From ff06990057b50b7b0dbad7975fec116540a584e8 Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Sat, 15 Mar 2008 22:49:44 +0000 Subject: [PATCH] arm.c (arm_rtx_costs_1): Add costs for ARMv6 value extension instructions. 2008-03-15 Paul Brook gcc/ * config/arm/arm.c (arm_rtx_costs_1): Add costs for ARMv6 value extension instructions. From-SVN: r133260 --- gcc/ChangeLog | 5 +++++ gcc/config/arm/arm.c | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c3f2d7d65c86..fcb1623cc308 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-03-15 Paul Brook + + * config/arm/arm.c (arm_rtx_costs_1): Add costs for ARMv6 value + extension instructions. + 2008-03-15 Richard Guenther * tree-ssa-ccp.c (ccp_fold): Also read from constant values diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index f3febf6c4192..4fb0a0d1f1ee 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -4904,6 +4904,12 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) /* Fall through */ 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) { 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) return 4 + (mode == DImode ? 4 : 0); 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) return (4 + (mode == DImode ? 4 : 0) + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); /* Fall through */ case ZERO_EXTEND: + if (arm_arch6 && mode == SImode) + return 1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0); + switch (GET_MODE (XEXP (x, 0))) { case QImode: