From 8e8805b212dd7e21b1ec28888ef7fbf477c5213f Mon Sep 17 00:00:00 2001 From: Italo Nicola Date: Thu, 20 Aug 2020 13:35:07 +0000 Subject: [PATCH] panfrost: add atomic_cmpxchg opcode Signed-off-by: Italo Nicola Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/midgard/midgard.h | 3 +++ src/panfrost/midgard/midgard_ops.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/panfrost/midgard/midgard.h b/src/panfrost/midgard/midgard.h index 656881c7ff3..1471603d964 100644 --- a/src/panfrost/midgard/midgard.h +++ b/src/panfrost/midgard/midgard.h @@ -456,6 +456,9 @@ typedef enum { midgard_op_atomic_xchg = 0x60, midgard_op_atomic_xchg64 = 0x61, + midgard_op_atomic_cmpxchg = 0x64, + midgard_op_atomic_cmpxchg64 = 0x65, + /* Used for compute shader's __global arguments, __local variables (or * for register spilling) */ diff --git a/src/panfrost/midgard/midgard_ops.c b/src/panfrost/midgard/midgard_ops.c index b56d3730bab..ef30523bc1a 100644 --- a/src/panfrost/midgard/midgard_ops.c +++ b/src/panfrost/midgard/midgard_ops.c @@ -197,6 +197,7 @@ struct mir_ldst_op_props load_store_opcode_props[256] = { [midgard_op_atomic_imax] = {"atomic_imax", M32 | LDST_SIDE_FX}, [midgard_op_atomic_umax] = {"atomic_umax", M32 | LDST_SIDE_FX}, [midgard_op_atomic_xchg] = {"atomic_xchg", M32 | LDST_SIDE_FX}, + [midgard_op_atomic_cmpxchg] = {"atomic_cmpxchg", M32 | LDST_SIDE_FX}, [midgard_op_atomic_add64] = {"atomic_add64", M64 | LDST_SIDE_FX}, [midgard_op_atomic_and64] = {"atomic_and64", M64 | LDST_SIDE_FX}, @@ -207,6 +208,7 @@ struct mir_ldst_op_props load_store_opcode_props[256] = { [midgard_op_atomic_imax64] = {"atomic_imax64", M64 | LDST_SIDE_FX}, [midgard_op_atomic_umax64] = {"atomic_umax64", M64 | LDST_SIDE_FX}, [midgard_op_atomic_xchg64] = {"atomic_xchg64", M64 | LDST_SIDE_FX}, + [midgard_op_atomic_cmpxchg64] = {"atomic_cmpxchg64", M64 | LDST_SIDE_FX}, [midgard_op_ld_uchar] = {"ld_uchar", M32 | LDST_ADDRESS}, [midgard_op_ld_char] = {"ld_char", M32 | LDST_ADDRESS}, -- 2.30.2