Mesa (master): r300/compiler: print opcode names instead of numbers

Marek Olšák mareko at kemper.freedesktop.org
Wed Jun 2 20:15:59 PDT 2010


Module: Mesa
Branch: master
Commit: 128190e4a908ab92690cba4e59e3e5fa42e98f6f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=128190e4a908ab92690cba4e59e3e5fa42e98f6f

Author: Marek Olšák <maraeo at gmail.com>
Date:   Thu Jun  3 05:15:10 2010 +0200

r300/compiler: print opcode names instead of numbers

---

 .../drivers/dri/r300/compiler/r300_fragprog_emit.c |    6 +++---
 src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c |    2 +-
 .../drivers/dri/r300/compiler/r500_fragprog_emit.c |    8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c
index ef56e62..b27a683 100644
--- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c
+++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c
@@ -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;
 	}
 
diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c
index 4a0b6c0..02bef56 100644
--- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c
+++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c
@@ -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;
 		}
 
diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
index 10c5e23..fb2d8b5 100644
--- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
+++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
@@ -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);
 	}
 }
 



More information about the mesa-commit mailing list