Commit 690688b3 by Terry Guo Committed by Xuepeng Guo

arm.c (thumb1_size_rtx_costs): Assign proper cost for shift_add/shift_sub0/shift_sub1 RTXs.

gcc/ChangeLog:
2013-07-24  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.

gcc/testsuite/ChangeLog:
2013-07-24  Terry Guo  <terry.guo@arm.com>

	* gcc.target/arm/thumb1-Os-mult.c: New test case.

From-SVN: r201237
parent a4ad093b
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>
......
......@@ -7925,6 +7925,15 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
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:
......
2013-07-25 Terry Guo <terry.guo@arm.com>
* gcc.target/arm/thumb1-Os-mult.c: New test case.
2013-07-24 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/57942
......
/* { 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." } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment