From patchwork Mon Jun 6 12:15:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Plotnikov X-Patchwork-Id: 98872 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]) by ozlabs.org (Postfix) with SMTP id A0FD9B6FBD for ; Mon, 6 Jun 2011 22:15:13 +1000 (EST) Received: (qmail 16722 invoked by alias); 6 Jun 2011 12:15:07 -0000 Received: (qmail 16640 invoked by uid 22791); 6 Jun 2011 12:15:02 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL, BAYES_00, FSL_RU_URL, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.198.202) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Jun 2011 12:14:47 +0000 Received: from ispserv.ispras.ru (ispserv.ispras.ru [83.149.198.72]) by smtp.ispras.ru (Postfix) with ESMTP id 383565D4091; Mon, 6 Jun 2011 16:10:04 +0400 (MSD) Received: from [10.10.3.60] (winnie.ispras.ru [83.149.198.236]) by ispserv.ispras.ru (Postfix) with ESMTP id 21E0F3FC48; Mon, 6 Jun 2011 16:14:46 +0400 (MSD) Message-ID: <4DECC4CB.2000500@ispras.ru> Date: Mon, 06 Jun 2011 16:15:07 +0400 From: Dmitry Plotnikov User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: Andrew Stubbs CC: Ramana Radhakrishnan , gcc-patches@gcc.gnu.org, patches@linaro.org, dm@ispras.ru Subject: Re: [PATCH][ARM] Add support for ADDW and SUBW instructions References: <4DAEFB5C.8020802@codesourcery.com> <4DE751DF.8080906@codesourcery.com> In-Reply-To: <4DE751DF.8080906@codesourcery.com> X-IsSubscribed: yes 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 This is follow-up patch that fixes rtx costs for CONST_INT in PLUS pattern. Original discussion is here: http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01427.html 2011-06-06 Dmitry PLotnikov gcc/ * config/arm/arm.c (arm_rtx_costs_1): Fixed costs for CONST_INT in PLUS pattern. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 22ddcd2..9ef6f6d 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -7050,7 +7056,10 @@ arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total, bool speed) case CONST_INT: if (const_ok_for_arm (INTVAL (x)) - || const_ok_for_arm (~INTVAL (x))) + || const_ok_for_arm (~INTVAL (x)) + || (TARGET_THUMB2 && outer == PLUS + && (const_ok_for_op (INTVAL (x), outer) + || const_ok_for_op (~INTVAL (x), outer)))) *total = COSTS_N_INSNS (1); else *total = COSTS_N_INSNS (arm_gen_constant (SET, mode, NULL_RTX,