From 3485b8dc78d8515665158c606b48e7ce21eae1f2 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 23 Mar 2022 18:12:31 -0400 Subject: [PATCH] pan/bi: Use consistent modifier lists in packing If there are modifiers only used by pseudo instructions, not the real instructions, bi_packer can get out-of-sync with bi_opcodes, causing hard-to-debug issues. Do the stupid-simple thing to ensure this doesn't happen. This may be a temporary issue, depending whether ISA.xml and the IR get split out for better Valhall support. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_packer.c.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bi_packer.c.py b/src/panfrost/bifrost/bi_packer.c.py index c014519f5cc..601750e2aa3 100644 --- a/src/panfrost/bifrost/bi_packer.c.py +++ b/src/panfrost/bifrost/bi_packer.c.py @@ -24,9 +24,14 @@ import sys from bifrost_isa import * from mako.template import Template +# Consider pseudo instructions when getting the modifier list +instructions_with_pseudo = parse_instructions(sys.argv[1], include_pseudo = True) +ir_instructions_with_pseudo = partition_mnemonics(instructions_with_pseudo) +modifier_lists = order_modifiers(ir_instructions_with_pseudo) + +# ...but strip for packing instructions = parse_instructions(sys.argv[1]) ir_instructions = partition_mnemonics(instructions) -modifier_lists = order_modifiers(ir_instructions) # Packs sources into an argument. Offset argument to work around a quirk of our # compiler IR when dealing with staging registers (TODO: reorder in the IR to