panfrost/midgard: Fix mir_print_instruction() for branch instructions

Branch instructions should not be treated as regular ALUs.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3478>
This commit is contained in:
Boris Brezillon
2020-01-20 21:44:49 +01:00
committed by Marge Bot
parent e1f9e8d60b
commit fe5fbadd46

View File

@@ -103,17 +103,41 @@ mir_print_instruction(midgard_instruction *ins)
{
printf("\t");
switch (ins->type) {
case TAG_ALU_4: {
midgard_alu_op op = ins->alu.op;
const char *name = alu_opcode_props[op].name;
if (midgard_is_branch_unit(ins->unit)) {
const char *branch_target_names[] = {
"goto", "break", "continue", "discard"
};
if (ins->compact_branch)
name = branch_target_names[ins->branch.target_type];
printf("%s.", mir_get_unit(ins->unit));
if (ins->branch.target_type == TARGET_DISCARD)
printf("discard.");
else if (ins->writeout)
printf("write.");
else if (ins->unit == ALU_ENAB_BR_COMPACT &&
!ins->branch.conditional)
printf("uncond.");
else
printf("cond.");
if (!ins->branch.conditional)
printf("always");
else if (ins->branch.invert_conditional)
printf("false");
else
printf("true");
if (ins->branch.target_type != TARGET_DISCARD)
printf(" %s -> block(%d)\n",
branch_target_names[ins->branch.target_type],
ins->branch.target_block);
return;
}
switch (ins->type) {
case TAG_ALU_4: {
midgard_alu_op op = ins->alu.op;
const char *name = alu_opcode_props[op].name;
if (ins->unit)
printf("%s.", mir_get_unit(ins->unit));