From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50488 invoked by alias); 24 Apr 2017 14:43:36 -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 50460 invoked by uid 89); 24 Apr 2017 14:43:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:D*de.ibm.com, Hx-languages-length:2664, among 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 14:43:33 +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 v3OEcYeA012741 for ; Mon, 24 Apr 2017 10:43:33 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2a1j60cxhy-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 24 Apr 2017 10:43:33 -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 15:43:31 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) 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 15:43:29 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3OEhStC15794514; Mon, 24 Apr 2017 14:43:28 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D55FF4C04E; Mon, 24 Apr 2017 15:42:39 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C39EF4C040; Mon, 24 Apr 2017 15:42:39 +0100 (BST) Received: from oc3748833570.ibm.com (unknown [9.152.213.161]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 24 Apr 2017 15:42:39 +0100 (BST) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id 55E00D807FA; Mon, 24 Apr 2017 16:43:28 +0200 (CEST) Subject: Re: [PATCH v5] S/390: Optimize atomic_compare_exchange and atomic_compare builtins. To: vogt@linux.vnet.ibm.com Date: Mon, 24 Apr 2017 15:20:00 -0000 From: "Ulrich Weigand" Cc: gcc-patches@gcc.gnu.org, krebbel@linux.vnet.ibm.com (Andreas Krebbel), Ulrich.Weigand@de.ibm.com (Ulrich Weigand) In-Reply-To: <20170411142054.GA12607@linux.vnet.ibm.com> from "Dominik Vogt" at Apr 11, 2017 03:20:55 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17042414-0008-0000-0000-0000043008DE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042414-0009-0000-0000-00001D63915F Message-Id: <20170424144328.55E00D807FA@oc3748833570.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-24_11:,, 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-1704240254 X-SW-Source: 2017-04/txt/msg01044.txt.bz2 Dominik Vogt wrote: > On Mon, Mar 27, 2017 at 09:27:35PM +0100, Dominik Vogt wrote: > > The attached patch optimizes the atomic_exchange and > > atomic_compare patterns on s390 and s390x (mostly limited to > > SImode and DImode). Among general optimizaation, the changes fix > > most of the problems reported in PR 80080: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80080 > > > > Bootstrapped and regression tested on a zEC12 with s390 and s390x > > biarch. > > v5: > * Generate LT pattern directly for const 0 value. > * Split into three patches. > > Bootstrapped and regression tested on a zEC12 with s390 and s390x > biarch. > gcc/ChangeLog-dv-atomic-gcc7-1 > > * config/s390/s390.md ("cstorecc4"): Use load-on-condition and deal > with CCZmode for TARGET_Z196. > gcc/ChangeLog-dv-atomic-gcc7-2 > > * config/s390/s390.md (define_peephole2): New peephole to help > combining the load-and-test pattern with volatile memory. > gcc/ChangeLog-dv-atomic-gcc7-3 > > * s390-protos.h (s390_expand_cs_hqi): Removed. > (s390_expand_cs, s390_expand_atomic_exchange_tdsi): New prototypes. > * config/s390/s390.c (s390_emit_compare_and_swap): Handle all integer > modes as well as CCZ1mode and CCZmode. > (s390_expand_atomic_exchange_tdsi, s390_expand_atomic): Adapt to new > signature of s390_emit_compare_and_swap. > (s390_expand_cs_hqi): Likewise, make static. > (s390_expand_cs_tdsi): Generate an explicit compare before trying > compare-and-swap, in some cases. > (s390_expand_cs): Wrapper function. > (s390_expand_atomic_exchange_tdsi): New backend specific expander for > atomic_exchange. > (s390_match_ccmode_set): Allow CCZmode <-> CCZ1 mode. > * config/s390/s390.md ("atomic_compare_and_swap"): Merge the > patterns for small and large integers. Forbid symref memory operands. > Move expander to s390.c. Require cc register. > ("atomic_compare_and_swap_internal") > ("*atomic_compare_and_swap_1") > ("*atomic_compare_and_swapdi_2") > ("*atomic_compare_and_swapsi_3"): Use s_operand to forbid > symref memory operands. Remove CC mode and call s390_match_ccmode > instead. > ("atomic_exchange"): Allow and implement all integer modes. > > gcc/testsuite/ChangeLog-dv-atomic-gcc7 > > * gcc.target/s390/md/atomic_compare_exchange-1.c: New test. > * gcc.target/s390/md/atomic_compare_exchange-1.inc: New test. > * gcc.target/s390/md/atomic_exchange-1.inc: New test. These all look good to me now. Thanks, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com