r300: Remove unused RC_OPCODE_ABS.

Nothing generates it in the backend.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14211>
This commit is contained in:
Emma Anholt 2021-12-08 12:17:43 -08:00 committed by Marge Bot
parent 7a0c3b1024
commit 2e2b755ecb
3 changed files with 1 additions and 33 deletions

View file

@ -41,13 +41,6 @@ const struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = {
.Opcode = RC_OPCODE_ILLEGAL_OPCODE,
.Name = "ILLEGAL OPCODE"
},
{
.Opcode = RC_OPCODE_ABS,
.Name = "ABS",
.NumSrcRegs = 1,
.HasDstReg = 1,
.IsComponentwise = 1
},
{
.Opcode = RC_OPCODE_ADD,
.Name = "ADD",

View file

@ -37,9 +37,6 @@ typedef enum {
RC_OPCODE_NOP = 0,
RC_OPCODE_ILLEGAL_OPCODE,
/** vec4 instruction: dst.c = abs(src0.c); */
RC_OPCODE_ABS,
/** vec4 instruction: dst.c = src0.c + src1.c; */
RC_OPCODE_ADD,

View file

@ -226,16 +226,6 @@ static struct rc_dst_register try_to_reuse_dst(struct radeon_compiler *c,
return dstregtmpmask(tmp, inst->U.I.DstReg.WriteMask);
}
static void transform_ABS(struct radeon_compiler* c,
struct rc_instruction* inst)
{
struct rc_src_register src = inst->U.I.SrcReg[0];
src.Abs = 1;
src.Negate = RC_MASK_NONE;
emit1(c, inst->Prev, RC_OPCODE_MOV, &inst->U.I, inst->U.I.DstReg, src);
rc_remove_instruction(inst);
}
static void transform_CEIL(struct radeon_compiler* c,
struct rc_instruction* inst)
{
@ -647,7 +637,7 @@ static void transform_XPD(struct radeon_compiler* c,
* no userData necessary.
*
* Eliminates the following ALU instructions:
* ABS, CEIL, DPH, DST, FLR, LIT, LRP, POW, SEQ, SFL, SGE, SGT, SLE, SLT, SNE, SUB, SWZ, XPD
* CEIL, DPH, DST, FLR, LIT, LRP, POW, SEQ, SFL, SGE, SGT, SLE, SLT, SNE, SUB, SWZ, XPD
* using:
* MOV, ADD, MUL, MAD, FRC, DP3, LG2, EX2, CMP
*
@ -662,7 +652,6 @@ int radeonTransformALU(
void* unused)
{
switch(inst->U.I.Opcode) {
case RC_OPCODE_ABS: transform_ABS(c, inst); return 1;
case RC_OPCODE_CEIL: transform_CEIL(c, inst); return 1;
case RC_OPCODE_CLAMP: transform_CLAMP(c, inst); return 1;
case RC_OPCODE_DP2: transform_DP2(c, inst); return 1;
@ -691,16 +680,6 @@ int radeonTransformALU(
}
}
static void transform_r300_vertex_ABS(struct radeon_compiler* c,
struct rc_instruction* inst)
{
/* Note: r500 can take absolute values, but r300 cannot. */
inst->U.I.Opcode = RC_OPCODE_MAX;
inst->U.I.SrcReg[1] = inst->U.I.SrcReg[0];
inst->U.I.SrcReg[1].Negate ^= RC_MASK_XYZW;
}
static void transform_r300_vertex_CMP(struct radeon_compiler* c,
struct rc_instruction* inst)
{
@ -906,7 +885,6 @@ int r300_transform_vertex_alu(
void* unused)
{
switch(inst->U.I.Opcode) {
case RC_OPCODE_ABS: transform_r300_vertex_ABS(c, inst); return 1;
case RC_OPCODE_CEIL: transform_CEIL(c, inst); return 1;
case RC_OPCODE_CLAMP: transform_CLAMP(c, inst); return 1;
case RC_OPCODE_CMP: transform_r300_vertex_CMP(c, inst); return 1;