From: Alyssa Rosenzweig Date: Fri, 30 Aug 2019 18:02:52 +0000 (-0700) Subject: pan/midgard: Print branches in MIR X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f42cebdd8424d3e0896bd0ddc214b2996bd07a73;p=mesa.git pan/midgard: Print branches in MIR Rather than a vague "br.??" line, annotate the branch with its target type (useful for disambiguating discards) and whether it was inverted. Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/panfrost/midgard/midgard_print.c b/src/panfrost/midgard/midgard_print.c index 2f65f2f8007..66b17be5bf6 100644 --- a/src/panfrost/midgard/midgard_print.c +++ b/src/panfrost/midgard/midgard_print.c @@ -99,6 +99,13 @@ mir_print_instruction(midgard_instruction *ins) midgard_alu_op op = ins->alu.op; const char *name = alu_opcode_props[op].name; + const char *branch_target_names[] = { + "goto", "break", "continue", "discard" + }; + + if (ins->compact_branch && !ins->prepacked_branch) + name = branch_target_names[ins->branch.target_type]; + if (ins->unit) printf("%s.", mir_get_unit(ins->unit)); @@ -124,7 +131,7 @@ mir_print_instruction(midgard_instruction *ins) assert(0); } - if (ins->invert) + if (ins->invert || (ins->compact_branch && !ins->prepacked_branch && ins->branch.invert_conditional)) printf(".not"); printf(" ");