projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
56e2164
)
nir: Recognize open-coded fmin/fmax.
author
Matt Turner
<mattst88@gmail.com>
Wed, 11 Feb 2015 05:43:32 +0000
(21:43 -0800)
committer
Matt Turner
<mattst88@gmail.com>
Wed, 11 Feb 2015 21:50:19 +0000
(13:50 -0800)
And unfortunately other shaders do the same thing but with >=/<= which
we can't apply this optimization to because of NaNs.
instructions in affected programs: 23309 -> 22938 (-1.59%)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/nir/nir_opt_algebraic.py
patch
|
blob
|
history
diff --git
a/src/glsl/nir/nir_opt_algebraic.py
b/src/glsl/nir/nir_opt_algebraic.py
index 2b4259e4654d7d1d93b90574e899afaf7dc01b05..83223f768cd3397cea92148b2d800d3e962dca8a 100644
(file)
--- a/
src/glsl/nir/nir_opt_algebraic.py
+++ b/
src/glsl/nir/nir_opt_algebraic.py
@@
-82,6
+82,8
@@
optimizations = [
(('feq', ('fadd', a, b), 0.0), ('feq', a, ('fneg', b))),
(('fne', ('fadd', a, b), 0.0), ('fne', a, ('fneg', 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)),
(('fmin', ('fmax', a, 0.0), 1.0), ('fsat', a)),
# Comparison with the same args. Note that these are not done for
# the float versions because NaN always returns false on float