[Mesa-dev] [PATCH 08/18] intel/compiler:add function to give option to print offsets into assembly

kevin.rogovin at intel.com kevin.rogovin at intel.com
Mon Nov 13 13:17:56 UTC 2017


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

Signed-off-by: Kevin Rogovin <kevin.rogovin at intel.com>
---
 src/intel/compiler/brw_eu.c | 11 ++++++++++-
 src/intel/compiler/brw_eu.h |  3 +++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_eu.c b/src/intel/compiler/brw_eu.c
index bc297a21b3..8969ae5bda 100644
--- a/src/intel/compiler/brw_eu.c
+++ b/src/intel/compiler/brw_eu.c
@@ -339,6 +339,15 @@ 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)
+{
+   brw_disassemble_print_offset_option(devinfo, assembly, start, end, out,
+                                       false);
+}
+
+void
+brw_disassemble_print_offset_option(const struct gen_device_info *devinfo,
+                                    const void *assembly, int start, int end,
+                                    FILE *out, bool print_offsets)
 {
    bool dump_hex = (INTEL_DEBUG & DEBUG_HEX) != 0;
 
@@ -346,7 +355,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 95503d5513..497cf9e575 100644
--- a/src/intel/compiler/brw_eu.h
+++ b/src/intel/compiler/brw_eu.h
@@ -128,6 +128,9 @@ 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);
+void brw_disassemble_print_offset_option(const struct gen_device_info *devinfo,
+                                         const void *assembly, int start, int end,
+                                         FILE *out, bool print_offsets);
 const unsigned *brw_get_program( struct brw_codegen *p, unsigned *sz );
 
 brw_inst *brw_next_insn(struct brw_codegen *p, unsigned opcode);
-- 
2.14.2



More information about the mesa-dev mailing list