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: 1755 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:55:31 -0000 Delivered-To: patches@linaro.org Received: by 10.52.181.10 with SMTP id ds10cs27909vdc; Mon, 6 Jun 2011 05:14:50 -0700 (PDT) Received: by 10.204.74.11 with SMTP id s11mr4954640bkj.43.1307362488949; Mon, 06 Jun 2011 05:14:48 -0700 (PDT) Received: from smtp.ispras.ru (smtp.ispras.ru [83.149.198.202]) by mx.google.com with ESMTP id zu16si14822446bkb.88.2011.06.06.05.14.47; Mon, 06 Jun 2011 05:14:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dplotnikov@ispras.ru designates 83.149.198.202 as permitted sender) client-ip=83.149.198.202; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dplotnikov@ispras.ru designates 83.149.198.202 as permitted sender) smtp.mail=dplotnikov@ispras.ru 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> 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,