X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fpanfrost%2Fbifrost%2Fbi_print.c;h=95b4e51fbecea345cdefe06c11068230319fce13;hb=95e3776d3e0119f679bfb467028ed09226fdf95d;hp=066b96c41c426910b04857d852fc33186c36af29;hpb=1a94daef589be2e95b12d30733d45b9ffeaad436;p=mesa.git diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c index 066b96c41c4..95b4e51fbec 100644 --- a/src/panfrost/bifrost/bi_print.c +++ b/src/panfrost/bifrost/bi_print.c @@ -238,6 +238,16 @@ bi_bitwise_op_name(enum bi_bitwise_op op) } } +static const char * +bi_imath_op_name(enum bi_imath_op op) +{ + switch (op) { + case BI_IMATH_ADD: return "iadd"; + case BI_IMATH_SUB: return "isub"; + default: return "invalid"; + } +} + const char * bi_table_op_name(enum bi_table_op op) { @@ -328,6 +338,8 @@ bi_print_instruction(bi_instruction *ins, FILE *fp) fprintf(fp, "%s", ins->op.minmax == BI_MINMAX_MIN ? "min" : "max"); else if (ins->type == BI_BITWISE) fprintf(fp, "%s", bi_bitwise_op_name(ins->op.bitwise)); + else if (ins->type == BI_IMATH) + fprintf(fp, "%s", bi_imath_op_name(ins->op.imath)); else if (ins->type == BI_SPECIAL) fprintf(fp, "%s", bi_special_op_name(ins->op.special)); else if (ins->type == BI_TABLE) @@ -399,6 +411,27 @@ bi_print_instruction(bi_instruction *ins, FILE *fp) fprintf(fp, "\n"); } +void +bi_print_ports(bi_registers *regs, FILE *fp) +{ + for (unsigned i = 0; i < 2; ++i) { + if (regs->enabled[i]) + fprintf(fp, "port %u: %u\n", i, regs->port[i]); + } + + if (regs->write_fma || regs->write_add) { + fprintf(fp, "port 2 (%s): %u\n", + regs->write_add ? "ADD" : "FMA", + regs->port[2]); + } + + if ((regs->write_fma && regs->write_add) || regs->read_port3) { + fprintf(fp, "port 3 (%s): %u\n", + regs->read_port3 ? "read" : "FMA", + regs->port[3]); + } +} + void bi_print_bundle(bi_bundle *bundle, FILE *fp) {