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>
/* 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 */