aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/compiler/aco_opcodes.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/amd/compiler/aco_opcodes.py')
-rw-r--r--src/amd/compiler/aco_opcodes.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/amd/compiler/aco_opcodes.py b/src/amd/compiler/aco_opcodes.py
index 08337a18d22..fb8617a8ec5 100644
--- a/src/amd/compiler/aco_opcodes.py
+++ b/src/amd/compiler/aco_opcodes.py
@@ -154,7 +154,7 @@ class Opcode(object):
"""Class that represents all the information we have about the opcode
NOTE: this must be kept in sync with aco_op_info
"""
- def __init__(self, name, opcode_gfx9, opcode_gfx10, format, input_mod, output_mod):
+ def __init__(self, name, opcode_gfx9, opcode_gfx10, format, input_mod, output_mod, is_atomic):
"""Parameters:
- name is the name of the opcode (prepend nir_op_ for the enum name)
@@ -177,6 +177,7 @@ class Opcode(object):
self.opcode_gfx10 = opcode_gfx10
self.input_mod = "1" if input_mod else "0"
self.output_mod = "1" if output_mod else "0"
+ self.is_atomic = "1" if is_atomic else "0"
self.format = format
@@ -186,9 +187,9 @@ opcodes = {}
# VOPC to GFX6 opcode translation map
VOPC_GFX6 = [0] * 256
-def opcode(name, opcode_gfx9 = -1, opcode_gfx10 = -1, format = Format.PSEUDO, input_mod = False, output_mod = False):
+def opcode(name, opcode_gfx9 = -1, opcode_gfx10 = -1, format = Format.PSEUDO, input_mod = False, output_mod = False, is_atomic = True):
assert name not in opcodes
- opcodes[name] = Opcode(name, opcode_gfx9, opcode_gfx10, format, input_mod, output_mod)
+ opcodes[name] = Opcode(name, opcode_gfx9, opcode_gfx10, format, input_mod, output_mod, is_atomic)
opcode("exp", 0, 0, format = Format.EXP)
opcode("p_parallelcopy")
@@ -584,7 +585,7 @@ SMEM = {
( -1, -1, -1, 0xac, 0xac, "s_atomic_dec_x2"),
}
for (gfx6, gfx7, gfx8, gfx9, gfx10, name) in SMEM:
- opcode(name, gfx9, gfx10, Format.SMEM)
+ opcode(name, gfx9, gfx10, Format.SMEM, is_atomic = "atomic" not in name)
# VOP2 instructions: 2 inputs, 1 output (+ optional vcc)
@@ -1261,7 +1262,7 @@ MUBUF = {
( -1, -1, -1, -1, 0x72, "buffer_gl1_inv"),
}
for (gfx6, gfx7, gfx8, gfx9, gfx10, name) in MUBUF:
- opcode(name, gfx9, gfx10, Format.MUBUF)
+ opcode(name, gfx9, gfx10, Format.MUBUF, is_atomic = "atomic" not in name)
MTBUF = {
(0x00, 0x00, 0x00, 0x00, 0x00, "tbuffer_load_format_x"),
@@ -1325,7 +1326,7 @@ IMAGE_ATOMIC = {
# (gfx6, gfx7, gfx8, gfx9, gfx10, name) = (gfx6, gfx7, gfx89, gfx89, ???, name)
# gfx7 and gfx10 opcodes are the same here
for (gfx6, gfx7, gfx89, name) in IMAGE_ATOMIC:
- opcode(name, gfx89, gfx7, Format.MIMG)
+ opcode(name, gfx89, gfx7, Format.MIMG, is_atomic = False)
IMAGE_SAMPLE = {
(0x20, "image_sample"),
@@ -1465,7 +1466,7 @@ FLAT = {
(0x60, -1, 0x60, "flat_atomic_fmax_x2"),
}
for (gfx7, gfx8, gfx10, name) in FLAT:
- opcode(name, gfx8, gfx10, Format.FLAT)
+ opcode(name, gfx8, gfx10, Format.FLAT, is_atomic = "atomic" not in name)
GLOBAL = {
#GFX8_9, GFX10
@@ -1525,7 +1526,7 @@ GLOBAL = {
( -1, 0x60, "global_atomic_fmax_x2"),
}
for (gfx8, gfx10, name) in GLOBAL:
- opcode(name, gfx8, gfx10, Format.GLOBAL)
+ opcode(name, gfx8, gfx10, Format.GLOBAL, is_atomic = "atomic" not in name)
SCRATCH = {
#GFX8_9, GFX10