aco: fix 64bit fsub
authorDaniel Schürmann <daniel@schuermann.dev>
Mon, 20 Apr 2020 11:59:21 +0000 (12:59 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 20 Apr 2020 15:12:50 +0000 (15:12 +0000)
Fixes: 425558bfd595ed3a7a049ad0f47a46b8b3c4691e ('aco: use v_subrev_f32 for fsub with an sgpr operand in src1')
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4642>

src/amd/compiler/aco_instruction_selection.cpp

index af1a5e4f1119240f53c323ed47fa70d5ce77c81a..1043bb2d2c0dbf54e8bb15104cedbf970df1385b 100644 (file)
@@ -1654,7 +1654,7 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr)
             emit_vop2_instruction(ctx, instr, aco_opcode::v_subrev_f32, dst, true);
       } else if (dst.regClass() == v2) {
          Instruction* add = bld.vop3(aco_opcode::v_add_f64, Definition(dst),
-                                     src0, src1);
+                                     as_vgpr(ctx, src0), as_vgpr(ctx, src1));
          VOP3A_instruction* sub = static_cast<VOP3A_instruction*>(add);
          sub->neg[1] = true;
       } else {