summaryrefslogtreecommitdiff
path: root/gcc/config/avr/avr-c.c
diff options
context:
space:
mode:
authorgjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-15 13:15:56 +0000
committergjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-15 13:15:56 +0000
commit0b6cf66f5a09759d8347a01108bfe5794d0f3f2d (patch)
treea4151173e9e16b606e0e6fa3862aa8300e82d656 /gcc/config/avr/avr-c.c
parentf260bce70fdf66cf1a78a639582e09f5a62c2700 (diff)
downloadgcc-0b6cf66f5a09759d8347a01108bfe5794d0f3f2d.tar.gz
libgcc/
PR target/52261 * config/avr/lib1funcs.S (__prologue_saves__): Handle AVR_XMEGA (__epilogue_restores__): Ditto. gcc/ PR target/52261 * config/avr/avr-devices.c (avr_arch_types): Add avrxmega2, avrxmega4, avrxmega5, avrxmega6, avrxmega7. Rewrite initializers for .macro. * config/avr/avr-mcus.def (AVR_MCU): Add known MCUs: avrxmega2: atxmega16a4, atxmega16d4, atxmega16x1, atxmega32a4 atxmega32d4, atxmega32x1. avrxmega4: atxmega64a3, atxmega64d3. avrxmega5: atxmega64a1, atxmega64a1u. avrxmega6: atxmega128a3, atxmega128d3, atxmega192a3, atxmega192d3, atxmega256a3, atxmega256a3b, atxmega256a3bu, atxmega256d3. avrxmega7: atxmega128a1, atxmega128a1u. * config/avr/multilib.h: Regenerate. * config/avr/t-multilib: Regenerate. * config/avr/avr-tables.opt: Regenerate. * config/avr/avr.h (enum avr_arch): Add: ARCH_AVRXMEGA2, ARCH_AVRXMEGA4, ARCH_AVRXMEGA5, ARCH_AVRXMEGA6, ARCH_AVRXMEGA7. (struct base_arch_s): Rename reserved to xmega_p. Rename reserved2 to have_rampd. (AVR_XMEGA): New define. (AVR_HAVE_RAMPD, AVR_HAVE_RAMPX, AVR_HAVE_RAMPY): New defines. (AVR_HAVE_RAMPZ): Change definition to fit xmega. * config/avr/predicates.md (io_address_operand): Take into account SFR offset. (low_io_address_operand): Ditto. (high_io_address_operand): Ditto. * config/avr/avr.md (isa): Add alternatives no_xmega, xmega. (enabled, movhi_sp_r): Use them. * config/avr/avr-c.c (avr_cpu_cpp_builtins): Use cpp_define_formatted to built-in define __AVR_ARCH__. (__AVR_XMEGA__): New built-in define. (__AVR_HAVE_RAMPD__): New built-in define. (__AVR_HAVE_RAMPX__): New built-in define. (__AVR_HAVE_RAMPY__): New built-in define. (__AVR_HAVE_RAMPZ__): Change condition when to built-in define it. * config/avr/avr.c (avr_addr_t): Add ccp, rampd, rampx, rampy. (avr_option_override): Initialize them. (sreg_rtx, rampd_rtx, rampx_rtx, rampy_rtx): New GTY rtx. (avr_init_expanders): Initialize them. No more block several calls. (emit_push_sfr): New static function. (avr_prologue_setup_frame): Use it to push SREG, RAMPD/X/Y/Z as needed. Handle AVR_XMEGA. (expand_epilogue): Handle AVR_XMEGA. Pop RAMPD/X/Y/Z as needed. (avr_print_operand): Print addreeses as symbols for RAMPX, RAMPY, RAMPD, CCP. (output_movhi): Handle AVR_XMEGA when writing to SP. (avr_out_movhi_mr_r_xmega): New static function. (out_movhi_mr_r): Forward to avr_out_movhi_mr_r_xmega for AVR_XMEGA. (avr_file_start): Print symbol defines for __RAMPX__, __RAMPY__, __RAMPD__, __CCP__ as needed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184269 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/avr/avr-c.c')
-rw-r--r--gcc/config/avr/avr-c.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/config/avr/avr-c.c b/gcc/config/avr/avr-c.c
index 55aed30412a..aabeb2177a1 100644
--- a/gcc/config/avr/avr-c.c
+++ b/gcc/config/avr/avr-c.c
@@ -77,23 +77,21 @@ avr_cpu_cpp_builtins (struct cpp_reader *pfile)
builtin_define_std ("AVR");
if (avr_current_arch->macro)
- cpp_define (pfile, avr_current_arch->macro);
+ cpp_define_formatted (pfile, "__AVR_ARCH__=%s", avr_current_arch->macro);
if (avr_extra_arch_macro)
cpp_define (pfile, avr_extra_arch_macro);
- if (avr_current_arch->have_elpm)
- cpp_define (pfile, "__AVR_HAVE_RAMPZ__");
- if (avr_current_arch->have_elpm)
- cpp_define (pfile, "__AVR_HAVE_ELPM__");
- if (avr_current_arch->have_elpmx)
- cpp_define (pfile, "__AVR_HAVE_ELPMX__");
- if (avr_current_arch->have_movw_lpmx)
- {
- cpp_define (pfile, "__AVR_HAVE_MOVW__");
- cpp_define (pfile, "__AVR_HAVE_LPMX__");
- }
+ if (AVR_HAVE_RAMPD) cpp_define (pfile, "__AVR_HAVE_RAMPD__");
+ if (AVR_HAVE_RAMPX) cpp_define (pfile, "__AVR_HAVE_RAMPX__");
+ if (AVR_HAVE_RAMPY) cpp_define (pfile, "__AVR_HAVE_RAMPY__");
+ if (AVR_HAVE_RAMPZ) cpp_define (pfile, "__AVR_HAVE_RAMPZ__");
+ if (AVR_HAVE_ELPM) cpp_define (pfile, "__AVR_HAVE_ELPM__");
+ if (AVR_HAVE_ELPMX) cpp_define (pfile, "__AVR_HAVE_ELPMX__");
+ if (AVR_HAVE_MOVW) cpp_define (pfile, "__AVR_HAVE_MOVW__");
+ if (AVR_HAVE_LPMX) cpp_define (pfile, "__AVR_HAVE_LPMX__");
+
if (avr_current_arch->asm_only)
cpp_define (pfile, "__AVR_ASM_ONLY__");
- if (avr_current_arch->have_mul)
+ if (AVR_HAVE_MUL)
{
cpp_define (pfile, "__AVR_ENHANCED__");
cpp_define (pfile, "__AVR_HAVE_MUL__");
@@ -103,6 +101,8 @@ avr_cpu_cpp_builtins (struct cpp_reader *pfile)
cpp_define (pfile, "__AVR_MEGA__");
cpp_define (pfile, "__AVR_HAVE_JMP_CALL__");
}
+ if (AVR_XMEGA)
+ cpp_define (pfile, "__AVR_XMEGA__");
if (avr_current_arch->have_eijmp_eicall)
{
cpp_define (pfile, "__AVR_HAVE_EIJMP_EICALL__");