From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101758 invoked by alias); 24 Apr 2017 16:04:38 -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 99815 invoked by uid 89); 24 Apr 2017 16:04:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=do, D*linux.vnet.ibm.com, krebbellinuxvnetibmcom, krebbel@linux.vnet.ibm.com X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Apr 2017 16:04:36 +0000 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3OG3bRn130391 for ; Mon, 24 Apr 2017 12:04:36 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2a1j60hd2r-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 24 Apr 2017 12:04:36 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 24 Apr 2017 17:04:33 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 24 Apr 2017 17:04:32 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3OG4V4t14877084 for ; Mon, 24 Apr 2017 16:04:31 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 390B611C075 for ; Mon, 24 Apr 2017 17:03:36 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1B02611C052 for ; Mon, 24 Apr 2017 17:03:36 +0100 (BST) Received: from maggie.boeblingen.de.ibm.com (unknown [9.152.212.134]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS for ; Mon, 24 Apr 2017 17:03:36 +0100 (BST) From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [PATCH] S/390: PR79895: Fix TImode constant handling Date: Mon, 24 Apr 2017 17:23:00 -0000 X-TM-AS-GCONF: 00 x-cbid: 17042416-0008-0000-0000-0000043029E9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042416-0009-0000-0000-00001D6401A5 Message-Id: <20170424160430.1324-1-krebbel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-24_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1704240275 X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg01052.txt.bz2 The P constraint letter is supposed to match every constant which is acceptable during reload. However, constraints do not appear to be able to handle const_wide_int yet. It works with predicates so the alternative is modelled with a new predicate now. Bootstrapped and regression tested on s390x. Bye, -Andreas- gcc/ChangeLog: 2017-04-24 Andreas Krebbel * config/s390/predicates.md (reload_const_wide_int_operand): New predicate. * config/s390/s390.md ("movti"): Remove d/P alternative. ("movti_bigconst"): New pattern definition. gcc/testsuite/ChangeLog: 2017-04-24 Andreas Krebbel * gcc.target/s390/pr79895.c: New test. --- gcc/config/s390/predicates.md | 5 +++++ gcc/config/s390/s390.md | 13 +++++++++++-- gcc/testsuite/gcc.target/s390/pr79895.c | 9 +++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/s390/pr79895.c diff --git a/gcc/config/s390/predicates.md b/gcc/config/s390/predicates.md index 0c82efc..34a7ea2 100644 --- a/gcc/config/s390/predicates.md +++ b/gcc/config/s390/predicates.md @@ -199,6 +199,11 @@ (and (match_code "const_int") (match_test "INTVAL (op) <= 32767 && INTVAL (op) >= -32768")))) +(define_predicate "reload_const_wide_int_operand" + (and (match_code "const_wide_int") + (match_test "legitimate_reload_constant_p (op)"))) + + ;; operators -------------------------------------------------------------- ;; Return nonzero if OP is a valid comparison operator diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 59f189c..36e2a40 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -1479,11 +1479,20 @@ ; movti instruction pattern(s). ; + +; Separate out the register pair alternative since constraints (P) are +; not able to deal with const_wide_int's. But predicates do. +(define_insn "*movti_bigconst" + [(set (match_operand:TI 0 "register_operand" "=d") + (match_operand:TI 1 "reload_const_wide_int_operand" ""))] + "TARGET_ZARCH" + "#") + ; FIXME: More constants are possible by enabling jxx, jyy constraints ; for TImode (use double-int for the calculations) (define_insn "movti" - [(set (match_operand:TI 0 "nonimmediate_operand" "=d,S,v, v, v,v,d,v,R, d,o") - (match_operand:TI 1 "general_operand" " S,d,v,j00,jm1,d,v,R,v,dPT,d"))] + [(set (match_operand:TI 0 "nonimmediate_operand" "=d,S,v, v, v,v,d,v,R, d,o") + (match_operand:TI 1 "general_operand" " S,d,v,j00,jm1,d,v,R,v,dT,d"))] "TARGET_ZARCH" "@ lmg\t%0,%N0,%S1 diff --git a/gcc/testsuite/gcc.target/s390/pr79895.c b/gcc/testsuite/gcc.target/s390/pr79895.c new file mode 100644 index 0000000..02374e4 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/pr79895.c @@ -0,0 +1,9 @@ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-O1 -mno-lra" } */ + +unsigned __int128 g; +void +foo () +{ + g = (unsigned __int128)1 << 127; +} -- 2.9.1