fold-vec-unpack-char.c: New.
authorWill Schmidt <will_schmidt@vnet.ibm.com>
Tue, 17 Jul 2018 15:51:12 +0000 (15:51 +0000)
committerWill Schmidt <willschm@gcc.gnu.org>
Tue, 17 Jul 2018 15:51:12 +0000 (15:51 +0000)
[testsuite]

2018-07-06  Will Schmidt  <will_schmidt@vnet.ibm.com>

* gcc.target/powerpc/fold-vec-unpack-char.c: New.
* gcc.target/powerpc/fold-vec-unpack-float.c: New.
* gcc.target/powerpc/fold-vec-unpack-int.c: New.
* gcc.target/powerpc/fold-vec-unpack-pixel.c: New.
* gcc.target/powerpc/fold-vec-unpack-short.c: New.

From-SVN: r262827

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-char.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-float.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-int.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-pixel.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-short.c [new file with mode: 0644]

index 9a88fb282b0f89c17d2a071b95d595cf49f9b48b..bcedfc5c8bb3da999010fdc18765af71036a7900 100644 (file)
@@ -1,3 +1,11 @@
+2018-07-17  Will Schmidt  <will_schmidt@vnet.ibm.com>
+
+       * gcc.target/powerpc/fold-vec-unpack-char.c: New.
+       * gcc.target/powerpc/fold-vec-unpack-float.c: New.
+       * gcc.target/powerpc/fold-vec-unpack-int.c: New.
+       * gcc.target/powerpc/fold-vec-unpack-pixel.c: New.
+       * gcc.target/powerpc/fold-vec-unpack-short.c: New.
+
 2018-07-17  David Edelsohn <dje.gcc@gmail.com>
 
        * gcc.target/powerpc/pr57150.c: Require longdouble128.
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-char.c
new file mode 100644 (file)
index 0000000..7f4b372
--- /dev/null
@@ -0,0 +1,36 @@
+/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with char
+   inputs produce the right code.  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec -O2" } */
+
+#include <altivec.h>
+
+vector bool short
+testbc_l (vector bool char vbc2)
+{
+  return vec_unpackl (vbc2);
+}
+
+vector signed short
+testsc_l (vector signed char vsc2)
+{
+  return vec_unpackl (vsc2);
+}
+
+vector bool short
+testbc_h (vector bool char vbc2)
+{
+  return vec_unpackh (vbc2);
+}
+
+vector signed short
+testsc_h (vector signed char vsc2)
+{
+  return vec_unpackh (vsc2);
+}
+
+/* { dg-final { scan-assembler-times "vupkhsb" 2 } } */
+/* { dg-final { scan-assembler-times "vupklsb" 2 } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-float.c
new file mode 100644 (file)
index 0000000..78e8eb3
--- /dev/null
@@ -0,0 +1,23 @@
+/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with float
+   inputs produce the right code.  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mpower8-vector -O2" } */
+
+#include <altivec.h>
+
+vector double
+testf_l (vector float vf2)
+{
+  return vec_unpackl (vf2);
+}
+
+vector double
+testf_h (vector float vf2)
+{
+  return vec_unpackh (vf2);
+}
+
+/* { dg-final { scan-assembler-times "xxsldwi" 4 } } */
+/* { dg-final { scan-assembler-times "xvcvspdp" 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-int.c
new file mode 100644 (file)
index 0000000..621c4eb
--- /dev/null
@@ -0,0 +1,35 @@
+/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with int
+   inputs produce the right code.  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mpower8-vector -O2" } */
+
+#include <altivec.h>
+
+vector bool long long
+testbi_l (vector bool int vbi2)
+{
+  return vec_unpackl (vbi2);
+}
+
+vector signed long long
+testsi_l (vector signed int vsi2)
+{
+  return vec_unpackl (vsi2);
+}
+
+vector bool long long
+testbi_h (vector bool int vbi2)
+{
+  return vec_unpackh (vbi2);
+}
+
+vector signed long long
+testsi_h (vector signed int vsi2)
+{
+  return vec_unpackh (vsi2);
+}
+
+/* { dg-final { scan-assembler-times "vupkhsw" 2 } } */
+/* { dg-final { scan-assembler-times "vupklsw" 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-pixel.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-pixel.c
new file mode 100644 (file)
index 0000000..8e7d110
--- /dev/null
@@ -0,0 +1,23 @@
+/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with pixel
+   inputs produce the right code.  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec -O2" } */
+
+#include <altivec.h>
+
+vector unsigned int
+testf_el (vector pixel vpx2)
+{
+  return vec_unpackl (vpx2);
+}
+
+vector unsigned int
+testf_eh (vector pixel vpx2)
+{
+  return vec_unpackh (vpx2);
+}
+
+/* { dg-final { scan-assembler-times "vupkhpx" 1 } } */
+/* { dg-final { scan-assembler-times "vupklpx" 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-short.c
new file mode 100644 (file)
index 0000000..da51012
--- /dev/null
@@ -0,0 +1,36 @@
+/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl 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 bool int
+testbi_el (vector bool short vbs2)
+{
+  return vec_unpackl (vbs2);
+}
+
+vector signed int
+testsi_el (vector signed short vss2)
+{
+  return vec_unpackl (vss2);
+}
+
+vector bool int
+testbi_eh (vector bool short vbs2)
+{
+  return vec_unpackh (vbs2);
+}
+
+vector signed int
+testsi_eh (vector signed short vss2)
+{
+  return vec_unpackh (vss2);
+}
+
+/* { dg-final { scan-assembler-times "vupkhsh" 2 } } */
+/* { dg-final { scan-assembler-times "vupklsh" 2 } } */
+