From aaa2fa4e7a7b6d8d56f3af5bd69224afb5bef95d Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 21 Jul 2022 14:45:49 -0400 Subject: [PATCH] pan/bi: Clean up destination printing Now we can trust in I->nr_dests, avoiding a bunch of special cases and incorrect printing for instructions without a destination. To compensate for those instructions being hard to scan now, indent. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_printer.c.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/panfrost/bifrost/bi_printer.c.py b/src/panfrost/bifrost/bi_printer.c.py index d00659f..024df69 100644 --- a/src/panfrost/bifrost/bi_printer.c.py +++ b/src/panfrost/bifrost/bi_printer.c.py @@ -160,22 +160,18 @@ bi_${mod}_as_str(enum bi_${mod} ${mod}) void bi_print_instr(const bi_instr *I, FILE *fp) { - if (I->op == BI_OPCODE_SPLIT_I32) { - for (unsigned d = 0; d < I->nr_dests; ++d) { - if (d > 0) fprintf(fp, ", "); + fputs(" ", fp); - bi_print_index(fp, I->dest[d]); - } - } else { - bi_foreach_dest(I, d) { - if (bi_is_null(I->dest[d])) break; - if (d > 0) fprintf(fp, ", "); + bi_foreach_dest(I, d) { + if (d > 0) fprintf(fp, ", "); - bi_print_index(fp, I->dest[d]); - } + bi_print_index(fp, I->dest[d]); } - fprintf(fp, " = %s", bi_opcode_props[I->op].name); + if (I->nr_dests > 0) + fputs(" = ", fp); + + fprintf(fp, "%s", bi_opcode_props[I->op].name); if (I->table) fprintf(fp, ".table%u", I->table); -- 2.7.4