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