]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: avr.c (avr_rtx_costs_1): Handle DImode MULT.
authorSenthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
Fri, 23 Sep 2016 08:20:40 +0000 (08:20 +0000)
committerSenthil Kumar Selvaraj <saaadhu@gcc.gnu.org>
Fri, 23 Sep 2016 08:20:40 +0000 (08:20 +0000)
Backport from 2016-09-22 trunk r240388.

2016-09-22  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

* config/avr/avr.c (avr_rtx_costs_1): Handle DImode MULT.
(avr_address_cost): Replace 61 with MAX_LD_OFFSET(mode).

From-SVN: r240397

gcc/ChangeLog
gcc/config/avr/avr.c

index 80416fc9df9bff9120e61aa7afd01f76be24f56d..ca81139c8f2f671e2845eb4824606800bfb265b5 100644 (file)
@@ -1,3 +1,10 @@
+2016-09-22  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
+
+       Backport from 2016-09-22 trunk r240388.
+
+       * config/avr/avr.c (avr_rtx_costs_1): Handle DImode MULT.
+       (avr_address_cost): Replace 61 with MAX_LD_OFFSET(mode).
+
 2016-09-21  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * doc/rtl.texi (JUMP_LABEL): Document RETURN and SIMPLE_RETURN values.
index 140356cc3ac893d69881d507ec4c5d09b2277455..4ffb38c571f5572ebc518598390e420600f27aed 100644 (file)
@@ -9122,6 +9122,8 @@ avr_eval_addr_attrib (rtx x)
       if (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_IO)
        {
          attr = lookup_attribute ("io", DECL_ATTRIBUTES (decl));
+         if (!attr || !TREE_VALUE (attr))
+           attr = lookup_attribute ("io_low", DECL_ATTRIBUTES (decl));
          gcc_assert (attr);
        }
       if (!attr || !TREE_VALUE (attr))
@@ -10235,6 +10237,7 @@ avr_rtx_costs_1 (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED,
           break;
 
        case SImode:
+       case DImode:
          if (AVR_HAVE_MUL)
             {
               if (!speed)
@@ -10260,7 +10263,10 @@ avr_rtx_costs_1 (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED,
                 *total = COSTS_N_INSNS (AVR_HAVE_JMP_CALL ? 5 : 4);
             }
 
-          return true;
+          if (mode == DImode)
+            *total *= 2;
+
+          return true;
 
        default:
          return false;
@@ -10837,7 +10843,7 @@ avr_address_cost (rtx x, machine_mode mode ATTRIBUTE_UNUSED,
       && (REG_P (XEXP (x, 0))
           || GET_CODE (XEXP (x, 0)) == SUBREG))
     {
-      if (INTVAL (XEXP (x, 1)) >= 61)
+      if (INTVAL (XEXP (x, 1)) > MAX_LD_OFFSET(mode))
         cost = 18;
     }
   else if (CONSTANT_ADDRESS_P (x))