Hi,
  Assorted updates to existing tests to compensate for codegen changes
introduced with the gimple-folding of unaligned vector loads and stores.
Regtest clean across assorted Linux systems (p6-p9).
OK for trunk?
Thanks,
-Will
    
[testsuite]
    
2018-05-31  Will Schmidt  <will_schm...@vnet.ibm.com>
    
        * gcc.target/powerpc/p8-vec-xl-xst-v2.c: New.
        * gcc.target/powerpc/p8-vec-xl-xst.c:  Disable gimple-folding.
        * gcc.target/powerpc/swaps-p8-17.c:  Same.

diff --git a/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst-v2.c 
b/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst-v2.c
new file mode 100644
index 0000000..3315c5f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst-v2.c
@@ -0,0 +1,64 @@
+/* { dg-do compile { target { powerpc64le-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { 
"-mcpu=power8" } } */
+/* { dg-options "-mcpu=power8 -O2" } */
+
+/* Verify fix for problem where vec_xl and vec_xst are not recognized
+   for the vector char and vector short cases on P8 only.
+   This test duplicates p8-vec-xl-xst.c , except that it allows gimple-folding,
+   which changes the expected codegen.  */
+
+#include <altivec.h>
+
+vector unsigned char
+foo (unsigned char * address)
+{
+  return __builtin_vec_xl (0, address);
+}
+
+void
+bar (vector unsigned char x, unsigned char * address)
+{
+  __builtin_vec_xst (x, 0, address);
+}
+
+vector unsigned short
+foot (unsigned short * address)
+{
+  return __builtin_vec_xl (0, address);
+}
+
+void
+bart (vector unsigned short x, unsigned short * address)
+{
+  __builtin_vec_xst (x, 0, address);
+}
+
+vector unsigned char
+fool (unsigned char * address)
+{
+  return vec_xl (0, address);
+}
+
+void
+barl (vector unsigned char x, unsigned char * address)
+{
+  vec_xst (x, 0, address);
+}
+
+vector unsigned short
+footle (unsigned short * address)
+{
+  return vec_xl (0, address);
+}
+
+void
+bartle (vector unsigned short x, unsigned short * address)
+{
+  vec_xst (x, 0, address);
+}
+
+/* { dg-final { scan-assembler-times "lvx" 4 } } */
+/* { dg-final { scan-assembler-times "stvx"  4 } } */
+/* { dg-final { scan-assembler-times "xxpermdi" 0 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst.c 
b/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst.c
index bbf7d91..06f3457 100644
--- a/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst.c
+++ b/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst.c
@@ -1,10 +1,11 @@
 /* { dg-do compile { target { powerpc64le-*-* } } } */
 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
 /* { dg-require-effective-target powerpc_p8vector_ok } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { 
"-mcpu=power8" } } */
-/* { dg-options "-mcpu=power8 -O2" } */
+/* { dg-options "-mcpu=power8 -O2 -mno-fold-gimple" } */
+/* { dg-prune-output "gimple folding of rs6000 builtins has been disabled." } 
*/
 
 /* Verify fix for problem where vec_xl and vec_xst are not recognized
    for the vector char and vector short cases on P8 only.  */
 
 #include <altivec.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/swaps-p8-17.c 
b/gcc/testsuite/gcc.target/powerpc/swaps-p8-17.c
index 7a9cfbf..889bbf7 100644
--- a/gcc/testsuite/gcc.target/powerpc/swaps-p8-17.c
+++ b/gcc/testsuite/gcc.target/powerpc/swaps-p8-17.c
@@ -1,8 +1,9 @@
 /* { dg-do compile { target { powerpc64le-*-* } } } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { 
"-mcpu=power8" } } */
-/* { dg-options "-mcpu=power8 -O1" } */
+/* { dg-options "-mcpu=power8 -O1 -mno-fold-gimple" } */
+/* { dg-prune-output "gimple folding of rs6000 builtins has been disabled." } 
*/
 /* { dg-final { scan-assembler "lxvd2x" } } */
 /* { dg-final { scan-assembler "xxpermdi" } } */
 
 /* Verify that we don't try to do permute removal in the presence of
    vec_ste.  This used to ICE.  */


Reply via email to