projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
26261bc
)
nir: Recognize a pattern for doing b2f without the opcode.
author
Eric Anholt
<eric@anholt.net>
Mon, 30 Mar 2015 05:59:39 +0000
(22:59 -0700)
committer
Eric Anholt
<eric@anholt.net>
Wed, 1 Apr 2015 17:57:01 +0000
(10:57 -0700)
Since we have patterns based on b2f, generate them if we see the b2f
equivalent using an iand. This is common when generating NIR from TGSI.
Reviewed-by: Connor Abbott <cwabbott0@gmail.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 66b456d1164d4016d8085507f0349a60103a9c66..301d7a8ebcf59a5d9a0a33139da1c944648a6df2 100644
(file)
--- a/
src/glsl/nir/nir_opt_algebraic.py
+++ b/
src/glsl/nir/nir_opt_algebraic.py
@@
-99,6
+99,7
@@
optimizations = [
# Emulating booleans
(('fmul', ('b2f', a), ('b2f', b)), ('b2f', ('iand', a, b))),
(('fsat', ('fadd', ('b2f', a), ('b2f', b))), ('b2f', ('ior', a, b))),
+ (('iand', 'a@bool', 1.0), ('b2f', a)),
# Comparison with the same args. Note that these are not done for
# the float versions because NaN always returns false on float
# inequalities.