fold-vec-store-vec_vsx_st-char.c: New.
authorWill Schmidt <will_schmidt@vnet.ibm.com>
Tue, 12 Jun 2018 16:04:52 +0000 (16:04 +0000)
committerWill Schmidt <willschm@gcc.gnu.org>
Tue, 12 Jun 2018 16:04:52 +0000 (16:04 +0000)
[testsuite]

2018-05-31  Will Schmidt  <will_schmidt@vnet.ibm.com>

* gcc.target/powerpc/fold-vec-store-vec_vsx_st-char.c: New.
* gcc.target/powerpc/fold-vec-store-vec_vsx_st-double.c: New.
* gcc.target/powerpc/fold-vec-store-vec_vsx_st-float.c: New.
* gcc.target/powerpc/fold-vec-store-vec_vsx_st-int.c: New.
* gcc.target/powerpc/fold-vec-store-vec_vsx_st-longlong.c: New.
* gcc.target/powerpc/fold-vec-store-vec_vsx_st-short.c: New.

From-SVN: r261508

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-char.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-double.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-float.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-int.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-longlong.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-short.c [new file with mode: 0644]

index 360080ffb58a5aa0cdab0aa274fd78143e491a2f..5b1fd2d8e5a70223878aa1fa24c8b6a4b1cff77e 100644 (file)
@@ -1,3 +1,12 @@
+2018-06-12  Will Schmidt  <will_schmidt@vnet.ibm.com>
+
+       * gcc.target/powerpc/fold-vec-store-vec_vsx_st-char.c: New.
+       * gcc.target/powerpc/fold-vec-store-vec_vsx_st-double.c: New.
+       * gcc.target/powerpc/fold-vec-store-vec_vsx_st-float.c: New.
+       * gcc.target/powerpc/fold-vec-store-vec_vsx_st-int.c: New.
+       * gcc.target/powerpc/fold-vec-store-vec_vsx_st-longlong.c: New.
+       * gcc.target/powerpc/fold-vec-store-vec_vsx_st-short.c: New.
+
 2018-06-12  Will Schmidt  <will_schmidt@vnet.ibm.com>
 
        * gcc.target/powerpc/fold-vec-store-builtin_vec_xst-char.c: New.
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-char.c
new file mode 100644 (file)
index 0000000..82bb891
--- /dev/null
@@ -0,0 +1,39 @@
+/* Verify that overloaded built-ins for vec_vsx_st with char
+   inputs produce the right code.  */
+
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mvsx -O2" } */
+
+#include <altivec.h>
+
+#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO)           \
+void                                                                   \
+TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto)    \
+{                                                                      \
+       vec_vsx_st (value, offset, saveto);             \
+}
+
+#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO)           \
+void                                                                   \
+TESTNAME1 ## _cst (VALUE value, SAVETO * saveto)                       \
+{                                                                      \
+       vec_vsx_st (value, CST_OFFSET, saveto);         \
+}
+
+BUILD_VAR_TEST( test1,  vector signed char, signed long long, signed char );
+BUILD_VAR_TEST( test2,  vector signed char, signed int, signed char );
+BUILD_CST_TEST( test3,  vector signed char, 12, signed char );
+
+BUILD_VAR_TEST( test4,  vector unsigned char, signed long long, unsigned char );
+BUILD_VAR_TEST( test5,  vector unsigned char, signed int, unsigned char );
+BUILD_CST_TEST( test6,  vector unsigned char, 12, unsigned char );
+
+BUILD_VAR_TEST( test7,  vector signed char, signed long long, vector signed char );
+BUILD_VAR_TEST( test8,  vector signed char, signed int, vector signed char );
+BUILD_CST_TEST( test9,  vector signed char, 12, vector signed char );
+
+BUILD_VAR_TEST( test10, vector unsigned char, signed long long, vector unsigned char );
+BUILD_VAR_TEST( test11, vector unsigned char, signed int, vector unsigned char );
+BUILD_CST_TEST( test12, vector unsigned char, 12, vector unsigned char );
+
+/* { dg-final { scan-assembler-times {\mstxvw4x\M|\mstxvd2x\M|\mstxvx\M|\mstvx\M} 12 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-double.c
new file mode 100644 (file)
index 0000000..34772cf
--- /dev/null
@@ -0,0 +1,31 @@
+/* Verify that overloaded built-ins for vec_vsx_st with double
+   inputs produce the right code.  */
+
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mvsx -O2" } */
+
+#include <altivec.h>
+
+#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO)           \
+void                                                                   \
+TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto)    \
+{                                                                      \
+       vec_vsx_st (value, offset, saveto);             \
+}
+
+#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO)           \
+void                                                                   \
+TESTNAME1 ## _cst (VALUE value, SAVETO * saveto)                       \
+{                                                                      \
+       vec_vsx_st (value, CST_OFFSET, saveto);         \
+}
+
+BUILD_VAR_TEST( test1,  vector double, signed long long, double );
+BUILD_VAR_TEST( test2,  vector double, signed int, double );
+BUILD_CST_TEST( test3,  vector double, 12, double );
+
+BUILD_VAR_TEST( test7,  vector double, signed long long, vector double );
+BUILD_VAR_TEST( test8,  vector double, signed int, vector double );
+BUILD_CST_TEST( test9,  vector double, 12, vector double );
+
+/* { dg-final { scan-assembler-times {\mstxvd2x\M|\mstxvx\M|\mstvx\M} 6 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-float.c
new file mode 100644 (file)
index 0000000..cf13f2a
--- /dev/null
@@ -0,0 +1,31 @@
+/* Verify that overloaded built-ins for vec_vsx_st with float
+   inputs produce the right code.  */
+
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mvsx -O2" } */
+
+#include <altivec.h>
+
+#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO)           \
+void                                                                   \
+TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto)    \
+{                                                                      \
+       vec_vsx_st (value, offset, saveto);             \
+}
+
+#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO)           \
+void                                                                   \
+TESTNAME1 ## _cst (VALUE value, SAVETO * saveto)                       \
+{                                                                      \
+       vec_vsx_st (value, CST_OFFSET, saveto);         \
+}
+
+BUILD_VAR_TEST( test1,  vector float, signed long long, float );
+BUILD_VAR_TEST( test2,  vector float, signed int, float );
+BUILD_CST_TEST( test3,  vector float, 12, float );
+
+BUILD_VAR_TEST( test7,  vector float, signed long long, vector float );
+BUILD_VAR_TEST( test8,  vector float, signed int, vector float );
+BUILD_CST_TEST( test9,  vector float, 12, vector float );
+
+/* { dg-final { scan-assembler-times {\mstxvd2x\M|\mstxvx\M|\mstvx\M} 6 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-int.c
new file mode 100644 (file)
index 0000000..a9e189d
--- /dev/null
@@ -0,0 +1,39 @@
+/* Verify that overloaded built-ins for vec_vsx_st with int
+   inputs produce the right code.  */
+
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mvsx -O2" } */
+
+#include <altivec.h>
+
+#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO)           \
+void                                                                   \
+TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto)    \
+{                                                                      \
+       vec_vsx_st (value, offset, saveto);             \
+}
+
+#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO)           \
+void                                                                   \
+TESTNAME1 ## _cst (VALUE value, SAVETO * saveto)                       \
+{                                                                      \
+       vec_vsx_st (value, CST_OFFSET, saveto);         \
+}
+
+BUILD_VAR_TEST( test1,  vector signed int, signed long long, signed int );
+BUILD_VAR_TEST( test2,  vector signed int, signed int, signed int );
+BUILD_CST_TEST( test3,  vector signed int, 12, signed int );
+
+BUILD_VAR_TEST( test4,  vector unsigned int, signed long long, unsigned int );
+BUILD_VAR_TEST( test5,  vector unsigned int, signed int, unsigned int );
+BUILD_CST_TEST( test6,  vector unsigned int, 12, unsigned int );
+
+BUILD_VAR_TEST( test7,  vector signed int, signed long long, vector signed int );
+BUILD_VAR_TEST( test8,  vector signed int, signed int, vector signed int );
+BUILD_CST_TEST( test9,  vector signed int, 12, vector signed int );
+
+BUILD_VAR_TEST( test10, vector unsigned int, signed long long, vector unsigned int );
+BUILD_VAR_TEST( test11, vector unsigned int, signed int, vector unsigned int );
+BUILD_CST_TEST( test12, vector unsigned int, 12, vector unsigned int );
+
+/* { dg-final { scan-assembler-times {\mstxvw4x\M|\mstxvd2x\M|\mstxvx\M|\mstvx\M} 12 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-longlong.c
new file mode 100644 (file)
index 0000000..f50e2b9
--- /dev/null
@@ -0,0 +1,39 @@
+/* Verify that overloaded built-ins for vec_vsx_st with long long
+   inputs produce the right code.  */
+
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mvsx -O2" } */
+
+#include <altivec.h>
+
+#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO)           \
+void                                                                   \
+TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto)    \
+{                                                                      \
+       vec_vsx_st (value, offset, saveto);             \
+}
+
+#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO)           \
+void                                                                   \
+TESTNAME1 ## _cst (VALUE value, SAVETO * saveto)                       \
+{                                                                      \
+       vec_vsx_st (value, CST_OFFSET, saveto);         \
+}
+
+BUILD_VAR_TEST( test1,  vector signed long long, signed long long, signed long long );
+BUILD_VAR_TEST( test2,  vector signed long long, signed int, signed long long );
+BUILD_CST_TEST( test3,  vector signed long long, 12, signed long long );
+
+BUILD_VAR_TEST( test4,  vector unsigned long long, signed long long, unsigned long long );
+BUILD_VAR_TEST( test5,  vector unsigned long long, signed int, unsigned long long );
+BUILD_CST_TEST( test6,  vector unsigned long long, 12, unsigned long long );
+
+BUILD_VAR_TEST( test7,  vector signed long long, signed long long, vector signed long long );
+BUILD_VAR_TEST( test8,  vector signed long long, signed int, vector signed long long );
+BUILD_CST_TEST( test9,  vector signed long long, 12, vector signed long long );
+
+BUILD_VAR_TEST( test10, vector unsigned long long, signed long long, vector unsigned long long );
+BUILD_VAR_TEST( test11, vector unsigned long long, signed int, vector unsigned long long );
+BUILD_CST_TEST( test12, vector unsigned long long, 12, vector unsigned long long );
+
+/* { dg-final { scan-assembler-times {\mstxvd2x\M|\mstxvx\M|\mstvx\M} 12 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-short.c
new file mode 100644 (file)
index 0000000..0f8a93a
--- /dev/null
@@ -0,0 +1,39 @@
+/* Verify that overloaded built-ins for vec_vsx_st with short
+   inputs produce the right code.  */
+
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mvsx -O2" } */
+
+#include <altivec.h>
+
+#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO)           \
+void                                                                   \
+TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto)    \
+{                                                                      \
+       vec_vsx_st (value, offset, saveto);             \
+}
+
+#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO)           \
+void                                                                   \
+TESTNAME1 ## _cst (VALUE value, SAVETO * saveto)                       \
+{                                                                      \
+       vec_vsx_st (value, CST_OFFSET, saveto);         \
+}
+
+BUILD_VAR_TEST( test1,  vector signed short, signed long long, signed short );
+BUILD_VAR_TEST( test2,  vector signed short, signed int, signed short );
+BUILD_CST_TEST( test3,  vector signed short, 12, signed short );
+
+BUILD_VAR_TEST( test4,  vector unsigned short, signed long long, unsigned short );
+BUILD_VAR_TEST( test5,  vector unsigned short, signed int, unsigned short );
+BUILD_CST_TEST( test6,  vector unsigned short, 12, unsigned short );
+
+BUILD_VAR_TEST( test7,  vector signed short, signed long long, vector signed short );
+BUILD_VAR_TEST( test8,  vector signed short, signed int, vector signed short );
+BUILD_CST_TEST( test9,  vector signed short, 12, vector signed short );
+
+BUILD_VAR_TEST( test10, vector unsigned short, signed long long, vector unsigned short );
+BUILD_VAR_TEST( test11, vector unsigned short, signed int, vector unsigned short );
+BUILD_CST_TEST( test12, vector unsigned short, 12, vector unsigned short );
+
+/* { dg-final { scan-assembler-times {\mstxvw4x\M|\mstxvd2x\M|\mstxvx\M|\mstvx\M} 12 } } */