glsl2: Add a pass to transform ir_binop_sub to add(op0, neg(op1))
authorEric Anholt <eric@anholt.net>
Tue, 10 Aug 2010 04:22:17 +0000 (21:22 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 10 Aug 2010 04:41:14 +0000 (21:41 -0700)
commit5854d4583c6e8885185e12a0636f77489a62e24c
tree38a132c8c1d5a1f09fc4733da1584fe5dbdd47a3
parent8bebbeb7c5b26ec9166a4644a2c051238d18509b
glsl2: Add a pass to transform ir_binop_sub to add(op0, neg(op1))

All the current HW backends transform subtract to adding the negation,
so I haven't bothered peepholing it back out in Mesa IR.  This allows
some subtract of subtract to get removed in ir_algebraic.
src/glsl/Makefile
src/glsl/ir_optimization.h
src/glsl/ir_sub_to_add_neg.cpp [new file with mode: 0644]
src/glsl/linker.cpp
src/mesa/program/ir_to_mesa.cpp