public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH 1/7] S/390: Fix vrepi constraint letter.
Date: Fri, 27 Nov 2015 11:42:00 -0000	[thread overview]
Message-ID: <1448624512-22364-2-git-send-email-krebbel@linux.vnet.ibm.com> (raw)
In-Reply-To: <1448624512-22364-1-git-send-email-krebbel@linux.vnet.ibm.com>

gcc/ChangeLog:

2015-11-27  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/vector.md ("*vec_splats<mode>"): Fix constraint
	latter I->K.

gcc/testsuite/ChangeLog:

2015-11-27  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/zvector/vec-splat-1.c: New test.
---
 gcc/config/s390/vector.md                          |  4 +--
 .../gcc.target/s390/zvector/vec-splat-1.c          | 42 ++++++++++++++++++++++
 2 files changed, 44 insertions(+), 2 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/vec-splat-1.c

diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md
index 16276e0..d8b9b07 100644
--- a/gcc/config/s390/vector.md
+++ b/gcc/config/s390/vector.md
@@ -370,11 +370,11 @@
 
 (define_insn "*vec_splats<mode>"
   [(set (match_operand:V_HW                          0 "register_operand" "=v,v,v,v")
-	(vec_duplicate:V_HW (match_operand:<non_vec> 1 "general_operand"  "QR,I,v,d")))]
+	(vec_duplicate:V_HW (match_operand:<non_vec> 1 "general_operand"  "QR,K,v,d")))]
   "TARGET_VX"
   "@
    vlrep<bhfgq>\t%v0,%1
-   vrepi<bhfgq>\t%v0,%1
+   vrepi<bhfgq>\t%v0,%h1
    vrep<bhfgq>\t%v0,%v1,0
    #"
   [(set_attr "op_type" "VRX,VRI,VRI,*")])
diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec-splat-1.c b/gcc/testsuite/gcc.target/s390/zvector/vec-splat-1.c
new file mode 100644
index 0000000..bab2e2d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/vec-splat-1.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -march=z13 -mzvector" } */
+
+#include <vecintrin.h>
+
+vector signed char v16qi;
+vector short       v8hi;
+vector int         v4si;
+vector long long   v2di;
+
+vector unsigned char      uv16qi;
+vector unsigned short     uv8hi;
+vector unsigned int       uv4si;
+vector unsigned long long uv2di;
+
+int
+foo ()
+{
+  v16qi  = vec_splats ((signed char)0x77);
+  uv16qi = vec_splats ((unsigned char)0x77);
+
+  v8hi  = vec_splats ((short int)0x7f0f);
+  uv8hi = vec_splats ((unsigned short int)0x7f0f);
+
+  v4si  = vec_splats ((int)0x7f0f);
+  uv4si = vec_splats ((unsigned int)0x7f0f);
+
+  v2di  = vec_splats ((long long)0x7f0f);
+  uv2di = vec_splats ((unsigned long long)0x7f0f);
+}
+
+/* { dg-final { scan-assembler-times "vrepib\t%v.*,119" 1 } } */
+/* { dg-final { scan-assembler-times "vrepib\t%v.*,119" 1 } } */
+
+/* { dg-final { scan-assembler-times "vrepih\t%v.*,32527" 1 } } */
+/* { dg-final { scan-assembler-times "vrepih\t%v.*,32527" 1 } } */
+
+/* { dg-final { scan-assembler-times "vrepif\t%v.*,32527" 1 } } */
+/* { dg-final { scan-assembler-times "vrepif\t%v.*,32527" 1 } } */
+
+/* { dg-final { scan-assembler-times "vrepig\t%v.*,32527" 1 } } */
+/* { dg-final { scan-assembler-times "vrepig\t%v.*,32527" 1 } } */
-- 
2.3.0

  parent reply	other threads:[~2015-11-27 11:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27 11:42 [PATCH 0/7] S/390: Minor fixes and improvements for the vector builtins Andreas Krebbel
2015-11-27 11:42 ` [PATCH 6/7] S/390: vec_set mode DI->SI for shift_count Andreas Krebbel
2015-11-27 11:42 ` Andreas Krebbel [this message]
2015-11-27 11:43 ` [PATCH 7/7] S/390: Make constant checking more strict Andreas Krebbel
2015-11-27 11:43 ` [PATCH 5/7] S/390: Fix vec_splat_* builtins Andreas Krebbel
2015-11-27 11:43 ` [PATCH 4/7] S/390: Sort builtin types - cleanup only Andreas Krebbel
2015-11-27 11:43 ` [PATCH 3/7] S/390: Fix RT flag in vstrc instruction Andreas Krebbel
2015-11-27 12:05 ` [PATCH 2/7] S/390: Enable vrepi constants Andreas Krebbel

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=1448624512-22364-2-git-send-email-krebbel@linux.vnet.ibm.com \
    --to=krebbel@linux.vnet.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).