[Mesa-dev] [PATCH 09/16] intel/compiler: add print_offsets argument to brw_disassemble()

kevin.rogovin at intel.com kevin.rogovin at intel.com
Tue Dec 12 07:44:10 UTC 2017


From: Kevin Rogovin <kevin.rogovin at intel.com>

Signed-off-by: Kevin Rogovin <kevin.rogovin at intel.com>
---
 src/intel/compiler/brw_compile_clip.c         | 4 +++-
 src/intel/compiler/brw_compile_sf.c           | 4 +++-
 src/intel/compiler/brw_disasm_info.c          | 4 +++-
 src/intel/compiler/brw_eu.c                   | 5 +++--
 src/intel/compiler/brw_eu.h                   | 3 ++-
 src/intel/tools/disasm.c                      | 2 +-
 src/mesa/drivers/dri/i965/brw_ff_gs.c         | 3 ++-
 src/mesa/drivers/dri/i965/brw_program_cache.c | 4 +++-
 8 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/intel/compiler/brw_compile_clip.c b/src/intel/compiler/brw_compile_clip.c
index c04d1a8277..d37a7d607e 100644
--- a/src/intel/compiler/brw_compile_clip.c
+++ b/src/intel/compiler/brw_compile_clip.c
@@ -88,7 +88,9 @@ brw_compile_clip(const struct brw_compiler *compiler,
    if (unlikely(INTEL_DEBUG & DEBUG_CLIP)) {
       fprintf(stderr, "clip:\n");
       brw_disassemble(compiler->devinfo,
-                      program, 0, *final_assembly_size, stderr);
+                      program, 0, *final_assembly_size,
+                      INTEL_DEBUG & DEBUG_PRINT_OFFSETS,
+                      stderr);
       fprintf(stderr, "\n");
    }
 
diff --git a/src/intel/compiler/brw_compile_sf.c b/src/intel/compiler/brw_compile_sf.c
index 91e8a6da6c..8294242f30 100644
--- a/src/intel/compiler/brw_compile_sf.c
+++ b/src/intel/compiler/brw_compile_sf.c
@@ -871,7 +871,9 @@ brw_compile_sf(const struct brw_compiler *compiler,
    if (unlikely(INTEL_DEBUG & DEBUG_SF)) {
       fprintf(stderr, "sf:\n");
       brw_disassemble(compiler->devinfo,
-                      program, 0, *final_assembly_size, stderr);
+                      program, 0, *final_assembly_size,
+                      INTEL_DEBUG & DEBUG_PRINT_OFFSETS,
+                      stderr);
       fprintf(stderr, "\n");
    }
 
diff --git a/src/intel/compiler/brw_disasm_info.c b/src/intel/compiler/brw_disasm_info.c
index 3db79ede70..baeb3271a9 100644
--- a/src/intel/compiler/brw_disasm_info.c
+++ b/src/intel/compiler/brw_disasm_info.c
@@ -72,7 +72,9 @@ dump_assembly(void *assembly, struct disasm_info *disasm)
             fprintf(stderr, "   %s\n", last_annotation_string);
       }
 
-      brw_disassemble(devinfo, assembly, start_offset, end_offset, stderr);
+      brw_disassemble(devinfo, assembly, start_offset, end_offset,
+                      INTEL_DEBUG & DEBUG_PRINT_OFFSETS,
+                      stderr);
 
       if (group->error) {
          fputs(group->error, stderr);
diff --git a/src/intel/compiler/brw_eu.c b/src/intel/compiler/brw_eu.c
index bc297a21b3..48ad82edfc 100644
--- a/src/intel/compiler/brw_eu.c
+++ b/src/intel/compiler/brw_eu.c
@@ -338,7 +338,8 @@ const unsigned *brw_get_program( struct brw_codegen *p,
 
 void
 brw_disassemble(const struct gen_device_info *devinfo,
-                const void *assembly, int start, int end, FILE *out)
+                const void *assembly, int start, int end,
+                bool print_offsets, FILE *out)
 {
    bool dump_hex = (INTEL_DEBUG & DEBUG_HEX) != 0;
 
@@ -346,7 +347,7 @@ brw_disassemble(const struct gen_device_info *devinfo,
       const brw_inst *insn = assembly + offset;
       brw_inst uncompacted;
       bool compacted = brw_inst_cmpt_control(devinfo, insn);
-      if (0)
+      if (print_offsets)
          fprintf(out, "0x%08x: ", offset);
 
       if (compacted) {
diff --git a/src/intel/compiler/brw_eu.h b/src/intel/compiler/brw_eu.h
index 2d0f56f793..ec98c046ee 100644
--- a/src/intel/compiler/brw_eu.h
+++ b/src/intel/compiler/brw_eu.h
@@ -127,7 +127,8 @@ void brw_init_codegen(const struct gen_device_info *, struct brw_codegen *p,
 int brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo,
                          const struct brw_inst *inst, bool is_compacted);
 void brw_disassemble(const struct gen_device_info *devinfo,
-                     const void *assembly, int start, int end, FILE *out);
+                     const void *assembly, int start, int end,
+                     bool print_offsets, FILE *out);
 const unsigned *brw_get_program( struct brw_codegen *p, unsigned *sz );
 
 brw_inst *brw_next_insn(struct brw_codegen *p, unsigned opcode);
diff --git a/src/intel/tools/disasm.c b/src/intel/tools/disasm.c
index 9a136db4db..c4a23594f8 100644
--- a/src/intel/tools/disasm.c
+++ b/src/intel/tools/disasm.c
@@ -97,7 +97,7 @@ gen_disasm_disassemble(struct gen_disasm *disasm, const void *assembly,
       int start_offset = group->offset;
       int end_offset = next->offset;
 
-      brw_disassemble(devinfo, assembly, start_offset, end_offset, out);
+      brw_disassemble(devinfo, assembly, start_offset, end_offset, false, out);
 
       if (group->error) {
          fputs(group->error, out);
diff --git a/src/mesa/drivers/dri/i965/brw_ff_gs.c b/src/mesa/drivers/dri/i965/brw_ff_gs.c
index 174418a474..16db209eaa 100644
--- a/src/mesa/drivers/dri/i965/brw_ff_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_ff_gs.c
@@ -136,7 +136,8 @@ brw_codegen_ff_gs_prog(struct brw_context *brw,
    if (unlikely(INTEL_DEBUG & DEBUG_GS)) {
       fprintf(stderr, "gs:\n");
       brw_disassemble(&brw->screen->devinfo, c.func.store,
-                      0, program_size, stderr);
+                      0, program_size, INTEL_DEBUG & DEBUG_PRINT_OFFSETS,
+                      stderr);
       fprintf(stderr, "\n");
     }
 
diff --git a/src/mesa/drivers/dri/i965/brw_program_cache.c b/src/mesa/drivers/dri/i965/brw_program_cache.c
index adb0cd5a23..4998caa277 100644
--- a/src/mesa/drivers/dri/i965/brw_program_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_program_cache.c
@@ -526,7 +526,9 @@ brw_print_program_cache(struct brw_context *brw)
       for (item = cache->items[i]; item; item = item->next) {
          fprintf(stderr, "%s:\n", cache_name(i));
          brw_disassemble(&brw->screen->devinfo, cache->map,
-                         item->offset, item->size, stderr);
+                         item->offset, item->size,
+                         INTEL_DEBUG & DEBUG_PRINT_OFFSETS,
+                         stderr);
       }
    }
 }
-- 
2.15.0



More information about the mesa-dev mailing list