Mesa (master): nir: Recognize and reduce duplicated fsats.

Eric Anholt anholt at kemper.freedesktop.org
Wed Feb 18 22:57:23 UTC 2015


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Jan 30 14:10:58 2015 -0800

nir: Recognize and reduce duplicated fsats.

No effect on vc4 shader-db.

v2: Rebase to master (no TGSI->NIR present)

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org> (v1)

---

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

diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py
index c7cb651..504c9f6 100644
--- a/src/glsl/nir/nir_opt_algebraic.py
+++ b/src/glsl/nir/nir_opt_algebraic.py
@@ -87,6 +87,8 @@ optimizations = [
    (('bcsel', ('flt', a, b), b, a), ('fmax', a, b)),
    (('fmin', ('fmax', a, 0.0), 1.0), ('fsat', a), '!options->lower_fsat'),
    (('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)),
    # Comparison with the same args.  Note that these are not done for
    # the float versions because NaN always returns false on float
    # inequalities.




More information about the mesa-commit mailing list