From 576ba35c2a288b7e5ac7b74237a9ac57cba75cd5 Mon Sep 17 00:00:00 2001 From: Pitchumani Sivanupandi Date: Sat, 5 Apr 2014 09:51:59 +0400 Subject: avr-arch.h (avr_mcu_t): Add dev_attribute field to have device specific ISA/ feature information. * config/avr/avr-arch.h (avr_mcu_t): Add dev_attribute field to have device specific ISA/ feature information. Remove short_sp and errata_skip ds. Add avr_device_specific_features enum to have device specific info. * config/avr/avr-c.c (avr_cpu_cpp_builtins): use dev_attribute to check errata_skip. Add __AVR_ISA_RMW__ builtin macro if RMW ISA available. * config/avr/avr-devices.c (avr_mcu_types): Update AVR_MCU macro for updated device specific info. * config/avr/avr-mcus.def: Merge device specific details to dev_attribute field. * config/avr/avr.c (avr_2word_insn_p): use dev_attribute field to check errata_skip. * config/avr/avr.h (AVR_HAVE_8BIT_SP): same for short sp info. * config/avr/driver-avr.c (avr_device_to_as): Pass -mrmw option to assembler if RMW isa supported by current device. * config/avr/genmultilib.awk: Update as device info structure changed. * doc/invoke.texi: Add info for __AVR_ISA_RMW__ builtin macro * gcc.target/avr/dev-specific-rmw.c: New test. From-SVN: r209141 --- gcc/config/avr/avr-arch.h | 62 +++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 23 deletions(-) (limited to 'gcc/config/avr/avr-arch.h') diff --git a/gcc/config/avr/avr-arch.h b/gcc/config/avr/avr-arch.h index 6357e99..b3c7cc0 100644 --- a/gcc/config/avr/avr-arch.h +++ b/gcc/config/avr/avr-arch.h @@ -100,32 +100,12 @@ typedef struct /* Index in avr_arch_types[]. */ enum avr_arch arch; + /* device specific feature */ + int dev_attribute; + /* Must lie outside user's namespace. NULL == no macro. */ const char *const macro; - /* Stack pointer have 8 bits width. */ - int short_sp; - - /* Some AVR devices have a core erratum when skipping a 2-word instruction. - Skip instructions are: SBRC, SBRS, SBIC, SBIS, CPSE. - Problems will occur with return address is IRQ executes during the - skip sequence. - - A support ticket from Atmel returned the following information: - - Subject: (ATTicket:644469) On AVR skip-bug core Erratum - From: avr@atmel.com Date: 2011-07-27 - (Please keep the subject when replying to this mail) - - This errata exists only in AT90S8515 and ATmega103 devices. - - For information please refer the following respective errata links - http://www.atmel.com/dyn/resources/prod_documents/doc2494.pdf - http://www.atmel.com/dyn/resources/prod_documents/doc1436.pdf */ - - /* Core Erratum: Must not skip 2-word instruction. */ - int errata_skip; - /* Start of data section. */ int data_section_start; @@ -136,6 +116,42 @@ typedef struct const char *const library_name; } avr_mcu_t; +/* AVR device specific features. + +AVR_ISA_RMW + Only few avr devices have Read-Modify-Write (RMW) instructions + (XCH, LAC, LAS and LAT) + +AVR_SHORT_SP + Stack Pointer has only 8 bit width. + The device / multilib has an 8-bit stack pointer (no SPH). + +AVR_ERRATA_SKIP + Some AVR devices have a core erratum when skipping a 2-word instruction. + Skip instructions are: SBRC, SBRS, SBIC, SBIS, CPSE. + Problems will occur with return address is IRQ executes during the + skip sequence. + + A support ticket from Atmel returned the following information: + + Subject: (ATTicket:644469) On AVR skip-bug core Erratum + From: avr@atmel.com Date: 2011-07-27 + (Please keep the subject when replying to this mail) + + This errata exists only in AT90S8515 and ATmega103 devices. + + For information please refer the following respective errata links + http://www.atmel.com/dyn/resources/prod_documents/doc2494.pdf + http://www.atmel.com/dyn/resources/prod_documents/doc1436.pdf */ + +enum avr_device_specific_features +{ + AVR_ISA_NONE, + AVR_ISA_RMW = 0x1, /* device has RMW instructions. */ + AVR_SHORT_SP = 0x2, /* Stack Pointer has 8 bits width. */ + AVR_ERRATA_SKIP = 0x4 /* device has a core erratum. */ +}; + /* Map architecture to its texinfo string. */ typedef struct -- cgit v1.1