mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 02:40:11 +01:00
nir: Add algebraic opt for int comparisons with identical operands.
No change on shader-db on i965. v2: Reword the comment due to feedback from Erik Faye-Lund Reviewed-by: Connor Abbott <cwabbott0@gmail.com> (v1) Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> (v1)
This commit is contained in:
parent
2919bdf466
commit
56e21647e2
1 changed files with 9 additions and 0 deletions
|
|
@ -83,6 +83,15 @@ optimizations = [
|
||||||
(('fne', ('fadd', a, b), 0.0), ('fne', a, ('fneg', b))),
|
(('fne', ('fadd', a, b), 0.0), ('fne', a, ('fneg', b))),
|
||||||
(('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)),
|
(('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)),
|
||||||
(('fmin', ('fmax', a, 0.0), 1.0), ('fsat', a)),
|
(('fmin', ('fmax', a, 0.0), 1.0), ('fsat', a)),
|
||||||
|
# Comparison with the same args. Note that these are not done for
|
||||||
|
# the float versions because NaN always returns false on float
|
||||||
|
# inequalities.
|
||||||
|
(('ilt', a, a), False),
|
||||||
|
(('ige', a, a), True),
|
||||||
|
(('ieq', a, a), True),
|
||||||
|
(('ine', a, a), False),
|
||||||
|
(('ult', a, a), False),
|
||||||
|
(('uge', a, a), True),
|
||||||
# Logical and bit operations
|
# Logical and bit operations
|
||||||
(('fand', a, 0.0), 0.0),
|
(('fand', a, 0.0), 0.0),
|
||||||
(('iand', a, a), a),
|
(('iand', a, a), a),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue