aco: fix operand to scc when selecting SGPR ufind_msb/ifind_msb
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 23 Jan 2020 19:34:06 +0000 (19:34 +0000)
committerRhys Perry <pendingchaos02@gmail.com>
Mon, 27 Jan 2020 14:50:37 +0000 (14:50 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: 93c8ebfa78 ('aco: Initial commit of independent AMD compiler')
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3541>

src/amd/compiler/aco_instruction_selection.cpp

index 7ce8e5d8aabe2e57256012f107e582034b2bd9f5..17be816d0204606b9ae89d7b51a3c8041f8903bf 100644 (file)
@@ -1139,7 +1139,7 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr)
          Temp msb = sub.def(0).getTemp();
          Temp carry = sub.def(1).getTemp();
 
-         bld.sop2(aco_opcode::s_cselect_b32, Definition(dst), Operand((uint32_t)-1), msb, carry);
+         bld.sop2(aco_opcode::s_cselect_b32, Definition(dst), Operand((uint32_t)-1), msb, bld.scc(carry));
       } else if (src.regClass() == v1) {
          aco_opcode op = instr->op == nir_op_ufind_msb ? aco_opcode::v_ffbh_u32 : aco_opcode::v_ffbh_i32;
          Temp msb_rev = bld.tmp(v1);