Mesa (master): nir/algebraic: Simplify fsat of fsign

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 9 20:57:01 UTC 2018


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

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Sun Sep  9 13:40:02 2018 -0700

nir/algebraic: Simplify fsat of fsign

These allows us to not support fsign.sat in the Intel compiler backend,
and that will simplify some later changes.

No shader-db changes on any Intel platform.

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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index 3267e93a58..422a8794d3 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -329,6 +329,7 @@ optimizations = [
    (('imax', a, ('ineg', a)), ('iabs', a)),
    (('~fmin', ('fmax', a, 0.0), 1.0), ('fsat', a), '!options->lower_fsat'),
    (('~fmax', ('fmin', a, 1.0), 0.0), ('fsat', a), '!options->lower_fsat'),
+   (('fsat', ('fsign', a)), ('b2f', ('flt', 0.0, a))),
    (('fsat', a), ('fmin', ('fmax', a, 0.0), 1.0), 'options->lower_fsat'),
    (('fsat', ('fsat', a)), ('fsat', a)),
    (('fmin', ('fmax', ('fmin', ('fmax', a, b), c), b), c), ('fmin', ('fmax', a, b), c)),




More information about the mesa-commit mailing list