projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a74fc3f
)
nir: Propagate negates up multiplication chains.
author
Matt Turner
<mattst88@gmail.com>
Mon, 22 Feb 2016 23:16:49 +0000
(15:16 -0800)
committer
Matt Turner
<mattst88@gmail.com>
Wed, 30 Mar 2016 20:12:34 +0000
(13:12 -0700)
total instructions in shared programs:
7112159
->
7088092
(-0.34%)
instructions in affected programs:
1374915
->
1350848
(-1.75%)
helped: 7392
HURT: 621
GAINED: 2
LOST: 2
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 53633233f2bc74c46b5251a0ba9c6361077c0f8b..c2e56e71734ddaa39b5a9aee2be6f6dc8599bbe8 100644
(file)
--- a/
src/compiler/nir/nir_opt_algebraic.py
+++ b/
src/compiler/nir/nir_opt_algebraic.py
@@
-269,6
+269,10
@@
optimizations = [
(('fabs', ('fsub', 0.0, a)), ('fabs', a)),
(('iabs', ('isub', 0, a)), ('iabs', a)),
+ # Propagate negation up multiplication chains
+ (('fmul', ('fneg', a), b), ('fneg', ('fmul', a, b))),
+ (('imul', ('ineg', a), b), ('ineg', ('fmul', a, b))),
+
# Misc. lowering
(('fmod', a, b), ('fsub', a, ('fmul', b, ('ffloor', ('fdiv', a, b)))), 'options->lower_fmod'),
(('uadd_carry', a, b), ('b2i', ('ult', ('iadd', a, b), a)), 'options->lower_uadd_carry'),