From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81668 invoked by alias); 10 Sep 2015 09:10:03 -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 81657 invoked by uid 89); 10 Sep 2015 09:10:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Sep 2015 09:10:02 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EC55175; Thu, 10 Sep 2015 02:10:10 -0700 (PDT) Received: from [10.2.206.27] (e105545-lin.cambridge.arm.com [10.2.206.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5EC0B3F21A; Thu, 10 Sep 2015 02:09:59 -0700 (PDT) Subject: Re: [PATCH][ARM][3/3] Implement negsicc, notsicc optabs To: Kyrill Tkachov , GCC Patches References: <55E5BFE9.7030301@arm.com> Cc: Richard Earnshaw , Ramana Radhakrishnan From: Ramana Radhakrishnan Message-ID: <55F148E7.4040609@foss.arm.com> Date: Thu, 10 Sep 2015 09:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55E5BFE9.7030301@arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00655.txt.bz2 On 01/09/15 16:10, Kyrill Tkachov wrote: > [Resending with patch attached] > > Hi all, > > This third patch implements the new optabs for arm. > Conveniently, we can reuse the recently refactored *if_neg_move pattern > and extend it to cover the conditional NOT case. > Although arm has conditional execution capabilities I have found that > performing the transformation from patch 1/3 early on benefits arm as well. > For example for code: > int > foonegsi (int a) > { > return a ? 25089992 : -25089992; > } > > we currently generate: > movw r2, #55240 > movw r3, #10296 > cmp r0, #0 > movt r2, 382 > movt r3, 65153 > movne r0, r2 > moveq r0, r3 > bx > > whereas with this patch we generate: > movw r3, #10296 > cmp r0, #0 > movt r3, 65153 > mov r0, r3 > rsbne r0, r3, #0 > bx lr > > > In SPEC2006 this doesn't trigger very often, so there were minimal code differences, > but overall I claim this patch is an improvement. > > Bootstrapped and tested on arm-none-linux-gnueabihf. > > Ok for trunk if the midend changes in 1/3 are approved? OK. Thanks, Ramana > > Thanks, > Kyrill > > 2015-08-20 Kyrylo Tkachov > > * config/arm/arm.md (sicc): New define_expand. > (*if_neg_move): Rename to... > (*if__move): ... This. Use NOT_NEG code iterator. > * config/arm/iterators.md (NOT_NEG): New code iterator. > (NOT_NEG_op): New code attribute. > > 2015-08-20 Kyrylo Tkachov > > * gcc.target/arm/cond_op_imm_1.c: New test.