diff options
author | Bill Schmidt <wschmidt@vnet.linux.ibm.com> | 2013-07-22 23:08:44 +0000 |
---|---|---|
committer | William Schmidt <wschmidt@gcc.gnu.org> | 2013-07-22 23:08:44 +0000 |
commit | 7061977bf95142acdacc0727223a1acc619dfb2e (patch) | |
tree | 59177bf2cd228ae4e6262d207c2c0bcd897be8f5 /gcc/config/rs6000 | |
parent | 75a418785a223a0efa41824bf55826271a4ddde6 (diff) | |
download | gcc-7061977bf95142acdacc0727223a1acc619dfb2e.zip gcc-7061977bf95142acdacc0727223a1acc619dfb2e.tar.gz gcc-7061977bf95142acdacc0727223a1acc619dfb2e.tar.bz2 |
rs6000.c (rs6000_expand_vector_init): Fix endianness when selecting field to splat.
2013-07-22 Bill Schmidt <wschmidt@vnet.linux.ibm.com>
Anton Blanchard <anton@au1.ibm.com>
* config/rs6000/rs6000.c (rs6000_expand_vector_init): Fix
endianness when selecting field to splat.
Co-Authored-By: Anton Blanchard <anton@au1.ibm.com>
From-SVN: r201149
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 04c7594..646eedc 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -5177,6 +5177,7 @@ rs6000_expand_vector_init (rtx target, rtx vals) of 64-bit items is not supported on Altivec. */ if (all_same && GET_MODE_SIZE (inner_mode) <= 4) { + rtx field; mem = assign_stack_temp (mode, GET_MODE_SIZE (inner_mode)); emit_move_insn (adjust_address_nv (mem, inner_mode, 0), XVECEXP (vals, 0, 0)); @@ -5187,9 +5188,11 @@ rs6000_expand_vector_init (rtx target, rtx vals) gen_rtx_SET (VOIDmode, target, mem), x))); + field = (BYTES_BIG_ENDIAN ? const0_rtx + : GEN_INT (GET_MODE_NUNITS (mode) - 1)); x = gen_rtx_VEC_SELECT (inner_mode, target, gen_rtx_PARALLEL (VOIDmode, - gen_rtvec (1, const0_rtx))); + gen_rtvec (1, field))); emit_insn (gen_rtx_SET (VOIDmode, target, gen_rtx_VEC_DUPLICATE (mode, x))); return; |