Commit ff069900 by Paul Brook Committed by Paul Brook

arm.c (arm_rtx_costs_1): Add costs for ARMv6 value extension instructions.

2008-03-15  Paul Brook  <paul@codesourcery.com>

	gcc/
	* config/arm/arm.c (arm_rtx_costs_1): Add costs for ARMv6 value
	extension instructions.

From-SVN: r133260
parent 1b753828
2008-03-15 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_rtx_costs_1): Add costs for ARMv6 value
extension instructions.
2008-03-15 Richard Guenther <rguenther@suse.de> 2008-03-15 Richard Guenther <rguenther@suse.de>
* tree-ssa-ccp.c (ccp_fold): Also read from constant values * tree-ssa-ccp.c (ccp_fold): Also read from constant values
......
...@@ -4904,6 +4904,12 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) ...@@ -4904,6 +4904,12 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
/* Fall through */ /* Fall through */
case PLUS: case PLUS:
if (arm_arch6 && mode == SImode
&& (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
|| GET_CODE (XEXP (x, 0)) == SIGN_EXTEND))
return 1 + (GET_CODE (XEXP (XEXP (x, 0), 0)) == MEM ? 10 : 0)
+ (GET_CODE (XEXP (x, 1)) == MEM ? 10 : 0);
if (GET_CODE (XEXP (x, 0)) == MULT) if (GET_CODE (XEXP (x, 0)) == MULT)
{ {
extra_cost = rtx_cost (XEXP (x, 0), code); extra_cost = rtx_cost (XEXP (x, 0), code);
...@@ -5002,12 +5008,17 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) ...@@ -5002,12 +5008,17 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
return 4 + (mode == DImode ? 4 : 0); return 4 + (mode == DImode ? 4 : 0);
case SIGN_EXTEND: case SIGN_EXTEND:
/* ??? value extensions are cheaper on armv6. */ if (arm_arch_thumb2 && mode == SImode)
return 1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0);
if (GET_MODE (XEXP (x, 0)) == QImode) if (GET_MODE (XEXP (x, 0)) == QImode)
return (4 + (mode == DImode ? 4 : 0) return (4 + (mode == DImode ? 4 : 0)
+ (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
/* Fall through */ /* Fall through */
case ZERO_EXTEND: case ZERO_EXTEND:
if (arm_arch6 && mode == SImode)
return 1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0);
switch (GET_MODE (XEXP (x, 0))) switch (GET_MODE (XEXP (x, 0)))
{ {
case QImode: case QImode:
......
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