diff --git a/src/asahi/compiler/agx_opcodes.c.py b/src/asahi/compiler/agx_opcodes.c.py index b981feaaf10..ab47066f58b 100644 --- a/src/asahi/compiler/agx_opcodes.c.py +++ b/src/asahi/compiler/agx_opcodes.c.py @@ -45,6 +45,7 @@ const struct agx_opcode_info agx_opcodes_info[AGX_NUM_OPCODES] = { ${make_encoding(op.encoding_16)}, ${int(op.is_float)}, ${int(op.can_eliminate)}, + ${int(op.can_reorder)}, }, % endfor }; diff --git a/src/asahi/compiler/agx_opcodes.h.py b/src/asahi/compiler/agx_opcodes.h.py index 9b7b7b90fdb..81e1a749d99 100644 --- a/src/asahi/compiler/agx_opcodes.h.py +++ b/src/asahi/compiler/agx_opcodes.h.py @@ -82,6 +82,7 @@ struct agx_opcode_info { struct agx_encoding encoding_16; bool is_float : 1; bool can_eliminate : 1; + bool can_reorder : 1; }; extern const struct agx_opcode_info agx_opcodes_info[AGX_NUM_OPCODES]; diff --git a/src/asahi/compiler/agx_opcodes.py b/src/asahi/compiler/agx_opcodes.py index 7900d745a94..c86463f742c 100644 --- a/src/asahi/compiler/agx_opcodes.py +++ b/src/asahi/compiler/agx_opcodes.py @@ -29,7 +29,7 @@ VARIABLE = ~0 class Opcode(object): def __init__(self, name, dests, srcs, imms, is_float, can_eliminate, - encoding_16, encoding_32): + can_reorder, encoding_16, encoding_32): self.name = name self.dests = dests if dests != VARIABLE else 0 self.srcs = srcs if srcs != VARIABLE else 0 @@ -38,6 +38,7 @@ class Opcode(object): self.imms = imms self.is_float = is_float self.can_eliminate = can_eliminate + self.can_reorder = can_reorder self.encoding_16 = encoding_16 self.encoding_32 = encoding_32 @@ -63,11 +64,11 @@ class Encoding(object): assert(length_long == length_short + (4 if length_short > 8 else 2)) def op(name, encoding_32, dests = 1, srcs = 0, imms = [], is_float = False, - can_eliminate = True, encoding_16 = None): + can_eliminate = True, can_reorder = True, encoding_16 = None): encoding_16 = Encoding(encoding_16) if encoding_16 is not None else None encoding_32 = Encoding(encoding_32) if encoding_32 is not None else None - opcodes[name] = Opcode(name, dests, srcs, imms, is_float, can_eliminate, encoding_16, encoding_32) + opcodes[name] = Opcode(name, dests, srcs, imms, is_float, can_eliminate, can_reorder, encoding_16, encoding_32) def immediate(name, ctype = "uint32_t"): imm = Immediate(name, ctype) @@ -222,7 +223,7 @@ op("texture_load", # sources are base, index op("device_load", encoding_32 = (0x05, 0x7F, 6, 8), - srcs = 2, imms = [FORMAT, MASK, SCOREBOARD]) + srcs = 2, imms = [FORMAT, MASK, SCOREBOARD], can_reorder = False) # sources are value, index # TODO: Consider permitting the short form @@ -238,7 +239,7 @@ op("get_sr", (0x72, 0x7F | L, 4, _), dests = 1, imms = [SR]) op("sample_mask", (0x7fc1, 0xffff, 6, _), dests = 0, srcs = 1, can_eliminate = False) # Essentially same encoding -op("ld_tile", (0x49, 0x7F, 8, _), dests = 1, srcs = 0, imms = [FORMAT, MASK]) +op("ld_tile", (0x49, 0x7F, 8, _), dests = 1, srcs = 0, imms = [FORMAT, MASK], can_reorder = False) op("st_tile", (0x09, 0x7F, 8, _), dests = 0, srcs = 1, can_eliminate = False, imms = [FORMAT, MASK])