1 /* Definitions of target machine for GNU compiler,
2 for ATMEL AVR at90s8515, ATmega103/103L, ATmega603/603L microcontrollers.
4 Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
5 Contributed by Denis Chertykov (denisc@overta.ru)
7 This file is part of GNU CC.
9 GNU CC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 GNU CC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GNU CC; see the file COPYING. If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
24 /* Names to predefine in the preprocessor for this target machine. */
26 #define CPP_PREDEFINES "-DAVR"
27 /* Define this to be a string constant containing `-D' options to
28 define the predefined macros that identify this machine and system.
29 These macros will be predefined unless the `-ansi' option is
32 In addition, a parallel set of macros are predefined, whose names
33 are made by appending `__' at the beginning and at the end. These
34 `__' macros are permitted by the ANSI standard, so they are
35 predefined regardless of whether `-ansi' is specified.
37 For example, on the Sun, one can use the following value:
39 "-Dmc68000 -Dsun -Dunix"
41 The result is to define the macros `__mc68000__', `__sun__' and
42 `__unix__' unconditionally, and the macros `mc68000', `sun' and
43 `unix' provided `-ansi' is not specified. */
46 /* This declaration should be present. */
47 extern int target_flags;
49 #define TARGET_ORDER_1 (target_flags & 0x1000)
50 #define TARGET_ORDER_2 (target_flags & 0x4000)
51 #define TARGET_INT8 (target_flags & 0x10000)
52 #define TARGET_NO_INTERRUPTS (target_flags & 0x20000)
53 #define TARGET_INSN_SIZE_DUMP (target_flags & 0x2000)
54 #define TARGET_CALL_PROLOGUES (target_flags & 0x40000)
55 #define TARGET_TINY_STACK (target_flags & 0x80000)
57 /* Dump each assembler insn's rtl into the output file.
58 This is for debugging the compiler itself. */
60 #define TARGET_RTL_DUMP (target_flags & 0x010)
61 #define TARGET_ALL_DEBUG (target_flags & 0xfe0)
64 This series of macros is to allow compiler command arguments to
65 enable or disable the use of optional features of the target
66 machine. For example, one machine description serves both the
67 68000 and the 68020; a command argument tells the compiler whether
68 it should use 68020-only instructions or not. This command
69 argument works by means of a macro `TARGET_68020' that tests a bit
72 Define a macro `TARGET_FEATURENAME' for each such option. Its
73 definition should test a bit in `target_flags'; for example:
75 #define TARGET_68020 (target_flags & 1)
77 One place where these macros are used is in the
78 condition-expressions of instruction patterns. Note how
79 `TARGET_68020' appears frequently in the 68000 machine description
80 file, `m68k.md'. Another place they are used is in the
81 definitions of the other macros in the `MACHINE.h' file. */
85 #define TARGET_SWITCHES { \
86 {"order1",0x1000, NULL}, \
87 {"order2",0x4000, NULL}, \
88 {"int8",0x10000,"Assume int to be 8 bit integer"}, \
89 {"no-interrupts",0x20000,"Don't output interrupt compatible code"}, \
90 {"call-prologues",0x40000, \
91 "Use subroutines for functions prologue/epilogue"}, \
92 {"tiny-stack", 0x80000, "Change only low 8 bits of stack pointer"}, \
94 {"size",0x2000,"Output instruction size's to the asm file"}, \
95 {"deb",0xfe0, NULL}, \
97 /* This macro defines names of command options to set and clear bits
98 in `target_flags'. Its definition is an initializer with a
99 subgrouping for each command option.
101 Each subgrouping contains a string constant, that defines the
102 option name, and a number, which contains the bits to set in
103 `target_flags'. A negative number says to clear bits instead; the
104 negative of the number is which bits to clear. The actual option
105 name is made by appending `-m' to the specified name.
107 One of the subgroupings should have a null string. The number in
108 this grouping is the default value for `target_flags'. Any target
109 options act starting with that value.
111 Here is an example which defines `-m68000' and `-m68020' with
112 opposite meanings, and picks the latter as the default:
114 #define TARGET_SWITCHES \
119 extern const char *avr_ram_end;
120 extern const char *avr_mcu_name;
128 extern struct mcu_type_s *avr_mcu_type;
129 #define AVR_MEGA (avr_mcu_type->mega)
131 #define TARGET_OPTIONS { \
132 {"init-stack=",&avr_ram_end,"Specify the initial stack address" }, \
133 {"mcu=", &avr_mcu_name, \
134 "Specify the MCU name (at90s23xx,attiny22,at90s44xx,at90s85xx,atmega603,atmega103)"}}
135 /* This macro is similar to `TARGET_SWITCHES' but defines names of
136 command options that have values. Its definition is an
137 initializer with a subgrouping for each command option.
139 Each subgrouping contains a string constant, that defines the
140 fixed part of the option name, and the address of a variable. The
141 variable, type `char *', is set to the variable part of the given
142 option if the fixed part matches. The actual option name is made
143 by appending `-m' to the specified name.
145 Here is an example which defines `-mshort-data-NUMBER'. If the
146 given option is `-mshort-data-512', the variable `m88k_short_data'
147 will be set to the string `"512"'.
149 extern char *m88k_short_data;
150 #define TARGET_OPTIONS \
151 { { "short-data-", &m88k_short_data } } */
153 #define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)");
154 /* This macro is a C statement to print on `stderr' a string
155 describing the particular machine description choice. Every
156 machine description should define `TARGET_VERSION'. For example:
159 #define TARGET_VERSION \
160 fprintf (stderr, " (68k, Motorola syntax)");
162 #define TARGET_VERSION \
163 fprintf (stderr, " (68k, MIT syntax)");
166 #define OVERRIDE_OPTIONS avr_override_options()
167 /* `OVERRIDE_OPTIONS'
168 Sometimes certain combinations of command options do not make
169 sense on a particular target machine. You can define a macro
170 `OVERRIDE_OPTIONS' to take account of this. This macro, if
171 defined, is executed once just after all the command options have
174 Don't use this macro to turn on various extra optimizations for
175 `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
177 #define CAN_DEBUG_WITHOUT_FP
178 /* Define this macro if debugging can be performed even without a
179 frame pointer. If this macro is defined, GNU CC will turn on the
180 `-fomit-frame-pointer' option whenever `-O' is specified. */
182 /* Define this if most significant byte of a word is the lowest numbered. */
183 #define BITS_BIG_ENDIAN 0
185 /* Define this if most significant byte of a word is the lowest numbered. */
186 #define BYTES_BIG_ENDIAN 0
188 /* Define this if most significant word of a multiword number is the lowest
190 #define WORDS_BIG_ENDIAN 0
192 /* number of bits in an addressable storage unit */
193 #define BITS_PER_UNIT 8
195 /* Width in bits of a "word", which is the contents of a machine register.
196 Note that this is not necessarily the width of data type `int'; */
197 #define BITS_PER_WORD 8
200 /* This is to get correct SI and DI modes in libgcc2.c (32 and 64 bits). */
201 #define UNITS_PER_WORD 4
203 /* Width of a word, in units (bytes). */
204 #define UNITS_PER_WORD 1
207 /* Width in bits of a pointer.
208 See also the macro `Pmode' defined below. */
209 #define POINTER_SIZE 16
212 /* Maximum sized of reasonable data type
213 DImode or Dfmode ... */
214 #define MAX_FIXED_MODE_SIZE 32
216 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
217 #define PARM_BOUNDARY 8
219 /* Allocation boundary (in *bits*) for the code of a function. */
220 #define FUNCTION_BOUNDARY 8
222 /* Alignment of field after `int : 0' in a structure. */
223 #define EMPTY_FIELD_BOUNDARY 8
225 /* No data type wants to be aligned rounder than this. */
226 #define BIGGEST_ALIGNMENT 8
229 /* Define this if move instructions will actually fail to work
230 when given unaligned data. */
231 #define STRICT_ALIGNMENT 0
233 /* A C expression for the size in bits of the type `int' on the
234 target machine. If you don't define this, the default is one word. */
235 #define INT_TYPE_SIZE (TARGET_INT8 ? 8 : 16)
238 /* A C expression for the size in bits of the type `short' on the
239 target machine. If you don't define this, the default is half a
240 word. (If this would be less than one storage unit, it is rounded
242 #define SHORT_TYPE_SIZE (INT_TYPE_SIZE == 8 ? INT_TYPE_SIZE : 16)
244 /* A C expression for the size in bits of the type `long' on the
245 target machine. If you don't define this, the default is one word. */
246 #define LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 16 : 32)
248 #define MAX_LONG_TYPE_SIZE 32
249 /* Maximum number for the size in bits of the type `long' on the
250 target machine. If this is undefined, the default is
251 `LONG_TYPE_SIZE'. Otherwise, it is the constant value that is the
252 largest value that `LONG_TYPE_SIZE' can have at run-time. This is
256 #define LONG_LONG_TYPE_SIZE 64
257 /* A C expression for the size in bits of the type `long long' on the
258 target machine. If you don't define this, the default is two
259 words. If you want to support GNU Ada on your machine, the value
260 of macro must be at least 64. */
263 #define CHAR_TYPE_SIZE 8
264 /* A C expression for the size in bits of the type `char' on the
265 target machine. If you don't define this, the default is one
266 quarter of a word. (If this would be less than one storage unit,
267 it is rounded up to one unit.) */
269 #define FLOAT_TYPE_SIZE 32
270 /* A C expression for the size in bits of the type `float' on the
271 target machine. If you don't define this, the default is one word. */
273 #define DOUBLE_TYPE_SIZE 32
274 /* A C expression for the size in bits of the type `double' on the
275 target machine. If you don't define this, the default is two
279 #define LONG_DOUBLE_TYPE_SIZE 32
280 /* A C expression for the size in bits of the type `long double' on
281 the target machine. If you don't define this, the default is two
284 #define DEFAULT_SIGNED_CHAR 1
285 /* An expression whose value is 1 or 0, according to whether the type
286 `char' should be signed or unsigned by default. The user can
287 always override this default with the options `-fsigned-char' and
288 `-funsigned-char'. */
290 /* `DEFAULT_SHORT_ENUMS'
291 A C expression to determine whether to give an `enum' type only as
292 many bytes as it takes to represent the range of possible values
293 of that type. A nonzero value means to do that; a zero value
294 means all `enum' types should be allocated like `int'.
296 If you don't define the macro, the default is 0. */
298 #define SIZE_TYPE (INT_TYPE_SIZE == 8 ? "long unsigned int" : "unsigned int")
299 /* A C expression for a string describing the name of the data type
300 to use for size values. The typedef name `size_t' is defined
301 using the contents of the string.
303 The string can contain more than one keyword. If so, separate
304 them with spaces, and write first any length keyword, then
305 `unsigned' if appropriate, and finally `int'. The string must
306 exactly match one of the data type names defined in the function
307 `init_decl_processing' in the file `c-decl.c'. You may not omit
308 `int' or change the order--that would cause the compiler to crash
311 If you don't define this macro, the default is `"long unsigned
314 #define PTRDIFF_TYPE (INT_TYPE_SIZE == 8 ? "long unsigned int" :"unsigned int")
315 /* A C expression for a string describing the name of the data type
316 to use for the result of subtracting two pointers. The typedef
317 name `ptrdiff_t' is defined using the contents of the string. See
318 `SIZE_TYPE' above for more information.
320 If you don't define this macro, the default is `"long int"'. */
323 #define WCHAR_TYPE_SIZE 16
324 /* A C expression for the size in bits of the data type for wide
325 characters. This is used in `cpp', which cannot make use of
328 #define FIRST_PSEUDO_REGISTER 36
329 /* Number of hardware registers known to the compiler. They receive
330 numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first
331 pseudo register's number really is assigned the number
332 `FIRST_PSEUDO_REGISTER'. */
334 #define FIXED_REGISTERS {\
352 1,1 /* arg pointer */ }
353 /* An initializer that says which registers are used for fixed
354 purposes all throughout the compiled code and are therefore not
355 available for general allocation. These would include the stack
356 pointer, the frame pointer (except on machines where that can be
357 used as a general register when no frame pointer is needed), the
358 program counter on machines where that is considered one of the
359 addressable registers, and any other numbered register with a
362 This information is expressed as a sequence of numbers, separated
363 by commas and surrounded by braces. The Nth number is 1 if
364 register N is fixed, 0 otherwise.
366 The table initialized from this macro, and the table initialized by
367 the following one, may be overridden at run time either
368 automatically, by the actions of the macro
369 `CONDITIONAL_REGISTER_USAGE', or by the user with the command
370 options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. */
372 #define CALL_USED_REGISTERS { \
390 1,1 /* arg pointer */ }
391 /* Like `FIXED_REGISTERS' but has 1 for each register that is
392 clobbered (in general) by function calls as well as for fixed
393 registers. This macro therefore identifies the registers that are
394 not available for general allocation of values that must live
395 across function calls.
397 If a register has 0 in `CALL_USED_REGISTERS', the compiler
398 automatically saves it on function entry and restores it on
399 function exit, if the register is used within the function. */
401 #define NON_SAVING_SETJMP 0
402 /* If this macro is defined and has a nonzero value, it means that
403 `setjmp' and related functions fail to save the registers, or that
404 `longjmp' fails to restore them. To compensate, the compiler
405 avoids putting variables in registers in functions that use
408 #define REG_ALLOC_ORDER { \
416 17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2, \
420 /* If defined, an initializer for a vector of integers, containing the
421 numbers of hard registers in the order in which GNU CC should
422 prefer to use them (from most preferred to least).
424 If this macro is not defined, registers are used lowest numbered
425 first (all else being equal).
427 One use of this macro is on machines where the highest numbered
428 registers must always be saved and the save-multiple-registers
429 instruction supports only sequences of consetionve registers. On
430 such machines, define `REG_ALLOC_ORDER' to be an initializer that
431 lists the highest numbered allocatable register first. */
433 #define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()
434 /* ORDER_REGS_FOR_LOCAL_ALLOC'
435 A C statement (sans semicolon) to choose the order in which to
436 allocate hard registers for pseudo-registers local to a basic
439 Store the desired register order in the array `reg_alloc_order'.
440 Element 0 should be the register to allocate first; element 1, the
441 next register; and so on.
443 The macro body should not assume anything about the contents of
444 `reg_alloc_order' before execution of the macro.
446 On most machines, it is not necessary to define this macro. */
449 #define HARD_REGNO_NREGS(REGNO, MODE) ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
451 /* A C expression for the number of consecutive hard registers,
452 starting at register number REGNO, required to hold a value of mode
455 On a machine where all registers are exactly one word, a suitable
456 definition of this macro is
458 #define HARD_REGNO_NREGS(REGNO, MODE) \
459 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
460 / UNITS_PER_WORD)) */
462 #define HARD_REGNO_MODE_OK(REGNO, MODE) avr_hard_regno_mode_ok(REGNO, MODE)
463 /* A C expression that is nonzero if it is permissible to store a
464 value of mode MODE in hard register number REGNO (or in several
465 registers starting with that one). For a machine where all
466 registers are equivalent, a suitable definition is
468 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
470 It is not necessary for this macro to check for the numbers of
471 fixed registers, because the allocation mechanism considers them
472 to be always occupied.
474 On some machines, double-precision values must be kept in even/odd
475 register pairs. The way to implement that is to define this macro
476 to reject odd register numbers for such modes.
478 The minimum requirement for a mode to be OK in a register is that
479 the `movMODE' instruction pattern support moves between the
480 register and any other hard register for which the mode is OK; and
481 that moving a value into the register and back out not alter it.
483 Since the same instruction used to move `SImode' will work for all
484 narrower integer modes, it is not necessary on any machine for
485 `HARD_REGNO_MODE_OK' to distinguish between these modes, provided
486 you define patterns `movhi', etc., to take advantage of this. This
487 is useful because of the interaction between `HARD_REGNO_MODE_OK'
488 and `MODES_TIEABLE_P'; it is very desirable for all integer modes
491 Many machines have special registers for floating point arithmetic.
492 Often people assume that floating point machine modes are allowed
493 only in floating point registers. This is not true. Any
494 registers that can hold integers can safely *hold* a floating
495 point machine mode, whether or not floating arithmetic can be done
496 on it in those registers. Integer move instructions can be used
499 On some machines, though, the converse is true: fixed-point machine
500 modes may not go in floating registers. This is true if the
501 floating registers normalize any value stored in them, because
502 storing a non-floating value there would garble it. In this case,
503 `HARD_REGNO_MODE_OK' should reject fixed-point machine modes in
504 floating registers. But if the floating registers do not
505 automatically normalize, if you can store any bit pattern in one
506 and retrieve it unchanged without a trap, then any machine mode
507 may go in a floating register, so you can define this macro to say
510 The primary significance of special floating registers is rather
511 that they are the registers acceptable in floating point arithmetic
512 instructions. However, this is of no concern to
513 `HARD_REGNO_MODE_OK'. You handle it by writing the proper
514 constraints for those instructions.
516 On some machines, the floating registers are especially slow to
517 access, so that it is better to store a value in a stack frame
518 than in such a register if floating point arithmetic is not being
519 done. As long as the floating registers are not in class
520 `GENERAL_REGS', they will not be used unless some pattern's
521 constraint asks for one. */
523 #define MODES_TIEABLE_P(MODE1, MODE2) 0
524 /* A C expression that is nonzero if it is desirable to choose
525 register allocation so as to avoid move instructions between a
526 value of mode MODE1 and a value of mode MODE2.
528 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
529 MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1,
530 MODE2)' must be zero. */
535 POINTER_X_REGS, /* r26 - r27 */
536 POINTER_Y_REGS, /* r28 - r29 */
537 POINTER_Z_REGS, /* r30 - r31 */
538 STACK_REG, /* STACK */
539 BASE_POINTER_REGS, /* r28 - r31 */
540 POINTER_REGS, /* r26 - r31 */
541 ADDW_REGS, /* r24 - r31 */
542 SIMPLE_LD_REGS, /* r16 - r23 */
543 LD_REGS, /* r16 - r31 */
544 NO_LD_REGS, /* r0 - r15 */
545 GENERAL_REGS, /* r0 - r31 */
546 ALL_REGS, LIM_REG_CLASSES
548 /* An enumeral type that must be defined with all the register class
549 names as enumeral values. `NO_REGS' must be first. `ALL_REGS'
550 must be the last register class, followed by one more enumeral
551 value, `LIM_REG_CLASSES', which is not a register class but rather
552 tells how many classes there are.
554 Each register class has a number, which is the value of casting
555 the class name to type `int'. The number serves as an index in
556 many of the tables described below. */
559 #define N_REG_CLASSES (int)LIM_REG_CLASSES
560 /* The number of distinct register classes, defined as follows:
562 #define N_REG_CLASSES (int) LIM_REG_CLASSES */
564 #define REG_CLASS_NAMES { \
567 "POINTER_X_REGS", /* r26 - r27 */ \
568 "POINTER_Y_REGS", /* r28 - r29 */ \
569 "POINTER_Z_REGS", /* r30 - r31 */ \
570 "STACK_REG", /* STACK */ \
571 "BASE_POINTER_REGS", /* r28 - r31 */ \
572 "POINTER_REGS", /* r26 - r31 */ \
573 "ADDW_REGS", /* r24 - r31 */ \
574 "SIMPLE_LD_REGS", /* r16 - r23 */ \
575 "LD_REGS", /* r16 - r31 */ \
576 "NO_LD_REGS", /* r0 - r15 */ \
577 "GENERAL_REGS", /* r0 - r31 */ \
579 /* An initializer containing the names of the register classes as C
580 string constants. These names are used in writing some of the
588 #define REG_CLASS_CONTENTS { \
589 {0x00000000,0x00000000}, /* NO_REGS */ \
590 {0x00000001,0x00000000}, /* R0_REG */ \
591 {3 << REG_X,0x00000000}, /* POINTER_X_REGS, r26 - r27 */ \
592 {3 << REG_Y,0x00000000}, /* POINTER_Y_REGS, r28 - r29 */ \
593 {3 << REG_Z,0x00000000}, /* POINTER_Z_REGS, r30 - r31 */ \
594 {0x00000000,0x00000003}, /* STACK_REG, STACK */ \
595 {(3 << REG_Y) | (3 << REG_Z), \
596 0x00000000}, /* BASE_POINTER_REGS, r28 - r31 */ \
597 {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z), \
598 0x00000000}, /* POINTER_REGS, r26 - r31 */ \
599 {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W), \
600 0x00000000}, /* ADDW_REGS, r24 - r31 */ \
601 {0x00ff0000,0x00000000}, /* SIMPLE_LD_REGS r16 - r23 */ \
602 {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16), \
603 0x00000000}, /* LD_REGS, r16 - r31 */ \
604 {0x0000ffff,0x00000000}, /* NO_LD_REGS r0 - r15 */ \
605 {0xffffffffu,0x00000000}, /* GENERAL_REGS, r0 - r31 */ \
606 {0xffffffffu,0x00000003} /* ALL_REGS */ \
608 /* An initializer containing the contents of the register classes, as
609 integers which are bit masks. The Nth integer specifies the
610 contents of class N. The way the integer MASK is interpreted is
611 that register R is in the class if `MASK & (1 << R)' is 1.
613 When the machine has more than 32 registers, an integer does not
614 suffice. Then the integers are replaced by sub-initializers,
615 braced groupings containing several integers. Each
616 sub-initializer must be suitable as an initializer for the type
617 `HARD_REG_SET' which is defined in `hard-reg-set.h'. */
619 #define REGNO_REG_CLASS(R) avr_regno_reg_class(R)
620 /* A C expression whose value is a register class containing hard
621 register REGNO. In general there is more than one such class;
622 choose a class which is "minimal", meaning that no smaller class
623 also contains the register. */
625 #define BASE_REG_CLASS POINTER_REGS
626 /* A macro whose definition is the name of the class to which a valid
627 base register must belong. A base register is one used in an
628 address which is the register value plus a displacement. */
630 #define INDEX_REG_CLASS NO_REGS
631 /* A macro whose definition is the name of the class to which a valid
632 index register must belong. An index register is one used in an
633 address where its value is either multiplied by a scale factor or
634 added to another register (as well as added to a displacement). */
636 #define REG_CLASS_FROM_LETTER(C) avr_reg_class_from_letter(C)
637 /* A C expression which defines the machine-dependent operand
638 constraint letters for register classes. If CHAR is such a
639 letter, the value should be the register class corresponding to
640 it. Otherwise, the value should be `NO_REGS'. The register
641 letter `r', corresponding to class `GENERAL_REGS', will not be
642 passed to this macro; you do not need to handle it. */
644 #define REGNO_OK_FOR_BASE_P(r) (((r) < FIRST_PSEUDO_REGISTER \
648 || (r) == ARG_POINTER_REGNUM)) \
650 && (reg_renumber[r] == REG_X \
651 || reg_renumber[r] == REG_Y \
652 || reg_renumber[r] == REG_Z \
653 || (reg_renumber[r] \
654 == ARG_POINTER_REGNUM))))
655 /* A C expression which is nonzero if register number NUM is suitable
656 for use as a base register in operand addresses. It may be either
657 a suitable hard register or a pseudo register that has been
658 allocated such a hard register. */
660 /* #define REGNO_MODE_OK_FOR_BASE_P(r, m) regno_mode_ok_for_base_p(r, m)
661 A C expression that is just like `REGNO_OK_FOR_BASE_P', except that
662 that expression may examine the mode of the memory reference in
663 MODE. You should define this macro if the mode of the memory
664 reference affects whether a register may be used as a base
665 register. If you define this macro, the compiler will use it
666 instead of `REGNO_OK_FOR_BASE_P'. */
668 #define REGNO_OK_FOR_INDEX_P(NUM) 0
669 /* A C expression which is nonzero if register number NUM is suitable
670 for use as an index register in operand addresses. It may be
671 either a suitable hard register or a pseudo register that has been
672 allocated such a hard register.
674 The difference between an index register and a base register is
675 that the index register may be scaled. If an address involves the
676 sum of two registers, neither one of them scaled, then either one
677 may be labeled the "base" and the other the "index"; but whichever
678 labeling is used must fit the machine's constraints of which
679 registers may serve in each capacity. The compiler will try both
680 labelings, looking for one that is valid, and will reload one or
681 both registers only if neither labeling works. */
683 #define PREFERRED_RELOAD_CLASS(X, CLASS) preferred_reload_class(X,CLASS)
684 /* A C expression that places additional restrictions on the register
685 class to use when it is necessary to copy value X into a register
686 in class CLASS. The value is a register class; perhaps CLASS, or
687 perhaps another, smaller class. On many machines, the following
690 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
692 Sometimes returning a more restrictive class makes better code.
693 For example, on the 68000, when X is an integer constant that is
694 in range for a `moveq' instruction, the value of this macro is
695 always `DATA_REGS' as long as CLASS includes the data registers.
696 Requiring a data register guarantees that a `moveq' will be used.
698 If X is a `const_double', by returning `NO_REGS' you can force X
699 into a memory constant. This is useful on certain machines where
700 immediate floating values cannot be loaded into certain kinds of
702 /* `PREFERRED_OUTPUT_RELOAD_CLASS (X, CLASS)'
703 Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of
704 input reloads. If you don't define this macro, the default is to
705 use CLASS, unchanged. */
707 /* `LIMIT_RELOAD_CLASS (MODE, CLASS)'
708 A C expression that places additional restrictions on the register
709 class to use when it is necessary to be able to hold a value of
710 mode MODE in a reload register for which class CLASS would
713 Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when
714 there are certain modes that simply can't go in certain reload
717 The value is a register class; perhaps CLASS, or perhaps another,
720 Don't define this macro unless the target machine has limitations
721 which require the macro to do something nontrivial. */
723 /* SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X)
724 `SECONDARY_RELOAD_CLASS (CLASS, MODE, X)'
725 `SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)'
726 Many machines have some registers that cannot be copied directly
727 to or from memory or even from other types of registers. An
728 example is the `MQ' register, which on most machines, can only be
729 copied to or from general registers, but not memory. Some
730 machines allow copying all registers to and from memory, but
731 require a scratch register for stores to some memory locations
732 (e.g., those with symbolic address on the RT, and those with
733 certain symbolic address on the Sparc when compiling PIC). In
734 some cases, both an intermediate and a scratch register are
737 You should define these macros to indicate to the reload phase
738 that it may need to allocate at least one register for a reload in
739 addition to the register to contain the data. Specifically, if
740 copying X to a register CLASS in MODE requires an intermediate
741 register, you should define `SECONDARY_INPUT_RELOAD_CLASS' to
742 return the largest register class all of whose registers can be
743 used as intermediate registers or scratch registers.
745 If copying a register CLASS in MODE to X requires an intermediate
746 or scratch register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be
747 defined to return the largest register class required. If the
748 requirements for input and output reloads are the same, the macro
749 `SECONDARY_RELOAD_CLASS' should be used instead of defining both
752 The values returned by these macros are often `GENERAL_REGS'.
753 Return `NO_REGS' if no spare register is needed; i.e., if X can be
754 directly copied to or from a register of CLASS in MODE without
755 requiring a scratch register. Do not define this macro if it
756 would always return `NO_REGS'.
758 If a scratch register is required (either with or without an
759 intermediate register), you should define patterns for
760 `reload_inM' or `reload_outM', as required (*note Standard
761 Names::.. These patterns, which will normally be implemented with
762 a `define_expand', should be similar to the `movM' patterns,
763 except that operand 2 is the scratch register.
765 Define constraints for the reload register and scratch register
766 that contain a single register class. If the original reload
767 register (whose class is CLASS) can meet the constraint given in
768 the pattern, the value returned by these macros is used for the
769 class of the scratch register. Otherwise, two additional reload
770 registers are required. Their classes are obtained from the
771 constraints in the insn pattern.
773 X might be a pseudo-register or a `subreg' of a pseudo-register,
774 which could either be in a hard register or in memory. Use
775 `true_regnum' to find out; it will return -1 if the pseudo is in
776 memory and the hard register number if it is in a register.
778 These macros should not be used in the case where a particular
779 class of registers can only be copied to memory and not to another
780 class of registers. In that case, secondary reload registers are
781 not needed and would not be helpful. Instead, a stack location
782 must be used to perform the copy and the `movM' pattern should use
783 memory as a intermediate storage. This case often occurs between
784 floating-point and general registers. */
786 /* `SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)'
787 Certain machines have the property that some registers cannot be
788 copied to some other registers without using memory. Define this
789 macro on those machines to be a C expression that is non-zero if
790 objects of mode M in registers of CLASS1 can only be copied to
791 registers of class CLASS2 by storing a register of CLASS1 into
792 memory and loading that memory location into a register of CLASS2.
794 Do not define this macro if its value would always be zero.
796 `SECONDARY_MEMORY_NEEDED_RTX (MODE)'
797 Normally when `SECONDARY_MEMORY_NEEDED' is defined, the compiler
798 allocates a stack slot for a memory location needed for register
799 copies. If this macro is defined, the compiler instead uses the
800 memory location defined by this macro.
802 Do not define this macro if you do not define
803 `SECONDARY_MEMORY_NEEDED'. */
805 #define SMALL_REGISTER_CLASSES 1
806 /* Normally the compiler avoids choosing registers that have been
807 explicitly mentioned in the rtl as spill registers (these
808 registers are normally those used to pass parameters and return
809 values). However, some machines have so few registers of certain
810 classes that there would not be enough registers to use as spill
811 registers if this were done.
813 Define `SMALL_REGISTER_CLASSES' to be an expression with a non-zero
814 value on these machines. When this macro has a non-zero value, the
815 compiler allows registers explicitly used in the rtl to be used as
816 spill registers but avoids extending the lifetime of these
819 It is always safe to define this macro with a non-zero value, but
820 if you unnecessarily define it, you will reduce the amount of
821 optimizations that can be performed in some cases. If you do not
822 define this macro with a non-zero value when it is required, the
823 compiler will run out of spill registers and print a fatal error
824 message. For most machines, you should not define this macro at
827 #define CLASS_LIKELY_SPILLED_P(c) class_likely_spilled_p(c)
828 /* A C expression whose value is nonzero if pseudos that have been
829 assigned to registers of class CLASS would likely be spilled
830 because registers of CLASS are needed for spill registers.
832 The default value of this macro returns 1 if CLASS has exactly one
833 register and zero otherwise. On most machines, this default
834 should be used. Only define this macro to some other expression
835 if pseudo allocated by `local-alloc.c' end up in memory because
836 their hard registers were needed for spill registers. If this
837 macro returns nonzero for those classes, those pseudos will only
838 be allocated by `global.c', which knows how to reallocate the
839 pseudo to another register. If there would not be another
840 register available for reallocation, you should not change the
841 definition of this macro since the only effect of such a
842 definition would be to slow down register allocation. */
844 #define CLASS_MAX_NREGS(CLASS, MODE) class_max_nregs (CLASS, MODE)
845 /* A C expression for the maximum number of consecutive registers of
846 class CLASS needed to hold a value of mode MODE.
848 This is closely related to the macro `HARD_REGNO_NREGS'. In fact,
849 the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be
850 the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all
851 REGNO values in the class CLASS.
853 This macro helps control the handling of multiple-word values in
856 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
857 ((C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 63 : \
858 (C) == 'J' ? (VALUE) <= 0 && (VALUE) >= -63: \
859 (C) == 'K' ? (VALUE) == 2 : \
860 (C) == 'L' ? (VALUE) == 0 : \
861 (C) == 'M' ? (VALUE) >= 0 && (VALUE) <= 0xff : \
862 (C) == 'N' ? (VALUE) == -1: \
863 (C) == 'O' ? (VALUE) == 8 || (VALUE) == 16 || (VALUE) == 24: \
864 (C) == 'P' ? (VALUE) == 1 : \
867 /* A C expression that defines the machine-dependent operand
868 constraint letters (`I', `J', `K', ... `P') that specify
869 particular ranges of integer values. If C is one of those
870 letters, the expression should check that VALUE, an integer, is in
871 the appropriate range and return 1 if so, 0 otherwise. If C is
872 not one of those letters, the value should be 0 regardless of
875 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
876 ((C) == 'G' ? (VALUE) == CONST0_RTX (SFmode) \
878 /* `CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)'
879 A C expression that defines the machine-dependent operand
880 constraint letters that specify particular ranges of
881 `const_double' values (`G' or `H').
883 If C is one of those letters, the expression should check that
884 VALUE, an RTX of code `const_double', is in the appropriate range
885 and return 1 if so, 0 otherwise. If C is not one of those
886 letters, the value should be 0 regardless of VALUE.
888 `const_double' is used for all floating-point constants and for
889 `DImode' fixed-point constants. A given letter can accept either
890 or both kinds of values. It can use `GET_MODE' to distinguish
891 between these kinds. */
893 #define EXTRA_CONSTRAINT(x, c) extra_constraint(x, c)
894 /* A C expression that defines the optional machine-dependent
895 constraint letters (``Q', `R', `S', `T', `U') that can'
896 be used to segregate specific types of operands, usually memory
897 references, for the target machine. Normally this macro will not
898 be defined. If it is required for a particular target machine, it
899 should return 1 if VALUE corresponds to the operand type
900 represented by the constraint letter C. If C is not defined as an
901 extra constraint, the value returned should be 0 regardless of
904 For example, on the ROMP, load instructions cannot have their
905 output in r0 if the memory reference contains a symbolic address.
906 Constraint letter `Q' is defined as representing a memory address
907 that does *not* contain a symbolic address. An alternative is
908 specified with a `Q' constraint on the input and `r' on the
909 output. The next alternative specifies `m' on the input and a
910 register class that does not include r0 on the output. */
912 /* This is an undocumented variable which describes
913 how GCC will push a data */
914 #define STACK_PUSH_CODE POST_DEC
916 #define STACK_GROWS_DOWNWARD
917 /* Define this macro if pushing a word onto the stack moves the stack
918 pointer to a smaller address.
920 When we say, "define this macro if ...," it means that the
921 compiler checks this macro only with `#ifdef' so the precise
922 definition used does not matter. */
924 #define STARTING_FRAME_OFFSET 1
925 /* Offset from the frame pointer to the first local variable slot to
928 If `FRAME_GROWS_DOWNWARD', find the next slot's offset by
929 subtracting the first slot's length from `STARTING_FRAME_OFFSET'.
930 Otherwise, it is found by adding the length of the first slot to
931 the value `STARTING_FRAME_OFFSET'. */
933 #define STACK_POINTER_OFFSET 1
934 /* Offset from the stack pointer register to the first location at
935 which outgoing arguments are placed. If not specified, the
936 default value of zero is used. This is the proper value for most
939 If `ARGS_GROW_DOWNWARD', this is the offset to the location above
940 the first location at which outgoing arguments are placed. */
942 #define FIRST_PARM_OFFSET(FUNDECL) 0
943 /* Offset from the argument pointer register to the first argument's
944 address. On some machines it may depend on the data type of the
947 If `ARGS_GROW_DOWNWARD', this is the offset to the location above
948 the first argument's address. */
950 /* `STACK_DYNAMIC_OFFSET (FUNDECL)'
951 Offset from the stack pointer register to an item dynamically
952 allocated on the stack, e.g., by `alloca'.
954 The default value for this macro is `STACK_POINTER_OFFSET' plus the
955 length of the outgoing arguments. The default is correct for most
956 machines. See `function.c' for details. */
958 #define STACK_BOUNDARY 8
959 /* Define this macro if there is a guaranteed alignment for the stack
960 pointer on this machine. The definition is a C expression for the
961 desired alignment (measured in bits). This value is used as a
962 default if PREFERRED_STACK_BOUNDARY is not defined. */
964 #define STACK_POINTER_REGNUM 32
965 /* The register number of the stack pointer register, which must also
966 be a fixed register according to `FIXED_REGISTERS'. On most
967 machines, the hardware determines which register this is. */
969 #define FRAME_POINTER_REGNUM REG_Y
970 /* The register number of the frame pointer register, which is used to
971 access automatic variables in the stack frame. On some machines,
972 the hardware determines which register this is. On other
973 machines, you can choose any register you wish for this purpose. */
975 #define ARG_POINTER_REGNUM 34
976 /* The register number of the arg pointer register, which is used to
977 access the function's argument list. On some machines, this is
978 the same as the frame pointer register. On some machines, the
979 hardware determines which register this is. On other machines,
980 you can choose any register you wish for this purpose. If this is
981 not the same register as the frame pointer register, then you must
982 mark it as a fixed register according to `FIXED_REGISTERS', or
983 arrange to be able to eliminate it (*note Elimination::.). */
985 #define STATIC_CHAIN_REGNUM 2
986 /* Register numbers used for passing a function's static chain
987 pointer. If register windows are used, the register number as
988 seen by the called function is `STATIC_CHAIN_INCOMING_REGNUM',
989 while the register number as seen by the calling function is
990 `STATIC_CHAIN_REGNUM'. If these registers are the same,
991 `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
993 The static chain register need not be a fixed register.
995 If the static chain is passed in memory, these macros should not be
996 defined; instead, the next two macros should be defined. */
998 #define FRAME_POINTER_REQUIRED frame_pointer_required_p()
999 /* A C expression which is nonzero if a function must have and use a
1000 frame pointer. This expression is evaluated in the reload pass.
1001 If its value is nonzero the function will have a frame pointer.
1003 The expression can in principle examine the current function and
1004 decide according to the facts, but on most machines the constant 0
1005 or the constant 1 suffices. Use 0 when the machine allows code to
1006 be generated with no frame pointer, and doing so saves some time
1007 or space. Use 1 when there is no possible advantage to avoiding a
1010 In certain cases, the compiler does not know how to produce valid
1011 code without a frame pointer. The compiler recognizes those cases
1012 and automatically gives the function a frame pointer regardless of
1013 what `FRAME_POINTER_REQUIRED' says. You don't need to worry about
1016 In a function that does not require a frame pointer, the frame
1017 pointer register can be allocated for ordinary usage, unless you
1018 mark it as a fixed register. See `FIXED_REGISTERS' for more
1021 #define ELIMINABLE_REGS { \
1022 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
1023 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \
1024 ,{FRAME_POINTER_REGNUM+1,STACK_POINTER_REGNUM+1}}
1025 /* If defined, this macro specifies a table of register pairs used to
1026 eliminate unneeded registers that point into the stack frame. If
1027 it is not defined, the only elimination attempted by the compiler
1028 is to replace references to the frame pointer with references to
1031 The definition of this macro is a list of structure
1032 initializations, each of which specifies an original and
1033 replacement register.
1035 On some machines, the position of the argument pointer is not
1036 known until the compilation is completed. In such a case, a
1037 separate hard register must be used for the argument pointer.
1038 This register can be eliminated by replacing it with either the
1039 frame pointer or the argument pointer, depending on whether or not
1040 the frame pointer has been eliminated.
1042 In this case, you might specify:
1043 #define ELIMINABLE_REGS \
1044 {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1045 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
1046 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
1048 Note that the elimination of the argument pointer with the stack
1049 pointer is specified first since that is the preferred elimination. */
1051 #define CAN_ELIMINATE(FROM, TO) (((FROM) == ARG_POINTER_REGNUM \
1052 && (TO) == FRAME_POINTER_REGNUM) \
1053 || (((FROM) == FRAME_POINTER_REGNUM \
1054 || (FROM) == FRAME_POINTER_REGNUM+1) \
1055 && ! FRAME_POINTER_REQUIRED \
1057 /* A C expression that returns non-zero if the compiler is allowed to
1058 try to replace register number FROM-REG with register number
1059 TO-REG. This macro need only be defined if `ELIMINABLE_REGS' is
1060 defined, and will usually be the constant 1, since most of the
1061 cases preventing register elimination are things that the compiler
1062 already knows about. */
1064 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1065 OFFSET = initial_elimination_offset (FROM, TO)
1066 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
1067 specifies the initial difference between the specified pair of
1068 registers. This macro must be defined if `ELIMINABLE_REGS' is
1071 #define RETURN_ADDR_RTX(count, x) \
1072 gen_rtx_MEM (Pmode, memory_address (Pmode, plus_constant (tem, 1)))
1074 #define PUSH_ROUNDING(NPUSHED) (NPUSHED)
1075 /* A C expression that is the number of bytes actually pushed onto the
1076 stack when an instruction attempts to push NPUSHED bytes.
1078 If the target machine does not have a push instruction, do not
1079 define this macro. That directs GNU CC to use an alternate
1080 strategy: to allocate the entire argument block and then store the
1083 On some machines, the definition
1085 #define PUSH_ROUNDING(BYTES) (BYTES)
1087 will suffice. But on other machines, instructions that appear to
1088 push one byte actually push two bytes in an attempt to maintain
1089 alignment. Then the definition should be
1091 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1) */
1093 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
1094 /* A C expression that should indicate the number of bytes of its own
1095 arguments that a function pops on returning, or 0 if the function
1096 pops no arguments and the caller must therefore pop them all after
1097 the function returns.
1099 FUNDECL is a C variable whose value is a tree node that describes
1100 the function in question. Normally it is a node of type
1101 `FUNCTION_DECL' that describes the declaration of the function.
1102 From this you can obtain the DECL_MACHINE_ATTRIBUTES of the
1105 FUNTYPE is a C variable whose value is a tree node that describes
1106 the function in question. Normally it is a node of type
1107 `FUNCTION_TYPE' that describes the data type of the function.
1108 From this it is possible to obtain the data types of the value and
1109 arguments (if known).
1111 When a call to a library function is being considered, FUNDECL
1112 will contain an identifier node for the library function. Thus, if
1113 you need to distinguish among various library functions, you can
1114 do so by their names. Note that "library function" in this
1115 context means a function used to perform arithmetic, whose name is
1116 known specially in the compiler and was not mentioned in the C
1117 code being compiled.
1119 STACK-SIZE is the number of bytes of arguments passed on the
1120 stack. If a variable number of bytes is passed, it is zero, and
1121 argument popping will always be the responsibility of the calling
1124 On the Vax, all functions always pop their arguments, so the
1125 definition of this macro is STACK-SIZE. On the 68000, using the
1126 standard calling convention, no functions pop their arguments, so
1127 the value of the macro is always 0 in this case. But an
1128 alternative calling convention is available in which functions
1129 that take a fixed number of arguments pop them but other functions
1130 (such as `printf') pop nothing (the caller pops all). When this
1131 convention is in use, FUNTYPE is examined to determine whether a
1132 function takes a fixed number of arguments. */
1134 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) (function_arg (&(CUM), MODE, TYPE, NAMED))
1135 /* A C expression that controls whether a function argument is passed
1136 in a register, and which register.
1138 The arguments are CUM, which summarizes all the previous
1139 arguments; MODE, the machine mode of the argument; TYPE, the data
1140 type of the argument as a tree node or 0 if that is not known
1141 (which happens for C support library functions); and NAMED, which
1142 is 1 for an ordinary argument and 0 for nameless arguments that
1143 correspond to `...' in the called function's prototype.
1145 The value of the expression is usually either a `reg' RTX for the
1146 hard register in which to pass the argument, or zero to pass the
1147 argument on the stack.
1149 For machines like the Vax and 68000, where normally all arguments
1150 are pushed, zero suffices as a definition.
1152 The value of the expression can also be a `parallel' RTX. This is
1153 used when an argument is passed in multiple locations. The mode
1154 of the of the `parallel' should be the mode of the entire
1155 argument. The `parallel' holds any number of `expr_list' pairs;
1156 each one describes where part of the argument is passed. In each
1157 `expr_list', the first operand can be either a `reg' RTX for the
1158 hard register in which to pass this part of the argument, or zero
1159 to pass the argument on the stack. If this operand is a `reg',
1160 then the mode indicates how large this part of the argument is.
1161 The second operand of the `expr_list' is a `const_int' which gives
1162 the offset in bytes into the entire argument where this part
1165 The usual way to make the ANSI library `stdarg.h' work on a machine
1166 where some arguments are usually passed in registers, is to cause
1167 nameless arguments to be passed on the stack instead. This is done
1168 by making `FUNCTION_ARG' return 0 whenever NAMED is 0.
1170 You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the
1171 definition of this macro to determine if this argument is of a
1172 type that must be passed in the stack. If `REG_PARM_STACK_SPACE'
1173 is not defined and `FUNCTION_ARG' returns non-zero for such an
1174 argument, the compiler will abort. If `REG_PARM_STACK_SPACE' is
1175 defined, the argument will be computed in the stack and then
1176 loaded into a register. */
1178 typedef struct avr_args {
1179 int nregs; /* # registers available for passing */
1180 int regno; /* next available register number */
1182 /* A C type for declaring a variable that is used as the first
1183 argument of `FUNCTION_ARG' and other related values. For some
1184 target machines, the type `int' suffices and can hold the number
1185 of bytes of argument so far.
1187 There is no need to record in `CUMULATIVE_ARGS' anything about the
1188 arguments that have been passed on the stack. The compiler has
1189 other variables to keep track of that. For target machines on
1190 which all arguments are passed on the stack, there is no need to
1191 store anything in `CUMULATIVE_ARGS'; however, the data structure
1192 must exist and should not be empty, so use `int'. */
1194 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) init_cumulative_args (&(CUM), FNTYPE, LIBNAME, INDIRECT)
1196 /* A C statement (sans semicolon) for initializing the variable CUM
1197 for the state at the beginning of the argument list. The variable
1198 has type `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node
1199 for the data type of the function which will receive the args, or 0
1200 if the args are to a compiler support library function. The value
1201 of INDIRECT is nonzero when processing an indirect call, for
1202 example a call through a function pointer. The value of INDIRECT
1203 is zero for a call to an explicitly named function, a library
1204 function call, or when `INIT_CUMULATIVE_ARGS' is used to find
1205 arguments for the function being compiled.
1207 When processing a call to a compiler support library function,
1208 LIBNAME identifies which one. It is a `symbol_ref' rtx which
1209 contains the name of the function, as a string. LIBNAME is 0 when
1210 an ordinary C function call is being processed. Thus, each time
1211 this macro is called, either LIBNAME or FNTYPE is nonzero, but
1212 never both of them at once. */
1214 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
1215 (function_arg_advance (&CUM, MODE, TYPE, NAMED))
1217 /* A C statement (sans semicolon) to update the summarizer variable
1218 CUM to advance past an argument in the argument list. The values
1219 MODE, TYPE and NAMED describe that argument. Once this is done,
1220 the variable CUM is suitable for analyzing the *following*
1221 argument with `FUNCTION_ARG', etc.
1223 This macro need not do anything if the argument in question was
1224 passed on the stack. The compiler knows how to track the amount
1225 of stack space used for arguments without any special help. */
1227 #define FUNCTION_ARG_REGNO_P(r) function_arg_regno_p(r)
1228 /* A C expression that is nonzero if REGNO is the number of a hard
1229 register in which function arguments are sometimes passed. This
1230 does *not* include implicit arguments such as the static chain and
1231 the structure-value address. On many machines, no registers can be
1232 used for this purpose since all function arguments are pushed on
1235 extern int avr_reg_order[];
1237 #define RET_REGISTER avr_ret_register ()
1239 #define FUNCTION_VALUE(VALTYPE, FUNC) avr_function_value (VALTYPE, FUNC)
1240 /* A C expression to create an RTX representing the place where a
1241 function returns a value of data type VALTYPE. VALTYPE is a tree
1242 node representing a data type. Write `TYPE_MODE (VALTYPE)' to get
1243 the machine mode used to represent that type. On many machines,
1244 only the mode is relevant. (Actually, on most machines, scalar
1245 values are returned in the same place regardless of mode).
1247 The value of the expression is usually a `reg' RTX for the hard
1248 register where the return value is stored. The value can also be a
1249 `parallel' RTX, if the return value is in multiple places. See
1250 `FUNCTION_ARG' for an explanation of the `parallel' form.
1252 If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same
1253 promotion rules specified in `PROMOTE_MODE' if VALTYPE is a scalar
1256 If the precise function being called is known, FUNC is a tree node
1257 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
1258 makes it possible to use a different value-returning convention
1259 for specific functions when all their calls are known.
1261 `FUNCTION_VALUE' is not used for return vales with aggregate data
1262 types, because these are returned in another way. See
1263 `STRUCT_VALUE_REGNUM' and related macros, below. */
1265 #define LIBCALL_VALUE(MODE) avr_libcall_value (MODE)
1266 /* A C expression to create an RTX representing the place where a
1267 library function returns a value of mode MODE. If the precise
1268 function being called is known, FUNC is a tree node
1269 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
1270 makes it possible to use a different value-returning convention
1271 for specific functions when all their calls are known.
1273 Note that "library function" in this context means a compiler
1274 support routine, used to perform arithmetic, whose name is known
1275 specially by the compiler and was not mentioned in the C code being
1278 The definition of `LIBRARY_VALUE' need not be concerned aggregate
1279 data types, because none of the library functions returns such
1282 #define FUNCTION_VALUE_REGNO_P(N) ((N) == RET_REGISTER)
1283 /* A C expression that is nonzero if REGNO is the number of a hard
1284 register in which the values of called function may come back.
1286 A register whose use for returning values is limited to serving as
1287 the second of a pair (for a value of type `double', say) need not
1288 be recognized by this macro. So for most machines, this definition
1291 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
1293 If the machine has register windows, so that the caller and the
1294 called function use different registers for the return value, this
1295 macro should recognize only the caller's register numbers. */
1297 #define RETURN_IN_MEMORY(TYPE) ((TYPE_MODE (TYPE) == BLKmode) \
1298 ? int_size_in_bytes (TYPE) > 8 \
1300 /* A C expression which can inhibit the returning of certain function
1301 values in registers, based on the type of value. A nonzero value
1302 says to return the function value in memory, just as large
1303 structures are always returned. Here TYPE will be a C expression
1304 of type `tree', representing the data type of the value.
1306 Note that values of mode `BLKmode' must be explicitly handled by
1307 this macro. Also, the option `-fpcc-struct-return' takes effect
1308 regardless of this macro. On most systems, it is possible to
1309 leave the macro undefined; this causes a default definition to be
1310 used, whose value is the constant 1 for `BLKmode' values, and 0
1313 Do not use this macro to indicate that structures and unions
1314 should always be returned in memory. You should instead use
1315 `DEFAULT_PCC_STRUCT_RETURN' to indicate this. */
1317 #define DEFAULT_PCC_STRUCT_RETURN 0
1318 /* Define this macro to be 1 if all structure and union return values
1319 must be in memory. Since this results in slower code, this should
1320 be defined only if needed for compatibility with other compilers
1321 or with an ABI. If you define this macro to be 0, then the
1322 conventions used for structure and union return values are decided
1323 by the `RETURN_IN_MEMORY' macro.
1325 If not defined, this defaults to the value 1. */
1327 #define STRUCT_VALUE 0
1328 /* If the structure value address is not passed in a register, define
1329 `STRUCT_VALUE' as an expression returning an RTX for the place
1330 where the address is passed. If it returns 0, the address is
1331 passed as an "invisible" first argument. */
1333 #define STRUCT_VALUE_INCOMING 0
1334 /* If the incoming location is not a register, then you should define
1335 `STRUCT_VALUE_INCOMING' as an expression for an RTX for where the
1336 called function should find the value. If it should find the
1337 value on the stack, define this to create a `mem' which refers to
1338 the frame pointer. A definition of 0 means that the address is
1339 passed as an "invisible" first argument. */
1341 #define FUNCTION_PROLOGUE(FILE, SIZE) function_prologue (FILE, SIZE)
1342 /* A C compound statement that outputs the assembler code for entry
1343 to a function. The prologue is responsible for setting up the
1344 stack frame, initializing the frame pointer register, saving
1345 registers that must be saved, and allocating SIZE additional bytes
1346 of storage for the local variables. SIZE is an integer. FILE is
1347 a stdio stream to which the assembler code should be output.
1349 The label for the beginning of the function need not be output by
1350 this macro. That has already been done when the macro is run.
1352 To determine which registers to save, the macro can refer to the
1353 array `regs_ever_live': element R is nonzero if hard register R is
1354 used anywhere within the function. This implies the function
1355 prologue should save register R, provided it is not one of the
1356 call-used registers. (`FUNCTION_EPILOGUE' must likewise use
1359 On machines that have "register windows", the function entry code
1360 does not save on the stack the registers that are in the windows,
1361 even if they are supposed to be preserved by function calls;
1362 instead it takes appropriate steps to "push" the register stack,
1363 if any non-call-used registers are used in the function.
1365 On machines where functions may or may not have frame-pointers, the
1366 function entry code must vary accordingly; it must set up the frame
1367 pointer if one is wanted, and not otherwise. To determine whether
1368 a frame pointer is in wanted, the macro can refer to the variable
1369 `frame_pointer_needed'. The variable's value will be 1 at run
1370 time in a function that needs a frame pointer. *Note
1373 The function entry code is responsible for allocating any stack
1374 space required for the function. This stack space consists of the
1375 regions listed below. In most cases, these regions are allocated
1376 in the order listed, with the last listed region closest to the
1377 top of the stack (the lowest address if `STACK_GROWS_DOWNWARD' is
1378 defined, and the highest address if it is not defined). You can
1379 use a different order for a machine if doing so is more convenient
1380 or required for compatibility reasons. Except in cases where
1381 required by standard or by a debugger, there is no reason why the
1382 stack layout used by GCC need agree with that used by other
1383 compilers for a machine.
1385 * A region of `current_function_pretend_args_size' bytes of
1386 uninitialized space just underneath the first argument
1387 arriving on the stack. (This may not be at the very start of
1388 the allocated stack region if the calling sequence has pushed
1389 anything else since pushing the stack arguments. But
1390 usually, on such machines, nothing else has been pushed yet,
1391 because the function prologue itself does all the pushing.)
1392 This region is used on machines where an argument may be
1393 passed partly in registers and partly in memory, and, in some
1394 cases to support the features in `varargs.h' and `stdargs.h'.
1396 * An area of memory used to save certain registers used by the
1397 function. The size of this area, which may also include
1398 space for such things as the return address and pointers to
1399 previous stack frames, is machine-specific and usually
1400 depends on which registers have been used in the function.
1401 Machines with register windows often do not require a save
1404 * A region of at least SIZE bytes, possibly rounded up to an
1405 allocation boundary, to contain the local variables of the
1406 function. On some machines, this region and the save area
1407 may occur in the opposite order, with the save area closer to
1408 the top of the stack.
1410 * Optionally, when `ACCUMULATE_OUTGOING_ARGS' is defined, a
1411 region of `current_function_outgoing_args_size' bytes to be
1412 used for outgoing argument lists of the function. *Note
1415 Normally, it is necessary for the macros `FUNCTION_PROLOGUE' and
1416 `FUNCTION_EPILOGE' to treat leaf functions specially. The C
1417 variable `leaf_function' is nonzero for such a function. */
1419 #define EPILOGUE_USES(REGNO) 0
1420 /* Define this macro as a C expression that is nonzero for registers
1421 are used by the epilogue or the `return' pattern. The stack and
1422 frame pointer registers are already be assumed to be used as
1425 #define FUNCTION_EPILOGUE(FILE, SIZE) function_epilogue (FILE, SIZE)
1426 /* A C compound statement that outputs the assembler code for exit
1427 from a function. The epilogue is responsible for restoring the
1428 saved registers and stack pointer to their values when the
1429 function was called, and returning control to the caller. This
1430 macro takes the same arguments as the macro `FUNCTION_PROLOGUE',
1431 and the registers to restore are determined from `regs_ever_live'
1432 and `CALL_USED_REGISTERS' in the same way.
1434 On some machines, there is a single instruction that does all the
1435 work of returning from the function. On these machines, give that
1436 instruction the name `return' and do not define the macro
1437 `FUNCTION_EPILOGUE' at all.
1439 Do not define a pattern named `return' if you want the
1440 `FUNCTION_EPILOGUE' to be used. If you want the target switches
1441 to control whether return instructions or epilogues are used,
1442 define a `return' pattern with a validity condition that tests the
1443 target switches appropriately. If the `return' pattern's validity
1444 condition is false, epilogues will be used.
1446 On machines where functions may or may not have frame-pointers, the
1447 function exit code must vary accordingly. Sometimes the code for
1448 these two cases is completely different. To determine whether a
1449 frame pointer is wanted, the macro can refer to the variable
1450 `frame_pointer_needed'. The variable's value will be 1 when
1451 compiling a function that needs a frame pointer.
1453 Normally, `FUNCTION_PROLOGUE' and `FUNCTION_EPILOGUE' must treat
1454 leaf functions specially. The C variable `leaf_function' is
1455 nonzero for such a function. *Note Leaf Functions::.
1457 On some machines, some functions pop their arguments on exit while
1458 others leave that for the caller to do. For example, the 68020
1459 when given `-mrtd' pops arguments in functions that take a fixed
1460 number of arguments.
1462 Your definition of the macro `RETURN_POPS_ARGS' decides which
1463 functions pop their own arguments. `FUNCTION_EPILOGUE' needs to
1464 know what was decided. The variable that is called
1465 `current_function_pops_args' is the number of bytes of its
1466 arguments that a function should pop. *Note Scalar Return::. */
1468 #define STRICT_ARGUMENT_NAMING 1
1469 /* Define this macro if the location where a function argument is
1470 passed depends on whether or not it is a named argument.
1472 This macro controls how the NAMED argument to `FUNCTION_ARG' is
1473 set for varargs and stdarg functions. With this macro defined,
1474 the NAMED argument is always true for named arguments, and false
1475 for unnamed arguments. If this is not defined, but
1476 `SETUP_INCOMING_VARARGS' is defined, then all arguments are
1477 treated as named. Otherwise, all named arguments except the last
1478 are treated as named. */
1481 #define HAVE_POST_INCREMENT 1
1482 /* Define this macro if the machine supports post-increment
1485 #define HAVE_PRE_DECREMENT 1
1486 /* #define HAVE_PRE_INCREMENT
1487 #define HAVE_POST_DECREMENT */
1488 /* Similar for other kinds of addressing. */
1490 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
1491 /* A C expression that is 1 if the RTX X is a constant which is a
1492 valid address. On most machines, this can be defined as
1493 `CONSTANT_P (X)', but a few machines are more restrictive in which
1494 constant addresses are supported.
1496 `CONSTANT_P' accepts integer-values expressions whose values are
1497 not explicitly known, such as `symbol_ref', `label_ref', and
1498 `high' expressions and `const' arithmetic expressions, in addition
1499 to `const_int' and `const_double' expressions. */
1501 #define MAX_REGS_PER_ADDRESS 1
1502 /* A number, the maximum number of registers that can appear in a
1503 valid memory address. Note that it is up to you to specify a
1504 value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS'
1505 would ever accept. */
1507 #ifdef REG_OK_STRICT
1508 # define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \
1510 if (legitimate_address_p (mode, operand, 1)) \
1514 # define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \
1516 if (legitimate_address_p (mode, operand, 0)) \
1520 /* A C compound statement with a conditional `goto LABEL;' executed
1521 if X (an RTX) is a legitimate memory address on the target machine
1522 for a memory operand of mode MODE.
1524 It usually pays to define several simpler macros to serve as
1525 subroutines for this one. Otherwise it may be too complicated to
1528 This macro must exist in two variants: a strict variant and a
1529 non-strict one. The strict variant is used in the reload pass. It
1530 must be defined so that any pseudo-register that has not been
1531 allocated a hard register is considered a memory reference. In
1532 contexts where some kind of register is required, a pseudo-register
1533 with no hard register must be rejected.
1535 The non-strict variant is used in other passes. It must be
1536 defined to accept all pseudo-registers in every context where some
1537 kind of register is required.
1539 Compiler source files that want to use the strict variant of this
1540 macro define the macro `REG_OK_STRICT'. You should use an `#ifdef
1541 REG_OK_STRICT' conditional to define the strict variant in that
1542 case and the non-strict variant otherwise.
1544 Subroutines to check for acceptable registers for various purposes
1545 (one for base registers, one for index registers, and so on) are
1546 typically among the subroutines used to define
1547 `GO_IF_LEGITIMATE_ADDRESS'. Then only these subroutine macros
1548 need have two variants; the higher levels of macros may be the
1549 same whether strict or not.
1551 Normally, constant addresses which are the sum of a `symbol_ref'
1552 and an integer are stored inside a `const' RTX to mark them as
1553 constant. Therefore, there is no need to recognize such sums
1554 specifically as legitimate addresses. Normally you would simply
1555 recognize any `const' as legitimate.
1557 Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant
1558 sums that are not marked with `const'. It assumes that a naked
1559 `plus' indicates indexing. If so, then you *must* reject such
1560 naked constant sums as illegitimate addresses, so that none of
1561 them will be given to `PRINT_OPERAND_ADDRESS'.
1563 On some machines, whether a symbolic address is legitimate depends
1564 on the section that the address refers to. On these machines,
1565 define the macro `ENCODE_SECTION_INFO' to store the information
1566 into the `symbol_ref', and then check for it here. When you see a
1567 `const', you will have to look inside it to find the `symbol_ref'
1568 in order to determine the section. *Note Assembler Format::.
1570 The best way to modify the name string is by adding text to the
1571 beginning, with suitable punctuation to prevent any ambiguity.
1572 Allocate the new name in `saveable_obstack'. You will have to
1573 modify `ASM_OUTPUT_LABELREF' to remove and decode the added text
1574 and output the name accordingly, and define `STRIP_NAME_ENCODING'
1575 to access the original name string.
1577 You can check the information stored here into the `symbol_ref' in
1578 the definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and
1579 `PRINT_OPERAND_ADDRESS'. */
1581 /* `REG_OK_FOR_BASE_P (X)'
1582 A C expression that is nonzero if X (assumed to be a `reg' RTX) is
1583 valid for use as a base register. For hard registers, it should
1584 always accept those which the hardware permits and reject the
1585 others. Whether the macro accepts or rejects pseudo registers
1586 must be controlled by `REG_OK_STRICT' as described above. This
1587 usually requires two variant definitions, of which `REG_OK_STRICT'
1588 controls the one actually used. */
1590 #define REG_OK_FOR_BASE_NOSTRICT_P(X) \
1591 (REGNO (X) >= FIRST_PSEUDO_REGISTER || REG_OK_FOR_BASE_STRICT_P(X))
1593 #define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
1595 #ifdef REG_OK_STRICT
1596 # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X)
1598 # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NOSTRICT_P (X)
1601 /* A C expression that is just like `REG_OK_FOR_BASE_P', except that
1602 that expression may examine the mode of the memory reference in
1603 MODE. You should define this macro if the mode of the memory
1604 reference affects whether a register may be used as a base
1605 register. If you define this macro, the compiler will use it
1606 instead of `REG_OK_FOR_BASE_P'. */
1607 #define REG_OK_FOR_INDEX_P(X) 0
1608 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is
1609 valid for use as an index register.
1611 The difference between an index register and a base register is
1612 that the index register may be scaled. If an address involves the
1613 sum of two registers, neither one of them scaled, then either one
1614 may be labeled the "base" and the other the "index"; but whichever
1615 labeling is used must fit the machine's constraints of which
1616 registers may serve in each capacity. The compiler will try both
1617 labelings, looking for one that is valid, and will reload one or
1618 both registers only if neither labeling works. */
1620 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
1622 (X) = legitimize_address (X, OLDX, MODE); \
1623 if (memory_address_p (MODE, X)) \
1626 /* A C compound statement that attempts to replace X with a valid
1627 memory address for an operand of mode MODE. WIN will be a C
1628 statement label elsewhere in the code; the macro definition may use
1630 GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
1632 to avoid further processing if the address has become legitimate.
1634 X will always be the result of a call to `break_out_memory_refs',
1635 and OLDX will be the operand that was given to that function to
1638 The code generated by this macro should not alter the substructure
1639 of X. If it transforms X into a more legitimate form, it should
1640 assign X (which will always be a C variable) a new value.
1642 It is not necessary for this macro to come up with a legitimate
1643 address. The compiler has standard ways of doing so in all cases.
1644 In fact, it is safe for this macro to do nothing. But often a
1645 machine-dependent strategy can generate better code. */
1647 #define XEXP_(X,Y) (X)
1648 #define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN) \
1650 if (1&&(GET_CODE (X) == POST_INC || GET_CODE (X) == PRE_DEC)) \
1652 push_reload (XEXP (X,0), XEXP (X,0), &XEXP (X,0), &XEXP (X,0), \
1653 POINTER_REGS, GET_MODE (X),GET_MODE (X) , 0, 0, \
1654 OPNUM, RELOAD_OTHER); \
1657 if (GET_CODE (X) == PLUS \
1658 && REG_P (XEXP (X, 0)) \
1659 && GET_CODE (XEXP (X, 1)) == CONST_INT \
1660 && INTVAL (XEXP (X, 1)) >= 1) \
1662 int fit = INTVAL (XEXP (X, 1)) <= (64 - GET_MODE_SIZE (MODE)); \
1665 if (reg_equiv_address[REGNO (XEXP (X, 0))] != 0) \
1667 int regno = REGNO (XEXP (X, 0)); \
1668 rtx mem = make_memloc (X, regno); \
1669 push_reload (XEXP (mem,0), NULL_PTR, &XEXP (mem,0), NULL_PTR, \
1670 POINTER_REGS, Pmode, VOIDmode, 0, 0, \
1671 1, ADDR_TYPE (TYPE)); \
1672 push_reload (mem, NULL_RTX, &XEXP (X, 0), NULL_PTR, \
1673 BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \
1677 push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL_PTR, \
1678 BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \
1682 else if (! (frame_pointer_needed && XEXP (X,0) == frame_pointer_rtx)) \
1684 push_reload (X, NULL_RTX, &X, NULL_PTR, \
1685 POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \
1691 /* A C compound statement that attempts to replace X, which is an
1692 address that needs reloading, with a valid memory address for an
1693 operand of mode MODE. WIN will be a C statement label elsewhere
1694 in the code. It is not necessary to define this macro, but it
1695 might be useful for performance reasons.
1697 For example, on the i386, it is sometimes possible to use a single
1698 reload register instead of two by reloading a sum of two pseudo
1699 registers into a register. On the other hand, for number of RISC
1700 processors offsets are limited so that often an intermediate
1701 address needs to be generated in order to address a stack slot.
1702 By defining LEGITIMIZE_RELOAD_ADDRESS appropriately, the
1703 intermediate addresses generated for adjacent some stack slots can
1704 be made identical, and thus be shared.
1706 *Note*: This macro should be used with caution. It is necessary
1707 to know something of how reload works in order to effectively use
1708 this, and it is quite easy to produce macros that build in too
1709 much knowledge of reload internals.
1711 *Note*: This macro must be able to reload an address created by a
1712 previous invocation of this macro. If it fails to handle such
1713 addresses then the compiler may generate incorrect code or abort.
1715 The macro definition should use `push_reload' to indicate parts
1716 that need reloading; OPNUM, TYPE and IND_LEVELS are usually
1717 suitable to be passed unaltered to `push_reload'.
1719 The code generated by this macro must not alter the substructure of
1720 X. If it transforms X into a more legitimate form, it should
1721 assign X (which will always be a C variable) a new value. This
1722 also applies to parts that you change indirectly by calling
1725 The macro definition may use `strict_memory_address_p' to test if
1726 the address has become legitimate.
1728 If you want to change only a part of X, one standard way of doing
1729 this is to use `copy_rtx'. Note, however, that is unshares only a
1730 single level of rtl. Thus, if the part to be changed is not at the
1731 top level, you'll need to replace first the top leve It is not
1732 necessary for this macro to come up with a legitimate address;
1733 but often a machine-dependent strategy can generate better code. */
1735 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
1736 if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) \
1738 /* A C statement or compound statement with a conditional `goto
1739 LABEL;' executed if memory address X (an RTX) can have different
1740 meanings depending on the machine mode of the memory reference it
1741 is used for or if the address is valid for some modes but not
1744 Autoincrement and autodecrement addresses typically have
1745 mode-dependent effects because the amount of the increment or
1746 decrement is the size of the operand being addressed. Some
1747 machines have other mode-dependent addresses. Many RISC machines
1748 have no mode-dependent addresses.
1750 You may assume that ADDR is a valid address for the machine. */
1752 #define LEGITIMATE_CONSTANT_P(X) 1
1753 /* A C expression that is nonzero if X is a legitimate constant for
1754 an immediate operand on the target machine. You can assume that X
1755 satisfies `CONSTANT_P', so you need not check this. In fact, `1'
1756 is a suitable definition for this macro on machines where anything
1757 `CONSTANT_P' is valid. */
1759 #define CONST_COSTS(x,CODE,OUTER_CODE) \
1761 if (OUTER_CODE == PLUS \
1762 || OUTER_CODE == IOR \
1763 || OUTER_CODE == AND \
1764 || OUTER_CODE == MINUS \
1765 || OUTER_CODE == SET \
1766 || INTVAL (x) == 0) \
1768 if (OUTER_CODE == COMPARE \
1769 && INTVAL (x) >= 0 \
1770 && INTVAL (x) <= 255) \
1776 case CONST_DOUBLE: \
1779 /* A part of a C `switch' statement that describes the relative costs
1780 of constant RTL expressions. It must contain `case' labels for
1781 expression codes `const_int', `const', `symbol_ref', `label_ref'
1782 and `const_double'. Each case must ultimately reach a `return'
1783 statement to return the relative cost of the use of that kind of
1784 constant value in an expression. The cost may depend on the
1785 precise value of the constant, which is available for examination
1786 in X, and the rtx code of the expression in which it is contained,
1787 found in OUTER_CODE.
1789 CODE is the expression code--redundant, since it can be obtained
1790 with `GET_CODE (X)'. */
1792 #define DEFAULT_RTX_COSTS(x, code, outer_code) \
1794 int cst = default_rtx_costs (x, code, outer_code); \
1802 /* Like `CONST_COSTS' but applies to nonconstant RTL expressions.
1803 This can be used, for example, to indicate how costly a multiply
1804 instruction is. In writing this macro, you can use the construct
1805 `COSTS_N_INSNS (N)' to specify a cost equal to N fast
1806 instructions. OUTER_CODE is the code of the expression in which X
1809 This macro is optional; do not define it if the default cost
1810 assumptions are adequate for the target machine. */
1812 #define ADDRESS_COST(ADDRESS) avr_address_cost (ADDRESS)
1814 /* An expression giving the cost of an addressing mode that contains
1815 ADDRESS. If not defined, the cost is computed from the ADDRESS
1816 expression and the `CONST_COSTS' values.
1818 For most CISC machines, the default cost is a good approximation
1819 of the true cost of the addressing mode. However, on RISC
1820 machines, all instructions normally have the same length and
1821 execution time. Hence all addresses will have equal costs.
1823 In cases where more than one form of an address is known, the form
1824 with the lowest cost will be used. If multiple forms have the
1825 same, lowest, cost, the one that is the most complex will be used.
1827 For example, suppose an address that is equal to the sum of a
1828 register and a constant is used twice in the same basic block.
1829 When this macro is not defined, the address will be computed in a
1830 register and memory references will be indirect through that
1831 register. On machines where the cost of the addressing mode
1832 containing the sum is no higher than that of a simple indirect
1833 reference, this will produce an additional instruction and
1834 possibly require an additional register. Proper specification of
1835 this macro eliminates this overhead for such machines.
1837 Similar use of this macro is made in strength reduction of loops.
1839 ADDRESS need not be valid as an address. In such a case, the cost
1840 is not relevant and can be any value; invalid addresses need not be
1841 assigned a different cost.
1843 On machines where an address involving more than one register is as
1844 cheap as an address computation involving only one register,
1845 defining `ADDRESS_COST' to reflect this can cause two registers to
1846 be live over a region of code where only one would have been if
1847 `ADDRESS_COST' were not defined in that manner. This effect should
1848 be considered in the definition of this macro. Equivalent costs
1849 should probably only be given to addresses with different numbers
1850 of registers on machines with lots of registers.
1852 This macro will normally either not be defined or be defined as a
1855 #define REGISTER_MOVE_COST(FROM, TO) ((FROM) == STACK_REG ? 6 : \
1856 (TO) == STACK_REG ? 12 \
1858 /* A C expression for the cost of moving data from a register in class
1859 FROM to one in class TO. The classes are expressed using the
1860 enumeration values such as `GENERAL_REGS'. A value of 2 is the
1861 default; other values are interpreted relative to that.
1863 It is not required that the cost always equal 2 when FROM is the
1864 same as TO; on some machines it is expensive to move between
1865 registers if they are not general registers.
1867 If reload sees an insn consisting of a single `set' between two
1868 hard registers, and if `REGISTER_MOVE_COST' applied to their
1869 classes returns a value of 2, reload does not check to ensure that
1870 the constraints of the insn are met. Setting a cost of other than
1871 2 will allow reload to verify that the constraints are met. You
1872 should do this if the `movM' pattern's constraints do not allow
1875 #define MEMORY_MOVE_COST(MODE,CLASS,IN) ((MODE)==QImode ? 2 : \
1876 (MODE)==HImode ? 4 : \
1877 (MODE)==SImode ? 8 : \
1878 (MODE)==SFmode ? 8 : 16)
1879 /* A C expression for the cost of moving data of mode M between a
1880 register and memory. A value of 4 is the default; this cost is
1881 relative to those in `REGISTER_MOVE_COST'.
1883 If moving between registers and memory is more expensive than
1884 between two registers, you should define this macro to express the
1887 #define SLOW_BYTE_ACCESS 0
1888 /* Define this macro as a C expression which is nonzero if accessing
1889 less than a word of memory (i.e. a `char' or a `short') is no
1890 faster than accessing a word of memory, i.e., if such access
1891 require more than one instruction or if there is no difference in
1892 cost between byte and (aligned) word loads.
1894 When this macro is not defined, the compiler will access a field by
1895 finding the smallest containing object; when it is defined, a
1896 fullword load will be used if alignment permits. Unless bytes
1897 accesses are faster than word accesses, using word accesses is
1898 preferable since it may eliminate subsequent memory access if
1899 subsequent accesses occur to other fields in the same word of the
1900 structure, but to different bytes.
1903 Define this macro if zero-extension (of a `char' or `short' to an
1904 `int') can be done faster if the destination is a register that is
1907 If you define this macro, you must have instruction patterns that
1908 recognize RTL structures like this:
1910 (set (strict_low_part (subreg:QI (reg:SI ...) 0)) ...)
1912 and likewise for `HImode'.
1914 `SLOW_UNALIGNED_ACCESS'
1915 Define this macro to be the value 1 if unaligned accesses have a
1916 cost many times greater than aligned accesses, for example if they
1917 are emulated in a trap handler.
1919 When this macro is non-zero, the compiler will act as if
1920 `STRICT_ALIGNMENT' were non-zero when generating code for block
1921 moves. This can cause significantly more instructions to be
1922 produced. Therefore, do not set this macro non-zero if unaligned
1923 accesses only add a cycle or two to the time for a memory access.
1925 If the value of this macro is always zero, it need not be defined.
1928 Define this macro to inhibit strength reduction of memory
1929 addresses. (On some machines, such strength reduction seems to do
1930 harm rather than good.)
1933 The number of scalar move insns which should be generated instead
1934 of a string move insn or a library call. Increasing the value
1935 will always make code faster, but eventually incurs high cost in
1936 increased code size.
1938 If you don't define this, a reasonable default is used. */
1940 #define NO_FUNCTION_CSE
1941 /* Define this macro if it is as good or better to call a constant
1942 function address than to call an address kept in a register. */
1944 #define NO_RECURSIVE_FUNCTION_CSE
1945 /* Define this macro if it is as good or better for a function to call
1946 itself with an explicit address than to call an address kept in a
1949 `ADJUST_COST (INSN, LINK, DEP_INSN, COST)'
1950 A C statement (sans semicolon) to update the integer variable COST
1951 based on the relationship between INSN that is dependent on
1952 DEP_INSN through the dependence LINK. The default is to make no
1953 adjustment to COST. This can be used for example to specify to
1954 the scheduler that an output- or anti-dependence does not incur
1955 the same cost as a data-dependence.
1957 `ADJUST_PRIORITY (INSN)'
1958 A C statement (sans semicolon) to update the integer scheduling
1959 priority `INSN_PRIORITY(INSN)'. Reduce the priority to execute
1960 the INSN earlier, increase the priority to execute INSN later.
1961 Do not define this macro if you do not need to adjust the
1962 scheduling priorities of insns. */
1965 #define TEXT_SECTION_ASM_OP ".text"
1966 /* A C expression whose value is a string containing the assembler
1967 operation that should precede instructions and read-only data.
1968 Normally `".text"' is right. */
1970 #define DATA_SECTION_ASM_OP ".data"
1971 /* A C expression whose value is a string containing the assembler
1972 operation to identify the following data as writable initialized
1973 data. Normally `".data"' is right. */
1975 #define EXTRA_SECTIONS in_progmem
1976 /* A list of names for sections other than the standard two, which are
1977 `in_text' and `in_data'. You need not define this macro on a
1978 system with no other sections (that GCC needs to use). */
1980 #define EXTRA_SECTION_FUNCTIONS \
1983 progmem_section (void) \
1985 if (in_section != in_progmem) \
1987 fprintf (asm_out_file, ".section .progmem.gcc_sw_table\n"); \
1988 in_section = in_progmem; \
1991 /* `EXTRA_SECTION_FUNCTIONS'
1992 One or more functions to be defined in `varasm.c'. These
1993 functions should do jobs analogous to those of `text_section' and
1994 `data_section', for your additional sections. Do not define this
1995 macro if you do not define `EXTRA_SECTIONS'. */
1997 #define READONLY_DATA_SECTION data_section
1998 /* On most machines, read-only variables, constants, and jump tables
1999 are placed in the text section. If this is not the case on your
2000 machine, this macro should be defined to be the name of a function
2001 (either `data_section' or a function defined in `EXTRA_SECTIONS')
2002 that switches to the section to be used for read-only items.
2004 If these items should be placed in the text section, this macro
2005 should not be defined. */
2007 /* `SELECT_SECTION (EXP, RELOC)'
2008 A C statement or statements to switch to the appropriate section
2009 for output of EXP. You can assume that EXP is either a `VAR_DECL'
2010 node or a constant of some sort. RELOC indicates whether the
2011 initial value of EXP requires link-time relocations. Select the
2012 section by calling `text_section' or one of the alternatives for
2015 Do not define this macro if you put all read-only variables and
2016 constants in the read-only data section (usually the text section). */
2018 /* `SELECT_RTX_SECTION (MODE, RTX)'
2019 A C statement or statements to switch to the appropriate section
2020 for output of RTX in mode MODE. You can assume that RTX is some
2021 kind of constant in RTL. The argument MODE is redundant except in
2022 the case of a `const_int' rtx. Select the section by calling
2023 `text_section' or one of the alternatives for other sections.
2025 Do not define this macro if you put all constants in the read-only
2028 #define JUMP_TABLES_IN_TEXT_SECTION 1
2029 /* Define this macro if jump tables (for `tablejump' insns) should be
2030 output in the text section, along with the assembler instructions.
2031 Otherwise, the readonly data section is used.
2033 This macro is irrelevant if there is no separate readonly data
2036 #define ENCODE_SECTION_INFO(DECL) encode_section_info(DECL)
2037 /* Define this macro if references to a symbol must be treated
2038 differently depending on something about the variable or function
2039 named by the symbol (such as what section it is in).
2041 The macro definition, if any, is executed immediately after the
2042 rtl for DECL has been created and stored in `DECL_RTL (DECL)'.
2043 The value of the rtl will be a `mem' whose address is a
2046 The usual thing for this macro to do is to record a flag in the
2047 `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified
2048 name string in the `symbol_ref' (if one bit is not enough
2051 #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
2052 (VAR) = (SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*' || (SYMBOL_NAME)[0] == '@');
2053 /* `STRIP_NAME_ENCODING (VAR, SYM_NAME)'
2054 Decode SYM_NAME and store the real name part in VAR, sans the
2055 characters that encode section info. Define this macro if
2056 `ENCODE_SECTION_INFO' alters the symbol's name string. */
2057 /* `UNIQUE_SECTION_P (DECL)'
2058 A C expression which evaluates to true if DECL should be placed
2059 into a unique section for some target-specific reason. If you do
2060 not define this macro, the default is `0'. Note that the flag
2061 `-ffunction-sections' will also cause functions to be placed into
2064 #define UNIQUE_SECTION(DECL, RELOC) unique_section (DECL, RELOC)
2065 /* `UNIQUE_SECTION (DECL, RELOC)'
2066 A C statement to build up a unique section name, expressed as a
2067 STRING_CST node, and assign it to `DECL_SECTION_NAME (DECL)'.
2068 RELOC indicates whether the initial value of EXP requires
2069 link-time relocations. If you do not define this macro, GNU CC
2070 will use the symbol name prefixed by `.' as the section name. */
2073 #define ASM_FILE_START(STREAM) asm_file_start (STREAM)
2074 /* A C expression which outputs to the stdio stream STREAM some
2075 appropriate text to go at the start of an assembler file.
2077 Normally this macro is defined to output a line containing
2078 `#NO_APP', which is a comment that has no effect on most
2079 assemblers but tells the GNU assembler that it can save time by not
2080 checking for certain assembler constructs.
2082 On systems that use SDB, it is necessary to output certain
2083 commands; see `attasm.h'. */
2085 #define ASM_FILE_END(STREAM) asm_file_end (STREAM)
2086 /* A C expression which outputs to the stdio stream STREAM some
2087 appropriate text to go at the end of an assembler file.
2089 If this macro is not defined, the default is to output nothing
2090 special at the end of the file. Most systems don't require any
2093 On systems that use SDB, it is necessary to output certain
2094 commands; see `attasm.h'. */
2096 #define ASM_COMMENT_START " ; "
2097 /* A C string constant describing how to begin a comment in the target
2098 assembler language. The compiler assumes that the comment will
2099 end at the end of the line. */
2101 #define ASM_APP_ON "/* #APP */\n"
2102 /* A C string constant for text to be output before each `asm'
2103 statement or group of consecutive ones. Normally this is
2104 `"#APP"', which is a comment that has no effect on most assemblers
2105 but tells the GNU assembler that it must check the lines that
2106 follow for all valid assembler constructs. */
2108 #define ASM_APP_OFF "/* #NOAPP */\n"
2109 /* A C string constant for text to be output after each `asm'
2110 statement or group of consecutive ones. Normally this is
2111 `"#NO_APP"', which tells the GNU assembler to resume making the
2112 time-saving assumptions that are valid for ordinary compiler
2115 #define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) fprintf (STREAM,"/* line: %d */\n",LINE)
2116 /* A C statement to output DBX or SDB debugging information before
2117 code for line number LINE of the current source file to the stdio
2120 This macro need not be defined if the standard form of debugging
2121 information for the debugger in use is appropriate. */
2123 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
2124 asm_output_section_name(FILE, DECL, NAME, RELOC)
2126 /* `ASM_OUTPUT_SECTION_NAME (STREAM, DECL, NAME, RELOC)'
2127 A C statement to output something to the assembler file to switch
2128 to section NAME for object DECL which is either a `FUNCTION_DECL',
2129 a `VAR_DECL' or `NULL_TREE'. RELOC indicates whether the initial
2130 value of EXP requires link-time relocations. Some target formats
2131 do not support arbitrary sections. Do not define this macro in
2134 At present this macro is only used to support section attributes.
2135 When this macro is undefined, section attributes are disabled. */
2137 #define OBJC_PROLOGUE {}
2138 /* A C statement to output any assembler statements which are
2139 required to precede any Objective C object definitions or message
2140 sending. The statement is executed only when compiling an
2141 Objective C program. */
2145 #define ASM_OUTPUT_DOUBLE(STREAM, VALUE) fprintf (STREAM, "no double float %.20e\n", VALUE)
2146 #define ASM_OUTPUT_FLOAT(STREAM, VALUE) asm_output_float (STREAM, VALUE)
2147 /* `ASM_OUTPUT_LONG_DOUBLE (STREAM, VALUE)'
2148 `ASM_OUTPUT_THREE_QUARTER_FLOAT (STREAM, VALUE)'
2149 `ASM_OUTPUT_SHORT_FLOAT (STREAM, VALUE)'
2150 `ASM_OUTPUT_BYTE_FLOAT (STREAM, VALUE)'
2151 A C statement to output to the stdio stream STREAM an assembler
2152 instruction to assemble a floating-point constant of `TFmode',
2153 `DFmode', `SFmode', `TQFmode', `HFmode', or `QFmode',
2154 respectively, whose value is VALUE. VALUE will be a C expression
2155 of type `REAL_VALUE_TYPE'. Macros such as
2156 `REAL_VALUE_TO_TARGET_DOUBLE' are useful for writing these
2160 #define ASM_OUTPUT_INT(FILE, VALUE) \
2161 ( fprintf (FILE, "\t.long "), \
2162 output_addr_const (FILE, (VALUE)), \
2165 /* Likewise for `short' and `char' constants. */
2167 #define ASM_OUTPUT_SHORT(FILE,VALUE) asm_output_short(FILE,VALUE)
2168 #define ASM_OUTPUT_CHAR(FILE,VALUE) asm_output_char(FILE,VALUE)
2170 /* `ASM_OUTPUT_QUADRUPLE_INT (STREAM, EXP)'
2171 A C statement to output to the stdio stream STREAM an assembler
2172 instruction to assemble an integer of 16, 8, 4, 2 or 1 bytes,
2173 respectively, whose value is VALUE. The argument EXP will be an
2174 RTL expression which represents a constant value. Use
2175 `output_addr_const (STREAM, EXP)' to output this value as an
2176 assembler expression.
2178 For sizes larger than `UNITS_PER_WORD', if the action of a macro
2179 would be identical to repeatedly calling the macro corresponding to
2180 a size of `UNITS_PER_WORD', once for each word, you need not define
2184 #define ASM_OUTPUT_BYTE(FILE,VALUE) asm_output_byte (FILE,VALUE)
2185 /* A C statement to output to the stdio stream STREAM an assembler
2186 instruction to assemble a single byte containing the number VALUE. */
2188 #define ASM_BYTE_OP ".byte "
2189 /* A C string constant giving the pseudo-op to use for a sequence of
2190 single-byte constants. If this macro is not defined, the default
2193 #define ASM_OUTPUT_ASCII(FILE, P, SIZE) gas_output_ascii (FILE,P,SIZE)
2194 /* `ASM_OUTPUT_ASCII (STREAM, PTR, LEN)'
2195 output_ascii (FILE, P, SIZE)
2196 A C statement to output to the stdio stream STREAM an assembler
2197 instruction to assemble a string constant containing the LEN bytes
2198 at PTR. PTR will be a C expression of type `char *' and LEN a C
2199 expression of type `int'.
2201 If the assembler has a `.ascii' pseudo-op as found in the Berkeley
2202 Unix assembler, do not define the macro `ASM_OUTPUT_ASCII'. */
2204 #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '\n' \
2206 /* Define this macro as a C expression which is nonzero if C is used
2207 as a logical line separator by the assembler.
2209 If you do not define this macro, the default is that only the
2210 character `;' is treated as a logical line separator. */
2212 #define ASM_OPEN_PAREN "("
2213 #define ASM_CLOSE_PAREN ")"
2214 /* These macros are defined as C string constant, describing the
2215 syntax in the assembler for grouping arithmetic expressions. The
2216 following definitions are correct for most assemblers:
2218 #define ASM_OPEN_PAREN "("
2219 #define ASM_CLOSE_PAREN ")"
2221 These macros are provided by `real.h' for writing the definitions of
2222 `ASM_OUTPUT_DOUBLE' and the like: */
2224 #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
2226 fputs ("\t.comm ", (STREAM)); \
2227 assemble_name ((STREAM), (NAME)); \
2228 fprintf ((STREAM), ",%d\n", (SIZE)); \
2230 /* A C statement (sans semicolon) to output to the stdio stream
2231 STREAM the assembler definition of a common-label named NAME whose
2232 size is SIZE bytes. The variable ROUNDED is the size rounded up
2233 to whatever alignment the caller wants.
2235 Use the expression `assemble_name (STREAM, NAME)' to output the
2236 name itself; before and after that, output the additional
2237 assembler syntax for defining the name, and a newline.
2239 This macro controls how the assembler definitions of uninitialized
2240 common global variables are output. */
2242 #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) \
2244 fputs ("\t.lcomm ", (STREAM)); \
2245 assemble_name ((STREAM), (NAME)); \
2246 fprintf ((STREAM), ",%d\n", (SIZE)); \
2248 /* A C statement (sans semicolon) to output to the stdio stream
2249 STREAM the assembler definition of a local-common-label named NAME
2250 whose size is SIZE bytes. The variable ROUNDED is the size
2251 rounded up to whatever alignment the caller wants.
2253 Use the expression `assemble_name (STREAM, NAME)' to output the
2254 name itself; before and after that, output the additional
2255 assembler syntax for defining the name, and a newline.
2257 This macro controls how the assembler definitions of uninitialized
2258 static variables are output. */
2260 #define ASM_OUTPUT_LABEL(STREAM, NAME) \
2262 assemble_name (STREAM, NAME); \
2263 fprintf (STREAM, ":\n"); \
2265 /* A C statement (sans semicolon) to output to the stdio stream
2266 STREAM the assembler definition of a label named NAME. Use the
2267 expression `assemble_name (STREAM, NAME)' to output the name
2268 itself; before and after that, output the additional assembler
2269 syntax for defining the name, and a newline. */
2274 #define TYPE_ASM_OP ".type"
2275 #define SIZE_ASM_OP ".size"
2276 #define WEAK_ASM_OP ".weak"
2277 /* Define the strings used for the special svr4 .type and .size directives.
2278 These strings generally do not vary from one system running svr4 to
2279 another, but if a given system (e.g. m88k running svr) needs to use
2280 different pseudo-op names for these, they may be overridden in the
2281 file which includes this one. */
2284 #undef TYPE_OPERAND_FMT
2285 #define TYPE_OPERAND_FMT "@%s"
2286 /* The following macro defines the format used to output the second
2287 operand of the .type assembler directive. Different svr4 assemblers
2288 expect various different forms for this operand. The one given here
2289 is just a default. You may need to override it in your machine-
2290 specific tm.h file (depending upon the particulars of your assembler). */
2293 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
2295 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
2296 assemble_name (FILE, NAME); \
2298 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
2299 putc ('\n', FILE); \
2300 ASM_OUTPUT_LABEL (FILE, NAME); \
2302 /* A C statement (sans semicolon) to output to the stdio stream
2303 STREAM any text necessary for declaring the name NAME of a
2304 function which is being defined. This macro is responsible for
2305 outputting the label definition (perhaps using
2306 `ASM_OUTPUT_LABEL'). The argument DECL is the `FUNCTION_DECL'
2307 tree node representing the function.
2309 If this macro is not defined, then the function name is defined in
2310 the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
2312 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
2314 if (!flag_inhibit_size_directive) \
2317 static int labelno; \
2319 ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
2320 ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
2321 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
2322 assemble_name (FILE, (FNAME)); \
2323 fprintf (FILE, ","); \
2324 assemble_name (FILE, label); \
2325 fprintf (FILE, "-"); \
2326 assemble_name (FILE, (FNAME)); \
2327 putc ('\n', FILE); \
2330 /* A C statement (sans semicolon) to output to the stdio stream
2331 STREAM any text necessary for declaring the size of a function
2332 which is being defined. The argument NAME is the name of the
2333 function. The argument DECL is the `FUNCTION_DECL' tree node
2334 representing the function.
2336 If this macro is not defined, then the function size is not
2339 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
2341 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
2342 assemble_name (FILE, NAME); \
2344 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
2345 putc ('\n', FILE); \
2346 size_directive_output = 0; \
2347 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
2349 size_directive_output = 1; \
2350 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
2351 assemble_name (FILE, NAME); \
2352 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
2354 ASM_OUTPUT_LABEL(FILE, NAME); \
2356 /* A C statement (sans semicolon) to output to the stdio stream
2357 STREAM any text necessary for declaring the name NAME of an
2358 initialized variable which is being defined. This macro must
2359 output the label definition (perhaps using `ASM_OUTPUT_LABEL').
2360 The argument DECL is the `VAR_DECL' tree node representing the
2363 If this macro is not defined, then the variable name is defined in
2364 the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
2366 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
2368 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
2369 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
2370 && ! AT_END && TOP_LEVEL \
2371 && DECL_INITIAL (DECL) == error_mark_node \
2372 && !size_directive_output) \
2374 size_directive_output = 1; \
2375 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
2376 assemble_name (FILE, name); \
2377 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
2380 /* A C statement (sans semicolon) to finish up declaring a variable
2381 name once the compiler has processed its initializer fully and
2382 thus has had a chance to determine the size of an array when
2383 controlled by an initializer. This is used on systems where it's
2384 necessary to declare something about the size of the object.
2386 If you don't define this macro, that is equivalent to defining it
2391 "\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\
2392 \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\
2393 \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\
2394 \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\
2395 \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\
2396 \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\
2397 \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\
2398 \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"
2399 /* A table of bytes codes used by the ASM_OUTPUT_ASCII and
2400 ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
2401 corresponds to a particular byte value [0..255]. For any
2402 given byte value, if the value in the corresponding table
2403 position is zero, the given character can be output directly.
2404 If the table value is 1, the byte must be output as a \ooo
2405 octal escape. If the tables value is anything else, then the
2406 byte value should be output as a \ followed by the value
2407 in the table. Note that we can use standard UN*X escape
2408 sequences for many control characters, but we don't use
2409 \a to represent BEL because some svr4 assemblers (e.g. on
2410 the i386) don't know about that. Also, we don't use \v
2411 since some versions of gas, such as 2.2 did not accept it. */
2413 #define STRING_LIMIT ((unsigned) 64)
2414 #define STRING_ASM_OP ".string"
2415 /* Some svr4 assemblers have a limit on the number of characters which
2416 can appear in the operand of a .string directive. If your assembler
2417 has such a limitation, you should define STRING_LIMIT to reflect that
2418 limit. Note that at least some svr4 assemblers have a limit on the
2419 actual number of bytes in the double-quoted string, and that they
2420 count each character in an escape sequence as one byte. Thus, an
2421 escape sequence like \377 would count as four bytes.
2423 If your target assembler doesn't support the .string directive, you
2424 should define this to zero. */
2426 #define ASM_GLOBALIZE_LABEL(STREAM, NAME) \
2428 fprintf (STREAM, ".global\t"); \
2429 assemble_name (STREAM, NAME); \
2430 fprintf (STREAM, "\n"); \
2434 /* A C statement (sans semicolon) to output to the stdio stream
2435 STREAM some commands that will make the label NAME global; that
2436 is, available for reference from other files. Use the expression
2437 `assemble_name (STREAM, NAME)' to output the name itself; before
2438 and after that, output the additional assembler syntax for making
2439 that name global, and a newline. */
2441 /* `ASM_WEAKEN_LABEL'
2442 A C statement (sans semicolon) to output to the stdio stream
2443 STREAM some commands that will make the label NAME weak; that is,
2444 available for reference from other files but only used if no other
2445 definition is available. Use the expression `assemble_name
2446 (STREAM, NAME)' to output the name itself; before and after that,
2447 output the additional assembler syntax for making that name weak,
2450 If you don't define this macro, GNU CC will not support weak
2451 symbols and you should not define the `SUPPORTS_WEAK' macro.
2454 A C expression which evaluates to true if the target supports weak
2457 If you don't define this macro, `defaults.h' provides a default
2458 definition. If `ASM_WEAKEN_LABEL' is defined, the default
2459 definition is `1'; otherwise, it is `0'. Define this macro if you
2460 want to control weak symbol support with a compiler flag such as
2463 `MAKE_DECL_ONE_ONLY'
2464 A C statement (sans semicolon) to mark DECL to be emitted as a
2465 public symbol such that extra copies in multiple translation units
2466 will be discarded by the linker. Define this macro if your object
2467 file format provides support for this concept, such as the `COMDAT'
2468 section flags in the Microsoft Windows PE/COFF format, and this
2469 support requires changes to DECL, such as putting it in a separate
2473 A C expression which evaluates to true if the target supports
2476 If you don't define this macro, `varasm.c' provides a default
2477 definition. If `MAKE_DECL_ONE_ONLY' is defined, the default
2478 definition is `1'; otherwise, it is `0'. Define this macro if you
2479 want to control weak symbol support with a compiler flag, or if
2480 setting the `DECL_ONE_ONLY' flag is enough to mark a declaration to
2481 be emitted as one-only. */
2483 #define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) \
2484 fprintf(STREAM, ".%s%d:\n", PREFIX, NUM)
2485 /* A C statement to output to the stdio stream STREAM a label whose
2486 name is made from the string PREFIX and the number NUM.
2488 It is absolutely essential that these labels be distinct from the
2489 labels used for user-level functions and variables. Otherwise,
2490 certain programs will have name conflicts with internal labels.
2492 It is desirable to exclude internal labels from the symbol table
2493 of the object file. Most assemblers have a naming convention for
2494 labels that should be excluded; on many systems, the letter `L' at
2495 the beginning of a label has this effect. You should find out what
2496 convention your system uses, and follow it.
2498 The usual definition of this macro is as follows:
2500 fprintf (STREAM, "L%s%d:\n", PREFIX, NUM) */
2502 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
2503 sprintf (STRING, "*.%s%d", PREFIX, NUM)
2504 /* A C statement to store into the string STRING a label whose name
2505 is made from the string PREFIX and the number NUM.
2507 This string, when output subsequently by `assemble_name', should
2508 produce the output that `ASM_OUTPUT_INTERNAL_LABEL' would produce
2509 with the same PREFIX and NUM.
2511 If the string begins with `*', then `assemble_name' will output
2512 the rest of the string unchanged. It is often convenient for
2513 `ASM_GENERATE_INTERNAL_LABEL' to use `*' in this way. If the
2514 string doesn't start with `*', then `ASM_OUTPUT_LABELREF' gets to
2515 output the string, and may change it. (Of course,
2516 `ASM_OUTPUT_LABELREF' is also part of your machine description, so
2517 you should know what it does on your machine.) */
2519 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
2520 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
2521 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
2523 /* A C expression to assign to OUTVAR (which is a variable of type
2524 `char *') a newly allocated string made from the string NAME and
2525 the number NUMBER, with some suitable punctuation added. Use
2526 `alloca' to get space for the string.
2528 The string will be used as an argument to `ASM_OUTPUT_LABELREF' to
2529 produce an assembler label for an internal static variable whose
2530 name is NAME. Therefore, the string must be such as to result in
2531 valid assembler code. The argument NUMBER is different each time
2532 this macro is executed; it prevents conflicts between
2533 similarly-named internal static variables in different scopes.
2535 Ideally this string should not be a valid C identifier, to prevent
2536 any conflict with the user's own symbols. Most assemblers allow
2537 periods or percent signs in assembler symbols; putting at least
2538 one of these between the name and the number will suffice. */
2540 /* `ASM_OUTPUT_WEAK_ALIAS (STREAM, NAME, VALUE)'
2541 A C statement to output to the stdio stream STREAM assembler code
2542 which defines (equates) the weak symbol NAME to have the value
2545 Define this macro if the target only supports weak aliases; define
2546 ASM_OUTPUT_DEF instead if possible. */
2548 #define HAS_INIT_SECTION 1
2549 /* If defined, `main' will not call `__main' as described above.
2550 This macro should be defined for systems that control the contents
2551 of the init section on a symbol-by-symbol basis, such as OSF/1,
2552 and should not be defined explicitly for systems that support
2553 `INIT_SECTION_ASM_OP'. */
2555 #define REGISTER_NAMES { \
2556 "r0","r1","r2","r3","r4","r5","r6","r7", \
2557 "r8","r9","r10","r11","r12","r13","r14","r15", \
2558 "r16","r17","r18","r19","r20","r21","r22","r23", \
2559 "r24","r25","r26","r27","r28","r29","r30","r31", \
2560 "__SPL__","__SPH__","argL","argH"}
2561 /* A C initializer containing the assembler's names for the machine
2562 registers, each one as a C string constant. This is what
2563 translates register numbers in the compiler into assembler
2566 #define FINAL_PRESCAN_INSN(insn, operand, nop) final_prescan_insn (insn, operand,nop)
2567 /* If defined, a C statement to be executed just prior to the output
2568 of assembler code for INSN, to modify the extracted operands so
2569 they will be output differently.
2571 Here the argument OPVEC is the vector containing the operands
2572 extracted from INSN, and NOPERANDS is the number of elements of
2573 the vector which contain meaningful data for this insn. The
2574 contents of this vector are what will be used to convert the insn
2575 template into assembler code, so you can change the assembler
2576 output by changing the contents of the vector.
2578 This macro is useful when various assembler syntaxes share a single
2579 file of instruction patterns; by defining this macro differently,
2580 you can cause a large class of instructions to be output
2581 differently (such as with rearranged operands). Naturally,
2582 variations in assembler syntax affecting individual insn patterns
2583 ought to be handled by writing conditional output routines in
2586 If this macro is not defined, it is equivalent to a null statement. */
2588 #define PRINT_OPERAND(STREAM, X, CODE) print_operand (STREAM, X, CODE)
2589 /* A C compound statement to output to stdio stream STREAM the
2590 assembler syntax for an instruction operand X. X is an RTL
2593 CODE is a value that can be used to specify one of several ways of
2594 printing the operand. It is used when identical operands must be
2595 printed differently depending on the context. CODE comes from the
2596 `%' specification that was used to request printing of the
2597 operand. If the specification was just `%DIGIT' then CODE is 0;
2598 if the specification was `%LTR DIGIT' then CODE is the ASCII code
2601 If X is a register, this macro should print the register's name.
2602 The names can be found in an array `reg_names' whose type is `char
2603 *[]'. `reg_names' is initialized from `REGISTER_NAMES'.
2605 When the machine description has a specification `%PUNCT' (a `%'
2606 followed by a punctuation character), this macro is called with a
2607 null pointer for X and the punctuation character for CODE. */
2609 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '~')
2610 /* A C expression which evaluates to true if CODE is a valid
2611 punctuation character for use in the `PRINT_OPERAND' macro. If
2612 `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no
2613 punctuation characters (except for the standard one, `%') are used
2616 #define PRINT_OPERAND_ADDRESS(STREAM, X) print_operand_address(STREAM, X)
2617 /* A C compound statement to output to stdio stream STREAM the
2618 assembler syntax for an instruction operand that is a memory
2619 reference whose address is X. X is an RTL expression.
2621 On some machines, the syntax for a symbolic address depends on the
2622 section that the address refers to. On these machines, define the
2623 macro `ENCODE_SECTION_INFO' to store the information into the
2624 `symbol_ref', and then check for it here. *Note Assembler
2627 #define USER_LABEL_PREFIX ""
2628 /* `LOCAL_LABEL_PREFIX'
2631 If defined, C string expressions to be used for the `%R', `%L',
2632 `%U', and `%I' options of `asm_fprintf' (see `final.c'). These
2633 are useful when a single `md' file must support multiple assembler
2634 formats. In that case, the various `tm.h' files can define these
2635 macros differently. */
2637 #define ASM_OUTPUT_REG_PUSH(STREAM, REGNO) \
2640 fatal("regno error in push"); \
2641 fprintf (STREAM, "\tpush\tr%d", REGNO); \
2643 /* A C expression to output to STREAM some assembler code which will
2644 push hard register number REGNO onto the stack. The code need not
2645 be optimal, since this macro is used only when profiling. */
2647 #define ASM_OUTPUT_REG_POP(STREAM, REGNO) \
2650 fatal("regno error in pop"); \
2651 fprintf (STREAM, "\tpop\tr%d", REGNO); \
2653 /* A C expression to output to STREAM some assembler code which will
2654 pop hard register number REGNO off of the stack. The code need
2655 not be optimal, since this macro is used only when profiling. */
2657 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
2658 fprintf (STREAM, "\t.word pm(.L%d)\n", VALUE);
2659 /* This macro should be provided on machines where the addresses in a
2660 dispatch table are absolute.
2662 The definition should be a C statement to output to the stdio
2663 stream STREAM an assembler pseudo-instruction to generate a
2664 reference to a label. VALUE is the number of an internal label
2665 whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'. For
2668 fprintf (STREAM, "\t.word L%d\n", VALUE) */
2670 #define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) \
2671 progmem_section (), ASM_OUTPUT_INTERNAL_LABEL (STREAM, PREFIX, NUM)
2673 /* `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)'
2674 Define this if the label before a jump-table needs to be output
2675 specially. The first three arguments are the same as for
2676 `ASM_OUTPUT_INTERNAL_LABEL'; the fourth argument is the jump-table
2677 which follows (a `jump_insn' containing an `addr_vec' or
2680 This feature is used on system V to output a `swbeg' statement for
2683 If this macro is not defined, these labels are output with
2684 `ASM_OUTPUT_INTERNAL_LABEL'. */
2686 /* `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)'
2687 Define this if something special must be output at the end of a
2688 jump-table. The definition should be a C statement to be executed
2689 after the assembler code for the table is written. It should write
2690 the appropriate code to stdio stream STREAM. The argument TABLE
2691 is the jump-table insn, and NUM is the label-number of the
2694 If this macro is not defined, nothing special is output at the end
2695 of the jump-table. */
2697 #define ASM_OUTPUT_SKIP(STREAM, n) \
2698 fprintf (STREAM, "\t.skip %d,0\n", n)
2699 /* A C statement to output to the stdio stream STREAM an assembler
2700 instruction to advance the location counter by NBYTES bytes.
2701 Those bytes should be zero when loaded. NBYTES will be a C
2702 expression of type `int'. */
2704 #define ASM_OUTPUT_ALIGN(STREAM, POWER)
2705 /* A C statement to output to the stdio stream STREAM an assembler
2706 command to advance the location counter to a multiple of 2 to the
2707 POWER bytes. POWER will be a C expression of type `int'. */
2709 #define CASE_VECTOR_MODE HImode
2710 /* An alias for a machine mode name. This is the machine mode that
2711 elements of a jump-table should have. */
2713 #define CASE_VALUES_THRESHOLD 17
2714 /* `CASE_VALUES_THRESHOLD'
2715 Define this to be the smallest number of different values for
2716 which it is best to use a jump-table instead of a tree of
2717 conditional branches. The default is four for machines with a
2718 `casesi' instruction and five otherwise. This is best for most
2721 #undef WORD_REGISTER_OPERATIONS
2722 /* Define this macro if operations between registers with integral
2723 mode smaller than a word are always performed on the entire
2724 register. Most RISC machines have this property and most CISC
2727 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
2728 /* An alias for a tree code that is the easiest kind of division to
2729 compile code for in the general case. It may be `TRUNC_DIV_EXPR',
2730 `FLOOR_DIV_EXPR', `CEIL_DIV_EXPR' or `ROUND_DIV_EXPR'. These four
2731 division operators differ in how they round the result to an
2732 integer. `EASY_DIV_EXPR' is used when it is permissible to use
2733 any of those kinds of division and the choice should be made on
2734 the basis of efficiency. */
2737 /* The maximum number of bytes that a single instruction can move
2738 quickly between memory and registers or between two memory
2741 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
2742 /* A C expression which is nonzero if on this machine it is safe to
2743 "convert" an integer of INPREC bits to one of OUTPREC bits (where
2744 OUTPREC is smaller than INPREC) by merely operating on it as if it
2745 had only OUTPREC bits.
2747 On many machines, this expression can be 1.
2749 When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for
2750 modes for which `MODES_TIEABLE_P' is 0, suboptimal code can result.
2751 If this is the case, making `TRULY_NOOP_TRUNCATION' return 0 in
2752 such cases may improve things. */
2754 #define Pmode HImode
2755 /* An alias for the machine mode for pointers. On most machines,
2756 define this to be the integer mode corresponding to the width of a
2757 hardware pointer; `SImode' on 32-bit machine or `DImode' on 64-bit
2758 machines. On some machines you must define this to be one of the
2759 partial integer modes, such as `PSImode'.
2761 The width of `Pmode' must be at least as large as the value of
2762 `POINTER_SIZE'. If it is not equal, you must define the macro
2763 `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to
2766 #define FUNCTION_MODE HImode
2767 /* An alias for the machine mode used for memory references to
2768 functions being called, in `call' RTL expressions. On most
2769 machines this should be `QImode'. */
2771 #define INTEGRATE_THRESHOLD(DECL) (1 + (3 * list_length (DECL_ARGUMENTS (DECL)) / 2))
2773 /* A C expression for the maximum number of instructions above which
2774 the function DECL should not be inlined. DECL is a
2775 `FUNCTION_DECL' node.
2777 The default definition of this macro is 64 plus 8 times the number
2778 of arguments that the function accepts. Some people think a larger
2779 threshold should be used on RISC machines. */
2781 #define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
2782 valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
2783 /* `VALID_MACHINE_DECL_ATTRIBUTE (DECL, ATTRIBUTES, IDENTIFIER, ARGS)'
2784 If defined, a C expression whose value is nonzero if IDENTIFIER
2785 with arguments ARGS is a valid machine specific attribute for DECL.
2786 The attributes in ATTRIBUTES have previously been assigned to DECL. */
2788 #define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) \
2789 valid_machine_type_attribute(TYPE, ATTRIBUTES, IDENTIFIER, ARGS)
2790 /* `VALID_MACHINE_TYPE_ATTRIBUTE (TYPE, ATTRIBUTES, IDENTIFIER, ARGS)'
2791 If defined, a C expression whose value is nonzero if IDENTIFIER
2792 with arguments ARGS is a valid machine specific attribute for TYPE.
2793 The attributes in ATTRIBUTES have previously been assigned to TYPE. */
2795 #define DOLLARS_IN_IDENTIFIERS 0
2796 /* Define this macro to control use of the character `$' in identifier
2797 names. 0 means `$' is not allowed by default; 1 means it is
2798 allowed. 1 is the default; there is no need to define this macro
2799 in that case. This macro controls the compiler proper; it does
2800 not affect the preprocessor. */
2802 #define NO_DOLLAR_IN_LABEL 1
2803 /* Define this macro if the assembler does not accept the character
2804 `$' in label names. By default constructors and destructors in
2805 G++ have `$' in the identifiers. If this macro is defined, `.' is
2808 #define MACHINE_DEPENDENT_REORG(INSN) machine_dependent_reorg (INSN)
2809 /* In rare cases, correct code generation requires extra machine
2810 dependent processing between the second jump optimization pass and
2811 delayed branch scheduling. On those machines, define this macro
2812 as a C statement to act on the code starting at INSN. */
2814 #define GIV_SORT_CRITERION(X, Y) \
2815 if (GET_CODE ((X)->add_val) == CONST_INT \
2816 && GET_CODE ((Y)->add_val) == CONST_INT) \
2817 return INTVAL ((X)->add_val) - INTVAL ((Y)->add_val);
2819 /* `GIV_SORT_CRITERION(GIV1, GIV2)'
2820 In some cases, the strength reduction optimization pass can
2821 produce better code if this is defined. This macro controls the
2822 order that induction variables are combined. This macro is
2823 particularly useful if the target has limited addressing modes.
2824 For instance, the SH target has only positive offsets in
2825 addresses. Thus sorting to put the smallest address first allows
2826 the most combinations to be found. */
2828 /* Define results of standard character escape sequences. */
2829 #define TARGET_BELL 007
2830 #define TARGET_BS 010
2831 #define TARGET_TAB 011
2832 #define TARGET_NEWLINE 012
2833 #define TARGET_VT 013
2834 #define TARGET_FF 014
2835 #define TARGET_CR 015
2839 #define TRAMPOLINE_TEMPLATE(FILE) fatal ("Trampolines not supported\n")
2841 /* Length in units of the trampoline for entering a nested function. */
2843 #define TRAMPOLINE_SIZE 4
2845 /* Emit RTL insns to initialize the variable parts of a trampoline.
2846 FNADDR is an RTX for the address of the function's pure code.
2847 CXT is an RTX for the static chain value for the function. */
2849 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
2851 emit_move_insn (gen_rtx (MEM, HImode, plus_constant ((TRAMP), 2)), CXT); \
2852 emit_move_insn (gen_rtx (MEM, HImode, plus_constant ((TRAMP), 6)), FNADDR); \
2854 /* Store in cc_status the expressions
2855 that the condition codes will describe
2856 after execution of an instruction whose pattern is EXP.
2857 Do not alter them if the instruction would not alter the cc's. */
2859 #define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc(EXP, INSN)
2861 /* The add insns don't set overflow in a usable way. */
2862 #define CC_OVERFLOW_UNUSABLE 01000
2863 /* The mov,and,or,xor insns don't set carry. That's ok though as the
2864 Z bit is all we need when doing unsigned comparisons on the result of
2865 these insns (since they're always with 0). However, conditions.h has
2866 CC_NO_OVERFLOW defined for this purpose. Rename it to something more
2868 #define CC_NO_CARRY CC_NO_OVERFLOW
2871 /* Output assembler code to FILE to increment profiler label # LABELNO
2872 for profiling a function entry. */
2874 #define FUNCTION_PROFILER(FILE, LABELNO) \
2875 fprintf (FILE, "/* profiler %d */", (LABELNO))
2877 /* `FIRST_INSN_ADDRESS'
2878 When the `length' insn attribute is used, this macro specifies the
2879 value to be assigned to the address of the first insn in a
2880 function. If not specified, 0 is used. */
2882 #define ADJUST_INSN_LENGTH(INSN, LENGTH) (LENGTH =\
2883 adjust_insn_length (INSN, LENGTH))
2884 /* If defined, modifies the length assigned to instruction INSN as a
2885 function of the context in which it is used. LENGTH is an lvalue
2886 that contains the initially computed length of the insn and should
2887 be updated with the correct length of the insn. If updating is
2888 required, INSN must not be a varying-length insn.
2890 This macro will normally not be required. A case in which it is
2891 required is the ROMP. On this machine, the size of an `addr_vec'
2892 insn must be increased by two to compensate for the fact that
2893 alignment may be required. */
2895 #define TARGET_MEM_FUNCTIONS
2896 /* Define this macro if GNU CC should generate calls to the System V
2897 (and ANSI C) library functions `memcpy' and `memset' rather than
2898 the BSD functions `bcopy' and `bzero'. */
2901 %{!mmcu=*:-DAVR_AT90S8515} \
2902 %{mmcu=at90s2313:-DAVR_AT90S2313} \
2903 %{mmcu=at90s2323:-DAVR_AT90S2323} \
2904 %{mmcu=at90s2333:-DAVR_AT90S2333} \
2905 %{mmcu=at90s2343:-DAVR_AT90S2343} \
2906 %{mmcu=attiny22:-DAVR_ATtiny22} \
2907 %{mmcu=at90s4433:-DAVR_AT90S4433} \
2908 %{mmcu=at90s4414:-DAVR_AT90S4414} \
2909 %{mmcu=at90s4434:-DAVR_AT90S4434} \
2910 %{mmcu=at90s8515:-DAVR_AT90S8515} \
2911 %{mmcu=at90s8535:-DAVR_AT90S8535} \
2912 %{mmcu=atmega603:-DAVR_ATmega603} \
2913 %{mmcu=atmega103:-DAVR_ATmega103} \
2914 %{mint8:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long -D__INT_MAX__=127} \
2915 %{!mint*:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int -D__INT_MAX__=32767} \
2916 %{posix:-D_POSIX_SOURCE}"
2917 /* A C string constant that tells the GNU CC driver program options to
2918 pass to CPP. It can also specify how to translate options you
2919 give to GNU CC into options for GNU CC to pass to the CPP.
2921 Do not define this macro if it does not need to do anything. */
2923 #define NO_BUILTIN_SIZE_TYPE
2924 /* If this macro is defined, the preprocessor will not define the
2925 builtin macro `__SIZE_TYPE__'. The macro `__SIZE_TYPE__' must
2926 then be defined by `CPP_SPEC' instead.
2928 This should be defined if `SIZE_TYPE' depends on target dependent
2929 flags which are not accessible to the preprocessor. Otherwise, it
2930 should not be defined. */
2932 #define NO_BUILTIN_PTRDIFF_TYPE
2933 /* If this macro is defined, the preprocessor will not define the
2934 builtin macro `__PTRDIFF_TYPE__'. The macro `__PTRDIFF_TYPE__'
2935 must then be defined by `CPP_SPEC' instead.
2937 This should be defined if `PTRDIFF_TYPE' depends on target
2938 dependent flags which are not accessible to the preprocessor.
2939 Otherwise, it should not be defined.
2942 A C string constant that tells the GNU CC driver program options to
2943 pass to CPP. By default, this macro is defined to pass the option
2944 `-D__CHAR_UNSIGNED__' to CPP if `char' will be treated as
2945 `unsigned char' by `cc1'.
2947 Do not define this macro unless you need to override the default
2950 #define CC1_SPEC "%{!mmcu*:-mmcu=at90s8515} %{profile:-p}"
2951 /* A C string constant that tells the GNU CC driver program options to
2952 pass to `cc1'. It can also specify how to translate options you
2953 give to GNU CC into options for GNU CC to pass to the `cc1'.
2955 Do not define this macro if it does not need to do anything. */
2958 /* A C string constant that tells the GNU CC driver program options to
2959 pass to the assembler. It can also specify how to translate
2960 options you give to GNU CC into options for GNU CC to pass to the
2961 assembler. See the file `sun3.h' for an example of this.
2963 Do not define this macro if it does not need to do anything. */
2965 #define ASM_FINAL_SPEC ""
2966 /* A C string constant that tells the GNU CC driver program how to
2967 run any programs which cleanup after the normal assembler.
2968 Normally, this is not needed. See the file `mips.h' for an
2971 Do not define this macro if it does not need to do anything. */
2973 #define LINK_SPEC "\
2974 %{!mmcu*:-m avr85xx} \
2975 %{mmcu=atmega603:-m avrmega603} \
2976 %{mmcu=atmega103:-m avrmega103} \
2977 %{mmcu=at90s2313:-m avr23xx} \
2978 %{mmcu=at90s2323:-m avr23xx} \
2979 %{mmcu=attiny22:-m avr23xx} \
2980 %{mmcu=at90s2333:-m avr23xx} \
2981 %{mmcu=at90s2343:-m avr23xx} \
2982 %{mmcu=at90s4433:-m avr4433} \
2983 %{mmcu=at90s4414:-m avr44x4} \
2984 %{mmcu=at90s4434:-m avr44x4} \
2985 %{mmcu=at90s8535:-m avr85xx} \
2986 %{mmcu=at90s8515:-m avr85xx}"
2988 /* A C string constant that tells the GNU CC driver program options to
2989 pass to the linker. It can also specify how to translate options
2990 you give to GNU CC into options for GNU CC to pass to the linker.
2992 Do not define this macro if it does not need to do anything. */
2995 %{!mmcu*|mmcu=at90s*|mmcu=attiny22: -lc} \
2996 %{mmcu=atmega*: -lc-mega}"
2997 /* Another C string constant used much like `LINK_SPEC'. The
2998 difference between the two is that `LIB_SPEC' is used at the end
2999 of the command given to the linker.
3001 If this macro is not defined, a default is provided that loads the
3002 standard C library from the usual place. See `gcc.c'. */
3004 #define LIBGCC_SPEC "\
3005 %{mmcu=atmega*:-lgcc} \
3006 %{!mmcu*|mmcu=at90s*|mmcu=attiny22:-lgcc}"
3007 /* Another C string constant that tells the GNU CC driver program how
3008 and when to place a reference to `libgcc.a' into the linker
3009 command line. This constant is placed both before and after the
3010 value of `LIB_SPEC'.
3012 If this macro is not defined, the GNU CC driver provides a default
3013 that passes the string `-lgcc' to the linker unless the `-shared'
3014 option is specified. */
3016 #define STARTFILE_SPEC "%(crt_binutils)"
3017 /* Another C string constant used much like `LINK_SPEC'. The
3018 difference between the two is that `STARTFILE_SPEC' is used at the
3019 very beginning of the command given to the linker.
3021 If this macro is not defined, a default is provided that loads the
3022 standard C startup file from the usual place. See `gcc.c'. */
3024 #define ENDFILE_SPEC ""
3025 /* Another C string constant used much like `LINK_SPEC'. The
3026 difference between the two is that `ENDFILE_SPEC' is used at the
3027 very end of the command given to the linker.
3029 Do not define this macro if it does not need to do anything. */
3031 #define CRT_BINUTILS_SPECS "\
3032 %{!mmcu*:gcrt1-8515.o%s} \
3033 %{mmcu=atmega603:gcrt1-mega603.o%s} \
3034 %{mmcu=atmega103:gcrt1-mega103.o%s} \
3035 %{mmcu=at90s2313:gcrt1-2313.o%s} \
3036 %{mmcu=at90s2323:gcrt1-2323.o%s} \
3037 %{mmcu=attiny22:gcrt1-tiny22.o%s} \
3038 %{mmcu=at90s2333:gcrt1-2333.o%s} \
3039 %{mmcu=at90s2343:gcrt1-2343.o%s} \
3040 %{mmcu=at90s4433:gcrt1-4433.o%s} \
3041 %{mmcu=at90s4414:gcrt1-4414.o%s} \
3042 %{mmcu=at90s4434:gcrt1-4434.o%s} \
3043 %{mmcu=at90s8535:gcrt1-8535.o%s} \
3044 %{mmcu=at90s8515:gcrt1-8515.o%s}"
3046 #define EXTRA_SPECS \
3047 {"crt_binutils", CRT_BINUTILS_SPECS},
3048 /* Define this macro to provide additional specifications to put in
3049 the `specs' file that can be used in various specifications like
3052 The definition should be an initializer for an array of structures,
3053 containing a string constant, that defines the specification name,
3054 and a string constant that provides the specification.
3056 Do not define this macro if it does not need to do anything.
3058 `EXTRA_SPECS' is useful when an architecture contains several
3059 related targets, which have various `..._SPECS' which are similar
3060 to each other, and the maintainer would like one central place to
3061 keep these definitions.
3063 For example, the PowerPC System V.4 targets use `EXTRA_SPECS' to
3064 define either `_CALL_SYSV' when the System V calling sequence is
3065 used or `_CALL_AIX' when the older AIX-based calling sequence is
3068 The `config/rs6000/rs6000.h' target file defines:
3070 #define EXTRA_SPECS \
3071 { "cpp_sysv_default", CPP_SYSV_DEFAULT },
3073 #define CPP_SYS_DEFAULT ""
3075 The `config/rs6000/sysv.h' target file defines:
3078 "%{posix: -D_POSIX_SOURCE } \
3079 %{mcall-sysv: -D_CALL_SYSV } %{mcall-aix: -D_CALL_AIX } \
3080 %{!mcall-sysv: %{!mcall-aix: %(cpp_sysv_default) }} \
3081 %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}"
3083 #undef CPP_SYSV_DEFAULT
3084 #define CPP_SYSV_DEFAULT "-D_CALL_SYSV"
3086 while the `config/rs6000/eabiaix.h' target file defines
3087 `CPP_SYSV_DEFAULT' as:
3089 #undef CPP_SYSV_DEFAULT
3090 #define CPP_SYSV_DEFAULT "-D_CALL_AIX" */
3092 /* This is undefined macro for collect2 disabling */
3093 #define LINKER_NAME "ld"
3095 #define TEST_HARD_REG_CLASS(CLASS, REGNO) \
3096 TEST_HARD_REG_BIT (reg_class_contents[ (int) (CLASS)], REGNO)
3098 /* Note that the other files fail to use these
3099 in some of the places where they should. */
3101 #if defined(__STDC__) || defined(ALMOST_STDC)
3102 #define AS2(a,b,c) #a " " #b "," #c
3103 #define AS2C(b,c) " " #b "," #c
3104 #define AS3(a,b,c,d) #a " " #b "," #c "," #d
3105 #define AS1(a,b) #a " " #b
3107 #define AS1(a,b) "a b"
3108 #define AS2(a,b,c) "a b,c"
3109 #define AS2C(b,c) " b,c"
3110 #define AS3(a,b,c,d) "a b,c,d"
3112 #define OUT_AS1(a,b) output_asm_insn (AS1(a,b), operands)
3113 #define OUT_AS2(a,b,c) output_asm_insn (AS2(a,b,c), operands)
3114 #define CR_TAB "\n\t"
3116 /* Define this macro as a C statement that declares additional library
3117 routines renames existing ones. `init_optabs' calls this macro
3118 after initializing all the normal library routines. */
3120 #define INIT_TARGET_OPTABS \
3122 smul_optab->handlers[(int) QImode].libfunc \
3123 = gen_rtx (SYMBOL_REF, Pmode, "_mulqi3"); \
3125 sdiv_optab->handlers[(int) QImode].libfunc \
3126 = gen_rtx (SYMBOL_REF, Pmode, "_divqi3"); \
3128 smod_optab->handlers[(int) QImode].libfunc \
3129 = gen_rtx (SYMBOL_REF, Pmode, "_modqi3"); \
3131 udiv_optab->handlers[(int) QImode].libfunc \
3132 = gen_rtx (SYMBOL_REF, Pmode, "_udivqi3"); \
3134 umod_optab->handlers[(int) QImode].libfunc \
3135 = gen_rtx (SYMBOL_REF, Pmode, "_umodqi3"); \
3137 smul_optab->handlers[(int) HImode].libfunc \
3138 = gen_rtx (SYMBOL_REF, Pmode, "_mulhi3"); \
3140 sdiv_optab->handlers[(int) HImode].libfunc \
3141 = gen_rtx (SYMBOL_REF, Pmode, "_divhi3"); \
3143 smod_optab->handlers[(int) HImode].libfunc \
3144 = gen_rtx (SYMBOL_REF, Pmode, "_modhi3"); \
3146 udiv_optab->handlers[(int) HImode].libfunc \
3147 = gen_rtx (SYMBOL_REF, Pmode, "_udivhi3"); \
3149 umod_optab->handlers[(int) HImode].libfunc \
3150 = gen_rtx (SYMBOL_REF, Pmode, "_umodhi3"); \
3152 smul_optab->handlers[(int) SImode].libfunc \
3153 = gen_rtx (SYMBOL_REF, Pmode, "_mulsi3"); \
3155 sdiv_optab->handlers[(int) SImode].libfunc \
3156 = gen_rtx (SYMBOL_REF, Pmode, "_divsi3"); \
3158 smod_optab->handlers[(int) SImode].libfunc \
3159 = gen_rtx (SYMBOL_REF, Pmode, "_modsi3"); \
3161 udiv_optab->handlers[(int) SImode].libfunc \
3162 = gen_rtx (SYMBOL_REF, Pmode, "_udivsi3"); \
3164 umod_optab->handlers[(int) SImode].libfunc \
3165 = gen_rtx (SYMBOL_REF, Pmode, "_umodsi3"); \
3169 /* Temporary register r0 */
3172 /* zero register r1 */
3173 #define ZERO_REGNO 1
3175 extern struct rtx_def *tmp_reg_rtx;
3176 extern struct rtx_def *zero_reg_rtx;
3178 #define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
3180 /* Define to use software floating point emulator for REAL_ARITHMETIC and
3181 decimal <-> binary conversion. */
3182 #define REAL_ARITHMETIC
3184 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
3186 #define DBX_REGISTER_NUMBER(r) (r)
3188 /* Get the standard ELF stabs definitions. */
3191 #undef ASM_IDENTIFY_GCC
3192 #define ASM_IDENTIFY_GCC(FILE) \
3195 if (write_symbols != DBX_DEBUG) \
3196 fputs ("gcc2_compiled.:\n", FILE); \