aco: fix redirect combine in propagate_constants_vop3p() with negatives
This previously didn't correctly consider negative integers when bits=16 (which sign-extend) and would have combined 0xfffe0000.xy as -2.yx. Now it combines 0xfffeffff.xy as that instead. It was also skipped when bits=32. 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/16296>
This commit is contained in:
@@ -949,12 +949,7 @@ propagate_constants_vop3p(opt_ctx& ctx, aco_ptr<Instruction>& instr, ssa_info& i
|
||||
/* opsel must point to lo for both halves */
|
||||
vop3p->opsel_lo &= ~(1 << i);
|
||||
vop3p->opsel_hi &= ~(1 << i);
|
||||
} else if (const_lo == Operand::c16(0)) {
|
||||
/* don't inline FP constants into integer instructions */
|
||||
// TODO: check if negative integers are zero- or sign-extended
|
||||
if (bits == 32 && const_hi.constantValue() > 64u)
|
||||
return;
|
||||
|
||||
} else if (const_lo.constantValue() == const_hi.constantValue16(true)) {
|
||||
instr->operands[i] = const_hi;
|
||||
|
||||
/* redirect opsel selection */
|
||||
|
Reference in New Issue
Block a user