diff options
author | amker <amker@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-03-27 08:16:54 +0000 |
---|---|---|
committer | amker <amker@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-03-27 08:16:54 +0000 |
commit | d18af62e3808d9860cf2a36c41367b3b3e8e3fa9 (patch) | |
tree | a9591cc2f68fcf00d793fbc0ac851287144577c0 /gcc | |
parent | 2e9f00a3faa55669b792de3e1685d44e525d9b4e (diff) | |
download | gcc-d18af62e3808d9860cf2a36c41367b3b3e8e3fa9.tar.gz |
PR target/56102
* config/arm/arm.c (thumb1_rtx_costs, thumb1_size_rtx_costs): Fix
rtx costs for SET/ASHIFT/ASHIFTRT/LSHIFTRT/ROTATERT patterns with
mult-word mode.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197155 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 17 |
2 files changed, 21 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a6e9c1bbf62..f8ae2ac497e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-03-27 Bin Cheng <bin.cheng@arm.com> + + PR target/56102 + * config/arm/arm.c (thumb1_rtx_costs, thumb1_size_rtx_costs): Fix + rtx costs for SET/ASHIFT/ASHIFTRT/LSHIFTRT/ROTATERT patterns with + mult-word mode. + 2013-03-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * config/s390/s390.h (TARGET_FLT_EVAL_METHOD): Define. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 21020b9b9b1..5f63a2e8712 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -7116,7 +7116,7 @@ static inline int thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) { enum machine_mode mode = GET_MODE (x); - int total; + int total, words; switch (code) { @@ -7124,6 +7124,8 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) case ASHIFTRT: case LSHIFTRT: case ROTATERT: + return (mode == SImode) ? COSTS_N_INSNS (1) : COSTS_N_INSNS (2); + case PLUS: case MINUS: case COMPARE: @@ -7147,7 +7149,10 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) return COSTS_N_INSNS (1) + 16; case SET: - return (COSTS_N_INSNS (1) + /* A SET doesn't have a mode, so let's look at the SET_DEST to get + the mode. */ + words = ARM_NUM_INTS (GET_MODE_SIZE (GET_MODE (SET_DEST (x)))); + return (COSTS_N_INSNS (words) + 4 * ((MEM_P (SET_SRC (x))) + MEM_P (SET_DEST (x)))); @@ -7844,6 +7849,7 @@ static inline int thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) { enum machine_mode mode = GET_MODE (x); + int words; switch (code) { @@ -7851,6 +7857,8 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) case ASHIFTRT: case LSHIFTRT: case ROTATERT: + return (mode == SImode) ? COSTS_N_INSNS (1) : COSTS_N_INSNS (2); + case PLUS: case MINUS: case COMPARE: @@ -7869,7 +7877,10 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) return COSTS_N_INSNS (1); case SET: - return (COSTS_N_INSNS (1) + /* A SET doesn't have a mode, so let's look at the SET_DEST to get + the mode. */ + words = ARM_NUM_INTS (GET_MODE_SIZE (GET_MODE (SET_DEST (x)))); + return (COSTS_N_INSNS (words) + 4 * ((MEM_P (SET_SRC (x))) + MEM_P (SET_DEST (x)))); |