mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
vc4: Optimize SF(ITOF(x)) -> SF(x).
This is a common production of st_glsl_to_tgsi, because CMP takes a float argument.
This commit is contained in:
parent
00a9aebfe0
commit
5a13522898
1 changed files with 16 additions and 0 deletions
|
|
@ -91,6 +91,22 @@ qir_opt_algebraic(struct vc4_compile *c)
|
|||
defs[inst->dst.index] = inst;
|
||||
|
||||
switch (inst->op) {
|
||||
case QOP_SF:
|
||||
/* SF just looks at the sign bit, or whether all the
|
||||
* bits are 0. This is preserved across an itof
|
||||
* transformation.
|
||||
*/
|
||||
if (inst->src[0].file == QFILE_TEMP &&
|
||||
defs[inst->src[0].index]->op == QOP_ITOF) {
|
||||
dump_from(c, inst);
|
||||
inst->src[0] =
|
||||
defs[inst->src[0].index]->src[0];
|
||||
progress = true;
|
||||
dump_to(c, inst);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case QOP_SEL_X_Y_ZS:
|
||||
case QOP_SEL_X_Y_ZC:
|
||||
case QOP_SEL_X_Y_NS:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue