mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-04 06:38:19 +02:00
r300: remove unused LIT opcode
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41618>
This commit is contained in:
parent
e5d9cdb62a
commit
2a9473e7ea
5 changed files with 0 additions and 74 deletions
|
|
@ -241,41 +241,6 @@ ei_cmp(struct r300_vertex_program_code *vp, struct rc_sub_instruction *vpi, unsi
|
|||
inst[3] = t_src(vp, &vpi->SrcReg[1]);
|
||||
}
|
||||
|
||||
static void
|
||||
ei_lit(struct r300_vertex_program_code *vp, struct rc_sub_instruction *vpi, unsigned int *inst)
|
||||
{
|
||||
// LIT TMP 1.Y Z TMP 1{} {X W Z Y} TMP 1{} {Y W Z X} TMP 1{} {Y X Z W}
|
||||
|
||||
inst[0] = PVS_OP_DST_OPERAND(ME_LIGHT_COEFF_DX, 1, 0, t_dst_index(vp, &vpi->DstReg),
|
||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File),
|
||||
vpi->SaturateMode == RC_SATURATE_ZERO_ONE);
|
||||
/* NOTE: Users swizzling might not work. */
|
||||
inst[1] = PVS_SRC_OPERAND(t_src_index(vp, &vpi->SrcReg[0]),
|
||||
t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 0)), // X
|
||||
t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 3)), // W
|
||||
PVS_SRC_SELECT_FORCE_0, // Z
|
||||
t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 1)), // Y
|
||||
t_src_class(vpi->SrcReg[0].File),
|
||||
vpi->SrcReg[0].Negate ? RC_MASK_XYZW : RC_MASK_NONE) |
|
||||
(vpi->SrcReg[0].RelAddr << 4);
|
||||
inst[2] = PVS_SRC_OPERAND(t_src_index(vp, &vpi->SrcReg[0]),
|
||||
t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 1)), // Y
|
||||
t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 3)), // W
|
||||
PVS_SRC_SELECT_FORCE_0, // Z
|
||||
t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 0)), // X
|
||||
t_src_class(vpi->SrcReg[0].File),
|
||||
vpi->SrcReg[0].Negate ? RC_MASK_XYZW : RC_MASK_NONE) |
|
||||
(vpi->SrcReg[0].RelAddr << 4);
|
||||
inst[3] = PVS_SRC_OPERAND(t_src_index(vp, &vpi->SrcReg[0]),
|
||||
t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 1)), // Y
|
||||
t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 0)), // X
|
||||
PVS_SRC_SELECT_FORCE_0, // Z
|
||||
t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 3)), // W
|
||||
t_src_class(vpi->SrcReg[0].File),
|
||||
vpi->SrcReg[0].Negate ? RC_MASK_XYZW : RC_MASK_NONE) |
|
||||
(vpi->SrcReg[0].RelAddr << 4);
|
||||
}
|
||||
|
||||
static void
|
||||
ei_mad(struct r300_vertex_program_code *vp, struct rc_sub_instruction *vpi, unsigned int *inst)
|
||||
{
|
||||
|
|
@ -473,9 +438,6 @@ translate_vertex_program(struct radeon_compiler *c, void *user)
|
|||
ei_math1_select(compiler->code, compiler->Base.math_rules, ME_LOG_BASE2_IEEE,
|
||||
ME_LOG_BASE2_FULL_DX, ME_LOG_BASE2_FULL_DX, vpi, inst);
|
||||
break;
|
||||
case RC_OPCODE_LIT:
|
||||
ei_lit(compiler->code, vpi, inst);
|
||||
break;
|
||||
case RC_OPCODE_LOG:
|
||||
ei_math1(compiler->code, ME_LOG_BASE2_DX, vpi, inst);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -129,12 +129,6 @@ const struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = {
|
|||
.HasDstReg = 1,
|
||||
.IsStandardScalar = 1,
|
||||
},
|
||||
{
|
||||
.Opcode = RC_OPCODE_LIT,
|
||||
.Name = "LIT",
|
||||
.NumSrcRegs = 1,
|
||||
.HasDstReg = 1,
|
||||
},
|
||||
{
|
||||
.Opcode = RC_OPCODE_LOG,
|
||||
.Name = "LOG",
|
||||
|
|
@ -500,9 +494,6 @@ rc_compute_sources_for_writemask(const struct rc_instruction *inst, unsigned int
|
|||
case RC_OPCODE_LOG:
|
||||
srcmasks[0] |= RC_MASK_XY;
|
||||
break;
|
||||
case RC_OPCODE_LIT:
|
||||
srcmasks[0] |= RC_MASK_X | RC_MASK_Y | RC_MASK_W;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,9 +70,6 @@ typedef enum {
|
|||
/** scalar instruction: dst = log_2(src0.x) */
|
||||
RC_OPCODE_LG2,
|
||||
|
||||
/** special instruction, see ARB_vertex_program */
|
||||
RC_OPCODE_LIT,
|
||||
|
||||
/** special instruction, see ARB_vertex_program */
|
||||
RC_OPCODE_LOG,
|
||||
|
||||
|
|
|
|||
|
|
@ -198,26 +198,6 @@ transform_r300_vertex_DP3(struct radeon_compiler *c, struct rc_instruction *inst
|
|||
rc_remove_instruction(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
transform_r300_vertex_fix_LIT(struct radeon_compiler *c, struct rc_instruction *inst)
|
||||
{
|
||||
struct rc_dst_register dst = new_dst_reg(c, inst);
|
||||
unsigned constant_swizzle;
|
||||
int constant = rc_constants_add_immediate_scalar(&c->Program.Constants, 0.0000000000000000001,
|
||||
&constant_swizzle);
|
||||
|
||||
/* MOV dst, src */
|
||||
dst.WriteMask = RC_MASK_XYZW;
|
||||
emit1(c, inst->Prev, RC_OPCODE_MOV, NULL, dst, inst->U.I.SrcReg[0]);
|
||||
|
||||
/* MAX dst.y, src, 0.00...001 */
|
||||
emit2(c, inst->Prev, RC_OPCODE_MAX, NULL, dstregtmpmask(dst.Index, RC_MASK_Y),
|
||||
srcreg(RC_FILE_TEMPORARY, dst.Index),
|
||||
srcregswz(RC_FILE_CONSTANT, constant, constant_swizzle));
|
||||
|
||||
inst->U.I.SrcReg[0] = srcreg(RC_FILE_TEMPORARY, dst.Index);
|
||||
}
|
||||
|
||||
static void
|
||||
transform_r300_vertex_SEQ(struct radeon_compiler *c, struct rc_instruction *inst)
|
||||
{
|
||||
|
|
@ -275,9 +255,6 @@ r300_transform_vertex_alu(struct radeon_compiler *c, struct rc_instruction *inst
|
|||
case RC_OPCODE_DP3:
|
||||
transform_r300_vertex_DP3(c, inst);
|
||||
return 1;
|
||||
case RC_OPCODE_LIT:
|
||||
transform_r300_vertex_fix_LIT(c, inst);
|
||||
return 1;
|
||||
case RC_OPCODE_SEQ:
|
||||
if (!c->is_r500) {
|
||||
transform_r300_vertex_SEQ(c, inst);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ static unsigned translate_opcode(unsigned opcode)
|
|||
switch(opcode) {
|
||||
case TGSI_OPCODE_ARL: return RC_OPCODE_ARL;
|
||||
case TGSI_OPCODE_MOV: return RC_OPCODE_MOV;
|
||||
case TGSI_OPCODE_LIT: return RC_OPCODE_LIT;
|
||||
case TGSI_OPCODE_RCP: return RC_OPCODE_RCP;
|
||||
case TGSI_OPCODE_RSQ: return RC_OPCODE_RSQ;
|
||||
case TGSI_OPCODE_EXP: return RC_OPCODE_EXP;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue