aco: add support for nir_intrinsic_shared_atomic_fadd
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 21 Jul 2020 08:44:29 +0000 (10:44 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 22 Jul 2020 08:01:59 +0000 (10:01 +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/6000>

src/amd/compiler/aco_instruction_selection.cpp
src/amd/compiler/aco_instruction_selection_setup.cpp

index 8e9d6bff89243037eb900ce7a621452012af6094..3145f719b46e7d6a4d3e40ee59d6690fe048375a 100644 (file)
@@ -6793,6 +6793,12 @@ void visit_shared_atomic(isel_context *ctx, nir_intrinsic_instr *instr)
          op64_rtn = aco_opcode::ds_cmpst_rtn_b64;
          num_operands = 4;
          break;
+      case nir_intrinsic_shared_atomic_fadd:
+         op32 = aco_opcode::ds_add_f32;
+         op32_rtn = aco_opcode::ds_add_rtn_f32;
+         op64 = aco_opcode::num_opcodes;
+         op64_rtn = aco_opcode::num_opcodes;
+         break;
       default:
          unreachable("Unhandled shared atomic intrinsic");
    }
@@ -7448,6 +7454,7 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr)
    case nir_intrinsic_shared_atomic_xor:
    case nir_intrinsic_shared_atomic_exchange:
    case nir_intrinsic_shared_atomic_comp_swap:
+   case nir_intrinsic_shared_atomic_fadd:
       visit_shared_atomic(ctx, instr);
       break;
    case nir_intrinsic_image_deref_load:
index a4901c1c06ec8b71a9a4f161a5a6c64df1d8bf7a..f557364239a2370116b23557940056c604508d67 100644 (file)
@@ -773,6 +773,7 @@ void init_context(isel_context *ctx, nir_shader *shader)
                   case nir_intrinsic_shared_atomic_xor:
                   case nir_intrinsic_shared_atomic_exchange:
                   case nir_intrinsic_shared_atomic_comp_swap:
+                  case nir_intrinsic_shared_atomic_fadd:
                   case nir_intrinsic_load_scratch:
                   case nir_intrinsic_load_invocation_id:
                   case nir_intrinsic_load_primitive_id: