From patchwork Mon Apr 27 13:24:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrylo Tkachov X-Patchwork-Id: 465012 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 CA2A6140329 for ; Mon, 27 Apr 2015 23:24:39 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=sm2xsZ72; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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:cc:subject:content-type; q=dns; s=default; b=TK8V5m016CHEBtz45KwyEjr90opFitPIGVmCoN8aov/ AxgEqws+YAeL5JmwK9spOjkb6MPZp0bXXwnyac0/yjljnk5H/4TanGzK0b4FmoSo uN5W2PhJuijNyenEDVXVxpQOJjYBLe75eSpkkE+1xw68GlONhitYYjBjEC15xxHU = 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:cc:subject:content-type; s=default; bh=bHKlTsTu3FO0YGNpDX76KBvztAs=; b=sm2xsZ72nTNCCorWS qMDLnFuHuiKJ7BDOacJp3MP1T4F3Ktw2s2ImQX8tmv7ha5ZYCHBsBppcKLHU1huW UuaxjG6m8PKOBXLdS82GDiKuxE5/6wg+XvnBeHhuFF8n6VDOatVnaSv7wXYglDQb 3u16v4091pU2hsShYqcNlTovHc= 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-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 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 14:24:28 +0100 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 X-IsSubscribed: yes 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. 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; } - *cost += rtx_cost (new_op1, MINUS, 1, speed); + *cost += rtx_cost (new_op1, MINUS, 1, speed) + + rtx_cost (op0, MINUS, 0, speed); if (speed) {