mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 08:30:10 +01:00
nir: Recognize mul(b2f(a), b2f(b)) as a logical AND.
Transform this into b2f(and(a, b)).
total instructions in shared programs: 6205448 -> 6204391 (-0.02%)
instructions in affected programs: 284030 -> 282973 (-0.37%)
helped: 903
HURT: 6
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
parent
b481ebbe39
commit
c31158d2cb
1 changed files with 2 additions and 0 deletions
|
|
@ -95,6 +95,8 @@ optimizations = [
|
|||
(('fsat', a), ('fmin', ('fmax', a, 0.0), 1.0), 'options->lower_fsat'),
|
||||
(('fsat', ('fsat', a)), ('fsat', a)),
|
||||
(('fmin', ('fmax', ('fmin', ('fmax', a, 0.0), 1.0), 0.0), 1.0), ('fmin', ('fmax', a, 0.0), 1.0)),
|
||||
# Emulating booleans
|
||||
(('fmul', ('b2f', a), ('b2f', b)), ('b2f', ('iand', a, b))),
|
||||
# Comparison with the same args. Note that these are not done for
|
||||
# the float versions because NaN always returns false on float
|
||||
# inequalities.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue