* [PATCH, rs6000] Add testcase coverage for vec_msum built-in
@ 2017-08-08 21:22 Will Schmidt
2017-08-08 23:10 ` Segher Boessenkool
0 siblings, 1 reply; 2+ messages in thread
From: Will Schmidt @ 2017-08-08 21:22 UTC (permalink / raw)
To: GCC Patches
Cc: Carl E. Love, Segher Boessenkool, David Edelsohn, Bill Schmidt
Hi,
[PATCH, rs6000] Add testcase coverage for vec_msum built-in
Add testcase coverage for vec_msum built-in.
Tested across power platforms (p6 and newer).
OK for trunk?
Thanks,
-Will
[gcc/testsuite]
2017-08-08 Will Schmidt <will_schmidt@vnet.ibm.com>
* fold-vec-msum-char.c: New.
* fold-vec-msum-short.c: New.
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-char.c
new file mode 100644
index 0000000..53519d5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-char.c
@@ -0,0 +1,25 @@
+/* Verify that overloaded built-ins for vec_msum() with char inputs
+ produce the right results. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec -O2" } */
+
+#include <altivec.h>
+
+vector unsigned int
+test_msum_ui_uc_uc_ui (vector unsigned char vuc2, vector unsigned char vuc3,
+ vector unsigned int vui2)
+{
+ return vec_msum (vuc2, vuc3, vui2);
+}
+
+vector signed int
+test_msum_si_sc_uc_si (vector signed char vsc2, vector unsigned char vuc3,
+ vector signed int vsi2)
+{
+ return vec_msum (vsc2, vuc3, vsi2);
+}
+
+/* { dg-final { scan-assembler-times "vmsumubm" 1 } } */
+/* { dg-final { scan-assembler-times "vmsummbm" 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-short.c
new file mode 100644
index 0000000..61e1d35
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-short.c
@@ -0,0 +1,25 @@
+/* Verify that overloaded built-ins for vec_msum with int
+ inputs produce the right results. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec -O2" } */
+
+#include <altivec.h>
+
+vector signed int
+test_msum_si (vector signed short vss2, vector signed short vss3,
+ vector signed int vsi2)
+{
+ return vec_msum (vss2, vss3, vsi2);
+}
+
+vector unsigned int
+test_msum)ui (vector unsigned short vus2, vector unsigned short vus3,
+ vector unsigned int vui2)
+{
+ return vec_msum (vus2, vus3, vui2);
+}
+
+/* { dg-final { scan-assembler-times "vmsumshm" 1 } } */
+/* { dg-final { scan-assembler-times "vmsumuhm" 1 } } */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH, rs6000] Add testcase coverage for vec_msum built-in
2017-08-08 21:22 [PATCH, rs6000] Add testcase coverage for vec_msum built-in Will Schmidt
@ 2017-08-08 23:10 ` Segher Boessenkool
0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2017-08-08 23:10 UTC (permalink / raw)
To: Will Schmidt; +Cc: GCC Patches, Carl E. Love, David Edelsohn, Bill Schmidt
Hi,
On Tue, Aug 08, 2017 at 04:22:40PM -0500, Will Schmidt wrote:
> * fold-vec-msum-char.c: New.
> * fold-vec-msum-short.c: New.
Okay for trunk with the paths in the changelog fixed. Thanks!
Segher
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-08 23:10 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:22 [PATCH, rs6000] Add testcase coverage for vec_msum built-in Will Schmidt
2017-08-08 23:10 ` 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).