glsl: Optimize mul(a, -1) into neg(a).
authorMatt Turner <mattst88@gmail.com>
Wed, 16 Oct 2013 06:42:19 +0000 (23:42 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 17 Oct 2013 03:49:43 +0000 (20:49 -0700)
commita360ca7476a967d12c6622bbe4e5e65e74fccd50
treefa24019ff4edc5ef0df14bb049631a1957f6b9e7
parent197f3a33fbce525e8f7799466935304d9e24c0f1
glsl: Optimize mul(a, -1) into neg(a).

Two extra instructions in some heroesofnewerth shaders, but a win for
everything else.

total instructions in shared programs: 1531352 -> 1530815 (-0.04%)
instructions in affected programs:     121898 -> 121361 (-0.44%)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/opt_algebraic.cpp