diff --git a/src/panfrost/bifrost/gen_disasm.py b/src/panfrost/bifrost/gen_disasm.py index a4aa66a803b..f80a97fdcc1 100644 --- a/src/panfrost/bifrost/gen_disasm.py +++ b/src/panfrost/bifrost/gen_disasm.py @@ -25,7 +25,7 @@ import itertools from isa_parse import parse_instructions, opname_to_c, expand_states from mako.template import Template -instructions = parse_instructions(sys.argv[1]) +instructions = parse_instructions(sys.argv[1], include_unused = True) # Constructs a reserved mask for a derived to cull impossible encodings diff --git a/src/panfrost/bifrost/isa_parse.py b/src/panfrost/bifrost/isa_parse.py index 9b4e8a68583..c0dccbc23e5 100644 --- a/src/panfrost/bifrost/isa_parse.py +++ b/src/panfrost/bifrost/isa_parse.py @@ -96,7 +96,8 @@ def parse_instruction(ins): 'immediates': [], 'swaps': [], 'derived': [], - 'staging': ins.attrib.get('staging', '') + 'staging': ins.attrib.get('staging', ''), + 'unused': ins.attrib.get('unused', False), } if 'exact' in ins.attrib: @@ -146,12 +147,19 @@ def parse_instruction(ins): return variants -def parse_instructions(xml): +def parse_instructions(xml, include_unused = False): final = {} instructions = ET.parse(xml).getroot().findall('ins') for ins in instructions: - final[ins.attrib['name']] = parse_instruction(ins) + parsed = parse_instruction(ins) + + # Some instructions are for useful disassembly only and can be stripped + # out of the compiler, particularly useful for release builds + if parsed[0][1]["unused"] and not include_unused: + continue + + final[ins.attrib['name']] = parsed return final