From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14736 invoked by alias); 30 Nov 2015 15:11:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 14616 invoked by uid 89); 30 Nov 2015 15:11:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.9 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e06smtp08.uk.ibm.com Received: from e06smtp08.uk.ibm.com (HELO e06smtp08.uk.ibm.com) (195.75.94.104) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 30 Nov 2015 15:11:28 +0000 Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Nov 2015 15:11:25 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp08.uk.ibm.com (192.168.101.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 30 Nov 2015 15:11:22 -0000 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: vogt@linux.vnet.ibm.com X-IBM-RcptTo: gcc-patches@gcc.gnu.org Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 502952190046 for ; Mon, 30 Nov 2015 15:11:15 +0000 (GMT) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tAUFBLoJ64159878 for ; Mon, 30 Nov 2015 15:11:22 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tAUEBMQw008770 for ; Mon, 30 Nov 2015 07:11:23 -0700 Received: from bl3ahm9f.de.ibm.com (sig-9-83-62-145.evts.uk.ibm.com [9.83.62.145]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id tAUEBMFO008736; Mon, 30 Nov 2015 07:11:22 -0700 Received: from dvogt by bl3ahm9f.de.ibm.com with local (Exim 4.76) (envelope-from ) id 1a3Q6r-0006kU-7S; Mon, 30 Nov 2015 16:11:21 +0100 Date: Mon, 30 Nov 2015 15:23:00 -0000 From: Dominik Vogt To: gcc-patches@gcc.gnu.org Cc: Andreas Krebbel , Ulrich Weigand Subject: S/390: Fix warnings in "*setmem_long..." patterns. Message-ID: <20151130151120.GA25255@linux.vnet.ibm.com> Reply-To: vogt@linux.vnet.ibm.com Mail-Followup-To: gcc-patches@gcc.gnu.org, Andreas Krebbel , Ulrich Weigand MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="wRRV7LY7NUeQGEoC" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15113015-0033-0000-0000-000004F26885 X-SW-Source: 2015-11/txt/msg03491.txt.bz2 --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 682 The attached patch fixes some warnings generated by the setmem... patterns in s390.md during build and add test cases for the patterns. The patch is to be added on to p of the movstr patch: https://gcc.gnu.org/ml/gcc-patches/2015-11/msg03485.html The test cases validate that the patterns are actually used, but at the moment the setmem_long_and pattern is never actually used and thus the test case would fail. So I've split the patch in two (both attached to this message) to activate this part of the test once we've fixed that. The patch has passed the SPEC2006 testsuite without any measurable changes in performance. Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=0001-0001b-Changelog Content-length: 368 gcc/ChangeLog * config/s390/s390.c (s390_expand_setmem): Use new expanders. * config/s390/s390.md ("*setmem_long") ("*setmem_long_and", "*setmem_long_31z"): Fix warnings. ("setmem_long_"): New expanders. ("setmem_long"): Removed. gcc/testsuite/ChangeLog * gcc.target/s390/md/setmem_long-1.c: New test. * gcc.target/s390/md/setmem_long-2.c: New test. --wRRV7LY7NUeQGEoC Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-S-390-Fix-warnings-in-setmem_long.-patterns.patch" Content-length: 5265 >From 6b484cd8a9f39a38b3e990b4ac160c8254c03f6b Mon Sep 17 00:00:00 2001 From: Dominik Vogt Date: Wed, 4 Nov 2015 03:16:24 +0100 Subject: [PATCH 1/1.5] S/390: Fix warnings in "*setmem_long..." patterns. --- gcc/config/s390/s390.c | 7 ++++++- gcc/config/s390/s390.md | 18 +++++++++++++----- gcc/testsuite/gcc.target/s390/md/setmem_long-1.c | 20 ++++++++++++++++++++ gcc/testsuite/gcc.target/s390/md/setmem_long-2.c | 20 ++++++++++++++++++++ 4 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/gcc.target/s390/md/setmem_long-1.c create mode 100644 gcc/testsuite/gcc.target/s390/md/setmem_long-2.c diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 40ee2f7..8f2396f 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -5178,7 +5178,12 @@ s390_expand_setmem (rtx dst, rtx len, rtx val) else if (TARGET_MVCLE) { val = force_not_mem (convert_modes (Pmode, QImode, val, 1)); - emit_insn (gen_setmem_long (dst, convert_to_mode (Pmode, len, 1), val)); + if (TARGET_64BIT) + emit_insn (gen_setmem_long_di (dst, convert_to_mode (Pmode, len, 1), + val)); + else + emit_insn (gen_setmem_long_si (dst, convert_to_mode (Pmode, len, 1), + val)); } else diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 75e9af7..ed98101 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -70,6 +70,9 @@ ; Copy CC as is into the lower 2 bits of an integer register UNSPEC_CC_TO_INT + ; Convert Pmode to BLKmode + UNSPEC_P_TO_BLK + ; GOT/PLT and lt-relative accesses UNSPEC_LTREL_OFFSET UNSPEC_LTREL_BASE @@ -3281,11 +3284,12 @@ ; Initialize a block of arbitrary length with (operands[2] % 256). -(define_expand "setmem_long" +(define_expand "setmem_long_" [(parallel [(clobber (match_dup 1)) (set (match_operand:BLK 0 "memory_operand" "") - (match_operand 2 "shift_count_or_setmem_operand" "")) + (unspec:BLK [(match_operand:P 2 "shift_count_or_setmem_operand" "")] + UNSPEC_P_TO_BLK)) (use (match_operand 1 "general_operand" "")) (use (match_dup 3)) (clobber (reg:CC CC_REGNUM))])] @@ -3312,7 +3316,8 @@ (define_insn "*setmem_long" [(clobber (match_operand: 0 "register_operand" "=d")) (set (mem:BLK (subreg:P (match_operand: 3 "register_operand" "0") 0)) - (match_operand 2 "shift_count_or_setmem_operand" "Y")) + (unspec:BLK [(match_operand:P 2 "shift_count_or_setmem_operand" "Y")] + UNSPEC_P_TO_BLK)) (use (match_dup 3)) (use (match_operand: 1 "register_operand" "d")) (clobber (reg:CC CC_REGNUM))] @@ -3324,7 +3329,9 @@ (define_insn "*setmem_long_and" [(clobber (match_operand: 0 "register_operand" "=d")) (set (mem:BLK (subreg:P (match_operand: 3 "register_operand" "0") 0)) - (and (match_operand 2 "shift_count_or_setmem_operand" "Y") + (and:BLK (unspec:BLK + [(match_operand:P 2 "shift_count_or_setmem_operand" "Y")] + UNSPEC_P_TO_BLK) (match_operand 4 "const_int_operand" "n"))) (use (match_dup 3)) (use (match_operand: 1 "register_operand" "d")) @@ -3338,7 +3345,8 @@ (define_insn "*setmem_long_31z" [(clobber (match_operand:TI 0 "register_operand" "=d")) (set (mem:BLK (subreg:SI (match_operand:TI 3 "register_operand" "0") 4)) - (match_operand 2 "shift_count_or_setmem_operand" "Y")) + (unspec:BLK [(match_operand:P 2 "shift_count_or_setmem_operand" "Y")] + UNSPEC_P_TO_BLK)) (use (match_dup 3)) (use (match_operand:TI 1 "register_operand" "d")) (clobber (reg:CC CC_REGNUM))] diff --git a/gcc/testsuite/gcc.target/s390/md/setmem_long-1.c b/gcc/testsuite/gcc.target/s390/md/setmem_long-1.c new file mode 100644 index 0000000..9a926ce --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/md/setmem_long-1.c @@ -0,0 +1,20 @@ +/* Machine description pattern tests. */ + +/* { dg-do compile { target { lp64 } } } */ +/* { dg-options "-mmvcle -dP" } */ + +#include + +void test(char *p, char c) +{ + __builtin_memset (p, c, 10000); +} + +void test2(char *p, int c) +{ + __builtin_memset (p, (char)c, 10000); +} + +/* Check that the right patterns are used. */ +/* { dg-final { scan-assembler-times "c:10 .\*\{\\*setmem_long\}" 1 } } */ +/* { dg-final { scan-assembler-times "c:15 .\*\{\\*setmem_long\}" 1 } } */ diff --git a/gcc/testsuite/gcc.target/s390/md/setmem_long-2.c b/gcc/testsuite/gcc.target/s390/md/setmem_long-2.c new file mode 100644 index 0000000..ce6aa42 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/md/setmem_long-2.c @@ -0,0 +1,20 @@ +/* Machine description pattern tests. */ + +/* { dg-do compile { target { ! lp64 } } } */ +/* { dg-options "-mmvcle -mzarch -dP" } */ + +#include + +void test(char *p, char c) +{ + __builtin_memset (p, c, 10000); +} + +void test2(char *p, int c) +{ + __builtin_memset (p, (char)c, 10000); +} + +/* Check that the right patterns are used. */ +/* { dg-final { scan-assembler-times "c:10 .\*\{\\*setmem_long_31z\}" 1 } } */ +/* { dg-final { scan-assembler-times "c:15 .\*\{\\*setmem_long_31z\}" 1 } } */ -- 2.3.0 --wRRV7LY7NUeQGEoC Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001b-S-390-Test-that-the-setmem_long_and-pattern-is-used.patch" Content-length: 1992 >From 7f9b0b46f49cb0c99dc461572057726d44d88e2e Mon Sep 17 00:00:00 2001 From: Dominik Vogt Date: Mon, 30 Nov 2015 15:34:27 +0100 Subject: [PATCH 1.5/1.5] S/390: Test that the setmem_long_and pattern is used. --- gcc/testsuite/gcc.target/s390/md/setmem_long-1.c | 7 ++++++- gcc/testsuite/gcc.target/s390/md/setmem_long-2.c | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) 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 9a926ce..c0ed482 100644 --- a/gcc/testsuite/gcc.target/s390/md/setmem_long-1.c +++ b/gcc/testsuite/gcc.target/s390/md/setmem_long-1.c @@ -17,4 +17,9 @@ void test2(char *p, int c) /* Check that the right patterns are used. */ /* { dg-final { scan-assembler-times "c:10 .\*\{\\*setmem_long\}" 1 } } */ -/* { dg-final { scan-assembler-times "c:15 .\*\{\\*setmem_long\}" 1 } } */ +/* { dg-final { scan-assembler-times "c:15 .\*\{\\*setmem_long_and\}" 1 } } */ + +/* Check that the setmem_long_and pattern is used properly. */ +/* { dg-final { scan-assembler-not "\tsllg\t" } } */ +/* { dg-final { scan-assembler-not "\tllgcr\t" } } */ +/* { dg-final { scan-assembler-not "\tn\t" } } */ diff --git a/gcc/testsuite/gcc.target/s390/md/setmem_long-2.c b/gcc/testsuite/gcc.target/s390/md/setmem_long-2.c index ce6aa42..8f29071 100644 --- a/gcc/testsuite/gcc.target/s390/md/setmem_long-2.c +++ b/gcc/testsuite/gcc.target/s390/md/setmem_long-2.c @@ -17,4 +17,8 @@ void test2(char *p, int c) /* Check that the right patterns are used. */ /* { dg-final { scan-assembler-times "c:10 .\*\{\\*setmem_long_31z\}" 1 } } */ -/* { dg-final { scan-assembler-times "c:15 .\*\{\\*setmem_long_31z\}" 1 } } */ +/* { dg-final { scan-assembler-times "c:15 .\*\{\\*setmem_long_and\}" 1 } } */ + +/* Check that the setmem_long_and pattern is used properly. */ +/* { dg-final { scan-assembler-not "\tllcr\t" } } */ +/* { dg-final { scan-assembler-not "\tn\t" } } */ -- 2.3.0 --wRRV7LY7NUeQGEoC--