OSDN Git Service

2003-01-26 Steven Bosscher <s.bosscher@student.tudelft.nl>
[pf3gnuchains/gcc-fork.git] / gcc / config / avr / avr.h
index a405cac..5309a0d 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler,
    for ATMEL AVR at90s8515, ATmega103/103L, ATmega603/603L microcontrollers.
-   Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    Contributed by Denis Chertykov (denisc@overta.ru)
 
 This file is part of GNU CC.
@@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA.  */
 
 /* Names to predefine in the preprocessor for this target machine. */
 
-#define TARGET_CPU_CPP_BUILTINS()              \
+#define TARGET_CPU_CPP_BUILTINS()              \
   do                                           \
     {                                          \
       builtin_define_std ("AVR");              \
@@ -58,7 +58,7 @@ extern int target_flags;
 
 #define TARGET_ORDER_1         (target_flags & MASK_ORDER_1)
 #define TARGET_ORDER_2         (target_flags & MASK_ORDER_2)
-#define TARGET_INT8            (target_flags & MASK_INT8)
+#define TARGET_INT8            (target_flags & MASK_INT8)
 #define TARGET_NO_INTERRUPTS   (target_flags & MASK_NO_INTERRUPTS)
 #define TARGET_INSN_SIZE_DUMP  (target_flags & MASK_INSN_SIZE_DUMP)
 #define TARGET_CALL_PROLOGUES  (target_flags & MASK_CALL_PROLOGUES)
@@ -70,7 +70,7 @@ extern int target_flags;
    This is for debugging the compiler itself.  */
 
 #define TARGET_RTL_DUMP                (target_flags & MASK_RTL_DUMP)
-#define TARGET_ALL_DEBUG       (target_flags & MASK_ALL_DEBUG)
+#define TARGET_ALL_DEBUG       (target_flags & MASK_ALL_DEBUG)
 
 #define TARGET_SWITCHES {                                              \
   { "order1", MASK_ORDER_1, NULL },                                    \
@@ -132,9 +132,6 @@ extern int avr_asm_only_p;
    Don't use this macro to turn on various extra optimizations for
    `-O'.  That is what `OPTIMIZATION_OPTIONS' is for.  */
 
-#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
-   avr_optimization_options (LEVEL, SIZE)
-
 #define CAN_DEBUG_WITHOUT_FP
 /* Define this macro if debugging can be performed even without a
    frame pointer.  If this macro is defined, GNU CC will turn on the
@@ -247,7 +244,7 @@ extern int avr_asm_only_p;
 /* A C expression for a string describing the name of the data type
    to use for size values.  The typedef name `size_t' is defined
    using the contents of the string.
-   
+
    The string can contain more than one keyword.  If so, separate
    them with spaces, and write first any length keyword, then
    `unsigned' if appropriate, and finally `int'.  The string must
@@ -255,7 +252,7 @@ extern int avr_asm_only_p;
    `init_decl_processing' in the file `c-decl.c'.  You may not omit
    `int' or change the order--that would cause the compiler to crash
    on startup.
-   
+
    If you don't define this macro, the default is `"long unsigned
    int"'.  */
 
@@ -264,7 +261,7 @@ extern int avr_asm_only_p;
    to use for the result of subtracting two pointers.  The typedef
    name `ptrdiff_t' is defined using the contents of the string.  See
    `SIZE_TYPE' above for more information.
-   
+
    If you don't define this macro, the default is `"long int"'.  */
 
 
@@ -368,10 +365,10 @@ extern int avr_asm_only_p;
 /* If defined, an initializer for a vector of integers, containing the
    numbers of hard registers in the order in which GNU CC should
    prefer to use them (from most preferred to least).
-   
+
    If this macro is not defined, registers are used lowest numbered
    first (all else being equal).
-   
+
    One use of this macro is on machines where the highest numbered
    registers must always be saved and the save-multiple-registers
    instruction supports only sequences of consetionve registers.  On
@@ -546,10 +543,10 @@ enum reg_class {
      0x00000000},              /* POINTER_REGS, r26 - r31 */           \
   {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W),          \
      0x00000000},              /* ADDW_REGS, r24 - r31 */              \
-  {0x00ff0000,0x00000000},     /* SIMPLE_LD_REGS r16 - r23 */          \
+  {0x00ff0000,0x00000000},     /* SIMPLE_LD_REGS r16 - r23 */          \
   {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16),   \
      0x00000000},      /* LD_REGS, r16 - r31 */                        \
