pan/midgard: Print mask in dumped MIR
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 6 Aug 2019 00:52:56 +0000 (17:52 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 12 Aug 2019 19:43:01 +0000 (12:43 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard_print.c

index a61526072333d5108ccdead2e92d8af6fa1134d0..d5a429ae2ac333ea550308301800706d8651ec90 100644 (file)
@@ -48,6 +48,19 @@ mir_print_source(int source)
         }
 }
 
+static const char components[16] = "xyzwefghijklmnop";
+
+static void
+mir_print_mask(unsigned mask)
+{
+        printf(".");
+
+        for (unsigned i = 0; i < 16; ++i) {
+                if (mask & (1 << i))
+                        putchar(components[i]);
+        }
+}
+
 void
 mir_print_instruction(midgard_instruction *ins)
 {
@@ -88,7 +101,12 @@ mir_print_instruction(midgard_instruction *ins)
 
         ssa_args *args = &ins->ssa_args;
 
-        printf(" %d, ", args->dest);
+        printf(" %d", args->dest);
+
+        if (ins->mask != 0xF)
+                mir_print_mask(ins->mask);
+
+        printf(", ");
 
         mir_print_source(args->src[0]);
         printf(", ");