aco: Fix some constant patterns in 16-bit vec4 construction with s_pack.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 21 Jul 2023 19:00:42 +0000 (21:00 +0200)
committerMarge Bot <emma+marge@anholt.net>
Sat, 22 Jul 2023 22:11:15 +0000 (22:11 +0000)
Fixes: 04e3d7ad930 ("aco: improve nir_op_vec with constant operands")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24286>

src/amd/compiler/aco_instruction_selection.cpp

index ea03e40..68e3c23 100644 (file)
@@ -1444,6 +1444,8 @@ visit_alu_instr(isel_context* ctx, nir_alu_instr* instr)
                else if (packed[i * 2].id())
                   packed[i] = bld.sop2(aco_opcode::s_pack_ll_b32_b16, bld.def(s1), packed[i * 2],
                                        Operand::c32(const_vals[i * 2 + 1]));
+               else
+                  packed[i] = Temp(); /* Both constants, so reset the entry */
 
                if (same)
                   const_vals[i] = const_vals[i * 2] | (const_vals[i * 2 + 1] << 16);