mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
r300: remove the remaining of backend constant folding
This was needed to clean up after the comparison opcode lowering which has now beed moved earlier to NIR. We just need to clean up the special case of add a,0 manually as this happens way too late for any other standard algebraic pass. Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com> Reviewed-by: Filip Gawin <filip.gawin@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27089>
This commit is contained in:
parent
553e841d7c
commit
18a0ff121e
1 changed files with 0 additions and 25 deletions
|
|
@ -242,27 +242,6 @@ static int is_src_uniform_constant(struct rc_src_register src,
|
|||
return 1;
|
||||
}
|
||||
|
||||
static void constant_folding_add(struct rc_instruction * inst)
|
||||
{
|
||||
rc_swizzle swz = 0;
|
||||
unsigned int negate = 0;
|
||||
|
||||
if (is_src_uniform_constant(inst->U.I.SrcReg[0], &swz, &negate)) {
|
||||
if (swz == RC_SWIZZLE_ZERO) {
|
||||
inst->U.I.Opcode = RC_OPCODE_MOV;
|
||||
inst->U.I.SrcReg[0] = inst->U.I.SrcReg[1];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_src_uniform_constant(inst->U.I.SrcReg[1], &swz, &negate)) {
|
||||
if (swz == RC_SWIZZLE_ZERO) {
|
||||
inst->U.I.Opcode = RC_OPCODE_MOV;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace 0.0, 1.0 and 0.5 immediate constants by their
|
||||
* respective swizzles. Simplify instructions like ADD dst, src, 0;
|
||||
|
|
@ -344,10 +323,6 @@ static void constant_folding(struct radeon_compiler * c, struct rc_instruction *
|
|||
inst->U.I.SrcReg[src] = newsrc;
|
||||
}
|
||||
|
||||
if (c->type == RC_FRAGMENT_PROGRAM &&
|
||||
inst->U.I.Opcode == RC_OPCODE_ADD)
|
||||
constant_folding_add(inst);
|
||||
|
||||
/* In case this instruction has been converted, make sure all of the
|
||||
* registers that are no longer used are empty. */
|
||||
opcode = rc_get_opcode_info(inst->U.I.Opcode);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue