]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc:
authorwschmidt <wschmidt@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Nov 2013 21:46:18 +0000 (21:46 +0000)
committerwschmidt <wschmidt@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Nov 2013 21:46:18 +0000 (21:46 +0000)
2013-11-20  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

* config/rs6000/vsx.md (vsx_set_<mode>): Adjust for little endian.
(vsx_extract_<mode>): Likewise.
(*vsx_extract_<mode>_one_le): New LE variant on
*vsx_extract_<mode>_zero.
(vsx_extract_v4sf): Adjust for little endian.

gcc/testsuite:

2013-11-20  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

* gcc.target/powerpc/pr48258-1.c: Skip for little endian.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205146 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/rs6000/vsx.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/pr48258-1.c

index 19ba024b7116460a932167db9a66bf25d59c88c4..892f5efeb19a528a513227c81353a7840b7772bb 100644 (file)
@@ -1,3 +1,11 @@
+2013-11-20  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
+
+       * config/rs6000/vsx.md (vsx_set_<mode>): Adjust for little endian.
+       (vsx_extract_<mode>): Likewise.
+       (*vsx_extract_<mode>_one_le): New LE variant on
+       *vsx_extract_<mode>_zero.
+       (vsx_extract_v4sf): Adjust for little endian.
+
 2013-11-20  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR rtl-optimization/59133
index 8a51afb3c8677e2b11d237d5e1702254b5134eb4..977ef963411bf7038a2f144cf4bf6c287b8c5541 100644 (file)
                      UNSPEC_VSX_SET))]
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 {
-  if (INTVAL (operands[3]) == 0)
+  int idx_first = BYTES_BIG_ENDIAN ? 0 : 1;
+  if (INTVAL (operands[3]) == idx_first)
     return \"xxpermdi %x0,%x2,%x1,1\";
-  else if (INTVAL (operands[3]) == 1)
+  else if (INTVAL (operands[3]) == 1 - idx_first)
     return \"xxpermdi %x0,%x1,%x2,0\";
   else
     gcc_unreachable ();
                        [(match_operand:QI 2 "u5bit_cint_operand" "i,i,i")])))]
   "VECTOR_MEM_VSX_P (<MODE>mode)"
 {
+  int fldDM;
   gcc_assert (UINTVAL (operands[2]) <= 1);
-  operands[3] = GEN_INT (INTVAL (operands[2]) << 1);
+  fldDM = INTVAL (operands[2]) << 1;
+  if (!BYTES_BIG_ENDIAN)
+    fldDM = 3 - fldDM;
+  operands[3] = GEN_INT (fldDM);
   return \"xxpermdi %x0,%x1,%x1,%3\";
 }
   [(set_attr "type" "vecperm")])
        (const_string "fpload")))
    (set_attr "length" "4")])  
 
+;; Optimize extracting element 1 from memory for little endian
+(define_insn "*vsx_extract_<mode>_one_le"
+  [(set (match_operand:<VS_scalar> 0 "vsx_register_operand" "=ws,d,?wa")
+       (vec_select:<VS_scalar>
+        (match_operand:VSX_D 1 "indexed_or_indirect_operand" "Z,Z,Z")
+        (parallel [(const_int 1)])))]
+  "VECTOR_MEM_VSX_P (<MODE>mode) && !WORDS_BIG_ENDIAN"
+  "lxsd%U1x %x0,%y1"
+  [(set (attr "type")
+      (if_then_else
+       (match_test "update_indexed_address_mem (operands[1], VOIDmode)")
+       (const_string "fpload_ux")
+       (const_string "fpload")))
+   (set_attr "length" "4")])  
+
 ;; Extract a SF element from V4SF
 (define_insn_and_split "vsx_extract_v4sf"
   [(set (match_operand:SF 0 "vsx_register_operand" "=f,f")
   rtx op2 = operands[2];
   rtx op3 = operands[3];
   rtx tmp;
-  HOST_WIDE_INT ele = INTVAL (op2);
+  HOST_WIDE_INT ele = BYTES_BIG_ENDIAN ? INTVAL (op2) : 3 - INTVAL (op2);
 
   if (ele == 0)
     tmp = op1;
index 348a0ce7320cd5d0b219180221ba05f1d1838f97..d47ec92a4be2f2c1f966cd3ac25640677ad4fc47 100644 (file)
@@ -1,3 +1,7 @@
+2013-11-20  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
+
+       * gcc.target/powerpc/pr48258-1.c: Skip for little endian.
+
 2013-11-20  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR rtl-optimization/59133
index 4f37815d38422529ebbd0f26a3f230ec9ae17ecb..3ccbf7693d9dac8d2ae1de38d77cbe723e848f1e 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "" { powerpc*le-*-* } { "*" } { "" } } */
 /* { dg-require-effective-target powerpc_vsx_ok } */
 /* { dg-options "-O3 -mcpu=power7 -mabi=altivec -ffast-math -fno-unroll-loops" } */
 /* { dg-final { scan-assembler-times "xvaddsp" 3 } } */