+2013-07-25 Terry Guo <terry.guo@arm.com>
+
+ * config/arm/arm.c (thumb1_size_rtx_costs): Assign proper cost for
+ shift_add/shift_sub0/shift_sub1 RTXs.
+
2013-07-24 Bill Schmidt <wschmidt@linux.ibm.com>
Anton Blanchard <anton@au1.ibm.com>
case PLUS:
case MINUS:
+ /* Thumb-1 needs two instructions to fulfill shiftadd/shiftsub0/shiftsub1
+ defined by RTL expansion, especially for the expansion of
+ multiplication. */
+ if ((GET_CODE (XEXP (x, 0)) == MULT
+ && power_of_two_operand (XEXP (XEXP (x,0),1), SImode))
+ || (GET_CODE (XEXP (x, 1)) == MULT
+ && power_of_two_operand (XEXP (XEXP (x, 1), 1), SImode)))
+ return COSTS_N_INSNS (2);
+ /* On purpose fall through for normal RTX. */
case COMPARE:
case NEG:
case NOT:
--- /dev/null
+/* { dg-require-effective-target arm_thumb1_ok } */
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+/* { dg-skip-if "" { ! { arm_thumb1 } } } */
+
+int
+mymul3 (int x)
+{
+ return x * 0x555;
+}
+
+/* { dg-final { scan-assembler "mul\[\\t \]*r.,\[\\t \]*r." } } */