* target.h (asm_out.file_start, file_start_app_off,
[official-gcc.git] / gcc / config / avr / avr.h
blob8255e199de82658e9de792d68835ec06a0b65e06
1 /* Definitions of target machine for GNU compiler,
2 for ATMEL AVR at90s8515, ATmega103/103L, ATmega603/603L microcontrollers.
3 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
4 Contributed by Denis Chertykov (denisc@overta.ru)
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 /* Names to predefine in the preprocessor for this target machine. */
25 #define TARGET_CPU_CPP_BUILTINS() \
26 do \
27 { \
28 builtin_define_std ("AVR"); \
29 if (avr_base_arch_macro) \
30 builtin_define (avr_base_arch_macro); \
31 if (avr_extra_arch_macro) \
32 builtin_define (avr_extra_arch_macro); \
33 if (avr_asm_only_p) \
34 builtin_define ("__AVR_ASM_ONLY__"); \
35 if (avr_enhanced_p) \
36 builtin_define ("__AVR_ENHANCED__"); \
37 if (avr_mega_p) \
38 builtin_define ("__AVR_MEGA__"); \
39 if (TARGET_NO_INTERRUPTS) \
40 builtin_define ("__NO_INTERRUPTS__"); \
41 } \
42 while (0)
44 /* This declaration should be present. */
45 extern int target_flags;
47 #define MASK_RTL_DUMP 0x00000010
48 #define MASK_ALL_DEBUG 0x00000FE0
49 #define MASK_ORDER_1 0x00001000
50 #define MASK_INSN_SIZE_DUMP 0x00002000
51 #define MASK_ORDER_2 0x00004000
52 #define MASK_NO_TABLEJUMP 0x00008000
53 #define MASK_INT8 0x00010000
54 #define MASK_NO_INTERRUPTS 0x00020000
55 #define MASK_CALL_PROLOGUES 0x00040000
56 #define MASK_TINY_STACK 0x00080000
57 #define MASK_SHORT_CALLS 0x00100000
59 #define TARGET_ORDER_1 (target_flags & MASK_ORDER_1)
60 #define TARGET_ORDER_2 (target_flags & MASK_ORDER_2)
61 #define TARGET_INT8 (target_flags & MASK_INT8)
62 #define TARGET_NO_INTERRUPTS (target_flags & MASK_NO_INTERRUPTS)
63 #define TARGET_INSN_SIZE_DUMP (target_flags & MASK_INSN_SIZE_DUMP)
64 #define TARGET_CALL_PROLOGUES (target_flags & MASK_CALL_PROLOGUES)
65 #define TARGET_TINY_STACK (target_flags & MASK_TINY_STACK)
66 #define TARGET_NO_TABLEJUMP (target_flags & MASK_NO_TABLEJUMP)
67 #define TARGET_SHORT_CALLS (target_flags & MASK_SHORT_CALLS)
69 /* Dump each assembler insn's rtl into the output file.
70 This is for debugging the compiler itself. */
72 #define TARGET_RTL_DUMP (target_flags & MASK_RTL_DUMP)
73 #define TARGET_ALL_DEBUG (target_flags & MASK_ALL_DEBUG)
75 #define TARGET_SWITCHES { \
76 { "order1", MASK_ORDER_1, NULL }, \
77 { "order2", MASK_ORDER_2, NULL }, \
78 { "int8", MASK_INT8, N_("Assume int to be 8 bit integer") }, \
79 { "no-interrupts", MASK_NO_INTERRUPTS, \
80 N_("Change the stack pointer without disabling interrupts") }, \
81 { "call-prologues", MASK_CALL_PROLOGUES, \
82 N_("Use subroutines for function prologue/epilogue") }, \
83 { "tiny-stack", MASK_TINY_STACK, \
84 N_("Change only the low 8 bits of the stack pointer") }, \
85 { "no-tablejump", MASK_NO_TABLEJUMP, \
86 N_("Do not generate tablejump insns") }, \
87 { "short-calls", MASK_SHORT_CALLS, \
88 N_("Use rjmp/rcall (limited range) on >8K devices") }, \
89 { "rtl", MASK_RTL_DUMP, NULL }, \
90 { "size", MASK_INSN_SIZE_DUMP, \
91 N_("Output instruction sizes to the asm file") }, \
92 { "deb", MASK_ALL_DEBUG, NULL }, \
93 { "", 0, NULL } }
95 extern const char *avr_init_stack;
96 extern const char *avr_mcu_name;
98 extern const char *avr_base_arch_macro;
99 extern const char *avr_extra_arch_macro;
100 extern int avr_mega_p;
101 extern int avr_enhanced_p;
102 extern int avr_asm_only_p;
104 #define AVR_MEGA (avr_mega_p && !TARGET_SHORT_CALLS)
105 #define AVR_ENHANCED (avr_enhanced_p)
107 #define TARGET_OPTIONS { \
108 { "init-stack=", &avr_init_stack, N_("Specify the initial stack address"), 0}, \
109 { "mcu=", &avr_mcu_name, N_("Specify the MCU name"), 0} }
111 #define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)");
112 /* This macro is a C statement to print on `stderr' a string
113 describing the particular machine description choice. Every
114 machine description should define `TARGET_VERSION'. For example:
116 #ifdef MOTOROLA
117 #define TARGET_VERSION \
118 fprintf (stderr, " (68k, Motorola syntax)");
119 #else
120 #define TARGET_VERSION \
121 fprintf (stderr, " (68k, MIT syntax)");
122 #endif */
124 #define OVERRIDE_OPTIONS avr_override_options ()
125 /* `OVERRIDE_OPTIONS'
126 Sometimes certain combinations of command options do not make
127 sense on a particular target machine. You can define a macro
128 `OVERRIDE_OPTIONS' to take account of this. This macro, if
129 defined, is executed once just after all the command options have
130 been parsed.
132 Don't use this macro to turn on various extra optimizations for
133 `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
135 #define CAN_DEBUG_WITHOUT_FP
136 /* Define this macro if debugging can be performed even without a
137 frame pointer. If this macro is defined, GNU CC will turn on the
138 `-fomit-frame-pointer' option whenever `-O' is specified. */
140 /* Define this if most significant byte of a word is the lowest numbered. */
141 #define BITS_BIG_ENDIAN 0
143 /* Define this if most significant byte of a word is the lowest numbered. */
144 #define BYTES_BIG_ENDIAN 0
146 /* Define this if most significant word of a multiword number is the lowest
147 numbered. */
148 #define WORDS_BIG_ENDIAN 0
150 #ifdef IN_LIBGCC2
151 /* This is to get correct SI and DI modes in libgcc2.c (32 and 64 bits). */
152 #define UNITS_PER_WORD 4
153 #else
154 /* Width of a word, in units (bytes). */
155 #define UNITS_PER_WORD 1
156 #endif
158 /* Width in bits of a pointer.
159 See also the macro `Pmode' defined below. */
160 #define POINTER_SIZE 16
163 /* Maximum sized of reasonable data type
164 DImode or Dfmode ... */
165 #define MAX_FIXED_MODE_SIZE 32
167 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
168 #define PARM_BOUNDARY 8
170 /* Allocation boundary (in *bits*) for the code of a function. */
171 #define FUNCTION_BOUNDARY 8
173 /* Alignment of field after `int : 0' in a structure. */
174 #define EMPTY_FIELD_BOUNDARY 8
176 /* No data type wants to be aligned rounder than this. */
177 #define BIGGEST_ALIGNMENT 8
180 /* Define this if move instructions will actually fail to work
181 when given unaligned data. */
182 #define STRICT_ALIGNMENT 0
184 /* A C expression for the size in bits of the type `int' on the
185 target machine. If you don't define this, the default is one word. */
186 #define INT_TYPE_SIZE (TARGET_INT8 ? 8 : 16)
189 /* A C expression for the size in bits of the type `short' on the
190 target machine. If you don't define this, the default is half a
191 word. (If this would be less than one storage unit, it is rounded
192 up to one unit.) */
193 #define SHORT_TYPE_SIZE (INT_TYPE_SIZE == 8 ? INT_TYPE_SIZE : 16)
195 /* A C expression for the size in bits of the type `long' on the
196 target machine. If you don't define this, the default is one word. */
197 #define LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 16 : 32)
199 #define MAX_LONG_TYPE_SIZE 32
200 /* Maximum number for the size in bits of the type `long' on the
201 target machine. If this is undefined, the default is
202 `LONG_TYPE_SIZE'. Otherwise, it is the constant value that is the
203 largest value that `LONG_TYPE_SIZE' can have at run-time. This is
204 used in `cpp'. */
207 #define LONG_LONG_TYPE_SIZE 64
208 /* A C expression for the size in bits of the type `long long' on the
209 target machine. If you don't define this, the default is two
210 words. If you want to support GNU Ada on your machine, the value
211 of macro must be at least 64. */
214 #define FLOAT_TYPE_SIZE 32
215 /* A C expression for the size in bits of the type `float' on the
216 target machine. If you don't define this, the default is one word. */
218 #define DOUBLE_TYPE_SIZE 32
219 /* A C expression for the size in bits of the type `double' on the
220 target machine. If you don't define this, the default is two
221 words. */
224 #define LONG_DOUBLE_TYPE_SIZE 32
225 /* A C expression for the size in bits of the type `long double' on
226 the target machine. If you don't define this, the default is two
227 words. */
229 #define DEFAULT_SIGNED_CHAR 1
230 /* An expression whose value is 1 or 0, according to whether the type
231 `char' should be signed or unsigned by default. The user can
232 always override this default with the options `-fsigned-char' and
233 `-funsigned-char'. */
235 /* `DEFAULT_SHORT_ENUMS'
236 A C expression to determine whether to give an `enum' type only as
237 many bytes as it takes to represent the range of possible values
238 of that type. A nonzero value means to do that; a zero value
239 means all `enum' types should be allocated like `int'.
241 If you don't define the macro, the default is 0. */
243 #define SIZE_TYPE (INT_TYPE_SIZE == 8 ? "long unsigned int" : "unsigned int")
244 /* A C expression for a string describing the name of the data type
245 to use for size values. The typedef name `size_t' is defined
246 using the contents of the string.
248 The string can contain more than one keyword. If so, separate
249 them with spaces, and write first any length keyword, then
250 `unsigned' if appropriate, and finally `int'. The string must
251 exactly match one of the data type names defined in the function
252 `init_decl_processing' in the file `c-decl.c'. You may not omit
253 `int' or change the order--that would cause the compiler to crash
254 on startup.
256 If you don't define this macro, the default is `"long unsigned
257 int"'. */
259 #define PTRDIFF_TYPE (INT_TYPE_SIZE == 8 ? "long int" :"int")
260 /* A C expression for a string describing the name of the data type
261 to use for the result of subtracting two pointers. The typedef
262 name `ptrdiff_t' is defined using the contents of the string. See
263 `SIZE_TYPE' above for more information.
265 If you don't define this macro, the default is `"long int"'. */
268 #define WCHAR_TYPE_SIZE 16
269 /* A C expression for the size in bits of the data type for wide
270 characters. This is used in `cpp', which cannot make use of
271 `WCHAR_TYPE'. */
273 #define FIRST_PSEUDO_REGISTER 36
274 /* Number of hardware registers known to the compiler. They receive
275 numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first
276 pseudo register's number really is assigned the number
277 `FIRST_PSEUDO_REGISTER'. */
279 #define FIXED_REGISTERS {\
280 1,1,/* r0 r1 */\
281 0,0,/* r2 r3 */\
282 0,0,/* r4 r5 */\
283 0,0,/* r6 r7 */\
284 0,0,/* r8 r9 */\
285 0,0,/* r10 r11 */\
286 0,0,/* r12 r13 */\
287 0,0,/* r14 r15 */\
288 0,0,/* r16 r17 */\
289 0,0,/* r18 r19 */\
290 0,0,/* r20 r21 */\
291 0,0,/* r22 r23 */\
292 0,0,/* r24 r25 */\
293 0,0,/* r26 r27 */\
294 0,0,/* r28 r29 */\
295 0,0,/* r30 r31 */\
296 1,1,/* STACK */\
297 1,1 /* arg pointer */ }
298 /* An initializer that says which registers are used for fixed
299 purposes all throughout the compiled code and are therefore not
300 available for general allocation. These would include the stack
301 pointer, the frame pointer (except on machines where that can be
302 used as a general register when no frame pointer is needed), the
303 program counter on machines where that is considered one of the
304 addressable registers, and any other numbered register with a
305 standard use.
307 This information is expressed as a sequence of numbers, separated
308 by commas and surrounded by braces. The Nth number is 1 if
309 register N is fixed, 0 otherwise.
311 The table initialized from this macro, and the table initialized by
312 the following one, may be overridden at run time either
313 automatically, by the actions of the macro
314 `CONDITIONAL_REGISTER_USAGE', or by the user with the command
315 options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. */
317 #define CALL_USED_REGISTERS { \
318 1,1,/* r0 r1 */ \
319 0,0,/* r2 r3 */ \
320 0,0,/* r4 r5 */ \
321 0,0,/* r6 r7 */ \
322 0,0,/* r8 r9 */ \
323 0,0,/* r10 r11 */ \
324 0,0,/* r12 r13 */ \
325 0,0,/* r14 r15 */ \
326 0,0,/* r16 r17 */ \
327 1,1,/* r18 r19 */ \
328 1,1,/* r20 r21 */ \
329 1,1,/* r22 r23 */ \
330 1,1,/* r24 r25 */ \
331 1,1,/* r26 r27 */ \
332 0,0,/* r28 r29 */ \
333 1,1,/* r30 r31 */ \
334 1,1,/* STACK */ \
335 1,1 /* arg pointer */ }
336 /* Like `FIXED_REGISTERS' but has 1 for each register that is
337 clobbered (in general) by function calls as well as for fixed
338 registers. This macro therefore identifies the registers that are
339 not available for general allocation of values that must live
340 across function calls.
342 If a register has 0 in `CALL_USED_REGISTERS', the compiler
343 automatically saves it on function entry and restores it on
344 function exit, if the register is used within the function. */
346 #define NON_SAVING_SETJMP 0
347 /* If this macro is defined and has a nonzero value, it means that
348 `setjmp' and related functions fail to save the registers, or that
349 `longjmp' fails to restore them. To compensate, the compiler
350 avoids putting variables in registers in functions that use
351 `setjmp'. */
353 #define REG_ALLOC_ORDER { \
354 24,25, \
355 18,19, \
356 20,21, \
357 22,23, \
358 30,31, \
359 26,27, \
360 28,29, \
361 17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2, \
362 0,1, \
363 32,33,34,35 \
365 /* If defined, an initializer for a vector of integers, containing the
366 numbers of hard registers in the order in which GNU CC should
367 prefer to use them (from most preferred to least).
369 If this macro is not defined, registers are used lowest numbered
370 first (all else being equal).
372 One use of this macro is on machines where the highest numbered
373 registers must always be saved and the save-multiple-registers
374 instruction supports only sequences of consetionve registers. On
375 such machines, define `REG_ALLOC_ORDER' to be an initializer that
376 lists the highest numbered allocatable register first. */
378 #define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()
379 /* ORDER_REGS_FOR_LOCAL_ALLOC'
380 A C statement (sans semicolon) to choose the order in which to
381 allocate hard registers for pseudo-registers local to a basic
382 block.
384 Store the desired register order in the array `reg_alloc_order'.
385 Element 0 should be the register to allocate first; element 1, the
386 next register; and so on.
388 The macro body should not assume anything about the contents of
389 `reg_alloc_order' before execution of the macro.
391 On most machines, it is not necessary to define this macro. */
394 #define HARD_REGNO_NREGS(REGNO, MODE) ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
396 /* A C expression for the number of consecutive hard registers,
397 starting at register number REGNO, required to hold a value of mode
398 MODE.
400 On a machine where all registers are exactly one word, a suitable
401 definition of this macro is
403 #define HARD_REGNO_NREGS(REGNO, MODE) \
404 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
405 / UNITS_PER_WORD)) */
407 #define HARD_REGNO_MODE_OK(REGNO, MODE) avr_hard_regno_mode_ok(REGNO, MODE)
408 /* A C expression that is nonzero if it is permissible to store a
409 value of mode MODE in hard register number REGNO (or in several
410 registers starting with that one). For a machine where all
411 registers are equivalent, a suitable definition is
413 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
415 It is not necessary for this macro to check for the numbers of
416 fixed registers, because the allocation mechanism considers them
417 to be always occupied.
419 On some machines, double-precision values must be kept in even/odd
420 register pairs. The way to implement that is to define this macro
421 to reject odd register numbers for such modes.
423 The minimum requirement for a mode to be OK in a register is that
424 the `movMODE' instruction pattern support moves between the
425 register and any other hard register for which the mode is OK; and
426 that moving a value into the register and back out not alter it.
428 Since the same instruction used to move `SImode' will work for all
429 narrower integer modes, it is not necessary on any machine for
430 `HARD_REGNO_MODE_OK' to distinguish between these modes, provided
431 you define patterns `movhi', etc., to take advantage of this. This
432 is useful because of the interaction between `HARD_REGNO_MODE_OK'
433 and `MODES_TIEABLE_P'; it is very desirable for all integer modes
434 to be tieable.
436 Many machines have special registers for floating point arithmetic.
437 Often people assume that floating point machine modes are allowed
438 only in floating point registers. This is not true. Any
439 registers that can hold integers can safely *hold* a floating
440 point machine mode, whether or not floating arithmetic can be done
441 on it in those registers. Integer move instructions can be used
442 to move the values.
444 On some machines, though, the converse is true: fixed-point machine
445 modes may not go in floating registers. This is true if the
446 floating registers normalize any value stored in them, because
447 storing a non-floating value there would garble it. In this case,
448 `HARD_REGNO_MODE_OK' should reject fixed-point machine modes in
449 floating registers. But if the floating registers do not
450 automatically normalize, if you can store any bit pattern in one
451 and retrieve it unchanged without a trap, then any machine mode
452 may go in a floating register, so you can define this macro to say
455 The primary significance of special floating registers is rather
456 that they are the registers acceptable in floating point arithmetic
457 instructions. However, this is of no concern to
458 `HARD_REGNO_MODE_OK'. You handle it by writing the proper
459 constraints for those instructions.
461 On some machines, the floating registers are especially slow to
462 access, so that it is better to store a value in a stack frame
463 than in such a register if floating point arithmetic is not being
464 done. As long as the floating registers are not in class
465 `GENERAL_REGS', they will not be used unless some pattern's
466 constraint asks for one. */
468 #define MODES_TIEABLE_P(MODE1, MODE2) 0
469 /* A C expression that is nonzero if it is desirable to choose
470 register allocation so as to avoid move instructions between a
471 value of mode MODE1 and a value of mode MODE2.
473 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
474 MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1,
475 MODE2)' must be zero. */
477 enum reg_class {
478 NO_REGS,
479 R0_REG, /* r0 */
480 POINTER_X_REGS, /* r26 - r27 */
481 POINTER_Y_REGS, /* r28 - r29 */
482 POINTER_Z_REGS, /* r30 - r31 */
483 STACK_REG, /* STACK */
484 BASE_POINTER_REGS, /* r28 - r31 */
485 POINTER_REGS, /* r26 - r31 */
486 ADDW_REGS, /* r24 - r31 */
487 SIMPLE_LD_REGS, /* r16 - r23 */
488 LD_REGS, /* r16 - r31 */
489 NO_LD_REGS, /* r0 - r15 */
490 GENERAL_REGS, /* r0 - r31 */
491 ALL_REGS, LIM_REG_CLASSES
493 /* An enumeral type that must be defined with all the register class
494 names as enumeral values. `NO_REGS' must be first. `ALL_REGS'
495 must be the last register class, followed by one more enumeral
496 value, `LIM_REG_CLASSES', which is not a register class but rather
497 tells how many classes there are.
499 Each register class has a number, which is the value of casting
500 the class name to type `int'. The number serves as an index in
501 many of the tables described below. */
504 #define N_REG_CLASSES (int)LIM_REG_CLASSES
505 /* The number of distinct register classes, defined as follows:
507 #define N_REG_CLASSES (int) LIM_REG_CLASSES */
509 #define REG_CLASS_NAMES { \
510 "NO_REGS", \
511 "R0_REG", /* r0 */ \
512 "POINTER_X_REGS", /* r26 - r27 */ \
513 "POINTER_Y_REGS", /* r28 - r29 */ \
514 "POINTER_Z_REGS", /* r30 - r31 */ \
515 "STACK_REG", /* STACK */ \
516 "BASE_POINTER_REGS", /* r28 - r31 */ \
517 "POINTER_REGS", /* r26 - r31 */ \
518 "ADDW_REGS", /* r24 - r31 */ \
519 "SIMPLE_LD_REGS", /* r16 - r23 */ \
520 "LD_REGS", /* r16 - r31 */ \
521 "NO_LD_REGS", /* r0 - r15 */ \
522 "GENERAL_REGS", /* r0 - r31 */ \
523 "ALL_REGS" }
524 /* An initializer containing the names of the register classes as C
525 string constants. These names are used in writing some of the
526 debugging dumps. */
528 #define REG_X 26
529 #define REG_Y 28
530 #define REG_Z 30
531 #define REG_W 24
533 #define REG_CLASS_CONTENTS { \
534 {0x00000000,0x00000000}, /* NO_REGS */ \
535 {0x00000001,0x00000000}, /* R0_REG */ \
536 {3 << REG_X,0x00000000}, /* POINTER_X_REGS, r26 - r27 */ \
537 {3 << REG_Y,0x00000000}, /* POINTER_Y_REGS, r28 - r29 */ \
538 {3 << REG_Z,0x00000000}, /* POINTER_Z_REGS, r30 - r31 */ \
539 {0x00000000,0x00000003}, /* STACK_REG, STACK */ \
540 {(3 << REG_Y) | (3 << REG_Z), \
541 0x00000000}, /* BASE_POINTER_REGS, r28 - r31 */ \
542 {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z), \
543 0x00000000}, /* POINTER_REGS, r26 - r31 */ \
544 {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W), \
545 0x00000000}, /* ADDW_REGS, r24 - r31 */ \
546 {0x00ff0000,0x00000000}, /* SIMPLE_LD_REGS r16 - r23 */ \
547 {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16), \
548 0x00000000}, /* LD_REGS, r16 - r31 */ \
549 {0x0000ffff,0x00000000}, /* NO_LD_REGS r0 - r15 */ \
550 {0xffffffff,0x00000000}, /* GENERAL_REGS, r0 - r31 */ \
551 {0xffffffff,0x00000003} /* ALL_REGS */ \
553 /* An initializer containing the contents of the register classes, as
554 integers which are bit masks. The Nth integer specifies the
555 contents of class N. The way the integer MASK is interpreted is
556 that register R is in the class if `MASK & (1 << R)' is 1.
558 When the machine has more than 32 registers, an integer does not
559 suffice. Then the integers are replaced by sub-initializers,
560 braced groupings containing several integers. Each
561 sub-initializer must be suitable as an initializer for the type
562 `HARD_REG_SET' which is defined in `hard-reg-set.h'. */
564 #define REGNO_REG_CLASS(R) avr_regno_reg_class(R)
565 /* A C expression whose value is a register class containing hard
566 register REGNO. In general there is more than one such class;
567 choose a class which is "minimal", meaning that no smaller class
568 also contains the register. */
570 #define BASE_REG_CLASS POINTER_REGS
571 /* A macro whose definition is the name of the class to which a valid
572 base register must belong. A base register is one used in an
573 address which is the register value plus a displacement. */
575 #define INDEX_REG_CLASS NO_REGS
576 /* A macro whose definition is the name of the class to which a valid
577 index register must belong. An index register is one used in an
578 address where its value is either multiplied by a scale factor or
579 added to another register (as well as added to a displacement). */
581 #define REG_CLASS_FROM_LETTER(C) avr_reg_class_from_letter(C)
582 /* A C expression which defines the machine-dependent operand
583 constraint letters for register classes. If CHAR is such a
584 letter, the value should be the register class corresponding to
585 it. Otherwise, the value should be `NO_REGS'. The register
586 letter `r', corresponding to class `GENERAL_REGS', will not be
587 passed to this macro; you do not need to handle it. */
589 #define REGNO_OK_FOR_BASE_P(r) (((r) < FIRST_PSEUDO_REGISTER \
590 && ((r) == REG_X \
591 || (r) == REG_Y \
592 || (r) == REG_Z \
593 || (r) == ARG_POINTER_REGNUM)) \
594 || (reg_renumber \
595 && (reg_renumber[r] == REG_X \
596 || reg_renumber[r] == REG_Y \
597 || reg_renumber[r] == REG_Z \
598 || (reg_renumber[r] \
599 == ARG_POINTER_REGNUM))))
600 /* A C expression which is nonzero if register number NUM is suitable
601 for use as a base register in operand addresses. It may be either
602 a suitable hard register or a pseudo register that has been
603 allocated such a hard register. */
605 /* #define REGNO_MODE_OK_FOR_BASE_P(r, m) regno_mode_ok_for_base_p(r, m)
606 A C expression that is just like `REGNO_OK_FOR_BASE_P', except that
607 that expression may examine the mode of the memory reference in
608 MODE. You should define this macro if the mode of the memory
609 reference affects whether a register may be used as a base
610 register. If you define this macro, the compiler will use it
611 instead of `REGNO_OK_FOR_BASE_P'. */
613 #define REGNO_OK_FOR_INDEX_P(NUM) 0
614 /* A C expression which is nonzero if register number NUM is suitable
615 for use as an index register in operand addresses. It may be
616 either a suitable hard register or a pseudo register that has been
617 allocated such a hard register.
619 The difference between an index register and a base register is
620 that the index register may be scaled. If an address involves the
621 sum of two registers, neither one of them scaled, then either one
622 may be labeled the "base" and the other the "index"; but whichever
623 labeling is used must fit the machine's constraints of which
624 registers may serve in each capacity. The compiler will try both
625 labelings, looking for one that is valid, and will reload one or
626 both registers only if neither labeling works. */
628 #define PREFERRED_RELOAD_CLASS(X, CLASS) preferred_reload_class(X,CLASS)
629 /* A C expression that places additional restrictions on the register
630 class to use when it is necessary to copy value X into a register
631 in class CLASS. The value is a register class; perhaps CLASS, or
632 perhaps another, smaller class. On many machines, the following
633 definition is safe:
635 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
637 Sometimes returning a more restrictive class makes better code.
638 For example, on the 68000, when X is an integer constant that is
639 in range for a `moveq' instruction, the value of this macro is
640 always `DATA_REGS' as long as CLASS includes the data registers.
641 Requiring a data register guarantees that a `moveq' will be used.
643 If X is a `const_double', by returning `NO_REGS' you can force X
644 into a memory constant. This is useful on certain machines where
645 immediate floating values cannot be loaded into certain kinds of
646 registers. */
647 /* `PREFERRED_OUTPUT_RELOAD_CLASS (X, CLASS)'
648 Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of
649 input reloads. If you don't define this macro, the default is to
650 use CLASS, unchanged. */
652 /* `LIMIT_RELOAD_CLASS (MODE, CLASS)'
653 A C expression that places additional restrictions on the register
654 class to use when it is necessary to be able to hold a value of
655 mode MODE in a reload register for which class CLASS would
656 ordinarily be used.
658 Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when
659 there are certain modes that simply can't go in certain reload
660 classes.
662 The value is a register class; perhaps CLASS, or perhaps another,
663 smaller class.
665 Don't define this macro unless the target machine has limitations
666 which require the macro to do something nontrivial. */
668 /* SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X)
669 `SECONDARY_RELOAD_CLASS (CLASS, MODE, X)'
670 `SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)'
671 Many machines have some registers that cannot be copied directly
672 to or from memory or even from other types of registers. An
673 example is the `MQ' register, which on most machines, can only be
674 copied to or from general registers, but not memory. Some
675 machines allow copying all registers to and from memory, but
676 require a scratch register for stores to some memory locations
677 (e.g., those with symbolic address on the RT, and those with
678 certain symbolic address on the SPARC when compiling PIC). In
679 some cases, both an intermediate and a scratch register are
680 required.
682 You should define these macros to indicate to the reload phase
683 that it may need to allocate at least one register for a reload in
684 addition to the register to contain the data. Specifically, if
685 copying X to a register CLASS in MODE requires an intermediate
686 register, you should define `SECONDARY_INPUT_RELOAD_CLASS' to
687 return the largest register class all of whose registers can be
688 used as intermediate registers or scratch registers.
690 If copying a register CLASS in MODE to X requires an intermediate
691 or scratch register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be
692 defined to return the largest register class required. If the
693 requirements for input and output reloads are the same, the macro
694 `SECONDARY_RELOAD_CLASS' should be used instead of defining both
695 macros identically.
697 The values returned by these macros are often `GENERAL_REGS'.
698 Return `NO_REGS' if no spare register is needed; i.e., if X can be
699 directly copied to or from a register of CLASS in MODE without
700 requiring a scratch register. Do not define this macro if it
701 would always return `NO_REGS'.
703 If a scratch register is required (either with or without an
704 intermediate register), you should define patterns for
705 `reload_inM' or `reload_outM', as required (*note Standard
706 Names::.. These patterns, which will normally be implemented with
707 a `define_expand', should be similar to the `movM' patterns,
708 except that operand 2 is the scratch register.
710 Define constraints for the reload register and scratch register
711 that contain a single register class. If the original reload
712 register (whose class is CLASS) can meet the constraint given in
713 the pattern, the value returned by these macros is used for the
714 class of the scratch register. Otherwise, two additional reload
715 registers are required. Their classes are obtained from the
716 constraints in the insn pattern.
718 X might be a pseudo-register or a `subreg' of a pseudo-register,
719 which could either be in a hard register or in memory. Use
720 `true_regnum' to find out; it will return -1 if the pseudo is in
721 memory and the hard register number if it is in a register.
723 These macros should not be used in the case where a particular
724 class of registers can only be copied to memory and not to another
725 class of registers. In that case, secondary reload registers are
726 not needed and would not be helpful. Instead, a stack location
727 must be used to perform the copy and the `movM' pattern should use
728 memory as an intermediate storage. This case often occurs between
729 floating-point and general registers. */
731 /* `SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)'
732 Certain machines have the property that some registers cannot be
733 copied to some other registers without using memory. Define this
734 macro on those machines to be a C expression that is nonzero if
735 objects of mode M in registers of CLASS1 can only be copied to
736 registers of class CLASS2 by storing a register of CLASS1 into
737 memory and loading that memory location into a register of CLASS2.
739 Do not define this macro if its value would always be zero.
741 `SECONDARY_MEMORY_NEEDED_RTX (MODE)'
742 Normally when `SECONDARY_MEMORY_NEEDED' is defined, the compiler
743 allocates a stack slot for a memory location needed for register
744 copies. If this macro is defined, the compiler instead uses the
745 memory location defined by this macro.
747 Do not define this macro if you do not define
748 `SECONDARY_MEMORY_NEEDED'. */
750 #define SMALL_REGISTER_CLASSES 1
751 /* Normally the compiler avoids choosing registers that have been
752 explicitly mentioned in the rtl as spill registers (these
753 registers are normally those used to pass parameters and return
754 values). However, some machines have so few registers of certain
755 classes that there would not be enough registers to use as spill
756 registers if this were done.
758 Define `SMALL_REGISTER_CLASSES' to be an expression with a nonzero
759 value on these machines. When this macro has a nonzero value, the
760 compiler allows registers explicitly used in the rtl to be used as
761 spill registers but avoids extending the lifetime of these
762 registers.
764 It is always safe to define this macro with a nonzero value, but
765 if you unnecessarily define it, you will reduce the amount of
766 optimizations that can be performed in some cases. If you do not
767 define this macro with a nonzero value when it is required, the
768 compiler will run out of spill registers and print a fatal error
769 message. For most machines, you should not define this macro at
770 all. */
772 #define CLASS_LIKELY_SPILLED_P(c) class_likely_spilled_p(c)
773 /* A C expression whose value is nonzero if pseudos that have been
774 assigned to registers of class CLASS would likely be spilled
775 because registers of CLASS are needed for spill registers.
777 The default value of this macro returns 1 if CLASS has exactly one
778 register and zero otherwise. On most machines, this default
779 should be used. Only define this macro to some other expression
780 if pseudo allocated by `local-alloc.c' end up in memory because
781 their hard registers were needed for spill registers. If this
782 macro returns nonzero for those classes, those pseudos will only
783 be allocated by `global.c', which knows how to reallocate the
784 pseudo to another register. If there would not be another
785 register available for reallocation, you should not change the
786 definition of this macro since the only effect of such a
787 definition would be to slow down register allocation. */
789 #define CLASS_MAX_NREGS(CLASS, MODE) class_max_nregs (CLASS, MODE)
790 /* A C expression for the maximum number of consecutive registers of
791 class CLASS needed to hold a value of mode MODE.
793 This is closely related to the macro `HARD_REGNO_NREGS'. In fact,
794 the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be
795 the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all
796 REGNO values in the class CLASS.
798 This macro helps control the handling of multiple-word values in
799 the reload pass. */
801 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
802 ((C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 63 : \
803 (C) == 'J' ? (VALUE) <= 0 && (VALUE) >= -63: \
804 (C) == 'K' ? (VALUE) == 2 : \
805 (C) == 'L' ? (VALUE) == 0 : \
806 (C) == 'M' ? (VALUE) >= 0 && (VALUE) <= 0xff : \
807 (C) == 'N' ? (VALUE) == -1: \
808 (C) == 'O' ? (VALUE) == 8 || (VALUE) == 16 || (VALUE) == 24: \
809 (C) == 'P' ? (VALUE) == 1 : \
812 /* A C expression that defines the machine-dependent operand
813 constraint letters (`I', `J', `K', ... `P') that specify
814 particular ranges of integer values. If C is one of those
815 letters, the expression should check that VALUE, an integer, is in
816 the appropriate range and return 1 if so, 0 otherwise. If C is
817 not one of those letters, the value should be 0 regardless of
818 VALUE. */
820 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
821 ((C) == 'G' ? (VALUE) == CONST0_RTX (SFmode) \
822 : 0)
823 /* `CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)'
824 A C expression that defines the machine-dependent operand
825 constraint letters that specify particular ranges of
826 `const_double' values (`G' or `H').
828 If C is one of those letters, the expression should check that
829 VALUE, an RTX of code `const_double', is in the appropriate range
830 and return 1 if so, 0 otherwise. If C is not one of those
831 letters, the value should be 0 regardless of VALUE.
833 `const_double' is used for all floating-point constants and for
834 `DImode' fixed-point constants. A given letter can accept either
835 or both kinds of values. It can use `GET_MODE' to distinguish
836 between these kinds. */
838 #define EXTRA_CONSTRAINT(x, c) extra_constraint(x, c)
839 /* A C expression that defines the optional machine-dependent
840 constraint letters (``Q', `R', `S', `T', `U') that can'
841 be used to segregate specific types of operands, usually memory
842 references, for the target machine. Normally this macro will not
843 be defined. If it is required for a particular target machine, it
844 should return 1 if VALUE corresponds to the operand type
845 represented by the constraint letter C. If C is not defined as an
846 extra constraint, the value returned should be 0 regardless of
847 VALUE.
849 For example, on the ROMP, load instructions cannot have their
850 output in r0 if the memory reference contains a symbolic address.
851 Constraint letter `Q' is defined as representing a memory address
852 that does *not* contain a symbolic address. An alternative is
853 specified with a `Q' constraint on the input and `r' on the
854 output. The next alternative specifies `m' on the input and a
855 register class that does not include r0 on the output. */
857 /* This is an undocumented variable which describes
858 how GCC will push a data */
859 #define STACK_PUSH_CODE POST_DEC
861 #define STACK_GROWS_DOWNWARD
862 /* Define this macro if pushing a word onto the stack moves the stack
863 pointer to a smaller address.
865 When we say, "define this macro if ...," it means that the
866 compiler checks this macro only with `#ifdef' so the precise
867 definition used does not matter. */
869 #define STARTING_FRAME_OFFSET 1
870 /* Offset from the frame pointer to the first local variable slot to
871 be allocated.
873 If `FRAME_GROWS_DOWNWARD', find the next slot's offset by
874 subtracting the first slot's length from `STARTING_FRAME_OFFSET'.
875 Otherwise, it is found by adding the length of the first slot to
876 the value `STARTING_FRAME_OFFSET'. */
878 #define STACK_POINTER_OFFSET 1
879 /* Offset from the stack pointer register to the first location at
880 which outgoing arguments are placed. If not specified, the
881 default value of zero is used. This is the proper value for most
882 machines.
884 If `ARGS_GROW_DOWNWARD', this is the offset to the location above
885 the first location at which outgoing arguments are placed. */
887 #define FIRST_PARM_OFFSET(FUNDECL) 0
888 /* Offset from the argument pointer register to the first argument's
889 address. On some machines it may depend on the data type of the
890 function.
892 If `ARGS_GROW_DOWNWARD', this is the offset to the location above
893 the first argument's address. */
895 /* `STACK_DYNAMIC_OFFSET (FUNDECL)'
896 Offset from the stack pointer register to an item dynamically
897 allocated on the stack, e.g., by `alloca'.
899 The default value for this macro is `STACK_POINTER_OFFSET' plus the
900 length of the outgoing arguments. The default is correct for most
901 machines. See `function.c' for details. */
903 #define STACK_BOUNDARY 8
904 /* Define this macro if there is a guaranteed alignment for the stack
905 pointer on this machine. The definition is a C expression for the
906 desired alignment (measured in bits). This value is used as a
907 default if PREFERRED_STACK_BOUNDARY is not defined. */
909 #define STACK_POINTER_REGNUM 32
910 /* The register number of the stack pointer register, which must also
911 be a fixed register according to `FIXED_REGISTERS'. On most
912 machines, the hardware determines which register this is. */
914 #define FRAME_POINTER_REGNUM REG_Y
915 /* The register number of the frame pointer register, which is used to
916 access automatic variables in the stack frame. On some machines,
917 the hardware determines which register this is. On other
918 machines, you can choose any register you wish for this purpose. */
920 #define ARG_POINTER_REGNUM 34
921 /* The register number of the arg pointer register, which is used to
922 access the function's argument list. On some machines, this is
923 the same as the frame pointer register. On some machines, the
924 hardware determines which register this is. On other machines,
925 you can choose any register you wish for this purpose. If this is
926 not the same register as the frame pointer register, then you must
927 mark it as a fixed register according to `FIXED_REGISTERS', or
928 arrange to be able to eliminate it (*note Elimination::.). */
930 #define STATIC_CHAIN_REGNUM 2
931 /* Register numbers used for passing a function's static chain
932 pointer. If register windows are used, the register number as
933 seen by the called function is `STATIC_CHAIN_INCOMING_REGNUM',
934 while the register number as seen by the calling function is
935 `STATIC_CHAIN_REGNUM'. If these registers are the same,
936 `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
938 The static chain register need not be a fixed register.
940 If the static chain is passed in memory, these macros should not be
941 defined; instead, the next two macros should be defined. */
943 #define FRAME_POINTER_REQUIRED frame_pointer_required_p()
944 /* A C expression which is nonzero if a function must have and use a
945 frame pointer. This expression is evaluated in the reload pass.
946 If its value is nonzero the function will have a frame pointer.
948 The expression can in principle examine the current function and
949 decide according to the facts, but on most machines the constant 0
950 or the constant 1 suffices. Use 0 when the machine allows code to
951 be generated with no frame pointer, and doing so saves some time
952 or space. Use 1 when there is no possible advantage to avoiding a
953 frame pointer.
955 In certain cases, the compiler does not know how to produce valid
956 code without a frame pointer. The compiler recognizes those cases
957 and automatically gives the function a frame pointer regardless of
958 what `FRAME_POINTER_REQUIRED' says. You don't need to worry about
959 them.
961 In a function that does not require a frame pointer, the frame
962 pointer register can be allocated for ordinary usage, unless you
963 mark it as a fixed register. See `FIXED_REGISTERS' for more
964 information. */
966 #define ELIMINABLE_REGS { \
967 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
968 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \
969 ,{FRAME_POINTER_REGNUM+1,STACK_POINTER_REGNUM+1}}
970 /* If defined, this macro specifies a table of register pairs used to
971 eliminate unneeded registers that point into the stack frame. If
972 it is not defined, the only elimination attempted by the compiler
973 is to replace references to the frame pointer with references to
974 the stack pointer.
976 The definition of this macro is a list of structure
977 initializations, each of which specifies an original and
978 replacement register.
980 On some machines, the position of the argument pointer is not
981 known until the compilation is completed. In such a case, a
982 separate hard register must be used for the argument pointer.
983 This register can be eliminated by replacing it with either the
984 frame pointer or the argument pointer, depending on whether or not
985 the frame pointer has been eliminated.
987 In this case, you might specify:
988 #define ELIMINABLE_REGS \
989 {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
990 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
991 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
993 Note that the elimination of the argument pointer with the stack
994 pointer is specified first since that is the preferred elimination. */
996 #define CAN_ELIMINATE(FROM, TO) (((FROM) == ARG_POINTER_REGNUM \
997 && (TO) == FRAME_POINTER_REGNUM) \
998 || (((FROM) == FRAME_POINTER_REGNUM \
999 || (FROM) == FRAME_POINTER_REGNUM+1) \
1000 && ! FRAME_POINTER_REQUIRED \
1002 /* A C expression that returns nonzero if the compiler is allowed to
1003 try to replace register number FROM-REG with register number
1004 TO-REG. This macro need only be defined if `ELIMINABLE_REGS' is
1005 defined, and will usually be the constant 1, since most of the
1006 cases preventing register elimination are things that the compiler
1007 already knows about. */
1009 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1010 OFFSET = initial_elimination_offset (FROM, TO)
1011 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
1012 specifies the initial difference between the specified pair of
1013 registers. This macro must be defined if `ELIMINABLE_REGS' is
1014 defined. */
1016 #define RETURN_ADDR_RTX(count, x) \
1017 gen_rtx_MEM (Pmode, memory_address (Pmode, plus_constant (tem, 1)))
1019 #define PUSH_ROUNDING(NPUSHED) (NPUSHED)
1020 /* A C expression that is the number of bytes actually pushed onto the
1021 stack when an instruction attempts to push NPUSHED bytes.
1023 If the target machine does not have a push instruction, do not
1024 define this macro. That directs GNU CC to use an alternate
1025 strategy: to allocate the entire argument block and then store the
1026 arguments into it.
1028 On some machines, the definition
1030 #define PUSH_ROUNDING(BYTES) (BYTES)
1032 will suffice. But on other machines, instructions that appear to
1033 push one byte actually push two bytes in an attempt to maintain
1034 alignment. Then the definition should be
1036 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1) */
1038 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
1039 /* A C expression that should indicate the number of bytes of its own
1040 arguments that a function pops on returning, or 0 if the function
1041 pops no arguments and the caller must therefore pop them all after
1042 the function returns.
1044 FUNDECL is a C variable whose value is a tree node that describes
1045 the function in question. Normally it is a node of type
1046 `FUNCTION_DECL' that describes the declaration of the function.
1047 From this you can obtain the DECL_ATTRIBUTES of the
1048 function.
1050 FUNTYPE is a C variable whose value is a tree node that describes
1051 the function in question. Normally it is a node of type
1052 `FUNCTION_TYPE' that describes the data type of the function.
1053 From this it is possible to obtain the data types of the value and
1054 arguments (if known).
1056 When a call to a library function is being considered, FUNDECL
1057 will contain an identifier node for the library function. Thus, if
1058 you need to distinguish among various library functions, you can
1059 do so by their names. Note that "library function" in this
1060 context means a function used to perform arithmetic, whose name is
1061 known specially in the compiler and was not mentioned in the C
1062 code being compiled.
1064 STACK-SIZE is the number of bytes of arguments passed on the
1065 stack. If a variable number of bytes is passed, it is zero, and
1066 argument popping will always be the responsibility of the calling
1067 function.
1069 On the VAX, all functions always pop their arguments, so the
1070 definition of this macro is STACK-SIZE. On the 68000, using the
1071 standard calling convention, no functions pop their arguments, so
1072 the value of the macro is always 0 in this case. But an
1073 alternative calling convention is available in which functions
1074 that take a fixed number of arguments pop them but other functions
1075 (such as `printf') pop nothing (the caller pops all). When this
1076 convention is in use, FUNTYPE is examined to determine whether a
1077 function takes a fixed number of arguments. */
1079 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) (function_arg (&(CUM), MODE, TYPE, NAMED))
1080 /* A C expression that controls whether a function argument is passed
1081 in a register, and which register.
1083 The arguments are CUM, which summarizes all the previous
1084 arguments; MODE, the machine mode of the argument; TYPE, the data
1085 type of the argument as a tree node or 0 if that is not known
1086 (which happens for C support library functions); and NAMED, which
1087 is 1 for an ordinary argument and 0 for nameless arguments that
1088 correspond to `...' in the called function's prototype.
1090 The value of the expression is usually either a `reg' RTX for the
1091 hard register in which to pass the argument, or zero to pass the
1092 argument on the stack.
1094 For machines like the VAX and 68000, where normally all arguments
1095 are pushed, zero suffices as a definition.
1097 The value of the expression can also be a `parallel' RTX. This is
1098 used when an argument is passed in multiple locations. The mode
1099 of the of the `parallel' should be the mode of the entire
1100 argument. The `parallel' holds any number of `expr_list' pairs;
1101 each one describes where part of the argument is passed. In each
1102 `expr_list', the first operand can be either a `reg' RTX for the
1103 hard register in which to pass this part of the argument, or zero
1104 to pass the argument on the stack. If this operand is a `reg',
1105 then the mode indicates how large this part of the argument is.
1106 The second operand of the `expr_list' is a `const_int' which gives
1107 the offset in bytes into the entire argument where this part
1108 starts.
1110 The usual way to make the ANSI library `stdarg.h' work on a machine
1111 where some arguments are usually passed in registers, is to cause
1112 nameless arguments to be passed on the stack instead. This is done
1113 by making `FUNCTION_ARG' return 0 whenever NAMED is 0.
1115 You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the
1116 definition of this macro to determine if this argument is of a
1117 type that must be passed in the stack. If `REG_PARM_STACK_SPACE'
1118 is not defined and `FUNCTION_ARG' returns nonzero for such an
1119 argument, the compiler will abort. If `REG_PARM_STACK_SPACE' is
1120 defined, the argument will be computed in the stack and then
1121 loaded into a register. */
1123 typedef struct avr_args {
1124 int nregs; /* # registers available for passing */
1125 int regno; /* next available register number */
1126 } CUMULATIVE_ARGS;
1127 /* A C type for declaring a variable that is used as the first
1128 argument of `FUNCTION_ARG' and other related values. For some
1129 target machines, the type `int' suffices and can hold the number
1130 of bytes of argument so far.
1132 There is no need to record in `CUMULATIVE_ARGS' anything about the
1133 arguments that have been passed on the stack. The compiler has
1134 other variables to keep track of that. For target machines on
1135 which all arguments are passed on the stack, there is no need to
1136 store anything in `CUMULATIVE_ARGS'; however, the data structure
1137 must exist and should not be empty, so use `int'. */
1139 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL) init_cumulative_args (&(CUM), FNTYPE, LIBNAME, FNDECL)
1141 /* A C statement (sans semicolon) for initializing the variable CUM
1142 for the state at the beginning of the argument list. The variable
1143 has type `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node
1144 for the data type of the function which will receive the args, or 0
1145 if the args are to a compiler support library function. The value
1146 of INDIRECT is nonzero when processing an indirect call, for
1147 example a call through a function pointer. The value of INDIRECT
1148 is zero for a call to an explicitly named function, a library
1149 function call, or when `INIT_CUMULATIVE_ARGS' is used to find
1150 arguments for the function being compiled.
1152 When processing a call to a compiler support library function,
1153 LIBNAME identifies which one. It is a `symbol_ref' rtx which
1154 contains the name of the function, as a string. LIBNAME is 0 when
1155 an ordinary C function call is being processed. Thus, each time
1156 this macro is called, either LIBNAME or FNTYPE is nonzero, but
1157 never both of them at once. */
1159 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
1160 (function_arg_advance (&CUM, MODE, TYPE, NAMED))
1162 /* A C statement (sans semicolon) to update the summarizer variable
1163 CUM to advance past an argument in the argument list. The values
1164 MODE, TYPE and NAMED describe that argument. Once this is done,
1165 the variable CUM is suitable for analyzing the *following*
1166 argument with `FUNCTION_ARG', etc.
1168 This macro need not do anything if the argument in question was
1169 passed on the stack. The compiler knows how to track the amount
1170 of stack space used for arguments without any special help. */
1172 #define FUNCTION_ARG_REGNO_P(r) function_arg_regno_p(r)
1173 /* A C expression that is nonzero if REGNO is the number of a hard
1174 register in which function arguments are sometimes passed. This
1175 does *not* include implicit arguments such as the static chain and
1176 the structure-value address. On many machines, no registers can be
1177 used for this purpose since all function arguments are pushed on
1178 the stack. */
1180 extern int avr_reg_order[];
1182 #define RET_REGISTER avr_ret_register ()
1184 #define FUNCTION_VALUE(VALTYPE, FUNC) avr_function_value (VALTYPE, FUNC)
1185 /* A C expression to create an RTX representing the place where a
1186 function returns a value of data type VALTYPE. VALTYPE is a tree
1187 node representing a data type. Write `TYPE_MODE (VALTYPE)' to get
1188 the machine mode used to represent that type. On many machines,
1189 only the mode is relevant. (Actually, on most machines, scalar
1190 values are returned in the same place regardless of mode).
1192 The value of the expression is usually a `reg' RTX for the hard
1193 register where the return value is stored. The value can also be a
1194 `parallel' RTX, if the return value is in multiple places. See
1195 `FUNCTION_ARG' for an explanation of the `parallel' form.
1197 If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same
1198 promotion rules specified in `PROMOTE_MODE' if VALTYPE is a scalar
1199 type.
1201 If the precise function being called is known, FUNC is a tree node
1202 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
1203 makes it possible to use a different value-returning convention
1204 for specific functions when all their calls are known.
1206 `FUNCTION_VALUE' is not used for return vales with aggregate data
1207 types, because these are returned in another way. See
1208 `STRUCT_VALUE_REGNUM' and related macros, below. */
1210 #define LIBCALL_VALUE(MODE) avr_libcall_value (MODE)
1211 /* A C expression to create an RTX representing the place where a
1212 library function returns a value of mode MODE. If the precise
1213 function being called is known, FUNC is a tree node
1214 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
1215 makes it possible to use a different value-returning convention
1216 for specific functions when all their calls are known.
1218 Note that "library function" in this context means a compiler
1219 support routine, used to perform arithmetic, whose name is known
1220 specially by the compiler and was not mentioned in the C code being
1221 compiled.
1223 The definition of `LIBRARY_VALUE' need not be concerned aggregate
1224 data types, because none of the library functions returns such
1225 types. */
1227 #define FUNCTION_VALUE_REGNO_P(N) ((int) (N) == RET_REGISTER)
1228 /* A C expression that is nonzero if REGNO is the number of a hard
1229 register in which the values of called function may come back.
1231 A register whose use for returning values is limited to serving as
1232 the second of a pair (for a value of type `double', say) need not
1233 be recognized by this macro. So for most machines, this definition
1234 suffices:
1236 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
1238 If the machine has register windows, so that the caller and the
1239 called function use different registers for the return value, this
1240 macro should recognize only the caller's register numbers. */
1242 #define RETURN_IN_MEMORY(TYPE) ((TYPE_MODE (TYPE) == BLKmode) \
1243 ? int_size_in_bytes (TYPE) > 8 \
1244 : 0)
1245 /* A C expression which can inhibit the returning of certain function
1246 values in registers, based on the type of value. A nonzero value
1247 says to return the function value in memory, just as large
1248 structures are always returned. Here TYPE will be a C expression
1249 of type `tree', representing the data type of the value.
1251 Note that values of mode `BLKmode' must be explicitly handled by
1252 this macro. Also, the option `-fpcc-struct-return' takes effect
1253 regardless of this macro. On most systems, it is possible to
1254 leave the macro undefined; this causes a default definition to be
1255 used, whose value is the constant 1 for `BLKmode' values, and 0
1256 otherwise.
1258 Do not use this macro to indicate that structures and unions
1259 should always be returned in memory. You should instead use
1260 `DEFAULT_PCC_STRUCT_RETURN' to indicate this. */
1262 #define DEFAULT_PCC_STRUCT_RETURN 0
1263 /* Define this macro to be 1 if all structure and union return values
1264 must be in memory. Since this results in slower code, this should
1265 be defined only if needed for compatibility with other compilers
1266 or with an ABI. If you define this macro to be 0, then the
1267 conventions used for structure and union return values are decided
1268 by the `RETURN_IN_MEMORY' macro.
1270 If not defined, this defaults to the value 1. */
1272 #define STRUCT_VALUE 0
1273 /* If the structure value address is not passed in a register, define
1274 `STRUCT_VALUE' as an expression returning an RTX for the place
1275 where the address is passed. If it returns 0, the address is
1276 passed as an "invisible" first argument. */
1278 #define STRUCT_VALUE_INCOMING 0
1279 /* If the incoming location is not a register, then you should define
1280 `STRUCT_VALUE_INCOMING' as an expression for an RTX for where the
1281 called function should find the value. If it should find the
1282 value on the stack, define this to create a `mem' which refers to
1283 the frame pointer. A definition of 0 means that the address is
1284 passed as an "invisible" first argument. */
1286 #define EPILOGUE_USES(REGNO) 0
1287 /* Define this macro as a C expression that is nonzero for registers
1288 are used by the epilogue or the `return' pattern. The stack and
1289 frame pointer registers are already be assumed to be used as
1290 needed. */
1292 #define STRICT_ARGUMENT_NAMING 1
1293 /* Define this macro if the location where a function argument is
1294 passed depends on whether or not it is a named argument.
1296 This macro controls how the NAMED argument to `FUNCTION_ARG' is
1297 set for varargs and stdarg functions. With this macro defined,
1298 the NAMED argument is always true for named arguments, and false
1299 for unnamed arguments. If this is not defined, but
1300 `SETUP_INCOMING_VARARGS' is defined, then all arguments are
1301 treated as named. Otherwise, all named arguments except the last
1302 are treated as named. */
1305 #define HAVE_POST_INCREMENT 1
1306 /* Define this macro if the machine supports post-increment
1307 addressing. */
1309 #define HAVE_PRE_DECREMENT 1
1310 /* Similar for other kinds of addressing. */
1312 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
1313 /* A C expression that is 1 if the RTX X is a constant which is a
1314 valid address. On most machines, this can be defined as
1315 `CONSTANT_P (X)', but a few machines are more restrictive in which
1316 constant addresses are supported.
1318 `CONSTANT_P' accepts integer-values expressions whose values are
1319 not explicitly known, such as `symbol_ref', `label_ref', and
1320 `high' expressions and `const' arithmetic expressions, in addition
1321 to `const_int' and `const_double' expressions. */
1323 #define MAX_REGS_PER_ADDRESS 1
1324 /* A number, the maximum number of registers that can appear in a
1325 valid memory address. Note that it is up to you to specify a
1326 value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS'
1327 would ever accept. */
1329 #ifdef REG_OK_STRICT
1330 # define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \
1332 if (legitimate_address_p (mode, operand, 1)) \
1333 goto ADDR; \
1335 # else
1336 # define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \
1338 if (legitimate_address_p (mode, operand, 0)) \
1339 goto ADDR; \
1341 #endif
1342 /* A C compound statement with a conditional `goto LABEL;' executed
1343 if X (an RTX) is a legitimate memory address on the target machine
1344 for a memory operand of mode MODE. */
1346 /* `REG_OK_FOR_BASE_P (X)'
1347 A C expression that is nonzero if X (assumed to be a `reg' RTX) is
1348 valid for use as a base register. For hard registers, it should
1349 always accept those which the hardware permits and reject the
1350 others. Whether the macro accepts or rejects pseudo registers
1351 must be controlled by `REG_OK_STRICT' as described above. This
1352 usually requires two variant definitions, of which `REG_OK_STRICT'
1353 controls the one actually used. */
1355 #define REG_OK_FOR_BASE_NOSTRICT_P(X) \
1356 (REGNO (X) >= FIRST_PSEUDO_REGISTER || REG_OK_FOR_BASE_STRICT_P(X))
1358 #define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
1360 #ifdef REG_OK_STRICT
1361 # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X)
1362 #else
1363 # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NOSTRICT_P (X)
1364 #endif
1366 /* A C expression that is just like `REG_OK_FOR_BASE_P', except that
1367 that expression may examine the mode of the memory reference in
1368 MODE. You should define this macro if the mode of the memory
1369 reference affects whether a register may be used as a base
1370 register. If you define this macro, the compiler will use it
1371 instead of `REG_OK_FOR_BASE_P'. */
1372 #define REG_OK_FOR_INDEX_P(X) 0
1373 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is
1374 valid for use as an index register.
1376 The difference between an index register and a base register is
1377 that the index register may be scaled. If an address involves the
1378 sum of two registers, neither one of them scaled, then either one
1379 may be labeled the "base" and the other the "index"; but whichever
1380 labeling is used must fit the machine's constraints of which
1381 registers may serve in each capacity. The compiler will try both
1382 labelings, looking for one that is valid, and will reload one or
1383 both registers only if neither labeling works. */
1385 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
1387 (X) = legitimize_address (X, OLDX, MODE); \
1388 if (memory_address_p (MODE, X)) \
1389 goto WIN; \
1391 /* A C compound statement that attempts to replace X with a valid
1392 memory address for an operand of mode MODE. WIN will be a C
1393 statement label elsewhere in the code; the macro definition may use
1395 GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
1397 to avoid further processing if the address has become legitimate.
1399 X will always be the result of a call to `break_out_memory_refs',
1400 and OLDX will be the operand that was given to that function to
1401 produce X.
1403 The code generated by this macro should not alter the substructure
1404 of X. If it transforms X into a more legitimate form, it should
1405 assign X (which will always be a C variable) a new value.
1407 It is not necessary for this macro to come up with a legitimate
1408 address. The compiler has standard ways of doing so in all cases.
1409 In fact, it is safe for this macro to do nothing. But often a
1410 machine-dependent strategy can generate better code. */
1412 #define XEXP_(X,Y) (X)
1413 #define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN) \
1414 do { \
1415 if (1&&(GET_CODE (X) == POST_INC || GET_CODE (X) == PRE_DEC)) \
1417 push_reload (XEXP (X,0), XEXP (X,0), &XEXP (X,0), &XEXP (X,0), \
1418 POINTER_REGS, GET_MODE (X),GET_MODE (X) , 0, 0, \
1419 OPNUM, RELOAD_OTHER); \
1420 goto WIN; \
1422 if (GET_CODE (X) == PLUS \
1423 && REG_P (XEXP (X, 0)) \
1424 && GET_CODE (XEXP (X, 1)) == CONST_INT \
1425 && INTVAL (XEXP (X, 1)) >= 1) \
1427 int fit = INTVAL (XEXP (X, 1)) <= (64 - GET_MODE_SIZE (MODE)); \
1428 if (fit) \
1430 if (reg_equiv_address[REGNO (XEXP (X, 0))] != 0) \
1432 int regno = REGNO (XEXP (X, 0)); \
1433 rtx mem = make_memloc (X, regno); \
1434 push_reload (XEXP (mem,0), NULL, &XEXP (mem,0), NULL, \
1435 POINTER_REGS, Pmode, VOIDmode, 0, 0, \
1436 1, ADDR_TYPE (TYPE)); \
1437 push_reload (mem, NULL_RTX, &XEXP (X, 0), NULL, \
1438 BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \
1439 OPNUM, TYPE); \
1440 goto WIN; \
1442 push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL, \
1443 BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \
1444 OPNUM, TYPE); \
1445 goto WIN; \
1447 else if (! (frame_pointer_needed && XEXP (X,0) == frame_pointer_rtx)) \
1449 push_reload (X, NULL_RTX, &X, NULL, \
1450 POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \
1451 OPNUM, TYPE); \
1452 goto WIN; \
1455 } while(0)
1456 /* A C compound statement that attempts to replace X, which is an
1457 address that needs reloading, with a valid memory address for an
1458 operand of mode MODE. WIN will be a C statement label elsewhere
1459 in the code. It is not necessary to define this macro, but it
1460 might be useful for performance reasons.
1462 For example, on the i386, it is sometimes possible to use a single
1463 reload register instead of two by reloading a sum of two pseudo
1464 registers into a register. On the other hand, for number of RISC
1465 processors offsets are limited so that often an intermediate
1466 address needs to be generated in order to address a stack slot.
1467 By defining LEGITIMIZE_RELOAD_ADDRESS appropriately, the
1468 intermediate addresses generated for adjacent some stack slots can
1469 be made identical, and thus be shared.
1471 *Note*: This macro should be used with caution. It is necessary
1472 to know something of how reload works in order to effectively use
1473 this, and it is quite easy to produce macros that build in too
1474 much knowledge of reload internals.
1476 *Note*: This macro must be able to reload an address created by a
1477 previous invocation of this macro. If it fails to handle such
1478 addresses then the compiler may generate incorrect code or abort.
1480 The macro definition should use `push_reload' to indicate parts
1481 that need reloading; OPNUM, TYPE and IND_LEVELS are usually
1482 suitable to be passed unaltered to `push_reload'.
1484 The code generated by this macro must not alter the substructure of
1485 X. If it transforms X into a more legitimate form, it should
1486 assign X (which will always be a C variable) a new value. This
1487 also applies to parts that you change indirectly by calling
1488 `push_reload'.
1490 The macro definition may use `strict_memory_address_p' to test if
1491 the address has become legitimate.
1493 If you want to change only a part of X, one standard way of doing
1494 this is to use `copy_rtx'. Note, however, that is unshares only a
1495 single level of rtl. Thus, if the part to be changed is not at the
1496 top level, you'll need to replace first the top leve It is not
1497 necessary for this macro to come up with a legitimate address;
1498 but often a machine-dependent strategy can generate better code. */
1500 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
1501 if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) \
1502 goto LABEL
1503 /* A C statement or compound statement with a conditional `goto
1504 LABEL;' executed if memory address X (an RTX) can have different
1505 meanings depending on the machine mode of the memory reference it
1506 is used for or if the address is valid for some modes but not
1507 others.
1509 Autoincrement and autodecrement addresses typically have
1510 mode-dependent effects because the amount of the increment or
1511 decrement is the size of the operand being addressed. Some
1512 machines have other mode-dependent addresses. Many RISC machines
1513 have no mode-dependent addresses.
1515 You may assume that ADDR is a valid address for the machine. */
1517 #define LEGITIMATE_CONSTANT_P(X) 1
1518 /* A C expression that is nonzero if X is a legitimate constant for
1519 an immediate operand on the target machine. You can assume that X
1520 satisfies `CONSTANT_P', so you need not check this. In fact, `1'
1521 is a suitable definition for this macro on machines where anything
1522 `CONSTANT_P' is valid. */
1524 #define REGISTER_MOVE_COST(MODE, FROM, TO) ((FROM) == STACK_REG ? 6 \
1525 : (TO) == STACK_REG ? 12 \
1526 : 2)
1527 /* A C expression for the cost of moving data from a register in class
1528 FROM to one in class TO. The classes are expressed using the
1529 enumeration values such as `GENERAL_REGS'. A value of 2 is the
1530 default; other values are interpreted relative to that.
1532 It is not required that the cost always equal 2 when FROM is the
1533 same as TO; on some machines it is expensive to move between
1534 registers if they are not general registers.
1536 If reload sees an insn consisting of a single `set' between two
1537 hard registers, and if `REGISTER_MOVE_COST' applied to their
1538 classes returns a value of 2, reload does not check to ensure that
1539 the constraints of the insn are met. Setting a cost of other than
1540 2 will allow reload to verify that the constraints are met. You
1541 should do this if the `movM' pattern's constraints do not allow
1542 such copying. */
1544 #define MEMORY_MOVE_COST(MODE,CLASS,IN) ((MODE)==QImode ? 2 : \
1545 (MODE)==HImode ? 4 : \
1546 (MODE)==SImode ? 8 : \
1547 (MODE)==SFmode ? 8 : 16)
1548 /* A C expression for the cost of moving data of mode M between a
1549 register and memory. A value of 4 is the default; this cost is
1550 relative to those in `REGISTER_MOVE_COST'.
1552 If moving between registers and memory is more expensive than
1553 between two registers, you should define this macro to express the
1554 relative cost. */
1556 #define BRANCH_COST 0
1557 /* A C expression for the cost of a branch instruction. A value of 1
1558 is the default; other values are interpreted relative to that.
1560 Here are additional macros which do not specify precise relative
1561 costs, but only that certain actions are more expensive than GCC would
1562 ordinarily expect. */
1564 #define SLOW_BYTE_ACCESS 0
1565 /* Define this macro as a C expression which is nonzero if accessing
1566 less than a word of memory (i.e. a `char' or a `short') is no
1567 faster than accessing a word of memory, i.e., if such access
1568 require more than one instruction or if there is no difference in
1569 cost between byte and (aligned) word loads.
1571 When this macro is not defined, the compiler will access a field by
1572 finding the smallest containing object; when it is defined, a
1573 fullword load will be used if alignment permits. Unless bytes
1574 accesses are faster than word accesses, using word accesses is
1575 preferable since it may eliminate subsequent memory access if
1576 subsequent accesses occur to other fields in the same word of the
1577 structure, but to different bytes.
1579 `SLOW_UNALIGNED_ACCESS'
1580 Define this macro to be the value 1 if unaligned accesses have a
1581 cost many times greater than aligned accesses, for example if they
1582 are emulated in a trap handler.
1584 When this macro is nonzero, the compiler will act as if
1585 `STRICT_ALIGNMENT' were nonzero when generating code for block
1586 moves. This can cause significantly more instructions to be
1587 produced. Therefore, do not set this macro nonzero if unaligned
1588 accesses only add a cycle or two to the time for a memory access.
1590 If the value of this macro is always zero, it need not be defined.
1592 `MOVE_RATIO'
1593 The number of scalar move insns which should be generated instead
1594 of a string move insn or a library call. Increasing the value
1595 will always make code faster, but eventually incurs high cost in
1596 increased code size.
1598 If you don't define this, a reasonable default is used. */
1600 #define NO_FUNCTION_CSE
1601 /* Define this macro if it is as good or better to call a constant
1602 function address than to call an address kept in a register. */
1604 #define NO_RECURSIVE_FUNCTION_CSE
1605 /* Define this macro if it is as good or better for a function to call
1606 itself with an explicit address than to call an address kept in a
1607 register. */
1609 #define TEXT_SECTION_ASM_OP "\t.text"
1610 /* A C expression whose value is a string containing the assembler
1611 operation that should precede instructions and read-only data.
1612 Normally `"\t.text"' is right. */
1614 #define DATA_SECTION_ASM_OP "\t.data"
1615 /* A C expression whose value is a string containing the assembler
1616 operation to identify the following data as writable initialized
1617 data. Normally `"\t.data"' is right. */
1619 #define BSS_SECTION_ASM_OP "\t.section .bss"
1620 /* If defined, a C expression whose value is a string, including
1621 spacing, containing the assembler operation to identify the
1622 following data as uninitialized global data. If not defined, and
1623 neither `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
1624 uninitialized global data will be output in the data section if
1625 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
1626 used. */
1628 /* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
1629 There are no shared libraries on this target, and these sections are
1630 placed in the read-only program memory, so they are not writable. */
1632 #undef CTORS_SECTION_ASM_OP
1633 #define CTORS_SECTION_ASM_OP "\t.section .ctors,\"a\",@progbits"
1635 #undef DTORS_SECTION_ASM_OP
1636 #define DTORS_SECTION_ASM_OP "\t.section .dtors,\"a\",@progbits"
1638 #define TARGET_ASM_CONSTRUCTOR avr_asm_out_ctor
1639 /* If defined, a function that outputs assembler code to arrange to
1640 call the function referenced by SYMBOL at initialization time. */
1642 #define TARGET_ASM_DESTRUCTOR avr_asm_out_dtor
1643 /* This is like `TARGET_ASM_CONSTRUCTOR' but used for termination
1644 functions rather than initialization functions. */
1646 #define EXTRA_SECTIONS in_progmem
1647 /* A list of names for sections other than the standard two, which are
1648 `in_text' and `in_data'. You need not define this macro on a
1649 system with no other sections (that GCC needs to use). */
1651 #define EXTRA_SECTION_FUNCTIONS \
1653 void \
1654 progmem_section () \
1656 if (in_section != in_progmem) \
1658 fprintf (asm_out_file, \
1659 "\t.section .progmem.gcc_sw_table, \"%s\", @progbits\n", \
1660 AVR_MEGA ? "a" : "ax"); \
1661 /* Should already be aligned, this is just to be safe if it isn't. */ \
1662 fprintf (asm_out_file, "\t.p2align 1\n"); \
1663 in_section = in_progmem; \
1666 /* `EXTRA_SECTION_FUNCTIONS'
1667 One or more functions to be defined in `varasm.c'. These
1668 functions should do jobs analogous to those of `text_section' and
1669 `data_section', for your additional sections. Do not define this
1670 macro if you do not define `EXTRA_SECTIONS'. */
1672 #define READONLY_DATA_SECTION data_section
1673 /* On most machines, read-only variables, constants, and jump tables
1674 are placed in the text section. If this is not the case on your
1675 machine, this macro should be defined to be the name of a function
1676 (either `data_section' or a function defined in `EXTRA_SECTIONS')
1677 that switches to the section to be used for read-only items.
1679 If these items should be placed in the text section, this macro
1680 should not be defined. */
1682 #define JUMP_TABLES_IN_TEXT_SECTION 0
1683 /* Define this macro if jump tables (for `tablejump' insns) should be
1684 output in the text section, along with the assembler instructions.
1685 Otherwise, the readonly data section is used.
1687 This macro is irrelevant if there is no separate readonly data
1688 section. */
1690 #define ASM_COMMENT_START " ; "
1691 /* A C string constant describing how to begin a comment in the target
1692 assembler language. The compiler assumes that the comment will
1693 end at the end of the line. */
1695 #define ASM_APP_ON "/* #APP */\n"
1696 /* A C string constant for text to be output before each `asm'
1697 statement or group of consecutive ones. Normally this is
1698 `"#APP"', which is a comment that has no effect on most assemblers
1699 but tells the GNU assembler that it must check the lines that
1700 follow for all valid assembler constructs. */
1702 #define ASM_APP_OFF "/* #NOAPP */\n"
1703 /* A C string constant for text to be output after each `asm'
1704 statement or group of consecutive ones. Normally this is
1705 `"#NO_APP"', which tells the GNU assembler to resume making the
1706 time-saving assumptions that are valid for ordinary compiler
1707 output. */
1709 #define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
1710 fprintf (STREAM,"/* line: %d */\n",LINE)
1711 /* A C statement to output DBX or SDB debugging information before
1712 code for line number LINE of the current source file to the stdio
1713 stream STREAM.
1715 This macro need not be defined if the standard form of debugging
1716 information for the debugger in use is appropriate. */
1718 /* Switch into a generic section. */
1719 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
1721 #define ASM_OUTPUT_ASCII(FILE, P, SIZE) gas_output_ascii (FILE,P,SIZE)
1722 /* `ASM_OUTPUT_ASCII (STREAM, PTR, LEN)'
1723 output_ascii (FILE, P, SIZE)
1724 A C statement to output to the stdio stream STREAM an assembler
1725 instruction to assemble a string constant containing the LEN bytes
1726 at PTR. PTR will be a C expression of type `char *' and LEN a C
1727 expression of type `int'.
1729 If the assembler has a `.ascii' pseudo-op as found in the Berkeley
1730 Unix assembler, do not define the macro `ASM_OUTPUT_ASCII'. */
1732 #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '\n' \
1733 || ((C) == '$'))
1734 /* Define this macro as a C expression which is nonzero if C is used
1735 as a logical line separator by the assembler.
1737 If you do not define this macro, the default is that only the
1738 character `;' is treated as a logical line separator. */
1740 /* These macros are provided by `real.h' for writing the definitions of
1741 `ASM_OUTPUT_DOUBLE' and the like: */
1743 #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
1744 do { \
1745 fputs ("\t.comm ", (STREAM)); \
1746 assemble_name ((STREAM), (NAME)); \
1747 fprintf ((STREAM), ",%lu,1\n", (unsigned long)(SIZE)); \
1748 } while (0)
1749 /* A C statement (sans semicolon) to output to the stdio stream
1750 STREAM the assembler definition of a common-label named NAME whose
1751 size is SIZE bytes. The variable ROUNDED is the size rounded up
1752 to whatever alignment the caller wants.
1754 Use the expression `assemble_name (STREAM, NAME)' to output the
1755 name itself; before and after that, output the additional
1756 assembler syntax for defining the name, and a newline.
1758 This macro controls how the assembler definitions of uninitialized
1759 common global variables are output. */
1761 #define ASM_OUTPUT_BSS(FILE, DECL, NAME, SIZE, ROUNDED) \
1762 asm_output_bss ((FILE), (DECL), (NAME), (SIZE), (ROUNDED))
1763 /* A C statement (sans semicolon) to output to the stdio stream
1764 STREAM the assembler definition of uninitialized global DECL named
1765 NAME whose size is SIZE bytes. The variable ROUNDED is the size
1766 rounded up to whatever alignment the caller wants. */
1768 #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) \
1769 do { \
1770 fputs ("\t.lcomm ", (STREAM)); \
1771 assemble_name ((STREAM), (NAME)); \
1772 fprintf ((STREAM), ",%d\n", (int)(SIZE)); \
1773 } while (0)
1774 /* A C statement (sans semicolon) to output to the stdio stream
1775 STREAM the assembler definition of a local-common-label named NAME
1776 whose size is SIZE bytes. The variable ROUNDED is the size
1777 rounded up to whatever alignment the caller wants.
1779 Use the expression `assemble_name (STREAM, NAME)' to output the
1780 name itself; before and after that, output the additional
1781 assembler syntax for defining the name, and a newline.
1783 This macro controls how the assembler definitions of uninitialized
1784 static variables are output. */
1786 #undef TYPE_ASM_OP
1787 #undef SIZE_ASM_OP
1788 #undef WEAK_ASM_OP
1789 #define TYPE_ASM_OP "\t.type\t"
1790 #define SIZE_ASM_OP "\t.size\t"
1791 #define WEAK_ASM_OP "\t.weak\t"
1792 /* Define the strings used for the special svr4 .type and .size directives.
1793 These strings generally do not vary from one system running svr4 to
1794 another, but if a given system (e.g. m88k running svr) needs to use
1795 different pseudo-op names for these, they may be overridden in the
1796 file which includes this one. */
1799 #undef TYPE_OPERAND_FMT
1800 #define TYPE_OPERAND_FMT "@%s"
1801 /* The following macro defines the format used to output the second
1802 operand of the .type assembler directive. Different svr4 assemblers
1803 expect various different forms for this operand. The one given here
1804 is just a default. You may need to override it in your machine-
1805 specific tm.h file (depending upon the particulars of your assembler). */
1807 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
1808 do { \
1809 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
1810 ASM_OUTPUT_LABEL (FILE, NAME); \
1811 } while (0)
1813 /* A C statement (sans semicolon) to output to the stdio stream
1814 STREAM any text necessary for declaring the name NAME of a
1815 function which is being defined. This macro is responsible for
1816 outputting the label definition (perhaps using
1817 `ASM_OUTPUT_LABEL'). The argument DECL is the `FUNCTION_DECL'
1818 tree node representing the function.
1820 If this macro is not defined, then the function name is defined in
1821 the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
1823 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
1824 do { \
1825 if (!flag_inhibit_size_directive) \
1826 ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
1827 } while (0)
1828 /* A C statement (sans semicolon) to output to the stdio stream
1829 STREAM any text necessary for declaring the size of a function
1830 which is being defined. The argument NAME is the name of the
1831 function. The argument DECL is the `FUNCTION_DECL' tree node
1832 representing the function.
1834 If this macro is not defined, then the function size is not
1835 defined. */
1837 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
1838 do { \
1839 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
1840 size_directive_output = 0; \
1841 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
1843 size_directive_output = 1; \
1844 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, \
1845 int_size_in_bytes (TREE_TYPE (DECL))); \
1847 ASM_OUTPUT_LABEL(FILE, NAME); \
1848 } while (0)
1849 /* A C statement (sans semicolon) to output to the stdio stream
1850 STREAM any text necessary for declaring the name NAME of an
1851 initialized variable which is being defined. This macro must
1852 output the label definition (perhaps using `ASM_OUTPUT_LABEL').
1853 The argument DECL is the `VAR_DECL' tree node representing the
1854 variable.
1856 If this macro is not defined, then the variable name is defined in
1857 the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
1859 #undef ASM_FINISH_DECLARE_OBJECT
1860 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
1861 do { \
1862 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
1863 HOST_WIDE_INT size; \
1864 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
1865 && ! AT_END && TOP_LEVEL \
1866 && DECL_INITIAL (DECL) == error_mark_node \
1867 && !size_directive_output) \
1869 size_directive_output = 1; \
1870 size = int_size_in_bytes (TREE_TYPE (DECL)); \
1871 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
1873 } while (0)
1875 /* A C statement (sans semicolon) to finish up declaring a variable
1876 name once the compiler has processed its initializer fully and
1877 thus has had a chance to determine the size of an array when
1878 controlled by an initializer. This is used on systems where it's
1879 necessary to declare something about the size of the object.
1881 If you don't define this macro, that is equivalent to defining it
1882 to do nothing. */
1885 #define ESCAPES \
1886 "\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\
1887 \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\
1888 \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\
1889 \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\
1890 \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\
1891 \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\
1892 \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\
1893 \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"
1894 /* A table of bytes codes used by the ASM_OUTPUT_ASCII and
1895 ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
1896 corresponds to a particular byte value [0..255]. For any
1897 given byte value, if the value in the corresponding table
1898 position is zero, the given character can be output directly.
1899 If the table value is 1, the byte must be output as a \ooo
1900 octal escape. If the tables value is anything else, then the
1901 byte value should be output as a \ followed by the value
1902 in the table. Note that we can use standard UN*X escape
1903 sequences for many control characters, but we don't use
1904 \a to represent BEL because some svr4 assemblers (e.g. on
1905 the i386) don't know about that. Also, we don't use \v
1906 since some versions of gas, such as 2.2 did not accept it. */
1908 #define STRING_LIMIT ((unsigned) 64)
1909 #define STRING_ASM_OP "\t.string\t"
1910 /* Some svr4 assemblers have a limit on the number of characters which
1911 can appear in the operand of a .string directive. If your assembler
1912 has such a limitation, you should define STRING_LIMIT to reflect that
1913 limit. Note that at least some svr4 assemblers have a limit on the
1914 actual number of bytes in the double-quoted string, and that they
1915 count each character in an escape sequence as one byte. Thus, an
1916 escape sequence like \377 would count as four bytes.
1918 If your target assembler doesn't support the .string directive, you
1919 should define this to zero. */
1921 /* Globalizing directive for a label. */
1922 #define GLOBAL_ASM_OP ".global\t"
1924 #define ASM_WEAKEN_LABEL(FILE, NAME) \
1925 do \
1927 fputs ("\t.weak\t", (FILE)); \
1928 assemble_name ((FILE), (NAME)); \
1929 fputc ('\n', (FILE)); \
1931 while (0)
1933 /* A C statement (sans semicolon) to output to the stdio stream
1934 STREAM some commands that will make the label NAME weak; that is,
1935 available for reference from other files but only used if no other
1936 definition is available. Use the expression `assemble_name
1937 (STREAM, NAME)' to output the name itself; before and after that,
1938 output the additional assembler syntax for making that name weak,
1939 and a newline.
1941 If you don't define this macro, GNU CC will not support weak
1942 symbols and you should not define the `SUPPORTS_WEAK' macro.
1945 #define SUPPORTS_WEAK 1
1946 /* A C expression which evaluates to true if the target supports weak
1947 symbols.
1949 If you don't define this macro, `defaults.h' provides a default
1950 definition. If `ASM_WEAKEN_LABEL' is defined, the default
1951 definition is `1'; otherwise, it is `0'. Define this macro if you
1952 want to control weak symbol support with a compiler flag such as
1953 `-melf'.
1955 `MAKE_DECL_ONE_ONLY'
1956 A C statement (sans semicolon) to mark DECL to be emitted as a
1957 public symbol such that extra copies in multiple translation units
1958 will be discarded by the linker. Define this macro if your object
1959 file format provides support for this concept, such as the `COMDAT'
1960 section flags in the Microsoft Windows PE/COFF format, and this
1961 support requires changes to DECL, such as putting it in a separate
1962 section.
1964 `SUPPORTS_WEAK'
1965 A C expression which evaluates to true if the target supports
1966 one-only semantics.
1968 If you don't define this macro, `varasm.c' provides a default
1969 definition. If `MAKE_DECL_ONE_ONLY' is defined, the default
1970 definition is `1'; otherwise, it is `0'. Define this macro if you
1971 want to control weak symbol support with a compiler flag, or if
1972 setting the `DECL_ONE_ONLY' flag is enough to mark a declaration to
1973 be emitted as one-only. */
1975 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
1976 sprintf (STRING, "*.%s%lu", PREFIX, (unsigned long)(NUM))
1977 /* A C statement to store into the string STRING a label whose name
1978 is made from the string PREFIX and the number NUM.
1980 This string, when output subsequently by `assemble_name', should
1981 produce the output that `(*targetm.asm_out.internal_label)' would produce
1982 with the same PREFIX and NUM.
1984 If the string begins with `*', then `assemble_name' will output
1985 the rest of the string unchanged. It is often convenient for
1986 `ASM_GENERATE_INTERNAL_LABEL' to use `*' in this way. If the
1987 string doesn't start with `*', then `ASM_OUTPUT_LABELREF' gets to
1988 output the string, and may change it. (Of course,
1989 `ASM_OUTPUT_LABELREF' is also part of your machine description, so
1990 you should know what it does on your machine.) */
1992 /* `ASM_OUTPUT_WEAK_ALIAS (STREAM, NAME, VALUE)'
1993 A C statement to output to the stdio stream STREAM assembler code
1994 which defines (equates) the weak symbol NAME to have the value
1995 VALUE.
1997 Define this macro if the target only supports weak aliases; define
1998 ASM_OUTPUT_DEF instead if possible. */
2000 #define HAS_INIT_SECTION 1
2001 /* If defined, `main' will not call `__main' as described above.
2002 This macro should be defined for systems that control the contents
2003 of the init section on a symbol-by-symbol basis, such as OSF/1,
2004 and should not be defined explicitly for systems that support
2005 `INIT_SECTION_ASM_OP'. */
2007 #define REGISTER_NAMES { \
2008 "r0","r1","r2","r3","r4","r5","r6","r7", \
2009 "r8","r9","r10","r11","r12","r13","r14","r15", \
2010 "r16","r17","r18","r19","r20","r21","r22","r23", \
2011 "r24","r25","r26","r27","r28","r29","r30","r31", \
2012 "__SPL__","__SPH__","argL","argH"}
2013 /* A C initializer containing the assembler's names for the machine
2014 registers, each one as a C string constant. This is what
2015 translates register numbers in the compiler into assembler
2016 language. */
2018 #define FINAL_PRESCAN_INSN(insn, operand, nop) final_prescan_insn (insn, operand,nop)
2019 /* If defined, a C statement to be executed just prior to the output
2020 of assembler code for INSN, to modify the extracted operands so
2021 they will be output differently.
2023 Here the argument OPVEC is the vector containing the operands
2024 extracted from INSN, and NOPERANDS is the number of elements of
2025 the vector which contain meaningful data for this insn. The
2026 contents of this vector are what will be used to convert the insn
2027 template into assembler code, so you can change the assembler
2028 output by changing the contents of the vector.
2030 This macro is useful when various assembler syntaxes share a single
2031 file of instruction patterns; by defining this macro differently,
2032 you can cause a large class of instructions to be output
2033 differently (such as with rearranged operands). Naturally,
2034 variations in assembler syntax affecting individual insn patterns
2035 ought to be handled by writing conditional output routines in
2036 those patterns.
2038 If this macro is not defined, it is equivalent to a null statement. */
2040 #define PRINT_OPERAND(STREAM, X, CODE) print_operand (STREAM, X, CODE)
2041 /* A C compound statement to output to stdio stream STREAM the
2042 assembler syntax for an instruction operand X. X is an RTL
2043 expression.
2045 CODE is a value that can be used to specify one of several ways of
2046 printing the operand. It is used when identical operands must be
2047 printed differently depending on the context. CODE comes from the
2048 `%' specification that was used to request printing of the
2049 operand. If the specification was just `%DIGIT' then CODE is 0;
2050 if the specification was `%LTR DIGIT' then CODE is the ASCII code
2051 for LTR.
2053 If X is a register, this macro should print the register's name.
2054 The names can be found in an array `reg_names' whose type is `char
2055 *[]'. `reg_names' is initialized from `REGISTER_NAMES'.
2057 When the machine description has a specification `%PUNCT' (a `%'
2058 followed by a punctuation character), this macro is called with a
2059 null pointer for X and the punctuation character for CODE. */
2061 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '~')
2062 /* A C expression which evaluates to true if CODE is a valid
2063 punctuation character for use in the `PRINT_OPERAND' macro. If
2064 `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no
2065 punctuation characters (except for the standard one, `%') are used
2066 in this way. */
2068 #define PRINT_OPERAND_ADDRESS(STREAM, X) print_operand_address(STREAM, X)
2069 /* A C compound statement to output to stdio stream STREAM the
2070 assembler syntax for an instruction operand that is a memory
2071 reference whose address is X. X is an RTL expression. */
2073 #define USER_LABEL_PREFIX ""
2074 /* `LOCAL_LABEL_PREFIX'
2075 `REGISTER_PREFIX'
2076 `IMMEDIATE_PREFIX'
2077 If defined, C string expressions to be used for the `%R', `%L',
2078 `%U', and `%I' options of `asm_fprintf' (see `final.c'). These
2079 are useful when a single `md' file must support multiple assembler
2080 formats. In that case, the various `tm.h' files can define these
2081 macros differently. */
2083 #define ASSEMBLER_DIALECT AVR_ENHANCED
2084 /* If your target supports multiple dialects of assembler language
2085 (such as different opcodes), define this macro as a C expression
2086 that gives the numeric index of the assembler language dialect to
2087 use, with zero as the first variant.
2089 If this macro is defined, you may use constructs of the form
2090 `{option0|option1|option2...}' in the output templates of patterns
2091 (*note Output Template::.) or in the first argument of
2092 `asm_fprintf'. This construct outputs `option0', `option1' or
2093 `option2', etc., if the value of `ASSEMBLER_DIALECT' is zero, one
2094 or two, etc. Any special characters within these strings retain
2095 their usual meaning.
2097 If you do not define this macro, the characters `{', `|' and `}'
2098 do not have any special meaning when used in templates or operands
2099 to `asm_fprintf'.
2101 Define the macros `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX',
2102 `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' if you can express the
2103 variations in assembler language syntax with that mechanism.
2104 Define `ASSEMBLER_DIALECT' and use the `{option0|option1}' syntax
2105 if the syntax variant are larger and involve such things as
2106 different opcodes or operand order. */
2108 #define ASM_OUTPUT_REG_PUSH(STREAM, REGNO) \
2110 if (REGNO > 31) \
2111 abort (); \
2112 fprintf (STREAM, "\tpush\tr%d", REGNO); \
2114 /* A C expression to output to STREAM some assembler code which will
2115 push hard register number REGNO onto the stack. The code need not
2116 be optimal, since this macro is used only when profiling. */
2118 #define ASM_OUTPUT_REG_POP(STREAM, REGNO) \
2120 if (REGNO > 31) \
2121 abort (); \
2122 fprintf (STREAM, "\tpop\tr%d", REGNO); \
2124 /* A C expression to output to STREAM some assembler code which will
2125 pop hard register number REGNO off of the stack. The code need
2126 not be optimal, since this macro is used only when profiling. */
2128 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
2129 avr_output_addr_vec_elt(STREAM, VALUE)
2130 /* This macro should be provided on machines where the addresses in a
2131 dispatch table are absolute.
2133 The definition should be a C statement to output to the stdio
2134 stream STREAM an assembler pseudo-instruction to generate a
2135 reference to a label. VALUE is the number of an internal label
2136 whose definition is output using `(*targetm.asm_out.internal_label)'. For
2137 example,
2139 fprintf (STREAM, "\t.word L%d\n", VALUE) */
2141 #define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) \
2142 progmem_section (), (*targetm.asm_out.internal_label) (STREAM, PREFIX, NUM)
2144 /* `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)'
2145 Define this if the label before a jump-table needs to be output
2146 specially. The first three arguments are the same as for
2147 `(*targetm.asm_out.internal_label)'; the fourth argument is the jump-table
2148 which follows (a `jump_insn' containing an `addr_vec' or
2149 `addr_diff_vec').
2151 This feature is used on system V to output a `swbeg' statement for
2152 the table.
2154 If this macro is not defined, these labels are output with
2155 `(*targetm.asm_out.internal_label)'. */
2157 /* `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)'
2158 Define this if something special must be output at the end of a
2159 jump-table. The definition should be a C statement to be executed
2160 after the assembler code for the table is written. It should write
2161 the appropriate code to stdio stream STREAM. The argument TABLE
2162 is the jump-table insn, and NUM is the label-number of the
2163 preceding label.
2165 If this macro is not defined, nothing special is output at the end
2166 of the jump-table. */
2168 #define ASM_OUTPUT_SKIP(STREAM, N) \
2169 fprintf (STREAM, "\t.skip %lu,0\n", (unsigned long)(N))
2170 /* A C statement to output to the stdio stream STREAM an assembler
2171 instruction to advance the location counter by NBYTES bytes.
2172 Those bytes should be zero when loaded. NBYTES will be a C
2173 expression of type `int'. */
2175 #define ASM_OUTPUT_ALIGN(STREAM, POWER)
2176 /* A C statement to output to the stdio stream STREAM an assembler
2177 command to advance the location counter to a multiple of 2 to the
2178 POWER bytes. POWER will be a C expression of type `int'. */
2180 #define CASE_VECTOR_MODE HImode
2181 /* An alias for a machine mode name. This is the machine mode that
2182 elements of a jump-table should have. */
2184 extern int avr_case_values_threshold;
2186 #define CASE_VALUES_THRESHOLD avr_case_values_threshold
2187 /* `CASE_VALUES_THRESHOLD'
2188 Define this to be the smallest number of different values for
2189 which it is best to use a jump-table instead of a tree of
2190 conditional branches. The default is four for machines with a
2191 `casesi' instruction and five otherwise. This is best for most
2192 machines. */
2194 #undef WORD_REGISTER_OPERATIONS
2195 /* Define this macro if operations between registers with integral
2196 mode smaller than a word are always performed on the entire
2197 register. Most RISC machines have this property and most CISC
2198 machines do not. */
2200 #define MOVE_MAX 4
2201 /* The maximum number of bytes that a single instruction can move
2202 quickly between memory and registers or between two memory
2203 locations. */
2205 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
2206 /* A C expression which is nonzero if on this machine it is safe to
2207 "convert" an integer of INPREC bits to one of OUTPREC bits (where
2208 OUTPREC is smaller than INPREC) by merely operating on it as if it
2209 had only OUTPREC bits.
2211 On many machines, this expression can be 1.
2213 When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for
2214 modes for which `MODES_TIEABLE_P' is 0, suboptimal code can result.
2215 If this is the case, making `TRULY_NOOP_TRUNCATION' return 0 in
2216 such cases may improve things. */
2218 #define Pmode HImode
2219 /* An alias for the machine mode for pointers. On most machines,
2220 define this to be the integer mode corresponding to the width of a
2221 hardware pointer; `SImode' on 32-bit machine or `DImode' on 64-bit
2222 machines. On some machines you must define this to be one of the
2223 partial integer modes, such as `PSImode'.
2225 The width of `Pmode' must be at least as large as the value of
2226 `POINTER_SIZE'. If it is not equal, you must define the macro
2227 `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to
2228 `Pmode'. */
2230 #define FUNCTION_MODE HImode
2231 /* An alias for the machine mode used for memory references to
2232 functions being called, in `call' RTL expressions. On most
2233 machines this should be `QImode'. */
2234 /* 1 3 */
2235 #define INTEGRATE_THRESHOLD(DECL) (1 + (3 * list_length (DECL_ARGUMENTS (DECL)) / 2))
2237 /* A C expression for the maximum number of instructions above which
2238 the function DECL should not be inlined. DECL is a
2239 `FUNCTION_DECL' node.
2241 The default definition of this macro is 64 plus 8 times the number
2242 of arguments that the function accepts. Some people think a larger
2243 threshold should be used on RISC machines. */
2245 #define DOLLARS_IN_IDENTIFIERS 0
2246 /* Define this macro to control use of the character `$' in identifier
2247 names. 0 means `$' is not allowed by default; 1 means it is
2248 allowed. 1 is the default; there is no need to define this macro
2249 in that case. This macro controls the compiler proper; it does
2250 not affect the preprocessor. */
2252 #define NO_DOLLAR_IN_LABEL 1
2253 /* Define this macro if the assembler does not accept the character
2254 `$' in label names. By default constructors and destructors in
2255 G++ have `$' in the identifiers. If this macro is defined, `.' is
2256 used instead. */
2258 #define GIV_SORT_CRITERION(X, Y) \
2259 if (GET_CODE ((X)->add_val) == CONST_INT \
2260 && GET_CODE ((Y)->add_val) == CONST_INT) \
2261 return INTVAL ((X)->add_val) - INTVAL ((Y)->add_val);
2263 /* `GIV_SORT_CRITERION(GIV1, GIV2)'
2264 In some cases, the strength reduction optimization pass can
2265 produce better code if this is defined. This macro controls the
2266 order that induction variables are combined. This macro is
2267 particularly useful if the target has limited addressing modes.
2268 For instance, the SH target has only positive offsets in
2269 addresses. Thus sorting to put the smallest address first allows
2270 the most combinations to be found. */
2272 #define TRAMPOLINE_TEMPLATE(FILE) \
2273 internal_error ("trampolines not supported")
2275 /* Length in units of the trampoline for entering a nested function. */
2277 #define TRAMPOLINE_SIZE 4
2279 /* Emit RTL insns to initialize the variable parts of a trampoline.
2280 FNADDR is an RTX for the address of the function's pure code.
2281 CXT is an RTX for the static chain value for the function. */
2283 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
2285 emit_move_insn (gen_rtx (MEM, HImode, plus_constant ((TRAMP), 2)), CXT); \
2286 emit_move_insn (gen_rtx (MEM, HImode, plus_constant ((TRAMP), 6)), FNADDR); \
2288 /* Store in cc_status the expressions
2289 that the condition codes will describe
2290 after execution of an instruction whose pattern is EXP.
2291 Do not alter them if the instruction would not alter the cc's. */
2293 #define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc(EXP, INSN)
2295 /* The add insns don't set overflow in a usable way. */
2296 #define CC_OVERFLOW_UNUSABLE 01000
2297 /* The mov,and,or,xor insns don't set carry. That's ok though as the
2298 Z bit is all we need when doing unsigned comparisons on the result of
2299 these insns (since they're always with 0). However, conditions.h has
2300 CC_NO_OVERFLOW defined for this purpose. Rename it to something more
2301 understandable. */
2302 #define CC_NO_CARRY CC_NO_OVERFLOW
2305 /* Output assembler code to FILE to increment profiler label # LABELNO
2306 for profiling a function entry. */
2308 #define FUNCTION_PROFILER(FILE, LABELNO) \
2309 fprintf (FILE, "/* profiler %d */", (LABELNO))
2311 /* `FIRST_INSN_ADDRESS'
2312 When the `length' insn attribute is used, this macro specifies the
2313 value to be assigned to the address of the first insn in a
2314 function. If not specified, 0 is used. */
2316 #define ADJUST_INSN_LENGTH(INSN, LENGTH) (LENGTH =\
2317 adjust_insn_length (INSN, LENGTH))
2318 /* If defined, modifies the length assigned to instruction INSN as a
2319 function of the context in which it is used. LENGTH is an lvalue
2320 that contains the initially computed length of the insn and should
2321 be updated with the correct length of the insn. If updating is
2322 required, INSN must not be a varying-length insn.
2324 This macro will normally not be required. A case in which it is
2325 required is the ROMP. On this machine, the size of an `addr_vec'
2326 insn must be increased by two to compensate for the fact that
2327 alignment may be required. */
2329 #define TARGET_MEM_FUNCTIONS
2330 /* Define this macro if GNU CC should generate calls to the System V
2331 (and ANSI C) library functions `memcpy' and `memset' rather than
2332 the BSD functions `bcopy' and `bzero'. */
2334 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
2336 /* A C string constant that tells the GNU CC driver program options to
2337 pass to CPP. It can also specify how to translate options you
2338 give to GNU CC into options for GNU CC to pass to the CPP.
2340 Do not define this macro if it does not need to do anything. */
2342 #define CC1_SPEC "%{profile:-p}"
2343 /* A C string constant that tells the GNU CC driver program options to
2344 pass to `cc1'. It can also specify how to translate options you
2345 give to GNU CC into options for GNU CC to pass to the `cc1'.
2347 Do not define this macro if it does not need to do anything. */
2349 #define CC1PLUS_SPEC "%{!frtti:-fno-rtti} \
2350 %{!fenforce-eh-specs:-fno-enforce-eh-specs} \
2351 %{!fexceptions:-fno-exceptions}"
2352 /* A C string constant that tells the GNU CC drvier program options to
2353 pass to `cc1plus'. */
2355 #define ASM_SPEC "%{mmcu=*:-mmcu=%*}"
2356 /* A C string constant that tells the GNU CC driver program how to
2357 run any programs which cleanup after the normal assembler.
2358 Normally, this is not needed. See the file `mips.h' for an
2359 example of this.
2361 Do not define this macro if it does not need to do anything. */
2363 #define LINK_SPEC " %{!mmcu*:-m avr2}\
2364 %{mmcu=at90s1200|mmcu=attiny1*|mmcu=attiny28:-m avr1} \
2365 %{mmcu=attiny22|mmcu=attiny26|mmcu=at90s2*|mmcu=at90s4*|mmcu=at90s8*|mmcu=at90c8*|mmcu=at86rf401:-m avr2}\
2366 %{mmcu=atmega103|mmcu=atmega603|mmcu=at43*|mmcu=at76*:-m avr3}\
2367 %{mmcu=atmega8*:-m avr4}\
2368 %{mmcu=atmega16*|mmcu=atmega32*|mmcu=atmega64|mmcu=atmega128|mmcu=at94k:-m avr5}\
2369 %{mmcu=atmega64|mmcu=atmega128|mmcu=atmega162|mmcu=atmega169: -Tdata 0x800100} "
2371 /* A C string constant that tells the GNU CC driver program options to
2372 pass to the linker. It can also specify how to translate options
2373 you give to GNU CC into options for GNU CC to pass to the linker.
2375 Do not define this macro if it does not need to do anything. */
2377 #define LIB_SPEC \
2378 "%{!mmcu=at90s1*:%{!mmcu=attiny1*:%{!mmcu=attiny28: -lc }}}"
2379 /* Another C string constant used much like `LINK_SPEC'. The
2380 difference between the two is that `LIB_SPEC' is used at the end
2381 of the command given to the linker.
2383 If this macro is not defined, a default is provided that loads the
2384 standard C library from the usual place. See `gcc.c'. */
2386 #define LIBSTDCXX "-lgcc"
2387 /* No libstdc++ for now. Empty string doesn't work. */
2389 #define LIBGCC_SPEC \
2390 "%{!mmcu=at90s1*:%{!mmcu=attiny1*:%{!mmcu=attiny28: -lgcc }}}"
2391 /* Another C string constant that tells the GNU CC driver program how
2392 and when to place a reference to `libgcc.a' into the linker
2393 command line. This constant is placed both before and after the
2394 value of `LIB_SPEC'.
2396 If this macro is not defined, the GNU CC driver provides a default
2397 that passes the string `-lgcc' to the linker unless the `-shared'
2398 option is specified. */
2400 #define STARTFILE_SPEC "%(crt_binutils)"
2401 /* Another C string constant used much like `LINK_SPEC'. The
2402 difference between the two is that `STARTFILE_SPEC' is used at the
2403 very beginning of the command given to the linker.
2405 If this macro is not defined, a default is provided that loads the
2406 standard C startup file from the usual place. See `gcc.c'. */
2408 #define ENDFILE_SPEC ""
2409 /* Another C string constant used much like `LINK_SPEC'. The
2410 difference between the two is that `ENDFILE_SPEC' is used at the
2411 very end of the command given to the linker.
2413 Do not define this macro if it does not need to do anything. */
2415 #define CRT_BINUTILS_SPECS "\
2416 %{mmcu=at90s1200|mmcu=avr1:crts1200.o%s} \
2417 %{mmcu=attiny11:crttn11.o%s} \
2418 %{mmcu=attiny12:crttn12.o%s} \
2419 %{mmcu=attiny15:crttn15.o%s} \
2420 %{mmcu=attiny28:crttn28.o%s} \
2421 %{!mmcu*|mmcu=at90s8515|mmcu=avr2:crts8515.o%s} \
2422 %{mmcu=at90s2313:crts2313.o%s} \
2423 %{mmcu=at90s2323:crts2323.o%s} \
2424 %{mmcu=at90s2333:crts2333.o%s} \
2425 %{mmcu=at90s2343:crts2343.o%s} \
2426 %{mmcu=attiny22:crttn22.o%s} \
2427 %{mmcu=attiny26:crttn26.o%s} \
2428 %{mmcu=at90s4433:crts4433.o%s} \
2429 %{mmcu=at90s4414:crts4414.o%s} \
2430 %{mmcu=at90s4434:crts4434.o%s} \
2431 %{mmcu=at90c8534:crtc8534.o%s} \
2432 %{mmcu=at90s8535:crts8535.o%s} \
2433 %{mmcu=at86rf401:crt86401.o%s} \
2434 %{mmcu=atmega103|mmcu=avr3:crtm103.o%s} \
2435 %{mmcu=atmega603:crtm603.o%s} \
2436 %{mmcu=at43usb320:crt43320.o%s} \
2437 %{mmcu=at43usb355:crt43355.o%s} \
2438 %{mmcu=at76c711:crt76711.o%s} \
2439 %{mmcu=atmega8|mmcu=avr4:crtm8.o%s} \
2440 %{mmcu=atmega8515:crtm8515.o%s} \
2441 %{mmcu=atmega8535:crtm8535.o%s} \
2442 %{mmcu=atmega16:crtm16.o%s} \
2443 %{mmcu=atmega161|mmcu=avr5:crtm161.o%s} \
2444 %{mmcu=atmega162:crtm162.o%s} \
2445 %{mmcu=atmega163:crtm163.o%s} \
2446 %{mmcu=atmega169:crtm169.o%s} \
2447 %{mmcu=atmega32:crtm32.o%s} \
2448 %{mmcu=atmega323:crtm323.o%s} \
2449 %{mmcu=atmega64:crtm64.o%s} \
2450 %{mmcu=atmega128:crtm128.o%s} \
2451 %{mmcu=at94k:crtat94k.o%s}"
2453 #define EXTRA_SPECS {"crt_binutils", CRT_BINUTILS_SPECS},
2455 /* Define this macro to provide additional specifications to put in
2456 the `specs' file that can be used in various specifications like
2457 `CC1_SPEC'. */
2459 /* This is the default without any -mmcu=* option (AT90S*). */
2460 #define MULTILIB_DEFAULTS { "mmcu=avr2" }
2462 /* This is undefined macro for collect2 disabling */
2463 #define LINKER_NAME "ld"
2465 #define TEST_HARD_REG_CLASS(CLASS, REGNO) \
2466 TEST_HARD_REG_BIT (reg_class_contents[ (int) (CLASS)], REGNO)
2468 /* Note that the other files fail to use these
2469 in some of the places where they should. */
2471 #if defined(__STDC__) || defined(ALMOST_STDC)
2472 #define AS2(a,b,c) #a " " #b "," #c
2473 #define AS2C(b,c) " " #b "," #c
2474 #define AS3(a,b,c,d) #a " " #b "," #c "," #d
2475 #define AS1(a,b) #a " " #b
2476 #else
2477 #define AS1(a,b) "a b"
2478 #define AS2(a,b,c) "a b,c"
2479 #define AS2C(b,c) " b,c"
2480 #define AS3(a,b,c,d) "a b,c,d"
2481 #endif
2482 #define OUT_AS1(a,b) output_asm_insn (AS1(a,b), operands)
2483 #define OUT_AS2(a,b,c) output_asm_insn (AS2(a,b,c), operands)
2484 #define CR_TAB "\n\t"
2486 /* Define this macro as a C statement that declares additional library
2487 routines renames existing ones. `init_optabs' calls this macro
2488 after initializing all the normal library routines. */
2490 #define INIT_TARGET_OPTABS \
2492 avr_init_once (); \
2495 /* Temporary register r0 */
2496 #define TMP_REGNO 0
2498 /* zero register r1 */
2499 #define ZERO_REGNO 1
2501 /* Temporary register which used for load immediate values to r0-r15 */
2502 #define LDI_REG_REGNO 31
2504 extern struct rtx_def *tmp_reg_rtx;
2505 extern struct rtx_def *zero_reg_rtx;
2506 extern struct rtx_def *ldi_reg_rtx;
2508 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
2510 /* Get the standard ELF stabs definitions. */
2511 #include "dbxelf.h"