fold-vec-madd-double.c: New.
authorWill Schmidt <will_schmidt@vnet.ibm.com>
Wed, 9 Aug 2017 19:02:41 +0000 (19:02 +0000)
committerWill Schmidt <willschm@gcc.gnu.org>
Wed, 9 Aug 2017 19:02:41 +0000 (19:02 +0000)
[gcc/testsuite]

2017-08-09  Will Schmidt  <will_schmidt@vnet.ibm.com>

* gcc.target/powerpc/fold-vec-madd-double.c: New.
* gcc.target/powerpc/fold-vec-madd-float.c: New.
* gcc.target/powerpc/fold-vec-madd-short.c: New.

From-SVN: r250996

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/fold-vec-madd-double.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/fold-vec-madd-float.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/fold-vec-madd-short.c [new file with mode: 0644]

index 97a17e33f166b8c7f7a102995001795d82e2099e..6e02fad4f4a5c8e13aa10ace9baad9691ec9cf0e 100644 (file)
@@ -1,3 +1,9 @@
+2017-08-09  Will Schmidt  <will_schmidt@vnet.ibm.com>
+
+       * gcc.target/powerpc/fold-vec-madd-double.c: New.
+       * gcc.target/powerpc/fold-vec-madd-float.c: New.
+       * gcc.target/powerpc/fold-vec-madd-short.c: New.
+
 2017-08-09  Will Schmidt  <will_schmidt@vnet.ibm.com>
 
        * gcc.target/powerpc/fold-vec-cntlz-int.c: New.
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-double.c
new file mode 100644 (file)
index 0000000..0fe7824
--- /dev/null
@@ -0,0 +1,17 @@
+/* Verify that overloaded built-ins for vec_madd with
+   double inputs produce the right results.  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mvsx -O2" } */
+
+#include <altivec.h>
+
+vector double
+testd_l (vector double vd2, vector double vd3, vector double vd4)
+{
+  return vec_madd (vd2, vd3, vd4);
+}
+
+/* { dg-final { scan-assembler-times "xvmaddmdp|xvmaddadp" 1 } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-float.c
new file mode 100644 (file)
index 0000000..fcfe0c3
--- /dev/null
@@ -0,0 +1,17 @@
+/* Verify that overloaded built-ins for vec_madd with float
+   inputs produce the right results.  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mvsx -O2" } */
+
+#include <altivec.h>
+
+vector float
+testf_l (vector float vf2, vector float vf3, vector float vf4)
+{
+  return vec_madd (vf2, vf3, vf4);
+}
+
+/* { dg-final { scan-assembler-times "xvmaddmsp|xvmaddasp" 1 } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-short.c
new file mode 100644 (file)
index 0000000..0e78f35
--- /dev/null
@@ -0,0 +1,38 @@
+/* Verify that overloaded built-ins for vec_madd with short
+   inputs produce the right results.  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec -O2" } */
+
+#include <altivec.h>
+
+vector signed short
+test_mad_sss (vector signed short vss2, vector signed short vss3,
+             vector signed short vss4)
+{
+  return vec_madd (vss2, vss3, vss4);
+}
+
+vector signed short
+test_mad_suu (vector signed short vss2, vector unsigned short vus3,
+               vector unsigned short vus4)
+{
+  return vec_madd (vss2, vus3, vus4);
+}
+
+vector signed short
+test_mad_uss (vector unsigned short vus2, vector signed short vss3,
+             vector signed short vss4)
+{
+  return vec_madd (vus2, vss3, vss4);
+}
+
+vector unsigned short
+test_mad_uuu (vector unsigned short vus2, vector unsigned short vus3,
+               vector unsigned short vus4)
+{
+  return vec_madd (vus2, vus3, vus4);
+}
+
+/* { dg-final { scan-assembler-times "vmladduhm" 4 } } */