diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2013-07-23 22:36:04 +0000 |
---|---|---|
committer | William Schmidt <wschmidt@gcc.gnu.org> | 2013-07-23 22:36:04 +0000 |
commit | 73792b92639b0ded29e5efebb0cd31abb55abd81 (patch) | |
tree | 713c40bf2ae9b919eb0ebe2b857ff4d78505fbf7 /gcc/config/rs6000 | |
parent | 14c21302b114f17846d1f72c4c64519a2f624fdc (diff) | |
download | gcc-73792b92639b0ded29e5efebb0cd31abb55abd81.zip gcc-73792b92639b0ded29e5efebb0cd31abb55abd81.tar.gz gcc-73792b92639b0ded29e5efebb0cd31abb55abd81.tar.bz2 |
rs6000.c (altivec_expand_vec_perm_const): Reverse two operands for little-endian.
2013-07-23 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Anton Blanchard <anton@au1.ibm.com>
* config/rs6000/rs6000.c (altivec_expand_vec_perm_const): Reverse
two operands for little-endian.
Co-Authored-By: Anton Blanchard <anton@au1.ibm.com>
From-SVN: r201195
Diffstat (limited to 'gcc/config/rs6000')
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 7729188..a3c9c98 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -28520,7 +28520,10 @@ altivec_expand_vec_perm_const (rtx operands[4]) enum machine_mode omode = insn_data[icode].operand[0].mode; enum machine_mode imode = insn_data[icode].operand[1].mode; - if (swapped) + /* For little-endian, the two input operands must be swapped + (or swapped back) to ensure proper right-to-left numbering + from 0 to 2N-1. */ + if (swapped ^ !BYTES_BIG_ENDIAN) x = op0, op0 = op1, op1 = x; if (imode != V16QImode) { |