Commit 1a910f8f by Georg-Johann Lay Committed by Georg-Johann Lay

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
parent 9aef8e95
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> 2012-09-28 Richard Guenther <rguenther@suse.de>
PR lto/47799 PR lto/47799
......
...@@ -102,6 +102,7 @@ extern int adjust_insn_length (rtx insn, int len); ...@@ -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_inhi (rtx*, rtx, int*);
extern const char* output_reload_insisf (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_reload_inpsi (rtx*, rtx, int*);
extern const char* avr_out_lpm (rtx, rtx*, int*);
extern void notice_update_cc (rtx body, rtx insn); 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);
extern int _reg_unused_after (rtx insn, rtx reg); extern int _reg_unused_after (rtx insn, rtx reg);
......
...@@ -2870,7 +2870,7 @@ avr_out_lpm_no_lpmx (rtx insn, rtx *xop, int *plen) ...@@ -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. If PLEN != 0 set *PLEN to the length in words of the instruction sequence.
Return "". */ Return "". */
static const char* const char*
avr_out_lpm (rtx insn, rtx *op, int *plen) avr_out_lpm (rtx insn, rtx *op, int *plen)
{ {
rtx xop[7]; rtx xop[7];
...@@ -7526,6 +7526,7 @@ adjust_insn_length (rtx insn, int len) ...@@ -7526,6 +7526,7 @@ adjust_insn_length (rtx insn, int len)
case ADJUST_LEN_MOV32: output_movsisf (insn, op, &len); break; case ADJUST_LEN_MOV32: output_movsisf (insn, op, &len); break;
case ADJUST_LEN_MOVMEM: avr_out_movmem (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_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_SFRACT: avr_out_fract (insn, op, true, &len); break;
case ADJUST_LEN_UFRACT: avr_out_fract (insn, op, false, &len); break; case ADJUST_LEN_UFRACT: avr_out_fract (insn, op, false, &len); break;
......
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
tsthi, tstpsi, tstsi, compare, compare64, call, tsthi, tstpsi, tstsi, compare, compare64, call,
mov8, mov16, mov24, mov32, reload_in16, reload_in24, reload_in32, mov8, mov16, mov24, mov32, reload_in16, reload_in24, reload_in32,
ufract, sfract, ufract, sfract,
xload, movmem, xload, lpm, movmem,
ashlqi, ashrqi, lshrqi, ashlqi, ashrqi, lshrqi,
ashlhi, ashrhi, lshrhi, ashlhi, ashrhi, lshrhi,
ashlsi, ashrsi, lshrsi, ashlsi, ashrsi, lshrsi,
...@@ -397,12 +397,15 @@ ...@@ -397,12 +397,15 @@
[(set (match_operand:MOVMODE 0 "register_operand" "=r") [(set (match_operand:MOVMODE 0 "register_operand" "=r")
(match_operand:MOVMODE 1 "memory_operand" "m")) (match_operand:MOVMODE 1 "memory_operand" "m"))
(clobber (match_operand:QI 2 "d_register_operand" "=d"))] (clobber (match_operand:QI 2 "d_register_operand" "=d"))]
"MEM_P (operands[1]) ;; Fixme: The insn condition must not test the address space.
&& !ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (operands[1]))" ;; 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")]) (set_attr "cc" "clobber")])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment