aco: fix neg(mul)/abs(mul) optimization with different bit-size

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14810>
This commit is contained in:
Rhys Perry 2022-01-31 18:28:59 +00:00 committed by Marge Bot
parent 13bbc7c882
commit 6b1dfa7eac
1 changed files with 2 additions and 0 deletions

View File

@ -3509,6 +3509,8 @@ combine_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
if (mul_instr->opcode == aco_opcode::v_mul_legacy_f32 &&
ctx.fp_mode.preserve_signed_zero_inf_nan32)
return;
if (mul_instr->definitions[0].bytes() != instr->definitions[0].bytes())
return;
/* convert to mul(neg(a), b), mul(abs(a), abs(b)) or mul(neg(abs(a)), abs(b)) */
ctx.uses[mul_instr->definitions[0].tempId()]--;