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 <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
This commit is contained in:
Alyssa Rosenzweig 2020-12-07 20:01:11 -05:00 committed by Marge Bot
parent d47e0af56b
commit b45978c8e1

View file

@ -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