mesa: Remove Mesa IR opcodes that existed only for NV_vertex_program.
v2: Remove dead positive() function, caught by Matt. Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
This commit is contained in:
@@ -1088,7 +1088,6 @@ upload_program(struct i915_fragment_program *p)
|
|||||||
|
|
||||||
case OPCODE_BGNLOOP:
|
case OPCODE_BGNLOOP:
|
||||||
case OPCODE_BGNSUB:
|
case OPCODE_BGNSUB:
|
||||||
case OPCODE_BRA:
|
|
||||||
case OPCODE_BRK:
|
case OPCODE_BRK:
|
||||||
case OPCODE_CAL:
|
case OPCODE_CAL:
|
||||||
case OPCODE_CONT:
|
case OPCODE_CONT:
|
||||||
|
@@ -79,23 +79,6 @@
|
|||||||
static const GLfloat ZeroVec[4] = { 0.0F, 0.0F, 0.0F, 0.0F };
|
static const GLfloat ZeroVec[4] = { 0.0F, 0.0F, 0.0F, 0.0F };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return TRUE for +0 and other positive values, FALSE otherwise.
|
|
||||||
* Used for RCC opcode.
|
|
||||||
*/
|
|
||||||
static inline GLboolean
|
|
||||||
positive(float x)
|
|
||||||
{
|
|
||||||
fi_type fi;
|
|
||||||
fi.f = x;
|
|
||||||
if (fi.i & 0x80000000)
|
|
||||||
return GL_FALSE;
|
|
||||||
return GL_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a pointer to the 4-element float vector specified by the given
|
* Return a pointer to the 4-element float vector specified by the given
|
||||||
* source register.
|
* source register.
|
||||||
@@ -728,13 +711,6 @@ _mesa_execute_program(struct gl_context * ctx,
|
|||||||
break;
|
break;
|
||||||
case OPCODE_ENDSUB: /* end subroutine */
|
case OPCODE_ENDSUB: /* end subroutine */
|
||||||
break;
|
break;
|
||||||
case OPCODE_BRA: /* branch (conditional) */
|
|
||||||
if (eval_condition(machine, inst)) {
|
|
||||||
/* take branch */
|
|
||||||
/* Subtract 1 here since we'll do pc++ below */
|
|
||||||
pc = inst->BranchTarget - 1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case OPCODE_BRK: /* break out of loop (conditional) */
|
case OPCODE_BRK: /* break out of loop (conditional) */
|
||||||
ASSERT(program->Instructions[inst->BranchTarget].Opcode
|
ASSERT(program->Instructions[inst->BranchTarget].Opcode
|
||||||
== OPCODE_ENDLOOP);
|
== OPCODE_ENDLOOP);
|
||||||
@@ -1367,43 +1343,6 @@ _mesa_execute_program(struct gl_context * ctx,
|
|||||||
store_vector4(inst, machine, result);
|
store_vector4(inst, machine, result);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OPCODE_RCC: /* clamped riciprocal */
|
|
||||||
{
|
|
||||||
const float largest = 1.884467e+19, smallest = 5.42101e-20;
|
|
||||||
GLfloat a[4], r, result[4];
|
|
||||||
fetch_vector1(&inst->SrcReg[0], machine, a);
|
|
||||||
if (DEBUG_PROG) {
|
|
||||||
if (a[0] == 0)
|
|
||||||
printf("RCC(0)\n");
|
|
||||||
else if (IS_INF_OR_NAN(a[0]))
|
|
||||||
printf("RCC(inf)\n");
|
|
||||||
}
|
|
||||||
if (a[0] == 1.0F) {
|
|
||||||
r = 1.0F;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
r = 1.0F / a[0];
|
|
||||||
}
|
|
||||||
if (positive(r)) {
|
|
||||||
if (r > largest) {
|
|
||||||
r = largest;
|
|
||||||
}
|
|
||||||
else if (r < smallest) {
|
|
||||||
r = smallest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (r < -largest) {
|
|
||||||
r = -largest;
|
|
||||||
}
|
|
||||||
else if (r > -smallest) {
|
|
||||||
r = -smallest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result[0] = result[1] = result[2] = result[3] = r;
|
|
||||||
store_vector4(inst, machine, result);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case OPCODE_RCP:
|
case OPCODE_RCP:
|
||||||
{
|
{
|
||||||
|
@@ -154,13 +154,9 @@ static const struct instruction_info InstInfo[MAX_OPCODE] = {
|
|||||||
{ OPCODE_ABS, "ABS", 1, 1 },
|
{ OPCODE_ABS, "ABS", 1, 1 },
|
||||||
{ OPCODE_ADD, "ADD", 2, 1 },
|
{ OPCODE_ADD, "ADD", 2, 1 },
|
||||||
{ OPCODE_AND, "AND", 2, 1 },
|
{ OPCODE_AND, "AND", 2, 1 },
|
||||||
{ OPCODE_ARA, "ARA", 1, 1 },
|
|
||||||
{ OPCODE_ARL, "ARL", 1, 1 },
|
{ OPCODE_ARL, "ARL", 1, 1 },
|
||||||
{ OPCODE_ARL_NV, "ARL_NV", 1, 1 },
|
|
||||||
{ OPCODE_ARR, "ARL", 1, 1 },
|
|
||||||
{ OPCODE_BGNLOOP,"BGNLOOP", 0, 0 },
|
{ OPCODE_BGNLOOP,"BGNLOOP", 0, 0 },
|
||||||
{ OPCODE_BGNSUB, "BGNSUB", 0, 0 },
|
{ OPCODE_BGNSUB, "BGNSUB", 0, 0 },
|
||||||
{ OPCODE_BRA, "BRA", 0, 0 },
|
|
||||||
{ OPCODE_BRK, "BRK", 0, 0 },
|
{ OPCODE_BRK, "BRK", 0, 0 },
|
||||||
{ OPCODE_CAL, "CAL", 0, 0 },
|
{ OPCODE_CAL, "CAL", 0, 0 },
|
||||||
{ OPCODE_CMP, "CMP", 3, 1 },
|
{ OPCODE_CMP, "CMP", 3, 1 },
|
||||||
@@ -210,10 +206,7 @@ static const struct instruction_info InstInfo[MAX_OPCODE] = {
|
|||||||
{ OPCODE_PK4B, "PK4B", 1, 1 },
|
{ OPCODE_PK4B, "PK4B", 1, 1 },
|
||||||
{ OPCODE_PK4UB, "PK4UB", 1, 1 },
|
{ OPCODE_PK4UB, "PK4UB", 1, 1 },
|
||||||
{ OPCODE_POW, "POW", 2, 1 },
|
{ OPCODE_POW, "POW", 2, 1 },
|
||||||
{ OPCODE_POPA, "POPA", 0, 0 },
|
|
||||||
{ OPCODE_PRINT, "PRINT", 1, 0 },
|
{ OPCODE_PRINT, "PRINT", 1, 0 },
|
||||||
{ OPCODE_PUSHA, "PUSHA", 0, 0 },
|
|
||||||
{ OPCODE_RCC, "RCC", 1, 1 },
|
|
||||||
{ OPCODE_RCP, "RCP", 1, 1 },
|
{ OPCODE_RCP, "RCP", 1, 1 },
|
||||||
{ OPCODE_RET, "RET", 0, 0 },
|
{ OPCODE_RET, "RET", 0, 0 },
|
||||||
{ OPCODE_RFL, "RFL", 1, 1 },
|
{ OPCODE_RFL, "RFL", 1, 1 },
|
||||||
|
@@ -148,13 +148,9 @@ typedef enum prog_opcode {
|
|||||||
OPCODE_ABS, /* X X 1.1 X */
|
OPCODE_ABS, /* X X 1.1 X */
|
||||||
OPCODE_ADD, /* X X X X X */
|
OPCODE_ADD, /* X X X X X */
|
||||||
OPCODE_AND, /* */
|
OPCODE_AND, /* */
|
||||||
OPCODE_ARA, /* 2 */
|
|
||||||
OPCODE_ARL, /* X X X */
|
OPCODE_ARL, /* X X X */
|
||||||
OPCODE_ARL_NV, /* 2 */
|
|
||||||
OPCODE_ARR, /* 2 */
|
|
||||||
OPCODE_BGNLOOP, /* opt */
|
OPCODE_BGNLOOP, /* opt */
|
||||||
OPCODE_BGNSUB, /* opt */
|
OPCODE_BGNSUB, /* opt */
|
||||||
OPCODE_BRA, /* 2 */
|
|
||||||
OPCODE_BRK, /* 2 opt */
|
OPCODE_BRK, /* 2 opt */
|
||||||
OPCODE_CAL, /* 2 2 opt */
|
OPCODE_CAL, /* 2 2 opt */
|
||||||
OPCODE_CMP, /* X X */
|
OPCODE_CMP, /* X X */
|
||||||
@@ -204,10 +200,7 @@ typedef enum prog_opcode {
|
|||||||
OPCODE_PK4B, /* X */
|
OPCODE_PK4B, /* X */
|
||||||
OPCODE_PK4UB, /* X */
|
OPCODE_PK4UB, /* X */
|
||||||
OPCODE_POW, /* X X X X */
|
OPCODE_POW, /* X X X X */
|
||||||
OPCODE_POPA, /* 3 */
|
|
||||||
OPCODE_PRINT, /* X X */
|
OPCODE_PRINT, /* X X */
|
||||||
OPCODE_PUSHA, /* 3 */
|
|
||||||
OPCODE_RCC, /* 1.1 */
|
|
||||||
OPCODE_RCP, /* X X X X X */
|
OPCODE_RCP, /* X X X X X */
|
||||||
OPCODE_RET, /* 2 2 opt */
|
OPCODE_RET, /* 2 2 opt */
|
||||||
OPCODE_RFL, /* X */
|
OPCODE_RFL, /* X */
|
||||||
|
@@ -392,7 +392,6 @@ find_next_use(const struct gl_program *prog,
|
|||||||
switch (inst->Opcode) {
|
switch (inst->Opcode) {
|
||||||
case OPCODE_BGNLOOP:
|
case OPCODE_BGNLOOP:
|
||||||
case OPCODE_BGNSUB:
|
case OPCODE_BGNSUB:
|
||||||
case OPCODE_BRA:
|
|
||||||
case OPCODE_CAL:
|
case OPCODE_CAL:
|
||||||
case OPCODE_CONT:
|
case OPCODE_CONT:
|
||||||
case OPCODE_IF:
|
case OPCODE_IF:
|
||||||
@@ -439,7 +438,6 @@ _mesa_is_flow_control_opcode(enum prog_opcode opcode)
|
|||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
case OPCODE_BGNLOOP:
|
case OPCODE_BGNLOOP:
|
||||||
case OPCODE_BGNSUB:
|
case OPCODE_BGNSUB:
|
||||||
case OPCODE_BRA:
|
|
||||||
case OPCODE_CAL:
|
case OPCODE_CAL:
|
||||||
case OPCODE_CONT:
|
case OPCODE_CONT:
|
||||||
case OPCODE_IF:
|
case OPCODE_IF:
|
||||||
|
@@ -748,13 +748,6 @@ _mesa_fprint_instruction_opt(FILE *f,
|
|||||||
fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
|
fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
|
||||||
fprint_comment(f, inst);
|
fprint_comment(f, inst);
|
||||||
break;
|
break;
|
||||||
case OPCODE_BRA:
|
|
||||||
fprintf(f, "BRA %d (%s%s)",
|
|
||||||
inst->BranchTarget,
|
|
||||||
_mesa_condcode_string(inst->DstReg.CondMask),
|
|
||||||
_mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE));
|
|
||||||
fprint_comment(f, inst);
|
|
||||||
break;
|
|
||||||
case OPCODE_IF:
|
case OPCODE_IF:
|
||||||
if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
|
if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
|
||||||
/* Use ordinary register */
|
/* Use ordinary register */
|
||||||
|
Reference in New Issue
Block a user