mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
i965/fs: Optimize saturating SEL.L(E) with imm val >= 1.0.
total instructions in shared programs: 1409124 -> 1406971 (-0.15%) instructions in affected programs: 158376 -> 156223 (-1.36%) Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
parent
a8f76d829b
commit
ca675b73d3
1 changed files with 22 additions and 0 deletions
|
|
@ -1880,6 +1880,28 @@ fs_visitor::opt_algebraic()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case BRW_OPCODE_SEL:
|
||||||
|
if (inst->saturate && inst->src[1].file == IMM) {
|
||||||
|
switch (inst->conditional_mod) {
|
||||||
|
case BRW_CONDITIONAL_LE:
|
||||||
|
case BRW_CONDITIONAL_L:
|
||||||
|
switch (inst->src[1].type) {
|
||||||
|
case BRW_REGISTER_TYPE_F:
|
||||||
|
if (inst->src[1].imm.f >= 1.0f) {
|
||||||
|
inst->opcode = BRW_OPCODE_MOV;
|
||||||
|
inst->src[1] = reg_undef;
|
||||||
|
progress = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue