OSDN Git Service

2009-05-15 Paolo Bonzini <bonzini@gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / config / avr / avr.h
index 5e5f932..d431790 100644 (file)
@@ -1,7 +1,7 @@
 /* Definitions of target machine for GNU compiler,
    for ATMEL AVR at90s8515, ATmega103/103L, ATmega603/603L microcontrollers.
    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 
-   2008 Free Software Foundation, Inc.
+   2008, 2009 Free Software Foundation, Inc.
    Contributed by Denis Chertykov (denisc@overta.ru)
 
 This file is part of GCC.
@@ -291,6 +291,19 @@ enum reg_class {
 
 #define REGNO_REG_CLASS(R) avr_regno_reg_class(R)
 
+/* The following macro defines cover classes for Integrated Register
+   Allocator.  Cover classes is a set of non-intersected register
+   classes covering all hard registers used for register allocation
+   purpose.  Any move between two registers of a cover class should be
+   cheaper than load or store of the registers.  The macro value is
+   array of register classes with LIM_REG_CLASSES used as the end
+   marker.  */
+
+#define IRA_COVER_CLASSES               \
+{                                       \
+  GENERAL_REGS, LIM_REG_CLASSES         \
+}
+
 #define BASE_REG_CLASS (reload_completed ? BASE_POINTER_REGS : POINTER_REGS)
 
 #define INDEX_REG_CLASS NO_REGS
@@ -337,7 +350,7 @@ enum reg_class {
 
 #define STATIC_CHAIN_REGNUM 2
 
-#define FRAME_POINTER_REQUIRED frame_pointer_required_p()
+#define FRAME_POINTER_REQUIRED avr_frame_pointer_required_p()
 
 /* Offset from the frame pointer register value to the top of the stack.  */
 #define FRAME_POINTER_CFA_OFFSET(FNDECL) 0
@@ -347,15 +360,10 @@ enum reg_class {
        {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}            \
        ,{FRAME_POINTER_REGNUM+1,STACK_POINTER_REGNUM+1}}
 
-#define CAN_ELIMINATE(FROM, TO) (((FROM) == ARG_POINTER_REGNUM            \
-                                 && (TO) == FRAME_POINTER_REGNUM)         \
-                                || (((FROM) == FRAME_POINTER_REGNUM       \
-                                     || (FROM) == FRAME_POINTER_REGNUM+1) \
-                                    && ! FRAME_POINTER_REQUIRED           \
-                                    ))
+#define CAN_ELIMINATE(FROM, TO)        avr_can_eliminate (FROM, TO)
 
 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET)                   \
-     OFFSET = initial_elimination_offset (FROM, TO)
+  OFFSET = avr_initial_elimination_offset (FROM, TO)
 
 #define RETURN_ADDR_RTX(count, x) \
   gen_rtx_MEM (Pmode, memory_address (Pmode, plus_constant (tem, 1)))
@@ -385,8 +393,6 @@ extern int avr_reg_order[];
 
 #define RET_REGISTER avr_ret_register ()
 
-#define FUNCTION_VALUE(VALTYPE, FUNC) avr_function_value (VALTYPE, FUNC)
-
 #define LIBCALL_VALUE(MODE)  avr_libcall_value (MODE)
 
 #define FUNCTION_VALUE_REGNO_P(N) ((int) (N) == RET_REGISTER)
@@ -402,20 +408,6 @@ extern int avr_reg_order[];
 
 #define MAX_REGS_PER_ADDRESS 1
 
-#ifdef REG_OK_STRICT
-#  define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR)        \
-{                                                      \
-  if (legitimate_address_p (mode, operand, 1))         \
-    goto ADDR;                                         \
-}
-#  else
-#  define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR)        \
-{                                                      \
-  if (legitimate_address_p (mode, operand, 0))         \
-    goto ADDR;                                         \
-}
-#endif
-
 #define REG_OK_FOR_BASE_NOSTRICT_P(X) \
   (REGNO (X) >= FIRST_PSEUDO_REGISTER || REG_OK_FOR_BASE_STRICT_P(X))
 
@@ -429,13 +421,6 @@ extern int avr_reg_order[];
 
 #define REG_OK_FOR_INDEX_P(X) 0
 
-#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)                         \
-{                                                                      \
-  (X) = legitimize_address (X, OLDX, MODE);                            \
-  if (memory_address_p (MODE, X))                                      \
-    goto WIN;                                                          \
-}
-
 #define XEXP_(X,Y) (X)
 
 /* LEGITIMIZE_RELOAD_ADDRESS will allow register R26/27 to be used, where it
@@ -472,10 +457,6 @@ do {                                                                           \
                           OPNUM, TYPE);                                    \
              goto WIN;                                                     \
            }                                                               \
-         push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL,           \
-                      BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0,     \
-                      OPNUM, TYPE);                                        \
-          goto WIN;                                                        \
        }                                                                   \
       else if (! (frame_pointer_needed && XEXP (X,0) == frame_pointer_rtx)) \
        {                                                                   \
@@ -487,8 +468,6 @@ do {                                                                            \
     }                                                                      \
 } while(0)
 
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
-
 #define LEGITIMATE_CONSTANT_P(X) 1
 
 #define REGISTER_MOVE_COST(MODE, FROM, TO) ((FROM) == STACK_REG ? 6 \
@@ -500,7 +479,7 @@ do {                                                                            \
                                         (MODE)==SImode ? 8 :   \
                                         (MODE)==SFmode ? 8 : 16)
 
-#define BRANCH_COST 0
+#define BRANCH_COST(speed_p, predictable_p) 0
 
 #define SLOW_BYTE_ACCESS 0
 
@@ -526,6 +505,8 @@ do {                                                                            \
 
 #define TARGET_ASM_DESTRUCTOR avr_asm_out_dtor
 
+#define SUPPORTS_INIT_PRIORITY 0
+
 #define JUMP_TABLES_IN_TEXT_SECTION 0
 
 #define ASM_COMMENT_START " ; "
@@ -581,10 +562,7 @@ do {                                                                       \
    specific tm.h file (depending upon the particulars of your assembler).  */
 
 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)            \
-do {                                                           \
-     ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function");       \
-     ASM_OUTPUT_LABEL (FILE, NAME);                            \
-} while (0)
+avr_asm_declare_function_name ((FILE), (NAME), (DECL))
 
 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)                   \
   do {                                                                 \
@@ -728,10 +706,6 @@ fprintf (STREAM, "\t.skip %lu,0\n", (unsigned long)(N))
 
 #define CASE_VECTOR_MODE HImode
 
-extern int avr_case_values_threshold;
-
-#define CASE_VALUES_THRESHOLD avr_case_values_threshold
-
 #undef WORD_REGISTER_OPERATIONS
 
 #define MOVE_MAX 4
@@ -817,7 +791,8 @@ mmcu=*:-mmcu=%*}"
   mmcu=at90s8*|\
   mmcu=at90c8*|\
   mmcu=at86rf401|\
-  mmcu=attiny13|\
+  mmcu=ata6289|\
+  mmcu=attiny13*|\
   mmcu=attiny2313|\
   mmcu=attiny24|\
   mmcu=attiny25|\
@@ -829,14 +804,16 @@ mmcu=*:-mmcu=%*}"
   mmcu=at76*|\
   mmcu=at90usb82|\
   mmcu=at90usb162|\
-  mmcu=attiny167: -m avr3}\
+  mmcu=attiny16*|\
+  mmcu=attiny32*: -m avr3}\
 %{mmcu=atmega8*|\
-  mmcu=atmega48*|\
+  mmcu=atmega4*|\
   mmcu=at90pwm1|\
   mmcu=at90pwm2|\
   mmcu=at90pwm2b|\
   mmcu=at90pwm3|\
-  mmcu=at90pwm3b: -m avr4}\
+  mmcu=at90pwm3b|\
+  mmcu=at90pwm81: -m avr4}\
 %{mmcu=atmega16*|\
   mmcu=atmega32*|\
   mmcu=atmega406|\
@@ -845,9 +822,12 @@ mmcu=*:-mmcu=%*}"
   mmcu=at90can*|\
   mmcu=at90pwm216|\
   mmcu=at90pwm316|\
+  mmcu=at90scr100|\
   mmcu=at90usb64*|\
   mmcu=at90usb128*|\
-  mmcu=at94k: -m avr5}\
+  mmcu=at94k|\
+  mmcu=m3000*|\
+  mmcu=m3001*: -m avr5}\
 %{mmcu=atmega256*:-m avr6}\
 %{mmcu=atmega324*|\
   mmcu=atmega325*|\
@@ -867,22 +847,37 @@ mmcu=*:-mmcu=%*}"
   mmcu=atmega165*|\
   mmcu=atmega168*|\
   mmcu=atmega169*|\
