diff options
author | Andrew Pinski <apinski@cavium.com> | 2014-01-15 23:30:16 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2014-01-15 15:30:16 -0800 |
commit | 6ee70f814d87b2fe4c64d3f58db3ccdcf9e97bfa (patch) | |
tree | 40a949bfda705a03071040d49f251d33c862dd8a /gcc | |
parent | 4d42626f8e140c3095bb13109ed91a201bfb8baa (diff) | |
download | gcc-6ee70f814d87b2fe4c64d3f58db3ccdcf9e97bfa.zip gcc-6ee70f814d87b2fe4c64d3f58db3ccdcf9e97bfa.tar.gz gcc-6ee70f814d87b2fe4c64d3f58db3ccdcf9e97bfa.tar.bz2 |
aarch64.c (aarch64_register_move_cost): Correct cost of moving from/to the STACK_REG register class.
2014-01-15 Andrew Pinski <apinski@cavium.com>
* config/aarch64/aarch64.c (aarch64_register_move_cost): Correct cost
of moving from/to the STACK_REG register class.
From-SVN: r206649
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 075582a..2781bd0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-01-15 Andrew Pinski <apinski@cavium.com> + + * config/aarch64/aarch64.c (aarch64_register_move_cost): Correct cost + of moving from/to the STACK_REG register class. + 2014-01-15 Richard Henderson <rth@redhat.com> PR debug/54694 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 89f2b9b..09966a3 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -4870,6 +4870,16 @@ aarch64_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, const struct cpu_regmove_cost *regmove_cost = aarch64_tune_params->regmove_cost; + /* Moving between GPR and stack cost is the same as GP2GP. */ + if ((from == GENERAL_REGS && to == STACK_REG) + || (to == GENERAL_REGS && from == STACK_REG)) + return regmove_cost->GP2GP; + + /* To/From the stack register, we move via the gprs. */ + if (to == STACK_REG || from == STACK_REG) + return aarch64_register_move_cost (mode, from, GENERAL_REGS) + + aarch64_register_move_cost (mode, GENERAL_REGS, to); + if (from == GENERAL_REGS && to == GENERAL_REGS) return regmove_cost->GP2GP; else if (from == GENERAL_REGS) |