diff options
author | zqchen <zqchen@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-22 02:54:45 +0000 |
---|---|---|
committer | zqchen <zqchen@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-22 02:54:45 +0000 |
commit | 1290b4d8ad5d6b705934b2119cdf0f24db8ed354 (patch) | |
tree | b7d729eefd3d2435e7018328c826b94ee5a6c351 /gcc/config/arm | |
parent | d0eb4a95454f873bb4fc05432661aa233af2e7c0 (diff) | |
download | gcc-1290b4d8ad5d6b705934b2119cdf0f24db8ed354.tar.gz |
2014-09-22 Zhenqiang Chen <zhenqiang.chen@arm.com>
* config/arm/arm.c: #include "tm-constrs.h"
(thumb1_size_rtx_costs): Adjust rtx costs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215444 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/arm')
-rw-r--r-- | gcc/config/arm/arm.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index a289052408e..93b989d334f 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -62,6 +62,7 @@ #include "dumpfile.h" #include "gimple-expr.h" #include "builtins.h" +#include "tm-constrs.h" /* Forward definitions of types. */ typedef struct minipool_node Mnode; @@ -8927,9 +8928,11 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) /* 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)))); + return COSTS_N_INSNS (words) + + COSTS_N_INSNS (1) * (satisfies_constraint_J (SET_SRC (x)) + || satisfies_constraint_K (SET_SRC (x)) + /* thumb1_movdi_insn. */ + || ((words > 1) && MEM_P (SET_SRC (x)))); case CONST_INT: if (outer == SET) @@ -8982,16 +8985,14 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) case AND: case XOR: case IOR: - /* XXX guess. */ - return 8; + return COSTS_N_INSNS (1); case MEM: - /* XXX another guess. */ - /* Memory costs quite a lot for the first word, but subsequent words - load at the equivalent of a single insn each. */ - return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD) + return (COSTS_N_INSNS (1) + + COSTS_N_INSNS (1) + * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD) + ((GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x)) - ? 4 : 0)); + ? COSTS_N_INSNS (1) : 0)); case IF_THEN_ELSE: /* XXX a guess. */ |