-  mmcu=atmega8hva|\
-  mmcu=atmega16hva|\
-  mmcu=atmega32hvb|\
+  mmcu=atmega4hv*|\
+  mmcu=atmega8hv*|\
+  mmcu=atmega16hv*|\
+  mmcu=atmega32hv*|\
   mmcu=attiny48|\
   mmcu=attiny88|\
+  mmcu=attiny87|\
   mmcu=attiny167|\
+  mmcu=attiny327|\
   mmcu=at90can*|\
   mmcu=at90pwm*|\
+  mmcu=atmega8c1|\
+  mmcu=atmega16c1|\
   mmcu=atmega32c1|\
+  mmcu=atmega64c1|\
+  mmcu=atmega8m1|\
+  mmcu=atmega16m1|\
   mmcu=atmega32m1|\
-  mmcu=atmega32u4|\
+  mmcu=atmega64m1|\
+  mmcu=atmega16u4|\
+  mmcu=atmega32u*|\
+  mmcu=at90scr100|\
+  mmcu=ata6289|\
   mmcu=at90usb*: -Tdata 0x800100}\
 %{mmcu=atmega640|\
   mmcu=atmega1280|\
   mmcu=atmega1281|\
-  mmcu=atmega256*: -Tdata 0x800200} "
+  mmcu=atmega256*|\
+  mmcu=atmega128rfa1: -Tdata 0x800200}\
+%{mmcu=m3000*|\
+  mmcu=m3001*: -Tdata 0x801000}"
 
 #define LIB_SPEC \
   "%{!mmcu=at90s1*:%{!mmcu=attiny11:%{!mmcu=attiny12:%{!mmcu=attiny15:%{!mmcu=attiny28: -lc }}}}}"
@@ -917,6 +912,7 @@ mmcu=*:-mmcu=%*}"
 %{mmcu=at90s8535:crts8535.o%s} \
 %{mmcu=at86rf401:crt86401.o%s} \
 %{mmcu=attiny13:crttn13.o%s} \
+%{mmcu=attiny13a:crttn13a.o%s} \
 %{mmcu=attiny2313|mmcu=avr25:crttn2313.o%s} \
 %{mmcu=attiny24:crttn24.o%s} \
 %{mmcu=attiny44:crttn44.o%s} \
@@ -928,15 +924,18 @@ mmcu=*:-mmcu=%*}"
 %{mmcu=attiny461:crttn461.o%s} \
 %{mmcu=attiny861:crttn861.o%s} \
 %{mmcu=attiny43u:crttn43u.o%s} \
+%{mmcu=attiny87:crttn87.o%s} \
 %{mmcu=attiny48:crttn48.o%s} \
 %{mmcu=attiny88:crttn88.o%s} \
-%{mmcu=attiny167:crttn167.o%s} \
-%{mmcu=at43usb320|mmcu=avr3:crt43320.o%s} \
-%{mmcu=at43usb355:crt43355.o%s} \
+%{mmcu=ata6289:crta6289.o%s} \
+%{mmcu=at43usb355|mmcu=avr3:crt43355.o%s} \
 %{mmcu=at76c711:crt76711.o%s} \
 %{mmcu=atmega103|mmcu=avr31:crtm103.o%s} \
+%{mmcu=at43usb320:crt43320.o%s} \
 %{mmcu=at90usb162|mmcu=avr35:crtusb162.o%s} \
 %{mmcu=at90usb82:crtusb82.o%s} \
+%{mmcu=attiny167:crttn167.o%s} \
+%{mmcu=attiny327:crttn327.o%s} \
 %{mmcu=atmega8|mmcu=avr4:crtm8.o%s} \
 %{mmcu=atmega48:crtm48.o%s} \
 %{mmcu=atmega48p:crtm48p.o%s} \
@@ -944,11 +943,14 @@ mmcu=*:-mmcu=%*}"
 %{mmcu=atmega88p:crtm88p.o%s} \
 %{mmcu=atmega8515:crtm8515.o%s} \
 %{mmcu=atmega8535:crtm8535.o%s} \
+%{mmcu=atmega8c1:crtm8c1.o%s} \
+%{mmcu=atmega8m1:crtm8m1.o%s} \
 %{mmcu=at90pwm1:crt90pwm1.o%s} \
 %{mmcu=at90pwm2:crt90pwm2.o%s} \
 %{mmcu=at90pwm2b:crt90pwm2b.o%s} \
 %{mmcu=at90pwm3:crt90pwm3.o%s} \
 %{mmcu=at90pwm3b:crt90pwm3b.o%s} \
