diff mbox

[ARM] Add support for ADDW and SUBW instructions

Message ID 4DECD592.2070708@ispras.ru
State New
Headers show

Commit Message

Dmitry Plotnikov June 6, 2011, 1:26 p.m. UTC
On 06/06/2011 04:41 PM, Andrew Stubbs wrote:
> On 06/06/11 13:15, Dmitry Plotnikov wrote:
>> + &&  (const_ok_for_op (INTVAL (x), outer)
>> +              || const_ok_for_op (~INTVAL (x), outer))))
>
> The second call is redundant. const_ok_for_op should already do that.
>
Fixed patch is attached.  Ok?
diff mbox

Patch

2011-06-06  Dmitry PLotnikov  <dplotnikov@ispras.ru>

	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,9 @@  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))))
 	*total = COSTS_N_INSNS (1);
       else
 	*total = COSTS_N_INSNS (arm_gen_constant (SET, mode, NULL_RTX,