OSDN Git Service

* config/avr/avr.md (adjust_len): Add lpm.
authorgjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Sep 2012 11:37:46 +0000 (11:37 +0000)
committergjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Sep 2012 11:37:46 +0000 (11:37 +0000)
(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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191825 138bc75d-0d04-0410-961f-82ee72b054a4

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

index cf298f1..796f772 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 91cac4c..46b96c2 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 501c504..1c5bab2 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 3340643..284860e 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")])