From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13680 invoked by alias); 7 Apr 2017 17:22:30 -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 13133 invoked by uid 89); 7 Apr 2017 17:22:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=refuses X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Apr 2017 17:22:28 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v37HIhnm193815 for ; Fri, 7 Apr 2017 13:22:28 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0b-001b2d01.pphosted.com with ESMTP id 29pdh8ve19-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 07 Apr 2017 13:22:27 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 7 Apr 2017 18:22:26 +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; Fri, 7 Apr 2017 18:22:24 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v37HMOIl9503098; Fri, 7 Apr 2017 17:22:24 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DBF2711C04C; Fri, 7 Apr 2017 18:21:45 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BF18411C04A; Fri, 7 Apr 2017 18:21:45 +0100 (BST) Received: from oc3748833570.ibm.com (unknown [9.164.179.158]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 7 Apr 2017 18:21:45 +0100 (BST) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id 587ABD83154; Fri, 7 Apr 2017 19:22:23 +0200 (CEST) Subject: Re: [PATCH] S/390: Optimize atomic_compare_exchange and atomic_compare builtins. To: vogt@linux.vnet.ibm.com Date: Fri, 07 Apr 2017 17:22: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: <20170407153715.GA5246@linux.vnet.ibm.com> from "Dominik Vogt" at Apr 07, 2017 04:37:15 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17040717-0008-0000-0000-0000041F9E72 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17040717-0009-0000-0000-00001D2B7C62 Message-Id: <20170407172223.587ABD83154@oc3748833570.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-07_15:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=6 spamscore=6 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1704070141 X-SW-Source: 2017-04/txt/msg00394.txt.bz2 Dominik Vogt wrote: > On Fri, Apr 07, 2017 at 04:34:44PM +0200, Ulrich Weigand wrote: > > > +; Peephole to combine a load-and-test from volatile memory which combine does > > > +; not do. > > > +(define_peephole2 > > > + [(set (match_operand:GPR 0 "register_operand") > > > + (match_operand:GPR 2 "memory_operand")) > > > + (set (reg CC_REGNUM) > > > + (compare (match_dup 0) (match_operand:GPR 1 "const0_operand")))] > > > + "s390_match_ccmode(insn, CCSmode) && TARGET_EXTIMM > > > + && GENERAL_REG_P (operands[0]) > > > + && satisfies_constraint_T (operands[2])" > > > + [(parallel > > > + [(set (reg:CCS CC_REGNUM) > > > + (compare:CCS (match_dup 2) (match_dup 1))) > > > + (set (match_dup 0) (match_dup 2))])]) > > > > Still wondering why this is necessary. > > It's necessary vecause Combine refuses to match anything that > contains a volatile memory reference, using a global flag for > Recog. So is this specifically to match the pre-test load emitted here? + emit_move_insn (output, mem); + emit_insn (gen_rtx_SET (cc, gen_rtx_COMPARE (CCZmode, output, cmp))); If so, since you already know that this should always map to a LOAD AND TEST, could simply just emit the LT pattern here, instead of relying on combine to do it ... Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com