altivec-7-be.c: Remove VSX content, allow 32-bit target.
authorWill Schmidt <will_schmidt@vnet.ibm.com>
Fri, 2 Mar 2018 15:18:54 +0000 (15:18 +0000)
committerWill Schmidt <willschm@gcc.gnu.org>
Fri, 2 Mar 2018 15:18:54 +0000 (15:18 +0000)
[testsuite]

2018-03-02  Will Schmidt  <will_schmidt@vnet.ibm.com>

* gcc.target/powerpc/altivec-7-be.c: Remove VSX content, allow
32-bit target.
* gcc.target/powerpc/altivec-7.h: Remove VSX content.
* gcc.target/powerpc/vsx-7-be.c: New test (VSX content).
* gcc.target/powerpc/vsx-7.h: New include (VSX content).
* gcc.target/powerpc/altivec-7-le.c: Add vsx-7.h include.

From-SVN: r258137

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/altivec-7-be.c
gcc/testsuite/gcc.target/powerpc/altivec-7-le.c
gcc/testsuite/gcc.target/powerpc/altivec-7.h
gcc/testsuite/gcc.target/powerpc/vsx-7-be.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-7.h [new file with mode: 0644]

index 17369ce0ebd2349567096624c0b38b4ed71841f2..94900056afd397f07850a565ce7ab76abeebe02a 100644 (file)
@@ -1,3 +1,12 @@
+2018-03-02  Will Schmidt  <will_schmidt@vnet.ibm.com>
+
+       * gcc.target/powerpc/altivec-7-be.c: Remove VSX content, allow
+       32-bit target.
+       * gcc.target/powerpc/altivec-7.h: Remove VSX content.
+       * gcc.target/powerpc/vsx-7-be.c: New test (VSX content).
+       * gcc.target/powerpc/vsx-7.h: New include (VSX content).
+       * gcc.target/powerpc/altivec-7-le.c: Add vsx-7.h include.
+
 2018-03-02  Marek Polacek  <polacek@redhat.com>
 
        PR c++/84590
index cbc31e67ce5a38070de655ca8a6b17ec2a62b75e..1e690be14452c4ce4f9dfe8ef8cce62cfeb746d1 100644 (file)
@@ -1,10 +1,10 @@
-/* { dg-do compile { target powerpc64-*-* } } */
+/* { dg-do compile { target powerpc*-*-* } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec" } */
 
 /* Expected results for Big Endian:
      vec_packpx                     vpkpx
-     vec_ld                         lxv2x
+     vec_ld                         lxvd2x
      vec_lde                        lvewx
      vec_ldl                        lxvl
      vec_lvewx                      lvewx
 /* { dg-final { scan-assembler-times "vpkpx" 2 } } */
 /* { dg-final { scan-assembler-times "vmulesb" 1 } } */
 /* { dg-final { scan-assembler-times "vmulosb" 1 } } */
-/* { dg-final { scan-assembler-times "lxvd2x" 6 } } */
 /* { dg-final { scan-assembler-times "lvewx" 2 } } */
 /* { dg-final { scan-assembler-times "lvxl" 1 } } */
 /* { dg-final { scan-assembler-times "vupklsh" 1 } } */
 /* { dg-final { scan-assembler-times "vupkhsh" 1 } } */
-/* { dg-final { scan-assembler-times "xxlnor" 4 } } */
-/* { dg-final { scan-assembler-times "xxland" 4 } } */
-/* { dg-final { scan-assembler-times "xxlxor" 5 } } */
-/* { dg-final { scan-assembler-times "vupkhpx" 1 } } */
 
 /* Source code for the test in altivec-7.h */
 #include "altivec-7.h"
index 6f895336407f23f66ea125f048fc42d559383e3d..38ce15362714f1b3dae2b7ba8acdfa83a322b0d5 100644 (file)
@@ -32,5 +32,6 @@
 /* { dg-final { scan-assembler-times "xxlxor" 5 } } */
 /* { dg-final { scan-assembler-times "vupkhpx" 1 } } */
 
-/* Source code for the test in altivec-7.h */
+/* Source code for the test in altivec-7.h and vsx-7.h. */
 #include "altivec-7.h"
