i965/disasm: Stop using gen8_disassemble in favor of brw_disassemble.
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 29 Jun 2014 03:37:56 +0000 (20:37 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 30 Jun 2014 21:05:28 +0000 (14:05 -0700)
At this point, brw_disassemble can do everything gen8_disassemble can
do - and, thanks to the new brw_inst API, it supports all generations.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
src/mesa/drivers/dri/i965/gen8_generator.cpp
src/mesa/drivers/dri/i965/gen8_generator.h
src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp
src/mesa/drivers/dri/i965/intel_asm_printer.c
src/mesa/drivers/dri/i965/intel_asm_printer.h

index bdac2a29a2f08311011e6c730fc4ef9b4a02263d..0f41781183dec910cdb8d27fc97b41dedecd464a 100644 (file)
@@ -1795,8 +1795,7 @@ fs_generator::generate_code(exec_list *instructions)
 
       const struct gl_program *prog = fp ? &fp->Base : NULL;
 
-      dump_assembly(p->store, annotation.ann_count, annotation.ann,
-                    brw, prog, brw_disassemble);
+      dump_assembly(p->store, annotation.ann_count, annotation.ann, brw, prog);
       ralloc_free(annotation.ann);
    }
 }
index 524761630b3ed8cebeee096b884973266aeb192b..9e0e7bb105fb7713b4ad1af361ea2518b5f57fae 100644 (file)
@@ -1296,8 +1296,7 @@ vec4_generator::generate_code(exec_list *instructions)
               before_size / 16, before_size, after_size,
               100.0f * (before_size - after_size) / before_size);
 
-      dump_assembly(p->store, annotation.ann_count, annotation.ann,
-                    brw, prog, brw_disassemble);
+      dump_assembly(p->store, annotation.ann_count, annotation.ann, brw, prog);
       ralloc_free(annotation.ann);
    }
 }
index 6d455a3af60123ff9e59a35d9ed17f7cfd42b70e..4725774a34e30b15cf553d726c5fdee94c1e2549 100644 (file)
@@ -1271,8 +1271,7 @@ gen8_fs_generator::generate_code(exec_list *instructions)
       fprintf(stderr, "SIMD%d shader: %d instructions.\n",
               dispatch_width, before_size / 16);
 
-      dump_assembly(store, annotation.ann_count, annotation.ann, brw, prog,
-                    gen8_disassemble);
+      dump_assembly(store, annotation.ann_count, annotation.ann, brw, prog);
       ralloc_free(annotation.ann);
    }
 }
index 2a9bf83ee409cc22a29e35e801e5310d82dfe022..a41aa7b7dfd2ff8ebd9822538dafe14d55e0d15e 100644 (file)
@@ -619,25 +619,3 @@ gen8_generator::HALT()
    gen8_set_mask_control(inst, BRW_MASK_DISABLE);
    return inst;
 }
-
-extern "C" void
-gen8_disassemble(struct brw_context *brw, void *assembly,
-                 int start, int end, FILE *out)
-{
-   bool dump_hex = false;
-
-   for (int offset = start; offset < end; offset += 16) {
-      gen8_instruction *inst = &((gen8_instruction *)assembly)[offset / 16];
-      fprintf(stderr, "0x%08x: ", offset);
-
-      if (dump_hex) {
-         fprintf(stderr, "0x%08x 0x%08x 0x%08x 0x%08x ",
-                 ((uint32_t *) inst)[3],
-                 ((uint32_t *) inst)[2],
-                 ((uint32_t *) inst)[1],
-                 ((uint32_t *) inst)[0]);
-      }
-
-      gen8_disassemble_inst(stderr, inst, brw->gen);
-   }
-}
index cdb2741d87ee72e655ed4242cb8d97118f3c8fa4..f91044a34a04f7004e9ca1888bbe19d0f5f09a4d 100644 (file)
@@ -194,7 +194,3 @@ protected:
 
    void *mem_ctx;
 };
-
-extern "C" void
-gen8_disassemble(struct brw_context *brw, void *assembly,
-                 int start, int end, FILE *out);
index 82ea45a0cc195b1d2174699b6fb82182a071d8e5..da6c8975f968d9e700ad3fa777c8a88a0c31ff9e 100644 (file)
@@ -898,8 +898,7 @@ gen8_vec4_generator::generate_code(exec_list *instructions)
       }
       fprintf(stderr, "vec4 shader: %d instructions.\n", before_size / 16);
 
-      dump_assembly(store, annotation.ann_count, annotation.ann,
-                    brw, prog, gen8_disassemble);
+      dump_assembly(store, annotation.ann_count, annotation.ann, brw, prog);
       ralloc_free(annotation.ann);
    }
 }
index f533e7cf284bae06334dad4d0f980c8eb4e53b98..3c2d256a0c0c2a1e811a42535f62b28b8056fba8 100644 (file)
  */
 
 #include "brw_cfg.h"
+#include "brw_eu.h"
 #include "intel_asm_printer.h"
 #include "program/prog_print.h"
 #include "program/prog_instruction.h"
 
 void
 dump_assembly(void *assembly, int num_annotations, struct annotation *annotation,
-              struct brw_context *brw, const struct gl_program *prog,
-              disassemble_func disassemble)
+              struct brw_context *brw, const struct gl_program *prog)
 {
    const char *last_annotation_string = NULL;
    const void *last_annotation_ir = NULL;
@@ -73,7 +73,7 @@ dump_assembly(void *assembly, int num_annotations, struct annotation *annotation
             fprintf(stderr, "   %s\n", last_annotation_string);
       }
 
-      disassemble(brw, assembly, start_offset, end_offset, stderr);
+      brw_disassemble(brw, assembly, start_offset, end_offset, stderr);
 
       if (annotation[i].block_end) {
          fprintf(stderr, "   END B%d", annotation[i].block_end->block_num);
index dfe64d6c2fa0ed5b29b8e2684039a6667d19f8c2..50ed21a3f7b385b325d42a9ebab50efc53fa5f1a 100644 (file)
@@ -56,13 +56,9 @@ struct annotation_info {
    int cur_block;
 };
 
-typedef void (*disassemble_func)(struct brw_context *brw, void *assembly,
-                                 int start, int end, FILE *out);
-
 void
 dump_assembly(void *assembly, int num_annotations, struct annotation *annotation,
-              struct brw_context *brw, const struct gl_program *prog,
-              disassemble_func disassemble);
+              struct brw_context *brw, const struct gl_program *prog);
 
 #ifdef __cplusplus
 } /* extern "C" */