From: Bill Schmidt Date: Wed, 24 Jul 2013 13:17:31 +0000 (+0000) Subject: vector.md (vec_realign_load_): Reorder input operands to vperm for little endian. X-Git-Tag: releases/gcc-4.9.0~4854 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=493f4c9e091a72c00b0b23f2e8ec137c4bde53ec;p=thirdparty%2Fgcc.git vector.md (vec_realign_load_): Reorder input operands to vperm for little endian. 2013-07-24 Bill Schmidt Anton Blanchard * vector.md (vec_realign_load_): Reorder input operands to vperm for little endian. * rs6000.c (rs6000_expand_builtin): Use lvsr instead of lvsl to create the control mask for a vperm for little endian. Co-Authored-By: Anton Blanchard From-SVN: r201208 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 24e47d491914..11a48301cb1c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2013-07-24 Bill Schmidt + Anton Blanchard + + * vector.md (vec_realign_load_): Reorder input operands to + vperm for little endian. + * rs6000.c (rs6000_expand_builtin): Use lvsr instead of lvsl to + create the control mask for a vperm for little endian. + 2013-07-23 Bill Schmidt Anton Blanchard diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index a3c9c98eb801..8b939d8e8269 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -12351,7 +12351,8 @@ rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, case ALTIVEC_BUILTIN_MASK_FOR_LOAD: case ALTIVEC_BUILTIN_MASK_FOR_STORE: { - int icode = (int) CODE_FOR_altivec_lvsr; + int icode = (BYTES_BIG_ENDIAN ? (int) CODE_FOR_altivec_lvsr + : (int) CODE_FOR_altivec_lvsl); enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode = insn_data[icode].operand[1].mode; tree arg; diff --git a/gcc/config/rs6000/vector.md b/gcc/config/rs6000/vector.md index 2eaa2d325c35..3faa7983aa88 100644 --- a/gcc/config/rs6000/vector.md +++ b/gcc/config/rs6000/vector.md @@ -936,8 +936,12 @@ (match_operand:V16QI 3 "vlogical_operand" "")] "VECTOR_MEM_ALTIVEC_OR_VSX_P (mode)" { - emit_insn (gen_altivec_vperm_ (operands[0], operands[1], operands[2], - operands[3])); + if (BYTES_BIG_ENDIAN) + emit_insn (gen_altivec_vperm_ (operands[0], operands[1], + operands[2], operands[3])); + else + emit_insn (gen_altivec_vperm_ (operands[0], operands[2], + operands[1], operands[3])); DONE; })