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