projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c31158d
)
nir: Recognize sat(add(b2f(a), b2f(b))) as a logical OR.
author
Matt Turner
<mattst88@gmail.com>
Wed, 18 Mar 2015 06:30:43 +0000
(23:30 -0700)
committer
Matt Turner
<mattst88@gmail.com>
Tue, 24 Mar 2015 21:43:37 +0000
(14:43 -0700)
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>
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 f956edff3c3e10eafcdc580e9c29fd55190ce4a0..1ee51a05f80edc1334d145b46e6c9ec82e2c6cda 100644
(file)
--- 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.