|-------* gcc.target/powerpc/fold-vec-splat-16.c: New |-------* gcc.target/powerpc...
authorWill Schmidt <will_schmidt@vnet.ibm.com>
Tue, 10 Oct 2017 16:32:54 +0000 (16:32 +0000)
committerWill Schmidt <willschm@gcc.gnu.org>
Tue, 10 Oct 2017 16:32:54 +0000 (16:32 +0000)
2017-10-10  Will Schmidt  <will_schmidt@vnet.ibm.com>

[testsuite]
|-------* gcc.target/powerpc/fold-vec-splat-16.c: New
|-------* gcc.target/powerpc/fold-vec-splat-32.c: New.
|-------* gcc.target/powerpc/fold-vec-splat-8.c: New.

From-SVN: r253591

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/fold-vec-splat-16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/fold-vec-splat-32.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/fold-vec-splat-8.c [new file with mode: 0644]

index 29b5277180ef9dfa9f3fe8d3d43c5925c5cf7714..e73439f2df1ea73bd9b7123b89ffb45b198f3cf7 100644 (file)
@@ -1,3 +1,9 @@
+2017-10-10  Will Schmidt  <will_schmidt@vnet.ibm.com>
+
+       * gcc.target/powerpc/fold-vec-splat-16.c: New
+       * gcc.target/powerpc/fold-vec-splat-32.c: New.
+       * gcc.target/powerpc/fold-vec-splat-8.c: New.
+
 2017-10-10  Will Schmidt <will_schmidt@vnet.ibm.com>
 
        * gcc.target/powerpc/fold-vec-splats-char.c: New.
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-16.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-16.c
new file mode 100644 (file)
index 0000000..bb4a8d2
--- /dev/null
@@ -0,0 +1,46 @@
+/* Verify that overloaded built-ins for vec_splat with int
+   inputs produce the right code.  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mvsx -O2" } */
+
+#include <altivec.h>
+
+vector signed short
+testss_1 ()
+{
+  return vec_splat_s16 (5);
+}
+
+vector signed short
+testss_2 ()
+{
+  return vec_splat_s16 (-5);
+}
+
+vector signed short
+testss_3 ()
+{
+  return vec_splat_s16 (15);
+}
+
+vector unsigned short
+testus_1 ()
+{
+  return vec_splat_u16 (5);
+}
+
+vector unsigned short
+testus_2 ()
+{
+  return vec_splat_u16 (-5);
+}
+
+vector unsigned short
+testus_3 ()
+{
+  return vec_splat_u16 (15);
+}
+
+/* { dg-final { scan-assembler-times "vspltish" 6 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-32.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-32.c
new file mode 100644 (file)
index 0000000..f59849e
--- /dev/null
@@ -0,0 +1,46 @@
+/* Verify that overloaded built-ins for vec_splat with int
+   inputs produce the right code.  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec -O2" } */
+
+#include <altivec.h>
+
+vector signed int
+testsi_1 ()
+{
+  return vec_splat_s32 (5);
+}
+
+vector signed int
+testsi_2 ()
+{
+  return vec_splat_s32 (-5);
+}
+
+vector signed int
+testsi_3 ()
+{
+ return vec_splat_s32 (15);
+}
+
+vector unsigned int
+testui_1 ()
+{
+  return vec_splat_u32 (5);
+}
+
+vector unsigned int
+testui_2 ()
+{
+  return vec_splat_u32 (-5);
+}
+
+vector unsigned int
+testui_3 ()
+{
+  return vec_splat_u32 (15);
+}
+
+/* { dg-final { scan-assembler-times "vspltisw" 6 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-8.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-8.c
new file mode 100644 (file)
index 0000000..679fcb3
--- /dev/null
@@ -0,0 +1,46 @@
+/* Verify that overloaded built-ins for vec_splat with int
+   inputs produce the right code.  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec -O2" } */
+
+#include <altivec.h>
+
+vector signed char
+testsc_1 ()
+{
+  return vec_splat_s8 (5);
+}
+
+vector signed char
+testsc_2 ()
+{
+  return vec_splat_s8 (-5);
+}
+
+vector signed char
+testsc_3 ()
+{
+  return vec_splat_s8 (15);
+}
+
+vector unsigned char
+testuc_1 ()
+{
+  return vec_splat_u8 (5);
+}
+
+vector unsigned char
+testuc_2 ()
+{
+  return vec_splat_u8 (-5);
+}
+
+vector unsigned char
+testuc_3 ()
+{
+  return vec_splat_u8 (15);
+}
+
+/* { dg-final { scan-assembler-times "vspltisb" 6 } } */