vector.md (vec_realign_load_<mode>): Reorder input operands to vperm for little endian.
authorBill Schmidt <wschmidt@vnet.linux.ibm.com>
Wed, 24 Jul 2013 13:17:31 +0000 (13:17 +0000)
committerWilliam Schmidt <wschmidt@gcc.gnu.org>
Wed, 24 Jul 2013 13:17:31 +0000 (13:17 +0000)
2013-07-24  Bill Schmidt  <wschmidt@vnet.linux.ibm.com>
    Anton Blanchard <anton@au1.ibm.com>

* vector.md (vec_realign_load_<mode>): 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 <anton@au1.ibm.com>
From-SVN: r201208

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/vector.md

index 24e47d4919149debe9d520441770b8cb2b690fb3..11a48301cb1ce9493ce3a551387e012cd020e249 100644 (file)
@@ -1,3 +1,11 @@
+2013-07-24  Bill Schmidt  <wschmidt@vnet.linux.ibm.com>
+           Anton Blanchard <anton@au1.ibm.com>
+
+       * vector.md (vec_realign_load_<mode>): 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  <wschmidt@linux.vnet.ibm.com>
            Anton Blanchard <anton@au1.ibm.com>
 
index a3c9c98eb8016029069f1d095d90f9cc30512f33..8b939d8e8269d80d9738b4057300d06eaa39fb45 100644 (file)
@@ -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;
index 2eaa2d325c3566a2452b3d175089658f3284582c..3faa7983aa880c71e2c80e7c2b854ddb9ed98492 100644 (file)
    (match_operand:V16QI 3 "vlogical_operand" "")]
   "VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)"
 {
-  emit_insn (gen_altivec_vperm_<mode> (operands[0], operands[1], operands[2],
-                                      operands[3]));
+  if (BYTES_BIG_ENDIAN)
+    emit_insn (gen_altivec_vperm_<mode> (operands[0], operands[1],
+                                        operands[2], operands[3]));
+  else
+    emit_insn (gen_altivec_vperm_<mode> (operands[0], operands[2],
+                                        operands[1], operands[3]));
   DONE;
 })