-  {0x0000ffff,0x00000000},     /* NO_LD_REGS  r0 - r15 */              \
+  {0x0000ffff,0x00000000},     /* NO_LD_REGS  r0 - r15 */              \
   {0xffffffff,0x00000000},     /* GENERAL_REGS, r0 - r31 */            \
   {0xffffffff,0x00000003}      /* ALL_REGS */                          \
 }
@@ -678,7 +675,7 @@ enum reg_class {
    machines allow copying all registers to and from memory, but
    require a scratch register for stores to some memory locations
    (e.g., those with symbolic address on the RT, and those with
-   certain symbolic address on the Sparc when compiling PIC).  In
+   certain symbolic address on the SPARC when compiling PIC).  In
    some cases, both an intermediate and a scratch register are
    required.
 
@@ -734,7 +731,7 @@ enum reg_class {
 /* `SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)'
    Certain machines have the property that some registers cannot be
    copied to some other registers without using memory.  Define this
-   macro on those machines to be a C expression that is non-zero if
+   macro on those machines to be a C expression that is nonzero if
    objects of mode M in registers of CLASS1 can only be copied to
    registers of class CLASS2 by storing a register of CLASS1 into
    memory and loading that memory location into a register of CLASS2.
@@ -758,16 +755,16 @@ enum reg_class {
    classes that there would not be enough registers to use as spill
    registers if this were done.
 
-   Define `SMALL_REGISTER_CLASSES' to be an expression with a non-zero
-   value on these machines.  When this macro has a non-zero value, the
+   Define `SMALL_REGISTER_CLASSES' to be an expression with a nonzero
+   value on these machines.  When this macro has a nonzero value, the
    compiler allows registers explicitly used in the rtl to be used as
    spill registers but avoids extending the lifetime of these
    registers.
 
-   It is always safe to define this macro with a non-zero value, but
+   It is always safe to define this macro with a nonzero value, but
    if you unnecessarily define it, you will reduce the amount of
    optimizations that can be performed in some cases.  If you do not
-   define this macro with a non-zero value when it is required, the
+   define this macro with a nonzero value when it is required, the
    compiler will run out of spill registers and print a fatal error
    message.  For most machines, you should not define this macro at
    all.  */
@@ -1002,7 +999,7 @@ enum reg_class {
                                      || (FROM) == FRAME_POINTER_REGNUM+1) \
                                     && ! FRAME_POINTER_REQUIRED           \
                                     ))
-/* A C expression that returns non-zero if the compiler is allowed to
+/* A C expression that returns nonzero if the compiler is allowed to
    try to replace register number FROM-REG with register number
    TO-REG.  This macro need only be defined if `ELIMINABLE_REGS' is
    defined, and will usually be the constant 1, since most of the
@@ -1118,7 +1115,7 @@ enum reg_class {
    You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the
    definition of this macro to determine if this argument is of a
    type that must be passed in the stack.  If `REG_PARM_STACK_SPACE'
-   is not defined and `FUNCTION_ARG' returns non-zero for such an
+   is not defined and `FUNCTION_ARG' returns nonzero for such an
    argument, the compiler will abort.  If `REG_PARM_STACK_SPACE' is
    defined, the argument will be computed in the stack and then
    loaded into a register.  */
