nir: Lower subtraction to add with negation when !lower_negate.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 25 Mar 2015 22:22:12 +0000 (15:22 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 28 Mar 2015 04:16:34 +0000 (21:16 -0700)
commitbf2c3bc316cbfcc19d1bb65ab7410784ed7a3dac
tree771ed6fe47e30b6b21d76eedabf3a47ab10ab24e
parentfaf6106c6f6fa2ba90ec175baaa8b54bec9f5125
nir: Lower subtraction to add with negation when !lower_negate.

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