From patchwork Fri May 1 08:25:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrylo Tkachov X-Patchwork-Id: 466913 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 697DF140761 for ; Fri, 1 May 2015 18:25:52 +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=pKniZCqq; 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=QmVDSzKIM+pi0MsXboik48bvQ5GT4+QD+Htz9pNNh/R U5kPBz6FWLFWeTCigsiDFr+zunKZ/xVaAqRYujv/pl21cK18rACEg2+oAaCihQ4q EiOYXeGTsM3dSXkXDjzgdX9Iz0kwrvubdmW8yLnG6zZ/y/Oxy6NML1FIp2AxxMMI = 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=ZTRH5IOU22pa5xlA2WPdD1Qefhg=; b=pKniZCqqhmPZw2N4m xnl7y+rXheWh8knCiVxQScROCqHdbMgxaSj2fKo1I8rSNkc0kRT4h4NEp6qTRoKa PBjsPNXLUqMCKEOupk7PsBNMJfyMWLKpQzx+fiy19QSqzGBr2LEWOpjVGCgpvreU wjsZRorS3EwNpkmswLxDvy7cYU= Received: (qmail 115161 invoked by alias); 1 May 2015 08:25:45 -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 115144 invoked by uid 89); 1 May 2015 08:25:44 -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; Fri, 01 May 2015 08:25:44 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by uk-mta-2.uk.mimecast.lan; Fri, 01 May 2015 09:25:41 +0100 Received: from [10.2.207.50] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 1 May 2015 09:25:41 +0100 Message-ID: <55433884.4030800@arm.com> Date: Fri, 01 May 2015 09:25:40 +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] Do not overwrite cost in bswap case X-MC-Unique: 95_CfcfkQd2rW2KQ8vMnBw-1 X-IsSubscribed: yes Hi all, This patch is trivial. We already initialise the cost to COSTS_N_INSNS (1) at the top of the function. No need to overwrite it again. Just add the cost of a rev and recurse into the operands. Bootstrapped and tested on aarch64-linux. Ok for trunk? Thanks, Kyrill 2015-05-01 Kyrylo Tkachov * config/aarch64/aarch64.c (aarch64_rtx_costs): Do not overwrite cost with COSTS_N_INSNS (1). commit 30857e8a8ff816244c49b3c76b6044c1d5cc9f2f Author: Kyrylo Tkachov Date: Tue Mar 3 10:10:53 2015 +0000 [AArch64] Do not overwrite BSWAP rtx cost, let recursion handle the operand diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 6083fd4..e19b592 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -5995,7 +5995,6 @@ cost_plus: } case BSWAP: - *cost = COSTS_N_INSNS (1); if (speed) *cost += extra_cost->alu.rev;