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:

committed by
Marge Bot

parent
e1f9e8d60b
commit
fe5fbadd46
@@ -103,17 +103,41 @@ mir_print_instruction(midgard_instruction *ins)
|
|||||||
{
|
{
|
||||||
printf("\t");
|
printf("\t");
|
||||||
|
|
||||||
switch (ins->type) {
|
if (midgard_is_branch_unit(ins->unit)) {
|
||||||
case TAG_ALU_4: {
|
|
||||||
midgard_alu_op op = ins->alu.op;
|
|
||||||
const char *name = alu_opcode_props[op].name;
|
|
||||||
|
|
||||||
const char *branch_target_names[] = {
|
const char *branch_target_names[] = {
|
||||||
"goto", "break", "continue", "discard"
|
"goto", "break", "continue", "discard"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ins->compact_branch)
|
printf("%s.", mir_get_unit(ins->unit));
|
||||||
name = branch_target_names[ins->branch.target_type];
|
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)
|
if (ins->unit)
|
||||||
printf("%s.", mir_get_unit(ins->unit));
|
printf("%s.", mir_get_unit(ins->unit));
|
||||||
|
Reference in New Issue
Block a user