pan/bi: Add FILE* argument to bi_print_registers
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 5 May 2020 18:31:20 +0000 (14:31 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 29 May 2020 20:34:55 +0000 (20:34 +0000)
In case we need it in general IR printing.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5260>

src/panfrost/bifrost/bi_pack.c
src/panfrost/bifrost/bi_print.c
src/panfrost/bifrost/bi_print.h

index 1afd486537c9b56b6c5baeda05d68aa7b2de65ee..9c49ffceb2760ba87b1c84fb1138de43a700537a 100644 (file)
@@ -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");
 }
 
index cf1e90eb1e920e736ce02ec11a809ace152f1f85..95b4e51fbecea345cdefe06c11068230319fce13 100644 (file)
@@ -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]);
         }
index ca644569ad52b56ad39b46eb48876be856c2c57f..efc3e75577b48a84cd2f0e478c11dd6f7dc7ee72 100644 (file)
@@ -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);