Mesa (master): nir: Transform expressions of b2f(a) and b2f(b) to a && b

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Aug 4 08:12:21 UTC 2018


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

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Aug  1 19:31:22 2018 -0700

nir: Transform expressions of b2f(a) and b2f(b) to a && b

No changes on any Gen platform.

v2: s/fmax/fmin/.  Noticed by Thomas Helland.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Thomas Helland <thomashelland90 at gmail.com>

---

 src/compiler/nir/nir_opt_algebraic.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index 341d52d677..7431642c8a 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -170,6 +170,9 @@ optimizations = [
    (('fne', ('fmax', ('b2f', a), ('b2f', b)), 0.0), ('ior', a, b)),
    (('fne', ('bcsel', a, 1.0, ('b2f', b))   , 0.0), ('ior', a, b)),
    (('fne', ('b2f', a), ('fneg', ('b2f', b))),      ('ior', a, b)),
+   (('fne', ('fmul', ('b2f', a), ('b2f', b)), 0.0), ('iand', a, b)),
+   (('fne', ('fmin', ('b2f', a), ('b2f', b)), 0.0), ('iand', a, b)),
+   (('fne', ('bcsel', a, ('b2f', b), 0.0)   , 0.0), ('iand', a, b)),
    (('feq', ('fadd', ('b2f', a), ('b2f', b)), 0.0), ('inot', ('ior', a, b))),
    (('feq', ('fmax', ('b2f', a), ('b2f', b)), 0.0), ('inot', ('ior', a, b))),
    (('feq', ('bcsel', a, 1.0, ('b2f', b))   , 0.0), ('inot', ('ior', a, b))),




More information about the mesa-commit mailing list