ast_propagate_effects(self, left);
ast_propagate_effects(self, right);
- /*
- * Try to fold away superfluous binary operations, such as:
- * A * 1, a + 0, etc.
- */
if (OPTS_OPTIMIZATION(OPTIM_PEEPHOLE) && (fold = (ast_binary*)fold_superfluous(left, right, op))) {
ast_binary_delete(self);
return fold;
else
self->expression.vtype = TYPE_FLOAT;
}
- else if (op == INSTR_BITAND || op == INSTR_BITOR || op == INSTR_MUL_F)
+ else if (op == INSTR_BITAND || op == INSTR_BITOR)
self->expression.vtype = TYPE_FLOAT;
- else if (op >= INSTR_MUL_V && op <= INSTR_MUL_VF)
+ else if (op == INSTR_MUL_VF || op == INSTR_MUL_FV)
self->expression.vtype = TYPE_VECTOR;
+ else if (op == INSTR_MUL_V)
+ self->expression.vtype = TYPE_FLOAT;
else
self->expression.vtype = left->vtype;
(op >= INSTR_NOT_F && op <= INSTR_NOT_FNC) ||
(op >= INSTR_AND && op <= INSTR_BITOR) ||
(op >= INSTR_CALL0 && op <= INSTR_CALL8) ||
- (op >= VINSTR_BITAND_V && op <= VINSTR_CROSS) );
+ (op >= VINSTR_BITAND_V && op <= VINSTR_NEG_V) );
}
static bool ir_function_pass_peephole(ir_function *self)
case VINSTR_BITOR_VF: return "BITOR_VF";
case VINSTR_BITXOR_VF: return "BITXOR_VF";
case VINSTR_CROSS: return "CROSS";
+ case VINSTR_NEG_F: return "NEG_F";
+ case VINSTR_NEG_V: return "NEG_V";
default: return "<UNK>";
}
}
echo -n " compiling $dir... "
old="$PWD"
cd "$dir"
- "$gmqcc_bin" $(cat ../../../options | grep "$line:" | awk '{print substr($0, index($0, $2))}') > /dev/null 2>&1
+ cmd="$(cat ../../../options | grep "$line:" | awk '{print substr($0, index($0, $2))}')"
+ "$gmqcc_bin" $cmd > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "error"
else
done
# nope only one project
else
- "$gmqcc_bin" $(cat ../../options | grep "$line:" | awk '{print substr($0, index($0, $2))}') > /dev/null 2>&1
+ echo "$gmqcc_bin" $(cat ../../options | grep "$line:" | awk '{print substr($0, index($0, $2))}')
+ cmd="$(cat ../../options | grep "$line:" | awk '{print substr($0, index($0, $2))}')"
+ "$gmqcc_bin" $cmd > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "error"
else