tgsi: report opcode name in addition to the number when translation fails
authorBrian Paul <brianp@vmware.com>
Fri, 31 Jul 2009 16:23:52 +0000 (10:23 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 3 Aug 2009 17:24:09 +0000 (11:24 -0600)
src/gallium/auxiliary/tgsi/tgsi_ppc.c
src/gallium/auxiliary/tgsi/tgsi_sse2.c

index 8fa21f6c408119ab9188181611ffbbf04bc98726..922f147b9465720677d7d0603d2f2f9dcf708177 100644 (file)
@@ -38,6 +38,7 @@
 #include "util/u_math.h"
 #include "util/u_memory.h"
 #include "util/u_sse.h"
+#include "tgsi/tgsi_info.h"
 #include "tgsi/tgsi_parse.h"
 #include "tgsi/tgsi_util.h"
 #include "tgsi_dump.h"
@@ -1317,8 +1318,10 @@ tgsi_emit_ppc(const struct tgsi_token *tokens,
          ok = emit_instruction(&gen, &parse.FullToken.FullInstruction);
 
         if (!ok) {
+            uint opcode = parse.FullToken.FullInstruction.Instruction.Opcode;
            debug_printf("failed to translate tgsi opcode %d to PPC (%s)\n", 
-                        parse.FullToken.FullInstruction.Instruction.Opcode,
+                        opcode,
+                         tgsi_get_opcode_name(opcode),
                          parse.FullHeader.Processor.Processor == TGSI_PROCESSOR_VERTEX ?
                          "vertex shader" : "fragment shader");
         }
index 52186770e6aad7c18a20310f2deef9d39d7c6af7..cfec5cfc0193a482643e4a2002add6966c50420d 100644 (file)
@@ -36,6 +36,7 @@
 #if defined(PIPE_ARCH_SSE)
 #include "util/u_sse.h"
 #endif
+#include "tgsi/tgsi_info.h"
 #include "tgsi/tgsi_parse.h"
 #include "tgsi/tgsi_util.h"
 #include "tgsi_exec.h"
@@ -2917,8 +2918,10 @@ tgsi_emit_sse2(
             &parse.FullToken.FullInstruction );
 
         if (!ok) {
-           debug_printf("failed to translate tgsi opcode %d to SSE (%s)\n", 
-                        parse.FullToken.FullInstruction.Instruction.Opcode,
+            uint opcode = parse.FullToken.FullInstruction.Instruction.Opcode;
+           debug_printf("failed to translate tgsi opcode %d (%s) to SSE (%s)\n", 
+                        opcode,
+                         tgsi_get_opcode_name(opcode),
                          parse.FullHeader.Processor.Processor == TGSI_PROCESSOR_VERTEX ?
                          "vertex shader" : "fragment shader");
         }