@@ -1151,7 +1148,7 @@ typedef struct avr_args {
    is zero for a call to an explicitly named function, a library
    function call, or when `INIT_CUMULATIVE_ARGS' is used to find
    arguments for the function being compiled.
-   
+
    When processing a call to a compiler support library function,
    LIBNAME identifies which one.  It is a `symbol_ref' rtx which
    contains the name of the function, as a string.  LIBNAME is 0 when
@@ -1167,7 +1164,7 @@ typedef struct avr_args {
    MODE, TYPE and NAMED describe that argument.  Once this is done,
    the variable CUM is suitable for analyzing the *following*
    argument with `FUNCTION_ARG', etc.
-   
+
    This macro need not do anything if the argument in question was
    passed on the stack.  The compiler knows how to track the amount
    of stack space used for arguments without any special help. */
@@ -1310,8 +1307,6 @@ extern int avr_reg_order[];
    addressing.  */
 
 #define HAVE_PRE_DECREMENT 1
-/* #define HAVE_PRE_INCREMENT
-   #define HAVE_POST_DECREMENT  */
 /* Similar for other kinds of addressing.  */
 
 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
@@ -1501,7 +1496,7 @@ do {                                                                          \
    top level, you'll need to replace first the top leve It is not
    necessary for this macro to come up with a legitimate address;
    but often a machine-dependent strategy can generate better code.  */
-       
+
 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)                       \
       if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC)   \
         goto LABEL
@@ -1563,9 +1558,9 @@ do {                                                                          \
 {                                                      \
   int cst = default_rtx_costs (x, code, outer_code);   \
   if (cst>0)                                           \
-    return cst;                                        \
+    return cst;                                        \
   else if (cst<0)                                      \
-    total += -cst;                                     \
+    total += -cst;                                     \
   break;                                               \
 }
 
@@ -1682,10 +1677,10 @@ do {                                                                        \
    cost many times greater than aligned accesses, for example if they
    are emulated in a trap handler.
 
-   When this macro is non-zero, the compiler will act as if
-   `STRICT_ALIGNMENT' were non-zero when generating code for block
+   When this macro is nonzero, the compiler will act as if
+   `STRICT_ALIGNMENT' were nonzero when generating code for block
    moves.  This can cause significantly more instructions to be
-   produced.  Therefore, do not set this macro non-zero if unaligned
+   produced.  Therefore, do not set this macro nonzero if unaligned
    accesses only add a cycle or two to the time for a memory access.
 
    If the value of this macro is always zero, it need not be defined.
@@ -1757,13 +1752,13 @@ do {                                                                        \
 #define EXTRA_SECTION_FUNCTIONS                                                      \
                                                                              \
 void                                                                         \
-progmem_section (void)                                                       \
+progmem_section ()                                                           \
 {                                                                            \
   if (in_section != in_progmem)                                                      \
     {                                                                        \
       fprintf (asm_out_file,                                                 \
               "\t.section .progmem.gcc_sw_table, \"%s\", @progbits\n",       \
-              AVR_MEGA ? "a" : "ax");                                        \
+              AVR_MEGA ? "a" : "ax");                                        \
       /* Should already be aligned, this is just to be safe if it isn't.  */  \
       fprintf (asm_out_file, "\t.p2align 1\n");                                      \
       in_section = in_progmem;                                               \
@@ -1848,9 +1843,9 @@ progmem_section (void)                                                          \
 
 #define OBJC_PROLOGUE {}
 /* A C statement to output any assembler statements which are
-   required to precede any Objective C object definitions or message
+   required to precede any Objective-C object definitions or message
    sending.  The statement is executed only when compiling an
-   Objective C program.  */
+   Objective-C program.  */
 
 
 #define ASM_OUTPUT_ASCII(FILE, P, SIZE)         gas_output_ascii (FILE,P,SIZE)
@@ -1991,6 +1986,7 @@ do {                                                                      \
    If this macro is not defined, then the variable name is defined in
    the usual manner as a label (by means of `ASM_OUTPUT_LABEL').  */
 
+#undef ASM_FINISH_DECLARE_OBJECT
 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)        \
 do {                                                                    \
      const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);            \
@@ -2055,11 +2051,11 @@ do {                                                                     \
 /* Globalizing directive for a label.  */
 #define GLOBAL_ASM_OP ".global\t"
 
-#define ASM_WEAKEN_LABEL(FILE, NAME)   \
+#define ASM_WEAKEN_LABEL(FILE, NAME)   \
   do                                   \
     {                                  \
       fputs ("\t.weak\t", (FILE));     \
-      assemble_name ((FILE), (NAME));  \
+      assemble_name ((FILE), (NAME));  \
       fputc ('\n', (FILE));            \
     }                                  \
   while (0)
@@ -2106,32 +2102,13 @@ do {                                                                     \
    setting the `DECL_ONE_ONLY' flag is enough to mark a declaration to
    be emitted as one-only.  */
 
-#define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) \
-fprintf(STREAM, ".%s%d:\n", PREFIX, NUM)
-/* A C statement to output to the stdio stream STREAM a label whose
-   name is made from the string PREFIX and the number NUM.
-
-   It is absolutely essential that these labels be distinct from the
-   labels used for user-level functions and variables.  Otherwise,
-   certain programs will have name conflicts with internal labels.
-
-   It is desirable to exclude internal labels from the symbol table
-   of the object file.  Most assemblers have a naming convention for
-   labels that should be excluded; on many systems, the letter `L' at
-   the beginning of a label has this effect.  You should find out what
-   convention your system uses, and follow it.
-
-   The usual definition of this macro is as follows:
-
-   fprintf (STREAM, "L%s%d:\n", PREFIX, NUM)  */
-
 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM)       \
 sprintf (STRING, "*.%s%d", PREFIX, NUM)
 /* A C statement to store into the string STRING a label whose name
    is made from the string PREFIX and the number NUM.
 
    This string, when output subsequently by `assemble_name', should
-   produce the output that `ASM_OUTPUT_INTERNAL_LABEL' would produce
+   produce the output that `(*targetm.asm_out.internal_label)' would produce
    with the same PREFIX and NUM.
 
    If the string begins with `*', then `assemble_name' will output
@@ -2142,27 +2119,6 @@ sprintf (STRING, "*.%s%d", PREFIX, NUM)
    `ASM_OUTPUT_LABELREF' is also part of your machine description, so
    you should know what it does on your machine.)  */
 
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10),   \
-  sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
-/* A C expression to assign to OUTVAR (which is a variable of type
-   `char *') a newly allocated string made from the string NAME and
-   the number NUMBER, with some suitable punctuation added.  Use
-   `alloca' to get space for the string.
-
-   The string will be used as an argument to `ASM_OUTPUT_LABELREF' to
-   produce an assembler label for an internal static variable whose
-   name is NAME.  Therefore, the string must be such as to result in
-   valid assembler code.  The argument NUMBER is different each time
-   this macro is executed; it prevents conflicts between
-   similarly-named internal static variables in different scopes.
-
-   Ideally this string should not be a valid C identifier, to prevent
-   any conflict with the user's own symbols.  Most assemblers allow
-   periods or percent signs in assembler symbols; putting at least
-   one of these between the name and the number will suffice.  */
-
 /* `ASM_OUTPUT_WEAK_ALIAS (STREAM, NAME, VALUE)'
    A C statement to output to the stdio stream STREAM assembler code
    which defines (equates) the weak symbol NAME to have the value
@@ -2307,18 +2263,18 @@ sprintf (STRING, "*.%s%d", PREFIX, NUM)
    The definition should be a C statement to output to the stdio
    stream STREAM an assembler pseudo-instruction to generate a
    reference to a label.  VALUE is the number of an internal label
-   whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'.  For
+   whose definition is output using `(*targetm.asm_out.internal_label)'.  For
    example,
 
    fprintf (STREAM, "\t.word L%d\n", VALUE)  */
 
 #define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) \
-  progmem_section (), ASM_OUTPUT_INTERNAL_LABEL (STREAM, PREFIX, NUM)
+  progmem_section (), (*targetm.asm_out.internal_label) (STREAM, PREFIX, NUM)
 
 /* `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)'
    Define this if the label before a jump-table needs to be output
    specially.  The first three arguments are the same as for
-   `ASM_OUTPUT_INTERNAL_LABEL'; the fourth argument is the jump-table
+   `(*targetm.asm_out.internal_label)'; the fourth argument is the jump-table
    which follows (a `jump_insn' containing an `addr_vec' or
    `addr_diff_vec').
 
@@ -2326,7 +2282,7 @@ sprintf (STRING, "*.%s%d", PREFIX, NUM)
    the table.
 
    If this macro is not defined, these labels are output with
-   `ASM_OUTPUT_INTERNAL_LABEL'.  */
+   `(*targetm.asm_out.internal_label)'.  */
 
 /* `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)'
    Define this if something special must be output at the end of a
