* [PATCH, rs6000] testcase coverage for vec_madd built-in functions
@ 2017-08-08 21:20 Will Schmidt
2017-08-08 23:06 ` Segher Boessenkool
0 siblings, 1 reply; 2+ messages in thread
From: Will Schmidt @ 2017-08-08 21:20 UTC (permalink / raw)
To: GCC Patches
Cc: Carl E. Love, Segher Boessenkool, David Edelsohn, Bill Schmidt
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.
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 } } */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH, rs6000] testcase coverage for vec_madd built-in functions
2017-08-08 21:20 [PATCH, rs6000] testcase coverage for vec_madd built-in functions Will Schmidt
@ 2017-08-08 23:06 ` Segher Boessenkool
0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2017-08-08 23:06 UTC (permalink / raw)
To: Will Schmidt; +Cc: GCC Patches, Carl E. Love, David Edelsohn, Bill Schmidt
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-08 23:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-08 21:20 [PATCH, rs6000] testcase coverage for vec_madd built-in functions Will Schmidt
2017-08-08 23:06 ` Segher Boessenkool
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).