1 /* Definitions of target machine for GNU compiler,
2 For Ubicom IP2022 Communications Controller
4 Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5 Contributed by Red Hat, Inc and Ubicom, Inc.
7 This file is part of GNU CC.
9 GNU CC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 GNU CC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GNU CC; see the file COPYING. If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
25 #undef ASM_SPEC /* We have a GAS assembler. */
27 #define TARGET_CPU_CPP_BUILTINS() \
30 builtin_define_std ("IP2K"); \
31 builtin_define ("_DOUBLE_IS_32BITS"); \
32 builtin_define ("_BUFSIZ=512"); \
33 builtin_define ("__FILENAME_MAX__=128"); \
37 /* This declaration should be present. */
38 extern int target_flags;
41 This series of macros is to allow compiler command arguments to
42 enable or disable the use of optional features of the target
43 machine. For example, one machine description serves both the
44 68000 and the 68020; a command argument tells the compiler whether
45 it should use 68020-only instructions or not. This command
46 argument works by means of a macro `TARGET_68020' that tests a bit
49 Define a macro `TARGET_FEATURENAME' for each such option. Its
50 definition should test a bit in `target_flags'; for example:
52 #define TARGET_68020 (target_flags & 1)
54 One place where these macros are used is in the
55 condition-expressions of instruction patterns. Note how
56 `TARGET_68020' appears frequently in the 68000 machine description
57 file, `m68k.md'. Another place they are used is in the
58 definitions of the other macros in the `MACHINE.h' file. */
62 #define TARGET_SWITCHES {{"",0, NULL}}
63 /* This macro defines names of command options to set and clear bits
64 in `target_flags'. Its definition is an initializer with a
65 subgrouping for each command option.
67 Each subgrouping contains a string constant, that defines the
68 option name, and a number, which contains the bits to set in
69 `target_flags'. A negative number says to clear bits instead; the
70 negative of the number is which bits to clear. The actual option
71 name is made by appending `-m' to the specified name.
73 One of the subgroupings should have a null string. The number in
74 this grouping is the default value for `target_flags'. Any target
75 options act starting with that value.
77 Here is an example which defines `-m68000' and `-m68020' with
78 opposite meanings, and picks the latter as the default:
80 #define TARGET_SWITCHES \
86 /* This macro is similar to `TARGET_SWITCHES' but defines names of
87 command options that have values. Its definition is an
88 initializer with a subgrouping for each command option.
90 Each subgrouping contains a string constant, that defines the
91 fixed part of the option name, and the address of a variable. The
92 variable, type `char *', is set to the variable part of the given
93 option if the fixed part matches. The actual option name is made
94 by appending `-m' to the specified name.
96 Here is an example which defines `-mshort-data-NUMBER'. If the
97 given option is `-mshort-data-512', the variable `m88k_short_data'
98 will be set to the string `"512"'.
100 extern char *m88k_short_data;
101 #define TARGET_OPTIONS \
102 { { "short-data-", &m88k_short_data } } */
104 #define TARGET_VERSION fprintf (stderr, " (ip2k, GNU assembler syntax)")
105 /* This macro is a C statement to print on `stderr' a string
106 describing the particular machine description choice. Every
107 machine description should define `TARGET_VERSION'. For example:
110 #define TARGET_VERSION \
111 fprintf (stderr, " (68k, Motorola syntax)")
113 #define TARGET_VERSION \
114 fprintf (stderr, " (68k, MIT syntax)")
117 /* Caller-saves is not a win for the IP2K. Pretty much anywhere that
118 a register is permitted allows SP-relative addresses too.
120 This machine doesn't have PIC addressing modes, so disable that also. */
122 #define OVERRIDE_OPTIONS \
124 flag_caller_saves = 0; \
128 /* `OVERRIDE_OPTIONS'
129 Sometimes certain combinations of command options do not make
130 sense on a particular target machine. You can define a macro
131 `OVERRIDE_OPTIONS' to take account of this. This macro, if
132 defined, is executed once just after all the command options have
135 Don't use this macro to turn on various extra optimizations for
136 `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
138 /* Put each function in its own section so that PAGE-instruction
139 relaxation can do its best. */
140 #define OPTIMIZATION_OPTIONS(LEVEL, SIZEFLAG) \
142 if ((LEVEL) || (SIZEFLAG)) \
143 flag_function_sections = 1; \
146 /* Define this if most significant byte of a word is the lowest numbered. */
147 #define BITS_BIG_ENDIAN 0
149 /* Define this if most significant byte of a word is the lowest numbered. */
150 #define BYTES_BIG_ENDIAN 1
152 /* Define this if most significant word of a multiword number is the lowest
154 #define WORDS_BIG_ENDIAN 1
156 /* Number of bits in an addressable storage unit. */
157 #define BITS_PER_UNIT 8
159 /* Width in bits of a "word", which is the contents of a machine register.
160 Note that this is not necessarily the width of data type `int'; */
161 #define BITS_PER_WORD 8
163 /* Width of a word, in units (bytes). */
164 #define UNITS_PER_WORD (BITS_PER_WORD / BITS_PER_UNIT)
166 /* Width in bits of a pointer.
167 See also the macro `Pmode' defined below. */
168 #define POINTER_SIZE 16
170 /* Maximum sized of reasonable data type DImode or Dfmode ... */
171 #define MAX_FIXED_MODE_SIZE 64
173 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
174 #define PARM_BOUNDARY 8
176 /* Allocation boundary (in *bits*) for the code of a function. */
177 #define FUNCTION_BOUNDARY 16
179 /* Alignment of field after `int : 0' in a structure. */
180 #define EMPTY_FIELD_BOUNDARY 8
182 /* No data type wants to be aligned rounder than this. */
184 #define BIGGEST_ALIGNMENT 8
186 #define STRICT_ALIGNMENT 0
188 #define PCC_BITFIELD_TYPE_MATTERS 1
190 /* A C expression for the size in bits of the type `int' on the
191 target machine. If you don't define this, the default is one word. */
193 #define INT_TYPE_SIZE 16
196 /* A C expression for the size in bits of the type `short' on the
197 target machine. If you don't define this, the default is half a
198 word. (If this would be less than one storage unit, it is rounded
200 #undef SHORT_TYPE_SIZE
201 #define SHORT_TYPE_SIZE 16
203 /* A C expression for the size in bits of the type `long' on the
204 target machine. If you don't define this, the default is one word. */
205 #undef LONG_TYPE_SIZE
206 #define LONG_TYPE_SIZE 32
209 /* Maximum number for the size in bits of the type `long' on the
210 target machine. If this is undefined, the default is
211 `LONG_TYPE_SIZE'. Otherwise, it is the constant value that is the
212 largest value that `LONG_TYPE_SIZE' can have at run-time. This is
214 #define MAX_LONG_TYPE_SIZE 32
216 /* A C expression for the size in bits of the type `long long' on the
217 target machine. If you don't define this, the default is two
218 words. If you want to support GNU Ada on your machine, the value
219 of macro must be at least 64. */
220 #undef LONG_LONG_TYPE_SIZE
221 #define LONG_LONG_TYPE_SIZE 64
223 #undef CHAR_TYPE_SIZE
224 #define CHAR_TYPE_SIZE 8
225 /* A C expression for the size in bits of the type `char' on the
226 target machine. If you don't define this, the default is one
227 quarter of a word. (If this would be less than one storage unit,
228 it is rounded up to one unit.) */
230 #undef FLOAT_TYPE_SIZE
231 #define FLOAT_TYPE_SIZE 32
232 /* A C expression for the size in bits of the type `float' on the
233 target machine. If you don't define this, the default is one word. */
235 #undef DOUBLE_TYPE_SIZE
236 #define DOUBLE_TYPE_SIZE 32
237 /* A C expression for the size in bits of the type `double' on the
238 target machine. If you don't define this, the default is two
242 /* A C expression for the size in bits of the type `long double' on
243 the target machine. If you don't define this, the default is two
245 #undef LONG_DOUBLE_TYPE_SIZE
246 #define LONG_DOUBLE_TYPE_SIZE 32
248 #define DEFAULT_SIGNED_CHAR 1
249 /* An expression whose value is 1 or 0, according to whether the type
250 `char' should be signed or unsigned by default. The user can
251 always override this default with the options `-fsigned-char' and
252 `-funsigned-char'. */
254 /* #define DEFAULT_SHORT_ENUMS 1
255 This was the default for the IP2k but gcc has a bug (as of 17th May
256 2001) in the way that library calls to the memory checker functions
257 are issues that screws things up if an enum is not equivalent to
259 /* `DEFAULT_SHORT_ENUMS'
260 A C expression to determine whether to give an `enum' type only as
261 many bytes as it takes to represent the range of possible values
262 of that type. A nonzero value means to do that; a zero value
263 means all `enum' types should be allocated like `int'.
265 If you don't define the macro, the default is 0. */
267 #define SIZE_TYPE "unsigned int"
268 /* A C expression for a string describing the name of the data type
269 to use for size values. The typedef name `size_t' is defined
270 using the contents of the string.
272 The string can contain more than one keyword. If so, separate
273 them with spaces, and write first any length keyword, then
274 `unsigned' if appropriate, and finally `int'. The string must
275 exactly match one of the data type names defined in the function
276 `init_decl_processing' in the file `c-decl.c'. You may not omit
277 `int' or change the order--that would cause the compiler to crash
280 If you don't define this macro, the default is `"long unsigned
283 #define PTRDIFF_TYPE "int"
284 /* A C expression for a string describing the name of the data type
285 to use for the result of subtracting two pointers. The typedef
286 name `ptrdiff_t' is defined using the contents of the string. See
287 `SIZE_TYPE' above for more information.
289 If you don't define this macro, the default is `"long int"'. */
292 #define WCHAR_TYPE "int"
293 #undef WCHAR_TYPE_SIZE
294 #define WCHAR_TYPE_SIZE 16
295 /* A C expression for the size in bits of the data type for wide
296 characters. This is used in `cpp', which cannot make use of
299 #define HARD_REG_SIZE (UNITS_PER_WORD)
300 /* Standard register usage.
302 for the IP2K, we are going to have a LOT of registers, but only some of them
305 #define FIRST_PSEUDO_REGISTER (0x104) /* Skip over physical regs, VFP, AP. */
307 /* Number of hardware registers known to the compiler. They receive
308 numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first
309 pseudo register's number really is assigned the number
310 `FIRST_PSEUDO_REGISTER'. */
313 #define REG_IPH REG_IP
317 #define REG_SPH REG_SP
324 #define REG_STATUS 0xb
327 #define REG_DPH REG_DP
332 #define REG_CALLH 0x7e /* Call-stack readout. */
333 #define REG_CALLL 0x7f
336 #define REG_RESULT 0x80 /* Result register (upto 8 bytes). */
337 #define REG_FP 0xfd /* 2 bytes for FRAME chain */
339 #define REG_ZERO 0xff /* Initialized to zero by runtime. */
341 #define REG_VFP 0x100 /* Virtual frame pointer. */
342 #define REG_AP 0x102 /* Virtual arg pointer. */
344 /* Status register bits. */
349 #define FIXED_REGISTERS {\
350 1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/* r0.. r31*/\
351 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/* r32.. r63*/\
352 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/* r64.. r95*/\
353 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/* r96..r127*/\
354 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,/*r128..r159*/\
355 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/*r160..r191*/\
356 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/*r192..r223*/\
357 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/*r224..r255*/\
360 /* An initializer that says which registers are used for fixed
361 purposes all throughout the compiled code and are therefore not
362 available for general allocation. These would include the stack
363 pointer, the frame pointer (except on machines where that can be
364 used as a general register when no frame pointer is needed), the
365 program counter on machines where that is considered one of the
366 addressable registers, and any other numbered register with a
369 This information is expressed as a sequence of numbers, separated
370 by commas and surrounded by braces. The Nth number is 1 if
371 register N is fixed, 0 otherwise.
373 The table initialized from this macro, and the table initialized by
374 the following one, may be overridden at run time either
375 automatically, by the actions of the macro
376 `CONDITIONAL_REGISTER_USAGE', or by the user with the command
377 options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. */
379 #define CALL_USED_REGISTERS { \
380 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/* r0.. r31*/\
381 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/* r32.. r63*/\
382 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/* r64.. r95*/\
383 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/* r96..r127*/\
384 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/*r128..r159*/\
385 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/*r160..r191*/\
386 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/*r192..r223*/\
387 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/*r224..r255*/\
390 /* Like `FIXED_REGISTERS' but has 1 for each register that is
391 clobbered (in general) by function calls as well as for fixed
392 registers. This macro therefore identifies the registers that are
393 not available for general allocation of values that must live
394 across function calls.
396 If a register has 0 in `CALL_USED_REGISTERS', the compiler
397 automatically saves it on function entry and restores it on
398 function exit, if the register is used within the function. */
400 #define NON_SAVING_SETJMP 0
401 /* If this macro is defined and has a nonzero value, it means that
402 `setjmp' and related functions fail to save the registers, or that
403 `longjmp' fails to restore them. To compensate, the compiler
404 avoids putting variables in registers in functions that use
407 #define REG_ALLOC_ORDER { \
408 0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, \
409 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97, \
410 0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f, \
411 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, \
412 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7, \
413 0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf, \
414 0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7, \
415 0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf, \
416 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7, \
417 0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf, \
418 0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7, \
419 0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf, \
420 0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7, \
421 0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef, \
422 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7, \
423 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff, \
424 0x00,0x01,0x02,0x03,0x0c,0x0d,0x06,0x07, \
425 0x08,0x09,0x0a,0x0b,0x04,0x05,0x0e,0x0f, \
426 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, \
427 0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f, \
428 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27, \
429 0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f, \
430 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37, \
431 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, \
432 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47, \
433 0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f, \
434 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57, \
435 0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f, \
436 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67, \
437 0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, \
438 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77, \
439 0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f, \
440 0x100,0x101,0x102,0x103}
442 /* If defined, an initializer for a vector of integers, containing the
443 numbers of hard registers in the order in which GNU CC should
444 prefer to use them (from most preferred to least).
446 If this macro is not defined, registers are used lowest numbered
447 first (all else being equal).
449 One use of this macro is on machines where the highest numbered
450 registers must always be saved and the save-multiple-registers
451 instruction supports only sequences of consecutive registers. On
452 such machines, define `REG_ALLOC_ORDER' to be an initializer that
453 lists the highest numbered allocatable register first. */
455 #define ORDER_REGS_FOR_LOCAL_ALLOC ip2k_init_local_alloc (reg_alloc_order)
456 /* A C statement (sans semicolon) to choose the order in which to
457 allocate hard registers for pseudo-registers local to a basic
460 Store the desired register order in the array `reg_alloc_order'.
461 Element 0 should be the register to allocate first; element 1, the
462 next register; and so on.
464 The macro body should not assume anything about the contents of
465 `reg_alloc_order' before execution of the macro.
467 On most machines, it is not necessary to define this macro. */
469 /* Are we allowed to rename registers? For some reason, regrename was
470 changing DP to IP (when it appeared in addresses like (plus:HI
471 (reg: DP) (const_int 37)) - and that's bad because IP doesn't
474 #define HARD_REGNO_RENAME_OK(REG, NREG) \
475 (((REG) == REG_DPH) ? 0 \
476 : ((REG) == REG_IPH) ? ((NREG) == REG_DPH) \
477 : (((NREG) == REG_IPL) || ((NREG) == REG_DPL)) ? 0 : 1)
479 #define HARD_REGNO_NREGS(REGNO, MODE) \
480 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
482 /* A C expression for the number of consecutive hard registers,
483 starting at register number REGNO, required to hold a value of mode
486 On a machine where all registers are exactly one word, a suitable
487 definition of this macro is
489 #define HARD_REGNO_NREGS(REGNO, MODE) \
490 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
491 / UNITS_PER_WORD)) */
493 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
494 /* A C expression that is nonzero if it is permissible to store a
495 value of mode MODE in hard register number REGNO (or in several
496 registers starting with that one). For a machine where all
497 registers are equivalent, a suitable definition is
499 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
501 It is not necessary for this macro to check for the numbers of
502 fixed registers, because the allocation mechanism considers them
503 to be always occupied.
505 On some machines, double-precision values must be kept in even/odd
506 register pairs. The way to implement that is to define this macro
507 to reject odd register numbers for such modes.
509 The minimum requirement for a mode to be OK in a register is that
510 the `movMODE' instruction pattern support moves between the
511 register and any other hard register for which the mode is OK; and
512 that moving a value into the register and back out not alter it.
514 Since the same instruction used to move `SImode' will work for all
515 narrower integer modes, it is not necessary on any machine for
516 `HARD_REGNO_MODE_OK' to distinguish between these modes, provided
517 you define patterns `movhi', etc., to take advantage of this. This
518 is useful because of the interaction between `HARD_REGNO_MODE_OK'
519 and `MODES_TIEABLE_P'; it is very desirable for all integer modes
522 Many machines have special registers for floating point arithmetic.
523 Often people assume that floating point machine modes are allowed
524 only in floating point registers. This is not true. Any
525 registers that can hold integers can safely *hold* a floating
526 point machine mode, whether or not floating arithmetic can be done
527 on it in those registers. Integer move instructions can be used
530 On some machines, though, the converse is true: fixed-point machine
531 modes may not go in floating registers. This is true if the
532 floating registers normalize any value stored in them, because
533 storing a non-floating value there would garble it. In this case,
534 `HARD_REGNO_MODE_OK' should reject fixed-point machine modes in
535 floating registers. But if the floating registers do not
536 automatically normalize, if you can store any bit pattern in one
537 and retrieve it unchanged without a trap, then any machine mode
538 may go in a floating register, so you can define this macro to say
541 The primary significance of special floating registers is rather
542 that they are the registers acceptable in floating point arithmetic
543 instructions. However, this is of no concern to
544 `HARD_REGNO_MODE_OK'. You handle it by writing the proper
545 constraints for those instructions.
547 On some machines, the floating registers are especially slow to
548 access, so that it is better to store a value in a stack frame
549 than in such a register if floating point arithmetic is not being
550 done. As long as the floating registers are not in class
551 `GENERAL_REGS', they will not be used unless some pattern's
552 constraint asks for one. */
554 #define MODES_TIEABLE_P(MODE1, MODE2) \
555 (((MODE1) == QImode && (MODE2) == HImode) \
556 || ((MODE2) == QImode && (MODE1) == HImode))
557 /* We originally had this as follows - this isn't a win on the IP2k
558 though as registers just get in our way!
560 #define MODES_TIEABLE_P(MODE1, MODE2) \
561 (((MODE1) > HImode && (MODE2) == HImode)
562 || ((MODE1) == HImode && (MODE2) > HImode)) */
564 /* A C expression that is nonzero if it is desirable to choose
565 register allocation so as to avoid move instructions between a
566 value of mode MODE1 and a value of mode MODE2.
568 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
569 MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1,
570 MODE2)' must be zero. */
586 ALL_REGS = GENERAL_REGS,
590 /* An enumeral type that must be defined with all the register class
591 names as enumeral values. `NO_REGS' must be first. `ALL_REGS'
592 must be the last register class, followed by one more enumeral
593 value, `LIM_REG_CLASSES', which is not a register class but rather
594 tells how many classes there are.
596 Each register class has a number, which is the value of casting
597 the class name to type `int'. The number serves as an index in
598 many of the tables described below. */
601 #define N_REG_CLASSES (int)LIM_REG_CLASSES
602 /* The number of distinct register classes, defined as follows:
604 #define N_REG_CLASSES (int) LIM_REG_CLASSES */
606 #define REG_CLASS_NAMES { \
621 /* An initializer containing the names of the register classes as C
622 string constants. These names are used in writing some of the
626 #define REG_CLASS_CONTENTS { \
627 {0x00000000, 0, 0, 0, 0, 0, 0, 0, 0}, /* NO_REGS */ \
628 {0x00001000, 0, 0, 0, 0, 0, 0, 0, 0}, /* DPH_REGS */ \
629 {0x00002000, 0, 0, 0, 0, 0, 0, 0, 0}, /* DPL_REGS */ \
630 {0x00003000, 0, 0, 0, 0, 0, 0, 0, 0}, /* DP_REGS */ \
631 {0x000000c0, 0, 0, 0, 0, 0, 0, 0, 0}, /* SP_REGS */ \
632 {0x00000010, 0, 0, 0, 0, 0, 0, 0, 0}, /* IPH_REGS */ \
633 {0x00000020, 0, 0, 0, 0, 0, 0, 0, 0}, /* IPL_REGS */ \
634 {0x00000030, 0, 0, 0, 0, 0, 0, 0, 0}, /* IP_REGS */ \
635 {0x000030c0, 0, 0, 0, 0, 0, 0, 0, 0}, /* DP_SP_REGS */ \
636 {0x000030f0, 0, 0, 0, 0, 0, 0, 0, 0}, /* PTR_REGS */ \
637 {0xffffcf0f,-1,-1,-1,-1,-1,-1,-1, 0}, /* NONPTR_REGS */ \
638 {0xffffff3f,-1,-1,-1,-1,-1,-1,-1, 0}, /* NONSP_REGS */ \
639 {0xffffffff,-1,-1,-1,-1,-1,-1,-1,15} /* GENERAL_REGS */ \
642 /* An initializer containing the contents of the register classes, as
643 integers which are bit masks. The Nth integer specifies the
644 contents of class N. The way the integer MASK is interpreted is
645 that register R is in the class if `MASK & (1 << R)' is 1.
647 When the machine has more than 32 registers, an integer does not
648 suffice. Then the integers are replaced by sub-initializers,
649 braced groupings containing several integers. Each
650 sub-initializer must be suitable as an initializer for the type
651 `HARD_REG_SET' which is defined in `hard-reg-set.h'. */
653 #define REGNO_REG_CLASS(R) \
654 ( (R) == REG_IPH ? IPH_REGS \
655 : (R) == REG_IPL ? IPL_REGS \
656 : (R) == REG_DPH ? DPH_REGS \
657 : (R) == REG_DPL ? DPL_REGS \
658 : (R) == REG_SPH ? SP_REGS \
659 : (R) == REG_SPL ? SP_REGS \
662 /* A C expression whose value is a register class containing hard
663 register REGNO. In general there is more than one such class;
664 choose a class which is "minimal", meaning that no smaller class
665 also contains the register. */
667 #define MODE_BASE_REG_CLASS(MODE) ((MODE) == QImode ? PTR_REGS : DP_SP_REGS)
668 /* This is a variation of the BASE_REG_CLASS macro which allows
669 the selection of a base register in a mode dependent manner.
670 If MODE is VOIDmode then it should return the same value as
673 #define BASE_REG_CLASS PTR_REGS
674 /* A macro whose definition is the name of the class to which a valid
675 base register must belong. A base register is one used in an
676 address which is the register value plus a displacement. */
678 #define INDEX_REG_CLASS NO_REGS
679 /* A macro whose definition is the name of the class to which a valid
680 index register must belong. An index register is one used in an
681 address where its value is either multiplied by a scale factor or
682 added to another register (as well as added to a displacement). */
685 #define REG_CLASS_FROM_LETTER(C) \
686 ( (C) == 'j' ? IPH_REGS \
687 : (C) == 'k' ? IPL_REGS \
688 : (C) == 'f' ? IP_REGS \
689 : (C) == 'y' ? DPH_REGS \
690 : (C) == 'z' ? DPL_REGS \
691 : (C) == 'b' ? DP_REGS \
692 : (C) == 'u' ? NONSP_REGS \
693 : (C) == 'q' ? SP_REGS \
694 : (C) == 'c' ? DP_SP_REGS \
695 : (C) == 'a' ? PTR_REGS \
696 : (C) == 'd' ? NONPTR_REGS \
699 /* A C expression which defines the machine-dependent operand
700 constraint letters for register classes. If CHAR is such a
701 letter, the value should be the register class corresponding to
702 it. Otherwise, the value should be `NO_REGS'. The register
703 letter `r', corresponding to class `GENERAL_REGS', will not be
704 passed to this macro; you do not need to handle it. */
707 #define REGNO_OK_FOR_BASE_P(R) \
708 ((R) == REG_DP || (R) == REG_IP || (R) == REG_SP)
709 /* A C expression which is nonzero if register number R is suitable
710 for use as a base register in operand addresses. It may be either
711 a suitable hard register or a pseudo register that has been
712 allocated such a hard register. */
714 #define REGNO_MODE_OK_FOR_BASE_P(R,M) \
715 ((R) == REG_DP || (R) == REG_SP \
716 || ((R) == REG_IP && GET_MODE_SIZE (M) <= 1))
717 /* A C expression that is just like `REGNO_OK_FOR_BASE_P', except that
718 that expression may examine the mode of the memory reference in
719 MODE. You should define this macro if the mode of the memory
720 reference affects whether a register may be used as a base
721 register. If you define this macro, the compiler will use it
722 instead of `REGNO_OK_FOR_BASE_P'. */
724 #define REGNO_OK_FOR_INDEX_P(NUM) 0
725 /* A C expression which is nonzero if register number NUM is suitable
726 for use as an index register in operand addresses. It may be
727 either a suitable hard register or a pseudo register that has been
728 allocated such a hard register.
730 The difference between an index register and a base register is
731 that the index register may be scaled. If an address involves the
732 sum of two registers, neither one of them scaled, then either one
733 may be labeled the "base" and the other the "index"; but whichever
734 labeling is used must fit the machine's constraints of which
735 registers may serve in each capacity. The compiler will try both
736 labelings, looking for one that is valid, and will reload one or
737 both registers only if neither labeling works. */
739 #define PREFERRED_RELOAD_CLASS(X, CLASS) (CLASS)
740 /* A C expression that places additional restrictions on the register
741 class to use when it is necessary to copy value X into a register
742 in class CLASS. The value is a register class; perhaps CLASS, or
743 perhaps another, smaller class. On many machines, the following
746 #define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
748 Sometimes returning a more restrictive class makes better code.
749 For example, on the 68000, when X is an integer constant that is
750 in range for a `moveq' instruction, the value of this macro is
751 always `DATA_REGS' as long as CLASS includes the data registers.
752 Requiring a data register guarantees that a `moveq' will be used.
754 If X is a `const_double', by returning `NO_REGS' you can force X
755 into a memory constant. This is useful on certain machines where
756 immediate floating values cannot be loaded into certain kinds of
759 /* `PREFERRED_OUTPUT_RELOAD_CLASS (X, CLASS)'
760 Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of
761 input reloads. If you don't define this macro, the default is to
762 use CLASS, unchanged. */
764 /* `LIMIT_RELOAD_CLASS (MODE, CLASS)'
765 A C expression that places additional restrictions on the register
766 class to use when it is necessary to be able to hold a value of
767 mode MODE in a reload register for which class CLASS would
770 Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when
771 there are certain modes that simply can't go in certain reload
774 The value is a register class; perhaps CLASS, or perhaps another,
777 Don't define this macro unless the target machine has limitations
778 which require the macro to do something nontrivial. */
780 /* SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X)
781 `SECONDARY_RELOAD_CLASS (CLASS, MODE, X)'
782 `SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)'
783 Many machines have some registers that cannot be copied directly
784 to or from memory or even from other types of registers. An
785 example is the `MQ' register, which on most machines, can only be
786 copied to or from general registers, but not memory. Some
787 machines allow copying all registers to and from memory, but
788 require a scratch register for stores to some memory locations
789 (e.g., those with symbolic address on the RT, and those with
790 certain symbolic address on the SPARC when compiling PIC). In
791 some cases, both an intermediate and a scratch register are
794 You should define these macros to indicate to the reload phase
795 that it may need to allocate at least one register for a reload in
796 addition to the register to contain the data. Specifically, if
797 copying X to a register CLASS in MODE requires an intermediate
798 register, you should define `SECONDARY_INPUT_RELOAD_CLASS' to
799 return the largest register class all of whose registers can be
800 used as intermediate registers or scratch registers.
802 If copying a register CLASS in MODE to X requires an intermediate
803 or scratch register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be
804 defined to return the largest register class required. If the
805 requirements for input and output reloads are the same, the macro
806 `SECONDARY_RELOAD_CLASS' should be used instead of defining both
809 The values returned by these macros are often `GENERAL_REGS'.
810 Return `NO_REGS' if no spare register is needed; i.e., if X can be
811 directly copied to or from a register of CLASS in MODE without
812 requiring a scratch register. Do not define this macro if it
813 would always return `NO_REGS'.
815 If a scratch register is required (either with or without an
816 intermediate register), you should define patterns for
817 `reload_inM' or `reload_outM', as required (*note Standard
818 Names::.. These patterns, which will normally be implemented with
819 a `define_expand', should be similar to the `movM' patterns,
820 except that operand 2 is the scratch register.
822 Define constraints for the reload register and scratch register
823 that contain a single register class. If the original reload
824 register (whose class is CLASS) can meet the constraint given in
825 the pattern, the value returned by these macros is used for the
826 class of the scratch register. Otherwise, two additional reload
827 registers are required. Their classes are obtained from the
828 constraints in the insn pattern.
830 X might be a pseudo-register or a `subreg' of a pseudo-register,
831 which could either be in a hard register or in memory. Use
832 `true_regnum' to find out; it will return -1 if the pseudo is in
833 memory and the hard register number if it is in a register.
835 These macros should not be used in the case where a particular
836 class of registers can only be copied to memory and not to another
837 class of registers. In that case, secondary reload registers are
838 not needed and would not be helpful. Instead, a stack location
839 must be used to perform the copy and the `movM' pattern should use
840 memory as an intermediate storage. This case often occurs between
841 floating-point and general registers. */
843 /* `SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)'
844 Certain machines have the property that some registers cannot be
845 copied to some other registers without using memory. Define this
846 macro on those machines to be a C expression that is nonzero if
847 objects of mode M in registers of CLASS1 can only be copied to
848 registers of class CLASS2 by storing a register of CLASS1 into
849 memory and loading that memory location into a register of CLASS2.
851 Do not define this macro if its value would always be zero.
853 `SECONDARY_MEMORY_NEEDED_RTX (MODE)'
854 Normally when `SECONDARY_MEMORY_NEEDED' is defined, the compiler
855 allocates a stack slot for a memory location needed for register
856 copies. If this macro is defined, the compiler instead uses the
857 memory location defined by this macro.
859 Do not define this macro if you do not define
860 `SECONDARY_MEMORY_NEEDED'. */
862 #define SMALL_REGISTER_CLASSES 1
863 /* Normally the compiler avoids choosing registers that have been
864 explicitly mentioned in the rtl as spill registers (these
865 registers are normally those used to pass parameters and return
866 values). However, some machines have so few registers of certain
867 classes that there would not be enough registers to use as spill
868 registers if this were done.
870 Define `SMALL_REGISTER_CLASSES' to be an expression with a nonzero
871 value on these machines. When this macro has a nonzero value, the
872 compiler allows registers explicitly used in the rtl to be used as
873 spill registers but avoids extending the lifetime of these
876 It is always safe to define this macro with a nonzero value, but
877 if you unnecessarily define it, you will reduce the amount of
878 optimizations that can be performed in some cases. If you do not
879 define this macro with a nonzero value when it is required, the
880 compiler will run out of spill registers and print a fatal error
881 message. For most machines, you should not define this macro at
884 #define CLASS_LIKELY_SPILLED_P(CLASS) class_likely_spilled_p(CLASS)
885 /* A C expression whose value is nonzero if pseudos that have been
886 assigned to registers of class CLASS would likely be spilled
887 because registers of CLASS are needed for spill registers.
889 The default value of this macro returns 1 if CLASS has exactly one
890 register and zero otherwise. On most machines, this default
891 should be used. Only define this macro to some other expression
892 if pseudo allocated by `local-alloc.c' end up in memory because
893 their hard registers were needed for spill registers. If this
894 macro returns nonzero for those classes, those pseudos will only
895 be allocated by `global.c', which knows how to reallocate the
896 pseudo to another register. If there would not be another
897 register available for reallocation, you should not change the
898 definition of this macro since the only effect of such a
899 definition would be to slow down register allocation. */
901 #define CLASS_MAX_NREGS(CLASS, MODE) GET_MODE_SIZE (MODE)
902 /* A C expression for the maximum number of consecutive registers of
903 class CLASS needed to hold a value of mode MODE.
905 This is closely related to the macro `HARD_REGNO_NREGS'. In fact,
906 the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be
907 the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all
908 REGNO values in the class CLASS.
910 This macro helps control the handling of multiple-word values in
913 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
914 ((C) == 'I' ? (VALUE) >= -255 && (VALUE) <= -1 : \
915 (C) == 'J' ? (VALUE) >= 0 && (VALUE) <= 7 : \
916 (C) == 'K' ? (VALUE) >= 0 && (VALUE) <= 127 : \
917 (C) == 'L' ? (VALUE) > 0 && (VALUE) < 128: \
918 (C) == 'M' ? (VALUE) == -1: \
919 (C) == 'N' ? (VALUE) == 1: \
920 (C) == 'O' ? (VALUE) == 0: \
921 (C) == 'P' ? (VALUE) >= 0 && (VALUE) <= 255: \
924 /* A C expression that defines the machine-dependent operand
925 constraint letters (`I', `J', `K', ... `P') that specify
926 particular ranges of integer values. If C is one of those
927 letters, the expression should check that VALUE, an integer, is in
928 the appropriate range and return 1 if so, 0 otherwise. If C is
929 not one of those letters, the value should be 0 regardless of
932 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
934 /* `CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)'
935 A C expression that defines the machine-dependent operand
936 constraint letters that specify particular ranges of
937 `const_double' values (`G' or `H').
939 If C is one of those letters, the expression should check that
940 VALUE, an RTX of code `const_double', is in the appropriate range
941 and return 1 if so, 0 otherwise. If C is not one of those
942 letters, the value should be 0 regardless of VALUE.
944 `const_double' is used for all floating-point constants and for
945 `DImode' fixed-point constants. A given letter can accept either
946 or both kinds of values. It can use `GET_MODE' to distinguish
947 between these kinds. */
949 #define EXTRA_CONSTRAINT(X, C) ip2k_extra_constraint (X, C)
951 /* A C expression that defines the optional machine-dependent
952 constraint letters (``Q', `R', `S', `T', `U') that can'
953 be used to segregate specific types of operands, usually memory
954 references, for the target machine. Normally this macro will not
955 be defined. If it is required for a particular target machine, it
956 should return 1 if VALUE corresponds to the operand type
957 represented by the constraint letter C. If C is not defined as an
958 extra constraint, the value returned should be 0 regardless of
961 For example, on the ROMP, load instructions cannot have their
962 output in r0 if the memory reference contains a symbolic address.
963 Constraint letter `Q' is defined as representing a memory address
964 that does *not* contain a symbolic address. An alternative is
965 specified with a `Q' constraint on the input and `r' on the
966 output. The next alternative specifies `m' on the input and a
967 register class that does not include r0 on the output. */
969 /* This is an undocumented variable which describes
970 how GCC will pop a data. */
971 #define STACK_POP_CODE PRE_INC
973 #define STACK_PUSH_CODE POST_DEC
974 /* This macro defines the operation used when something is pushed on
975 the stack. In RTL, a push operation will be `(set (mem
976 (STACK_PUSH_CODE (reg sp))) ...)'
978 The choices are `PRE_DEC', `POST_DEC', `PRE_INC', and `POST_INC'.
979 Which of these is correct depends on the stack direction and on
980 whether the stack pointer points to the last item on the stack or
981 whether it points to the space for the next item on the stack.
983 The default is `PRE_DEC' when `STACK_GROWS_DOWNWARD' is defined,
984 which is almost always right, and `PRE_INC' otherwise, which is
988 #define STACK_CHECK_BUILTIN 1
989 /* Prologue code will do stack checking as necessary. */
991 #define STARTING_FRAME_OFFSET (0)
992 /* Offset from the frame pointer to the first local variable slot to
995 If `FRAME_GROWS_DOWNWARD', find the next slot's offset by
996 subtracting the first slot's length from `STARTING_FRAME_OFFSET'.
997 Otherwise, it is found by adding the length of the first slot to
998 the value `STARTING_FRAME_OFFSET'. */
1000 #define FRAME_GROWS_DOWNWARD 1
1001 #define STACK_GROWS_DOWNWARD 1
1003 /* On IP2K arg pointer is virtual and resolves to either SP or FP
1004 after we've resolved what registers are saved (fp chain, return
1007 #define FIRST_PARM_OFFSET(FUNDECL) 0
1008 /* Offset from the argument pointer register to the first argument's
1009 address. On some machines it may depend on the data type of the
1012 If `ARGS_GROW_DOWNWARD', this is the offset to the location above
1013 the first argument's address. */
1015 /* `STACK_DYNAMIC_OFFSET (FUNDECL)'
1016 Offset from the stack pointer register to an item dynamically
1017 allocated on the stack, e.g., by `alloca'.
1019 The default value for this macro is `STACK_POINTER_OFFSET' plus the
1020 length of the outgoing arguments. The default is correct for most
1021 machines. See `function.c' for details. */
1023 #define STACK_POINTER_OFFSET 1
1024 /* IP2K stack is post-decremented, so 0(sp) is address of open space
1025 and 1(sp) is offset to the location avobe the forst location at which
1026 outgoing arguments are placed. */
1028 #define STACK_BOUNDARY 8
1029 /* Define this macro if there is a guaranteed alignment for the stack
1030 pointer on this machine. The definition is a C expression for the
1031 desired alignment (measured in bits). This value is used as a
1032 default if PREFERRED_STACK_BOUNDARY is not defined. */
1034 #define STACK_POINTER_REGNUM REG_SP
1035 /* The register number of the stack pointer register, which must also
1036 be a fixed register according to `FIXED_REGISTERS'. On most
1037 machines, the hardware determines which register this is. */
1039 #define FRAME_POINTER_REGNUM REG_VFP
1040 /* The register number of the frame pointer register, which is used to
1041 access automatic variables in the stack frame. On some machines,
1042 the hardware determines which register this is. On other
1043 machines, you can choose any register you wish for this purpose. */
1045 #define HARD_FRAME_POINTER_REGNUM REG_FP
1047 #define ARG_POINTER_REGNUM REG_AP
1048 /* The register number of the arg pointer register, which is used to
1049 access the function's argument list. On some machines, this is
1050 the same as the frame pointer register. On some machines, the
1051 hardware determines which register this is. On other machines,
1052 you can choose any register you wish for this purpose. If this is
1053 not the same register as the frame pointer register, then you must
1054 mark it as a fixed register according to `FIXED_REGISTERS', or
1055 arrange to be able to eliminate it (*note Elimination::.). */
1057 /* We don't really want to support nested functions. But we'll crash
1058 in various testsuite tests if we don't at least define the register
1059 to contain the static chain. The return value register is about as
1060 bad a place as any for this. */
1062 #define STATIC_CHAIN_REGNUM REG_RESULT
1063 /* Register numbers used for passing a function's static chain
1064 pointer. If register windows are used, the register number as
1065 seen by the called function is `STATIC_CHAIN_INCOMING_REGNUM',
1066 while the register number as seen by the calling function is
1067 `STATIC_CHAIN_REGNUM'. If these registers are the same,
1068 `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
1070 The static chain register need not be a fixed register.
1072 If the static chain is passed in memory, these macros should not be
1073 defined; instead, the next two macros should be defined. */
1075 #define FRAME_POINTER_REQUIRED (!flag_omit_frame_pointer)
1076 /* A C expression which is nonzero if a function must have and use a
1077 frame pointer. This expression is evaluated in the reload pass.
1078 If its value is nonzero the function will have a frame pointer.
1080 The expression can in principle examine the current function and
1081 decide according to the facts, but on most machines the constant 0
1082 or the constant 1 suffices. Use 0 when the machine allows code to
1083 be generated with no frame pointer, and doing so saves some time
1084 or space. Use 1 when there is no possible advantage to avoiding a
1087 In certain cases, the compiler does not know how to produce valid
1088 code without a frame pointer. The compiler recognizes those cases
1089 and automatically gives the function a frame pointer regardless of
1090 what `FRAME_POINTER_REQUIRED' says. You don't need to worry about
1093 In a function that does not require a frame pointer, the frame
1094 pointer register can be allocated for ordinary usage, unless you
1095 mark it as a fixed register. See `FIXED_REGISTERS' for more
1098 #define ELIMINABLE_REGS { \
1099 {ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1100 {ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
1101 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1102 {FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
1103 {HARD_FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1105 /* If defined, this macro specifies a table of register pairs used to
1106 eliminate unneeded registers that point into the stack frame. If
1107 it is not defined, the only elimination attempted by the compiler
1108 is to replace references to the frame pointer with references to
1111 The definition of this macro is a list of structure
1112 initializations, each of which specifies an original and
1113 replacement register.
1115 On some machines, the position of the argument pointer is not
1116 known until the compilation is completed. In such a case, a
1117 separate hard register must be used for the argument pointer.
1118 This register can be eliminated by replacing it with either the
1119 frame pointer or the argument pointer, depending on whether or not
1120 the frame pointer has been eliminated.
1122 In this case, you might specify:
1123 #define ELIMINABLE_REGS \
1124 {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1125 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
1126 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
1128 Note that the elimination of the argument pointer with the stack
1129 pointer is specified first since that is the preferred elimination. */
1132 #define CAN_ELIMINATE(FROM, TO) \
1133 ((FROM) == HARD_FRAME_POINTER_REGNUM \
1134 ? (flag_omit_frame_pointer && !frame_pointer_needed) : 1)
1135 /* Don't eliminate FP unless we EXPLICITLY_ASKED */
1137 /* A C expression that returns nonzero if the compiler is allowed to
1138 try to replace register number FROM-REG with register number
1139 TO-REG. This macro need only be defined if `ELIMINABLE_REGS' is
1140 defined, and will usually be the constant 1, since most of the
1141 cases preventing register elimination are things that the compiler
1142 already knows about. */
1144 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1145 ((OFFSET) = ip2k_init_elim_offset ((FROM), (TO)))
1147 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
1148 specifies the initial difference between the specified pair of
1149 registers. This macro must be defined if `ELIMINABLE_REGS' is
1152 #define RETURN_ADDR_RTX(COUNT, X) \
1153 (((COUNT) == 0) ? gen_rtx_REG (HImode, REG_CALLH) : NULL_RTX)
1154 /* A C expression whose value is RTL representing the value of the
1155 return address for the frame COUNT steps up from the current
1156 frame, after the prologue. FRAMEADDR is the frame pointer of the
1157 COUNT frame, or the frame pointer of the COUNT - 1 frame if
1158 `RETURN_ADDR_IN_PREVIOUS_FRAME' is defined.
1160 The value of the expression must always be the correct address when
1161 COUNT is zero, but may be `NULL_RTX' if there is not way to
1162 determine the return address of other frames. */
1164 #define PUSH_ROUNDING(NPUSHED) (NPUSHED)
1165 /* A C expression that is the number of bytes actually pushed onto the
1166 stack when an instruction attempts to push NPUSHED bytes.
1168 If the target machine does not have a push instruction, do not
1169 define this macro. That directs GNU CC to use an alternate
1170 strategy: to allocate the entire argument block and then store the
1173 On some machines, the definition
1175 #define PUSH_ROUNDING(BYTES) (BYTES)
1177 will suffice. But on other machines, instructions that appear to
1178 push one byte actually push two bytes in an attempt to maintain
1179 alignment. Then the definition should be
1181 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1) */
1183 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
1184 ip2k_return_pops_args ((FUNDECL), (FUNTYPE), (SIZE))
1185 /* A C expression that should indicate the number of bytes of its own
1186 arguments that a function pops on returning, or 0 if the function
1187 pops no arguments and the caller must therefore pop them all after
1188 the function returns.
1190 FUNDECL is a C variable whose value is a tree node that describes
1191 the function in question. Normally it is a node of type
1192 `FUNCTION_DECL' that describes the declaration of the function.
1193 From this you can obtain the DECL_MACHINE_ATTRIBUTES of the
1196 FUNTYPE is a C variable whose value is a tree node that describes
1197 the function in question. Normally it is a node of type
1198 `FUNCTION_TYPE' that describes the data type of the function.
1199 From this it is possible to obtain the data types of the value and
1200 arguments (if known).
1202 When a call to a library function is being considered, FUNDECL
1203 will contain an identifier node for the library function. Thus, if
1204 you need to distinguish among various library functions, you can
1205 do so by their names. Note that "library function" in this
1206 context means a function used to perform arithmetic, whose name is
1207 known specially in the compiler and was not mentioned in the C
1208 code being compiled.
1210 STACK-SIZE is the number of bytes of arguments passed on the
1211 stack. If a variable number of bytes is passed, it is zero, and
1212 argument popping will always be the responsibility of the calling
1215 On the VAX, all functions always pop their arguments, so the
1216 definition of this macro is STACK-SIZE. On the 68000, using the
1217 standard calling convention, no functions pop their arguments, so
1218 the value of the macro is always 0 in this case. But an
1219 alternative calling convention is available in which functions
1220 that take a fixed number of arguments pop them but other functions
1221 (such as `printf') pop nothing (the caller pops all). When this
1222 convention is in use, FUNTYPE is examined to determine whether a
1223 function takes a fixed number of arguments. */
1225 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
1226 /* A C expression that controls whether a function argument is passed
1227 in a register, and which register.
1229 The arguments are CUM, which summarizes all the previous
1230 arguments; MODE, the machine mode of the argument; TYPE, the data
1231 type of the argument as a tree node or 0 if that is not known
1232 (which happens for C support library functions); and NAMED, which
1233 is 1 for an ordinary argument and 0 for nameless arguments that
1234 correspond to `...' in the called function's prototype.
1236 The value of the expression is usually either a `reg' RTX for the
1237 hard register in which to pass the argument, or zero to pass the
1238 argument on the stack.
1240 For machines like the VAX and 68000, where normally all arguments
1241 are pushed, zero suffices as a definition.
1243 The value of the expression can also be a `parallel' RTX. This is
1244 used when an argument is passed in multiple locations. The mode
1245 of the of the `parallel' should be the mode of the entire
1246 argument. The `parallel' holds any number of `expr_list' pairs;
1247 each one describes where part of the argument is passed. In each
1248 `expr_list', the first operand can be either a `reg' RTX for the
1249 hard register in which to pass this part of the argument, or zero
1250 to pass the argument on the stack. If this operand is a `reg',
1251 then the mode indicates how large this part of the argument is.
1252 The second operand of the `expr_list' is a `const_int' which gives
1253 the offset in bytes into the entire argument where this part
1256 The usual way to make the ANSI library `stdarg.h' work on a machine
1257 where some arguments are usually passed in registers, is to cause
1258 nameless arguments to be passed on the stack instead. This is done
1259 by making `FUNCTION_ARG' return 0 whenever NAMED is 0.
1261 You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the
1262 definition of this macro to determine if this argument is of a
1263 type that must be passed in the stack. If `REG_PARM_STACK_SPACE'
1264 is not defined and `FUNCTION_ARG' returns nonzero for such an
1265 argument, the compiler will abort. If `REG_PARM_STACK_SPACE' is
1266 defined, the argument will be computed in the stack and then
1267 loaded into a register. */
1269 #define CUMULATIVE_ARGS int
1271 /* A C type for declaring a variable that is used as the first
1272 argument of `FUNCTION_ARG' and other related values. For some
1273 target machines, the type `int' suffices and can hold the number
1274 of bytes of argument so far.
1276 There is no need to record in `CUMULATIVE_ARGS' anything about the
1277 arguments that have been passed on the stack. The compiler has
1278 other variables to keep track of that. For target machines on
1279 which all arguments are passed on the stack, there is no need to
1280 store anything in `CUMULATIVE_ARGS'; however, the data structure
1281 must exist and should not be empty, so use `int'. */
1283 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
1286 /* A C statement (sans semicolon) for initializing the variable CUM
1287 for the state at the beginning of the argument list. The variable
1288 has type `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node
1289 for the data type of the function which will receive the args, or 0
1290 if the args are to a compiler support library function. The value
1291 of INDIRECT is nonzero when processing an indirect call, for
1292 example a call through a function pointer. The value of INDIRECT
1293 is zero for a call to an explicitly named function, a library
1294 function call, or when `INIT_CUMULATIVE_ARGS' is used to find
1295 arguments for the function being compiled.
1297 When processing a call to a compiler support library function,
1298 LIBNAME identifies which one. It is a `symbol_ref' rtx which
1299 contains the name of the function, as a string. LIBNAME is 0 when
1300 an ordinary C function call is being processed. Thus, each time
1301 this macro is called, either LIBNAME or FNTYPE is nonzero, but
1302 never both of them at once. */
1304 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)
1306 /* All arguments are passed on stack - do nothing here. */
1308 /* A C statement (sans semicolon) to update the summarizer variable
1309 CUM to advance past an argument in the argument list. The values
1310 MODE, TYPE and NAMED describe that argument. Once this is done,
1311 the variable CUM is suitable for analyzing the *following*
1312 argument with `FUNCTION_ARG', etc.
1314 This macro need not do anything if the argument in question was
1315 passed on the stack. The compiler knows how to track the amount
1316 of stack space used for arguments without any special help. */
1318 #define FUNCTION_ARG_REGNO_P(R) 0
1319 /* A C expression that is nonzero if REGNO is the number of a hard
1320 register in which function arguments are sometimes passed. This
1321 does *not* include implicit arguments such as the static chain and
1322 the structure-value address. On many machines, no registers can be
1323 used for this purpose since all function arguments are pushed on
1326 #define FUNCTION_VALUE(VALTYPE, FUNC) \
1327 ((TYPE_MODE (VALTYPE) == QImode) \
1328 ? gen_rtx_REG (TYPE_MODE (VALTYPE), REG_RESULT + 1) \
1329 : gen_rtx_REG (TYPE_MODE (VALTYPE), REG_RESULT))
1331 /* Because functions returning 'char' actually widen to 'int', we have to
1332 use $81 as the return location if we think we only have a 'char'. */
1334 /* A C expression to create an RTX representing the place where a
1335 function returns a value of data type VALTYPE. VALTYPE is a tree
1336 node representing a data type. Write `TYPE_MODE (VALTYPE)' to get
1337 the machine mode used to represent that type. On many machines,
1338 only the mode is relevant. (Actually, on most machines, scalar
1339 values are returned in the same place regardless of mode).
1341 The value of the expression is usually a `reg' RTX for the hard
1342 register where the return value is stored. The value can also be a
1343 `parallel' RTX, if the return value is in multiple places. See
1344 `FUNCTION_ARG' for an explanation of the `parallel' form.
1346 If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same
1347 promotion rules specified in `PROMOTE_MODE' if VALTYPE is a scalar
1350 If the precise function being called is known, FUNC is a tree node
1351 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
1352 makes it possible to use a different value-returning convention
1353 for specific functions when all their calls are known.
1355 `FUNCTION_VALUE' is not used for return vales with aggregate data
1356 types, because these are returned in another way. See
1357 `STRUCT_VALUE_REGNUM' and related macros, below. */
1359 #define LIBCALL_VALUE(MODE) gen_rtx_REG ((MODE), REG_RESULT)
1360 /* A C expression to create an RTX representing the place where a
1361 library function returns a value of mode MODE. If the precise
1362 function being called is known, FUNC is a tree node
1363 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
1364 makes it possible to use a different value-returning convention
1365 for specific functions when all their calls are known.
1367 Note that "library function" in this context means a compiler
1368 support routine, used to perform arithmetic, whose name is known
1369 specially by the compiler and was not mentioned in the C code being
1372 The definition of `LIBRARY_VALUE' need not be concerned aggregate
1373 data types, because none of the library functions returns such
1376 #define FUNCTION_VALUE_REGNO_P(N) ((N) == REG_RESULT)
1377 /* A C expression that is nonzero if REGNO is the number of a hard
1378 register in which the values of called function may come back.
1380 A register whose use for returning values is limited to serving as
1381 the second of a pair (for a value of type `double', say) need not
1382 be recognized by this macro. So for most machines, this definition
1385 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
1387 If the machine has register windows, so that the caller and the
1388 called function use different registers for the return value, this
1389 macro should recognize only the caller's register numbers. */
1391 #define RETURN_IN_MEMORY(TYPE) \
1392 ((TYPE_MODE (TYPE) == BLKmode) ? int_size_in_bytes (TYPE) > 8 : 0)
1393 /* A C expression which can inhibit the returning of certain function
1394 values in registers, based on the type of value. A nonzero value
1395 says to return the function value in memory, just as large
1396 structures are always returned. Here TYPE will be a C expression
1397 of type `tree', representing the data type of the value.
1399 Note that values of mode `BLKmode' must be explicitly handled by
1400 this macro. Also, the option `-fpcc-struct-return' takes effect
1401 regardless of this macro. On most systems, it is possible to
1402 leave the macro undefined; this causes a default definition to be
1403 used, whose value is the constant 1 for `BLKmode' values, and 0
1406 Do not use this macro to indicate that structures and unions
1407 should always be returned in memory. You should instead use
1408 `DEFAULT_PCC_STRUCT_RETURN' to indicate this. */
1410 /* Indicate that large structures are passed by reference. */
1411 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM,MODE,TYPE,NAMED) 0
1414 #define DEFAULT_PCC_STRUCT_RETURN 0
1415 /* Define this macro to be 1 if all structure and union return values
1416 must be in memory. Since this results in slower code, this should
1417 be defined only if needed for compatibility with other compilers
1418 or with an ABI. If you define this macro to be 0, then the
1419 conventions used for structure and union return values are decided
1420 by the `RETURN_IN_MEMORY' macro.
1422 If not defined, this defaults to the value 1. */
1424 #define STRUCT_VALUE 0
1425 /* If the structure value address is not passed in a register, define
1426 `STRUCT_VALUE' as an expression returning an RTX for the place
1427 where the address is passed. If it returns 0, the address is
1428 passed as an "invisible" first argument. */
1430 #define STRUCT_VALUE_INCOMING 0
1431 /* If the incoming location is not a register, then you should define
1432 `STRUCT_VALUE_INCOMING' as an expression for an RTX for where the
1433 called function should find the value. If it should find the
1434 value on the stack, define this to create a `mem' which refers to
1435 the frame pointer. A definition of 0 means that the address is
1436 passed as an "invisible" first argument. */
1438 #define EPILOGUE_USES(REGNO) 0
1439 /* Define this macro as a C expression that is nonzero for registers
1440 are used by the epilogue or the `return' pattern. The stack and
1441 frame pointer registers are already be assumed to be used as
1444 #define SETUP_INCOMING_VARARGS(ARGS_SO_FAR,MODE,TYPE, \
1445 PRETEND_ARGS_SIZE,SECOND_TIME) \
1446 ((PRETEND_ARGS_SIZE) = (0))
1449 /* Hmmm. We don't actually like constants as addresses - they always need
1450 to be loaded to a register, except for function calls which take an
1451 address by immediate value. But changing this to zero had negative
1452 effects, causing the compiler to get very confused.... */
1454 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
1456 /* A C expression that is 1 if the RTX X is a constant which is a
1457 valid address. On most machines, this can be defined as
1458 `CONSTANT_P (X)', but a few machines are more restrictive in which
1459 constant addresses are supported.
1461 `CONSTANT_P' accepts integer-values expressions whose values are
1462 not explicitly known, such as `symbol_ref', `label_ref', and
1463 `high' expressions and `const' arithmetic expressions, in addition
1464 to `const_int' and `const_double' expressions. */
1466 #define MAX_REGS_PER_ADDRESS 1
1467 /* A number, the maximum number of registers that can appear in a
1468 valid memory address. Note that it is up to you to specify a
1469 value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS'
1470 would ever accept. */
1472 #ifdef REG_OK_STRICT
1473 # define GO_IF_LEGITIMATE_ADDRESS(MODE, OPERAND, ADDR) \
1475 if (legitimate_address_p ((MODE), (OPERAND), 1)) \
1479 # define GO_IF_LEGITIMATE_ADDRESS(MODE, OPERAND, ADDR) \
1481 if (legitimate_address_p ((MODE), (OPERAND), 0)) \
1485 /* A C compound statement with a conditional `goto LABEL;' executed
1486 if X (an RTX) is a legitimate memory address on the target machine
1487 for a memory operand of mode MODE.
1489 It usually pays to define several simpler macros to serve as
1490 subroutines for this one. Otherwise it may be too complicated to
1493 This macro must exist in two variants: a strict variant and a
1494 non-strict one. The strict variant is used in the reload pass. It
1495 must be defined so that any pseudo-register that has not been
1496 allocated a hard register is considered a memory reference. In
1497 contexts where some kind of register is required, a pseudo-register
1498 with no hard register must be rejected.
1500 The non-strict variant is used in other passes. It must be
1501 defined to accept all pseudo-registers in every context where some
1502 kind of register is required.
1504 Compiler source files that want to use the strict variant of this
1505 macro define the macro `REG_OK_STRICT'. You should use an `#ifdef
1506 REG_OK_STRICT' conditional to define the strict variant in that
1507 case and the non-strict variant otherwise.
1509 Subroutines to check for acceptable registers for various purposes
1510 (one for base registers, one for index registers, and so on) are
1511 typically among the subroutines used to define
1512 `GO_IF_LEGITIMATE_ADDRESS'. Then only these subroutine macros
1513 need have two variants; the higher levels of macros may be the
1514 same whether strict or not.
1516 Normally, constant addresses which are the sum of a `symbol_ref'
1517 and an integer are stored inside a `const' RTX to mark them as
1518 constant. Therefore, there is no need to recognize such sums
1519 specifically as legitimate addresses. Normally you would simply
1520 recognize any `const' as legitimate.
1522 Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant
1523 sums that are not marked with `const'. It assumes that a naked
1524 `plus' indicates indexing. If so, then you *must* reject such
1525 naked constant sums as illegitimate addresses, so that none of
1526 them will be given to `PRINT_OPERAND_ADDRESS'.
1528 On some machines, whether a symbolic address is legitimate depends
1529 on the section that the address refers to. On these machines,
1530 define the macro `ENCODE_SECTION_INFO' to store the information
1531 into the `symbol_ref', and then check for it here. When you see a
1532 `const', you will have to look inside it to find the `symbol_ref'
1533 in order to determine the section. *Note Assembler Format::.
1535 The best way to modify the name string is by adding text to the
1536 beginning, with suitable punctuation to prevent any ambiguity.
1537 Allocate the new name in `saveable_obstack'. You will have to
1538 modify `ASM_OUTPUT_LABELREF' to remove and decode the added text
1539 and output the name accordingly, and define `STRIP_NAME_ENCODING'
1540 to access the original name string.
1542 You can check the information stored here into the `symbol_ref' in
1543 the definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and
1544 `PRINT_OPERAND_ADDRESS'. */
1546 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is
1547 valid for use as a base register. For hard registers, it should
1548 always accept those which the hardware permits and reject the
1549 others. Whether the macro accepts or rejects pseudo registers
1550 must be controlled by `REG_OK_STRICT' as described above. This
1551 usually requires two variant definitions, of which `REG_OK_STRICT'
1552 controls the one actually used. */
1554 #define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
1556 #define REG_OK_FOR_BASE_NOSTRICT_P(X) \
1557 (REGNO (X) >= FIRST_PSEUDO_REGISTER \
1558 || (REGNO (X) == REG_FP) \
1559 || (REGNO (X) == REG_VFP) \
1560 || (REGNO (X) == REG_AP) \
1561 || REG_OK_FOR_BASE_STRICT_P(X))
1563 #ifdef REG_OK_STRICT
1564 # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X)
1566 # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NOSTRICT_P (X)
1569 #define REG_OK_FOR_INDEX_P(X) 0
1570 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is
1571 valid for use as an index register.
1573 The difference between an index register and a base register is
1574 that the index register may be scaled. If an address involves the
1575 sum of two registers, neither one of them scaled, then either one
1576 may be labeled the "base" and the other the "index"; but whichever
1577 labeling is used must fit the machine's constraints of which
1578 registers may serve in each capacity. The compiler will try both
1579 labelings, looking for one that is valid, and will reload one or
1580 both registers only if neither labeling works. */
1583 /* A C compound statement that attempts to replace X with a valid
1584 memory address for an operand of mode MODE. WIN will be a C
1585 statement label elsewhere in the code; the macro definition may use
1587 GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
1589 to avoid further processing if the address has become legitimate.
1591 X will always be the result of a call to `break_out_memory_refs',
1592 and OLDX will be the operand that was given to that function to
1595 The code generated by this macro should not alter the substructure
1596 of X. If it transforms X into a more legitimate form, it should
1597 assign X (which will always be a C variable) a new value.
1599 It is not necessary for this macro to come up with a legitimate
1600 address. The compiler has standard ways of doing so in all cases.
1601 In fact, it is safe for this macro to do nothing. But often a
1602 machine-dependent strategy can generate better code. */
1604 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
1605 do { rtx orig_x = (X); \
1606 (X) = legitimize_address ((X), (OLDX), (MODE), 0); \
1607 if ((X) != orig_x && memory_address_p ((MODE), (X))) \
1611 /* Is X a legitimate register to reload, or is it a pseudo stack-temp
1612 that is problematic for push_reload() ? */
1614 #define LRA_REG(X) \
1615 (! (reg_equiv_memory_loc[REGNO (X)] \
1616 && (reg_equiv_address[REGNO (X)] \
1617 || num_not_at_initial_offset)))
1619 /* Given a register X that failed the LRA_REG test, replace X
1620 by its memory equivalent, find the reloads needed for THAT memory
1621 location and substitute that back for the higher-level reload
1622 that we're conducting... */
1624 /* WARNING: we reference 'ind_levels' and 'insn' which are local variables
1625 in find_reloads_address (), where the LEGITIMIZE_RELOAD_ADDRESS macro
1628 #define FRA_REG(X,MODE,OPNUM,TYPE) \
1630 rtx tem = make_memloc ((X), REGNO (X)); \
1632 if (! strict_memory_address_p (GET_MODE (tem), XEXP (tem, 0))) \
1634 /* Note that we're doing address in address - cf. ADDR_TYPE */ \
1635 find_reloads_address (GET_MODE (tem), &tem, XEXP (tem, 0), \
1636 &XEXP (tem, 0), (OPNUM), \
1637 ADDR_TYPE (TYPE), ind_levels, insn); \
1643 /* For the IP2K, we want to be clever about picking IP vs DP for a
1644 base pointer since IP only directly supports a zero displacement.
1645 (Note that we have modified all the HI patterns to correctly handle
1646 IP references by manipulating iph:ipl as we fetch the pieces). */
1647 #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND,WIN) \
1649 if (GET_CODE (X) == PLUS \
1650 && REG_P (XEXP (X, 0)) \
1651 && GET_CODE (XEXP (X, 1)) == CONST_INT) \
1653 int disp = INTVAL (XEXP (X, 1)); \
1654 int fit = (disp >= 0 && disp <= (127 - 2 * GET_MODE_SIZE (MODE))); \
1655 rtx reg = XEXP (X, 0); \
1658 push_reload ((X), NULL_RTX, &(X), \
1659 NULL, MODE_BASE_REG_CLASS (MODE), GET_MODE (X), \
1660 VOIDmode, 0, 0, OPNUM, TYPE); \
1663 if (reg_equiv_memory_loc[REGNO (reg)] \
1664 && (reg_equiv_address[REGNO (reg)] || num_not_at_initial_offset)) \
1666 rtx mem = make_memloc (reg, REGNO (reg)); \
1667 if (! strict_memory_address_p (GET_MODE (mem), XEXP (mem, 0))) \
1669 /* Note that we're doing address in address - cf. ADDR_TYPE */\
1670 find_reloads_address (GET_MODE (mem), &mem, XEXP (mem, 0), \
1671 &XEXP (mem, 0), (OPNUM), \
1672 ADDR_TYPE (TYPE), (IND), insn); \
1674 push_reload (mem, NULL, &XEXP (X, 0), NULL, \
1675 GENERAL_REGS, Pmode, VOIDmode, 0, 0, \
1677 push_reload (X, NULL, &X, NULL, \
1678 MODE_BASE_REG_CLASS (MODE), GET_MODE (X), VOIDmode, \
1679 0, 0, OPNUM, TYPE); \
1684 /* A C compound statement that attempts to replace X, which is an
1685 address that needs reloading, with a valid memory address for an
1686 operand of mode MODE. WIN will be a C statement label elsewhere
1687 in the code. It is not necessary to define this macro, but it
1688 might be useful for performance reasons.
1690 For example, on the i386, it is sometimes possible to use a single
1691 reload register instead of two by reloading a sum of two pseudo
1692 registers into a register. On the other hand, for number of RISC
1693 processors offsets are limited so that often an intermediate
1694 address needs to be generated in order to address a stack slot.
1695 By defining LEGITIMIZE_RELOAD_ADDRESS appropriately, the
1696 intermediate addresses generated for adjacent some stack slots can
1697 be made identical, and thus be shared.
1699 *Note*: This macro should be used with caution. It is necessary
1700 to know something of how reload works in order to effectively use
1701 this, and it is quite easy to produce macros that build in too
1702 much knowledge of reload internals.
1704 *Note*: This macro must be able to reload an address created by a
1705 previous invocation of this macro. If it fails to handle such
1706 addresses then the compiler may generate incorrect code or abort.
1708 The macro definition should use `push_reload' to indicate parts
1709 that need reloading; OPNUM, TYPE and IND_LEVELS are usually
1710 suitable to be passed unaltered to `push_reload'.
1712 The code generated by this macro must not alter the substructure of
1713 X. If it transforms X into a more legitimate form, it should
1714 assign X (which will always be a C variable) a new value. This
1715 also applies to parts that you change indirectly by calling
1718 The macro definition may use `strict_memory_address_p' to test if
1719 the address has become legitimate.
1721 If you want to change only a part of X, one standard way of doing
1722 this is to use `copy_rtx'. Note, however, that is unshares only a
1723 single level of rtl. Thus, if the part to be changed is not at the
1724 top level, you'll need to replace first the top leve It is not
1725 necessary for this macro to come up with a legitimate address;
1726 but often a machine-dependent strategy can generate better code. */
1728 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
1730 if (ip2k_mode_dependent_address (ADDR)) goto LABEL; \
1733 /* A C statement or compound statement with a conditional `goto
1734 LABEL;' executed if memory address X (an RTX) can have different
1735 meanings depending on the machine mode of the memory reference it
1736 is used for or if the address is valid for some modes but not
1739 Autoincrement and autodecrement addresses typically have
1740 mode-dependent effects because the amount of the increment or
1741 decrement is the size of the operand being addressed. Some
1742 machines have other mode-dependent addresses. Many RISC machines
1743 have no mode-dependent addresses.
1745 You may assume that ADDR is a valid address for the machine. */
1747 #define LEGITIMATE_CONSTANT_P(X) 1
1748 /* A C expression that is nonzero if X is a legitimate constant for
1749 an immediate operand on the target machine. You can assume that X
1750 satisfies `CONSTANT_P', so you need not check this. In fact, `1'
1751 is a suitable definition for this macro on machines where anything
1752 `CONSTANT_P' is valid. */
1754 #define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) 7
1755 /* A C expression for the cost of moving data from a register in class
1756 FROM to one in class TO. The classes are expressed using the
1757 enumeration values such as `GENERAL_REGS'. A value of 2 is the
1758 default; other values are interpreted relative to that.
1760 It is not required that the cost always equal 2 when FROM is the
1761 same as TO; on some machines it is expensive to move between
1762 registers if they are not general registers.
1764 If reload sees an insn consisting of a single `set' between two
1765 hard registers, and if `REGISTER_MOVE_COST' applied to their
1766 classes returns a value of 2, reload does not check to ensure that
1767 the constraints of the insn are met. Setting a cost of other than
1768 2 will allow reload to verify that the constraints are met. You
1769 should do this if the `movM' pattern's constraints do not allow
1772 #define MEMORY_MOVE_COST(MODE,CLASS,IN) 6
1773 /* A C expression for the cost of moving data of mode M between a
1774 register and memory. A value of 4 is the default; this cost is
1775 relative to those in `REGISTER_MOVE_COST'.
1777 If moving between registers and memory is more expensive than
1778 between two registers, you should define this macro to express the
1781 #define SLOW_BYTE_ACCESS 0
1782 /* Define this macro as a C expression which is nonzero if accessing
1783 less than a word of memory (i.e. a `char' or a `short') is no
1784 faster than accessing a word of memory, i.e., if such access
1785 require more than one instruction or if there is no difference in
1786 cost between byte and (aligned) word loads.
1788 When this macro is not defined, the compiler will access a field by
1789 finding the smallest containing object; when it is defined, a
1790 fullword load will be used if alignment permits. Unless bytes
1791 accesses are faster than word accesses, using word accesses is
1792 preferable since it may eliminate subsequent memory access if
1793 subsequent accesses occur to other fields in the same word of the
1794 structure, but to different bytes.
1797 Define this macro if zero-extension (of a `char' or `short' to an
1798 `int') can be done faster if the destination is a register that is
1801 If you define this macro, you must have instruction patterns that
1802 recognize RTL structures like this:
1804 (set (strict_low_part (subreg:QI (reg:SI ...) 0)) ...)
1806 and likewise for `HImode'.
1808 `SLOW_UNALIGNED_ACCESS'
1809 Define this macro to be the value 1 if unaligned accesses have a
1810 cost many times greater than aligned accesses, for example if they
1811 are emulated in a trap handler.
1813 When this macro is nonzero, the compiler will act as if
1814 `STRICT_ALIGNMENT' were nonzero when generating code for block
1815 moves. This can cause significantly more instructions to be
1816 produced. Therefore, do not set this macro nonzero if unaligned
1817 accesses only add a cycle or two to the time for a memory access.
1819 If the value of this macro is always zero, it need not be defined.
1822 The number of scalar move insns which should be generated instead
1823 of a string move insn or a library call. Increasing the value
1824 will always make code faster, but eventually incurs high cost in
1825 increased code size.
1827 If you don't define this, a reasonable default is used. */
1829 #define NO_FUNCTION_CSE
1830 /* Define this macro if it is as good or better to call a constant
1831 function address than to call an address kept in a register. */
1833 #define NO_RECURSIVE_FUNCTION_CSE
1834 /* Define this macro if it is as good or better for a function to call
1835 itself with an explicit address than to call an address kept in a
1838 `ADJUST_COST (INSN, LINK, DEP_INSN, COST)'
1839 A C statement (sans semicolon) to update the integer variable COST
1840 based on the relationship between INSN that is dependent on
1841 DEP_INSN through the dependence LINK. The default is to make no
1842 adjustment to COST. This can be used for example to specify to
1843 the scheduler that an output- or anti-dependence does not incur
1844 the same cost as a data-dependence.
1846 `ADJUST_PRIORITY (INSN)'
1847 A C statement (sans semicolon) to update the integer scheduling
1848 priority `INSN_PRIORITY(INSN)'. Reduce the priority to execute
1849 the INSN earlier, increase the priority to execute INSN later.
1850 Do not define this macro if you do not need to adjust the
1851 scheduling priorities of insns. */
1853 #define TEXT_SECTION_ASM_OP ".text"
1854 /* A C expression whose value is a string containing the assembler
1855 operation that should precede instructions and read-only data.
1856 Normally `".text"' is right. */
1858 #define DATA_SECTION_ASM_OP ".data"
1859 /* A C expression whose value is a string containing the assembler
1860 operation to identify the following data as writable initialized
1861 data. Normally `".data"' is right. */
1863 #define JUMP_TABLES_IN_TEXT_SECTION 1
1864 /* Define this macro if jump tables (for `tablejump' insns) should be
1865 output in the text section, along with the assembler instructions.
1866 Otherwise, the readonly data section is used.
1868 This macro is irrelevant if there is no separate readonly data
1871 #define ASM_COMMENT_START " ; "
1872 /* A C string constant describing how to begin a comment in the target
1873 assembler language. The compiler assumes that the comment will
1874 end at the end of the line. */
1876 #define ASM_APP_ON "/* #APP */\n"
1877 /* A C string constant for text to be output before each `asm'
1878 statement or group of consecutive ones. Normally this is
1879 `"#APP"', which is a comment that has no effect on most assemblers
1880 but tells the GNU assembler that it must check the lines that
1881 follow for all valid assembler constructs. */
1883 #define ASM_APP_OFF "/* #NOAPP */\n"
1884 /* A C string constant for text to be output after each `asm'
1885 statement or group of consecutive ones. Normally this is
1886 `"#NO_APP"', which tells the GNU assembler to resume making the
1887 time-saving assumptions that are valid for ordinary compiler
1890 #define ASM_OUTPUT_DOUBLE(STREAM, VALUE) \
1891 fprintf ((STREAM), ".double %.20e\n", (VALUE))
1892 #define ASM_OUTPUT_FLOAT(STREAM, VALUE) \
1893 asm_output_float ((STREAM), (VALUE))
1895 /* `ASM_OUTPUT_LONG_DOUBLE (STREAM, VALUE)'
1896 `ASM_OUTPUT_THREE_QUARTER_FLOAT (STREAM, VALUE)'
1897 `ASM_OUTPUT_SHORT_FLOAT (STREAM, VALUE)'
1898 `ASM_OUTPUT_BYTE_FLOAT (STREAM, VALUE)'
1899 A C statement to output to the stdio stream STREAM an assembler
1900 instruction to assemble a floating-point constant of `TFmode',
1901 `DFmode', `SFmode', `TQFmode', `HFmode', or `QFmode',
1902 respectively, whose value is VALUE. VALUE will be a C expression
1903 of type `REAL_VALUE_TYPE'. Macros such as
1904 `REAL_VALUE_TO_TARGET_DOUBLE' are useful for writing these
1907 #define ASM_OUTPUT_INT(FILE, VALUE) \
1908 ( fprintf ((FILE), "\t.long "), \
1909 output_addr_const ((FILE), (VALUE)), \
1910 fputs ("\n", (FILE)))
1912 /* Likewise for `short' and `char' constants. */
1914 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
1915 asm_output_short ((FILE), (VALUE))
1916 #define ASM_OUTPUT_CHAR(FILE,VALUE) \
1917 asm_output_char ((FILE), (VALUE))
1919 /* `ASM_OUTPUT_QUADRUPLE_INT (STREAM, EXP)'
1920 A C statement to output to the stdio stream STREAM an assembler
1921 instruction to assemble an integer of 16, 8, 4, 2 or 1 bytes,
1922 respectively, whose value is VALUE. The argument EXP will be an
1923 RTL expression which represents a constant value. Use
1924 `output_addr_const (STREAM, EXP)' to output this value as an
1925 assembler expression.
1927 For sizes larger than `UNITS_PER_WORD', if the action of a macro
1928 would be identical to repeatedly calling the macro corresponding to
1929 a size of `UNITS_PER_WORD', once for each word, you need not define
1932 #define ASM_OUTPUT_BYTE(FILE,VALUE) \
1933 asm_output_byte ((FILE), (VALUE))
1934 /* A C statement to output to the stdio stream STREAM an assembler
1935 instruction to assemble a single byte containing the number VALUE. */
1937 #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) \
1938 ((C) == '\n' || ((C) == '$'))
1939 /* Define this macro as a C expression which is nonzero if C is used
1940 as a logical line separator by the assembler.
1942 If you do not define this macro, the default is that only the
1943 character `;' is treated as a logical line separator. */
1945 #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
1947 fputs ("\t.comm ", (STREAM)); \
1948 assemble_name ((STREAM), (NAME)); \
1949 fprintf ((STREAM), ",%d\n", (int)(SIZE)); \
1951 /* A C statement (sans semicolon) to output to the stdio stream
1952 STREAM the assembler definition of a common-label named NAME whose
1953 size is SIZE bytes. The variable ROUNDED is the size rounded up
1954 to whatever alignment the caller wants.
1956 Use the expression `assemble_name (STREAM, NAME)' to output the
1957 name itself; before and after that, output the additional
1958 assembler syntax for defining the name, and a newline.
1960 This macro controls how the assembler definitions of uninitialized
1961 common global variables are output. */
1963 #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) \
1965 fputs ("\t.lcomm ", (STREAM)); \
1966 assemble_name ((STREAM), (NAME)); \
1967 fprintf ((STREAM), ",%d\n", (int)(SIZE)); \
1969 /* A C statement (sans semicolon) to output to the stdio stream
1970 STREAM the assembler definition of a local-common-label named NAME
1971 whose size is SIZE bytes. The variable ROUNDED is the size
1972 rounded up to whatever alignment the caller wants.
1974 Use the expression `assemble_name (STREAM, NAME)' to output the
1975 name itself; before and after that, output the additional
1976 assembler syntax for defining the name, and a newline.
1978 This macro controls how the assembler definitions of uninitialized
1979 static variables are output. */
1982 #define WEAK_ASM_OP ".weak"
1984 #undef ASM_DECLARE_FUNCTION_SIZE
1985 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
1987 if (!flag_inhibit_size_directive) \
1988 ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
1990 /* A C statement (sans semicolon) to output to the stdio stream
1991 STREAM any text necessary for declaring the size of a function
1992 which is being defined. The argument NAME is the name of the
1993 function. The argument DECL is the `FUNCTION_DECL' tree node
1994 representing the function.
1996 If this macro is not defined, then the function size is not
2000 "\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
2001 \0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
2002 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
2003 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
2004 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
2005 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
2006 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
2007 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
2008 /* A table of bytes codes used by the ASM_OUTPUT_ASCII and
2009 ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
2010 corresponds to a particular byte value [0..255]. For any
2011 given byte value, if the value in the corresponding table
2012 position is zero, the given character can be output directly.
2013 If the table value is 1, the byte must be output as a \ooo
2014 octal escape. If the tables value is anything else, then the
2015 byte value should be output as a \ followed by the value
2016 in the table. Note that we can use standard UN*X escape
2017 sequences for many control characters, but we don't use
2018 \a to represent BEL because some svr4 assemblers (e.g. on
2019 the i386) don't know about that. Also, we don't use \v
2020 since some versions of gas, such as 2.2 did not accept it. */
2022 /* Globalizing directive for a label. */
2023 #define GLOBAL_ASM_OP ".global\t"
2025 #define REGISTER_NAMES { \
2026 "$00","$01","$02","$03","iph","ipl","sph","spl", \
2027 "pch","pcl","wreg","status","dph","dpl","$0e","mulh", \
2028 "$10","$11","$12","$13","$14","$15","$16","$17", \
2029 "$18","$19","$1a","$1b","$1c","$1d","$1e","$1f", \
2030 "$20","$21","$22","$23","$24","$25","$26","$27", \
2031 "$28","$29","$2a","$2b","$2c","$2d","$2e","$2f", \
2032 "$30","$31","$32","$33","$34","$35","$36","$37", \
2033 "$38","$39","$3a","$3b","$3c","$3d","$3e","$3f", \
2034 "$40","$41","$42","$43","$44","$45","$46","$47", \
2035 "$48","$49","$4a","$4b","$4c","$4d","$4e","$4f", \
2036 "$50","$51","$52","$53","$54","$55","$56","$57", \
2037 "$58","$59","$5a","$5b","$5c","$5d","$5e","$5f", \
2038 "$60","$61","$62","$63","$64","$65","$66","$67", \
2039 "$68","$69","$6a","$6b","$6c","$6d","$6e","$6f", \
2040 "$70","$71","$72","$73","$74","$75","$76","$77", \
2041 "$78","$79","$7a","$7b","$7c","$7d","callh","calll", \
2042 "$80","$81","$82","$83","$84","$85","$86","$87", \
2043 "$88","$89","$8a","$8b","$8c","$8d","$8e","$8f", \
2044 "$90","$91","$92","$93","$94","$95","$96","$97", \
2045 "$98","$99","$9a","$9b","$9c","$9d","$9e","$9f", \
2046 "$a0","$a1","$a2","$a3","$a4","$a5","$a6","$a7", \
2047 "$a8","$a9","$aa","$ab","$ac","$ad","$ae","$af", \
2048 "$b0","$b1","$b2","$b3","$b4","$b5","$b6","$b7", \
2049 "$b8","$b9","$ba","$bb","$bc","$bd","$be","$bf", \
2050 "$c0","$c1","$c2","$c3","$c4","$c5","$c6","$c7", \
2051 "$c8","$c9","$ca","$cb","$cc","$cd","$ce","$cf", \
2052 "$d0","$d1","$d2","$d3","$d4","$d5","$d6","$d7", \
2053 "$d8","$d9","$da","$db","$dc","$dd","$de","$df", \
2054 "$e0","$e1","$e2","$e3","$e4","$e5","$e6","$e7", \
2055 "$e8","$e9","$ea","$eb","$ec","$ed","$ee","$ef", \
2056 "$f0","$f1","$f2","$f3","$f4","$f5","$f6","$f7", \
2057 "$f8","$f9","$fa","$fb","$fc","$fd","$fe","$ff", \
2058 "vfph","vfpl","vaph","vapl"}
2060 /* A C initializer containing the assembler's names for the machine
2061 registers, each one as a C string constant. This is what
2062 translates register numbers in the compiler into assembler
2065 #define PRINT_OPERAND(STREAM, X, CODE) \
2066 print_operand ((STREAM), (X), (CODE))
2067 /* A C compound statement to output to stdio stream STREAM the
2068 assembler syntax for an instruction operand X. X is an RTL
2071 CODE is a value that can be used to specify one of several ways of
2072 printing the operand. It is used when identical operands must be
2073 printed differently depending on the context. CODE comes from the
2074 `%' specification that was used to request printing of the
2075 operand. If the specification was just `%DIGIT' then CODE is 0;
2076 if the specification was `%LTR DIGIT' then CODE is the ASCII code
2079 If X is a register, this macro should print the register's name.
2080 The names can be found in an array `reg_names' whose type is `char
2081 *[]'. `reg_names' is initialized from `REGISTER_NAMES'.
2083 When the machine description has a specification `%PUNCT' (a `%'
2084 followed by a punctuation character), this macro is called with a
2085 null pointer for X and the punctuation character for CODE. */
2087 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
2088 ((CODE) == '<' || (CODE) == '>')
2090 /* A C expression which evaluates to true if CODE is a valid
2091 punctuation character for use in the `PRINT_OPERAND' macro. If
2092 `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no
2093 punctuation characters (except for the standard one, `%') are used
2096 #define PRINT_OPERAND_ADDRESS(STREAM, X) print_operand_address(STREAM, X)
2097 /* A C compound statement to output to stdio stream STREAM the
2098 assembler syntax for an instruction operand that is a memory
2099 reference whose address is X. X is an RTL expression.
2101 On some machines, the syntax for a symbolic address depends on the
2102 section that the address refers to. On these machines, define the
2103 macro `ENCODE_SECTION_INFO' to store the information into the
2104 `symbol_ref', and then check for it here. *Note Assembler
2107 /* Since register names don't have a prefix, we must preface all
2108 user identifiers with the '_' to prevent confusion. */
2110 #undef USER_LABEL_PREFIX
2111 #define USER_LABEL_PREFIX "_"
2112 #define LOCAL_LABEL_PREFIX ".L"
2113 /* `LOCAL_LABEL_PREFIX'
2116 If defined, C string expressions to be used for the `%R', `%L',
2117 `%U', and `%I' options of `asm_fprintf' (see `final.c'). These
2118 are useful when a single `md' file must support multiple assembler
2119 formats. In that case, the various `tm.h' files can define these
2120 macros differently. */
2123 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
2124 asm_fprintf ((STREAM), "\tpage\t%L%d\n\tjmp\t%L%d\n", (VALUE), (VALUE))
2126 /* elfos.h presumes that we will want switch/case dispatch tables aligned.
2127 This is not so for the ip2k. */
2128 #undef ASM_OUTPUT_CASE_LABEL
2130 #undef ASM_OUTPUT_ADDR_VEC_ELT
2131 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
2132 asm_fprintf ((STREAM), "\tpage\t%L%d\n\tjmp\t%L%d\n", (VALUE), (VALUE))
2134 /* This macro should be provided on machines where the addresses in a
2135 dispatch table are absolute.
2137 The definition should be a C statement to output to the stdio
2138 stream STREAM an assembler pseudo-instruction to generate a
2139 reference to a label. VALUE is the number of an internal label
2140 whose definition is output using `(*targetm.asm_out.internal_label)'. For
2143 fprintf ((STREAM), "\t.word L%d\n", (VALUE)) */
2145 #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
2146 fprintf ((STREAM), "\t.align %d\n", (POWER))
2147 /* A C statement to output to the stdio stream STREAM an assembler
2148 command to advance the location counter to a multiple of 2 to the
2149 POWER bytes. POWER will be a C expression of type `int'. */
2151 /* Since instructions are 16 bit word addresses, we should lie and claim that
2152 the dispatch vectors are in QImode. Otherwise the offset into the jump
2153 table will be scaled by the MODE_SIZE. */
2155 #define CASE_VECTOR_MODE QImode
2156 /* An alias for a machine mode name. This is the machine mode that
2157 elements of a jump-table should have. */
2160 /* `CASE_VALUES_THRESHOLD'
2161 Define this to be the smallest number of different values for
2162 which it is best to use a jump-table instead of a tree of
2163 conditional branches. The default is four for machines with a
2164 `casesi' instruction and five otherwise. This is best for most
2167 #undef WORD_REGISTER_OPERATIONS
2168 /* Define this macro if operations between registers with integral
2169 mode smaller than a word are always performed on the entire
2170 register. Most RISC machines have this property and most CISC
2174 /* The maximum number of bytes that a single instruction can move
2175 quickly between memory and registers or between two memory
2178 #define MOVE_RATIO 3
2179 /* MOVE_RATIO is the number of move instructions that is better than a
2180 block move. Make this small on the IP2k, since the code size grows very
2181 large with each move. */
2183 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
2184 /* A C expression which is nonzero if on this machine it is safe to
2185 "convert" an integer of INPREC bits to one of OUTPREC bits (where
2186 OUTPREC is smaller than INPREC) by merely operating on it as if it
2187 had only OUTPREC bits.
2189 On many machines, this expression can be 1.
2191 When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for
2192 modes for which `MODES_TIEABLE_P' is 0, suboptimal code can result.
2193 If this is the case, making `TRULY_NOOP_TRUNCATION' return 0 in
2194 such cases may improve things. */
2196 #define Pmode HImode
2197 /* An alias for the machine mode for pointers. On most machines,
2198 define this to be the integer mode corresponding to the width of a
2199 hardware pointer; `SImode' on 32-bit machine or `DImode' on 64-bit
2200 machines. On some machines you must define this to be one of the
2201 partial integer modes, such as `PSImode'.
2203 The width of `Pmode' must be at least as large as the value of
2204 `POINTER_SIZE'. If it is not equal, you must define the macro
2205 `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to
2208 #define FUNCTION_MODE HImode
2209 /* An alias for the machine mode used for memory references to
2210 functions being called, in `call' RTL expressions. On most
2211 machines this should be `QImode'. */
2213 #define INTEGRATE_THRESHOLD(DECL) \
2214 (1 + (3 * list_length (DECL_ARGUMENTS (DECL)) / 2))
2215 /* A C expression for the maximum number of instructions above which
2216 the function DECL should not be inlined. DECL is a
2217 `FUNCTION_DECL' node.
2219 The default definition of this macro is 64 plus 8 times the number
2220 of arguments that the function accepts. Some people think a larger
2221 threshold should be used on RISC machines. */
2223 #define DOLLARS_IN_IDENTIFIERS 0
2224 /* Define this macro to control use of the character `$' in identifier
2225 names. 0 means `$' is not allowed by default; 1 means it is
2226 allowed. 1 is the default; there is no need to define this macro
2227 in that case. This macro controls the compiler proper; it does
2228 not affect the preprocessor. */
2230 extern int ip2k_reorg_in_progress;
2231 /* Flag if we're in the middle of IP2k-specific reorganization. */
2233 extern int ip2k_reorg_completed;
2234 /* Flag if we've completed our IP2k-specific reorganization. If we have
2235 then we allow quite a few more tricks than before. */
2237 extern int ip2k_reorg_split_dimode;
2238 extern int ip2k_reorg_split_simode;
2239 extern int ip2k_reorg_split_qimode;
2240 extern int ip2k_reorg_split_himode;
2241 /* Flags for various split operations that we run in sequence. */
2243 extern int ip2k_reorg_merge_qimode;
2244 /* Flag to indicate that it's safe to merge QImode operands. */
2246 #define GIV_SORT_CRITERION(X, Y) \
2248 if (GET_CODE ((X)->add_val) == CONST_INT \
2249 && GET_CODE ((Y)->add_val) == CONST_INT) \
2250 return INTVAL ((X)->add_val) - INTVAL ((Y)->add_val); \
2253 /* In some cases, the strength reduction optimization pass can
2254 produce better code if this is defined. This macro controls the
2255 order that induction variables are combined. This macro is
2256 particularly useful if the target has limited addressing modes.
2257 For instance, the SH target has only positive offsets in
2258 addresses. Thus sorting to put the smallest address first allows
2259 the most combinations to be found. */
2261 #define TRAMPOLINE_TEMPLATE(FILE) abort ()
2263 /* Length in units of the trampoline for entering a nested function. */
2265 #define TRAMPOLINE_SIZE 4
2267 /* Emit RTL insns to initialize the variable parts of a trampoline.
2268 FNADDR is an RTX for the address of the function's pure code.
2269 CXT is an RTX for the static chain value for the function. */
2271 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
2273 emit_move_insn (gen_rtx_MEM (HImode, plus_constant ((TRAMP), 2)), \
2275 emit_move_insn (gen_rtx_MEM (HImode, plus_constant ((TRAMP), 6)), \
2278 /* Store in cc_status the expressions
2279 that the condition codes will describe
2280 after execution of an instruction whose pattern is EXP.
2281 Do not alter them if the instruction would not alter the cc's. */
2283 #define NOTICE_UPDATE_CC(EXP, INSN) (void)(0)
2285 /* Output assembler code to FILE to increment profiler label # LABELNO
2286 for profiling a function entry. */
2288 #define FUNCTION_PROFILER(FILE, LABELNO) \
2289 fprintf ((FILE), "/* profiler %d */", (LABELNO))
2291 #define TARGET_MEM_FUNCTIONS
2292 /* Define this macro if GNU CC should generate calls to the System V
2293 (and ANSI C) library functions `memcpy' and `memset' rather than
2294 the BSD functions `bcopy' and `bzero'. */
2299 #undef STARTFILE_SPEC
2301 /* Another C string constant used much like `LINK_SPEC'. The
2302 difference between the two is that `ENDFILE_SPEC' is used at the
2303 very end of the command given to the linker.
2305 Do not define this macro if it does not need to do anything. */
2307 #if defined(__STDC__) || defined(ALMOST_STDC)
2308 #define AS2(a,b,c) #a "\t" #b "," #c
2309 #define AS1(a,b) #a "\t" #b
2311 #define AS1(a,b) "a b"
2312 #define AS2(a,b,c) "a b,c"
2314 #define OUT_AS1(a,b) output_asm_insn (AS1 (a,b), operands)
2315 #define OUT_AS2(a,b,c) output_asm_insn (AS2 (a,b,c), operands)
2316 #define CR_TAB "\n\t"
2318 /* Define this macro as a C statement that declares additional library
2319 routines renames existing ones. `init_optabs' calls this macro
2320 after initializing all the normal library routines. */
2322 #define INIT_TARGET_OPTABS \
2324 smul_optab->handlers[(int) SImode].libfunc \
2325 = gen_rtx_SYMBOL_REF (Pmode, "_mulsi3"); \
2327 smul_optab->handlers[(int) DImode].libfunc \
2328 = gen_rtx_SYMBOL_REF (Pmode, "_muldi3"); \
2330 cmp_optab->handlers[(int) HImode].libfunc \
2331 = gen_rtx_SYMBOL_REF (Pmode, "_cmphi2"); \
2333 cmp_optab->handlers[(int) SImode].libfunc \
2334 = gen_rtx_SYMBOL_REF (Pmode, "_cmpsi2"); \
2337 #define PREDICATE_CODES \
2338 {"ip2k_ip_operand", {MEM}}, \
2339 {"ip2k_short_operand", {MEM}}, \
2340 {"ip2k_gen_operand", {MEM, REG, SUBREG}}, \
2341 {"ip2k_nonptr_operand", {REG, SUBREG}}, \
2342 {"ip2k_ptr_operand", {REG, SUBREG}}, \
2343 {"ip2k_split_dest_operand", {REG, SUBREG, MEM}}, \
2344 {"ip2k_sp_operand", {REG}}, \
2345 {"ip2k_nonsp_reg_operand", {REG, SUBREG}}, \
2346 {"ip2k_symbol_ref_operand", {SYMBOL_REF}}, \
2347 {"ip2k_binary_operator", {PLUS, MINUS, MULT, DIV, \
2348 UDIV, MOD, UMOD, AND, IOR, \
2349 XOR, COMPARE, ASHIFT, \
2350 ASHIFTRT, LSHIFTRT}}, \
2351 {"ip2k_unary_operator", {NEG, NOT, SIGN_EXTEND, \
2353 {"ip2k_unsigned_comparison_operator", {LTU, GTU, NE, \
2355 {"ip2k_signed_comparison_operator", {LT, GT, LE, GE}},
2357 #define DWARF2_DEBUGGING_INFO 1
2359 #define DWARF2_ASM_LINE_DEBUG_INFO 1
2361 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
2363 /* Miscellaneous macros to describe machine specifics. */
2365 #define IS_PSEUDO_P(R) (REGNO (R) >= FIRST_PSEUDO_REGISTER)
2367 /* Default calculations would cause DWARF address sizes to be 2 bytes,
2368 but the Harvard architecture of the IP2k and the word-addressed 64k
2369 of instruction memory causes us to want a 32-bit "address" field. */
2370 #undef DWARF2_ADDR_SIZE
2371 #define DWARF2_ADDR_SIZE 4