]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
avr.md (adjust_len): Add lpm.
authorGeorg-Johann Lay <avr@gjlay.de>
Fri, 28 Sep 2012 11:37:46 +0000 (11:37 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Fri, 28 Sep 2012 11:37:46 +0000 (11:37 +0000)
* config/avr/avr.md (adjust_len): Add lpm.
(reload_in<mode>): Use avr_out_lpm for output.  Use "lpm" for
adjust_len.
* config/avr/avr-protos.h (avr_out_lpm): New prototype.
* config/avr/avr.c (avr_out_lpm): Make global.
(adjust_insn_length): Handle ADJUST_LEN_LPM.

From-SVN: r191825

gcc/ChangeLog
gcc/config/avr/avr-protos.h
gcc/config/avr/avr.c
gcc/config/avr/avr.md

index cf298f171ad576ff70af058bf625a9c630299a1a..796f772633dd04a9274488c6ff4a9bd7a8400588 100644 (file)
@@ -1,3 +1,12 @@
+2012-09-28  Georg-Johann Lay  <avr@gjlay.de>
+
+       * config/avr/avr.md (adjust_len): Add lpm.
+       (reload_in<mode>): Use avr_out_lpm for output.  Use "lpm" for
+       adjust_len.
+       * config/avr/avr-protos.h (avr_out_lpm): New prototype.
+       * config/avr/avr.c (avr_out_lpm): Make global.
+       (adjust_insn_length): Handle ADJUST_LEN_LPM.
+
 2012-09-28  Richard Guenther  <rguenther@suse.de>
 
        PR lto/47799
index 91cac4c210967cc305bf690bc8afbf18b9c7f0cd..46b96c2dd84ed751e659cafea1e0b62a239b4322 100644 (file)
@@ -102,6 +102,7 @@ extern int adjust_insn_length (rtx insn, int len);
 extern const char* output_reload_inhi (rtx*, rtx, int*);
 extern const char* output_reload_insisf (rtx*, rtx, int*);
 extern const char* avr_out_reload_inpsi (rtx*, rtx, int*);
+extern const char* avr_out_lpm (rtx, rtx*, int*);
 extern void notice_update_cc (rtx body, rtx insn);
 extern int reg_unused_after (rtx insn, rtx reg);
 extern int _reg_unused_after (rtx insn, rtx reg);
index 501c504b551e28718bd46db2c98f6cb045405112..1c5bab2baf0325764fa204644473712ebc62c495 100644 (file)
@@ -2870,7 +2870,7 @@ avr_out_lpm_no_lpmx (rtx insn, rtx *xop, int *plen)
    If PLEN != 0 set *PLEN to the length in words of the instruction sequence.
    Return "".  */
 
-static const char*
+const char*
 avr_out_lpm (rtx insn, rtx *op, int *plen)
 {
   rtx xop[7];
@@ -7526,6 +7526,7 @@ adjust_insn_length (rtx insn, int len)
     case ADJUST_LEN_MOV32: output_movsisf (insn, op, &len); break;
     case ADJUST_LEN_MOVMEM: avr_out_movmem (insn, op, &len); break;
     case ADJUST_LEN_XLOAD: avr_out_xload (insn, op, &len); break;
+    case ADJUST_LEN_LPM: avr_out_lpm (insn, op, &len); break;
 
     case ADJUST_LEN_SFRACT: avr_out_fract (insn, op, true, &len); break;
     case ADJUST_LEN_UFRACT: avr_out_fract (insn, op, false, &len); break;
index 334064337cdd05d9389b8874708f503ab6f334f6..284860e9ec58e54ea6354b9ae63b949bc0a72598 100644 (file)
    tsthi, tstpsi, tstsi, compare, compare64, call,
    mov8, mov16, mov24, mov32, reload_in16, reload_in24, reload_in32,
    ufract, sfract,
-   xload, movmem,
+   xload, lpm, movmem,
    ashlqi, ashrqi, lshrqi,
    ashlhi, ashrhi, lshrhi,
    ashlsi, ashrsi, lshrsi,
   [(set (match_operand:MOVMODE 0 "register_operand"   "=r")
         (match_operand:MOVMODE 1 "memory_operand"      "m"))
    (clobber (match_operand:QI 2 "d_register_operand"  "=d"))]
-  "MEM_P (operands[1])
-   && !ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (operands[1]))"
+  ;; Fixme: The insn condition must not test the address space.
+  ;;   Because the gen tools refuse to generate insns for address spaces
+  ;;   and will generate insn-codes.h to look like:
+  ;;   #define CODE_FOR_reload_inhi CODE_FOR_nothing
+  "reload_completed || reload_in_progress"
   {
-    return output_movqi (insn, operands, NULL);
+    return avr_out_lpm (insn, operands, NULL);
   }
-  [(set_attr "adjust_len" "mov8")
+  [(set_attr "adjust_len" "lpm")
    (set_attr "cc" "clobber")])