aco: implement 64bit i2b for SI /CI
authorDaniel Schürmann <daniel@schuermann.dev>
Fri, 15 Nov 2019 07:20:06 +0000 (08:20 +0100)
committerDaniel Schürmann <daniel@schuermann.dev>
Sat, 7 Dec 2019 10:23:11 +0000 (11:23 +0100)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
src/amd/compiler/aco_instruction_selection.cpp

index 85ed7b3bf6186e24081a4a0da2076cbb58779687..82b6989bb72ee32d7384b223fbf91448532f1e53 100644 (file)
@@ -2115,8 +2115,13 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr)
                   Definition(dst), Operand(0u), src).def(0).setHint(vcc);
       } else {
          assert(src.regClass() == s1 || src.regClass() == s2);
-         Temp tmp = bld.sopc(src.size() == 2 ? aco_opcode::s_cmp_lg_u64 : aco_opcode::s_cmp_lg_u32,
-                             bld.scc(bld.def(s1)), Operand(0u), src);
+         Temp tmp;
+         if (src.regClass() == s2 && ctx->program->chip_class <= GFX7) {
+            tmp = bld.sop2(aco_opcode::s_or_b64, bld.def(s2), bld.def(s1, scc), Operand(0u), src).def(1).getTemp();
+         } else {
+            tmp = bld.sopc(src.size() == 2 ? aco_opcode::s_cmp_lg_u64 : aco_opcode::s_cmp_lg_u32,
+                           bld.scc(bld.def(s1)), Operand(0u), src);
+         }
          bool_to_vector_condition(ctx, tmp, dst);
       }
       break;