Commit 78b4e425 by Bin Cheng Committed by Bin Cheng

re PR target/56102 (Wrong rtx cost calculated for Thumb1)

	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.

From-SVN: r197155
parent a5ba7b92
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> 2013-03-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.h (TARGET_FLT_EVAL_METHOD): Define. * config/s390/s390.h (TARGET_FLT_EVAL_METHOD): Define.
......
...@@ -7116,7 +7116,7 @@ static inline int ...@@ -7116,7 +7116,7 @@ static inline int
thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
{ {
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
int total; int total, words;
switch (code) switch (code)
{ {
...@@ -7124,6 +7124,8 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) ...@@ -7124,6 +7124,8 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
case ASHIFTRT: case ASHIFTRT:
case LSHIFTRT: case LSHIFTRT:
case ROTATERT: case ROTATERT:
return (mode == SImode) ? COSTS_N_INSNS (1) : COSTS_N_INSNS (2);
case PLUS: case PLUS:
case MINUS: case MINUS:
case COMPARE: case COMPARE:
...@@ -7147,7 +7149,10 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) ...@@ -7147,7 +7149,10 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
return COSTS_N_INSNS (1) + 16; return COSTS_N_INSNS (1) + 16;
case SET: 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))) + 4 * ((MEM_P (SET_SRC (x)))
+ MEM_P (SET_DEST (x)))); + MEM_P (SET_DEST (x))));
...@@ -7844,6 +7849,7 @@ static inline int ...@@ -7844,6 +7849,7 @@ static inline int
thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
{ {
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
int words;
switch (code) switch (code)
{ {
...@@ -7851,6 +7857,8 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) ...@@ -7851,6 +7857,8 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
case ASHIFTRT: case ASHIFTRT:
case LSHIFTRT: case LSHIFTRT:
case ROTATERT: case ROTATERT:
return (mode == SImode) ? COSTS_N_INSNS (1) : COSTS_N_INSNS (2);
case PLUS: case PLUS:
case MINUS: case MINUS:
case COMPARE: case COMPARE:
...@@ -7869,7 +7877,10 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) ...@@ -7869,7 +7877,10 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
return COSTS_N_INSNS (1); return COSTS_N_INSNS (1);
case SET: 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))) + 4 * ((MEM_P (SET_SRC (x)))
+ MEM_P (SET_DEST (x)))); + MEM_P (SET_DEST (x))));
......
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