aco: fix nir_intrinsic_quad_* with 8-bit in GFX6-GFX7
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 4 Jun 2020 08:39:51 +0000 (10:39 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 5 Jun 2020 14:04:06 +0000 (16:04 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5327>

src/amd/compiler/aco_instruction_selection.cpp

index fed67bf7a9f57b3d73c781205301214c32b0f7f2..ccfb17eb6708555d3eadf983da670930cdc0b5d6 100644 (file)
@@ -7761,7 +7761,10 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr)
             emit_wqm(ctx, tmp, dst);
          } else if (instr->dest.ssa.bit_size == 8) {
             Temp tmp = bld.tmp(v1);
-            emit_wqm(ctx, bld.vop1_dpp(aco_opcode::v_mov_b32, bld.def(v1), src, dpp_ctrl), tmp);
+            if (ctx->program->chip_class >= GFX8)
+               emit_wqm(ctx, bld.vop1_dpp(aco_opcode::v_mov_b32, bld.def(v1), src, dpp_ctrl), tmp);
+            else
+               emit_wqm(ctx, bld.ds(aco_opcode::ds_swizzle_b32, bld.def(v1), src, (1 << 15) | dpp_ctrl), tmp);
             bld.pseudo(aco_opcode::p_split_vector, Definition(dst), bld.def(v3b), tmp);
          } else if (instr->dest.ssa.bit_size == 16) {
             Temp tmp = bld.tmp(v1);
@@ -7836,7 +7839,10 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr)
          emit_wqm(ctx, tmp, dst);
       } else if (instr->dest.ssa.bit_size == 8) {
          Temp tmp = bld.tmp(v1);
-         emit_wqm(ctx, bld.vop1_dpp(aco_opcode::v_mov_b32, bld.def(v1), src, dpp_ctrl), tmp);
+         if (ctx->program->chip_class >= GFX8)
+            emit_wqm(ctx, bld.vop1_dpp(aco_opcode::v_mov_b32, bld.def(v1), src, dpp_ctrl), tmp);
+         else
+            emit_wqm(ctx, bld.ds(aco_opcode::ds_swizzle_b32, bld.def(v1), src, dpp_ctrl), tmp);
          bld.pseudo(aco_opcode::p_split_vector, Definition(dst), bld.def(v3b), tmp);
       } else if (instr->dest.ssa.bit_size == 16) {
          Temp tmp = bld.tmp(v1);