OSDN Git Service

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