projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
faf6106
)
nir: Lower subtraction to add with negation when !lower_negate.
author
Kenneth Graunke
<kenneth@whitecape.org>
Wed, 25 Mar 2015 22:22:12 +0000
(15:22 -0700)
committer
Kenneth Graunke
<kenneth@whitecape.org>
Sat, 28 Mar 2015 04:16:34 +0000
(21:16 -0700)
prog->nir will generate fsub opcodes, but i965 doesn't implement them.
We may as well lower them at the NIR level, since it's trivial to do.
Suggested by Connor Abbott.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
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 20ec4d3a39af8e29aa7d6824c97403c78730e695..66b456d1164d4016d8085507f0349a60103a9c66 100644
(file)
--- a/
src/glsl/nir/nir_opt_algebraic.py
+++ b/
src/glsl/nir/nir_opt_algebraic.py
@@
-161,6
+161,8
@@
optimizations = [
# Subtracts
(('fsub', a, ('fsub', 0.0, b)), ('fadd', a, b)),
(('isub', a, ('isub', 0, b)), ('iadd', a, b)),
+ (('fsub', a, b), ('fadd', a, ('fneg', b)), '!options->lower_negate'),
+ (('isub', a, b), ('iadd', a, ('ineg', b)), '!options->lower_negate'),
(('fneg', a), ('fsub', 0.0, a), 'options->lower_negate'),
(('ineg', a), ('isub', 0, a), 'options->lower_negate'),
(('fadd', a, ('fsub', 0.0, b)), ('fsub', a, b)),