aco: allow overflow for some SMEM instructions
[mesa.git] / src / amd / compiler / aco_opcodes_cpp.py
index 83c24e0eb447b3b953d1cb53c1540f83e0c879e2..6678b102adc5a0ea7e91f5c50eaa7f6a560bbcd9 100644 (file)
@@ -28,19 +28,20 @@ template = """\
 
 namespace aco {
 
-const unsigned VOPC_to_GFX6[256] = {
-% for code in VOPC_GFX6:
-    ${code},
-% endfor
-};
 
 <%
 opcode_names = sorted(opcodes.keys())
 can_use_input_modifiers = "".join([opcodes[name].input_mod for name in reversed(opcode_names)])
 can_use_output_modifiers = "".join([opcodes[name].output_mod for name in reversed(opcode_names)])
+is_atomic = "".join([opcodes[name].is_atomic for name in reversed(opcode_names)])
 %>
 
 extern const aco::Info instr_info = {
+   .opcode_gfx7 = {
+      % for name in opcode_names:
+      ${opcodes[name].opcode_gfx7},
+      % endfor
+   },
    .opcode_gfx9 = {
       % for name in opcode_names:
       ${opcodes[name].opcode_gfx9},
@@ -53,6 +54,7 @@ extern const aco::Info instr_info = {
    },
    .can_use_input_modifiers = std::bitset<${len(opcode_names)}>("${can_use_input_modifiers}"),
    .can_use_output_modifiers = std::bitset<${len(opcode_names)}>("${can_use_output_modifiers}"),
+   .is_atomic = std::bitset<${len(opcode_names)}>("${is_atomic}"),
    .name = {
       % for name in opcode_names:
       "${name}",
@@ -63,12 +65,22 @@ extern const aco::Info instr_info = {
       aco::Format::${str(opcodes[name].format.name)},
       % endfor
    },
+   .operand_size = {
+      % for name in opcode_names:
+      ${opcodes[name].operand_size},
+      % endfor
+   },
+   .definition_size = {
+      % for name in opcode_names:
+      ${opcodes[name].definition_size},
+      % endfor
+   },
 };
 
 }
 """
 
-from aco_opcodes import opcodes, VOPC_GFX6
+from aco_opcodes import opcodes
 from mako.template import Template
 
-print(Template(template).render(opcodes=opcodes, VOPC_GFX6=VOPC_GFX6))
+print(Template(template).render(opcodes=opcodes))