From patchwork Wed Nov 12 16:38:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrylo Tkachov X-Patchwork-Id: 410035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9D70E1400AB for ; Thu, 13 Nov 2014 03:39:08 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=DOru8iu5sppayjrTDxih/HOVgKaWJpk00IUAqdMcXJ4u+q 8JwpVc4Zuh1K8UNCCznIXRwS1Hr9nLUntFseaEq9sGoEpQIQDUB82Qt7rK9OyeGc tUtX5xbswlOT8b1Hb6h4fmRb/VUNdUDjvPDxCudevP8BLZq6Y5HrKFBtpIgas= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=S/s+YFg+uOgZoFusGKrn3uf0bX8=; b=l8lbVz3Cty3DSsi2eHuP 1C7H46IjlrxlU/auL15y+t6onRrLSpUR4CUeTzE5HIjCbmWT8EsHaYmstJK/eOWm mgH2OK4b5gg+IgbYWNkR0SdPL0la2vbbIlQgGLBSg9wulqdQWLTfw94LFdHF/Ztr YT67ZQrRCwjSSnCDORHs67Y= Received: (qmail 26717 invoked by alias); 12 Nov 2014 16:39:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 26706 invoked by uid 89); 12 Nov 2014 16:38:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Nov 2014 16:38:58 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 12 Nov 2014 16:38:55 +0000 Received: from [10.1.207.43] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 12 Nov 2014 16:38:55 +0000 Message-ID: <54638D1E.4090505@arm.com> Date: Wed, 12 Nov 2014 16:38:54 +0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches , Ramana Radhakrishnan , Richard Earnshaw Subject: [PATCH][ARM] Handle simple SImode PLUS and MINUS cases in rtx costs X-MC-Unique: 114111216385502301 X-IsSubscribed: yes Hi all, This is a much-delayed respin of the patch in response to Richards feedback at: http://gcc.gnu.org/ml/gcc-patches/2014-05/msg00068.html We now let recursion do its magic and just add the cost of the arithmetic operation on top. Tested on arm-none-eabi Ok for trunk? 2014-11-12 Kyrylo Tkachov * config/arm/arm.c (arm_new_rtx_costs, case PLUS, MINUS): Add cost of alu.arith in simple SImode case. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 4bada64..f1cd242 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -9615,6 +9615,8 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code, *cost += rtx_cost (XEXP (x, 1), code, 1, speed_p); return true; } + else if (speed_p) + *cost += extra_cost->alu.arith; return false; } @@ -9850,6 +9852,9 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code, *cost += rtx_cost (XEXP (x, 0), PLUS, 0, speed_p); return true; } + else if (speed_p) + *cost += extra_cost->alu.arith; + return false; }