pan/bi: Space out disassembly
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 16 Dec 2020 20:06:56 +0000 (15:06 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 21 Dec 2020 21:54:50 +0000 (21:54 +0000)
Makes things much more legible with some "room to breathe".

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8139>

src/panfrost/bifrost/disassemble.c
src/panfrost/bifrost/gen_disasm.py

index 1bc33de..49bde8c 100644 (file)
@@ -162,7 +162,7 @@ static struct bifrost_reg_ctrl DecodeRegCtrl(FILE *fp, struct bifrost_regs regs,
 static void dump_regs(FILE *fp, struct bifrost_regs srcs, bool first)
 {
         struct bifrost_reg_ctrl ctrl = DecodeRegCtrl(fp, srcs, first);
-        fprintf(fp, "# ");
+        fprintf(fp, "    # ");
         if (ctrl.read_reg0)
                 fprintf(fp, "slot 0: r%d ", get_reg0(srcs));
         if (ctrl.read_reg1)
@@ -664,7 +664,7 @@ static bool dump_clause(FILE *fp, uint32_t *words, unsigned *size, unsigned offs
                 memcpy((char *) &regs, (char *) &instrs[i].reg_bits, sizeof(regs));
 
                 if (verbose) {
-                        fprintf(fp, "# regs: %016" PRIx64 "\n", instrs[i].reg_bits);
+                        fprintf(fp, "    # regs: %016" PRIx64 "\n", instrs[i].reg_bits);
                         dump_regs(fp, regs, i == 0);
                 }
 
@@ -684,6 +684,8 @@ static bool dump_clause(FILE *fp, uint32_t *words, unsigned *size, unsigned offs
                         fprintf(fp, "# const%d: %08" PRIx64 "\n", 2 * i + 1, consts.raw[i] >> 32);
                 }
         }
+
+        fprintf(fp, "\n");
         return stopbit;
 }
 
index 4df7b1b..a4aa66a 100644 (file)
@@ -66,6 +66,8 @@ def decode_op(instructions, is_fma):
     template = """void
 bi_disasm_${unit}(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
 {
+    fputs("    ", fp);
+
 % for (i, (name, (emask, ebits), derived)) in enumerate(options):
 % if len(derived) > 0:
     ${"else " if i > 0 else ""}if (unlikely(((bits & ${hex(emask)}) == ${hex(ebits)})