* Makefile.in (cse.o): Depend on TARGET_H.
[official-gcc.git] / gcc / config / ip2k / ip2k.h
blobc656e4a4becc58368d6f18b3aeeddc10901981a3
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)
12 any later version.
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 /* Set up System V.4 (aka ELF) defaults. */
27 #include "elfos.h"
28 #undef ASM_SPEC /* But we have a GAS assembler. */
30 #define CPP_PREDEFINES \
31 "-DIP2K -D_DOUBLE_IS_32BITS -D__BUFSIZ__=512 -D__FILENAME_MAX__=128"
32 /* Define this to be a string constant containing `-D' options to
33 define the predefined macros that identify this machine and system.
34 These macros will be predefined unless the `-ansi' option is
35 specified.
37 In addition, a parallel set of macros are predefined, whose names
38 are made by appending `__' at the beginning and at the end. These
39 `__' macros are permitted by the ANSI standard, so they are
40 predefined regardless of whether `-ansi' is specified.
42 For example, on the Sun, one can use the following value:
44 "-Dmc68000 -Dsun -Dunix"
46 The result is to define the macros `__mc68000__', `__sun__' and
47 `__unix__' unconditionally, and the macros `mc68000', `sun' and
48 `unix' provided `-ansi' is not specified. */
51 /* This declaration should be present. */
52 extern int target_flags;
54 /* `TARGET_...'
55 This series of macros is to allow compiler command arguments to
56 enable or disable the use of optional features of the target
57 machine. For example, one machine description serves both the
58 68000 and the 68020; a command argument tells the compiler whether
59 it should use 68020-only instructions or not. This command
60 argument works by means of a macro `TARGET_68020' that tests a bit
61 in `target_flags'.
63 Define a macro `TARGET_FEATURENAME' for each such option. Its
64 definition should test a bit in `target_flags'; for example:
66 #define TARGET_68020 (target_flags & 1)
68 One place where these macros are used is in the
69 condition-expressions of instruction patterns. Note how
70 `TARGET_68020' appears frequently in the 68000 machine description
71 file, `m68k.md'. Another place they are used is in the
72 definitions of the other macros in the `MACHINE.h' file. */
76 #define TARGET_SWITCHES {{"",0, NULL}}
77 /* This macro defines names of command options to set and clear bits
78 in `target_flags'. Its definition is an initializer with a
79 subgrouping for each command option.
81 Each subgrouping contains a string constant, that defines the
82 option name, and a number, which contains the bits to set in
83 `target_flags'. A negative number says to clear bits instead; the
84 negative of the number is which bits to clear. The actual option
85 name is made by appending `-m' to the specified name.
87 One of the subgroupings should have a null string. The number in
88 this grouping is the default value for `target_flags'. Any target
89 options act starting with that value.
91 Here is an example which defines `-m68000' and `-m68020' with
92 opposite meanings, and picks the latter as the default:
94 #define TARGET_SWITCHES \
95 { { "68020", 1}, \
96 { "68000", -1}, \
97 { "", 1}} */
100 /* This macro is similar to `TARGET_SWITCHES' but defines names of
101 command options that have values. Its definition is an
102 initializer with a subgrouping for each command option.
104 Each subgrouping contains a string constant, that defines the
105 fixed part of the option name, and the address of a variable. The
106 variable, type `char *', is set to the variable part of the given
107 option if the fixed part matches. The actual option name is made
108 by appending `-m' to the specified name.
110 Here is an example which defines `-mshort-data-NUMBER'. If the
111 given option is `-mshort-data-512', the variable `m88k_short_data'
112 will be set to the string `"512"'.
114 extern char *m88k_short_data;
115 #define TARGET_OPTIONS \
116 { { "short-data-", &m88k_short_data } } */
118 #define TARGET_VERSION fprintf (stderr, " (ip2k, GNU assembler syntax)")
119 /* This macro is a C statement to print on `stderr' a string
120 describing the particular machine description choice. Every
121 machine description should define `TARGET_VERSION'. For example:
123 #ifdef MOTOROLA
124 #define TARGET_VERSION \
125 fprintf (stderr, " (68k, Motorola syntax)")
126 #else
127 #define TARGET_VERSION \
128 fprintf (stderr, " (68k, MIT syntax)")
129 #endif */
131 /* Caller-saves is not a win for the IP2K. Pretty much anywhere that
132 a register is permitted allows SP-relative addresses too.
134 This machine doesn't have PIC addressing modes, so disable that also. */
136 #define OVERRIDE_OPTIONS \
137 do { \
138 flag_caller_saves = 0; \
139 flag_pic = 0; \
140 } while (0)
142 /* `OVERRIDE_OPTIONS'
143 Sometimes certain combinations of command options do not make
144 sense on a particular target machine. You can define a macro
145 `OVERRIDE_OPTIONS' to take account of this. This macro, if
146 defined, is executed once just after all the command options have
147 been parsed.
149 Don't use this macro to turn on various extra optimizations for
150 `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
152 /* Put each function in its own section so that PAGE-instruction
153 relaxation can do its best. */
154 #define OPTIMIZATION_OPTIONS(LEVEL, SIZEFLAG) \
155 do { \
156 if ((LEVEL) || (SIZEFLAG)) \
157 flag_function_sections = 1; \
158 } while (0)
160 /* Define this if most significant byte of a word is the lowest numbered. */
161 #define BITS_BIG_ENDIAN 0
163 /* Define this if most significant byte of a word is the lowest numbered. */
164 #define BYTES_BIG_ENDIAN 1
166 /* Define this if most significant word of a multiword number is the lowest
167 numbered. */
168 #define WORDS_BIG_ENDIAN 1
170 /* Number of bits in an addressable storage unit. */
171 #define BITS_PER_UNIT 8
173 /* Width in bits of a "word", which is the contents of a machine register.
174 Note that this is not necessarily the width of data type `int'; */
175 #define BITS_PER_WORD 8
177 /* Width of a word, in units (bytes). */
178 #define UNITS_PER_WORD (BITS_PER_WORD / BITS_PER_UNIT)
180 /* Width in bits of a pointer.
181 See also the macro `Pmode' defined below. */
182 #define POINTER_SIZE 16
184 /* Maximum sized of reasonable data type DImode or Dfmode ... */
185 #define MAX_FIXED_MODE_SIZE 64
187 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
188 #define PARM_BOUNDARY 8
190 /* Allocation boundary (in *bits*) for the code of a function. */
191 #define FUNCTION_BOUNDARY 16
193 /* Alignment of field after `int : 0' in a structure. */
194 #define EMPTY_FIELD_BOUNDARY 8
196 /* No data type wants to be aligned rounder than this. */
198 #define BIGGEST_ALIGNMENT 8
200 #define STRICT_ALIGNMENT 0
202 #define PCC_BITFIELD_TYPE_MATTERS 1
204 /* A C expression for the size in bits of the type `int' on the
205 target machine. If you don't define this, the default is one word. */
206 #undef INT_TYPE_SIZE
207 #define INT_TYPE_SIZE 16
210 /* A C expression for the size in bits of the type `short' on the
211 target machine. If you don't define this, the default is half a
212 word. (If this would be less than one storage unit, it is rounded
213 up to one unit.) */
214 #undef SHORT_TYPE_SIZE
215 #define SHORT_TYPE_SIZE 16
217 /* A C expression for the size in bits of the type `long' on the
218 target machine. If you don't define this, the default is one word. */
219 #undef LONG_TYPE_SIZE
220 #define LONG_TYPE_SIZE 32
223 /* Maximum number for the size in bits of the type `long' on the
224 target machine. If this is undefined, the default is
225 `LONG_TYPE_SIZE'. Otherwise, it is the constant value that is the
226 largest value that `LONG_TYPE_SIZE' can have at run-time. This is
227 used in `cpp'. */
228 #define MAX_LONG_TYPE_SIZE 32
230 /* A C expression for the size in bits of the type `long long' on the
231 target machine. If you don't define this, the default is two
232 words. If you want to support GNU Ada on your machine, the value
233 of macro must be at least 64. */
234 #undef LONG_LONG_TYPE_SIZE
235 #define LONG_LONG_TYPE_SIZE 64
237 #undef CHAR_TYPE_SIZE
238 #define CHAR_TYPE_SIZE 8
239 /* A C expression for the size in bits of the type `char' on the
240 target machine. If you don't define this, the default is one
241 quarter of a word. (If this would be less than one storage unit,
242 it is rounded up to one unit.) */
244 #undef FLOAT_TYPE_SIZE
245 #define FLOAT_TYPE_SIZE 32
246 /* A C expression for the size in bits of the type `float' on the
247 target machine. If you don't define this, the default is one word. */
249 #undef DOUBLE_TYPE_SIZE
250 #define DOUBLE_TYPE_SIZE 32
251 /* A C expression for the size in bits of the type `double' on the
252 target machine. If you don't define this, the default is two
253 words. */
256 /* A C expression for the size in bits of the type `long double' on
257 the target machine. If you don't define this, the default is two
258 words. */
259 #undef LONG_DOUBLE_TYPE_SIZE
260 #define LONG_DOUBLE_TYPE_SIZE 32
262 #define DEFAULT_SIGNED_CHAR 1
263 /* An expression whose value is 1 or 0, according to whether the type
264 `char' should be signed or unsigned by default. The user can
265 always override this default with the options `-fsigned-char' and
266 `-funsigned-char'. */
268 /* #define DEFAULT_SHORT_ENUMS 1
269 This was the default for the IP2k but gcc has a bug (as of 17th May
270 2001) in the way that library calls to the memory checker functions
271 are issues that screws things up if an enum is not equivalent to
272 an int. */
273 /* `DEFAULT_SHORT_ENUMS'
274 A C expression to determine whether to give an `enum' type only as
275 many bytes as it takes to represent the range of possible values
276 of that type. A nonzero value means to do that; a zero value
277 means all `enum' types should be allocated like `int'.
279 If you don't define the macro, the default is 0. */
281 #define SIZE_TYPE "unsigned int"
282 /* A C expression for a string describing the name of the data type
283 to use for size values. The typedef name `size_t' is defined
284 using the contents of the string.
286 The string can contain more than one keyword. If so, separate
287 them with spaces, and write first any length keyword, then
288 `unsigned' if appropriate, and finally `int'. The string must
289 exactly match one of the data type names defined in the function
290 `init_decl_processing' in the file `c-decl.c'. You may not omit
291 `int' or change the order--that would cause the compiler to crash
292 on startup.
294 If you don't define this macro, the default is `"long unsigned
295 int"'. */
297 #define PTRDIFF_TYPE "int"
298 /* A C expression for a string describing the name of the data type
299 to use for the result of subtracting two pointers. The typedef
300 name `ptrdiff_t' is defined using the contents of the string. See
301 `SIZE_TYPE' above for more information.
303 If you don't define this macro, the default is `"long int"'. */
305 #undef WCHAR_TYPE
306 #define WCHAR_TYPE "int"
307 #undef WCHAR_TYPE_SIZE
308 #define WCHAR_TYPE_SIZE 16
309 /* A C expression for the size in bits of the data type for wide
310 characters. This is used in `cpp', which cannot make use of
311 `WCHAR_TYPE'. */
313 #define HARD_REG_SIZE (UNITS_PER_WORD)
314 /* Standard register usage.
316 for the IP2K, we are going to have a LOT of registers, but only some of them
317 are named. */
319 #define FIRST_PSEUDO_REGISTER (0x104) /* Skip over physical regs, VFP, AP. */
321 /* Number of hardware registers known to the compiler. They receive
322 numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first
323 pseudo register's number really is assigned the number
324 `FIRST_PSEUDO_REGISTER'. */
326 #define REG_IP 0x4
327 #define REG_IPH REG_IP
328 #define REG_IPL 0x5
330 #define REG_SP 0x6
331 #define REG_SPH REG_SP
332 #define REG_SPL 0x7
334 #define REG_PCH 0x8
335 #define REG_PCL 0x9
337 #define REG_W 0xa
338 #define REG_STATUS 0xb
340 #define REG_DP 0xc
341 #define REG_DPH REG_DP
342 #define REG_DPL 0xd
344 #define REG_MULH 0xf
346 #define REG_CALLH 0x7e /* Call-stack readout. */
347 #define REG_CALLL 0x7f
350 #define REG_RESULT 0x80 /* Result register (upto 8 bytes). */
351 #define REG_FP 0xfd /* 2 bytes for FRAME chain */
353 #define REG_ZERO 0xff /* Initialized to zero by runtime. */
355 #define REG_VFP 0x100 /* Virtual frame pointer. */
356 #define REG_AP 0x102 /* Virtual arg pointer. */
358 /* Status register bits. */
359 #define Z_FLAG 0x2
360 #define DC_FLAG 0x1
361 #define C_FLAG 0x0
363 #define FIXED_REGISTERS {\
364 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*/\
365 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*/\
366 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*/\
367 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*/\
368 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*/\
369 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*/\
370 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*/\
371 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*/\
372 1,1,1,1}
374 /* An initializer that says which registers are used for fixed
375 purposes all throughout the compiled code and are therefore not
376 available for general allocation. These would include the stack
377 pointer, the frame pointer (except on machines where that can be
378 used as a general register when no frame pointer is needed), the
379 program counter on machines where that is considered one of the
380 addressable registers, and any other numbered register with a
381 standard use.
383 This information is expressed as a sequence of numbers, separated
384 by commas and surrounded by braces. The Nth number is 1 if
385 register N is fixed, 0 otherwise.
387 The table initialized from this macro, and the table initialized by
388 the following one, may be overridden at run time either
389 automatically, by the actions of the macro
390 `CONDITIONAL_REGISTER_USAGE', or by the user with the command
391 options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. */
393 #define CALL_USED_REGISTERS { \
394 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*/\
395 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*/\
396 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*/\
397 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*/\
398 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*/\
399 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*/\
400 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*/\
401 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*/\
402 1,1,1,1}
404 /* Like `FIXED_REGISTERS' but has 1 for each register that is
405 clobbered (in general) by function calls as well as for fixed
406 registers. This macro therefore identifies the registers that are
407 not available for general allocation of values that must live
408 across function calls.
410 If a register has 0 in `CALL_USED_REGISTERS', the compiler
411 automatically saves it on function entry and restores it on
412 function exit, if the register is used within the function. */
414 #define NON_SAVING_SETJMP 0
415 /* If this macro is defined and has a nonzero value, it means that
416 `setjmp' and related functions fail to save the registers, or that
417 `longjmp' fails to restore them. To compensate, the compiler
418 avoids putting variables in registers in functions that use
419 `setjmp'. */
421 #define REG_ALLOC_ORDER { \
422 0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, \
423 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97, \
424 0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f, \
425 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, \
426 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7, \
427 0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf, \
428 0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7, \
429 0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf, \
430 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7, \
431 0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf, \
432 0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7, \
433 0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf, \
434 0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7, \
435 0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef, \
436 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7, \
437 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff, \
438 0x00,0x01,0x02,0x03,0x0c,0x0d,0x06,0x07, \
439 0x08,0x09,0x0a,0x0b,0x04,0x05,0x0e,0x0f, \
440 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, \
441 0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f, \
442 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27, \
443 0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f, \
444 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37, \
445 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, \
446 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47, \
447 0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f, \
448 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57, \
449 0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f, \
450 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67, \
451 0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, \
452 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77, \
453 0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f, \
454 0x100,0x101,0x102,0x103}
456 /* If defined, an initializer for a vector of integers, containing the
457 numbers of hard registers in the order in which GNU CC should
458 prefer to use them (from most preferred to least).
460 If this macro is not defined, registers are used lowest numbered
461 first (all else being equal).
463 One use of this macro is on machines where the highest numbered
464 registers must always be saved and the save-multiple-registers
465 instruction supports only sequences of consecutive registers. On
466 such machines, define `REG_ALLOC_ORDER' to be an initializer that
467 lists the highest numbered allocatable register first. */
469 #define ORDER_REGS_FOR_LOCAL_ALLOC ip2k_init_local_alloc (reg_alloc_order)
470 /* A C statement (sans semicolon) to choose the order in which to
471 allocate hard registers for pseudo-registers local to a basic
472 block.
474 Store the desired register order in the array `reg_alloc_order'.
475 Element 0 should be the register to allocate first; element 1, the
476 next register; and so on.
478 The macro body should not assume anything about the contents of
479 `reg_alloc_order' before execution of the macro.
481 On most machines, it is not necessary to define this macro. */
483 /* Are we allowed to rename registers? For some reason, regrename was
484 changing DP to IP (when it appeared in addresses like (plus:HI
485 (reg: DP) (const_int 37)) - and that's bad because IP doesn't
486 permit offsets! */
488 #define HARD_REGNO_RENAME_OK(REG, NREG) \
489 (((REG) == REG_DPH) ? 0 \
490 : ((REG) == REG_IPH) ? ((NREG) == REG_DPH) \
491 : (((NREG) == REG_IPL) || ((NREG) == REG_DPL)) ? 0 : 1)
493 #define HARD_REGNO_NREGS(REGNO, MODE) \
494 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
496 /* A C expression for the number of consecutive hard registers,
497 starting at register number REGNO, required to hold a value of mode
498 MODE.
500 On a machine where all registers are exactly one word, a suitable
501 definition of this macro is
503 #define HARD_REGNO_NREGS(REGNO, MODE) \
504 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
505 / UNITS_PER_WORD)) */
507 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
508 /* A C expression that is nonzero if it is permissible to store a
509 value of mode MODE in hard register number REGNO (or in several
510 registers starting with that one). For a machine where all
511 registers are equivalent, a suitable definition is
513 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
515 It is not necessary for this macro to check for the numbers of
516 fixed registers, because the allocation mechanism considers them
517 to be always occupied.
519 On some machines, double-precision values must be kept in even/odd
520 register pairs. The way to implement that is to define this macro
521 to reject odd register numbers for such modes.
523 The minimum requirement for a mode to be OK in a register is that
524 the `movMODE' instruction pattern support moves between the
525 register and any other hard register for which the mode is OK; and
526 that moving a value into the register and back out not alter it.
528 Since the same instruction used to move `SImode' will work for all
529 narrower integer modes, it is not necessary on any machine for
530 `HARD_REGNO_MODE_OK' to distinguish between these modes, provided
531 you define patterns `movhi', etc., to take advantage of this. This
532 is useful because of the interaction between `HARD_REGNO_MODE_OK'
533 and `MODES_TIEABLE_P'; it is very desirable for all integer modes
534 to be tieable.
536 Many machines have special registers for floating point arithmetic.
537 Often people assume that floating point machine modes are allowed
538 only in floating point registers. This is not true. Any
539 registers that can hold integers can safely *hold* a floating
540 point machine mode, whether or not floating arithmetic can be done
541 on it in those registers. Integer move instructions can be used
542 to move the values.
544 On some machines, though, the converse is true: fixed-point machine
545 modes may not go in floating registers. This is true if the
546 floating registers normalize any value stored in them, because
547 storing a non-floating value there would garble it. In this case,
548 `HARD_REGNO_MODE_OK' should reject fixed-point machine modes in
549 floating registers. But if the floating registers do not
550 automatically normalize, if you can store any bit pattern in one
551 and retrieve it unchanged without a trap, then any machine mode
552 may go in a floating register, so you can define this macro to say
555 The primary significance of special floating registers is rather
556 that they are the registers acceptable in floating point arithmetic
557 instructions. However, this is of no concern to
558 `HARD_REGNO_MODE_OK'. You handle it by writing the proper
559 constraints for those instructions.
561 On some machines, the floating registers are especially slow to
562 access, so that it is better to store a value in a stack frame
563 than in such a register if floating point arithmetic is not being
564 done. As long as the floating registers are not in class
565 `GENERAL_REGS', they will not be used unless some pattern's
566 constraint asks for one. */
568 #define MODES_TIEABLE_P(MODE1, MODE2) \
569 (((MODE1) == QImode && (MODE2) == HImode) \
570 || ((MODE2) == QImode && (MODE1) == HImode))
571 /* We originally had this as follows - this isn't a win on the IP2k
572 though as registers just get in our way!
574 #define MODES_TIEABLE_P(MODE1, MODE2) \
575 (((MODE1) > HImode && (MODE2) == HImode)
576 || ((MODE1) == HImode && (MODE2) > HImode)) */
578 /* A C expression that is nonzero if it is desirable to choose
579 register allocation so as to avoid move instructions between a
580 value of mode MODE1 and a value of mode MODE2.
582 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
583 MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1,
584 MODE2)' must be zero. */
586 enum reg_class {
587 NO_REGS,
588 DPH_REGS,
589 DPL_REGS,
590 DP_REGS,
591 SP_REGS,
592 IPH_REGS,
593 IPL_REGS,
594 IP_REGS,
595 DP_SP_REGS,
596 PTR_REGS,
597 NONPTR_REGS,
598 NONSP_REGS,
599 GENERAL_REGS,
600 ALL_REGS = GENERAL_REGS,
601 LIM_REG_CLASSES
604 /* An enumeral type that must be defined with all the register class
605 names as enumeral values. `NO_REGS' must be first. `ALL_REGS'
606 must be the last register class, followed by one more enumeral
607 value, `LIM_REG_CLASSES', which is not a register class but rather
608 tells how many classes there are.
610 Each register class has a number, which is the value of casting
611 the class name to type `int'. The number serves as an index in
612 many of the tables described below. */
615 #define N_REG_CLASSES (int)LIM_REG_CLASSES
616 /* The number of distinct register classes, defined as follows:
618 #define N_REG_CLASSES (int) LIM_REG_CLASSES */
620 #define REG_CLASS_NAMES { \
621 "NO_REGS", \
622 "DPH_REGS", \
623 "DPL_REGS", \
624 "DP_REGS", \
625 "SP_REGS", \
626 "IPH_REGS", \
627 "IPL_REGS", \
628 "IP_REGS", \
629 "DP_SP_REGS", \
630 "PTR_REGS", \
631 "NONPTR_REGS", \
632 "NONSP_REGS", \
633 "GENERAL_REGS" \
635 /* An initializer containing the names of the register classes as C
636 string constants. These names are used in writing some of the
637 debugging dumps. */
640 #define REG_CLASS_CONTENTS { \
641 {0x00000000, 0, 0, 0, 0, 0, 0, 0, 0}, /* NO_REGS */ \
642 {0x00001000, 0, 0, 0, 0, 0, 0, 0, 0}, /* DPH_REGS */ \
643 {0x00002000, 0, 0, 0, 0, 0, 0, 0, 0}, /* DPL_REGS */ \
644 {0x00003000, 0, 0, 0, 0, 0, 0, 0, 0}, /* DP_REGS */ \
645 {0x000000c0, 0, 0, 0, 0, 0, 0, 0, 0}, /* SP_REGS */ \
646 {0x00000010, 0, 0, 0, 0, 0, 0, 0, 0}, /* IPH_REGS */ \
647 {0x00000020, 0, 0, 0, 0, 0, 0, 0, 0}, /* IPL_REGS */ \
648 {0x00000030, 0, 0, 0, 0, 0, 0, 0, 0}, /* IP_REGS */ \
649 {0x000030c0, 0, 0, 0, 0, 0, 0, 0, 0}, /* DP_SP_REGS */ \
650 {0x000030f0, 0, 0, 0, 0, 0, 0, 0, 0}, /* PTR_REGS */ \
651 {0xffffcf0f,-1,-1,-1,-1,-1,-1,-1, 0}, /* NONPTR_REGS */ \
652 {0xffffff3f,-1,-1,-1,-1,-1,-1,-1, 0}, /* NONSP_REGS */ \
653 {0xffffffff,-1,-1,-1,-1,-1,-1,-1,15} /* GENERAL_REGS */ \
656 /* An initializer containing the contents of the register classes, as
657 integers which are bit masks. The Nth integer specifies the
658 contents of class N. The way the integer MASK is interpreted is
659 that register R is in the class if `MASK & (1 << R)' is 1.
661 When the machine has more than 32 registers, an integer does not
662 suffice. Then the integers are replaced by sub-initializers,
663 braced groupings containing several integers. Each
664 sub-initializer must be suitable as an initializer for the type
665 `HARD_REG_SET' which is defined in `hard-reg-set.h'. */
667 #define REGNO_REG_CLASS(R) \
668 ( (R) == REG_IPH ? IPH_REGS \
669 : (R) == REG_IPL ? IPL_REGS \
670 : (R) == REG_DPH ? DPH_REGS \
671 : (R) == REG_DPL ? DPL_REGS \
672 : (R) == REG_SPH ? SP_REGS \
673 : (R) == REG_SPL ? SP_REGS \
674 : NONPTR_REGS)
676 /* A C expression whose value is a register class containing hard
677 register REGNO. In general there is more than one such class;
678 choose a class which is "minimal", meaning that no smaller class
679 also contains the register. */
681 #define MODE_BASE_REG_CLASS(MODE) ((MODE) == QImode ? PTR_REGS : DP_SP_REGS)
682 /* This is a variation of the BASE_REG_CLASS macro which allows
683 the selection of a base register in a mode dependent manner.
684 If MODE is VOIDmode then it should return the same value as
685 BASE_REG_CLASS. */
687 #define BASE_REG_CLASS PTR_REGS
688 /* A macro whose definition is the name of the class to which a valid
689 base register must belong. A base register is one used in an
690 address which is the register value plus a displacement. */
692 #define INDEX_REG_CLASS NO_REGS
693 /* A macro whose definition is the name of the class to which a valid
694 index register must belong. An index register is one used in an
695 address where its value is either multiplied by a scale factor or
696 added to another register (as well as added to a displacement). */
699 #define REG_CLASS_FROM_LETTER(C) \
700 ( (C) == 'j' ? IPH_REGS \
701 : (C) == 'k' ? IPL_REGS \
702 : (C) == 'f' ? IP_REGS \
703 : (C) == 'y' ? DPH_REGS \
704 : (C) == 'z' ? DPL_REGS \
705 : (C) == 'b' ? DP_REGS \
706 : (C) == 'u' ? NONSP_REGS \
707 : (C) == 'q' ? SP_REGS \
708 : (C) == 'c' ? DP_SP_REGS \
709 : (C) == 'a' ? PTR_REGS \
710 : (C) == 'd' ? NONPTR_REGS \
711 : NO_REGS)
713 /* A C expression which defines the machine-dependent operand
714 constraint letters for register classes. If CHAR is such a
715 letter, the value should be the register class corresponding to
716 it. Otherwise, the value should be `NO_REGS'. The register
717 letter `r', corresponding to class `GENERAL_REGS', will not be
718 passed to this macro; you do not need to handle it. */
721 #define REGNO_OK_FOR_BASE_P(R) \
722 ((R) == REG_DP || (R) == REG_IP || (R) == REG_SP)
723 /* A C expression which is nonzero if register number R is suitable
724 for use as a base register in operand addresses. It may be either
725 a suitable hard register or a pseudo register that has been
726 allocated such a hard register. */
728 #define REGNO_MODE_OK_FOR_BASE_P(R,M) \
729 ((R) == REG_DP || (R) == REG_SP \
730 || ((R) == REG_IP && GET_MODE_SIZE (M) <= 1))
731 /* A C expression that is just like `REGNO_OK_FOR_BASE_P', except that
732 that expression may examine the mode of the memory reference in
733 MODE. You should define this macro if the mode of the memory
734 reference affects whether a register may be used as a base
735 register. If you define this macro, the compiler will use it
736 instead of `REGNO_OK_FOR_BASE_P'. */
738 #define REGNO_OK_FOR_INDEX_P(NUM) 0
739 /* A C expression which is nonzero if register number NUM is suitable
740 for use as an index register in operand addresses. It may be
741 either a suitable hard register or a pseudo register that has been
742 allocated such a hard register.
744 The difference between an index register and a base register is
745 that the index register may be scaled. If an address involves the
746 sum of two registers, neither one of them scaled, then either one
747 may be labeled the "base" and the other the "index"; but whichever
748 labeling is used must fit the machine's constraints of which
749 registers may serve in each capacity. The compiler will try both
750 labelings, looking for one that is valid, and will reload one or
751 both registers only if neither labeling works. */
753 #define PREFERRED_RELOAD_CLASS(X, CLASS) (CLASS)
754 /* A C expression that places additional restrictions on the register
755 class to use when it is necessary to copy value X into a register
756 in class CLASS. The value is a register class; perhaps CLASS, or
757 perhaps another, smaller class. On many machines, the following
758 definition is safe:
760 #define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
762 Sometimes returning a more restrictive class makes better code.
763 For example, on the 68000, when X is an integer constant that is
764 in range for a `moveq' instruction, the value of this macro is
765 always `DATA_REGS' as long as CLASS includes the data registers.
766 Requiring a data register guarantees that a `moveq' will be used.
768 If X is a `const_double', by returning `NO_REGS' you can force X
769 into a memory constant. This is useful on certain machines where
770 immediate floating values cannot be loaded into certain kinds of
771 registers. */
773 /* `PREFERRED_OUTPUT_RELOAD_CLASS (X, CLASS)'
774 Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of
775 input reloads. If you don't define this macro, the default is to
776 use CLASS, unchanged. */
778 /* `LIMIT_RELOAD_CLASS (MODE, CLASS)'
779 A C expression that places additional restrictions on the register
780 class to use when it is necessary to be able to hold a value of
781 mode MODE in a reload register for which class CLASS would
782 ordinarily be used.
784 Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when
785 there are certain modes that simply can't go in certain reload
786 classes.
788 The value is a register class; perhaps CLASS, or perhaps another,
789 smaller class.
791 Don't define this macro unless the target machine has limitations
792 which require the macro to do something nontrivial. */
794 /* SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X)
795 `SECONDARY_RELOAD_CLASS (CLASS, MODE, X)'
796 `SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)'
797 Many machines have some registers that cannot be copied directly
798 to or from memory or even from other types of registers. An
799 example is the `MQ' register, which on most machines, can only be
800 copied to or from general registers, but not memory. Some
801 machines allow copying all registers to and from memory, but
802 require a scratch register for stores to some memory locations
803 (e.g., those with symbolic address on the RT, and those with
804 certain symbolic address on the SPARC when compiling PIC). In
805 some cases, both an intermediate and a scratch register are
806 required.
808 You should define these macros to indicate to the reload phase
809 that it may need to allocate at least one register for a reload in
810 addition to the register to contain the data. Specifically, if
811 copying X to a register CLASS in MODE requires an intermediate
812 register, you should define `SECONDARY_INPUT_RELOAD_CLASS' to
813 return the largest register class all of whose registers can be
814 used as intermediate registers or scratch registers.
816 If copying a register CLASS in MODE to X requires an intermediate
817 or scratch register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be
818 defined to return the largest register class required. If the
819 requirements for input and output reloads are the same, the macro
820 `SECONDARY_RELOAD_CLASS' should be used instead of defining both
821 macros identically.
823 The values returned by these macros are often `GENERAL_REGS'.
824 Return `NO_REGS' if no spare register is needed; i.e., if X can be
825 directly copied to or from a register of CLASS in MODE without
826 requiring a scratch register. Do not define this macro if it
827 would always return `NO_REGS'.
829 If a scratch register is required (either with or without an
830 intermediate register), you should define patterns for
831 `reload_inM' or `reload_outM', as required (*note Standard
832 Names::.. These patterns, which will normally be implemented with
833 a `define_expand', should be similar to the `movM' patterns,
834 except that operand 2 is the scratch register.
836 Define constraints for the reload register and scratch register
837 that contain a single register class. If the original reload
838 register (whose class is CLASS) can meet the constraint given in
839 the pattern, the value returned by these macros is used for the
840 class of the scratch register. Otherwise, two additional reload
841 registers are required. Their classes are obtained from the
842 constraints in the insn pattern.
844 X might be a pseudo-register or a `subreg' of a pseudo-register,
845 which could either be in a hard register or in memory. Use
846 `true_regnum' to find out; it will return -1 if the pseudo is in
847 memory and the hard register number if it is in a register.
849 These macros should not be used in the case where a particular
850 class of registers can only be copied to memory and not to another
851 class of registers. In that case, secondary reload registers are
852 not needed and would not be helpful. Instead, a stack location
853 must be used to perform the copy and the `movM' pattern should use
854 memory as an intermediate storage. This case often occurs between
855 floating-point and general registers. */
857 /* `SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)'
858 Certain machines have the property that some registers cannot be
859 copied to some other registers without using memory. Define this
860 macro on those machines to be a C expression that is nonzero if
861 objects of mode M in registers of CLASS1 can only be copied to
862 registers of class CLASS2 by storing a register of CLASS1 into
863 memory and loading that memory location into a register of CLASS2.
865 Do not define this macro if its value would always be zero.
867 `SECONDARY_MEMORY_NEEDED_RTX (MODE)'
868 Normally when `SECONDARY_MEMORY_NEEDED' is defined, the compiler
869 allocates a stack slot for a memory location needed for register
870 copies. If this macro is defined, the compiler instead uses the
871 memory location defined by this macro.
873 Do not define this macro if you do not define
874 `SECONDARY_MEMORY_NEEDED'. */
876 #define SMALL_REGISTER_CLASSES 1
877 /* Normally the compiler avoids choosing registers that have been
878 explicitly mentioned in the rtl as spill registers (these
879 registers are normally those used to pass parameters and return
880 values). However, some machines have so few registers of certain
881 classes that there would not be enough registers to use as spill
882 registers if this were done.
884 Define `SMALL_REGISTER_CLASSES' to be an expression with a nonzero
885 value on these machines. When this macro has a nonzero value, the
886 compiler allows registers explicitly used in the rtl to be used as
887 spill registers but avoids extending the lifetime of these
888 registers.
890 It is always safe to define this macro with a nonzero value, but
891 if you unnecessarily define it, you will reduce the amount of
892 optimizations that can be performed in some cases. If you do not
893 define this macro with a nonzero value when it is required, the
894 compiler will run out of spill registers and print a fatal error
895 message. For most machines, you should not define this macro at
896 all. */
898 #define CLASS_LIKELY_SPILLED_P(CLASS) class_likely_spilled_p(CLASS)
899 /* A C expression whose value is nonzero if pseudos that have been
900 assigned to registers of class CLASS would likely be spilled
901 because registers of CLASS are needed for spill registers.
903 The default value of this macro returns 1 if CLASS has exactly one
904 register and zero otherwise. On most machines, this default
905 should be used. Only define this macro to some other expression
906 if pseudo allocated by `local-alloc.c' end up in memory because
907 their hard registers were needed for spill registers. If this
908 macro returns nonzero for those classes, those pseudos will only
909 be allocated by `global.c', which knows how to reallocate the
910 pseudo to another register. If there would not be another
911 register available for reallocation, you should not change the
912 definition of this macro since the only effect of such a
913 definition would be to slow down register allocation. */
915 #define CLASS_MAX_NREGS(CLASS, MODE) GET_MODE_SIZE (MODE)
916 /* A C expression for the maximum number of consecutive registers of
917 class CLASS needed to hold a value of mode MODE.
919 This is closely related to the macro `HARD_REGNO_NREGS'. In fact,
920 the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be
921 the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all
922 REGNO values in the class CLASS.
924 This macro helps control the handling of multiple-word values in
925 the reload pass. */
927 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
928 ((C) == 'I' ? (VALUE) >= -255 && (VALUE) <= -1 : \
929 (C) == 'J' ? (VALUE) >= 0 && (VALUE) <= 7 : \
930 (C) == 'K' ? (VALUE) >= 0 && (VALUE) <= 127 : \
931 (C) == 'L' ? (VALUE) > 0 && (VALUE) < 128: \
932 (C) == 'M' ? (VALUE) == -1: \
933 (C) == 'N' ? (VALUE) == 1: \
934 (C) == 'O' ? (VALUE) == 0: \
935 (C) == 'P' ? (VALUE) >= 0 && (VALUE) <= 255: \
938 /* A C expression that defines the machine-dependent operand
939 constraint letters (`I', `J', `K', ... `P') that specify
940 particular ranges of integer values. If C is one of those
941 letters, the expression should check that VALUE, an integer, is in
942 the appropriate range and return 1 if so, 0 otherwise. If C is
943 not one of those letters, the value should be 0 regardless of
944 VALUE. */
946 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
948 /* `CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)'
949 A C expression that defines the machine-dependent operand
950 constraint letters that specify particular ranges of
951 `const_double' values (`G' or `H').
953 If C is one of those letters, the expression should check that
954 VALUE, an RTX of code `const_double', is in the appropriate range
955 and return 1 if so, 0 otherwise. If C is not one of those
956 letters, the value should be 0 regardless of VALUE.
958 `const_double' is used for all floating-point constants and for
959 `DImode' fixed-point constants. A given letter can accept either
960 or both kinds of values. It can use `GET_MODE' to distinguish
961 between these kinds. */
963 #define EXTRA_CONSTRAINT(X, C) ip2k_extra_constraint (X, C)
965 /* A C expression that defines the optional machine-dependent
966 constraint letters (``Q', `R', `S', `T', `U') that can'
967 be used to segregate specific types of operands, usually memory
968 references, for the target machine. Normally this macro will not
969 be defined. If it is required for a particular target machine, it
970 should return 1 if VALUE corresponds to the operand type
971 represented by the constraint letter C. If C is not defined as an
972 extra constraint, the value returned should be 0 regardless of
973 VALUE.
975 For example, on the ROMP, load instructions cannot have their
976 output in r0 if the memory reference contains a symbolic address.
977 Constraint letter `Q' is defined as representing a memory address
978 that does *not* contain a symbolic address. An alternative is
979 specified with a `Q' constraint on the input and `r' on the
980 output. The next alternative specifies `m' on the input and a
981 register class that does not include r0 on the output. */
983 /* This is an undocumented variable which describes
984 how GCC will pop a data. */
985 #define STACK_POP_CODE PRE_INC
987 #define STACK_PUSH_CODE POST_DEC
988 /* This macro defines the operation used when something is pushed on
989 the stack. In RTL, a push operation will be `(set (mem
990 (STACK_PUSH_CODE (reg sp))) ...)'
992 The choices are `PRE_DEC', `POST_DEC', `PRE_INC', and `POST_INC'.
993 Which of these is correct depends on the stack direction and on
994 whether the stack pointer points to the last item on the stack or
995 whether it points to the space for the next item on the stack.
997 The default is `PRE_DEC' when `STACK_GROWS_DOWNWARD' is defined,
998 which is almost always right, and `PRE_INC' otherwise, which is
999 often wrong. */
1002 #define STACK_CHECK_BUILTIN 1
1003 /* Prologue code will do stack checking as necessary. */
1005 #define STARTING_FRAME_OFFSET (0)
1006 /* Offset from the frame pointer to the first local variable slot to
1007 be allocated.
1009 If `FRAME_GROWS_DOWNWARD', find the next slot's offset by
1010 subtracting the first slot's length from `STARTING_FRAME_OFFSET'.
1011 Otherwise, it is found by adding the length of the first slot to
1012 the value `STARTING_FRAME_OFFSET'. */
1014 #define FRAME_GROWS_DOWNWARD 1
1015 #define STACK_GROWS_DOWNWARD 1
1017 /* On IP2K arg pointer is virtual and resolves to either SP or FP
1018 after we've resolved what registers are saved (fp chain, return
1019 pc, etc. */
1021 #define FIRST_PARM_OFFSET(FUNDECL) 0
1022 /* Offset from the argument pointer register to the first argument's
1023 address. On some machines it may depend on the data type of the
1024 function.
1026 If `ARGS_GROW_DOWNWARD', this is the offset to the location above
1027 the first argument's address. */
1029 /* `STACK_DYNAMIC_OFFSET (FUNDECL)'
1030 Offset from the stack pointer register to an item dynamically
1031 allocated on the stack, e.g., by `alloca'.
1033 The default value for this macro is `STACK_POINTER_OFFSET' plus the
1034 length of the outgoing arguments. The default is correct for most
1035 machines. See `function.c' for details. */
1037 #define STACK_POINTER_OFFSET 1
1038 /* IP2K stack is post-decremented, so 0(sp) is address of open space
1039 and 1(sp) is offset to the location avobe the forst location at which
1040 outgoing arguments are placed. */
1042 #define STACK_BOUNDARY 8
1043 /* Define this macro if there is a guaranteed alignment for the stack
1044 pointer on this machine. The definition is a C expression for the
1045 desired alignment (measured in bits). This value is used as a
1046 default if PREFERRED_STACK_BOUNDARY is not defined. */
1048 #define STACK_POINTER_REGNUM REG_SP
1049 /* The register number of the stack pointer register, which must also
1050 be a fixed register according to `FIXED_REGISTERS'. On most
1051 machines, the hardware determines which register this is. */
1053 #define FRAME_POINTER_REGNUM REG_VFP
1054 /* The register number of the frame pointer register, which is used to
1055 access automatic variables in the stack frame. On some machines,
1056 the hardware determines which register this is. On other
1057 machines, you can choose any register you wish for this purpose. */
1059 #define HARD_FRAME_POINTER_REGNUM REG_FP
1061 #define ARG_POINTER_REGNUM REG_AP
1062 /* The register number of the arg pointer register, which is used to
1063 access the function's argument list. On some machines, this is
1064 the same as the frame pointer register. On some machines, the
1065 hardware determines which register this is. On other machines,
1066 you can choose any register you wish for this purpose. If this is
1067 not the same register as the frame pointer register, then you must
1068 mark it as a fixed register according to `FIXED_REGISTERS', or
1069 arrange to be able to eliminate it (*note Elimination::.). */
1071 /* We don't really want to support nested functions. But we'll crash
1072 in various testsuite tests if we don't at least define the register
1073 to contain the static chain. The return value register is about as
1074 bad a place as any for this. */
1076 #define STATIC_CHAIN_REGNUM REG_RESULT
1077 /* Register numbers used for passing a function's static chain
1078 pointer. If register windows are used, the register number as
1079 seen by the called function is `STATIC_CHAIN_INCOMING_REGNUM',
1080 while the register number as seen by the calling function is
1081 `STATIC_CHAIN_REGNUM'. If these registers are the same,
1082 `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
1084 The static chain register need not be a fixed register.
1086 If the static chain is passed in memory, these macros should not be
1087 defined; instead, the next two macros should be defined. */
1089 #define FRAME_POINTER_REQUIRED (!flag_omit_frame_pointer)
1090 /* A C expression which is nonzero if a function must have and use a
1091 frame pointer. This expression is evaluated in the reload pass.
1092 If its value is nonzero the function will have a frame pointer.
1094 The expression can in principle examine the current function and
1095 decide according to the facts, but on most machines the constant 0
1096 or the constant 1 suffices. Use 0 when the machine allows code to
1097 be generated with no frame pointer, and doing so saves some time
1098 or space. Use 1 when there is no possible advantage to avoiding a
1099 frame pointer.
1101 In certain cases, the compiler does not know how to produce valid
1102 code without a frame pointer. The compiler recognizes those cases
1103 and automatically gives the function a frame pointer regardless of
1104 what `FRAME_POINTER_REQUIRED' says. You don't need to worry about
1105 them.
1107 In a function that does not require a frame pointer, the frame
1108 pointer register can be allocated for ordinary usage, unless you
1109 mark it as a fixed register. See `FIXED_REGISTERS' for more
1110 information. */
1112 #define ELIMINABLE_REGS { \
1113 {ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1114 {ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
1115 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1116 {FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
1117 {HARD_FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1119 /* If defined, this macro specifies a table of register pairs used to
1120 eliminate unneeded registers that point into the stack frame. If
1121 it is not defined, the only elimination attempted by the compiler
1122 is to replace references to the frame pointer with references to
1123 the stack pointer.
1125 The definition of this macro is a list of structure
1126 initializations, each of which specifies an original and
1127 replacement register.
1129 On some machines, the position of the argument pointer is not
1130 known until the compilation is completed. In such a case, a
1131 separate hard register must be used for the argument pointer.
1132 This register can be eliminated by replacing it with either the
1133 frame pointer or the argument pointer, depending on whether or not
1134 the frame pointer has been eliminated.
1136 In this case, you might specify:
1137 #define ELIMINABLE_REGS \
1138 {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1139 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
1140 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
1142 Note that the elimination of the argument pointer with the stack
1143 pointer is specified first since that is the preferred elimination. */
1146 #define CAN_ELIMINATE(FROM, TO) \
1147 ((FROM) == HARD_FRAME_POINTER_REGNUM \
1148 ? (flag_omit_frame_pointer && !frame_pointer_needed) : 1)
1149 /* Don't eliminate FP unless we EXPLICITLY_ASKED */
1151 /* A C expression that returns nonzero if the compiler is allowed to
1152 try to replace register number FROM-REG with register number
1153 TO-REG. This macro need only be defined if `ELIMINABLE_REGS' is
1154 defined, and will usually be the constant 1, since most of the
1155 cases preventing register elimination are things that the compiler
1156 already knows about. */
1158 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1159 ((OFFSET) = ip2k_init_elim_offset ((FROM), (TO)))
1161 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
1162 specifies the initial difference between the specified pair of
1163 registers. This macro must be defined if `ELIMINABLE_REGS' is
1164 defined. */
1166 #define RETURN_ADDR_RTX(COUNT, X) \
1167 (((COUNT) == 0) ? gen_rtx_REG (HImode, REG_CALLH) : NULL_RTX)
1168 /* A C expression whose value is RTL representing the value of the
1169 return address for the frame COUNT steps up from the current
1170 frame, after the prologue. FRAMEADDR is the frame pointer of the
1171 COUNT frame, or the frame pointer of the COUNT - 1 frame if
1172 `RETURN_ADDR_IN_PREVIOUS_FRAME' is defined.
1174 The value of the expression must always be the correct address when
1175 COUNT is zero, but may be `NULL_RTX' if there is not way to
1176 determine the return address of other frames. */
1178 #define PUSH_ROUNDING(NPUSHED) (NPUSHED)
1179 /* A C expression that is the number of bytes actually pushed onto the
1180 stack when an instruction attempts to push NPUSHED bytes.
1182 If the target machine does not have a push instruction, do not
1183 define this macro. That directs GNU CC to use an alternate
1184 strategy: to allocate the entire argument block and then store the
1185 arguments into it.
1187 On some machines, the definition
1189 #define PUSH_ROUNDING(BYTES) (BYTES)
1191 will suffice. But on other machines, instructions that appear to
1192 push one byte actually push two bytes in an attempt to maintain
1193 alignment. Then the definition should be
1195 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1) */
1197 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
1198 ip2k_return_pops_args ((FUNDECL), (FUNTYPE), (SIZE))
1199 /* A C expression that should indicate the number of bytes of its own
1200 arguments that a function pops on returning, or 0 if the function
1201 pops no arguments and the caller must therefore pop them all after
1202 the function returns.
1204 FUNDECL is a C variable whose value is a tree node that describes
1205 the function in question. Normally it is a node of type
1206 `FUNCTION_DECL' that describes the declaration of the function.
1207 From this you can obtain the DECL_MACHINE_ATTRIBUTES of the
1208 function.
1210 FUNTYPE is a C variable whose value is a tree node that describes
1211 the function in question. Normally it is a node of type
1212 `FUNCTION_TYPE' that describes the data type of the function.
1213 From this it is possible to obtain the data types of the value and
1214 arguments (if known).
1216 When a call to a library function is being considered, FUNDECL
1217 will contain an identifier node for the library function. Thus, if
1218 you need to distinguish among various library functions, you can
1219 do so by their names. Note that "library function" in this
1220 context means a function used to perform arithmetic, whose name is
1221 known specially in the compiler and was not mentioned in the C
1222 code being compiled.
1224 STACK-SIZE is the number of bytes of arguments passed on the
1225 stack. If a variable number of bytes is passed, it is zero, and
1226 argument popping will always be the responsibility of the calling
1227 function.
1229 On the VAX, all functions always pop their arguments, so the
1230 definition of this macro is STACK-SIZE. On the 68000, using the
1231 standard calling convention, no functions pop their arguments, so
1232 the value of the macro is always 0 in this case. But an
1233 alternative calling convention is available in which functions
1234 that take a fixed number of arguments pop them but other functions
1235 (such as `printf') pop nothing (the caller pops all). When this
1236 convention is in use, FUNTYPE is examined to determine whether a
1237 function takes a fixed number of arguments. */
1239 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
1240 /* A C expression that controls whether a function argument is passed
1241 in a register, and which register.
1243 The arguments are CUM, which summarizes all the previous
1244 arguments; MODE, the machine mode of the argument; TYPE, the data
1245 type of the argument as a tree node or 0 if that is not known
1246 (which happens for C support library functions); and NAMED, which
1247 is 1 for an ordinary argument and 0 for nameless arguments that
1248 correspond to `...' in the called function's prototype.
1250 The value of the expression is usually either a `reg' RTX for the
1251 hard register in which to pass the argument, or zero to pass the
1252 argument on the stack.
1254 For machines like the VAX and 68000, where normally all arguments
1255 are pushed, zero suffices as a definition.
1257 The value of the expression can also be a `parallel' RTX. This is
1258 used when an argument is passed in multiple locations. The mode
1259 of the of the `parallel' should be the mode of the entire
1260 argument. The `parallel' holds any number of `expr_list' pairs;
1261 each one describes where part of the argument is passed. In each
1262 `expr_list', the first operand can be either a `reg' RTX for the
1263 hard register in which to pass this part of the argument, or zero
1264 to pass the argument on the stack. If this operand is a `reg',
1265 then the mode indicates how large this part of the argument is.
1266 The second operand of the `expr_list' is a `const_int' which gives
1267 the offset in bytes into the entire argument where this part
1268 starts.
1270 The usual way to make the ANSI library `stdarg.h' work on a machine
1271 where some arguments are usually passed in registers, is to cause
1272 nameless arguments to be passed on the stack instead. This is done
1273 by making `FUNCTION_ARG' return 0 whenever NAMED is 0.
1275 You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the
1276 definition of this macro to determine if this argument is of a
1277 type that must be passed in the stack. If `REG_PARM_STACK_SPACE'
1278 is not defined and `FUNCTION_ARG' returns nonzero for such an
1279 argument, the compiler will abort. If `REG_PARM_STACK_SPACE' is
1280 defined, the argument will be computed in the stack and then
1281 loaded into a register. */
1283 #define CUMULATIVE_ARGS int
1285 /* A C type for declaring a variable that is used as the first
1286 argument of `FUNCTION_ARG' and other related values. For some
1287 target machines, the type `int' suffices and can hold the number
1288 of bytes of argument so far.
1290 There is no need to record in `CUMULATIVE_ARGS' anything about the
1291 arguments that have been passed on the stack. The compiler has
1292 other variables to keep track of that. For target machines on
1293 which all arguments are passed on the stack, there is no need to
1294 store anything in `CUMULATIVE_ARGS'; however, the data structure
1295 must exist and should not be empty, so use `int'. */
1297 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
1298 ((CUM) = 0)
1300 /* A C statement (sans semicolon) for initializing the variable CUM
1301 for the state at the beginning of the argument list. The variable
1302 has type `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node
1303 for the data type of the function which will receive the args, or 0
1304 if the args are to a compiler support library function. The value
1305 of INDIRECT is nonzero when processing an indirect call, for
1306 example a call through a function pointer. The value of INDIRECT
1307 is zero for a call to an explicitly named function, a library
1308 function call, or when `INIT_CUMULATIVE_ARGS' is used to find
1309 arguments for the function being compiled.
1311 When processing a call to a compiler support library function,
1312 LIBNAME identifies which one. It is a `symbol_ref' rtx which
1313 contains the name of the function, as a string. LIBNAME is 0 when
1314 an ordinary C function call is being processed. Thus, each time
1315 this macro is called, either LIBNAME or FNTYPE is nonzero, but
1316 never both of them at once. */
1318 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)
1320 /* All arguments are passed on stack - do nothing here. */
1322 /* A C statement (sans semicolon) to update the summarizer variable
1323 CUM to advance past an argument in the argument list. The values
1324 MODE, TYPE and NAMED describe that argument. Once this is done,
1325 the variable CUM is suitable for analyzing the *following*
1326 argument with `FUNCTION_ARG', etc.
1328 This macro need not do anything if the argument in question was
1329 passed on the stack. The compiler knows how to track the amount
1330 of stack space used for arguments without any special help. */
1332 #define FUNCTION_ARG_REGNO_P(R) 0
1333 /* A C expression that is nonzero if REGNO is the number of a hard
1334 register in which function arguments are sometimes passed. This
1335 does *not* include implicit arguments such as the static chain and
1336 the structure-value address. On many machines, no registers can be
1337 used for this purpose since all function arguments are pushed on
1338 the stack. */
1340 #define FUNCTION_VALUE(VALTYPE, FUNC) \
1341 ((TYPE_MODE (VALTYPE) == QImode) \
1342 ? gen_rtx_REG (TYPE_MODE (VALTYPE), REG_RESULT + 1) \
1343 : gen_rtx_REG (TYPE_MODE (VALTYPE), REG_RESULT))
1345 /* Because functions returning 'char' actually widen to 'int', we have to
1346 use $81 as the return location if we think we only have a 'char'. */
1348 /* A C expression to create an RTX representing the place where a
1349 function returns a value of data type VALTYPE. VALTYPE is a tree
1350 node representing a data type. Write `TYPE_MODE (VALTYPE)' to get
1351 the machine mode used to represent that type. On many machines,
1352 only the mode is relevant. (Actually, on most machines, scalar
1353 values are returned in the same place regardless of mode).
1355 The value of the expression is usually a `reg' RTX for the hard
1356 register where the return value is stored. The value can also be a
1357 `parallel' RTX, if the return value is in multiple places. See
1358 `FUNCTION_ARG' for an explanation of the `parallel' form.
1360 If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same
1361 promotion rules specified in `PROMOTE_MODE' if VALTYPE is a scalar
1362 type.
1364 If the precise function being called is known, FUNC is a tree node
1365 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
1366 makes it possible to use a different value-returning convention
1367 for specific functions when all their calls are known.
1369 `FUNCTION_VALUE' is not used for return vales with aggregate data
1370 types, because these are returned in another way. See
1371 `STRUCT_VALUE_REGNUM' and related macros, below. */
1373 #define LIBCALL_VALUE(MODE) gen_rtx_REG ((MODE), REG_RESULT)
1374 /* A C expression to create an RTX representing the place where a
1375 library function returns a value of mode MODE. If the precise
1376 function being called is known, FUNC is a tree node
1377 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
1378 makes it possible to use a different value-returning convention
1379 for specific functions when all their calls are known.
1381 Note that "library function" in this context means a compiler
1382 support routine, used to perform arithmetic, whose name is known
1383 specially by the compiler and was not mentioned in the C code being
1384 compiled.
1386 The definition of `LIBRARY_VALUE' need not be concerned aggregate
1387 data types, because none of the library functions returns such
1388 types. */
1390 #define FUNCTION_VALUE_REGNO_P(N) ((N) == REG_RESULT)
1391 /* A C expression that is nonzero if REGNO is the number of a hard
1392 register in which the values of called function may come back.
1394 A register whose use for returning values is limited to serving as
1395 the second of a pair (for a value of type `double', say) need not
1396 be recognized by this macro. So for most machines, this definition
1397 suffices:
1399 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
1401 If the machine has register windows, so that the caller and the
1402 called function use different registers for the return value, this
1403 macro should recognize only the caller's register numbers. */
1405 #define RETURN_IN_MEMORY(TYPE) \
1406 ((TYPE_MODE (TYPE) == BLKmode) ? int_size_in_bytes (TYPE) > 8 : 0)
1407 /* A C expression which can inhibit the returning of certain function
1408 values in registers, based on the type of value. A nonzero value
1409 says to return the function value in memory, just as large
1410 structures are always returned. Here TYPE will be a C expression
1411 of type `tree', representing the data type of the value.
1413 Note that values of mode `BLKmode' must be explicitly handled by
1414 this macro. Also, the option `-fpcc-struct-return' takes effect
1415 regardless of this macro. On most systems, it is possible to
1416 leave the macro undefined; this causes a default definition to be
1417 used, whose value is the constant 1 for `BLKmode' values, and 0
1418 otherwise.
1420 Do not use this macro to indicate that structures and unions
1421 should always be returned in memory. You should instead use
1422 `DEFAULT_PCC_STRUCT_RETURN' to indicate this. */
1424 /* Indicate that large structures are passed by reference. */
1425 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM,MODE,TYPE,NAMED) 0
1428 #define DEFAULT_PCC_STRUCT_RETURN 0
1429 /* Define this macro to be 1 if all structure and union return values
1430 must be in memory. Since this results in slower code, this should
1431 be defined only if needed for compatibility with other compilers
1432 or with an ABI. If you define this macro to be 0, then the
1433 conventions used for structure and union return values are decided
1434 by the `RETURN_IN_MEMORY' macro.
1436 If not defined, this defaults to the value 1. */
1438 #define STRUCT_VALUE 0
1439 /* If the structure value address is not passed in a register, define
1440 `STRUCT_VALUE' as an expression returning an RTX for the place
1441 where the address is passed. If it returns 0, the address is
1442 passed as an "invisible" first argument. */
1444 #define STRUCT_VALUE_INCOMING 0
1445 /* If the incoming location is not a register, then you should define
1446 `STRUCT_VALUE_INCOMING' as an expression for an RTX for where the
1447 called function should find the value. If it should find the
1448 value on the stack, define this to create a `mem' which refers to
1449 the frame pointer. A definition of 0 means that the address is
1450 passed as an "invisible" first argument. */
1452 #define EPILOGUE_USES(REGNO) 0
1453 /* Define this macro as a C expression that is nonzero for registers
1454 are used by the epilogue or the `return' pattern. The stack and
1455 frame pointer registers are already be assumed to be used as
1456 needed. */
1458 #define SETUP_INCOMING_VARARGS(ARGS_SO_FAR,MODE,TYPE, \
1459 PRETEND_ARGS_SIZE,SECOND_TIME) \
1460 ((PRETEND_ARGS_SIZE) = (0))
1463 /* Hmmm. We don't actually like constants as addresses - they always need
1464 to be loaded to a register, except for function calls which take an
1465 address by immediate value. But changing this to zero had negative
1466 effects, causing the compiler to get very confused.... */
1468 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
1470 /* A C expression that is 1 if the RTX X is a constant which is a
1471 valid address. On most machines, this can be defined as
1472 `CONSTANT_P (X)', but a few machines are more restrictive in which
1473 constant addresses are supported.
1475 `CONSTANT_P' accepts integer-values expressions whose values are
1476 not explicitly known, such as `symbol_ref', `label_ref', and
1477 `high' expressions and `const' arithmetic expressions, in addition
1478 to `const_int' and `const_double' expressions. */
1480 #define MAX_REGS_PER_ADDRESS 1
1481 /* A number, the maximum number of registers that can appear in a
1482 valid memory address. Note that it is up to you to specify a
1483 value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS'
1484 would ever accept. */
1486 #ifdef REG_OK_STRICT
1487 # define GO_IF_LEGITIMATE_ADDRESS(MODE, OPERAND, ADDR) \
1489 if (legitimate_address_p ((MODE), (OPERAND), 1)) \
1490 goto ADDR; \
1492 #else
1493 # define GO_IF_LEGITIMATE_ADDRESS(MODE, OPERAND, ADDR) \
1495 if (legitimate_address_p ((MODE), (OPERAND), 0)) \
1496 goto ADDR; \
1498 #endif
1499 /* A C compound statement with a conditional `goto LABEL;' executed
1500 if X (an RTX) is a legitimate memory address on the target machine
1501 for a memory operand of mode MODE.
1503 It usually pays to define several simpler macros to serve as
1504 subroutines for this one. Otherwise it may be too complicated to
1505 understand.
1507 This macro must exist in two variants: a strict variant and a
1508 non-strict one. The strict variant is used in the reload pass. It
1509 must be defined so that any pseudo-register that has not been
1510 allocated a hard register is considered a memory reference. In
1511 contexts where some kind of register is required, a pseudo-register
1512 with no hard register must be rejected.
1514 The non-strict variant is used in other passes. It must be
1515 defined to accept all pseudo-registers in every context where some
1516 kind of register is required.
1518 Compiler source files that want to use the strict variant of this
1519 macro define the macro `REG_OK_STRICT'. You should use an `#ifdef
1520 REG_OK_STRICT' conditional to define the strict variant in that
1521 case and the non-strict variant otherwise.
1523 Subroutines to check for acceptable registers for various purposes
1524 (one for base registers, one for index registers, and so on) are
1525 typically among the subroutines used to define
1526 `GO_IF_LEGITIMATE_ADDRESS'. Then only these subroutine macros
1527 need have two variants; the higher levels of macros may be the
1528 same whether strict or not.
1530 Normally, constant addresses which are the sum of a `symbol_ref'
1531 and an integer are stored inside a `const' RTX to mark them as
1532 constant. Therefore, there is no need to recognize such sums
1533 specifically as legitimate addresses. Normally you would simply
1534 recognize any `const' as legitimate.
1536 Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant
1537 sums that are not marked with `const'. It assumes that a naked
1538 `plus' indicates indexing. If so, then you *must* reject such
1539 naked constant sums as illegitimate addresses, so that none of
1540 them will be given to `PRINT_OPERAND_ADDRESS'.
1542 On some machines, whether a symbolic address is legitimate depends
1543 on the section that the address refers to. On these machines,
1544 define the macro `ENCODE_SECTION_INFO' to store the information
1545 into the `symbol_ref', and then check for it here. When you see a
1546 `const', you will have to look inside it to find the `symbol_ref'
1547 in order to determine the section. *Note Assembler Format::.
1549 The best way to modify the name string is by adding text to the
1550 beginning, with suitable punctuation to prevent any ambiguity.
1551 Allocate the new name in `saveable_obstack'. You will have to
1552 modify `ASM_OUTPUT_LABELREF' to remove and decode the added text
1553 and output the name accordingly, and define `STRIP_NAME_ENCODING'
1554 to access the original name string.
1556 You can check the information stored here into the `symbol_ref' in
1557 the definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and
1558 `PRINT_OPERAND_ADDRESS'. */
1560 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is
1561 valid for use as a base register. For hard registers, it should
1562 always accept those which the hardware permits and reject the
1563 others. Whether the macro accepts or rejects pseudo registers
1564 must be controlled by `REG_OK_STRICT' as described above. This
1565 usually requires two variant definitions, of which `REG_OK_STRICT'
1566 controls the one actually used. */
1568 #define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
1570 #define REG_OK_FOR_BASE_NOSTRICT_P(X) \
1571 (REGNO (X) >= FIRST_PSEUDO_REGISTER \
1572 || (REGNO (X) == REG_FP) \
1573 || (REGNO (X) == REG_VFP) \
1574 || (REGNO (X) == REG_AP) \
1575 || REG_OK_FOR_BASE_STRICT_P(X))
1577 #ifdef REG_OK_STRICT
1578 # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X)
1579 #else
1580 # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NOSTRICT_P (X)
1581 #endif
1583 #define REG_OK_FOR_INDEX_P(X) 0
1584 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is
1585 valid for use as an index register.
1587 The difference between an index register and a base register is
1588 that the index register may be scaled. If an address involves the
1589 sum of two registers, neither one of them scaled, then either one
1590 may be labeled the "base" and the other the "index"; but whichever
1591 labeling is used must fit the machine's constraints of which
1592 registers may serve in each capacity. The compiler will try both
1593 labelings, looking for one that is valid, and will reload one or
1594 both registers only if neither labeling works. */
1597 /* A C compound statement that attempts to replace X with a valid
1598 memory address for an operand of mode MODE. WIN will be a C
1599 statement label elsewhere in the code; the macro definition may use
1601 GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
1603 to avoid further processing if the address has become legitimate.
1605 X will always be the result of a call to `break_out_memory_refs',
1606 and OLDX will be the operand that was given to that function to
1607 produce X.
1609 The code generated by this macro should not alter the substructure
1610 of X. If it transforms X into a more legitimate form, it should
1611 assign X (which will always be a C variable) a new value.
1613 It is not necessary for this macro to come up with a legitimate
1614 address. The compiler has standard ways of doing so in all cases.
1615 In fact, it is safe for this macro to do nothing. But often a
1616 machine-dependent strategy can generate better code. */
1618 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
1619 do { rtx orig_x = (X); \
1620 (X) = legitimize_address ((X), (OLDX), (MODE), 0); \
1621 if ((X) != orig_x && memory_address_p ((MODE), (X))) \
1622 goto WIN; \
1623 } while (0)
1625 /* Is X a legitimate register to reload, or is it a pseudo stack-temp
1626 that is problematic for push_reload() ? */
1628 #define LRA_REG(X) \
1629 (! (reg_equiv_memory_loc[REGNO (X)] \
1630 && (reg_equiv_address[REGNO (X)] \
1631 || num_not_at_initial_offset)))
1633 /* Given a register X that failed the LRA_REG test, replace X
1634 by its memory equivalent, find the reloads needed for THAT memory
1635 location and substitute that back for the higher-level reload
1636 that we're conducting... */
1638 /* WARNING: we reference 'ind_levels' and 'insn' which are local variables
1639 in find_reloads_address (), where the LEGITIMIZE_RELOAD_ADDRESS macro
1640 expands. */
1642 #define FRA_REG(X,MODE,OPNUM,TYPE) \
1643 do { \
1644 rtx tem = make_memloc ((X), REGNO (X)); \
1646 if (! strict_memory_address_p (GET_MODE (tem), XEXP (tem, 0))) \
1648 /* Note that we're doing address in address - cf. ADDR_TYPE */ \
1649 find_reloads_address (GET_MODE (tem), &tem, XEXP (tem, 0), \
1650 &XEXP (tem, 0), (OPNUM), \
1651 ADDR_TYPE (TYPE), ind_levels, insn); \
1653 (X) = tem; \
1654 } while (0)
1657 /* For the IP2K, we want to be clever about picking IP vs DP for a
1658 base pointer since IP only directly supports a zero displacement.
1659 (Note that we have modified all the HI patterns to correctly handle
1660 IP references by manipulating iph:ipl as we fetch the pieces). */
1661 #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND,WIN) \
1663 if (GET_CODE (X) == PLUS \
1664 && REG_P (XEXP (X, 0)) \
1665 && GET_CODE (XEXP (X, 1)) == CONST_INT) \
1667 int disp = INTVAL (XEXP (X, 1)); \
1668 int fit = (disp >= 0 && disp <= (127 - 2 * GET_MODE_SIZE (MODE))); \
1669 rtx reg = XEXP (X, 0); \
1670 if (!fit) \
1672 push_reload ((X), NULL_RTX, &(X), \
1673 NULL, MODE_BASE_REG_CLASS (MODE), GET_MODE (X), \
1674 VOIDmode, 0, 0, OPNUM, TYPE); \
1675 goto WIN; \
1677 if (reg_equiv_memory_loc[REGNO (reg)] \
1678 && (reg_equiv_address[REGNO (reg)] || num_not_at_initial_offset)) \
1680 rtx mem = make_memloc (reg, REGNO (reg)); \
1681 if (! strict_memory_address_p (GET_MODE (mem), XEXP (mem, 0))) \
1683 /* Note that we're doing address in address - cf. ADDR_TYPE */\
1684 find_reloads_address (GET_MODE (mem), &mem, XEXP (mem, 0), \
1685 &XEXP (mem, 0), (OPNUM), \
1686 ADDR_TYPE (TYPE), (IND), insn); \
1688 push_reload (mem, NULL, &XEXP (X, 0), NULL, \
1689 GENERAL_REGS, Pmode, VOIDmode, 0, 0, \
1690 OPNUM, TYPE); \
1691 push_reload (X, NULL, &X, NULL, \
1692 MODE_BASE_REG_CLASS (MODE), GET_MODE (X), VOIDmode, \
1693 0, 0, OPNUM, TYPE); \
1694 goto WIN; \
1698 /* A C compound statement that attempts to replace X, which is an
1699 address that needs reloading, with a valid memory address for an
1700 operand of mode MODE. WIN will be a C statement label elsewhere
1701 in the code. It is not necessary to define this macro, but it
1702 might be useful for performance reasons.
1704 For example, on the i386, it is sometimes possible to use a single
1705 reload register instead of two by reloading a sum of two pseudo
1706 registers into a register. On the other hand, for number of RISC
1707 processors offsets are limited so that often an intermediate
1708 address needs to be generated in order to address a stack slot.
1709 By defining LEGITIMIZE_RELOAD_ADDRESS appropriately, the
1710 intermediate addresses generated for adjacent some stack slots can
1711 be made identical, and thus be shared.
1713 *Note*: This macro should be used with caution. It is necessary
1714 to know something of how reload works in order to effectively use
1715 this, and it is quite easy to produce macros that build in too
1716 much knowledge of reload internals.
1718 *Note*: This macro must be able to reload an address created by a
1719 previous invocation of this macro. If it fails to handle such
1720 addresses then the compiler may generate incorrect code or abort.
1722 The macro definition should use `push_reload' to indicate parts
1723 that need reloading; OPNUM, TYPE and IND_LEVELS are usually
1724 suitable to be passed unaltered to `push_reload'.
1726 The code generated by this macro must not alter the substructure of
1727 X. If it transforms X into a more legitimate form, it should
1728 assign X (which will always be a C variable) a new value. This
1729 also applies to parts that you change indirectly by calling
1730 `push_reload'.
1732 The macro definition may use `strict_memory_address_p' to test if
1733 the address has become legitimate.
1735 If you want to change only a part of X, one standard way of doing
1736 this is to use `copy_rtx'. Note, however, that is unshares only a
1737 single level of rtl. Thus, if the part to be changed is not at the
1738 top level, you'll need to replace first the top leve It is not
1739 necessary for this macro to come up with a legitimate address;
1740 but often a machine-dependent strategy can generate better code. */
1742 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
1743 do { \
1744 if (ip2k_mode_dependent_address (ADDR)) goto LABEL; \
1745 } while (0)
1747 /* A C statement or compound statement with a conditional `goto
1748 LABEL;' executed if memory address X (an RTX) can have different
1749 meanings depending on the machine mode of the memory reference it
1750 is used for or if the address is valid for some modes but not
1751 others.
1753 Autoincrement and autodecrement addresses typically have
1754 mode-dependent effects because the amount of the increment or
1755 decrement is the size of the operand being addressed. Some
1756 machines have other mode-dependent addresses. Many RISC machines
1757 have no mode-dependent addresses.
1759 You may assume that ADDR is a valid address for the machine. */
1761 #define LEGITIMATE_CONSTANT_P(X) 1
1762 /* A C expression that is nonzero if X is a legitimate constant for
1763 an immediate operand on the target machine. You can assume that X
1764 satisfies `CONSTANT_P', so you need not check this. In fact, `1'
1765 is a suitable definition for this macro on machines where anything
1766 `CONSTANT_P' is valid. */
1768 #define ADDRESS_COST(ADDRESS) ip2k_address_cost (ADDRESS)
1770 /* An expression giving the cost of an addressing mode that contains
1771 ADDRESS. If not defined, the cost is computed from the ADDRESS
1772 expression and the `CONST_COSTS' values.
1774 For most CISC machines, the default cost is a good approximation
1775 of the true cost of the addressing mode. However, on RISC
1776 machines, all instructions normally have the same length and
1777 execution time. Hence all addresses will have equal costs.
1779 In cases where more than one form of an address is known, the form
1780 with the lowest cost will be used. If multiple forms have the
1781 same, lowest, cost, the one that is the most complex will be used.
1783 For example, suppose an address that is equal to the sum of a
1784 register and a constant is used twice in the same basic block.
1785 When this macro is not defined, the address will be computed in a
1786 register and memory references will be indirect through that
1787 register. On machines where the cost of the addressing mode
1788 containing the sum is no higher than that of a simple indirect
1789 reference, this will produce an additional instruction and
1790 possibly require an additional register. Proper specification of
1791 this macro eliminates this overhead for such machines.
1793 Similar use of this macro is made in strength reduction of loops.
1795 ADDRESS need not be valid as an address. In such a case, the cost
1796 is not relevant and can be any value; invalid addresses need not be
1797 assigned a different cost.
1799 On machines where an address involving more than one register is as
1800 cheap as an address computation involving only one register,
1801 defining `ADDRESS_COST' to reflect this can cause two registers to
1802 be live over a region of code where only one would have been if
1803 `ADDRESS_COST' were not defined in that manner. This effect should
1804 be considered in the definition of this macro. Equivalent costs
1805 should probably only be given to addresses with different numbers
1806 of registers on machines with lots of registers.
1808 This macro will normally either not be defined or be defined as a
1809 constant. */
1811 #define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) 7
1812 /* A C expression for the cost of moving data from a register in class
1813 FROM to one in class TO. The classes are expressed using the
1814 enumeration values such as `GENERAL_REGS'. A value of 2 is the
1815 default; other values are interpreted relative to that.
1817 It is not required that the cost always equal 2 when FROM is the
1818 same as TO; on some machines it is expensive to move between
1819 registers if they are not general registers.
1821 If reload sees an insn consisting of a single `set' between two
1822 hard registers, and if `REGISTER_MOVE_COST' applied to their
1823 classes returns a value of 2, reload does not check to ensure that
1824 the constraints of the insn are met. Setting a cost of other than
1825 2 will allow reload to verify that the constraints are met. You
1826 should do this if the `movM' pattern's constraints do not allow
1827 such copying. */
1829 #define MEMORY_MOVE_COST(MODE,CLASS,IN) 6
1830 /* A C expression for the cost of moving data of mode M between a
1831 register and memory. A value of 4 is the default; this cost is
1832 relative to those in `REGISTER_MOVE_COST'.
1834 If moving between registers and memory is more expensive than
1835 between two registers, you should define this macro to express the
1836 relative cost. */
1838 #define SLOW_BYTE_ACCESS 0
1839 /* Define this macro as a C expression which is nonzero if accessing
1840 less than a word of memory (i.e. a `char' or a `short') is no
1841 faster than accessing a word of memory, i.e., if such access
1842 require more than one instruction or if there is no difference in
1843 cost between byte and (aligned) word loads.
1845 When this macro is not defined, the compiler will access a field by
1846 finding the smallest containing object; when it is defined, a
1847 fullword load will be used if alignment permits. Unless bytes
1848 accesses are faster than word accesses, using word accesses is
1849 preferable since it may eliminate subsequent memory access if
1850 subsequent accesses occur to other fields in the same word of the
1851 structure, but to different bytes.
1853 `SLOW_ZERO_EXTEND'
1854 Define this macro if zero-extension (of a `char' or `short' to an
1855 `int') can be done faster if the destination is a register that is
1856 known to be zero.
1858 If you define this macro, you must have instruction patterns that
1859 recognize RTL structures like this:
1861 (set (strict_low_part (subreg:QI (reg:SI ...) 0)) ...)
1863 and likewise for `HImode'.
1865 `SLOW_UNALIGNED_ACCESS'
1866 Define this macro to be the value 1 if unaligned accesses have a
1867 cost many times greater than aligned accesses, for example if they
1868 are emulated in a trap handler.
1870 When this macro is nonzero, the compiler will act as if
1871 `STRICT_ALIGNMENT' were nonzero when generating code for block
1872 moves. This can cause significantly more instructions to be
1873 produced. Therefore, do not set this macro nonzero if unaligned
1874 accesses only add a cycle or two to the time for a memory access.
1876 If the value of this macro is always zero, it need not be defined.
1878 `DONT_REDUCE_ADDR'
1879 Define this macro to inhibit strength reduction of memory
1880 addresses. (On some machines, such strength reduction seems to do
1881 harm rather than good.)
1883 `MOVE_RATIO'
1884 The number of scalar move insns which should be generated instead
1885 of a string move insn or a library call. Increasing the value
1886 will always make code faster, but eventually incurs high cost in
1887 increased code size.
1889 If you don't define this, a reasonable default is used. */
1891 #define NO_FUNCTION_CSE
1892 /* Define this macro if it is as good or better to call a constant
1893 function address than to call an address kept in a register. */
1895 #define NO_RECURSIVE_FUNCTION_CSE
1896 /* Define this macro if it is as good or better for a function to call
1897 itself with an explicit address than to call an address kept in a
1898 register.
1900 `ADJUST_COST (INSN, LINK, DEP_INSN, COST)'
1901 A C statement (sans semicolon) to update the integer variable COST
1902 based on the relationship between INSN that is dependent on
1903 DEP_INSN through the dependence LINK. The default is to make no
1904 adjustment to COST. This can be used for example to specify to
1905 the scheduler that an output- or anti-dependence does not incur
1906 the same cost as a data-dependence.
1908 `ADJUST_PRIORITY (INSN)'
1909 A C statement (sans semicolon) to update the integer scheduling
1910 priority `INSN_PRIORITY(INSN)'. Reduce the priority to execute
1911 the INSN earlier, increase the priority to execute INSN later.
1912 Do not define this macro if you do not need to adjust the
1913 scheduling priorities of insns. */
1915 #define TEXT_SECTION_ASM_OP ".text"
1916 /* A C expression whose value is a string containing the assembler
1917 operation that should precede instructions and read-only data.
1918 Normally `".text"' is right. */
1920 #define DATA_SECTION_ASM_OP ".data"
1921 /* A C expression whose value is a string containing the assembler
1922 operation to identify the following data as writable initialized
1923 data. Normally `".data"' is right. */
1925 #define JUMP_TABLES_IN_TEXT_SECTION 1
1926 /* Define this macro if jump tables (for `tablejump' insns) should be
1927 output in the text section, along with the assembler instructions.
1928 Otherwise, the readonly data section is used.
1930 This macro is irrelevant if there is no separate readonly data
1931 section. */
1933 #define ASM_COMMENT_START " ; "
1934 /* A C string constant describing how to begin a comment in the target
1935 assembler language. The compiler assumes that the comment will
1936 end at the end of the line. */
1938 #define ASM_APP_ON "/* #APP */\n"
1939 /* A C string constant for text to be output before each `asm'
1940 statement or group of consecutive ones. Normally this is
1941 `"#APP"', which is a comment that has no effect on most assemblers
1942 but tells the GNU assembler that it must check the lines that
1943 follow for all valid assembler constructs. */
1945 #define ASM_APP_OFF "/* #NOAPP */\n"
1946 /* A C string constant for text to be output after each `asm'
1947 statement or group of consecutive ones. Normally this is
1948 `"#NO_APP"', which tells the GNU assembler to resume making the
1949 time-saving assumptions that are valid for ordinary compiler
1950 output. */
1953 #define OBJC_PROLOGUE {}
1954 /* A C statement to output any assembler statements which are
1955 required to precede any Objective-C object definitions or message
1956 sending. The statement is executed only when compiling an
1957 Objective-C program. */
1959 #define ASM_OUTPUT_DOUBLE(STREAM, VALUE) \
1960 fprintf ((STREAM), ".double %.20e\n", (VALUE))
1961 #define ASM_OUTPUT_FLOAT(STREAM, VALUE) \
1962 asm_output_float ((STREAM), (VALUE))
1964 /* `ASM_OUTPUT_LONG_DOUBLE (STREAM, VALUE)'
1965 `ASM_OUTPUT_THREE_QUARTER_FLOAT (STREAM, VALUE)'
1966 `ASM_OUTPUT_SHORT_FLOAT (STREAM, VALUE)'
1967 `ASM_OUTPUT_BYTE_FLOAT (STREAM, VALUE)'
1968 A C statement to output to the stdio stream STREAM an assembler
1969 instruction to assemble a floating-point constant of `TFmode',
1970 `DFmode', `SFmode', `TQFmode', `HFmode', or `QFmode',
1971 respectively, whose value is VALUE. VALUE will be a C expression
1972 of type `REAL_VALUE_TYPE'. Macros such as
1973 `REAL_VALUE_TO_TARGET_DOUBLE' are useful for writing these
1974 definitions. */
1976 #define ASM_OUTPUT_INT(FILE, VALUE) \
1977 ( fprintf ((FILE), "\t.long "), \
1978 output_addr_const ((FILE), (VALUE)), \
1979 fputs ("\n", (FILE)))
1981 /* Likewise for `short' and `char' constants. */
1983 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
1984 asm_output_short ((FILE), (VALUE))
1985 #define ASM_OUTPUT_CHAR(FILE,VALUE) \
1986 asm_output_char ((FILE), (VALUE))
1988 /* `ASM_OUTPUT_QUADRUPLE_INT (STREAM, EXP)'
1989 A C statement to output to the stdio stream STREAM an assembler
1990 instruction to assemble an integer of 16, 8, 4, 2 or 1 bytes,
1991 respectively, whose value is VALUE. The argument EXP will be an
1992 RTL expression which represents a constant value. Use
1993 `output_addr_const (STREAM, EXP)' to output this value as an
1994 assembler expression.
1996 For sizes larger than `UNITS_PER_WORD', if the action of a macro
1997 would be identical to repeatedly calling the macro corresponding to
1998 a size of `UNITS_PER_WORD', once for each word, you need not define
1999 the macro. */
2001 #define ASM_OUTPUT_BYTE(FILE,VALUE) \
2002 asm_output_byte ((FILE), (VALUE))
2003 /* A C statement to output to the stdio stream STREAM an assembler
2004 instruction to assemble a single byte containing the number VALUE. */
2006 #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) \
2007 ((C) == '\n' || ((C) == '$'))
2008 /* Define this macro as a C expression which is nonzero if C is used
2009 as a logical line separator by the assembler.
2011 If you do not define this macro, the default is that only the
2012 character `;' is treated as a logical line separator. */
2014 #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
2015 do { \
2016 fputs ("\t.comm ", (STREAM)); \
2017 assemble_name ((STREAM), (NAME)); \
2018 fprintf ((STREAM), ",%d\n", (SIZE)); \
2019 } while (0)
2020 /* A C statement (sans semicolon) to output to the stdio stream
2021 STREAM the assembler definition of a common-label named NAME whose
2022 size is SIZE bytes. The variable ROUNDED is the size rounded up
2023 to whatever alignment the caller wants.
2025 Use the expression `assemble_name (STREAM, NAME)' to output the
2026 name itself; before and after that, output the additional
2027 assembler syntax for defining the name, and a newline.
2029 This macro controls how the assembler definitions of uninitialized
2030 common global variables are output. */
2032 #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) \
2033 do { \
2034 fputs ("\t.lcomm ", (STREAM)); \
2035 assemble_name ((STREAM), (NAME)); \
2036 fprintf ((STREAM), ",%d\n", (SIZE)); \
2037 } while (0)
2038 /* A C statement (sans semicolon) to output to the stdio stream
2039 STREAM the assembler definition of a local-common-label named NAME
2040 whose size is SIZE bytes. The variable ROUNDED is the size
2041 rounded up to whatever alignment the caller wants.
2043 Use the expression `assemble_name (STREAM, NAME)' to output the
2044 name itself; before and after that, output the additional
2045 assembler syntax for defining the name, and a newline.
2047 This macro controls how the assembler definitions of uninitialized
2048 static variables are output. */
2050 #undef WEAK_ASM_OP
2051 #define WEAK_ASM_OP ".weak"
2053 #undef ASM_DECLARE_FUNCTION_SIZE
2054 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
2055 do { \
2056 if (!flag_inhibit_size_directive) \
2057 ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
2058 } while (0)
2059 /* A C statement (sans semicolon) to output to the stdio stream
2060 STREAM any text necessary for declaring the size of a function
2061 which is being defined. The argument NAME is the name of the
2062 function. The argument DECL is the `FUNCTION_DECL' tree node
2063 representing the function.
2065 If this macro is not defined, then the function size is not
2066 defined. */
2068 #define ESCAPES \
2069 "\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\
2070 \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\
2071 \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\
2072 \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\
2073 \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\
2074 \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\
2075 \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\
2076 \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"
2077 /* A table of bytes codes used by the ASM_OUTPUT_ASCII and
2078 ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
2079 corresponds to a particular byte value [0..255]. For any
2080 given byte value, if the value in the corresponding table
2081 position is zero, the given character can be output directly.
2082 If the table value is 1, the byte must be output as a \ooo
2083 octal escape. If the tables value is anything else, then the
2084 byte value should be output as a \ followed by the value
2085 in the table. Note that we can use standard UN*X escape
2086 sequences for many control characters, but we don't use
2087 \a to represent BEL because some svr4 assemblers (e.g. on
2088 the i386) don't know about that. Also, we don't use \v
2089 since some versions of gas, such as 2.2 did not accept it. */
2091 /* Globalizing directive for a label. */
2092 #define GLOBAL_ASM_OP ".global\t"
2094 #define REGISTER_NAMES { \
2095 "$00","$01","$02","$03","iph","ipl","sph","spl", \
2096 "pch","pcl","wreg","status","dph","dpl","$0e","mulh", \
2097 "$10","$11","$12","$13","$14","$15","$16","$17", \
2098 "$18","$19","$1a","$1b","$1c","$1d","$1e","$1f", \
2099 "$20","$21","$22","$23","$24","$25","$26","$27", \
2100 "$28","$29","$2a","$2b","$2c","$2d","$2e","$2f", \
2101 "$30","$31","$32","$33","$34","$35","$36","$37", \
2102 "$38","$39","$3a","$3b","$3c","$3d","$3e","$3f", \
2103 "$40","$41","$42","$43","$44","$45","$46","$47", \
2104 "$48","$49","$4a","$4b","$4c","$4d","$4e","$4f", \
2105 "$50","$51","$52","$53","$54","$55","$56","$57", \
2106 "$58","$59","$5a","$5b","$5c","$5d","$5e","$5f", \
2107 "$60","$61","$62","$63","$64","$65","$66","$67", \
2108 "$68","$69","$6a","$6b","$6c","$6d","$6e","$6f", \
2109 "$70","$71","$72","$73","$74","$75","$76","$77", \
2110 "$78","$79","$7a","$7b","$7c","$7d","callh","calll", \
2111 "$80","$81","$82","$83","$84","$85","$86","$87", \
2112 "$88","$89","$8a","$8b","$8c","$8d","$8e","$8f", \
2113 "$90","$91","$92","$93","$94","$95","$96","$97", \
2114 "$98","$99","$9a","$9b","$9c","$9d","$9e","$9f", \
2115 "$a0","$a1","$a2","$a3","$a4","$a5","$a6","$a7", \
2116 "$a8","$a9","$aa","$ab","$ac","$ad","$ae","$af", \
2117 "$b0","$b1","$b2","$b3","$b4","$b5","$b6","$b7", \
2118 "$b8","$b9","$ba","$bb","$bc","$bd","$be","$bf", \
2119 "$c0","$c1","$c2","$c3","$c4","$c5","$c6","$c7", \
2120 "$c8","$c9","$ca","$cb","$cc","$cd","$ce","$cf", \
2121 "$d0","$d1","$d2","$d3","$d4","$d5","$d6","$d7", \
2122 "$d8","$d9","$da","$db","$dc","$dd","$de","$df", \
2123 "$e0","$e1","$e2","$e3","$e4","$e5","$e6","$e7", \
2124 "$e8","$e9","$ea","$eb","$ec","$ed","$ee","$ef", \
2125 "$f0","$f1","$f2","$f3","$f4","$f5","$f6","$f7", \
2126 "$f8","$f9","$fa","$fb","$fc","$fd","$fe","$ff", \
2127 "vfph","vfpl","vaph","vapl"}
2129 /* A C initializer containing the assembler's names for the machine
2130 registers, each one as a C string constant. This is what
2131 translates register numbers in the compiler into assembler
2132 language. */
2134 #define PRINT_OPERAND(STREAM, X, CODE) \
2135 print_operand ((STREAM), (X), (CODE))
2136 /* A C compound statement to output to stdio stream STREAM the
2137 assembler syntax for an instruction operand X. X is an RTL
2138 expression.
2140 CODE is a value that can be used to specify one of several ways of
2141 printing the operand. It is used when identical operands must be
2142 printed differently depending on the context. CODE comes from the
2143 `%' specification that was used to request printing of the
2144 operand. If the specification was just `%DIGIT' then CODE is 0;
2145 if the specification was `%LTR DIGIT' then CODE is the ASCII code
2146 for LTR.
2148 If X is a register, this macro should print the register's name.
2149 The names can be found in an array `reg_names' whose type is `char
2150 *[]'. `reg_names' is initialized from `REGISTER_NAMES'.
2152 When the machine description has a specification `%PUNCT' (a `%'
2153 followed by a punctuation character), this macro is called with a
2154 null pointer for X and the punctuation character for CODE. */
2156 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
2157 ((CODE) == '<' || (CODE) == '>')
2159 /* A C expression which evaluates to true if CODE is a valid
2160 punctuation character for use in the `PRINT_OPERAND' macro. If
2161 `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no
2162 punctuation characters (except for the standard one, `%') are used
2163 in this way. */
2165 #define PRINT_OPERAND_ADDRESS(STREAM, X) print_operand_address(STREAM, X)
2166 /* A C compound statement to output to stdio stream STREAM the
2167 assembler syntax for an instruction operand that is a memory
2168 reference whose address is X. X is an RTL expression.
2170 On some machines, the syntax for a symbolic address depends on the
2171 section that the address refers to. On these machines, define the
2172 macro `ENCODE_SECTION_INFO' to store the information into the
2173 `symbol_ref', and then check for it here. *Note Assembler
2174 Format::. */
2176 /* Since register names don't have a prefix, we must preface all
2177 user identifiers with the '_' to prevent confusion. */
2179 #undef USER_LABEL_PREFIX
2180 #define USER_LABEL_PREFIX "_"
2181 #define LOCAL_LABEL_PREFIX ".L"
2182 /* `LOCAL_LABEL_PREFIX'
2183 `REGISTER_PREFIX'
2184 `IMMEDIATE_PREFIX'
2185 If defined, C string expressions to be used for the `%R', `%L',
2186 `%U', and `%I' options of `asm_fprintf' (see `final.c'). These
2187 are useful when a single `md' file must support multiple assembler
2188 formats. In that case, the various `tm.h' files can define these
2189 macros differently. */
2192 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
2193 asm_fprintf ((STREAM), "\tpage\t%L%d\n\tjmp\t%L%d\n", (VALUE), (VALUE))
2195 /* elfos.h presumes that we will want switch/case dispatch tables aligned.
2196 This is not so for the ip2k. */
2197 #undef ASM_OUTPUT_CASE_LABEL
2199 #undef ASM_OUTPUT_ADDR_VEC_ELT
2200 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
2201 asm_fprintf ((STREAM), "\tpage\t%L%d\n\tjmp\t%L%d\n", (VALUE), (VALUE))
2203 /* This macro should be provided on machines where the addresses in a
2204 dispatch table are absolute.
2206 The definition should be a C statement to output to the stdio
2207 stream STREAM an assembler pseudo-instruction to generate a
2208 reference to a label. VALUE is the number of an internal label
2209 whose definition is output using `(*targetm.asm_out.internal_label)'. For
2210 example,
2212 fprintf ((STREAM), "\t.word L%d\n", (VALUE)) */
2214 #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
2215 fprintf ((STREAM), "\t.align %d\n", (POWER))
2216 /* A C statement to output to the stdio stream STREAM an assembler
2217 command to advance the location counter to a multiple of 2 to the
2218 POWER bytes. POWER will be a C expression of type `int'. */
2220 /* Since instructions are 16 bit word addresses, we should lie and claim that
2221 the dispatch vectors are in QImode. Otherwise the offset into the jump
2222 table will be scaled by the MODE_SIZE. */
2224 #define CASE_VECTOR_MODE QImode
2225 /* An alias for a machine mode name. This is the machine mode that
2226 elements of a jump-table should have. */
2229 /* `CASE_VALUES_THRESHOLD'
2230 Define this to be the smallest number of different values for
2231 which it is best to use a jump-table instead of a tree of
2232 conditional branches. The default is four for machines with a
2233 `casesi' instruction and five otherwise. This is best for most
2234 machines. */
2236 #undef WORD_REGISTER_OPERATIONS
2237 /* Define this macro if operations between registers with integral
2238 mode smaller than a word are always performed on the entire
2239 register. Most RISC machines have this property and most CISC
2240 machines do not. */
2242 #define MOVE_MAX 1
2243 /* The maximum number of bytes that a single instruction can move
2244 quickly between memory and registers or between two memory
2245 locations. */
2247 #define MOVE_RATIO 3
2248 /* MOVE_RATIO is the number of move instructions that is better than a
2249 block move. Make this small on the IP2k, since the code size grows very
2250 large with each move. */
2252 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
2253 /* A C expression which is nonzero if on this machine it is safe to
2254 "convert" an integer of INPREC bits to one of OUTPREC bits (where
2255 OUTPREC is smaller than INPREC) by merely operating on it as if it
2256 had only OUTPREC bits.
2258 On many machines, this expression can be 1.
2260 When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for
2261 modes for which `MODES_TIEABLE_P' is 0, suboptimal code can result.
2262 If this is the case, making `TRULY_NOOP_TRUNCATION' return 0 in
2263 such cases may improve things. */
2265 #define Pmode HImode
2266 /* An alias for the machine mode for pointers. On most machines,
2267 define this to be the integer mode corresponding to the width of a
2268 hardware pointer; `SImode' on 32-bit machine or `DImode' on 64-bit
2269 machines. On some machines you must define this to be one of the
2270 partial integer modes, such as `PSImode'.
2272 The width of `Pmode' must be at least as large as the value of
2273 `POINTER_SIZE'. If it is not equal, you must define the macro
2274 `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to
2275 `Pmode'. */
2277 #define FUNCTION_MODE HImode
2278 /* An alias for the machine mode used for memory references to
2279 functions being called, in `call' RTL expressions. On most
2280 machines this should be `QImode'. */
2282 #define INTEGRATE_THRESHOLD(DECL) \
2283 (1 + (3 * list_length (DECL_ARGUMENTS (DECL)) / 2))
2284 /* A C expression for the maximum number of instructions above which
2285 the function DECL should not be inlined. DECL is a
2286 `FUNCTION_DECL' node.
2288 The default definition of this macro is 64 plus 8 times the number
2289 of arguments that the function accepts. Some people think a larger
2290 threshold should be used on RISC machines. */
2292 #define DOLLARS_IN_IDENTIFIERS 0
2293 /* Define this macro to control use of the character `$' in identifier
2294 names. 0 means `$' is not allowed by default; 1 means it is
2295 allowed. 1 is the default; there is no need to define this macro
2296 in that case. This macro controls the compiler proper; it does
2297 not affect the preprocessor. */
2299 #define MACHINE_DEPENDENT_REORG(INSN) machine_dependent_reorg (INSN)
2300 /* In rare cases, correct code generation requires extra machine
2301 dependent processing between the second jump optimization pass and
2302 delayed branch scheduling. On those machines, define this macro
2303 as a C statement to act on the code starting at INSN. */
2305 extern int ip2k_reorg_in_progress;
2306 /* Flag if we're in the middle of IP2k-specific reorganization. */
2308 extern int ip2k_reorg_completed;
2309 /* Flag if we've completed our IP2k-specific reorganization. If we have
2310 then we allow quite a few more tricks than before. */
2312 extern int ip2k_reorg_split_dimode;
2313 extern int ip2k_reorg_split_simode;
2314 extern int ip2k_reorg_split_qimode;
2315 extern int ip2k_reorg_split_himode;
2316 /* Flags for various split operations that we run in sequence. */
2318 extern int ip2k_reorg_merge_qimode;
2319 /* Flag to indicate that it's safe to merge QImode operands. */
2321 #define GIV_SORT_CRITERION(X, Y) \
2322 do { \
2323 if (GET_CODE ((X)->add_val) == CONST_INT \
2324 && GET_CODE ((Y)->add_val) == CONST_INT) \
2325 return INTVAL ((X)->add_val) - INTVAL ((Y)->add_val); \
2326 } while (0)
2328 /* In some cases, the strength reduction optimization pass can
2329 produce better code if this is defined. This macro controls the
2330 order that induction variables are combined. This macro is
2331 particularly useful if the target has limited addressing modes.
2332 For instance, the SH target has only positive offsets in
2333 addresses. Thus sorting to put the smallest address first allows
2334 the most combinations to be found. */
2336 #define TRAMPOLINE_TEMPLATE(FILE) abort ()
2338 /* Length in units of the trampoline for entering a nested function. */
2340 #define TRAMPOLINE_SIZE 4
2342 /* Emit RTL insns to initialize the variable parts of a trampoline.
2343 FNADDR is an RTX for the address of the function's pure code.
2344 CXT is an RTX for the static chain value for the function. */
2346 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
2348 emit_move_insn (gen_rtx_MEM (HImode, plus_constant ((TRAMP), 2)), \
2349 CXT); \
2350 emit_move_insn (gen_rtx_MEM (HImode, plus_constant ((TRAMP), 6)), \
2351 FNADDR); \
2353 /* Store in cc_status the expressions
2354 that the condition codes will describe
2355 after execution of an instruction whose pattern is EXP.
2356 Do not alter them if the instruction would not alter the cc's. */
2358 #define NOTICE_UPDATE_CC(EXP, INSN) (void)(0)
2360 /* Output assembler code to FILE to increment profiler label # LABELNO
2361 for profiling a function entry. */
2363 #define FUNCTION_PROFILER(FILE, LABELNO) \
2364 fprintf ((FILE), "/* profiler %d */", (LABELNO))
2366 #define TARGET_MEM_FUNCTIONS
2367 /* Define this macro if GNU CC should generate calls to the System V
2368 (and ANSI C) library functions `memcpy' and `memset' rather than
2369 the BSD functions `bcopy' and `bzero'. */
2372 #undef ENDFILE_SPEC
2373 #undef LINK_SPEC
2374 #undef STARTFILE_SPEC
2376 /* Another C string constant used much like `LINK_SPEC'. The
2377 difference between the two is that `ENDFILE_SPEC' is used at the
2378 very end of the command given to the linker.
2380 Do not define this macro if it does not need to do anything. */
2382 #if defined(__STDC__) || defined(ALMOST_STDC)
2383 #define AS2(a,b,c) #a "\t" #b "," #c
2384 #define AS1(a,b) #a "\t" #b
2385 #else
2386 #define AS1(a,b) "a b"
2387 #define AS2(a,b,c) "a b,c"
2388 #endif
2389 #define OUT_AS1(a,b) output_asm_insn (AS1 (a,b), operands)
2390 #define OUT_AS2(a,b,c) output_asm_insn (AS2 (a,b,c), operands)
2391 #define CR_TAB "\n\t"
2393 /* Define this macro as a C statement that declares additional library
2394 routines renames existing ones. `init_optabs' calls this macro
2395 after initializing all the normal library routines. */
2397 #define INIT_TARGET_OPTABS \
2399 smul_optab->handlers[(int) SImode].libfunc \
2400 = gen_rtx_SYMBOL_REF (Pmode, "_mulsi3"); \
2402 smul_optab->handlers[(int) DImode].libfunc \
2403 = gen_rtx_SYMBOL_REF (Pmode, "_muldi3"); \
2405 cmp_optab->handlers[(int) HImode].libfunc \
2406 = gen_rtx_SYMBOL_REF (Pmode, "_cmphi2"); \
2408 cmp_optab->handlers[(int) SImode].libfunc \
2409 = gen_rtx_SYMBOL_REF (Pmode, "_cmpsi2"); \
2412 #define PREDICATE_CODES \
2413 {"ip2k_ip_operand", {MEM}}, \
2414 {"ip2k_short_operand", {MEM}}, \
2415 {"ip2k_gen_operand", {MEM, REG, SUBREG}}, \
2416 {"ip2k_nonptr_operand", {REG, SUBREG}}, \
2417 {"ip2k_ptr_operand", {REG, SUBREG}}, \
2418 {"ip2k_split_dest_operand", {REG, SUBREG, MEM}}, \
2419 {"ip2k_sp_operand", {REG}}, \
2420 {"ip2k_nonsp_reg_operand", {REG, SUBREG}}, \
2421 {"ip2k_symbol_ref_operand", {SYMBOL_REF}}, \
2422 {"ip2k_binary_operator", {PLUS, MINUS, MULT, DIV, \
2423 UDIV, MOD, UMOD, AND, IOR, \
2424 XOR, COMPARE, ASHIFT, \
2425 ASHIFTRT, LSHIFTRT}}, \
2426 {"ip2k_unary_operator", {NEG, NOT, SIGN_EXTEND, \
2427 ZERO_EXTEND}}, \
2428 {"ip2k_unsigned_comparison_operator", {LTU, GTU, NE, \
2429 EQ, LEU, GEU}},\
2430 {"ip2k_signed_comparison_operator", {LT, GT, LE, GE}},
2432 #define DWARF2_DEBUGGING_INFO 1
2434 #define DWARF2_ASM_LINE_DEBUG_INFO 1
2436 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
2438 /* Miscellaneous macros to describe machine specifics. */
2440 #define STORE_FLAG_VALUE 1
2442 #define IS_PSEUDO_P(R) (REGNO (R) >= FIRST_PSEUDO_REGISTER)
2444 /* Default calculations would cause DWARF address sizes to be 2 bytes,
2445 but the Harvard architecture of the IP2k and the word-addressed 64k
2446 of instruction memory causes us to want a 32-bit "address" field. */
2447 #undef DWARF2_ADDR_SIZE
2448 #define DWARF2_ADDR_SIZE 4