r300/compiler: print opcode names instead of numbers
authorMarek Olšák <maraeo@gmail.com>
Thu, 3 Jun 2010 03:15:10 +0000 (05:15 +0200)
committerMarek Olšák <maraeo@gmail.com>
Thu, 3 Jun 2010 03:15:10 +0000 (05:15 +0200)
src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c
src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c
src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c

index ef56e62396981f64abb094102a6df92186383d5b..b27a683c397955d6cf0ed556506b8878a3260b6a 100644 (file)
@@ -95,7 +95,7 @@ static unsigned int translate_rgb_opcode(struct r300_fragment_program_compiler *
        case RC_OPCODE_DP4: return R300_ALU_OUTC_DP4;
        case RC_OPCODE_FRC: return R300_ALU_OUTC_FRC;
        default:
-               error("translate_rgb_opcode(%i): Unknown opcode", opcode);
+               error("translate_rgb_opcode: Unknown opcode %s", rc_get_opcode_info(opcode)->Name);
                /* fall through */
        case RC_OPCODE_NOP:
                /* fall through */
@@ -116,7 +116,7 @@ static unsigned int translate_alpha_opcode(struct r300_fragment_program_compiler
        case RC_OPCODE_FRC: return R300_ALU_OUTA_FRC;
        case RC_OPCODE_LG2: return R300_ALU_OUTA_LG2;
        default:
-               error("translate_rgb_opcode(%i): Unknown opcode", opcode);
+               error("translate_rgb_opcode: Unknown opcode %s", rc_get_opcode_info(opcode)->Name);
                /* fall through */
        case RC_OPCODE_NOP:
                /* fall through */
@@ -302,7 +302,7 @@ static int emit_tex(struct r300_emit_state * emit, struct rc_instruction * inst)
        case RC_OPCODE_TXB: opcode = R300_TEX_OP_TXB; break;
        case RC_OPCODE_TXP: opcode = R300_TEX_OP_TXP; break;
        default:
-               error("Unknown texture opcode %i", inst->U.I.Opcode);
+               error("Unknown texture opcode %s", rc_get_opcode_info(inst->U.I.Opcode)->Name);
                return 0;
        }
 
index 4a0b6c02efe06622b34f3c0a98282bfafff1e517..02bef5603f38d9e91884e312cb3e4f5f4ecfdc9c 100644 (file)
@@ -375,7 +375,7 @@ static void translate_vertex_program(struct r300_vertex_program_compiler * compi
                case RC_OPCODE_SGE: ei_vector2(compiler->code, VE_SET_GREATER_THAN_EQUAL, vpi, inst); break;
                case RC_OPCODE_SLT: ei_vector2(compiler->code, VE_SET_LESS_THAN, vpi, inst); break;
                default:
-                       rc_error(&compiler->Base, "Unknown opcode %i\n", vpi->Opcode);
+                       rc_error(&compiler->Base, "Unknown opcode %s\n", rc_get_opcode_info(vpi->Opcode)->Name);
                        return;
                }
 
index 10c5e2349e99e8377d6690333a3d6a463d14e1b4..fb2d8b5a9c0a4ac5fbb854a0cb7932956350af8f 100644 (file)
@@ -82,7 +82,7 @@ static unsigned int translate_rgb_op(struct r300_fragment_program_compiler *c, r
        case RC_OPCODE_DP4: return R500_ALU_RGBA_OP_DP4;
        case RC_OPCODE_FRC: return R500_ALU_RGBA_OP_FRC;
        default:
-               error("translate_rgb_op(%d): unknown opcode\n", opcode);
+               error("translate_rgb_op: unknown opcode %s\n", rc_get_opcode_info(opcode)->Name);
                /* fall through */
        case RC_OPCODE_NOP:
                /* fall through */
@@ -106,7 +106,7 @@ static unsigned int translate_alpha_op(struct r300_fragment_program_compiler *c,
        case RC_OPCODE_FRC: return R500_ALPHA_OP_FRC;
        case RC_OPCODE_LG2: return R500_ALPHA_OP_LN2;
        default:
-               error("translate_alpha_op(%d): unknown opcode\n", opcode);
+               error("translate_alpha_op: unknown opcode %s\n", rc_get_opcode_info(opcode)->Name);
                /* fall through */
        case RC_OPCODE_NOP:
                /* fall through */
@@ -332,7 +332,7 @@ static int emit_tex(struct r300_fragment_program_compiler *c, struct rc_sub_inst
                code->inst[ip].inst1 |= R500_TEX_INST_PROJ;
                break;
        default:
-               error("emit_tex can't handle opcode %x\n", inst->Opcode);
+               error("emit_tex can't handle opcode %s\n", rc_get_opcode_info(inst->Opcode)->Name);
        }
 
        use_temporary(code, inst->SrcReg[0].Index);
@@ -432,7 +432,7 @@ static void emit_flowcontrol(struct emit_state * s, struct rc_instruction * inst
 
                s->CurrentBranchDepth--;
        } else {
-               rc_error(s->C, "%s: unknown opcode %i\n", __FUNCTION__, inst->U.I.Opcode);
+               rc_error(s->C, "%s: unknown opcode %s\n", __FUNCTION__, rc_get_opcode_info(inst->U.I.Opcode)->Name);
        }
 }