[4/7] panfrost: Update extended branch disassembly

Submitted by Alyssa Rosenzweig on Feb. 18, 2019, 4:40 a.m.

Details

Message ID 20190218044006.4757-1-alyssa@rosenzweig.io
State New
Headers show
Series "panfrost: Improve branching in Midgard compiler" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Alyssa Rosenzweig Feb. 18, 2019, 4:40 a.m.
Partial support was previously included in the disassembler, but based
on a buggy form of the ISA. This corrects the disassembly. Additionally,
we now prefix extended branches with "brx", to visually differentiate
from compact branches prefixed with "br".

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
---
 src/gallium/drivers/panfrost/midgard/disassemble.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/panfrost/midgard/disassemble.c b/src/gallium/drivers/panfrost/midgard/disassemble.c
index afde3fdbbcd..7e5c5803f75 100644
--- a/src/gallium/drivers/panfrost/midgard/disassemble.c
+++ b/src/gallium/drivers/panfrost/midgard/disassemble.c
@@ -373,6 +373,10 @@  static void
 print_branch_op(int op)
 {
         switch (op) {
+        case midgard_jmp_writeout_op_branch_uncond:
+                printf("uncond.");
+                break;
+
         case midgard_jmp_writeout_op_branch_cond:
                 printf("cond.");
                 break;
@@ -412,6 +416,7 @@  print_branch_cond(int cond)
                 break;
 
         default:
+                printf("unk%X", cond);
                 break;
         }
 }
@@ -470,17 +475,13 @@  print_extended_branch_writeout_field(uint8_t *words)
         midgard_branch_extended br;
         memcpy((char *) &br, (char *) words, sizeof(br));
 
-        printf("br.");
+        printf("brx.");
 
         print_branch_op(br.op);
         print_branch_cond(br.cond);
 
-        /* XXX: This can't be right */
         if (br.unknown)
-                printf(".unknown%d\n", br.unknown);
-
-        if (br.zero)
-                printf(".zero%d\n", br.zero);
+                printf(".unknown%d", br.unknown);
 
         printf(" ");