i965: Avoid crashing while dumping vec4 insn operands
authorChris Forbes <chrisf@ijw.co.nz>
Sun, 6 Jul 2014 08:11:06 +0000 (20:11 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Fri, 11 Jul 2014 23:29:17 +0000 (11:29 +1200)
We'd otherwise go looking into virtual_grf_sizes for things that aren't
in there at all.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_vec4.cpp

index b60cd1fd9d537abd63f20a6d309f8e5243d923a3..9ea0b147644dfabf54f214a5ddc28c486dfe98d9 100644 (file)
@@ -1337,7 +1337,10 @@ vec4_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
          break;
       }
 
-      if (virtual_grf_sizes[inst->src[i].reg] != 1)
+      /* Don't print .0; and only VGRFs have reg_offsets and sizes */
+      if (inst->src[i].reg_offset != 0 &&
+          inst->src[i].file == GRF &&
+          virtual_grf_sizes[inst->src[i].reg] != 1)
          fprintf(file, ".%d", inst->src[i].reg_offset);
 
       if (inst->src[i].file != IMM) {