Re: [Mesa-dev] [PATCH] glsl: Optimize AND/OR reductions used in vec4 comparisons.

2013-05-10 Thread Matt Turner
On Fri, May 10, 2013 at 2:49 PM, Ian Romanick wrote: > On 05/08/2013 07:21 PM, Matt Turner wrote: >> >> For vec4 equality comparisons we emit >> >> (and (and (and a b) c) d) > > > Refresh my memory... what generates this? Is this from the compiler itself, > or are people writing this code by

Re: [Mesa-dev] [PATCH] glsl: Optimize AND/OR reductions used in vec4 comparisons.

2013-05-10 Thread Ian Romanick
On 05/08/2013 07:21 PM, Matt Turner wrote: For vec4 equality comparisons we emit (and (and (and a b) c) d) Refresh my memory... what generates this? Is this from the compiler itself, or are people writing this code by hand? On old, vec4-centric architectures, this sort of thing was usu

[Mesa-dev] [PATCH] glsl: Optimize AND/OR reductions used in vec4 comparisons.

2013-05-08 Thread Matt Turner
For vec4 equality comparisons we emit (and (and (and a b) c) d) which leads to three dependent instructions. We can reassociate the operands which allows the first two instructions to be issued independently. Turn it into: (and (and a b) (and c d)) Do the same thing for ORs, used in vec4