First version committed to git
[zpugcc/jano.git] / toolchain / gcc / gcc / config / d30v / d30v.h
blob62d0e2af09798395fce632d34420bf9ed806e44b
1 /* Definitions of target machine for Mitsubishi D30V.
2 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
3 Free Software Foundation, Inc.
4 Contributed by Cygnus Solutions.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GCC 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 GCC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 #ifndef GCC_D30V_H
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. */
40 #undef ASM_SPEC
41 #define ASM_SPEC "\
42 %{!mno-asm-optimize: %{O*: %{!O0: -O} %{O0: %{masm-optimize: -O}}}} \
43 %{v} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
45 /* Defined in svr4.h. */
46 #undef LINK_SPEC
47 #define LINK_SPEC "\
48 %{h*} %{v:-V} \
49 %{b} %{Wl,*:%*} \
50 %{static:-dn -Bstatic} \
51 %{shared:-G -dy -z text} \
52 %{symbolic:-Bsymbolic -G -dy -z text} \
53 %{G:-G} \
54 %{YP,*} \
55 %{Qy:} %{!Qn:-Qy} \
56 %{mextmem: -m d30v_e} %{mextmemory: -m d30v_e} %{monchip: -m d30v_o}"
58 /* Defined in svr4.h. */
59 #undef LIB_SPEC
60 #define LIB_SPEC "--start-group -lsim -lc --end-group"
62 /* Defined in svr4.h. */
63 #undef STARTFILE_SPEC
64 #define STARTFILE_SPEC "crt0%O%s crtbegin%O%s"
66 /* Defined in svr4.h. */
67 #undef ENDFILE_SPEC
68 #define ENDFILE_SPEC "crtend%O%s"
70 /* Defined in svr4.h for host compilers. */
71 /* #define MD_EXEC_PREFIX "" */
73 /* Defined in svr4.h for host compilers. */
74 /* #define MD_STARTFILE_PREFIX "" */
77 /* Run-time target specifications */
79 #define TARGET_CPU_CPP_BUILTINS() \
80 do \
81 { \
82 builtin_define ("__D30V__"); \
83 builtin_assert ("machine=d30v"); \
84 } \
85 while (0)
87 /* This declaration should be present. */
88 extern int target_flags;
90 #define MASK_NO_COND_MOVE 0x00000001 /* disable conditional moves */
92 #define MASK_DEBUG_ARG 0x10000000 /* debug argument handling */
93 #define MASK_DEBUG_STACK 0x20000000 /* debug stack allocations */
94 #define MASK_DEBUG_ADDR 0x40000000 /* debug GO_IF_LEGITIMATE_ADDRESS */
96 #define TARGET_NO_COND_MOVE (target_flags & MASK_NO_COND_MOVE)
97 #define TARGET_DEBUG_ARG (target_flags & MASK_DEBUG_ARG)
98 #define TARGET_DEBUG_STACK (target_flags & MASK_DEBUG_STACK)
99 #define TARGET_DEBUG_ADDR (target_flags & MASK_DEBUG_ADDR)
101 #define TARGET_COND_MOVE (! TARGET_NO_COND_MOVE)
103 /* Default switches used. */
104 #ifndef TARGET_DEFAULT
105 #define TARGET_DEFAULT 0
106 #endif
108 #define TARGET_SWITCHES \
110 { "cond-move", -MASK_NO_COND_MOVE, \
111 N_("Enable use of conditional move instructions") }, \
113 { "no-cond-move", MASK_NO_COND_MOVE, \
114 N_("Disable use of conditional move instructions") }, \
116 { "debug-arg", MASK_DEBUG_ARG, \
117 N_("Debug argument support in compiler") }, \
119 { "debug-stack", MASK_DEBUG_STACK, \
120 N_("Debug stack support in compiler") }, \
122 { "debug-addr", MASK_DEBUG_ADDR, \
123 N_("Debug memory address support in compiler") }, \
125 { "asm-optimize", 0, \
126 N_("Make adjacent short instructions parallel if possible") }, \
128 { "no-asm-optimize", 0, \
129 N_("Do not make adjacent short instructions parallel") }, \
131 { "extmem", 0, \
132 N_("Link programs/data to be in external memory by default") }, \
134 { "extmemory", 0, \
135 N_("Link programs/data to be in external memory by default") }, \
137 { "onchip", 0, \
138 N_("Link programs/data to be in onchip memory by default") }, \
140 { "", TARGET_DEFAULT, "" }, \
143 #define TARGET_OPTIONS \
145 {"branch-cost=", &d30v_branch_cost_string, \
146 N_("Change the branch costs within the compiler"), 0}, \
148 {"cond-exec=", &d30v_cond_exec_string, \
149 N_("Change the threshold for conversion to conditional execution"), 0}, \
152 #define TARGET_VERSION fprintf (stderr, " d30v")
154 #define OVERRIDE_OPTIONS override_options ()
156 #define CAN_DEBUG_WITHOUT_FP
159 /* Storage Layout */
161 #define BITS_BIG_ENDIAN 1
163 #define BYTES_BIG_ENDIAN 1
165 #define WORDS_BIG_ENDIAN 1
167 #define UNITS_PER_WORD 4
169 #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
170 do { \
171 if (GET_MODE_CLASS (MODE) == MODE_INT \
172 && GET_MODE_SIZE (MODE) < 4) \
173 (MODE) = SImode; \
174 } while (0)
176 #define PARM_BOUNDARY 32
178 #define STACK_BOUNDARY 64
180 #define FUNCTION_BOUNDARY 64
182 #define BIGGEST_ALIGNMENT 64
184 /* Defined in svr4.h. */
185 /* #define MAX_OFILE_ALIGNMENT */
187 #define DATA_ALIGNMENT(TYPE, ALIGN) \
188 (TREE_CODE (TYPE) == ARRAY_TYPE \
189 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
190 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
192 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
193 (TREE_CODE (EXP) == STRING_CST \
194 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
196 #define STRICT_ALIGNMENT 1
198 /* Defined in svr4.h. */
200 #define PCC_BITFIELD_TYPE_MATTERS 1
202 /* Layout of Source Language Data Types */
204 #define INT_TYPE_SIZE 32
206 #define SHORT_TYPE_SIZE 16
208 #define LONG_TYPE_SIZE 32
210 #define LONG_LONG_TYPE_SIZE 64
212 #define FLOAT_TYPE_SIZE 32
214 #define DOUBLE_TYPE_SIZE 64
216 #define LONG_DOUBLE_TYPE_SIZE 64
218 #define DEFAULT_SIGNED_CHAR 1
220 /* Defined in svr4.h. */
221 /* #define SIZE_TYPE */
223 /* Defined in svr4.h. */
224 /* #define PTRDIFF_TYPE */
226 /* Defined in svr4.h. */
227 /* #define WCHAR_TYPE */
229 /* Defined in svr4.h. */
230 /* #define WCHAR_TYPE_SIZE */
233 /* D30V register layout. */
235 /* Return true if a value is inside a range */
236 #define IN_RANGE_P(VALUE, LOW, HIGH) \
237 (((unsigned)((VALUE) - (LOW))) <= ((unsigned)((HIGH) - (LOW))))
239 /* General purpose registers. */
240 #define GPR_FIRST 0 /* First gpr */
241 #define GPR_LAST (GPR_FIRST + 63) /* Last gpr */
242 #define GPR_R0 GPR_FIRST /* R0, constant 0 */
243 #define GPR_ARG_FIRST (GPR_FIRST + 2) /* R2, first argument reg */
244 #define GPR_ARG_LAST (GPR_FIRST + 17) /* R17, last argument reg */
245 #define GPR_RET_VALUE GPR_ARG_FIRST /* R2, function return reg */
246 #define GPR_ATMP_FIRST (GPR_FIRST + 20) /* R20, tmp to save accs */
247 #define GPR_ATMP_LAST (GPR_FIRST + 21) /* R21, tmp to save accs */
248 #define GPR_STACK_TMP (GPR_FIRST + 22) /* R22, tmp for saving stack */
249 #define GPR_RES_FIRST (GPR_FIRST + 32) /* R32, first reserved reg */
250 #define GPR_RES_LAST (GPR_FIRST + 35) /* R35, last reserved reg */
251 #define GPR_FP (GPR_FIRST + 61) /* Frame pointer */
252 #define GPR_LINK (GPR_FIRST + 62) /* Return address register */
253 #define GPR_SP (GPR_FIRST + 63) /* Stack pointer */
255 /* Argument register that is eliminated in favor of the frame and/or stack
256 pointer. Also add register to point to where the return address is
257 stored. */
258 #define SPECIAL_REG_FIRST (GPR_LAST + 1)
259 #define SPECIAL_REG_LAST (SPECIAL_REG_FIRST)
260 #define ARG_POINTER_REGNUM (SPECIAL_REG_FIRST + 0)
261 #define SPECIAL_REG_P(R) ((R) == SPECIAL_REG_FIRST)
263 #define GPR_OR_SPECIAL_REG_P(R) IN_RANGE_P (R, GPR_FIRST, SPECIAL_REG_LAST)
264 #define GPR_P(R) IN_RANGE_P (R, GPR_FIRST, GPR_LAST)
265 #define GPR_OR_PSEUDO_P(R) (GPR_OR_SPECIAL_REG_P (R) \
266 || (R) >= FIRST_PSEUDO_REGISTER)
268 /* Flag bits. */
269 #define FLAG_FIRST (SPECIAL_REG_LAST + 1) /* First flag */
270 #define FLAG_LAST (FLAG_FIRST + 7) /* Last flag */
271 #define FLAG_F0 (FLAG_FIRST) /* F0, used in prediction */
272 #define FLAG_F1 (FLAG_FIRST + 1) /* F1, used in prediction */
273 #define FLAG_F2 (FLAG_FIRST + 2) /* F2, general flag */
274 #define FLAG_F3 (FLAG_FIRST + 3) /* F3, general flag */
275 #define FLAG_SAT (FLAG_FIRST + 4) /* F4, saturation flag */
276 #define FLAG_OVERFLOW (FLAG_FIRST + 5) /* F5, overflow flag */
277 #define FLAG_ACC_OVER (FLAG_FIRST + 6) /* F6, accumulated overflow */
278 #define FLAG_CARRY (FLAG_FIRST + 7) /* F7, carry/borrow flag */
279 #define FLAG_BORROW FLAG_CARRY
281 #define FLAG_P(R) IN_RANGE_P (R, FLAG_FIRST, FLAG_LAST)
282 #define FLAG_OR_PSEUDO_P(R) (FLAG_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
284 #define BR_FLAG_P(R) IN_RANGE_P (R, FLAG_F0, FLAG_F1)
285 #define BR_FLAG_OR_PSEUDO_P(R) (BR_FLAG_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
287 /* Accumulators */
288 #define ACCUM_FIRST (FLAG_LAST + 1) /* First accumulator */
289 #define ACCUM_A0 ACCUM_FIRST /* Register A0 */
290 #define ACCUM_A1 (ACCUM_FIRST + 1) /* Register A1 */
291 #define ACCUM_LAST (ACCUM_FIRST + 1) /* Last accumulator */
293 #define ACCUM_P(R) IN_RANGE_P (R, ACCUM_FIRST, ACCUM_LAST)
294 #define ACCUM_OR_PSEUDO_P(R) (ACCUM_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
296 /* Special registers. Note, we only define the registers that can actually
297 be used. */
298 #define CR_FIRST (ACCUM_LAST + 1) /* First CR */
299 #define CR_LAST (CR_FIRST + 14) /* Last CR */
300 #define CR_PSW (CR_FIRST + 0) /* CR0, Program status word */
301 #define CR_BPSW (CR_FIRST + 1) /* CR1, Backup PSW */
302 #define CR_PC (CR_FIRST + 2) /* CR2, Program counter */
303 #define CR_BPC (CR_FIRST + 3) /* CR3, Backup PC */
304 #define CR_DPSW (CR_FIRST + 4) /* CR4, Debug PSW */
305 #define CR_DPC (CR_FIRST + 5) /* CR5, Debug PC */
306 #define CR_RPT_C (CR_FIRST + 6) /* CR7, loop count register */
307 #define CR_RPT_S (CR_FIRST + 7) /* CR8, loop start address */
308 #define CR_RPT_E (CR_FIRST + 8) /* CR9, loop end address */
309 #define CR_MOD_S (CR_FIRST + 9) /* CR10, modulo address start*/
310 #define CR_MOD_E (CR_FIRST + 10) /* CR11, modulo address */
311 #define CR_IBA (CR_FIRST + 11) /* CR14, Interrupt break addr */
312 #define CR_EIT_VB (CR_FIRST + 12) /* CR15, EIT vector address */
313 #define CR_INT_S (CR_FIRST + 13) /* CR16, Interrupt status */
314 #define CR_INT_M (CR_FIRST + 14) /* CR17, Interrupt mask */
316 #define CR_P(R) IN_RANGE_P (R, CR_FIRST, CR_LAST)
317 #define CR_OR_PSEUDO_P(R) (CR_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
320 /* Register Basics */
322 /* Number of hardware registers known to the compiler. They receive numbers 0
323 through `FIRST_PSEUDO_REGISTER-1'; thus, the first pseudo register's number
324 really is assigned the number `FIRST_PSEUDO_REGISTER'. */
325 #define FIRST_PSEUDO_REGISTER (CR_LAST + 1)
327 /* An initializer that says which registers are used for fixed purposes all
328 throughout the compiled code and are therefore not available for general
329 allocation. These would include the stack pointer, the frame pointer
330 (except on machines where that can be used as a general register when no
331 frame pointer is needed), the program counter on machines where that is
332 considered one of the addressable registers, and any other numbered register
333 with a standard use.
335 This information is expressed as a sequence of numbers, separated by commas
336 and surrounded by braces. The Nth number is 1 if register N is fixed, 0
337 otherwise.
339 The table initialized from this macro, and the table initialized by the
340 following one, may be overridden at run time either automatically, by the
341 actions of the macro `CONDITIONAL_REGISTER_USAGE', or by the user with the
342 command options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. */
343 #define FIXED_REGISTERS \
345 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* R0 - R15 */ \
346 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, /* R16 - R31 */ \
347 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* R32 - R47 */ \
348 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* R48 - R63 */ \
349 1, /* ARG ptr */ \
350 0, 0, 0, 0, 1, 1, 1, 1, /* F0 - F7 */ \
351 0, 0, /* A0 - A1 */ \
352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* CRs */ \
355 /* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered (in
356 general) by function calls as well as for fixed registers. This macro
357 therefore identifies the registers that are not available for general
358 allocation of values that must live across function calls.
360 If a register has 0 in `CALL_USED_REGISTERS', the compiler automatically
361 saves it on function entry and restores it on function exit, if the register
362 is used within the function. */
363 #define CALL_USED_REGISTERS \
365 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* R0 - R15 */ \
366 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* R16 - R31 */ \
367 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* R32 - R47 */ \
368 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* R48 - R63 */ \
369 1, /* ARG ptr */ \
370 1, 1, 1, 1, 1, 1, 1, 1, /* F0 - F7 */ \
371 1, 0, /* A0 - A1 */ \
372 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* CRs */ \
376 /* Order of allocation of registers */
378 /* If defined, an initializer for a vector of integers, containing the numbers
379 of hard registers in the order in which GCC should prefer to use them
380 (from most preferred to least).
382 If this macro is not defined, registers are used lowest numbered first (all
383 else being equal).
385 One use of this macro is on machines where the highest numbered registers
386 must always be saved and the save-multiple-registers instruction supports
387 only sequences of consecutive registers. On such machines, define
388 `REG_ALLOC_ORDER' to be an initializer that lists the highest numbered
389 allocatable register first. */
391 #define REG_ALLOC_ORDER \
393 /* volatile registers */ \
394 GPR_FIRST + 2, GPR_FIRST + 3, GPR_FIRST + 4, GPR_FIRST + 5, \
395 GPR_FIRST + 6, GPR_FIRST + 7, GPR_FIRST + 8, GPR_FIRST + 9, \
396 GPR_FIRST + 10, GPR_FIRST + 11, GPR_FIRST + 12, GPR_FIRST + 13, \
397 GPR_FIRST + 14, GPR_FIRST + 15, GPR_FIRST + 16, GPR_FIRST + 17, \
398 GPR_FIRST + 18, GPR_FIRST + 19, GPR_FIRST + 20, GPR_FIRST + 21, \
399 GPR_FIRST + 22, GPR_FIRST + 23, GPR_FIRST + 24, GPR_FIRST + 25, \
400 GPR_FIRST + 1, \
402 /* saved registers */ \
403 GPR_FIRST + 34, GPR_FIRST + 35, GPR_FIRST + 36, GPR_FIRST + 37, \
404 GPR_FIRST + 38, GPR_FIRST + 39, GPR_FIRST + 40, GPR_FIRST + 41, \
405 GPR_FIRST + 42, GPR_FIRST + 43, GPR_FIRST + 44, GPR_FIRST + 45, \
406 GPR_FIRST + 46, GPR_FIRST + 47, GPR_FIRST + 48, GPR_FIRST + 49, \
407 GPR_FIRST + 50, GPR_FIRST + 51, GPR_FIRST + 52, GPR_FIRST + 53, \
408 GPR_FIRST + 54, GPR_FIRST + 55, GPR_FIRST + 56, GPR_FIRST + 57, \
409 GPR_FIRST + 58, GPR_FIRST + 59, GPR_FIRST + 60, GPR_FIRST + 61, \
410 GPR_FIRST + 62, \
412 /* flags */ \
413 FLAG_F2, FLAG_F3, FLAG_F0, FLAG_F1, \
414 FLAG_SAT, FLAG_OVERFLOW, FLAG_ACC_OVER, FLAG_CARRY, \
416 /* accumultors */ \
417 ACCUM_FIRST + 0, ACCUM_FIRST + 1, \
419 /* fixed registers */ \
420 GPR_FIRST + 0, GPR_FIRST + 26, GPR_FIRST + 27, GPR_FIRST + 28, \
421 GPR_FIRST + 29, GPR_FIRST + 30, GPR_FIRST + 31, GPR_FIRST + 32, \
422 GPR_FIRST + 33, GPR_FIRST + 63, \
423 CR_PSW, CR_BPSW, CR_PC, CR_BPC, \
424 CR_DPSW, CR_DPC, CR_RPT_C, CR_RPT_S, \
425 CR_RPT_E, CR_MOD_S, CR_MOD_E, CR_IBA, \
426 CR_EIT_VB, CR_INT_S, CR_INT_M, \
427 ARG_POINTER_REGNUM, \
431 /* How Values Fit in Registers */
433 /* A C expression for the number of consecutive hard registers, starting at
434 register number REGNO, required to hold a value of mode MODE.
436 On a machine where all registers are exactly one word, a suitable definition
437 of this macro is
439 #define HARD_REGNO_NREGS(REGNO, MODE) \
440 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
441 / UNITS_PER_WORD)) */
443 #define HARD_REGNO_NREGS(REGNO, MODE) \
444 (ACCUM_P (REGNO) ? ((GET_MODE_SIZE (MODE) + 2*UNITS_PER_WORD - 1) \
445 / (2*UNITS_PER_WORD)) \
446 : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
447 / UNITS_PER_WORD))
449 /* A C expression that is nonzero if it is permissible to store a value of mode
450 MODE in hard register number REGNO (or in several registers starting with
451 that one). For a machine where all registers are equivalent, a suitable
452 definition is
454 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
456 It is not necessary for this macro to check for the numbers of fixed
457 registers, because the allocation mechanism considers them to be always
458 occupied.
460 On some machines, double-precision values must be kept in even/odd register
461 pairs. The way to implement that is to define this macro to reject odd
462 register numbers for such modes.
464 The minimum requirement for a mode to be OK in a register is that the
465 `movMODE' instruction pattern support moves between the register and any
466 other hard register for which the mode is OK; and that moving a value into
467 the register and back out not alter it.
469 Since the same instruction used to move `SImode' will work for all narrower
470 integer modes, it is not necessary on any machine for `HARD_REGNO_MODE_OK'
471 to distinguish between these modes, provided you define patterns `movhi',
472 etc., to take advantage of this. This is useful because of the interaction
473 between `HARD_REGNO_MODE_OK' and `MODES_TIEABLE_P'; it is very desirable for
474 all integer modes to be tieable.
476 Many machines have special registers for floating point arithmetic. Often
477 people assume that floating point machine modes are allowed only in floating
478 point registers. This is not true. Any registers that can hold integers
479 can safely *hold* a floating point machine mode, whether or not floating
480 arithmetic can be done on it in those registers. Integer move instructions
481 can be used to move the values.
483 On some machines, though, the converse is true: fixed-point machine modes
484 may not go in floating registers. This is true if the floating registers
485 normalize any value stored in them, because storing a non-floating value
486 there would garble it. In this case, `HARD_REGNO_MODE_OK' should reject
487 fixed-point machine modes in floating registers. But if the floating
488 registers do not automatically normalize, if you can store any bit pattern
489 in one and retrieve it unchanged without a trap, then any machine mode may
490 go in a floating register, so you can define this macro to say so.
492 The primary significance of special floating registers is rather that they
493 are the registers acceptable in floating point arithmetic instructions.
494 However, this is of no concern to `HARD_REGNO_MODE_OK'. You handle it by
495 writing the proper constraints for those instructions.
497 On some machines, the floating registers are especially slow to access, so
498 that it is better to store a value in a stack frame than in such a register
499 if floating point arithmetic is not being done. As long as the floating
500 registers are not in class `GENERAL_REGS', they will not be used unless some
501 pattern's constraint asks for one. */
503 extern unsigned char hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
504 #define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok[ (int)MODE ][ REGNO ]
506 /* A C expression that is nonzero if it is desirable to choose register
507 allocation so as to avoid move instructions between a value of mode MODE1
508 and a value of mode MODE2.
510 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are
511 ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be
512 zero. */
514 extern unsigned char modes_tieable_p[];
515 #define MODES_TIEABLE_P(MODE1, MODE2) \
516 modes_tieable_p[ (((int)(MODE1)) * (NUM_MACHINE_MODES)) + (int)(MODE2) ]
518 /* Define this macro if the compiler should avoid copies to/from CCmode
519 registers. You should only define this macro if support fo copying to/from
520 CCmode is incomplete. */
522 /* On the D30V, copying to/from CCmode is complete, but since there are only
523 two CC registers usable for conditional tests, this helps gcse not compound
524 the reload problem. */
525 #define AVOID_CCMODE_COPIES
528 /* Register Classes */
530 /* An enumeral type that must be defined with all the register class names as
531 enumeral values. `NO_REGS' must be first. `ALL_REGS' must be the last
532 register class, followed by one more enumeral value, `LIM_REG_CLASSES',
533 which is not a register class but rather tells how many classes there are.
535 Each register class has a number, which is the value of casting the class
536 name to type `int'. The number serves as an index in many of the tables
537 described below. */
538 enum reg_class
540 NO_REGS,
541 REPEAT_REGS,
542 CR_REGS,
543 ACCUM_REGS,
544 OTHER_FLAG_REGS,
545 F0_REGS,
546 F1_REGS,
547 BR_FLAG_REGS,
548 FLAG_REGS,
549 EVEN_REGS,
550 GPR_REGS,
551 ALL_REGS,
552 LIM_REG_CLASSES
555 #define GENERAL_REGS GPR_REGS
557 /* The number of distinct register classes, defined as follows:
559 #define N_REG_CLASSES (int) LIM_REG_CLASSES */
560 #define N_REG_CLASSES ((int) LIM_REG_CLASSES)
562 /* An initializer containing the names of the register classes as C string
563 constants. These names are used in writing some of the debugging dumps. */
564 #define REG_CLASS_NAMES \
566 "NO_REGS", \
567 "REPEAT_REGS", \
568 "CR_REGS", \
569 "ACCUM_REGS", \
570 "OTHER_FLAG_REGS", \
571 "F0_REGS", \
572 "F1_REGS", \
573 "BR_FLAG_REGS", \
574 "FLAG_REGS", \
575 "EVEN_REGS", \
576 "GPR_REGS", \
577 "ALL_REGS", \
580 /* Create mask bits for 3rd word of REG_CLASS_CONTENTS */
581 #define MASK_WORD3(REG) ((long)1 << ((REG) - 64))
583 #define NO_MASK 0
584 #define REPEAT_MASK MASK_WORD3 (CR_RPT_C)
585 #define CR_MASK (MASK_WORD3 (CR_PSW) | MASK_WORD3 (CR_BPSW) \
586 | MASK_WORD3 (CR_PC) | MASK_WORD3 (CR_BPC) \
587 | MASK_WORD3 (CR_DPSW) | MASK_WORD3 (CR_DPC) \
588 | MASK_WORD3 (CR_RPT_C) | MASK_WORD3 (CR_RPT_S) \
589 | MASK_WORD3 (CR_RPT_E) | MASK_WORD3 (CR_MOD_S) \
590 | MASK_WORD3 (CR_MOD_E) | MASK_WORD3 (CR_IBA) \
591 | MASK_WORD3 (CR_EIT_VB) | MASK_WORD3 (CR_INT_S) \
592 | MASK_WORD3 (CR_INT_M))
594 #define ACCUM_MASK (MASK_WORD3 (ACCUM_A0) | MASK_WORD3 (ACCUM_A1))
595 #define OTHER_FLAG_MASK (MASK_WORD3 (FLAG_F2) | MASK_WORD3 (FLAG_F3) \
596 | MASK_WORD3 (FLAG_SAT) | MASK_WORD3 (FLAG_OVERFLOW) \
597 | MASK_WORD3 (FLAG_ACC_OVER) | MASK_WORD3 (FLAG_CARRY))
599 #define F0_MASK MASK_WORD3 (FLAG_F0)
600 #define F1_MASK MASK_WORD3 (FLAG_F1)
601 #define BR_FLAG_MASK (F0_MASK | F1_MASK)
602 #define FLAG_MASK (BR_FLAG_MASK | OTHER_FLAG_MASK)
603 #define SPECIAL_MASK MASK_WORD3 (ARG_POINTER_REGNUM)
605 #define ALL_MASK (CR_MASK | ACCUM_MASK | FLAG_MASK | SPECIAL_MASK)
607 /* An initializer containing the contents of the register classes, as integers
608 which are bit masks. The Nth integer specifies the contents of class N.
609 The way the integer MASK is interpreted is that register R is in the class
610 if `MASK & (1 << R)' is 1.
612 When the machine has more than 32 registers, an integer does not suffice.
613 Then the integers are replaced by sub-initializers, braced groupings
614 containing several integers. Each sub-initializer must be suitable as an
615 initializer for the type `HARD_REG_SET' which is defined in
616 `hard-reg-set.h'. */
617 #define REG_CLASS_CONTENTS \
619 { 0x00000000, 0x00000000, NO_MASK }, /* NO_REGS */ \
620 { 0x00000000, 0x00000000, REPEAT_MASK }, /* REPEAT_REGS */ \
621 { 0x00000000, 0x00000000, CR_MASK }, /* CR_REGS */ \
622 { 0x00000000, 0x00000000, ACCUM_MASK }, /* ACCUM_REGS */ \
623 { 0x00000000, 0x00000000, OTHER_FLAG_MASK }, /* OTHER_FLAG_REGS */ \
624 { 0x00000000, 0x00000000, F0_MASK }, /* F0_REGS */ \
625 { 0x00000000, 0x00000000, F1_MASK }, /* F1_REGS */ \
626 { 0x00000000, 0x00000000, BR_FLAG_MASK }, /* BR_FLAG_REGS */ \
627 { 0x00000000, 0x00000000, FLAG_MASK }, /* FLAG_REGS */ \
628 { 0xfffffffc, 0x3fffffff, NO_MASK }, /* EVEN_REGS */ \
629 { 0xffffffff, 0xffffffff, SPECIAL_MASK }, /* GPR_REGS */ \
630 { 0xffffffff, 0xffffffff, ALL_MASK }, /* ALL_REGS */ \
633 /* A C expression whose value is a register class containing hard register
634 REGNO. In general there is more than one such class; choose a class which
635 is "minimal", meaning that no smaller class also contains the register. */
637 extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
638 #define REGNO_REG_CLASS(REGNO) regno_reg_class[ (REGNO) ]
640 /* A macro whose definition is the name of the class to which a valid base
641 register must belong. A base register is one used in an address which is
642 the register value plus a displacement. */
643 #define BASE_REG_CLASS GPR_REGS
645 /* A macro whose definition is the name of the class to which a valid index
646 register must belong. An index register is one used in an address where its
647 value is either multiplied by a scale factor or added to another register
648 (as well as added to a displacement). */
649 #define INDEX_REG_CLASS GPR_REGS
651 /* A C expression which defines the machine-dependent operand constraint
652 letters for register classes. If CHAR is such a letter, the value should be
653 the register class corresponding to it. Otherwise, the value should be
654 `NO_REGS'. The register letter `r', corresponding to class `GENERAL_REGS',
655 will not be passed to this macro; you do not need to handle it.
657 The following letters are unavailable, due to being used as
658 constraints:
659 '0'..'9'
660 '<', '>'
661 'E', 'F', 'G', 'H'
662 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'
663 'Q', 'R', 'S', 'T', 'U'
664 'V', 'X'
665 'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */
667 extern enum reg_class reg_class_from_letter[256];
668 #define REG_CLASS_FROM_LETTER(CHAR) reg_class_from_letter[(unsigned char)(CHAR)]
670 /* A C expression which is nonzero if register number NUM is suitable for use
671 as a base register in operand addresses. It may be either a suitable hard
672 register or a pseudo register that has been allocated such a hard register. */
674 #define REGNO_OK_FOR_BASE_P(NUM) \
675 ((NUM) < FIRST_PSEUDO_REGISTER \
676 ? GPR_P (NUM) \
677 : (reg_renumber[NUM] >= 0 && GPR_P (reg_renumber[NUM])))
680 /* A C expression which is nonzero if register number NUM is suitable for use
681 as an index register in operand addresses. It may be either a suitable hard
682 register or a pseudo register that has been allocated such a hard register.
684 The difference between an index register and a base register is that the
685 index register may be scaled. If an address involves the sum of two
686 registers, neither one of them scaled, then either one may be labeled the
687 "base" and the other the "index"; but whichever labeling is used must fit
688 the machine's constraints of which registers may serve in each capacity.
689 The compiler will try both labelings, looking for one that is valid, and
690 will reload one or both registers only if neither labeling works. */
692 #define REGNO_OK_FOR_INDEX_P(NUM) \
693 ((NUM) < FIRST_PSEUDO_REGISTER \
694 ? GPR_P (NUM) \
695 : (reg_renumber[NUM] >= 0 && GPR_P (reg_renumber[NUM])))
697 /* A C expression that places additional restrictions on the register class to
698 use when it is necessary to copy value X into a register in class CLASS.
699 The value is a register class; perhaps CLASS, or perhaps another, smaller
700 class. On many machines, the following definition is safe:
702 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
704 Sometimes returning a more restrictive class makes better code. For
705 example, on the 68000, when X is an integer constant that is in range for a
706 `moveq' instruction, the value of this macro is always `DATA_REGS' as long
707 as CLASS includes the data registers. Requiring a data register guarantees
708 that a `moveq' will be used.
710 If X is a `const_double', by returning `NO_REGS' you can force X into a
711 memory constant. This is useful on certain machines where immediate
712 floating values cannot be loaded into certain kinds of registers. */
713 #define PREFERRED_RELOAD_CLASS(X, CLASS) CLASS
715 /* Many machines have some registers that cannot be copied directly to or from
716 memory or even from other types of registers. An example is the `MQ'
717 register, which on most machines, can only be copied to or from general
718 registers, but not memory. Some machines allow copying all registers to and
719 from memory, but require a scratch register for stores to some memory
720 locations (e.g., those with symbolic address on the RT, and those with
721 certain symbolic address on the SPARC when compiling PIC). In some cases,
722 both an intermediate and a scratch register are required.
724 You should define these macros to indicate to the reload phase that it may
725 need to allocate at least one register for a reload in addition to the
726 register to contain the data. Specifically, if copying X to a register
727 CLASS in MODE requires an intermediate register, you should define
728 `SECONDARY_INPUT_RELOAD_CLASS' to return the largest register class all of
729 whose registers can be used as intermediate registers or scratch registers.
731 If copying a register CLASS in MODE to X requires an intermediate or scratch
732 register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be defined to return the
733 largest register class required. If the requirements for input and output
734 reloads are the same, the macro `SECONDARY_RELOAD_CLASS' should be used
735 instead of defining both macros identically.
737 The values returned by these macros are often `GENERAL_REGS'. Return
738 `NO_REGS' if no spare register is needed; i.e., if X can be directly copied
739 to or from a register of CLASS in MODE without requiring a scratch register.
740 Do not define this macro if it would always return `NO_REGS'.
742 If a scratch register is required (either with or without an intermediate
743 register), you should define patterns for `reload_inM' or `reload_outM', as
744 required (*note Standard Names::.. These patterns, which will normally be
745 implemented with a `define_expand', should be similar to the `movM'
746 patterns, except that operand 2 is the scratch register.
748 Define constraints for the reload register and scratch register that contain
749 a single register class. If the original reload register (whose class is
750 CLASS) can meet the constraint given in the pattern, the value returned by
751 these macros is used for the class of the scratch register. Otherwise, two
752 additional reload registers are required. Their classes are obtained from
753 the constraints in the insn pattern.
755 X might be a pseudo-register or a `subreg' of a pseudo-register, which could
756 either be in a hard register or in memory. Use `true_regnum' to find out;
757 it will return -1 if the pseudo is in memory and the hard register number if
758 it is in a register.
760 These macros should not be used in the case where a particular class of
761 registers can only be copied to memory and not to another class of
762 registers. In that case, secondary reload registers are not needed and
763 would not be helpful. Instead, a stack location must be used to perform the
764 copy and the `movM' pattern should use memory as an intermediate storage.
765 This case often occurs between floating-point and general registers. */
767 #define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \
768 ((CLASS) == GPR_REGS ? NO_REGS \
769 : (CLASS) == EVEN_REGS ? NO_REGS \
770 : (CLASS) == ACCUM_REGS ? EVEN_REGS \
771 : GPR_REGS)
773 /* A C expression whose value is nonzero if pseudos that have been assigned to
774 registers of class CLASS would likely be spilled because registers of CLASS
775 are needed for spill registers.
777 The default value of this macro returns 1 if CLASS has exactly one register
778 and zero otherwise. On most machines, this default should be used. Only
779 define this macro to some other expression if pseudo allocated by
780 `local-alloc.c' end up in memory because their hard registers were needed
781 for spill registers. If this macro returns nonzero for those classes, those
782 pseudos will only be allocated by `global.c', which knows how to reallocate
783 the pseudo to another register. If there would not be another register
784 available for reallocation, you should not change the definition of this
785 macro since the only effect of such a definition would be to slow down
786 register allocation. */
787 #define CLASS_LIKELY_SPILLED_P(CLASS) \
788 ((CLASS) != GPR_REGS && (CLASS) != EVEN_REGS)
790 /* A C expression for the maximum number of consecutive registers of
791 class CLASS needed to hold a value of mode MODE.
793 This is closely related to the macro `HARD_REGNO_NREGS'. In fact, the value
794 of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be the maximum value of
795 `HARD_REGNO_NREGS (REGNO, MODE)' for all REGNO values in the class CLASS.
797 This macro helps control the handling of multiple-word values in
798 the reload pass. */
800 #define CLASS_MAX_NREGS(CLASS, MODE) \
801 (((CLASS) == ACCUM_REGS) \
802 ? ((GET_MODE_SIZE (MODE) + 8 - 1) / 8) \
803 : ((GET_MODE_SIZE (MODE) + 4 - 1) / 4))
805 /* A C expression that defines the machine-dependent operand constraint letters
806 (`I', `J', `K', .. 'P') that specify particular ranges of integer values.
807 If C is one of those letters, the expression should check that VALUE, an
808 integer, is in the appropriate range and return 1 if so, 0 otherwise. If C
809 is not one of those letters, the value should be 0 regardless of VALUE. */
810 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
811 ((C) == 'I' ? IN_RANGE_P (VALUE, -32, 31) \
812 : (C) == 'J' ? IN_RANGE_P (VALUE, 0, 31) \
813 : (C) == 'K' ? IN_RANGE_P (exact_log2 (VALUE), 0, 31) \
814 : (C) == 'L' ? IN_RANGE_P (exact_log2 (~ (VALUE)), 0, 31) \
815 : (C) == 'M' ? ((VALUE) == 32) \
816 : (C) == 'N' ? ((VALUE) == 1) \
817 : (C) == 'O' ? ((VALUE) == 0) \
818 : (C) == 'P' ? IN_RANGE_P (VALUE, 32, 63) \
819 : FALSE)
821 /* A C expression that defines the machine-dependent operand constraint letters
822 (`G', `H') that specify particular ranges of `const_double' values.
824 If C is one of those letters, the expression should check that VALUE, an RTX
825 of code `const_double', is in the appropriate range and return 1 if so, 0
826 otherwise. If C is not one of those letters, the value should be 0
827 regardless of VALUE.
829 `const_double' is used for all floating-point constants and for `DImode'
830 fixed-point constants. A given letter can accept either or both kinds of
831 values. It can use `GET_MODE' to distinguish between these kinds. */
832 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
833 ((C) == 'G' ? (CONST_DOUBLE_LOW (VALUE) == 0 \
834 && CONST_DOUBLE_HIGH (VALUE) == 0) \
835 : (C) == 'H' ? FALSE \
836 : FALSE)
838 /* A C expression that defines the optional machine-dependent constraint
839 letters (`Q', `R', `S', `T', `U') that can be used to segregate specific
840 types of operands, usually memory references, for the target machine.
841 Normally this macro will not be defined. If it is required for a particular
842 target machine, it should return 1 if VALUE corresponds to the operand type
843 represented by the constraint letter C. If C is not defined as an extra
844 constraint, the value returned should be 0 regardless of VALUE.
846 For example, on the ROMP, load instructions cannot have their output in r0
847 if the memory reference contains a symbolic address. Constraint letter `Q'
848 is defined as representing a memory address that does *not* contain a
849 symbolic address. An alternative is specified with a `Q' constraint on the
850 input and `r' on the output. The next alternative specifies `m' on the
851 input and a register class that does not include r0 on the output. */
853 #define EXTRA_CONSTRAINT(VALUE, C) \
854 (((C) == 'Q') ? short_memory_operand ((VALUE), GET_MODE (VALUE)) \
855 : ((C) == 'R') ? single_reg_memory_operand ((VALUE), GET_MODE (VALUE)) \
856 : ((C) == 'S') ? const_addr_memory_operand ((VALUE), GET_MODE (VALUE)) \
857 : ((C) == 'T') ? long_memory_operand ((VALUE), GET_MODE (VALUE)) \
858 : ((C) == 'U') ? FALSE \
859 : FALSE)
862 /* Basic Stack Layout */
864 /* Stack layout */
866 /* Structure used to define the d30v stack */
867 typedef struct d30v_stack {
868 int varargs_p; /* whether this is a varargs function */
869 int varargs_size; /* size to hold varargs args passed in regs */
870 int vars_size; /* variable save area size */
871 int parm_size; /* outgoing parameter size */
872 int gpr_size; /* size of saved GPR registers */
873 int accum_size; /* size of saved ACCUM registers */
874 int total_size; /* total bytes allocated for stack */
875 /* which registers are to be saved */
876 int save_offset; /* offset from new sp to start saving vars at */
877 int link_offset; /* offset r62 is saved at */
878 int memrefs_varargs; /* # of 2 word memory references for varargs */
879 int memrefs_2words; /* # of 2 word memory references */
880 int memrefs_1word; /* # of 1 word memory references */
881 /* 1 for ldw/stw ops; 2 for ld2w/st2w ops */
882 unsigned char save_p[FIRST_PSEUDO_REGISTER];
883 } d30v_stack_t;
885 /* Define this macro if pushing a word onto the stack moves the stack pointer
886 to a smaller address.
888 When we say, "define this macro if ...," it means that the compiler checks
889 this macro only with `#ifdef' so the precise definition used does not
890 matter. */
891 #define STACK_GROWS_DOWNWARD 1
893 /* Offset from the frame pointer to the first local variable slot to be
894 allocated.
896 If `FRAME_GROWS_DOWNWARD', find the next slot's offset by subtracting the
897 first slot's length from `STARTING_FRAME_OFFSET'. Otherwise, it is found by
898 adding the length of the first slot to the value `STARTING_FRAME_OFFSET'. */
900 #define STARTING_FRAME_OFFSET \
901 (D30V_ALIGN (current_function_outgoing_args_size, \
902 (STACK_BOUNDARY / BITS_PER_UNIT)))
904 /* Offset from the argument pointer register to the first argument's address.
905 On some machines it may depend on the data type of the function.
907 If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first
908 argument's address. */
909 #define FIRST_PARM_OFFSET(FUNDECL) 0
911 /* A C expression whose value is RTL representing the value of the return
912 address for the frame COUNT steps up from the current frame, after the
913 prologue. FRAMEADDR is the frame pointer of the COUNT frame, or the frame
914 pointer of the COUNT - 1 frame if `RETURN_ADDR_IN_PREVIOUS_FRAME' is
915 defined.
917 The value of the expression must always be the correct address when COUNT is
918 zero, but may be `NULL_RTX' if there is not way to determine the return
919 address of other frames. */
921 /* ??? This definition fails for leaf functions. There is currently no
922 general solution for this problem. */
924 /* ??? There appears to be no way to get the return address of any previous
925 frame except by disassembling instructions in the prologue/epilogue.
926 So currently we support only the current frame. */
928 #define RETURN_ADDR_RTX(COUNT, FRAME) \
929 ((COUNT) == 0 ? d30v_return_addr() : const0_rtx)
931 /* A C expression whose value is RTL representing the location of the incoming
932 return address at the beginning of any function, before the prologue. This
933 RTL is either a `REG', indicating that the return value is saved in `REG',
934 or a `MEM' representing a location in the stack.
936 You only need to define this macro if you want to support call frame
937 debugging information like that provided by DWARF 2. */
939 /* Before the prologue, RA lives in r62. */
940 #define INCOMING_RETURN_ADDR_RTX gen_rtx (REG, Pmode, GPR_LINK)
942 /* A C expression whose value is an integer giving the offset, in bytes, from
943 the value of the stack pointer register to the top of the stack frame at the
944 beginning of any function, before the prologue. The top of the frame is
945 defined to be the value of the stack pointer in the previous frame, just
946 before the call instruction.
948 You only need to define this macro if you want to support call frame
949 debugging information like that provided by DWARF 2. */
950 #define INCOMING_FRAME_SP_OFFSET 0
952 /* Initialize data used by insn expanders. This is called from insn_emit,
953 once for every function before code is generated. */
955 #define INIT_EXPANDERS d30v_init_expanders ()
958 /* Register That Address the Stack Frame. */
960 /* The register number of the stack pointer register, which must also be a
961 fixed register according to `FIXED_REGISTERS'. On most machines, the
962 hardware determines which register this is. */
963 #define STACK_POINTER_REGNUM GPR_SP
965 /* The register number of the frame pointer register, which is used to access
966 automatic variables in the stack frame. On some machines, the hardware
967 determines which register this is. On other machines, you can choose any
968 register you wish for this purpose. */
969 #define FRAME_POINTER_REGNUM GPR_FP
971 /* Register numbers used for passing a function's static chain pointer. If
972 register windows are used, the register number as seen by the called
973 function is `STATIC_CHAIN_INCOMING_REGNUM', while the register number as
974 seen by the calling function is `STATIC_CHAIN_REGNUM'. If these registers
975 are the same, `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
977 The static chain register need not be a fixed register.
979 If the static chain is passed in memory, these macros should not be defined;
980 instead, the next two macros should be defined. */
982 #define STATIC_CHAIN_REGNUM (GPR_FIRST + 18)
985 /* Eliminating the Frame Pointer and the Arg Pointer */
987 /* A C expression which is nonzero if a function must have and use a frame
988 pointer. This expression is evaluated in the reload pass. If its value is
989 nonzero the function will have a frame pointer.
991 The expression can in principle examine the current function and decide
992 according to the facts, but on most machines the constant 0 or the constant
993 1 suffices. Use 0 when the machine allows code to be generated with no
994 frame pointer, and doing so saves some time or space. Use 1 when there is
995 no possible advantage to avoiding a frame pointer.
997 In certain cases, the compiler does not know how to produce valid code
998 without a frame pointer. The compiler recognizes those cases and
999 automatically gives the function a frame pointer regardless of what
1000 `FRAME_POINTER_REQUIRED' says. You don't need to worry about them.
1002 In a function that does not require a frame pointer, the frame pointer
1003 register can be allocated for ordinary usage, unless you mark it as a fixed
1004 register. See `FIXED_REGISTERS' for more information. */
1005 #define FRAME_POINTER_REQUIRED 0
1007 /* If defined, this macro specifies a table of register pairs used to eliminate
1008 unneeded registers that point into the stack frame. If it is not defined,
1009 the only elimination attempted by the compiler is to replace references to
1010 the frame pointer with references to the stack pointer.
1012 The definition of this macro is a list of structure initializations, each of
1013 which specifies an original and replacement register.
1015 On some machines, the position of the argument pointer is not known until
1016 the compilation is completed. In such a case, a separate hard register must
1017 be used for the argument pointer. This register can be eliminated by
1018 replacing it with either the frame pointer or the argument pointer,
1019 depending on whether or not the frame pointer has been eliminated.
1021 In this case, you might specify:
1022 #define ELIMINABLE_REGS \
1023 {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1024 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
1025 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
1027 Note that the elimination of the argument pointer with the stack pointer is
1028 specified first since that is the preferred elimination. */
1029 #define ELIMINABLE_REGS \
1031 { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
1032 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \
1033 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM } \
1036 /* A C expression that returns nonzero if the compiler is allowed to try to
1037 replace register number FROM-REG with register number TO-REG. This macro
1038 need only be defined if `ELIMINABLE_REGS' is defined, and will usually be
1039 the constant 1, since most of the cases preventing register elimination are
1040 things that the compiler already knows about. */
1042 #define CAN_ELIMINATE(FROM, TO) \
1043 ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \
1044 ? ! frame_pointer_needed \
1045 : 1)
1047 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It specifies the
1048 initial difference between the specified pair of registers. This macro must
1049 be defined if `ELIMINABLE_REGS' is defined. */
1051 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1053 d30v_stack_t *info = d30v_stack_info (); \
1055 if ((FROM) == FRAME_POINTER_REGNUM) \
1056 (OFFSET) = 0; \
1057 else if ((FROM) == ARG_POINTER_REGNUM) \
1058 (OFFSET) = info->total_size - current_function_pretend_args_size; \
1059 else \
1060 abort (); \
1064 /* Passing Function Arguments on the Stack */
1066 /* If defined, the maximum amount of space required for outgoing arguments will
1067 be computed and placed into the variable
1068 `current_function_outgoing_args_size'. No space will be pushed onto the
1069 stack for each call; instead, the function prologue should increase the
1070 stack frame size by this amount.
1072 Defining both `PUSH_ROUNDING' and `ACCUMULATE_OUTGOING_ARGS' is not
1073 proper. */
1074 #define ACCUMULATE_OUTGOING_ARGS 1
1076 /* A C expression that should indicate the number of bytes of its own arguments
1077 that a function pops on returning, or 0 if the function pops no arguments
1078 and the caller must therefore pop them all after the function returns.
1080 FUNDECL is a C variable whose value is a tree node that describes the
1081 function in question. Normally it is a node of type `FUNCTION_DECL' that
1082 describes the declaration of the function. From this it is possible to
1083 obtain the DECL_ATTRIBUTES of the function.
1085 FUNTYPE is a C variable whose value is a tree node that describes the
1086 function in question. Normally it is a node of type `FUNCTION_TYPE' that
1087 describes the data type of the function. From this it is possible to obtain
1088 the data types of the value and arguments (if known).
1090 When a call to a library function is being considered, FUNTYPE will contain
1091 an identifier node for the library function. Thus, if you need to
1092 distinguish among various library functions, you can do so by their names.
1093 Note that "library function" in this context means a function used to
1094 perform arithmetic, whose name is known specially in the compiler and was
1095 not mentioned in the C code being compiled.
1097 STACK-SIZE is the number of bytes of arguments passed on the stack. If a
1098 variable number of bytes is passed, it is zero, and argument popping will
1099 always be the responsibility of the calling function.
1101 On the VAX, all functions always pop their arguments, so the definition of
1102 this macro is STACK-SIZE. On the 68000, using the standard calling
1103 convention, no functions pop their arguments, so the value of the macro is
1104 always 0 in this case. But an alternative calling convention is available
1105 in which functions that take a fixed number of arguments pop them but other
1106 functions (such as `printf') pop nothing (the caller pops all). When this
1107 convention is in use, FUNTYPE is examined to determine whether a function
1108 takes a fixed number of arguments. */
1109 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
1112 /* Function Arguments in Registers */
1114 /* A C expression that controls whether a function argument is passed in a
1115 register, and which register.
1117 The arguments are CUM, which summarizes all the previous arguments; MODE,
1118 the machine mode of the argument; TYPE, the data type of the argument as a
1119 tree node or 0 if that is not known (which happens for C support library
1120 functions); and NAMED, which is 1 for an ordinary argument and 0 for
1121 nameless arguments that correspond to `...' in the called function's
1122 prototype.
1124 The value of the expression should either be a `reg' RTX for the hard
1125 register in which to pass the argument, or zero to pass the argument on the
1126 stack.
1128 For machines like the VAX and 68000, where normally all arguments are
1129 pushed, zero suffices as a definition.
1131 The usual way to make the ANSI library `stdarg.h' work on a machine where
1132 some arguments are usually passed in registers, is to cause nameless
1133 arguments to be passed on the stack instead. This is done by making
1134 `FUNCTION_ARG' return 0 whenever NAMED is 0.
1136 You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the definition of
1137 this macro to determine if this argument is of a type that must be passed in
1138 the stack. If `REG_PARM_STACK_SPACE' is not defined and `FUNCTION_ARG'
1139 returns nonzero for such an argument, the compiler will abort. If
1140 `REG_PARM_STACK_SPACE' is defined, the argument will be computed in the
1141 stack and then loaded into a register. */
1143 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
1144 d30v_function_arg (&CUM, (int)MODE, TYPE, NAMED, FALSE)
1146 /* Define this macro if the target machine has "register windows", so that the
1147 register in which a function sees an arguments is not necessarily the same
1148 as the one in which the caller passed the argument.
1150 For such machines, `FUNCTION_ARG' computes the register in which the caller
1151 passes the value, and `FUNCTION_INCOMING_ARG' should be defined in a similar
1152 fashion to tell the function being called where the arguments will arrive.
1154 If `FUNCTION_INCOMING_ARG' is not defined, `FUNCTION_ARG' serves both
1155 purposes. */
1157 #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
1158 d30v_function_arg (&CUM, (int)MODE, TYPE, NAMED, TRUE)
1160 /* A C expression for the number of words, at the beginning of an argument,
1161 must be put in registers. The value must be zero for arguments that are
1162 passed entirely in registers or that are entirely pushed on the stack.
1164 On some machines, certain arguments must be passed partially in registers
1165 and partially in memory. On these machines, typically the first N words of
1166 arguments are passed in registers, and the rest on the stack. If a
1167 multi-word argument (a `double' or a structure) crosses that boundary, its
1168 first few words must be passed in registers and the rest must be pushed.
1169 This macro tells the compiler when this occurs, and how many of the words
1170 should go in registers.
1172 `FUNCTION_ARG' for these arguments should return the first register to be
1173 used by the caller for this argument; likewise `FUNCTION_INCOMING_ARG', for
1174 the called function. */
1175 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
1176 d30v_function_arg_partial_nregs (&CUM, (int)MODE, TYPE, NAMED)
1178 /* A C expression that indicates when an argument must be passed by reference.
1179 If nonzero for an argument, a copy of that argument is made in memory and a
1180 pointer to the argument is passed instead of the argument itself. The
1181 pointer is passed in whatever way is appropriate for passing a pointer to
1182 that type.
1184 On machines where `REG_PARM_STACK_SPACE' is not defined, a suitable
1185 definition of this macro might be
1186 #define FUNCTION_ARG_PASS_BY_REFERENCE\
1187 (CUM, MODE, TYPE, NAMED) \
1188 MUST_PASS_IN_STACK (MODE, TYPE) */
1189 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) 0
1191 /* A C type for declaring a variable that is used as the first argument of
1192 `FUNCTION_ARG' and other related values. For some target machines, the type
1193 `int' suffices and can hold the number of bytes of argument so far.
1195 There is no need to record in `CUMULATIVE_ARGS' anything about the arguments
1196 that have been passed on the stack. The compiler has other variables to
1197 keep track of that. For target machines on which all arguments are passed
1198 on the stack, there is no need to store anything in `CUMULATIVE_ARGS';
1199 however, the data structure must exist and should not be empty, so use
1200 `int'. */
1201 #define CUMULATIVE_ARGS int
1203 /* A C statement (sans semicolon) for initializing the variable CUM for the
1204 state at the beginning of the argument list. The variable has type
1205 `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node for the data type
1206 of the function which will receive the args, or 0 if the args are to a
1207 compiler support library function. The value of INDIRECT is nonzero when
1208 processing an indirect call, for example a call through a function pointer.
1209 The value of INDIRECT is zero for a call to an explicitly named function, a
1210 library function call, or when `INIT_CUMULATIVE_ARGS' is used to find
1211 arguments for the function being compiled.
1213 When processing a call to a compiler support library function, LIBNAME
1214 identifies which one. It is a `symbol_ref' rtx which contains the name of
1215 the function, as a string. LIBNAME is 0 when an ordinary C function call is
1216 being processed. Thus, each time this macro is called, either LIBNAME or
1217 FNTYPE is nonzero, but never both of them at once. */
1219 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
1220 d30v_init_cumulative_args (&CUM, FNTYPE, LIBNAME, FNDECL, FALSE)
1222 /* Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of finding the
1223 arguments for the function being compiled. If this macro is undefined,
1224 `INIT_CUMULATIVE_ARGS' is used instead.
1226 The value passed for LIBNAME is always 0, since library routines with
1227 special calling conventions are never compiled with GCC. The argument
1228 LIBNAME exists for symmetry with `INIT_CUMULATIVE_ARGS'. */
1230 #define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
1231 d30v_init_cumulative_args (&CUM, FNTYPE, LIBNAME, NULL, TRUE)
1233 /* A C statement (sans semicolon) to update the summarizer variable CUM to
1234 advance past an argument in the argument list. The values MODE, TYPE and
1235 NAMED describe that argument. Once this is done, the variable CUM is
1236 suitable for analyzing the *following* argument with `FUNCTION_ARG', etc.
1238 This macro need not do anything if the argument in question was passed on
1239 the stack. The compiler knows how to track the amount of stack space used
1240 for arguments without any special help. */
1242 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
1243 d30v_function_arg_advance (&CUM, (int) MODE, TYPE, NAMED)
1245 /* If defined, a C expression that gives the alignment boundary, in bits, of an
1246 argument with the specified mode and type. If it is not defined,
1247 `PARM_BOUNDARY' is used for all arguments. */
1249 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
1250 d30v_function_arg_boundary ((int) MODE, TYPE)
1252 /* A C expression that is nonzero if REGNO is the number of a hard register in
1253 which function arguments are sometimes passed. This does *not* include
1254 implicit arguments such as the static chain and the structure-value address.
1255 On many machines, no registers can be used for this purpose since all
1256 function arguments are pushed on the stack. */
1258 #define FUNCTION_ARG_REGNO_P(REGNO) \
1259 IN_RANGE_P (REGNO, GPR_ARG_FIRST, GPR_ARG_LAST)
1262 /* How Scalar Function Values are Returned */
1264 /* A C expression to create an RTX representing the place where a function
1265 returns a value of data type VALTYPE. VALTYPE is a tree node representing a
1266 data type. Write `TYPE_MODE (VALTYPE)' to get the machine mode used to
1267 represent that type. On many machines, only the mode is relevant.
1268 (Actually, on most machines, scalar values are returned in the same place
1269 regardless of mode).
1271 If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same promotion
1272 rules specified in `PROMOTE_MODE' if VALTYPE is a scalar type.
1274 If the precise function being called is known, FUNC is a tree node
1275 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This makes it
1276 possible to use a different value-returning convention for specific
1277 functions when all their calls are known.
1279 `FUNCTION_VALUE' is not used for return vales with aggregate data types,
1280 because these are returned in another way. See `STRUCT_VALUE_REGNUM' and
1281 related macros, below. */
1283 #define FUNCTION_VALUE(VALTYPE, FUNC) \
1284 gen_rtx (REG, TYPE_MODE (VALTYPE), GPR_RET_VALUE)
1286 /* A C expression to create an RTX representing the place where a library
1287 function returns a value of mode MODE. If the precise function being called
1288 is known, FUNC is a tree node (`FUNCTION_DECL') for it; otherwise, FUNC is a
1289 null pointer. This makes it possible to use a different value-returning
1290 convention for specific functions when all their calls are known.
1292 Note that "library function" in this context means a compiler support
1293 routine, used to perform arithmetic, whose name is known specially by the
1294 compiler and was not mentioned in the C code being compiled.
1296 The definition of `LIBRARY_VALUE' need not be concerned aggregate data
1297 types, because none of the library functions returns such types. */
1299 #define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, GPR_RET_VALUE)
1301 /* A C expression that is nonzero if REGNO is the number of a hard register in
1302 which the values of called function may come back.
1304 A register whose use for returning values is limited to serving as the
1305 second of a pair (for a value of type `double', say) need not be recognized
1306 by this macro. So for most machines, this definition suffices:
1308 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
1310 If the machine has register windows, so that the caller and the called
1311 function use different registers for the return value, this macro should
1312 recognize only the caller's register numbers. */
1314 #define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == GPR_RET_VALUE)
1317 /* How Large Values are Returned */
1319 /* If the structure value address is passed in a register, then
1320 `STRUCT_VALUE_REGNUM' should be the number of that register. */
1322 #define STRUCT_VALUE_REGNUM GPR_ARG_FIRST
1324 /* If the structure value address is not passed in a register, define
1325 `STRUCT_VALUE' as an expression returning an RTX for the place where the
1326 address is passed. If it returns 0, the address is passed as an "invisible"
1327 first argument. */
1329 #define STRUCT_VALUE 0
1332 /* Define this macro as a C expression that is nonzero for registers
1333 are used by the epilogue or the `return' pattern. The stack and
1334 frame pointer registers are already be assumed to be used as
1335 needed. */
1336 #define EPILOGUE_USES(REGNO) ((REGNO) == GPR_LINK)
1338 /* A C structure for machine-specific, per-function data.
1339 This is added to the cfun structure. */
1340 typedef struct machine_function GTY(())
1342 /* Additionsl stack adjustment in __builtin_eh_throw. */
1343 rtx eh_epilogue_sp_ofs;
1344 } machine_function;
1347 /* Generating Code for Profiling. */
1349 /* A C statement or compound statement to output to FILE some assembler code to
1350 call the profiling subroutine `mcount'. Before calling, the assembler code
1351 must load the address of a counter variable into a register where `mcount'
1352 expects to find the address. The name of this variable is `LP' followed by
1353 the number LABELNO, so you would generate the name using `LP%d' in a
1354 `fprintf'.
1356 The details of how the address should be passed to `mcount' are determined
1357 by your operating system environment, not by GCC. To figure them out,
1358 compile a small program for profiling using the system's installed C
1359 compiler and look at the assembler code that results. */
1361 #define FUNCTION_PROFILER(FILE, LABELNO) d30v_function_profiler (FILE, LABELNO)
1364 /* Implementing the Varargs Macros. */
1366 /* If defined, is a C expression that produces the machine-specific code for a
1367 call to `__builtin_saveregs'. This code will be moved to the very beginning
1368 of the function, before any parameter access are made. The return value of
1369 this function should be an RTX that contains the value to use as the return
1370 of `__builtin_saveregs'.
1372 If this macro is not defined, the compiler will output an ordinary call to
1373 the library function `__builtin_saveregs'. */
1375 #define EXPAND_BUILTIN_SAVEREGS() d30v_expand_builtin_saveregs ()
1377 /* This macro offers an alternative to using `__builtin_saveregs' and defining
1378 the macro `EXPAND_BUILTIN_SAVEREGS'. Use it to store the anonymous register
1379 arguments into the stack so that all the arguments appear to have been
1380 passed consecutively on the stack. Once this is done, you can use the
1381 standard implementation of varargs that works for machines that pass all
1382 their arguments on the stack.
1384 The argument ARGS_SO_FAR is the `CUMULATIVE_ARGS' data structure, containing
1385 the values that obtain after processing of the named arguments. The
1386 arguments MODE and TYPE describe the last named argument--its machine mode
1387 and its data type as a tree node.
1389 The macro implementation should do two things: first, push onto the stack
1390 all the argument registers *not* used for the named arguments, and second,
1391 store the size of the data thus pushed into the `int'-valued variable whose
1392 name is supplied as the argument PRETEND_ARGS_SIZE. The value that you
1393 store here will serve as additional offset for setting up the stack frame.
1395 Because you must generate code to push the anonymous arguments at compile
1396 time without knowing their data types, `SETUP_INCOMING_VARARGS' is only
1397 useful on machines that have just a single category of argument register and
1398 use it uniformly for all data types.
1400 If the argument SECOND_TIME is nonzero, it means that the arguments of the
1401 function are being analyzed for the second time. This happens for an inline
1402 function, which is not actually compiled until the end of the source file.
1403 The macro `SETUP_INCOMING_VARARGS' should not generate any instructions in
1404 this case. */
1406 #define SETUP_INCOMING_VARARGS(ARGS_SO_FAR, MODE, TYPE, PRETEND_ARGS_SIZE, SECOND_TIME) \
1407 d30v_setup_incoming_varargs (&ARGS_SO_FAR, (int) MODE, TYPE, \
1408 &PRETEND_ARGS_SIZE, SECOND_TIME)
1410 /* Implement the stdarg/varargs va_start macro. STDARG_P is nonzero if this
1411 is stdarg.h instead of varargs.h. VALIST is the tree of the va_list
1412 variable to initialize. NEXTARG is the machine independent notion of the
1413 'next' argument after the variable arguments. If not defined, a standard
1414 implementation will be defined that works for arguments passed on the stack. */
1416 #define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG) \
1417 d30v_expand_builtin_va_start(VALIST, NEXTARG)
1419 /* Implement the stdarg/varargs va_arg macro. VALIST is the variable of type
1420 va_list as a tree, TYPE is the type passed to va_arg. */
1422 #define EXPAND_BUILTIN_VA_ARG(VALIST, TYPE) \
1423 (d30v_expand_builtin_va_arg (VALIST, TYPE))
1425 /* Trampolines for Nested Functions. */
1427 /* A C expression for the size in bytes of the trampoline, as an integer. */
1428 #define TRAMPOLINE_SIZE (d30v_trampoline_size ())
1430 /* Alignment required for trampolines, in bits.
1432 If you don't define this macro, the value of `BIGGEST_ALIGNMENT' is used for
1433 aligning trampolines. */
1434 #define TRAMPOLINE_ALIGNMENT 64
1436 /* A C statement to initialize the variable parts of a trampoline. ADDR is an
1437 RTX for the address of the trampoline; FNADDR is an RTX for the address of
1438 the nested function; STATIC_CHAIN is an RTX for the static chain value that
1439 should be passed to the function when it is called. */
1440 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
1441 d30v_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN)
1444 /* Addressing Modes */
1446 /* Define this macro if the machine supports post-increment addressing. */
1447 #define HAVE_POST_INCREMENT 1
1449 /* Similar for other kinds of addressing. */
1450 #define HAVE_POST_DECREMENT 1
1452 /* A C expression that is 1 if the RTX X is a constant which is a valid
1453 address. On most machines, this can be defined as `CONSTANT_P (X)', but a
1454 few machines are more restrictive in which constant addresses are supported.
1456 `CONSTANT_P' accepts integer-values expressions whose values are not
1457 explicitly known, such as `symbol_ref', `label_ref', and `high' expressions
1458 and `const' arithmetic expressions, in addition to `const_int' and
1459 `const_double' expressions. */
1460 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
1462 /* A number, the maximum number of registers that can appear in a valid memory
1463 address. Note that it is up to you to specify a value equal to the maximum
1464 number that `GO_IF_LEGITIMATE_ADDRESS' would ever accept. */
1465 #define MAX_REGS_PER_ADDRESS 2
1467 /* A C compound statement with a conditional `goto LABEL;' executed if X (an
1468 RTX) is a legitimate memory address on the target machine for a memory
1469 operand of mode MODE. */
1471 #ifdef REG_OK_STRICT
1472 #define REG_OK_STRICT_P 1
1473 #else
1474 #define REG_OK_STRICT_P 0
1475 #endif
1477 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
1478 do { \
1479 if (d30v_legitimate_address_p ((int)MODE, X, REG_OK_STRICT_P)) \
1480 goto ADDR; \
1481 } while (0)
1483 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
1484 use as a base register. For hard registers, it should always accept those
1485 which the hardware permits and reject the others. Whether the macro accepts
1486 or rejects pseudo registers must be controlled by `REG_OK_STRICT' as
1487 described above. This usually requires two variant definitions, of which
1488 `REG_OK_STRICT' controls the one actually used. */
1490 #ifdef REG_OK_STRICT
1491 #define REG_OK_FOR_BASE_P(X) (GPR_P (REGNO (X)))
1492 #else
1493 #define REG_OK_FOR_BASE_P(X) (GPR_OR_PSEUDO_P (REGNO (X)))
1494 #endif
1496 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
1497 use as an index register.
1499 The difference between an index register and a base register is that the
1500 index register may be scaled. If an address involves the sum of two
1501 registers, neither one of them scaled, then either one may be labeled the
1502 "base" and the other the "index"; but whichever labeling is used must fit
1503 the machine's constraints of which registers may serve in each capacity.
1504 The compiler will try both labelings, looking for one that is valid, and
1505 will reload one or both registers only if neither labeling works. */
1507 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
1509 /* A C compound statement that attempts to replace X with a valid memory
1510 address for an operand of mode MODE. WIN will be a C statement label
1511 elsewhere in the code; the macro definition may use
1513 GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
1515 to avoid further processing if the address has become legitimate.
1517 X will always be the result of a call to `break_out_memory_refs', and OLDX
1518 will be the operand that was given to that function to produce X.
1520 The code generated by this macro should not alter the substructure of X. If
1521 it transforms X into a more legitimate form, it should assign X (which will
1522 always be a C variable) a new value.
1524 It is not necessary for this macro to come up with a legitimate address.
1525 The compiler has standard ways of doing so in all cases. In fact, it is
1526 safe for this macro to do nothing. But often a machine-dependent strategy
1527 can generate better code. */
1529 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
1530 do { \
1531 rtx y = d30v_legitimize_address (X, OLDX, (int)MODE, REG_OK_STRICT_P); \
1532 if (y) \
1534 X = y; \
1535 GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN); \
1537 } while (0)
1539 /* A C statement or compound statement with a conditional `goto LABEL;'
1540 executed if memory address X (an RTX) can have different meanings depending
1541 on the machine mode of the memory reference it is used for or if the address
1542 is valid for some modes but not others.
1544 Autoincrement and autodecrement addresses typically have mode-dependent
1545 effects because the amount of the increment or decrement is the size of the
1546 operand being addressed. Some machines have other mode-dependent addresses.
1547 Many RISC machines have no mode-dependent addresses.
1549 You may assume that ADDR is a valid address for the machine. */
1551 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
1552 do { \
1553 if (d30v_mode_dependent_address_p (ADDR)) \
1554 goto LABEL; \
1555 } while (0) \
1557 /* A C expression that is nonzero if X is a legitimate constant for an
1558 immediate operand on the target machine. You can assume that X satisfies
1559 `CONSTANT_P', so you need not check this. In fact, `1' is a suitable
1560 definition for this macro on machines where anything `CONSTANT_P' is valid. */
1561 #define LEGITIMATE_CONSTANT_P(X) 1
1564 /* Describing Relative Costs of Operations */
1566 /* A C expression for the cost of moving data from a register in class FROM to
1567 one in class TO. The classes are expressed using the enumeration values
1568 such as `GENERAL_REGS'. A value of 4 is the default; other values are
1569 interpreted relative to that.
1571 It is not required that the cost always equal 2 when FROM is the same as TO;
1572 on some machines it is expensive to move between registers if they are not
1573 general registers.
1575 If reload sees an insn consisting of a single `set' between two hard
1576 registers, and if `REGISTER_MOVE_COST' applied to their classes returns a
1577 value of 2, reload does not check to ensure that the constraints of the insn
1578 are met. Setting a cost of other than 2 will allow reload to verify that
1579 the constraints are met. You should do this if the `movM' pattern's
1580 constraints do not allow such copying. */
1582 #define REGISTER_MOVE_COST(MODE, FROM, TO) \
1583 (((FROM) != GPR_REGS && (FROM) != EVEN_REGS \
1584 && (TO) != GPR_REGS && (TO) != EVEN_REGS) ? 4 : 2)
1586 /* A C expression for the cost of moving data of mode M between a register and
1587 memory. A value of 2 is the default; this cost is relative to those in
1588 `REGISTER_MOVE_COST'.
1590 If moving between registers and memory is more expensive than between two
1591 registers, you should define this macro to express the relative cost. */
1592 #define MEMORY_MOVE_COST(M,C,I) 4
1594 /* A C expression for the cost of a branch instruction. A value of 1 is the
1595 default; other values are interpreted relative to that. */
1597 #define BRANCH_COST d30v_branch_cost
1599 #define D30V_DEFAULT_BRANCH_COST 2
1601 /* Values of the -mbranch-cost=n string. */
1602 extern int d30v_branch_cost;
1603 extern const char *d30v_branch_cost_string;
1605 /* Here are additional macros which do not specify precise relative costs, but
1606 only that certain actions are more expensive than GCC would ordinarily
1607 expect. */
1609 /* Define this macro as a C expression which is nonzero if accessing less than
1610 a word of memory (i.e. a `char' or a `short') is no faster than accessing a
1611 word of memory, i.e., if such access require more than one instruction or if
1612 there is no difference in cost between byte and (aligned) word loads.
1614 When this macro is not defined, the compiler will access a field by finding
1615 the smallest containing object; when it is defined, a fullword load will be
1616 used if alignment permits. Unless bytes accesses are faster than word
1617 accesses, using word accesses is preferable since it may eliminate
1618 subsequent memory access if subsequent accesses occur to other fields in the
1619 same word of the structure, but to different bytes. */
1620 #define SLOW_BYTE_ACCESS 1
1622 /* Define this macro if it is as good or better to call a constant function
1623 address than to call an address kept in a register. */
1624 #define NO_FUNCTION_CSE
1627 /* Dividing the output into sections. */
1629 /* A C expression whose value is a string containing the assembler operation
1630 that should precede instructions and read-only data. Normally `".text"' is
1631 right. */
1632 #define TEXT_SECTION_ASM_OP "\t.text"
1634 /* A C expression whose value is a string containing the assembler operation to
1635 identify the following data as writable initialized data. Normally
1636 `".data"' is right. */
1637 #define DATA_SECTION_ASM_OP "\t.data"
1639 /* If defined, a C expression whose value is a string containing the
1640 assembler operation to identify the following data as
1641 uninitialized global data. If not defined, and neither
1642 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
1643 uninitialized global data will be output in the data section if
1644 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
1645 used. */
1646 #define BSS_SECTION_ASM_OP "\t.section .bss"
1649 /* The Overall Framework of an Assembler File. */
1651 /* A C string constant describing how to begin a comment in the target
1652 assembler language. The compiler assumes that the comment will end at the
1653 end of the line. */
1654 #define ASM_COMMENT_START ";"
1656 /* A C string constant for text to be output before each `asm' statement or
1657 group of consecutive ones. Normally this is `"#APP"', which is a comment
1658 that has no effect on most assemblers but tells the GNU assembler that it
1659 must check the lines that follow for all valid assembler constructs. */
1660 #define ASM_APP_ON "#APP\n"
1662 /* A C string constant for text to be output after each `asm' statement or
1663 group of consecutive ones. Normally this is `"#NO_APP"', which tells the
1664 GNU assembler to resume making the time-saving assumptions that are valid
1665 for ordinary compiler output. */
1666 #define ASM_APP_OFF "#NO_APP\n"
1669 /* Output and Generation of Labels. */
1671 /* Globalizing directive for a label. */
1672 #define GLOBAL_ASM_OP "\t.globl "
1675 /* Macros Controlling Initialization Routines. */
1677 /* If defined, `main' will call `__main' despite the presence of
1678 `INIT_SECTION_ASM_OP'. This macro should be defined for systems where the
1679 init section is not actually run automatically, but is still useful for
1680 collecting the lists of constructors and destructors. */
1681 #define INVOKE__main
1684 /* Output of Assembler Instructions. */
1686 /* A C initializer containing the assembler's names for the machine registers,
1687 each one as a C string constant. This is what translates register numbers
1688 in the compiler into assembler language. */
1689 #define REGISTER_NAMES \
1691 "r0", "r1", "r2", "r3", \
1692 "r4", "r5", "r6", "r7", \
1693 "r8", "r9", "r10", "r11", \
1694 "r12", "r13", "r14", "r15", \
1695 "r16", "r17", "r18", "r19", \
1696 "r20", "r21", "r22", "r23", \
1697 "r24", "r25", "r26", "r27", \
1698 "r28", "r29", "r30", "r31", \
1699 "r32", "r33", "r34", "r35", \
1700 "r36", "r37", "r38", "r39", \
1701 "r40", "r41", "r42", "r43", \
1702 "r44", "r45", "r46", "r47", \
1703 "r48", "r49", "r50", "r51", \
1704 "r52", "r53", "r54", "r55", \
1705 "r56", "r57", "r58", "r59", \
1706 "r60", "r61", "link", "sp", \
1707 "ap", \
1708 "f0", "f1", "f2", "f3", \
1709 "s", "v", "va", "c", \
1710 "a0", "a1", \
1711 "psw", "bpsw", "pc", "bpc", \
1712 "dpsw", "dpc", "rpt_c", "rpt_s", \
1713 "rpt_e", "mod_s", "mod_e", "iba", \
1714 "eit_vb", "int_s", "int_m", \
1717 /* If defined, a C initializer for an array of structures containing a name and
1718 a register number. This macro defines additional names for hard registers,
1719 thus allowing the `asm' option in declarations to refer to registers using
1720 alternate names. */
1721 #define ADDITIONAL_REGISTER_NAMES \
1723 {"r62", GPR_LINK}, \
1724 {"r63", GPR_SP}, \
1725 {"f4", FLAG_SAT}, \
1726 {"f5", FLAG_OVERFLOW}, \
1727 {"f6", FLAG_ACC_OVER}, \
1728 {"f7", FLAG_CARRY}, \
1729 {"carry", FLAG_CARRY}, \
1730 {"borrow", FLAG_BORROW}, \
1731 {"b", FLAG_BORROW}, \
1732 {"cr0", CR_PSW}, \
1733 {"cr1", CR_BPSW}, \
1734 {"cr2", CR_PC}, \
1735 {"cr3", CR_BPC}, \
1736 {"cr4", CR_DPSW}, \
1737 {"cr5", CR_DPC}, \
1738 {"cr7", CR_RPT_C}, \
1739 {"cr8", CR_RPT_S}, \
1740 {"cr9", CR_RPT_E}, \
1741 {"cr10", CR_MOD_S}, \
1742 {"cr11", CR_MOD_E}, \
1743 {"cr14", CR_IBA}, \
1744 {"cr15", CR_EIT_VB}, \
1745 {"cr16", CR_INT_S}, \
1746 {"cr17", CR_INT_M} \
1749 /* A C compound statement to output to stdio stream STREAM the assembler syntax
1750 for an instruction operand X. X is an RTL expression.
1752 CODE is a value that can be used to specify one of several ways of printing
1753 the operand. It is used when identical operands must be printed differently
1754 depending on the context. CODE comes from the `%' specification that was
1755 used to request printing of the operand. If the specification was just
1756 `%DIGIT' then CODE is 0; if the specification was `%LTR DIGIT' then CODE is
1757 the ASCII code for LTR.
1759 If X is a register, this macro should print the register's name. The names
1760 can be found in an array `reg_names' whose type is `char *[]'. `reg_names'
1761 is initialized from `REGISTER_NAMES'.
1763 When the machine description has a specification `%PUNCT' (a `%' followed by
1764 a punctuation character), this macro is called with a null pointer for X and
1765 the punctuation character for CODE.
1767 Standard operand flags that are handled elsewhere:
1768 `=' Output a number unique to each instruction in the compilation.
1769 `a' Substitute an operand as if it were a memory reference.
1770 `c' Omit the syntax that indicates an immediate operand.
1771 `l' Substitute a LABEL_REF into a jump instruction.
1772 `n' Like %cDIGIT, except negate the value before printing.
1774 The d30v specific operand flags are:
1775 `.' Print r0.
1776 `f' Print a SF constant as an int.
1777 `s' Subtract 32 and negate.
1778 `A' Print accumulator number without an `a' in front of it.
1779 `B' Print bit offset for BSET, etc. instructions.
1780 `E' Print u if this is zero extend, nothing if this is sign extend.
1781 `F' Emit /{f,t,x}{f,t,x} for executing a false condition.
1782 `L' Print the lower half of a 64 bit item.
1783 `M' Print a memory reference for ld/st instructions.
1784 `R' Return appropriate cmp instruction for relational test.
1785 `S' Subtract 32.
1786 `T' Emit /{f,t,x}{f,t,x} for executing a true condition.
1787 `U' Print the upper half of a 64 bit item. */
1789 #define PRINT_OPERAND(STREAM, X, CODE) d30v_print_operand (STREAM, X, CODE)
1791 /* A C expression which evaluates to true if CODE is a valid punctuation
1792 character for use in the `PRINT_OPERAND' macro. If
1793 `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no punctuation
1794 characters (except for the standard one, `%') are used in this way. */
1796 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '.' || (CODE) == ':')
1798 /* A C compound statement to output to stdio stream STREAM the assembler syntax
1799 for an instruction operand that is a memory reference whose address is X. X
1800 is an RTL expression. */
1802 #define PRINT_OPERAND_ADDRESS(STREAM, X) d30v_print_operand_address (STREAM, X)
1804 /* If defined, C string expressions to be used for the `%R', `%L', `%U', and
1805 `%I' options of `asm_fprintf' (see `final.c'). These are useful when a
1806 single `md' file must support multiple assembler formats. In that case, the
1807 various `tm.h' files can define these macros differently.
1809 USER_LABEL_PREFIX is defined in svr4.h. */
1811 #define REGISTER_PREFIX "%"
1812 #define LOCAL_LABEL_PREFIX "."
1813 #define USER_LABEL_PREFIX ""
1814 #define IMMEDIATE_PREFIX ""
1817 /* Output of dispatch tables. */
1819 /* This macro should be provided on machines where the addresses in a dispatch
1820 table are relative to the table's own address.
1822 The definition should be a C statement to output to the stdio stream STREAM
1823 an assembler pseudo-instruction to generate a difference between two labels.
1824 VALUE and REL are the numbers of two internal labels. The definitions of
1825 these labels are output using `(*targetm.asm_out.internal_label)', and they must be
1826 printed in the same way here. For example,
1828 fprintf (STREAM, "\t.word L%d-L%d\n", VALUE, REL) */
1830 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
1831 fprintf (STREAM, "\t.word .L%d-.L%d\n", VALUE, REL)
1833 /* This macro should be provided on machines where the addresses in a dispatch
1834 table are absolute.
1836 The definition should be a C statement to output to the stdio stream STREAM
1837 an assembler pseudo-instruction to generate a reference to a label. VALUE
1838 is the number of an internal label whose definition is output using
1839 `(*targetm.asm_out.internal_label)'. For example,
1841 fprintf (STREAM, "\t.word L%d\n", VALUE) */
1843 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
1844 fprintf (STREAM, "\t.word .L%d\n", VALUE)
1847 /* Assembler Commands for Alignment. */
1849 /* A C statement to output to the stdio stream STREAM an assembler command to
1850 advance the location counter to a multiple of 2 to the POWER bytes. POWER
1851 will be a C expression of type `int'. */
1852 #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
1853 fprintf ((STREAM), "\t.p2align %d\n", (POWER))
1856 /* Macros Affecting all Debug Formats. */
1858 /* A C expression that returns the DBX register number for the compiler
1859 register number REGNO. In simple cases, the value of this expression may be
1860 REGNO itself. But sometimes there are some registers that the compiler
1861 knows about and DBX does not, or vice versa. In such cases, some register
1862 may need to have one number in the compiler and another for DBX.
1864 If two registers have consecutive numbers inside GCC, and they can be
1865 used as a pair to hold a multiword value, then they *must* have consecutive
1866 numbers after renumbering with `DBX_REGISTER_NUMBER'. Otherwise, debuggers
1867 will be unable to access such a pair, because they expect register pairs to
1868 be consecutive in their own numbering scheme.
1870 If you find yourself defining `DBX_REGISTER_NUMBER' in way that does not
1871 preserve register pairs, then what you must do instead is redefine the
1872 actual register numbering scheme. */
1873 #define DBX_REGISTER_NUMBER(REGNO) \
1874 (GPR_P (REGNO) ? ((REGNO) - GPR_FIRST) \
1875 : ACCUM_P (REGNO) ? ((REGNO) - ACCUM_FIRST + 84) \
1876 : FLAG_P (REGNO) ? 66 /* return psw for all flags */ \
1877 : (REGNO) == ARG_POINTER_REGNUM ? (GPR_SP - GPR_FIRST) \
1878 : (REGNO) == CR_PSW ? (66 + 0) \
1879 : (REGNO) == CR_BPSW ? (66 + 1) \
1880 : (REGNO) == CR_PC ? (66 + 2) \
1881 : (REGNO) == CR_BPC ? (66 + 3) \
1882 : (REGNO) == CR_DPSW ? (66 + 4) \
1883 : (REGNO) == CR_DPC ? (66 + 5) \
1884 : (REGNO) == CR_RPT_C ? (66 + 7) \
1885 : (REGNO) == CR_RPT_S ? (66 + 8) \
1886 : (REGNO) == CR_RPT_E ? (66 + 9) \
1887 : (REGNO) == CR_MOD_S ? (66 + 10) \
1888 : (REGNO) == CR_MOD_E ? (66 + 11) \
1889 : (REGNO) == CR_IBA ? (66 + 14) \
1890 : (REGNO) == CR_EIT_VB ? (66 + 15) \
1891 : (REGNO) == CR_INT_S ? (66 + 16) \
1892 : (REGNO) == CR_INT_M ? (66 + 17) \
1893 : -1)
1895 /* A C expression that returns the type of debugging output GCC produces
1896 when the user specifies `-g' or `-ggdb'. Define this if you have arranged
1897 for GCC to support more than one format of debugging output. Currently,
1898 the allowable values are `DBX_DEBUG', `SDB_DEBUG', `DWARF_DEBUG',
1899 `DWARF2_DEBUG', and `XCOFF_DEBUG'.
1901 The value of this macro only affects the default debugging output; the user
1902 can always get a specific type of output by using `-gstabs', `-gcoff',
1903 `-gdwarf-1', `-gdwarf-2', or `-gxcoff'.
1905 Defined in svr4.h. */
1907 #undef PREFERRED_DEBUGGING_TYPE
1908 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
1911 /* Miscellaneous Parameters. */
1913 /* Define this if you have defined special-purpose predicates in the file
1914 `MACHINE.c'. This macro is called within an initializer of an array of
1915 structures. The first field in the structure is the name of a predicate and
1916 the second field is an array of rtl codes. For each predicate, list all rtl
1917 codes that can be in expressions matched by the predicate. The list should
1918 have a trailing comma. Here is an example of two entries in the list for a
1919 typical RISC machine:
1921 #define PREDICATE_CODES \
1922 {"gen_reg_rtx_operand", {SUBREG, REG}}, \
1923 {"reg_or_short_cint_operand", {SUBREG, REG, CONST_INT}},
1925 Defining this macro does not affect the generated code (however, incorrect
1926 definitions that omit an rtl code that may be matched by the predicate can
1927 cause the compiler to malfunction). Instead, it allows the table built by
1928 `genrecog' to be more compact and efficient, thus speeding up the compiler.
1929 The most important predicates to include in the list specified by this macro
1930 are thoses used in the most insn patterns. */
1932 #define PREDICATE_CODES \
1933 { "short_memory_operand", { MEM }}, \
1934 { "long_memory_operand", { MEM }}, \
1935 { "d30v_memory_operand", { MEM }}, \
1936 { "single_reg_memory_operand", { MEM }}, \
1937 { "const_addr_memory_operand", { MEM }}, \
1938 { "call_operand", { MEM }}, \
1939 { "gpr_operand", { REG, SUBREG }}, \
1940 { "accum_operand", { REG, SUBREG }}, \
1941 { "gpr_or_accum_operand", { REG, SUBREG }}, \
1942 { "cr_operand", { REG, SUBREG }}, \
1943 { "repeat_operand", { REG, SUBREG }}, \
1944 { "flag_operand", { REG, SUBREG }}, \
1945 { "br_flag_operand", { REG, SUBREG }}, \
1946 { "br_flag_or_constant_operand", { REG, SUBREG, CONST_INT }}, \
1947 { "gpr_or_br_flag_operand", { REG, SUBREG }}, \
1948 { "f0_operand", { REG, SUBREG }}, \
1949 { "f1_operand", { REG, SUBREG }}, \
1950 { "carry_operand", { REG, SUBREG }}, \
1951 { "reg_or_0_operand", { REG, SUBREG, CONST_INT, \
1952 CONST_DOUBLE }}, \
1953 { "gpr_or_signed6_operand", { REG, SUBREG, CONST_INT }}, \
1954 { "gpr_or_unsigned5_operand", { REG, SUBREG, CONST_INT }}, \
1955 { "gpr_or_unsigned6_operand", { REG, SUBREG, CONST_INT }}, \
1956 { "gpr_or_constant_operand", { REG, SUBREG, CONST_INT, \
1957 CONST, SYMBOL_REF, \
1958 LABEL_REF }}, \
1959 { "gpr_or_dbl_const_operand", { REG, SUBREG, CONST_INT, \
1960 CONST, SYMBOL_REF, \
1961 LABEL_REF, CONST_DOUBLE }}, \
1962 { "gpr_or_memory_operand", { REG, SUBREG, MEM }}, \
1963 { "move_input_operand", { REG, SUBREG, MEM, CONST_INT, \
1964 CONST, SYMBOL_REF, \
1965 LABEL_REF, CONST_DOUBLE }}, \
1966 { "move_output_operand", { REG, SUBREG, MEM }}, \
1967 { "signed6_operand", { CONST_INT }}, \
1968 { "unsigned5_operand", { CONST_INT }}, \
1969 { "unsigned6_operand", { CONST_INT }}, \
1970 { "bitset_operand", { CONST_INT }}, \
1971 { "condexec_test_operator", { EQ, NE }}, \
1972 { "condexec_branch_operator", { EQ, NE }}, \
1973 { "condexec_unary_operator", { ABS, NEG, NOT, ZERO_EXTEND }}, \
1974 { "condexec_addsub_operator", { PLUS, MINUS }}, \
1975 { "condexec_binary_operator", { MULT, AND, IOR, XOR, \
1976 ASHIFT, ASHIFTRT, LSHIFTRT, \
1977 ROTATE, ROTATERT }}, \
1978 { "condexec_shiftl_operator", { ASHIFT, ROTATE }}, \
1979 { "condexec_extend_operator", { SIGN_EXTEND, ZERO_EXTEND }}, \
1980 { "branch_zero_operator", { EQ, NE }}, \
1981 { "cond_move_dest_operand", { REG, SUBREG, MEM }}, \
1982 { "cond_move_operand", { REG, SUBREG, CONST_INT, \
1983 CONST, SYMBOL_REF, \
1984 LABEL_REF, MEM }}, \
1985 { "cond_exec_operand", { REG, SUBREG, CONST_INT, \
1986 CONST, SYMBOL_REF, \
1987 LABEL_REF, MEM }}, \
1988 { "srelational_si_operator", { EQ, NE, LT, LE, GT, GE }}, \
1989 { "urelational_si_operator", { LTU, LEU, GTU, GEU }}, \
1990 { "relational_di_operator", { EQ, NE, LT, LE, GT, GE, \
1991 LTU, LEU, GTU, GEU }},
1993 /* An alias for a machine mode name. This is the machine mode that elements of
1994 a jump-table should have. */
1995 #define CASE_VECTOR_MODE SImode
1997 /* Define this macro if operations between registers with integral mode smaller
1998 than a word are always performed on the entire register. Most RISC machines
1999 have this property and most CISC machines do not. */
2000 #define WORD_REGISTER_OPERATIONS 1
2002 /* Define this macro to be a C expression indicating when insns that read
2003 memory in MODE, an integral mode narrower than a word, set the bits outside
2004 of MODE to be either the sign-extension or the zero-extension of the data
2005 read. Return `SIGN_EXTEND' for values of MODE for which the insn
2006 sign-extends, `ZERO_EXTEND' for which it zero-extends, and `NIL' for other
2007 modes.
2009 This macro is not called with MODE non-integral or with a width greater than
2010 or equal to `BITS_PER_WORD', so you may return any value in this case. Do
2011 not define this macro if it would always return `NIL'. On machines where
2012 this macro is defined, you will normally define it as the constant
2013 `SIGN_EXTEND' or `ZERO_EXTEND'. */
2015 #define LOAD_EXTEND_OP(MODE) SIGN_EXTEND
2017 /* Define if loading short immediate values into registers sign extends. */
2018 #define SHORT_IMMEDIATES_SIGN_EXTEND
2020 /* The maximum number of bytes that a single instruction can move quickly from
2021 memory to memory. */
2022 #define MOVE_MAX 8
2024 /* A C expression which is nonzero if on this machine it is safe to "convert"
2025 an integer of INPREC bits to one of OUTPREC bits (where OUTPREC is smaller
2026 than INPREC) by merely operating on it as if it had only OUTPREC bits.
2028 On many machines, this expression can be 1.
2030 When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for modes for
2031 which `MODES_TIEABLE_P' is 0, suboptimal code can result. If this is the
2032 case, making `TRULY_NOOP_TRUNCATION' return 0 in such cases may improve
2033 things. */
2034 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
2036 /* An alias for the machine mode for pointers. On most machines, define this
2037 to be the integer mode corresponding to the width of a hardware pointer;
2038 `SImode' on 32-bit machine or `DImode' on 64-bit machines. On some machines
2039 you must define this to be one of the partial integer modes, such as
2040 `PSImode'.
2042 The width of `Pmode' must be at least as large as the value of
2043 `POINTER_SIZE'. If it is not equal, you must define the macro
2044 `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to `Pmode'. */
2045 #define Pmode SImode
2047 /* An alias for the machine mode used for memory references to functions being
2048 called, in `call' RTL expressions. On most machines this should be
2049 `QImode'. */
2050 #define FUNCTION_MODE QImode
2052 /* Define this macro to handle System V style pragmas (particularly #pack).
2054 Defined in svr4.h. */
2055 #define HANDLE_SYSV_PRAGMA 1
2057 /* A C expression for the maximum number of instructions to execute via
2058 conditional execution instructions instead of a branch. A value of
2059 BRANCH_COST+1 is the default if the machine does not use cc0, and 1 if it
2060 does use cc0. */
2061 #define MAX_CONDITIONAL_EXECUTE d30v_cond_exec
2063 #define D30V_DEFAULT_MAX_CONDITIONAL_EXECUTE 4
2065 /* Values of the -mcond-exec=n string. */
2066 extern int d30v_cond_exec;
2067 extern const char *d30v_cond_exec_string;
2069 #endif /* GCC_D30V_H */