[Mesa-dev] [PATCH 23/23] i965/gen8: Print number of instructions directly.

Matt Turner mattst88 at gmail.com
Mon May 19 11:55:49 PDT 2014


---
 src/mesa/drivers/dri/i965/gen8_fs_generator.cpp   | 5 +++++
 src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp b/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
index 0ac00f9..90743ee 100644
--- a/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
@@ -1313,10 +1313,13 @@ gen8_fs_generator::generate_assembly(exec_list *simd8_instructions,
 
          struct annotation *annotation;
          int num_annotations;
+         int start_offset = next_inst_offset;
 
          dispatch_width = (i + 1) * 8;
          generate_code(instructions[i], &num_annotations, &annotation);
 
+         int before_size = next_inst_offset - start_offset;
+
          if (unlikely(INTEL_DEBUG & DEBUG_WM)) {
             if (this->prog) {
                fprintf(stderr,
@@ -1331,6 +1334,8 @@ gen8_fs_generator::generate_assembly(exec_list *simd8_instructions,
                fprintf(stderr, "Native code for blorp program (SIMD%d dispatch):\n",
                        dispatch_width);
             }
+            fprintf(stderr, "SIMD%d shader: %d instructions.\n",
+                    dispatch_width, before_size / 16);
             dump_assembly(store, num_annotations, annotation, brw, prog,
                           gen8_disassemble);
             ralloc_free(annotation);
diff --git a/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp b/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp
index 9f19a0a..3447ebf 100644
--- a/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp
@@ -944,6 +944,8 @@ gen8_vec4_generator::generate_assembly(exec_list *instructions,
    default_state.exec_size = BRW_EXECUTE_8;
    generate_code(instructions, &num_annotations, &annotation);
 
+   int before_size = next_inst_offset;
+
    if (unlikely(debug_flag)) {
       if (shader_prog) {
          fprintf(stderr, "Native code for %s vertex shader %d:\n",
@@ -952,6 +954,7 @@ gen8_vec4_generator::generate_assembly(exec_list *instructions,
       } else {
          fprintf(stderr, "Native code for vertex program %d:\n", prog->Id);
       }
+      fprintf(stderr, "vec4 shader: %d instructions.\n", before_size / 16);
       dump_assembly(store, num_annotations, annotation, brw, prog,
                     gen8_disassemble);
       ralloc_free(annotation);
-- 
1.8.3.2



More information about the mesa-dev mailing list