panfrost: add support for atomics
authorItalo Nicola <italonicola@collabora.com>
Mon, 31 Aug 2020 17:32:30 +0000 (17:32 +0000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Sep 2020 21:04:09 +0000 (21:04 +0000)
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6439>

src/panfrost/midgard/midgard_compile.c

index 5c22ba7c45b8decbb6f038f18c80a8794c088555..a58701de75fbd9ac552da32afeab8ded29625ed1 100644 (file)
@@ -2061,6 +2061,17 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
                 schedule_barrier(ctx);
                 break;
 
+        ATOMIC_CASE(ctx, instr, add, add);
+        ATOMIC_CASE(ctx, instr, and, and);
+        ATOMIC_CASE(ctx, instr, comp_swap, cmpxchg);
+        ATOMIC_CASE(ctx, instr, exchange, xchg);
+        ATOMIC_CASE(ctx, instr, imax, imax);
+        ATOMIC_CASE(ctx, instr, imin, imin);
+        ATOMIC_CASE(ctx, instr, or, or);
+        ATOMIC_CASE(ctx, instr, umax, umax);
+        ATOMIC_CASE(ctx, instr, umin, umin);
+        ATOMIC_CASE(ctx, instr, xor, xor);
+
         default:
                 fprintf(stderr, "Unhandled intrinsic %s\n", nir_intrinsic_infos[instr->intrinsic].name);
                 assert(0);