[rs6000] testcase coverage for vec_madd built-in functions

Submitted by Will Schmidt on Aug. 8, 2017, 9:20 p.m.

Details

Message ID 1502227214.6577.18.camel@brimstone.rchland.ibm.com
State New
Headers show

Commit Message

Will Schmidt Aug. 8, 2017, 9:20 p.m.
Hi, 

[Patch, rs6000] testcase coverage for vec_madd built-in function
    
Add testcase coverage for vec_madd built-in function.

Tested across power platforms (p6 and newer).  
OK for trunk?

Thanks, 
-Will
    
[testsuite]

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

	* fold-vec-madd-double.c: New.
	* fold-vec-madd-float.c: New.
	* fold-vec-madd-short.c: New.

Comments

Segher Boessenkool Aug. 8, 2017, 11:05 p.m.
Hi!

On Tue, Aug 08, 2017 at 04:20:14PM -0500, Will Schmidt wrote:
> 	* fold-vec-madd-double.c: New.
> 	* fold-vec-madd-float.c: New.
> 	* fold-vec-madd-short.c: New.

Same as before, it needs the path in here (the path is relative to the
directory the changelog is in).

The actual tests look fine, please commit.  Thanks!


Segher

Patch hide | download patch | download mbox

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
index 0000000..0fe7824
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-double.c
@@ -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
index 0000000..fcfe0c3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-float.c
@@ -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
index 0000000..0e78f35
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-short.c
@@ -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 } } */