diff mbox

[ARM] Add support for ADDW and SUBW instructions

Message ID 4DECC4CB.2000500@ispras.ru
State New
Headers show

Commit Message

Dmitry Plotnikov June 6, 2011, 12:15 p.m. UTC
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

Comments

Andrew Stubbs June 6, 2011, 12:41 p.m. UTC | #1
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.

Andrew
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,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,