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 ef56e62..b27a683 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 4a0b6c0..02bef56 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 10c5e23..fb2d8b5 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);
        }
 }