+%{mmcu=at90pwm81:crt90pwm81.o%s} \
 %{mmcu=atmega16:crtm16.o%s} \
 %{mmcu=atmega161|mmcu=avr5:crtm161.o%s} \
 %{mmcu=atmega162:crtm162.o%s} \
@@ -972,7 +974,6 @@ mmcu=*:-mmcu=%*}"
 %{mmcu=atmega329p:crtm329p.o%s} \
 %{mmcu=atmega3290:crtm3290.o%s} \
 %{mmcu=atmega3290p:crtm3290p.o%s} \
-%{mmcu=atmega32hvb:crtm32hvb.o%s} \
 %{mmcu=atmega406:crtm406.o%s} \
 %{mmcu=atmega64:crtm64.o%s} \
 %{mmcu=atmega640:crtm640.o%s} \
@@ -984,13 +985,24 @@ mmcu=*:-mmcu=%*}"
 %{mmcu=atmega6490:crtm6490.o%s} \
 %{mmcu=atmega8hva:crtm8hva.o%s} \
 %{mmcu=atmega16hva:crtm16hva.o%s} \
+%{mmcu=atmega16hvb:crtm16hvb.o%s} \
+%{mmcu=atmega32hvb:crtm32hvb.o%s} \
+%{mmcu=atmega4hvd:crtm4hvd.o%s} \
+%{mmcu=atmega8hvd:crtm8hvd.o%s} \
 %{mmcu=at90can32:crtcan32.o%s} \
 %{mmcu=at90can64:crtcan64.o%s} \
 %{mmcu=at90pwm216:crt90pwm216.o%s} \
 %{mmcu=at90pwm316:crt90pwm316.o%s} \
+%{mmcu=atmega16c1:crtm16c1.o%s} \
 %{mmcu=atmega32c1:crtm32c1.o%s} \
+%{mmcu=atmega64c1:crtm64c1.o%s} \
+%{mmcu=atmega16m1:crtm16m1.o%s} \
 %{mmcu=atmega32m1:crtm32m1.o%s} \
+%{mmcu=atmega64m1:crtm64m1.o%s} \
+%{mmcu=atmega16u4:crtm16u4.o%s} \
 %{mmcu=atmega32u4:crtm32u4.o%s} \
+%{mmcu=atmega32u6:crtm32u6.o%s} \
+%{mmcu=at90scr100:crt90scr100.o%s} \
 %{mmcu=at90usb646:crtusb646.o%s} \
 %{mmcu=at90usb647:crtusb647.o%s} \
 %{mmcu=at94k:crtat94k.o%s} \
@@ -998,11 +1010,15 @@ mmcu=*:-mmcu=%*}"
 %{mmcu=atmega1280:crtm1280.o%s} \
 %{mmcu=atmega1281:crtm1281.o%s} \
 %{mmcu=atmega1284p:crtm1284p.o%s} \
-%{mmcu=atmega2560:crtm2560.o%s} \
-%{mmcu=atmega2561:crtm2561.o%s} \
 %{mmcu=at90can128:crtcan128.o%s} \
+%{mmcu=atmega128rfa1:crtm128rfa1.o%s} \
 %{mmcu=at90usb1286:crtusb1286.o%s} \
-%{mmcu=at90usb1287:crtusb1287.o%s}"
+%{mmcu=at90usb1287:crtusb1287.o%s} \
+%{mmcu=m3000f:crtm3000f.o%s} \
+%{mmcu=m3000s:crtm3000s.o%s} \
+%{mmcu=m3001b:crtm3001b.o%s} \
+%{mmcu=atmega2560|mmcu=avr6:crtm2560.o%s} \
+%{mmcu=atmega2561:crtm2561.o%s}"
 
 #define EXTRA_SPECS {"crt_binutils", CRT_BINUTILS_SPECS},
 
@@ -1046,7 +1062,7 @@ mmcu=*:-mmcu=%*}"
 
 /* A C structure for machine-specific, per-function data.
    This is added to the cfun structure.  */
-struct machine_function GTY(())
+struct GTY(()) machine_function
 {
   /* 'true' - if the current function is a leaf function.  */
   int is_leaf;