From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41540 invoked by alias); 27 Apr 2015 13:24:32 -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 41530 invoked by uid 89); 27 Apr 2015 13:24:32 -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: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Apr 2015 13:24:31 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by uk-mta-6.uk.mimecast.lan; Mon, 27 Apr 2015 14:24:28 +0100 Received: from [10.2.207.50] ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 27 Apr 2015 14:24:28 +0100 Message-ID: <553E388C.3050902@arm.com> Date: Mon, 27 Apr 2015 13:24:00 -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 CC: Marcus Shawcroft , Richard Earnshaw , James Greenhalgh Subject: [PATCH][AArch64] Fix operand costing logic for MINUS X-MC-Unique: bwG2NCvnQp-XlPzvdn-zNg-1 Content-Type: multipart/mixed; boundary="------------010403030708020706000406" X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg01617.txt.bz2 This is a multi-part message in MIME format. --------------010403030708020706000406 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-length: 623 Hi all, This fixes a case in aarch64 costs where we forgot to account for one of the operands in the MINUS case. This is important to get right as the mult synthesis code can ask for the cost of a shift+sub operation and put the shift part in any of the MINUS operands, expecting the cost function to break it down into a separate shift operation if the two cannot be combined. Bootstrapped and tested on aarch64. Ok for trunk? Thanks, Kyrill 2015-04-27 Kyrylo Tkachov * config/aarch64/aarch64.c (aarch64_rtx_costs, MINUS): Properly account for both operand costs in simple case. --------------010403030708020706000406 Content-Type: text/x-patch; name=aarch64-costs-minus.patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="aarch64-costs-minus.patch" Content-length: 592 commit 4859566692e4b9195b975632ed105b9c4b6ab765 Author: Kyrylo Tkachov Date: Mon Mar 2 10:18:22 2015 +0000 [AArch64] Properly cost both operands of MINUS. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 7ffa7ee..5a3f887 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -5844,7 +5844,8 @@ cost_minus: return true; } =20 - *cost +=3D rtx_cost (new_op1, MINUS, 1, speed); + *cost +=3D rtx_cost (new_op1, MINUS, 1, speed) + + rtx_cost (op0, MINUS, 0, speed); =20 if (speed) { --------------010403030708020706000406--