summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-08-30 11:02:52 -0700
committerAlyssa Rosenzweig <[email protected]>2019-08-30 15:50:26 -0700
commitf42cebdd8424d3e0896bd0ddc214b2996bd07a73 (patch)
tree633529a2497fee8e3c323983df46526bc401cbbe /src
parent59f2cfcbc7d9da9b9e7c45ccc58c5cdaecbe92e8 (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/panfrost/midgard/midgard_print.c9
1 files changed, 8 insertions, 1 deletions
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(" ");