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)
56 /* Dump each assembler insn's rtl into the output file.
57 This is for debugging the compiler itself. */
59 #define TARGET_RTL_DUMP (target_flags & 0x010)
60 #define TARGET_ALL_DEBUG (target_flags & 0xfe0)
63 This series of macros is to allow compiler command arguments to
64 enable or disable the use of optional features of the target
65 machine. For example, one machine description serves both the
66 68000 and the 68020; a command argument tells the compiler whether
67 it should use 68020-only instructions or not. This command
68 argument works by means of a macro `TARGET_68020' that tests a bit
71 Define a macro `TARGET_FEATURENAME' for each such option. Its
72 definition should test a bit in `target_flags'; for example:
74 #define TARGET_68020 (target_flags & 1)
76 One place where these macros are used is in the
77 condition-expressions of instruction patterns. Note how
78 `TARGET_68020' appears frequently in the 68000 machine description
79 file, `m68k.md'. Another place they are used is in the
80 definitions of the other macros in the `MACHINE.h' file. */
84 #define TARGET_SWITCHES { \
85 {"order1",0x1000, NULL}, \
86 {"order2",0x4000, NULL}, \
87 {"int8",0x10000,"Assume int to be 8 bit integer"}, \
88 {"no-interrupts",0x20000,"Don't output interrupt compatible code"}, \
89 {"call-prologues",0x40000, \
90 "Use subroutines for functions prologeu/epilogue"}, \
92 {"size",0x2000,"Output instruction size's to the asm file"}, \
93 {"deb",0xfe0, NULL}, \
95 /* This macro defines names of command options to set and clear bits
96 in `target_flags'. Its definition is an initializer with a
97 subgrouping for each command option.
99 Each subgrouping contains a string constant, that defines the
100 option name, and a number, which contains the bits to set in
101 `target_flags'. A negative number says to clear bits instead; the
102 negative of the number is which bits to clear. The actual option
103 name is made by appending `-m' to the specified name.
105 One of the subgroupings should have a null string. The number in
106 this grouping is the default value for `target_flags'. Any target
107 options act starting with that value.
109 Here is an example which defines `-m68000' and `-m68020' with
110 opposite meanings, and picks the latter as the default:
112 #define TARGET_SWITCHES \
117 extern const char *avr_ram_end;
118 extern const char *avr_mcu_name;
126 extern struct mcu_type_s *avr_mcu_type;
127 #define AVR_MEGA (avr_mcu_type->mega)
129 #define TARGET_OPTIONS { \
130 {"init-stack=",&avr_ram_end,"Specify the initial stack address" }, \
131 {"mcu=", &avr_mcu_name, \
132 "Specify the MCU name (at90s23xx,attiny22,at90s44xx,at90s85xx,atmega603,atmega103)"}}
133 /* This macro is similar to `TARGET_SWITCHES' but defines names of
134 command options that have values. Its definition is an
135 initializer with a subgrouping for each command option.
137 Each subgrouping contains a string constant, that defines the
138 fixed part of the option name, and the address of a variable. The
139 variable, type `char *', is set to the variable part of the given
140 option if the fixed part matches. The actual option name is made
141 by appending `-m' to the specified name.
143 Here is an example which defines `-mshort-data-NUMBER'. If the
144 given option is `-mshort-data-512', the variable `m88k_short_data'
145 will be set to the string `"512"'.
147 extern char *m88k_short_data;
148 #define TARGET_OPTIONS \
149 { { "short-data-", &m88k_short_data } } */
151 #define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)");
152 /* This macro is a C statement to print on `stderr' a string
153 describing the particular machine description choice. Every
154 machine description should define `TARGET_VERSION'. For example:
157 #define TARGET_VERSION \
158 fprintf (stderr, " (68k, Motorola syntax)");
160 #define TARGET_VERSION \
161 fprintf (stderr, " (68k, MIT syntax)");
164 #define OVERRIDE_OPTIONS avr_override_options()
165 /* `OVERRIDE_OPTIONS'
166 Sometimes certain combinations of command options do not make
167 sense on a particular target machine. You can define a macro
168 `OVERRIDE_OPTIONS' to take account of this. This macro, if
169 defined, is executed once just after all the command options have
172 Don't use this macro to turn on various extra optimizations for
173 `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
175 #define CAN_DEBUG_WITHOUT_FP
176 /* Define this macro if debugging can be performed even without a
177 frame pointer. If this macro is defined, GNU CC will turn on the
178 `-fomit-frame-pointer' option whenever `-O' is specified. */
180 /* Define this if most significant byte of a word is the lowest numbered. */
181 #define BITS_BIG_ENDIAN 0
183 /* Define this if most significant byte of a word is the lowest numbered. */
184 #define BYTES_BIG_ENDIAN 0
186 /* Define this if most significant word of a multiword number is the lowest
188 #define WORDS_BIG_ENDIAN 0
190 /* number of bits in an addressable storage unit */
191 #define BITS_PER_UNIT 8
193 /* Width in bits of a "word", which is the contents of a machine register.
194 Note that this is not necessarily the width of data type `int'; */
195 #define BITS_PER_WORD 8
197 /* Width of a word, in units (bytes). */
198 #define UNITS_PER_WORD 1
200 /* Width in bits of a pointer.
201 See also the macro `Pmode' defined below. */
202 #define POINTER_SIZE 16
205 /* Maximum sized of reasonable data type
206 DImode or Dfmode ... */
207 #define MAX_FIXED_MODE_SIZE 32
209 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
210 #define PARM_BOUNDARY 8
212 /* Allocation boundary (in *bits*) for the code of a function. */
213 #define FUNCTION_BOUNDARY 8
215 /* Alignment of field after `int : 0' in a structure. */
216 #define EMPTY_FIELD_BOUNDARY 8
218 /* No data type wants to be aligned rounder than this. */
219 #define BIGGEST_ALIGNMENT 8
222 /* Define this if move instructions will actually fail to work
223 when given unaligned data. */
224 #define STRICT_ALIGNMENT 0
226 /* A C expression for the size in bits of the type `int' on the
227 target machine. If you don't define this, the default is one word. */
228 #define INT_TYPE_SIZE (TARGET_INT8 ? 8 : 16)
231 /* A C expression for the size in bits of the type `short' on the
232 target machine. If you don't define this, the default is half a
233 word. (If this would be less than one storage unit, it is rounded
235 #define SHORT_TYPE_SIZE (INT_TYPE_SIZE == 8 ? INT_TYPE_SIZE : 16)
237 /* A C expression for the size in bits of the type `long' on the
238 target machine. If you don't define this, the default is one word. */
239 #define LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 16 : 32)
241 #define MAX_LONG_TYPE_SIZE 32
242 /* Maximum number for the size in bits of the type `long' on the
243 target machine. If this is undefined, the default is
244 `LONG_TYPE_SIZE'. Otherwise, it is the constant value that is the
245 largest value that `LONG_TYPE_SIZE' can have at run-time. This is
249 #define LONG_LONG_TYPE_SIZE 64
250 /* A C expression for the size in bits of the type `long long' on the
251 target machine. If you don't define this, the default is two
252 words. If you want to support GNU Ada on your machine, the value
253 of macro must be at least 64. */
256 #define CHAR_TYPE_SIZE 8
257 /* A C expression for the size in bits of the type `char' on the
258 target machine. If you don't define this, the default is one
259 quarter of a word. (If this would be less than one storage unit,
260 it is rounded up to one unit.) */
262 #define FLOAT_TYPE_SIZE 32
263 /* A C expression for the size in bits of the type `float' on the
264 target machine. If you don't define this, the default is one word. */
266 #define DOUBLE_TYPE_SIZE 32
267 /* A C expression for the size in bits of the type `double' on the
268 target machine. If you don't define this, the default is two
272 #define LONG_DOUBLE_TYPE_SIZE 32
273 /* A C expression for the size in bits of the type `long double' on
274 the target machine. If you don't define this, the default is two
277 #define DEFAULT_SIGNED_CHAR 1
278 /* An expression whose value is 1 or 0, according to whether the type
279 `char' should be signed or unsigned by default. The user can
280 always override this default with the options `-fsigned-char' and
281 `-funsigned-char'. */
283 /* `DEFAULT_SHORT_ENUMS'
284 A C expression to determine whether to give an `enum' type only as
285 many bytes as it takes to represent the range of possible values
286 of that type. A nonzero value means to do that; a zero value
287 means all `enum' types should be allocated like `int'.
289 If you don't define the macro, the default is 0. */
291 #define SIZE_TYPE (INT_TYPE_SIZE == 8 ? "long unsigned int" : "unsigned int")
292 /* A C expression for a string describing the name of the data type
293 to use for size values. The typedef name `size_t' is defined
294 using the contents of the string.
296 The string can contain more than one keyword. If so, separate
297 them with spaces, and write first any length keyword, then
298 `unsigned' if appropriate, and finally `int'. The string must
299 exactly match one of the data type names defined in the function
300 `init_decl_processing' in the file `c-decl.c'. You may not omit
301 `int' or change the order--that would cause the compiler to crash
304 If you don't define this macro, the default is `"long unsigned
307 #define PTRDIFF_TYPE (INT_TYPE_SIZE == 8 ? "long unsigned int" :"unsigned int")
308 /* A C expression for a string describing the name of the data type
309 to use for the result of subtracting two pointers. The typedef
310 name `ptrdiff_t' is defined using the contents of the string. See
311 `SIZE_TYPE' above for more information.
313 If you don't define this macro, the default is `"long int"'. */
316 #define WCHAR_TYPE_SIZE 16
317 /* A C expression for the size in bits of the data type for wide
318 characters. This is used in `cpp', which cannot make use of
321 #define FIRST_PSEUDO_REGISTER 36
322 /* Number of hardware registers known to the compiler. They receive
323 numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first
324 pseudo register's number really is assigned the number
325 `FIRST_PSEUDO_REGISTER'. */
327 #define FIXED_REGISTERS {\
345 1,1 /* arg pointer */ }
346 /* An initializer that says which registers are used for fixed
347 purposes all throughout the compiled code and are therefore not
348 available for general allocation. These would include the stack
349 pointer, the frame pointer (except on machines where that can be
350 used as a general register when no frame pointer is needed), the
351 program counter on machines where that is considered one of the
352 addressable registers, and any other numbered register with a
355 This information is expressed as a sequence of numbers, separated
356 by commas and surrounded by braces. The Nth number is 1 if
357 register N is fixed, 0 otherwise.
359 The table initialized from this macro, and the table initialized by
360 the following one, may be overridden at run time either
361 automatically, by the actions of the macro
362 `CONDITIONAL_REGISTER_USAGE', or by the user with the command
363 options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. */
365 #define CALL_USED_REGISTERS { \
383 1,1 /* arg pointer */ }
384 /* Like `FIXED_REGISTERS' but has 1 for each register that is
385 clobbered (in general) by function calls as well as for fixed
386 registers. This macro therefore identifies the registers that are
387 not available for general allocation of values that must live
388 across function calls.
390 If a register has 0 in `CALL_USED_REGISTERS', the compiler
391 automatically saves it on function entry and restores it on
392 function exit, if the register is used within the function. */
394 #define NON_SAVING_SETJMP 0
395 /* If this macro is defined and has a nonzero value, it means that
396 `setjmp' and related functions fail to save the registers, or that
397 `longjmp' fails to restore them. To compensate, the compiler
398 avoids putting variables in registers in functions that use
401 #define REG_ALLOC_ORDER { \
409 17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2, \
413 /* If defined, an initializer for a vector of integers, containing the
414 numbers of hard registers in the order in which GNU CC should
415 prefer to use them (from most preferred to least).
417 If this macro is not defined, registers are used lowest numbered
418 first (all else being equal).
420 One use of this macro is on machines where the highest numbered
421 registers must always be saved and the save-multiple-registers
422 instruction supports only sequences of consetionve registers. On
423 such machines, define `REG_ALLOC_ORDER' to be an initializer that
424 lists the highest numbered allocatable register first. */
426 #define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()
427 /* ORDER_REGS_FOR_LOCAL_ALLOC'
428 A C statement (sans semicolon) to choose the order in which to
429 allocate hard registers for pseudo-registers local to a basic
432 Store the desired register order in the array `reg_alloc_order'.
433 Element 0 should be the register to allocate first; element 1, the
434 next register; and so on.
436 The macro body should not assume anything about the contents of
437 `reg_alloc_order' before execution of the macro.
439 On most machines, it is not necessary to define this macro. */
442 #define HARD_REGNO_NREGS(REGNO, MODE) ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
444 /* A C expression for the number of consecutive hard registers,
445 starting at register number REGNO, required to hold a value of mode
448 On a machine where all registers are exactly one word, a suitable
449 definition of this macro is
451 #define HARD_REGNO_NREGS(REGNO, MODE) \
452 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
453 / UNITS_PER_WORD)) */
455 #define HARD_REGNO_MODE_OK(REGNO, MODE) (((REGNO) >= 24 && (MODE) != QImode) \
458 /* A C expression that is nonzero if it is permissible to store a
459 value of mode MODE in hard register number REGNO (or in several
460 registers starting with that one). For a machine where all
461 registers are equivalent, a suitable definition is
463 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
465 It is not necessary for this macro to check for the numbers of
466 fixed registers, because the allocation mechanism considers them
467 to be always occupied.
469 On some machines, double-precision values must be kept in even/odd
470 register pairs. The way to implement that is to define this macro
471 to reject odd register numbers for such modes.
473 The minimum requirement for a mode to be OK in a register is that
474 the `movMODE' instruction pattern support moves between the
475 register and any other hard register for which the mode is OK; and
476 that moving a value into the register and back out not alter it.
478 Since the same instruction used to move `SImode' will work for all
479 narrower integer modes, it is not necessary on any machine for
480 `HARD_REGNO_MODE_OK' to distinguish between these modes, provided
481 you define patterns `movhi', etc., to take advantage of this. This
482 is useful because of the interaction between `HARD_REGNO_MODE_OK'
483 and `MODES_TIEABLE_P'; it is very desirable for all integer modes
486 Many machines have special registers for floating point arithmetic.
487 Often people assume that floating point machine modes are allowed
488 only in floating point registers. This is not true. Any
489 registers that can hold integers can safely *hold* a floating
490 point machine mode, whether or not floating arithmetic can be done
491 on it in those registers. Integer move instructions can be used
494 On some machines, though, the converse is true: fixed-point machine
495 modes may not go in floating registers. This is true if the
496 floating registers normalize any value stored in them, because
497 storing a non-floating value there would garble it. In this case,
498 `HARD_REGNO_MODE_OK' should reject fixed-point machine modes in
499 floating registers. But if the floating registers do not
500 automatically normalize, if you can store any bit pattern in one
501 and retrieve it unchanged without a trap, then any machine mode
502 may go in a floating register, so you can define this macro to say
505 The primary significance of special floating registers is rather
506 that they are the registers acceptable in floating point arithmetic
507 instructions. However, this is of no concern to
508 `HARD_REGNO_MODE_OK'. You handle it by writing the proper
509 constraints for those instructions.
511 On some machines, the floating registers are especially slow to
512 access, so that it is better to store a value in a stack frame
513 than in such a register if floating point arithmetic is not being
514 done. As long as the floating registers are not in class
515 `GENERAL_REGS', they will not be used unless some pattern's
516 constraint asks for one. */
518 #define MODES_TIEABLE_P(MODE1, MODE2) 0
519 /* A C expression that is nonzero if it is desirable to choose
520 register allocation so as to avoid move instructions between a
521 value of mode MODE1 and a value of mode MODE2.
523 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
524 MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1,
525 MODE2)' must be zero. */
530 POINTER_X_REGS, /* r26 - r27 */
531 POINTER_Y_REGS, /* r28 - r29 */
532 POINTER_Z_REGS, /* r30 - r31 */
533 STACK_REG, /* STACK */
534 BASE_POINTER_REGS, /* r28 - r31 */
535 POINTER_REGS, /* r26 - r31 */
536 ADDW_REGS, /* r24 - r31 */
537 SIMPLE_LD_REGS, /* r16 - r23 */
538 LD_REGS, /* r16 - r31 */
539 NO_LD_REGS, /* r0 - r15 */
540 GENERAL_REGS, /* r0 - r31 */
541 ALL_REGS, LIM_REG_CLASSES
543 /* An enumeral type that must be defined with all the register class
544 names as enumeral values. `NO_REGS' must be first. `ALL_REGS'
545 must be the last register class, followed by one more enumeral
546 value, `LIM_REG_CLASSES', which is not a register class but rather
547 tells how many classes there are.
549 Each register class has a number, which is the value of casting
550 the class name to type `int'. The number serves as an index in
551 many of the tables described below. */
554 #define N_REG_CLASSES (int)LIM_REG_CLASSES
555 /* The number of distinct register classes, defined as follows:
557 #define N_REG_CLASSES (int) LIM_REG_CLASSES */
559 #define REG_CLASS_NAMES { \
562 "POINTER_X_REGS", /* r26 - r27 */ \
563 "POINTER_Y_REGS", /* r28 - r29 */ \
564 "POINTER_Z_REGS", /* r30 - r31 */ \
565 "STACK_REG", /* STACK */ \
566 "BASE_POINTER_REGS", /* r28 - r31 */ \
567 "POINTER_REGS", /* r26 - r31 */ \
568 "ADDW_REGS", /* r24 - r31 */ \
569 "SIMPLE_LD_REGS", /* r16 - r23 */ \
570 "LD_REGS", /* r16 - r31 */ \
571 "NO_LD_REGS", /* r0 - r15 */ \
572 "GENERAL_REGS", /* r0 - r31 */ \
574 /* An initializer containing the names of the register classes as C
575 string constants. These names are used in writing some of the
583 #define REG_CLASS_CONTENTS { \
584 {0x00000000,0x00000000}, /* NO_REGS */ \
585 {0x00000001,0x00000000}, /* R0_REG */ \
586 {3 << REG_X,0x00000000}, /* POINTER_X_REGS, r26 - r27 */ \
587 {3 << REG_Y,0x00000000}, /* POINTER_Y_REGS, r28 - r29 */ \
588 {3 << REG_Z,0x00000000}, /* POINTER_Z_REGS, r30 - r31 */ \
589 {0x00000000,0x00000003}, /* STACK_REG, STACK */ \
590 {(3 << REG_Y) | (3 << REG_Z), \
591 0x00000000}, /* BASE_POINTER_REGS, r28 - r31 */ \
592 {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z), \
593 0x00000000}, /* POINTER_REGS, r26 - r31 */ \
594 {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W), \
595 0x00000000}, /* ADDW_REGS, r24 - r31 */ \
596 {0x00ff0000,0x00000000}, /* SIMPLE_LD_REGS r16 - r23 */ \
597 {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16), \
598 0x00000000}, /* LD_REGS, r16 - r31 */ \
599 {0x0000ffff,0x00000000}, /* NO_LD_REGS r0 - r15 */ \
600 {0xffffffffu,0x00000000}, /* GENERAL_REGS, r0 - r31 */ \
601 {0xffffffffu,0x00000003} /* ALL_REGS */ \
603 /* An initializer containing the contents of the register classes, as
604 integers which are bit masks. The Nth integer specifies the
605 contents of class N. The way the integer MASK is interpreted is
606 that register R is in the class if `MASK & (1 << R)' is 1.
608 When the machine has more than 32 registers, an integer does not
609 suffice. Then the integers are replaced by sub-initializers,
610 braced groupings containing several integers. Each
611 sub-initializer must be suitable as an initializer for the type
612 `HARD_REG_SET' which is defined in `hard-reg-set.h'. */
614 #define REGNO_REG_CLASS(R) avr_regno_reg_class(R)
615 /* A C expression whose value is a register class containing hard
616 register REGNO. In general there is more than one such class;
617 choose a class which is "minimal", meaning that no smaller class
618 also contains the register. */
620 #define BASE_REG_CLASS POINTER_REGS
621 /* A macro whose definition is the name of the class to which a valid
622 base register must belong. A base register is one used in an
623 address which is the register value plus a displacement. */
625 #define INDEX_REG_CLASS NO_REGS
626 /* A macro whose definition is the name of the class to which a valid
627 index register must belong. An index register is one used in an
628 address where its value is either multiplied by a scale factor or
629 added to another register (as well as added to a displacement). */
631 #define REG_CLASS_FROM_LETTER(C) avr_reg_class_from_letter(C)
632 /* A C expression which defines the machine-dependent operand
633 constraint letters for register classes. If CHAR is such a
634 letter, the value should be the register class corresponding to
635 it. Otherwise, the value should be `NO_REGS'. The register
636 letter `r', corresponding to class `GENERAL_REGS', will not be
637 passed to this macro; you do not need to handle it. */
639 #define REGNO_OK_FOR_BASE_P(r) (((r) < FIRST_PSEUDO_REGISTER \
643 || (r) == ARG_POINTER_REGNUM)) \
645 && (reg_renumber[r] == REG_X \
646 || reg_renumber[r] == REG_Y \
647 || reg_renumber[r] == REG_Z \
648 || (reg_renumber[r] \
649 == ARG_POINTER_REGNUM))))
650 /* A C expression which is nonzero if register number NUM is suitable
651 for use as a base register in operand addresses. It may be either
652 a suitable hard register or a pseudo register that has been
653 allocated such a hard register. */
655 /* #define REGNO_MODE_OK_FOR_BASE_P(r, m) regno_mode_ok_for_base_p(r, m)
656 A C expression that is just like `REGNO_OK_FOR_BASE_P', except that
657 that expression may examine the mode of the memory reference in
658 MODE. You should define this macro if the mode of the memory
659 reference affects whether a register may be used as a base
660 register. If you define this macro, the compiler will use it
661 instead of `REGNO_OK_FOR_BASE_P'. */
663 #define REGNO_OK_FOR_INDEX_P(NUM) 0
664 /* A C expression which is nonzero if register number NUM is suitable
665 for use as an index register in operand addresses. It may be
666 either a suitable hard register or a pseudo register that has been
667 allocated such a hard register.
669 The difference between an index register and a base register is
670 that the index register may be scaled. If an address involves the
671 sum of two registers, neither one of them scaled, then either one
672 may be labeled the "base" and the other the "index"; but whichever
673 labeling is used must fit the machine's constraints of which
674 registers may serve in each capacity. The compiler will try both
675 labelings, looking for one that is valid, and will reload one or
676 both registers only if neither labeling works. */
678 #define PREFERRED_RELOAD_CLASS(X, CLASS) preferred_reload_class(X,CLASS)
679 /* A C expression that places additional restrictions on the register
680 class to use when it is necessary to copy value X into a register
681 in class CLASS. The value is a register class; perhaps CLASS, or
682 perhaps another, smaller class. On many machines, the following
685 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
687 Sometimes returning a more restrictive class makes better code.
688 For example, on the 68000, when X is an integer constant that is
689 in range for a `moveq' instruction, the value of this macro is
690 always `DATA_REGS' as long as CLASS includes the data registers.
691 Requiring a data register guarantees that a `moveq' will be used.
693 If X is a `const_double', by returning `NO_REGS' you can force X
694 into a memory constant. This is useful on certain machines where
695 immediate floating values cannot be loaded into certain kinds of
697 /* `PREFERRED_OUTPUT_RELOAD_CLASS (X, CLASS)'
698 Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of
699 input reloads. If you don't define this macro, the default is to
700 use CLASS, unchanged. */
702 /* `LIMIT_RELOAD_CLASS (MODE, CLASS)'
703 A C expression that places additional restrictions on the register
704 class to use when it is necessary to be able to hold a value of
705 mode MODE in a reload register for which class CLASS would
708 Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when
709 there are certain modes that simply can't go in certain reload
712 The value is a register class; perhaps CLASS, or perhaps another,
715 Don't define this macro unless the target machine has limitations
716 which require the macro to do something nontrivial. */
718 /* SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X)
719 `SECONDARY_RELOAD_CLASS (CLASS, MODE, X)'
720 `SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)'
721 Many machines have some registers that cannot be copied directly
722 to or from memory or even from other types of registers. An
723 example is the `MQ' register, which on most machines, can only be
724 copied to or from general registers, but not memory. Some
725 machines allow copying all registers to and from memory, but
726 require a scratch register for stores to some memory locations
727 (e.g., those with symbolic address on the RT, and those with
728 certain symbolic address on the Sparc when compiling PIC). In
729 some cases, both an intermediate and a scratch register are
732 You should define these macros to indicate to the reload phase
733 that it may need to allocate at least one register for a reload in
734 addition to the register to contain the data. Specifically, if
735 copying X to a register CLASS in MODE requires an intermediate
736 register, you should define `SECONDARY_INPUT_RELOAD_CLASS' to
737 return the largest register class all of whose registers can be
738 used as intermediate registers or scratch registers.
740 If copying a register CLASS in MODE to X requires an intermediate
741 or scratch register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be
742 defined to return the largest register class required. If the
743 requirements for input and output reloads are the same, the macro
744 `SECONDARY_RELOAD_CLASS' should be used instead of defining both
747 The values returned by these macros are often `GENERAL_REGS'.
748 Return `NO_REGS' if no spare register is needed; i.e., if X can be
749 directly copied to or from a register of CLASS in MODE without
750 requiring a scratch register. Do not define this macro if it
751 would always return `NO_REGS'.
753 If a scratch register is required (either with or without an
754 intermediate register), you should define patterns for
755 `reload_inM' or `reload_outM', as required (*note Standard
756 Names::.. These patterns, which will normally be implemented with
757 a `define_expand', should be similar to the `movM' patterns,
758 except that operand 2 is the scratch register.
760 Define constraints for the reload register and scratch register
761 that contain a single register class. If the original reload
762 register (whose class is CLASS) can meet the constraint given in
763 the pattern, the value returned by these macros is used for the
764 class of the scratch register. Otherwise, two additional reload
765 registers are required. Their classes are obtained from the
766 constraints in the insn pattern.
768 X might be a pseudo-register or a `subreg' of a pseudo-register,
769 which could either be in a hard register or in memory. Use
770 `true_regnum' to find out; it will return -1 if the pseudo is in
771 memory and the hard register number if it is in a register.
773 These macros should not be used in the case where a particular
774 class of registers can only be copied to memory and not to another
775 class of registers. In that case, secondary reload registers are
776 not needed and would not be helpful. Instead, a stack location
777 must be used to perform the copy and the `movM' pattern should use
778 memory as a intermediate storage. This case often occurs between
779 floating-point and general registers. */
781 /* `SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)'
782 Certain machines have the property that some registers cannot be
783 copied to some other registers without using memory. Define this
784 macro on those machines to be a C expression that is non-zero if
785 objects of mode M in registers of CLASS1 can only be copied to
786 registers of class CLASS2 by storing a register of CLASS1 into
787 memory and loading that memory location into a register of CLASS2.
789 Do not define this macro if its value would always be zero.
791 `SECONDARY_MEMORY_NEEDED_RTX (MODE)'
792 Normally when `SECONDARY_MEMORY_NEEDED' is defined, the compiler
793 allocates a stack slot for a memory location needed for register
794 copies. If this macro is defined, the compiler instead uses the
795 memory location defined by this macro.
797 Do not define this macro if you do not define
798 `SECONDARY_MEMORY_NEEDED'. */
800 #define SMALL_REGISTER_CLASSES 1
801 /* Normally the compiler avoids choosing registers that have been
802 explicitly mentioned in the rtl as spill registers (these
803 registers are normally those used to pass parameters and return
804 values). However, some machines have so few registers of certain
805 classes that there would not be enough registers to use as spill
806 registers if this were done.
808 Define `SMALL_REGISTER_CLASSES' to be an expression with a non-zero
809 value on these machines. When this macro has a non-zero value, the
810 compiler allows registers explicitly used in the rtl to be used as
811 spill registers but avoids extending the lifetime of these
814 It is always safe to define this macro with a non-zero value, but
815 if you unnecessarily define it, you will reduce the amount of
816 optimizations that can be performed in some cases. If you do not
817 define this macro with a non-zero value when it is required, the
818 compiler will run out of spill registers and print a fatal error
819 message. For most machines, you should not define this macro at
822 #define CLASS_LIKELY_SPILLED_P(c) class_likely_spilled_p(c)
823 /* A C expression whose value is nonzero if pseudos that have been
824 assigned to registers of class CLASS would likely be spilled
825 because registers of CLASS are needed for spill registers.
827 The default value of this macro returns 1 if CLASS has exactly one
828 register and zero otherwise. On most machines, this default
829 should be used. Only define this macro to some other expression
830 if pseudo allocated by `local-alloc.c' end up in memory because
831 their hard registers were needed for spill registers. If this
832 macro returns nonzero for those classes, those pseudos will only
833 be allocated by `global.c', which knows how to reallocate the
834 pseudo to another register. If there would not be another
835 register available for reallocation, you should not change the
836 definition of this macro since the only effect of such a
837 definition would be to slow down register allocation. */
839 #define CLASS_MAX_NREGS(CLASS, MODE) class_max_nregs (CLASS, MODE)
840 /* A C expression for the maximum number of consecutive registers of
841 class CLASS needed to hold a value of mode MODE.
843 This is closely related to the macro `HARD_REGNO_NREGS'. In fact,
844 the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be
845 the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all
846 REGNO values in the class CLASS.
848 This macro helps control the handling of multiple-word values in
851 #undef CLASS_CANNOT_CHANGE_SIZE
852 /* `CLASS_CANNOT_CHANGE_SIZE'
853 If defined, a C expression for a class that contains registers
854 which the compiler must always access in a mode that is the same
855 size as the mode in which it loaded the register.
857 For the example, loading 32-bit integer or floating-point objects
858 into floating-point registers on the Alpha extends them to 64-bits.
859 Therefore loading a 64-bit object and then storing it as a 32-bit
860 object does not store the low-order 32-bits, as would be the case
861 for a normal register. Therefore, `alpha.h' defines this macro as
864 Three other special macros describe which operands fit which
865 constraint letters. */
867 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
868 ((C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 63 : \
869 (C) == 'J' ? (VALUE) <= 0 && (VALUE) >= -63: \
870 (C) == 'K' ? (VALUE) == 2 : \
871 (C) == 'L' ? (VALUE) == 0 : \
872 (C) == 'M' ? (VALUE) >= 0 && (VALUE) <= 0xff : \
873 (C) == 'N' ? (VALUE) == -1: \
874 (C) == 'O' ? (VALUE) == 8 || (VALUE) == 16 || (VALUE) == 24: \
875 (C) == 'P' ? (VALUE) == 1 : \
878 /* A C expression that defines the machine-dependent operand
879 constraint letters (`I', `J', `K', ... `P') that specify
880 particular ranges of integer values. If C is one of those
881 letters, the expression should check that VALUE, an integer, is in
882 the appropriate range and return 1 if so, 0 otherwise. If C is
883 not one of those letters, the value should be 0 regardless of
886 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
887 ((C) == 'G' ? (VALUE) == CONST0_RTX (SFmode) \
889 /* `CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)'
890 A C expression that defines the machine-dependent operand
891 constraint letters that specify particular ranges of
892 `const_double' values (`G' or `H').
894 If C is one of those letters, the expression should check that
895 VALUE, an RTX of code `const_double', is in the appropriate range
896 and return 1 if so, 0 otherwise. If C is not one of those
897 letters, the value should be 0 regardless of VALUE.
899 `const_double' is used for all floating-point constants and for
900 `DImode' fixed-point constants. A given letter can accept either
901 or both kinds of values. It can use `GET_MODE' to distinguish
902 between these kinds. */
904 #define EXTRA_CONSTRAINT(x, c) extra_constraint(x, c)
905 /* A C expression that defines the optional machine-dependent
906 constraint letters (``Q', `R', `S', `T', `U') that can'
907 be used to segregate specific types of operands, usually memory
908 references, for the target machine. Normally this macro will not
909 be defined. If it is required for a particular target machine, it
910 should return 1 if VALUE corresponds to the operand type
911 represented by the constraint letter C. If C is not defined as an
912 extra constraint, the value returned should be 0 regardless of
915 For example, on the ROMP, load instructions cannot have their
916 output in r0 if the memory reference contains a symbolic address.
917 Constraint letter `Q' is defined as representing a memory address
918 that does *not* contain a symbolic address. An alternative is
919 specified with a `Q' constraint on the input and `r' on the
920 output. The next alternative specifies `m' on the input and a
921 register class that does not include r0 on the output. */
923 /* This is an undocumented variable which describes
924 how GCC will push a data */
925 #define STACK_PUSH_CODE POST_DEC
927 #define STACK_GROWS_DOWNWARD
928 /* Define this macro if pushing a word onto the stack moves the stack
929 pointer to a smaller address.
931 When we say, "define this macro if ...," it means that the
932 compiler checks this macro only with `#ifdef' so the precise
933 definition used does not matter. */
935 #define STARTING_FRAME_OFFSET 1
936 /* Offset from the frame pointer to the first local variable slot to
939 If `FRAME_GROWS_DOWNWARD', find the next slot's offset by
940 subtracting the first slot's length from `STARTING_FRAME_OFFSET'.
941 Otherwise, it is found by adding the length of the first slot to
942 the value `STARTING_FRAME_OFFSET'. */
944 #define STACK_POINTER_OFFSET 1
945 /* Offset from the stack pointer register to the first location at
946 which outgoing arguments are placed. If not specified, the
947 default value of zero is used. This is the proper value for most
950 If `ARGS_GROW_DOWNWARD', this is the offset to the location above
951 the first location at which outgoing arguments are placed. */
953 #define FIRST_PARM_OFFSET(FUNDECL) 0
954 /* Offset from the argument pointer register to the first argument's
955 address. On some machines it may depend on the data type of the
958 If `ARGS_GROW_DOWNWARD', this is the offset to the location above
959 the first argument's address. */
961 /* `STACK_DYNAMIC_OFFSET (FUNDECL)'
962 Offset from the stack pointer register to an item dynamically
963 allocated on the stack, e.g., by `alloca'.
965 The default value for this macro is `STACK_POINTER_OFFSET' plus the
966 length of the outgoing arguments. The default is correct for most
967 machines. See `function.c' for details. */
969 #define STACK_BOUNDARY 8
970 /* Define this macro if there is a guaranteed alignment for the stack
971 pointer on this machine. The definition is a C expression for the
972 desired alignment (measured in bits). This value is used as a
973 default if PREFERRED_STACK_BOUNDARY is not defined. */
975 #define STACK_POINTER_REGNUM 32
976 /* The register number of the stack pointer register, which must also
977 be a fixed register according to `FIXED_REGISTERS'. On most
978 machines, the hardware determines which register this is. */
980 #define FRAME_POINTER_REGNUM REG_Y
981 /* The register number of the frame pointer register, which is used to
982 access automatic variables in the stack frame. On some machines,
983 the hardware determines which register this is. On other
984 machines, you can choose any register you wish for this purpose. */
986 #define ARG_POINTER_REGNUM 34
987 /* The register number of the arg pointer register, which is used to
988 access the function's argument list. On some machines, this is
989 the same as the frame pointer register. On some machines, the
990 hardware determines which register this is. On other machines,
991 you can choose any register you wish for this purpose. If this is
992 not the same register as the frame pointer register, then you must
993 mark it as a fixed register according to `FIXED_REGISTERS', or
994 arrange to be able to eliminate it (*note Elimination::.). */
996 #define STATIC_CHAIN_REGNUM 2
997 /* Register numbers used for passing a function's static chain
998 pointer. If register windows are used, the register number as
999 seen by the called function is `STATIC_CHAIN_INCOMING_REGNUM',
1000 while the register number as seen by the calling function is
1001 `STATIC_CHAIN_REGNUM'. If these registers are the same,
1002 `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
1004 The static chain register need not be a fixed register.
1006 If the static chain is passed in memory, these macros should not be
1007 defined; instead, the next two macros should be defined. */
1009 #define FRAME_POINTER_REQUIRED frame_pointer_required_p()
1010 /* A C expression which is nonzero if a function must have and use a
1011 frame pointer. This expression is evaluated in the reload pass.
1012 If its value is nonzero the function will have a frame pointer.
1014 The expression can in principle examine the current function and
1015 decide according to the facts, but on most machines the constant 0
1016 or the constant 1 suffices. Use 0 when the machine allows code to
1017 be generated with no frame pointer, and doing so saves some time
1018 or space. Use 1 when there is no possible advantage to avoiding a
1021 In certain cases, the compiler does not know how to produce valid
1022 code without a frame pointer. The compiler recognizes those cases
1023 and automatically gives the function a frame pointer regardless of
1024 what `FRAME_POINTER_REQUIRED' says. You don't need to worry about
1027 In a function that does not require a frame pointer, the frame
1028 pointer register can be allocated for ordinary usage, unless you
1029 mark it as a fixed register. See `FIXED_REGISTERS' for more
1032 #define ELIMINABLE_REGS { \
1033 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
1034 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \
1035 ,{FRAME_POINTER_REGNUM+1,STACK_POINTER_REGNUM+1}}
1036 /* If defined, this macro specifies a table of register pairs used to
1037 eliminate unneeded registers that point into the stack frame. If
1038 it is not defined, the only elimination attempted by the compiler
1039 is to replace references to the frame pointer with references to
1042 The definition of this macro is a list of structure
1043 initializations, each of which specifies an original and
1044 replacement register.
1046 On some machines, the position of the argument pointer is not
1047 known until the compilation is completed. In such a case, a
1048 separate hard register must be used for the argument pointer.
1049 This register can be eliminated by replacing it with either the
1050 frame pointer or the argument pointer, depending on whether or not
1051 the frame pointer has been eliminated.
1053 In this case, you might specify:
1054 #define ELIMINABLE_REGS \
1055 {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1056 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
1057 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
1059 Note that the elimination of the argument pointer with the stack
1060 pointer is specified first since that is the preferred elimination. */
1062 #define CAN_ELIMINATE(FROM, TO) (((FROM) == ARG_POINTER_REGNUM \
1063 && (TO) == FRAME_POINTER_REGNUM) \
1064 || (((FROM) == FRAME_POINTER_REGNUM \
1065 || (FROM) == FRAME_POINTER_REGNUM+1) \
1066 && ! FRAME_POINTER_REQUIRED \
1068 /* A C expression that returns non-zero if the compiler is allowed to
1069 try to replace register number FROM-REG with register number
1070 TO-REG. This macro need only be defined if `ELIMINABLE_REGS' is
1071 defined, and will usually be the constant 1, since most of the
1072 cases preventing register elimination are things that the compiler
1073 already knows about. */
1075 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1076 OFFSET = initial_elimination_offset (FROM, TO)
1077 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
1078 specifies the initial difference between the specified pair of
1079 registers. This macro must be defined if `ELIMINABLE_REGS' is
1082 #define PUSH_ROUNDING(NPUSHED) (NPUSHED)
1083 /* A C expression that is the number of bytes actually pushed onto the
1084 stack when an instruction attempts to push NPUSHED bytes.
1086 If the target machine does not have a push instruction, do not
1087 define this macro. That directs GNU CC to use an alternate
1088 strategy: to allocate the entire argument block and then store the
1091 On some machines, the definition
1093 #define PUSH_ROUNDING(BYTES) (BYTES)
1095 will suffice. But on other machines, instructions that appear to
1096 push one byte actually push two bytes in an attempt to maintain
1097 alignment. Then the definition should be
1099 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1) */
1101 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
1102 /* A C expression that should indicate the number of bytes of its own
1103 arguments that a function pops on returning, or 0 if the function
1104 pops no arguments and the caller must therefore pop them all after
1105 the function returns.
1107 FUNDECL is a C variable whose value is a tree node that describes
1108 the function in question. Normally it is a node of type
1109 `FUNCTION_DECL' that describes the declaration of the function.
1110 From this you can obtain the DECL_MACHINE_ATTRIBUTES of the
1113 FUNTYPE is a C variable whose value is a tree node that describes
1114 the function in question. Normally it is a node of type
1115 `FUNCTION_TYPE' that describes the data type of the function.
1116 From this it is possible to obtain the data types of the value and
1117 arguments (if known).
1119 When a call to a library function is being considered, FUNDECL
1120 will contain an identifier node for the library function. Thus, if
1121 you need to distinguish among various library functions, you can
1122 do so by their names. Note that "library function" in this
1123 context means a function used to perform arithmetic, whose name is
1124 known specially in the compiler and was not mentioned in the C
1125 code being compiled.
1127 STACK-SIZE is the number of bytes of arguments passed on the
1128 stack. If a variable number of bytes is passed, it is zero, and
1129 argument popping will always be the responsibility of the calling
1132 On the Vax, all functions always pop their arguments, so the
1133 definition of this macro is STACK-SIZE. On the 68000, using the
1134 standard calling convention, no functions pop their arguments, so
1135 the value of the macro is always 0 in this case. But an
1136 alternative calling convention is available in which functions
1137 that take a fixed number of arguments pop them but other functions
1138 (such as `printf') pop nothing (the caller pops all). When this
1139 convention is in use, FUNTYPE is examined to determine whether a
1140 function takes a fixed number of arguments. */
1142 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) (function_arg (&(CUM), MODE, TYPE, NAMED))
1143 /* A C expression that controls whether a function argument is passed
1144 in a register, and which register.
1146 The arguments are CUM, which summarizes all the previous
1147 arguments; MODE, the machine mode of the argument; TYPE, the data
1148 type of the argument as a tree node or 0 if that is not known
1149 (which happens for C support library functions); and NAMED, which
1150 is 1 for an ordinary argument and 0 for nameless arguments that
1151 correspond to `...' in the called function's prototype.
1153 The value of the expression is usually either a `reg' RTX for the
1154 hard register in which to pass the argument, or zero to pass the
1155 argument on the stack.
1157 For machines like the Vax and 68000, where normally all arguments
1158 are pushed, zero suffices as a definition.
1160 The value of the expression can also be a `parallel' RTX. This is
1161 used when an argument is passed in multiple locations. The mode
1162 of the of the `parallel' should be the mode of the entire
1163 argument. The `parallel' holds any number of `expr_list' pairs;
1164 each one describes where part of the argument is passed. In each
1165 `expr_list', the first operand can be either a `reg' RTX for the
1166 hard register in which to pass this part of the argument, or zero
1167 to pass the argument on the stack. If this operand is a `reg',
1168 then the mode indicates how large this part of the argument is.
1169 The second operand of the `expr_list' is a `const_int' which gives
1170 the offset in bytes into the entire argument where this part
1173 The usual way to make the ANSI library `stdarg.h' work on a machine
1174 where some arguments are usually passed in registers, is to cause
1175 nameless arguments to be passed on the stack instead. This is done
1176 by making `FUNCTION_ARG' return 0 whenever NAMED is 0.
1178 You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the
1179 definition of this macro to determine if this argument is of a
1180 type that must be passed in the stack. If `REG_PARM_STACK_SPACE'
1181 is not defined and `FUNCTION_ARG' returns non-zero for such an
1182 argument, the compiler will abort. If `REG_PARM_STACK_SPACE' is
1183 defined, the argument will be computed in the stack and then
1184 loaded into a register. */
1186 typedef struct avr_args {
1187 int nregs; /* # registers available for passing */
1188 int regno; /* next available register number */
1190 /* A C type for declaring a variable that is used as the first
1191 argument of `FUNCTION_ARG' and other related values. For some
1192 target machines, the type `int' suffices and can hold the number
1193 of bytes of argument so far.
1195 There is no need to record in `CUMULATIVE_ARGS' anything about the
1196 arguments that have been passed on the stack. The compiler has
1197 other variables to keep track of that. For target machines on
1198 which all arguments are passed on the stack, there is no need to
1199 store anything in `CUMULATIVE_ARGS'; however, the data structure
1200 must exist and should not be empty, so use `int'. */
1202 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) init_cumulative_args (&(CUM), FNTYPE, LIBNAME, INDIRECT)
1204 /* A C statement (sans semicolon) for initializing the variable CUM
1205 for the state at the beginning of the argument list. The variable
1206 has type `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node
1207 for the data type of the function which will receive the args, or 0
1208 if the args are to a compiler support library function. The value
1209 of INDIRECT is nonzero when processing an indirect call, for
1210 example a call through a function pointer. The value of INDIRECT
1211 is zero for a call to an explicitly named function, a library
1212 function call, or when `INIT_CUMULATIVE_ARGS' is used to find
1213 arguments for the function being compiled.
1215 When processing a call to a compiler support library function,
1216 LIBNAME identifies which one. It is a `symbol_ref' rtx which
1217 contains the name of the function, as a string. LIBNAME is 0 when
1218 an ordinary C function call is being processed. Thus, each time
1219 this macro is called, either LIBNAME or FNTYPE is nonzero, but
1220 never both of them at once. */
1222 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
1223 (function_arg_advance (&CUM, MODE, TYPE, NAMED))
1225 /* A C statement (sans semicolon) to update the summarizer variable
1226 CUM to advance past an argument in the argument list. The values
1227 MODE, TYPE and NAMED describe that argument. Once this is done,
1228 the variable CUM is suitable for analyzing the *following*
1229 argument with `FUNCTION_ARG', etc.
1231 This macro need not do anything if the argument in question was
1232 passed on the stack. The compiler knows how to track the amount
1233 of stack space used for arguments without any special help. */
1235 #define FUNCTION_ARG_REGNO_P(r) function_arg_regno_p(r)
1236 /* A C expression that is nonzero if REGNO is the number of a hard
1237 register in which function arguments are sometimes passed. This
1238 does *not* include implicit arguments such as the static chain and
1239 the structure-value address. On many machines, no registers can be
1240 used for this purpose since all function arguments are pushed on
1243 extern int avr_reg_order[];
1245 #define RET_REGISTER avr_ret_register ()
1247 #define FUNCTION_VALUE(VALTYPE, FUNC) avr_function_value (VALTYPE, FUNC)
1248 /* A C expression to create an RTX representing the place where a
1249 function returns a value of data type VALTYPE. VALTYPE is a tree
1250 node representing a data type. Write `TYPE_MODE (VALTYPE)' to get
1251 the machine mode used to represent that type. On many machines,
1252 only the mode is relevant. (Actually, on most machines, scalar
1253 values are returned in the same place regardless of mode).
1255 The value of the expression is usually a `reg' RTX for the hard
1256 register where the return value is stored. The value can also be a
1257 `parallel' RTX, if the return value is in multiple places. See
1258 `FUNCTION_ARG' for an explanation of the `parallel' form.
1260 If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same
1261 promotion rules specified in `PROMOTE_MODE' if VALTYPE is a scalar
1264 If the precise function being called is known, FUNC is a tree node
1265 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
1266 makes it possible to use a different value-returning convention
1267 for specific functions when all their calls are known.
1269 `FUNCTION_VALUE' is not used for return vales with aggregate data
1270 types, because these are returned in another way. See
1271 `STRUCT_VALUE_REGNUM' and related macros, below. */
1273 #define LIBCALL_VALUE(MODE) avr_libcall_value (MODE)
1274 /* A C expression to create an RTX representing the place where a
1275 library function returns a value of mode MODE. If the precise
1276 function being called is known, FUNC is a tree node
1277 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
1278 makes it possible to use a different value-returning convention
1279 for specific functions when all their calls are known.
1281 Note that "library function" in this context means a compiler
1282 support routine, used to perform arithmetic, whose name is known
1283 specially by the compiler and was not mentioned in the C code being
1286 The definition of `LIBRARY_VALUE' need not be concerned aggregate
1287 data types, because none of the library functions returns such
1290 #define FUNCTION_VALUE_REGNO_P(N) ((N) == RET_REGISTER)
1291 /* A C expression that is nonzero if REGNO is the number of a hard
1292 register in which the values of called function may come back.
1294 A register whose use for returning values is limited to serving as
1295 the second of a pair (for a value of type `double', say) need not
1296 be recognized by this macro. So for most machines, this definition
1299 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
1301 If the machine has register windows, so that the caller and the
1302 called function use different registers for the return value, this
1303 macro should recognize only the caller's register numbers. */
1305 #define RETURN_IN_MEMORY(TYPE) ((TYPE_MODE (TYPE) == BLKmode) \
1306 ? int_size_in_bytes (TYPE) > 8 \
1308 /* A C expression which can inhibit the returning of certain function
1309 values in registers, based on the type of value. A nonzero value
1310 says to return the function value in memory, just as large
1311 structures are always returned. Here TYPE will be a C expression
1312 of type `tree', representing the data type of the value.
1314 Note that values of mode `BLKmode' must be explicitly handled by
1315 this macro. Also, the option `-fpcc-struct-return' takes effect
1316 regardless of this macro. On most systems, it is possible to
1317 leave the macro undefined; this causes a default definition to be
1318 used, whose value is the constant 1 for `BLKmode' values, and 0
1321 Do not use this macro to indicate that structures and unions
1322 should always be returned in memory. You should instead use
1323 `DEFAULT_PCC_STRUCT_RETURN' to indicate this. */
1325 #define DEFAULT_PCC_STRUCT_RETURN 0
1326 /* Define this macro to be 1 if all structure and union return values
1327 must be in memory. Since this results in slower code, this should
1328 be defined only if needed for compatibility with other compilers
1329 or with an ABI. If you define this macro to be 0, then the
1330 conventions used for structure and union return values are decided
1331 by the `RETURN_IN_MEMORY' macro.
1333 If not defined, this defaults to the value 1. */
1335 #define STRUCT_VALUE 0
1336 /* If the structure value address is not passed in a register, define
1337 `STRUCT_VALUE' as an expression returning an RTX for the place
1338 where the address is passed. If it returns 0, the address is
1339 passed as an "invisible" first argument. */
1341 #define STRUCT_VALUE_INCOMING 0
1342 /* If the incoming location is not a register, then you should define
1343 `STRUCT_VALUE_INCOMING' as an expression for an RTX for where the
1344 called function should find the value. If it should find the
1345 value on the stack, define this to create a `mem' which refers to
1346 the frame pointer. A definition of 0 means that the address is
1347 passed as an "invisible" first argument. */
1349 #define FUNCTION_PROLOGUE(FILE, SIZE) function_prologue (FILE, SIZE)
1350 /* A C compound statement that outputs the assembler code for entry
1351 to a function. The prologue is responsible for setting up the
1352 stack frame, initializing the frame pointer register, saving
1353 registers that must be saved, and allocating SIZE additional bytes
1354 of storage for the local variables. SIZE is an integer. FILE is
1355 a stdio stream to which the assembler code should be output.
1357 The label for the beginning of the function need not be output by
1358 this macro. That has already been done when the macro is run.
1360 To determine which registers to save, the macro can refer to the
1361 array `regs_ever_live': element R is nonzero if hard register R is
1362 used anywhere within the function. This implies the function
1363 prologue should save register R, provided it is not one of the
1364 call-used registers. (`FUNCTION_EPILOGUE' must likewise use
1367 On machines that have "register windows", the function entry code
1368 does not save on the stack the registers that are in the windows,
1369 even if they are supposed to be preserved by function calls;
1370 instead it takes appropriate steps to "push" the register stack,
1371 if any non-call-used registers are used in the function.
1373 On machines where functions may or may not have frame-pointers, the
1374 function entry code must vary accordingly; it must set up the frame
1375 pointer if one is wanted, and not otherwise. To determine whether
1376 a frame pointer is in wanted, the macro can refer to the variable
1377 `frame_pointer_needed'. The variable's value will be 1 at run
1378 time in a function that needs a frame pointer. *Note
1381 The function entry code is responsible for allocating any stack
1382 space required for the function. This stack space consists of the
1383 regions listed below. In most cases, these regions are allocated
1384 in the order listed, with the last listed region closest to the
1385 top of the stack (the lowest address if `STACK_GROWS_DOWNWARD' is
1386 defined, and the highest address if it is not defined). You can
1387 use a different order for a machine if doing so is more convenient
1388 or required for compatibility reasons. Except in cases where
1389 required by standard or by a debugger, there is no reason why the
1390 stack layout used by GCC need agree with that used by other
1391 compilers for a machine.
1393 * A region of `current_function_pretend_args_size' bytes of
1394 uninitialized space just underneath the first argument
1395 arriving on the stack. (This may not be at the very start of
1396 the allocated stack region if the calling sequence has pushed
1397 anything else since pushing the stack arguments. But
1398 usually, on such machines, nothing else has been pushed yet,
1399 because the function prologue itself does all the pushing.)
1400 This region is used on machines where an argument may be
1401 passed partly in registers and partly in memory, and, in some
1402 cases to support the features in `varargs.h' and `stdargs.h'.
1404 * An area of memory used to save certain registers used by the
1405 function. The size of this area, which may also include
1406 space for such things as the return address and pointers to
1407 previous stack frames, is machine-specific and usually
1408 depends on which registers have been used in the function.
1409 Machines with register windows often do not require a save
1412 * A region of at least SIZE bytes, possibly rounded up to an
1413 allocation boundary, to contain the local variables of the
1414 function. On some machines, this region and the save area
1415 may occur in the opposite order, with the save area closer to
1416 the top of the stack.
1418 * Optionally, when `ACCUMULATE_OUTGOING_ARGS' is defined, a
1419 region of `current_function_outgoing_args_size' bytes to be
1420 used for outgoing argument lists of the function. *Note
1423 Normally, it is necessary for the macros `FUNCTION_PROLOGUE' and
1424 `FUNCTION_EPILOGE' to treat leaf functions specially. The C
1425 variable `leaf_function' is nonzero for such a function. */
1427 #define EPILOGUE_USES(REGNO) 0
1428 /* Define this macro as a C expression that is nonzero for registers
1429 are used by the epilogue or the `return' pattern. The stack and
1430 frame pointer registers are already be assumed to be used as
1433 #define FUNCTION_EPILOGUE(FILE, SIZE) function_epilogue (FILE, SIZE)
1434 /* A C compound statement that outputs the assembler code for exit
1435 from a function. The epilogue is responsible for restoring the
1436 saved registers and stack pointer to their values when the
1437 function was called, and returning control to the caller. This
1438 macro takes the same arguments as the macro `FUNCTION_PROLOGUE',
1439 and the registers to restore are determined from `regs_ever_live'
1440 and `CALL_USED_REGISTERS' in the same way.
1442 On some machines, there is a single instruction that does all the
1443 work of returning from the function. On these machines, give that
1444 instruction the name `return' and do not define the macro
1445 `FUNCTION_EPILOGUE' at all.
1447 Do not define a pattern named `return' if you want the
1448 `FUNCTION_EPILOGUE' to be used. If you want the target switches
1449 to control whether return instructions or epilogues are used,
1450 define a `return' pattern with a validity condition that tests the
1451 target switches appropriately. If the `return' pattern's validity
1452 condition is false, epilogues will be used.
1454 On machines where functions may or may not have frame-pointers, the
1455 function exit code must vary accordingly. Sometimes the code for
1456 these two cases is completely different. To determine whether a
1457 frame pointer is wanted, the macro can refer to the variable
1458 `frame_pointer_needed'. The variable's value will be 1 when
1459 compiling a function that needs a frame pointer.
1461 Normally, `FUNCTION_PROLOGUE' and `FUNCTION_EPILOGUE' must treat
1462 leaf functions specially. The C variable `leaf_function' is
1463 nonzero for such a function. *Note Leaf Functions::.
1465 On some machines, some functions pop their arguments on exit while
1466 others leave that for the caller to do. For example, the 68020
1467 when given `-mrtd' pops arguments in functions that take a fixed
1468 number of arguments.
1470 Your definition of the macro `RETURN_POPS_ARGS' decides which
1471 functions pop their own arguments. `FUNCTION_EPILOGUE' needs to
1472 know what was decided. The variable that is called
1473 `current_function_pops_args' is the number of bytes of its
1474 arguments that a function should pop. *Note Scalar Return::. */
1476 #define STRICT_ARGUMENT_NAMING 1
1477 /* Define this macro if the location where a function argument is
1478 passed depends on whether or not it is a named argument.
1480 This macro controls how the NAMED argument to `FUNCTION_ARG' is
1481 set for varargs and stdarg functions. With this macro defined,
1482 the NAMED argument is always true for named arguments, and false
1483 for unnamed arguments. If this is not defined, but
1484 `SETUP_INCOMING_VARARGS' is defined, then all arguments are
1485 treated as named. Otherwise, all named arguments except the last
1486 are treated as named. */
1489 #define HAVE_POST_INCREMENT 1
1490 /* Define this macro if the machine supports post-increment
1493 #define HAVE_PRE_DECREMENT 1
1494 /* #define HAVE_PRE_INCREMENT
1495 #define HAVE_POST_DECREMENT */
1496 /* Similar for other kinds of addressing. */
1498 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
1499 /* A C expression that is 1 if the RTX X is a constant which is a
1500 valid address. On most machines, this can be defined as
1501 `CONSTANT_P (X)', but a few machines are more restrictive in which
1502 constant addresses are supported.
1504 `CONSTANT_P' accepts integer-values expressions whose values are
1505 not explicitly known, such as `symbol_ref', `label_ref', and
1506 `high' expressions and `const' arithmetic expressions, in addition
1507 to `const_int' and `const_double' expressions. */
1509 #define MAX_REGS_PER_ADDRESS 1
1510 /* A number, the maximum number of registers that can appear in a
1511 valid memory address. Note that it is up to you to specify a
1512 value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS'
1513 would ever accept. */
1515 #ifdef REG_OK_STRICT
1516 # define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \
1518 if (legitimate_address_p (mode, operand, 1)) \
1522 # define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \
1524 if (legitimate_address_p (mode, operand, 0)) \
1528 /* A C compound statement with a conditional `goto LABEL;' executed
1529 if X (an RTX) is a legitimate memory address on the target machine
1530 for a memory operand of mode MODE.
1532 It usually pays to define several simpler macros to serve as
1533 subroutines for this one. Otherwise it may be too complicated to
1536 This macro must exist in two variants: a strict variant and a
1537 non-strict one. The strict variant is used in the reload pass. It
1538 must be defined so that any pseudo-register that has not been
1539 allocated a hard register is considered a memory reference. In
1540 contexts where some kind of register is required, a pseudo-register
1541 with no hard register must be rejected.
1543 The non-strict variant is used in other passes. It must be
1544 defined to accept all pseudo-registers in every context where some
1545 kind of register is required.
1547 Compiler source files that want to use the strict variant of this
1548 macro define the macro `REG_OK_STRICT'. You should use an `#ifdef
1549 REG_OK_STRICT' conditional to define the strict variant in that
1550 case and the non-strict variant otherwise.
1552 Subroutines to check for acceptable registers for various purposes
1553 (one for base registers, one for index registers, and so on) are
1554 typically among the subroutines used to define
1555 `GO_IF_LEGITIMATE_ADDRESS'. Then only these subroutine macros
1556 need have two variants; the higher levels of macros may be the
1557 same whether strict or not.
1559 Normally, constant addresses which are the sum of a `symbol_ref'
1560 and an integer are stored inside a `const' RTX to mark them as
1561 constant. Therefore, there is no need to recognize such sums
1562 specifically as legitimate addresses. Normally you would simply
1563 recognize any `const' as legitimate.
1565 Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant
1566 sums that are not marked with `const'. It assumes that a naked
1567 `plus' indicates indexing. If so, then you *must* reject such
1568 naked constant sums as illegitimate addresses, so that none of
1569 them will be given to `PRINT_OPERAND_ADDRESS'.
1571 On some machines, whether a symbolic address is legitimate depends
1572 on the section that the address refers to. On these machines,
1573 define the macro `ENCODE_SECTION_INFO' to store the information
1574 into the `symbol_ref', and then check for it here. When you see a
1575 `const', you will have to look inside it to find the `symbol_ref'
1576 in order to determine the section. *Note Assembler Format::.
1578 The best way to modify the name string is by adding text to the
1579 beginning, with suitable punctuation to prevent any ambiguity.
1580 Allocate the new name in `saveable_obstack'. You will have to
1581 modify `ASM_OUTPUT_LABELREF' to remove and decode the added text
1582 and output the name accordingly, and define `STRIP_NAME_ENCODING'
1583 to access the original name string.
1585 You can check the information stored here into the `symbol_ref' in
1586 the definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and
1587 `PRINT_OPERAND_ADDRESS'. */
1589 /* `REG_OK_FOR_BASE_P (X)'
1590 A C expression that is nonzero if X (assumed to be a `reg' RTX) is
1591 valid for use as a base register. For hard registers, it should
1592 always accept those which the hardware permits and reject the
1593 others. Whether the macro accepts or rejects pseudo registers
1594 must be controlled by `REG_OK_STRICT' as described above. This
1595 usually requires two variant definitions, of which `REG_OK_STRICT'
1596 controls the one actually used. */
1598 #define REG_OK_FOR_BASE_NOSTRICT_P(X) \
1599 (REGNO (X) >= FIRST_PSEUDO_REGISTER || REG_OK_FOR_BASE_STRICT_P(X))
1601 #define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
1603 #ifdef REG_OK_STRICT
1604 # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X)
1606 # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NOSTRICT_P (X)
1609 /* A C expression that is just like `REG_OK_FOR_BASE_P', except that
1610 that expression may examine the mode of the memory reference in
1611 MODE. You should define this macro if the mode of the memory
1612 reference affects whether a register may be used as a base
1613 register. If you define this macro, the compiler will use it
1614 instead of `REG_OK_FOR_BASE_P'. */
1615 #define REG_OK_FOR_INDEX_P(X) 0
1616 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is
1617 valid for use as an index register.
1619 The difference between an index register and a base register is
1620 that the index register may be scaled. If an address involves the
1621 sum of two registers, neither one of them scaled, then either one
1622 may be labeled the "base" and the other the "index"; but whichever
1623 labeling is used must fit the machine's constraints of which
1624 registers may serve in each capacity. The compiler will try both
1625 labelings, looking for one that is valid, and will reload one or
1626 both registers only if neither labeling works. */
1628 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
1630 (X) = legitimize_address (X, OLDX, MODE); \
1631 if (memory_address_p (MODE, X)) \
1634 /* A C compound statement that attempts to replace X with a valid
1635 memory address for an operand of mode MODE. WIN will be a C
1636 statement label elsewhere in the code; the macro definition may use
1638 GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
1640 to avoid further processing if the address has become legitimate.
1642 X will always be the result of a call to `break_out_memory_refs',
1643 and OLDX will be the operand that was given to that function to
1646 The code generated by this macro should not alter the substructure
1647 of X. If it transforms X into a more legitimate form, it should
1648 assign X (which will always be a C variable) a new value.
1650 It is not necessary for this macro to come up with a legitimate
1651 address. The compiler has standard ways of doing so in all cases.
1652 In fact, it is safe for this macro to do nothing. But often a
1653 machine-dependent strategy can generate better code. */
1655 #define XEXP_(X,Y) (X)
1656 #define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN) \
1658 if (1&&(GET_CODE (X) == POST_INC || GET_CODE (X) == PRE_DEC)) \
1660 push_reload (XEXP (X,0), XEXP (X,0), &XEXP (X,0), &XEXP (X,0), \
1661 POINTER_REGS, GET_MODE (X),GET_MODE (X) , 0, 0, \
1662 OPNUM, RELOAD_OTHER); \
1665 if (GET_CODE (X) == PLUS \
1666 && REG_P (XEXP (X, 0)) \
1667 && GET_CODE (XEXP (X, 1)) == CONST_INT \
1668 && INTVAL (XEXP (X, 1)) >= 1) \
1670 int fit = INTVAL (XEXP (X, 1)) <= (64 - GET_MODE_SIZE (MODE)); \
1673 if (reg_equiv_address[REGNO (XEXP (X, 0))] != 0) \
1675 int regno = REGNO (XEXP (X, 0)); \
1676 rtx mem = make_memloc (X, regno); \
1677 push_reload (XEXP (mem,0), NULL_PTR, &XEXP (mem,0), NULL_PTR, \
1678 POINTER_REGS, Pmode, VOIDmode, 0, 0, \
1679 1, ADDR_TYPE (TYPE)); \
1680 push_reload (mem, NULL_RTX, &XEXP (X, 0), NULL_PTR, \
1681 BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \
1685 push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL_PTR, \
1686 BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \
1690 else if (! (frame_pointer_needed && XEXP (X,0) == frame_pointer_rtx)) \
1692 push_reload (X, NULL_RTX, &X, NULL_PTR, \
1693 POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \
1699 /* A C compound statement that attempts to replace X, which is an
1700 address that needs reloading, with a valid memory address for an
1701 operand of mode MODE. WIN will be a C statement label elsewhere
1702 in the code. It is not necessary to define this macro, but it
1703 might be useful for performance reasons.
1705 For example, on the i386, it is sometimes possible to use a single
1706 reload register instead of two by reloading a sum of two pseudo
1707 registers into a register. On the other hand, for number of RISC
1708 processors offsets are limited so that often an intermediate
1709 address needs to be generated in order to address a stack slot.
1710 By defining LEGITIMIZE_RELOAD_ADDRESS appropriately, the
1711 intermediate addresses generated for adjacent some stack slots can
1712 be made identical, and thus be shared.
1714 *Note*: This macro should be used with caution. It is necessary
1715 to know something of how reload works in order to effectively use
1716 this, and it is quite easy to produce macros that build in too
1717 much knowledge of reload internals.
1719 *Note*: This macro must be able to reload an address created by a
1720 previous invocation of this macro. If it fails to handle such
1721 addresses then the compiler may generate incorrect code or abort.
1723 The macro definition should use `push_reload' to indicate parts
1724 that need reloading; OPNUM, TYPE and IND_LEVELS are usually
1725 suitable to be passed unaltered to `push_reload'.
1727 The code generated by this macro must not alter the substructure of
1728 X. If it transforms X into a more legitimate form, it should
1729 assign X (which will always be a C variable) a new value. This
1730 also applies to parts that you change indirectly by calling
1733 The macro definition may use `strict_memory_address_p' to test if
1734 the address has become legitimate.
1736 If you want to change only a part of X, one standard way of doing
1737 this is to use `copy_rtx'. Note, however, that is unshares only a
1738 single level of rtl. Thus, if the part to be changed is not at the
1739 top level, you'll need to replace first the top leve It is not
1740 necessary for this macro to come up with a legitimate address;
1741 but often a machine-dependent strategy can generate better code. */
1743 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
1744 if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) \
1746 /* A C statement or compound statement with a conditional `goto
1747 LABEL;' executed if memory address X (an RTX) can have different
1748 meanings depending on the machine mode of the memory reference it
1749 is used for or if the address is valid for some modes but not
1752 Autoincrement and autodecrement addresses typically have
1753 mode-dependent effects because the amount of the increment or
1754 decrement is the size of the operand being addressed. Some
1755 machines have other mode-dependent addresses. Many RISC machines
1756 have no mode-dependent addresses.
1758 You may assume that ADDR is a valid address for the machine. */
1760 #define LEGITIMATE_CONSTANT_P(X) 1
1761 /* A C expression that is nonzero if X is a legitimate constant for
1762 an immediate operand on the target machine. You can assume that X
1763 satisfies `CONSTANT_P', so you need not check this. In fact, `1'
1764 is a suitable definition for this macro on machines where anything
1765 `CONSTANT_P' is valid. */
1767 #define CONST_COSTS(x,CODE,OUTER_CODE) \
1769 if (OUTER_CODE == PLUS \
1770 || OUTER_CODE == IOR \
1771 || OUTER_CODE == AND \
1772 || OUTER_CODE == MINUS \
1773 || OUTER_CODE == SET \
1774 || INTVAL (x) == 0) \
1776 if (OUTER_CODE == COMPARE \
1777 && INTVAL (x) >= 0 \
1778 && INTVAL (x) <= 255) \
1784 case CONST_DOUBLE: \
1787 /* A part of a C `switch' statement that describes the relative costs
1788 of constant RTL expressions. It must contain `case' labels for
1789 expression codes `const_int', `const', `symbol_ref', `label_ref'
1790 and `const_double'. Each case must ultimately reach a `return'
1791 statement to return the relative cost of the use of that kind of
1792 constant value in an expression. The cost may depend on the
1793 precise value of the constant, which is available for examination
1794 in X, and the rtx code of the expression in which it is contained,
1795 found in OUTER_CODE.
1797 CODE is the expression code--redundant, since it can be obtained
1798 with `GET_CODE (X)'. */
1800 #define DEFAULT_RTX_COSTS(x, code, outer_code) \
1802 int cst = default_rtx_costs (x, code, outer_code); \
1810 /* Like `CONST_COSTS' but applies to nonconstant RTL expressions.
1811 This can be used, for example, to indicate how costly a multiply
1812 instruction is. In writing this macro, you can use the construct
1813 `COSTS_N_INSNS (N)' to specify a cost equal to N fast
1814 instructions. OUTER_CODE is the code of the expression in which X
1817 This macro is optional; do not define it if the default cost
1818 assumptions are adequate for the target machine. */
1820 #define ADDRESS_COST(ADDRESS) address_cost (ADDRESS)
1822 /* An expression giving the cost of an addressing mode that contains
1823 ADDRESS. If not defined, the cost is computed from the ADDRESS
1824 expression and the `CONST_COSTS' values.
1826 For most CISC machines, the default cost is a good approximation
1827 of the true cost of the addressing mode. However, on RISC
1828 machines, all instructions normally have the same length and
1829 execution time. Hence all addresses will have equal costs.
1831 In cases where more than one form of an address is known, the form
1832 with the lowest cost will be used. If multiple forms have the
1833 same, lowest, cost, the one that is the most complex will be used.
1835 For example, suppose an address that is equal to the sum of a
1836 register and a constant is used twice in the same basic block.
1837 When this macro is not defined, the address will be computed in a
1838 register and memory references will be indirect through that
1839 register. On machines where the cost of the addressing mode
1840 containing the sum is no higher than that of a simple indirect
1841 reference, this will produce an additional instruction and
1842 possibly require an additional register. Proper specification of
1843 this macro eliminates this overhead for such machines.
1845 Similar use of this macro is made in strength reduction of loops.
1847 ADDRESS need not be valid as an address. In such a case, the cost
1848 is not relevant and can be any value; invalid addresses need not be
1849 assigned a different cost.
1851 On machines where an address involving more than one register is as
1852 cheap as an address computation involving only one register,
1853 defining `ADDRESS_COST' to reflect this can cause two registers to
1854 be live over a region of code where only one would have been if
1855 `ADDRESS_COST' were not defined in that manner. This effect should
1856 be considered in the definition of this macro. Equivalent costs
1857 should probably only be given to addresses with different numbers
1858 of registers on machines with lots of registers.
1860 This macro will normally either not be defined or be defined as a
1863 #define REGISTER_MOVE_COST(FROM, TO) ((FROM) == STACK_REG ? 6 : \
1864 (TO) == STACK_REG ? 12 \
1866 /* A C expression for the cost of moving data from a register in class
1867 FROM to one in class TO. The classes are expressed using the
1868 enumeration values such as `GENERAL_REGS'. A value of 2 is the
1869 default; other values are interpreted relative to that.
1871 It is not required that the cost always equal 2 when FROM is the
1872 same as TO; on some machines it is expensive to move between
1873 registers if they are not general registers.
1875 If reload sees an insn consisting of a single `set' between two
1876 hard registers, and if `REGISTER_MOVE_COST' applied to their
1877 classes returns a value of 2, reload does not check to ensure that
1878 the constraints of the insn are met. Setting a cost of other than
1879 2 will allow reload to verify that the constraints are met. You
1880 should do this if the `movM' pattern's constraints do not allow
1883 #define MEMORY_MOVE_COST(MODE,CLASS,IN) ((MODE)==QImode ? 2 : \
1884 (MODE)==HImode ? 4 : \
1885 (MODE)==SImode ? 8 : \
1886 (MODE)==SFmode ? 8 : 16)
1887 /* A C expression for the cost of moving data of mode M between a
1888 register and memory. A value of 4 is the default; this cost is
1889 relative to those in `REGISTER_MOVE_COST'.
1891 If moving between registers and memory is more expensive than
1892 between two registers, you should define this macro to express the
1895 #define SLOW_BYTE_ACCESS 0
1896 /* Define this macro as a C expression which is nonzero if accessing
1897 less than a word of memory (i.e. a `char' or a `short') is no
1898 faster than accessing a word of memory, i.e., if such access
1899 require more than one instruction or if there is no difference in
1900 cost between byte and (aligned) word loads.
1902 When this macro is not defined, the compiler will access a field by
1903 finding the smallest containing object; when it is defined, a
1904 fullword load will be used if alignment permits. Unless bytes
1905 accesses are faster than word accesses, using word accesses is
1906 preferable since it may eliminate subsequent memory access if
1907 subsequent accesses occur to other fields in the same word of the
1908 structure, but to different bytes.
1911 Define this macro if zero-extension (of a `char' or `short' to an
1912 `int') can be done faster if the destination is a register that is
1915 If you define this macro, you must have instruction patterns that
1916 recognize RTL structures like this:
1918 (set (strict_low_part (subreg:QI (reg:SI ...) 0)) ...)
1920 and likewise for `HImode'.
1922 `SLOW_UNALIGNED_ACCESS'
1923 Define this macro to be the value 1 if unaligned accesses have a
1924 cost many times greater than aligned accesses, for example if they
1925 are emulated in a trap handler.
1927 When this macro is non-zero, the compiler will act as if
1928 `STRICT_ALIGNMENT' were non-zero when generating code for block
1929 moves. This can cause significantly more instructions to be
1930 produced. Therefore, do not set this macro non-zero if unaligned
1931 accesses only add a cycle or two to the time for a memory access.
1933 If the value of this macro is always zero, it need not be defined.
1936 Define this macro to inhibit strength reduction of memory
1937 addresses. (On some machines, such strength reduction seems to do
1938 harm rather than good.)
1941 The number of scalar move insns which should be generated instead
1942 of a string move insn or a library call. Increasing the value
1943 will always make code faster, but eventually incurs high cost in
1944 increased code size.
1946 If you don't define this, a reasonable default is used. */
1948 #define NO_FUNCTION_CSE
1949 /* Define this macro if it is as good or better to call a constant
1950 function address than to call an address kept in a register. */
1952 #define NO_RECURSIVE_FUNCTION_CSE
1953 /* Define this macro if it is as good or better for a function to call
1954 itself with an explicit address than to call an address kept in a
1957 `ADJUST_COST (INSN, LINK, DEP_INSN, COST)'
1958 A C statement (sans semicolon) to update the integer variable COST
1959 based on the relationship between INSN that is dependent on
1960 DEP_INSN through the dependence LINK. The default is to make no
1961 adjustment to COST. This can be used for example to specify to
1962 the scheduler that an output- or anti-dependence does not incur
1963 the same cost as a data-dependence.
1965 `ADJUST_PRIORITY (INSN)'
1966 A C statement (sans semicolon) to update the integer scheduling
1967 priority `INSN_PRIORITY(INSN)'. Reduce the priority to execute
1968 the INSN earlier, increase the priority to execute INSN later.
1969 Do not define this macro if you do not need to adjust the
1970 scheduling priorities of insns. */
1973 #define TEXT_SECTION_ASM_OP ".text"
1974 /* A C expression whose value is a string containing the assembler
1975 operation that should precede instructions and read-only data.
1976 Normally `".text"' is right. */
1978 #define DATA_SECTION_ASM_OP ".data"
1979 /* A C expression whose value is a string containing the assembler
1980 operation to identify the following data as writable initialized
1981 data. Normally `".data"' is right. */
1983 #define EXTRA_SECTIONS in_progmem
1984 /* A list of names for sections other than the standard two, which are
1985 `in_text' and `in_data'. You need not define this macro on a
1986 system with no other sections (that GCC needs to use). */
1988 #define EXTRA_SECTION_FUNCTIONS \
1991 progmem_section (void) \
1993 if (in_section != in_progmem) \
1995 fprintf (asm_out_file, ".section .progmem.gcc_sw_table\n"); \
1996 in_section = in_progmem; \
1999 /* `EXTRA_SECTION_FUNCTIONS'
2000 One or more functions to be defined in `varasm.c'. These
2001 functions should do jobs analogous to those of `text_section' and
2002 `data_section', for your additional sections. Do not define this
2003 macro if you do not define `EXTRA_SECTIONS'. */
2005 #define READONLY_DATA_SECTION data_section
2006 /* On most machines, read-only variables, constants, and jump tables
2007 are placed in the text section. If this is not the case on your
2008 machine, this macro should be defined to be the name of a function
2009 (either `data_section' or a function defined in `EXTRA_SECTIONS')
2010 that switches to the section to be used for read-only items.
2012 If these items should be placed in the text section, this macro
2013 should not be defined. */
2015 /* `SELECT_SECTION (EXP, RELOC)'
2016 A C statement or statements to switch to the appropriate section
2017 for output of EXP. You can assume that EXP is either a `VAR_DECL'
2018 node or a constant of some sort. RELOC indicates whether the
2019 initial value of EXP requires link-time relocations. Select the
2020 section by calling `text_section' or one of the alternatives for
2023 Do not define this macro if you put all read-only variables and
2024 constants in the read-only data section (usually the text section). */
2026 /* `SELECT_RTX_SECTION (MODE, RTX)'
2027 A C statement or statements to switch to the appropriate section
2028 for output of RTX in mode MODE. You can assume that RTX is some
2029 kind of constant in RTL. The argument MODE is redundant except in
2030 the case of a `const_int' rtx. Select the section by calling
2031 `text_section' or one of the alternatives for other sections.
2033 Do not define this macro if you put all constants in the read-only
2036 #define JUMP_TABLES_IN_TEXT_SECTION 1
2037 /* Define this macro if jump tables (for `tablejump' insns) should be
2038 output in the text section, along with the assembler instructions.
2039 Otherwise, the readonly data section is used.
2041 This macro is irrelevant if there is no separate readonly data
2044 #define ENCODE_SECTION_INFO(DECL) encode_section_info(DECL)
2045 /* Define this macro if references to a symbol must be treated
2046 differently depending on something about the variable or function
2047 named by the symbol (such as what section it is in).
2049 The macro definition, if any, is executed immediately after the
2050 rtl for DECL has been created and stored in `DECL_RTL (DECL)'.
2051 The value of the rtl will be a `mem' whose address is a
2054 The usual thing for this macro to do is to record a flag in the
2055 `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified
2056 name string in the `symbol_ref' (if one bit is not enough
2059 #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
2060 (VAR) = (SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*' || (SYMBOL_NAME)[0] == '@');
2061 /* `STRIP_NAME_ENCODING (VAR, SYM_NAME)'
2062 Decode SYM_NAME and store the real name part in VAR, sans the
2063 characters that encode section info. Define this macro if
2064 `ENCODE_SECTION_INFO' alters the symbol's name string. */
2065 /* `UNIQUE_SECTION_P (DECL)'
2066 A C expression which evaluates to true if DECL should be placed
2067 into a unique section for some target-specific reason. If you do
2068 not define this macro, the default is `0'. Note that the flag
2069 `-ffunction-sections' will also cause functions to be placed into
2072 #define UNIQUE_SECTION(DECL, RELOC) unique_section (DECL, RELOC)
2073 /* `UNIQUE_SECTION (DECL, RELOC)'
2074 A C statement to build up a unique section name, expressed as a
2075 STRING_CST node, and assign it to `DECL_SECTION_NAME (DECL)'.
2076 RELOC indicates whether the initial value of EXP requires
2077 link-time relocations. If you do not define this macro, GNU CC
2078 will use the symbol name prefixed by `.' as the section name. */
2081 #define ASM_FILE_START(STREAM) asm_file_start (STREAM)
2082 /* A C expression which outputs to the stdio stream STREAM some
2083 appropriate text to go at the start of an assembler file.
2085 Normally this macro is defined to output a line containing
2086 `#NO_APP', which is a comment that has no effect on most
2087 assemblers but tells the GNU assembler that it can save time by not
2088 checking for certain assembler constructs.
2090 On systems that use SDB, it is necessary to output certain
2091 commands; see `attasm.h'. */
2093 #define ASM_FILE_END(STREAM) asm_file_end (STREAM)
2094 /* A C expression which outputs to the stdio stream STREAM some
2095 appropriate text to go at the end of an assembler file.
2097 If this macro is not defined, the default is to output nothing
2098 special at the end of the file. Most systems don't require any
2101 On systems that use SDB, it is necessary to output certain
2102 commands; see `attasm.h'. */
2104 #define ASM_COMMENT_START " ; "
2105 /* A C string constant describing how to begin a comment in the target
2106 assembler language. The compiler assumes that the comment will
2107 end at the end of the line. */
2109 #define ASM_APP_ON "/* #APP */\n"
2110 /* A C string constant for text to be output before each `asm'
2111 statement or group of consecutive ones. Normally this is
2112 `"#APP"', which is a comment that has no effect on most assemblers
2113 but tells the GNU assembler that it must check the lines that
2114 follow for all valid assembler constructs. */
2116 #define ASM_APP_OFF "/* #NOAPP */\n"
2117 /* A C string constant for text to be output after each `asm'
2118 statement or group of consecutive ones. Normally this is
2119 `"#NO_APP"', which tells the GNU assembler to resume making the
2120 time-saving assumptions that are valid for ordinary compiler
2123 #define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) fprintf (STREAM,"/* line: %d */\n",LINE)
2124 /* A C statement to output DBX or SDB debugging information before
2125 code for line number LINE of the current source file to the stdio
2128 This macro need not be defined if the standard form of debugging
2129 information for the debugger in use is appropriate. */
2131 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
2132 asm_output_section_name(FILE, DECL, NAME, RELOC)
2134 /* `ASM_OUTPUT_SECTION_NAME (STREAM, DECL, NAME, RELOC)'
2135 A C statement to output something to the assembler file to switch
2136 to section NAME for object DECL which is either a `FUNCTION_DECL',
2137 a `VAR_DECL' or `NULL_TREE'. RELOC indicates whether the initial
2138 value of EXP requires link-time relocations. Some target formats
2139 do not support arbitrary sections. Do not define this macro in
2142 At present this macro is only used to support section attributes.
2143 When this macro is undefined, section attributes are disabled. */
2145 #define OBJC_PROLOGUE {}
2146 /* A C statement to output any assembler statements which are
2147 required to precede any Objective C object definitions or message
2148 sending. The statement is executed only when compiling an
2149 Objective C program. */
2153 #define ASM_OUTPUT_DOUBLE(STREAM, VALUE) fprintf (STREAM, "no double float %.20e\n", VALUE)
2154 #define ASM_OUTPUT_FLOAT(STREAM, VALUE) asm_output_float (STREAM, VALUE)
2155 /* `ASM_OUTPUT_LONG_DOUBLE (STREAM, VALUE)'
2156 `ASM_OUTPUT_THREE_QUARTER_FLOAT (STREAM, VALUE)'
2157 `ASM_OUTPUT_SHORT_FLOAT (STREAM, VALUE)'
2158 `ASM_OUTPUT_BYTE_FLOAT (STREAM, VALUE)'
2159 A C statement to output to the stdio stream STREAM an assembler
2160 instruction to assemble a floating-point constant of `TFmode',
2161 `DFmode', `SFmode', `TQFmode', `HFmode', or `QFmode',
2162 respectively, whose value is VALUE. VALUE will be a C expression
2163 of type `REAL_VALUE_TYPE'. Macros such as
2164 `REAL_VALUE_TO_TARGET_DOUBLE' are useful for writing these
2168 #define ASM_OUTPUT_INT(FILE, VALUE) \
2169 ( fprintf (FILE, "\t.long "), \
2170 output_addr_const (FILE, (VALUE)), \
2173 /* Likewise for `short' and `char' constants. */
2175 #define ASM_OUTPUT_SHORT(FILE,VALUE) asm_output_short(FILE,VALUE)
2176 #define ASM_OUTPUT_CHAR(FILE,VALUE) asm_output_char(FILE,VALUE)
2178 /* `ASM_OUTPUT_QUADRUPLE_INT (STREAM, EXP)'
2179 A C statement to output to the stdio stream STREAM an assembler
2180 instruction to assemble an integer of 16, 8, 4, 2 or 1 bytes,
2181 respectively, whose value is VALUE. The argument EXP will be an
2182 RTL expression which represents a constant value. Use
2183 `output_addr_const (STREAM, EXP)' to output this value as an
2184 assembler expression.
2186 For sizes larger than `UNITS_PER_WORD', if the action of a macro
2187 would be identical to repeatedly calling the macro corresponding to
2188 a size of `UNITS_PER_WORD', once for each word, you need not define
2192 #define ASM_OUTPUT_BYTE(FILE,VALUE) asm_output_byte (FILE,VALUE)
2193 /* A C statement to output to the stdio stream STREAM an assembler
2194 instruction to assemble a single byte containing the number VALUE. */
2196 #define ASM_BYTE_OP ".byte "
2197 /* A C string constant giving the pseudo-op to use for a sequence of
2198 single-byte constants. If this macro is not defined, the default
2201 #define ASM_OUTPUT_ASCII(FILE, P, SIZE) gas_output_ascii (FILE,P,SIZE)
2202 /* `ASM_OUTPUT_ASCII (STREAM, PTR, LEN)'
2203 output_ascii (FILE, P, SIZE)
2204 A C statement to output to the stdio stream STREAM an assembler
2205 instruction to assemble a string constant containing the LEN bytes
2206 at PTR. PTR will be a C expression of type `char *' and LEN a C
2207 expression of type `int'.
2209 If the assembler has a `.ascii' pseudo-op as found in the Berkeley
2210 Unix assembler, do not define the macro `ASM_OUTPUT_ASCII'. */
2212 #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '\n' \
2214 /* Define this macro as a C expression which is nonzero if C is used
2215 as a logical line separator by the assembler.
2217 If you do not define this macro, the default is that only the
2218 character `;' is treated as a logical line separator. */
2220 #define ASM_OPEN_PAREN "("
2221 #define ASM_CLOSE_PAREN ")"
2222 /* These macros are defined as C string constant, describing the
2223 syntax in the assembler for grouping arithmetic expressions. The
2224 following definitions are correct for most assemblers:
2226 #define ASM_OPEN_PAREN "("
2227 #define ASM_CLOSE_PAREN ")"
2229 These macros are provided by `real.h' for writing the definitions of
2230 `ASM_OUTPUT_DOUBLE' and the like: */
2232 #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
2234 fputs ("\t.comm ", (STREAM)); \
2235 assemble_name ((STREAM), (NAME)); \
2236 fprintf ((STREAM), ",%d\n", (SIZE)); \
2238 /* A C statement (sans semicolon) to output to the stdio stream
2239 STREAM the assembler definition of a common-label named NAME whose
2240 size is SIZE bytes. The variable ROUNDED is the size rounded up
2241 to whatever alignment the caller wants.
2243 Use the expression `assemble_name (STREAM, NAME)' to output the
2244 name itself; before and after that, output the additional
2245 assembler syntax for defining the name, and a newline.
2247 This macro controls how the assembler definitions of uninitialized
2248 common global variables are output. */
2250 #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) \
2252 fputs ("\t.lcomm ", (STREAM)); \
2253 assemble_name ((STREAM), (NAME)); \
2254 fprintf ((STREAM), ",%d\n", (SIZE)); \
2256 /* A C statement (sans semicolon) to output to the stdio stream
2257 STREAM the assembler definition of a local-common-label named NAME
2258 whose size is SIZE bytes. The variable ROUNDED is the size
2259 rounded up to whatever alignment the caller wants.
2261 Use the expression `assemble_name (STREAM, NAME)' to output the
2262 name itself; before and after that, output the additional
2263 assembler syntax for defining the name, and a newline.
2265 This macro controls how the assembler definitions of uninitialized
2266 static variables are output. */
2268 #define ASM_OUTPUT_LABEL(STREAM, NAME) \
2270 assemble_name (STREAM, NAME); \
2271 fprintf (STREAM, ":\n"); \
2273 /* A C statement (sans semicolon) to output to the stdio stream
2274 STREAM the assembler definition of a label named NAME. Use the
2275 expression `assemble_name (STREAM, NAME)' to output the name
2276 itself; before and after that, output the additional assembler
2277 syntax for defining the name, and a newline. */
2282 #define TYPE_ASM_OP ".type"
2283 #define SIZE_ASM_OP ".size"
2284 #define WEAK_ASM_OP ".weak"
2285 /* Define the strings used for the special svr4 .type and .size directives.
2286 These strings generally do not vary from one system running svr4 to
2287 another, but if a given system (e.g. m88k running svr) needs to use
2288 different pseudo-op names for these, they may be overridden in the
2289 file which includes this one. */
2292 #undef TYPE_OPERAND_FMT
2293 #define TYPE_OPERAND_FMT "@%s"
2294 /* The following macro defines the format used to output the second
2295 operand of the .type assembler directive. Different svr4 assemblers
2296 expect various different forms for this operand. The one given here
2297 is just a default. You may need to override it in your machine-
2298 specific tm.h file (depending upon the particulars of your assembler). */
2301 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
2303 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
2304 assemble_name (FILE, NAME); \
2306 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
2307 putc ('\n', FILE); \
2308 ASM_OUTPUT_LABEL (FILE, NAME); \
2310 /* A C statement (sans semicolon) to output to the stdio stream
2311 STREAM any text necessary for declaring the name NAME of a
2312 function which is being defined. This macro is responsible for
2313 outputting the label definition (perhaps using
2314 `ASM_OUTPUT_LABEL'). The argument DECL is the `FUNCTION_DECL'
2315 tree node representing the function.
2317 If this macro is not defined, then the function name is defined in
2318 the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
2320 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
2322 if (!flag_inhibit_size_directive) \
2325 static int labelno; \
2327 ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
2328 ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
2329 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
2330 assemble_name (FILE, (FNAME)); \
2331 fprintf (FILE, ","); \
2332 assemble_name (FILE, label); \
2333 fprintf (FILE, "-"); \
2334 assemble_name (FILE, (FNAME)); \
2335 putc ('\n', FILE); \
2338 /* A C statement (sans semicolon) to output to the stdio stream
2339 STREAM any text necessary for declaring the size of a function
2340 which is being defined. The argument NAME is the name of the
2341 function. The argument DECL is the `FUNCTION_DECL' tree node
2342 representing the function.
2344 If this macro is not defined, then the function size is not
2347 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
2349 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
2350 assemble_name (FILE, NAME); \
2352 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
2353 putc ('\n', FILE); \
2354 size_directive_output = 0; \
2355 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
2357 size_directive_output = 1; \
2358 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
2359 assemble_name (FILE, NAME); \
2360 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
2362 ASM_OUTPUT_LABEL(FILE, NAME); \
2364 /* A C statement (sans semicolon) to output to the stdio stream
2365 STREAM any text necessary for declaring the name NAME of an
2366 initialized variable which is being defined. This macro must
2367 output the label definition (perhaps using `ASM_OUTPUT_LABEL').
2368 The argument DECL is the `VAR_DECL' tree node representing the
2371 If this macro is not defined, then the variable name is defined in
2372 the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
2374 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
2376 char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
2377 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
2378 && ! AT_END && TOP_LEVEL \
2379 && DECL_INITIAL (DECL) == error_mark_node \
2380 && !size_directive_output) \
2382 size_directive_output = 1; \
2383 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
2384 assemble_name (FILE, name); \
2385 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
2388 /* A C statement (sans semicolon) to finish up declaring a variable
2389 name once the compiler has processed its initializer fully and
2390 thus has had a chance to determine the size of an array when
2391 controlled by an initializer. This is used on systems where it's
2392 necessary to declare something about the size of the object.
2394 If you don't define this macro, that is equivalent to defining it
2399 "\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\
2400 \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\
2401 \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\
2402 \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\
2403 \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\
2404 \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\
2405 \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\
2406 \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"
2407 /* A table of bytes codes used by the ASM_OUTPUT_ASCII and
2408 ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
2409 corresponds to a particular byte value [0..255]. For any
2410 given byte value, if the value in the corresponding table
2411 position is zero, the given character can be output directly.
2412 If the table value is 1, the byte must be output as a \ooo
2413 octal escape. If the tables value is anything else, then the
2414 byte value should be output as a \ followed by the value
2415 in the table. Note that we can use standard UN*X escape
2416 sequences for many control characters, but we don't use
2417 \a to represent BEL because some svr4 assemblers (e.g. on
2418 the i386) don't know about that. Also, we don't use \v
2419 since some versions of gas, such as 2.2 did not accept it. */
2421 #define STRING_LIMIT ((unsigned) 64)
2422 #define STRING_ASM_OP ".string"
2423 /* Some svr4 assemblers have a limit on the number of characters which
2424 can appear in the operand of a .string directive. If your assembler
2425 has such a limitation, you should define STRING_LIMIT to reflect that
2426 limit. Note that at least some svr4 assemblers have a limit on the
2427 actual number of bytes in the double-quoted string, and that they
2428 count each character in an escape sequence as one byte. Thus, an
2429 escape sequence like \377 would count as four bytes.
2431 If your target assembler doesn't support the .string directive, you
2432 should define this to zero. */
2434 #define ASM_GLOBALIZE_LABEL(STREAM, NAME) \
2436 fprintf (STREAM, ".global\t"); \
2437 assemble_name (STREAM, NAME); \
2438 fprintf (STREAM, "\n"); \
2442 /* A C statement (sans semicolon) to output to the stdio stream
2443 STREAM some commands that will make the label NAME global; that
2444 is, available for reference from other files. Use the expression
2445 `assemble_name (STREAM, NAME)' to output the name itself; before
2446 and after that, output the additional assembler syntax for making
2447 that name global, and a newline. */
2449 /* `ASM_WEAKEN_LABEL'
2450 A C statement (sans semicolon) to output to the stdio stream
2451 STREAM some commands that will make the label NAME weak; that is,
2452 available for reference from other files but only used if no other
2453 definition is available. Use the expression `assemble_name
2454 (STREAM, NAME)' to output the name itself; before and after that,
2455 output the additional assembler syntax for making that name weak,
2458 If you don't define this macro, GNU CC will not support weak
2459 symbols and you should not define the `SUPPORTS_WEAK' macro.
2462 A C expression which evaluates to true if the target supports weak
2465 If you don't define this macro, `defaults.h' provides a default
2466 definition. If `ASM_WEAKEN_LABEL' is defined, the default
2467 definition is `1'; otherwise, it is `0'. Define this macro if you
2468 want to control weak symbol support with a compiler flag such as
2471 `MAKE_DECL_ONE_ONLY'
2472 A C statement (sans semicolon) to mark DECL to be emitted as a
2473 public symbol such that extra copies in multiple translation units
2474 will be discarded by the linker. Define this macro if your object
2475 file format provides support for this concept, such as the `COMDAT'
2476 section flags in the Microsoft Windows PE/COFF format, and this
2477 support requires changes to DECL, such as putting it in a separate
2481 A C expression which evaluates to true if the target supports
2484 If you don't define this macro, `varasm.c' provides a default
2485 definition. If `MAKE_DECL_ONE_ONLY' is defined, the default
2486 definition is `1'; otherwise, it is `0'. Define this macro if you
2487 want to control weak symbol support with a compiler flag, or if
2488 setting the `DECL_ONE_ONLY' flag is enough to mark a declaration to
2489 be emitted as one-only. */
2491 #define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) \
2492 fprintf(STREAM, ".%s%d:\n", PREFIX, NUM)
2493 /* A C statement to output to the stdio stream STREAM a label whose
2494 name is made from the string PREFIX and the number NUM.
2496 It is absolutely essential that these labels be distinct from the
2497 labels used for user-level functions and variables. Otherwise,
2498 certain programs will have name conflicts with internal labels.
2500 It is desirable to exclude internal labels from the symbol table
2501 of the object file. Most assemblers have a naming convention for
2502 labels that should be excluded; on many systems, the letter `L' at
2503 the beginning of a label has this effect. You should find out what
2504 convention your system uses, and follow it.
2506 The usual definition of this macro is as follows:
2508 fprintf (STREAM, "L%s%d:\n", PREFIX, NUM) */
2510 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
2511 sprintf (STRING, "*.%s%d", PREFIX, NUM)
2512 /* A C statement to store into the string STRING a label whose name
2513 is made from the string PREFIX and the number NUM.
2515 This string, when output subsequently by `assemble_name', should
2516 produce the output that `ASM_OUTPUT_INTERNAL_LABEL' would produce
2517 with the same PREFIX and NUM.
2519 If the string begins with `*', then `assemble_name' will output
2520 the rest of the string unchanged. It is often convenient for
2521 `ASM_GENERATE_INTERNAL_LABEL' to use `*' in this way. If the
2522 string doesn't start with `*', then `ASM_OUTPUT_LABELREF' gets to
2523 output the string, and may change it. (Of course,
2524 `ASM_OUTPUT_LABELREF' is also part of your machine description, so
2525 you should know what it does on your machine.) */
2527 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
2528 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
2529 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
2531 /* A C expression to assign to OUTVAR (which is a variable of type
2532 `char *') a newly allocated string made from the string NAME and
2533 the number NUMBER, with some suitable punctuation added. Use
2534 `alloca' to get space for the string.
2536 The string will be used as an argument to `ASM_OUTPUT_LABELREF' to
2537 produce an assembler label for an internal static variable whose
2538 name is NAME. Therefore, the string must be such as to result in
2539 valid assembler code. The argument NUMBER is different each time
2540 this macro is executed; it prevents conflicts between
2541 similarly-named internal static variables in different scopes.
2543 Ideally this string should not be a valid C identifier, to prevent
2544 any conflict with the user's own symbols. Most assemblers allow
2545 periods or percent signs in assembler symbols; putting at least
2546 one of these between the name and the number will suffice. */
2548 /* `ASM_OUTPUT_WEAK_ALIAS (STREAM, NAME, VALUE)'
2549 A C statement to output to the stdio stream STREAM assembler code
2550 which defines (equates) the weak symbol NAME to have the value
2553 Define this macro if the target only supports weak aliases; define
2554 ASM_OUTPUT_DEF instead if possible. */
2556 #define HAS_INIT_SECTION 1
2557 /* If defined, `main' will not call `__main' as described above.
2558 This macro should be defined for systems that control the contents
2559 of the init section on a symbol-by-symbol basis, such as OSF/1,
2560 and should not be defined explicitly for systems that support
2561 `INIT_SECTION_ASM_OP'. */
2563 #define REGISTER_NAMES { \
2564 "r0","r1","r2","r3","r4","r5","r6","r7", \
2565 "r8","r9","r10","r11","r12","r13","r14","r15", \
2566 "r16","r17","r18","r19","r20","r21","r22","r23", \
2567 "r24","r25","r26","r27","r28","r29","r30","r31", \
2568 "__SPL__","__SPH__","argL","argH"}
2569 /* A C initializer containing the assembler's names for the machine
2570 registers, each one as a C string constant. This is what
2571 translates register numbers in the compiler into assembler
2574 #define FINAL_PRESCAN_INSN(insn, operand, nop) final_prescan_insn (insn, operand,nop)
2575 /* If defined, a C statement to be executed just prior to the output
2576 of assembler code for INSN, to modify the extracted operands so
2577 they will be output differently.
2579 Here the argument OPVEC is the vector containing the operands
2580 extracted from INSN, and NOPERANDS is the number of elements of
2581 the vector which contain meaningful data for this insn. The
2582 contents of this vector are what will be used to convert the insn
2583 template into assembler code, so you can change the assembler
2584 output by changing the contents of the vector.
2586 This macro is useful when various assembler syntaxes share a single
2587 file of instruction patterns; by defining this macro differently,
2588 you can cause a large class of instructions to be output
2589 differently (such as with rearranged operands). Naturally,
2590 variations in assembler syntax affecting individual insn patterns
2591 ought to be handled by writing conditional output routines in
2594 If this macro is not defined, it is equivalent to a null statement. */
2596 #define PRINT_OPERAND(STREAM, X, CODE) print_operand (STREAM, X, CODE)
2597 /* A C compound statement to output to stdio stream STREAM the
2598 assembler syntax for an instruction operand X. X is an RTL
2601 CODE is a value that can be used to specify one of several ways of
2602 printing the operand. It is used when identical operands must be
2603 printed differently depending on the context. CODE comes from the
2604 `%' specification that was used to request printing of the
2605 operand. If the specification was just `%DIGIT' then CODE is 0;
2606 if the specification was `%LTR DIGIT' then CODE is the ASCII code
2609 If X is a register, this macro should print the register's name.
2610 The names can be found in an array `reg_names' whose type is `char
2611 *[]'. `reg_names' is initialized from `REGISTER_NAMES'.
2613 When the machine description has a specification `%PUNCT' (a `%'
2614 followed by a punctuation character), this macro is called with a
2615 null pointer for X and the punctuation character for CODE. */
2617 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '~')
2618 /* A C expression which evaluates to true if CODE is a valid
2619 punctuation character for use in the `PRINT_OPERAND' macro. If
2620 `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no
2621 punctuation characters (except for the standard one, `%') are used
2624 #define PRINT_OPERAND_ADDRESS(STREAM, X) print_operand_address(STREAM, X)
2625 /* A C compound statement to output to stdio stream STREAM the
2626 assembler syntax for an instruction operand that is a memory
2627 reference whose address is X. X is an RTL expression.
2629 On some machines, the syntax for a symbolic address depends on the
2630 section that the address refers to. On these machines, define the
2631 macro `ENCODE_SECTION_INFO' to store the information into the
2632 `symbol_ref', and then check for it here. *Note Assembler
2635 #define USER_LABEL_PREFIX ""
2636 /* `LOCAL_LABEL_PREFIX'
2639 If defined, C string expressions to be used for the `%R', `%L',
2640 `%U', and `%I' options of `asm_fprintf' (see `final.c'). These
2641 are useful when a single `md' file must support multiple assembler
2642 formats. In that case, the various `tm.h' files can define these
2643 macros differently. */
2645 #define ASM_OUTPUT_REG_PUSH(STREAM, REGNO) \
2648 fatal("regno error in push"); \
2649 fprintf (STREAM, "\tpush\tr%d", REGNO); \
2651 /* A C expression to output to STREAM some assembler code which will
2652 push hard register number REGNO onto the stack. The code need not
2653 be optimal, since this macro is used only when profiling. */
2655 #define ASM_OUTPUT_REG_POP(STREAM, REGNO) \
2658 fatal("regno error in pop"); \
2659 fprintf (STREAM, "\tpop\tr%d", REGNO); \
2661 /* A C expression to output to STREAM some assembler code which will
2662 pop hard register number REGNO off of the stack. The code need
2663 not be optimal, since this macro is used only when profiling. */
2665 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
2666 fprintf (STREAM, "\t.word pm(.L%d)\n", VALUE);
2667 /* This macro should be provided on machines where the addresses in a
2668 dispatch table are absolute.
2670 The definition should be a C statement to output to the stdio
2671 stream STREAM an assembler pseudo-instruction to generate a
2672 reference to a label. VALUE is the number of an internal label
2673 whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'. For
2676 fprintf (STREAM, "\t.word L%d\n", VALUE) */
2678 #define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) \
2679 progmem_section (), ASM_OUTPUT_INTERNAL_LABEL (STREAM, PREFIX, NUM)
2681 /* `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)'
2682 Define this if the label before a jump-table needs to be output
2683 specially. The first three arguments are the same as for
2684 `ASM_OUTPUT_INTERNAL_LABEL'; the fourth argument is the jump-table
2685 which follows (a `jump_insn' containing an `addr_vec' or
2688 This feature is used on system V to output a `swbeg' statement for
2691 If this macro is not defined, these labels are output with
2692 `ASM_OUTPUT_INTERNAL_LABEL'. */
2694 /* `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)'
2695 Define this if something special must be output at the end of a
2696 jump-table. The definition should be a C statement to be executed
2697 after the assembler code for the table is written. It should write
2698 the appropriate code to stdio stream STREAM. The argument TABLE
2699 is the jump-table insn, and NUM is the label-number of the
2702 If this macro is not defined, nothing special is output at the end
2703 of the jump-table. */
2705 #define ASM_OUTPUT_SKIP(STREAM, n) \
2706 fprintf (STREAM, "\t.skip %d,0\n", n)
2707 /* A C statement to output to the stdio stream STREAM an assembler
2708 instruction to advance the location counter by NBYTES bytes.
2709 Those bytes should be zero when loaded. NBYTES will be a C
2710 expression of type `int'. */
2712 #define ASM_OUTPUT_ALIGN(STREAM, POWER)
2713 /* A C statement to output to the stdio stream STREAM an assembler
2714 command to advance the location counter to a multiple of 2 to the
2715 POWER bytes. POWER will be a C expression of type `int'. */
2717 #define CASE_VECTOR_MODE HImode
2718 /* An alias for a machine mode name. This is the machine mode that
2719 elements of a jump-table should have. */
2721 #define CASE_VALUES_THRESHOLD 17
2722 /* `CASE_VALUES_THRESHOLD'
2723 Define this to be the smallest number of different values for
2724 which it is best to use a jump-table instead of a tree of
2725 conditional branches. The default is four for machines with a
2726 `casesi' instruction and five otherwise. This is best for most
2729 #undef WORD_REGISTER_OPERATIONS
2730 /* Define this macro if operations between registers with integral
2731 mode smaller than a word are always performed on the entire
2732 register. Most RISC machines have this property and most CISC
2735 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
2736 /* An alias for a tree code that is the easiest kind of division to
2737 compile code for in the general case. It may be `TRUNC_DIV_EXPR',
2738 `FLOOR_DIV_EXPR', `CEIL_DIV_EXPR' or `ROUND_DIV_EXPR'. These four
2739 division operators differ in how they round the result to an
2740 integer. `EASY_DIV_EXPR' is used when it is permissible to use
2741 any of those kinds of division and the choice should be made on
2742 the basis of efficiency. */
2745 /* The maximum number of bytes that a single instruction can move
2746 quickly between memory and registers or between two memory
2749 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
2750 /* A C expression which is nonzero if on this machine it is safe to
2751 "convert" an integer of INPREC bits to one of OUTPREC bits (where
2752 OUTPREC is smaller than INPREC) by merely operating on it as if it
2753 had only OUTPREC bits.
2755 On many machines, this expression can be 1.
2757 When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for
2758 modes for which `MODES_TIEABLE_P' is 0, suboptimal code can result.
2759 If this is the case, making `TRULY_NOOP_TRUNCATION' return 0 in
2760 such cases may improve things. */
2762 #define Pmode HImode
2763 /* An alias for the machine mode for pointers. On most machines,
2764 define this to be the integer mode corresponding to the width of a
2765 hardware pointer; `SImode' on 32-bit machine or `DImode' on 64-bit
2766 machines. On some machines you must define this to be one of the
2767 partial integer modes, such as `PSImode'.
2769 The width of `Pmode' must be at least as large as the value of
2770 `POINTER_SIZE'. If it is not equal, you must define the macro
2771 `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to
2774 #define FUNCTION_MODE HImode
2775 /* An alias for the machine mode used for memory references to
2776 functions being called, in `call' RTL expressions. On most
2777 machines this should be `QImode'. */
2779 #define INTEGRATE_THRESHOLD(DECL) (1 + (3 * list_length (DECL_ARGUMENTS (DECL)) / 2))
2781 /* A C expression for the maximum number of instructions above which
2782 the function DECL should not be inlined. DECL is a
2783 `FUNCTION_DECL' node.
2785 The default definition of this macro is 64 plus 8 times the number
2786 of arguments that the function accepts. Some people think a larger
2787 threshold should be used on RISC machines. */
2789 #define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
2790 valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
2791 /* `VALID_MACHINE_DECL_ATTRIBUTE (DECL, ATTRIBUTES, IDENTIFIER, ARGS)'
2792 If defined, a C expression whose value is nonzero if IDENTIFIER
2793 with arguments ARGS is a valid machine specific attribute for DECL.
2794 The attributes in ATTRIBUTES have previously been assigned to DECL. */
2796 #define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) \
2797 valid_machine_type_attribute(TYPE, ATTRIBUTES, IDENTIFIER, ARGS)
2798 /* `VALID_MACHINE_TYPE_ATTRIBUTE (TYPE, ATTRIBUTES, IDENTIFIER, ARGS)'
2799 If defined, a C expression whose value is nonzero if IDENTIFIER
2800 with arguments ARGS is a valid machine specific attribute for TYPE.
2801 The attributes in ATTRIBUTES have previously been assigned to TYPE. */
2803 #define DOLLARS_IN_IDENTIFIERS 0
2804 /* Define this macro to control use of the character `$' in identifier
2805 names. 0 means `$' is not allowed by default; 1 means it is
2806 allowed. 1 is the default; there is no need to define this macro
2807 in that case. This macro controls the compiler proper; it does
2808 not affect the preprocessor. */
2810 #define NO_DOLLAR_IN_LABEL 1
2811 /* Define this macro if the assembler does not accept the character
2812 `$' in label names. By default constructors and destructors in
2813 G++ have `$' in the identifiers. If this macro is defined, `.' is
2816 #define MACHINE_DEPENDENT_REORG(INSN) machine_dependent_reorg (INSN)
2817 /* In rare cases, correct code generation requires extra machine
2818 dependent processing between the second jump optimization pass and
2819 delayed branch scheduling. On those machines, define this macro
2820 as a C statement to act on the code starting at INSN. */
2822 #define GIV_SORT_CRITERION(X, Y) \
2823 if (GET_CODE ((X)->add_val) == CONST_INT \
2824 && GET_CODE ((Y)->add_val) == CONST_INT) \
2825 return INTVAL ((X)->add_val) - INTVAL ((Y)->add_val);
2827 /* `GIV_SORT_CRITERION(GIV1, GIV2)'
2828 In some cases, the strength reduction optimization pass can
2829 produce better code if this is defined. This macro controls the
2830 order that induction variables are combined. This macro is
2831 particularly useful if the target has limited addressing modes.
2832 For instance, the SH target has only positive offsets in
2833 addresses. Thus sorting to put the smallest address first allows
2834 the most combinations to be found. */
2836 /* Define results of standard character escape sequences. */
2837 #define TARGET_BELL 007
2838 #define TARGET_BS 010
2839 #define TARGET_TAB 011
2840 #define TARGET_NEWLINE 012
2841 #define TARGET_VT 013
2842 #define TARGET_FF 014
2843 #define TARGET_CR 015
2847 #define TRAMPOLINE_TEMPLATE(FILE) fatal ("Trampolines not supported\n")
2849 /* Length in units of the trampoline for entering a nested function. */
2851 #define TRAMPOLINE_SIZE 4
2853 /* Emit RTL insns to initialize the variable parts of a trampoline.
2854 FNADDR is an RTX for the address of the function's pure code.
2855 CXT is an RTX for the static chain value for the function. */
2857 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
2859 emit_move_insn (gen_rtx (MEM, HImode, plus_constant ((TRAMP), 2)), CXT); \
2860 emit_move_insn (gen_rtx (MEM, HImode, plus_constant ((TRAMP), 6)), FNADDR); \
2862 /* Store in cc_status the expressions
2863 that the condition codes will describe
2864 after execution of an instruction whose pattern is EXP.
2865 Do not alter them if the instruction would not alter the cc's. */
2867 #define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc(EXP, INSN)
2869 /* The add insns don't set overflow in a usable way. */
2870 #define CC_OVERFLOW_UNUSABLE 01000
2871 /* The mov,and,or,xor insns don't set carry. That's ok though as the
2872 Z bit is all we need when doing unsigned comparisons on the result of
2873 these insns (since they're always with 0). However, conditions.h has
2874 CC_NO_OVERFLOW defined for this purpose. Rename it to something more
2876 #define CC_NO_CARRY CC_NO_OVERFLOW
2879 /* Output assembler code to FILE to increment profiler label # LABELNO
2880 for profiling a function entry. */
2882 #define FUNCTION_PROFILER(FILE, LABELNO) \
2883 fprintf (FILE, "/* profiler %d */", (LABELNO))
2885 /* `FIRST_INSN_ADDRESS'
2886 When the `length' insn attribute is used, this macro specifies the
2887 value to be assigned to the address of the first insn in a
2888 function. If not specified, 0 is used. */
2890 #define ADJUST_INSN_LENGTH(INSN, LENGTH) (LENGTH =\
2891 adjust_insn_length (INSN, LENGTH))
2892 /* If defined, modifies the length assigned to instruction INSN as a
2893 function of the context in which it is used. LENGTH is an lvalue
2894 that contains the initially computed length of the insn and should
2895 be updated with the correct length of the insn. If updating is
2896 required, INSN must not be a varying-length insn.
2898 This macro will normally not be required. A case in which it is
2899 required is the ROMP. On this machine, the size of an `addr_vec'
2900 insn must be increased by two to compensate for the fact that
2901 alignment may be required. */
2903 #define TARGET_MEM_FUNCTIONS
2904 /* Define this macro if GNU CC should generate calls to the System V
2905 (and ANSI C) library functions `memcpy' and `memset' rather than
2906 the BSD functions `bcopy' and `bzero'. */
2909 %{!mmcu=*:-DAVR_AT90S8515} \
2910 %{mmcu=at90s2313:-DAVR_AT90S2313} \
2911 %{mmcu=at90s2323:-DAVR_AT90S2323} \
2912 %{mmcu=at90s2333:-DAVR_AT90S2333} \
2913 %{mmcu=at90s2343:-DAVR_AT90S2343} \
2914 %{mmcu=attiny22:-DAVR_ATtiny22} \
2915 %{mmcu=at90s4433:-DAVR_AT90S4433} \
2916 %{mmcu=at90s4414:-DAVR_AT90S4414} \
2917 %{mmcu=at90s4434:-DAVR_AT90S4434} \
2918 %{mmcu=at90s8515:-DAVR_AT90S8515} \
2919 %{mmcu=at90s8535:-DAVR_AT90S8535} \
2920 %{mmcu=atmega603:-DAVR_ATmega603} \
2921 %{mmcu=atmega103:-DAVR_ATmega103} \
2922 %{mint8:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long -D__INT_MAX__=127} \
2923 %{!mint*:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int -D__INT_MAX__=32767} \
2924 %{posix:-D_POSIX_SOURCE}"
2925 /* A C string constant that tells the GNU CC driver program options to
2926 pass to CPP. It can also specify how to translate options you
2927 give to GNU CC into options for GNU CC to pass to the CPP.
2929 Do not define this macro if it does not need to do anything. */
2931 #define NO_BUILTIN_SIZE_TYPE
2932 /* If this macro is defined, the preprocessor will not define the
2933 builtin macro `__SIZE_TYPE__'. The macro `__SIZE_TYPE__' must
2934 then be defined by `CPP_SPEC' instead.
2936 This should be defined if `SIZE_TYPE' depends on target dependent
2937 flags which are not accessible to the preprocessor. Otherwise, it
2938 should not be defined. */
2940 #define NO_BUILTIN_PTRDIFF_TYPE
2941 /* If this macro is defined, the preprocessor will not define the
2942 builtin macro `__PTRDIFF_TYPE__'. The macro `__PTRDIFF_TYPE__'
2943 must then be defined by `CPP_SPEC' instead.
2945 This should be defined if `PTRDIFF_TYPE' depends on target
2946 dependent flags which are not accessible to the preprocessor.
2947 Otherwise, it should not be defined.
2950 A C string constant that tells the GNU CC driver program options to
2951 pass to CPP. By default, this macro is defined to pass the option
2952 `-D__CHAR_UNSIGNED__' to CPP if `char' will be treated as
2953 `unsigned char' by `cc1'.
2955 Do not define this macro unless you need to override the default
2958 #define CC1_SPEC "%{!mmcu*:-mmcu=at90s8515} %{profile:-p}"
2959 /* A C string constant that tells the GNU CC driver program options to
2960 pass to `cc1'. It can also specify how to translate options you
2961 give to GNU CC into options for GNU CC to pass to the `cc1'.
2963 Do not define this macro if it does not need to do anything. */
2966 /* A C string constant that tells the GNU CC driver program options to
2967 pass to the assembler. It can also specify how to translate
2968 options you give to GNU CC into options for GNU CC to pass to the
2969 assembler. See the file `sun3.h' for an example of this.
2971 Do not define this macro if it does not need to do anything. */
2973 #define ASM_FINAL_SPEC ""
2974 /* A C string constant that tells the GNU CC driver program how to
2975 run any programs which cleanup after the normal assembler.
2976 Normally, this is not needed. See the file `mips.h' for an
2979 Do not define this macro if it does not need to do anything. */
2981 #define LINK_SPEC "\
2982 %{!mmcu*:-m avr85xx} \
2983 %{mmcu=atmega603:-m avrmega603} \
2984 %{mmcu=atmega103:-m avrmega103} \
2985 %{mmcu=at90s2313:-m avr23xx} \
2986 %{mmcu=at90s2323:-m avr23xx} \
2987 %{mmcu=attiny22:-m avr23xx} \
2988 %{mmcu=at90s2333:-m avr23xx} \
2989 %{mmcu=at90s2343:-m avr23xx} \
2990 %{mmcu=at90s4433:-m avr4433} \
2991 %{mmcu=at90s4414:-m avr44x4} \
2992 %{mmcu=at90s4434:-m avr44x4} \
2993 %{mmcu=at90s8535:-m avr85xx} \
2994 %{mmcu=at90s8515:-m avr85xx}"
2996 /* A C string constant that tells the GNU CC driver program options to
2997 pass to the linker. It can also specify how to translate options
2998 you give to GNU CC into options for GNU CC to pass to the linker.
3000 Do not define this macro if it does not need to do anything. */
3003 %{!mmcu*|mmcu=at90s*|mmcu=attiny22: -lc} \
3004 %{mmcu=atmega*: -lc-mega}"
3005 /* Another C string constant used much like `LINK_SPEC'. The
3006 difference between the two is that `LIB_SPEC' is used at the end
3007 of the command given to the linker.
3009 If this macro is not defined, a default is provided that loads the
3010 standard C library from the usual place. See `gcc.c'. */
3012 #define LIBGCC_SPEC "\
3013 %{mmcu=atmega*:-lgcc} \
3014 %{!mmcu*|mmcu=at90s*|mmcu=attiny22:-lgcc}"
3015 /* Another C string constant that tells the GNU CC driver program how
3016 and when to place a reference to `libgcc.a' into the linker
3017 command line. This constant is placed both before and after the
3018 value of `LIB_SPEC'.
3020 If this macro is not defined, the GNU CC driver provides a default
3021 that passes the string `-lgcc' to the linker unless the `-shared'
3022 option is specified. */
3024 #define STARTFILE_SPEC "%(crt_binutils)"
3025 /* Another C string constant used much like `LINK_SPEC'. The
3026 difference between the two is that `STARTFILE_SPEC' is used at the
3027 very beginning of the command given to the linker.
3029 If this macro is not defined, a default is provided that loads the
3030 standard C startup file from the usual place. See `gcc.c'. */
3032 #define ENDFILE_SPEC ""
3033 /* Another C string constant used much like `LINK_SPEC'. The
3034 difference between the two is that `ENDFILE_SPEC' is used at the
3035 very end of the command given to the linker.
3037 Do not define this macro if it does not need to do anything. */
3039 #define CRT_BINUTILS_SPECS "\
3040 %{!mmcu*:gcrt1-8515.o%s} \
3041 %{mmcu=atmega603:gcrt1-mega603.o%s} \
3042 %{mmcu=atmega103:gcrt1-mega103.o%s} \
3043 %{mmcu=at90s2313:gcrt1-2313.o%s} \
3044 %{mmcu=at90s2323:gcrt1-2323.o%s} \
3045 %{mmcu=attiny22:gcrt1-tiny22.o%s} \
3046 %{mmcu=at90s2333:gcrt1-2333.o%s} \
3047 %{mmcu=at90s2343:gcrt1-2343.o%s} \
3048 %{mmcu=at90s4433:gcrt1-4433.o%s} \
3049 %{mmcu=at90s4414:gcrt1-4414.o%s} \
3050 %{mmcu=at90s4434:gcrt1-4434.o%s} \
3051 %{mmcu=at90s8535:gcrt1-8535.o%s} \
3052 %{mmcu=at90s8515:gcrt1-8515.o%s}"
3054 #define EXTRA_SPECS \
3055 {"crt_binutils", CRT_BINUTILS_SPECS},
3056 /* Define this macro to provide additional specifications to put in
3057 the `specs' file that can be used in various specifications like
3060 The definition should be an initializer for an array of structures,
3061 containing a string constant, that defines the specification name,
3062 and a string constant that provides the specification.
3064 Do not define this macro if it does not need to do anything.
3066 `EXTRA_SPECS' is useful when an architecture contains several
3067 related targets, which have various `..._SPECS' which are similar
3068 to each other, and the maintainer would like one central place to
3069 keep these definitions.
3071 For example, the PowerPC System V.4 targets use `EXTRA_SPECS' to
3072 define either `_CALL_SYSV' when the System V calling sequence is
3073 used or `_CALL_AIX' when the older AIX-based calling sequence is
3076 The `config/rs6000/rs6000.h' target file defines:
3078 #define EXTRA_SPECS \
3079 { "cpp_sysv_default", CPP_SYSV_DEFAULT },
3081 #define CPP_SYS_DEFAULT ""
3083 The `config/rs6000/sysv.h' target file defines:
3086 "%{posix: -D_POSIX_SOURCE } \
3087 %{mcall-sysv: -D_CALL_SYSV } %{mcall-aix: -D_CALL_AIX } \
3088 %{!mcall-sysv: %{!mcall-aix: %(cpp_sysv_default) }} \
3089 %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}"
3091 #undef CPP_SYSV_DEFAULT
3092 #define CPP_SYSV_DEFAULT "-D_CALL_SYSV"
3094 while the `config/rs6000/eabiaix.h' target file defines
3095 `CPP_SYSV_DEFAULT' as:
3097 #undef CPP_SYSV_DEFAULT
3098 #define CPP_SYSV_DEFAULT "-D_CALL_AIX" */
3100 /* This is undefined macro for collect2 disabling */
3101 #define LINKER_NAME "ld"
3103 #define TEST_HARD_REG_CLASS(CLASS, REGNO) \
3104 TEST_HARD_REG_BIT (reg_class_contents[ (int) (CLASS)], REGNO)
3106 /* Note that the other files fail to use these
3107 in some of the places where they should. */
3109 #if defined(__STDC__) || defined(ALMOST_STDC)
3110 #define AS2(a,b,c) #a " " #b "," #c
3111 #define AS2C(b,c) " " #b "," #c
3112 #define AS3(a,b,c,d) #a " " #b "," #c "," #d
3113 #define AS1(a,b) #a " " #b
3115 #define AS1(a,b) "a b"
3116 #define AS2(a,b,c) "a b,c"
3117 #define AS2C(b,c) " b,c"
3118 #define AS3(a,b,c,d) "a b,c,d"
3120 #define OUT_AS1(a,b) output_asm_insn (AS1(a,b), operands)
3121 #define OUT_AS2(a,b,c) output_asm_insn (AS2(a,b,c), operands)
3122 #define CR_TAB "\n\t"
3124 /* Define this macro as a C statement that declares additional library
3125 routines renames existing ones. `init_optabs' calls this macro
3126 after initializing all the normal library routines. */
3128 #define INIT_TARGET_OPTABS \
3130 smul_optab->handlers[(int) QImode].libfunc \
3131 = gen_rtx (SYMBOL_REF, Pmode, "_mulqi3"); \
3133 sdiv_optab->handlers[(int) QImode].libfunc \
3134 = gen_rtx (SYMBOL_REF, Pmode, "_divqi3"); \
3136 smod_optab->handlers[(int) QImode].libfunc \
3137 = gen_rtx (SYMBOL_REF, Pmode, "_modqi3"); \
3139 udiv_optab->handlers[(int) QImode].libfunc \
3140 = gen_rtx (SYMBOL_REF, Pmode, "_udivqi3"); \
3142 umod_optab->handlers[(int) QImode].libfunc \
3143 = gen_rtx (SYMBOL_REF, Pmode, "_umodqi3"); \
3145 smul_optab->handlers[(int) HImode].libfunc \
3146 = gen_rtx (SYMBOL_REF, Pmode, "_mulhi3"); \
3148 sdiv_optab->handlers[(int) HImode].libfunc \
3149 = gen_rtx (SYMBOL_REF, Pmode, "_divhi3"); \
3151 smod_optab->handlers[(int) HImode].libfunc \
3152 = gen_rtx (SYMBOL_REF, Pmode, "_modhi3"); \
3154 udiv_optab->handlers[(int) HImode].libfunc \
3155 = gen_rtx (SYMBOL_REF, Pmode, "_udivhi3"); \
3157 umod_optab->handlers[(int) HImode].libfunc \
3158 = gen_rtx (SYMBOL_REF, Pmode, "_umodhi3"); \
3160 smul_optab->handlers[(int) SImode].libfunc \
3161 = gen_rtx (SYMBOL_REF, Pmode, "_mulsi3"); \
3163 sdiv_optab->handlers[(int) SImode].libfunc \
3164 = gen_rtx (SYMBOL_REF, Pmode, "_divsi3"); \
3166 smod_optab->handlers[(int) SImode].libfunc \
3167 = gen_rtx (SYMBOL_REF, Pmode, "_modsi3"); \
3169 udiv_optab->handlers[(int) SImode].libfunc \
3170 = gen_rtx (SYMBOL_REF, Pmode, "_udivsi3"); \
3172 umod_optab->handlers[(int) SImode].libfunc \
3173 = gen_rtx (SYMBOL_REF, Pmode, "_umodsi3"); \
3177 /* Temporary register r0 */
3180 /* zero register r1 */
3181 #define ZERO_REGNO 1
3183 extern struct rtx_def *tmp_reg_rtx;
3184 extern struct rtx_def *zero_reg_rtx;
3186 #define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
3188 /* Define to use software floating point emulator for REAL_ARITHMETIC and
3189 decimal <-> binary conversion. */
3190 #define REAL_ARITHMETIC
3192 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
3194 #define DBX_REGISTER_NUMBER(r) (r)
3196 /* Get the standard ELF stabs definitions. */
3199 #undef ASM_IDENTIFY_GCC
3200 #define ASM_IDENTIFY_GCC(FILE) \
3203 if (write_symbols != DBX_DEBUG) \
3204 fputs ("gcc2_compiled.:\n", FILE); \