diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2012-09-28 11:37:46 +0000 |
---|---|---|
committer | Georg-Johann Lay <gjl@gcc.gnu.org> | 2012-09-28 11:37:46 +0000 |
commit | 1a910f8f264f9ab3cc05c2ad13158201fff8b948 (patch) | |
tree | 133f18699820b6d126f491db5d7141bed55f488d /gcc/config/avr | |
parent | 9aef8e955f7c306437d125a99607baaabadbb8d3 (diff) | |
download | gcc-1a910f8f264f9ab3cc05c2ad13158201fff8b948.zip gcc-1a910f8f264f9ab3cc05c2ad13158201fff8b948.tar.gz gcc-1a910f8f264f9ab3cc05c2ad13158201fff8b948.tar.bz2 |
avr.md (adjust_len): Add lpm.
* 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
Diffstat (limited to 'gcc/config/avr')
-rw-r--r-- | gcc/config/avr/avr-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/avr/avr.c | 3 | ||||
-rw-r--r-- | gcc/config/avr/avr.md | 13 |
3 files changed, 11 insertions, 6 deletions
diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h index 91cac4c..46b96c2 100644 --- a/gcc/config/avr/avr-protos.h +++ b/gcc/config/avr/avr-protos.h @@ -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); diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 501c504..1c5bab2 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -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; diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md index 3340643..284860e 100644 --- a/gcc/config/avr/avr.md +++ b/gcc/config/avr/avr.md @@ -141,7 +141,7 @@ 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, @@ -397,12 +397,15 @@ [(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")]) |