summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2015-03-17 23:30:43 -0700
committerMatt Turner <mattst88@gmail.com>2015-03-24 14:43:37 -0700
commit3fb56805f0dbfe929cd733e15566197bc0733290 (patch)
treeb28924ffffba6c87fb4fd0b3c181b134cd59767c /src
parentc31158d2cb06a864cf44d6d4f2c539e359990d3d (diff)
downloadexternal_mesa3d-3fb56805f0dbfe929cd733e15566197bc0733290.zip
external_mesa3d-3fb56805f0dbfe929cd733e15566197bc0733290.tar.gz
external_mesa3d-3fb56805f0dbfe929cd733e15566197bc0733290.tar.bz2
nir: Recognize sat(add(b2f(a), b2f(b))) as a logical OR.
Transform this into b2f(or(a, b)). instructions in affected programs: 432 -> 430 (-0.46%) helped: 2 Acked-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/nir/nir_opt_algebraic.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py
index f956edf..1ee51a0 100644
--- a/src/glsl/nir/nir_opt_algebraic.py
+++ b/src/glsl/nir/nir_opt_algebraic.py
@@ -97,6 +97,7 @@ optimizations = [
(('fmin', ('fmax', ('fmin', ('fmax', a, 0.0), 1.0), 0.0), 1.0), ('fmin', ('fmax', a, 0.0), 1.0)),
# Emulating booleans
(('fmul', ('b2f', a), ('b2f', b)), ('b2f', ('iand', a, b))),
+ (('fsat', ('fadd', ('b2f', a), ('b2f', b))), ('b2f', ('ior', a, b))),
# Comparison with the same args. Note that these are not done for
# the float versions because NaN always returns false on float
# inequalities.