OSDN Git Service

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