From 73f54f286ae7d20144822c2e2758f1d703017c43 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 5 Aug 2019 17:52:56 -0700 Subject: [PATCH] pan/midgard: Print mask in dumped MIR Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_print.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/panfrost/midgard/midgard_print.c b/src/panfrost/midgard/midgard_print.c index a6152607233..d5a429ae2ac 100644 --- a/src/panfrost/midgard/midgard_print.c +++ b/src/panfrost/midgard/midgard_print.c @@ -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(", "); -- 2.30.2