Mesa (master): nir: Allow feq/fne/ieq/ine to be optimized with inot.

Matt Turner mattst88 at kemper.freedesktop.org
Thu May 7 18:03:16 UTC 2015


Module: Mesa
Branch: master
Commit: 8e029105c2e6959390a68116ac6d1d277815519f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8e029105c2e6959390a68116ac6d1d277815519f

Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue May  5 22:54:59 2015 -0700

nir: Allow feq/fne/ieq/ine to be optimized with inot.

instructions in affected programs:     380 -> 376 (-1.05%)
helped:                                2

Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Glenn Kennard <glenn.kennard at gmail.com>

---

 src/glsl/nir/nir_opt_algebraic.py |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py
index b0a1f24..400d60e 100644
--- a/src/glsl/nir/nir_opt_algebraic.py
+++ b/src/glsl/nir/nir_opt_algebraic.py
@@ -83,8 +83,12 @@ optimizations = [
    # Comparison simplifications
    (('inot', ('flt', a, b)), ('fge', a, b)),
    (('inot', ('fge', a, b)), ('flt', a, b)),
+   (('inot', ('feq', a, b)), ('fne', a, b)),
+   (('inot', ('fne', a, b)), ('feq', a, b)),
    (('inot', ('ilt', a, b)), ('ige', a, b)),
    (('inot', ('ige', a, b)), ('ilt', a, b)),
+   (('inot', ('ieq', a, b)), ('ine', a, b)),
+   (('inot', ('ine', a, b)), ('ieq', a, b)),
    (('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)),
    (('bcsel', ('flt', a, b), a, b), ('fmin', a, b)),
    (('bcsel', ('flt', a, b), b, a), ('fmax', a, b)),




More information about the mesa-commit mailing list