From b45978c8e1c0af55f31f18c51444b5f670aa1f74 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 7 Dec 2020 20:01:11 -0500 Subject: [PATCH] pan/bi: Add pseudo-instruction mechanism Useful for instructions that need to be modeled in the IR (with support in the builder and printer) but will always be lowered away before packing since they don't correspond to anything real. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/isa_parse.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/isa_parse.py b/src/panfrost/bifrost/isa_parse.py index c0dccbc23e5..7d927e2c727 100644 --- a/src/panfrost/bifrost/isa_parse.py +++ b/src/panfrost/bifrost/isa_parse.py @@ -98,6 +98,7 @@ def parse_instruction(ins): 'derived': [], 'staging': ins.attrib.get('staging', ''), 'unused': ins.attrib.get('unused', False), + 'pseudo': ins.attrib.get('pseudo', False), } if 'exact' in ins.attrib: @@ -147,7 +148,7 @@ def parse_instruction(ins): return variants -def parse_instructions(xml, include_unused = False): +def parse_instructions(xml, include_unused = False, include_pseudo = False): final = {} instructions = ET.parse(xml).getroot().findall('ins') @@ -159,6 +160,10 @@ def parse_instructions(xml, include_unused = False): if parsed[0][1]["unused"] and not include_unused: continue + # On the other hand, some instructions are only for the IR, not disassembly + if parsed[0][1]["pseudo"] and not include_pseudo: + continue + final[ins.attrib['name']] = parsed return final