projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1713c97
)
nir: Transform expressions of b2f(a) and b2f(b) to !(a && b)
author
Ian Romanick
<ian.d.romanick@intel.com>
Thu, 2 Aug 2018 02:32:18 +0000
(19:32 -0700)
committer
Ian Romanick
<ian.d.romanick@intel.com>
Sat, 4 Aug 2018 08:12:03 +0000
(
01:12
-0700)
All Gen platforms had pretty similar results. (Skylake shown)
total cycles in shared programs:
532578400
->
532578397
(<.01%)
cycles in affected programs: 2784 -> 2781 (-0.11%)
helped: 1
HURT: 1
helped stats (abs) min: 4 max: 4 x̄: 4.00 x̃: 4
helped stats (rel) min: 0.26% max: 0.26% x̄: 0.26% x̃: 0.26%
HURT stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel) min: 0.08% max: 0.08% x̄: 0.08% x̃: 0.08%
v2: s/fmax/fmin/. Noticed by Thomas Helland.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
src/compiler/nir/nir_opt_algebraic.py
patch
|
blob
|
history
diff --git
a/src/compiler/nir/nir_opt_algebraic.py
b/src/compiler/nir/nir_opt_algebraic.py
index 7431642c8a0bf0aa1d3e8cd8f2f917945787d5a6..9ead2dd37d59b4e6d41e8708c11bc34d4ce51a15 100644
(file)
--- a/
src/compiler/nir/nir_opt_algebraic.py
+++ b/
src/compiler/nir/nir_opt_algebraic.py
@@
-177,6
+177,9
@@
optimizations = [
(('feq', ('fmax', ('b2f', a), ('b2f', b)), 0.0), ('inot', ('ior', a, b))),
(('feq', ('bcsel', a, 1.0, ('b2f', b)) , 0.0), ('inot', ('ior', a, b))),
(('feq', ('b2f', a), ('fneg', ('b2f', b))), ('inot', ('ior', a, b))),
+ (('feq', ('fmul', ('b2f', a), ('b2f', b)), 0.0), ('inot', ('iand', a, b))),
+ (('feq', ('fmin', ('b2f', a), ('b2f', b)), 0.0), ('inot', ('iand', a, b))),
+ (('feq', ('bcsel', a, ('b2f', b), 0.0) , 0.0), ('inot', ('iand', a, b))),
# -(b2f(a) + b2f(b)) < 0
# 0 < b2f(a) + b2f(b)