self->return_value = NULL;
return self;
-
+
cleanup:
mem_d(self);
return NULL;
/* From 'bin' we jump to whatever comes first */
if (bprecond) tmpblock = bprecond;
else tmpblock = bbody; /* can never be null */
-
+
/* DEAD CODE
else if (bpostcond) tmpblock = bpostcond;
else tmpblock = bout;
*/
-
+
if (!ir_block_create_jump(bin, ast_ctx(self), tmpblock))
return false;
ir_block *ontrue, *onfalse;
ontrue = bbody; /* can never be null */
- /* all of this is dead code
+ /* all of this is dead code
else if (bincrement) ontrue = bincrement;
else ontrue = bpostcond;
*/
if (bprecond) ontrue = bprecond;
else ontrue = bbody; /* can never be null */
- /* all of this is dead code
+ /* all of this is dead code
else if (bincrement) ontrue = bincrement;
else ontrue = bpostcond;
*/
default:
/* ranges: */
/* boolean operations result in floats */
-
+
/*
* opcode >= 10 takes true branch opcode is at least 10
* opcode <= 23 takes false branch opcode is at least 24
*/
if (opcode >= INSTR_EQ_F && opcode <= INSTR_GT)
ot = TYPE_FLOAT;
-
- /*
- * At condition "opcode <= 23", the value of "opcode" must be
+
+ /*
+ * At condition "opcode <= 23", the value of "opcode" must be
* at least 24.
* At condition "opcode <= 23", the value of "opcode" cannot be
* equal to any of {1, 2, 3, 4, 5, 6, 7, 8, 9, 62, 63, 64, 65}.
* The condition "opcode <= 23" cannot be true.
- *
+ *
* Thus ot=2 (TYPE_FLOAT) can never be true
*/
#if 0
/* there should just be this one nil */
ir_value *nil;
ir_value *reserved_va_count;
-
+
/* code generator */
code_t *code;
} ir_builder;
if (!line[0] || (line[0] == '/' && line[1] == '/'))
continue;
-
+
if (hasline) {
item.filename = util_strdup(line);
item.type = TYPE_QC;
* Further more, the only time it is legal to do XOR otherwise
* is when both operand are floats. This nicely crafted if
* statement catches them all.
- *
+ *
* In the event that the first operand is a vector, two
* possible situations can arise, thus, each element of
* vector A (operand A) is exclusive-ORed with the corresponding
* element of vector B (operand B), If B is scalar, the
* scalar value is first replicated for each element.
- *
+ *
* The QCVM itself lacks a BITXOR instruction. Thus emulating
* the mathematics of it is required. The following equation
* is used: (LHS | RHS) & ~(LHS & RHS). However, due to the
* QCVM also lacking a BITNEG instruction, we need to emulate
* ~FOO with -1 - FOO, the whole process becoming this nicely
* crafted expression: (LHS | RHS) & (-1 - (LHS & RHS)).
- *
+ *
* When A is not scalar, this process is repeated for all
* components of vector A with the value in operand B,
* only if operand B is scalar. When A is not scalar, and B
* components of the vector A with the components of vector B.
* Finally when A is scalar and B is scalar, this process is
* simply used once for A and B being LHS and RHS respectfully.
- *
+ *
* Yes the semantics are a bit strange (no pun intended).
* But then again BITXOR is strange itself, consdering it's
* commutative, assocative, and elements of the BITXOR operation
)
);
expr->refs = AST_REF_NONE;
-
+
out = (ast_expression*)
ast_binary_new(
ctx,
}
}
}
-
+
break;
case opid2('<','<'):
ast_value_delete(parser->const_vec[0]);
ast_value_delete(parser->const_vec[1]);
ast_value_delete(parser->const_vec[2]);
-
+
if (parser->reserved_version)
ast_value_delete(parser->reserved_version);
* This is a patched version of the Murmur2 hashing function to use
* a proper pre-mix and post-mix setup. Infact this is Murmur3 for
* the most part just reinvented.
- *
+ *
* Murmur 2 contains an inner loop such as:
* while (l >= 4) {
* u32 k = *(u32*)d;
* k *= m;
* k ^= k >> r;
* k *= m;
- *
+ *
* h *= m;
* h ^= k;
* d += 4;
* l -= 4;
* }
- *
+ *
* The two u32s that form the key are the same value x (pulled from data)
* this premix stage will perform the same results for both values. Unrolled
* this produces just:
* h ^= x;
* h *= m;
* h ^= x;
- *
+ *
* This appears to be fine, except what happens when m == 1? well x
* cancels out entierly, leaving just:
* x ^= x >> r;
* h ^= x;
* h ^= x;
- *
+ *
* So all keys hash to the same value, but how often does m == 1?
* well, it turns out testing x for all possible values yeilds only
* 172,013,942 unique results instead of 2^32. So nearly ~4.6 bits
* are cancelled out on average!
- *
+ *
* This means we have a 14.5% (rounded) chance of colliding more, which
* results in another bucket/chain for the hashtable.
*