public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Will Schmidt <will_schmidt@vnet.ibm.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: "Carl E. Love" <cel@us.ibm.com>,
	       Segher Boessenkool <segher@kernel.crashing.org>,
	       David Edelsohn <dje.gcc@gmail.com>,
	       Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Subject: [PATCH, rs6000] testcase coverage for vec_pack builtin
Date: Tue, 08 Aug 2017 21:25:00 -0000	[thread overview]
Message-ID: <1502227466.6577.23.camel@brimstone.rchland.ibm.com> (raw)

Hi, 

[PATCH, rs6000] testcase coverage for vec_pack builtin
    
Add some testcase coverage for the vec_pack 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-pack-double.c: New.
    	* fold-vec-pack-int.c: New.
    	* fold-vec-pack-longlong.c: New.
    	* fold-vec-pack-short.c: New.

diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-double.c
new file mode 100644
index 0000000..29d049a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-double.c
@@ -0,0 +1,18 @@
+/* Verify that overloaded built-ins for vec_pack with
+   double inputs produce the right results.  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mvsx -mpower8-vector -O2" } */
+
+#include <altivec.h>
+
+// vector float vec_pack (vector double, vector double);
+
+vector float
+test_pack (vector double vd2, vector double vd3)
+{
+  return vec_pack (vd2, vd3);
+}
+
+/* { dg-final { scan-assembler-times "vpkudum" 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-int.c
new file mode 100644
index 0000000..940faf3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-int.c
@@ -0,0 +1,28 @@
+/* Verify that overloaded built-ins for vec_pack 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 bool short
+testbi_h (vector bool int vbi2, vector bool int vbi3)
+{
+  return vec_pack (vbi2, vbi3);
+}
+
+vector signed short
+testsi_h (vector signed int vsi2, vector signed int vsi3)
+{
+  return vec_pack (vsi2, vsi3);
+}
+
+vector unsigned short
+testui_h (vector unsigned int vui2, vector unsigned int vui3)
+{
+  return vec_pack (vui2, vui3);
+}
+
+/* { dg-final { scan-assembler-times "vpkuwum" 3 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-longlong.c
new file mode 100644
index 0000000..d8acc3c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-longlong.c
@@ -0,0 +1,28 @@
+/* Verify that overloaded built-ins for vec_pack with long long
+   inputs produce the right results.  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mvsx -mpower8-vector -O2" } */
+
+#include <altivec.h>
+
+vector bool int
+testbl_h (vector bool long long vbl2, vector bool long long vbl3)
+{
+  return vec_pack (vbl2, vbl3);
+}
+
+vector signed int
+testsl_h (vector signed long long vsl2, vector signed long long vsl3)
+{
+  return vec_pack (vsl2, vsl3);
+}
+
+vector unsigned int
+testul_h (vector unsigned long vul2, vector unsigned long vul3)
+{
+  return vec_pack (vul2, vul3);
+}
+
+/* { dg-final { scan-assembler-times "vpkudum" 3 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-short.c
new file mode 100644
index 0000000..37cd191
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-short.c
@@ -0,0 +1,28 @@
+/* Verify that overloaded built-ins for vec_pack 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 bool char
+testbi_eh (vector bool short vbs2, vector bool short vbs3)
+{
+  return vec_pack (vbs2, vbs3);
+}
+
+vector signed char
+testsi_eh (vector signed short vss2, vector signed short vss3)
+{
+  return vec_pack (vss2, vss3);
+}
+
+vector unsigned char
+testui_eh (vector unsigned short vus2, vector unsigned short vus3)
+{
+  return vec_pack (vus2, vus3);
+}
+
+/* { dg-final { scan-assembler-times "vpkuhum" 3 } } */


             reply	other threads:[~2017-08-08 21:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 21:25 Will Schmidt [this message]
2017-08-08 23:17 ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1502227466.6577.23.camel@brimstone.rchland.ibm.com \
    --to=will_schmidt@vnet.ibm.com \
    --cc=cel@us.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).