Re: [Mesa-dev] [PATCH 01/10] i965/vs: Add support for simple algebraic optimizations.

2011-09-09 Thread Eric Anholt
On Fri, 09 Sep 2011 15:21:14 -0700, Kenneth Graunke wrote: > On 09/08/2011 11:32 PM, Eric Anholt wrote: > > + * Does algebraic optimizations (0 * a = 0, 1 * a = a, a + 0 = a). > > I was going to ask "what about commutativity?"...after all, 0 * a but a > + 0 seems kind of arbitrary...but then I i

Re: [Mesa-dev] [PATCH 01/10] i965/vs: Add support for simple algebraic optimizations.

2011-09-09 Thread Kenneth Graunke
On 09/08/2011 11:32 PM, Eric Anholt wrote: > + * Does algebraic optimizations (0 * a = 0, 1 * a = a, a + 0 = a). I was going to ask "what about commutativity?"...after all, 0 * a but a + 0 seems kind of arbitrary...but then I implemented it and tried it on shader-db: Total instructions: 39967 ->

Re: [Mesa-dev] [PATCH 01/10] i965/vs: Add support for simple algebraic optimizations.

2011-09-09 Thread Kenneth Graunke
On 09/08/2011 11:32 PM, Eric Anholt wrote: > We generate silly code for array access, and it's easier to generally > support the cleanup than to specifically avoid the bad code in each > place we might generate it. > > Removes 4.6% of instructions from 41.6% of shaders in shader-db, > particularly

[Mesa-dev] [PATCH 01/10] i965/vs: Add support for simple algebraic optimizations.

2011-09-08 Thread Eric Anholt
We generate silly code for array access, and it's easier to generally support the cleanup than to specifically avoid the bad code in each place we might generate it. Removes 4.6% of instructions from 41.6% of shaders in shader-db, particularly savage2/hon and unigine. --- src/mesa/drivers/dri/i96