OSDN Git Service

2003-01-26 Steven Bosscher <s.bosscher@student.tudelft.nl>
[pf3gnuchains/gcc-fork.git] / gcc / config / avr / avr.h
1 /* Definitions of target machine for GNU compiler,
2    for ATMEL AVR at90s8515, ATmega103/103L, ATmega603/603L microcontrollers.
3    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
4    Contributed by Denis Chertykov (denisc@overta.ru)
5
6 This file is part of GNU CC.
7
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.  */
22
23 /* Names to predefine in the preprocessor for this target machine. */
24
25 #define TARGET_CPU_CPP_BUILTINS()               \
26   do                                            \
27     {                                           \
28       builtin_define_std ("AVR");               \
29       if (avr_base_arch_macro)                  \
30         builtin_define (avr_base_arch_macro);   \
31       if (avr_extra_arch_macro)                 \
32         builtin_define (avr_extra_arch_macro);  \
33       if (avr_asm_only_p)                       \
34         builtin_define ("__AVR_ASM_ONLY__");    \
35       if (avr_enhanced_p)                       \
36         builtin_define ("__AVR_ENHANCED__");    \
37       if (avr_mega_p)                           \
38         builtin_define ("__AVR_MEGA__");        \
39       if (TARGET_NO_INTERRUPTS)                 \
40         builtin_define ("__NO_INTERRUPTS__");   \
41     }                                           \
42   while (0)
43
44 /* This declaration should be present. */
45 extern int target_flags;
46
47 #define MASK_RTL_DUMP           0x00000010
48 #define MASK_ALL_DEBUG          0x00000FE0
49 #define MASK_ORDER_1            0x00001000
50 #define MASK_INSN_SIZE_DUMP     0x00002000
51 #define MASK_ORDER_2            0x00004000
52 #define MASK_NO_TABLEJUMP       0x00008000
53 #define MASK_INT8               0x00010000
54 #define MASK_NO_INTERRUPTS      0x00020000
55 #define MASK_CALL_PROLOGUES     0x00040000
56 #define MASK_TINY_STACK         0x00080000
57 #define MASK_SHORT_CALLS        0x00100000
58
59 #define TARGET_ORDER_1          (target_flags & MASK_ORDER_1)
60 #define TARGET_ORDER_2          (target_flags & MASK_ORDER_2)
61 #define TARGET_INT8             (target_flags & MASK_INT8)
62 #define TARGET_NO_INTERRUPTS    (target_flags & MASK_NO_INTERRUPTS)
63 #define TARGET_INSN_SIZE_DUMP   (target_flags & MASK_INSN_SIZE_DUMP)
64 #define TARGET_CALL_PROLOGUES   (target_flags & MASK_CALL_PROLOGUES)
65 #define TARGET_TINY_STACK       (target_flags & MASK_TINY_STACK)
66 #define TARGET_NO_TABLEJUMP     (target_flags & MASK_NO_TABLEJUMP)
67 #define TARGET_SHORT_CALLS      (target_flags & MASK_SHORT_CALLS)
68
69 /* Dump each assembler insn's rtl into the output file.
70    This is for debugging the compiler itself.  */
71
72 #define TARGET_RTL_DUMP         (target_flags & MASK_RTL_DUMP)
73 #define TARGET_ALL_DEBUG        (target_flags & MASK_ALL_DEBUG)
74
75 #define TARGET_SWITCHES {                                               \
76   { "order1", MASK_ORDER_1, NULL },                                     \
77   { "order2", MASK_ORDER_2, NULL },                                     \
78   { "int8", MASK_INT8, N_("Assume int to be 8 bit integer") },          \
79   { "no-interrupts", MASK_NO_INTERRUPTS,                                \
80     N_("Change the stack pointer without disabling interrupts") },      \
81   { "call-prologues", MASK_CALL_PROLOGUES,                              \
82     N_("Use subroutines for function prologue/epilogue") },             \
83   { "tiny-stack", MASK_TINY_STACK,                                      \
84     N_("Change only the low 8 bits of the stack pointer") },            \
85   { "no-tablejump", MASK_NO_TABLEJUMP,                                  \
86     N_("Do not generate tablejump insns") },                            \
87   { "short-calls", MASK_SHORT_CALLS,                                    \
88     N_("Use rjmp/rcall (limited range) on >8K devices") },              \
89   { "rtl", MASK_RTL_DUMP, NULL },                                       \
90   { "size", MASK_INSN_SIZE_DUMP,                                        \
91     N_("Output instruction sizes to the asm file") },                   \
92   { "deb", MASK_ALL_DEBUG, NULL },                                      \
93   { "", 0, NULL } }
94
95 extern const char *avr_init_stack;
96 extern const char *avr_mcu_name;
97
98 extern const char *avr_base_arch_macro;
99 extern const char *avr_extra_arch_macro;
100 extern int avr_mega_p;
101 extern int avr_enhanced_p;
102 extern int avr_asm_only_p;
103
104 #define AVR_MEGA (avr_mega_p && !TARGET_SHORT_CALLS)
105 #define AVR_ENHANCED (avr_enhanced_p)
106
107 #define TARGET_OPTIONS {                                                      \
108  { "init-stack=", &avr_init_stack, N_("Specify the initial stack address") }, \
109  { "mcu=", &avr_mcu_name, N_("Specify the MCU name") } }
110
111 #define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)");
112 /* This macro is a C statement to print on `stderr' a string
113    describing the particular machine description choice.  Every
114    machine description should define `TARGET_VERSION'.  For example:
115
116    #ifdef MOTOROLA
117    #define TARGET_VERSION \
118    fprintf (stderr, " (68k, Motorola syntax)");
119    #else
120    #define TARGET_VERSION \
121    fprintf (stderr, " (68k, MIT syntax)");
122    #endif  */
123
124 #define OVERRIDE_OPTIONS avr_override_options ()
125 /* `OVERRIDE_OPTIONS'
126    Sometimes certain combinations of command options do not make
127    sense on a particular target machine.  You can define a macro
128    `OVERRIDE_OPTIONS' to take account of this.  This macro, if
129    defined, is executed once just after all the command options have
130    been parsed.
131
132    Don't use this macro to turn on various extra optimizations for
133    `-O'.  That is what `OPTIMIZATION_OPTIONS' is for.  */
134
135 #define CAN_DEBUG_WITHOUT_FP
136 /* Define this macro if debugging can be performed even without a
137    frame pointer.  If this macro is defined, GNU CC will turn on the
138    `-fomit-frame-pointer' option whenever `-O' is specified.  */
139
140 /* Define this if most significant byte of a word is the lowest numbered. */
141 #define BITS_BIG_ENDIAN 0
142
143 /* Define this if most significant byte of a word is the lowest numbered. */
144 #define BYTES_BIG_ENDIAN 0
145
146 /* Define this if most significant word of a multiword number is the lowest
147    numbered.  */
148 #define WORDS_BIG_ENDIAN 0
149
150 #ifdef IN_LIBGCC2
151 /* This is to get correct SI and DI modes in libgcc2.c (32 and 64 bits).  */
152 #define UNITS_PER_WORD 4
153 #else
154 /* Width of a word, in units (bytes). */
155 #define UNITS_PER_WORD 1
156 #endif
157
158 /* Width in bits of a pointer.
159    See also the macro `Pmode' defined below.  */
160 #define POINTER_SIZE 16
161
162
163 /* Maximum sized of reasonable data type
164    DImode or Dfmode ...  */
165 #define MAX_FIXED_MODE_SIZE 32
166
167 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
168 #define PARM_BOUNDARY 8
169
170 /* Allocation boundary (in *bits*) for the code of a function. */
171 #define FUNCTION_BOUNDARY 8
172
173 /* Alignment of field after `int : 0' in a structure. */
174 #define EMPTY_FIELD_BOUNDARY 8
175
176 /* No data type wants to be aligned rounder than this. */
177 #define BIGGEST_ALIGNMENT 8
178
179
180 /* Define this if move instructions will actually fail to work
181    when given unaligned data.  */
182 #define STRICT_ALIGNMENT 0
183
184 /* A C expression for the size in bits of the type `int' on the
185      target machine.  If you don't define this, the default is one word.  */
186 #define INT_TYPE_SIZE (TARGET_INT8 ? 8 : 16)
187
188
189 /* A C expression for the size in bits of the type `short' on the
190    target machine.  If you don't define this, the default is half a
191    word.  (If this would be less than one storage unit, it is rounded
192    up to one unit.)  */
193 #define SHORT_TYPE_SIZE (INT_TYPE_SIZE == 8 ? INT_TYPE_SIZE : 16)
194
195 /* A C expression for the size in bits of the type `long' on the
196    target machine.  If you don't define this, the default is one word.  */
197 #define LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 16 : 32)
198
199 #define MAX_LONG_TYPE_SIZE 32
200 /* Maximum number for the size in bits of the type `long' on the
201    target machine.  If this is undefined, the default is
202    `LONG_TYPE_SIZE'.  Otherwise, it is the constant value that is the
203    largest value that `LONG_TYPE_SIZE' can have at run-time.  This is
204    used in `cpp'.  */
205
206
207 #define LONG_LONG_TYPE_SIZE 64
208 /* A C expression for the size in bits of the type `long long' on the
209    target machine.  If you don't define this, the default is two
210    words.  If you want to support GNU Ada on your machine, the value
211    of macro must be at least 64.  */
212
213
214 #define FLOAT_TYPE_SIZE 32
215 /* A C expression for the size in bits of the type `float' on the
216    target machine.  If you don't define this, the default is one word.  */
217
218 #define DOUBLE_TYPE_SIZE 32
219 /* A C expression for the size in bits of the type `double' on the
220    target machine.  If you don't define this, the default is two
221    words. */
222
223
224 #define LONG_DOUBLE_TYPE_SIZE 32
225 /* A C expression for the size in bits of the type `long double' on
226    the target machine.  If you don't define this, the default is two
227    words.  */
228
229 #define DEFAULT_SIGNED_CHAR 1
230 /* An expression whose value is 1 or 0, according to whether the type
231    `char' should be signed or unsigned by default.  The user can
232    always override this default with the options `-fsigned-char' and
233    `-funsigned-char'.  */
234
235 /* `DEFAULT_SHORT_ENUMS'
236    A C expression to determine whether to give an `enum' type only as
237    many bytes as it takes to represent the range of possible values
238    of that type.  A nonzero value means to do that; a zero value
239    means all `enum' types should be allocated like `int'.
240
241    If you don't define the macro, the default is 0.  */
242
243 #define SIZE_TYPE (INT_TYPE_SIZE == 8 ? "long unsigned int" : "unsigned int")
244 /* A C expression for a string describing the name of the data type
245    to use for size values.  The typedef name `size_t' is defined
246    using the contents of the string.
247
248    The string can contain more than one keyword.  If so, separate
249    them with spaces, and write first any length keyword, then
250    `unsigned' if appropriate, and finally `int'.  The string must
251    exactly match one of the data type names defined in the function
252    `init_decl_processing' in the file `c-decl.c'.  You may not omit
253    `int' or change the order--that would cause the compiler to crash
254    on startup.
255
256    If you don't define this macro, the default is `"long unsigned
257    int"'.  */
258
259 #define PTRDIFF_TYPE (INT_TYPE_SIZE == 8 ? "long int" :"int")
260 /* A C expression for a string describing the name of the data type
261    to use for the result of subtracting two pointers.  The typedef
262    name `ptrdiff_t' is defined using the contents of the string.  See
263    `SIZE_TYPE' above for more information.
264
265    If you don't define this macro, the default is `"long int"'.  */
266
267
268 #define WCHAR_TYPE_SIZE 16
269 /* A C expression for the size in bits of the data type for wide
270    characters.  This is used in `cpp', which cannot make use of
271    `WCHAR_TYPE'.  */
272
273 #define FIRST_PSEUDO_REGISTER 36
274 /* Number of hardware registers known to the compiler.  They receive
275    numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first
276    pseudo register's number really is assigned the number
277    `FIRST_PSEUDO_REGISTER'.  */
278
279 #define FIXED_REGISTERS {\
280   1,1,/* r0 r1 */\
281   0,0,/* r2 r3 */\
282   0,0,/* r4 r5 */\
283   0,0,/* r6 r7 */\
284   0,0,/* r8 r9 */\
285   0,0,/* r10 r11 */\
286   0,0,/* r12 r13 */\
287   0,0,/* r14 r15 */\
288   0,0,/* r16 r17 */\
289   0,0,/* r18 r19 */\
290   0,0,/* r20 r21 */\
291   0,0,/* r22 r23 */\
292   0,0,/* r24 r25 */\
293   0,0,/* r26 r27 */\
294   0,0,/* r28 r29 */\
295   0,0,/* r30 r31 */\
296   1,1,/*  STACK */\
297   1,1 /* arg pointer */  }
298 /* An initializer that says which registers are used for fixed
299    purposes all throughout the compiled code and are therefore not
300    available for general allocation.  These would include the stack
301    pointer, the frame pointer (except on machines where that can be
302    used as a general register when no frame pointer is needed), the
303    program counter on machines where that is considered one of the
304    addressable registers, and any other numbered register with a
305    standard use.
306
307    This information is expressed as a sequence of numbers, separated
308    by commas and surrounded by braces.  The Nth number is 1 if
309    register N is fixed, 0 otherwise.
310
311    The table initialized from this macro, and the table initialized by
312    the following one, may be overridden at run time either
313    automatically, by the actions of the macro
314    `CONDITIONAL_REGISTER_USAGE', or by the user with the command
315    options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'.  */
316
317 #define CALL_USED_REGISTERS {                   \
318   1,1,/* r0 r1 */                               \
319     0,0,/* r2 r3 */                             \
320     0,0,/* r4 r5 */                             \
321     0,0,/* r6 r7 */                             \
322     0,0,/* r8 r9 */                             \
323     0,0,/* r10 r11 */                           \
324     0,0,/* r12 r13 */                           \
325     0,0,/* r14 r15 */                           \
326     0,0,/* r16 r17 */                           \
327     1,1,/* r18 r19 */                           \
328     1,1,/* r20 r21 */                           \
329     1,1,/* r22 r23 */                           \
330     1,1,/* r24 r25 */                           \
331     1,1,/* r26 r27 */                           \
332     0,0,/* r28 r29 */                           \
333     1,1,/* r30 r31 */                           \
334     1,1,/*  STACK */                            \
335     1,1 /* arg pointer */  }
336 /* Like `FIXED_REGISTERS' but has 1 for each register that is
337    clobbered (in general) by function calls as well as for fixed
338    registers.  This macro therefore identifies the registers that are
339    not available for general allocation of values that must live
340    across function calls.
341
342    If a register has 0 in `CALL_USED_REGISTERS', the compiler
343    automatically saves it on function entry and restores it on
344    function exit, if the register is used within the function.  */
345
346 #define NON_SAVING_SETJMP 0
347 /* If this macro is defined and has a nonzero value, it means that
348    `setjmp' and related functions fail to save the registers, or that
349    `longjmp' fails to restore them.  To compensate, the compiler
350    avoids putting variables in registers in functions that use
351    `setjmp'.  */
352
353 #define REG_ALLOC_ORDER {                       \
354     24,25,                                      \
355     18,19,                                      \
356     20,21,                                      \
357     22,23,                                      \
358     30,31,                                      \
359     26,27,                                      \
360     28,29,                                      \
361     17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,    \
362     0,1,                                        \
363     32,33,34,35                                 \
364     }
365 /* If defined, an initializer for a vector of integers, containing the
366    numbers of hard registers in the order in which GNU CC should
367    prefer to use them (from most preferred to least).
368
369    If this macro is not defined, registers are used lowest numbered
370    first (all else being equal).
371
372    One use of this macro is on machines where the highest numbered
373    registers must always be saved and the save-multiple-registers
374    instruction supports only sequences of consetionve registers.  On
375    such machines, define `REG_ALLOC_ORDER' to be an initializer that
376    lists the highest numbered allocatable register first. */
377
378 #define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()
379 /* ORDER_REGS_FOR_LOCAL_ALLOC'
380    A C statement (sans semicolon) to choose the order in which to
381    allocate hard registers for pseudo-registers local to a basic
382    block.
383
384    Store the desired register order in the array `reg_alloc_order'.
385    Element 0 should be the register to allocate first; element 1, the
386    next register; and so on.
387
388    The macro body should not assume anything about the contents of
389    `reg_alloc_order' before execution of the macro.
390
391    On most machines, it is not necessary to define this macro.  */
392
393
394 #define HARD_REGNO_NREGS(REGNO, MODE) ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
395
396 /* A C expression for the number of consecutive hard registers,
397    starting at register number REGNO, required to hold a value of mode
398    MODE.
399
400    On a machine where all registers are exactly one word, a suitable
401    definition of this macro is
402
403    #define HARD_REGNO_NREGS(REGNO, MODE)            \
404    ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1)  \
405    / UNITS_PER_WORD))  */
406
407 #define HARD_REGNO_MODE_OK(REGNO, MODE) avr_hard_regno_mode_ok(REGNO, MODE)
408 /* A C expression that is nonzero if it is permissible to store a
409    value of mode MODE in hard register number REGNO (or in several
410    registers starting with that one).  For a machine where all
411    registers are equivalent, a suitable definition is
412
413    #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
414
415    It is not necessary for this macro to check for the numbers of
416    fixed registers, because the allocation mechanism considers them
417    to be always occupied.
418
419    On some machines, double-precision values must be kept in even/odd
420    register pairs.  The way to implement that is to define this macro
421    to reject odd register numbers for such modes.
422
423    The minimum requirement for a mode to be OK in a register is that
424    the `movMODE' instruction pattern support moves between the
425    register and any other hard register for which the mode is OK; and
426    that moving a value into the register and back out not alter it.
427
428    Since the same instruction used to move `SImode' will work for all
429    narrower integer modes, it is not necessary on any machine for
430    `HARD_REGNO_MODE_OK' to distinguish between these modes, provided
431    you define patterns `movhi', etc., to take advantage of this.  This
432    is useful because of the interaction between `HARD_REGNO_MODE_OK'
433    and `MODES_TIEABLE_P'; it is very desirable for all integer modes
434    to be tieable.
435
436    Many machines have special registers for floating point arithmetic.
437    Often people assume that floating point machine modes are allowed
438    only in floating point registers.  This is not true.  Any
439    registers that can hold integers can safely *hold* a floating
440    point machine mode, whether or not floating arithmetic can be done
441    on it in those registers.  Integer move instructions can be used
442    to move the values.
443
444    On some machines, though, the converse is true: fixed-point machine
445    modes may not go in floating registers.  This is true if the
446    floating registers normalize any value stored in them, because
447    storing a non-floating value there would garble it.  In this case,
448    `HARD_REGNO_MODE_OK' should reject fixed-point machine modes in
449    floating registers.  But if the floating registers do not
450    automatically normalize, if you can store any bit pattern in one
451    and retrieve it unchanged without a trap, then any machine mode
452    may go in a floating register, so you can define this macro to say
453    so.
454
455    The primary significance of special floating registers is rather
456    that they are the registers acceptable in floating point arithmetic
457    instructions.  However, this is of no concern to
458    `HARD_REGNO_MODE_OK'.  You handle it by writing the proper
459    constraints for those instructions.
460
461    On some machines, the floating registers are especially slow to
462    access, so that it is better to store a value in a stack frame
463    than in such a register if floating point arithmetic is not being
464    done.  As long as the floating registers are not in class
465    `GENERAL_REGS', they will not be used unless some pattern's
466    constraint asks for one.  */
467
468 #define MODES_TIEABLE_P(MODE1, MODE2) 0
469 /* A C expression that is nonzero if it is desirable to choose
470    register allocation so as to avoid move instructions between a
471    value of mode MODE1 and a value of mode MODE2.
472
473    If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
474    MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1,
475    MODE2)' must be zero.  */
476
477 enum reg_class {
478   NO_REGS,
479   R0_REG,                       /* r0 */
480   POINTER_X_REGS,               /* r26 - r27 */
481   POINTER_Y_REGS,               /* r28 - r29 */
482   POINTER_Z_REGS,               /* r30 - r31 */
483   STACK_REG,                    /* STACK */
484   BASE_POINTER_REGS,            /* r28 - r31 */
485   POINTER_REGS,                 /* r26 - r31 */
486   ADDW_REGS,                    /* r24 - r31 */
487   SIMPLE_LD_REGS,               /* r16 - r23 */
488   LD_REGS,                      /* r16 - r31 */
489   NO_LD_REGS,                   /* r0 - r15 */
490   GENERAL_REGS,                 /* r0 - r31 */
491   ALL_REGS, LIM_REG_CLASSES
492 };
493 /* An enumeral type that must be defined with all the register class
494    names as enumeral values.  `NO_REGS' must be first.  `ALL_REGS'
495    must be the last register class, followed by one more enumeral
496    value, `LIM_REG_CLASSES', which is not a register class but rather
497    tells how many classes there are.
498
499    Each register class has a number, which is the value of casting
500    the class name to type `int'.  The number serves as an index in
501    many of the tables described below.  */
502
503
504 #define N_REG_CLASSES (int)LIM_REG_CLASSES
505 /* The number of distinct register classes, defined as follows:
506
507    #define N_REG_CLASSES (int) LIM_REG_CLASSES  */
508
509 #define REG_CLASS_NAMES {                                       \
510                  "NO_REGS",                                     \
511                    "R0_REG",    /* r0 */                        \
512                    "POINTER_X_REGS", /* r26 - r27 */            \
513                    "POINTER_Y_REGS", /* r28 - r29 */            \
514                    "POINTER_Z_REGS", /* r30 - r31 */            \
515                    "STACK_REG", /* STACK */                     \
516                    "BASE_POINTER_REGS", /* r28 - r31 */         \
517                    "POINTER_REGS", /* r26 - r31 */              \
518                    "ADDW_REGS", /* r24 - r31 */                 \
519                    "SIMPLE_LD_REGS", /* r16 - r23 */            \
520                    "LD_REGS",   /* r16 - r31 */                 \
521                    "NO_LD_REGS", /* r0 - r15 */                 \
522                    "GENERAL_REGS", /* r0 - r31 */               \
523                    "ALL_REGS" }
524 /* An initializer containing the names of the register classes as C
525    string constants.  These names are used in writing some of the
526    debugging dumps.  */
527
528 #define REG_X 26
529 #define REG_Y 28
530 #define REG_Z 30
531 #define REG_W 24
532
533 #define REG_CLASS_CONTENTS {                                            \
534   {0x00000000,0x00000000},      /* NO_REGS */                           \
535   {0x00000001,0x00000000},      /* R0_REG */                            \
536   {3 << REG_X,0x00000000},      /* POINTER_X_REGS, r26 - r27 */         \
537   {3 << REG_Y,0x00000000},      /* POINTER_Y_REGS, r28 - r29 */         \
538   {3 << REG_Z,0x00000000},      /* POINTER_Z_REGS, r30 - r31 */         \
539   {0x00000000,0x00000003},      /* STACK_REG, STACK */                  \
540   {(3 << REG_Y) | (3 << REG_Z),                                         \
541      0x00000000},               /* BASE_POINTER_REGS, r28 - r31 */      \
542   {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z),                          \
543      0x00000000},               /* POINTER_REGS, r26 - r31 */           \
544   {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W),           \
545      0x00000000},               /* ADDW_REGS, r24 - r31 */              \
546   {0x00ff0000,0x00000000},      /* SIMPLE_LD_REGS r16 - r23 */          \
547   {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16),    \
548      0x00000000},       /* LD_REGS, r16 - r31 */                        \
549   {0x0000ffff,0x00000000},      /* NO_LD_REGS  r0 - r15 */              \
550   {0xffffffff,0x00000000},      /* GENERAL_REGS, r0 - r31 */            \
551   {0xffffffff,0x00000003}       /* ALL_REGS */                          \
552 }
553 /* An initializer containing the contents of the register classes, as
554    integers which are bit masks.  The Nth integer specifies the
555    contents of class N.  The way the integer MASK is interpreted is
556    that register R is in the class if `MASK & (1 << R)' is 1.
557
558    When the machine has more than 32 registers, an integer does not
559    suffice.  Then the integers are replaced by sub-initializers,
560    braced groupings containing several integers.  Each
561    sub-initializer must be suitable as an initializer for the type
562    `HARD_REG_SET' which is defined in `hard-reg-set.h'.  */
563
564 #define REGNO_REG_CLASS(R) avr_regno_reg_class(R)
565 /* A C expression whose value is a register class containing hard
566    register REGNO.  In general there is more than one such class;
567    choose a class which is "minimal", meaning that no smaller class
568    also contains the register.  */
569
570 #define BASE_REG_CLASS POINTER_REGS
571 /* A macro whose definition is the name of the class to which a valid
572    base register must belong.  A base register is one used in an
573    address which is the register value plus a displacement.  */
574
575 #define INDEX_REG_CLASS NO_REGS
576 /* A macro whose definition is the name of the class to which a valid
577    index register must belong.  An index register is one used in an
578    address where its value is either multiplied by a scale factor or
579    added to another register (as well as added to a displacement).  */
580
581 #define REG_CLASS_FROM_LETTER(C) avr_reg_class_from_letter(C)
582 /* A C expression which defines the machine-dependent operand
583    constraint letters for register classes.  If CHAR is such a
584    letter, the value should be the register class corresponding to
585    it.  Otherwise, the value should be `NO_REGS'.  The register
586    letter `r', corresponding to class `GENERAL_REGS', will not be
587    passed to this macro; you do not need to handle it.  */
588
589 #define REGNO_OK_FOR_BASE_P(r) (((r) < FIRST_PSEUDO_REGISTER            \
590                                  && ((r) == REG_X                       \
591                                      || (r) == REG_Y                    \
592                                      || (r) == REG_Z                    \
593                                      || (r) == ARG_POINTER_REGNUM))     \
594                                 || (reg_renumber                        \
595                                     && (reg_renumber[r] == REG_X        \
596                                         || reg_renumber[r] == REG_Y     \
597                                         || reg_renumber[r] == REG_Z     \
598                                         || (reg_renumber[r]             \
599                                             == ARG_POINTER_REGNUM))))
600 /* A C expression which is nonzero if register number NUM is suitable
601    for use as a base register in operand addresses.  It may be either
602    a suitable hard register or a pseudo register that has been
603    allocated such a hard register.  */
604
605 /* #define REGNO_MODE_OK_FOR_BASE_P(r, m) regno_mode_ok_for_base_p(r, m)
606    A C expression that is just like `REGNO_OK_FOR_BASE_P', except that
607    that expression may examine the mode of the memory reference in
608    MODE.  You should define this macro if the mode of the memory
609    reference affects whether a register may be used as a base
610    register.  If you define this macro, the compiler will use it
611    instead of `REGNO_OK_FOR_BASE_P'.  */
612
613 #define REGNO_OK_FOR_INDEX_P(NUM) 0
614 /* A C expression which is nonzero if register number NUM is suitable
615    for use as an index register in operand addresses.  It may be
616    either a suitable hard register or a pseudo register that has been
617    allocated such a hard register.
618
619    The difference between an index register and a base register is
620    that the index register may be scaled.  If an address involves the
621    sum of two registers, neither one of them scaled, then either one
622    may be labeled the "base" and the other the "index"; but whichever
623    labeling is used must fit the machine's constraints of which
624    registers may serve in each capacity.  The compiler will try both
625    labelings, looking for one that is valid, and will reload one or
626    both registers only if neither labeling works.  */
627
628 #define PREFERRED_RELOAD_CLASS(X, CLASS) preferred_reload_class(X,CLASS)
629 /* A C expression that places additional restrictions on the register
630    class to use when it is necessary to copy value X into a register
631    in class CLASS.  The value is a register class; perhaps CLASS, or
632    perhaps another, smaller class.  On many machines, the following
633    definition is safe:
634
635    #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
636
637    Sometimes returning a more restrictive class makes better code.
638    For example, on the 68000, when X is an integer constant that is
639    in range for a `moveq' instruction, the value of this macro is
640    always `DATA_REGS' as long as CLASS includes the data registers.
641    Requiring a data register guarantees that a `moveq' will be used.
642
643    If X is a `const_double', by returning `NO_REGS' you can force X
644    into a memory constant.  This is useful on certain machines where
645    immediate floating values cannot be loaded into certain kinds of
646    registers.  */
647 /* `PREFERRED_OUTPUT_RELOAD_CLASS (X, CLASS)'
648    Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of
649    input reloads.  If you don't define this macro, the default is to
650    use CLASS, unchanged.  */
651
652 /* `LIMIT_RELOAD_CLASS (MODE, CLASS)'
653    A C expression that places additional restrictions on the register
654    class to use when it is necessary to be able to hold a value of
655    mode MODE in a reload register for which class CLASS would
656    ordinarily be used.
657
658    Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when
659    there are certain modes that simply can't go in certain reload
660    classes.
661
662    The value is a register class; perhaps CLASS, or perhaps another,
663    smaller class.
664
665    Don't define this macro unless the target machine has limitations
666    which require the macro to do something nontrivial.  */
667
668 /* SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X)
669    `SECONDARY_RELOAD_CLASS (CLASS, MODE, X)'
670    `SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)'
671    Many machines have some registers that cannot be copied directly
672    to or from memory or even from other types of registers.  An
673    example is the `MQ' register, which on most machines, can only be
674    copied to or from general registers, but not memory.  Some
675    machines allow copying all registers to and from memory, but
676    require a scratch register for stores to some memory locations
677    (e.g., those with symbolic address on the RT, and those with
678    certain symbolic address on the SPARC when compiling PIC).  In
679    some cases, both an intermediate and a scratch register are
680    required.
681
682    You should define these macros to indicate to the reload phase
683    that it may need to allocate at least one register for a reload in
684    addition to the register to contain the data.  Specifically, if
685    copying X to a register CLASS in MODE requires an intermediate
686    register, you should define `SECONDARY_INPUT_RELOAD_CLASS' to
687    return the largest register class all of whose registers can be
688    used as intermediate registers or scratch registers.
689
690    If copying a register CLASS in MODE to X requires an intermediate
691    or scratch register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be
692    defined to return the largest register class required.  If the
693    requirements for input and output reloads are the same, the macro
694    `SECONDARY_RELOAD_CLASS' should be used instead of defining both
695    macros identically.
696
697    The values returned by these macros are often `GENERAL_REGS'.
698    Return `NO_REGS' if no spare register is needed; i.e., if X can be
699    directly copied to or from a register of CLASS in MODE without
700    requiring a scratch register.  Do not define this macro if it
701    would always return `NO_REGS'.
702
703    If a scratch register is required (either with or without an
704    intermediate register), you should define patterns for
705    `reload_inM' or `reload_outM', as required (*note Standard
706    Names::..  These patterns, which will normally be implemented with
707    a `define_expand', should be similar to the `movM' patterns,
708    except that operand 2 is the scratch register.
709
710    Define constraints for the reload register and scratch register
711    that contain a single register class.  If the original reload
712    register (whose class is CLASS) can meet the constraint given in
713    the pattern, the value returned by these macros is used for the
714    class of the scratch register.  Otherwise, two additional reload
715    registers are required.  Their classes are obtained from the
716    constraints in the insn pattern.
717
718    X might be a pseudo-register or a `subreg' of a pseudo-register,
719    which could either be in a hard register or in memory.  Use
720    `true_regnum' to find out; it will return -1 if the pseudo is in
721    memory and the hard register number if it is in a register.
722
723    These macros should not be used in the case where a particular
724    class of registers can only be copied to memory and not to another
725    class of registers.  In that case, secondary reload registers are
726    not needed and would not be helpful.  Instead, a stack location
727    must be used to perform the copy and the `movM' pattern should use
728    memory as an intermediate storage.  This case often occurs between
729    floating-point and general registers.  */
730
731 /* `SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)'
732    Certain machines have the property that some registers cannot be
733    copied to some other registers without using memory.  Define this
734    macro on those machines to be a C expression that is nonzero if
735    objects of mode M in registers of CLASS1 can only be copied to
736    registers of class CLASS2 by storing a register of CLASS1 into
737    memory and loading that memory location into a register of CLASS2.
738
739    Do not define this macro if its value would always be zero.
740
741    `SECONDARY_MEMORY_NEEDED_RTX (MODE)'
742    Normally when `SECONDARY_MEMORY_NEEDED' is defined, the compiler
743    allocates a stack slot for a memory location needed for register
744    copies.  If this macro is defined, the compiler instead uses the
745    memory location defined by this macro.
746
747    Do not define this macro if you do not define
748    `SECONDARY_MEMORY_NEEDED'.  */
749
750 #define SMALL_REGISTER_CLASSES 1
751 /* Normally the compiler avoids choosing registers that have been
752    explicitly mentioned in the rtl as spill registers (these
753    registers are normally those used to pass parameters and return
754    values).  However, some machines have so few registers of certain
755    classes that there would not be enough registers to use as spill
756    registers if this were done.
757
758    Define `SMALL_REGISTER_CLASSES' to be an expression with a nonzero
759    value on these machines.  When this macro has a nonzero value, the
760    compiler allows registers explicitly used in the rtl to be used as
761    spill registers but avoids extending the lifetime of these
762    registers.
763
764    It is always safe to define this macro with a nonzero value, but
765    if you unnecessarily define it, you will reduce the amount of
766    optimizations that can be performed in some cases.  If you do not
767    define this macro with a nonzero value when it is required, the
768    compiler will run out of spill registers and print a fatal error
769    message.  For most machines, you should not define this macro at
770    all.  */
771
772 #define CLASS_LIKELY_SPILLED_P(c) class_likely_spilled_p(c)
773 /* A C expression whose value is nonzero if pseudos that have been
774    assigned to registers of class CLASS would likely be spilled
775    because registers of CLASS are needed for spill registers.
776
777    The default value of this macro returns 1 if CLASS has exactly one
778    register and zero otherwise.  On most machines, this default
779    should be used.  Only define this macro to some other expression
780    if pseudo allocated by `local-alloc.c' end up in memory because
781    their hard registers were needed for spill registers.  If this
782    macro returns nonzero for those classes, those pseudos will only
783    be allocated by `global.c', which knows how to reallocate the
784    pseudo to another register.  If there would not be another
785    register available for reallocation, you should not change the
786    definition of this macro since the only effect of such a
787    definition would be to slow down register allocation.  */
788
789 #define CLASS_MAX_NREGS(CLASS, MODE)   class_max_nregs (CLASS, MODE)
790 /* A C expression for the maximum number of consecutive registers of
791    class CLASS needed to hold a value of mode MODE.
792
793    This is closely related to the macro `HARD_REGNO_NREGS'.  In fact,
794    the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be
795    the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all
796    REGNO values in the class CLASS.
797
798    This macro helps control the handling of multiple-word values in
799    the reload pass.  */
800
801 #define CONST_OK_FOR_LETTER_P(VALUE, C)                         \
802   ((C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 63 :                 \
803    (C) == 'J' ? (VALUE) <= 0 && (VALUE) >= -63:                 \
804    (C) == 'K' ? (VALUE) == 2 :                                  \
805    (C) == 'L' ? (VALUE) == 0 :                                  \
806    (C) == 'M' ? (VALUE) >= 0 && (VALUE) <= 0xff :               \
807    (C) == 'N' ? (VALUE) == -1:                                  \
808    (C) == 'O' ? (VALUE) == 8 || (VALUE) == 16 || (VALUE) == 24: \
809    (C) == 'P' ? (VALUE) == 1 :                                  \
810    0)
811
812 /* A C expression that defines the machine-dependent operand
813    constraint letters (`I', `J', `K', ... `P') that specify
814    particular ranges of integer values.  If C is one of those
815    letters, the expression should check that VALUE, an integer, is in
816    the appropriate range and return 1 if so, 0 otherwise.  If C is
817    not one of those letters, the value should be 0 regardless of
818    VALUE.  */
819
820 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
821   ((C) == 'G' ? (VALUE) == CONST0_RTX (SFmode)  \
822    : 0)
823 /* `CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)'
824    A C expression that defines the machine-dependent operand
825    constraint letters that specify particular ranges of
826    `const_double' values (`G' or `H').
827
828    If C is one of those letters, the expression should check that
829    VALUE, an RTX of code `const_double', is in the appropriate range
830    and return 1 if so, 0 otherwise.  If C is not one of those
831    letters, the value should be 0 regardless of VALUE.
832
833    `const_double' is used for all floating-point constants and for
834    `DImode' fixed-point constants.  A given letter can accept either
835    or both kinds of values.  It can use `GET_MODE' to distinguish
836    between these kinds.  */
837
838 #define EXTRA_CONSTRAINT(x, c) extra_constraint(x, c)
839 /* A C expression that defines the optional machine-dependent
840    constraint letters (``Q', `R', `S', `T', `U') that can'
841    be used to segregate specific types of operands, usually memory
842    references, for the target machine.  Normally this macro will not
843    be defined.  If it is required for a particular target machine, it
844    should return 1 if VALUE corresponds to the operand type
845    represented by the constraint letter C.  If C is not defined as an
846    extra constraint, the value returned should be 0 regardless of
847    VALUE.
848
849    For example, on the ROMP, load instructions cannot have their
850    output in r0 if the memory reference contains a symbolic address.
851    Constraint letter `Q' is defined as representing a memory address
852    that does *not* contain a symbolic address.  An alternative is
853    specified with a `Q' constraint on the input and `r' on the
854    output.  The next alternative specifies `m' on the input and a
855    register class that does not include r0 on the output.  */
856
857 /*  This is an undocumented variable which describes
858     how GCC will push a data */
859 #define STACK_PUSH_CODE POST_DEC
860
861 #define STACK_GROWS_DOWNWARD
862 /* Define this macro if pushing a word onto the stack moves the stack
863    pointer to a smaller address.
864
865    When we say, "define this macro if ...," it means that the
866    compiler checks this macro only with `#ifdef' so the precise
867    definition used does not matter.  */
868
869 #define STARTING_FRAME_OFFSET 1
870 /* Offset from the frame pointer to the first local variable slot to
871    be allocated.
872
873    If `FRAME_GROWS_DOWNWARD', find the next slot's offset by
874    subtracting the first slot's length from `STARTING_FRAME_OFFSET'.
875    Otherwise, it is found by adding the length of the first slot to
876    the value `STARTING_FRAME_OFFSET'.  */
877
878 #define STACK_POINTER_OFFSET 1
879 /* Offset from the stack pointer register to the first location at
880    which outgoing arguments are placed.  If not specified, the
881    default value of zero is used.  This is the proper value for most
882    machines.
883
884    If `ARGS_GROW_DOWNWARD', this is the offset to the location above
885    the first location at which outgoing arguments are placed.  */
886
887 #define FIRST_PARM_OFFSET(FUNDECL) 0
888 /* Offset from the argument pointer register to the first argument's
889    address.  On some machines it may depend on the data type of the
890    function.
891
892    If `ARGS_GROW_DOWNWARD', this is the offset to the location above
893    the first argument's address.  */
894
895 /* `STACK_DYNAMIC_OFFSET (FUNDECL)'
896    Offset from the stack pointer register to an item dynamically
897    allocated on the stack, e.g., by `alloca'.
898
899    The default value for this macro is `STACK_POINTER_OFFSET' plus the
900    length of the outgoing arguments.  The default is correct for most
901    machines.  See `function.c' for details.  */
902
903 #define STACK_BOUNDARY 8
904 /* Define this macro if there is a guaranteed alignment for the stack
905    pointer on this machine.  The definition is a C expression for the
906    desired alignment (measured in bits).  This value is used as a
907    default if PREFERRED_STACK_BOUNDARY is not defined.  */
908
909 #define STACK_POINTER_REGNUM 32
910 /* The register number of the stack pointer register, which must also
911    be a fixed register according to `FIXED_REGISTERS'.  On most
912    machines, the hardware determines which register this is.  */
913
914 #define FRAME_POINTER_REGNUM REG_Y
915 /* The register number of the frame pointer register, which is used to
916    access automatic variables in the stack frame.  On some machines,
917    the hardware determines which register this is.  On other
918    machines, you can choose any register you wish for this purpose.  */
919
920 #define ARG_POINTER_REGNUM 34
921 /* The register number of the arg pointer register, which is used to
922    access the function's argument list.  On some machines, this is
923    the same as the frame pointer register.  On some machines, the
924    hardware determines which register this is.  On other machines,
925    you can choose any register you wish for this purpose.  If this is
926    not the same register as the frame pointer register, then you must
927    mark it as a fixed register according to `FIXED_REGISTERS', or
928    arrange to be able to eliminate it (*note Elimination::.).  */
929
930 #define STATIC_CHAIN_REGNUM 2
931 /* Register numbers used for passing a function's static chain
932    pointer.  If register windows are used, the register number as
933    seen by the called function is `STATIC_CHAIN_INCOMING_REGNUM',
934    while the register number as seen by the calling function is
935    `STATIC_CHAIN_REGNUM'.  If these registers are the same,
936    `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
937
938    The static chain register need not be a fixed register.
939
940    If the static chain is passed in memory, these macros should not be
941    defined; instead, the next two macros should be defined.  */
942
943 #define FRAME_POINTER_REQUIRED frame_pointer_required_p()
944 /* A C expression which is nonzero if a function must have and use a
945    frame pointer.  This expression is evaluated  in the reload pass.
946    If its value is nonzero the function will have a frame pointer.
947
948    The expression can in principle examine the current function and
949    decide according to the facts, but on most machines the constant 0
950    or the constant 1 suffices.  Use 0 when the machine allows code to
951    be generated with no frame pointer, and doing so saves some time
952    or space.  Use 1 when there is no possible advantage to avoiding a
953    frame pointer.
954
955    In certain cases, the compiler does not know how to produce valid
956    code without a frame pointer.  The compiler recognizes those cases
957    and automatically gives the function a frame pointer regardless of
958    what `FRAME_POINTER_REQUIRED' says.  You don't need to worry about
959    them.
960
961    In a function that does not require a frame pointer, the frame
962    pointer register can be allocated for ordinary usage, unless you
963    mark it as a fixed register.  See `FIXED_REGISTERS' for more
964    information.  */
965
966 #define ELIMINABLE_REGS {                                       \
967       {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM},               \
968         {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}            \
969        ,{FRAME_POINTER_REGNUM+1,STACK_POINTER_REGNUM+1}}
970 /* If defined, this macro specifies a table of register pairs used to
971    eliminate unneeded registers that point into the stack frame.  If
972    it is not defined, the only elimination attempted by the compiler
973    is to replace references to the frame pointer with references to
974    the stack pointer.
975
976    The definition of this macro is a list of structure
977    initializations, each of which specifies an original and
978    replacement register.
979
980    On some machines, the position of the argument pointer is not
981    known until the compilation is completed.  In such a case, a
982    separate hard register must be used for the argument pointer.
983    This register can be eliminated by replacing it with either the
984    frame pointer or the argument pointer, depending on whether or not
985    the frame pointer has been eliminated.
986
987    In this case, you might specify:
988    #define ELIMINABLE_REGS  \
989    {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
990    {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
991    {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
992
993    Note that the elimination of the argument pointer with the stack
994    pointer is specified first since that is the preferred elimination.  */
995
996 #define CAN_ELIMINATE(FROM, TO) (((FROM) == ARG_POINTER_REGNUM             \
997                                   && (TO) == FRAME_POINTER_REGNUM)         \
998                                  || (((FROM) == FRAME_POINTER_REGNUM       \
999                                       || (FROM) == FRAME_POINTER_REGNUM+1) \
1000                                      && ! FRAME_POINTER_REQUIRED           \
1001                                      ))
1002 /* A C expression that returns nonzero if the compiler is allowed to
1003    try to replace register number FROM-REG with register number
1004    TO-REG.  This macro need only be defined if `ELIMINABLE_REGS' is
1005    defined, and will usually be the constant 1, since most of the
1006    cases preventing register elimination are things that the compiler
1007    already knows about.  */
1008
1009 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET)                    \
1010      OFFSET = initial_elimination_offset (FROM, TO)
1011 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'.  It
1012    specifies the initial difference between the specified pair of
1013    registers.  This macro must be defined if `ELIMINABLE_REGS' is
1014    defined.  */
1015
1016 #define RETURN_ADDR_RTX(count, x) \
1017   gen_rtx_MEM (Pmode, memory_address (Pmode, plus_constant (tem, 1)))
1018
1019 #define PUSH_ROUNDING(NPUSHED) (NPUSHED)
1020 /* A C expression that is the number of bytes actually pushed onto the
1021    stack when an instruction attempts to push NPUSHED bytes.
1022
1023    If the target machine does not have a push instruction, do not
1024    define this macro.  That directs GNU CC to use an alternate
1025    strategy: to allocate the entire argument block and then store the
1026    arguments into it.
1027
1028    On some machines, the definition
1029
1030    #define PUSH_ROUNDING(BYTES) (BYTES)
1031
1032    will suffice.  But on other machines, instructions that appear to
1033    push one byte actually push two bytes in an attempt to maintain
1034    alignment.  Then the definition should be
1035
1036    #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)  */
1037
1038 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
1039 /* A C expression that should indicate the number of bytes of its own
1040    arguments that a function pops on returning, or 0 if the function
1041    pops no arguments and the caller must therefore pop them all after
1042    the function returns.
1043
1044    FUNDECL is a C variable whose value is a tree node that describes
1045    the function in question.  Normally it is a node of type
1046    `FUNCTION_DECL' that describes the declaration of the function.
1047    From this you can obtain the DECL_ATTRIBUTES of the
1048    function.
1049
1050    FUNTYPE is a C variable whose value is a tree node that describes
1051    the function in question.  Normally it is a node of type
1052    `FUNCTION_TYPE' that describes the data type of the function.
1053    From this it is possible to obtain the data types of the value and
1054    arguments (if known).
1055
1056    When a call to a library function is being considered, FUNDECL
1057    will contain an identifier node for the library function.  Thus, if
1058    you need to distinguish among various library functions, you can
1059    do so by their names.  Note that "library function" in this
1060    context means a function used to perform arithmetic, whose name is
1061    known specially in the compiler and was not mentioned in the C
1062    code being compiled.
1063
1064    STACK-SIZE is the number of bytes of arguments passed on the
1065    stack.  If a variable number of bytes is passed, it is zero, and
1066    argument popping will always be the responsibility of the calling
1067    function.
1068
1069    On the VAX, all functions always pop their arguments, so the
1070    definition of this macro is STACK-SIZE.  On the 68000, using the
1071    standard calling convention, no functions pop their arguments, so
1072    the value of the macro is always 0 in this case.  But an
1073    alternative calling convention is available in which functions
1074    that take a fixed number of arguments pop them but other functions
1075    (such as `printf') pop nothing (the caller pops all).  When this
1076    convention is in use, FUNTYPE is examined to determine whether a
1077    function takes a fixed number of arguments.  */
1078
1079 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) (function_arg (&(CUM), MODE, TYPE, NAMED))
1080 /* A C expression that controls whether a function argument is passed
1081    in a register, and which register.
1082
1083    The arguments are CUM, which summarizes all the previous
1084    arguments; MODE, the machine mode of the argument; TYPE, the data
1085    type of the argument as a tree node or 0 if that is not known
1086    (which happens for C support library functions); and NAMED, which
1087    is 1 for an ordinary argument and 0 for nameless arguments that
1088    correspond to `...' in the called function's prototype.
1089
1090    The value of the expression is usually either a `reg' RTX for the
1091    hard register in which to pass the argument, or zero to pass the
1092    argument on the stack.
1093
1094    For machines like the VAX and 68000, where normally all arguments
1095    are pushed, zero suffices as a definition.
1096
1097    The value of the expression can also be a `parallel' RTX.  This is
1098    used when an argument is passed in multiple locations.  The mode
1099    of the of the `parallel' should be the mode of the entire
1100    argument.  The `parallel' holds any number of `expr_list' pairs;
1101    each one describes where part of the argument is passed.  In each
1102    `expr_list', the first operand can be either a `reg' RTX for the
1103    hard register in which to pass this part of the argument, or zero
1104    to pass the argument on the stack.  If this operand is a `reg',
1105    then the mode indicates how large this part of the argument is.
1106    The second operand of the `expr_list' is a `const_int' which gives
1107    the offset in bytes into the entire argument where this part
1108    starts.
1109
1110    The usual way to make the ANSI library `stdarg.h' work on a machine
1111    where some arguments are usually passed in registers, is to cause
1112    nameless arguments to be passed on the stack instead.  This is done
1113    by making `FUNCTION_ARG' return 0 whenever NAMED is 0.
1114
1115    You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the
1116    definition of this macro to determine if this argument is of a
1117    type that must be passed in the stack.  If `REG_PARM_STACK_SPACE'
1118    is not defined and `FUNCTION_ARG' returns nonzero for such an
1119    argument, the compiler will abort.  If `REG_PARM_STACK_SPACE' is
1120    defined, the argument will be computed in the stack and then
1121    loaded into a register.  */
1122
1123 typedef struct avr_args {
1124   int nregs;                    /* # registers available for passing */
1125   int regno;                    /* next available register number */
1126 } CUMULATIVE_ARGS;
1127 /* A C type for declaring a variable that is used as the first
1128    argument of `FUNCTION_ARG' and other related values.  For some
1129    target machines, the type `int' suffices and can hold the number
1130    of bytes of argument so far.
1131
1132    There is no need to record in `CUMULATIVE_ARGS' anything about the
1133    arguments that have been passed on the stack.  The compiler has
1134    other variables to keep track of that.  For target machines on
1135    which all arguments are passed on the stack, there is no need to
1136    store anything in `CUMULATIVE_ARGS'; however, the data structure
1137    must exist and should not be empty, so use `int'.  */
1138
1139 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) init_cumulative_args (&(CUM), FNTYPE, LIBNAME, INDIRECT)
1140
1141 /* A C statement (sans semicolon) for initializing the variable CUM
1142    for the state at the beginning of the argument list.  The variable
1143    has type `CUMULATIVE_ARGS'.  The value of FNTYPE is the tree node
1144    for the data type of the function which will receive the args, or 0
1145    if the args are to a compiler support library function.  The value
1146    of INDIRECT is nonzero when processing an indirect call, for
1147    example a call through a function pointer.  The value of INDIRECT
1148    is zero for a call to an explicitly named function, a library
1149    function call, or when `INIT_CUMULATIVE_ARGS' is used to find
1150    arguments for the function being compiled.
1151
1152    When processing a call to a compiler support library function,
1153    LIBNAME identifies which one.  It is a `symbol_ref' rtx which
1154    contains the name of the function, as a string.  LIBNAME is 0 when
1155    an ordinary C function call is being processed.  Thus, each time
1156    this macro is called, either LIBNAME or FNTYPE is nonzero, but
1157    never both of them at once.   */
1158
1159 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)    \
1160   (function_arg_advance (&CUM, MODE, TYPE, NAMED))
1161
1162 /* A C statement (sans semicolon) to update the summarizer variable
1163    CUM to advance past an argument in the argument list.  The values
1164    MODE, TYPE and NAMED describe that argument.  Once this is done,
1165    the variable CUM is suitable for analyzing the *following*
1166    argument with `FUNCTION_ARG', etc.
1167
1168    This macro need not do anything if the argument in question was
1169    passed on the stack.  The compiler knows how to track the amount
1170    of stack space used for arguments without any special help. */
1171
1172 #define FUNCTION_ARG_REGNO_P(r) function_arg_regno_p(r)
1173 /* A C expression that is nonzero if REGNO is the number of a hard
1174    register in which function arguments are sometimes passed.  This
1175    does *not* include implicit arguments such as the static chain and
1176    the structure-value address.  On many machines, no registers can be
1177    used for this purpose since all function arguments are pushed on
1178    the stack.  */
1179
1180 extern int avr_reg_order[];
1181
1182 #define RET_REGISTER avr_ret_register ()
1183
1184 #define FUNCTION_VALUE(VALTYPE, FUNC) avr_function_value (VALTYPE, FUNC)
1185 /* A C expression to create an RTX representing the place where a
1186    function returns a value of data type VALTYPE.  VALTYPE is a tree
1187    node representing a data type.  Write `TYPE_MODE (VALTYPE)' to get
1188    the machine mode used to represent that type.  On many machines,
1189    only the mode is relevant.  (Actually, on most machines, scalar
1190    values are returned in the same place regardless of mode).
1191
1192    The value of the expression is usually a `reg' RTX for the hard
1193    register where the return value is stored.  The value can also be a
1194    `parallel' RTX, if the return value is in multiple places.  See
1195    `FUNCTION_ARG' for an explanation of the `parallel' form.
1196
1197    If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same
1198    promotion rules specified in `PROMOTE_MODE' if VALTYPE is a scalar
1199    type.
1200
1201    If the precise function being called is known, FUNC is a tree node
1202    (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer.  This
1203    makes it possible to use a different value-returning convention
1204    for specific functions when all their calls are known.
1205
1206    `FUNCTION_VALUE' is not used for return vales with aggregate data
1207    types, because these are returned in another way.  See
1208    `STRUCT_VALUE_REGNUM' and related macros, below.  */
1209
1210 #define LIBCALL_VALUE(MODE)  avr_libcall_value (MODE)
1211 /* A C expression to create an RTX representing the place where a
1212    library function returns a value of mode MODE.  If the precise
1213    function being called is known, FUNC is a tree node
1214    (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer.  This
1215    makes it possible to use a different value-returning convention
1216    for specific functions when all their calls are known.
1217
1218    Note that "library function" in this context means a compiler
1219    support routine, used to perform arithmetic, whose name is known
1220    specially by the compiler and was not mentioned in the C code being
1221    compiled.
1222
1223    The definition of `LIBRARY_VALUE' need not be concerned aggregate
1224    data types, because none of the library functions returns such
1225    types.  */
1226
1227 #define FUNCTION_VALUE_REGNO_P(N) ((N) == RET_REGISTER)
1228 /* A C expression that is nonzero if REGNO is the number of a hard
1229    register in which the values of called function may come back.
1230
1231    A register whose use for returning values is limited to serving as
1232    the second of a pair (for a value of type `double', say) need not
1233    be recognized by this macro.  So for most machines, this definition
1234    suffices:
1235
1236    #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
1237
1238    If the machine has register windows, so that the caller and the
1239    called function use different registers for the return value, this
1240    macro should recognize only the caller's register numbers.  */
1241
1242 #define RETURN_IN_MEMORY(TYPE) ((TYPE_MODE (TYPE) == BLKmode)   \
1243                                 ? int_size_in_bytes (TYPE) > 8  \
1244                                 : 0)
1245 /* A C expression which can inhibit the returning of certain function
1246    values in registers, based on the type of value.  A nonzero value
1247    says to return the function value in memory, just as large
1248    structures are always returned.  Here TYPE will be a C expression
1249    of type `tree', representing the data type of the value.
1250
1251    Note that values of mode `BLKmode' must be explicitly handled by
1252    this macro.  Also, the option `-fpcc-struct-return' takes effect
1253    regardless of this macro.  On most systems, it is possible to
1254    leave the macro undefined; this causes a default definition to be
1255    used, whose value is the constant 1 for `BLKmode' values, and 0
1256    otherwise.
1257
1258    Do not use this macro to indicate that structures and unions
1259    should always be returned in memory.  You should instead use
1260    `DEFAULT_PCC_STRUCT_RETURN' to indicate this.  */
1261
1262 #define DEFAULT_PCC_STRUCT_RETURN 0
1263 /* Define this macro to be 1 if all structure and union return values
1264    must be in memory.  Since this results in slower code, this should
1265    be defined only if needed for compatibility with other compilers
1266    or with an ABI.  If you define this macro to be 0, then the
1267    conventions used for structure and union return values are decided
1268    by the `RETURN_IN_MEMORY' macro.
1269
1270    If not defined, this defaults to the value 1.  */
1271
1272 #define STRUCT_VALUE 0
1273 /* If the structure value address is not passed in a register, define
1274    `STRUCT_VALUE' as an expression returning an RTX for the place
1275    where the address is passed.  If it returns 0, the address is
1276    passed as an "invisible" first argument.  */
1277
1278 #define STRUCT_VALUE_INCOMING 0
1279 /* If the incoming location is not a register, then you should define
1280    `STRUCT_VALUE_INCOMING' as an expression for an RTX for where the
1281    called function should find the value.  If it should find the
1282    value on the stack, define this to create a `mem' which refers to
1283    the frame pointer.  A definition of 0 means that the address is
1284    passed as an "invisible" first argument.  */
1285
1286 #define EPILOGUE_USES(REGNO) 0
1287 /* Define this macro as a C expression that is nonzero for registers
1288    are used by the epilogue or the `return' pattern.  The stack and
1289    frame pointer registers are already be assumed to be used as
1290    needed.  */
1291
1292 #define STRICT_ARGUMENT_NAMING 1
1293 /* Define this macro if the location where a function argument is
1294    passed depends on whether or not it is a named argument.
1295
1296    This macro controls how the NAMED argument to `FUNCTION_ARG' is
1297    set for varargs and stdarg functions.  With this macro defined,
1298    the NAMED argument is always true for named arguments, and false
1299    for unnamed arguments.  If this is not defined, but
1300    `SETUP_INCOMING_VARARGS' is defined, then all arguments are
1301    treated as named.  Otherwise, all named arguments except the last
1302    are treated as named.  */
1303
1304
1305 #define HAVE_POST_INCREMENT 1
1306 /* Define this macro if the machine supports post-increment
1307    addressing.  */
1308
1309 #define HAVE_PRE_DECREMENT 1
1310 /* Similar for other kinds of addressing.  */
1311
1312 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
1313 /* A C expression that is 1 if the RTX X is a constant which is a
1314    valid address.  On most machines, this can be defined as
1315    `CONSTANT_P (X)', but a few machines are more restrictive in which
1316    constant addresses are supported.
1317
1318    `CONSTANT_P' accepts integer-values expressions whose values are
1319    not explicitly known, such as `symbol_ref', `label_ref', and
1320    `high' expressions and `const' arithmetic expressions, in addition
1321    to `const_int' and `const_double' expressions.  */
1322
1323 #define MAX_REGS_PER_ADDRESS 1
1324 /* A number, the maximum number of registers that can appear in a
1325    valid memory address.  Note that it is up to you to specify a
1326    value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS'
1327    would ever accept.  */
1328
1329 #ifdef REG_OK_STRICT
1330 #  define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \
1331 {                                                       \
1332   if (legitimate_address_p (mode, operand, 1))          \
1333     goto ADDR;                                          \
1334 }
1335 #  else
1336 #  define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \
1337 {                                                       \
1338   if (legitimate_address_p (mode, operand, 0))          \
1339     goto ADDR;                                          \
1340 }
1341 #endif
1342 /* A C compound statement with a conditional `goto LABEL;' executed
1343    if X (an RTX) is a legitimate memory address on the target machine
1344    for a memory operand of mode MODE.  */
1345
1346 /* `REG_OK_FOR_BASE_P (X)'
1347    A C expression that is nonzero if X (assumed to be a `reg' RTX) is
1348    valid for use as a base register.  For hard registers, it should
1349    always accept those which the hardware permits and reject the
1350    others.  Whether the macro accepts or rejects pseudo registers
1351    must be controlled by `REG_OK_STRICT' as described above.  This
1352    usually requires two variant definitions, of which `REG_OK_STRICT'
1353    controls the one actually used.  */
1354
1355 #define REG_OK_FOR_BASE_NOSTRICT_P(X) \
1356   (REGNO (X) >= FIRST_PSEUDO_REGISTER || REG_OK_FOR_BASE_STRICT_P(X))
1357
1358 #define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
1359
1360 #ifdef REG_OK_STRICT
1361 #  define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X)
1362 #else
1363 #  define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NOSTRICT_P (X)
1364 #endif
1365
1366 /* A C expression that is just like `REG_OK_FOR_BASE_P', except that
1367    that expression may examine the mode of the memory reference in
1368    MODE.  You should define this macro if the mode of the memory
1369    reference affects whether a register may be used as a base
1370    register.  If you define this macro, the compiler will use it
1371    instead of `REG_OK_FOR_BASE_P'.  */
1372 #define REG_OK_FOR_INDEX_P(X) 0
1373 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is
1374    valid for use as an index register.
1375
1376    The difference between an index register and a base register is
1377    that the index register may be scaled.  If an address involves the
1378    sum of two registers, neither one of them scaled, then either one
1379    may be labeled the "base" and the other the "index"; but whichever
1380    labeling is used must fit the machine's constraints of which
1381    registers may serve in each capacity.  The compiler will try both
1382    labelings, looking for one that is valid, and will reload one or
1383    both registers only if neither labeling works.  */
1384
1385 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)                          \
1386 {                                                                       \
1387   (X) = legitimize_address (X, OLDX, MODE);                             \
1388   if (memory_address_p (MODE, X))                                       \
1389     goto WIN;                                                           \
1390 }
1391 /* A C compound statement that attempts to replace X with a valid
1392    memory address for an operand of mode MODE.  WIN will be a C
1393    statement label elsewhere in the code; the macro definition may use
1394
1395    GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
1396
1397    to avoid further processing if the address has become legitimate.
1398
1399    X will always be the result of a call to `break_out_memory_refs',
1400    and OLDX will be the operand that was given to that function to
1401    produce X.
1402
1403    The code generated by this macro should not alter the substructure
1404    of X.  If it transforms X into a more legitimate form, it should
1405    assign X (which will always be a C variable) a new value.
1406
1407    It is not necessary for this macro to come up with a legitimate
1408    address.  The compiler has standard ways of doing so in all cases.
1409    In fact, it is safe for this macro to do nothing.  But often a
1410    machine-dependent strategy can generate better code.  */
1411
1412 #define XEXP_(X,Y) (X)
1413 #define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN)    \
1414 do {                                                                        \
1415   if (1&&(GET_CODE (X) == POST_INC || GET_CODE (X) == PRE_DEC))     \
1416     {                                                                       \
1417       push_reload (XEXP (X,0), XEXP (X,0), &XEXP (X,0), &XEXP (X,0),        \
1418                    POINTER_REGS, GET_MODE (X),GET_MODE (X) , 0, 0,          \
1419                    OPNUM, RELOAD_OTHER);                                    \
1420       goto WIN;                                                             \
1421     }                                                                       \
1422   if (GET_CODE (X) == PLUS                                                  \
1423       && REG_P (XEXP (X, 0))                                                \
1424       && GET_CODE (XEXP (X, 1)) == CONST_INT                                \
1425       && INTVAL (XEXP (X, 1)) >= 1)                                         \
1426     {                                                                       \
1427       int fit = INTVAL (XEXP (X, 1)) <= (64 - GET_MODE_SIZE (MODE));        \
1428       if (fit)                                                              \
1429         {                                                                   \
1430           if (reg_equiv_address[REGNO (XEXP (X, 0))] != 0)                  \
1431             {                                                               \
1432               int regno = REGNO (XEXP (X, 0));                              \
1433               rtx mem = make_memloc (X, regno);                             \
1434               push_reload (XEXP (mem,0), NULL, &XEXP (mem,0), NULL,         \
1435                            POINTER_REGS, Pmode, VOIDmode, 0, 0,             \
1436                            1, ADDR_TYPE (TYPE));                            \
1437               push_reload (mem, NULL_RTX, &XEXP (X, 0), NULL,               \
1438                            BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \
1439                            OPNUM, TYPE);                                    \
1440               goto WIN;                                                     \
1441             }                                                               \
1442           push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL,           \
1443                        BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0,     \
1444                        OPNUM, TYPE);                                        \
1445           goto WIN;                                                         \
1446         }                                                                   \
1447       else if (! (frame_pointer_needed && XEXP (X,0) == frame_pointer_rtx)) \
1448         {                                                                   \
1449           push_reload (X, NULL_RTX, &X, NULL,                               \
1450                        POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0,          \
1451                        OPNUM, TYPE);                                        \
1452           goto WIN;                                                         \
1453         }                                                                   \
1454     }                                                                       \
1455 } while(0)
1456 /* A C compound statement that attempts to replace X, which is an
1457    address that needs reloading, with a valid memory address for an
1458    operand of mode MODE.  WIN will be a C statement label elsewhere
1459    in the code.  It is not necessary to define this macro, but it
1460    might be useful for performance reasons.
1461
1462    For example, on the i386, it is sometimes possible to use a single
1463    reload register instead of two by reloading a sum of two pseudo
1464    registers into a register.  On the other hand, for number of RISC
1465    processors offsets are limited so that often an intermediate
1466    address needs to be generated in order to address a stack slot.
1467    By defining LEGITIMIZE_RELOAD_ADDRESS appropriately, the
1468    intermediate addresses generated for adjacent some stack slots can
1469    be made identical, and thus be shared.
1470
1471    *Note*: This macro should be used with caution.  It is necessary
1472    to know something of how reload works in order to effectively use
1473    this, and it is quite easy to produce macros that build in too
1474    much knowledge of reload internals.
1475
1476    *Note*: This macro must be able to reload an address created by a
1477    previous invocation of this macro.  If it fails to handle such
1478    addresses then the compiler may generate incorrect code or abort.
1479
1480    The macro definition should use `push_reload' to indicate parts
1481    that need reloading; OPNUM, TYPE and IND_LEVELS are usually
1482    suitable to be passed unaltered to `push_reload'.
1483
1484    The code generated by this macro must not alter the substructure of
1485    X.  If it transforms X into a more legitimate form, it should
1486    assign X (which will always be a C variable) a new value.  This
1487    also applies to parts that you change indirectly by calling
1488    `push_reload'.
1489
1490    The macro definition may use `strict_memory_address_p' to test if
1491    the address has become legitimate.
1492
1493    If you want to change only a part of X, one standard way of doing
1494    this is to use `copy_rtx'.  Note, however, that is unshares only a
1495    single level of rtl.  Thus, if the part to be changed is not at the
1496    top level, you'll need to replace first the top leve It is not
1497    necessary for this macro to come up with a legitimate address;
1498    but often a machine-dependent strategy can generate better code.  */
1499
1500 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)                        \
1501       if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC)    \
1502         goto LABEL
1503 /* A C statement or compound statement with a conditional `goto
1504    LABEL;' executed if memory address X (an RTX) can have different
1505    meanings depending on the machine mode of the memory reference it
1506    is used for or if the address is valid for some modes but not
1507    others.
1508
1509    Autoincrement and autodecrement addresses typically have
1510    mode-dependent effects because the amount of the increment or
1511    decrement is the size of the operand being addressed.  Some
1512    machines have other mode-dependent addresses.  Many RISC machines
1513    have no mode-dependent addresses.
1514
1515    You may assume that ADDR is a valid address for the machine.  */
1516
1517 #define LEGITIMATE_CONSTANT_P(X) 1
1518 /* A C expression that is nonzero if X is a legitimate constant for
1519    an immediate operand on the target machine.  You can assume that X
1520    satisfies `CONSTANT_P', so you need not check this.  In fact, `1'
1521    is a suitable definition for this macro on machines where anything
1522    `CONSTANT_P' is valid.  */
1523
1524 #define CONST_COSTS(x,CODE,OUTER_CODE)          \
1525     case CONST_INT:                             \
1526       if (OUTER_CODE == PLUS                    \
1527           || OUTER_CODE == IOR                  \
1528           || OUTER_CODE == AND                  \
1529           || OUTER_CODE == MINUS                \
1530           || OUTER_CODE == SET                  \
1531           || INTVAL (x) == 0)                   \
1532         return 2;                               \
1533       if (OUTER_CODE == COMPARE                 \
1534           && INTVAL (x) >= 0                    \
1535           && INTVAL (x) <= 255)                 \
1536         return 2;                               \
1537     case CONST:                                 \
1538     case LABEL_REF:                             \
1539     case SYMBOL_REF:                            \
1540       return 4;                                 \
1541     case CONST_DOUBLE:                          \
1542       return 4;
1543
1544 /* A part of a C `switch' statement that describes the relative costs
1545    of constant RTL expressions.  It must contain `case' labels for
1546    expression codes `const_int', `const', `symbol_ref', `label_ref'
1547    and `const_double'.  Each case must ultimately reach a `return'
1548    statement to return the relative cost of the use of that kind of
1549    constant value in an expression.  The cost may depend on the
1550    precise value of the constant, which is available for examination
1551    in X, and the rtx code of the expression in which it is contained,
1552    found in OUTER_CODE.
1553
1554    CODE is the expression code--redundant, since it can be obtained
1555    with `GET_CODE (X)'.  */
1556
1557 #define DEFAULT_RTX_COSTS(x, code, outer_code)          \
1558 {                                                       \
1559   int cst = default_rtx_costs (x, code, outer_code);    \
1560   if (cst>0)                                            \
1561     return cst;                                 \
1562   else if (cst<0)                                       \
1563     total += -cst;                                      \
1564   break;                                                \
1565 }
1566
1567 /* Like `CONST_COSTS' but applies to nonconstant RTL expressions.
1568    This can be used, for example, to indicate how costly a multiply
1569    instruction is.  In writing this macro, you can use the construct
1570    `COSTS_N_INSNS (N)' to specify a cost equal to N fast
1571    instructions.  OUTER_CODE is the code of the expression in which X
1572    is contained.
1573
1574    This macro is optional; do not define it if the default cost
1575    assumptions are adequate for the target machine.  */
1576
1577 #define ADDRESS_COST(ADDRESS) avr_address_cost (ADDRESS)
1578
1579 /* An expression giving the cost of an addressing mode that contains
1580    ADDRESS.  If not defined, the cost is computed from the ADDRESS
1581    expression and the `CONST_COSTS' values.
1582
1583    For most CISC machines, the default cost is a good approximation
1584    of the true cost of the addressing mode.  However, on RISC
1585    machines, all instructions normally have the same length and
1586    execution time.  Hence all addresses will have equal costs.
1587
1588    In cases where more than one form of an address is known, the form
1589    with the lowest cost will be used.  If multiple forms have the
1590    same, lowest, cost, the one that is the most complex will be used.
1591
1592    For example, suppose an address that is equal to the sum of a
1593    register and a constant is used twice in the same basic block.
1594    When this macro is not defined, the address will be computed in a
1595    register and memory references will be indirect through that
1596    register.  On machines where the cost of the addressing mode
1597    containing the sum is no higher than that of a simple indirect
1598    reference, this will produce an additional instruction and
1599    possibly require an additional register.  Proper specification of
1600    this macro eliminates this overhead for such machines.
1601
1602    Similar use of this macro is made in strength reduction of loops.
1603
1604    ADDRESS need not be valid as an address.  In such a case, the cost
1605    is not relevant and can be any value; invalid addresses need not be
1606    assigned a different cost.
1607
1608    On machines where an address involving more than one register is as
1609    cheap as an address computation involving only one register,
1610    defining `ADDRESS_COST' to reflect this can cause two registers to
1611    be live over a region of code where only one would have been if
1612    `ADDRESS_COST' were not defined in that manner.  This effect should
1613    be considered in the definition of this macro.  Equivalent costs
1614    should probably only be given to addresses with different numbers
1615    of registers on machines with lots of registers.
1616
1617    This macro will normally either not be defined or be defined as a
1618    constant.  */
1619
1620 #define REGISTER_MOVE_COST(MODE, FROM, TO) ((FROM) == STACK_REG ? 6 \
1621                                             : (TO) == STACK_REG ? 12 \
1622                                             : 2)
1623 /* A C expression for the cost of moving data from a register in class
1624    FROM to one in class TO.  The classes are expressed using the
1625    enumeration values such as `GENERAL_REGS'.  A value of 2 is the
1626    default; other values are interpreted relative to that.
1627
1628    It is not required that the cost always equal 2 when FROM is the
1629    same as TO; on some machines it is expensive to move between
1630    registers if they are not general registers.
1631
1632    If reload sees an insn consisting of a single `set' between two
1633    hard registers, and if `REGISTER_MOVE_COST' applied to their
1634    classes returns a value of 2, reload does not check to ensure that
1635    the constraints of the insn are met.  Setting a cost of other than
1636    2 will allow reload to verify that the constraints are met.  You
1637    should do this if the `movM' pattern's constraints do not allow
1638    such copying.  */
1639
1640 #define MEMORY_MOVE_COST(MODE,CLASS,IN) ((MODE)==QImode ? 2 :   \
1641                                          (MODE)==HImode ? 4 :   \
1642                                          (MODE)==SImode ? 8 :   \
1643                                          (MODE)==SFmode ? 8 : 16)
1644 /* A C expression for the cost of moving data of mode M between a
1645    register and memory.  A value of 4 is the default; this cost is
1646    relative to those in `REGISTER_MOVE_COST'.
1647
1648    If moving between registers and memory is more expensive than
1649    between two registers, you should define this macro to express the
1650    relative cost.  */
1651
1652 #define BRANCH_COST 0
1653 /* A C expression for the cost of a branch instruction.  A value of 1
1654    is the default; other values are interpreted relative to that.
1655
1656    Here are additional macros which do not specify precise relative
1657    costs, but only that certain actions are more expensive than GCC would
1658    ordinarily expect.  */
1659
1660 #define SLOW_BYTE_ACCESS 0
1661 /* Define this macro as a C expression which is nonzero if accessing
1662    less than a word of memory (i.e. a `char' or a `short') is no
1663    faster than accessing a word of memory, i.e., if such access
1664    require more than one instruction or if there is no difference in
1665    cost between byte and (aligned) word loads.
1666
1667    When this macro is not defined, the compiler will access a field by
1668    finding the smallest containing object; when it is defined, a
1669    fullword load will be used if alignment permits.  Unless bytes
1670    accesses are faster than word accesses, using word accesses is
1671    preferable since it may eliminate subsequent memory access if
1672    subsequent accesses occur to other fields in the same word of the
1673    structure, but to different bytes.
1674
1675    `SLOW_UNALIGNED_ACCESS'
1676    Define this macro to be the value 1 if unaligned accesses have a
1677    cost many times greater than aligned accesses, for example if they
1678    are emulated in a trap handler.
1679
1680    When this macro is nonzero, the compiler will act as if
1681    `STRICT_ALIGNMENT' were nonzero when generating code for block
1682    moves.  This can cause significantly more instructions to be
1683    produced.  Therefore, do not set this macro nonzero if unaligned
1684    accesses only add a cycle or two to the time for a memory access.
1685
1686    If the value of this macro is always zero, it need not be defined.
1687
1688    `DONT_REDUCE_ADDR'
1689    Define this macro to inhibit strength reduction of memory
1690    addresses.  (On some machines, such strength reduction seems to do
1691    harm rather than good.)
1692
1693    `MOVE_RATIO'
1694    The number of scalar move insns which should be generated instead
1695    of a string move insn or a library call.  Increasing the value
1696    will always make code faster, but eventually incurs high cost in
1697    increased code size.
1698
1699    If you don't define this, a reasonable default is used.  */
1700
1701 #define NO_FUNCTION_CSE
1702 /* Define this macro if it is as good or better to call a constant
1703    function address than to call an address kept in a register.  */
1704
1705 #define NO_RECURSIVE_FUNCTION_CSE
1706 /* Define this macro if it is as good or better for a function to call
1707    itself with an explicit address than to call an address kept in a
1708    register.  */
1709
1710 #define TEXT_SECTION_ASM_OP "\t.text"
1711 /* A C expression whose value is a string containing the assembler
1712    operation that should precede instructions and read-only data.
1713    Normally `"\t.text"' is right.  */
1714
1715 #define DATA_SECTION_ASM_OP "\t.data"
1716 /* A C expression whose value is a string containing the assembler
1717    operation to identify the following data as writable initialized
1718    data.  Normally `"\t.data"' is right.  */
1719
1720 #define BSS_SECTION_ASM_OP "\t.section .bss"
1721 /* If defined, a C expression whose value is a string, including
1722    spacing, containing the assembler operation to identify the
1723    following data as uninitialized global data.  If not defined, and
1724    neither `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
1725    uninitialized global data will be output in the data section if
1726    `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
1727    used.  */
1728
1729 /* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
1730    There are no shared libraries on this target, and these sections are
1731    placed in the read-only program memory, so they are not writable.  */
1732
1733 #undef CTORS_SECTION_ASM_OP
1734 #define CTORS_SECTION_ASM_OP "\t.section .ctors,\"a\",@progbits"
1735
1736 #undef DTORS_SECTION_ASM_OP
1737 #define DTORS_SECTION_ASM_OP "\t.section .dtors,\"a\",@progbits"
1738
1739 #define TARGET_ASM_CONSTRUCTOR avr_asm_out_ctor
1740 /* If defined, a function that outputs assembler code to arrange to
1741    call the function referenced by SYMBOL at initialization time.  */
1742
1743 #define TARGET_ASM_DESTRUCTOR avr_asm_out_dtor
1744 /* This is like `TARGET_ASM_CONSTRUCTOR' but used for termination
1745    functions rather than initialization functions.  */
1746
1747 #define EXTRA_SECTIONS in_progmem
1748 /* A list of names for sections other than the standard two, which are
1749    `in_text' and `in_data'.  You need not define this macro on a
1750    system with no other sections (that GCC needs to use).  */
1751
1752 #define EXTRA_SECTION_FUNCTIONS                                               \
1753                                                                               \
1754 void                                                                          \
1755 progmem_section ()                                                            \
1756 {                                                                             \
1757   if (in_section != in_progmem)                                               \
1758     {                                                                         \
1759       fprintf (asm_out_file,                                                  \
1760                "\t.section .progmem.gcc_sw_table, \"%s\", @progbits\n",       \
1761                AVR_MEGA ? "a" : "ax");                                        \
1762       /* Should already be aligned, this is just to be safe if it isn't.  */  \
1763       fprintf (asm_out_file, "\t.p2align 1\n");                               \
1764       in_section = in_progmem;                                                \
1765     }                                                                         \
1766 }
1767 /* `EXTRA_SECTION_FUNCTIONS'
1768    One or more functions to be defined in `varasm.c'.  These
1769    functions should do jobs analogous to those of `text_section' and
1770    `data_section', for your additional sections.  Do not define this
1771    macro if you do not define `EXTRA_SECTIONS'.  */
1772
1773 #define READONLY_DATA_SECTION data_section
1774 /* On most machines, read-only variables, constants, and jump tables
1775    are placed in the text section.  If this is not the case on your
1776    machine, this macro should be defined to be the name of a function
1777    (either `data_section' or a function defined in `EXTRA_SECTIONS')
1778    that switches to the section to be used for read-only items.
1779
1780    If these items should be placed in the text section, this macro
1781    should not be defined.  */
1782
1783 #define JUMP_TABLES_IN_TEXT_SECTION 0
1784 /* Define this macro if jump tables (for `tablejump' insns) should be
1785    output in the text section, along with the assembler instructions.
1786    Otherwise, the readonly data section is used.
1787
1788    This macro is irrelevant if there is no separate readonly data
1789    section.  */
1790
1791 #define ASM_FILE_START(STREAM) asm_file_start (STREAM)
1792 /* A C expression which outputs to the stdio stream STREAM some
1793    appropriate text to go at the start of an assembler file.
1794
1795    Normally this macro is defined to output a line containing
1796    `#NO_APP', which is a comment that has no effect on most
1797    assemblers but tells the GNU assembler that it can save time by not
1798    checking for certain assembler constructs.
1799
1800    On systems that use SDB, it is necessary to output certain
1801    commands; see `attasm.h'.  */
1802
1803 #define ASM_FILE_END(STREAM) asm_file_end (STREAM)
1804 /* A C expression which outputs to the stdio stream STREAM some
1805    appropriate text to go at the end of an assembler file.
1806
1807    If this macro is not defined, the default is to output nothing
1808    special at the end of the file.  Most systems don't require any
1809    definition.
1810
1811    On systems that use SDB, it is necessary to output certain
1812    commands; see `attasm.h'.  */
1813
1814 #define ASM_COMMENT_START " ; "
1815 /* A C string constant describing how to begin a comment in the target
1816    assembler language.  The compiler assumes that the comment will
1817    end at the end of the line.  */
1818
1819 #define ASM_APP_ON "/* #APP */\n"
1820 /* A C string constant for text to be output before each `asm'
1821    statement or group of consecutive ones.  Normally this is
1822    `"#APP"', which is a comment that has no effect on most assemblers
1823    but tells the GNU assembler that it must check the lines that
1824    follow for all valid assembler constructs.  */
1825
1826 #define ASM_APP_OFF "/* #NOAPP */\n"
1827 /* A C string constant for text to be output after each `asm'
1828    statement or group of consecutive ones.  Normally this is
1829    `"#NO_APP"', which tells the GNU assembler to resume making the
1830    time-saving assumptions that are valid for ordinary compiler
1831    output.  */
1832
1833 #define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) fprintf (STREAM,"/* line: %d */\n",LINE)
1834 /* A C statement to output DBX or SDB debugging information before
1835    code for line number LINE of the current source file to the stdio
1836    stream STREAM.
1837
1838    This macro need not be defined if the standard form of debugging
1839    information for the debugger in use is appropriate.  */
1840
1841 /* Switch into a generic section.  */
1842 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
1843
1844 #define OBJC_PROLOGUE {}
1845 /* A C statement to output any assembler statements which are
1846    required to precede any Objective-C object definitions or message
1847    sending.  The statement is executed only when compiling an
1848    Objective-C program.  */
1849
1850
1851 #define ASM_OUTPUT_ASCII(FILE, P, SIZE)  gas_output_ascii (FILE,P,SIZE)
1852 /* `ASM_OUTPUT_ASCII (STREAM, PTR, LEN)'
1853    output_ascii (FILE, P, SIZE)
1854    A C statement to output to the stdio stream STREAM an assembler
1855    instruction to assemble a string constant containing the LEN bytes
1856    at PTR.  PTR will be a C expression of type `char *' and LEN a C
1857    expression of type `int'.
1858
1859    If the assembler has a `.ascii' pseudo-op as found in the Berkeley
1860    Unix assembler, do not define the macro `ASM_OUTPUT_ASCII'.  */
1861
1862 #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '\n'                    \
1863                                           || ((C) == '$'))
1864 /* Define this macro as a C expression which is nonzero if C is used
1865    as a logical line separator by the assembler.
1866
1867    If you do not define this macro, the default is that only the
1868    character `;' is treated as a logical line separator.  */
1869
1870 /* These macros are provided by `real.h' for writing the definitions of
1871    `ASM_OUTPUT_DOUBLE' and the like:  */
1872
1873 #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED)                     \
1874 do {                                                                       \
1875      fputs ("\t.comm ", (STREAM));                                         \
1876      assemble_name ((STREAM), (NAME));                                     \
1877      fprintf ((STREAM), ",%d,1\n", (SIZE));                                \
1878 } while (0)
1879 /* A C statement (sans semicolon) to output to the stdio stream
1880    STREAM the assembler definition of a common-label named NAME whose
1881    size is SIZE bytes.  The variable ROUNDED is the size rounded up
1882    to whatever alignment the caller wants.
1883
1884    Use the expression `assemble_name (STREAM, NAME)' to output the
1885    name itself; before and after that, output the additional
1886    assembler syntax for defining the name, and a newline.
1887
1888    This macro controls how the assembler definitions of uninitialized
1889    common global variables are output.  */
1890
1891 #define ASM_OUTPUT_BSS(FILE, DECL, NAME, SIZE, ROUNDED)                 \
1892   asm_output_bss ((FILE), (DECL), (NAME), (SIZE), (ROUNDED))
1893 /* A C statement (sans semicolon) to output to the stdio stream
1894    STREAM the assembler definition of uninitialized global DECL named
1895    NAME whose size is SIZE bytes.  The variable ROUNDED is the size
1896    rounded up to whatever alignment the caller wants.  */
1897
1898 #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED)                   \
1899 do {                                                                    \
1900      fputs ("\t.lcomm ", (STREAM));                                     \
1901      assemble_name ((STREAM), (NAME));                                  \
1902      fprintf ((STREAM), ",%d\n", (SIZE));                               \
1903 } while (0)
1904 /* A C statement (sans semicolon) to output to the stdio stream
1905    STREAM the assembler definition of a local-common-label named NAME
1906    whose size is SIZE bytes.  The variable ROUNDED is the size
1907    rounded up to whatever alignment the caller wants.
1908
1909    Use the expression `assemble_name (STREAM, NAME)' to output the
1910    name itself; before and after that, output the additional
1911    assembler syntax for defining the name, and a newline.
1912
1913    This macro controls how the assembler definitions of uninitialized
1914    static variables are output.  */
1915
1916 #undef TYPE_ASM_OP
1917 #undef SIZE_ASM_OP
1918 #undef WEAK_ASM_OP
1919 #define TYPE_ASM_OP     "\t.type\t"
1920 #define SIZE_ASM_OP     "\t.size\t"
1921 #define WEAK_ASM_OP     "\t.weak\t"
1922 /* Define the strings used for the special svr4 .type and .size directives.
1923    These strings generally do not vary from one system running svr4 to
1924    another, but if a given system (e.g. m88k running svr) needs to use
1925    different pseudo-op names for these, they may be overridden in the
1926    file which includes this one.  */
1927
1928
1929 #undef TYPE_OPERAND_FMT
1930 #define TYPE_OPERAND_FMT        "@%s"
1931 /* The following macro defines the format used to output the second
1932    operand of the .type assembler directive.  Different svr4 assemblers
1933    expect various different forms for this operand.  The one given here
1934    is just a default.  You may need to override it in your machine-
1935    specific tm.h file (depending upon the particulars of your assembler).  */
1936
1937 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)             \
1938 do {                                                            \
1939      ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function");        \
1940      ASM_OUTPUT_LABEL (FILE, NAME);                             \
1941 } while (0)
1942
1943 /* A C statement (sans semicolon) to output to the stdio stream
1944    STREAM any text necessary for declaring the name NAME of a
1945    function which is being defined.  This macro is responsible for
1946    outputting the label definition (perhaps using
1947    `ASM_OUTPUT_LABEL').  The argument DECL is the `FUNCTION_DECL'
1948    tree node representing the function.
1949
1950    If this macro is not defined, then the function name is defined in
1951    the usual manner as a label (by means of `ASM_OUTPUT_LABEL').  */
1952
1953 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)                    \
1954   do {                                                                  \
1955     if (!flag_inhibit_size_directive)                                   \
1956       ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME);                           \
1957   } while (0)
1958 /* A C statement (sans semicolon) to output to the stdio stream
1959    STREAM any text necessary for declaring the size of a function
1960    which is being defined.  The argument NAME is the name of the
1961    function.  The argument DECL is the `FUNCTION_DECL' tree node
1962    representing the function.
1963
1964    If this macro is not defined, then the function size is not
1965    defined.  */
1966
1967 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)                       \
1968 do {                                                                    \
1969   ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");                     \
1970   size_directive_output = 0;                                            \
1971   if (!flag_inhibit_size_directive && DECL_SIZE (DECL))                 \
1972     {                                                                   \
1973       size_directive_output = 1;                                        \
1974       ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME,                            \
1975                                  int_size_in_bytes (TREE_TYPE (DECL))); \
1976     }                                                                   \
1977   ASM_OUTPUT_LABEL(FILE, NAME);                                         \
1978 } while (0)
1979 /* A C statement (sans semicolon) to output to the stdio stream
1980    STREAM any text necessary for declaring the name NAME of an
1981    initialized variable which is being defined.  This macro must
1982    output the label definition (perhaps using `ASM_OUTPUT_LABEL').
1983    The argument DECL is the `VAR_DECL' tree node representing the
1984    variable.
1985
1986    If this macro is not defined, then the variable name is defined in
1987    the usual manner as a label (by means of `ASM_OUTPUT_LABEL').  */
1988
1989 #undef ASM_FINISH_DECLARE_OBJECT
1990 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)         \
1991 do {                                                                     \
1992      const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);             \
1993      HOST_WIDE_INT size;                                                 \
1994      if (!flag_inhibit_size_directive && DECL_SIZE (DECL)                \
1995          && ! AT_END && TOP_LEVEL                                        \
1996          && DECL_INITIAL (DECL) == error_mark_node                       \
1997          && !size_directive_output)                                      \
1998        {                                                                 \
1999          size_directive_output = 1;                                      \
2000          size = int_size_in_bytes (TREE_TYPE (DECL));                    \
2001          ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size);                   \
2002        }                                                                 \
2003    } while (0)
2004
2005 /* A C statement (sans semicolon) to finish up declaring a variable
2006    name once the compiler has processed its initializer fully and
2007    thus has had a chance to determine the size of an array when
2008    controlled by an initializer.  This is used on systems where it's
2009    necessary to declare something about the size of the object.
2010
2011    If you don't define this macro, that is equivalent to defining it
2012    to do nothing.  */
2013
2014
2015 #define ESCAPES \
2016 "\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
2017 \0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
2018 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
2019 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
2020 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
2021 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
2022 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
2023 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
2024 /* A table of bytes codes used by the ASM_OUTPUT_ASCII and
2025    ASM_OUTPUT_LIMITED_STRING macros.  Each byte in the table
2026    corresponds to a particular byte value [0..255].  For any
2027    given byte value, if the value in the corresponding table
2028    position is zero, the given character can be output directly.
2029    If the table value is 1, the byte must be output as a \ooo
2030    octal escape.  If the tables value is anything else, then the
2031    byte value should be output as a \ followed by the value
2032    in the table.  Note that we can use standard UN*X escape
2033    sequences for many control characters, but we don't use
2034    \a to represent BEL because some svr4 assemblers (e.g. on
2035    the i386) don't know about that.  Also, we don't use \v
2036    since some versions of gas, such as 2.2 did not accept it.  */
2037
2038 #define STRING_LIMIT    ((unsigned) 64)
2039 #define STRING_ASM_OP   "\t.string\t"
2040 /* Some svr4 assemblers have a limit on the number of characters which
2041    can appear in the operand of a .string directive.  If your assembler
2042    has such a limitation, you should define STRING_LIMIT to reflect that
2043    limit.  Note that at least some svr4 assemblers have a limit on the
2044    actual number of bytes in the double-quoted string, and that they
2045    count each character in an escape sequence as one byte.  Thus, an
2046    escape sequence like \377 would count as four bytes.
2047
2048    If your target assembler doesn't support the .string directive, you
2049    should define this to zero.  */
2050
2051 /* Globalizing directive for a label.  */
2052 #define GLOBAL_ASM_OP ".global\t"
2053
2054 #define ASM_WEAKEN_LABEL(FILE, NAME)    \
2055   do                                    \
2056     {                                   \
2057       fputs ("\t.weak\t", (FILE));      \
2058       assemble_name ((FILE), (NAME));   \
2059       fputc ('\n', (FILE));             \
2060     }                                   \
2061   while (0)
2062
2063 /* A C statement (sans semicolon) to output to the stdio stream
2064    STREAM some commands that will make the label NAME weak; that is,
2065    available for reference from other files but only used if no other
2066    definition is available.  Use the expression `assemble_name
2067    (STREAM, NAME)' to output the name itself; before and after that,
2068    output the additional assembler syntax for making that name weak,
2069    and a newline.
2070
2071    If you don't define this macro, GNU CC will not support weak
2072    symbols and you should not define the `SUPPORTS_WEAK' macro.
2073 */
2074
2075 #define SUPPORTS_WEAK 1
2076 /* A C expression which evaluates to true if the target supports weak
2077    symbols.
2078
2079    If you don't define this macro, `defaults.h' provides a default
2080    definition.  If `ASM_WEAKEN_LABEL' is defined, the default
2081    definition is `1'; otherwise, it is `0'.  Define this macro if you
2082    want to control weak symbol support with a compiler flag such as
2083    `-melf'.
2084
2085    `MAKE_DECL_ONE_ONLY'
2086    A C statement (sans semicolon) to mark DECL to be emitted as a
2087    public symbol such that extra copies in multiple translation units
2088    will be discarded by the linker.  Define this macro if your object
2089    file format provides support for this concept, such as the `COMDAT'
2090    section flags in the Microsoft Windows PE/COFF format, and this
2091    support requires changes to DECL, such as putting it in a separate
2092    section.
2093
2094    `SUPPORTS_WEAK'
2095    A C expression which evaluates to true if the target supports
2096    one-only semantics.
2097
2098    If you don't define this macro, `varasm.c' provides a default
2099    definition.  If `MAKE_DECL_ONE_ONLY' is defined, the default
2100    definition is `1'; otherwise, it is `0'.  Define this macro if you
2101    want to control weak symbol support with a compiler flag, or if
2102    setting the `DECL_ONE_ONLY' flag is enough to mark a declaration to
2103    be emitted as one-only.  */
2104
2105 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM)        \
2106 sprintf (STRING, "*.%s%d", PREFIX, NUM)
2107 /* A C statement to store into the string STRING a label whose name
2108    is made from the string PREFIX and the number NUM.
2109
2110    This string, when output subsequently by `assemble_name', should
2111    produce the output that `(*targetm.asm_out.internal_label)' would produce
2112    with the same PREFIX and NUM.
2113
2114    If the string begins with `*', then `assemble_name' will output
2115    the rest of the string unchanged.  It is often convenient for
2116    `ASM_GENERATE_INTERNAL_LABEL' to use `*' in this way.  If the
2117    string doesn't start with `*', then `ASM_OUTPUT_LABELREF' gets to
2118    output the string, and may change it.  (Of course,
2119    `ASM_OUTPUT_LABELREF' is also part of your machine description, so
2120    you should know what it does on your machine.)  */
2121
2122 /* `ASM_OUTPUT_WEAK_ALIAS (STREAM, NAME, VALUE)'
2123    A C statement to output to the stdio stream STREAM assembler code
2124    which defines (equates) the weak symbol NAME to have the value
2125    VALUE.
2126
2127    Define this macro if the target only supports weak aliases; define
2128    ASM_OUTPUT_DEF instead if possible.  */
2129
2130 #define HAS_INIT_SECTION 1
2131 /* If defined, `main' will not call `__main' as described above.
2132    This macro should be defined for systems that control the contents
2133    of the init section on a symbol-by-symbol basis, such as OSF/1,
2134    and should not be defined explicitly for systems that support
2135    `INIT_SECTION_ASM_OP'.  */
2136
2137 #define REGISTER_NAMES {                                \
2138   "r0","r1","r2","r3","r4","r5","r6","r7",              \
2139     "r8","r9","r10","r11","r12","r13","r14","r15",      \
2140     "r16","r17","r18","r19","r20","r21","r22","r23",    \
2141     "r24","r25","r26","r27","r28","r29","r30","r31",    \
2142     "__SPL__","__SPH__","argL","argH"}
2143 /* A C initializer containing the assembler's names for the machine
2144    registers, each one as a C string constant.  This is what
2145    translates register numbers in the compiler into assembler
2146    language.  */
2147
2148 #define FINAL_PRESCAN_INSN(insn, operand, nop) final_prescan_insn (insn, operand,nop)
2149 /* If defined, a C statement to be executed just prior to the output
2150    of assembler code for INSN, to modify the extracted operands so
2151    they will be output differently.
2152
2153    Here the argument OPVEC is the vector containing the operands
2154    extracted from INSN, and NOPERANDS is the number of elements of
2155    the vector which contain meaningful data for this insn.  The
2156    contents of this vector are what will be used to convert the insn
2157    template into assembler code, so you can change the assembler
2158    output by changing the contents of the vector.
2159
2160    This macro is useful when various assembler syntaxes share a single
2161    file of instruction patterns; by defining this macro differently,
2162    you can cause a large class of instructions to be output
2163    differently (such as with rearranged operands).  Naturally,
2164    variations in assembler syntax affecting individual insn patterns
2165    ought to be handled by writing conditional output routines in
2166    those patterns.
2167
2168    If this macro is not defined, it is equivalent to a null statement.  */
2169
2170 #define PRINT_OPERAND(STREAM, X, CODE) print_operand (STREAM, X, CODE)
2171 /* A C compound statement to output to stdio stream STREAM the
2172    assembler syntax for an instruction operand X.  X is an RTL
2173    expression.
2174
2175    CODE is a value that can be used to specify one of several ways of
2176    printing the operand.  It is used when identical operands must be
2177    printed differently depending on the context.  CODE comes from the
2178    `%' specification that was used to request printing of the
2179    operand.  If the specification was just `%DIGIT' then CODE is 0;
2180    if the specification was `%LTR DIGIT' then CODE is the ASCII code
2181    for LTR.
2182
2183    If X is a register, this macro should print the register's name.
2184    The names can be found in an array `reg_names' whose type is `char
2185    *[]'.  `reg_names' is initialized from `REGISTER_NAMES'.
2186
2187    When the machine description has a specification `%PUNCT' (a `%'
2188    followed by a punctuation character), this macro is called with a
2189    null pointer for X and the punctuation character for CODE.  */
2190
2191 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '~')
2192 /* A C expression which evaluates to true if CODE is a valid
2193    punctuation character for use in the `PRINT_OPERAND' macro.  If
2194    `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no
2195    punctuation characters (except for the standard one, `%') are used
2196    in this way.  */
2197
2198 #define PRINT_OPERAND_ADDRESS(STREAM, X) print_operand_address(STREAM, X)
2199 /* A C compound statement to output to stdio stream STREAM the
2200    assembler syntax for an instruction operand that is a memory
2201    reference whose address is X.  X is an RTL expression.  */
2202
2203 #define USER_LABEL_PREFIX ""
2204 /* `LOCAL_LABEL_PREFIX'
2205    `REGISTER_PREFIX'
2206    `IMMEDIATE_PREFIX'
2207    If defined, C string expressions to be used for the `%R', `%L',
2208    `%U', and `%I' options of `asm_fprintf' (see `final.c').  These
2209    are useful when a single `md' file must support multiple assembler
2210    formats.  In that case, the various `tm.h' files can define these
2211    macros differently.  */
2212
2213 #define ASSEMBLER_DIALECT AVR_ENHANCED
2214 /* If your target supports multiple dialects of assembler language
2215   (such as different opcodes), define this macro as a C expression
2216   that gives the numeric index of the assembler language dialect to
2217   use, with zero as the first variant.
2218
2219   If this macro is defined, you may use constructs of the form
2220   `{option0|option1|option2...}' in the output templates of patterns
2221   (*note Output Template::.) or in the first argument of
2222   `asm_fprintf'.  This construct outputs `option0', `option1' or
2223   `option2', etc., if the value of `ASSEMBLER_DIALECT' is zero, one
2224   or two, etc.  Any special characters within these strings retain
2225   their usual meaning.
2226
2227   If you do not define this macro, the characters `{', `|' and `}'
2228   do not have any special meaning when used in templates or operands
2229   to `asm_fprintf'.
2230
2231   Define the macros `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX',
2232   `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' if you can express the
2233   variations in assembler language syntax with that mechanism.
2234   Define `ASSEMBLER_DIALECT' and use the `{option0|option1}' syntax
2235   if the syntax variant are larger and involve such things as
2236   different opcodes or operand order.  */
2237
2238 #define ASM_OUTPUT_REG_PUSH(STREAM, REGNO)      \
2239 {                                               \
2240   if (REGNO > 31)                               \
2241     abort ();                                   \
2242   fprintf (STREAM, "\tpush\tr%d", REGNO);       \
2243 }
2244 /* A C expression to output to STREAM some assembler code which will
2245    push hard register number REGNO onto the stack.  The code need not
2246    be optimal, since this macro is used only when profiling.  */
2247
2248 #define ASM_OUTPUT_REG_POP(STREAM, REGNO)       \
2249 {                                               \
2250   if (REGNO > 31)                               \
2251     abort ();                                   \
2252   fprintf (STREAM, "\tpop\tr%d", REGNO);        \
2253 }
2254 /* A C expression to output to STREAM some assembler code which will
2255    pop hard register number REGNO off of the stack.  The code need
2256    not be optimal, since this macro is used only when profiling.  */
2257
2258 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE)          \
2259   avr_output_addr_vec_elt(STREAM, VALUE)
2260 /* This macro should be provided on machines where the addresses in a
2261    dispatch table are absolute.
2262
2263    The definition should be a C statement to output to the stdio
2264    stream STREAM an assembler pseudo-instruction to generate a
2265    reference to a label.  VALUE is the number of an internal label
2266    whose definition is output using `(*targetm.asm_out.internal_label)'.  For
2267    example,
2268
2269    fprintf (STREAM, "\t.word L%d\n", VALUE)  */
2270
2271 #define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) \
2272   progmem_section (), (*targetm.asm_out.internal_label) (STREAM, PREFIX, NUM)
2273
2274 /* `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)'
2275    Define this if the label before a jump-table needs to be output
2276    specially.  The first three arguments are the same as for
2277    `(*targetm.asm_out.internal_label)'; the fourth argument is the jump-table
2278    which follows (a `jump_insn' containing an `addr_vec' or
2279    `addr_diff_vec').
2280
2281    This feature is used on system V to output a `swbeg' statement for
2282    the table.
2283
2284    If this macro is not defined, these labels are output with
2285    `(*targetm.asm_out.internal_label)'.  */
2286
2287 /* `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)'
2288    Define this if something special must be output at the end of a
2289    jump-table.  The definition should be a C statement to be executed
2290    after the assembler code for the table is written.  It should write
2291    the appropriate code to stdio stream STREAM.  The argument TABLE
2292    is the jump-table insn, and NUM is the label-number of the
2293    preceding label.
2294
2295    If this macro is not defined, nothing special is output at the end
2296    of the jump-table.  */
2297
2298 #define ASM_OUTPUT_SKIP(STREAM, N)              \
2299 fprintf (STREAM, "\t.skip %d,0\n", N)
2300 /* A C statement to output to the stdio stream STREAM an assembler
2301    instruction to advance the location counter by NBYTES bytes.
2302    Those bytes should be zero when loaded.  NBYTES will be a C
2303    expression of type `int'.  */
2304
2305 #define ASM_OUTPUT_ALIGN(STREAM, POWER)
2306 /* A C statement to output to the stdio stream STREAM an assembler
2307    command to advance the location counter to a multiple of 2 to the
2308    POWER bytes.  POWER will be a C expression of type `int'.  */
2309
2310 #define CASE_VECTOR_MODE HImode
2311 /* An alias for a machine mode name.  This is the machine mode that
2312    elements of a jump-table should have.  */
2313
2314 extern int avr_case_values_threshold;
2315
2316 #define CASE_VALUES_THRESHOLD avr_case_values_threshold
2317 /* `CASE_VALUES_THRESHOLD'
2318    Define this to be the smallest number of different values for
2319    which it is best to use a jump-table instead of a tree of
2320    conditional branches.  The default is four for machines with a
2321    `casesi' instruction and five otherwise.  This is best for most
2322    machines.  */
2323
2324 #undef WORD_REGISTER_OPERATIONS
2325 /* Define this macro if operations between registers with integral
2326    mode smaller than a word are always performed on the entire
2327    register.  Most RISC machines have this property and most CISC
2328    machines do not.  */
2329
2330 #define MOVE_MAX 4
2331 /* The maximum number of bytes that a single instruction can move
2332    quickly between memory and registers or between two memory
2333    locations.  */
2334
2335 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
2336 /* A C expression which is nonzero if on this machine it is safe to
2337    "convert" an integer of INPREC bits to one of OUTPREC bits (where
2338    OUTPREC is smaller than INPREC) by merely operating on it as if it
2339    had only OUTPREC bits.
2340
2341    On many machines, this expression can be 1.
2342
2343    When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for
2344    modes for which `MODES_TIEABLE_P' is 0, suboptimal code can result.
2345    If this is the case, making `TRULY_NOOP_TRUNCATION' return 0 in
2346    such cases may improve things.  */
2347
2348 #define Pmode HImode
2349 /* An alias for the machine mode for pointers.  On most machines,
2350    define this to be the integer mode corresponding to the width of a
2351    hardware pointer; `SImode' on 32-bit machine or `DImode' on 64-bit
2352    machines.  On some machines you must define this to be one of the
2353    partial integer modes, such as `PSImode'.
2354
2355    The width of `Pmode' must be at least as large as the value of
2356    `POINTER_SIZE'.  If it is not equal, you must define the macro
2357    `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to
2358    `Pmode'.  */
2359
2360 #define FUNCTION_MODE HImode
2361 /* An alias for the machine mode used for memory references to
2362    functions being called, in `call' RTL expressions.  On most
2363    machines this should be `QImode'.  */
2364      /*                            1        3 */
2365 #define INTEGRATE_THRESHOLD(DECL) (1 + (3 * list_length (DECL_ARGUMENTS (DECL)) / 2))
2366
2367 /* A C expression for the maximum number of instructions above which
2368    the function DECL should not be inlined.  DECL is a
2369    `FUNCTION_DECL' node.
2370
2371    The default definition of this macro is 64 plus 8 times the number
2372    of arguments that the function accepts.  Some people think a larger
2373    threshold should be used on RISC machines.  */
2374
2375 #define DOLLARS_IN_IDENTIFIERS 0
2376 /* Define this macro to control use of the character `$' in identifier
2377    names.  0 means `$' is not allowed by default; 1 means it is
2378    allowed.  1 is the default; there is no need to define this macro
2379    in that case.  This macro controls the compiler proper; it does
2380    not affect the preprocessor.  */
2381
2382 #define NO_DOLLAR_IN_LABEL 1
2383 /* Define this macro if the assembler does not accept the character
2384    `$' in label names.  By default constructors and destructors in
2385    G++ have `$' in the identifiers.  If this macro is defined, `.' is
2386    used instead.  */
2387
2388 #define MACHINE_DEPENDENT_REORG(INSN) machine_dependent_reorg (INSN)
2389 /* In rare cases, correct code generation requires extra machine
2390    dependent processing between the second jump optimization pass and
2391    delayed branch scheduling.  On those machines, define this macro
2392    as a C statement to act on the code starting at INSN.  */
2393
2394 #define GIV_SORT_CRITERION(X, Y)        \
2395   if (GET_CODE ((X)->add_val) == CONST_INT              \
2396       && GET_CODE ((Y)->add_val) == CONST_INT)          \
2397     return INTVAL ((X)->add_val) - INTVAL ((Y)->add_val);
2398
2399 /* `GIV_SORT_CRITERION(GIV1, GIV2)'
2400    In some cases, the strength reduction optimization pass can
2401    produce better code if this is defined.  This macro controls the
2402    order that induction variables are combined.  This macro is
2403    particularly useful if the target has limited addressing modes.
2404    For instance, the SH target has only positive offsets in
2405    addresses.  Thus sorting to put the smallest address first allows
2406    the most combinations to be found.  */
2407
2408 #define TRAMPOLINE_TEMPLATE(FILE) \
2409   internal_error ("trampolines not supported")
2410
2411 /* Length in units of the trampoline for entering a nested function.  */
2412
2413 #define TRAMPOLINE_SIZE 4
2414
2415 /* Emit RTL insns to initialize the variable parts of a trampoline.
2416    FNADDR is an RTX for the address of the function's pure code.
2417    CXT is an RTX for the static chain value for the function.  */
2418
2419 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT)                             \
2420 {                                                                             \
2421   emit_move_insn (gen_rtx (MEM, HImode, plus_constant ((TRAMP), 2)), CXT);    \
2422   emit_move_insn (gen_rtx (MEM, HImode, plus_constant ((TRAMP), 6)), FNADDR); \
2423 }
2424 /* Store in cc_status the expressions
2425    that the condition codes will describe
2426    after execution of an instruction whose pattern is EXP.
2427    Do not alter them if the instruction would not alter the cc's.  */
2428
2429 #define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc(EXP, INSN)
2430
2431 /* The add insns don't set overflow in a usable way.  */
2432 #define CC_OVERFLOW_UNUSABLE 01000
2433 /* The mov,and,or,xor insns don't set carry.  That's ok though as the
2434    Z bit is all we need when doing unsigned comparisons on the result of
2435    these insns (since they're always with 0).  However, conditions.h has
2436    CC_NO_OVERFLOW defined for this purpose.  Rename it to something more
2437    understandable.  */
2438 #define CC_NO_CARRY CC_NO_OVERFLOW
2439
2440
2441 /* Output assembler code to FILE to increment profiler label # LABELNO
2442    for profiling a function entry.  */
2443
2444 #define FUNCTION_PROFILER(FILE, LABELNO)  \
2445   fprintf (FILE, "/* profiler %d */", (LABELNO))
2446
2447 /* `FIRST_INSN_ADDRESS'
2448    When the `length' insn attribute is used, this macro specifies the
2449    value to be assigned to the address of the first insn in a
2450    function.  If not specified, 0 is used.  */
2451
2452 #define ADJUST_INSN_LENGTH(INSN, LENGTH) (LENGTH =\
2453                                           adjust_insn_length (INSN, LENGTH))
2454 /* If defined, modifies the length assigned to instruction INSN as a
2455    function of the context in which it is used.  LENGTH is an lvalue
2456    that contains the initially computed length of the insn and should
2457    be updated with the correct length of the insn.  If updating is
2458    required, INSN must not be a varying-length insn.
2459
2460    This macro will normally not be required.  A case in which it is
2461    required is the ROMP.  On this machine, the size of an `addr_vec'
2462    insn must be increased by two to compensate for the fact that
2463    alignment may be required.  */
2464
2465 #define TARGET_MEM_FUNCTIONS
2466 /* Define this macro if GNU CC should generate calls to the System V
2467    (and ANSI C) library functions `memcpy' and `memset' rather than
2468    the BSD functions `bcopy' and `bzero'.  */
2469
2470 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
2471
2472 /* A C string constant that tells the GNU CC driver program options to
2473    pass to CPP.  It can also specify how to translate options you
2474    give to GNU CC into options for GNU CC to pass to the CPP.
2475
2476    Do not define this macro if it does not need to do anything.  */
2477
2478 #define CC1_SPEC "%{profile:-p}"
2479 /* A C string constant that tells the GNU CC driver program options to
2480    pass to `cc1'.  It can also specify how to translate options you
2481    give to GNU CC into options for GNU CC to pass to the `cc1'.
2482
2483    Do not define this macro if it does not need to do anything.  */
2484
2485 #define CC1PLUS_SPEC "%{!frtti:-fno-rtti} \
2486     %{!fenforce-eh-specs:-fno-enforce-eh-specs} \
2487     %{!fexceptions:-fno-exceptions}"
2488 /* A C string constant that tells the GNU CC drvier program options to
2489    pass to `cc1plus'.  */
2490
2491 #define ASM_SPEC "%{mmcu=*:-mmcu=%*}"
2492 /* A C string constant that tells the GNU CC driver program how to
2493    run any programs which cleanup after the normal assembler.
2494    Normally, this is not needed.  See the file `mips.h' for an
2495    example of this.
2496
2497    Do not define this macro if it does not need to do anything.  */
2498
2499 #define LINK_SPEC " %{!mmcu*:-m avr2}\
2500 %{mmcu=at90s1200|mmcu=attiny1*|mmcu=attiny28:-m avr1} \
2501 %{mmcu=attiny22|mmcu=attiny26|mmcu=at90s2*|mmcu=at90s4*|mmcu=at90s8*|mmcu=at90c8*|mmcu=at86rf401:-m avr2}\
2502 %{mmcu=atmega103|mmcu=atmega603|mmcu=at43*|mmcu=at76*:-m avr3}\
2503 %{mmcu=atmega8*:-m avr4}\
2504 %{mmcu=atmega16*|mmcu=atmega32*|mmcu=atmega64|mmcu=atmega128|mmcu=at94k:-m avr5}\
2505 %{mmcu=atmega64|mmcu=atmega128|mmcu=atmega162|mmcu=atmega169: -Tdata 0x800100} "
2506
2507 /* A C string constant that tells the GNU CC driver program options to
2508    pass to the linker.  It can also specify how to translate options
2509    you give to GNU CC into options for GNU CC to pass to the linker.
2510
2511    Do not define this macro if it does not need to do anything.  */
2512
2513 #define LIB_SPEC \
2514   "%{!mmcu=at90s1*:%{!mmcu=attiny1*:%{!mmcu=attiny28: -lc }}}"
2515 /* Another C string constant used much like `LINK_SPEC'.  The
2516    difference between the two is that `LIB_SPEC' is used at the end
2517    of the command given to the linker.
2518
2519    If this macro is not defined, a default is provided that loads the
2520    standard C library from the usual place.  See `gcc.c'.  */
2521
2522 #define LIBSTDCXX "-lgcc"
2523 /* No libstdc++ for now.  Empty string doesn't work.  */
2524
2525 #define LIBGCC_SPEC \
2526   "%{!mmcu=at90s1*:%{!mmcu=attiny1*:%{!mmcu=attiny28: -lgcc }}}"
2527 /* Another C string constant that tells the GNU CC driver program how
2528    and when to place a reference to `libgcc.a' into the linker
2529    command line.  This constant is placed both before and after the
2530    value of `LIB_SPEC'.
2531
2532    If this macro is not defined, the GNU CC driver provides a default
2533    that passes the string `-lgcc' to the linker unless the `-shared'
2534    option is specified.  */
2535
2536 #define STARTFILE_SPEC "%(crt_binutils)"
2537 /* Another C string constant used much like `LINK_SPEC'.  The
2538    difference between the two is that `STARTFILE_SPEC' is used at the
2539    very beginning of the command given to the linker.
2540
2541    If this macro is not defined, a default is provided that loads the
2542    standard C startup file from the usual place.  See `gcc.c'.  */
2543
2544 #define ENDFILE_SPEC ""
2545 /* Another C string constant used much like `LINK_SPEC'.  The
2546    difference between the two is that `ENDFILE_SPEC' is used at the
2547    very end of the command given to the linker.
2548
2549    Do not define this macro if it does not need to do anything.  */
2550
2551 #define CRT_BINUTILS_SPECS "\
2552 %{mmcu=at90s1200|mmcu=avr1:crts1200.o%s} \
2553 %{mmcu=attiny11:crttn11.o%s} \
2554 %{mmcu=attiny12:crttn12.o%s} \
2555 %{mmcu=attiny15:crttn15.o%s} \
2556 %{mmcu=attiny28:crttn28.o%s} \
2557 %{!mmcu*|mmcu=at90s8515|mmcu=avr2:crts8515.o%s} \
2558 %{mmcu=at90s2313:crts2313.o%s} \
2559 %{mmcu=at90s2323:crts2323.o%s} \
2560 %{mmcu=at90s2333:crts2333.o%s} \
2561 %{mmcu=at90s2343:crts2343.o%s} \
2562 %{mmcu=attiny22:crttn22.o%s} \
2563 %{mmcu=attiny26:crttn26.o%s} \
2564 %{mmcu=at90s4433:crts4433.o%s} \
2565 %{mmcu=at90s4414:crts4414.o%s} \
2566 %{mmcu=at90s4434:crts4434.o%s} \
2567 %{mmcu=at90c8534:crtc8534.o%s} \
2568 %{mmcu=at90s8535:crts8535.o%s} \
2569 %{mmcu=at86rf401:crt86401.o%s} \
2570 %{mmcu=atmega103|mmcu=avr3:crtm103.o%s} \
2571 %{mmcu=atmega603:crtm603.o%s} \
2572 %{mmcu=at43usb320:crt43320.o%s} \
2573 %{mmcu=at43usb355:crt43355.o%s} \
2574 %{mmcu=at76c711:crt76711.o%s} \
2575 %{mmcu=atmega8|mmcu=avr4:crtm8.o%s} \
2576 %{mmcu=atmega8515:crtm8515.o%s} \
2577 %{mmcu=atmega8535:crtm8535.o%s} \
2578 %{mmcu=atmega16:crtm16.o%s} \
2579 %{mmcu=atmega161|mmcu=avr5:crtm161.o%s} \
2580 %{mmcu=atmega162:crtm162.o%s} \
2581 %{mmcu=atmega163:crtm163.o%s} \
2582 %{mmcu=atmega169:crtm169.o%s} \
2583 %{mmcu=atmega32:crtm32.o%s} \
2584 %{mmcu=atmega323:crtm323.o%s} \
2585 %{mmcu=atmega64:crtm64.o%s} \
2586 %{mmcu=atmega128:crtm128.o%s} \
2587 %{mmcu=at94k:crtat94k.o%s}"
2588
2589 #define EXTRA_SPECS {"crt_binutils", CRT_BINUTILS_SPECS},
2590
2591 /* Define this macro to provide additional specifications to put in
2592    the `specs' file that can be used in various specifications like
2593    `CC1_SPEC'.  */
2594
2595 /* This is the default without any -mmcu=* option (AT90S*).  */
2596 #define MULTILIB_DEFAULTS { "mmcu=avr2" }
2597
2598 /* This is undefined macro for collect2 disabling */
2599 #define LINKER_NAME "ld"
2600
2601 #define TEST_HARD_REG_CLASS(CLASS, REGNO) \
2602   TEST_HARD_REG_BIT (reg_class_contents[ (int) (CLASS)], REGNO)
2603
2604 /* Note that the other files fail to use these
2605    in some of the places where they should.  */
2606
2607 #if defined(__STDC__) || defined(ALMOST_STDC)
2608 #define AS2(a,b,c) #a " " #b "," #c
2609 #define AS2C(b,c) " " #b "," #c
2610 #define AS3(a,b,c,d) #a " " #b "," #c "," #d
2611 #define AS1(a,b) #a " " #b
2612 #else
2613 #define AS1(a,b) "a     b"
2614 #define AS2(a,b,c) "a   b,c"
2615 #define AS2C(b,c) " b,c"
2616 #define AS3(a,b,c,d) "a b,c,d"
2617 #endif
2618 #define OUT_AS1(a,b) output_asm_insn (AS1(a,b), operands)
2619 #define OUT_AS2(a,b,c) output_asm_insn (AS2(a,b,c), operands)
2620 #define CR_TAB "\n\t"
2621
2622 /* Define this macro as a C statement that declares additional library
2623    routines renames existing ones. `init_optabs' calls this macro
2624    after initializing all the normal library routines.  */
2625
2626 #define INIT_TARGET_OPTABS                              \
2627 {                                                       \
2628   avr_init_once ();                                     \
2629 }
2630
2631 /* Temporary register r0 */
2632 #define TMP_REGNO 0
2633
2634 /* zero register r1 */
2635 #define ZERO_REGNO 1
2636
2637 /* Temporary register which used for load immediate values to r0-r15  */
2638 #define LDI_REG_REGNO 31
2639
2640 extern struct rtx_def *tmp_reg_rtx;
2641 extern struct rtx_def *zero_reg_rtx;
2642 extern struct rtx_def *ldi_reg_rtx;
2643
2644 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
2645
2646 /* Get the standard ELF stabs definitions.  */
2647 #include "dbxelf.h"