public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* S/390: Fix matching setmem_long_and*.
@ 2017-01-26 16:11 Dominik Vogt
  2017-01-27  8:20 ` Andreas Krebbel
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Vogt @ 2017-01-26 16:11 UTC (permalink / raw)
  To: gcc-patches; +Cc: Andreas Krebbel

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

The attached patch reactivates the setmem_long_and* patterns on
S/390 that have not been generated for a while.  Regression tested
and bootstrapped on s390x biarch and s390.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany

[-- Attachment #2: 0001-ChangeLog --]
[-- Type: text/plain, Size: 243 bytes --]

gcc/ChangeLog-setmem_long_and

	* config/s390/s390.md ("*setmem_long_and")
	("*setmem_long_and_31z"): Use zero_extend instead of and.
gcc/testsuite/ChangeLog-setmem_long_and

	* gcc.target/s390/md/setmem_long-1.c: Remove xfail, skip with -O0.

[-- Attachment #3: 0001-S-390-Fix-matching-setmem_long_and.patch --]
[-- Type: text/plain, Size: 3345 bytes --]

From bd89a98bc61c3b1cfde4ede30f8017eadd5586ab Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date: Thu, 26 Jan 2017 13:02:25 +0100
Subject: [PATCH] S/390: Fix matching setmem_long_and*.

The old pattern never matched in combine.
Remove the xfail from the test case.
---
 gcc/config/s390/s390.md                          | 14 ++++----------
 gcc/testsuite/gcc.target/s390/md/setmem_long-1.c | 10 ++++++++--
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index ee7ca73..3135175 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -3402,15 +3402,12 @@
 (define_insn "*setmem_long_and"
   [(clobber (match_operand:<DBL> 0 "register_operand" "=d"))
    (set (mem:BLK (subreg:P (match_operand:<DBL> 3 "register_operand" "0") 0))
-        (unspec:BLK [(and:P
-		      (match_operand:P 2 "setmem_operand" "Y")
-		      (match_operand:P 4 "const_int_operand"             "n"))
+        (unspec:BLK [(zero_extend:P (match_operand:QI 2 "setmem_operand" "Y"))
 		    (subreg:P (match_dup 3) <modesize>)]
 		    UNSPEC_REPLICATE_BYTE))
    (use (match_operand:<DBL> 1 "register_operand" "d"))
    (clobber (reg:CC CC_REGNUM))]
-  "(TARGET_64BIT || !TARGET_ZARCH) &&
-   (INTVAL (operands[4]) & 255) == 255"
+  "(TARGET_64BIT || !TARGET_ZARCH)"
   "mvcle\t%0,%1,%Y2\;jo\t.-4"
   [(set_attr "length" "8")
    (set_attr "type" "vs")])
@@ -3433,14 +3430,11 @@
 (define_insn "*setmem_long_and_31z"
   [(clobber (match_operand:TI 0 "register_operand" "=d"))
    (set (mem:BLK (subreg:SI (match_operand:TI 3 "register_operand" "0") 4))
-        (unspec:BLK [(and:SI
-		      (match_operand:SI 2 "setmem_operand" "Y")
-		      (match_operand:SI 4 "const_int_operand" "n"))
+        (unspec:BLK [(zero_extend:SI (match_operand:QI 2 "setmem_operand" "Y"))
 		    (subreg:SI (match_dup 3) 12)] UNSPEC_REPLICATE_BYTE))
    (use (match_operand:TI 1 "register_operand" "d"))
    (clobber (reg:CC CC_REGNUM))]
-  "(!TARGET_64BIT && TARGET_ZARCH) &&
-   (INTVAL (operands[4]) & 255) == 255"
+  "(!TARGET_64BIT && TARGET_ZARCH)"
   "mvcle\t%0,%1,%Y2\;jo\t.-4"
   [(set_attr "length" "8")
    (set_attr "type" "vs")])
diff --git a/gcc/testsuite/gcc.target/s390/md/setmem_long-1.c b/gcc/testsuite/gcc.target/s390/md/setmem_long-1.c
index 5fc54e2..dec7197 100644
--- a/gcc/testsuite/gcc.target/s390/md/setmem_long-1.c
+++ b/gcc/testsuite/gcc.target/s390/md/setmem_long-1.c
@@ -4,6 +4,12 @@
 /* { dg-options "-mmvcle -dP -save-temps" } */
 /* { dg-do run { target { s390_useable_hw } } } */
 
+/* Skip test if -O0 is present on the command line or -O... is missing:
+
+    { dg-skip-if "" { *-*-* } { "-march=z9*" "-O0" } { "" } }
+    { dg-skip-if "" { *-*-* } { "*" } { "-O*" } }
+*/
+
 __attribute__ ((noinline))
 void test(char *p, char c, int len)
 {
@@ -17,8 +23,8 @@ void test2(char *p, int c, int len)
 }
 
 /* Check that the right patterns are used.  */
-/* { dg-final { scan-assembler-times {c"?:10 .*{[*]setmem_long_?3?1?z?}} 1 } } */
-/* { dg-final { scan-assembler-times {c"?:16 .*{[*]setmem_long_and_?3?1?z?}} 1 { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-times {c"?:16 .*{[*]setmem_long_?3?1?z?}} 1 } } */
+/* { dg-final { scan-assembler-times {c"?:22 .*{[*]setmem_long_and_?3?1?z?}} 1 } } */
 
 #define LEN 500
 char buf[LEN + 2];
-- 
2.3.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: S/390: Fix matching setmem_long_and*.
  2017-01-26 16:11 S/390: Fix matching setmem_long_and* Dominik Vogt
@ 2017-01-27  8:20 ` Andreas Krebbel
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Krebbel @ 2017-01-27  8:20 UTC (permalink / raw)
  To: vogt, gcc-patches

On 01/26/2017 05:08 PM, Dominik Vogt wrote:
> The attached patch reactivates the setmem_long_and* patterns on
> S/390 that have not been generated for a while.  Regression tested
> and bootstrapped on s390x biarch and s390.
> 
> Ciao
> 
> Dominik ^_^  ^_^
> 
Applied. Thanks!

-Andreas-

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-27  8:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-26 16:11 S/390: Fix matching setmem_long_and* Dominik Vogt
2017-01-27  8:20 ` Andreas Krebbel

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).