aco: fix propagate_constants_vop3p with integer vop3p and 16-bit constants

This would have created a 1.0.xx operand from 0x3c00.xx or 0x3c003c00.xy
for vop3p instructions which have 32-bit operands.

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:
Rhys Perry
2022-05-02 13:10:47 +01:00
committed by Marge Bot
parent 9739c07d9e
commit ae74474509

View File

@@ -914,8 +914,11 @@ propagate_constants_vop3p(opt_ctx& ctx, aco_ptr<Instruction>& instr, ssa_info& i
/* try to fold inline constants */
VOP3P_instruction* vop3p = &instr->vop3p();
Operand const_lo = Operand::c16(info.val);
Operand const_hi = Operand::c16(info.val >> 16);
/* TODO: if bits==32, we might be able to get an inline constant if we sign-extend or shift left
* 16 bits.
*/
Operand const_lo = Operand::get_const(ctx.program->gfx_level, info.val & 0xffff, bits / 8u);
Operand const_hi = Operand::get_const(ctx.program->gfx_level, info.val >> 16, bits / 8u);
bool opsel_lo = (vop3p->opsel_lo >> i) & 1;
bool opsel_hi = (vop3p->opsel_hi >> i) & 1;