[Mesa-dev,52/95] i965/vec4: print subnr in dump_instruction()

Submitted by Iago Toral Quiroga on July 19, 2016, 10:40 a.m.

Details

Message ID 1468924892-6910-53-git-send-email-itoral@igalia.com
State New
Headers show
Series "i965 Haswell ARB_gpu_shader_fp64 / OpenGL 4.0" ( rev: 2 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Iago Toral Quiroga July 19, 2016, 10:40 a.m.
Also, we use reg_offset=1 with DF uniforms when we try to access
components Z/W, so print reg_offset for them too.
---
 src/mesa/drivers/dri/i965/brw_vec4.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 2bb6a8a..9400baa 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -1429,7 +1429,9 @@  vec4_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
 
    switch (inst->dst.file) {
    case VGRF:
-      fprintf(file, "vgrf%d.%d", inst->dst.nr, inst->dst.reg_offset);
+      fprintf(file, "vgrf%d", inst->dst.nr);
+      if (inst->dst.reg_offset || inst->dst.subnr)
+         fprintf(file, "+%d.%d", inst->dst.reg_offset, inst->dst.subnr);
       break;
    case FIXED_GRF:
       fprintf(file, "g%d", inst->dst.nr);
@@ -1490,6 +1492,8 @@  vec4_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
       switch (inst->src[i].file) {
       case VGRF:
          fprintf(file, "vgrf%d", inst->src[i].nr);
+         if (inst->src[i].reg_offset || inst->src[i].subnr)
+            fprintf(file, "+%d.%d", inst->src[i].reg_offset, inst->src[i].subnr);
          break;
       case FIXED_GRF:
          fprintf(file, "g%d", inst->src[i].nr);
@@ -1499,6 +1503,8 @@  vec4_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
          break;
       case UNIFORM:
          fprintf(file, "u%d", inst->src[i].nr);
+         if (inst->src[i].reg_offset || inst->src[i].subnr)
+            fprintf(file, "+%d.%d", inst->src[i].reg_offset, inst->src[i].subnr);
          break;
       case IMM:
          switch (inst->src[i].type) {
@@ -1554,12 +1560,6 @@  vec4_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
          unreachable("not reached");
       }
 
-      /* Don't print .0; and only VGRFs have reg_offsets and sizes */
-      if (inst->src[i].reg_offset != 0 &&
-          inst->src[i].file == VGRF &&
-          alloc.sizes[inst->src[i].nr] != 1)
-         fprintf(file, ".%d", inst->src[i].reg_offset);
-
       if (inst->src[i].file != IMM) {
          static const char *chans[4] = {"x", "y", "z", "w"};
          fprintf(file, ".");