i965: dump the disassembly to the given file
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 5 Dec 2013 15:34:56 +0000 (17:34 +0200)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 27 Dec 2013 09:58:52 +0000 (11:58 +0200)
instead of ignoring the argument and always dumping to
standard output.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_eu.c

index 8c7235a2b17f1772b62eeeccad1b6aa5ccf27122..9d0c85674c88ad12e0c0b249011021c68419aba7 100644 (file)
@@ -236,14 +236,14 @@ brw_dump_compile(struct brw_compile *p, FILE *out, int start, int end)
    for (int offset = start; offset < end;) {
       struct brw_instruction *insn = store + offset;
       struct brw_instruction uncompacted;
-      printf("0x%08x: ", offset);
+      fprintf(out, "0x%08x: ", offset);
 
       if (insn->header.cmpt_control) {
         struct brw_compact_instruction *compacted = (void *)insn;
         if (dump_hex) {
-           printf("0x%08x 0x%08x                       ",
-                  ((uint32_t *)insn)[1],
-                  ((uint32_t *)insn)[0]);
+           fprintf(out, "0x%08x 0x%08x                       ",
+                   ((uint32_t *)insn)[1],
+                   ((uint32_t *)insn)[0]);
         }
 
         brw_uncompact_instruction(brw, &uncompacted, compacted);
@@ -251,15 +251,15 @@ brw_dump_compile(struct brw_compile *p, FILE *out, int start, int end)
         offset += 8;
       } else {
         if (dump_hex) {
-           printf("0x%08x 0x%08x 0x%08x 0x%08x ",
-                  ((uint32_t *)insn)[3],
-                  ((uint32_t *)insn)[2],
-                  ((uint32_t *)insn)[1],
-                  ((uint32_t *)insn)[0]);
+           fprintf(out, "0x%08x 0x%08x 0x%08x 0x%08x ",
+                   ((uint32_t *)insn)[3],
+                   ((uint32_t *)insn)[2],
+                   ((uint32_t *)insn)[1],
+                   ((uint32_t *)insn)[0]);
         }
         offset += 16;
       }
 
-      brw_disasm(stdout, insn, p->brw->gen);
+      brw_disasm(out, insn, p->brw->gen);
    }
 }