On Tue, Jun 12, 2012 at 11:22 AM, Julian Brown <jul...@codesourcery.com> wrote: > On Mon, 11 Jun 2012 16:46:27 +0100 > Ramana Radhakrishnan <ramana.radhakrish...@linaro.org> wrote: > >> Hi, >> >> I don't like the ML bits of the patch as it stands today and before >> committing I would like to clean up the ML bits quite a bit further >> especially in areas where I've put FIXMEs [...] > > I had a go at this, see attached. Untested. Note there are some > semantic differences in output: > > vzipq_p8 (poly8x16_t __a, poly8x16_t __b) > { > poly8x16x2_t __rv; > - uint8x16_t __mask1 = {0, 2}; > - uint8x16_t __mask2 = {1, 3}; > - __rv.val[0] = (poly8x16_t)__builtin_shuffle (__a, __b, __mask1); > - __rv.val[1] = (poly8x16_t)__builtin_shuffle (__a, __b, __mask2); > + uint8x16_t __mask1 = { 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, > 22, 7, 23 }; > + uint8x16_t __mask2 = { 8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, > 14, 30, 15, 31 }; > + __rv.val[0] = (poly8x16_t) __builtin_shuffle (__a, __b, __mask1); > + __rv.val[1] = (poly8x16_t) __builtin_shuffle (__a, __b, __mask2);
You should get better code at -O0 when not using a temporary __mask1/__mask2 but directly pasting the constant in the builtin call. > return __rv; > } > > I wasn't quite sure which version was correct -- but your version > doesn't seem to have enough elements for these cases? > > HTH, > > Julian