From ba8ec19a64b7c58f504f8573b07ecf667b9a7fab Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 5 Aug 2019 17:58:52 -0700 Subject: [PATCH] pan/midgard: Pretty-print units Since we are seeing some use of MIR post-scheduling, let's get this printed right. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_print.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/panfrost/midgard/midgard_print.c b/src/panfrost/midgard/midgard_print.c index d5a429ae2ac..bf26bf70b2c 100644 --- a/src/panfrost/midgard/midgard_print.c +++ b/src/panfrost/midgard/midgard_print.c @@ -61,6 +61,29 @@ mir_print_mask(unsigned mask) } } +static const char * +mir_get_unit(unsigned unit) +{ + switch (unit) { + case ALU_ENAB_VEC_MUL: + return "vmul"; + case ALU_ENAB_SCAL_ADD: + return "sadd"; + case ALU_ENAB_VEC_ADD: + return "vadd"; + case ALU_ENAB_SCAL_MUL: + return "smul"; + case ALU_ENAB_VEC_LUT: + return "lut"; + case ALU_ENAB_BR_COMPACT: + return "br"; + case ALU_ENAB_BRANCH: + return "brx"; + default: + return "???"; + } +} + void mir_print_instruction(midgard_instruction *ins) { @@ -72,7 +95,7 @@ mir_print_instruction(midgard_instruction *ins) const char *name = alu_opcode_props[op].name; if (ins->unit) - printf("%d.", ins->unit); + printf("%s.", mir_get_unit(ins->unit)); printf("%s", name ? name : "??"); break; -- 2.30.2