OSDN Git Service

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