[Mesa-dev] [PATCH 13/13] glsl: Compare vector indices in blocks

2011-07-21 Thread Ian Romanick
From: Ian Romanick Just like the non-constant array index lowering pass, compare all N indices at once. For accesses to a vec4, this saves 3 comparison instructions on a vector architecture. --- src/glsl/lower_vec_index_to_cond_assign.cpp | 57 -- 1 files changed, 35 i

Re: [Mesa-dev] [PATCH 13/13] glsl: Compare vector indices in blocks

2011-07-21 Thread Eric Anholt
On Thu, 21 Jul 2011 12:16:58 -0700, "Ian Romanick" wrote: > From: Ian Romanick > > Just like the non-constant array index lowering pass, compare all N > indices at once. For accesses to a vec4, this saves 3 comparison > instructions on a vector architecture. > --- > src/glsl/lower_vec_index_to

Re: [Mesa-dev] [PATCH 13/13] glsl: Compare vector indices in blocks

2011-07-22 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/21/2011 05:28 PM, Eric Anholt wrote: > On Thu, 21 Jul 2011 12:16:58 -0700, "Ian Romanick" > wrote: >> From: Ian Romanick >> >> Just like the non-constant array index lowering pass, compare all N >> indices at once. For accesses to a vec4, thi

Re: [Mesa-dev] [PATCH 13/13] glsl: Compare vector indices in blocks

2011-07-22 Thread Eric Anholt
On Fri, 22 Jul 2011 09:27:36 -0700, Ian Romanick wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 07/21/2011 05:28 PM, Eric Anholt wrote: > > On Thu, 21 Jul 2011 12:16:58 -0700, "Ian Romanick" > > wrote: > >> From: Ian Romanick > >> > >> Just like the non-constant array index lo

Re: [Mesa-dev] [PATCH 13/13] glsl: Compare vector indices in blocks

2011-07-22 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/22/2011 11:27 AM, Eric Anholt wrote: > On Fri, 22 Jul 2011 09:27:36 -0700, Ian Romanick wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> On 07/21/2011 05:28 PM, Eric Anholt wrote: >>> On Thu, 21 Jul 2011 12:16:58 -0700, "Ian Roma

Re: [Mesa-dev] [PATCH 13/13] glsl: Compare vector indices in blocks

2011-07-22 Thread Eric Anholt
On Fri, 22 Jul 2011 15:20:03 -0700, Ian Romanick wrote: > I'd like to refactor that code to be more like the non-constant array > index lowering pass. The r-value and l-value case only differ in the > order of the operands in the generated assignments and the optional > if-statement wrapping. It