From cffc1d90da0d03e1ec90b1fff2e35cc0f5fee390 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 23 Dec 2020 11:30:17 -0500 Subject: [PATCH] pan/bi: Add staging register counts to ISA.xml Message-passing instructions that read/write staging registers access either: * a fixed number of registers * vecsize registers (/2 for LD/ST_CVT if register_format is 16-bit) * a computed number for TEXC This adds the fixed counts into the XML for the first type and space to specify the latter types. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/ISA.xml | 106 ++++++++++++++++-------------- src/panfrost/bifrost/isa_parse.py | 13 ++-- 2 files changed, 64 insertions(+), 55 deletions(-) diff --git a/src/panfrost/bifrost/ISA.xml b/src/panfrost/bifrost/ISA.xml index 2541130b098..bdfff876e36 100644 --- a/src/panfrost/bifrost/ISA.xml +++ b/src/panfrost/bifrost/ISA.xml @@ -2454,31 +2454,31 @@ - + - + - + - + - + @@ -2489,19 +2489,21 @@ - + + + - + - + @@ -2509,7 +2511,7 @@ - + @@ -6191,7 +6193,7 @@ - + @@ -6230,7 +6232,7 @@ - + @@ -6269,7 +6271,7 @@ - + @@ -6308,7 +6310,7 @@ - + @@ -6320,7 +6322,7 @@ - + @@ -6333,7 +6335,7 @@ - + @@ -6345,7 +6347,7 @@ - + @@ -6486,7 +6488,7 @@ - + none @@ -6539,7 +6541,7 @@ - + none @@ -6592,7 +6594,7 @@ - + @@ -6733,7 +6735,7 @@ - + point @@ -6919,7 +6921,7 @@ - + @@ -6952,7 +6954,7 @@ - + @@ -6985,7 +6987,7 @@ - + @@ -7018,7 +7020,7 @@ - + @@ -7028,7 +7030,7 @@ - + @@ -7038,7 +7040,7 @@ - + @@ -7053,7 +7055,7 @@ - + @@ -7112,7 +7114,7 @@ - + @@ -7127,7 +7129,7 @@ - + @@ -7164,7 +7166,7 @@ - + @@ -7179,7 +7181,7 @@ - + @@ -7194,7 +7196,7 @@ - + @@ -7278,7 +7280,7 @@ - + @@ -7492,7 +7494,7 @@ - + @@ -7507,7 +7509,7 @@ - + @@ -7522,7 +7524,7 @@ - + @@ -7537,7 +7539,7 @@ - + @@ -7552,7 +7554,7 @@ - + @@ -7567,7 +7569,7 @@ - + @@ -7582,7 +7584,7 @@ - + @@ -7597,7 +7599,7 @@ - + @@ -7612,7 +7614,7 @@ - + @@ -7624,7 +7626,7 @@ - + @@ -7660,14 +7662,16 @@ - + + + - + @@ -7679,7 +7683,7 @@ - + @@ -7691,7 +7695,7 @@ - + @@ -7700,7 +7704,7 @@ - + @@ -8022,7 +8026,7 @@ - + @@ -8052,7 +8056,7 @@ - + @@ -8111,7 +8115,7 @@ - + diff --git a/src/panfrost/bifrost/isa_parse.py b/src/panfrost/bifrost/isa_parse.py index f0824d09e16..c05ce55b5f9 100644 --- a/src/panfrost/bifrost/isa_parse.py +++ b/src/panfrost/bifrost/isa_parse.py @@ -89,14 +89,15 @@ def parse_copy(enc, existing): if ex[0][0] == name: ex[0][1] = node.get('start') -def parse_instruction(ins): +def parse_instruction(ins, include_pseudo): common = { 'srcs': [], 'modifiers': [], 'immediates': [], 'swaps': [], 'derived': [], - 'staging': ins.attrib.get('staging', ''), + 'staging': ins.attrib.get('staging', '').split('=')[0], + 'staging_count': ins.attrib.get('staging', '=0').split('=')[1], 'unused': ins.attrib.get('unused', False), 'pseudo': ins.attrib.get('pseudo', False), 'message': ins.attrib.get('message', 'none'), @@ -110,7 +111,11 @@ def parse_instruction(ins): common['srcs'].append([int(src.attrib['start'], 0), mask]) for imm in ins.findall('immediate'): - common['immediates'].append([imm.attrib['name'], int(imm.attrib['start']), int(imm.attrib['size'])]) + if imm.attrib.get('pseudo', False) and not include_pseudo: + continue + + start = int(imm.attrib['start']) if 'start' in imm.attrib else None + common['immediates'].append([imm.attrib['name'], start, int(imm.attrib['size'])]) common['derived'] = parse_derived(ins) common['modifiers'] = parse_modifiers(ins) @@ -154,7 +159,7 @@ def parse_instructions(xml, include_unused = False, include_pseudo = False): instructions = ET.parse(xml).getroot().findall('ins') for ins in instructions: - parsed = parse_instruction(ins) + parsed = parse_instruction(ins, include_pseudo) # Some instructions are for useful disassembly only and can be stripped # out of the compiler, particularly useful for release builds