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

kevin.rogovin at intel.com kevin.rogovin at intel.com
Mon Sep 25 10:34: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_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 b0bdc38..4fa40e8 100644
--- a/src/intel/compiler/brw_eu.c
+++ b/src/intel/compiler/brw_eu.c
@@ -339,13 +339,22 @@ 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;
 
    for (int offset = start; offset < end;) {
       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 d8c9be2..eec5b92 100644
--- a/src/intel/compiler/brw_eu.h
+++ b/src/intel/compiler/brw_eu.h
@@ -118,6 +118,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.7.4



More information about the mesa-dev mailing list