@@ -2526,15 +2482,13 @@ extern int avr_case_values_threshold;
 
    Do not define this macro if it does not need to do anything.  */
 
-#define ASM_SPEC "%{mmcu=*:-mmcu=%*}"
-/* A C string constant that tells the GNU CC driver program options to
-   pass to the assembler.  It can also specify how to translate
-   options you give to GNU CC into options for GNU CC to pass to the
-   assembler.  See the file `sun3.h' for an example of this.
-
-   Do not define this macro if it does not need to do anything.  */
+#define CC1PLUS_SPEC "%{!frtti:-fno-rtti} \
+    %{!fenforce-eh-specs:-fno-enforce-eh-specs} \
+    %{!fexceptions:-fno-exceptions}"
+/* A C string constant that tells the GNU CC drvier program options to
+   pass to `cc1plus'.  */
 
-#define ASM_FINAL_SPEC ""
+#define ASM_SPEC "%{mmcu=*:-mmcu=%*}"
 /* A C string constant that tells the GNU CC driver program how to
    run any programs which cleanup after the normal assembler.
    Normally, this is not needed.  See the file `mips.h' for an
@@ -2687,8 +2641,6 @@ extern struct rtx_def *tmp_reg_rtx;
 extern struct rtx_def *zero_reg_rtx;
 extern struct rtx_def *ldi_reg_rtx;
 
-#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
-
 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
 
 /* Get the standard ELF stabs definitions.  */