X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Famd%2Fcompiler%2Faco_opcodes_cpp.py;h=6678b102adc5a0ea7e91f5c50eaa7f6a560bbcd9;hb=ae6330d955ed9e5a6c9a0ce12a11a08b95830bff;hp=83c24e0eb447b3b953d1cb53c1540f83e0c879e2;hpb=93c8ebfa780ebd1495095e794731881aef29e7d3;p=mesa.git diff --git a/src/amd/compiler/aco_opcodes_cpp.py b/src/amd/compiler/aco_opcodes_cpp.py index 83c24e0eb44..6678b102adc 100644 --- a/src/amd/compiler/aco_opcodes_cpp.py +++ b/src/amd/compiler/aco_opcodes_cpp.py @@ -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))