]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64.c (aarch64_register_move_cost): Correct cost of moving from/to the STACK_REG...
authorAndrew Pinski <apinski@cavium.com>
Wed, 15 Jan 2014 23:30:16 +0000 (23:30 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Wed, 15 Jan 2014 23:30:16 +0000 (15:30 -0800)
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

gcc/ChangeLog
gcc/config/aarch64/aarch64.c

index 075582a896f576dbeff6d2c77cfd209aba5c6790..2781bd05da62cabf4db2e057b5e34be541aef394 100644 (file)
@@ -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
index 89f2b9bf50e51f1e1e901ce727605b9d535cde84..09966a3994c1c6002894834f5d5f582802c8ab14 100644 (file)
@@ -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)