aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDominik Vogt <vogt@linux.vnet.ibm.com>2017-01-27 08:07:26 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2017-01-27 08:07:26 +0000
commitd876f5cd0272d7d7d6842703d59a130bdaf72cca (patch)
tree7de78e20c7898200c4f2d0dca60799451826e0be /gcc
parentbb6a6ee9db925bea82bba47b1b3cdd3555fb539b (diff)
downloadgcc-d876f5cd0272d7d7d6842703d59a130bdaf72cca.zip
gcc-d876f5cd0272d7d7d6842703d59a130bdaf72cca.tar.gz
gcc-d876f5cd0272d7d7d6842703d59a130bdaf72cca.tar.bz2
S/390: Fix matching setmem_long_and*.
The attached patch reactivates the setmem_long_and* patterns on S/390 that have not been generated for a while. gcc/ChangeLog: 2017-01-27 Dominik Vogt <vogt@linux.vnet.ibm.com> * config/s390/s390.md ("*setmem_long_and") ("*setmem_long_and_31z"): Use zero_extend instead of and. gcc/testsuite/ChangeLog: 2017-01-27 Dominik Vogt <vogt@linux.vnet.ibm.com> * gcc.target/s390/md/setmem_long-1.c: Remove xfail, skip with -O0. From-SVN: r244963
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/s390/s390.md14
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/s390/md/setmem_long-1.c10
4 files changed, 21 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c625d7b..e288fd5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-27 Dominik Vogt <vogt@linux.vnet.ibm.com>
+
+ * config/s390/s390.md ("*setmem_long_and")
+ ("*setmem_long_and_31z"): Use zero_extend instead of and.
+
2017-01-26 Martin Sebor <msebor@redhat.com>
* gimple-ssa-sprintf.c (format_floating): Simplify the computation
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/ChangeLog b/gcc/testsuite/ChangeLog
index 71ef013..85425e4 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2017-01-27 Dominik Vogt <vogt@linux.vnet.ibm.com>
+
+ * gcc.target/s390/md/setmem_long-1.c: Remove xfail, skip with -O0.
+
2017-01-27 Adam Butcher <adam@jessamine.co.uk>
PR c++/64382
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];