+#include "vsx-7.h"
index ff87deb9c5387a210f9b5ab8058f1272ec0ea69f..4dedcd8146988e2178294242e0b13a46f4a972d9 100644 (file)
@@ -17,7 +17,6 @@ vector unsigned char *vecuchar;
 vector unsigned int *vecuint;
 vector unsigned short *vecushort;
 vector float *vecfloat;
-vector double *vecdouble;
 
 int main ()
 {
@@ -43,8 +42,6 @@ int main ()
   *vecuint++ = vec_lvx(var_int[0], uintp[1]);
   *vecuint++ = vec_vmsumubm(vecuchar[0], vecuchar[1], vecuint[2]);
   *vecuchar++ = vec_xor(vecuchar[0], (vector unsigned char)vecchar[1]);
-  *vecdouble++ = vec_unpackl(vecfloat[0]);
-  *vecdouble++ = vec_unpackh(vecfloat[0]);
 
   return 0;
 }
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-7-be.c b/gcc/testsuite/gcc.target/powerpc/vsx-7-be.c
new file mode 100644 (file)
index 0000000..2df9fca
--- /dev/null
@@ -0,0 +1,50 @@
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mvsx" } */
+
+/* This is an extension of altivec-7-be.c, with vsx target features included. */
+
+/* Expected results for Big Endian:
+(from altivec-7.h)
+     vec_packpx                     vpkpx
+     vec_ld                         lxvd2x or lxv
+     vec_lde                        lvewx
+     vec_ldl                        lxvl
+     vec_lvewx                      lvewx
+     vec_andc                       xxnor
+                                    xxland
+     vec_vxor                       xxlxor
+     vec_vmsumubm                   vmsumubm
+     vec_vmulesb                    vmulesb
+     vec_vmulosb                    vmulosb
+(from vsx-7.h)
+     vec_unpackl                    vupkhsh
+     vec_unpackh                    vupklsh
+*/
+
+/* { dg-final { scan-assembler-times "vpkpx" 2 } } */
+/* { dg-final { scan-assembler-times "vmulesb" 1 } } */
+/* { dg-final { scan-assembler-times "vmulosb" 1 } } */
+
+// For LE platforms P9 and later, we generate the lxv insn instead of lxvd2x.
+/* { dg-final { scan-assembler-times {\mlxvd2x\M}  0  { target { { powerpc64*le-*-* } && { p9vector_hw } } } } } */
+/* { dg-final { scan-assembler-times {\mlxv\M}    36  { target { { powerpc64*le-*-* } && { p9vector_hw } } } } } */
+// For LE platforms < P9.
+/* { dg-final { scan-assembler-times {\mlxvd2x\M}  36  { target { { powerpc64*le-*-* } && { ! p9vector_hw } } } } } */
+// For BE platforms we generate 6 lxvd2x insns.
+/* { dg-final { scan-assembler-times {\mlxvd2x\M}  6  { target { { ! powerpc64*le-*-* } && { ! p9vector_hw } } } } } */
+
+/* { dg-final { scan-assembler-times "lvewx" 2 } } */
+/* { dg-final { scan-assembler-times "lvxl" 1 } } */
+/* { dg-final { scan-assembler-times "vupklsh" 1 } } */
+/* { dg-final { scan-assembler-times "vupkhsh" 1 } } */
+/* { dg-final { scan-assembler-times "xxlnor" 4 } } */
+/* { dg-final { scan-assembler-times "xxland" 4 } } */
+/* { dg-final { scan-assembler-times "xxlxor" 5 } } */
+/* { dg-final { scan-assembler-times "vupkhpx" 1 } } */
+
+/* Source code for the 'altivec' test in altivec-7.h */
+/* Source code for the 'vsx' required tests in vsx-7.h */
+
+#include "altivec-7.h"
+#include "vsx-7.h"
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-7.h b/gcc/testsuite/gcc.target/powerpc/vsx-7.h
new file mode 100644 (file)
index 0000000..fe55472
--- /dev/null
@@ -0,0 +1,18 @@
+
+/* This test code is included into vsx-7-be.c.
+ * this is meant to supplement code in altivec-7.h.  */
+
+#include <altivec.h>
+
+
+vector float *vecfloat;
+vector double *vecdouble;
+
+int main2 ()
+{
+
+  *vecdouble++ = vec_unpackl(vecfloat[0]);
+  *vecdouble++ = vec_unpackh(vecfloat[0]);
+
+  return 0;
+}