1 /* Definitions of target machine for Mitsubishi D30V.
2 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc.
4 Contributed by Cygnus Solutions.
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
25 /* D30V specific macros */
27 /* Align an address */
28 #define D30V_ALIGN(addr,align) (((addr) + (align) - 1) & ~((align) - 1))
31 /* Driver configuration */
33 /* Defined in svr4.h. */
34 /* #define SWITCH_TAKES_ARG(CHAR) */
36 /* Defined in svr4.h. */
37 /* #define WORD_SWITCH_TAKES_ARG(NAME) */
39 /* Defined in svr4.h. */
42 %{!mno-asm-optimize: %{O*: %{!O0: -O} %{O0: %{masm-optimize: -O}}}} \
43 %{v} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
45 /* Defined in svr4.h. */
46 /* #define ASM_FINAL_SPEC "" */
48 /* Defined in svr4.h. */
53 %{static:-dn -Bstatic} \
54 %{shared:-G -dy -z text} \
55 %{symbolic:-Bsymbolic -G -dy -z text} \
59 %{mextmem: -m d30v_e} %{mextmemory: -m d30v_e} %{monchip: -m d30v_o}"
61 /* Defined in svr4.h. */
63 #define LIB_SPEC "--start-group -lsim -lc --end-group"
65 /* Defined in svr4.h. */
67 #define STARTFILE_SPEC "crt0%O%s crtbegin%O%s"
69 /* Defined in svr4.h. */
71 #define ENDFILE_SPEC "crtend%O%s"
73 /* Defined in svr4.h for host compilers. */
74 /* #define MD_EXEC_PREFIX "" */
76 /* Defined in svr4.h for host compilers. */
77 /* #define MD_STARTFILE_PREFIX "" */
80 /* Run-time target specifications */
82 #define CPP_PREDEFINES "-D__D30V__ -Amachine=d30v"
84 /* This declaration should be present. */
85 extern int target_flags;
87 #define MASK_NO_COND_MOVE 0x00000001 /* disable conditional moves */
89 #define MASK_DEBUG_ARG 0x10000000 /* debug argument handling */
90 #define MASK_DEBUG_STACK 0x20000000 /* debug stack allocations */
91 #define MASK_DEBUG_ADDR 0x40000000 /* debug GO_IF_LEGITIMATE_ADDRESS */
93 #define TARGET_NO_COND_MOVE (target_flags & MASK_NO_COND_MOVE)
94 #define TARGET_DEBUG_ARG (target_flags & MASK_DEBUG_ARG)
95 #define TARGET_DEBUG_STACK (target_flags & MASK_DEBUG_STACK)
96 #define TARGET_DEBUG_ADDR (target_flags & MASK_DEBUG_ADDR)
98 #define TARGET_COND_MOVE (! TARGET_NO_COND_MOVE)
100 /* Default switches used. */
101 #ifndef TARGET_DEFAULT
102 #define TARGET_DEFAULT 0
105 #define TARGET_SWITCHES \
107 { "cond-move", -MASK_NO_COND_MOVE, \
108 N_("Enable use of conditional move instructions") }, \
110 { "no-cond-move", MASK_NO_COND_MOVE, \
111 N_("Disable use of conditional move instructions") }, \
113 { "debug-arg", MASK_DEBUG_ARG, \
114 N_("Debug argument support in compiler") }, \
116 { "debug-stack", MASK_DEBUG_STACK, \
117 N_("Debug stack support in compiler") }, \
119 { "debug-addr", MASK_DEBUG_ADDR, \
120 N_("Debug memory address support in compiler") }, \
122 { "asm-optimize", 0, \
123 N_("Make adjacent short instructions parallel if possible") }, \
125 { "no-asm-optimize", 0, \
126 N_("Do not make adjacent short instructions parallel") }, \
129 N_("Link programs/data to be in external memory by default") }, \
132 N_("Link programs/data to be in external memory by default") }, \
135 N_("Link programs/data to be in onchip memory by default") }, \
137 { "", TARGET_DEFAULT, "" }, \
140 #define TARGET_OPTIONS \
142 {"branch-cost=", &d30v_branch_cost_string, \
143 N_("Change the branch costs within the compiler") }, \
145 {"cond-exec=", &d30v_cond_exec_string, \
146 N_("Change the threshold for conversion to conditional execution") }, \
149 #define TARGET_VERSION fprintf (stderr, " d30v")
151 #define OVERRIDE_OPTIONS override_options ()
153 #define CAN_DEBUG_WITHOUT_FP
158 #define BITS_BIG_ENDIAN 1
160 #define BYTES_BIG_ENDIAN 1
162 #define WORDS_BIG_ENDIAN 1
164 #define UNITS_PER_WORD 4
166 #define POINTER_SIZE 32
168 #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
170 if (GET_MODE_CLASS (MODE) == MODE_INT \
171 && GET_MODE_SIZE (MODE) < 4) \
175 #define PARM_BOUNDARY 32
177 #define STACK_BOUNDARY 64
179 #define FUNCTION_BOUNDARY 64
181 #define BIGGEST_ALIGNMENT 64
183 /* Defined in svr4.h. */
184 /* #define MAX_OFILE_ALIGNMENT */
186 #define DATA_ALIGNMENT(TYPE, ALIGN) \
187 (TREE_CODE (TYPE) == ARRAY_TYPE \
188 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
189 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
191 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
192 (TREE_CODE (EXP) == STRING_CST \
193 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
195 #define STRICT_ALIGNMENT 1
197 /* Defined in svr4.h. */
199 #define PCC_BITFIELD_TYPE_MATTERS 1
201 #define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
204 /* Layout of Source Language Data Types */
206 #define INT_TYPE_SIZE 32
208 #define SHORT_TYPE_SIZE 16
210 #define LONG_TYPE_SIZE 32
212 #define LONG_LONG_TYPE_SIZE 64
214 #define FLOAT_TYPE_SIZE 32
216 #define DOUBLE_TYPE_SIZE 64
218 #define LONG_DOUBLE_TYPE_SIZE 64
220 #define DEFAULT_SIGNED_CHAR 1
222 /* Defined in svr4.h. */
223 /* #define SIZE_TYPE */
225 /* Defined in svr4.h. */
226 /* #define PTRDIFF_TYPE */
228 /* Defined in svr4.h. */
229 /* #define WCHAR_TYPE */
231 /* Defined in svr4.h. */
232 /* #define WCHAR_TYPE_SIZE */
235 /* D30V register layout. */
237 /* Return true if a value is inside a range */
238 #define IN_RANGE_P(VALUE, LOW, HIGH) \
239 (((unsigned)((VALUE) - (LOW))) <= ((unsigned)((HIGH) - (LOW))))
241 /* General purpose registers. */
242 #define GPR_FIRST 0 /* First gpr */
243 #define GPR_LAST (GPR_FIRST + 63) /* Last gpr */
244 #define GPR_R0 GPR_FIRST /* R0, constant 0 */
245 #define GPR_ARG_FIRST (GPR_FIRST + 2) /* R2, first argument reg */
246 #define GPR_ARG_LAST (GPR_FIRST + 17) /* R17, last argument reg */
247 #define GPR_RET_VALUE GPR_ARG_FIRST /* R2, function return reg */
248 #define GPR_ATMP_FIRST (GPR_FIRST + 20) /* R20, tmp to save accs */
249 #define GPR_ATMP_LAST (GPR_FIRST + 21) /* R21, tmp to save accs */
250 #define GPR_STACK_TMP (GPR_FIRST + 22) /* R22, tmp for saving stack */
251 #define GPR_RES_FIRST (GPR_FIRST + 32) /* R32, first reserved reg */
252 #define GPR_RES_LAST (GPR_FIRST + 35) /* R35, last reserved reg */
253 #define GPR_FP (GPR_FIRST + 61) /* Frame pointer */
254 #define GPR_LINK (GPR_FIRST + 62) /* Return address register */
255 #define GPR_SP (GPR_FIRST + 63) /* Stack pointer */
257 /* Argument register that is eliminated in favor of the frame and/or stack
258 pointer. Also add register to point to where the return address is
260 #define SPECIAL_REG_FIRST (GPR_LAST + 1)
261 #define SPECIAL_REG_LAST (SPECIAL_REG_FIRST)
262 #define ARG_POINTER_REGNUM (SPECIAL_REG_FIRST + 0)
263 #define SPECIAL_REG_P(R) ((R) == SPECIAL_REG_FIRST)
265 #define GPR_OR_SPECIAL_REG_P(R) IN_RANGE_P (R, GPR_FIRST, SPECIAL_REG_LAST)
266 #define GPR_P(R) IN_RANGE_P (R, GPR_FIRST, GPR_LAST)
267 #define GPR_OR_PSEUDO_P(R) (GPR_OR_SPECIAL_REG_P (R) \
268 || (R) >= FIRST_PSEUDO_REGISTER)
271 #define FLAG_FIRST (SPECIAL_REG_LAST + 1) /* First flag */
272 #define FLAG_LAST (FLAG_FIRST + 7) /* Last flag */
273 #define FLAG_F0 (FLAG_FIRST) /* F0, used in prediction */
274 #define FLAG_F1 (FLAG_FIRST + 1) /* F1, used in prediction */
275 #define FLAG_F2 (FLAG_FIRST + 2) /* F2, general flag */
276 #define FLAG_F3 (FLAG_FIRST + 3) /* F3, general flag */
277 #define FLAG_SAT (FLAG_FIRST + 4) /* F4, saturation flag */
278 #define FLAG_OVERFLOW (FLAG_FIRST + 5) /* F5, overflow flag */
279 #define FLAG_ACC_OVER (FLAG_FIRST + 6) /* F6, accumulated overflow */
280 #define FLAG_CARRY (FLAG_FIRST + 7) /* F7, carry/borrow flag */
281 #define FLAG_BORROW FLAG_CARRY
283 #define FLAG_P(R) IN_RANGE_P (R, FLAG_FIRST, FLAG_LAST)
284 #define FLAG_OR_PSEUDO_P(R) (FLAG_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
286 #define BR_FLAG_P(R) IN_RANGE_P (R, FLAG_F0, FLAG_F1)
287 #define BR_FLAG_OR_PSEUDO_P(R) (BR_FLAG_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
290 #define ACCUM_FIRST (FLAG_LAST + 1) /* First accumulator */
291 #define ACCUM_A0 ACCUM_FIRST /* Register A0 */
292 #define ACCUM_A1 (ACCUM_FIRST + 1) /* Register A1 */
293 #define ACCUM_LAST (ACCUM_FIRST + 1) /* Last accumulator */
295 #define ACCUM_P(R) IN_RANGE_P (R, ACCUM_FIRST, ACCUM_LAST)
296 #define ACCUM_OR_PSEUDO_P(R) (ACCUM_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
298 /* Special registers. Note, we only define the registers that can actually
300 #define CR_FIRST (ACCUM_LAST + 1) /* First CR */
301 #define CR_LAST (CR_FIRST + 14) /* Last CR */
302 #define CR_PSW (CR_FIRST + 0) /* CR0, Program status word */
303 #define CR_BPSW (CR_FIRST + 1) /* CR1, Backup PSW */
304 #define CR_PC (CR_FIRST + 2) /* CR2, Program counter */
305 #define CR_BPC (CR_FIRST + 3) /* CR3, Backup PC */
306 #define CR_DPSW (CR_FIRST + 4) /* CR4, Debug PSW */
307 #define CR_DPC (CR_FIRST + 5) /* CR5, Debug PC */
308 #define CR_RPT_C (CR_FIRST + 6) /* CR7, loop count register */
309 #define CR_RPT_S (CR_FIRST + 7) /* CR8, loop start address */
310 #define CR_RPT_E (CR_FIRST + 8) /* CR9, loop end address */
311 #define CR_MOD_S (CR_FIRST + 9) /* CR10, modulo address start*/
312 #define CR_MOD_E (CR_FIRST + 10) /* CR11, modulo address */
313 #define CR_IBA (CR_FIRST + 11) /* CR14, Interrupt break addr */
314 #define CR_EIT_VB (CR_FIRST + 12) /* CR15, EIT vector address */
315 #define CR_INT_S (CR_FIRST + 13) /* CR16, Interrupt status */
316 #define CR_INT_M (CR_FIRST + 14) /* CR17, Interrupt mask */
318 #define CR_P(R) IN_RANGE_P (R, CR_FIRST, CR_LAST)
319 #define CR_OR_PSEUDO_P(R) (CR_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
322 /* Register Basics */
324 /* Number of hardware registers known to the compiler. They receive numbers 0
325 through `FIRST_PSEUDO_REGISTER-1'; thus, the first pseudo register's number
326 really is assigned the number `FIRST_PSEUDO_REGISTER'. */
327 #define FIRST_PSEUDO_REGISTER (CR_LAST + 1)
329 /* An initializer that says which registers are used for fixed purposes all
330 throughout the compiled code and are therefore not available for general
331 allocation. These would include the stack pointer, the frame pointer
332 (except on machines where that can be used as a general register when no
333 frame pointer is needed), the program counter on machines where that is
334 considered one of the addressable registers, and any other numbered register
337 This information is expressed as a sequence of numbers, separated by commas
338 and surrounded by braces. The Nth number is 1 if register N is fixed, 0
341 The table initialized from this macro, and the table initialized by the
342 following one, may be overridden at run time either automatically, by the
343 actions of the macro `CONDITIONAL_REGISTER_USAGE', or by the user with the
344 command options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. */
345 #define FIXED_REGISTERS \
347 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* R0 - R15 */ \
348 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, /* R16 - R31 */ \
349 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* R32 - R47 */ \
350 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* R48 - R63 */ \
352 0, 0, 0, 0, 1, 1, 1, 1, /* F0 - F7 */ \
353 0, 0, /* A0 - A1 */ \
354 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* CRs */ \
357 /* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered (in
358 general) by function calls as well as for fixed registers. This macro
359 therefore identifies the registers that are not available for general
360 allocation of values that must live across function calls.
362 If a register has 0 in `CALL_USED_REGISTERS', the compiler automatically
363 saves it on function entry and restores it on function exit, if the register
364 is used within the function. */
365 #define CALL_USED_REGISTERS \
367 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* R0 - R15 */ \
368 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* R16 - R31 */ \
369 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* R32 - R47 */ \
370 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* R48 - R63 */ \
372 1, 1, 1, 1, 1, 1, 1, 1, /* F0 - F7 */ \
373 1, 0, /* A0 - A1 */ \
374 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* CRs */ \
377 /* Zero or more C statements that may conditionally modify two variables
378 `fixed_regs' and `call_used_regs' (both of type `char []') after they have
379 been initialized from the two preceding macros.
381 This is necessary in case the fixed or call-clobbered registers depend on
384 You need not define this macro if it has no work to do.
386 If the usage of an entire class of registers depends on the target flags,
387 you may indicate this to GCC by using this macro to modify `fixed_regs' and
388 `call_used_regs' to 1 for each of the registers in the classes which should
389 not be used by GCC. Also define the macro `REG_CLASS_FROM_LETTER' to return
390 `NO_REGS' if it is called with a letter for a class that shouldn't be used.
392 (However, if this class is not included in `GENERAL_REGS' and all of the
393 insn patterns whose constraints permit this class are controlled by target
394 switches, then GCC will automatically avoid using these registers when the
395 target switches are opposed to them.) */
396 /* #define CONDITIONAL_REGISTER_USAGE */
398 /* If this macro is defined and has a nonzero value, it means that `setjmp' and
399 related functions fail to save the registers, or that `longjmp' fails to
400 restore them. To compensate, the compiler avoids putting variables in
401 registers in functions that use `setjmp'. */
402 /* #define NON_SAVING_SETJMP */
404 /* Define this macro if the target machine has register windows. This C
405 expression returns the register number as seen by the called function
406 corresponding to the register number OUT as seen by the calling function.
407 Return OUT if register number OUT is not an outbound register. */
408 /* #define INCOMING_REGNO(OUT) */
410 /* Define this macro if the target machine has register windows. This C
411 expression returns the register number as seen by the calling function
412 corresponding to the register number IN as seen by the called function.
413 Return IN if register number IN is not an inbound register. */
414 /* #define OUTGOING_REGNO(IN) */
417 /* Order of allocation of registers */
419 /* If defined, an initializer for a vector of integers, containing the numbers
420 of hard registers in the order in which GNU CC should prefer to use them
421 (from most preferred to least).
423 If this macro is not defined, registers are used lowest numbered first (all
426 One use of this macro is on machines where the highest numbered registers
427 must always be saved and the save-multiple-registers instruction supports
428 only sequences of consecutive registers. On such machines, define
429 `REG_ALLOC_ORDER' to be an initializer that lists the highest numbered
430 allocatable register first. */
432 #define REG_ALLOC_ORDER \
434 /* volatile registers */ \
435 GPR_FIRST + 2, GPR_FIRST + 3, GPR_FIRST + 4, GPR_FIRST + 5, \
436 GPR_FIRST + 6, GPR_FIRST + 7, GPR_FIRST + 8, GPR_FIRST + 9, \
437 GPR_FIRST + 10, GPR_FIRST + 11, GPR_FIRST + 12, GPR_FIRST + 13, \
438 GPR_FIRST + 14, GPR_FIRST + 15, GPR_FIRST + 16, GPR_FIRST + 17, \
439 GPR_FIRST + 18, GPR_FIRST + 19, GPR_FIRST + 20, GPR_FIRST + 21, \
440 GPR_FIRST + 22, GPR_FIRST + 23, GPR_FIRST + 24, GPR_FIRST + 25, \
443 /* saved registers */ \
444 GPR_FIRST + 34, GPR_FIRST + 35, GPR_FIRST + 36, GPR_FIRST + 37, \
445 GPR_FIRST + 38, GPR_FIRST + 39, GPR_FIRST + 40, GPR_FIRST + 41, \
446 GPR_FIRST + 42, GPR_FIRST + 43, GPR_FIRST + 44, GPR_FIRST + 45, \
447 GPR_FIRST + 46, GPR_FIRST + 47, GPR_FIRST + 48, GPR_FIRST + 49, \
448 GPR_FIRST + 50, GPR_FIRST + 51, GPR_FIRST + 52, GPR_FIRST + 53, \
449 GPR_FIRST + 54, GPR_FIRST + 55, GPR_FIRST + 56, GPR_FIRST + 57, \
450 GPR_FIRST + 58, GPR_FIRST + 59, GPR_FIRST + 60, GPR_FIRST + 61, \
454 FLAG_F2, FLAG_F3, FLAG_F0, FLAG_F1, \
455 FLAG_SAT, FLAG_OVERFLOW, FLAG_ACC_OVER, FLAG_CARRY, \
458 ACCUM_FIRST + 0, ACCUM_FIRST + 1, \
460 /* fixed registers */ \
461 GPR_FIRST + 0, GPR_FIRST + 26, GPR_FIRST + 27, GPR_FIRST + 28, \
462 GPR_FIRST + 29, GPR_FIRST + 30, GPR_FIRST + 31, GPR_FIRST + 32, \
463 GPR_FIRST + 33, GPR_FIRST + 63, \
464 CR_PSW, CR_BPSW, CR_PC, CR_BPC, \
465 CR_DPSW, CR_DPC, CR_RPT_C, CR_RPT_S, \
466 CR_RPT_E, CR_MOD_S, CR_MOD_E, CR_IBA, \
467 CR_EIT_VB, CR_INT_S, CR_INT_M, \
468 ARG_POINTER_REGNUM, \
471 /* A C statement (sans semicolon) to choose the order in which to allocate hard
472 registers for pseudo-registers local to a basic block.
474 Store the desired register order in the array `reg_alloc_order'. Element 0
475 should be the register to allocate first; element 1, the next register; and
478 The macro body should not assume anything about the contents of
479 `reg_alloc_order' before execution of the macro.
481 On most machines, it is not necessary to define this macro. */
482 /* #define ORDER_REGS_FOR_LOCAL_ALLOC */
485 /* How Values Fit in Registers */
487 /* A C expression for the number of consecutive hard registers, starting at
488 register number REGNO, required to hold a value of mode MODE.
490 On a machine where all registers are exactly one word, a suitable definition
493 #define HARD_REGNO_NREGS(REGNO, MODE) \
494 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
495 / UNITS_PER_WORD)) */
497 #define HARD_REGNO_NREGS(REGNO, MODE) \
498 (ACCUM_P (REGNO) ? ((GET_MODE_SIZE (MODE) + 2*UNITS_PER_WORD - 1) \
499 / (2*UNITS_PER_WORD)) \
500 : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
503 /* A C expression that is nonzero if it is permissible to store a value of mode
504 MODE in hard register number REGNO (or in several registers starting with
505 that one). For a machine where all registers are equivalent, a suitable
508 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
510 It is not necessary for this macro to check for the numbers of fixed
511 registers, because the allocation mechanism considers them to be always
514 On some machines, double-precision values must be kept in even/odd register
515 pairs. The way to implement that is to define this macro to reject odd
516 register numbers for such modes.
518 The minimum requirement for a mode to be OK in a register is that the
519 `movMODE' instruction pattern support moves between the register and any
520 other hard register for which the mode is OK; and that moving a value into
521 the register and back out not alter it.
523 Since the same instruction used to move `SImode' will work for all narrower
524 integer modes, it is not necessary on any machine for `HARD_REGNO_MODE_OK'
525 to distinguish between these modes, provided you define patterns `movhi',
526 etc., to take advantage of this. This is useful because of the interaction
527 between `HARD_REGNO_MODE_OK' and `MODES_TIEABLE_P'; it is very desirable for
528 all integer modes to be tieable.
530 Many machines have special registers for floating point arithmetic. Often
531 people assume that floating point machine modes are allowed only in floating
532 point registers. This is not true. Any registers that can hold integers
533 can safely *hold* a floating point machine mode, whether or not floating
534 arithmetic can be done on it in those registers. Integer move instructions
535 can be used to move the values.
537 On some machines, though, the converse is true: fixed-point machine modes
538 may not go in floating registers. This is true if the floating registers
539 normalize any value stored in them, because storing a non-floating value
540 there would garble it. In this case, `HARD_REGNO_MODE_OK' should reject
541 fixed-point machine modes in floating registers. But if the floating
542 registers do not automatically normalize, if you can store any bit pattern
543 in one and retrieve it unchanged without a trap, then any machine mode may
544 go in a floating register, so you can define this macro to say so.
546 The primary significance of special floating registers is rather that they
547 are the registers acceptable in floating point arithmetic instructions.
548 However, this is of no concern to `HARD_REGNO_MODE_OK'. You handle it by
549 writing the proper constraints for those instructions.
551 On some machines, the floating registers are especially slow to access, so
552 that it is better to store a value in a stack frame than in such a register
553 if floating point arithmetic is not being done. As long as the floating
554 registers are not in class `GENERAL_REGS', they will not be used unless some
555 pattern's constraint asks for one. */
557 extern unsigned char hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
558 #define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok[ (int)MODE ][ REGNO ]
560 /* A C expression that is nonzero if it is desirable to choose register
561 allocation so as to avoid move instructions between a value of mode MODE1
562 and a value of mode MODE2.
564 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are
565 ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be
568 extern unsigned char modes_tieable_p[];
569 #define MODES_TIEABLE_P(MODE1, MODE2) \
570 modes_tieable_p[ (((int)(MODE1)) * (NUM_MACHINE_MODES)) + (int)(MODE2) ]
572 /* Define this macro if the compiler should avoid copies to/from CCmode
573 registers. You should only define this macro if support fo copying to/from
574 CCmode is incomplete. */
576 /* On the D30V, copying to/from CCmode is complete, but since there are only
577 two CC registers usable for conditional tests, this helps gcse not compound
578 the reload problem. */
579 #define AVOID_CCMODE_COPIES
582 /* Handling Leaf Functions */
584 /* A C initializer for a vector, indexed by hard register number, which
585 contains 1 for a register that is allowable in a candidate for leaf function
588 If leaf function treatment involves renumbering the registers, then the
589 registers marked here should be the ones before renumbering--those that GNU
590 CC would ordinarily allocate. The registers which will actually be used in
591 the assembler code, after renumbering, should not be marked with 1 in this
594 Define this macro only if the target machine offers a way to optimize the
595 treatment of leaf functions. */
596 /* #define LEAF_REGISTERS */
598 /* A C expression whose value is the register number to which REGNO should be
599 renumbered, when a function is treated as a leaf function.
601 If REGNO is a register number which should not appear in a leaf function
602 before renumbering, then the expression should yield -1, which will cause
603 the compiler to abort.
605 Define this macro only if the target machine offers a way to optimize the
606 treatment of leaf functions, and registers need to be renumbered to do this. */
607 /* #define LEAF_REG_REMAP(REGNO) */
610 /* Registers That Form a Stack. */
612 /* Define this if the machine has any stack-like registers. */
613 /* #define STACK_REGS */
615 /* The number of the first stack-like register. This one is the top
617 /* #define FIRST_STACK_REG */
619 /* The number of the last stack-like register. This one is the
620 bottom of the stack. */
621 /* #define LAST_STACK_REG */
624 /* Register Classes */
626 /* An enumeral type that must be defined with all the register class names as
627 enumeral values. `NO_REGS' must be first. `ALL_REGS' must be the last
628 register class, followed by one more enumeral value, `LIM_REG_CLASSES',
629 which is not a register class but rather tells how many classes there are.
631 Each register class has a number, which is the value of casting the class
632 name to type `int'. The number serves as an index in many of the tables
651 #define GENERAL_REGS GPR_REGS
653 /* The number of distinct register classes, defined as follows:
655 #define N_REG_CLASSES (int) LIM_REG_CLASSES */
656 #define N_REG_CLASSES ((int) LIM_REG_CLASSES)
658 /* An initializer containing the names of the register classes as C string
659 constants. These names are used in writing some of the debugging dumps. */
660 #define REG_CLASS_NAMES \
676 /* Create mask bits for 3rd word of REG_CLASS_CONTENTS */
677 #define MASK_WORD3(REG) ((long)1 << ((REG) - 64))
680 #define REPEAT_MASK MASK_WORD3 (CR_RPT_C)
681 #define CR_MASK (MASK_WORD3 (CR_PSW) | MASK_WORD3 (CR_BPSW) \
682 | MASK_WORD3 (CR_PC) | MASK_WORD3 (CR_BPC) \
683 | MASK_WORD3 (CR_DPSW) | MASK_WORD3 (CR_DPC) \
684 | MASK_WORD3 (CR_RPT_C) | MASK_WORD3 (CR_RPT_S) \
685 | MASK_WORD3 (CR_RPT_E) | MASK_WORD3 (CR_MOD_S) \
686 | MASK_WORD3 (CR_MOD_E) | MASK_WORD3 (CR_IBA) \
687 | MASK_WORD3 (CR_EIT_VB) | MASK_WORD3 (CR_INT_S) \
688 | MASK_WORD3 (CR_INT_M))
690 #define ACCUM_MASK (MASK_WORD3 (ACCUM_A0) | MASK_WORD3 (ACCUM_A1))
691 #define OTHER_FLAG_MASK (MASK_WORD3 (FLAG_F2) | MASK_WORD3 (FLAG_F3) \
692 | MASK_WORD3 (FLAG_SAT) | MASK_WORD3 (FLAG_OVERFLOW) \
693 | MASK_WORD3 (FLAG_ACC_OVER) | MASK_WORD3 (FLAG_CARRY))
695 #define F0_MASK MASK_WORD3 (FLAG_F0)
696 #define F1_MASK MASK_WORD3 (FLAG_F1)
697 #define BR_FLAG_MASK (F0_MASK | F1_MASK)
698 #define FLAG_MASK (BR_FLAG_MASK | OTHER_FLAG_MASK)
699 #define SPECIAL_MASK MASK_WORD3 (ARG_POINTER_REGNUM)
701 #define ALL_MASK (CR_MASK | ACCUM_MASK | FLAG_MASK | SPECIAL_MASK)
703 /* An initializer containing the contents of the register classes, as integers
704 which are bit masks. The Nth integer specifies the contents of class N.
705 The way the integer MASK is interpreted is that register R is in the class
706 if `MASK & (1 << R)' is 1.
708 When the machine has more than 32 registers, an integer does not suffice.
709 Then the integers are replaced by sub-initializers, braced groupings
710 containing several integers. Each sub-initializer must be suitable as an
711 initializer for the type `HARD_REG_SET' which is defined in
713 #define REG_CLASS_CONTENTS \
715 { 0x00000000, 0x00000000, NO_MASK }, /* NO_REGS */ \
716 { 0x00000000, 0x00000000, REPEAT_MASK }, /* REPEAT_REGS */ \
717 { 0x00000000, 0x00000000, CR_MASK }, /* CR_REGS */ \
718 { 0x00000000, 0x00000000, ACCUM_MASK }, /* ACCUM_REGS */ \
719 { 0x00000000, 0x00000000, OTHER_FLAG_MASK }, /* OTHER_FLAG_REGS */ \
720 { 0x00000000, 0x00000000, F0_MASK }, /* F0_REGS */ \
721 { 0x00000000, 0x00000000, F1_MASK }, /* F1_REGS */ \
722 { 0x00000000, 0x00000000, BR_FLAG_MASK }, /* BR_FLAG_REGS */ \
723 { 0x00000000, 0x00000000, FLAG_MASK }, /* FLAG_REGS */ \
724 { 0xfffffffc, 0x3fffffff, NO_MASK }, /* EVEN_REGS */ \
725 { 0xffffffff, 0xffffffff, SPECIAL_MASK }, /* GPR_REGS */ \
726 { 0xffffffff, 0xffffffff, ALL_MASK }, /* ALL_REGS */ \
729 /* A C expression whose value is a register class containing hard register
730 REGNO. In general there is more than one such class; choose a class which
731 is "minimal", meaning that no smaller class also contains the register. */
733 extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
734 #define REGNO_REG_CLASS(REGNO) regno_reg_class[ (REGNO) ]
736 /* A macro whose definition is the name of the class to which a valid base
737 register must belong. A base register is one used in an address which is
738 the register value plus a displacement. */
739 #define BASE_REG_CLASS GPR_REGS
741 /* A macro whose definition is the name of the class to which a valid index
742 register must belong. An index register is one used in an address where its
743 value is either multiplied by a scale factor or added to another register
744 (as well as added to a displacement). */
745 #define INDEX_REG_CLASS GPR_REGS
747 /* A C expression which defines the machine-dependent operand constraint
748 letters for register classes. If CHAR is such a letter, the value should be
749 the register class corresponding to it. Otherwise, the value should be
750 `NO_REGS'. The register letter `r', corresponding to class `GENERAL_REGS',
751 will not be passed to this macro; you do not need to handle it.
753 The following letters are unavailable, due to being used as
758 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'
759 'Q', 'R', 'S', 'T', 'U'
761 'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */
763 extern enum reg_class reg_class_from_letter[256];
764 #define REG_CLASS_FROM_LETTER(CHAR) reg_class_from_letter[(unsigned char)(CHAR)]
766 /* A C expression which is nonzero if register number NUM is suitable for use
767 as a base register in operand addresses. It may be either a suitable hard
768 register or a pseudo register that has been allocated such a hard register. */
770 #define REGNO_OK_FOR_BASE_P(NUM) \
771 ((NUM) < FIRST_PSEUDO_REGISTER \
773 : (reg_renumber[NUM] >= 0 && GPR_P (reg_renumber[NUM])))
776 /* A C expression which is nonzero if register number NUM is suitable for use
777 as an index register in operand addresses. It may be either a suitable hard
778 register or a pseudo register that has been allocated such a hard register.
780 The difference between an index register and a base register is that the
781 index register may be scaled. If an address involves the sum of two
782 registers, neither one of them scaled, then either one may be labeled the
783 "base" and the other the "index"; but whichever labeling is used must fit
784 the machine's constraints of which registers may serve in each capacity.
785 The compiler will try both labelings, looking for one that is valid, and
786 will reload one or both registers only if neither labeling works. */
788 #define REGNO_OK_FOR_INDEX_P(NUM) \
789 ((NUM) < FIRST_PSEUDO_REGISTER \
791 : (reg_renumber[NUM] >= 0 && GPR_P (reg_renumber[NUM])))
793 /* A C expression that places additional restrictions on the register class to
794 use when it is necessary to copy value X into a register in class CLASS.
795 The value is a register class; perhaps CLASS, or perhaps another, smaller
796 class. On many machines, the following definition is safe:
798 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
800 Sometimes returning a more restrictive class makes better code. For
801 example, on the 68000, when X is an integer constant that is in range for a
802 `moveq' instruction, the value of this macro is always `DATA_REGS' as long
803 as CLASS includes the data registers. Requiring a data register guarantees
804 that a `moveq' will be used.
806 If X is a `const_double', by returning `NO_REGS' you can force X into a
807 memory constant. This is useful on certain machines where immediate
808 floating values cannot be loaded into certain kinds of registers. */
809 #define PREFERRED_RELOAD_CLASS(X, CLASS) CLASS
811 /* Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of input
812 reloads. If you don't define this macro, the default is to use CLASS,
814 /* #define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) */
816 /* A C expression that places additional restrictions on the register class to
817 use when it is necessary to be able to hold a value of mode MODE in a reload
818 register for which class CLASS would ordinarily be used.
820 Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when there are
821 certain modes that simply can't go in certain reload classes.
823 The value is a register class; perhaps CLASS, or perhaps another, smaller
826 Don't define this macro unless the target machine has limitations which
827 require the macro to do something nontrivial. */
828 /* #define LIMIT_RELOAD_CLASS(MODE, CLASS) */
830 /* Many machines have some registers that cannot be copied directly to or from
831 memory or even from other types of registers. An example is the `MQ'
832 register, which on most machines, can only be copied to or from general
833 registers, but not memory. Some machines allow copying all registers to and
834 from memory, but require a scratch register for stores to some memory
835 locations (e.g., those with symbolic address on the RT, and those with
836 certain symbolic address on the Sparc when compiling PIC). In some cases,
837 both an intermediate and a scratch register are required.
839 You should define these macros to indicate to the reload phase that it may
840 need to allocate at least one register for a reload in addition to the
841 register to contain the data. Specifically, if copying X to a register
842 CLASS in MODE requires an intermediate register, you should define
843 `SECONDARY_INPUT_RELOAD_CLASS' to return the largest register class all of
844 whose registers can be used as intermediate registers or scratch registers.
846 If copying a register CLASS in MODE to X requires an intermediate or scratch
847 register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be defined to return the
848 largest register class required. If the requirements for input and output
849 reloads are the same, the macro `SECONDARY_RELOAD_CLASS' should be used
850 instead of defining both macros identically.
852 The values returned by these macros are often `GENERAL_REGS'. Return
853 `NO_REGS' if no spare register is needed; i.e., if X can be directly copied
854 to or from a register of CLASS in MODE without requiring a scratch register.
855 Do not define this macro if it would always return `NO_REGS'.
857 If a scratch register is required (either with or without an intermediate
858 register), you should define patterns for `reload_inM' or `reload_outM', as
859 required (*note Standard Names::.. These patterns, which will normally be
860 implemented with a `define_expand', should be similar to the `movM'
861 patterns, except that operand 2 is the scratch register.
863 Define constraints for the reload register and scratch register that contain
864 a single register class. If the original reload register (whose class is
865 CLASS) can meet the constraint given in the pattern, the value returned by
866 these macros is used for the class of the scratch register. Otherwise, two
867 additional reload registers are required. Their classes are obtained from
868 the constraints in the insn pattern.
870 X might be a pseudo-register or a `subreg' of a pseudo-register, which could
871 either be in a hard register or in memory. Use `true_regnum' to find out;
872 it will return -1 if the pseudo is in memory and the hard register number if
875 These macros should not be used in the case where a particular class of
876 registers can only be copied to memory and not to another class of
877 registers. In that case, secondary reload registers are not needed and
878 would not be helpful. Instead, a stack location must be used to perform the
879 copy and the `movM' pattern should use memory as an intermediate storage.
880 This case often occurs between floating-point and general registers. */
882 #define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \
883 ((CLASS) == GPR_REGS ? NO_REGS \
884 : (CLASS) == EVEN_REGS ? NO_REGS \
885 : (CLASS) == ACCUM_REGS ? EVEN_REGS \
888 /* #define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) */
889 /* #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) */
891 /* Certain machines have the property that some registers cannot be copied to
892 some other registers without using memory. Define this macro on those
893 machines to be a C expression that is non-zero if objects of mode M in
894 registers of CLASS1 can only be copied to registers of class CLASS2 by
895 storing a register of CLASS1 into memory and loading that memory location
896 into a register of CLASS2.
898 Do not define this macro if its value would always be zero. */
899 /* #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, M) */
901 /* Normally when `SECONDARY_MEMORY_NEEDED' is defined, the compiler allocates a
902 stack slot for a memory location needed for register copies. If this macro
903 is defined, the compiler instead uses the memory location defined by this
906 Do not define this macro if you do not define
907 `SECONDARY_MEMORY_NEEDED'. */
908 /* #define SECONDARY_MEMORY_NEEDED_RTX(MODE) */
910 /* When the compiler needs a secondary memory location to copy between two
911 registers of mode MODE, it normally allocates sufficient memory to hold a
912 quantity of `BITS_PER_WORD' bits and performs the store and load operations
913 in a mode that many bits wide and whose class is the same as that of MODE.
915 This is right thing to do on most machines because it ensures that all bits
916 of the register are copied and prevents accesses to the registers in a
917 narrower mode, which some machines prohibit for floating-point registers.
919 However, this default behavior is not correct on some machines, such as the
920 DEC Alpha, that store short integers in floating-point registers differently
921 than in integer registers. On those machines, the default widening will not
922 work correctly and you must define this macro to suppress that widening in
923 some cases. See the file `alpha.h' for details.
925 Do not define this macro if you do not define `SECONDARY_MEMORY_NEEDED' or
926 if widening MODE to a mode that is `BITS_PER_WORD' bits wide is correct for
928 /* #define SECONDARY_MEMORY_NEEDED_MODE(MODE) */
930 /* Normally the compiler avoids choosing registers that have been explicitly
931 mentioned in the rtl as spill registers (these registers are normally those
932 used to pass parameters and return values). However, some machines have so
933 few registers of certain classes that there would not be enough registers to
934 use as spill registers if this were done.
936 Define `SMALL_REGISTER_CLASSES' to be an expression with a non-zero value on
937 these machines. When this macro has a non-zero value, the compiler allows
938 registers explicitly used in the rtl to be used as spill registers but
939 avoids extending the lifetime of these registers.
941 It is always safe to define this macro with a non-zero value, but if you
942 unnecessarily define it, you will reduce the amount of optimizations that
943 can be performed in some cases. If you do not define this macro with a
944 non-zero value when it is required, the compiler will run out of spill
945 registers and print a fatal error message. For most machines, you should
946 not define this macro at all. */
947 /* #define SMALL_REGISTER_CLASSES */
949 /* A C expression whose value is nonzero if pseudos that have been assigned to
950 registers of class CLASS would likely be spilled because registers of CLASS
951 are needed for spill registers.
953 The default value of this macro returns 1 if CLASS has exactly one register
954 and zero otherwise. On most machines, this default should be used. Only
955 define this macro to some other expression if pseudo allocated by
956 `local-alloc.c' end up in memory because their hard registers were needed
957 for spill registers. If this macro returns nonzero for those classes, those
958 pseudos will only be allocated by `global.c', which knows how to reallocate
959 the pseudo to another register. If there would not be another register
960 available for reallocation, you should not change the definition of this
961 macro since the only effect of such a definition would be to slow down
962 register allocation. */
963 #define CLASS_LIKELY_SPILLED_P(CLASS) \
964 ((CLASS) != GPR_REGS && (CLASS) != EVEN_REGS)
966 /* A C expression for the maximum number of consecutive registers of
967 class CLASS needed to hold a value of mode MODE.
969 This is closely related to the macro `HARD_REGNO_NREGS'. In fact, the value
970 of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be the maximum value of
971 `HARD_REGNO_NREGS (REGNO, MODE)' for all REGNO values in the class CLASS.
973 This macro helps control the handling of multiple-word values in
976 #define CLASS_MAX_NREGS(CLASS, MODE) \
977 (((CLASS) == ACCUM_REGS) \
978 ? ((GET_MODE_SIZE (MODE) + 8 - 1) / 8) \
979 : ((GET_MODE_SIZE (MODE) + 4 - 1) / 4))
981 /* A C expression that defines the machine-dependent operand constraint letters
982 (`I', `J', `K', .. 'P') that specify particular ranges of integer values.
983 If C is one of those letters, the expression should check that VALUE, an
984 integer, is in the appropriate range and return 1 if so, 0 otherwise. If C
985 is not one of those letters, the value should be 0 regardless of VALUE. */
986 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
987 ((C) == 'I' ? IN_RANGE_P (VALUE, -32, 31) \
988 : (C) == 'J' ? IN_RANGE_P (VALUE, 0, 31) \
989 : (C) == 'K' ? IN_RANGE_P (exact_log2 (VALUE), 0, 31) \
990 : (C) == 'L' ? IN_RANGE_P (exact_log2 (~ (VALUE)), 0, 31) \
991 : (C) == 'M' ? ((VALUE) == 32) \
992 : (C) == 'N' ? ((VALUE) == 1) \
993 : (C) == 'O' ? ((VALUE) == 0) \
994 : (C) == 'P' ? IN_RANGE_P (VALUE, 32, 63) \
997 /* A C expression that defines the machine-dependent operand constraint letters
998 (`G', `H') that specify particular ranges of `const_double' values.
1000 If C is one of those letters, the expression should check that VALUE, an RTX
1001 of code `const_double', is in the appropriate range and return 1 if so, 0
1002 otherwise. If C is not one of those letters, the value should be 0
1003 regardless of VALUE.
1005 `const_double' is used for all floating-point constants and for `DImode'
1006 fixed-point constants. A given letter can accept either or both kinds of
1007 values. It can use `GET_MODE' to distinguish between these kinds. */
1008 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
1009 ((C) == 'G' ? (CONST_DOUBLE_LOW (VALUE) == 0 \
1010 && CONST_DOUBLE_HIGH (VALUE) == 0) \
1011 : (C) == 'H' ? FALSE \
1014 /* A C expression that defines the optional machine-dependent constraint
1015 letters (`Q', `R', `S', `T', `U') that can be used to segregate specific
1016 types of operands, usually memory references, for the target machine.
1017 Normally this macro will not be defined. If it is required for a particular
1018 target machine, it should return 1 if VALUE corresponds to the operand type
1019 represented by the constraint letter C. If C is not defined as an extra
1020 constraint, the value returned should be 0 regardless of VALUE.
1022 For example, on the ROMP, load instructions cannot have their output in r0
1023 if the memory reference contains a symbolic address. Constraint letter `Q'
1024 is defined as representing a memory address that does *not* contain a
1025 symbolic address. An alternative is specified with a `Q' constraint on the
1026 input and `r' on the output. The next alternative specifies `m' on the
1027 input and a register class that does not include r0 on the output. */
1029 #define EXTRA_CONSTRAINT(VALUE, C) \
1030 (((C) == 'Q') ? short_memory_operand ((VALUE), GET_MODE (VALUE)) \
1031 : ((C) == 'R') ? single_reg_memory_operand ((VALUE), GET_MODE (VALUE)) \
1032 : ((C) == 'S') ? const_addr_memory_operand ((VALUE), GET_MODE (VALUE)) \
1033 : ((C) == 'T') ? long_memory_operand ((VALUE), GET_MODE (VALUE)) \
1034 : ((C) == 'U') ? FALSE \
1038 /* Basic Stack Layout */
1042 /* Structure used to define the d30v stack */
1043 typedef struct d30v_stack {
1044 int varargs_p; /* whether this is a varargs function */
1045 int varargs_size; /* size to hold varargs args passed in regs */
1046 int vars_size; /* variable save area size */
1047 int parm_size; /* outgoing parameter size */
1048 int gpr_size; /* size of saved GPR registers */
1049 int accum_size; /* size of saved ACCUM registers */
1050 int total_size; /* total bytes allocated for stack */
1051 /* which registers are to be saved */
1052 int save_offset; /* offset from new sp to start saving vars at */
1053 int link_offset; /* offset r62 is saved at */
1054 int memrefs_varargs; /* # of 2 word memory references for varargs */
1055 int memrefs_2words; /* # of 2 word memory references */
1056 int memrefs_1word; /* # of 1 word memory references */
1057 /* 1 for ldw/stw ops; 2 for ld2w/st2w ops */
1058 unsigned char save_p[FIRST_PSEUDO_REGISTER];
1061 /* Define this macro if pushing a word onto the stack moves the stack pointer
1062 to a smaller address.
1064 When we say, "define this macro if ...," it means that the compiler checks
1065 this macro only with `#ifdef' so the precise definition used does not
1067 #define STACK_GROWS_DOWNWARD 1
1069 /* Define this macro if the addresses of local variable slots are at negative
1070 offsets from the frame pointer. */
1071 /* #define FRAME_GROWS_DOWNWARD */
1073 /* Define this macro if successive arguments to a function occupy decreasing
1074 addresses on the stack. */
1075 /* #define ARGS_GROW_DOWNWARD */
1077 /* Offset from the frame pointer to the first local variable slot to be
1080 If `FRAME_GROWS_DOWNWARD', find the next slot's offset by subtracting the
1081 first slot's length from `STARTING_FRAME_OFFSET'. Otherwise, it is found by
1082 adding the length of the first slot to the value `STARTING_FRAME_OFFSET'. */
1084 #define STARTING_FRAME_OFFSET \
1085 (D30V_ALIGN (current_function_outgoing_args_size, \
1086 (STACK_BOUNDARY / BITS_PER_UNIT)))
1088 /* Offset from the stack pointer register to the first location at which
1089 outgoing arguments are placed. If not specified, the default value of zero
1090 is used. This is the proper value for most machines.
1092 If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first
1093 location at which outgoing arguments are placed. */
1094 /* #define STACK_POINTER_OFFSET */
1096 /* Offset from the argument pointer register to the first argument's address.
1097 On some machines it may depend on the data type of the function.
1099 If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first
1100 argument's address. */
1101 #define FIRST_PARM_OFFSET(FUNDECL) 0
1103 /* Offset from the stack pointer register to an item dynamically allocated on
1104 the stack, e.g., by `alloca'.
1106 The default value for this macro is `STACK_POINTER_OFFSET' plus the length
1107 of the outgoing arguments. The default is correct for most machines. See
1108 `function.c' for details. */
1109 /* #define STACK_DYNAMIC_OFFSET(FUNDECL) */
1111 /* A C expression whose value is RTL representing the address in a stack frame
1112 where the pointer to the caller's frame is stored. Assume that FRAMEADDR is
1113 an RTL expression for the address of the stack frame itself.
1115 If you don't define this macro, the default is to return the value of
1116 FRAMEADDR--that is, the stack frame address is also the address of the stack
1117 word that points to the previous frame. */
1118 /* #define DYNAMIC_CHAIN_ADDRESS(FRAMEADDR) */
1120 /* If defined, a C expression that produces the machine-specific code to setup
1121 the stack so that arbitrary frames can be accessed. For example, on the
1122 Sparc, we must flush all of the register windows to the stack before we can
1123 access arbitrary stack frames. This macro will seldom need to be defined. */
1124 /* #define SETUP_FRAME_ADDRESSES() */
1126 /* A C expression whose value is RTL representing the value of the return
1127 address for the frame COUNT steps up from the current frame, after the
1128 prologue. FRAMEADDR is the frame pointer of the COUNT frame, or the frame
1129 pointer of the COUNT - 1 frame if `RETURN_ADDR_IN_PREVIOUS_FRAME' is
1132 The value of the expression must always be the correct address when COUNT is
1133 zero, but may be `NULL_RTX' if there is not way to determine the return
1134 address of other frames. */
1136 /* ??? This definition fails for leaf functions. There is currently no
1137 general solution for this problem. */
1139 /* ??? There appears to be no way to get the return address of any previous
1140 frame except by disassembling instructions in the prologue/epilogue.
1141 So currently we support only the current frame. */
1143 #define RETURN_ADDR_RTX(COUNT, FRAME) \
1144 ((COUNT) == 0 ? d30v_return_addr() : const0_rtx)
1146 /* Define this if the return address of a particular stack frame is
1147 accessed from the frame pointer of the previous stack frame. */
1148 /* #define RETURN_ADDR_IN_PREVIOUS_FRAME */
1150 /* A C expression whose value is RTL representing the location of the incoming
1151 return address at the beginning of any function, before the prologue. This
1152 RTL is either a `REG', indicating that the return value is saved in `REG',
1153 or a `MEM' representing a location in the stack.
1155 You only need to define this macro if you want to support call frame
1156 debugging information like that provided by DWARF 2. */
1158 /* Before the prologue, RA lives in r62. */
1159 #define INCOMING_RETURN_ADDR_RTX gen_rtx (REG, Pmode, GPR_LINK)
1161 /* A C expression whose value is an integer giving the offset, in bytes, from
1162 the value of the stack pointer register to the top of the stack frame at the
1163 beginning of any function, before the prologue. The top of the frame is
1164 defined to be the value of the stack pointer in the previous frame, just
1165 before the call instruction.
1167 You only need to define this macro if you want to support call frame
1168 debugging information like that provided by DWARF 2. */
1169 #define INCOMING_FRAME_SP_OFFSET 0
1171 /* Initialize data used by insn expanders. This is called from insn_emit,
1172 once for every function before code is generated. */
1174 #define INIT_EXPANDERS d30v_init_expanders ()
1177 /* Stack Checking. */
1179 /* A nonzero value if stack checking is done by the configuration files in a
1180 machine-dependent manner. You should define this macro if stack checking is
1181 require by the ABI of your machine or if you would like to have to stack
1182 checking in some more efficient way than GNU CC's portable approach. The
1183 default value of this macro is zero. */
1184 /* #define STACK_CHECK_BUILTIN */
1186 /* An integer representing the interval at which GNU CC must generate stack
1187 probe instructions. You will normally define this macro to be no larger
1188 than the size of the "guard pages" at the end of a stack area. The default
1189 value of 4096 is suitable for most systems. */
1190 /* #define STACK_CHECK_PROBE_INTERVAL */
1192 /* An integer which is nonzero if GNU CC should perform the stack probe as a
1193 load instruction and zero if GNU CC should use a store instruction. The
1194 default is zero, which is the most efficient choice on most systems. */
1195 /* #define STACK_CHECK_PROBE_LOAD */
1197 /* The number of bytes of stack needed to recover from a stack overflow, for
1198 languages where such a recovery is supported. The default value of 75 words
1199 should be adequate for most machines. */
1200 /* #define STACK_CHECK_PROTECT */
1202 /* The maximum size of a stack frame, in bytes. GNU CC will generate probe
1203 instructions in non-leaf functions to ensure at least this many bytes of
1204 stack are available. If a stack frame is larger than this size, stack
1205 checking will not be reliable and GNU CC will issue a warning. The default
1206 is chosen so that GNU CC only generates one instruction on most systems.
1207 You should normally not change the default value of this macro. */
1208 /* #define STACK_CHECK_MAX_FRAME_SIZE */
1210 /* GNU CC uses this value to generate the above warning message. It represents
1211 the amount of fixed frame used by a function, not including space for any
1212 callee-saved registers, temporaries and user variables. You need only
1213 specify an upper bound for this amount and will normally use the default of
1215 /* #define STACK_CHECK_FIXED_FRAME_SIZE */
1217 /* The maximum size, in bytes, of an object that GNU CC will place in the fixed
1218 area of the stack frame when the user specifies `-fstack-check'. GNU CC
1219 computed the default from the values of the above macros and you will
1220 normally not need to override that default. */
1221 /* #define STACK_CHECK_MAX_VAR_SIZE */
1224 /* Register That Address the Stack Frame. */
1226 /* The register number of the stack pointer register, which must also be a
1227 fixed register according to `FIXED_REGISTERS'. On most machines, the
1228 hardware determines which register this is. */
1229 #define STACK_POINTER_REGNUM GPR_SP
1231 /* The register number of the frame pointer register, which is used to access
1232 automatic variables in the stack frame. On some machines, the hardware
1233 determines which register this is. On other machines, you can choose any
1234 register you wish for this purpose. */
1235 #define FRAME_POINTER_REGNUM GPR_FP
1237 /* On some machines the offset between the frame pointer and starting offset of
1238 the automatic variables is not known until after register allocation has
1239 been done (for example, because the saved registers are between these two
1240 locations). On those machines, define `FRAME_POINTER_REGNUM' the number of
1241 a special, fixed register to be used internally until the offset is known,
1242 and define `HARD_FRAME_POINTER_REGNUM' to be actual the hard register number
1243 used for the frame pointer.
1245 You should define this macro only in the very rare circumstances when it is
1246 not possible to calculate the offset between the frame pointer and the
1247 automatic variables until after register allocation has been completed.
1248 When this macro is defined, you must also indicate in your definition of
1249 `ELIMINABLE_REGS' how to eliminate `FRAME_POINTER_REGNUM' into either
1250 `HARD_FRAME_POINTER_REGNUM' or `STACK_POINTER_REGNUM'.
1252 Do not define this macro if it would be the same as `FRAME_POINTER_REGNUM'. */
1253 /* #define HARD_FRAME_POINTER_REGNUM */
1255 /* The register number of the arg pointer register, which is used to access the
1256 function's argument list. On some machines, this is the same as the frame
1257 pointer register. On some machines, the hardware determines which register
1258 this is. On other machines, you can choose any register you wish for this
1259 purpose. If this is not the same register as the frame pointer register,
1260 then you must mark it as a fixed register according to `FIXED_REGISTERS', or
1261 arrange to be able to eliminate it (*note Elimination::.). */
1262 /* #define ARG_POINTER_REGNUM */
1264 /* The register number of the return address pointer register, which is used to
1265 access the current function's return address from the stack. On some
1266 machines, the return address is not at a fixed offset from the frame pointer
1267 or stack pointer or argument pointer. This register can be defined to point
1268 to the return address on the stack, and then be converted by
1269 `ELIMINABLE_REGS' into either the frame pointer or stack pointer.
1271 Do not define this macro unless there is no other way to get the return
1272 address from the stack. */
1273 /* #define RETURN_ADDRESS_POINTER_REGNUM */
1275 /* Register numbers used for passing a function's static chain pointer. If
1276 register windows are used, the register number as seen by the called
1277 function is `STATIC_CHAIN_INCOMING_REGNUM', while the register number as
1278 seen by the calling function is `STATIC_CHAIN_REGNUM'. If these registers
1279 are the same, `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
1281 The static chain register need not be a fixed register.
1283 If the static chain is passed in memory, these macros should not be defined;
1284 instead, the next two macros should be defined. */
1286 #define STATIC_CHAIN_REGNUM (GPR_FIRST + 18)
1287 /* #define STATIC_CHAIN_INCOMING_REGNUM */
1289 /* If the static chain is passed in memory, these macros provide rtx giving
1290 `mem' expressions that denote where they are stored. `STATIC_CHAIN' and
1291 `STATIC_CHAIN_INCOMING' give the locations as seen by the calling and called
1292 functions, respectively. Often the former will be at an offset from the
1293 stack pointer and the latter at an offset from the frame pointer.
1295 The variables `stack_pointer_rtx', `frame_pointer_rtx', and
1296 `arg_pointer_rtx' will have been initialized prior to the use of these
1297 macros and should be used to refer to those items.
1299 If the static chain is passed in a register, the two previous
1300 macros should be defined instead. */
1301 /* #define STATIC_CHAIN */
1302 /* #define STATIC_CHAIN_INCOMING */
1305 /* Eliminating the Frame Pointer and the Arg Pointer */
1307 /* A C expression which is nonzero if a function must have and use a frame
1308 pointer. This expression is evaluated in the reload pass. If its value is
1309 nonzero the function will have a frame pointer.
1311 The expression can in principle examine the current function and decide
1312 according to the facts, but on most machines the constant 0 or the constant
1313 1 suffices. Use 0 when the machine allows code to be generated with no
1314 frame pointer, and doing so saves some time or space. Use 1 when there is
1315 no possible advantage to avoiding a frame pointer.
1317 In certain cases, the compiler does not know how to produce valid code
1318 without a frame pointer. The compiler recognizes those cases and
1319 automatically gives the function a frame pointer regardless of what
1320 `FRAME_POINTER_REQUIRED' says. You don't need to worry about them.
1322 In a function that does not require a frame pointer, the frame pointer
1323 register can be allocated for ordinary usage, unless you mark it as a fixed
1324 register. See `FIXED_REGISTERS' for more information. */
1325 #define FRAME_POINTER_REQUIRED 0
1327 /* A C statement to store in the variable DEPTH-VAR the difference between the
1328 frame pointer and the stack pointer values immediately after the function
1329 prologue. The value would be computed from information such as the result
1330 of `get_frame_size ()' and the tables of registers `regs_ever_live' and
1333 If `ELIMINABLE_REGS' is defined, this macro will be not be used and need not
1334 be defined. Otherwise, it must be defined even if `FRAME_POINTER_REQUIRED'
1335 is defined to always be true; in that case, you may set DEPTH-VAR to
1337 /* #define INITIAL_FRAME_POINTER_OFFSET(DEPTH_VAR) */
1339 /* If defined, this macro specifies a table of register pairs used to eliminate
1340 unneeded registers that point into the stack frame. If it is not defined,
1341 the only elimination attempted by the compiler is to replace references to
1342 the frame pointer with references to the stack pointer.
1344 The definition of this macro is a list of structure initializations, each of
1345 which specifies an original and replacement register.
1347 On some machines, the position of the argument pointer is not known until
1348 the compilation is completed. In such a case, a separate hard register must
1349 be used for the argument pointer. This register can be eliminated by
1350 replacing it with either the frame pointer or the argument pointer,
1351 depending on whether or not the frame pointer has been eliminated.
1353 In this case, you might specify:
1354 #define ELIMINABLE_REGS \
1355 {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1356 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
1357 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
1359 Note that the elimination of the argument pointer with the stack pointer is
1360 specified first since that is the preferred elimination. */
1361 #define ELIMINABLE_REGS \
1363 { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
1364 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \
1365 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM } \
1368 /* A C expression that returns non-zero if the compiler is allowed to try to
1369 replace register number FROM-REG with register number TO-REG. This macro
1370 need only be defined if `ELIMINABLE_REGS' is defined, and will usually be
1371 the constant 1, since most of the cases preventing register elimination are
1372 things that the compiler already knows about. */
1374 #define CAN_ELIMINATE(FROM, TO) \
1375 ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \
1376 ? ! frame_pointer_needed \
1379 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It specifies the
1380 initial difference between the specified pair of registers. This macro must
1381 be defined if `ELIMINABLE_REGS' is defined. */
1383 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1385 d30v_stack_t *info = d30v_stack_info (); \
1387 if ((FROM) == FRAME_POINTER_REGNUM) \
1389 else if ((FROM) == ARG_POINTER_REGNUM) \
1390 (OFFSET) = info->total_size - current_function_pretend_args_size; \
1396 /* Passing Function Arguments on the Stack */
1398 /* Define this macro if an argument declared in a prototype as an integral type
1399 smaller than `int' should actually be passed as an `int'. In addition to
1400 avoiding errors in certain cases of mismatch, it also makes for better code
1401 on certain machines. */
1402 /* #define PROMOTE_PROTOTYPES */
1404 /* A C expression that is the number of bytes actually pushed onto the stack
1405 when an instruction attempts to push NPUSHED bytes.
1407 If the target machine does not have a push instruction, do not define this
1408 macro. That directs GNU CC to use an alternate strategy: to allocate the
1409 entire argument block and then store the arguments into it.
1411 On some machines, the definition
1413 #define PUSH_ROUNDING(BYTES) (BYTES)
1415 will suffice. But on other machines, instructions that appear to push one
1416 byte actually push two bytes in an attempt to maintain alignment. Then the
1417 definition should be
1419 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1) */
1420 /* #define PUSH_ROUNDING(NPUSHED) */
1422 /* If defined, the maximum amount of space required for outgoing arguments will
1423 be computed and placed into the variable
1424 `current_function_outgoing_args_size'. No space will be pushed onto the
1425 stack for each call; instead, the function prologue should increase the
1426 stack frame size by this amount.
1428 Defining both `PUSH_ROUNDING' and `ACCUMULATE_OUTGOING_ARGS' is not
1430 #define ACCUMULATE_OUTGOING_ARGS 1
1432 /* Define this macro if functions should assume that stack space has been
1433 allocated for arguments even when their values are passed in registers.
1435 The value of this macro is the size, in bytes, of the area reserved for
1436 arguments passed in registers for the function represented by FNDECL.
1438 This space can be allocated by the caller, or be a part of the
1439 machine-dependent stack frame: `OUTGOING_REG_PARM_STACK_SPACE' says
1441 /* #define REG_PARM_STACK_SPACE(FNDECL) */
1443 /* Define these macros in addition to the one above if functions might allocate
1444 stack space for arguments even when their values are passed in registers.
1445 These should be used when the stack space allocated for arguments in
1446 registers is not a simple constant independent of the function declaration.
1448 The value of the first macro is the size, in bytes, of the area that we
1449 should initially assume would be reserved for arguments passed in registers.
1451 The value of the second macro is the actual size, in bytes, of the area that
1452 will be reserved for arguments passed in registers. This takes two
1453 arguments: an integer representing the number of bytes of fixed sized
1454 arguments on the stack, and a tree representing the number of bytes of
1455 variable sized arguments on the stack.
1457 When these macros are defined, `REG_PARM_STACK_SPACE' will only be called
1458 for libcall functions, the current function, or for a function being called
1459 when it is known that such stack space must be allocated. In each case this
1460 value can be easily computed.
1462 When deciding whether a called function needs such stack space, and how much
1463 space to reserve, GNU CC uses these two macros instead of
1464 `REG_PARM_STACK_SPACE'. */
1465 /* #define MAYBE_REG_PARM_STACK_SPACE */
1466 /* #define FINAL_REG_PARM_STACK_SPACE(CONST_SIZE, VAR_SIZE) */
1468 /* Define this if it is the responsibility of the caller to allocate the area
1469 reserved for arguments passed in registers.
1471 If `ACCUMULATE_OUTGOING_ARGS' is defined, this macro controls whether the
1472 space for these arguments counts in the value of
1473 `current_function_outgoing_args_size'. */
1474 /* #define OUTGOING_REG_PARM_STACK_SPACE */
1476 /* Define this macro if `REG_PARM_STACK_SPACE' is defined, but the stack
1477 parameters don't skip the area specified by it.
1479 Normally, when a parameter is not passed in registers, it is placed on the
1480 stack beyond the `REG_PARM_STACK_SPACE' area. Defining this macro
1481 suppresses this behavior and causes the parameter to be passed on the stack
1482 in its natural location. */
1483 /* #define STACK_PARMS_IN_REG_PARM_AREA */
1485 /* A C expression that should indicate the number of bytes of its own arguments
1486 that a function pops on returning, or 0 if the function pops no arguments
1487 and the caller must therefore pop them all after the function returns.
1489 FUNDECL is a C variable whose value is a tree node that describes the
1490 function in question. Normally it is a node of type `FUNCTION_DECL' that
1491 describes the declaration of the function. From this it is possible to
1492 obtain the DECL_ATTRIBUTES of the function.
1494 FUNTYPE is a C variable whose value is a tree node that describes the
1495 function in question. Normally it is a node of type `FUNCTION_TYPE' that
1496 describes the data type of the function. From this it is possible to obtain
1497 the data types of the value and arguments (if known).
1499 When a call to a library function is being considered, FUNTYPE will contain
1500 an identifier node for the library function. Thus, if you need to
1501 distinguish among various library functions, you can do so by their names.
1502 Note that "library function" in this context means a function used to
1503 perform arithmetic, whose name is known specially in the compiler and was
1504 not mentioned in the C code being compiled.
1506 STACK-SIZE is the number of bytes of arguments passed on the stack. If a
1507 variable number of bytes is passed, it is zero, and argument popping will
1508 always be the responsibility of the calling function.
1510 On the VAX, all functions always pop their arguments, so the definition of
1511 this macro is STACK-SIZE. On the 68000, using the standard calling
1512 convention, no functions pop their arguments, so the value of the macro is
1513 always 0 in this case. But an alternative calling convention is available
1514 in which functions that take a fixed number of arguments pop them but other
1515 functions (such as `printf') pop nothing (the caller pops all). When this
1516 convention is in use, FUNTYPE is examined to determine whether a function
1517 takes a fixed number of arguments. */
1518 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
1521 /* Function Arguments in Registers */
1523 /* A C expression that controls whether a function argument is passed in a
1524 register, and which register.
1526 The arguments are CUM, which summarizes all the previous arguments; MODE,
1527 the machine mode of the argument; TYPE, the data type of the argument as a
1528 tree node or 0 if that is not known (which happens for C support library
1529 functions); and NAMED, which is 1 for an ordinary argument and 0 for
1530 nameless arguments that correspond to `...' in the called function's
1533 The value of the expression should either be a `reg' RTX for the hard
1534 register in which to pass the argument, or zero to pass the argument on the
1537 For machines like the VAX and 68000, where normally all arguments are
1538 pushed, zero suffices as a definition.
1540 The usual way to make the ANSI library `stdarg.h' work on a machine where
1541 some arguments are usually passed in registers, is to cause nameless
1542 arguments to be passed on the stack instead. This is done by making
1543 `FUNCTION_ARG' return 0 whenever NAMED is 0.
1545 You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the definition of
1546 this macro to determine if this argument is of a type that must be passed in
1547 the stack. If `REG_PARM_STACK_SPACE' is not defined and `FUNCTION_ARG'
1548 returns non-zero for such an argument, the compiler will abort. If
1549 `REG_PARM_STACK_SPACE' is defined, the argument will be computed in the
1550 stack and then loaded into a register. */
1552 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
1553 d30v_function_arg (&CUM, (int)MODE, TYPE, NAMED, FALSE)
1555 /* Define this macro if the target machine has "register windows", so that the
1556 register in which a function sees an arguments is not necessarily the same
1557 as the one in which the caller passed the argument.
1559 For such machines, `FUNCTION_ARG' computes the register in which the caller
1560 passes the value, and `FUNCTION_INCOMING_ARG' should be defined in a similar
1561 fashion to tell the function being called where the arguments will arrive.
1563 If `FUNCTION_INCOMING_ARG' is not defined, `FUNCTION_ARG' serves both
1566 #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
1567 d30v_function_arg (&CUM, (int)MODE, TYPE, NAMED, TRUE)
1569 /* A C expression for the number of words, at the beginning of an argument,
1570 must be put in registers. The value must be zero for arguments that are
1571 passed entirely in registers or that are entirely pushed on the stack.
1573 On some machines, certain arguments must be passed partially in registers
1574 and partially in memory. On these machines, typically the first N words of
1575 arguments are passed in registers, and the rest on the stack. If a
1576 multi-word argument (a `double' or a structure) crosses that boundary, its
1577 first few words must be passed in registers and the rest must be pushed.
1578 This macro tells the compiler when this occurs, and how many of the words
1579 should go in registers.
1581 `FUNCTION_ARG' for these arguments should return the first register to be
1582 used by the caller for this argument; likewise `FUNCTION_INCOMING_ARG', for
1583 the called function. */
1584 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
1585 d30v_function_arg_partial_nregs (&CUM, (int)MODE, TYPE, NAMED)
1587 /* A C expression that indicates when an argument must be passed by reference.
1588 If nonzero for an argument, a copy of that argument is made in memory and a
1589 pointer to the argument is passed instead of the argument itself. The
1590 pointer is passed in whatever way is appropriate for passing a pointer to
1593 On machines where `REG_PARM_STACK_SPACE' is not defined, a suitable
1594 definition of this macro might be
1595 #define FUNCTION_ARG_PASS_BY_REFERENCE\
1596 (CUM, MODE, TYPE, NAMED) \
1597 MUST_PASS_IN_STACK (MODE, TYPE) */
1598 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) 0
1600 /* If defined, a C expression that indicates when it is the called function's
1601 responsibility to make a copy of arguments passed by invisible reference.
1602 Normally, the caller makes a copy and passes the address of the copy to the
1603 routine being called. When FUNCTION_ARG_CALLEE_COPIES is defined and is
1604 nonzero, the caller does not make a copy. Instead, it passes a pointer to
1605 the "live" value. The called function must not modify this value. If it
1606 can be determined that the value won't be modified, it need not make a copy;
1607 otherwise a copy must be made. */
1608 /* #define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) */
1610 /* A C type for declaring a variable that is used as the first argument of
1611 `FUNCTION_ARG' and other related values. For some target machines, the type
1612 `int' suffices and can hold the number of bytes of argument so far.
1614 There is no need to record in `CUMULATIVE_ARGS' anything about the arguments
1615 that have been passed on the stack. The compiler has other variables to
1616 keep track of that. For target machines on which all arguments are passed
1617 on the stack, there is no need to store anything in `CUMULATIVE_ARGS';
1618 however, the data structure must exist and should not be empty, so use
1620 typedef int CUMULATIVE_ARGS;
1622 /* A C statement (sans semicolon) for initializing the variable CUM for the
1623 state at the beginning of the argument list. The variable has type
1624 `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node for the data type
1625 of the function which will receive the args, or 0 if the args are to a
1626 compiler support library function. The value of INDIRECT is nonzero when
1627 processing an indirect call, for example a call through a function pointer.
1628 The value of INDIRECT is zero for a call to an explicitly named function, a
1629 library function call, or when `INIT_CUMULATIVE_ARGS' is used to find
1630 arguments for the function being compiled.
1632 When processing a call to a compiler support library function, LIBNAME
1633 identifies which one. It is a `symbol_ref' rtx which contains the name of
1634 the function, as a string. LIBNAME is 0 when an ordinary C function call is
1635 being processed. Thus, each time this macro is called, either LIBNAME or
1636 FNTYPE is nonzero, but never both of them at once. */
1638 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
1639 d30v_init_cumulative_args (&CUM, FNTYPE, LIBNAME, INDIRECT, FALSE)
1641 /* Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of finding the
1642 arguments for the function being compiled. If this macro is undefined,
1643 `INIT_CUMULATIVE_ARGS' is used instead.
1645 The value passed for LIBNAME is always 0, since library routines with
1646 special calling conventions are never compiled with GNU CC. The argument
1647 LIBNAME exists for symmetry with `INIT_CUMULATIVE_ARGS'. */
1649 #define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
1650 d30v_init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE, TRUE)
1652 /* A C statement (sans semicolon) to update the summarizer variable CUM to
1653 advance past an argument in the argument list. The values MODE, TYPE and
1654 NAMED describe that argument. Once this is done, the variable CUM is
1655 suitable for analyzing the *following* argument with `FUNCTION_ARG', etc.
1657 This macro need not do anything if the argument in question was passed on
1658 the stack. The compiler knows how to track the amount of stack space used
1659 for arguments without any special help. */
1661 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
1662 d30v_function_arg_advance (&CUM, (int) MODE, TYPE, NAMED)
1664 /* If defined, a C expression which determines whether, and in which direction,
1665 to pad out an argument with extra space. The value should be of type `enum
1666 direction': either `upward' to pad above the argument, `downward' to pad
1667 below, or `none' to inhibit padding.
1669 The *amount* of padding is always just enough to reach the next multiple of
1670 `FUNCTION_ARG_BOUNDARY'; this macro does not control it.
1672 This macro has a default definition which is right for most systems. For
1673 little-endian machines, the default is to pad upward. For big-endian
1674 machines, the default is to pad downward for an argument of constant size
1675 shorter than an `int', and upward otherwise. */
1676 /* #define FUNCTION_ARG_PADDING(MODE, TYPE) */
1678 /* If defined, a C expression that gives the alignment boundary, in bits, of an
1679 argument with the specified mode and type. If it is not defined,
1680 `PARM_BOUNDARY' is used for all arguments. */
1682 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
1683 d30v_function_arg_boundary ((int) MODE, TYPE)
1685 /* A C expression that is nonzero if REGNO is the number of a hard register in
1686 which function arguments are sometimes passed. This does *not* include
1687 implicit arguments such as the static chain and the structure-value address.
1688 On many machines, no registers can be used for this purpose since all
1689 function arguments are pushed on the stack. */
1691 #define FUNCTION_ARG_REGNO_P(REGNO) \
1692 IN_RANGE_P (REGNO, GPR_ARG_FIRST, GPR_ARG_LAST)
1695 /* How Scalar Function Values are Returned */
1697 /* A C expression to create an RTX representing the place where a function
1698 returns a value of data type VALTYPE. VALTYPE is a tree node representing a
1699 data type. Write `TYPE_MODE (VALTYPE)' to get the machine mode used to
1700 represent that type. On many machines, only the mode is relevant.
1701 (Actually, on most machines, scalar values are returned in the same place
1702 regardless of mode).
1704 If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same promotion
1705 rules specified in `PROMOTE_MODE' if VALTYPE is a scalar type.
1707 If the precise function being called is known, FUNC is a tree node
1708 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This makes it
1709 possible to use a different value-returning convention for specific
1710 functions when all their calls are known.
1712 `FUNCTION_VALUE' is not used for return vales with aggregate data types,
1713 because these are returned in another way. See `STRUCT_VALUE_REGNUM' and
1714 related macros, below. */
1716 #define FUNCTION_VALUE(VALTYPE, FUNC) \
1717 gen_rtx (REG, TYPE_MODE (VALTYPE), GPR_RET_VALUE)
1719 /* Define this macro if the target machine has "register windows" so that the
1720 register in which a function returns its value is not the same as the one in
1721 which the caller sees the value.
1723 For such machines, `FUNCTION_VALUE' computes the register in which the
1724 caller will see the value. `FUNCTION_OUTGOING_VALUE' should be defined in a
1725 similar fashion to tell the function where to put the value.
1727 If `FUNCTION_OUTGOING_VALUE' is not defined, `FUNCTION_VALUE' serves both
1730 `FUNCTION_OUTGOING_VALUE' is not used for return vales with aggregate data
1731 types, because these are returned in another way. See `STRUCT_VALUE_REGNUM'
1732 and related macros, below. */
1733 /* #define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) */
1735 /* A C expression to create an RTX representing the place where a library
1736 function returns a value of mode MODE. If the precise function being called
1737 is known, FUNC is a tree node (`FUNCTION_DECL') for it; otherwise, FUNC is a
1738 null pointer. This makes it possible to use a different value-returning
1739 convention for specific functions when all their calls are known.
1741 Note that "library function" in this context means a compiler support
1742 routine, used to perform arithmetic, whose name is known specially by the
1743 compiler and was not mentioned in the C code being compiled.
1745 The definition of `LIBRARY_VALUE' need not be concerned aggregate data
1746 types, because none of the library functions returns such types. */
1748 #define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, GPR_RET_VALUE)
1750 /* A C expression that is nonzero if REGNO is the number of a hard register in
1751 which the values of called function may come back.
1753 A register whose use for returning values is limited to serving as the
1754 second of a pair (for a value of type `double', say) need not be recognized
1755 by this macro. So for most machines, this definition suffices:
1757 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
1759 If the machine has register windows, so that the caller and the called
1760 function use different registers for the return value, this macro should
1761 recognize only the caller's register numbers. */
1763 #define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == GPR_RET_VALUE)
1765 /* Define this macro if `untyped_call' and `untyped_return' need more space
1766 than is implied by `FUNCTION_VALUE_REGNO_P' for saving and restoring an
1767 arbitrary return value. */
1768 /* #define APPLY_RESULT_SIZE */
1771 /* How Large Values are Returned */
1773 /* A C expression which can inhibit the returning of certain function values in
1774 registers, based on the type of value. A nonzero value says to return the
1775 function value in memory, just as large structures are always returned.
1776 Here TYPE will be a C expression of type `tree', representing the data type
1779 Note that values of mode `BLKmode' must be explicitly handled by this macro.
1780 Also, the option `-fpcc-struct-return' takes effect regardless of this
1781 macro. On most systems, it is possible to leave the macro undefined; this
1782 causes a default definition to be used, whose value is the constant 1 for
1783 `BLKmode' values, and 0 otherwise.
1785 Do not use this macro to indicate that structures and unions should always
1786 be returned in memory. You should instead use `DEFAULT_PCC_STRUCT_RETURN'
1787 to indicate this. */
1788 /* #define RETURN_IN_MEMORY(TYPE) */
1790 /* Define this macro to be 1 if all structure and union return values must be
1791 in memory. Since this results in slower code, this should be defined only
1792 if needed for compatibility with other compilers or with an ABI. If you
1793 define this macro to be 0, then the conventions used for structure and union
1794 return values are decided by the `RETURN_IN_MEMORY' macro.
1796 If not defined, this defaults to the value 1. */
1797 /* #define DEFAULT_PCC_STRUCT_RETURN */
1799 /* If the structure value address is passed in a register, then
1800 `STRUCT_VALUE_REGNUM' should be the number of that register. */
1802 #define STRUCT_VALUE_REGNUM GPR_ARG_FIRST
1804 /* If the structure value address is not passed in a register, define
1805 `STRUCT_VALUE' as an expression returning an RTX for the place where the
1806 address is passed. If it returns 0, the address is passed as an "invisible"
1809 #define STRUCT_VALUE 0
1811 /* On some architectures the place where the structure value address is found
1812 by the called function is not the same place that the caller put it. This
1813 can be due to register windows, or it could be because the function prologue
1814 moves it to a different place.
1816 If the incoming location of the structure value address is in a register,
1817 define this macro as the register number. */
1818 /* #define STRUCT_VALUE_INCOMING_REGNUM */
1820 /* If the incoming location is not a register, then you should define
1821 `STRUCT_VALUE_INCOMING' as an expression for an RTX for where the called
1822 function should find the value. If it should find the value on the stack,
1823 define this to create a `mem' which refers to the frame pointer. A
1824 definition of 0 means that the address is passed as an "invisible" first
1826 /* #define STRUCT_VALUE_INCOMING */
1828 /* Define this macro if the usual system convention on the target machine for
1829 returning structures and unions is for the called function to return the
1830 address of a static variable containing the value.
1832 Do not define this if the usual system convention is for the caller to pass
1833 an address to the subroutine.
1835 This macro has effect in `-fpcc-struct-return' mode, but it does nothing
1836 when you use `-freg-struct-return' mode. */
1837 /* #define PCC_STATIC_STRUCT_RETURN */
1840 /* Caller-Saves Register Allocation */
1842 /* Define this macro if function calls on the target machine do not preserve
1843 any registers; in other words, if `CALL_USED_REGISTERS' has 1 for all
1844 registers. This macro enables `-fcaller-saves' by default. Eventually that
1845 option will be enabled by default on all machines and both the option and
1846 this macro will be eliminated. */
1847 /* #define DEFAULT_CALLER_SAVES */
1849 /* A C expression to determine whether it is worthwhile to consider placing a
1850 pseudo-register in a call-clobbered hard register and saving and restoring
1851 it around each function call. The expression should be 1 when this is worth
1852 doing, and 0 otherwise.
1854 If you don't define this macro, a default is used which is good on most
1855 machines: `4 * CALLS < REFS'. */
1856 /* #define CALLER_SAVE_PROFITABLE(REFS, CALLS) */
1859 /* #define EXIT_IGNORE_STACK */
1861 /* Define this macro as a C expression that is nonzero for registers
1862 are used by the epilogue or the `return' pattern. The stack and
1863 frame pointer registers are already be assumed to be used as
1865 #define EPILOGUE_USES(REGNO) ((REGNO) == GPR_LINK)
1867 /* Define this macro if the function epilogue contains delay slots to which
1868 instructions from the rest of the function can be "moved". The definition
1869 should be a C expression whose value is an integer representing the number
1870 of delay slots there. */
1871 /* #define DELAY_SLOTS_FOR_EPILOGUE */
1873 /* A C expression that returns 1 if INSN can be placed in delay slot number N
1876 The argument N is an integer which identifies the delay slot now being
1877 considered (since different slots may have different rules of eligibility).
1878 It is never negative and is always less than the number of epilogue delay
1879 slots (what `DELAY_SLOTS_FOR_EPILOGUE' returns). If you reject a particular
1880 insn for a given delay slot, in principle, it may be reconsidered for a
1881 subsequent delay slot. Also, other insns may (at least in principle) be
1882 considered for the so far unfilled delay slot.
1884 The insns accepted to fill the epilogue delay slots are put in an
1885 RTL list made with `insn_list' objects, stored in the variable
1886 `current_function_epilogue_delay_list'. The insn for the first
1887 delay slot comes first in the list. Your definition of the function
1888 output_function_epilogue() should fill the delay slots by outputting the
1889 insns in this list, usually by calling `final_scan_insn'.
1891 You need not define this macro if you did not define
1892 `DELAY_SLOTS_FOR_EPILOGUE'. */
1893 /* #define ELIGIBLE_FOR_EPILOGUE_DELAY(INSN, N) */
1895 /* A C compound statement that outputs the assembler code for a thunk function,
1896 used to implement C++ virtual function calls with multiple inheritance. The
1897 thunk acts as a wrapper around a virtual function, adjusting the implicit
1898 object parameter before handing control off to the real function.
1900 First, emit code to add the integer DELTA to the location that contains the
1901 incoming first argument. Assume that this argument contains a pointer, and
1902 is the one used to pass the `this' pointer in C++. This is the incoming
1903 argument *before* the function prologue, e.g. `%o0' on a sparc. The
1904 addition must preserve the values of all other incoming arguments.
1906 After the addition, emit code to jump to FUNCTION, which is a
1907 `FUNCTION_DECL'. This is a direct pure jump, not a call, and does not touch
1908 the return address. Hence returning from FUNCTION will return to whoever
1909 called the current `thunk'.
1911 The effect must be as if FUNCTION had been called directly with the
1912 adjusted first argument. This macro is responsible for emitting
1913 all of the code for a thunk function; output_function_prologue()
1914 and output_function_epilogue() are not invoked.
1916 The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already been
1917 extracted from it.) It might possibly be useful on some targets, but
1920 If you do not define this macro, the target-independent code in the C++
1921 frontend will generate a less efficient heavyweight thunk that calls
1922 FUNCTION instead of jumping to it. The generic approach does not support
1924 /* #define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) */
1926 /* A C structure for machine-specific, per-function data.
1927 This is added to the cfun structure. */
1928 typedef struct machine_function
1930 /* Additionsl stack adjustment in __builtin_eh_throw. */
1931 struct rtx_def * eh_epilogue_sp_ofs;
1935 /* Generating Code for Profiling. */
1937 /* A C statement or compound statement to output to FILE some assembler code to
1938 call the profiling subroutine `mcount'. Before calling, the assembler code
1939 must load the address of a counter variable into a register where `mcount'
1940 expects to find the address. The name of this variable is `LP' followed by
1941 the number LABELNO, so you would generate the name using `LP%d' in a
1944 The details of how the address should be passed to `mcount' are determined
1945 by your operating system environment, not by GNU CC. To figure them out,
1946 compile a small program for profiling using the system's installed C
1947 compiler and look at the assembler code that results. */
1949 #define FUNCTION_PROFILER(FILE, LABELNO) d30v_function_profiler (FILE, LABELNO)
1951 /* Define this macro if the code for function profiling should come before the
1952 function prologue. Normally, the profiling code comes after. */
1953 /* #define PROFILE_BEFORE_PROLOGUE */
1956 /* Implementing the Varargs Macros. */
1958 /* If defined, is a C expression that produces the machine-specific code for a
1959 call to `__builtin_saveregs'. This code will be moved to the very beginning
1960 of the function, before any parameter access are made. The return value of
1961 this function should be an RTX that contains the value to use as the return
1962 of `__builtin_saveregs'.
1964 If this macro is not defined, the compiler will output an ordinary call to
1965 the library function `__builtin_saveregs'. */
1967 #define EXPAND_BUILTIN_SAVEREGS() d30v_expand_builtin_saveregs ()
1969 /* This macro offers an alternative to using `__builtin_saveregs' and defining
1970 the macro `EXPAND_BUILTIN_SAVEREGS'. Use it to store the anonymous register
1971 arguments into the stack so that all the arguments appear to have been
1972 passed consecutively on the stack. Once this is done, you can use the
1973 standard implementation of varargs that works for machines that pass all
1974 their arguments on the stack.
1976 The argument ARGS_SO_FAR is the `CUMULATIVE_ARGS' data structure, containing
1977 the values that obtain after processing of the named arguments. The
1978 arguments MODE and TYPE describe the last named argument--its machine mode
1979 and its data type as a tree node.
1981 The macro implementation should do two things: first, push onto the stack
1982 all the argument registers *not* used for the named arguments, and second,
1983 store the size of the data thus pushed into the `int'-valued variable whose
1984 name is supplied as the argument PRETEND_ARGS_SIZE. The value that you
1985 store here will serve as additional offset for setting up the stack frame.
1987 Because you must generate code to push the anonymous arguments at compile
1988 time without knowing their data types, `SETUP_INCOMING_VARARGS' is only
1989 useful on machines that have just a single category of argument register and
1990 use it uniformly for all data types.
1992 If the argument SECOND_TIME is nonzero, it means that the arguments of the
1993 function are being analyzed for the second time. This happens for an inline
1994 function, which is not actually compiled until the end of the source file.
1995 The macro `SETUP_INCOMING_VARARGS' should not generate any instructions in
1998 #define SETUP_INCOMING_VARARGS(ARGS_SO_FAR, MODE, TYPE, PRETEND_ARGS_SIZE, SECOND_TIME) \
1999 d30v_setup_incoming_varargs (&ARGS_SO_FAR, (int) MODE, TYPE, \
2000 &PRETEND_ARGS_SIZE, SECOND_TIME)
2002 /* Define this macro if the location where a function argument is passed
2003 depends on whether or not it is a named argument.
2005 This macro controls how the NAMED argument to `FUNCTION_ARG' is set for
2006 varargs and stdarg functions. With this macro defined, the NAMED argument
2007 is always true for named arguments, and false for unnamed arguments. If
2008 this is not defined, but `SETUP_INCOMING_VARARGS' is defined, then all
2009 arguments are treated as named. Otherwise, all named arguments except the
2010 last are treated as named. */
2011 /* #define STRICT_ARGUMENT_NAMING */
2013 /* Build up the stdarg/varargs va_list type tree, assinging it to NODE. If not
2014 defined, it is assumed that va_list is a void * pointer. */
2016 #define BUILD_VA_LIST_TYPE(VALIST) \
2017 (VALIST) = d30v_build_va_list ()
2020 /* Implement the stdarg/varargs va_start macro. STDARG_P is non-zero if this
2021 is stdarg.h instead of varargs.h. VALIST is the tree of the va_list
2022 variable to initialize. NEXTARG is the machine independent notion of the
2023 'next' argument after the variable arguments. If not defined, a standard
2024 implementation will be defined that works for arguments passed on the stack. */
2026 #define EXPAND_BUILTIN_VA_START(STDARG_P, VALIST, NEXTARG) \
2027 (d30v_expand_builtin_va_start(STDARG_P, VALIST, NEXTARG))
2029 /* Implement the stdarg/varargs va_arg macro. VALIST is the variable of type
2030 va_list as a tree, TYPE is the type passed to va_arg. */
2032 #define EXPAND_BUILTIN_VA_ARG(VALIST, TYPE) \
2033 (d30v_expand_builtin_va_arg (VALIST, TYPE))
2035 /* Implement the stdarg/varargs va_end macro.
2036 VALIST is the variable of type va_list as a tree. */
2038 /* #define EXPAND_BUILTIN_VA_END(VALIST) */
2042 /* Trampolines for Nested Functions. */
2044 /* A C statement to output, on the stream FILE, assembler code for a block of
2045 data that contains the constant parts of a trampoline. This code should not
2046 include a label--the label is taken care of automatically. */
2047 /* #define TRAMPOLINE_TEMPLATE(FILE) d30v_trampoline_template (FILE) */
2049 /* The name of a subroutine to switch to the section in which the trampoline
2050 template is to be placed (*note Sections::.). The default is a value of
2051 `readonly_data_section', which places the trampoline in the section
2052 containing read-only data. */
2053 /* #define TRAMPOLINE_SECTION */
2055 /* A C expression for the size in bytes of the trampoline, as an integer. */
2056 #define TRAMPOLINE_SIZE (d30v_trampoline_size ())
2058 /* Alignment required for trampolines, in bits.
2060 If you don't define this macro, the value of `BIGGEST_ALIGNMENT' is used for
2061 aligning trampolines. */
2062 #define TRAMPOLINE_ALIGNMENT 64
2064 /* A C statement to initialize the variable parts of a trampoline. ADDR is an
2065 RTX for the address of the trampoline; FNADDR is an RTX for the address of
2066 the nested function; STATIC_CHAIN is an RTX for the static chain value that
2067 should be passed to the function when it is called. */
2068 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
2069 d30v_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN)
2071 /* A C expression to allocate run-time space for a trampoline. The expression
2072 value should be an RTX representing a memory reference to the space for the
2075 If this macro is not defined, by default the trampoline is allocated as a
2076 stack slot. This default is right for most machines. The exceptions are
2077 machines where it is impossible to execute instructions in the stack area.
2078 On such machines, you may have to implement a separate stack, using this
2079 macro in conjunction with output_function_prologue () and
2080 output_function_epilogue ().
2082 FP points to a data structure, a `struct function', which describes the
2083 compilation status of the immediate containing function of the function
2084 which the trampoline is for. Normally (when `ALLOCATE_TRAMPOLINE' is not
2085 defined), the stack slot for the trampoline is in the stack frame of this
2086 containing function. Other allocation strategies probably must do something
2087 analogous with this information. */
2088 /* #define ALLOCATE_TRAMPOLINE(FP) */
2090 /* Implementing trampolines is difficult on many machines because they have
2091 separate instruction and data caches. Writing into a stack location fails
2092 to clear the memory in the instruction cache, so when the program jumps to
2093 that location, it executes the old contents.
2095 Here are two possible solutions. One is to clear the relevant parts of the
2096 instruction cache whenever a trampoline is set up. The other is to make all
2097 trampolines identical, by having them jump to a standard subroutine. The
2098 former technique makes trampoline execution faster; the latter makes
2099 initialization faster.
2101 To clear the instruction cache when a trampoline is initialized, define the
2102 following macros which describe the shape of the cache. */
2104 /* The total size in bytes of the cache. */
2105 /* #define INSN_CACHE_SIZE */
2107 /* The length in bytes of each cache line. The cache is divided into cache
2108 lines which are disjoint slots, each holding a contiguous chunk of data
2109 fetched from memory. Each time data is brought into the cache, an entire
2110 line is read at once. The data loaded into a cache line is always aligned
2111 on a boundary equal to the line size. */
2112 /* #define INSN_CACHE_LINE_WIDTH */
2114 /* The number of alternative cache lines that can hold any particular memory
2116 /* #define INSN_CACHE_DEPTH */
2118 /* Alternatively, if the machine has system calls or instructions to clear the
2119 instruction cache directly, you can define the following macro. */
2121 /* If defined, expands to a C expression clearing the *instruction cache* in
2122 the specified interval. If it is not defined, and the macro INSN_CACHE_SIZE
2123 is defined, some generic code is generated to clear the cache. The
2124 definition of this macro would typically be a series of `asm' statements.
2125 Both BEG and END are both pointer expressions. */
2126 /* #define CLEAR_INSN_CACHE (BEG, END) */
2128 /* To use a standard subroutine, define the following macro. In addition, you
2129 must make sure that the instructions in a trampoline fill an entire cache
2130 line with identical instructions, or else ensure that the beginning of the
2131 trampoline code is always aligned at the same point in its cache line. Look
2132 in `m68k.h' as a guide. */
2134 /* Define this macro if trampolines need a special subroutine to do their work.
2135 The macro should expand to a series of `asm' statements which will be
2136 compiled with GNU CC. They go in a library function named
2137 `__transfer_from_trampoline'.
2139 If you need to avoid executing the ordinary prologue code of a compiled C
2140 function when you jump to the subroutine, you can do so by placing a special
2141 label of your own in the assembler code. Use one `asm' statement to
2142 generate an assembler label, and another to make the label global. Then
2143 trampolines can use that label to jump directly to your special assembler
2145 /* #define TRANSFER_FROM_TRAMPOLINE */
2148 /* Implicit Calls to Library Routines */
2150 /* A C string constant giving the name of the function to call for
2151 multiplication of one signed full-word by another. If you do not define
2152 this macro, the default name is used, which is `__mulsi3', a function
2153 defined in `libgcc.a'. */
2154 /* #define MULSI3_LIBCALL */
2156 /* A C string constant giving the name of the function to call for division of
2157 one signed full-word by another. If you do not define this macro, the
2158 default name is used, which is `__divsi3', a function defined in `libgcc.a'. */
2159 /* #define DIVSI3_LIBCALL */
2161 /* A C string constant giving the name of the function to call for division of
2162 one unsigned full-word by another. If you do not define this macro, the
2163 default name is used, which is `__udivsi3', a function defined in
2165 /* #define UDIVSI3_LIBCALL */
2167 /* A C string constant giving the name of the function to call for the
2168 remainder in division of one signed full-word by another. If you do not
2169 define this macro, the default name is used, which is `__modsi3', a function
2170 defined in `libgcc.a'. */
2171 /* #define MODSI3_LIBCALL */
2173 /* A C string constant giving the name of the function to call for the
2174 remainder in division of one unsigned full-word by another. If you do not
2175 define this macro, the default name is used, which is `__umodsi3', a
2176 function defined in `libgcc.a'. */
2177 /* #define UMODSI3_LIBCALL */
2179 /* A C string constant giving the name of the function to call for
2180 multiplication of one signed double-word by another. If you do not define
2181 this macro, the default name is used, which is `__muldi3', a function
2182 defined in `libgcc.a'. */
2183 /* #define MULDI3_LIBCALL */
2185 /* A C string constant giving the name of the function to call for division of
2186 one signed double-word by another. If you do not define this macro, the
2187 default name is used, which is `__divdi3', a function defined in `libgcc.a'. */
2188 /* #define DIVDI3_LIBCALL */
2190 /* A C string constant giving the name of the function to call for division of
2191 one unsigned full-word by another. If you do not define this macro, the
2192 default name is used, which is `__udivdi3', a function defined in
2194 /* #define UDIVDI3_LIBCALL */
2196 /* A C string constant giving the name of the function to call for the
2197 remainder in division of one signed double-word by another. If you do not
2198 define this macro, the default name is used, which is `__moddi3', a function
2199 defined in `libgcc.a'. */
2200 /* #define MODDI3_LIBCALL */
2202 /* A C string constant giving the name of the function to call for the
2203 remainder in division of one unsigned full-word by another. If you do not
2204 define this macro, the default name is used, which is `__umoddi3', a
2205 function defined in `libgcc.a'. */
2206 /* #define UMODDI3_LIBCALL */
2208 /* Define this macro as a C statement that declares additional library routines
2209 renames existing ones. `init_optabs' calls this macro after initializing all
2210 the normal library routines. */
2211 /* #define INIT_TARGET_OPTABS */
2213 /* The value of `EDOM' on the target machine, as a C integer constant
2214 expression. If you don't define this macro, GNU CC does not attempt to
2215 deposit the value of `EDOM' into `errno' directly. Look in
2216 `/usr/include/errno.h' to find the value of `EDOM' on your system.
2218 If you do not define `TARGET_EDOM', then compiled code reports domain errors
2219 by calling the library function and letting it report the error. If
2220 mathematical functions on your system use `matherr' when there is an error,
2221 then you should leave `TARGET_EDOM' undefined so that `matherr' is used
2223 /* #define TARGET_EDOM */
2225 /* Define this macro as a C expression to create an rtl expression that refers
2226 to the global "variable" `errno'. (On certain systems, `errno' may not
2227 actually be a variable.) If you don't define this macro, a reasonable
2229 /* #define GEN_ERRNO_RTX */
2231 /* Define this macro if GNU CC should generate calls to the System V (and ANSI
2232 C) library functions `memcpy' and `memset' rather than the BSD functions
2233 `bcopy' and `bzero'.
2235 Defined in svr4.h. */
2236 /* #define TARGET_MEM_FUNCTIONS */
2238 /* Define this macro to generate code for Objective C message sending using the
2239 calling convention of the NeXT system. This calling convention involves
2240 passing the object, the selector and the method arguments all at once to the
2241 method-lookup library function.
2243 The default calling convention passes just the object and the selector to
2244 the lookup function, which returns a pointer to the method. */
2245 /* #define NEXT_OBJC_RUNTIME */
2248 /* Addressing Modes */
2250 /* Define this macro if the machine supports post-increment addressing. */
2251 #define HAVE_POST_INCREMENT 1
2253 /* Similar for other kinds of addressing. */
2254 /* #define HAVE_PRE_INCREMENT 0 */
2255 #define HAVE_POST_DECREMENT 1
2256 /* #define HAVE_PRE_DECREMENT 0 */
2258 /* A C expression that is 1 if the RTX X is a constant which is a valid
2259 address. On most machines, this can be defined as `CONSTANT_P (X)', but a
2260 few machines are more restrictive in which constant addresses are supported.
2262 `CONSTANT_P' accepts integer-values expressions whose values are not
2263 explicitly known, such as `symbol_ref', `label_ref', and `high' expressions
2264 and `const' arithmetic expressions, in addition to `const_int' and
2265 `const_double' expressions. */
2266 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
2268 /* A number, the maximum number of registers that can appear in a valid memory
2269 address. Note that it is up to you to specify a value equal to the maximum
2270 number that `GO_IF_LEGITIMATE_ADDRESS' would ever accept. */
2271 #define MAX_REGS_PER_ADDRESS 2
2273 /* A C compound statement with a conditional `goto LABEL;' executed if X (an
2274 RTX) is a legitimate memory address on the target machine for a memory
2275 operand of mode MODE.
2277 It usually pays to define several simpler macros to serve as subroutines for
2278 this one. Otherwise it may be too complicated to understand.
2280 This macro must exist in two variants: a strict variant and a non-strict
2281 one. The strict variant is used in the reload pass. It must be defined so
2282 that any pseudo-register that has not been allocated a hard register is
2283 considered a memory reference. In contexts where some kind of register is
2284 required, a pseudo-register with no hard register must be rejected.
2286 The non-strict variant is used in other passes. It must be defined to
2287 accept all pseudo-registers in every context where some kind of register is
2290 Compiler source files that want to use the strict variant of this macro
2291 define the macro `REG_OK_STRICT'. You should use an `#ifdef REG_OK_STRICT'
2292 conditional to define the strict variant in that case and the non-strict
2295 Subroutines to check for acceptable registers for various purposes (one for
2296 base registers, one for index registers, and so on) are typically among the
2297 subroutines used to define `GO_IF_LEGITIMATE_ADDRESS'. Then only these
2298 subroutine macros need have two variants; the higher levels of macros may be
2299 the same whether strict or not.
2301 Normally, constant addresses which are the sum of a `symbol_ref' and an
2302 integer are stored inside a `const' RTX to mark them as constant.
2303 Therefore, there is no need to recognize such sums specifically as
2304 legitimate addresses. Normally you would simply recognize any `const' as
2307 Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant sums that
2308 are not marked with `const'. It assumes that a naked `plus' indicates
2309 indexing. If so, then you *must* reject such naked constant sums as
2310 illegitimate addresses, so that none of them will be given to
2311 `PRINT_OPERAND_ADDRESS'.
2313 On some machines, whether a symbolic address is legitimate depends on the
2314 section that the address refers to. On these machines, define the macro
2315 `ENCODE_SECTION_INFO' to store the information into the `symbol_ref', and
2316 then check for it here. When you see a `const', you will have to look
2317 inside it to find the `symbol_ref' in order to determine the section. *Note
2320 The best way to modify the name string is by adding text to the beginning,
2321 with suitable punctuation to prevent any ambiguity. Allocate the new name
2322 in `saveable_obstack'. You will have to modify `ASM_OUTPUT_LABELREF' to
2323 remove and decode the added text and output the name accordingly, and define
2324 `STRIP_NAME_ENCODING' to access the original name string.
2326 You can check the information stored here into the `symbol_ref' in the
2327 definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and
2328 `PRINT_OPERAND_ADDRESS'. */
2330 #ifdef REG_OK_STRICT
2331 #define REG_OK_STRICT_P 1
2333 #define REG_OK_STRICT_P 0
2336 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
2338 if (d30v_legitimate_address_p ((int)MODE, X, REG_OK_STRICT_P)) \
2342 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
2343 use as a base register. For hard registers, it should always accept those
2344 which the hardware permits and reject the others. Whether the macro accepts
2345 or rejects pseudo registers must be controlled by `REG_OK_STRICT' as
2346 described above. This usually requires two variant definitions, of which
2347 `REG_OK_STRICT' controls the one actually used. */
2349 #ifdef REG_OK_STRICT
2350 #define REG_OK_FOR_BASE_P(X) (GPR_P (REGNO (X)))
2352 #define REG_OK_FOR_BASE_P(X) (GPR_OR_PSEUDO_P (REGNO (X)))
2355 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
2356 use as an index register.
2358 The difference between an index register and a base register is that the
2359 index register may be scaled. If an address involves the sum of two
2360 registers, neither one of them scaled, then either one may be labeled the
2361 "base" and the other the "index"; but whichever labeling is used must fit
2362 the machine's constraints of which registers may serve in each capacity.
2363 The compiler will try both labelings, looking for one that is valid, and
2364 will reload one or both registers only if neither labeling works. */
2366 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
2368 /* A C compound statement that attempts to replace X with a valid memory
2369 address for an operand of mode MODE. WIN will be a C statement label
2370 elsewhere in the code; the macro definition may use
2372 GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
2374 to avoid further processing if the address has become legitimate.
2376 X will always be the result of a call to `break_out_memory_refs', and OLDX
2377 will be the operand that was given to that function to produce X.
2379 The code generated by this macro should not alter the substructure of X. If
2380 it transforms X into a more legitimate form, it should assign X (which will
2381 always be a C variable) a new value.
2383 It is not necessary for this macro to come up with a legitimate address.
2384 The compiler has standard ways of doing so in all cases. In fact, it is
2385 safe for this macro to do nothing. But often a machine-dependent strategy
2386 can generate better code. */
2388 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
2390 rtx y = d30v_legitimize_address (X, OLDX, (int)MODE, REG_OK_STRICT_P); \
2394 GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN); \
2398 /* A C statement or compound statement with a conditional `goto LABEL;'
2399 executed if memory address X (an RTX) can have different meanings depending
2400 on the machine mode of the memory reference it is used for or if the address
2401 is valid for some modes but not others.
2403 Autoincrement and autodecrement addresses typically have mode-dependent
2404 effects because the amount of the increment or decrement is the size of the
2405 operand being addressed. Some machines have other mode-dependent addresses.
2406 Many RISC machines have no mode-dependent addresses.
2408 You may assume that ADDR is a valid address for the machine. */
2410 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
2412 if (d30v_mode_dependent_address_p (ADDR)) \
2416 /* A C expression that is nonzero if X is a legitimate constant for an
2417 immediate operand on the target machine. You can assume that X satisfies
2418 `CONSTANT_P', so you need not check this. In fact, `1' is a suitable
2419 definition for this macro on machines where anything `CONSTANT_P' is valid. */
2420 #define LEGITIMATE_CONSTANT_P(X) 1
2423 /* Condition Code Status */
2425 /* C code for a data type which is used for declaring the `mdep' component of
2426 `cc_status'. It defaults to `int'.
2428 This macro is not used on machines that do not use `cc0'. */
2429 /* #define CC_STATUS_MDEP */
2431 /* A C expression to initialize the `mdep' field to "empty". The default
2432 definition does nothing, since most machines don't use the field anyway. If
2433 you want to use the field, you should probably define this macro to
2436 This macro is not used on machines that do not use `cc0'. */
2437 /* #define CC_STATUS_MDEP_INIT */
2439 /* A C compound statement to set the components of `cc_status' appropriately
2440 for an insn INSN whose body is EXP. It is this macro's responsibility to
2441 recognize insns that set the condition code as a byproduct of other activity
2442 as well as those that explicitly set `(cc0)'.
2444 This macro is not used on machines that do not use `cc0'.
2446 If there are insns that do not set the condition code but do alter other
2447 machine registers, this macro must check to see whether they invalidate the
2448 expressions that the condition code is recorded as reflecting. For example,
2449 on the 68000, insns that store in address registers do not set the condition
2450 code, which means that usually `NOTICE_UPDATE_CC' can leave `cc_status'
2451 unaltered for such insns. But suppose that the previous insn set the
2452 condition code based on location `a4@(102)' and the current insn stores a
2453 new value in `a4'. Although the condition code is not changed by this, it
2454 will no longer be true that it reflects the contents of `a4@(102)'.
2455 Therefore, `NOTICE_UPDATE_CC' must alter `cc_status' in this case to say
2456 that nothing is known about the condition code value.
2458 The definition of `NOTICE_UPDATE_CC' must be prepared to deal with the
2459 results of peephole optimization: insns whose patterns are `parallel' RTXs
2460 containing various `reg', `mem' or constants which are just the operands.
2461 The RTL structure of these insns is not sufficient to indicate what the
2462 insns actually do. What `NOTICE_UPDATE_CC' should do when it sees one is
2463 just to run `CC_STATUS_INIT'.
2465 A possible definition of `NOTICE_UPDATE_CC' is to call a function that looks
2466 at an attribute (*note Insn Attributes::.) named, for example, `cc'. This
2467 avoids having detailed information about patterns in two places, the `md'
2468 file and in `NOTICE_UPDATE_CC'. */
2469 /* #define NOTICE_UPDATE_CC(EXP, INSN) */
2471 /* A list of names to be used for additional modes for condition code values in
2472 registers (*note Jump Patterns::.). These names are added to `enum
2473 machine_mode' and all have class `MODE_CC'. By convention, they should
2474 start with `CC' and end with `mode'.
2476 You should only define this macro if your machine does not use `cc0' and
2477 only if additional modes are required. */
2478 /* #define EXTRA_CC_MODES */
2480 /* Returns a mode from class `MODE_CC' to be used when comparison operation
2481 code OP is applied to rtx X and Y. For example, on the Sparc,
2482 `SELECT_CC_MODE' is defined as (see *note Jump Patterns::. for a
2483 description of the reason for this definition)
2485 #define SELECT_CC_MODE(OP,X,Y) \
2486 (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
2487 ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode) \
2488 : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS \
2489 || GET_CODE (X) == NEG) \
2490 ? CC_NOOVmode : CCmode))
2492 You need not define this macro if `EXTRA_CC_MODES' is not defined. */
2493 /* #define SELECT_CC_MODE(OP, X, Y) */
2495 /* One some machines not all possible comparisons are defined, but you can
2496 convert an invalid comparison into a valid one. For example, the Alpha does
2497 not have a `GT' comparison, but you can use an `LT' comparison instead and
2498 swap the order of the operands.
2500 On such machines, define this macro to be a C statement to do any required
2501 conversions. CODE is the initial comparison code and OP0 and OP1 are the
2502 left and right operands of the comparison, respectively. You should modify
2503 CODE, OP0, and OP1 as required.
2505 GNU CC will not assume that the comparison resulting from this macro is
2506 valid but will see if the resulting insn matches a pattern in the `md' file.
2508 You need not define this macro if it would never change the comparison code
2510 /* #define CANONICALIZE_COMPARISON(CODE, OP0, OP1) */
2512 /* A C expression whose value is one if it is always safe to reverse a
2513 comparison whose mode is MODE. If `SELECT_CC_MODE' can ever return MODE for
2514 a floating-point inequality comparison, then `REVERSIBLE_CC_MODE (MODE)'
2517 You need not define this macro if it would always returns zero or if the
2518 floating-point format is anything other than `IEEE_FLOAT_FORMAT'. For
2519 example, here is the definition used on the Sparc, where floating-point
2520 inequality comparisons are always given `CCFPEmode':
2522 #define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode) */
2523 /* #define REVERSIBLE_CC_MODE(MODE) */
2526 /* Describing Relative Costs of Operations */
2528 /* A part of a C `switch' statement that describes the relative costs of
2529 constant RTL expressions. It must contain `case' labels for expression
2530 codes `const_int', `const', `symbol_ref', `label_ref' and `const_double'.
2531 Each case must ultimately reach a `return' statement to return the relative
2532 cost of the use of that kind of constant value in an expression. The cost
2533 may depend on the precise value of the constant, which is available for
2534 examination in X, and the rtx code of the expression in which it is
2535 contained, found in OUTER_CODE.
2537 CODE is the expression code--redundant, since it can be obtained with
2540 /* On the d30v, consider operatnds that fit in a short instruction very
2541 cheap. However, at this time, it causes cse to generate incorrect
2542 code, so disable it for now. */
2544 #define CONST_COSTS(X, CODE, OUTER_CODE) \
2546 if (IN_RANGE_P (INTVAL (X), 0, 31)) \
2548 else if ((OUTER_CODE) == LEU && (OUTER_CODE) == LTU \
2549 && (OUTER_CODE) == GEU && (OUTER_CODE) == GTU) \
2550 return IN_RANGE_P (INTVAL (X), 32, 63) ? 0 : COSTS_N_INSNS (2); \
2552 return IN_RANGE_P (INTVAL (X), -31, -1) ? 0 : COSTS_N_INSNS (2); \
2556 return COSTS_N_INSNS (2); \
2557 case CONST_DOUBLE: \
2558 return COSTS_N_INSNS ((GET_MODE (X) == SFmode) ? 2 : 4);
2560 #define CONST_COSTS(X, CODE, OUTER_CODE)
2563 /* Like `CONST_COSTS' but applies to nonconstant RTL expressions. This can be
2564 used, for example, to indicate how costly a multiply instruction is. In
2565 writing this macro, you can use the construct `COSTS_N_INSNS (N)' to specify
2566 a cost equal to N fast instructions. OUTER_CODE is the code of the
2567 expression in which X is contained.
2569 This macro is optional; do not define it if the default cost assumptions are
2570 adequate for the target machine. */
2571 #define RTX_COSTS(X, CODE, OUTER_CODE) \
2573 return COSTS_N_INSNS ((GET_CODE (XEXP (x, 1)) == CONST_INT \
2574 && exact_log2 (INTVAL (XEXP (x, 1))) >= 0) \
2577 /* An expression giving the cost of an addressing mode that contains ADDRESS.
2578 If not defined, the cost is computed from the ADDRESS expression and the
2579 `CONST_COSTS' values.
2581 For most CISC machines, the default cost is a good approximation of the true
2582 cost of the addressing mode. However, on RISC machines, all instructions
2583 normally have the same length and execution time. Hence all addresses will
2586 In cases where more than one form of an address is known, the form with the
2587 lowest cost will be used. If multiple forms have the same, lowest, cost,
2588 the one that is the most complex will be used.
2590 For example, suppose an address that is equal to the sum of a register and a
2591 constant is used twice in the same basic block. When this macro is not
2592 defined, the address will be computed in a register and memory references
2593 will be indirect through that register. On machines where the cost of the
2594 addressing mode containing the sum is no higher than that of a simple
2595 indirect reference, this will produce an additional instruction and possibly
2596 require an additional register. Proper specification of this macro
2597 eliminates this overhead for such machines.
2599 Similar use of this macro is made in strength reduction of loops.
2601 ADDRESS need not be valid as an address. In such a case, the cost is not
2602 relevant and can be any value; invalid addresses need not be assigned a
2605 On machines where an address involving more than one register is as cheap as
2606 an address computation involving only one register, defining `ADDRESS_COST'
2607 to reflect this can cause two registers to be live over a region of code
2608 where only one would have been if `ADDRESS_COST' were not defined in that
2609 manner. This effect should be considered in the definition of this macro.
2610 Equivalent costs should probably only be given to addresses with different
2611 numbers of registers on machines with lots of registers.
2613 This macro will normally either not be defined or be defined as a constant. */
2614 #define ADDRESS_COST(ADDRESS) 0
2616 /* A C expression for the cost of moving data from a register in class FROM to
2617 one in class TO. The classes are expressed using the enumeration values
2618 such as `GENERAL_REGS'. A value of 4 is the default; other values are
2619 interpreted relative to that.
2621 It is not required that the cost always equal 2 when FROM is the same as TO;
2622 on some machines it is expensive to move between registers if they are not
2625 If reload sees an insn consisting of a single `set' between two hard
2626 registers, and if `REGISTER_MOVE_COST' applied to their classes returns a
2627 value of 2, reload does not check to ensure that the constraints of the insn
2628 are met. Setting a cost of other than 2 will allow reload to verify that
2629 the constraints are met. You should do this if the `movM' pattern's
2630 constraints do not allow such copying. */
2632 #define REGISTER_MOVE_COST(MODE, FROM, TO) \
2633 (((FROM) != GPR_REGS && (FROM) != EVEN_REGS \
2634 && (TO) != GPR_REGS && (TO) != EVEN_REGS) ? 4 : 2)
2636 /* A C expression for the cost of moving data of mode M between a register and
2637 memory. A value of 2 is the default; this cost is relative to those in
2638 `REGISTER_MOVE_COST'.
2640 If moving between registers and memory is more expensive than between two
2641 registers, you should define this macro to express the relative cost. */
2642 #define MEMORY_MOVE_COST(M,C,I) 4
2644 /* A C expression for the cost of a branch instruction. A value of 1 is the
2645 default; other values are interpreted relative to that. */
2647 #define BRANCH_COST d30v_branch_cost
2649 #define D30V_DEFAULT_BRANCH_COST 2
2651 /* Values of the -mbranch-cost=n string. */
2652 extern int d30v_branch_cost;
2653 extern const char *d30v_branch_cost_string;
2655 /* Here are additional macros which do not specify precise relative costs, but
2656 only that certain actions are more expensive than GNU CC would ordinarily
2659 /* Define this macro as a C expression which is nonzero if accessing less than
2660 a word of memory (i.e. a `char' or a `short') is no faster than accessing a
2661 word of memory, i.e., if such access require more than one instruction or if
2662 there is no difference in cost between byte and (aligned) word loads.
2664 When this macro is not defined, the compiler will access a field by finding
2665 the smallest containing object; when it is defined, a fullword load will be
2666 used if alignment permits. Unless bytes accesses are faster than word
2667 accesses, using word accesses is preferable since it may eliminate
2668 subsequent memory access if subsequent accesses occur to other fields in the
2669 same word of the structure, but to different bytes. */
2670 #define SLOW_BYTE_ACCESS 1
2672 /* Define this macro to be the value 1 if unaligned accesses have a cost many
2673 times greater than aligned accesses, for example if they are emulated in a
2676 When this macro is non-zero, the compiler will act as if `STRICT_ALIGNMENT'
2677 were non-zero when generating code for block moves. This can cause
2678 significantly more instructions to be produced. Therefore, do not set this
2679 macro non-zero if unaligned accesses only add a cycle or two to the time for
2682 If the value of this macro is always zero, it need not be defined. */
2683 /* #define SLOW_UNALIGNED_ACCESS */
2685 /* Define this macro to inhibit strength reduction of memory addresses. (On
2686 some machines, such strength reduction seems to do harm rather than good.) */
2687 /* #define DONT_REDUCE_ADDR */
2689 /* The number of scalar move insns which should be generated instead of a
2690 string move insn or a library call. Increasing the value will always make
2691 code faster, but eventually incurs high cost in increased code size.
2693 If you don't define this, a reasonable default is used. */
2694 /* #define MOVE_RATIO */
2696 /* Define this macro if it is as good or better to call a constant function
2697 address than to call an address kept in a register. */
2698 #define NO_FUNCTION_CSE
2700 /* Define this macro if it is as good or better for a function to call itself
2701 with an explicit address than to call an address kept in a register. */
2702 /* #define NO_RECURSIVE_FUNCTION_CSE */
2705 /* Dividing the output into sections. */
2707 /* A C expression whose value is a string containing the assembler operation
2708 that should precede instructions and read-only data. Normally `".text"' is
2710 #define TEXT_SECTION_ASM_OP "\t.text"
2712 /* A C expression whose value is a string containing the assembler operation to
2713 identify the following data as writable initialized data. Normally
2714 `".data"' is right. */
2715 #define DATA_SECTION_ASM_OP "\t.data"
2717 /* if defined, a C expression whose value is a string containing the assembler
2718 operation to identify the following data as shared data. If not defined,
2719 `DATA_SECTION_ASM_OP' will be used. */
2720 /* #define SHARED_SECTION_ASM_OP */
2722 /* If defined, a C expression whose value is a string containing the
2723 assembler operation to identify the following data as
2724 uninitialized global data. If not defined, and neither
2725 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
2726 uninitialized global data will be output in the data section if
2727 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
2729 #define BSS_SECTION_ASM_OP "\t.bss"
2731 /* If defined, a C expression whose value is a string containing the
2732 assembler operation to identify the following data as
2733 uninitialized global shared data. If not defined, and
2734 `BSS_SECTION_ASM_OP' is, the latter will be used. */
2735 /* #define SHARED_BSS_SECTION_ASM_OP */
2737 /* A list of names for sections other than the standard two, which are
2738 `in_text' and `in_data'. You need not define this macro on a system with no
2739 other sections (that GCC needs to use).
2741 Defined in svr4.h. */
2742 /* #define EXTRA_SECTIONS */
2744 /* One or more functions to be defined in `varasm.c'. These functions should
2745 do jobs analogous to those of `text_section' and `data_section', for your
2746 additional sections. Do not define this macro if you do not define
2749 Defined in svr4.h. */
2750 /* #define EXTRA_SECTION_FUNCTIONS */
2752 /* On most machines, read-only variables, constants, and jump tables are placed
2753 in the text section. If this is not the case on your machine, this macro
2754 should be defined to be the name of a function (either `data_section' or a
2755 function defined in `EXTRA_SECTIONS') that switches to the section to be
2756 used for read-only items.
2758 If these items should be placed in the text section, this macro should not
2760 /* #define READONLY_DATA_SECTION */
2762 /* A C statement or statements to switch to the appropriate section for output
2763 of EXP. You can assume that EXP is either a `VAR_DECL' node or a constant
2764 of some sort. RELOC indicates whether the initial value of EXP requires
2765 link-time relocations. Select the section by calling `text_section' or one
2766 of the alternatives for other sections.
2768 Do not define this macro if you put all read-only variables and constants in
2769 the read-only data section (usually the text section).
2771 Defined in svr4.h. */
2772 /* #define SELECT_SECTION(EXP, RELOC, ALIGN) */
2774 /* A C statement or statements to switch to the appropriate section for output
2775 of RTX in mode MODE. You can assume that RTX is some kind of constant in
2776 RTL. The argument MODE is redundant except in the case of a `const_int'
2777 rtx. Select the section by calling `text_section' or one of the
2778 alternatives for other sections.
2780 Do not define this macro if you put all constants in the read-only data
2783 Defined in svr4.h. */
2784 /* #define SELECT_RTX_SECTION(MODE, RTX, ALIGN) */
2786 /* Define this macro if jump tables (for `tablejump' insns) should be output in
2787 the text section, along with the assembler instructions. Otherwise, the
2788 readonly data section is used.
2790 This macro is irrelevant if there is no separate readonly data section. */
2791 /* #define JUMP_TABLES_IN_TEXT_SECTION */
2793 /* Decode SYM_NAME and store the real name part in VAR, sans the characters
2794 that encode section info. Define this macro if `ENCODE_SECTION_INFO' alters
2795 the symbol's name string. */
2796 /* #define STRIP_NAME_ENCODING(VAR, SYM_NAME) */
2798 /* A C statement to build up a unique section name, expressed as a
2799 STRING_CST node, and assign it to `DECL_SECTION_NAME (DECL)'.
2800 RELOC indicates whether the initial value of EXP requires
2801 link-time relocations. If you do not define this macro, GNU CC
2802 will use the symbol name prefixed by `.' as the section name.
2804 Defined in svr4.h. */
2805 /* #define UNIQUE_SECTION(DECL, RELOC) */
2808 /* Position Independent Code. */
2810 /* The register number of the register used to address a table of static data
2811 addresses in memory. In some cases this register is defined by a
2812 processor's "application binary interface" (ABI). When this macro is
2813 defined, RTL is generated for this register once, as with the stack pointer
2814 and frame pointer registers. If this macro is not defined, it is up to the
2815 machine-dependent files to allocate such a register (if necessary). */
2816 /* #define PIC_OFFSET_TABLE_REGNUM */
2818 /* Define this macro if the register defined by `PIC_OFFSET_TABLE_REGNUM' is
2819 clobbered by calls. Do not define this macro if `PIC_OFFSET_TABLE_REGNUM'
2821 /* #define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED */
2823 /* By generating position-independent code, when two different programs (A and
2824 B) share a common library (libC.a), the text of the library can be shared
2825 whether or not the library is linked at the same address for both programs.
2826 In some of these environments, position-independent code requires not only
2827 the use of different addressing modes, but also special code to enable the
2828 use of these addressing modes.
2830 The `FINALIZE_PIC' macro serves as a hook to emit these special codes once
2831 the function is being compiled into assembly code, but not before. (It is
2832 not done before, because in the case of compiling an inline function, it
2833 would lead to multiple PIC prologues being included in functions which used
2834 inline functions and were compiled to assembly language.) */
2835 /* #define FINALIZE_PIC */
2837 /* A C expression that is nonzero if X is a legitimate immediate operand on the
2838 target machine when generating position independent code. You can assume
2839 that X satisfies `CONSTANT_P', so you need not check this. You can also
2840 assume FLAG_PIC is true, so you need not check it either. You need not
2841 define this macro if all constants (including `SYMBOL_REF') can be immediate
2842 operands when generating position independent code. */
2843 /* #define LEGITIMATE_PIC_OPERAND_P(X) */
2846 /* The Overall Framework of an Assembler File. */
2848 /* A C expression which outputs to the stdio stream STREAM some appropriate
2849 text to go at the start of an assembler file.
2851 Normally this macro is defined to output a line containing `#NO_APP', which
2852 is a comment that has no effect on most assemblers but tells the GNU
2853 assembler that it can save time by not checking for certain assembler
2856 On systems that use SDB, it is necessary to output certain commands; see
2859 Defined in svr4.h. */
2861 /* #define ASM_FILE_START(STREAM) \
2862 output_file_directive ((STREAM), main_input_filename) */
2864 /* A C expression which outputs to the stdio stream STREAM some appropriate
2865 text to go at the end of an assembler file.
2867 If this macro is not defined, the default is to output nothing special at
2868 the end of the file. Most systems don't require any definition.
2870 On systems that use SDB, it is necessary to output certain commands; see
2873 Defined in svr4.h. */
2874 /* #define ASM_FILE_END(STREAM) */
2876 /* A C string constant describing how to begin a comment in the target
2877 assembler language. The compiler assumes that the comment will end at the
2879 #define ASM_COMMENT_START ";"
2881 /* A C string constant for text to be output before each `asm' statement or
2882 group of consecutive ones. Normally this is `"#APP"', which is a comment
2883 that has no effect on most assemblers but tells the GNU assembler that it
2884 must check the lines that follow for all valid assembler constructs. */
2885 #define ASM_APP_ON "#APP\n"
2887 /* A C string constant for text to be output after each `asm' statement or
2888 group of consecutive ones. Normally this is `"#NO_APP"', which tells the
2889 GNU assembler to resume making the time-saving assumptions that are valid
2890 for ordinary compiler output. */
2891 #define ASM_APP_OFF "#NO_APP\n"
2893 /* A C statement to output COFF information or DWARF debugging information
2894 which indicates that filename NAME is the current source file to the stdio
2897 This macro need not be defined if the standard form of output for the file
2898 format in use is appropriate. */
2899 /* #define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) */
2901 /* A C statement to output DBX or SDB debugging information before code for
2902 line number LINE of the current source file to the stdio stream STREAM.
2904 This macro need not be defined if the standard form of debugging information
2905 for the debugger in use is appropriate.
2907 Defined in svr4.h. */
2908 /* #define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) */
2910 /* A C statement to output something to the assembler file to handle a `#ident'
2911 directive containing the text STRING. If this macro is not defined, nothing
2912 is output for a `#ident' directive.
2914 Defined in svr4.h. */
2915 /* #define ASM_OUTPUT_IDENT(STREAM, STRING) */
2917 /* A C statement to output any assembler statements which are required to
2918 precede any Objective C object definitions or message sending. The
2919 statement is executed only when compiling an Objective C program. */
2920 /* #define OBJC_PROLOGUE */
2923 /* Output of Data. */
2925 /* A C statement to output to the stdio stream STREAM an assembler instruction
2926 to assemble a string constant containing the LEN bytes at PTR. PTR will be
2927 a C expression of type `char *' and LEN a C expression of type `int'.
2929 If the assembler has a `.ascii' pseudo-op as found in the Berkeley Unix
2930 assembler, do not define the macro `ASM_OUTPUT_ASCII'.
2932 Defined in svr4.h. */
2933 /* #define ASM_OUTPUT_ASCII(STREAM, PTR, LEN) */
2935 /* You may define this macro as a C expression. You should define the
2936 expression to have a non-zero value if GNU CC should output the
2937 constant pool for a function before the code for the function, or
2938 a zero value if GNU CC should output the constant pool after the
2939 function. If you do not define this macro, the usual case, GNU CC
2940 will output the constant pool before the function. */
2941 /* #define CONSTANT_POOL_BEFORE_FUNCTION */
2943 /* A C statement to output assembler commands to define the start of the
2944 constant pool for a function. FUNNAME is a string giving the name of the
2945 function. Should the return type of the function be required, it can be
2946 obtained via FUNDECL. SIZE is the size, in bytes, of the constant pool that
2947 will be written immediately after this call.
2949 If no constant-pool prefix is required, the usual case, this macro need not
2951 /* #define ASM_OUTPUT_POOL_PROLOGUE(FILE FUNNAME FUNDECL SIZE) */
2953 /* A C statement (with or without semicolon) to output a constant in the
2954 constant pool, if it needs special treatment. (This macro need not do
2955 anything for RTL expressions that can be output normally.)
2957 The argument FILE is the standard I/O stream to output the assembler code
2958 on. X is the RTL expression for the constant to output, and MODE is the
2959 machine mode (in case X is a `const_int'). ALIGN is the required alignment
2960 for the value X; you should output an assembler directive to force this much
2963 The argument LABELNO is a number to use in an internal label for the address
2964 of this pool entry. The definition of this macro is responsible for
2965 outputting the label definition at the proper place. Here is how to do
2968 ASM_OUTPUT_INTERNAL_LABEL (FILE, "LC", LABELNO);
2970 When you output a pool entry specially, you should end with a `goto' to the
2971 label JUMPTO. This will prevent the same pool entry from being output a
2972 second time in the usual manner.
2974 You need not define this macro if it would do nothing. */
2975 /* #define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, X, MODE, ALIGN, LABELNO, JUMPTO) */
2977 /* Define this macro as a C expression which is nonzero if the constant EXP, of
2978 type `tree', should be output after the code for a function. The compiler
2979 will normally output all constants before the function; you need not define
2980 this macro if this is OK. */
2981 /* #define CONSTANT_AFTER_FUNCTION_P(EXP) */
2983 /* A C statement to output assembler commands to at the end of the constant
2984 pool for a function. FUNNAME is a string giving the name of the function.
2985 Should the return type of the function be required, you can obtain it via
2986 FUNDECL. SIZE is the size, in bytes, of the constant pool that GNU CC wrote
2987 immediately before this call.
2989 If no constant-pool epilogue is required, the usual case, you need not
2990 define this macro. */
2991 /* #define ASM_OUTPUT_POOL_EPILOGUE (FILE FUNNAME FUNDECL SIZE) */
2993 /* Define this macro as a C expression which is nonzero if C is used as a
2994 logical line separator by the assembler.
2996 If you do not define this macro, the default is that only the character `;'
2997 is treated as a logical line separator. */
2998 /* #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) */
3000 /* These macros are provided by `real.h' for writing the definitions of
3001 `ASM_OUTPUT_DOUBLE' and the like: */
3004 /* Output of Uninitialized Variables. */
3006 /* A C statement (sans semicolon) to output to the stdio stream STREAM the
3007 assembler definition of a common-label named NAME whose size is SIZE bytes.
3008 The variable ROUNDED is the size rounded up to whatever alignment the caller
3011 Use the expression `assemble_name (STREAM, NAME)' to output the name itself;
3012 before and after that, output the additional assembler syntax for defining
3013 the name, and a newline.
3015 This macro controls how the assembler definitions of uninitialized global
3016 variables are output. */
3017 /* #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) */
3019 /* Like `ASM_OUTPUT_COMMON' except takes the required alignment as a separate,
3020 explicit argument. If you define this macro, it is used in place of
3021 `ASM_OUTPUT_COMMON', and gives you more flexibility in handling the required
3022 alignment of the variable. The alignment is specified as the number of
3025 Defined in svr4.h. */
3026 /* #define ASM_OUTPUT_ALIGNED_COMMON(STREAM, NAME, SIZE, ALIGNMENT) */
3028 /* Like ASM_OUTPUT_ALIGNED_COMMON except that it takes an additional argument -
3029 the DECL of the variable to be output, if there is one. This macro can be
3030 called with DECL == NULL_TREE. If you define this macro, it is used in
3031 place of both ASM_OUTPUT_COMMON and ASM_OUTPUT_ALIGNED_COMMON, and gives you
3032 more flexibility in handling the destination of the variable. */
3033 /* #define ASM_OUTPUT_DECL_COMMON (STREAM, DECL, NAME, SIZE, ALIGNMENT) */
3035 /* If defined, it is similar to `ASM_OUTPUT_COMMON', except that it is used
3036 when NAME is shared. If not defined, `ASM_OUTPUT_COMMON' will be used. */
3037 /* #define ASM_OUTPUT_SHARED_COMMON(STREAM, NAME, SIZE, ROUNDED) */
3039 /* A C statement (sans semicolon) to output to the stdio stream STREAM the
3040 assembler definition of uninitialized global DECL named NAME whose size is
3041 SIZE bytes. The variable ROUNDED is the size rounded up to whatever
3042 alignment the caller wants.
3044 Try to use function `asm_output_bss' defined in `varasm.c' when defining
3045 this macro. If unable, use the expression `assemble_name (STREAM, NAME)' to
3046 output the name itself; before and after that, output the additional
3047 assembler syntax for defining the name, and a newline.
3049 This macro controls how the assembler definitions of uninitialized global
3050 variables are output. This macro exists to properly support languages like
3051 `c++' which do not have `common' data. However, this macro currently is not
3052 defined for all targets. If this macro and `ASM_OUTPUT_ALIGNED_BSS' are not
3053 defined then `ASM_OUTPUT_COMMON' or `ASM_OUTPUT_ALIGNED_COMMON' or
3054 `ASM_OUTPUT_DECL_COMMON' is used. */
3055 /* #define ASM_OUTPUT_BSS(STREAM, DECL, NAME, SIZE, ROUNDED) */
3057 /* Like `ASM_OUTPUT_BSS' except takes the required alignment as a separate,
3058 explicit argument. If you define this macro, it is used in place of
3059 `ASM_OUTPUT_BSS', and gives you more flexibility in handling the required
3060 alignment of the variable. The alignment is specified as the number of
3063 Try to use function `asm_output_aligned_bss' defined in file `varasm.c' when
3064 defining this macro. */
3065 /* #define ASM_OUTPUT_ALIGNED_BSS(STREAM, DECL, NAME, SIZE, ALIGNMENT) */
3067 /* If defined, it is similar to `ASM_OUTPUT_BSS', except that it is used when
3068 NAME is shared. If not defined, `ASM_OUTPUT_BSS' will be used. */
3069 /* #define ASM_OUTPUT_SHARED_BSS(STREAM, DECL, NAME, SIZE, ROUNDED) */
3071 /* A C statement (sans semicolon) to output to the stdio stream STREAM the
3072 assembler definition of a local-common-label named NAME whose size is SIZE
3073 bytes. The variable ROUNDED is the size rounded up to whatever alignment
3076 Use the expression `assemble_name (STREAM, NAME)' to output the name itself;
3077 before and after that, output the additional assembler syntax for defining
3078 the name, and a newline.
3080 This macro controls how the assembler definitions of uninitialized static
3081 variables are output. */
3082 /* #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) */
3084 /* Like `ASM_OUTPUT_LOCAL' except takes the required alignment as a separate,
3085 explicit argument. If you define this macro, it is used in place of
3086 `ASM_OUTPUT_LOCAL', and gives you more flexibility in handling the required
3087 alignment of the variable. The alignment is specified as the number of
3090 Defined in svr4.h. */
3091 /* #define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGNMENT) */
3093 /* Like `ASM_OUTPUT_ALIGNED_LOCAL' except that it takes an additional
3094 parameter - the DECL of variable to be output, if there is one.
3095 This macro can be called with DECL == NULL_TREE. If you define
3096 this macro, it is used in place of `ASM_OUTPUT_LOCAL' and
3097 `ASM_OUTPUT_ALIGNED_LOCAL', and gives you more flexibility in
3098 handling the destination of the variable. */
3099 /* #define ASM_OUTPUT_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGNMENT) */
3101 /* If defined, it is similar to `ASM_OUTPUT_LOCAL', except that it is used when
3102 NAME is shared. If not defined, `ASM_OUTPUT_LOCAL' will be used. */
3103 /* #define ASM_OUTPUT_SHARED_LOCAL (STREAM, NAME, SIZE, ROUNDED) */
3106 /* Output and Generation of Labels. */
3108 /* A C statement (sans semicolon) to output to the stdio stream STREAM the
3109 assembler definition of a label named NAME. Use the expression
3110 `assemble_name (STREAM, NAME)' to output the name itself; before and after
3111 that, output the additional assembler syntax for defining the name, and a
3114 #define ASM_OUTPUT_LABEL(STREAM, NAME) \
3116 assemble_name (STREAM, NAME); \
3117 fputs (":\n", STREAM); \
3120 /* A C statement (sans semicolon) to output to the stdio stream STREAM any text
3121 necessary for declaring the name NAME of a function which is being defined.
3122 This macro is responsible for outputting the label definition (perhaps using
3123 `ASM_OUTPUT_LABEL'). The argument DECL is the `FUNCTION_DECL' tree node
3124 representing the function.
3126 If this macro is not defined, then the function name is defined in the usual
3127 manner as a label (by means of `ASM_OUTPUT_LABEL').
3129 Defined in svr4.h. */
3130 /* #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) */
3132 /* A C statement (sans semicolon) to output to the stdio stream STREAM any text
3133 necessary for declaring the size of a function which is being defined. The
3134 argument NAME is the name of the function. The argument DECL is the
3135 `FUNCTION_DECL' tree node representing the function.
3137 If this macro is not defined, then the function size is not defined.
3139 Defined in svr4.h. */
3140 /* #define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL) */
3142 /* A C statement (sans semicolon) to output to the stdio stream STREAM any text
3143 necessary for declaring the name NAME of an initialized variable which is
3144 being defined. This macro must output the label definition (perhaps using
3145 `ASM_OUTPUT_LABEL'). The argument DECL is the `VAR_DECL' tree node
3146 representing the variable.
3148 If this macro is not defined, then the variable name is defined in the usual
3149 manner as a label (by means of `ASM_OUTPUT_LABEL').
3151 Defined in svr4.h. */
3152 /* #define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) */
3154 /* A C statement (sans semicolon) to finish up declaring a variable name once
3155 the compiler has processed its initializer fully and thus has had a chance
3156 to determine the size of an array when controlled by an initializer. This
3157 is used on systems where it's necessary to declare something about the size
3160 If you don't define this macro, that is equivalent to defining it to do
3163 Defined in svr4.h. */
3164 /* #define ASM_FINISH_DECLARE_OBJECT(STREAM, DECL, TOPLEVEL, ATEND) */
3166 /* A C statement (sans semicolon) to output to the stdio stream STREAM some
3167 commands that will make the label NAME global; that is, available for
3168 reference from other files. Use the expression `assemble_name (STREAM,
3169 NAME)' to output the name itself; before and after that, output the
3170 additional assembler syntax for making that name global, and a newline. */
3172 #define ASM_GLOBALIZE_LABEL(STREAM,NAME) \
3174 fputs ("\t.globl ", STREAM); \
3175 assemble_name (STREAM, NAME); \
3176 fputs ("\n", STREAM); \
3179 /* A C statement (sans semicolon) to output to the stdio stream STREAM some
3180 commands that will make the label NAME weak; that is, available for
3181 reference from other files but only used if no other definition is
3182 available. Use the expression `assemble_name (STREAM, NAME)' to output the
3183 name itself; before and after that, output the additional assembler syntax
3184 for making that name weak, and a newline.
3186 If you don't define this macro, GNU CC will not support weak symbols and you
3187 should not define the `SUPPORTS_WEAK' macro.
3189 Defined in svr4.h. */
3190 /* #define ASM_WEAKEN_LABEL */
3192 /* A C expression which evaluates to true if the target supports weak symbols.
3194 If you don't define this macro, `defaults.h' provides a default definition.
3195 If `ASM_WEAKEN_LABEL' is defined, the default definition is `1'; otherwise,
3196 it is `0'. Define this macro if you want to control weak symbol support
3197 with a compiler flag such as `-melf'. */
3198 /* #define SUPPORTS_WEAK */
3200 /* A C statement (sans semicolon) to mark DECL to be emitted as a
3201 public symbol such that extra copies in multiple translation units
3202 will be discarded by the linker. Define this macro if your object
3203 file format provides support for this concept, such as the `COMDAT'
3204 section flags in the Microsoft Windows PE/COFF format, and this
3205 support requires changes to DECL, such as putting it in a separate
3208 Defined in svr4.h. */
3209 /* #define MAKE_DECL_ONE_ONLY */
3211 /* A C expression which evaluates to true if the target supports one-only
3214 If you don't define this macro, `varasm.c' provides a default definition.
3215 If `MAKE_DECL_ONE_ONLY' is defined, the default definition is `1';
3216 otherwise, it is `0'. Define this macro if you want to control one-only
3217 symbol support with a compiler flag, or if setting the `DECL_ONE_ONLY' flag
3218 is enough to mark a declaration to be emitted as one-only. */
3219 /* #define SUPPORTS_ONE_ONLY */
3221 /* A C statement (sans semicolon) to output to the stdio stream STREAM any text
3222 necessary for declaring the name of an external symbol named NAME which is
3223 referenced in this compilation but not defined. The value of DECL is the
3224 tree node for the declaration.
3226 This macro need not be defined if it does not need to output anything. The
3227 GNU assembler and most Unix assemblers don't require anything. */
3228 /* #define ASM_OUTPUT_EXTERNAL(STREAM, DECL, NAME) */
3230 /* A C statement (sans semicolon) to output on STREAM an assembler pseudo-op to
3231 declare a library function name external. The name of the library function
3232 is given by SYMREF, which has type `rtx' and is a `symbol_ref'.
3234 This macro need not be defined if it does not need to output anything. The
3235 GNU assembler and most Unix assemblers don't require anything.
3237 Defined in svr4.h. */
3238 /* #define ASM_OUTPUT_EXTERNAL_LIBCALL(STREAM, SYMREF) */
3240 /* A C statement (sans semicolon) to output to the stdio stream STREAM a
3241 reference in assembler syntax to a label named NAME. This should add `_' to
3242 the front of the name, if that is customary on your operating system, as it
3243 is in most Berkeley Unix systems. This macro is used in `assemble_name'. */
3244 /* #define ASM_OUTPUT_LABELREF(STREAM, NAME) */
3246 /* A C statement to output to the stdio stream STREAM a label whose name is
3247 made from the string PREFIX and the number NUM.
3249 It is absolutely essential that these labels be distinct from the labels
3250 used for user-level functions and variables. Otherwise, certain programs
3251 will have name conflicts with internal labels.
3253 It is desirable to exclude internal labels from the symbol table of the
3254 object file. Most assemblers have a naming convention for labels that
3255 should be excluded; on many systems, the letter `L' at the beginning of a
3256 label has this effect. You should find out what convention your system
3257 uses, and follow it.
3259 The usual definition of this macro is as follows:
3261 fprintf (STREAM, "L%s%d:\n", PREFIX, NUM)
3263 Defined in svr4.h. */
3264 /* #define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) */
3266 /* A C statement to store into the string STRING a label whose name is made
3267 from the string PREFIX and the number NUM.
3269 This string, when output subsequently by `assemble_name', should produce the
3270 output that `ASM_OUTPUT_INTERNAL_LABEL' would produce with the same PREFIX
3273 If the string begins with `*', then `assemble_name' will output the rest of
3274 the string unchanged. It is often convenient for
3275 `ASM_GENERATE_INTERNAL_LABEL' to use `*' in this way. If the string doesn't
3276 start with `*', then `ASM_OUTPUT_LABELREF' gets to output the string, and
3277 may change it. (Of course, `ASM_OUTPUT_LABELREF' is also part of your
3278 machine description, so you should know what it does on your machine.)
3280 Defined in svr4.h. */
3283 #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
3285 sprintf (LABEL, "*.%s%d", PREFIX, NUM); \
3289 /* A C expression to assign to OUTVAR (which is a variable of type `char *') a
3290 newly allocated string made from the string NAME and the number NUMBER, with
3291 some suitable punctuation added. Use `alloca' to get space for the string.
3293 The string will be used as an argument to `ASM_OUTPUT_LABELREF' to produce
3294 an assembler label for an internal static variable whose name is NAME.
3295 Therefore, the string must be such as to result in valid assembler code.
3296 The argument NUMBER is different each time this macro is executed; it
3297 prevents conflicts between similarly-named internal static variables in
3300 Ideally this string should not be a valid C identifier, to prevent any
3301 conflict with the user's own symbols. Most assemblers allow periods or
3302 percent signs in assembler symbols; putting at least one of these between
3303 the name and the number will suffice. */
3305 #define ASM_FORMAT_PRIVATE_NAME(OUTVAR, NAME, NUMBER) \
3307 (OUTVAR) = (char *) alloca (strlen ((NAME)) + 12); \
3308 sprintf ((OUTVAR), "%s.%ld", (NAME), (long)(NUMBER)); \
3311 /* A C statement to output to the stdio stream STREAM assembler code which
3312 defines (equates) the symbol NAME to have the value VALUE.
3314 If SET_ASM_OP is defined, a default definition is provided which is correct
3317 Defined in svr4.h. */
3318 /* #define ASM_OUTPUT_DEF(STREAM, NAME, VALUE) */
3320 /* A C statement to output to the stdio stream STREAM assembler code which
3321 defines (equates) the weak symbol NAME to have the value VALUE.
3323 Define this macro if the target only supports weak aliases; define
3324 ASM_OUTPUT_DEF instead if possible. */
3325 /* #define ASM_OUTPUT_WEAK_ALIAS (STREAM, NAME, VALUE) */
3327 /* Define this macro to override the default assembler names used for Objective
3330 The default name is a unique method number followed by the name of the class
3331 (e.g. `_1_Foo'). For methods in categories, the name of the category is
3332 also included in the assembler name (e.g. `_1_Foo_Bar').
3334 These names are safe on most systems, but make debugging difficult since the
3335 method's selector is not present in the name. Therefore, particular systems
3336 define other ways of computing names.
3338 BUF is an expression of type `char *' which gives you a buffer in which to
3339 store the name; its length is as long as CLASS_NAME, CAT_NAME and SEL_NAME
3340 put together, plus 50 characters extra.
3342 The argument IS_INST specifies whether the method is an instance method or a
3343 class method; CLASS_NAME is the name of the class; CAT_NAME is the name of
3344 the category (or NULL if the method is not in a category); and SEL_NAME is
3345 the name of the selector.
3347 On systems where the assembler can handle quoted names, you can use this
3348 macro to provide more human-readable names. */
3349 /* #define OBJC_GEN_METHOD_LABEL(BUF, IS_INST, CLASS_NAME, CAT_NAME, SEL_NAME) */
3352 /* Macros Controlling Initialization Routines. */
3354 /* If defined, a C string constant for the assembler operation to identify the
3355 following data as initialization code. If not defined, GNU CC will assume
3356 such a section does not exist. When you are using special sections for
3357 initialization and termination functions, this macro also controls how
3358 `crtstuff.c' and `libgcc2.c' arrange to run the initialization functions.
3360 Defined in svr4.h. */
3361 /* #define INIT_SECTION_ASM_OP */
3362 #undef INIT_SECTION_ASM_OP
3364 /* If defined, `main' will not call `__main' as described above. This macro
3365 should be defined for systems that control the contents of the init section
3366 on a symbol-by-symbol basis, such as OSF/1, and should not be defined
3367 explicitly for systems that support `INIT_SECTION_ASM_OP'. */
3368 /* #define HAS_INIT_SECTION */
3370 /* If defined, a C string constant for a switch that tells the linker that the
3371 following symbol is an initialization routine. */
3372 /* #define LD_INIT_SWITCH */
3374 /* If defined, a C string constant for a switch that tells the linker that the
3375 following symbol is a finalization routine. */
3376 /* #define LD_FINI_SWITCH */
3378 /* If defined, `main' will call `__main' despite the presence of
3379 `INIT_SECTION_ASM_OP'. This macro should be defined for systems where the
3380 init section is not actually run automatically, but is still useful for
3381 collecting the lists of constructors and destructors. */
3382 #define INVOKE__main
3384 /* If your system uses `collect2' as the means of processing constructors, then
3385 that program normally uses `nm' to scan an object file for constructor
3386 functions to be called. On certain kinds of systems, you can define these
3387 macros to make `collect2' work faster (and, in some cases, make it work at
3390 /* Define this macro if the system uses COFF (Common Object File Format) object
3391 files, so that `collect2' can assume this format and scan object files
3392 directly for dynamic constructor/destructor functions. */
3393 /* #define OBJECT_FORMAT_COFF */
3395 /* Define this macro if the system uses ROSE format object files, so that
3396 `collect2' can assume this format and scan object files directly for dynamic
3397 constructor/destructor functions.
3399 These macros are effective only in a native compiler; `collect2' as
3400 part of a cross compiler always uses `nm' for the target machine. */
3401 /* #define OBJECT_FORMAT_ROSE */
3403 /* Define this macro if the system uses ELF format object files.
3405 Defined in svr4.h. */
3406 /* #define OBJECT_FORMAT_ELF */
3408 /* Define this macro as a C string constant containing the file name to use to
3409 execute `nm'. The default is to search the path normally for `nm'.
3411 If your system supports shared libraries and has a program to list the
3412 dynamic dependencies of a given library or executable, you can define these
3413 macros to enable support for running initialization and termination
3414 functions in shared libraries: */
3415 /* #define REAL_NM_FILE_NAME */
3417 /* Define this macro to a C string constant containing the name of the program
3418 which lists dynamic dependencies, like `"ldd"' under SunOS 4. */
3419 /* #define LDD_SUFFIX */
3421 /* Define this macro to be C code that extracts filenames from the output of
3422 the program denoted by `LDD_SUFFIX'. PTR is a variable of type `char *'
3423 that points to the beginning of a line of output from `LDD_SUFFIX'. If the
3424 line lists a dynamic dependency, the code must advance PTR to the beginning
3425 of the filename on that line. Otherwise, it must set PTR to `NULL'. */
3426 /* #define PARSE_LDD_OUTPUT (PTR) */
3429 /* Output of Assembler Instructions. */
3431 /* A C initializer containing the assembler's names for the machine registers,
3432 each one as a C string constant. This is what translates register numbers
3433 in the compiler into assembler language. */
3434 #define REGISTER_NAMES \
3436 "r0", "r1", "r2", "r3", \
3437 "r4", "r5", "r6", "r7", \
3438 "r8", "r9", "r10", "r11", \
3439 "r12", "r13", "r14", "r15", \
3440 "r16", "r17", "r18", "r19", \
3441 "r20", "r21", "r22", "r23", \
3442 "r24", "r25", "r26", "r27", \
3443 "r28", "r29", "r30", "r31", \
3444 "r32", "r33", "r34", "r35", \
3445 "r36", "r37", "r38", "r39", \
3446 "r40", "r41", "r42", "r43", \
3447 "r44", "r45", "r46", "r47", \
3448 "r48", "r49", "r50", "r51", \
3449 "r52", "r53", "r54", "r55", \
3450 "r56", "r57", "r58", "r59", \
3451 "r60", "r61", "link", "sp", \
3453 "f0", "f1", "f2", "f3", \
3454 "s", "v", "va", "c", \
3456 "psw", "bpsw", "pc", "bpc", \
3457 "dpsw", "dpc", "rpt_c", "rpt_s", \
3458 "rpt_e", "mod_s", "mod_e", "iba", \
3459 "eit_vb", "int_s", "int_m", \
3462 /* If defined, a C initializer for an array of structures containing a name and
3463 a register number. This macro defines additional names for hard registers,
3464 thus allowing the `asm' option in declarations to refer to registers using
3466 #define ADDITIONAL_REGISTER_NAMES \
3468 {"r62", GPR_LINK}, \
3471 {"f5", FLAG_OVERFLOW}, \
3472 {"f6", FLAG_ACC_OVER}, \
3473 {"f7", FLAG_CARRY}, \
3474 {"carry", FLAG_CARRY}, \
3475 {"borrow", FLAG_BORROW}, \
3476 {"b", FLAG_BORROW}, \
3483 {"cr7", CR_RPT_C}, \
3484 {"cr8", CR_RPT_S}, \
3485 {"cr9", CR_RPT_E}, \
3486 {"cr10", CR_MOD_S}, \
3487 {"cr11", CR_MOD_E}, \
3489 {"cr15", CR_EIT_VB}, \
3490 {"cr16", CR_INT_S}, \
3491 {"cr17", CR_INT_M} \
3494 /* Define this macro if you are using an unusual assembler that requires
3495 different names for the machine instructions.
3497 The definition is a C statement or statements which output an assembler
3498 instruction opcode to the stdio stream STREAM. The macro-operand PTR is a
3499 variable of type `char *' which points to the opcode name in its "internal"
3500 form--the form that is written in the machine description. The definition
3501 should output the opcode name to STREAM, performing any translation you
3502 desire, and increment the variable PTR to point at the end of the opcode so
3503 that it will not be output twice.
3505 In fact, your macro definition may process less than the entire opcode name,
3506 or more than the opcode name; but if you want to process text that includes
3507 `%'-sequences to substitute operands, you must take care of the substitution
3508 yourself. Just be sure to increment PTR over whatever text should not be
3511 If you need to look at the operand values, they can be found as the elements
3512 of `recog_data.operand'.
3514 If the macro definition does nothing, the instruction is output in the usual
3516 /* #define ASM_OUTPUT_OPCODE(STREAM, PTR) */
3518 /* If defined, a C statement to be executed just prior to the output of
3519 assembler code for INSN, to modify the extracted operands so they will be
3522 Here the argument OPVEC is the vector containing the operands extracted from
3523 INSN, and NOPERANDS is the number of elements of the vector which contain
3524 meaningful data for this insn. The contents of this vector are what will be
3525 used to convert the insn template into assembler code, so you can change the
3526 assembler output by changing the contents of the vector.
3528 This macro is useful when various assembler syntaxes share a single file of
3529 instruction patterns; by defining this macro differently, you can cause a
3530 large class of instructions to be output differently (such as with
3531 rearranged operands). Naturally, variations in assembler syntax affecting
3532 individual insn patterns ought to be handled by writing conditional output
3533 routines in those patterns.
3535 If this macro is not defined, it is equivalent to a null statement. */
3536 /* #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) */
3538 /* If defined, `FINAL_PRESCAN_INSN' will be called on each
3539 `CODE_LABEL'. In that case, OPVEC will be a null pointer and
3540 NOPERANDS will be zero. */
3541 /* #define FINAL_PRESCAN_LABEL */
3543 /* A C compound statement to output to stdio stream STREAM the assembler syntax
3544 for an instruction operand X. X is an RTL expression.
3546 CODE is a value that can be used to specify one of several ways of printing
3547 the operand. It is used when identical operands must be printed differently
3548 depending on the context. CODE comes from the `%' specification that was
3549 used to request printing of the operand. If the specification was just
3550 `%DIGIT' then CODE is 0; if the specification was `%LTR DIGIT' then CODE is
3551 the ASCII code for LTR.
3553 If X is a register, this macro should print the register's name. The names
3554 can be found in an array `reg_names' whose type is `char *[]'. `reg_names'
3555 is initialized from `REGISTER_NAMES'.
3557 When the machine description has a specification `%PUNCT' (a `%' followed by
3558 a punctuation character), this macro is called with a null pointer for X and
3559 the punctuation character for CODE.
3561 Standard operand flags that are handled elsewhere:
3562 `=' Output a number unique to each instruction in the compilation.
3563 `a' Substitute an operand as if it were a memory reference.
3564 `c' Omit the syntax that indicates an immediate operand.
3565 `l' Substitute a LABEL_REF into a jump instruction.
3566 `n' Like %cDIGIT, except negate the value before printing.
3568 The d30v specific operand flags are:
3570 `f' Print a SF constant as an int.
3571 `s' Subtract 32 and negate.
3572 `A' Print accumulator number without an `a' in front of it.
3573 `B' Print bit offset for BSET, etc. instructions.
3574 `E' Print u if this is zero extend, nothing if this is sign extend.
3575 `F' Emit /{f,t,x}{f,t,x} for executing a false condition.
3576 `L' Print the lower half of a 64 bit item.
3577 `M' Print a memory reference for ld/st instructions.
3578 `R' Return appropriate cmp instruction for relational test.
3580 `T' Emit /{f,t,x}{f,t,x} for executing a true condition.
3581 `U' Print the upper half of a 64 bit item. */
3583 #define PRINT_OPERAND(STREAM, X, CODE) d30v_print_operand (STREAM, X, CODE)
3585 /* A C expression which evaluates to true if CODE is a valid punctuation
3586 character for use in the `PRINT_OPERAND' macro. If
3587 `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no punctuation
3588 characters (except for the standard one, `%') are used in this way. */
3590 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '.' || (CODE) == ':')
3592 /* A C compound statement to output to stdio stream STREAM the assembler syntax
3593 for an instruction operand that is a memory reference whose address is X. X
3594 is an RTL expression.
3596 On some machines, the syntax for a symbolic address depends on the section
3597 that the address refers to. On these machines, define the macro
3598 `ENCODE_SECTION_INFO' to store the information into the `symbol_ref', and
3599 then check for it here. *Note Assembler Format::. */
3601 #define PRINT_OPERAND_ADDRESS(STREAM, X) d30v_print_operand_address (STREAM, X)
3603 /* A C statement, to be executed after all slot-filler instructions have been
3604 output. If necessary, call `dbr_sequence_length' to determine the number of
3605 slots filled in a sequence (zero if not currently outputting a sequence), to
3606 decide how many no-ops to output, or whatever.
3608 Don't define this macro if it has nothing to do, but it is helpful in
3609 reading assembly output if the extent of the delay sequence is made explicit
3610 (e.g. with white space).
3612 Note that output routines for instructions with delay slots must be prepared
3613 to deal with not being output as part of a sequence (i.e. when the
3614 scheduling pass is not run, or when no slot fillers could be found.) The
3615 variable `final_sequence' is null when not processing a sequence, otherwise
3616 it contains the `sequence' rtx being output. */
3617 /* #define DBR_OUTPUT_SEQEND(FILE) */
3619 /* If defined, C string expressions to be used for the `%R', `%L', `%U', and
3620 `%I' options of `asm_fprintf' (see `final.c'). These are useful when a
3621 single `md' file must support multiple assembler formats. In that case, the
3622 various `tm.h' files can define these macros differently.
3624 USER_LABEL_PREFIX is defined in svr4.h. */
3626 #define REGISTER_PREFIX "%"
3627 #define LOCAL_LABEL_PREFIX "."
3628 #define USER_LABEL_PREFIX ""
3629 #define IMMEDIATE_PREFIX ""
3631 /* If your target supports multiple dialects of assembler language (such as
3632 different opcodes), define this macro as a C expression that gives the
3633 numeric index of the assembler language dialect to use, with zero as the
3636 If this macro is defined, you may use `{option0|option1|option2...}'
3637 constructs in the output templates of patterns (*note Output Template::.) or
3638 in the first argument of `asm_fprintf'. This construct outputs `option0',
3639 `option1' or `option2', etc., if the value of `ASSEMBLER_DIALECT' is zero,
3640 one or two, etc. Any special characters within these strings retain their
3643 If you do not define this macro, the characters `{', `|' and `}' do not have
3644 any special meaning when used in templates or operands to `asm_fprintf'.
3646 Define the macros `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX',
3647 `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' if you can express the variations
3648 in assemble language syntax with that mechanism. Define `ASSEMBLER_DIALECT'
3649 and use the `{option0|option1}' syntax if the syntax variant are larger and
3650 involve such things as different opcodes or operand order. */
3651 /* #define ASSEMBLER_DIALECT */
3653 /* A C expression to output to STREAM some assembler code which will push hard
3654 register number REGNO onto the stack. The code need not be optimal, since
3655 this macro is used only when profiling. */
3656 /* #define ASM_OUTPUT_REG_PUSH (STREAM, REGNO) */
3658 /* A C expression to output to STREAM some assembler code which will pop hard
3659 register number REGNO off of the stack. The code need not be optimal, since
3660 this macro is used only when profiling. */
3661 /* #define ASM_OUTPUT_REG_POP (STREAM, REGNO) */
3664 /* Output of dispatch tables. */
3666 /* This macro should be provided on machines where the addresses in a dispatch
3667 table are relative to the table's own address.
3669 The definition should be a C statement to output to the stdio stream STREAM
3670 an assembler pseudo-instruction to generate a difference between two labels.
3671 VALUE and REL are the numbers of two internal labels. The definitions of
3672 these labels are output using `ASM_OUTPUT_INTERNAL_LABEL', and they must be
3673 printed in the same way here. For example,
3675 fprintf (STREAM, "\t.word L%d-L%d\n", VALUE, REL) */
3677 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
3678 fprintf (STREAM, "\t.word .L%d-.L%d\n", VALUE, REL)
3680 /* This macro should be provided on machines where the addresses in a dispatch
3683 The definition should be a C statement to output to the stdio stream STREAM
3684 an assembler pseudo-instruction to generate a reference to a label. VALUE
3685 is the number of an internal label whose definition is output using
3686 `ASM_OUTPUT_INTERNAL_LABEL'. For example,
3688 fprintf (STREAM, "\t.word L%d\n", VALUE) */
3690 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
3691 fprintf (STREAM, "\t.word .L%d\n", VALUE)
3693 /* Define this if the label before a jump-table needs to be output specially.
3694 The first three arguments are the same as for `ASM_OUTPUT_INTERNAL_LABEL';
3695 the fourth argument is the jump-table which follows (a `jump_insn'
3696 containing an `addr_vec' or `addr_diff_vec').
3698 This feature is used on system V to output a `swbeg' statement for the
3701 If this macro is not defined, these labels are output with
3702 `ASM_OUTPUT_INTERNAL_LABEL'.
3704 Defined in svr4.h. */
3705 /* #define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) */
3707 /* Define this if something special must be output at the end of a jump-table.
3708 The definition should be a C statement to be executed after the assembler
3709 code for the table is written. It should write the appropriate code to
3710 stdio stream STREAM. The argument TABLE is the jump-table insn, and NUM is
3711 the label-number of the preceding label.
3713 If this macro is not defined, nothing special is output at the end of the
3715 /* #define ASM_OUTPUT_CASE_END(STREAM, NUM, TABLE) */
3718 /* Assembler Commands for Exception Regions. */
3720 /* An rtx used to mask the return address found via RETURN_ADDR_RTX, so that it
3721 does not contain any extraneous set bits in it. */
3722 /* #define MASK_RETURN_ADDR */
3724 /* Define this macro to 0 if your target supports DWARF 2 frame unwind
3725 information, but it does not yet work with exception handling. Otherwise,
3726 if your target supports this information (if it defines
3727 `INCOMING_RETURN_ADDR_RTX'), GCC will provide a default definition of 1.
3729 If this macro is defined to 1, the DWARF 2 unwinder will be the default
3730 exception handling mechanism; otherwise, setjmp/longjmp will be used by
3733 If this macro is defined to anything, the DWARF 2 unwinder will be used
3734 instead of inline unwinders and __unwind_function in the non-setjmp case. */
3735 /* #define DWARF2_UNWIND_INFO */
3738 /* Assembler Commands for Alignment. */
3740 /* The alignment (log base 2) to put in front of LABEL, which follows
3743 This macro need not be defined if you don't want any special alignment to be
3744 done at such a time. Most machine descriptions do not currently define the
3746 /* #define LABEL_ALIGN_AFTER_BARRIER(LABEL) */
3748 /* The desired alignment for the location counter at the beginning
3751 This macro need not be defined if you don't want any special alignment to be
3752 done at such a time. Most machine descriptions do not currently define the
3754 /* #define LOOP_ALIGN(LABEL) */
3756 /* A C statement to output to the stdio stream STREAM an assembler instruction
3757 to advance the location counter by NBYTES bytes. Those bytes should be zero
3758 when loaded. NBYTES will be a C expression of type `int'.
3760 Defined in svr4.h. */
3761 /* #define ASM_OUTPUT_SKIP(STREAM, NBYTES) \
3762 fprintf (STREAM, "\t.zero\t%u\n", (NBYTES)) */
3764 /* Define this macro if `ASM_OUTPUT_SKIP' should not be used in the text
3765 section because it fails put zeros in the bytes that are skipped. This is
3766 true on many Unix systems, where the pseudo-op to skip bytes produces no-op
3767 instructions rather than zeros when used in the text section. */
3768 /* #define ASM_NO_SKIP_IN_TEXT */
3770 /* A C statement to output to the stdio stream STREAM an assembler command to
3771 advance the location counter to a multiple of 2 to the POWER bytes. POWER
3772 will be a C expression of type `int'. */
3773 #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
3774 fprintf ((STREAM), "\t.p2align %d\n", (POWER))
3777 /* Macros Affecting all Debug Formats. */
3779 /* A C expression that returns the DBX register number for the compiler
3780 register number REGNO. In simple cases, the value of this expression may be
3781 REGNO itself. But sometimes there are some registers that the compiler
3782 knows about and DBX does not, or vice versa. In such cases, some register
3783 may need to have one number in the compiler and another for DBX.
3785 If two registers have consecutive numbers inside GNU CC, and they can be
3786 used as a pair to hold a multiword value, then they *must* have consecutive
3787 numbers after renumbering with `DBX_REGISTER_NUMBER'. Otherwise, debuggers
3788 will be unable to access such a pair, because they expect register pairs to
3789 be consecutive in their own numbering scheme.
3791 If you find yourself defining `DBX_REGISTER_NUMBER' in way that does not
3792 preserve register pairs, then what you must do instead is redefine the
3793 actual register numbering scheme. */
3794 #define DBX_REGISTER_NUMBER(REGNO) \
3795 (GPR_P (REGNO) ? ((REGNO) - GPR_FIRST) \
3796 : ACCUM_P (REGNO) ? ((REGNO) - ACCUM_FIRST + 84) \
3797 : FLAG_P (REGNO) ? 66 /* return psw for all flags */ \
3798 : (REGNO) == ARG_POINTER_REGNUM ? (GPR_SP - GPR_FIRST) \
3799 : (REGNO) == CR_PSW ? (66 + 0) \
3800 : (REGNO) == CR_BPSW ? (66 + 1) \
3801 : (REGNO) == CR_PC ? (66 + 2) \
3802 : (REGNO) == CR_BPC ? (66 + 3) \
3803 : (REGNO) == CR_DPSW ? (66 + 4) \
3804 : (REGNO) == CR_DPC ? (66 + 5) \
3805 : (REGNO) == CR_RPT_C ? (66 + 7) \
3806 : (REGNO) == CR_RPT_S ? (66 + 8) \
3807 : (REGNO) == CR_RPT_E ? (66 + 9) \
3808 : (REGNO) == CR_MOD_S ? (66 + 10) \
3809 : (REGNO) == CR_MOD_E ? (66 + 11) \
3810 : (REGNO) == CR_IBA ? (66 + 14) \
3811 : (REGNO) == CR_EIT_VB ? (66 + 15) \
3812 : (REGNO) == CR_INT_S ? (66 + 16) \
3813 : (REGNO) == CR_INT_M ? (66 + 17) \
3816 /* A C expression that returns the integer offset value for an automatic
3817 variable having address X (an RTL expression). The default computation
3818 assumes that X is based on the frame-pointer and gives the offset from the
3819 frame-pointer. This is required for targets that produce debugging output
3820 for DBX or COFF-style debugging output for SDB and allow the frame-pointer
3821 to be eliminated when the `-g' options is used. */
3822 /* #define DEBUGGER_AUTO_OFFSET(X) */
3824 /* A C expression that returns the integer offset value for an argument having
3825 address X (an RTL expression). The nominal offset is OFFSET. */
3826 /* #define DEBUGGER_ARG_OFFSET(OFFSET, X) */
3828 /* A C expression that returns the type of debugging output GNU CC produces
3829 when the user specifies `-g' or `-ggdb'. Define this if you have arranged
3830 for GNU CC to support more than one format of debugging output. Currently,
3831 the allowable values are `DBX_DEBUG', `SDB_DEBUG', `DWARF_DEBUG',
3832 `DWARF2_DEBUG', and `XCOFF_DEBUG'.
3834 The value of this macro only affects the default debugging output; the user
3835 can always get a specific type of output by using `-gstabs', `-gcoff',
3836 `-gdwarf-1', `-gdwarf-2', or `-gxcoff'.
3838 Defined in svr4.h. */
3840 #undef PREFERRED_DEBUGGING_TYPE
3841 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
3844 /* Specific Options for DBX Output. */
3846 /* Define this macro if GNU CC should produce debugging output for DBX in
3847 response to the `-g' option.
3849 Defined in svr4.h. */
3850 /* #define DBX_DEBUGGING_INFO */
3852 /* Define this macro if GNU CC should produce XCOFF format debugging output in
3853 response to the `-g' option. This is a variant of DBX format. */
3854 /* #define XCOFF_DEBUGGING_INFO */
3856 /* Define this macro to control whether GNU CC should by default generate GDB's
3857 extended version of DBX debugging information (assuming DBX-format debugging
3858 information is enabled at all). If you don't define the macro, the default
3859 is 1: always generate the extended information if there is any occasion to. */
3860 /* #define DEFAULT_GDB_EXTENSIONS */
3862 /* Define this macro if all `.stabs' commands should be output while in the
3864 /* #define DEBUG_SYMS_TEXT */
3866 /* A C string constant naming the assembler pseudo op to use instead of
3867 `.stabs' to define an ordinary debugging symbol. If you don't define this
3868 macro, `.stabs' is used. This macro applies only to DBX debugging
3869 information format. */
3870 /* #define ASM_STABS_OP */
3872 /* A C string constant naming the assembler pseudo op to use instead of
3873 `.stabd' to define a debugging symbol whose value is the current location.
3874 If you don't define this macro, `.stabd' is used. This macro applies only
3875 to DBX debugging information format. */
3876 /* #define ASM_STABD_OP */
3878 /* A C string constant naming the assembler pseudo op to use instead of
3879 `.stabn' to define a debugging symbol with no name. If you don't define
3880 this macro, `.stabn' is used. This macro applies only to DBX debugging
3881 information format. */
3882 /* #define ASM_STABN_OP */
3884 /* Define this macro if DBX on your system does not support the construct
3885 `xsTAGNAME'. On some systems, this construct is used to describe a forward
3886 reference to a structure named TAGNAME. On other systems, this construct is
3887 not supported at all. */
3888 /* #define DBX_NO_XREFS */
3890 /* A symbol name in DBX-format debugging information is normally continued
3891 (split into two separate `.stabs' directives) when it exceeds a certain
3892 length (by default, 80 characters). On some operating systems, DBX requires
3893 this splitting; on others, splitting must not be done. You can inhibit
3894 splitting by defining this macro with the value zero. You can override the
3895 default splitting-length by defining this macro as an expression for the
3896 length you desire. */
3897 /* #define DBX_CONTIN_LENGTH */
3899 /* Normally continuation is indicated by adding a `\' character to the end of a
3900 `.stabs' string when a continuation follows. To use a different character
3901 instead, define this macro as a character constant for the character you
3902 want to use. Do not define this macro if backslash is correct for your
3904 /* #define DBX_CONTIN_CHAR */
3906 /* Define this macro if it is necessary to go to the data section before
3907 outputting the `.stabs' pseudo-op for a non-global static variable. */
3908 /* #define DBX_STATIC_STAB_DATA_SECTION */
3910 /* The value to use in the "code" field of the `.stabs' directive for a
3911 typedef. The default is `N_LSYM'. */
3912 /* #define DBX_TYPE_DECL_STABS_CODE */
3914 /* The value to use in the "code" field of the `.stabs' directive for a static
3915 variable located in the text section. DBX format does not provide any
3916 "right" way to do this. The default is `N_FUN'. */
3917 /* #define DBX_STATIC_CONST_VAR_CODE */
3919 /* The value to use in the "code" field of the `.stabs' directive for a
3920 parameter passed in registers. DBX format does not provide any "right" way
3921 to do this. The default is `N_RSYM'. */
3922 /* #define DBX_REGPARM_STABS_CODE */
3924 /* The letter to use in DBX symbol data to identify a symbol as a parameter
3925 passed in registers. DBX format does not customarily provide any way to do
3926 this. The default is `'P''. */
3927 /* #define DBX_REGPARM_STABS_LETTER */
3929 /* The letter to use in DBX symbol data to identify a symbol as a stack
3930 parameter. The default is `'p''. */
3931 /* #define DBX_MEMPARM_STABS_LETTER */
3933 /* Define this macro if the DBX information for a function and its arguments
3934 should precede the assembler code for the function. Normally, in DBX
3935 format, the debugging information entirely follows the assembler code.
3937 Defined in svr4.h. */
3938 /* #define DBX_FUNCTION_FIRST */
3940 /* Define this macro if the `N_LBRAC' symbol for a block should precede the
3941 debugging information for variables and functions defined in that block.
3942 Normally, in DBX format, the `N_LBRAC' symbol comes first. */
3943 /* #define DBX_LBRAC_FIRST */
3945 /* Define this macro if the value of a symbol describing the scope of a block
3946 (`N_LBRAC' or `N_RBRAC') should be relative to the start of the enclosing
3947 function. Normally, GNU C uses an absolute address.
3949 Defined in svr4.h. */
3950 /* #define DBX_BLOCKS_FUNCTION_RELATIVE */
3952 /* Define this macro if GNU C should generate `N_BINCL' and `N_EINCL'
3953 stabs for included header files, as on Sun systems. This macro
3954 also directs GNU C to output a type number as a pair of a file
3955 number and a type number within the file. Normally, GNU C does not
3956 generate `N_BINCL' or `N_EINCL' stabs, and it outputs a single
3957 number for a type number. */
3958 /* #define DBX_USE_BINCL */
3961 /* Open ended Hooks for DBX Output. */
3963 /* Define this macro to say how to output to STREAM the debugging information
3964 for the start of a scope level for variable names. The argument NAME is the
3965 name of an assembler symbol (for use with `assemble_name') whose value is
3966 the address where the scope begins. */
3967 /* #define DBX_OUTPUT_LBRAC(STREAM, NAME) */
3969 /* Like `DBX_OUTPUT_LBRAC', but for the end of a scope level. */
3970 /* #define DBX_OUTPUT_RBRAC(STREAM, NAME) */
3972 /* Define this macro if the target machine requires special handling to output
3973 an enumeration type. The definition should be a C statement (sans
3974 semicolon) to output the appropriate information to STREAM for the type
3976 /* #define DBX_OUTPUT_ENUM(STREAM, TYPE) */
3978 /* Define this macro if the target machine requires special output at the end
3979 of the debugging information for a function. The definition should be a C
3980 statement (sans semicolon) to output the appropriate information to STREAM.
3981 FUNCTION is the `FUNCTION_DECL' node for the function. */
3982 /* #define DBX_OUTPUT_FUNCTION_END(STREAM, FUNCTION) */
3984 /* Define this macro if you need to control the order of output of the standard
3985 data types at the beginning of compilation. The argument SYMS is a `tree'
3986 which is a chain of all the predefined global symbols, including names of
3989 Normally, DBX output starts with definitions of the types for integers and
3990 characters, followed by all the other predefined types of the particular
3991 language in no particular order.
3993 On some machines, it is necessary to output different particular types
3994 first. To do this, define `DBX_OUTPUT_STANDARD_TYPES' to output those
3995 symbols in the necessary order. Any predefined types that you don't
3996 explicitly output will be output afterward in no particular order.
3998 Be careful not to define this macro so that it works only for C. There are
3999 no global variables to access most of the built-in types, because another
4000 language may have another set of types. The way to output a particular type
4001 is to look through SYMS to see if you can find it. Here is an example:
4005 for (decl = syms; decl; decl = TREE_CHAIN (decl))
4006 if (!strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)),
4008 dbxout_symbol (decl);
4012 This does nothing if the expected type does not exist.
4014 See the function `init_decl_processing' in `c-decl.c' to find the names to
4015 use for all the built-in C types. */
4016 /* #define DBX_OUTPUT_STANDARD_TYPES(SYMS) */
4018 /* Some stabs encapsulation formats (in particular ECOFF), cannot
4019 handle the `.stabs "",N_FUN,,0,0,Lscope-function-1' gdb dbx
4020 extension construct. On those machines, define this macro to turn
4021 this feature off without disturbing the rest of the gdb extensions. */
4022 /* #define NO_DBX_FUNCTION_END */
4025 /* File names in DBX format. */
4027 /* Define this if DBX wants to have the current directory recorded in each
4030 Note that the working directory is always recorded if GDB extensions are
4032 /* #define DBX_WORKING_DIRECTORY */
4034 /* A C statement to output DBX debugging information to the stdio stream STREAM
4035 which indicates that file NAME is the main source file--the file specified
4036 as the input file for compilation. This macro is called only once, at the
4037 beginning of compilation.
4039 This macro need not be defined if the standard form of output for DBX
4040 debugging information is appropriate.
4042 Defined in svr4.h. */
4043 /* #define DBX_OUTPUT_MAIN_SOURCE_FILENAME(STREAM, NAME) */
4045 /* A C statement to output DBX debugging information to the stdio stream STREAM
4046 which indicates that the current directory during compilation is named NAME.
4048 This macro need not be defined if the standard form of output for DBX
4049 debugging information is appropriate. */
4050 /* #define DBX_OUTPUT_MAIN_SOURCE_DIRECTORY(STREAM, NAME) */
4052 /* A C statement to output DBX debugging information at the end of compilation
4053 of the main source file NAME.
4055 If you don't define this macro, nothing special is output at the end of
4056 compilation, which is correct for most machines. */
4057 /* #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(STREAM, NAME) */
4059 /* A C statement to output DBX debugging information to the stdio stream STREAM
4060 which indicates that file NAME is the current source file. This output is
4061 generated each time input shifts to a different source file as a result of
4062 `#include', the end of an included file, or a `#line' command.
4064 This macro need not be defined if the standard form of output for DBX
4065 debugging information is appropriate. */
4066 /* #define DBX_OUTPUT_SOURCE_FILENAME(STREAM, NAME) */
4069 /* Macros for SDB and Dwarf Output. */
4071 /* Define this macro if GNU CC should produce COFF-style debugging output for
4072 SDB in response to the `-g' option. */
4073 /* #define SDB_DEBUGGING_INFO */
4075 /* Define this macro if GNU CC should produce dwarf format debugging output in
4076 response to the `-g' option.
4078 Defined in svr4.h. */
4079 /* #define DWARF_DEBUGGING_INFO */
4081 /* Define this macro if GNU CC should produce dwarf version 2 format debugging
4082 output in response to the `-g' option.
4084 To support optional call frame debugging information, you must also define
4085 `INCOMING_RETURN_ADDR_RTX' and either set `RTX_FRAME_RELATED_P' on the
4086 prologue insns if you use RTL for the prologue, or call `dwarf2out_def_cfa'
4087 and `dwarf2out_reg_save' as appropriate from output_function_prologue() if
4090 Defined in svr4.h. */
4091 /* #define DWARF2_DEBUGGING_INFO */
4093 /* Define these macros to override the assembler syntax for the special SDB
4094 assembler directives. See `sdbout.c' for a list of these macros and their
4095 arguments. If the standard syntax is used, you need not define them
4097 /* #define PUT_SDB_... */
4099 /* Some assemblers do not support a semicolon as a delimiter, even between SDB
4100 assembler directives. In that case, define this macro to be the delimiter
4101 to use (usually `\n'). It is not necessary to define a new set of
4102 `PUT_SDB_OP' macros if this is the only change required. */
4103 /* #define SDB_DELIM */
4105 /* Define this macro to override the usual method of constructing a dummy name
4106 for anonymous structure and union types. See `sdbout.c' for more
4108 /* #define SDB_GENERATE_FAKE */
4110 /* Define this macro to allow references to unknown structure, union, or
4111 enumeration tags to be emitted. Standard COFF does not allow handling of
4112 unknown references, MIPS ECOFF has support for it. */
4113 /* #define SDB_ALLOW_UNKNOWN_REFERENCES */
4115 /* Define this macro to allow references to structure, union, or enumeration
4116 tags that have not yet been seen to be handled. Some assemblers choke if
4117 forward tags are used, while some require it. */
4118 /* #define SDB_ALLOW_FORWARD_REFERENCES */
4122 /* Miscellaneous Parameters. */
4124 /* Define this if you have defined special-purpose predicates in the file
4125 `MACHINE.c'. This macro is called within an initializer of an array of
4126 structures. The first field in the structure is the name of a predicate and
4127 the second field is an array of rtl codes. For each predicate, list all rtl
4128 codes that can be in expressions matched by the predicate. The list should
4129 have a trailing comma. Here is an example of two entries in the list for a
4130 typical RISC machine:
4132 #define PREDICATE_CODES \
4133 {"gen_reg_rtx_operand", {SUBREG, REG}}, \
4134 {"reg_or_short_cint_operand", {SUBREG, REG, CONST_INT}},
4136 Defining this macro does not affect the generated code (however, incorrect
4137 definitions that omit an rtl code that may be matched by the predicate can
4138 cause the compiler to malfunction). Instead, it allows the table built by
4139 `genrecog' to be more compact and efficient, thus speeding up the compiler.
4140 The most important predicates to include in the list specified by this macro
4141 are thoses used in the most insn patterns. */
4143 #define PREDICATE_CODES \
4144 { "short_memory_operand", { MEM }}, \
4145 { "long_memory_operand", { MEM }}, \
4146 { "d30v_memory_operand", { MEM }}, \
4147 { "single_reg_memory_operand", { MEM }}, \
4148 { "const_addr_memory_operand", { MEM }}, \
4149 { "call_operand", { MEM }}, \
4150 { "gpr_operand", { REG, SUBREG }}, \
4151 { "accum_operand", { REG, SUBREG }}, \
4152 { "gpr_or_accum_operand", { REG, SUBREG }}, \
4153 { "cr_operand", { REG, SUBREG }}, \
4154 { "repeat_operand", { REG, SUBREG }}, \
4155 { "flag_operand", { REG, SUBREG }}, \
4156 { "br_flag_operand", { REG, SUBREG }}, \
4157 { "br_flag_or_constant_operand", { REG, SUBREG, CONST_INT }}, \
4158 { "gpr_or_br_flag_operand", { REG, SUBREG }}, \
4159 { "f0_operand", { REG, SUBREG }}, \
4160 { "f1_operand", { REG, SUBREG }}, \
4161 { "carry_operand", { REG, SUBREG }}, \
4162 { "reg_or_0_operand", { REG, SUBREG, CONST_INT, \
4164 { "gpr_or_signed6_operand", { REG, SUBREG, CONST_INT }}, \
4165 { "gpr_or_unsigned5_operand", { REG, SUBREG, CONST_INT }}, \
4166 { "gpr_or_unsigned6_operand", { REG, SUBREG, CONST_INT }}, \
4167 { "gpr_or_constant_operand", { REG, SUBREG, CONST_INT, \
4168 CONST, SYMBOL_REF, \
4170 { "gpr_or_dbl_const_operand", { REG, SUBREG, CONST_INT, \
4171 CONST, SYMBOL_REF, \
4172 LABEL_REF, CONST_DOUBLE }}, \
4173 { "gpr_or_memory_operand", { REG, SUBREG, MEM }}, \
4174 { "move_input_operand", { REG, SUBREG, MEM, CONST_INT, \
4175 CONST, SYMBOL_REF, \
4176 LABEL_REF, CONST_DOUBLE }}, \
4177 { "move_output_operand", { REG, SUBREG, MEM }}, \
4178 { "signed6_operand", { CONST_INT }}, \
4179 { "unsigned5_operand", { CONST_INT }}, \
4180 { "unsigned6_operand", { CONST_INT }}, \
4181 { "bitset_operand", { CONST_INT }}, \
4182 { "condexec_test_operator", { EQ, NE }}, \
4183 { "condexec_branch_operator", { EQ, NE }}, \
4184 { "condexec_unary_operator", { ABS, NEG, NOT, ZERO_EXTEND }}, \
4185 { "condexec_addsub_operator", { PLUS, MINUS }}, \
4186 { "condexec_binary_operator", { MULT, AND, IOR, XOR, \
4187 ASHIFT, ASHIFTRT, LSHIFTRT, \
4188 ROTATE, ROTATERT }}, \
4189 { "condexec_shiftl_operator", { ASHIFT, ROTATE }}, \
4190 { "condexec_extend_operator", { SIGN_EXTEND, ZERO_EXTEND }}, \
4191 { "branch_zero_operator", { EQ, NE }}, \
4192 { "cond_move_dest_operand", { REG, SUBREG, MEM }}, \
4193 { "cond_move_operand", { REG, SUBREG, CONST_INT, \
4194 CONST, SYMBOL_REF, \
4195 LABEL_REF, MEM }}, \
4196 { "cond_exec_operand", { REG, SUBREG, CONST_INT, \
4197 CONST, SYMBOL_REF, \
4198 LABEL_REF, MEM }}, \
4199 { "srelational_si_operator", { EQ, NE, LT, LE, GT, GE }}, \
4200 { "urelational_si_operator", { LTU, LEU, GTU, GEU }}, \
4201 { "relational_di_operator", { EQ, NE, LT, LE, GT, GE, \
4202 LTU, LEU, GTU, GEU }},
4204 /* An alias for a machine mode name. This is the machine mode that elements of
4205 a jump-table should have. */
4206 #define CASE_VECTOR_MODE SImode
4208 /* Define as C expression which evaluates to nonzero if the tablejump
4209 instruction expects the table to contain offsets from the address of the
4211 Do not define this if the table should contain absolute addresses. */
4212 /* #define CASE_VECTOR_PC_RELATIVE 1 */
4214 /* Define this if control falls through a `case' insn when the index value is
4215 out of range. This means the specified default-label is actually ignored by
4216 the `case' insn proper. */
4217 /* #define CASE_DROPS_THROUGH */
4219 /* Define this to be the smallest number of different values for which it is
4220 best to use a jump-table instead of a tree of conditional branches. The
4221 default is four for machines with a `casesi' instruction and five otherwise.
4222 This is best for most machines. */
4223 /* #define CASE_VALUES_THRESHOLD */
4225 /* Define this macro if operations between registers with integral mode smaller
4226 than a word are always performed on the entire register. Most RISC machines
4227 have this property and most CISC machines do not. */
4228 #define WORD_REGISTER_OPERATIONS 1
4230 /* Define this macro to be a C expression indicating when insns that read
4231 memory in MODE, an integral mode narrower than a word, set the bits outside
4232 of MODE to be either the sign-extension or the zero-extension of the data
4233 read. Return `SIGN_EXTEND' for values of MODE for which the insn
4234 sign-extends, `ZERO_EXTEND' for which it zero-extends, and `NIL' for other
4237 This macro is not called with MODE non-integral or with a width greater than
4238 or equal to `BITS_PER_WORD', so you may return any value in this case. Do
4239 not define this macro if it would always return `NIL'. On machines where
4240 this macro is defined, you will normally define it as the constant
4241 `SIGN_EXTEND' or `ZERO_EXTEND'. */
4243 #define LOAD_EXTEND_OP(MODE) SIGN_EXTEND
4245 /* Define if loading short immediate values into registers sign extends. */
4246 #define SHORT_IMMEDIATES_SIGN_EXTEND
4248 /* Define this macro if the same instructions that convert a floating point
4249 number to a signed fixed point number also convert validly to an unsigned
4251 /* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC */
4253 /* The maximum number of bytes that a single instruction can move quickly from
4254 memory to memory. */
4257 /* The maximum number of bytes that a single instruction can move quickly from
4258 memory to memory. If this is undefined, the default is `MOVE_MAX'.
4259 Otherwise, it is the constant value that is the largest value that
4260 `MOVE_MAX' can have at run-time. */
4261 /* #define MAX_MOVE_MAX */
4263 /* A C expression that is nonzero if on this machine the number of bits
4264 actually used for the count of a shift operation is equal to the number of
4265 bits needed to represent the size of the object being shifted. When this
4266 macro is non-zero, the compiler will assume that it is safe to omit a
4267 sign-extend, zero-extend, and certain bitwise `and' instructions that
4268 truncates the count of a shift operation. On machines that have
4269 instructions that act on bitfields at variable positions, which may include
4270 `bit test' instructions, a nonzero `SHIFT_COUNT_TRUNCATED' also enables
4271 deletion of truncations of the values that serve as arguments to bitfield
4274 If both types of instructions truncate the count (for shifts) and position
4275 (for bitfield operations), or if no variable-position bitfield instructions
4276 exist, you should define this macro.
4278 However, on some machines, such as the 80386 and the 680x0, truncation only
4279 applies to shift operations and not the (real or pretended) bitfield
4280 operations. Define `SHIFT_COUNT_TRUNCATED' to be zero on such machines.
4281 Instead, add patterns to the `md' file that include the implied truncation
4282 of the shift instructions.
4284 You need not define this macro if it would always have the value of zero. */
4285 /* #define SHIFT_COUNT_TRUNCATED */
4287 /* A C expression which is nonzero if on this machine it is safe to "convert"
4288 an integer of INPREC bits to one of OUTPREC bits (where OUTPREC is smaller
4289 than INPREC) by merely operating on it as if it had only OUTPREC bits.
4291 On many machines, this expression can be 1.
4293 When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for modes for
4294 which `MODES_TIEABLE_P' is 0, suboptimal code can result. If this is the
4295 case, making `TRULY_NOOP_TRUNCATION' return 0 in such cases may improve
4297 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
4299 /* A C expression describing the value returned by a comparison operator with
4300 an integral mode and stored by a store-flag instruction (`sCOND') when the
4301 condition is true. This description must apply to *all* the `sCOND'
4302 patterns and all the comparison operators whose results have a `MODE_INT'
4305 A value of 1 or -1 means that the instruction implementing the comparison
4306 operator returns exactly 1 or -1 when the comparison is true and 0 when the
4307 comparison is false. Otherwise, the value indicates which bits of the
4308 result are guaranteed to be 1 when the comparison is true. This value is
4309 interpreted in the mode of the comparison operation, which is given by the
4310 mode of the first operand in the `sCOND' pattern. Either the low bit or the
4311 sign bit of `STORE_FLAG_VALUE' be on. Presently, only those bits are used
4314 If `STORE_FLAG_VALUE' is neither 1 or -1, the compiler will generate code
4315 that depends only on the specified bits. It can also replace comparison
4316 operators with equivalent operations if they cause the required bits to be
4317 set, even if the remaining bits are undefined. For example, on a machine
4318 whose comparison operators return an `SImode' value and where
4319 `STORE_FLAG_VALUE' is defined as `0x80000000', saying that just the sign bit
4320 is relevant, the expression
4322 (ne:SI (and:SI X (const_int POWER-OF-2)) (const_int 0))
4326 (ashift:SI X (const_int N))
4328 where N is the appropriate shift count to move the bit being tested into the
4331 There is no way to describe a machine that always sets the low-order bit for
4332 a true value, but does not guarantee the value of any other bits, but we do
4333 not know of any machine that has such an instruction. If you are trying to
4334 port GNU CC to such a machine, include an instruction to perform a
4335 logical-and of the result with 1 in the pattern for the comparison operators
4336 and let us know (*note How to Report Bugs: Bug Reporting.).
4338 Often, a machine will have multiple instructions that obtain a value from a
4339 comparison (or the condition codes). Here are rules to guide the choice of
4340 value for `STORE_FLAG_VALUE', and hence the instructions to be used:
4342 * Use the shortest sequence that yields a valid definition for
4343 `STORE_FLAG_VALUE'. It is more efficient for the compiler to
4344 "normalize" the value (convert it to, e.g., 1 or 0) than for
4345 the comparison operators to do so because there may be
4346 opportunities to combine the normalization with other
4349 * For equal-length sequences, use a value of 1 or -1, with -1
4350 being slightly preferred on machines with expensive jumps and
4351 1 preferred on other machines.
4353 * As a second choice, choose a value of `0x80000001' if
4354 instructions exist that set both the sign and low-order bits
4355 but do not define the others.
4357 * Otherwise, use a value of `0x80000000'.
4359 Many machines can produce both the value chosen for `STORE_FLAG_VALUE' and
4360 its negation in the same number of instructions. On those machines, you
4361 should also define a pattern for those cases, e.g., one matching
4363 (set A (neg:M (ne:M B C)))
4365 Some machines can also perform `and' or `plus' operations on condition code
4366 values with less instructions than the corresponding `sCOND' insn followed
4367 by `and' or `plus'. On those machines, define the appropriate patterns.
4368 Use the names `incscc' and `decscc', respectively, for the the patterns
4369 which perform `plus' or `minus' operations on condition code values. See
4370 `rs6000.md' for some examples. The GNU Superoptizer can be used to find
4371 such instruction sequences on other machines.
4373 You need not define `STORE_FLAG_VALUE' if the machine has no store-flag
4375 /* #define STORE_FLAG_VALUE */
4377 /* A C expression that gives a non-zero floating point value that is returned
4378 when comparison operators with floating-point results are true. Define this
4379 macro on machine that have comparison operations that return floating-point
4380 values. If there are no such operations, do not define this macro. */
4381 /* #define FLOAT_STORE_FLAG_VALUE */
4383 /* An alias for the machine mode for pointers. On most machines, define this
4384 to be the integer mode corresponding to the width of a hardware pointer;
4385 `SImode' on 32-bit machine or `DImode' on 64-bit machines. On some machines
4386 you must define this to be one of the partial integer modes, such as
4389 The width of `Pmode' must be at least as large as the value of
4390 `POINTER_SIZE'. If it is not equal, you must define the macro
4391 `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to `Pmode'. */
4392 #define Pmode SImode
4394 /* An alias for the machine mode used for memory references to functions being
4395 called, in `call' RTL expressions. On most machines this should be
4397 #define FUNCTION_MODE QImode
4399 /* A C expression for the maximum number of instructions above which the
4400 function DECL should not be inlined. DECL is a `FUNCTION_DECL' node.
4402 The default definition of this macro is 64 plus 8 times the number of
4403 arguments that the function accepts. Some people think a larger threshold
4404 should be used on RISC machines. */
4405 /* #define INTEGRATE_THRESHOLD(DECL) */
4407 /* Define this if the preprocessor should ignore `#sccs' directives and print
4410 Defined in svr4.h. */
4411 /* #define SCCS_DIRECTIVE */
4413 /* Define this macro if the system header files support C++ as well as C. This
4414 macro inhibits the usual method of using system header files in C++, which
4415 is to pretend that the file's contents are enclosed in `extern "C" {...}'. */
4416 /* #define NO_IMPLICIT_EXTERN_C */
4418 /* Define this macro to handle System V style pragmas (particularly #pack).
4420 Defined in svr4.h. */
4421 #define HANDLE_SYSV_PRAGMA
4423 /* Define this macro if you want to handle #pragma weak (HANDLE_SYSV_PRAGMA
4424 must also be defined). */
4425 /* #define HANDLE_WEAK_PRAGMA */
4427 /* Define this macro if the assembler does not accept the character `$' in
4428 label names. By default constructors and destructors in G++ have `$' in the
4429 identifiers. If this macro is defined, `.' is used instead.
4431 Defined in svr4.h. */
4432 /* #define NO_DOLLAR_IN_LABEL */
4434 /* Define this macro if the assembler does not accept the character `.' in
4435 label names. By default constructors and destructors in G++ have names that
4436 use `.'. If this macro is defined, these names are rewritten to avoid `.'. */
4437 /* #define NO_DOT_IN_LABEL */
4439 /* Define this macro if the target system expects every program's `main'
4440 function to return a standard "success" value by default (if no other value
4441 is explicitly returned).
4443 The definition should be a C statement (sans semicolon) to generate the
4444 appropriate rtl instructions. It is used only when compiling the end of
4446 /* #define DEFAULT_MAIN_RETURN */
4448 /* Define this if your `exit' function needs to do something besides calling an
4449 external function `_cleanup' before terminating with `_exit'. The
4450 `EXIT_BODY' macro is only needed if `NEED_ATEXIT' is defined and
4451 `ON_EXIT' is not defined. */
4452 /* #define EXIT_BODY */
4454 /* Define this macro as a C expression that is nonzero if it is safe for the
4455 delay slot scheduler to place instructions in the delay slot of INSN, even
4456 if they appear to use a resource set or clobbered in INSN. INSN is always a
4457 `jump_insn' or an `insn'; GNU CC knows that every `call_insn' has this
4458 behavior. On machines where some `insn' or `jump_insn' is really a function
4459 call and hence has this behavior, you should define this macro.
4461 You need not define this macro if it would always return zero. */
4462 /* #define INSN_SETS_ARE_DELAYED(INSN) */
4464 /* Define this macro as a C expression that is nonzero if it is safe for the
4465 delay slot scheduler to place instructions in the delay slot of INSN, even
4466 if they appear to set or clobber a resource referenced in INSN. INSN is
4467 always a `jump_insn' or an `insn'. On machines where some `insn' or
4468 `jump_insn' is really a function call and its operands are registers whose
4469 use is actually in the subroutine it calls, you should define this macro.
4470 Doing so allows the delay slot scheduler to move instructions which copy
4471 arguments into the argument registers into the delay slot of INSN.
4473 You need not define this macro if it would always return zero. */
4474 /* #define INSN_REFERENCES_ARE_DELAYED(INSN) */
4476 /* In rare cases, correct code generation requires extra machine dependent
4477 processing between the second jump optimization pass and delayed branch
4478 scheduling. On those machines, define this macro as a C statement to act on
4479 the code starting at INSN. */
4480 #define MACHINE_DEPENDENT_REORG(INSN) d30v_machine_dependent_reorg (INSN)
4482 /* Define this macro if in some cases global symbols from one translation unit
4483 may not be bound to undefined symbols in another translation unit without
4484 user intervention. For instance, under Microsoft Windows symbols must be
4485 explicitly imported from shared libraries (DLLs). */
4486 /* #define MULTIPLE_SYMBOL_SPACES */
4488 /* A C expression for the maximum number of instructions to execute via
4489 conditional execution instructions instead of a branch. A value of
4490 BRANCH_COST+1 is the default if the machine does not use cc0, and 1 if it
4492 #define MAX_CONDITIONAL_EXECUTE d30v_cond_exec
4494 #define D30V_DEFAULT_MAX_CONDITIONAL_EXECUTE 4
4496 /* Values of the -mcond-exec=n string. */
4497 extern int d30v_cond_exec;
4498 extern const char *d30v_cond_exec_string;
4500 #endif /* GCC_D30V_H */