X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=ir.c;h=4c41c8c478e82532395d354b10fab01687723c95;hb=0f190026e8a0c3612dc619d83cb40d27b1ddea23;hp=a641310644dc950712894eef33cfe9965c9c1d09;hpb=7fc88cfe5b53e6c9740f48335206d5a2b7d03bcb;p=xonotic%2Fgmqcc.git diff --git a/ir.c b/ir.c index a641310..4c41c8c 100644 --- a/ir.c +++ b/ir.c @@ -600,6 +600,13 @@ bool ir_function_pass_peephole(ir_function *self) if (!instr_is_operation(oper->opcode)) continue; + if (OPTS_FLAG(LEGACY_VECTOR_MATHS)) { + if (oper->opcode == INSTR_MUL_VF && oper->_ops[2]->memberof == oper->_ops[1]) + continue; + if (oper->opcode == INSTR_MUL_FV && oper->_ops[1]->memberof == oper->_ops[2]) + continue; + } + value = oper->_ops[0]; /* only do it for SSA values */ @@ -2554,7 +2561,7 @@ static bool ir_block_life_propagate(ir_block *self, ir_block *prev, bool *change if (value->memberof && ir_value_life_merge(value->memberof, instr->eid+1)) *changed = true; } - else if (instr->opcode == INSTR_MUL_FV) + else if (instr->opcode == INSTR_MUL_FV || instr->opcode == INSTR_LOAD_V) { value = instr->_ops[1]; /* the float source will get an additional lifetime */