From: Alyssa Rosenzweig Date: Tue, 5 May 2020 18:31:20 +0000 (-0400) Subject: pan/bi: Add FILE* argument to bi_print_registers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=95e3776d3e0119f679bfb467028ed09226fdf95d;p=mesa.git pan/bi: Add FILE* argument to bi_print_registers In case we need it in general IR printing. Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index 1afd486537c..9c49ffceb27 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -216,7 +216,7 @@ bi_assign_port_read(bi_registers *regs, unsigned src) return; } - bi_print_ports(regs); + bi_print_ports(regs, stderr); unreachable("Failed to find a free port for src"); } diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c index cf1e90eb1e9..95b4e51fbec 100644 --- a/src/panfrost/bifrost/bi_print.c +++ b/src/panfrost/bifrost/bi_print.c @@ -412,21 +412,21 @@ bi_print_instruction(bi_instruction *ins, FILE *fp) } void -bi_print_ports(bi_registers *regs) +bi_print_ports(bi_registers *regs, FILE *fp) { for (unsigned i = 0; i < 2; ++i) { if (regs->enabled[i]) - printf("port %u: %u\n", i, regs->port[i]); + fprintf(fp, "port %u: %u\n", i, regs->port[i]); } if (regs->write_fma || regs->write_add) { - printf("port 2 (%s): %u\n", + 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) { - printf("port 3 (%s): %u\n", + fprintf(fp, "port 3 (%s): %u\n", regs->read_port3 ? "read" : "FMA", regs->port[3]); } diff --git a/src/panfrost/bifrost/bi_print.h b/src/panfrost/bifrost/bi_print.h index ca644569ad5..efc3e75577b 100644 --- a/src/panfrost/bifrost/bi_print.h +++ b/src/panfrost/bifrost/bi_print.h @@ -47,7 +47,7 @@ const char * bi_frexp_op_name(enum bi_frexp_op op); const char * bi_tex_op_name(enum bi_tex_op op); void bi_print_instruction(bi_instruction *ins, FILE *fp); -void bi_print_ports(bi_registers *regs); +void bi_print_ports(bi_registers *regs, FILE *fp); void bi_print_bundle(bi_bundle *bundle, FILE *fp); void bi_print_clause(bi_clause *clause, FILE *fp); void bi_print_block(bi_block *block, FILE *fp);