On Mon, Oct 21, 2013 at 8:49 AM, Bill Schmidt <wschm...@linux.vnet.ibm.com> wrote: > Hi, > > In altivec_expand_vec_perm_const, we look for special masks that match > the behavior of specific instructions, so we can use those instructions > rather than load a constant control vector and perform a permute. Some > of the masks must be treated differently for little endian mode. > > The masks that represent merge-high and merge-low operations have > reversed meanings in little-endian, because of the reversed ordering of > the vector elements. > > The masks that represent vector-pack operations remain correct when the > mode of the input operands matches the natural mode of the instruction, > but not otherwise. This is because the pack instructions always select > the rightmost, low-order bits of the vector element. There are cases > where we use this, for example, with a V8SI vector matching a vpkuwum > mask in order to select the odd-numbered elements of the vector. In > little endian mode, this instruction will get us the even-numbered > elements instead. There is no alternative instruction with the desired > behavior, so I've just disabled use of those masks for little endian > when the mode isn't natural. > > These changes fix 32 failures in the test suite for little endian mode. > Bootstrapped and tested on powerpc64{,le}-unknown-linux-gnu with no new > failures. Is this ok for trunk? > > Thanks, > Bill > > > 2013-10-21 Bill Schmidt <wschm...@vnet.ibm.com> > > * config/rs6000/rs6000.c (altivec_expand_vec_perm_const): Reverse > meaning of merge-high and merge-low masks for little endian; avoid > use of vector-pack masks for little endian for mismatched modes.
Okay. Thanks, David