On Wed, Nov 12, 2014 at 6:56 PM, Alan Lawrence <alan.lawre...@arm.com> wrote: > This redefines vec_shr optab to be the same (in terms of gcc vectors) > regardless of target endianness. The vectorizer uses this to do reductions > via shifts, so also change the vectorizer to shift things always the same > way (from the midend's POV of vectors). > > cross-tested check-gcc on (1) aarch64-none-elf and (2) aarch64_be-none-elf, > both (a) using the endianness-independent vec_shr patterns at > https://gcc.gnu.org/ml/gcc-patches/2014-09/msg01477.html and (b) in present > state without any vec_shr patterns. No regressions on any combination. > > Bootstrap + check-gcc on x86_64-none-linux-gnu. > > This patch will break MIPS and PowerPC (which have bigendian vec_shr > patterns). Candidate MIPS fix previously posted at > https://gcc.gnu.org/ml/gcc-patches/2014-09/msg01481.html . > PowerPC should be fixed by > https://gcc.gnu.org/ml/gcc-patches/2014-09/msg01480.html ; I've bootstrapped > this on powerpc64-unknown-linux-gnu, check-gcc in progress.
Ok. Thanks. Richard. > gcc/ChangeLog: > > * optabs.c (shift_amt_for_vec_perm_mask): Remove code conditional on > BYTES_BIG_ENDIAN. > * tree-vect-loop.c (calc_vec_perm_mask_for_shift, > vect_create_epilog_for_reduction): Likewise. > * doc/md.texi (vec_shr_m): Clarify direction of shifting.