d455629349940939a7a691a680badb6b2e63fb0d
[gcc.git] / gcc / config / d30v / d30v.h
1 /* Definitions of target machine for Mitsubishi D30V.
2 Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 Contributed by Cygnus Solutions.
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21
22 /* D30V specific macros */
23
24 /* Align an address */
25 #define D30V_ALIGN(addr,align) (((addr) + (align) - 1) & ~((align) - 1))
26
27 \f
28 /* Set up System V.4 (aka ELF) defaults. */
29 #include "svr4.h"
30
31 \f
32 /* Driver configuration */
33
34 /* A C expression which determines whether the option `-CHAR' takes arguments.
35 The value should be the number of arguments that option takes-zero, for many
36 options.
37
38 By default, this macro is defined to handle the standard options properly.
39 You need not define it unless you wish to add additional options which take
40 arguments.
41
42 Defined in svr4.h. */
43 /* #define SWITCH_TAKES_ARG(CHAR) */
44
45 /* A C expression which determines whether the option `-NAME' takes arguments.
46 The value should be the number of arguments that option takes-zero, for many
47 options. This macro rather than `SWITCH_TAKES_ARG' is used for
48 multi-character option names.
49
50 By default, this macro is defined as `DEFAULT_WORD_SWITCH_TAKES_ARG', which
51 handles the standard options properly. You need not define
52 `WORD_SWITCH_TAKES_ARG' unless you wish to add additional options which take
53 arguments. Any redefinition should call `DEFAULT_WORD_SWITCH_TAKES_ARG' and
54 then check for additional options.
55
56 Defined in svr4.h. */
57 /* #define WORD_SWITCH_TAKES_ARG(NAME) */
58
59 /* A string-valued C expression which is nonempty if the linker needs a space
60 between the `-L' or `-o' option and its argument.
61
62 If this macro is not defined, the default value is 0. */
63 /* #define SWITCHES_NEED_SPACES "" */
64
65 /* A C string constant that tells the GNU CC driver program options to pass to
66 CPP. It can also specify how to translate options you give to GNU CC into
67 options for GNU CC to pass to the CPP.
68
69 Do not define this macro if it does not need to do anything. */
70 /* #define CPP_SPEC "" */
71
72 /* If this macro is defined, the preprocessor will not define the builtin macro
73 `__SIZE_TYPE__'. The macro `__SIZE_TYPE__' must then be defined by
74 `CPP_SPEC' instead.
75
76 This should be defined if `SIZE_TYPE' depends on target dependent flags
77 which are not accessible to the preprocessor. Otherwise, it should not be
78 defined. */
79 /* #define NO_BUILTIN_SIZE_TYPE */
80
81 /* If this macro is defined, the preprocessor will not define the builtin macro
82 `__PTRDIFF_TYPE__'. The macro `__PTRDIFF_TYPE__' must then be defined by
83 `CPP_SPEC' instead.
84
85 This should be defined if `PTRDIFF_TYPE' depends on target dependent flags
86 which are not accessible to the preprocessor. Otherwise, it should not be
87 defined. */
88 /* #define NO_BUILTIN_PTRDIFF_TYPE */
89
90 /* A C string constant that tells the GNU CC driver program options to pass to
91 CPP. By default, this macro is defined to pass the option
92 `-D__CHAR_UNSIGNED__' to CPP if `char' will be treated as `unsigned char' by
93 `cc1'.
94
95 Do not define this macro unless you need to override the default definition. */
96 /* #if DEFAULT_SIGNED_CHAR
97 #define SIGNED_CHAR_SPEC "%{funsigned-char:-D__CHAR_UNSIGNED__}"
98 #else
99 #define SIGNED_CHAR_SPEC "%{!fsigned-char:-D__CHAR_UNSIGNED__}"
100 #endif */
101
102 /* A C string constant that tells the GNU CC driver program options to pass to
103 `cc1'. It can also specify how to translate options you give to GNU CC into
104 options for GNU CC to pass to the `cc1'.
105
106 Do not define this macro if it does not need to do anything. */
107 /* #define CC1_SPEC "" */
108
109 /* A C string constant that tells the GNU CC driver program options to pass to
110 `cc1plus'. It can also specify how to translate options you give to GNU CC
111 into options for GNU CC to pass to the `cc1plus'.
112
113 Do not define this macro if it does not need to do anything. */
114 /* #define CC1PLUS_SPEC "" */
115
116 /* A C string constant that tells the GNU CC driver program options to pass to
117 the assembler. It can also specify how to translate options you give to GNU
118 CC into options for GNU CC to pass to the assembler. See the file `sun3.h'
119 for an example of this.
120
121 Do not define this macro if it does not need to do anything.
122
123 Defined in svr4.h. */
124 #undef ASM_SPEC
125 #define ASM_SPEC "\
126 %{!mno-asm-optimize: %{O*: %{!O0: -O} %{O0: %{masm-optimize: -O}}}} \
127 %{v} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
128
129 /* A C string constant that tells the GNU CC driver program how to run any
130 programs which cleanup after the normal assembler. Normally, this is not
131 needed. See the file `mips.h' for an example of this.
132
133 Do not define this macro if it does not need to do anything.
134
135 Defined in svr4.h. */
136 /* #define ASM_FINAL_SPEC "" */
137
138 /* A C string constant that tells the GNU CC driver program options to pass to
139 the linker. It can also specify how to translate options you give to GNU CC
140 into options for GNU CC to pass to the linker.
141
142 Do not define this macro if it does not need to do anything.
143
144 Defined in svr4.h. */
145 #undef LINK_SPEC
146 #define LINK_SPEC "\
147 %{h*} %{v:-V} \
148 %{b} %{Wl,*:%*} \
149 %{static:-dn -Bstatic} \
150 %{shared:-G -dy -z text} \
151 %{symbolic:-Bsymbolic -G -dy -z text} \
152 %{G:-G} \
153 %{YP,*} \
154 %{Qy:} %{!Qn:-Qy} \
155 %{mextmem: -m d30v_e} %{mextmemory: -m d30v_e} %{monchip: -m d30v_o}"
156
157 /* Another C string constant used much like `LINK_SPEC'. The difference
158 between the two is that `LIB_SPEC' is used at the end of the command given
159 to the linker.
160
161 If this macro is not defined, a default is provided that loads the standard
162 C library from the usual place. See `gcc.c'.
163
164 Defined in svr4.h. */
165 #undef LIB_SPEC
166 #define LIB_SPEC "--start-group -lsim -lc --end-group"
167
168 /* Another C string constant that tells the GNU CC driver program how and when
169 to place a reference to `libgcc.a' into the linker command line. This
170 constant is placed both before and after the value of `LIB_SPEC'.
171
172 If this macro is not defined, the GNU CC driver provides a default that
173 passes the string `-lgcc' to the linker unless the `-shared' option is
174 specified. */
175 /* #define LIBGCC_SPEC "" */
176
177 /* Another C string constant used much like `LINK_SPEC'. The difference
178 between the two is that `STARTFILE_SPEC' is used at the very beginning of
179 the command given to the linker.
180
181 If this macro is not defined, a default is provided that loads the standard
182 C startup file from the usual place. See `gcc.c'.
183
184 Defined in svr4.h. */
185
186 #undef STARTFILE_SPEC
187 #define STARTFILE_SPEC "crt0%O%s crtbegin%O%s"
188
189 /* Another C string constant used much like `LINK_SPEC'. The difference
190 between the two is that `ENDFILE_SPEC' is used at the very end of the
191 command given to the linker.
192
193 Do not define this macro if it does not need to do anything.
194
195 Defined in svr4.h. */
196
197 #undef ENDFILE_SPEC
198 #define ENDFILE_SPEC "crtend%O%s"
199
200 /* Define this macro if the driver program should find the library `libgcc.a'
201 itself and should not pass `-L' options to the linker. If you do not define
202 this macro, the driver program will pass the argument `-lgcc' to tell the
203 linker to do the search and will pass `-L' options to it. */
204 /* #define LINK_LIBGCC_SPECIAL */
205
206 /* Define this macro if the driver program should find the library `libgcc.a'.
207 If you do not define this macro, the driver program will pass the argument
208 `-lgcc' to tell the linker to do the search. This macro is similar to
209 `LINK_LIBGCC_SPECIAL', except that it does not affect `-L' options. */
210 /* #define LINK_LIBGCC_SPECIAL_1 */
211
212 /* Define this macro to provide additional specifications to put in the `specs'
213 file that can be used in various specifications like `CC1_SPEC'.
214
215 The definition should be an initializer for an array of structures,
216 containing a string constant, that defines the specification name, and a
217 string constant that provides the specification.
218
219 Do not define this macro if it does not need to do anything. */
220 /* #define EXTRA_SPECS {{}} */
221
222 /* Define this macro as a C expression for the initializer of an array of
223 string to tell the driver program which options are defaults for this target
224 and thus do not need to be handled specially when using `MULTILIB_OPTIONS'.
225
226 Do not define this macro if `MULTILIB_OPTIONS' is not defined in the target
227 makefile fragment or if none of the options listed in `MULTILIB_OPTIONS' are
228 set by default. *Note Target Fragment::. */
229 /* #define MULTILIB_DEFAULTS {} */
230
231 /* Define this macro to tell `gcc' that it should only translate a `-B' prefix
232 into a `-L' linker option if the prefix indicates an absolute file name. */
233 /* #define RELATIVE_PREFIX_NOT_LINKDIR */
234
235 /* Define this macro as a C string constant if you wish to override the
236 standard choice of `/usr/local/lib/gcc-lib/' as the default prefix to try
237 when searching for the executable files of the compiler. */
238 /* #define STANDARD_EXEC_PREFIX "" */
239
240 /* If defined, this macro is an additional prefix to try after
241 `STANDARD_EXEC_PREFIX'. `MD_EXEC_PREFIX' is not searched when the `-b'
242 option is used, or the compiler is built as a cross compiler.
243
244 Defined in svr4.h for host compilers. */
245 /* #define MD_EXEC_PREFIX "" */
246
247 /* Define this macro as a C string constant if you wish to override the
248 standard choice of `/usr/local/lib/' as the default prefix to try when
249 searching for startup files such as `crt0.o'. */
250 /* #define STANDARD_STARTFILE_PREFIX "" */
251
252 /* If defined, this macro supplies an additional prefix to try after the
253 standard prefixes. `MD_EXEC_PREFIX' is not searched when the `-b' option is
254 used, or when the compiler is built as a cross compiler.
255
256 Defined in svr4.h for host compilers. */
257 /* #define MD_STARTFILE_PREFIX "" */
258
259 /* If defined, this macro supplies yet another prefix to try after the standard
260 prefixes. It is not searched when the `-b' option is used, or when the
261 compiler is built as a cross compiler. */
262 /* #define MD_STARTFILE_PREFIX_1 "" */
263
264 /* Define this macro as a C string constant if you with to set environment
265 variables for programs called by the driver, such as the assembler and
266 loader. The driver passes the value of this macro to `putenv' to initialize
267 the necessary environment variables. */
268 /* #define INIT_ENVIRONMENT "" */
269
270 /* Define this macro as a C string constant if you wish to override the
271 standard choice of `/usr/local/include' as the default prefix to try when
272 searching for local header files. `LOCAL_INCLUDE_DIR' comes before
273 `SYSTEM_INCLUDE_DIR' in the search order.
274
275 Cross compilers do not use this macro and do not search either
276 `/usr/local/include' or its replacement. */
277 /* #define LOCAL_INCLUDE_DIR "" */
278
279 /* Define this macro as a C string constant if you wish to specify a
280 system-specific directory to search for header files before the standard
281 directory. `SYSTEM_INCLUDE_DIR' comes before `STANDARD_INCLUDE_DIR' in the
282 search order.
283
284 Cross compilers do not use this macro and do not search the directory
285 specified. */
286 /* #define SYSTEM_INCLUDE_DIR "" */
287
288 /* Define this macro as a C string constant if you wish to override the
289 standard choice of `/usr/include' as the default prefix to try when
290 searching for header files.
291
292 Cross compilers do not use this macro and do not search either
293 `/usr/include' or its replacement. */
294 /* #define STANDARD_INCLUDE_DIR "" */
295
296 /* Define this macro if you wish to override the entire default search path for
297 include files. The default search path includes `GCC_INCLUDE_DIR',
298 `LOCAL_INCLUDE_DIR', `SYSTEM_INCLUDE_DIR', `GPLUSPLUS_INCLUDE_DIR', and
299 `STANDARD_INCLUDE_DIR'. In addition, `GPLUSPLUS_INCLUDE_DIR' and
300 `GCC_INCLUDE_DIR' are defined automatically by `Makefile', and specify
301 private search areas for GCC. The directory `GPLUSPLUS_INCLUDE_DIR' is used
302 only for C++ programs.
303
304 The definition should be an initializer for an array of structures. Each
305 array element should have two elements: the directory name (a string
306 constant) and a flag for C++-only directories. Mark the end of the array
307 with a null element. For example, here is the definition used for VMS:
308
309 #define INCLUDE_DEFAULTS \
310 { \
311 { "GNU_GXX_INCLUDE:", 1}, \
312 { "GNU_CC_INCLUDE:", 0}, \
313 { "SYS$SYSROOT:[SYSLIB.]", 0}, \
314 { ".", 0}, \
315 { 0, 0} \
316 }
317
318 Here is the order of prefixes tried for exec files:
319
320 1. Any prefixes specified by the user with `-B'.
321
322 2. The environment variable `GCC_EXEC_PREFIX', if any.
323
324 3. The directories specified by the environment variable
325 `COMPILER_PATH'.
326
327 4. The macro `STANDARD_EXEC_PREFIX'.
328
329 5. `/usr/lib/gcc/'.
330
331 6. The macro `MD_EXEC_PREFIX', if any.
332
333 Here is the order of prefixes tried for startfiles:
334
335 1. Any prefixes specified by the user with `-B'.
336
337 2. The environment variable `GCC_EXEC_PREFIX', if any.
338
339 3. The directories specified by the environment variable
340 `LIBRARY_PATH' (native only, cross compilers do not use this).
341
342 4. The macro `STANDARD_EXEC_PREFIX'.
343
344 5. `/usr/lib/gcc/'.
345
346 6. The macro `MD_EXEC_PREFIX', if any.
347
348 7. The macro `MD_STARTFILE_PREFIX', if any.
349
350 8. The macro `STANDARD_STARTFILE_PREFIX'.
351
352 9. `/lib/'.
353
354 10. `/usr/lib/'. */
355 /* #define INCLUDE_DEFAULTS {{ }} */
356
357 \f
358 /* Run-time target specifications */
359
360 /* Define this to be a string constant containing `-D' options to define the
361 predefined macros that identify this machine and system. These macros will
362 be predefined unless the `-ansi' option is specified.
363
364 In addition, a parallel set of macros are predefined, whose names are made
365 by appending `__' at the beginning and at the end. These `__' macros are
366 permitted by the ANSI standard, so they are predefined regardless of whether
367 `-ansi' is specified.
368
369 For example, on the Sun, one can use the following value:
370
371 "-Dmc68000 -Dsun -Dunix"
372
373 The result is to define the macros `__mc68000__', `__sun__' and `__unix__'
374 unconditionally, and the macros `mc68000', `sun' and `unix' provided `-ansi'
375 is not specified. */
376 #define CPP_PREDEFINES "-D__D30V__ -Amachine(d30v)"
377
378 /* This declaration should be present. */
379 extern int target_flags;
380
381 /* This series of macros is to allow compiler command arguments to enable or
382 disable the use of optional features of the target machine. For example,
383 one machine description serves both the 68000 and the 68020; a command
384 argument tells the compiler whether it should use 68020-only instructions or
385 not. This command argument works by means of a macro `TARGET_68020' that
386 tests a bit in `target_flags'.
387
388 Define a macro `TARGET_FEATURENAME' for each such option. Its definition
389 should test a bit in `target_flags'; for example:
390
391 #define TARGET_68020 (target_flags & 1)
392
393 One place where these macros are used is in the condition-expressions of
394 instruction patterns. Note how `TARGET_68020' appears frequently in the
395 68000 machine description file, `m68k.md'. Another place they are used is
396 in the definitions of the other macros in the `MACHINE.h' file. */
397
398 #define MASK_NO_COND_MOVE 0x00000001 /* disable conditional moves */
399
400 #define MASK_DEBUG_ARG 0x10000000 /* debug argument handling */
401 #define MASK_DEBUG_STACK 0x20000000 /* debug stack allocations */
402 #define MASK_DEBUG_ADDR 0x40000000 /* debug GO_IF_LEGITIMATE_ADDRESS */
403
404 #define TARGET_NO_COND_MOVE (target_flags & MASK_NO_COND_MOVE)
405 #define TARGET_DEBUG_ARG (target_flags & MASK_DEBUG_ARG)
406 #define TARGET_DEBUG_STACK (target_flags & MASK_DEBUG_STACK)
407 #define TARGET_DEBUG_ADDR (target_flags & MASK_DEBUG_ADDR)
408
409 #define TARGET_COND_MOVE (! TARGET_NO_COND_MOVE)
410
411 /* Default switches used. */
412 #ifndef TARGET_DEFAULT
413 #define TARGET_DEFAULT 0
414 #endif
415
416 /* This macro defines names of command options to set and clear bits in
417 `target_flags'. Its definition is an initializer with a subgrouping for
418 each command option.
419
420 Each subgrouping contains a string constant, that defines the option name,
421 and a number, which contains the bits to set in `target_flags'. A negative
422 number says to clear bits instead; the negative of the number is which bits
423 to clear. The actual option name is made by appending `-m' to the specified
424 name.
425
426 One of the subgroupings should have a null string. The number in this
427 grouping is the default value for `target_flags'. Any target options act
428 starting with that value.
429
430 Here is an example which defines `-m68000' and `-m68020' with opposite
431 meanings, and picks the latter as the default:
432
433 #define TARGET_SWITCHES \
434 { { "68020", 1}, \
435 { "68000", -1}, \
436 { "", 1}} */
437
438 #define TARGET_SWITCHES \
439 { \
440 { "cond-move", -MASK_NO_COND_MOVE }, \
441 { "no-cond-move", MASK_NO_COND_MOVE }, \
442 { "debug-arg", MASK_DEBUG_ARG }, \
443 { "debug-stack", MASK_DEBUG_STACK }, \
444 { "debug-addr", MASK_DEBUG_ADDR }, \
445 { "asm-optimize", 0 }, \
446 { "no-asm-optimize", 0 }, \
447 { "extmem", 0 }, \
448 { "extmemory", 0 }, \
449 { "onchip", 0 }, \
450 { "", TARGET_DEFAULT }, \
451 }
452
453 /* This macro is similar to `TARGET_SWITCHES' but defines names of command
454 options that have values. Its definition is an initializer with a
455 subgrouping for each command option.
456
457 Each subgrouping contains a string constant, that defines the fixed part of
458 the option name, and the address of a variable. The variable, type `char
459 *', is set to the variable part of the given option if the fixed part
460 matches. The actual option name is made by appending `-m' to the specified
461 name.
462
463 Here is an example which defines `-mshort-data-NUMBER'. If the given option
464 is `-mshort-data-512', the variable `m88k_short_data' will be set to the
465 string `"512"'.
466
467 extern char *m88k_short_data;
468 #define TARGET_OPTIONS \
469 { { "short-data-", &m88k_short_data } } */
470
471 #define TARGET_OPTIONS \
472 { \
473 {"branch-cost=", &d30v_branch_cost_string}, \
474 {"cond-exec=", &d30v_cond_exec_string}, \
475 }
476
477 /* This macro is a C statement to print on `stderr' a string describing the
478 particular machine description choice. Every machine description should
479 define `TARGET_VERSION'. For example:
480
481 #ifdef MOTOROLA
482 #define TARGET_VERSION \
483 fprintf (stderr, " (68k, Motorola syntax)");
484 #else
485 #define TARGET_VERSION \
486 fprintf (stderr, " (68k, MIT syntax)");
487 #endif */
488 #define TARGET_VERSION fprintf (stderr, " d30v")
489
490 /* Sometimes certain combinations of command options do not make sense on a
491 particular target machine. You can define a macro `OVERRIDE_OPTIONS' to
492 take account of this. This macro, if defined, is executed once just after
493 all the command options have been parsed.
494
495 Don't use this macro to turn on various extra optimizations for `-O'. That
496 is what `OPTIMIZATION_OPTIONS' is for. */
497
498 #define OVERRIDE_OPTIONS override_options ()
499
500 /* Some machines may desire to change what optimizations are performed for
501 various optimization levels. This macro, if defined, is executed once just
502 after the optimization level is determined and before the remainder of the
503 command options have been parsed. Values set in this macro are used as the
504 default values for the other command line options.
505
506 LEVEL is the optimization level specified; 2 if `-O2' is specified, 1 if
507 `-O' is specified, and 0 if neither is specified.
508
509 SIZE is non-zero if `-Os' is specified, 0 otherwise.
510
511 You should not use this macro to change options that are not
512 machine-specific. These should uniformly selected by the same optimization
513 level on all supported machines. Use this macro to enable machbine-specific
514 optimizations.
515
516 *Do not examine `write_symbols' in this macro!* The debugging options are
517 *not supposed to alter the generated code. */
518 /* #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) */
519
520 /* Define this macro if debugging can be performed even without a frame
521 pointer. If this macro is defined, GNU CC will turn on the
522 `-fomit-frame-pointer' option whenever `-O' is specified. */
523 #define CAN_DEBUG_WITHOUT_FP
524
525 \f
526 /* Storage Layout */
527
528 /* Define this macro to have the value 1 if the most significant bit in a byte
529 has the lowest number; otherwise define it to have the value zero. This
530 means that bit-field instructions count from the most significant bit. If
531 the machine has no bit-field instructions, then this must still be defined,
532 but it doesn't matter which value it is defined to. This macro need not be
533 a constant.
534
535 This macro does not affect the way structure fields are packed into bytes or
536 words; that is controlled by `BYTES_BIG_ENDIAN'. */
537 #define BITS_BIG_ENDIAN 1
538
539 /* Define this macro to have the value 1 if the most significant byte in a word
540 has the lowest number. This macro need not be a constant. */
541 #define BYTES_BIG_ENDIAN 1
542
543 /* Define this macro to have the value 1 if, in a multiword object, the most
544 significant word has the lowest number. This applies to both memory
545 locations and registers; GNU CC fundamentally assumes that the order of
546 words in memory is the same as the order in registers. This macro need not
547 be a constant. */
548 #define WORDS_BIG_ENDIAN 1
549
550 /* Define this macro if WORDS_BIG_ENDIAN is not constant. This must be a
551 constant value with the same meaning as WORDS_BIG_ENDIAN, which will be used
552 only when compiling libgcc2.c. Typically the value will be set based on
553 preprocessor defines. */
554 /* #define LIBGCC2_WORDS_BIG_ENDIAN */
555
556 /* Define this macro to have the value 1 if `DFmode', `XFmode' or `TFmode'
557 floating point numbers are stored in memory with the word containing the
558 sign bit at the lowest address; otherwise define it to have the value 0.
559 This macro need not be a constant.
560
561 You need not define this macro if the ordering is the same as for multi-word
562 integers. */
563 /* #define FLOAT_WORDS_BIG_EnNDIAN */
564
565 /* Define this macro to be the number of bits in an addressable storage unit
566 (byte); normally 8. */
567 #define BITS_PER_UNIT 8
568
569 /* Number of bits in a word; normally 32. */
570 #define BITS_PER_WORD 32
571
572 /* Maximum number of bits in a word. If this is undefined, the default is
573 `BITS_PER_WORD'. Otherwise, it is the constant value that is the largest
574 value that `BITS_PER_WORD' can have at run-time. */
575 /* #define MAX_BITS_PER_WORD */
576
577 /* Number of storage units in a word; normally 4. */
578 #define UNITS_PER_WORD 4
579
580 /* Minimum number of units in a word. If this is undefined, the default is
581 `UNITS_PER_WORD'. Otherwise, it is the constant value that is the smallest
582 value that `UNITS_PER_WORD' can have at run-time. */
583 /* #define MIN_UNITS_PER_WORD */
584
585 /* Width of a pointer, in bits. You must specify a value no wider than the
586 width of `Pmode'. If it is not equal to the width of `Pmode', you must
587 define `POINTERS_EXTEND_UNSIGNED'. */
588 #define POINTER_SIZE 32
589
590 /* A C expression whose value is nonzero if pointers that need to be extended
591 from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and zero if
592 they are zero-extended.
593
594 You need not define this macro if the `POINTER_SIZE' is equal to the width
595 of `Pmode'. */
596 /* #define POINTERS_EXTEND_UNSIGNED */
597
598 /* A macro to update M and UNSIGNEDP when an object whose type is TYPE and
599 which has the specified mode and signedness is to be stored in a register.
600 This macro is only called when TYPE is a scalar type.
601
602 On most RISC machines, which only have operations that operate on a full
603 register, define this macro to set M to `word_mode' if M is an integer mode
604 narrower than `BITS_PER_WORD'. In most cases, only integer modes should be
605 widened because wider-precision floating-point operations are usually more
606 expensive than their narrower counterparts.
607
608 For most machines, the macro definition does not change UNSIGNEDP. However,
609 some machines, have instructions that preferentially handle either signed or
610 unsigned quantities of certain modes. For example, on the DEC Alpha, 32-bit
611 loads from memory and 32-bit add instructions sign-extend the result to 64
612 bits. On such machines, set UNSIGNEDP according to which kind of extension
613 is more efficient.
614
615 Do not define this macro if it would never modify M. */
616 #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
617 do { \
618 if (GET_MODE_CLASS (MODE) == MODE_INT \
619 && GET_MODE_SIZE (MODE) < 4) \
620 (MODE) = SImode; \
621 } while (0)
622
623 /* Define this macro if the promotion described by `PROMOTE_MODE' should also
624 be done for outgoing function arguments. */
625 /* #define PROMOTE_FUNCTION_ARGS */
626
627 /* Define this macro if the promotion described by `PROMOTE_MODE' should also
628 be done for the return value of functions.
629
630 If this macro is defined, `FUNCTION_VALUE' must perform the same promotions
631 done by `PROMOTE_MODE'. */
632 /* #define PROMOTE_FUNCTION_RETURN */
633
634 /* Define this macro if the promotion described by `PROMOTE_MODE' should *only*
635 be performed for outgoing function arguments or function return values, as
636 specified by `PROMOTE_FUNCTION_ARGS' and `PROMOTE_FUNCTION_RETURN',
637 respectively. */
638 /* #define PROMOTE_FOR_CALL_ONLY */
639
640 /* Normal alignment required for function parameters on the stack, in bits.
641 All stack parameters receive at least this much alignment regardless of data
642 type. On most machines, this is the same as the size of an integer. */
643
644 #define PARM_BOUNDARY 32
645
646 /* Define this macro if you wish to preserve a certain alignment for the stack
647 pointer. The definition is a C expression for the desired alignment
648 (measured in bits).
649
650 If `PUSH_ROUNDING' is not defined, the stack will always be aligned to the
651 specified boundary. If `PUSH_ROUNDING' is defined and specifies a less
652 strict alignment than `STACK_BOUNDARY', the stack may be momentarily
653 unaligned while pushing arguments. */
654
655 #define STACK_BOUNDARY 64
656
657 /* Alignment required for a function entry point, in bits. */
658
659 #define FUNCTION_BOUNDARY 64
660
661 /* Biggest alignment that any data type can require on this machine,
662 in bits. */
663
664 #define BIGGEST_ALIGNMENT 64
665
666 /* Biggest alignment that any structure field can require on this machine, in
667 bits. If defined, this overrides `BIGGEST_ALIGNMENT' for structure fields
668 only. */
669 /* #define BIGGEST_FIELD_ALIGNMENT */
670
671 /* Biggest alignment supported by the object file format of this machine. Use
672 this macro to limit the alignment which can be specified using the
673 `__attribute__ ((aligned (N)))' construct. If not defined, the default
674 value is `BIGGEST_ALIGNMENT'.
675
676 Defined in svr4.h. */
677 /* #define MAX_OFILE_ALIGNMENT */
678
679 /* If defined, a C expression to compute the alignment for a static variable.
680 TYPE is the data type, and BASIC-ALIGN is the alignment that the object
681 would ordinarily have. The value of this macro is used instead of that
682 alignment to align the object.
683
684 If this macro is not defined, then BASIC-ALIGN is used.
685
686 One use of this macro is to increase alignment of medium-size data to make
687 it all fit in fewer cache lines. Another is to cause character arrays to be
688 word-aligned so that `strcpy' calls that copy constants to character arrays
689 can be done inline. */
690
691 #define DATA_ALIGNMENT(TYPE, ALIGN) \
692 (TREE_CODE (TYPE) == ARRAY_TYPE \
693 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
694 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
695
696 /* If defined, a C expression to compute the alignment given to a constant that
697 is being placed in memory. CONSTANT is the constant and BASIC-ALIGN is the
698 alignment that the object would ordinarily have. The value of this macro is
699 used instead of that alignment to align the object.
700
701 If this macro is not defined, then BASIC-ALIGN is used.
702
703 The typical use of this macro is to increase alignment for string constants
704 to be word aligned so that `strcpy' calls that copy constants can be done
705 inline. */
706
707 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
708 (TREE_CODE (EXP) == STRING_CST \
709 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
710
711 /* Alignment in bits to be given to a structure bit field that follows an empty
712 field such as `int : 0;'.
713
714 Note that `PCC_BITFIELD_TYPE_MATTERS' also affects the alignment that
715 results from an empty field. */
716 /* #define EMPTY_FIELD_BOUNDARY */
717
718 /* Number of bits which any structure or union's size must be a multiple of.
719 Each structure or union's size is rounded up to a multiple of this.
720
721 If you do not define this macro, the default is the same as `BITS_PER_UNIT'. */
722 /* #define STRUCTURE_SIZE_BOUNDARY */
723
724 /* Define this macro to be the value 1 if instructions will fail to work if
725 given data not on the nominal alignment. If instructions will merely go
726 slower in that case, define this macro as 0. */
727
728 #define STRICT_ALIGNMENT 1
729
730 /* Define this if you wish to imitate the way many other C compilers handle
731 alignment of bitfields and the structures that contain them.
732
733 The behavior is that the type written for a bitfield (`int', `short', or
734 other integer type) imposes an alignment for the entire structure, as if the
735 structure really did contain an ordinary field of that type. In addition,
736 the bitfield is placed within the structure so that it would fit within such
737 a field, not crossing a boundary for it.
738
739 Thus, on most machines, a bitfield whose type is written as `int' would not
740 cross a four-byte boundary, and would force four-byte alignment for the
741 whole structure. (The alignment used may not be four bytes; it is
742 controlled by the other alignment parameters.)
743
744 If the macro is defined, its definition should be a C expression; a nonzero
745 value for the expression enables this behavior.
746
747 Note that if this macro is not defined, or its value is zero, some bitfields
748 may cross more than one alignment boundary. The compiler can support such
749 references if there are `insv', `extv', and `extzv' insns that can directly
750 reference memory.
751
752 The other known way of making bitfields work is to define
753 `STRUCTURE_SIZE_BOUNDARY' as large as `BIGGEST_ALIGNMENT'. Then every
754 structure can be accessed with fullwords.
755
756 Unless the machine has bitfield instructions or you define
757 `STRUCTURE_SIZE_BOUNDARY' that way, you must define
758 `PCC_BITFIELD_TYPE_MATTERS' to have a nonzero value.
759
760 If your aim is to make GNU CC use the same conventions for laying out
761 bitfields as are used by another compiler, here is how to investigate what
762 the other compiler does. Compile and run this program:
763
764 struct foo1
765 {
766 char x;
767 char :0;
768 char y;
769 };
770
771 struct foo2
772 {
773 char x;
774 int :0;
775 char y;
776 };
777
778 main ()
779 {
780 printf ("Size of foo1 is %d\n",
781 sizeof (struct foo1));
782 printf ("Size of foo2 is %d\n",
783 sizeof (struct foo2));
784 exit (0);
785 }
786
787 If this prints 2 and 5, then the compiler's behavior is what you would get
788 from `PCC_BITFIELD_TYPE_MATTERS'.
789
790 Defined in svr4.h. */
791
792 #define PCC_BITFIELD_TYPE_MATTERS 1
793
794 /* Like PCC_BITFIELD_TYPE_MATTERS except that its effect is limited to aligning
795 a bitfield within the structure. */
796 /* #define BITFIELD_NBYTES_LIMITED */
797
798 /* Define this macro as an expression for the overall size of a structure
799 (given by STRUCT as a tree node) when the size computed from the fields is
800 SIZE and the alignment is ALIGN.
801
802 The default is to round SIZE up to a multiple of ALIGN. */
803 /* #define ROUND_TYPE_SIZE(STRUCT, SIZE, ALIGN) */
804
805 /* Define this macro as an expression for the alignment of a structure (given
806 by STRUCT as a tree node) if the alignment computed in the usual way is
807 COMPUTED and the alignment explicitly specified was SPECIFIED.
808
809 The default is to use SPECIFIED if it is larger; otherwise, use the smaller
810 of COMPUTED and `BIGGEST_ALIGNMENT' */
811 /* #define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) */
812
813 /* An integer expression for the size in bits of the largest integer machine
814 mode that should actually be used. All integer machine modes of this size
815 or smaller can be used for structures and unions with the appropriate sizes.
816 If this macro is undefined, `GET_MODE_BITSIZE (DImode)' is assumed. */
817 /* #define MAX_FIXED_MODE_SIZE */
818
819 /* A C statement to validate the value VALUE (of type `double') for mode MODE.
820 This means that you check whether VALUE fits within the possible range of
821 values for mode MODE on this target machine. The mode MODE is always a mode
822 of class `MODE_FLOAT'. OVERFLOW is nonzero if the value is already known to
823 be out of range.
824
825 If VALUE is not valid or if OVERFLOW is nonzero, you should set OVERFLOW to
826 1 and then assign some valid value to VALUE. Allowing an invalid value to
827 go through the compiler can produce incorrect assembler code which may even
828 cause Unix assemblers to crash.
829
830 This macro need not be defined if there is no work for it to do. */
831 /* #define CHECK_FLOAT_VALUE(MODE, VALUE, OVERFLOW) */
832
833 /* A code distinguishing the floating point format of the target machine.
834 There are three defined values:
835
836 IEEE_FLOAT_FORMAT'
837 This code indicates IEEE floating point. It is the default;
838 there is no need to define this macro when the format is IEEE.
839
840 VAX_FLOAT_FORMAT'
841 This code indicates the peculiar format used on the Vax.
842
843 UNKNOWN_FLOAT_FORMAT'
844 This code indicates any other format.
845
846 The value of this macro is compared with `HOST_FLOAT_FORMAT' (*note
847 Config::.) to determine whether the target machine has the same format as
848 the host machine. If any other formats are actually in use on supported
849 machines, new codes should be defined for them.
850
851 The ordering of the component words of floating point values stored in
852 memory is controlled by `FLOAT_WORDS_BIG_ENDIAN' for the target machine and
853 `HOST_FLOAT_WORDS_BIG_ENDIAN' for the host. */
854 #define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
855
856 /* GNU CC supports two ways of implementing C++ vtables: traditional or with
857 so-called "thunks". The flag `-fvtable-thunk' chooses between them. Define
858 this macro to be a C expression for the default value of that flag. If
859 `DEFAULT_VTABLE_THUNKS' is 0, GNU CC uses the traditional implementation by
860 default. The "thunk" implementation is more efficient (especially if you
861 have provided an implementation of `ASM_OUTPUT_MI_THUNK', see *Note Function
862 Entry::), but is not binary compatible with code compiled using the
863 traditional implementation. If you are writing a new ports, define
864 `DEFAULT_VTABLE_THUNKS' to 1.
865
866 If you do not define this macro, the default for `-fvtable-thunk' is 0. */
867 #define DEFAULT_VTABLE_THUNKS 0
868
869 \f
870 /* Layout of Source Language Data Types */
871
872 /* A C expression for the size in bits of the type `int' on the target machine.
873 If you don't define this, the default is one word. */
874 #define INT_TYPE_SIZE 32
875
876 /* Maximum number for the size in bits of the type `int' on the target machine.
877 If this is undefined, the default is `INT_TYPE_SIZE'. Otherwise, it is the
878 constant value that is the largest value that `INT_TYPE_SIZE' can have at
879 run-time. This is used in `cpp'. */
880 /* #define MAX_INT_TYPE_SIZE */
881
882 /* A C expression for the size in bits of the type `short' on the target
883 machine. If you don't define this, the default is half a word. (If this
884 would be less than one storage unit, it is rounded up to one unit.) */
885 #define SHORT_TYPE_SIZE 16
886
887 /* A C expression for the size in bits of the type `long' on the target
888 machine. If you don't define this, the default is one word. */
889 #define LONG_TYPE_SIZE 32
890
891 /* Maximum number for the size in bits of the type `long' on the target
892 machine. If this is undefined, the default is `LONG_TYPE_SIZE'. Otherwise,
893 it is the constant value that is the largest value that `LONG_TYPE_SIZE' can
894 have at run-time. This is used in `cpp'. */
895 /* #define MAX_LONG_TYPE_SIZE */
896
897 /* A C expression for the size in bits of the type `long long' on the target
898 machine. If you don't define this, the default is two words. If you want
899 to support GNU Ada on your machine, the value of macro must be at least 64. */
900 #define LONG_LONG_TYPE_SIZE 64
901
902 /* A C expression for the size in bits of the type `char' on the target
903 machine. If you don't define this, the default is one quarter of a word.
904 (If this would be less than one storage unit, it is rounded up to one unit.) */
905 #define CHAR_TYPE_SIZE 8
906
907 /* Maximum number for the size in bits of the type `char' on the target
908 machine. If this is undefined, the default is `CHAR_TYPE_SIZE'. Otherwise,
909 it is the constant value that is the largest value that `CHAR_TYPE_SIZE' can
910 have at run-time. This is used in `cpp'. */
911 /* #define MAX_CHAR_TYPE_SIZE */
912
913 /* A C expression for the size in bits of the type `float' on the target
914 machine. If you don't define this, the default is one word. */
915 #define FLOAT_TYPE_SIZE 32
916
917 /* A C expression for the size in bits of the type `double' on the target
918 machine. If you don't define this, the default is two words. */
919 #define DOUBLE_TYPE_SIZE 64
920
921 /* A C expression for the size in bits of the type `long double' on the target
922 machine. If you don't define this, the default is two words. */
923 #define LONG_DOUBLE_TYPE_SIZE 64
924
925 /* An expression whose value is 1 or 0, according to whether the type `char'
926 should be signed or unsigned by default. The user can always override this
927 default with the options `-fsigned-char' and `-funsigned-char'. */
928 #define DEFAULT_SIGNED_CHAR 1
929
930 /* A C expression to determine whether to give an `enum' type only as many
931 bytes as it takes to represent the range of possible values of that type. A
932 nonzero value means to do that; a zero value means all `enum' types should
933 be allocated like `int'.
934
935 If you don't define the macro, the default is 0. */
936 /* #define DEFAULT_SHORT_ENUMS */
937
938 /* A C expression for a string describing the name of the data type to use for
939 size values. The typedef name `size_t' is defined using the contents of the
940 string.
941
942 The string can contain more than one keyword. If so, separate them with
943 spaces, and write first any length keyword, then `unsigned' if appropriate,
944 and finally `int'. The string must exactly match one of the data type names
945 defined in the function `init_decl_processing' in the file `c-decl.c'. You
946 may not omit `int' or change the order--that would cause the compiler to
947 crash on startup.
948
949 If you don't define this macro, the default is `"long unsigned int"'.
950
951 Defined in svr4.h. */
952 /* #define SIZE_TYPE */
953
954 /* A C expression for a string describing the name of the data type to use for
955 the result of subtracting two pointers. The typedef name `ptrdiff_t' is
956 defined using the contents of the string. See `SIZE_TYPE' above for more
957 information.
958
959 If you don't define this macro, the default is `"long int"'.
960
961 Defined in svr4.h. */
962 /* #define PTRDIFF_TYPE */
963
964 /* A C expression for a string describing the name of the data type to use for
965 wide characters. The typedef name `wchar_t' is defined using the contents
966 of the string. See `SIZE_TYPE' above for more information.
967
968 If you don't define this macro, the default is `"int"'.
969
970 Defined in svr4.h. */
971 /* #define WCHAR_TYPE */
972
973 /* A C expression for the size in bits of the data type for wide characters.
974 This is used in `cpp', which cannot make use of `WCHAR_TYPE'.
975
976 Defined in svr4.h. */
977 /* #define WCHAR_TYPE_SIZE */
978
979 /* Maximum number for the size in bits of the data type for wide characters.
980 If this is undefined, the default is `WCHAR_TYPE_SIZE'. Otherwise, it is
981 the constant value that is the largest value that `WCHAR_TYPE_SIZE' can have
982 at run-time. This is used in `cpp'. */
983 /* #define MAX_WCHAR_TYPE_SIZE */
984
985 /* Define this macro if the type of Objective C selectors should be `int'.
986
987 If this macro is not defined, then selectors should have the type `struct
988 objc_selector *'. */
989 /* #define OBJC_INT_SELECTORS */
990
991 /* Define this macro if the compiler can group all the selectors together into
992 a vector and use just one label at the beginning of the vector. Otherwise,
993 the compiler must give each selector its own assembler label.
994
995 On certain machines, it is important to have a separate label for each
996 selector because this enables the linker to eliminate duplicate selectors. */
997 /* #define OBJC_SELECTORS_WITHOUT_LABELS */
998
999 /* A C constant expression for the integer value for escape sequence
1000 `\a'. */
1001 #define TARGET_BELL 0x7
1002
1003 /* C constant expressions for the integer values for escape sequences
1004 `\b', `\t' and `\n'. */
1005 #define TARGET_BS 0x8
1006 #define TARGET_TAB 0x9
1007 #define TARGET_NEWLINE 0xa
1008
1009 /* C constant expressions for the integer values for escape sequences
1010 `\v', `\f' and `\r'. */
1011 #define TARGET_VT 0xb
1012 #define TARGET_FF 0xc
1013 #define TARGET_CR 0xd
1014
1015 \f
1016 /* D30V register layout. */
1017
1018 /* Return true if a value is inside a range */
1019 #define IN_RANGE_P(VALUE, LOW, HIGH) \
1020 (((unsigned)((VALUE) - (LOW))) <= ((unsigned)((HIGH) - (LOW))))
1021
1022 /* General purpose registers. */
1023 #define GPR_FIRST 0 /* First gpr */
1024 #define GPR_LAST (GPR_FIRST + 63) /* Last gpr */
1025 #define GPR_R0 GPR_FIRST /* R0, constant 0 */
1026 #define GPR_ARG_FIRST (GPR_FIRST + 2) /* R2, first argument reg */
1027 #define GPR_ARG_LAST (GPR_FIRST + 17) /* R17, last argument reg */
1028 #define GPR_RET_VALUE GPR_ARG_FIRST /* R2, function return reg */
1029 #define GPR_ATMP_FIRST (GPR_FIRST + 20) /* R20, tmp to save accs */
1030 #define GPR_ATMP_LAST (GPR_FIRST + 21) /* R21, tmp to save accs */
1031 #define GPR_STACK_TMP (GPR_FIRST + 22) /* R22, tmp for saving stack */
1032 #define GPR_RES_FIRST (GPR_FIRST + 32) /* R32, first reserved reg */
1033 #define GPR_RES_LAST (GPR_FIRST + 35) /* R35, last reserved reg */
1034 #define GPR_FP (GPR_FIRST + 61) /* Frame pointer */
1035 #define GPR_LINK (GPR_FIRST + 62) /* Return address register */
1036 #define GPR_SP (GPR_FIRST + 63) /* Stack pointer */
1037
1038 /* Argument register that is eliminated in favor of the frame and/or stack
1039 pointer. Also add register to point to where the return address is
1040 stored. */
1041 #define SPECIAL_REG_FIRST (GPR_LAST + 1)
1042 #define SPECIAL_REG_LAST (SPECIAL_REG_FIRST)
1043 #define ARG_POINTER_REGNUM (SPECIAL_REG_FIRST + 0)
1044 #define SPECIAL_REG_P(R) ((R) == SPECIAL_REG_FIRST)
1045
1046 #define GPR_OR_SPECIAL_REG_P(R) IN_RANGE_P (R, GPR_FIRST, SPECIAL_REG_LAST)
1047 #define GPR_P(R) IN_RANGE_P (R, GPR_FIRST, GPR_LAST)
1048 #define GPR_OR_PSEUDO_P(R) (GPR_OR_SPECIAL_REG_P (R) \
1049 || (R) >= FIRST_PSEUDO_REGISTER)
1050
1051 /* Flag bits. */
1052 #define FLAG_FIRST (SPECIAL_REG_LAST + 1) /* First flag */
1053 #define FLAG_LAST (FLAG_FIRST + 7) /* Last flag */
1054 #define FLAG_F0 (FLAG_FIRST) /* F0, used in prediction */
1055 #define FLAG_F1 (FLAG_FIRST + 1) /* F1, used in prediction */
1056 #define FLAG_F2 (FLAG_FIRST + 2) /* F2, general flag */
1057 #define FLAG_F3 (FLAG_FIRST + 3) /* F3, general flag */
1058 #define FLAG_SAT (FLAG_FIRST + 4) /* F4, saturation flag */
1059 #define FLAG_OVERFLOW (FLAG_FIRST + 5) /* F5, overflow flag */
1060 #define FLAG_ACC_OVER (FLAG_FIRST + 6) /* F6, accumulated overflow */
1061 #define FLAG_CARRY (FLAG_FIRST + 7) /* F7, carry/borrow flag */
1062 #define FLAG_BORROW FLAG_CARRY
1063
1064 #define FLAG_P(R) IN_RANGE_P (R, FLAG_FIRST, FLAG_LAST)
1065 #define FLAG_OR_PSEUDO_P(R) (FLAG_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
1066
1067 #define BR_FLAG_P(R) IN_RANGE_P (R, FLAG_F0, FLAG_F1)
1068 #define BR_FLAG_OR_PSEUDO_P(R) (BR_FLAG_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
1069
1070 /* Accumulators */
1071 #define ACCUM_FIRST (FLAG_LAST + 1) /* First accumulator */
1072 #define ACCUM_A0 ACCUM_FIRST /* Register A0 */
1073 #define ACCUM_A1 (ACCUM_FIRST + 1) /* Register A1 */
1074 #define ACCUM_LAST (ACCUM_FIRST + 1) /* Last accumulator */
1075
1076 #define ACCUM_P(R) IN_RANGE_P (R, ACCUM_FIRST, ACCUM_LAST)
1077 #define ACCUM_OR_PSEUDO_P(R) (ACCUM_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
1078
1079 /* Special registers. Note, we only define the registers that can actually
1080 be used. */
1081 #define CR_FIRST (ACCUM_LAST + 1) /* First CR */
1082 #define CR_LAST (CR_FIRST + 14) /* Last CR */
1083 #define CR_PSW (CR_FIRST + 0) /* CR0, Program status word */
1084 #define CR_BPSW (CR_FIRST + 1) /* CR1, Backup PSW */
1085 #define CR_PC (CR_FIRST + 2) /* CR2, Program counter */
1086 #define CR_BPC (CR_FIRST + 3) /* CR3, Backup PC */
1087 #define CR_DPSW (CR_FIRST + 4) /* CR4, Debug PSW */
1088 #define CR_DPC (CR_FIRST + 5) /* CR5, Debug PC */
1089 #define CR_RPT_C (CR_FIRST + 6) /* CR7, loop count register */
1090 #define CR_RPT_S (CR_FIRST + 7) /* CR8, loop start address */
1091 #define CR_RPT_E (CR_FIRST + 8) /* CR9, loop end address */
1092 #define CR_MOD_S (CR_FIRST + 9) /* CR10, modulo address start*/
1093 #define CR_MOD_E (CR_FIRST + 10) /* CR11, modulo address */
1094 #define CR_IBA (CR_FIRST + 11) /* CR14, Interrupt break addr */
1095 #define CR_EIT_VB (CR_FIRST + 12) /* CR15, EIT vector address */
1096 #define CR_INT_S (CR_FIRST + 13) /* CR16, Interrupt status */
1097 #define CR_INT_M (CR_FIRST + 14) /* CR17, Interrupt mask */
1098
1099 #define CR_P(R) IN_RANGE_P (R, CR_FIRST, CR_LAST)
1100 #define CR_OR_PSEUDO_P(R) (CR_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
1101
1102 \f
1103 /* Register Basics */
1104
1105 /* Number of hardware registers known to the compiler. They receive numbers 0
1106 through `FIRST_PSEUDO_REGISTER-1'; thus, the first pseudo register's number
1107 really is assigned the number `FIRST_PSEUDO_REGISTER'. */
1108 #define FIRST_PSEUDO_REGISTER (CR_LAST + 1)
1109
1110 /* An initializer that says which registers are used for fixed purposes all
1111 throughout the compiled code and are therefore not available for general
1112 allocation. These would include the stack pointer, the frame pointer
1113 (except on machines where that can be used as a general register when no
1114 frame pointer is needed), the program counter on machines where that is
1115 considered one of the addressable registers, and any other numbered register
1116 with a standard use.
1117
1118 This information is expressed as a sequence of numbers, separated by commas
1119 and surrounded by braces. The Nth number is 1 if register N is fixed, 0
1120 otherwise.
1121
1122 The table initialized from this macro, and the table initialized by the
1123 following one, may be overridden at run time either automatically, by the
1124 actions of the macro `CONDITIONAL_REGISTER_USAGE', or by the user with the
1125 command options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. */
1126 #define FIXED_REGISTERS \
1127 { \
1128 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* R0 - R15 */ \
1129 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, /* R16 - R31 */ \
1130 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* R32 - R47 */ \
1131 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* R48 - R63 */ \
1132 1, /* ARG ptr */ \
1133 0, 0, 0, 0, 1, 1, 1, 1, /* F0 - F7 */ \
1134 0, 0, /* A0 - A1 */ \
1135 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* CRs */ \
1136 }
1137
1138 /* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered (in
1139 general) by function calls as well as for fixed registers. This macro
1140 therefore identifies the registers that are not available for general
1141 allocation of values that must live across function calls.
1142
1143 If a register has 0 in `CALL_USED_REGISTERS', the compiler automatically
1144 saves it on function entry and restores it on function exit, if the register
1145 is used within the function. */
1146 #define CALL_USED_REGISTERS \
1147 { \
1148 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* R0 - R15 */ \
1149 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* R16 - R31 */ \
1150 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* R32 - R47 */ \
1151 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* R48 - R63 */ \
1152 1, /* ARG ptr */ \
1153 1, 1, 1, 1, 1, 1, 1, 1, /* F0 - F7 */ \
1154 1, 0, /* A0 - A1 */ \
1155 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* CRs */ \
1156 }
1157
1158 /* Zero or more C statements that may conditionally modify two variables
1159 `fixed_regs' and `call_used_regs' (both of type `char []') after they have
1160 been initialized from the two preceding macros.
1161
1162 This is necessary in case the fixed or call-clobbered registers depend on
1163 target flags.
1164
1165 You need not define this macro if it has no work to do.
1166
1167 If the usage of an entire class of registers depends on the target flags,
1168 you may indicate this to GCC by using this macro to modify `fixed_regs' and
1169 `call_used_regs' to 1 for each of the registers in the classes which should
1170 not be used by GCC. Also define the macro `REG_CLASS_FROM_LETTER' to return
1171 `NO_REGS' if it is called with a letter for a class that shouldn't be used.
1172
1173 (However, if this class is not included in `GENERAL_REGS' and all of the
1174 insn patterns whose constraints permit this class are controlled by target
1175 switches, then GCC will automatically avoid using these registers when the
1176 target switches are opposed to them.) */
1177 /* #define CONDITIONAL_REGISTER_USAGE */
1178
1179 /* If this macro is defined and has a nonzero value, it means that `setjmp' and
1180 related functions fail to save the registers, or that `longjmp' fails to
1181 restore them. To compensate, the compiler avoids putting variables in
1182 registers in functions that use `setjmp'. */
1183 /* #define NON_SAVING_SETJMP */
1184
1185 /* Define this macro if the target machine has register windows. This C
1186 expression returns the register number as seen by the called function
1187 corresponding to the register number OUT as seen by the calling function.
1188 Return OUT if register number OUT is not an outbound register. */
1189 /* #define INCOMING_REGNO(OUT) */
1190
1191 /* Define this macro if the target machine has register windows. This C
1192 expression returns the register number as seen by the calling function
1193 corresponding to the register number IN as seen by the called function.
1194 Return IN if register number IN is not an inbound register. */
1195 /* #define OUTGOING_REGNO(IN) */
1196
1197 \f
1198 /* Order of allocation of registers */
1199
1200 /* If defined, an initializer for a vector of integers, containing the numbers
1201 of hard registers in the order in which GNU CC should prefer to use them
1202 (from most preferred to least).
1203
1204 If this macro is not defined, registers are used lowest numbered first (all
1205 else being equal).
1206
1207 One use of this macro is on machines where the highest numbered registers
1208 must always be saved and the save-multiple-registers instruction supports
1209 only sequences of consecutive registers. On such machines, define
1210 `REG_ALLOC_ORDER' to be an initializer that lists the highest numbered
1211 allocatable register first. */
1212
1213 #define REG_ALLOC_ORDER \
1214 { \
1215 /* volatile registers */ \
1216 GPR_FIRST + 2, GPR_FIRST + 3, GPR_FIRST + 4, GPR_FIRST + 5, \
1217 GPR_FIRST + 6, GPR_FIRST + 7, GPR_FIRST + 8, GPR_FIRST + 9, \
1218 GPR_FIRST + 10, GPR_FIRST + 11, GPR_FIRST + 12, GPR_FIRST + 13, \
1219 GPR_FIRST + 14, GPR_FIRST + 15, GPR_FIRST + 16, GPR_FIRST + 17, \
1220 GPR_FIRST + 18, GPR_FIRST + 19, GPR_FIRST + 20, GPR_FIRST + 21, \
1221 GPR_FIRST + 22, GPR_FIRST + 23, GPR_FIRST + 24, GPR_FIRST + 25, \
1222 GPR_FIRST + 1, \
1223 \
1224 /* saved registers */ \
1225 GPR_FIRST + 34, GPR_FIRST + 35, GPR_FIRST + 36, GPR_FIRST + 37, \
1226 GPR_FIRST + 38, GPR_FIRST + 39, GPR_FIRST + 40, GPR_FIRST + 41, \
1227 GPR_FIRST + 42, GPR_FIRST + 43, GPR_FIRST + 44, GPR_FIRST + 45, \
1228 GPR_FIRST + 46, GPR_FIRST + 47, GPR_FIRST + 48, GPR_FIRST + 49, \
1229 GPR_FIRST + 50, GPR_FIRST + 51, GPR_FIRST + 52, GPR_FIRST + 53, \
1230 GPR_FIRST + 54, GPR_FIRST + 55, GPR_FIRST + 56, GPR_FIRST + 57, \
1231 GPR_FIRST + 58, GPR_FIRST + 59, GPR_FIRST + 60, GPR_FIRST + 61, \
1232 GPR_FIRST + 62, \
1233 \
1234 /* flags */ \
1235 FLAG_F2, FLAG_F3, FLAG_F0, FLAG_F1, \
1236 FLAG_SAT, FLAG_OVERFLOW, FLAG_ACC_OVER, FLAG_CARRY, \
1237 \
1238 /* accumultors */ \
1239 ACCUM_FIRST + 0, ACCUM_FIRST + 1, \
1240 \
1241 /* fixed registers */ \
1242 GPR_FIRST + 0, GPR_FIRST + 26, GPR_FIRST + 27, GPR_FIRST + 28, \
1243 GPR_FIRST + 29, GPR_FIRST + 30, GPR_FIRST + 31, GPR_FIRST + 32, \
1244 GPR_FIRST + 33, GPR_FIRST + 63, \
1245 CR_PSW, CR_BPSW, CR_PC, CR_BPC, \
1246 CR_DPSW, CR_DPC, CR_RPT_C, CR_RPT_S, \
1247 CR_RPT_E, CR_MOD_S, CR_MOD_E, CR_IBA, \
1248 CR_EIT_VB, CR_INT_S, CR_INT_M, \
1249 ARG_POINTER_REGNUM, \
1250 }
1251
1252 /* A C statement (sans semicolon) to choose the order in which to allocate hard
1253 registers for pseudo-registers local to a basic block.
1254
1255 Store the desired register order in the array `reg_alloc_order'. Element 0
1256 should be the register to allocate first; element 1, the next register; and
1257 so on.
1258
1259 The macro body should not assume anything about the contents of
1260 `reg_alloc_order' before execution of the macro.
1261
1262 On most machines, it is not necessary to define this macro. */
1263 /* #define ORDER_REGS_FOR_LOCAL_ALLOC */
1264
1265 \f
1266 /* How Values Fit in Registers */
1267
1268 /* A C expression for the number of consecutive hard registers, starting at
1269 register number REGNO, required to hold a value of mode MODE.
1270
1271 On a machine where all registers are exactly one word, a suitable definition
1272 of this macro is
1273
1274 #define HARD_REGNO_NREGS(REGNO, MODE) \
1275 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
1276 / UNITS_PER_WORD)) */
1277
1278 #define HARD_REGNO_NREGS(REGNO, MODE) \
1279 (ACCUM_P (REGNO) ? ((GET_MODE_SIZE (MODE) + 2*UNITS_PER_WORD - 1) \
1280 / (2*UNITS_PER_WORD)) \
1281 : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
1282 / UNITS_PER_WORD))
1283
1284 /* A C expression that is nonzero if it is permissible to store a value of mode
1285 MODE in hard register number REGNO (or in several registers starting with
1286 that one). For a machine where all registers are equivalent, a suitable
1287 definition is
1288
1289 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
1290
1291 It is not necessary for this macro to check for the numbers of fixed
1292 registers, because the allocation mechanism considers them to be always
1293 occupied.
1294
1295 On some machines, double-precision values must be kept in even/odd register
1296 pairs. The way to implement that is to define this macro to reject odd
1297 register numbers for such modes.
1298
1299 The minimum requirement for a mode to be OK in a register is that the
1300 `movMODE' instruction pattern support moves between the register and any
1301 other hard register for which the mode is OK; and that moving a value into
1302 the register and back out not alter it.
1303
1304 Since the same instruction used to move `SImode' will work for all narrower
1305 integer modes, it is not necessary on any machine for `HARD_REGNO_MODE_OK'
1306 to distinguish between these modes, provided you define patterns `movhi',
1307 etc., to take advantage of this. This is useful because of the interaction
1308 between `HARD_REGNO_MODE_OK' and `MODES_TIEABLE_P'; it is very desirable for
1309 all integer modes to be tieable.
1310
1311 Many machines have special registers for floating point arithmetic. Often
1312 people assume that floating point machine modes are allowed only in floating
1313 point registers. This is not true. Any registers that can hold integers
1314 can safely *hold* a floating point machine mode, whether or not floating
1315 arithmetic can be done on it in those registers. Integer move instructions
1316 can be used to move the values.
1317
1318 On some machines, though, the converse is true: fixed-point machine modes
1319 may not go in floating registers. This is true if the floating registers
1320 normalize any value stored in them, because storing a non-floating value
1321 there would garble it. In this case, `HARD_REGNO_MODE_OK' should reject
1322 fixed-point machine modes in floating registers. But if the floating
1323 registers do not automatically normalize, if you can store any bit pattern
1324 in one and retrieve it unchanged without a trap, then any machine mode may
1325 go in a floating register, so you can define this macro to say so.
1326
1327 The primary significance of special floating registers is rather that they
1328 are the registers acceptable in floating point arithmetic instructions.
1329 However, this is of no concern to `HARD_REGNO_MODE_OK'. You handle it by
1330 writing the proper constraints for those instructions.
1331
1332 On some machines, the floating registers are especially slow to access, so
1333 that it is better to store a value in a stack frame than in such a register
1334 if floating point arithmetic is not being done. As long as the floating
1335 registers are not in class `GENERAL_REGS', they will not be used unless some
1336 pattern's constraint asks for one. */
1337
1338 extern unsigned char hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
1339 #define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok[ (int)MODE ][ REGNO ]
1340
1341 /* A C expression that is nonzero if it is desirable to choose register
1342 allocation so as to avoid move instructions between a value of mode MODE1
1343 and a value of mode MODE2.
1344
1345 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are
1346 ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be
1347 zero. */
1348
1349 extern unsigned char modes_tieable_p[];
1350 #define MODES_TIEABLE_P(MODE1, MODE2) \
1351 modes_tieable_p[ (((int)(MODE1)) * (NUM_MACHINE_MODES)) + (int)(MODE2) ]
1352
1353 /* Define this macro if the compiler should avoid copies to/from CCmode
1354 registers. You should only define this macro if support fo copying to/from
1355 CCmode is incomplete. */
1356
1357 /* On the D30V, copying to/from CCmode is complete, but since there are only
1358 two CC registers usable for conditional tests, this helps gcse not compound
1359 the reload problem. */
1360 #define AVOID_CCMODE_COPIES
1361
1362 \f
1363 /* Handling Leaf Functions */
1364
1365 /* A C initializer for a vector, indexed by hard register number, which
1366 contains 1 for a register that is allowable in a candidate for leaf function
1367 treatment.
1368
1369 If leaf function treatment involves renumbering the registers, then the
1370 registers marked here should be the ones before renumbering--those that GNU
1371 CC would ordinarily allocate. The registers which will actually be used in
1372 the assembler code, after renumbering, should not be marked with 1 in this
1373 vector.
1374
1375 Define this macro only if the target machine offers a way to optimize the
1376 treatment of leaf functions. */
1377 /* #define LEAF_REGISTERS */
1378
1379 /* A C expression whose value is the register number to which REGNO should be
1380 renumbered, when a function is treated as a leaf function.
1381
1382 If REGNO is a register number which should not appear in a leaf function
1383 before renumbering, then the expression should yield -1, which will cause
1384 the compiler to abort.
1385
1386 Define this macro only if the target machine offers a way to optimize the
1387 treatment of leaf functions, and registers need to be renumbered to do this. */
1388 /* #define LEAF_REG_REMAP(REGNO) */
1389
1390 \f
1391 /* Registers That Form a Stack. */
1392
1393 /* Define this if the machine has any stack-like registers. */
1394 /* #define STACK_REGS */
1395
1396 /* The number of the first stack-like register. This one is the top
1397 of the stack. */
1398 /* #define FIRST_STACK_REG */
1399
1400 /* The number of the last stack-like register. This one is the
1401 bottom of the stack. */
1402 /* #define LAST_STACK_REG */
1403
1404 \f
1405 /* Register Classes */
1406
1407 /* An enumeral type that must be defined with all the register class names as
1408 enumeral values. `NO_REGS' must be first. `ALL_REGS' must be the last
1409 register class, followed by one more enumeral value, `LIM_REG_CLASSES',
1410 which is not a register class but rather tells how many classes there are.
1411
1412 Each register class has a number, which is the value of casting the class
1413 name to type `int'. The number serves as an index in many of the tables
1414 described below. */
1415 enum reg_class
1416 {
1417 NO_REGS,
1418 REPEAT_REGS,
1419 CR_REGS,
1420 ACCUM_REGS,
1421 OTHER_FLAG_REGS,
1422 F0_REGS,
1423 F1_REGS,
1424 BR_FLAG_REGS,
1425 FLAG_REGS,
1426 EVEN_REGS,
1427 GPR_REGS,
1428 ALL_REGS,
1429 LIM_REG_CLASSES
1430 };
1431
1432 #define GENERAL_REGS GPR_REGS
1433
1434 /* The number of distinct register classes, defined as follows:
1435
1436 #define N_REG_CLASSES (int) LIM_REG_CLASSES */
1437 #define N_REG_CLASSES ((int) LIM_REG_CLASSES)
1438
1439 /* An initializer containing the names of the register classes as C string
1440 constants. These names are used in writing some of the debugging dumps. */
1441 #define REG_CLASS_NAMES \
1442 { \
1443 "NO_REGS", \
1444 "REPEAT_REGS", \
1445 "CR_REGS", \
1446 "ACCUM_REGS", \
1447 "OTHER_FLAG_REGS", \
1448 "F0_REGS", \
1449 "F1_REGS", \
1450 "BR_FLAG_REGS", \
1451 "FLAG_REGS", \
1452 "EVEN_REGS", \
1453 "GPR_REGS", \
1454 "ALL_REGS", \
1455 }
1456
1457 /* Create mask bits for 3rd word of REG_CLASS_CONTENTS */
1458 #define MASK_WORD3(REG) ((long)1 << ((REG) - 64))
1459
1460 #define NO_MASK 0
1461 #define REPEAT_MASK MASK_WORD3 (CR_RPT_C)
1462 #define CR_MASK (MASK_WORD3 (CR_PSW) | MASK_WORD3 (CR_BPSW) \
1463 | MASK_WORD3 (CR_PC) | MASK_WORD3 (CR_BPC) \
1464 | MASK_WORD3 (CR_DPSW) | MASK_WORD3 (CR_DPC) \
1465 | MASK_WORD3 (CR_RPT_C) | MASK_WORD3 (CR_RPT_S) \
1466 | MASK_WORD3 (CR_RPT_E) | MASK_WORD3 (CR_MOD_S) \
1467 | MASK_WORD3 (CR_MOD_E) | MASK_WORD3 (CR_IBA) \
1468 | MASK_WORD3 (CR_EIT_VB) | MASK_WORD3 (CR_INT_S) \
1469 | MASK_WORD3 (CR_INT_M))
1470
1471 #define ACCUM_MASK (MASK_WORD3 (ACCUM_A0) | MASK_WORD3 (ACCUM_A1))
1472 #define OTHER_FLAG_MASK (MASK_WORD3 (FLAG_F2) | MASK_WORD3 (FLAG_F3) \
1473 | MASK_WORD3 (FLAG_SAT) | MASK_WORD3 (FLAG_OVERFLOW) \
1474 | MASK_WORD3 (FLAG_ACC_OVER) | MASK_WORD3 (FLAG_CARRY))
1475
1476 #define F0_MASK MASK_WORD3 (FLAG_F0)
1477 #define F1_MASK MASK_WORD3 (FLAG_F1)
1478 #define BR_FLAG_MASK (F0_MASK | F1_MASK)
1479 #define FLAG_MASK (BR_FLAG_MASK | OTHER_FLAG_MASK)
1480 #define SPECIAL_MASK MASK_WORD3 (ARG_POINTER_REGNUM)
1481
1482 #define ALL_MASK (CR_MASK | ACCUM_MASK | FLAG_MASK | SPECIAL_MASK)
1483
1484 /* An initializer containing the contents of the register classes, as integers
1485 which are bit masks. The Nth integer specifies the contents of class N.
1486 The way the integer MASK is interpreted is that register R is in the class
1487 if `MASK & (1 << R)' is 1.
1488
1489 When the machine has more than 32 registers, an integer does not suffice.
1490 Then the integers are replaced by sub-initializers, braced groupings
1491 containing several integers. Each sub-initializer must be suitable as an
1492 initializer for the type `HARD_REG_SET' which is defined in
1493 `hard-reg-set.h'. */
1494 #define REG_CLASS_CONTENTS \
1495 { \
1496 { 0x00000000, 0x00000000, NO_MASK }, /* NO_REGS */ \
1497 { 0x00000000, 0x00000000, REPEAT_MASK }, /* REPEAT_REGS */ \
1498 { 0x00000000, 0x00000000, CR_MASK }, /* CR_REGS */ \
1499 { 0x00000000, 0x00000000, ACCUM_MASK }, /* ACCUM_REGS */ \
1500 { 0x00000000, 0x00000000, OTHER_FLAG_MASK }, /* OTHER_FLAG_REGS */ \
1501 { 0x00000000, 0x00000000, F0_MASK }, /* F0_REGS */ \
1502 { 0x00000000, 0x00000000, F1_MASK }, /* F1_REGS */ \
1503 { 0x00000000, 0x00000000, BR_FLAG_MASK }, /* BR_FLAG_REGS */ \
1504 { 0x00000000, 0x00000000, FLAG_MASK }, /* FLAG_REGS */ \
1505 { 0xfffffffc, 0x3fffffff, NO_MASK }, /* EVEN_REGS */ \
1506 { 0xffffffff, 0xffffffff, SPECIAL_MASK }, /* GPR_REGS */ \
1507 { 0xffffffff, 0xffffffff, ALL_MASK }, /* ALL_REGS */ \
1508 }
1509
1510 /* A C expression whose value is a register class containing hard register
1511 REGNO. In general there is more than one such class; choose a class which
1512 is "minimal", meaning that no smaller class also contains the register. */
1513
1514 extern enum reg_class regno_reg_class[];
1515 #define REGNO_REG_CLASS(REGNO) regno_reg_class[ (REGNO) ]
1516
1517 /* A macro whose definition is the name of the class to which a valid base
1518 register must belong. A base register is one used in an address which is
1519 the register value plus a displacement. */
1520 #define BASE_REG_CLASS GPR_REGS
1521
1522 /* A macro whose definition is the name of the class to which a valid index
1523 register must belong. An index register is one used in an address where its
1524 value is either multiplied by a scale factor or added to another register
1525 (as well as added to a displacement). */
1526 #define INDEX_REG_CLASS GPR_REGS
1527
1528 /* A C expression which defines the machine-dependent operand constraint
1529 letters for register classes. If CHAR is such a letter, the value should be
1530 the register class corresponding to it. Otherwise, the value should be
1531 `NO_REGS'. The register letter `r', corresponding to class `GENERAL_REGS',
1532 will not be passed to this macro; you do not need to handle it.
1533
1534 The following letters are unavailable, due to being used as
1535 constraints:
1536 '0'..'9'
1537 '<', '>'
1538 'E', 'F', 'G', 'H'
1539 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'
1540 'Q', 'R', 'S', 'T', 'U'
1541 'V', 'X'
1542 'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */
1543
1544 extern enum reg_class reg_class_from_letter[];
1545 #define REG_CLASS_FROM_LETTER(CHAR) reg_class_from_letter[ CHAR ]
1546
1547 /* A C expression which is nonzero if register number NUM is suitable for use
1548 as a base register in operand addresses. It may be either a suitable hard
1549 register or a pseudo register that has been allocated such a hard register. */
1550
1551 #define REGNO_OK_FOR_BASE_P(NUM) \
1552 ((NUM) < FIRST_PSEUDO_REGISTER \
1553 ? GPR_P (NUM) \
1554 : (reg_renumber[NUM] >= 0 && GPR_P (reg_renumber[NUM])))
1555
1556
1557 /* A C expression which is nonzero if register number NUM is suitable for use
1558 as an index register in operand addresses. It may be either a suitable hard
1559 register or a pseudo register that has been allocated such a hard register.
1560
1561 The difference between an index register and a base register is that the
1562 index register may be scaled. If an address involves the sum of two
1563 registers, neither one of them scaled, then either one may be labeled the
1564 "base" and the other the "index"; but whichever labeling is used must fit
1565 the machine's constraints of which registers may serve in each capacity.
1566 The compiler will try both labelings, looking for one that is valid, and
1567 will reload one or both registers only if neither labeling works. */
1568
1569 #define REGNO_OK_FOR_INDEX_P(NUM) \
1570 ((NUM) < FIRST_PSEUDO_REGISTER \
1571 ? GPR_P (NUM) \
1572 : (reg_renumber[NUM] >= 0 && GPR_P (reg_renumber[NUM])))
1573
1574 /* A C expression that places additional restrictions on the register class to
1575 use when it is necessary to copy value X into a register in class CLASS.
1576 The value is a register class; perhaps CLASS, or perhaps another, smaller
1577 class. On many machines, the following definition is safe:
1578
1579 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
1580
1581 Sometimes returning a more restrictive class makes better code. For
1582 example, on the 68000, when X is an integer constant that is in range for a
1583 `moveq' instruction, the value of this macro is always `DATA_REGS' as long
1584 as CLASS includes the data registers. Requiring a data register guarantees
1585 that a `moveq' will be used.
1586
1587 If X is a `const_double', by returning `NO_REGS' you can force X into a
1588 memory constant. This is useful on certain machines where immediate
1589 floating values cannot be loaded into certain kinds of registers. */
1590 #define PREFERRED_RELOAD_CLASS(X, CLASS) CLASS
1591
1592 /* Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of input
1593 reloads. If you don't define this macro, the default is to use CLASS,
1594 unchanged. */
1595 /* #define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) */
1596
1597 /* A C expression that places additional restrictions on the register class to
1598 use when it is necessary to be able to hold a value of mode MODE in a reload
1599 register for which class CLASS would ordinarily be used.
1600
1601 Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when there are
1602 certain modes that simply can't go in certain reload classes.
1603
1604 The value is a register class; perhaps CLASS, or perhaps another, smaller
1605 class.
1606
1607 Don't define this macro unless the target machine has limitations which
1608 require the macro to do something nontrivial. */
1609 /* #define LIMIT_RELOAD_CLASS(MODE, CLASS) */
1610
1611 /* Many machines have some registers that cannot be copied directly to or from
1612 memory or even from other types of registers. An example is the `MQ'
1613 register, which on most machines, can only be copied to or from general
1614 registers, but not memory. Some machines allow copying all registers to and
1615 from memory, but require a scratch register for stores to some memory
1616 locations (e.g., those with symbolic address on the RT, and those with
1617 certain symbolic address on the Sparc when compiling PIC). In some cases,
1618 both an intermediate and a scratch register are required.
1619
1620 You should define these macros to indicate to the reload phase that it may
1621 need to allocate at least one register for a reload in addition to the
1622 register to contain the data. Specifically, if copying X to a register
1623 CLASS in MODE requires an intermediate register, you should define
1624 `SECONDARY_INPUT_RELOAD_CLASS' to return the largest register class all of
1625 whose registers can be used as intermediate registers or scratch registers.
1626
1627 If copying a register CLASS in MODE to X requires an intermediate or scratch
1628 register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be defined to return the
1629 largest register class required. If the requirements for input and output
1630 reloads are the same, the macro `SECONDARY_RELOAD_CLASS' should be used
1631 instead of defining both macros identically.
1632
1633 The values returned by these macros are often `GENERAL_REGS'. Return
1634 `NO_REGS' if no spare register is needed; i.e., if X can be directly copied
1635 to or from a register of CLASS in MODE without requiring a scratch register.
1636 Do not define this macro if it would always return `NO_REGS'.
1637
1638 If a scratch register is required (either with or without an intermediate
1639 register), you should define patterns for `reload_inM' or `reload_outM', as
1640 required (*note Standard Names::.. These patterns, which will normally be
1641 implemented with a `define_expand', should be similar to the `movM'
1642 patterns, except that operand 2 is the scratch register.
1643
1644 Define constraints for the reload register and scratch register that contain
1645 a single register class. If the original reload register (whose class is
1646 CLASS) can meet the constraint given in the pattern, the value returned by
1647 these macros is used for the class of the scratch register. Otherwise, two
1648 additional reload registers are required. Their classes are obtained from
1649 the constraints in the insn pattern.
1650
1651 X might be a pseudo-register or a `subreg' of a pseudo-register, which could
1652 either be in a hard register or in memory. Use `true_regnum' to find out;
1653 it will return -1 if the pseudo is in memory and the hard register number if
1654 it is in a register.
1655
1656 These macros should not be used in the case where a particular class of
1657 registers can only be copied to memory and not to another class of
1658 registers. In that case, secondary reload registers are not needed and
1659 would not be helpful. Instead, a stack location must be used to perform the
1660 copy and the `movM' pattern should use memory as a intermediate storage.
1661 This case often occurs between floating-point and general registers. */
1662
1663 #define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \
1664 ((CLASS) == GPR_REGS ? NO_REGS \
1665 : (CLASS) == EVEN_REGS ? NO_REGS \
1666 : (CLASS) == ACCUM_REGS ? EVEN_REGS \
1667 : GPR_REGS)
1668
1669 /* #define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) */
1670 /* #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) */
1671
1672 /* Certain machines have the property that some registers cannot be copied to
1673 some other registers without using memory. Define this macro on those
1674 machines to be a C expression that is non-zero if objects of mode M in
1675 registers of CLASS1 can only be copied to registers of class CLASS2 by
1676 storing a register of CLASS1 into memory and loading that memory location
1677 into a register of CLASS2.
1678
1679 Do not define this macro if its value would always be zero. */
1680 /* #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, M) */
1681
1682 /* Normally when `SECONDARY_MEMORY_NEEDED' is defined, the compiler allocates a
1683 stack slot for a memory location needed for register copies. If this macro
1684 is defined, the compiler instead uses the memory location defined by this
1685 macro.
1686
1687 Do not define this macro if you do not define
1688 `SECONDARY_MEMORY_NEEDED'. */
1689 /* #define SECONDARY_MEMORY_NEEDED_RTX(MODE) */
1690
1691 /* When the compiler needs a secondary memory location to copy between two
1692 registers of mode MODE, it normally allocates sufficient memory to hold a
1693 quantity of `BITS_PER_WORD' bits and performs the store and load operations
1694 in a mode that many bits wide and whose class is the same as that of MODE.
1695
1696 This is right thing to do on most machines because it ensures that all bits
1697 of the register are copied and prevents accesses to the registers in a
1698 narrower mode, which some machines prohibit for floating-point registers.
1699
1700 However, this default behavior is not correct on some machines, such as the
1701 DEC Alpha, that store short integers in floating-point registers differently
1702 than in integer registers. On those machines, the default widening will not
1703 work correctly and you must define this macro to suppress that widening in
1704 some cases. See the file `alpha.h' for details.
1705
1706 Do not define this macro if you do not define `SECONDARY_MEMORY_NEEDED' or
1707 if widening MODE to a mode that is `BITS_PER_WORD' bits wide is correct for
1708 your machine. */
1709 /* #define SECONDARY_MEMORY_NEEDED_MODE(MODE) */
1710
1711 /* Normally the compiler avoids choosing registers that have been explicitly
1712 mentioned in the rtl as spill registers (these registers are normally those
1713 used to pass parameters and return values). However, some machines have so
1714 few registers of certain classes that there would not be enough registers to
1715 use as spill registers if this were done.
1716
1717 Define `SMALL_REGISTER_CLASSES' to be an expression with a non-zero value on
1718 these machines. When this macro has a non-zero value, the compiler allows
1719 registers explicitly used in the rtl to be used as spill registers but
1720 avoids extending the lifetime of these registers.
1721
1722 It is always safe to define this macro with a non-zero value, but if you
1723 unnecessarily define it, you will reduce the amount of optimizations that
1724 can be performed in some cases. If you do not define this macro with a
1725 non-zero value when it is required, the compiler will run out of spill
1726 registers and print a fatal error message. For most machines, you should
1727 not define this macro at all. */
1728 /* #define SMALL_REGISTER_CLASSES */
1729
1730 /* A C expression whose value is nonzero if pseudos that have been assigned to
1731 registers of class CLASS would likely be spilled because registers of CLASS
1732 are needed for spill registers.
1733
1734 The default value of this macro returns 1 if CLASS has exactly one register
1735 and zero otherwise. On most machines, this default should be used. Only
1736 define this macro to some other expression if pseudo allocated by
1737 `local-alloc.c' end up in memory because their hard registers were needed
1738 for spill registers. If this macro returns nonzero for those classes, those
1739 pseudos will only be allocated by `global.c', which knows how to reallocate
1740 the pseudo to another register. If there would not be another register
1741 available for reallocation, you should not change the definition of this
1742 macro since the only effect of such a definition would be to slow down
1743 register allocation. */
1744 #define CLASS_LIKELY_SPILLED_P(CLASS) \
1745 ((CLASS) != GPR_REGS && (CLASS) != EVEN_REGS)
1746
1747 /* A C expression for the maximum number of consecutive registers of
1748 class CLASS needed to hold a value of mode MODE.
1749
1750 This is closely related to the macro `HARD_REGNO_NREGS'. In fact, the value
1751 of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be the maximum value of
1752 `HARD_REGNO_NREGS (REGNO, MODE)' for all REGNO values in the class CLASS.
1753
1754 This macro helps control the handling of multiple-word values in
1755 the reload pass. */
1756
1757 #define CLASS_MAX_NREGS(CLASS, MODE) \
1758 (((CLASS) == ACCUM_REGS) \
1759 ? ((GET_MODE_SIZE (MODE) + 8 - 1) / 8) \
1760 : ((GET_MODE_SIZE (MODE) + 4 - 1) / 4))
1761
1762 /* A C expression that defines the machine-dependent operand constraint letters
1763 (`I', `J', `K', .. 'P') that specify particular ranges of integer values.
1764 If C is one of those letters, the expression should check that VALUE, an
1765 integer, is in the appropriate range and return 1 if so, 0 otherwise. If C
1766 is not one of those letters, the value should be 0 regardless of VALUE. */
1767 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
1768 ((C) == 'I' ? IN_RANGE_P (VALUE, -32, 31) \
1769 : (C) == 'J' ? IN_RANGE_P (VALUE, 0, 31) \
1770 : (C) == 'K' ? IN_RANGE_P (exact_log2 (VALUE), 0, 31) \
1771 : (C) == 'L' ? IN_RANGE_P (exact_log2 (~ (VALUE)), 0, 31) \
1772 : (C) == 'M' ? ((VALUE) == 32) \
1773 : (C) == 'N' ? ((VALUE) == 1) \
1774 : (C) == 'O' ? ((VALUE) == 0) \
1775 : (C) == 'P' ? IN_RANGE_P (VALUE, 32, 63) \
1776 : FALSE)
1777
1778 /* A C expression that defines the machine-dependent operand constraint letters
1779 (`G', `H') that specify particular ranges of `const_double' values.
1780
1781 If C is one of those letters, the expression should check that VALUE, an RTX
1782 of code `const_double', is in the appropriate range and return 1 if so, 0
1783 otherwise. If C is not one of those letters, the value should be 0
1784 regardless of VALUE.
1785
1786 `const_double' is used for all floating-point constants and for `DImode'
1787 fixed-point constants. A given letter can accept either or both kinds of
1788 values. It can use `GET_MODE' to distinguish between these kinds. */
1789 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
1790 ((C) == 'G' ? (CONST_DOUBLE_LOW (VALUE) == 0 \
1791 && CONST_DOUBLE_HIGH (VALUE) == 0) \
1792 : (C) == 'H' ? FALSE \
1793 : FALSE)
1794
1795 /* A C expression that defines the optional machine-dependent constraint
1796 letters (`Q', `R', `S', `T', `U') that can be used to segregate specific
1797 types of operands, usually memory references, for the target machine.
1798 Normally this macro will not be defined. If it is required for a particular
1799 target machine, it should return 1 if VALUE corresponds to the operand type
1800 represented by the constraint letter C. If C is not defined as an extra
1801 constraint, the value returned should be 0 regardless of VALUE.
1802
1803 For example, on the ROMP, load instructions cannot have their output in r0
1804 if the memory reference contains a symbolic address. Constraint letter `Q'
1805 is defined as representing a memory address that does *not* contain a
1806 symbolic address. An alternative is specified with a `Q' constraint on the
1807 input and `r' on the output. The next alternative specifies `m' on the
1808 input and a register class that does not include r0 on the output. */
1809
1810 #define EXTRA_CONSTRAINT(VALUE, C) \
1811 (((C) == 'Q') ? short_memory_operand ((VALUE), GET_MODE (VALUE)) \
1812 : ((C) == 'R') ? single_reg_memory_operand ((VALUE), GET_MODE (VALUE)) \
1813 : ((C) == 'S') ? const_addr_memory_operand ((VALUE), GET_MODE (VALUE)) \
1814 : ((C) == 'T') ? long_memory_operand ((VALUE), GET_MODE (VALUE)) \
1815 : ((C) == 'U') ? FALSE \
1816 : FALSE)
1817
1818 \f
1819 /* Basic Stack Layout */
1820
1821 /* Stack layout */
1822
1823 /* Structure used to define the d30v stack */
1824 typedef struct d30v_stack {
1825 int varargs_p; /* whether this is a varargs function */
1826 int varargs_size; /* size to hold varargs args passed in regs */
1827 int vars_size; /* variable save area size */
1828 int parm_size; /* outgoing parameter size */
1829 int gpr_size; /* size of saved GPR registers */
1830 int accum_size; /* size of saved ACCUM registers */
1831 int total_size; /* total bytes allocated for stack */
1832 /* which registers are to be saved */
1833 int save_offset; /* offset from new sp to start saving vars at */
1834 int link_offset; /* offset r62 is saved at */
1835 int memrefs_varargs; /* # of 2 word memory references for varargs */
1836 int memrefs_2words; /* # of 2 word memory references */
1837 int memrefs_1word; /* # of 1 word memory references */
1838 /* 1 for ldw/stw ops; 2 for ld2w/st2w ops */
1839 unsigned char save_p[FIRST_PSEUDO_REGISTER];
1840 } d30v_stack_t;
1841
1842 /* Define this macro if pushing a word onto the stack moves the stack pointer
1843 to a smaller address.
1844
1845 When we say, "define this macro if ...," it means that the compiler checks
1846 this macro only with `#ifdef' so the precise definition used does not
1847 matter. */
1848 #define STACK_GROWS_DOWNWARD 1
1849
1850 /* Define this macro if the addresses of local variable slots are at negative
1851 offsets from the frame pointer. */
1852 /* #define FRAME_GROWS_DOWNWARD */
1853
1854 /* Define this macro if successive arguments to a function occupy decreasing
1855 addresses on the stack. */
1856 /* #define ARGS_GROW_DOWNWARD */
1857
1858 /* Offset from the frame pointer to the first local variable slot to be
1859 allocated.
1860
1861 If `FRAME_GROWS_DOWNWARD', find the next slot's offset by subtracting the
1862 first slot's length from `STARTING_FRAME_OFFSET'. Otherwise, it is found by
1863 adding the length of the first slot to the value `STARTING_FRAME_OFFSET'. */
1864
1865 #define STARTING_FRAME_OFFSET \
1866 (D30V_ALIGN (current_function_outgoing_args_size, \
1867 (STACK_BOUNDARY / BITS_PER_UNIT)))
1868
1869 /* Offset from the stack pointer register to the first location at which
1870 outgoing arguments are placed. If not specified, the default value of zero
1871 is used. This is the proper value for most machines.
1872
1873 If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first
1874 location at which outgoing arguments are placed. */
1875 /* #define STACK_POINTER_OFFSET */
1876
1877 /* Offset from the argument pointer register to the first argument's address.
1878 On some machines it may depend on the data type of the function.
1879
1880 If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first
1881 argument's address. */
1882 #define FIRST_PARM_OFFSET(FUNDECL) 0
1883
1884 /* Offset from the stack pointer register to an item dynamically allocated on
1885 the stack, e.g., by `alloca'.
1886
1887 The default value for this macro is `STACK_POINTER_OFFSET' plus the length
1888 of the outgoing arguments. The default is correct for most machines. See
1889 `function.c' for details. */
1890 /* #define STACK_DYNAMIC_OFFSET(FUNDECL) */
1891
1892 /* A C expression whose value is RTL representing the address in a stack frame
1893 where the pointer to the caller's frame is stored. Assume that FRAMEADDR is
1894 an RTL expression for the address of the stack frame itself.
1895
1896 If you don't define this macro, the default is to return the value of
1897 FRAMEADDR--that is, the stack frame address is also the address of the stack
1898 word that points to the previous frame. */
1899 /* #define DYNAMIC_CHAIN_ADDRESS(FRAMEADDR) */
1900
1901 /* If defined, a C expression that produces the machine-specific code to setup
1902 the stack so that arbitrary frames can be accessed. For example, on the
1903 Sparc, we must flush all of the register windows to the stack before we can
1904 access arbitrary stack frames. This macro will seldom need to be defined. */
1905 /* #define SETUP_FRAME_ADDRESSES() */
1906
1907 /* A C expression whose value is RTL representing the value of the return
1908 address for the frame COUNT steps up from the current frame, after the
1909 prologue. FRAMEADDR is the frame pointer of the COUNT frame, or the frame
1910 pointer of the COUNT - 1 frame if `RETURN_ADDR_IN_PREVIOUS_FRAME' is
1911 defined.
1912
1913 The value of the expression must always be the correct address when COUNT is
1914 zero, but may be `NULL_RTX' if there is not way to determine the return
1915 address of other frames. */
1916
1917 /* ??? This definition fails for leaf functions. There is currently no
1918 general solution for this problem. */
1919
1920 /* ??? There appears to be no way to get the return address of any previous
1921 frame except by disassembling instructions in the prologue/epilogue.
1922 So currently we support only the current frame. */
1923
1924 #define RETURN_ADDR_RTX(COUNT, FRAME) \
1925 ((COUNT) == 0 ? d30v_return_addr() : const0_rtx)
1926
1927 /* Define this if the return address of a particular stack frame is
1928 accessed from the frame pointer of the previous stack frame. */
1929 /* #define RETURN_ADDR_IN_PREVIOUS_FRAME */
1930
1931 /* A C expression whose value is RTL representing the location of the incoming
1932 return address at the beginning of any function, before the prologue. This
1933 RTL is either a `REG', indicating that the return value is saved in `REG',
1934 or a `MEM' representing a location in the stack.
1935
1936 You only need to define this macro if you want to support call frame
1937 debugging information like that provided by DWARF 2. */
1938
1939 /* Before the prologue, RA lives in r62. */
1940 #define INCOMING_RETURN_ADDR_RTX gen_rtx (REG, Pmode, GPR_LINK)
1941
1942 /* A C expression whose value is an integer giving the offset, in bytes, from
1943 the value of the stack pointer register to the top of the stack frame at the
1944 beginning of any function, before the prologue. The top of the frame is
1945 defined to be the value of the stack pointer in the previous frame, just
1946 before the call instruction.
1947
1948 You only need to define this macro if you want to support call frame
1949 debugging information like that provided by DWARF 2. */
1950 #define INCOMING_FRAME_SP_OFFSET 0
1951
1952 /* Initialize data used by insn expanders. This is called from insn_emit,
1953 once for every function before code is generated. */
1954
1955 #define INIT_EXPANDERS d30v_init_expanders ()
1956 extern void d30v_init_expanders ();
1957 \f
1958 /* Stack Checking. */
1959
1960 /* A nonzero value if stack checking is done by the configuration files in a
1961 machine-dependent manner. You should define this macro if stack checking is
1962 require by the ABI of your machine or if you would like to have to stack
1963 checking in some more efficient way than GNU CC's portable approach. The
1964 default value of this macro is zero. */
1965 /* #define STACK_CHECK_BUILTIN */
1966
1967 /* An integer representing the interval at which GNU CC must generate stack
1968 probe instructions. You will normally define this macro to be no larger
1969 than the size of the "guard pages" at the end of a stack area. The default
1970 value of 4096 is suitable for most systems. */
1971 /* #define STACK_CHECK_PROBE_INTERVAL */
1972
1973 /* A integer which is nonzero if GNU CC should perform the stack probe as a
1974 load instruction and zero if GNU CC should use a store instruction. The
1975 default is zero, which is the most efficient choice on most systems. */
1976 /* #define STACK_CHECK_PROBE_LOAD */
1977
1978 /* The number of bytes of stack needed to recover from a stack overflow, for
1979 languages where such a recovery is supported. The default value of 75 words
1980 should be adequate for most machines. */
1981 /* #define STACK_CHECK_PROTECT */
1982
1983 /* The maximum size of a stack frame, in bytes. GNU CC will generate probe
1984 instructions in non-leaf functions to ensure at least this many bytes of
1985 stack are available. If a stack frame is larger than this size, stack
1986 checking will not be reliable and GNU CC will issue a warning. The default
1987 is chosen so that GNU CC only generates one instruction on most systems.
1988 You should normally not change the default value of this macro. */
1989 /* #define STACK_CHECK_MAX_FRAME_SIZE */
1990
1991 /* GNU CC uses this value to generate the above warning message. It represents
1992 the amount of fixed frame used by a function, not including space for any
1993 callee-saved registers, temporaries and user variables. You need only
1994 specify an upper bound for this amount and will normally use the default of
1995 four words. */
1996 /* #define STACK_CHECK_FIXED_FRAME_SIZE */
1997
1998 /* The maximum size, in bytes, of an object that GNU CC will place in the fixed
1999 area of the stack frame when the user specifies `-fstack-check'. GNU CC
2000 computed the default from the values of the above macros and you will
2001 normally not need to override that default. */
2002 /* #define STACK_CHECK_MAX_VAR_SIZE */
2003
2004 \f
2005 /* Register That Address the Stack Frame. */
2006
2007 /* The register number of the stack pointer register, which must also be a
2008 fixed register according to `FIXED_REGISTERS'. On most machines, the
2009 hardware determines which register this is. */
2010 #define STACK_POINTER_REGNUM GPR_SP
2011
2012 /* The register number of the frame pointer register, which is used to access
2013 automatic variables in the stack frame. On some machines, the hardware
2014 determines which register this is. On other machines, you can choose any
2015 register you wish for this purpose. */
2016 #define FRAME_POINTER_REGNUM GPR_FP
2017
2018 /* On some machines the offset between the frame pointer and starting offset of
2019 the automatic variables is not known until after register allocation has
2020 been done (for example, because the saved registers are between these two
2021 locations). On those machines, define `FRAME_POINTER_REGNUM' the number of
2022 a special, fixed register to be used internally until the offset is known,
2023 and define `HARD_FRAME_POINTER_REGNUM' to be actual the hard register number
2024 used for the frame pointer.
2025
2026 You should define this macro only in the very rare circumstances when it is
2027 not possible to calculate the offset between the frame pointer and the
2028 automatic variables until after register allocation has been completed.
2029 When this macro is defined, you must also indicate in your definition of
2030 `ELIMINABLE_REGS' how to eliminate `FRAME_POINTER_REGNUM' into either
2031 `HARD_FRAME_POINTER_REGNUM' or `STACK_POINTER_REGNUM'.
2032
2033 Do not define this macro if it would be the same as `FRAME_POINTER_REGNUM'. */
2034 /* #define HARD_FRAME_POINTER_REGNUM */
2035
2036 /* The register number of the arg pointer register, which is used to access the
2037 function's argument list. On some machines, this is the same as the frame
2038 pointer register. On some machines, the hardware determines which register
2039 this is. On other machines, you can choose any register you wish for this
2040 purpose. If this is not the same register as the frame pointer register,
2041 then you must mark it as a fixed register according to `FIXED_REGISTERS', or
2042 arrange to be able to eliminate it (*note Elimination::.). */
2043 /* #define ARG_POINTER_REGNUM */
2044
2045 /* The register number of the return address pointer register, which is used to
2046 access the current function's return address from the stack. On some
2047 machines, the return address is not at a fixed offset from the frame pointer
2048 or stack pointer or argument pointer. This register can be defined to point
2049 to the return address on the stack, and then be converted by
2050 `ELIMINABLE_REGS' into either the frame pointer or stack pointer.
2051
2052 Do not define this macro unless there is no other way to get the return
2053 address from the stack. */
2054 /* #define RETURN_ADDRESS_POINTER_REGNUM */
2055
2056 /* Register numbers used for passing a function's static chain pointer. If
2057 register windows are used, the register number as seen by the called
2058 function is `STATIC_CHAIN_INCOMING_REGNUM', while the register number as
2059 seen by the calling function is `STATIC_CHAIN_REGNUM'. If these registers
2060 are the same, `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
2061
2062 The static chain register need not be a fixed register.
2063
2064 If the static chain is passed in memory, these macros should not be defined;
2065 instead, the next two macros should be defined. */
2066
2067 #define STATIC_CHAIN_REGNUM (GPR_FIRST + 18)
2068 /* #define STATIC_CHAIN_INCOMING_REGNUM */
2069
2070 /* If the static chain is passed in memory, these macros provide rtx giving
2071 `mem' expressions that denote where they are stored. `STATIC_CHAIN' and
2072 `STATIC_CHAIN_INCOMING' give the locations as seen by the calling and called
2073 functions, respectively. Often the former will be at an offset from the
2074 stack pointer and the latter at an offset from the frame pointer.
2075
2076 The variables `stack_pointer_rtx', `frame_pointer_rtx', and
2077 `arg_pointer_rtx' will have been initialized prior to the use of these
2078 macros and should be used to refer to those items.
2079
2080 If the static chain is passed in a register, the two previous
2081 macros should be defined instead. */
2082 /* #define STATIC_CHAIN */
2083 /* #define STATIC_CHAIN_INCOMING */
2084
2085 \f
2086 /* Eliminating the Frame Pointer and the Arg Pointer */
2087
2088 /* A C expression which is nonzero if a function must have and use a frame
2089 pointer. This expression is evaluated in the reload pass. If its value is
2090 nonzero the function will have a frame pointer.
2091
2092 The expression can in principle examine the current function and decide
2093 according to the facts, but on most machines the constant 0 or the constant
2094 1 suffices. Use 0 when the machine allows code to be generated with no
2095 frame pointer, and doing so saves some time or space. Use 1 when there is
2096 no possible advantage to avoiding a frame pointer.
2097
2098 In certain cases, the compiler does not know how to produce valid code
2099 without a frame pointer. The compiler recognizes those cases and
2100 automatically gives the function a frame pointer regardless of what
2101 `FRAME_POINTER_REQUIRED' says. You don't need to worry about them.
2102
2103 In a function that does not require a frame pointer, the frame pointer
2104 register can be allocated for ordinary usage, unless you mark it as a fixed
2105 register. See `FIXED_REGISTERS' for more information. */
2106 #define FRAME_POINTER_REQUIRED 0
2107
2108 /* A C statement to store in the variable DEPTH-VAR the difference between the
2109 frame pointer and the stack pointer values immediately after the function
2110 prologue. The value would be computed from information such as the result
2111 of `get_frame_size ()' and the tables of registers `regs_ever_live' and
2112 `call_used_regs'.
2113
2114 If `ELIMINABLE_REGS' is defined, this macro will be not be used and need not
2115 be defined. Otherwise, it must be defined even if `FRAME_POINTER_REQUIRED'
2116 is defined to always be true; in that case, you may set DEPTH-VAR to
2117 anything. */
2118 /* #define INITIAL_FRAME_POINTER_OFFSET(DEPTH_VAR) */
2119
2120 /* If defined, this macro specifies a table of register pairs used to eliminate
2121 unneeded registers that point into the stack frame. If it is not defined,
2122 the only elimination attempted by the compiler is to replace references to
2123 the frame pointer with references to the stack pointer.
2124
2125 The definition of this macro is a list of structure initializations, each of
2126 which specifies an original and replacement register.
2127
2128 On some machines, the position of the argument pointer is not known until
2129 the compilation is completed. In such a case, a separate hard register must
2130 be used for the argument pointer. This register can be eliminated by
2131 replacing it with either the frame pointer or the argument pointer,
2132 depending on whether or not the frame pointer has been eliminated.
2133
2134 In this case, you might specify:
2135 #define ELIMINABLE_REGS \
2136 {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
2137 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
2138 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
2139
2140 Note that the elimination of the argument pointer with the stack pointer is
2141 specified first since that is the preferred elimination. */
2142 #define ELIMINABLE_REGS \
2143 { \
2144 { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
2145 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \
2146 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM } \
2147 }
2148
2149 /* A C expression that returns non-zero if the compiler is allowed to try to
2150 replace register number FROM-REG with register number TO-REG. This macro
2151 need only be defined if `ELIMINABLE_REGS' is defined, and will usually be
2152 the constant 1, since most of the cases preventing register elimination are
2153 things that the compiler already knows about. */
2154
2155 #define CAN_ELIMINATE(FROM, TO) \
2156 ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \
2157 ? ! frame_pointer_needed \
2158 : 1)
2159
2160 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It specifies the
2161 initial difference between the specified pair of registers. This macro must
2162 be defined if `ELIMINABLE_REGS' is defined. */
2163
2164 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
2165 { \
2166 d30v_stack_t *info = d30v_stack_info (); \
2167 \
2168 if ((FROM) == FRAME_POINTER_REGNUM) \
2169 (OFFSET) = 0; \
2170 else if ((FROM) == ARG_POINTER_REGNUM) \
2171 (OFFSET) = info->total_size - current_function_pretend_args_size; \
2172 else \
2173 abort (); \
2174 }
2175
2176 /* Define this macro if the `longjmp' function restores registers from the
2177 stack frames, rather than from those saved specifically by `setjmp'.
2178 Certain quantities must not be kept in registers across a call to `setjmp'
2179 on such machines. */
2180 /* #define LONGJMP_RESTORE_FROM_STACK */
2181
2182 \f
2183 /* Passing Function Arguments on the Stack */
2184
2185 /* Define this macro if an argument declared in a prototype as an integral type
2186 smaller than `int' should actually be passed as an `int'. In addition to
2187 avoiding errors in certain cases of mismatch, it also makes for better code
2188 on certain machines. */
2189 /* #define PROMOTE_PROTOTYPES */
2190
2191 /* A C expression that is the number of bytes actually pushed onto the stack
2192 when an instruction attempts to push NPUSHED bytes.
2193
2194 If the target machine does not have a push instruction, do not define this
2195 macro. That directs GNU CC to use an alternate strategy: to allocate the
2196 entire argument block and then store the arguments into it.
2197
2198 On some machines, the definition
2199
2200 #define PUSH_ROUNDING(BYTES) (BYTES)
2201
2202 will suffice. But on other machines, instructions that appear to push one
2203 byte actually push two bytes in an attempt to maintain alignment. Then the
2204 definition should be
2205
2206 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1) */
2207 /* #define PUSH_ROUNDING(NPUSHED) */
2208
2209 /* If defined, the maximum amount of space required for outgoing arguments will
2210 be computed and placed into the variable
2211 `current_function_outgoing_args_size'. No space will be pushed onto the
2212 stack for each call; instead, the function prologue should increase the
2213 stack frame size by this amount.
2214
2215 Defining both `PUSH_ROUNDING' and `ACCUMULATE_OUTGOING_ARGS' is not
2216 proper. */
2217 #define ACCUMULATE_OUTGOING_ARGS 1
2218
2219 /* Define this macro if functions should assume that stack space has been
2220 allocated for arguments even when their values are passed in registers.
2221
2222 The value of this macro is the size, in bytes, of the area reserved for
2223 arguments passed in registers for the function represented by FNDECL.
2224
2225 This space can be allocated by the caller, or be a part of the
2226 machine-dependent stack frame: `OUTGOING_REG_PARM_STACK_SPACE' says
2227 which. */
2228 /* #define REG_PARM_STACK_SPACE(FNDECL) */
2229
2230 /* Define these macros in addition to the one above if functions might allocate
2231 stack space for arguments even when their values are passed in registers.
2232 These should be used when the stack space allocated for arguments in
2233 registers is not a simple constant independent of the function declaration.
2234
2235 The value of the first macro is the size, in bytes, of the area that we
2236 should initially assume would be reserved for arguments passed in registers.
2237
2238 The value of the second macro is the actual size, in bytes, of the area that
2239 will be reserved for arguments passed in registers. This takes two
2240 arguments: an integer representing the number of bytes of fixed sized
2241 arguments on the stack, and a tree representing the number of bytes of
2242 variable sized arguments on the stack.
2243
2244 When these macros are defined, `REG_PARM_STACK_SPACE' will only be called
2245 for libcall functions, the current function, or for a function being called
2246 when it is known that such stack space must be allocated. In each case this
2247 value can be easily computed.
2248
2249 When deciding whether a called function needs such stack space, and how much
2250 space to reserve, GNU CC uses these two macros instead of
2251 `REG_PARM_STACK_SPACE'. */
2252 /* #define MAYBE_REG_PARM_STACK_SPACE */
2253 /* #define FINAL_REG_PARM_STACK_SPACE(CONST_SIZE, VAR_SIZE) */
2254
2255 /* Define this if it is the responsibility of the caller to allocate the area
2256 reserved for arguments passed in registers.
2257
2258 If `ACCUMULATE_OUTGOING_ARGS' is defined, this macro controls whether the
2259 space for these arguments counts in the value of
2260 `current_function_outgoing_args_size'. */
2261 /* #define OUTGOING_REG_PARM_STACK_SPACE */
2262
2263 /* Define this macro if `REG_PARM_STACK_SPACE' is defined, but the stack
2264 parameters don't skip the area specified by it.
2265
2266 Normally, when a parameter is not passed in registers, it is placed on the
2267 stack beyond the `REG_PARM_STACK_SPACE' area. Defining this macro
2268 suppresses this behavior and causes the parameter to be passed on the stack
2269 in its natural location. */
2270 /* #define STACK_PARMS_IN_REG_PARM_AREA */
2271
2272 /* A C expression that should indicate the number of bytes of its own arguments
2273 that a function pops on returning, or 0 if the function pops no arguments
2274 and the caller must therefore pop them all after the function returns.
2275
2276 FUNDECL is a C variable whose value is a tree node that describes the
2277 function in question. Normally it is a node of type `FUNCTION_DECL' that
2278 describes the declaration of the function. From this it is possible to
2279 obtain the DECL_MACHINE_ATTRIBUTES of the function.
2280
2281 FUNTYPE is a C variable whose value is a tree node that describes the
2282 function in question. Normally it is a node of type `FUNCTION_TYPE' that
2283 describes the data type of the function. From this it is possible to obtain
2284 the data types of the value and arguments (if known).
2285
2286 When a call to a library function is being considered, FUNTYPE will contain
2287 an identifier node for the library function. Thus, if you need to
2288 distinguish among various library functions, you can do so by their names.
2289 Note that "library function" in this context means a function used to
2290 perform arithmetic, whose name is known specially in the compiler and was
2291 not mentioned in the C code being compiled.
2292
2293 STACK-SIZE is the number of bytes of arguments passed on the stack. If a
2294 variable number of bytes is passed, it is zero, and argument popping will
2295 always be the responsibility of the calling function.
2296
2297 On the Vax, all functions always pop their arguments, so the definition of
2298 this macro is STACK-SIZE. On the 68000, using the standard calling
2299 convention, no functions pop their arguments, so the value of the macro is
2300 always 0 in this case. But an alternative calling convention is available
2301 in which functions that take a fixed number of arguments pop them but other
2302 functions (such as `printf') pop nothing (the caller pops all). When this
2303 convention is in use, FUNTYPE is examined to determine whether a function
2304 takes a fixed number of arguments. */
2305 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
2306
2307 \f
2308 /* Function Arguments in Registers */
2309
2310 /* A C expression that controls whether a function argument is passed in a
2311 register, and which register.
2312
2313 The arguments are CUM, which summarizes all the previous arguments; MODE,
2314 the machine mode of the argument; TYPE, the data type of the argument as a
2315 tree node or 0 if that is not known (which happens for C support library
2316 functions); and NAMED, which is 1 for an ordinary argument and 0 for
2317 nameless arguments that correspond to `...' in the called function's
2318 prototype.
2319
2320 The value of the expression should either be a `reg' RTX for the hard
2321 register in which to pass the argument, or zero to pass the argument on the
2322 stack.
2323
2324 For machines like the Vax and 68000, where normally all arguments are
2325 pushed, zero suffices as a definition.
2326
2327 The usual way to make the ANSI library `stdarg.h' work on a machine where
2328 some arguments are usually passed in registers, is to cause nameless
2329 arguments to be passed on the stack instead. This is done by making
2330 `FUNCTION_ARG' return 0 whenever NAMED is 0.
2331
2332 You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the definition of
2333 this macro to determine if this argument is of a type that must be passed in
2334 the stack. If `REG_PARM_STACK_SPACE' is not defined and `FUNCTION_ARG'
2335 returns non-zero for such an argument, the compiler will abort. If
2336 `REG_PARM_STACK_SPACE' is defined, the argument will be computed in the
2337 stack and then loaded into a register. */
2338
2339 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
2340 d30v_function_arg (&CUM, (int)MODE, TYPE, NAMED, FALSE)
2341
2342 /* Define this macro if the target machine has "register windows", so that the
2343 register in which a function sees an arguments is not necessarily the same
2344 as the one in which the caller passed the argument.
2345
2346 For such machines, `FUNCTION_ARG' computes the register in which the caller
2347 passes the value, and `FUNCTION_INCOMING_ARG' should be defined in a similar
2348 fashion to tell the function being called where the arguments will arrive.
2349
2350 If `FUNCTION_INCOMING_ARG' is not defined, `FUNCTION_ARG' serves both
2351 purposes. */
2352
2353 #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
2354 d30v_function_arg (&CUM, (int)MODE, TYPE, NAMED, TRUE)
2355
2356 /* A C expression for the number of words, at the beginning of an argument,
2357 must be put in registers. The value must be zero for arguments that are
2358 passed entirely in registers or that are entirely pushed on the stack.
2359
2360 On some machines, certain arguments must be passed partially in registers
2361 and partially in memory. On these machines, typically the first N words of
2362 arguments are passed in registers, and the rest on the stack. If a
2363 multi-word argument (a `double' or a structure) crosses that boundary, its
2364 first few words must be passed in registers and the rest must be pushed.
2365 This macro tells the compiler when this occurs, and how many of the words
2366 should go in registers.
2367
2368 `FUNCTION_ARG' for these arguments should return the first register to be
2369 used by the caller for this argument; likewise `FUNCTION_INCOMING_ARG', for
2370 the called function. */
2371 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
2372 d30v_function_arg_partial_nregs (&CUM, (int)MODE, TYPE, NAMED)
2373
2374 /* A C expression that indicates when an argument must be passed by reference.
2375 If nonzero for an argument, a copy of that argument is made in memory and a
2376 pointer to the argument is passed instead of the argument itself. The
2377 pointer is passed in whatever way is appropriate for passing a pointer to
2378 that type.
2379
2380 On machines where `REG_PARM_STACK_SPACE' is not defined, a suitable
2381 definition of this macro might be
2382 #define FUNCTION_ARG_PASS_BY_REFERENCE\
2383 (CUM, MODE, TYPE, NAMED) \
2384 MUST_PASS_IN_STACK (MODE, TYPE) */
2385 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) 0
2386
2387 /* If defined, a C expression that indicates when it is more
2388 desirable to keep an argument passed by invisible reference as a
2389 reference, rather than copying it to a pseudo register. */
2390 /* #define FUNCTION_ARG_KEEP_AS_REFERENCE(CUM, MODE, TYPE, NAMED) */
2391
2392 /* If defined, a C expression that indicates when it is the called function's
2393 responsibility to make a copy of arguments passed by invisible reference.
2394 Normally, the caller makes a copy and passes the address of the copy to the
2395 routine being called. When FUNCTION_ARG_CALLEE_COPIES is defined and is
2396 nonzero, the caller does not make a copy. Instead, it passes a pointer to
2397 the "live" value. The called function must not modify this value. If it
2398 can be determined that the value won't be modified, it need not make a copy;
2399 otherwise a copy must be made. */
2400 /* #define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) */
2401
2402 /* If defined, a C expression that indicates when it is more desirable to keep
2403 an argument passed by invisible reference as a reference, rather than
2404 copying it to a pseudo register. */
2405 /* #define FUNCTION_ARG_KEEP_AS_REFERENCE(CUM, MODE, TYPE, NAMED) */
2406
2407 /* A C type for declaring a variable that is used as the first argument of
2408 `FUNCTION_ARG' and other related values. For some target machines, the type
2409 `int' suffices and can hold the number of bytes of argument so far.
2410
2411 There is no need to record in `CUMULATIVE_ARGS' anything about the arguments
2412 that have been passed on the stack. The compiler has other variables to
2413 keep track of that. For target machines on which all arguments are passed
2414 on the stack, there is no need to store anything in `CUMULATIVE_ARGS';
2415 however, the data structure must exist and should not be empty, so use
2416 `int'. */
2417 typedef int CUMULATIVE_ARGS;
2418
2419 /* A C statement (sans semicolon) for initializing the variable CUM for the
2420 state at the beginning of the argument list. The variable has type
2421 `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node for the data type
2422 of the function which will receive the args, or 0 if the args are to a
2423 compiler support library function. The value of INDIRECT is nonzero when
2424 processing an indirect call, for example a call through a function pointer.
2425 The value of INDIRECT is zero for a call to an explicitly named function, a
2426 library function call, or when `INIT_CUMULATIVE_ARGS' is used to find
2427 arguments for the function being compiled.
2428
2429 When processing a call to a compiler support library function, LIBNAME
2430 identifies which one. It is a `symbol_ref' rtx which contains the name of
2431 the function, as a string. LIBNAME is 0 when an ordinary C function call is
2432 being processed. Thus, each time this macro is called, either LIBNAME or
2433 FNTYPE is nonzero, but never both of them at once. */
2434
2435 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
2436 d30v_init_cumulative_args (&CUM, FNTYPE, LIBNAME, INDIRECT, FALSE)
2437
2438 /* Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of finding the
2439 arguments for the function being compiled. If this macro is undefined,
2440 `INIT_CUMULATIVE_ARGS' is used instead.
2441
2442 The value passed for LIBNAME is always 0, since library routines with
2443 special calling conventions are never compiled with GNU CC. The argument
2444 LIBNAME exists for symmetry with `INIT_CUMULATIVE_ARGS'. */
2445
2446 #define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
2447 d30v_init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE, TRUE)
2448
2449 /* A C statement (sans semicolon) to update the summarizer variable CUM to
2450 advance past an argument in the argument list. The values MODE, TYPE and
2451 NAMED describe that argument. Once this is done, the variable CUM is
2452 suitable for analyzing the *following* argument with `FUNCTION_ARG', etc.
2453
2454 This macro need not do anything if the argument in question was passed on
2455 the stack. The compiler knows how to track the amount of stack space used
2456 for arguments without any special help. */
2457
2458 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
2459 d30v_function_arg_advance (&CUM, (int) MODE, TYPE, NAMED)
2460
2461 /* If defined, a C expression which determines whether, and in which direction,
2462 to pad out an argument with extra space. The value should be of type `enum
2463 direction': either `upward' to pad above the argument, `downward' to pad
2464 below, or `none' to inhibit padding.
2465
2466 The *amount* of padding is always just enough to reach the next multiple of
2467 `FUNCTION_ARG_BOUNDARY'; this macro does not control it.
2468
2469 This macro has a default definition which is right for most systems. For
2470 little-endian machines, the default is to pad upward. For big-endian
2471 machines, the default is to pad downward for an argument of constant size
2472 shorter than an `int', and upward otherwise. */
2473 /* #define FUNCTION_ARG_PADDING(MODE, TYPE) */
2474
2475 /* If defined, a C expression that gives the alignment boundary, in bits, of an
2476 argument with the specified mode and type. If it is not defined,
2477 `PARM_BOUNDARY' is used for all arguments. */
2478
2479 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
2480 d30v_function_arg_boundary ((int) MODE, TYPE)
2481
2482 /* A C expression that is nonzero if REGNO is the number of a hard register in
2483 which function arguments are sometimes passed. This does *not* include
2484 implicit arguments such as the static chain and the structure-value address.
2485 On many machines, no registers can be used for this purpose since all
2486 function arguments are pushed on the stack. */
2487
2488 #define FUNCTION_ARG_REGNO_P(REGNO) \
2489 IN_RANGE_P (REGNO, GPR_ARG_FIRST, GPR_ARG_LAST)
2490
2491 \f
2492 /* How Scalar Function Values are Returned */
2493
2494 /* Define this macro if `-traditional' should not cause functions declared to
2495 return `float' to convert the value to `double'. */ /* #define
2496 TRADITIONAL_RETURN_FLOAT */
2497
2498 /* A C expression to create an RTX representing the place where a function
2499 returns a value of data type VALTYPE. VALTYPE is a tree node representing a
2500 data type. Write `TYPE_MODE (VALTYPE)' to get the machine mode used to
2501 represent that type. On many machines, only the mode is relevant.
2502 (Actually, on most machines, scalar values are returned in the same place
2503 regardless of mode).
2504
2505 If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same promotion
2506 rules specified in `PROMOTE_MODE' if VALTYPE is a scalar type.
2507
2508 If the precise function being called is known, FUNC is a tree node
2509 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This makes it
2510 possible to use a different value-returning convention for specific
2511 functions when all their calls are known.
2512
2513 `FUNCTION_VALUE' is not used for return vales with aggregate data types,
2514 because these are returned in another way. See `STRUCT_VALUE_REGNUM' and
2515 related macros, below. */
2516
2517 #define FUNCTION_VALUE(VALTYPE, FUNC) \
2518 gen_rtx (REG, TYPE_MODE (VALTYPE), GPR_RET_VALUE)
2519
2520 /* Define this macro if the target machine has "register windows" so that the
2521 register in which a function returns its value is not the same as the one in
2522 which the caller sees the value.
2523
2524 For such machines, `FUNCTION_VALUE' computes the register in which the
2525 caller will see the value. `FUNCTION_OUTGOING_VALUE' should be defined in a
2526 similar fashion to tell the function where to put the value.
2527
2528 If `FUNCTION_OUTGOING_VALUE' is not defined, `FUNCTION_VALUE' serves both
2529 purposes.
2530
2531 `FUNCTION_OUTGOING_VALUE' is not used for return vales with aggregate data
2532 types, because these are returned in another way. See `STRUCT_VALUE_REGNUM'
2533 and related macros, below. */
2534 /* #define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) */
2535
2536 /* A C expression to create an RTX representing the place where a library
2537 function returns a value of mode MODE. If the precise function being called
2538 is known, FUNC is a tree node (`FUNCTION_DECL') for it; otherwise, FUNC is a
2539 null pointer. This makes it possible to use a different value-returning
2540 convention for specific functions when all their calls are known.
2541
2542 Note that "library function" in this context means a compiler support
2543 routine, used to perform arithmetic, whose name is known specially by the
2544 compiler and was not mentioned in the C code being compiled.
2545
2546 The definition of `LIBRARY_VALUE' need not be concerned aggregate data
2547 types, because none of the library functions returns such types. */
2548
2549 #define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, GPR_RET_VALUE)
2550
2551 /* A C expression that is nonzero if REGNO is the number of a hard register in
2552 which the values of called function may come back.
2553
2554 A register whose use for returning values is limited to serving as the
2555 second of a pair (for a value of type `double', say) need not be recognized
2556 by this macro. So for most machines, this definition suffices:
2557
2558 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
2559
2560 If the machine has register windows, so that the caller and the called
2561 function use different registers for the return value, this macro should
2562 recognize only the caller's register numbers. */
2563
2564 #define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == GPR_RET_VALUE)
2565
2566 /* Define this macro if `untyped_call' and `untyped_return' need more space
2567 than is implied by `FUNCTION_VALUE_REGNO_P' for saving and restoring an
2568 arbitrary return value. */
2569 /* #define APPLY_RESULT_SIZE */
2570
2571 \f
2572 /* How Large Values are Returned */
2573
2574 /* A C expression which can inhibit the returning of certain function values in
2575 registers, based on the type of value. A nonzero value says to return the
2576 function value in memory, just as large structures are always returned.
2577 Here TYPE will be a C expression of type `tree', representing the data type
2578 of the value.
2579
2580 Note that values of mode `BLKmode' must be explicitly handled by this macro.
2581 Also, the option `-fpcc-struct-return' takes effect regardless of this
2582 macro. On most systems, it is possible to leave the macro undefined; this
2583 causes a default definition to be used, whose value is the constant 1 for
2584 `BLKmode' values, and 0 otherwise.
2585
2586 Do not use this macro to indicate that structures and unions should always
2587 be returned in memory. You should instead use `DEFAULT_PCC_STRUCT_RETURN'
2588 to indicate this. */
2589 /* #define RETURN_IN_MEMORY(TYPE) */
2590
2591 /* Define this macro to be 1 if all structure and union return values must be
2592 in memory. Since this results in slower code, this should be defined only
2593 if needed for compatibility with other compilers or with an ABI. If you
2594 define this macro to be 0, then the conventions used for structure and union
2595 return values are decided by the `RETURN_IN_MEMORY' macro.
2596
2597 If not defined, this defaults to the value 1. */
2598 /* #define DEFAULT_PCC_STRUCT_RETURN */
2599
2600 /* If the structure value address is passed in a register, then
2601 `STRUCT_VALUE_REGNUM' should be the number of that register. */
2602
2603 #define STRUCT_VALUE_REGNUM GPR_ARG_FIRST
2604
2605 /* If the structure value address is not passed in a register, define
2606 `STRUCT_VALUE' as an expression returning an RTX for the place where the
2607 address is passed. If it returns 0, the address is passed as an "invisible"
2608 first argument. */
2609
2610 #define STRUCT_VALUE 0
2611
2612 /* On some architectures the place where the structure value address is found
2613 by the called function is not the same place that the caller put it. This
2614 can be due to register windows, or it could be because the function prologue
2615 moves it to a different place.
2616
2617 If the incoming location of the structure value address is in a register,
2618 define this macro as the register number. */
2619 /* #define STRUCT_VALUE_INCOMING_REGNUM */
2620
2621 /* If the incoming location is not a register, then you should define
2622 `STRUCT_VALUE_INCOMING' as an expression for an RTX for where the called
2623 function should find the value. If it should find the value on the stack,
2624 define this to create a `mem' which refers to the frame pointer. A
2625 definition of 0 means that the address is passed as an "invisible" first
2626 argument. */
2627 /* #define STRUCT_VALUE_INCOMING */
2628
2629 /* Define this macro if the usual system convention on the target machine for
2630 returning structures and unions is for the called function to return the
2631 address of a static variable containing the value.
2632
2633 Do not define this if the usual system convention is for the caller to pass
2634 an address to the subroutine.
2635
2636 This macro has effect in `-fpcc-struct-return' mode, but it does nothing
2637 when you use `-freg-struct-return' mode. */
2638 /* #define PCC_STATIC_STRUCT_RETURN */
2639
2640 \f
2641 /* Caller-Saves Register Allocation */
2642
2643 /* Define this macro if function calls on the target machine do not preserve
2644 any registers; in other words, if `CALL_USED_REGISTERS' has 1 for all
2645 registers. This macro enables `-fcaller-saves' by default. Eventually that
2646 option will be enabled by default on all machines and both the option and
2647 this macro will be eliminated. */
2648 /* #define DEFAULT_CALLER_SAVES */
2649
2650 /* A C expression to determine whether it is worthwhile to consider placing a
2651 pseudo-register in a call-clobbered hard register and saving and restoring
2652 it around each function call. The expression should be 1 when this is worth
2653 doing, and 0 otherwise.
2654
2655 If you don't define this macro, a default is used which is good on most
2656 machines: `4 * CALLS < REFS'. */
2657 /* #define CALLER_SAVE_PROFITABLE(REFS, CALLS) */
2658
2659 \f
2660 /* Function Entry and Exit */
2661
2662 /* A C compound statement that outputs the assembler code for entry to a
2663 function. The prologue is responsible for setting up the stack frame,
2664 initializing the frame pointer register, saving registers that must be
2665 saved, and allocating SIZE additional bytes of storage for the local
2666 variables. SIZE is an integer. FILE is a stdio stream to which the
2667 assembler code should be output.
2668
2669 The label for the beginning of the function need not be output by this
2670 macro. That has already been done when the macro is run.
2671
2672 To determine which registers to save, the macro can refer to the array
2673 `regs_ever_live': element R is nonzero if hard register R is used anywhere
2674 within the function. This implies the function prologue should save
2675 register R, provided it is not one of the call-used registers.
2676 (`FUNCTION_EPILOGUE' must likewise use `regs_ever_live'.)
2677
2678 On machines that have "register windows", the function entry code does not
2679 save on the stack the registers that are in the windows, even if they are
2680 supposed to be preserved by function calls; instead it takes appropriate
2681 steps to "push" the register stack, if any non-call-used registers are used
2682 in the function.
2683
2684 On machines where functions may or may not have frame-pointers, the function
2685 entry code must vary accordingly; it must set up the frame pointer if one is
2686 wanted, and not otherwise. To determine whether a frame pointer is in
2687 wanted, the macro can refer to the variable `frame_pointer_needed'. The
2688 variable's value will be 1 at run time in a function that needs a frame
2689 pointer. *Note Elimination::.
2690
2691 The function entry code is responsible for allocating any stack space
2692 required for the function. This stack space consists of the regions listed
2693 below. In most cases, these regions are allocated in the order listed, with
2694 the last listed region closest to the top of the stack (the lowest address
2695 if `STACK_GROWS_DOWNWARD' is defined, and the highest address if it is not
2696 defined). You can use a different order for a machine if doing so is more
2697 convenient or required for compatibility reasons. Except in cases where
2698 required by standard or by a debugger, there is no reason why the stack
2699 layout used by GCC need agree with that used by other compilers for a
2700 machine.
2701
2702 * A region of `current_function_pretend_args_size' bytes of
2703 uninitialized space just underneath the first argument
2704 arriving on the stack. (This may not be at the very start of
2705 the allocated stack region if the calling sequence has pushed
2706 anything else since pushing the stack arguments. But
2707 usually, on such machines, nothing else has been pushed yet,
2708 because the function prologue itself does all the pushing.)
2709 This region is used on machines where an argument may be
2710 passed partly in registers and partly in memory, and, in some
2711 cases to support the features in `varargs.h' and `stdargs.h'.
2712
2713 * An area of memory used to save certain registers used by the
2714 function. The size of this area, which may also include
2715 space for such things as the return address and pointers to
2716 previous stack frames, is machine-specific and usually
2717 depends on which registers have been used in the function.
2718 Machines with register windows often do not require a save
2719 area.
2720
2721 * A region of at least SIZE bytes, possibly rounded up to an
2722 allocation boundary, to contain the local variables of the
2723 function. On some machines, this region and the save area
2724 may occur in the opposite order, with the save area closer to
2725 the top of the stack.
2726
2727 * Optionally, when `ACCUMULATE_OUTGOING_ARGS' is defined, a
2728 region of `current_function_outgoing_args_size' bytes to be
2729 used for outgoing argument lists of the function. *Note
2730 Stack Arguments::.
2731
2732 Normally, it is necessary for the macros `FUNCTION_PROLOGUE' and
2733 `FUNCTION_EPILOGUE' to treat leaf functions specially. The C variable
2734 `leaf_function' is nonzero for such a function. */
2735
2736 #define FUNCTION_PROLOGUE(FILE, SIZE) d30v_function_prologue (FILE, SIZE)
2737
2738 /* Define this macro as a C expression that is nonzero if the return
2739 instruction or the function epilogue ignores the value of the stack pointer;
2740 in other words, if it is safe to delete an instruction to adjust the stack
2741 pointer before a return from the function.
2742
2743 Note that this macro's value is relevant only for functions for which frame
2744 pointers are maintained. It is never safe to delete a final stack
2745 adjustment in a function that has no frame pointer, and the compiler knows
2746 this regardless of `EXIT_IGNORE_STACK'. */
2747 /* #define EXIT_IGNORE_STACK */
2748
2749 /* Define this macro as a C expression that is nonzero for registers
2750 are used by the epilogue or the `return' pattern. The stack and
2751 frame pointer registers are already be assumed to be used as
2752 needed. */
2753 #define EPILOGUE_USES(REGNO) ((REGNO) == GPR_LINK)
2754
2755 /* A C compound statement that outputs the assembler code for exit from a
2756 function. The epilogue is responsible for restoring the saved registers and
2757 stack pointer to their values when the function was called, and returning
2758 control to the caller. This macro takes the same arguments as the macro
2759 `FUNCTION_PROLOGUE', and the registers to restore are determined from
2760 `regs_ever_live' and `CALL_USED_REGISTERS' in the same way.
2761
2762 On some machines, there is a single instruction that does all the work of
2763 returning from the function. On these machines, give that instruction the
2764 name `return' and do not define the macro `FUNCTION_EPILOGUE' at all.
2765
2766 Do not define a pattern named `return' if you want the `FUNCTION_EPILOGUE'
2767 to be used. If you want the target switches to control whether return
2768 instructions or epilogues are used, define a `return' pattern with a
2769 validity condition that tests the target switches appropriately. If the
2770 `return' pattern's validity condition is false, epilogues will be used.
2771
2772 On machines where functions may or may not have frame-pointers, the function
2773 exit code must vary accordingly. Sometimes the code for these two cases is
2774 completely different. To determine whether a frame pointer is wanted, the
2775 macro can refer to the variable `frame_pointer_needed'. The variable's
2776 value will be 1 when compiling a function that needs a frame pointer.
2777
2778 Normally, `FUNCTION_PROLOGUE' and `FUNCTION_EPILOGUE' must treat leaf
2779 functions specially. The C variable `leaf_function' is nonzero for such a
2780 function. *Note Leaf Functions::.
2781
2782 On some machines, some functions pop their arguments on exit while others
2783 leave that for the caller to do. For example, the 68020 when given `-mrtd'
2784 pops arguments in functions that take a fixed number of arguments.
2785
2786 Your definition of the macro `RETURN_POPS_ARGS' decides which functions pop
2787 their own arguments. `FUNCTION_EPILOGUE' needs to know what was decided.
2788 The variable that is called `current_function_pops_args' is the number of
2789 bytes of its arguments that a function should pop. *Note Scalar Return::. */
2790
2791 #define FUNCTION_EPILOGUE(FILE, SIZE) d30v_function_epilogue (FILE, SIZE)
2792
2793 /* Define this macro if the function epilogue contains delay slots to which
2794 instructions from the rest of the function can be "moved". The definition
2795 should be a C expression whose value is an integer representing the number
2796 of delay slots there. */
2797 /* #define DELAY_SLOTS_FOR_EPILOGUE */
2798
2799 /* A C expression that returns 1 if INSN can be placed in delay slot number N
2800 of the epilogue.
2801
2802 The argument N is an integer which identifies the delay slot now being
2803 considered (since different slots may have different rules of eligibility).
2804 It is never negative and is always less than the number of epilogue delay
2805 slots (what `DELAY_SLOTS_FOR_EPILOGUE' returns). If you reject a particular
2806 insn for a given delay slot, in principle, it may be reconsidered for a
2807 subsequent delay slot. Also, other insns may (at least in principle) be
2808 considered for the so far unfilled delay slot.
2809
2810 The insns accepted to fill the epilogue delay slots are put in an
2811 RTL list made with `insn_list' objects, stored in the variable
2812 `current_function_epilogue_delay_list'. The insn for the first
2813 delay slot comes first in the list. Your definition of the macro
2814 `FUNCTION_EPILOGUE' should fill the delay slots by outputting the
2815 insns in this list, usually by calling `final_scan_insn'.
2816
2817 You need not define this macro if you did not define
2818 `DELAY_SLOTS_FOR_EPILOGUE'. */
2819 /* #define ELIGIBLE_FOR_EPILOGUE_DELAY(INSN, N) */
2820
2821 /* A C compound statement that outputs the assembler code for a thunk function,
2822 used to implement C++ virtual function calls with multiple inheritance. The
2823 thunk acts as a wrapper around a virtual function, adjusting the implicit
2824 object parameter before handing control off to the real function.
2825
2826 First, emit code to add the integer DELTA to the location that contains the
2827 incoming first argument. Assume that this argument contains a pointer, and
2828 is the one used to pass the `this' pointer in C++. This is the incoming
2829 argument *before* the function prologue, e.g. `%o0' on a sparc. The
2830 addition must preserve the values of all other incoming arguments.
2831
2832 After the addition, emit code to jump to FUNCTION, which is a
2833 `FUNCTION_DECL'. This is a direct pure jump, not a call, and does not touch
2834 the return address. Hence returning from FUNCTION will return to whoever
2835 called the current `thunk'.
2836
2837 The effect must be as if FUNCTION had been called directly with the adjusted
2838 first argument. This macro is responsible for emitting all of the code for
2839 a thunk function; `FUNCTION_PROLOGUE' and `FUNCTION_EPILOGUE' are not
2840 invoked.
2841
2842 The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already been
2843 extracted from it.) It might possibly be useful on some targets, but
2844 probably not.
2845
2846 If you do not define this macro, the target-independent code in the C++
2847 frontend will generate a less efficient heavyweight thunk that calls
2848 FUNCTION instead of jumping to it. The generic approach does not support
2849 varargs. */
2850 /* #define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) */
2851
2852 \f
2853 /* Generating Code for Profiling. */
2854
2855 /* A C statement or compound statement to output to FILE some assembler code to
2856 call the profiling subroutine `mcount'. Before calling, the assembler code
2857 must load the address of a counter variable into a register where `mcount'
2858 expects to find the address. The name of this variable is `LP' followed by
2859 the number LABELNO, so you would generate the name using `LP%d' in a
2860 `fprintf'.
2861
2862 The details of how the address should be passed to `mcount' are determined
2863 by your operating system environment, not by GNU CC. To figure them out,
2864 compile a small program for profiling using the system's installed C
2865 compiler and look at the assembler code that results. */
2866
2867 #define FUNCTION_PROFILER(FILE, LABELNO) d30v_function_profiler (FILE, LABELNO)
2868
2869 /* Define this macro if the code for function profiling should come before the
2870 function prologue. Normally, the profiling code comes after. */
2871 /* #define PROFILE_BEFORE_PROLOGUE */
2872
2873 /* A C statement or compound statement to output to FILE some assembler code to
2874 initialize basic-block profiling for the current object module. The global
2875 compile flag `profile_block_flag' distingishes two profile modes.
2876
2877 profile_block_flag != 2'
2878 Output code to call the subroutine `__bb_init_func' once per
2879 object module, passing it as its sole argument the address of
2880 a block allocated in the object module.
2881
2882 The name of the block is a local symbol made with this
2883 statement:
2884
2885 ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 0);
2886
2887 Of course, since you are writing the definition of
2888 `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro,
2889 you can take a short cut in the definition of this macro and
2890 use the name that you know will result.
2891
2892 The first word of this block is a flag which will be nonzero
2893 if the object module has already been initialized. So test
2894 this word first, and do not call `__bb_init_func' if the flag
2895 is nonzero. BLOCK_OR_LABEL contains a unique number which
2896 may be used to generate a label as a branch destination when
2897 `__bb_init_func' will not be called.
2898
2899 Described in assembler language, the code to be output looks
2900 like:
2901
2902 cmp (LPBX0),0
2903 bne local_label
2904 parameter1 <- LPBX0
2905 call __bb_init_func
2906 local_label:
2907
2908 profile_block_flag == 2'
2909 Output code to call the subroutine `__bb_init_trace_func' and
2910 pass two parameters to it. The first parameter is the same as
2911 for `__bb_init_func'. The second parameter is the number of
2912 the first basic block of the function as given by
2913 BLOCK_OR_LABEL. Note that `__bb_init_trace_func' has to be
2914 called, even if the object module has been initialized
2915 already.
2916
2917 Described in assembler language, the code to be output looks
2918 like:
2919 parameter1 <- LPBX0
2920 parameter2 <- BLOCK_OR_LABEL
2921 call __bb_init_trace_func */
2922 /* #define FUNCTION_BLOCK_PROFILER (FILE, LABELNO) */
2923
2924 /* A C statement or compound statement to output to FILE some assembler code to
2925 increment the count associated with the basic block number BLOCKNO. The
2926 global compile flag `profile_block_flag' distingishes two profile modes.
2927
2928 profile_block_flag != 2'
2929 Output code to increment the counter directly. Basic blocks
2930 are numbered separately from zero within each compilation.
2931 The count associated with block number BLOCKNO is at index
2932 BLOCKNO in a vector of words; the name of this array is a
2933 local symbol made with this statement:
2934
2935 ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 2);
2936
2937 Of course, since you are writing the definition of
2938 `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro,
2939 you can take a short cut in the definition of this macro and
2940 use the name that you know will result.
2941
2942 Described in assembler language, the code to be output looks
2943 like:
2944
2945 inc (LPBX2+4*BLOCKNO)
2946
2947 profile_block_flag == 2'
2948 Output code to initialize the global structure `__bb' and
2949 call the function `__bb_trace_func', which will increment the
2950 counter.
2951
2952 `__bb' consists of two words. In the first word, the current
2953 basic block number, as given by BLOCKNO, has to be stored. In
2954 the second word, the address of a block allocated in the
2955 object module has to be stored. The address is given by the
2956 label created with this statement:
2957
2958 ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 0);
2959
2960 Described in assembler language, the code to be output looks
2961 like:
2962 move BLOCKNO -> (__bb)
2963 move LPBX0 -> (__bb+4)
2964 call __bb_trace_func */
2965 /* #define BLOCK_PROFILER(FILE, BLOCKNO) */
2966
2967 /* A C statement or compound statement to output to FILE assembler
2968 code to call function `__bb_trace_ret'. The assembler code should
2969 only be output if the global compile flag `profile_block_flag' ==
2970 2. This macro has to be used at every place where code for
2971 returning from a function is generated (e.g. `FUNCTION_EPILOGUE').
2972 Although you have to write the definition of `FUNCTION_EPILOGUE'
2973 as well, you have to define this macro to tell the compiler, that
2974 the proper call to `__bb_trace_ret' is produced. */
2975 /* #define FUNCTION_BLOCK_PROFILER_EXIT(FILE) */
2976
2977 /* A C statement or compound statement to save all registers, which may be
2978 clobbered by a function call, including condition codes. The `asm'
2979 statement will be mostly likely needed to handle this task. Local labels in
2980 the assembler code can be concatenated with the string ID, to obtain a
2981 unique lable name.
2982
2983 Registers or condition codes clobbered by `FUNCTION_PROLOGUE' or
2984 `FUNCTION_EPILOGUE' must be saved in the macros `FUNCTION_BLOCK_PROFILER',
2985 `FUNCTION_BLOCK_PROFILER_EXIT' and `BLOCK_PROFILER' prior calling
2986 `__bb_init_trace_func', `__bb_trace_ret' and `__bb_trace_func' respectively. */
2987 /* #define MACHINE_STATE_SAVE(ID) */
2988
2989 /* A C statement or compound statement to restore all registers, including
2990 condition codes, saved by `MACHINE_STATE_SAVE'.
2991
2992 Registers or condition codes clobbered by `FUNCTION_PROLOGUE' or
2993 `FUNCTION_EPILOGUE' must be restored in the macros
2994 `FUNCTION_BLOCK_PROFILER', `FUNCTION_BLOCK_PROFILER_EXIT' and
2995 `BLOCK_PROFILER' after calling `__bb_init_trace_func', `__bb_trace_ret' and
2996 `__bb_trace_func' respectively. */
2997 /* #define MACHINE_STATE_RESTORE(ID) */
2998
2999 /* A C function or functions which are needed in the library to support block
3000 profiling. */
3001 /* #define BLOCK_PROFILER_CODE */
3002
3003 \f
3004 /* Implementing the Varargs Macros. */
3005
3006 /* If defined, is a C expression that produces the machine-specific code for a
3007 call to `__builtin_saveregs'. This code will be moved to the very beginning
3008 of the function, before any parameter access are made. The return value of
3009 this function should be an RTX that contains the value to use as the return
3010 of `__builtin_saveregs'.
3011
3012 If this macro is not defined, the compiler will output an ordinary call to
3013 the library function `__builtin_saveregs'. */
3014
3015 #define EXPAND_BUILTIN_SAVEREGS() d30v_expand_builtin_saveregs ()
3016
3017 /* This macro offers an alternative to using `__builtin_saveregs' and defining
3018 the macro `EXPAND_BUILTIN_SAVEREGS'. Use it to store the anonymous register
3019 arguments into the stack so that all the arguments appear to have been
3020 passed consecutively on the stack. Once this is done, you can use the
3021 standard implementation of varargs that works for machines that pass all
3022 their arguments on the stack.
3023
3024 The argument ARGS_SO_FAR is the `CUMULATIVE_ARGS' data structure, containing
3025 the values that obtain after processing of the named arguments. The
3026 arguments MODE and TYPE describe the last named argument--its machine mode
3027 and its data type as a tree node.
3028
3029 The macro implementation should do two things: first, push onto the stack
3030 all the argument registers *not* used for the named arguments, and second,
3031 store the size of the data thus pushed into the `int'-valued variable whose
3032 name is supplied as the argument PRETEND_ARGS_SIZE. The value that you
3033 store here will serve as additional offset for setting up the stack frame.
3034
3035 Because you must generate code to push the anonymous arguments at compile
3036 time without knowing their data types, `SETUP_INCOMING_VARARGS' is only
3037 useful on machines that have just a single category of argument register and
3038 use it uniformly for all data types.
3039
3040 If the argument SECOND_TIME is nonzero, it means that the arguments of the
3041 function are being analyzed for the second time. This happens for an inline
3042 function, which is not actually compiled until the end of the source file.
3043 The macro `SETUP_INCOMING_VARARGS' should not generate any instructions in
3044 this case. */
3045
3046 #define SETUP_INCOMING_VARARGS(ARGS_SO_FAR, MODE, TYPE, PRETEND_ARGS_SIZE, SECOND_TIME) \
3047 d30v_setup_incoming_varargs (&ARGS_SO_FAR, (int) MODE, TYPE, \
3048 &PRETEND_ARGS_SIZE, SECOND_TIME)
3049
3050 /* Define this macro if the location where a function argument is passed
3051 depends on whether or not it is a named argument.
3052
3053 This macro controls how the NAMED argument to `FUNCTION_ARG' is set for
3054 varargs and stdarg functions. With this macro defined, the NAMED argument
3055 is always true for named arguments, and false for unnamed arguments. If
3056 this is not defined, but `SETUP_INCOMING_VARARGS' is defined, then all
3057 arguments are treated as named. Otherwise, all named arguments except the
3058 last are treated as named. */
3059 /* #define STRICT_ARGUMENT_NAMING */
3060
3061 /* Build up the stdarg/varargs va_list type tree, assinging it to NODE. If not
3062 defined, it is assumed that va_list is a void * pointer. */
3063
3064 #define BUILD_VA_LIST_TYPE(VALIST) \
3065 (VALIST) = d30v_build_va_list ()
3066
3067
3068 /* Implement the stdarg/varargs va_start macro. STDARG_P is non-zero if this
3069 is stdarg.h instead of varargs.h. VALIST is the tree of the va_list
3070 variable to initialize. NEXTARG is the machine independent notion of the
3071 'next' argument after the variable arguments. If not defined, a standard
3072 implementation will be defined that works for arguments passed on the stack. */
3073
3074 #define EXPAND_BUILTIN_VA_START(STDARG_P, VALIST, NEXTARG) \
3075 (d30v_expand_builtin_va_start(STDARG_P, VALIST, NEXTARG))
3076
3077 /* Implement the stdarg/varargs va_arg macro. VALIST is the variable of type
3078 va_list as a tree, TYPE is the type passed to va_arg. */
3079
3080 #define EXPAND_BUILTIN_VA_ARG(VALIST, TYPE) \
3081 (d30v_expand_builtin_va_arg (VALIST, TYPE))
3082
3083 /* Implement the stdarg/varargs va_end macro.
3084 VALIST is the variable of type va_list as a tree. */
3085
3086 /* #define EXPAND_BUILTIN_VA_END(VALIST) */
3087
3088
3089 \f
3090 /* Trampolines for Nested Functions. */
3091
3092 /* A C statement to output, on the stream FILE, assembler code for a block of
3093 data that contains the constant parts of a trampoline. This code should not
3094 include a label--the label is taken care of automatically. */
3095 /* #define TRAMPOLINE_TEMPLATE(FILE) d30v_trampoline_template (FILE) */
3096
3097 /* The name of a subroutine to switch to the section in which the trampoline
3098 template is to be placed (*note Sections::.). The default is a value of
3099 `readonly_data_section', which places the trampoline in the section
3100 containing read-only data. */
3101 /* #define TRAMPOLINE_SECTION */
3102
3103 /* A C expression for the size in bytes of the trampoline, as an integer. */
3104 #define TRAMPOLINE_SIZE (d30v_trampoline_size ())
3105
3106 /* Alignment required for trampolines, in bits.
3107
3108 If you don't define this macro, the value of `BIGGEST_ALIGNMENT' is used for
3109 aligning trampolines. */
3110 #define TRAMPOLINE_ALIGNMENT 64
3111
3112 /* A C statement to initialize the variable parts of a trampoline. ADDR is an
3113 RTX for the address of the trampoline; FNADDR is an RTX for the address of
3114 the nested function; STATIC_CHAIN is an RTX for the static chain value that
3115 should be passed to the function when it is called. */
3116 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
3117 d30v_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN)
3118
3119 /* A C expression to allocate run-time space for a trampoline. The expression
3120 value should be an RTX representing a memory reference to the space for the
3121 trampoline.
3122
3123 If this macro is not defined, by default the trampoline is allocated as a
3124 stack slot. This default is right for most machines. The exceptions are
3125 machines where it is impossible to execute instructions in the stack area.
3126 On such machines, you may have to implement a separate stack, using this
3127 macro in conjunction with `FUNCTION_PROLOGUE' and `FUNCTION_EPILOGUE'.
3128
3129 FP points to a data structure, a `struct function', which describes the
3130 compilation status of the immediate containing function of the function
3131 which the trampoline is for. Normally (when `ALLOCATE_TRAMPOLINE' is not
3132 defined), the stack slot for the trampoline is in the stack frame of this
3133 containing function. Other allocation strategies probably must do something
3134 analogous with this information. */
3135 /* #define ALLOCATE_TRAMPOLINE(FP) */
3136
3137 /* Implementing trampolines is difficult on many machines because they have
3138 separate instruction and data caches. Writing into a stack location fails
3139 to clear the memory in the instruction cache, so when the program jumps to
3140 that location, it executes the old contents.
3141
3142 Here are two possible solutions. One is to clear the relevant parts of the
3143 instruction cache whenever a trampoline is set up. The other is to make all
3144 trampolines identical, by having them jump to a standard subroutine. The
3145 former technique makes trampoline execution faster; the latter makes
3146 initialization faster.
3147
3148 To clear the instruction cache when a trampoline is initialized, define the
3149 following macros which describe the shape of the cache. */
3150
3151 /* The total size in bytes of the cache. */
3152 /* #define INSN_CACHE_SIZE */
3153
3154 /* The length in bytes of each cache line. The cache is divided into cache
3155 lines which are disjoint slots, each holding a contiguous chunk of data
3156 fetched from memory. Each time data is brought into the cache, an entire
3157 line is read at once. The data loaded into a cache line is always aligned
3158 on a boundary equal to the line size. */
3159 /* #define INSN_CACHE_LINE_WIDTH */
3160
3161 /* The number of alternative cache lines that can hold any particular memory
3162 location. */
3163 /* #define INSN_CACHE_DEPTH */
3164
3165 /* Alternatively, if the machine has system calls or instructions to clear the
3166 instruction cache directly, you can define the following macro. */
3167
3168 /* If defined, expands to a C expression clearing the *instruction cache* in
3169 the specified interval. If it is not defined, and the macro INSN_CACHE_SIZE
3170 is defined, some generic code is generated to clear the cache. The
3171 definition of this macro would typically be a series of `asm' statements.
3172 Both BEG and END are both pointer expressions. */
3173 /* #define CLEAR_INSN_CACHE (BEG, END) */
3174
3175 /* To use a standard subroutine, define the following macro. In addition, you
3176 must make sure that the instructions in a trampoline fill an entire cache
3177 line with identical instructions, or else ensure that the beginning of the
3178 trampoline code is always aligned at the same point in its cache line. Look
3179 in `m68k.h' as a guide. */
3180
3181 /* Define this macro if trampolines need a special subroutine to do their work.
3182 The macro should expand to a series of `asm' statements which will be
3183 compiled with GNU CC. They go in a library function named
3184 `__transfer_from_trampoline'.
3185
3186 If you need to avoid executing the ordinary prologue code of a compiled C
3187 function when you jump to the subroutine, you can do so by placing a special
3188 label of your own in the assembler code. Use one `asm' statement to
3189 generate an assembler label, and another to make the label global. Then
3190 trampolines can use that label to jump directly to your special assembler
3191 code. */
3192 /* #define TRANSFER_FROM_TRAMPOLINE */
3193
3194 \f
3195 /* Implicit Calls to Library Routines */
3196
3197 /* A C string constant giving the name of the function to call for
3198 multiplication of one signed full-word by another. If you do not define
3199 this macro, the default name is used, which is `__mulsi3', a function
3200 defined in `libgcc.a'. */
3201 /* #define MULSI3_LIBCALL */
3202
3203 /* A C string constant giving the name of the function to call for division of
3204 one signed full-word by another. If you do not define this macro, the
3205 default name is used, which is `__divsi3', a function defined in `libgcc.a'. */
3206 /* #define DIVSI3_LIBCALL */
3207
3208 /* A C string constant giving the name of the function to call for division of
3209 one unsigned full-word by another. If you do not define this macro, the
3210 default name is used, which is `__udivsi3', a function defined in
3211 `libgcc.a'. */
3212 /* #define UDIVSI3_LIBCALL */
3213
3214 /* A C string constant giving the name of the function to call for the
3215 remainder in division of one signed full-word by another. If you do not
3216 define this macro, the default name is used, which is `__modsi3', a function
3217 defined in `libgcc.a'. */
3218 /* #define MODSI3_LIBCALL */
3219
3220 /* A C string constant giving the name of the function to call for the
3221 remainder in division of one unsigned full-word by another. If you do not
3222 define this macro, the default name is used, which is `__umodsi3', a
3223 function defined in `libgcc.a'. */
3224 /* #define UMODSI3_LIBCALL */
3225
3226 /* A C string constant giving the name of the function to call for
3227 multiplication of one signed double-word by another. If you do not define
3228 this macro, the default name is used, which is `__muldi3', a function
3229 defined in `libgcc.a'. */
3230 /* #define MULDI3_LIBCALL */
3231
3232 /* A C string constant giving the name of the function to call for division of
3233 one signed double-word by another. If you do not define this macro, the
3234 default name is used, which is `__divdi3', a function defined in `libgcc.a'. */
3235 /* #define DIVDI3_LIBCALL */
3236
3237 /* A C string constant giving the name of the function to call for division of
3238 one unsigned full-word by another. If you do not define this macro, the
3239 default name is used, which is `__udivdi3', a function defined in
3240 `libgcc.a'. */
3241 /* #define UDIVDI3_LIBCALL */
3242
3243 /* A C string constant giving the name of the function to call for the
3244 remainder in division of one signed double-word by another. If you do not
3245 define this macro, the default name is used, which is `__moddi3', a function
3246 defined in `libgcc.a'. */
3247 /* #define MODDI3_LIBCALL */
3248
3249 /* A C string constant giving the name of the function to call for the
3250 remainder in division of one unsigned full-word by another. If you do not
3251 define this macro, the default name is used, which is `__umoddi3', a
3252 function defined in `libgcc.a'. */
3253 /* #define UMODDI3_LIBCALL */
3254
3255 /* Define this macro as a C statement that declares additional library routines
3256 renames existing ones. `init_optabs' calls this macro after initializing all
3257 the normal library routines. */
3258 /* #define INIT_TARGET_OPTABS */
3259
3260 /* The value of `EDOM' on the target machine, as a C integer constant
3261 expression. If you don't define this macro, GNU CC does not attempt to
3262 deposit the value of `EDOM' into `errno' directly. Look in
3263 `/usr/include/errno.h' to find the value of `EDOM' on your system.
3264
3265 If you do not define `TARGET_EDOM', then compiled code reports domain errors
3266 by calling the library function and letting it report the error. If
3267 mathematical functions on your system use `matherr' when there is an error,
3268 then you should leave `TARGET_EDOM' undefined so that `matherr' is used
3269 normally. */
3270 /* #define TARGET_EDOM */
3271
3272 /* Define this macro as a C expression to create an rtl expression that refers
3273 to the global "variable" `errno'. (On certain systems, `errno' may not
3274 actually be a variable.) If you don't define this macro, a reasonable
3275 default is used. */
3276 /* #define GEN_ERRNO_RTX */
3277
3278 /* Define this macro if GNU CC should generate calls to the System V (and ANSI
3279 C) library functions `memcpy' and `memset' rather than the BSD functions
3280 `bcopy' and `bzero'.
3281
3282 Defined in svr4.h. */
3283 /* #define TARGET_MEM_FUNCTIONS */
3284
3285 /* Define this macro if only `float' arguments cannot be passed to library
3286 routines (so they must be converted to `double'). This macro affects both
3287 how library calls are generated and how the library routines in `libgcc1.c'
3288 accept their arguments. It is useful on machines where floating and fixed
3289 point arguments are passed differently, such as the i860. */
3290 /* #define LIBGCC_NEEDS_DOUBLE */
3291
3292 /* Define this macro to override the type used by the library routines to pick
3293 up arguments of type `float'. (By default, they use a union of `float' and
3294 `int'.)
3295
3296 The obvious choice would be `float'--but that won't work with traditional C
3297 compilers that expect all arguments declared as `float' to arrive as
3298 `double'. To avoid this conversion, the library routines ask for the value
3299 as some other type and then treat it as a `float'.
3300
3301 On some systems, no other type will work for this. For these systems, you
3302 must use `LIBGCC_NEEDS_DOUBLE' instead, to force conversion of the values
3303 `double' before they are passed. */
3304 /* #define FLOAT_ARG_TYPE */
3305
3306 /* Define this macro to override the way library routines redesignate a `float'
3307 argument as a `float' instead of the type it was passed as. The default is
3308 an expression which takes the `float' field of the union. */
3309 /* #define FLOATIFY(PASSED_VALUE) */
3310
3311 /* Define this macro to override the type used by the library routines to
3312 return values that ought to have type `float'. (By default, they use
3313 `int'.)
3314
3315 The obvious choice would be `float'--but that won't work with traditional C
3316 compilers gratuitously convert values declared as `float' into `double'. */
3317 /* #define FLOAT_VALUE_TYPE */
3318
3319 /* Define this macro to override the way the value of a `float'-returning
3320 library routine should be packaged in order to return it. These functions
3321 are actually declared to return type `FLOAT_VALUE_TYPE' (normally `int').
3322
3323 These values can't be returned as type `float' because traditional C
3324 compilers would gratuitously convert the value to a `double'.
3325
3326 A local variable named `intify' is always available when the macro `INTIFY'
3327 is used. It is a union of a `float' field named `f' and a field named `i'
3328 whose type is `FLOAT_VALUE_TYPE' or `int'.
3329
3330 If you don't define this macro, the default definition works by copying the
3331 value through that union. */
3332 /* #define INTIFY(FLOAT_VALUE) */
3333
3334 /* Define this macro as the name of the data type corresponding to `SImode' in
3335 the system's own C compiler.
3336
3337 You need not define this macro if that type is `long int', as it usually is. */
3338 /* #define nongcc_SI_type */
3339
3340 /* Define this macro as the name of the data type corresponding to the
3341 word_mode in the system's own C compiler.
3342
3343 You need not define this macro if that type is `long int', as it usually is. */
3344 /* #define nongcc_word_type */
3345
3346 /* Define these macros to supply explicit C statements to carry out various
3347 arithmetic operations on types `float' and `double' in the library routines
3348 in `libgcc1.c'. See that file for a full list of these macros and their
3349 arguments.
3350
3351 On most machines, you don't need to define any of these macros, because the
3352 C compiler that comes with the system takes care of doing them. */
3353 /* #define perform_... */
3354
3355 /* Define this macro to generate code for Objective C message sending using the
3356 calling convention of the NeXT system. This calling convention involves
3357 passing the object, the selector and the method arguments all at once to the
3358 method-lookup library function.
3359
3360 The default calling convention passes just the object and the selector to
3361 the lookup function, which returns a pointer to the method. */
3362 /* #define NEXT_OBJC_RUNTIME */
3363
3364 \f
3365 /* Addressing Modes */
3366
3367 /* Define this macro if the machine supports post-increment addressing. */
3368 #define HAVE_POST_INCREMENT 1
3369
3370 /* Similar for other kinds of addressing. */
3371 /* #define HAVE_PRE_INCREMENT 0 */
3372 #define HAVE_POST_DECREMENT 1
3373 /* #define HAVE_PRE_DECREMENT 0 */
3374
3375 /* A C expression that is 1 if the RTX X is a constant which is a valid
3376 address. On most machines, this can be defined as `CONSTANT_P (X)', but a
3377 few machines are more restrictive in which constant addresses are supported.
3378
3379 `CONSTANT_P' accepts integer-values expressions whose values are not
3380 explicitly known, such as `symbol_ref', `label_ref', and `high' expressions
3381 and `const' arithmetic expressions, in addition to `const_int' and
3382 `const_double' expressions. */
3383 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
3384
3385 /* A number, the maximum number of registers that can appear in a valid memory
3386 address. Note that it is up to you to specify a value equal to the maximum
3387 number that `GO_IF_LEGITIMATE_ADDRESS' would ever accept. */
3388 #define MAX_REGS_PER_ADDRESS 2
3389
3390 /* A C compound statement with a conditional `goto LABEL;' executed if X (an
3391 RTX) is a legitimate memory address on the target machine for a memory
3392 operand of mode MODE.
3393
3394 It usually pays to define several simpler macros to serve as subroutines for
3395 this one. Otherwise it may be too complicated to understand.
3396
3397 This macro must exist in two variants: a strict variant and a non-strict
3398 one. The strict variant is used in the reload pass. It must be defined so
3399 that any pseudo-register that has not been allocated a hard register is
3400 considered a memory reference. In contexts where some kind of register is
3401 required, a pseudo-register with no hard register must be rejected.
3402
3403 The non-strict variant is used in other passes. It must be defined to
3404 accept all pseudo-registers in every context where some kind of register is
3405 required.
3406
3407 Compiler source files that want to use the strict variant of this macro
3408 define the macro `REG_OK_STRICT'. You should use an `#ifdef REG_OK_STRICT'
3409 conditional to define the strict variant in that case and the non-strict
3410 variant otherwise.
3411
3412 Subroutines to check for acceptable registers for various purposes (one for
3413 base registers, one for index registers, and so on) are typically among the
3414 subroutines used to define `GO_IF_LEGITIMATE_ADDRESS'. Then only these
3415 subroutine macros need have two variants; the higher levels of macros may be
3416 the same whether strict or not.
3417
3418 Normally, constant addresses which are the sum of a `symbol_ref' and an
3419 integer are stored inside a `const' RTX to mark them as constant.
3420 Therefore, there is no need to recognize such sums specifically as
3421 legitimate addresses. Normally you would simply recognize any `const' as
3422 legitimate.
3423
3424 Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant sums that
3425 are not marked with `const'. It assumes that a naked `plus' indicates
3426 indexing. If so, then you *must* reject such naked constant sums as
3427 illegitimate addresses, so that none of them will be given to
3428 `PRINT_OPERAND_ADDRESS'.
3429
3430 On some machines, whether a symbolic address is legitimate depends on the
3431 section that the address refers to. On these machines, define the macro
3432 `ENCODE_SECTION_INFO' to store the information into the `symbol_ref', and
3433 then check for it here. When you see a `const', you will have to look
3434 inside it to find the `symbol_ref' in order to determine the section. *Note
3435 Assembler Format::.
3436
3437 The best way to modify the name string is by adding text to the beginning,
3438 with suitable punctuation to prevent any ambiguity. Allocate the new name
3439 in `saveable_obstack'. You will have to modify `ASM_OUTPUT_LABELREF' to
3440 remove and decode the added text and output the name accordingly, and define
3441 `STRIP_NAME_ENCODING' to access the original name string.
3442
3443 You can check the information stored here into the `symbol_ref' in the
3444 definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and
3445 `PRINT_OPERAND_ADDRESS'. */
3446
3447 #ifdef REG_OK_STRICT
3448 #define REG_OK_STRICT_P 1
3449 #else
3450 #define REG_OK_STRICT_P 0
3451 #endif
3452
3453 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
3454 do { \
3455 if (d30v_legitimate_address_p ((int)MODE, X, REG_OK_STRICT_P)) \
3456 goto ADDR; \
3457 } while (0)
3458
3459 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
3460 use as a base register. For hard registers, it should always accept those
3461 which the hardware permits and reject the others. Whether the macro accepts
3462 or rejects pseudo registers must be controlled by `REG_OK_STRICT' as
3463 described above. This usually requires two variant definitions, of which
3464 `REG_OK_STRICT' controls the one actually used. */
3465
3466 #ifdef REG_OK_STRICT
3467 #define REG_OK_FOR_BASE_P(X) (GPR_P (REGNO (X)))
3468 #else
3469 #define REG_OK_FOR_BASE_P(X) (GPR_OR_PSEUDO_P (REGNO (X)))
3470 #endif
3471
3472 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
3473 use as an index register.
3474
3475 The difference between an index register and a base register is that the
3476 index register may be scaled. If an address involves the sum of two
3477 registers, neither one of them scaled, then either one may be labeled the
3478 "base" and the other the "index"; but whichever labeling is used must fit
3479 the machine's constraints of which registers may serve in each capacity.
3480 The compiler will try both labelings, looking for one that is valid, and
3481 will reload one or both registers only if neither labeling works. */
3482
3483 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
3484
3485 /* A C compound statement that attempts to replace X with a valid memory
3486 address for an operand of mode MODE. WIN will be a C statement label
3487 elsewhere in the code; the macro definition may use
3488
3489 GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
3490
3491 to avoid further processing if the address has become legitimate.
3492
3493 X will always be the result of a call to `break_out_memory_refs', and OLDX
3494 will be the operand that was given to that function to produce X.
3495
3496 The code generated by this macro should not alter the substructure of X. If
3497 it transforms X into a more legitimate form, it should assign X (which will
3498 always be a C variable) a new value.
3499
3500 It is not necessary for this macro to come up with a legitimate address.
3501 The compiler has standard ways of doing so in all cases. In fact, it is
3502 safe for this macro to do nothing. But often a machine-dependent strategy
3503 can generate better code. */
3504
3505 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
3506 do { \
3507 rtx y = d30v_legitimize_address (X, OLDX, (int)MODE, REG_OK_STRICT_P); \
3508 if (y) \
3509 { \
3510 X = y; \
3511 GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN); \
3512 } \
3513 } while (0)
3514
3515 /* A C statement or compound statement with a conditional `goto LABEL;'
3516 executed if memory address X (an RTX) can have different meanings depending
3517 on the machine mode of the memory reference it is used for or if the address
3518 is valid for some modes but not others.
3519
3520 Autoincrement and autodecrement addresses typically have mode-dependent
3521 effects because the amount of the increment or decrement is the size of the
3522 operand being addressed. Some machines have other mode-dependent addresses.
3523 Many RISC machines have no mode-dependent addresses.
3524
3525 You may assume that ADDR is a valid address for the machine. */
3526
3527 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
3528 do { \
3529 if (d30v_mode_dependent_address_p (ADDR)) \
3530 goto LABEL; \
3531 } while (0) \
3532
3533 /* A C expression that is nonzero if X is a legitimate constant for an
3534 immediate operand on the target machine. You can assume that X satisfies
3535 `CONSTANT_P', so you need not check this. In fact, `1' is a suitable
3536 definition for this macro on machines where anything `CONSTANT_P' is valid. */
3537 #define LEGITIMATE_CONSTANT_P(X) 1
3538
3539 \f
3540 /* Condition Code Status */
3541
3542 /* C code for a data type which is used for declaring the `mdep' component of
3543 `cc_status'. It defaults to `int'.
3544
3545 This macro is not used on machines that do not use `cc0'. */
3546 /* #define CC_STATUS_MDEP */
3547
3548 /* A C expression to initialize the `mdep' field to "empty". The default
3549 definition does nothing, since most machines don't use the field anyway. If
3550 you want to use the field, you should probably define this macro to
3551 initialize it.
3552
3553 This macro is not used on machines that do not use `cc0'. */
3554 /* #define CC_STATUS_MDEP_INIT */
3555
3556 /* A C compound statement to set the components of `cc_status' appropriately
3557 for an insn INSN whose body is EXP. It is this macro's responsibility to
3558 recognize insns that set the condition code as a byproduct of other activity
3559 as well as those that explicitly set `(cc0)'.
3560
3561 This macro is not used on machines that do not use `cc0'.
3562
3563 If there are insns that do not set the condition code but do alter other
3564 machine registers, this macro must check to see whether they invalidate the
3565 expressions that the condition code is recorded as reflecting. For example,
3566 on the 68000, insns that store in address registers do not set the condition
3567 code, which means that usually `NOTICE_UPDATE_CC' can leave `cc_status'
3568 unaltered for such insns. But suppose that the previous insn set the
3569 condition code based on location `a4@(102)' and the current insn stores a
3570 new value in `a4'. Although the condition code is not changed by this, it
3571 will no longer be true that it reflects the contents of `a4@(102)'.
3572 Therefore, `NOTICE_UPDATE_CC' must alter `cc_status' in this case to say
3573 that nothing is known about the condition code value.
3574
3575 The definition of `NOTICE_UPDATE_CC' must be prepared to deal with the
3576 results of peephole optimization: insns whose patterns are `parallel' RTXs
3577 containing various `reg', `mem' or constants which are just the operands.
3578 The RTL structure of these insns is not sufficient to indicate what the
3579 insns actually do. What `NOTICE_UPDATE_CC' should do when it sees one is
3580 just to run `CC_STATUS_INIT'.
3581
3582 A possible definition of `NOTICE_UPDATE_CC' is to call a function that looks
3583 at an attribute (*note Insn Attributes::.) named, for example, `cc'. This
3584 avoids having detailed information about patterns in two places, the `md'
3585 file and in `NOTICE_UPDATE_CC'. */
3586 /* #define NOTICE_UPDATE_CC(EXP, INSN) */
3587
3588 /* A list of names to be used for additional modes for condition code values in
3589 registers (*note Jump Patterns::.). These names are added to `enum
3590 machine_mode' and all have class `MODE_CC'. By convention, they should
3591 start with `CC' and end with `mode'.
3592
3593 You should only define this macro if your machine does not use `cc0' and
3594 only if additional modes are required. */
3595 /* #define EXTRA_CC_MODES */
3596
3597 /* Returns a mode from class `MODE_CC' to be used when comparison operation
3598 code OP is applied to rtx X and Y. For example, on the Sparc,
3599 `SELECT_CC_MODE' is defined as (see *note Jump Patterns::. for a
3600 description of the reason for this definition)
3601
3602 #define SELECT_CC_MODE(OP,X,Y) \
3603 (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
3604 ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode) \
3605 : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS \
3606 || GET_CODE (X) == NEG) \
3607 ? CC_NOOVmode : CCmode))
3608
3609 You need not define this macro if `EXTRA_CC_MODES' is not defined. */
3610 /* #define SELECT_CC_MODE(OP, X, Y) */
3611
3612 /* One some machines not all possible comparisons are defined, but you can
3613 convert an invalid comparison into a valid one. For example, the Alpha does
3614 not have a `GT' comparison, but you can use an `LT' comparison instead and
3615 swap the order of the operands.
3616
3617 On such machines, define this macro to be a C statement to do any required
3618 conversions. CODE is the initial comparison code and OP0 and OP1 are the
3619 left and right operands of the comparison, respectively. You should modify
3620 CODE, OP0, and OP1 as required.
3621
3622 GNU CC will not assume that the comparison resulting from this macro is
3623 valid but will see if the resulting insn matches a pattern in the `md' file.
3624
3625 You need not define this macro if it would never change the comparison code
3626 or operands. */
3627 /* #define CANONICALIZE_COMPARISON(CODE, OP0, OP1) */
3628
3629 /* A C expression whose value is one if it is always safe to reverse a
3630 comparison whose mode is MODE. If `SELECT_CC_MODE' can ever return MODE for
3631 a floating-point inequality comparison, then `REVERSIBLE_CC_MODE (MODE)'
3632 must be zero.
3633
3634 You need not define this macro if it would always returns zero or if the
3635 floating-point format is anything other than `IEEE_FLOAT_FORMAT'. For
3636 example, here is the definition used on the Sparc, where floating-point
3637 inequality comparisons are always given `CCFPEmode':
3638
3639 #define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode) */
3640 /* #define REVERSIBLE_CC_MODE(MODE) */
3641
3642 \f
3643 /* Describing Relative Costs of Operations */
3644
3645 /* A part of a C `switch' statement that describes the relative costs of
3646 constant RTL expressions. It must contain `case' labels for expression
3647 codes `const_int', `const', `symbol_ref', `label_ref' and `const_double'.
3648 Each case must ultimately reach a `return' statement to return the relative
3649 cost of the use of that kind of constant value in an expression. The cost
3650 may depend on the precise value of the constant, which is available for
3651 examination in X, and the rtx code of the expression in which it is
3652 contained, found in OUTER_CODE.
3653
3654 CODE is the expression code--redundant, since it can be obtained with
3655 `GET_CODE (X)'. */
3656
3657 /* On the d30v, consider operatnds that fit in a short instruction very
3658 cheap. However, at this time, it causes cse to generate incorrect
3659 code, so disable it for now. */
3660 #if 0
3661 #define CONST_COSTS(X, CODE, OUTER_CODE) \
3662 case CONST_INT: \
3663 if (IN_RANGE_P (INTVAL (X), 0, 31)) \
3664 return 0; \
3665 else if ((OUTER_CODE) == LEU && (OUTER_CODE) == LTU \
3666 && (OUTER_CODE) == GEU && (OUTER_CODE) == GTU) \
3667 return IN_RANGE_P (INTVAL (X), 32, 63) ? 0 : COSTS_N_INSNS (2); \
3668 else \
3669 return IN_RANGE_P (INTVAL (X), -31, -1) ? 0 : COSTS_N_INSNS (2); \
3670 case SYMBOL_REF: \
3671 case LABEL_REF: \
3672 case CONST: \
3673 return COSTS_N_INSNS (2); \
3674 case CONST_DOUBLE: \
3675 return COSTS_N_INSNS ((GET_MODE (X) == SFmode) ? 2 : 4);
3676 #else
3677 #define CONST_COSTS(X, CODE, OUTER_CODE)
3678 #endif
3679
3680 /* Like `CONST_COSTS' but applies to nonconstant RTL expressions. This can be
3681 used, for example, to indicate how costly a multiply instruction is. In
3682 writing this macro, you can use the construct `COSTS_N_INSNS (N)' to specify
3683 a cost equal to N fast instructions. OUTER_CODE is the code of the
3684 expression in which X is contained.
3685
3686 This macro is optional; do not define it if the default cost assumptions are
3687 adequate for the target machine. */
3688 #define RTX_COSTS(X, CODE, OUTER_CODE) \
3689 case MULT: \
3690 return COSTS_N_INSNS ((GET_CODE (XEXP (x, 1)) == CONST_INT \
3691 && exact_log2 (INTVAL (XEXP (x, 1))) >= 0) \
3692 ? 1 : 2);
3693
3694 /* An expression giving the cost of an addressing mode that contains ADDRESS.
3695 If not defined, the cost is computed from the ADDRESS expression and the
3696 `CONST_COSTS' values.
3697
3698 For most CISC machines, the default cost is a good approximation of the true
3699 cost of the addressing mode. However, on RISC machines, all instructions
3700 normally have the same length and execution time. Hence all addresses will
3701 have equal costs.
3702
3703 In cases where more than one form of an address is known, the form with the
3704 lowest cost will be used. If multiple forms have the same, lowest, cost,
3705 the one that is the most complex will be used.
3706
3707 For example, suppose an address that is equal to the sum of a register and a
3708 constant is used twice in the same basic block. When this macro is not
3709 defined, the address will be computed in a register and memory references
3710 will be indirect through that register. On machines where the cost of the
3711 addressing mode containing the sum is no higher than that of a simple
3712 indirect reference, this will produce an additional instruction and possibly
3713 require an additional register. Proper specification of this macro
3714 eliminates this overhead for such machines.
3715
3716 Similar use of this macro is made in strength reduction of loops.
3717
3718 ADDRESS need not be valid as an address. In such a case, the cost is not
3719 relevant and can be any value; invalid addresses need not be assigned a
3720 different cost.
3721
3722 On machines where an address involving more than one register is as cheap as
3723 an address computation involving only one register, defining `ADDRESS_COST'
3724 to reflect this can cause two registers to be live over a region of code
3725 where only one would have been if `ADDRESS_COST' were not defined in that
3726 manner. This effect should be considered in the definition of this macro.
3727 Equivalent costs should probably only be given to addresses with different
3728 numbers of registers on machines with lots of registers.
3729
3730 This macro will normally either not be defined or be defined as a constant. */
3731 #define ADDRESS_COST(ADDRESS) 0
3732
3733 /* A C expression for the cost of moving data from a register in class FROM to
3734 one in class TO. The classes are expressed using the enumeration values
3735 such as `GENERAL_REGS'. A value of 4 is the default; other values are
3736 interpreted relative to that.
3737
3738 It is not required that the cost always equal 2 when FROM is the same as TO;
3739 on some machines it is expensive to move between registers if they are not
3740 general registers.
3741
3742 If reload sees an insn consisting of a single `set' between two hard
3743 registers, and if `REGISTER_MOVE_COST' applied to their classes returns a
3744 value of 2, reload does not check to ensure that the constraints of the insn
3745 are met. Setting a cost of other than 2 will allow reload to verify that
3746 the constraints are met. You should do this if the `movM' pattern's
3747 constraints do not allow such copying. */
3748
3749 #define REGISTER_MOVE_COST(FROM, TO) \
3750 (((FROM) != GPR_REGS && (FROM) != EVEN_REGS \
3751 && (TO) != GPR_REGS && (TO) != EVEN_REGS) ? 4 : 2)
3752
3753 /* A C expression for the cost of moving data of mode M between a register and
3754 memory. A value of 2 is the default; this cost is relative to those in
3755 `REGISTER_MOVE_COST'.
3756
3757 If moving between registers and memory is more expensive than between two
3758 registers, you should define this macro to express the relative cost. */
3759 #define MEMORY_MOVE_COST(M,C,I) 4
3760
3761 /* A C expression for the cost of a branch instruction. A value of 1 is the
3762 default; other values are interpreted relative to that. */
3763
3764 #define BRANCH_COST d30v_branch_cost
3765
3766 #define D30V_DEFAULT_BRANCH_COST 2
3767
3768 /* Values of the -mbranch-cost=n string. */
3769 extern int d30v_branch_cost;
3770 extern const char *d30v_branch_cost_string;
3771
3772 /* Here are additional macros which do not specify precise relative costs, but
3773 only that certain actions are more expensive than GNU CC would ordinarily
3774 expect. */
3775
3776 /* Define this macro as a C expression which is nonzero if accessing less than
3777 a word of memory (i.e. a `char' or a `short') is no faster than accessing a
3778 word of memory, i.e., if such access require more than one instruction or if
3779 there is no difference in cost between byte and (aligned) word loads.
3780
3781 When this macro is not defined, the compiler will access a field by finding
3782 the smallest containing object; when it is defined, a fullword load will be
3783 used if alignment permits. Unless bytes accesses are faster than word
3784 accesses, using word accesses is preferable since it may eliminate
3785 subsequent memory access if subsequent accesses occur to other fields in the
3786 same word of the structure, but to different bytes. */
3787 #define SLOW_BYTE_ACCESS 1
3788
3789 /* Define this macro if zero-extension (of a `char' or `short' to an `int') can
3790 be done faster if the destination is a register that is known to be zero.
3791
3792 If you define this macro, you must have instruction patterns that recognize
3793 RTL structures like this:
3794
3795 (set (strict_low_part (subreg:QI (reg:SI ...) 0)) ...)
3796
3797 and likewise for `HImode'. */
3798 #define SLOW_ZERO_EXTEND 0
3799
3800 /* Define this macro to be the value 1 if unaligned accesses have a cost many
3801 times greater than aligned accesses, for example if they are emulated in a
3802 trap handler.
3803
3804 When this macro is non-zero, the compiler will act as if `STRICT_ALIGNMENT'
3805 were non-zero when generating code for block moves. This can cause
3806 significantly more instructions to be produced. Therefore, do not set this
3807 macro non-zero if unaligned accesses only add a cycle or two to the time for
3808 a memory access.
3809
3810 If the value of this macro is always zero, it need not be defined. */
3811 /* #define SLOW_UNALIGNED_ACCESS */
3812
3813 /* Define this macro to inhibit strength reduction of memory addresses. (On
3814 some machines, such strength reduction seems to do harm rather than good.) */
3815 /* #define DONT_REDUCE_ADDR */
3816
3817 /* The number of scalar move insns which should be generated instead of a
3818 string move insn or a library call. Increasing the value will always make
3819 code faster, but eventually incurs high cost in increased code size.
3820
3821 If you don't define this, a reasonable default is used. */
3822 /* #define MOVE_RATIO */
3823
3824 /* Define this macro if it is as good or better to call a constant function
3825 address than to call an address kept in a register. */
3826 #define NO_FUNCTION_CSE
3827
3828 /* Define this macro if it is as good or better for a function to call itself
3829 with an explicit address than to call an address kept in a register. */
3830 /* #define NO_RECURSIVE_FUNCTION_CSE */
3831
3832 /* A C statement (sans semicolon) to update the integer variable COST based on
3833 the relationship between INSN that is dependent on DEP_INSN through the
3834 dependence LINK. The default is to make no adjustment to COST. This can be
3835 used for example to specify to the scheduler that an output- or
3836 anti-dependence does not incur the same cost as a data-dependence. */
3837
3838 #define ADJUST_COST(INSN,LINK,DEP_INSN,COST) \
3839 (COST) = d30v_adjust_cost (INSN, LINK, DEP_INSN, COST)
3840
3841 /* A C statement (sans semicolon) to update the integer scheduling
3842 priority `INSN_PRIORITY(INSN)'. Reduce the priority to execute
3843 the INSN earlier, increase the priority to execute INSN later.
3844 Do not define this macro if you do not need to adjust the
3845 scheduling priorities of insns. */
3846 /* #define ADJUST_PRIORITY (INSN) */
3847
3848 /* Macro to determine whether the Haifa scheduler is used. */
3849 #ifdef HAIFA
3850 #define HAIFA_P 1
3851 #else
3852 #define HAIFA_P 0
3853 #endif
3854
3855 \f
3856 /* Dividing the output into sections. */
3857
3858 /* A C expression whose value is a string containing the assembler operation
3859 that should precede instructions and read-only data. Normally `".text"' is
3860 right. */
3861 #define TEXT_SECTION_ASM_OP ".text"
3862
3863 /* A C expression whose value is a string containing the assembler operation to
3864 identify the following data as writable initialized data. Normally
3865 `".data"' is right. */
3866 #define DATA_SECTION_ASM_OP ".data"
3867
3868 /* if defined, a C expression whose value is a string containing the assembler
3869 operation to identify the following data as shared data. If not defined,
3870 `DATA_SECTION_ASM_OP' will be used. */
3871 /* #define SHARED_SECTION_ASM_OP */
3872
3873 /* If defined, a C expression whose value is a string containing the
3874 assembler operation to identify the following data as
3875 uninitialized global data. If not defined, and neither
3876 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
3877 uninitialized global data will be output in the data section if
3878 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
3879 used. */
3880 #define BSS_SECTION_ASM_OP ".bss"
3881
3882 /* If defined, a C expression whose value is a string containing the
3883 assembler operation to identify the following data as
3884 uninitialized global shared data. If not defined, and
3885 `BSS_SECTION_ASM_OP' is, the latter will be used. */
3886 /* #define SHARED_BSS_SECTION_ASM_OP */
3887
3888 /* A list of names for sections other than the standard two, which are
3889 `in_text' and `in_data'. You need not define this macro on a system with no
3890 other sections (that GCC needs to use).
3891
3892 Defined in svr4.h. */
3893 /* #define EXTRA_SECTIONS */
3894
3895 /* One or more functions to be defined in `varasm.c'. These functions should
3896 do jobs analogous to those of `text_section' and `data_section', for your
3897 additional sections. Do not define this macro if you do not define
3898 `EXTRA_SECTIONS'.
3899
3900 Defined in svr4.h. */
3901 /* #define EXTRA_SECTION_FUNCTIONS */
3902
3903 /* On most machines, read-only variables, constants, and jump tables are placed
3904 in the text section. If this is not the case on your machine, this macro
3905 should be defined to be the name of a function (either `data_section' or a
3906 function defined in `EXTRA_SECTIONS') that switches to the section to be
3907 used for read-only items.
3908
3909 If these items should be placed in the text section, this macro should not
3910 be defined. */
3911 /* #define READONLY_DATA_SECTION */
3912
3913 /* A C statement or statements to switch to the appropriate section for output
3914 of EXP. You can assume that EXP is either a `VAR_DECL' node or a constant
3915 of some sort. RELOC indicates whether the initial value of EXP requires
3916 link-time relocations. Select the section by calling `text_section' or one
3917 of the alternatives for other sections.
3918
3919 Do not define this macro if you put all read-only variables and constants in
3920 the read-only data section (usually the text section).
3921
3922 Defined in svr4.h. */
3923 /* #define SELECT_SECTION(EXP, RELOC) */
3924
3925 /* A C statement or statements to switch to the appropriate section for output
3926 of RTX in mode MODE. You can assume that RTX is some kind of constant in
3927 RTL. The argument MODE is redundant except in the case of a `const_int'
3928 rtx. Select the section by calling `text_section' or one of the
3929 alternatives for other sections.
3930
3931 Do not define this macro if you put all constants in the read-only data
3932 section.
3933
3934 Defined in svr4.h. */
3935 /* #define SELECT_RTX_SECTION(MODE, RTX) */
3936
3937 /* Define this macro if jump tables (for `tablejump' insns) should be output in
3938 the text section, along with the assembler instructions. Otherwise, the
3939 readonly data section is used.
3940
3941 This macro is irrelevant if there is no separate readonly data section. */
3942 /* #define JUMP_TABLES_IN_TEXT_SECTION */
3943
3944 /* Define this macro if references to a symbol must be treated differently
3945 depending on something about the variable or function named by the symbol
3946 (such as what section it is in).
3947
3948 The macro definition, if any, is executed immediately after the rtl for DECL
3949 has been created and stored in `DECL_RTL (DECL)'. The value of the rtl will
3950 be a `mem' whose address is a `symbol_ref'.
3951
3952 The usual thing for this macro to do is to record a flag in the `symbol_ref'
3953 (such as `SYMBOL_REF_FLAG') or to store a modified name string in the
3954 `symbol_ref' (if one bit is not enough information). */
3955 /* #define ENCODE_SECTION_INFO(DECL) */
3956
3957 /* Decode SYM_NAME and store the real name part in VAR, sans the characters
3958 that encode section info. Define this macro if `ENCODE_SECTION_INFO' alters
3959 the symbol's name string. */
3960 /* #define STRIP_NAME_ENCODING(VAR, SYM_NAME) */
3961
3962 /* A C expression which evaluates to true if DECL should be placed
3963 into a unique section for some target-specific reason. If you do
3964 not define this macro, the default is `0'. Note that the flag
3965 `-ffunction-sections' will also cause functions to be placed into
3966 unique sections.
3967
3968 Defined in svr4.h. */
3969 /* #define UNIQUE_SECTION_P(DECL) */
3970
3971 /* A C statement to build up a unique section name, expressed as a
3972 STRING_CST node, and assign it to `DECL_SECTION_NAME (DECL)'.
3973 RELOC indicates whether the initial value of EXP requires
3974 link-time relocations. If you do not define this macro, GNU CC
3975 will use the symbol name prefixed by `.' as the section name.
3976
3977 Defined in svr4.h. */
3978 /* #define UNIQUE_SECTION(DECL, RELOC) */
3979
3980 \f
3981 /* Position Independent Code. */
3982
3983 /* The register number of the register used to address a table of static data
3984 addresses in memory. In some cases this register is defined by a
3985 processor's "application binary interface" (ABI). When this macro is
3986 defined, RTL is generated for this register once, as with the stack pointer
3987 and frame pointer registers. If this macro is not defined, it is up to the
3988 machine-dependent files to allocate such a register (if necessary). */
3989 /* #define PIC_OFFSET_TABLE_REGNUM */
3990
3991 /* Define this macro if the register defined by `PIC_OFFSET_TABLE_REGNUM' is
3992 clobbered by calls. Do not define this macro if `PIC_OFFSET_TABLE_REGNUM'
3993 is not defined. */
3994 /* #define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED */
3995
3996 /* By generating position-independent code, when two different programs (A and
3997 B) share a common library (libC.a), the text of the library can be shared
3998 whether or not the library is linked at the same address for both programs.
3999 In some of these environments, position-independent code requires not only
4000 the use of different addressing modes, but also special code to enable the
4001 use of these addressing modes.
4002
4003 The `FINALIZE_PIC' macro serves as a hook to emit these special codes once
4004 the function is being compiled into assembly code, but not before. (It is
4005 not done before, because in the case of compiling an inline function, it
4006 would lead to multiple PIC prologues being included in functions which used
4007 inline functions and were compiled to assembly language.) */
4008 /* #define FINALIZE_PIC */
4009
4010 /* A C expression that is nonzero if X is a legitimate immediate operand on the
4011 target machine when generating position independent code. You can assume
4012 that X satisfies `CONSTANT_P', so you need not check this. You can also
4013 assume FLAG_PIC is true, so you need not check it either. You need not
4014 define this macro if all constants (including `SYMBOL_REF') can be immediate
4015 operands when generating position independent code. */
4016 /* #define LEGITIMATE_PIC_OPERAND_P(X) */
4017
4018 \f
4019 /* The Overall Framework of an Assembler File. */
4020
4021 /* A C expression which outputs to the stdio stream STREAM some appropriate
4022 text to go at the start of an assembler file.
4023
4024 Normally this macro is defined to output a line containing `#NO_APP', which
4025 is a comment that has no effect on most assemblers but tells the GNU
4026 assembler that it can save time by not checking for certain assembler
4027 constructs.
4028
4029 On systems that use SDB, it is necessary to output certain commands; see
4030 `attasm.h'.
4031
4032 Defined in svr4.h. */
4033
4034 /* #define ASM_FILE_START(STREAM) \
4035 output_file_directive ((STREAM), main_input_filename) */
4036
4037 /* A C expression which outputs to the stdio stream STREAM some appropriate
4038 text to go at the end of an assembler file.
4039
4040 If this macro is not defined, the default is to output nothing special at
4041 the end of the file. Most systems don't require any definition.
4042
4043 On systems that use SDB, it is necessary to output certain commands; see
4044 `attasm.h'.
4045
4046 Defined in svr4.h. */
4047 /* #define ASM_FILE_END(STREAM) */
4048
4049 /* A C statement to output assembler commands which will identify the object
4050 file as having been compiled with GNU CC (or another GNU compiler).
4051
4052 If you don't define this macro, the string `gcc_compiled.:' is output. This
4053 string is calculated to define a symbol which, on BSD systems, will never be
4054 defined for any other reason. GDB checks for the presence of this symbol
4055 when reading the symbol table of an executable.
4056
4057 On non-BSD systems, you must arrange communication with GDB in some other
4058 fashion. If GDB is not used on your system, you can define this macro with
4059 an empty body.
4060
4061 Defined in svr4.h. */
4062 /* #define ASM_IDENTIFY_GCC(FILE) */
4063
4064 /* Like ASM_IDENTIFY_GCC, but used when dbx debugging is selected to emit
4065 a stab the debugger uses to identify gcc as the compiler that is emitted
4066 after the stabs for the filename, which makes it easier for GDB to parse.
4067
4068 Defined in svr4.h. */
4069 /* #define ASM_IDENTIFY_GCC_AFTER_SOURCE(FILE) */
4070
4071 /* A C string constant describing how to begin a comment in the target
4072 assembler language. The compiler assumes that the comment will end at the
4073 end of the line. */
4074 #define ASM_COMMENT_START ";"
4075
4076 /* A C string constant for text to be output before each `asm' statement or
4077 group of consecutive ones. Normally this is `"#APP"', which is a comment
4078 that has no effect on most assemblers but tells the GNU assembler that it
4079 must check the lines that follow for all valid assembler constructs. */
4080 #define ASM_APP_ON "#APP\n"
4081
4082 /* A C string constant for text to be output after each `asm' statement or
4083 group of consecutive ones. Normally this is `"#NO_APP"', which tells the
4084 GNU assembler to resume making the time-saving assumptions that are valid
4085 for ordinary compiler output. */
4086 #define ASM_APP_OFF "#NO_APP\n"
4087
4088 /* A C statement to output COFF information or DWARF debugging information
4089 which indicates that filename NAME is the current source file to the stdio
4090 stream STREAM.
4091
4092 This macro need not be defined if the standard form of output for the file
4093 format in use is appropriate. */
4094 /* #define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) */
4095
4096 /* A C statement to output DBX or SDB debugging information before code for
4097 line number LINE of the current source file to the stdio stream STREAM.
4098
4099 This macro need not be defined if the standard form of debugging information
4100 for the debugger in use is appropriate.
4101
4102 Defined in svr4.h. */
4103 /* #define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) */
4104
4105 /* A C statement to output something to the assembler file to handle a `#ident'
4106 directive containing the text STRING. If this macro is not defined, nothing
4107 is output for a `#ident' directive.
4108
4109 Defined in svr4.h. */
4110 /* #define ASM_OUTPUT_IDENT(STREAM, STRING) */
4111
4112 /* A C statement to output something to the assembler file to switch to section
4113 NAME for object DECL which is either a `FUNCTION_DECL', a `VAR_DECL' or
4114 `NULL_TREE'. Some target formats do not support arbitrary sections. Do not
4115 define this macro in such cases.
4116
4117 At present this macro is only used to support section attributes. When this
4118 macro is undefined, section attributes are disabled.
4119
4120 Defined in svr4.h. */
4121 /* #define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME) */
4122
4123 /* A C statement to output any assembler statements which are required to
4124 precede any Objective C object definitions or message sending. The
4125 statement is executed only when compiling an Objective C program. */
4126 /* #define OBJC_PROLOGUE */
4127
4128 \f
4129 /* Output of Data. */
4130
4131 /* A C statement to output to the stdio stream STREAM an assembler instruction
4132 to assemble a floating-point constant of `TFmode', `DFmode', `SFmode',
4133 `TQFmode', `HFmode', or `QFmode', respectively, whose value is VALUE. VALUE
4134 will be a C expression of type `REAL_VALUE_TYPE'. Macros such as
4135 `REAL_VALUE_TO_TARGET_DOUBLE' are useful for writing these definitions. */
4136
4137 /* #define ASM_OUTPUT_LONG_DOUBLE(STREAM, VALUE) */
4138
4139 #define ASM_OUTPUT_DOUBLE(FILE, VALUE) \
4140 { \
4141 if (REAL_VALUE_ISINF (VALUE) \
4142 || REAL_VALUE_ISNAN (VALUE) \
4143 || REAL_VALUE_MINUS_ZERO (VALUE)) \
4144 { \
4145 long t[2]; \
4146 REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t); \
4147 fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", \
4148 t[0] & 0xffffffff, t[1] & 0xffffffff); \
4149 } \
4150 else \
4151 { \
4152 char str[30]; \
4153 REAL_VALUE_TO_DECIMAL (VALUE, "%.20e", str); \
4154 fprintf (FILE, "\t.double 0d%s\n", str); \
4155 } \
4156 }
4157
4158 #define ASM_OUTPUT_FLOAT(FILE, VALUE) \
4159 { \
4160 if (REAL_VALUE_ISINF (VALUE) \
4161 || REAL_VALUE_ISNAN (VALUE) \
4162 || REAL_VALUE_MINUS_ZERO (VALUE)) \
4163 { \
4164 long t; \
4165 REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \
4166 fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \
4167 } \
4168 else \
4169 { \
4170 char str[30]; \
4171 REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \
4172 fprintf (FILE, "\t.float 0d%s\n", str); \
4173 } \
4174 }
4175
4176 /* #define ASM_OUTPUT_THREE_QUARTER_FLOAT(STREAM, VALUE) */
4177 /* #define ASM_OUTPUT_SHORT_FLOAT(STREAM, VALUE) */
4178 /* #define ASM_OUTPUT_BYTE_FLOAT(STREAM, VALUE) */
4179
4180 /* A C statement to output to the stdio stream STREAM an assembler instruction
4181 to assemble an integer of 16, 8, 4, 2 or 1 bytes, respectively, whose value
4182 is VALUE. The argument EXP will be an RTL expression which represents a
4183 constant value. Use `output_addr_const (STREAM, EXP)' to output this value
4184 as an assembler expression.
4185
4186 For sizes larger than `UNITS_PER_WORD', if the action of a macro would be
4187 identical to repeatedly calling the macro corresponding to a size of
4188 `UNITS_PER_WORD', once for each word, you need not define the macro. */
4189
4190 /* #define ASM_OUTPUT_QUADRUPLE_INT(STREAM, EXP) */
4191 /* #define ASM_OUTPUT_DOUBLE_INT(STREAM, EXP) */
4192
4193 #define ASM_OUTPUT_INT(STREAM, EXP) \
4194 do { \
4195 fputs ("\t.word ", STREAM); \
4196 output_addr_const (STREAM, EXP); \
4197 putc ('\n', STREAM); \
4198 } while (0)
4199
4200 #define ASM_OUTPUT_SHORT(STREAM, EXP) \
4201 do { \
4202 fputs ("\t.hword ", STREAM); \
4203 output_addr_const (STREAM, EXP); \
4204 putc ('\n', STREAM); \
4205 } while (0)
4206
4207 #define ASM_OUTPUT_CHAR(STREAM, EXP) \
4208 do { \
4209 fputs ("\t.byte ", STREAM); \
4210 output_addr_const (STREAM, EXP); \
4211 putc ('\n', STREAM); \
4212 } while (0)
4213
4214 /* A C statement to output to the stdio stream STREAM an assembler instruction
4215 to assemble a single byte containing the number VALUE. */
4216
4217 #define ASM_OUTPUT_BYTE(STREAM, VALUE) \
4218 fprintf (STREAM, "\t%s %d\n", ASM_BYTE_OP, (int)(VALUE))
4219
4220 /* A C string constant giving the pseudo-op to use for a sequence of
4221 single-byte constants. If this macro is not defined, the default
4222 is `"byte"'.
4223
4224 Defined in svr4.h. */
4225 /* #define ASM_BYTE_OP */
4226
4227 /* A C statement to output to the stdio stream STREAM an assembler instruction
4228 to assemble a string constant containing the LEN bytes at PTR. PTR will be
4229 a C expression of type `char *' and LEN a C expression of type `int'.
4230
4231 If the assembler has a `.ascii' pseudo-op as found in the Berkeley Unix
4232 assembler, do not define the macro `ASM_OUTPUT_ASCII'.
4233
4234 Defined in svr4.h. */
4235 /* #define ASM_OUTPUT_ASCII(STREAM, PTR, LEN) */
4236
4237 /* You may define this macro as a C expression. You should define the
4238 expression to have a non-zero value if GNU CC should output the
4239 constant pool for a function before the code for the function, or
4240 a zero value if GNU CC should output the constant pool after the
4241 function. If you do not define this macro, the usual case, GNU CC
4242 will output the constant pool before the function. */
4243 /* #define CONSTANT_POOL_BEFORE_FUNCTION */
4244
4245 /* A C statement to output assembler commands to define the start of the
4246 constant pool for a function. FUNNAME is a string giving the name of the
4247 function. Should the return type of the function be required, it can be
4248 obtained via FUNDECL. SIZE is the size, in bytes, of the constant pool that
4249 will be written immediately after this call.
4250
4251 If no constant-pool prefix is required, the usual case, this macro need not
4252 be defined. */
4253 /* #define ASM_OUTPUT_POOL_PROLOGUE(FILE FUNNAME FUNDECL SIZE) */
4254
4255 /* A C statement (with or without semicolon) to output a constant in the
4256 constant pool, if it needs special treatment. (This macro need not do
4257 anything for RTL expressions that can be output normally.)
4258
4259 The argument FILE is the standard I/O stream to output the assembler code
4260 on. X is the RTL expression for the constant to output, and MODE is the
4261 machine mode (in case X is a `const_int'). ALIGN is the required alignment
4262 for the value X; you should output an assembler directive to force this much
4263 alignment.
4264
4265 The argument LABELNO is a number to use in an internal label for the address
4266 of this pool entry. The definition of this macro is responsible for
4267 outputting the label definition at the proper place. Here is how to do
4268 this:
4269
4270 ASM_OUTPUT_INTERNAL_LABEL (FILE, "LC", LABELNO);
4271
4272 When you output a pool entry specially, you should end with a `goto' to the
4273 label JUMPTO. This will prevent the same pool entry from being output a
4274 second time in the usual manner.
4275
4276 You need not define this macro if it would do nothing. */
4277 /* #define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, X, MODE, ALIGN, LABELNO, JUMPTO) */
4278
4279 /* Define this macro as a C expression which is nonzero if the constant EXP, of
4280 type `tree', should be output after the code for a function. The compiler
4281 will normally output all constants before the function; you need not define
4282 this macro if this is OK. */
4283 /* #define CONSTANT_AFTER_FUNCTION_P(EXP) */
4284
4285 /* A C statement to output assembler commands to at the end of the constant
4286 pool for a function. FUNNAME is a string giving the name of the function.
4287 Should the return type of the function be required, you can obtain it via
4288 FUNDECL. SIZE is the size, in bytes, of the constant pool that GNU CC wrote
4289 immediately before this call.
4290
4291 If no constant-pool epilogue is required, the usual case, you need not
4292 define this macro. */
4293 /* #define ASM_OUTPUT_POOL_EPILOGUE (FILE FUNNAME FUNDECL SIZE) */
4294
4295 /* Define this macro as a C expression which is nonzero if C is used as a
4296 logical line separator by the assembler.
4297
4298 If you do not define this macro, the default is that only the character `;'
4299 is treated as a logical line separator. */
4300 /* #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) */
4301
4302 /* These macros are defined as C string constant, describing the syntax in the
4303 assembler for grouping arithmetic expressions. The following definitions
4304 are correct for most assemblers:
4305
4306 #define ASM_OPEN_PAREN "("
4307 #define ASM_CLOSE_PAREN ")" */
4308 #define ASM_OPEN_PAREN "("
4309 #define ASM_CLOSE_PAREN ")"
4310
4311 /* These macros are provided by `real.h' for writing the definitions of
4312 `ASM_OUTPUT_DOUBLE' and the like: */
4313
4314 /* These translate X, of type `REAL_VALUE_TYPE', to the target's floating point
4315 representation, and store its bit pattern in the array of `long int' whose
4316 address is L. The number of elements in the output array is determined by
4317 the size of the desired target floating point data type: 32 bits of it go in
4318 each `long int' array element. Each array element holds 32 bits of the
4319 result, even if `long int' is wider than 32 bits on the host machine.
4320
4321 The array element values are designed so that you can print them out using
4322 `fprintf' in the order they should appear in the target machine's memory. */
4323 /* #define REAL_VALUE_TO_TARGET_SINGLE(X, L) */
4324 /* #define REAL_VALUE_TO_TARGET_DOUBLE(X, L) */
4325 /* #define REAL_VALUE_TO_TARGET_LONG_DOUBLE(X, L) */
4326
4327 /* This macro converts X, of type `REAL_VALUE_TYPE', to a decimal number and
4328 stores it as a string into STRING. You must pass, as STRING, the address of
4329 a long enough block of space to hold the result.
4330
4331 The argument FORMAT is a `printf'-specification that serves as a suggestion
4332 for how to format the output string. */
4333 /* #define REAL_VALUE_TO_DECIMAL(X, FORMAT, STRING) */
4334
4335 \f
4336 /* Output of Uninitialized Variables. */
4337
4338 /* A C statement (sans semicolon) to output to the stdio stream STREAM the
4339 assembler definition of a common-label named NAME whose size is SIZE bytes.
4340 The variable ROUNDED is the size rounded up to whatever alignment the caller
4341 wants.
4342
4343 Use the expression `assemble_name (STREAM, NAME)' to output the name itself;
4344 before and after that, output the additional assembler syntax for defining
4345 the name, and a newline.
4346
4347 This macro controls how the assembler definitions of uninitialized global
4348 variables are output. */
4349 /* #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) */
4350
4351 /* Like `ASM_OUTPUT_COMMON' except takes the required alignment as a separate,
4352 explicit argument. If you define this macro, it is used in place of
4353 `ASM_OUTPUT_COMMON', and gives you more flexibility in handling the required
4354 alignment of the variable. The alignment is specified as the number of
4355 bits.
4356
4357 Defined in svr4.h. */
4358 /* #define ASM_OUTPUT_ALIGNED_COMMON(STREAM, NAME, SIZE, ALIGNMENT) */
4359
4360 /* Like ASM_OUTPUT_ALIGNED_COMMON except that it takes an additional argument -
4361 the DECL of the variable to be output, if there is one. This macro can be
4362 called with DECL == NULL_TREE. If you define this macro, it is used in
4363 place of both ASM_OUTPUT_COMMON and ASM_OUTPUT_ALIGNED_COMMON, and gives you
4364 more flexibility in handling the destination of the variable. */
4365 /* #define ASM_OUTPUT_DECL_COMMON (STREAM, DECL, NAME, SIZE, ALIGNMENT) */
4366
4367 /* If defined, it is similar to `ASM_OUTPUT_COMMON', except that it is used
4368 when NAME is shared. If not defined, `ASM_OUTPUT_COMMON' will be used. */
4369 /* #define ASM_OUTPUT_SHARED_COMMON(STREAM, NAME, SIZE, ROUNDED) */
4370
4371 /* A C statement (sans semicolon) to output to the stdio stream STREAM the
4372 assembler definition of uninitialized global DECL named NAME whose size is
4373 SIZE bytes. The variable ROUNDED is the size rounded up to whatever
4374 alignment the caller wants.
4375
4376 Try to use function `asm_output_bss' defined in `varasm.c' when defining
4377 this macro. If unable, use the expression `assemble_name (STREAM, NAME)' to
4378 output the name itself; before and after that, output the additional
4379 assembler syntax for defining the name, and a newline.
4380
4381 This macro controls how the assembler definitions of uninitialized global
4382 variables are output. This macro exists to properly support languages like
4383 `c++' which do not have `common' data. However, this macro currently is not
4384 defined for all targets. If this macro and `ASM_OUTPUT_ALIGNED_BSS' are not
4385 defined then `ASM_OUTPUT_COMMON' or `ASM_OUTPUT_ALIGNED_COMMON' or
4386 `ASM_OUTPUT_DECL_COMMON' is used. */
4387 /* #define ASM_OUTPUT_BSS(STREAM, DECL, NAME, SIZE, ROUNDED) */
4388
4389 /* Like `ASM_OUTPUT_BSS' except takes the required alignment as a separate,
4390 explicit argument. If you define this macro, it is used in place of
4391 `ASM_OUTPUT_BSS', and gives you more flexibility in handling the required
4392 alignment of the variable. The alignment is specified as the number of
4393 bits.
4394
4395 Try to use function `asm_output_aligned_bss' defined in file `varasm.c' when
4396 defining this macro. */
4397 /* #define ASM_OUTPUT_ALIGNED_BSS(STREAM, DECL, NAME, SIZE, ALIGNMENT) */
4398
4399 /* If defined, it is similar to `ASM_OUTPUT_BSS', except that it is used when
4400 NAME is shared. If not defined, `ASM_OUTPUT_BSS' will be used. */
4401 /* #define ASM_OUTPUT_SHARED_BSS(STREAM, DECL, NAME, SIZE, ROUNDED) */
4402
4403 /* A C statement (sans semicolon) to output to the stdio stream STREAM the
4404 assembler definition of a local-common-label named NAME whose size is SIZE
4405 bytes. The variable ROUNDED is the size rounded up to whatever alignment
4406 the caller wants.
4407
4408 Use the expression `assemble_name (STREAM, NAME)' to output the name itself;
4409 before and after that, output the additional assembler syntax for defining
4410 the name, and a newline.
4411
4412 This macro controls how the assembler definitions of uninitialized static
4413 variables are output. */
4414 /* #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) */
4415
4416 /* Like `ASM_OUTPUT_LOCAL' except takes the required alignment as a separate,
4417 explicit argument. If you define this macro, it is used in place of
4418 `ASM_OUTPUT_LOCAL', and gives you more flexibility in handling the required
4419 alignment of the variable. The alignment is specified as the number of
4420 bits.
4421
4422 Defined in svr4.h. */
4423 /* #define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGNMENT) */
4424
4425 /* Like `ASM_OUTPUT_ALIGNED_LOCAL' except that it takes an additional
4426 parameter - the DECL of variable to be output, if there is one.
4427 This macro can be called with DECL == NULL_TREE. If you define
4428 this macro, it is used in place of `ASM_OUTPUT_LOCAL' and
4429 `ASM_OUTPUT_ALIGNED_LOCAL', and gives you more flexibility in
4430 handling the destination of the variable. */
4431 /* #define ASM_OUTPUT_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGNMENT) */
4432
4433 /* If defined, it is similar to `ASM_OUTPUT_LOCAL', except that it is used when
4434 NAME is shared. If not defined, `ASM_OUTPUT_LOCAL' will be used. */
4435 /* #define ASM_OUTPUT_SHARED_LOCAL (STREAM, NAME, SIZE, ROUNDED) */
4436
4437 \f
4438 /* Output and Generation of Labels. */
4439
4440 /* A C statement (sans semicolon) to output to the stdio stream STREAM the
4441 assembler definition of a label named NAME. Use the expression
4442 `assemble_name (STREAM, NAME)' to output the name itself; before and after
4443 that, output the additional assembler syntax for defining the name, and a
4444 newline. */
4445
4446 #define ASM_OUTPUT_LABEL(STREAM, NAME) \
4447 do { \
4448 assemble_name (STREAM, NAME); \
4449 fputs (":\n", STREAM); \
4450 } while (0)
4451
4452 /* A C statement (sans semicolon) to output to the stdio stream STREAM any text
4453 necessary for declaring the name NAME of a function which is being defined.
4454 This macro is responsible for outputting the label definition (perhaps using
4455 `ASM_OUTPUT_LABEL'). The argument DECL is the `FUNCTION_DECL' tree node
4456 representing the function.
4457
4458 If this macro is not defined, then the function name is defined in the usual
4459 manner as a label (by means of `ASM_OUTPUT_LABEL').
4460
4461 Defined in svr4.h. */
4462 /* #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) */
4463
4464 /* A C statement (sans semicolon) to output to the stdio stream STREAM any text
4465 necessary for declaring the size of a function which is being defined. The
4466 argument NAME is the name of the function. The argument DECL is the
4467 `FUNCTION_DECL' tree node representing the function.
4468
4469 If this macro is not defined, then the function size is not defined.
4470
4471 Defined in svr4.h. */
4472 /* #define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL) */
4473
4474 /* A C statement (sans semicolon) to output to the stdio stream STREAM any text
4475 necessary for declaring the name NAME of an initialized variable which is
4476 being defined. This macro must output the label definition (perhaps using
4477 `ASM_OUTPUT_LABEL'). The argument DECL is the `VAR_DECL' tree node
4478 representing the variable.
4479
4480 If this macro is not defined, then the variable name is defined in the usual
4481 manner as a label (by means of `ASM_OUTPUT_LABEL').
4482
4483 Defined in svr4.h. */
4484 /* #define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) */
4485
4486 /* A C statement (sans semicolon) to finish up declaring a variable name once
4487 the compiler has processed its initializer fully and thus has had a chance
4488 to determine the size of an array when controlled by an initializer. This
4489 is used on systems where it's necessary to declare something about the size
4490 of the object.
4491
4492 If you don't define this macro, that is equivalent to defining it to do
4493 nothing.
4494
4495 Defined in svr4.h. */
4496 /* #define ASM_FINISH_DECLARE_OBJECT(STREAM, DECL, TOPLEVEL, ATEND) */
4497
4498 /* A C statement (sans semicolon) to output to the stdio stream STREAM some
4499 commands that will make the label NAME global; that is, available for
4500 reference from other files. Use the expression `assemble_name (STREAM,
4501 NAME)' to output the name itself; before and after that, output the
4502 additional assembler syntax for making that name global, and a newline. */
4503
4504 #define ASM_GLOBALIZE_LABEL(STREAM,NAME) \
4505 do { \
4506 fputs ("\t.globl ", STREAM); \
4507 assemble_name (STREAM, NAME); \
4508 fputs ("\n", STREAM); \
4509 } while (0)
4510
4511 /* A C statement (sans semicolon) to output to the stdio stream STREAM some
4512 commands that will make the label NAME weak; that is, available for
4513 reference from other files but only used if no other definition is
4514 available. Use the expression `assemble_name (STREAM, NAME)' to output the
4515 name itself; before and after that, output the additional assembler syntax
4516 for making that name weak, and a newline.
4517
4518 If you don't define this macro, GNU CC will not support weak symbols and you
4519 should not define the `SUPPORTS_WEAK' macro.
4520
4521 Defined in svr4.h. */
4522 /* #define ASM_WEAKEN_LABEL */
4523
4524 /* A C expression which evaluates to true if the target supports weak symbols.
4525
4526 If you don't define this macro, `defaults.h' provides a default definition.
4527 If `ASM_WEAKEN_LABEL' is defined, the default definition is `1'; otherwise,
4528 it is `0'. Define this macro if you want to control weak symbol support
4529 with a compiler flag such as `-melf'. */
4530 /* #define SUPPORTS_WEAK */
4531
4532 /* A C statement (sans semicolon) to mark DECL to be emitted as a
4533 public symbol such that extra copies in multiple translation units
4534 will be discarded by the linker. Define this macro if your object
4535 file format provides support for this concept, such as the `COMDAT'
4536 section flags in the Microsoft Windows PE/COFF format, and this
4537 support requires changes to DECL, such as putting it in a separate
4538 section.
4539
4540 Defined in svr4.h. */
4541 /* #define MAKE_DECL_ONE_ONLY */
4542
4543 /* A C expression which evaluates to true if the target supports one-only
4544 semantics.
4545
4546 If you don't define this macro, `varasm.c' provides a default definition.
4547 If `MAKE_DECL_ONE_ONLY' is defined, the default definition is `1';
4548 otherwise, it is `0'. Define this macro if you want to control one-only
4549 symbol support with a compiler flag, or if setting the `DECL_ONE_ONLY' flag
4550 is enough to mark a declaration to be emitted as one-only. */
4551 /* #define SUPPORTS_ONE_ONLY */
4552
4553 /* A C statement (sans semicolon) to output to the stdio stream STREAM any text
4554 necessary for declaring the name of an external symbol named NAME which is
4555 referenced in this compilation but not defined. The value of DECL is the
4556 tree node for the declaration.
4557
4558 This macro need not be defined if it does not need to output anything. The
4559 GNU assembler and most Unix assemblers don't require anything. */
4560 /* #define ASM_OUTPUT_EXTERNAL(STREAM, DECL, NAME) */
4561
4562 /* A C statement (sans semicolon) to output on STREAM an assembler pseudo-op to
4563 declare a library function name external. The name of the library function
4564 is given by SYMREF, which has type `rtx' and is a `symbol_ref'.
4565
4566 This macro need not be defined if it does not need to output anything. The
4567 GNU assembler and most Unix assemblers don't require anything.
4568
4569 Defined in svr4.h. */
4570 /* #define ASM_OUTPUT_EXTERNAL_LIBCALL(STREAM, SYMREF) */
4571
4572 /* A C statement (sans semicolon) to output to the stdio stream STREAM a
4573 reference in assembler syntax to a label named NAME. This should add `_' to
4574 the front of the name, if that is customary on your operating system, as it
4575 is in most Berkeley Unix systems. This macro is used in `assemble_name'. */
4576 /* #define ASM_OUTPUT_LABELREF(STREAM, NAME) */
4577
4578 /* A C statement to output to the stdio stream STREAM a label whose name is
4579 made from the string PREFIX and the number NUM.
4580
4581 It is absolutely essential that these labels be distinct from the labels
4582 used for user-level functions and variables. Otherwise, certain programs
4583 will have name conflicts with internal labels.
4584
4585 It is desirable to exclude internal labels from the symbol table of the
4586 object file. Most assemblers have a naming convention for labels that
4587 should be excluded; on many systems, the letter `L' at the beginning of a
4588 label has this effect. You should find out what convention your system
4589 uses, and follow it.
4590
4591 The usual definition of this macro is as follows:
4592
4593 fprintf (STREAM, "L%s%d:\n", PREFIX, NUM)
4594
4595 Defined in svr4.h. */
4596 /* #define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) */
4597
4598 /* A C statement to store into the string STRING a label whose name is made
4599 from the string PREFIX and the number NUM.
4600
4601 This string, when output subsequently by `assemble_name', should produce the
4602 output that `ASM_OUTPUT_INTERNAL_LABEL' would produce with the same PREFIX
4603 and NUM.
4604
4605 If the string begins with `*', then `assemble_name' will output the rest of
4606 the string unchanged. It is often convenient for
4607 `ASM_GENERATE_INTERNAL_LABEL' to use `*' in this way. If the string doesn't
4608 start with `*', then `ASM_OUTPUT_LABELREF' gets to output the string, and
4609 may change it. (Of course, `ASM_OUTPUT_LABELREF' is also part of your
4610 machine description, so you should know what it does on your machine.)
4611
4612 Defined in svr4.h. */
4613
4614 /*
4615 #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
4616 do { \
4617 sprintf (LABEL, "*.%s%d", PREFIX, NUM); \
4618 } while (0)
4619 */
4620
4621 /* A C expression to assign to OUTVAR (which is a variable of type `char *') a
4622 newly allocated string made from the string NAME and the number NUMBER, with
4623 some suitable punctuation added. Use `alloca' to get space for the string.
4624
4625 The string will be used as an argument to `ASM_OUTPUT_LABELREF' to produce
4626 an assembler label for an internal static variable whose name is NAME.
4627 Therefore, the string must be such as to result in valid assembler code.
4628 The argument NUMBER is different each time this macro is executed; it
4629 prevents conflicts between similarly-named internal static variables in
4630 different scopes.
4631
4632 Ideally this string should not be a valid C identifier, to prevent any
4633 conflict with the user's own symbols. Most assemblers allow periods or
4634 percent signs in assembler symbols; putting at least one of these between
4635 the name and the number will suffice. */
4636
4637 #define ASM_FORMAT_PRIVATE_NAME(OUTVAR, NAME, NUMBER) \
4638 do { \
4639 (OUTVAR) = (char *) alloca (strlen ((NAME)) + 12); \
4640 sprintf ((OUTVAR), "%s.%ld", (NAME), (long)(NUMBER)); \
4641 } while (0)
4642
4643 /* A C statement to output to the stdio stream STREAM assembler code which
4644 defines (equates) the symbol NAME to have the value VALUE.
4645
4646 If SET_ASM_OP is defined, a default definition is provided which is correct
4647 for most systems.
4648
4649 Defined in svr4.h. */
4650 /* #define ASM_OUTPUT_DEF(STREAM, NAME, VALUE) */
4651
4652 /* A C statement to output to the stdio stream STREAM assembler code which
4653 defines (equates) the weak symbol NAME to have the value VALUE.
4654
4655 Define this macro if the target only supports weak aliases; define
4656 ASM_OUTPUT_DEF instead if possible. */
4657 /* #define ASM_OUTPUT_WEAK_ALIAS (STREAM, NAME, VALUE) */
4658
4659 /* Define this macro to override the default assembler names used for Objective
4660 C methods.
4661
4662 The default name is a unique method number followed by the name of the class
4663 (e.g. `_1_Foo'). For methods in categories, the name of the category is
4664 also included in the assembler name (e.g. `_1_Foo_Bar').
4665
4666 These names are safe on most systems, but make debugging difficult since the
4667 method's selector is not present in the name. Therefore, particular systems
4668 define other ways of computing names.
4669
4670 BUF is an expression of type `char *' which gives you a buffer in which to
4671 store the name; its length is as long as CLASS_NAME, CAT_NAME and SEL_NAME
4672 put together, plus 50 characters extra.
4673
4674 The argument IS_INST specifies whether the method is an instance method or a
4675 class method; CLASS_NAME is the name of the class; CAT_NAME is the name of
4676 the category (or NULL if the method is not in a category); and SEL_NAME is
4677 the name of the selector.
4678
4679 On systems where the assembler can handle quoted names, you can use this
4680 macro to provide more human-readable names. */
4681 /* #define OBJC_GEN_METHOD_LABEL(BUF, IS_INST, CLASS_NAME, CAT_NAME, SEL_NAME) */
4682
4683 \f
4684 /* Macros Controlling Initialization Routines. */
4685
4686 /* If defined, a C string constant for the assembler operation to identify the
4687 following data as initialization code. If not defined, GNU CC will assume
4688 such a section does not exist. When you are using special sections for
4689 initialization and termination functions, this macro also controls how
4690 `crtstuff.c' and `libgcc2.c' arrange to run the initialization functions.
4691
4692 Defined in svr4.h. */
4693 /* #define INIT_SECTION_ASM_OP */
4694 #undef INIT_SECTION_ASM_OP
4695
4696 /* If defined, `main' will not call `__main' as described above. This macro
4697 should be defined for systems that control the contents of the init section
4698 on a symbol-by-symbol basis, such as OSF/1, and should not be defined
4699 explicitly for systems that support `INIT_SECTION_ASM_OP'. */
4700 /* #define HAS_INIT_SECTION */
4701
4702 /* If defined, a C string constant for a switch that tells the linker that the
4703 following symbol is an initialization routine. */
4704 /* #define LD_INIT_SWITCH */
4705
4706 /* If defined, a C string constant for a switch that tells the linker that the
4707 following symbol is a finalization routine. */
4708 /* #define LD_FINI_SWITCH */
4709
4710 /* If defined, `main' will call `__main' despite the presence of
4711 `INIT_SECTION_ASM_OP'. This macro should be defined for systems where the
4712 init section is not actually run automatically, but is still useful for
4713 collecting the lists of constructors and destructors. */
4714 #define INVOKE__main
4715
4716 /* Define this macro as a C statement to output on the stream STREAM the
4717 assembler code to arrange to call the function named NAME at initialization
4718 time.
4719
4720 Assume that NAME is the name of a C function generated automatically by the
4721 compiler. This function takes no arguments. Use the function
4722 `assemble_name' to output the name NAME; this performs any system-specific
4723 syntactic transformations such as adding an underscore.
4724
4725 If you don't define this macro, nothing special is output to arrange to call
4726 the function. This is correct when the function will be called in some
4727 other manner--for example, by means of the `collect2' program, which looks
4728 through the symbol table to find these functions by their names.
4729
4730 Defined in svr4.h. */
4731 /* #define ASM_OUTPUT_CONSTRUCTOR(STREAM, NAME) */
4732
4733 /* This is like `ASM_OUTPUT_CONSTRUCTOR' but used for termination functions
4734 rather than initialization functions.
4735
4736 Defined in svr4.h. */
4737 /* #define ASM_OUTPUT_DESTRUCTOR(STREAM, NAME) */
4738
4739 /* If your system uses `collect2' as the means of processing constructors, then
4740 that program normally uses `nm' to scan an object file for constructor
4741 functions to be called. On certain kinds of systems, you can define these
4742 macros to make `collect2' work faster (and, in some cases, make it work at
4743 all): */
4744
4745 /* Define this macro if the system uses COFF (Common Object File Format) object
4746 files, so that `collect2' can assume this format and scan object files
4747 directly for dynamic constructor/destructor functions. */
4748 /* #define OBJECT_FORMAT_COFF */
4749
4750 /* Define this macro if the system uses ROSE format object files, so that
4751 `collect2' can assume this format and scan object files directly for dynamic
4752 constructor/destructor functions.
4753
4754 These macros are effective only in a native compiler; `collect2' as
4755 part of a cross compiler always uses `nm' for the target machine. */
4756 /* #define OBJECT_FORMAT_ROSE */
4757
4758 /* Define this macro if the system uses ELF format object files.
4759
4760 Defined in svr4.h. */
4761 /* #define OBJECT_FORMAT_ELF */
4762
4763 /* Define this macro as a C string constant containing the file name to use to
4764 execute `nm'. The default is to search the path normally for `nm'.
4765
4766 If your system supports shared libraries and has a program to list the
4767 dynamic dependencies of a given library or executable, you can define these
4768 macros to enable support for running initialization and termination
4769 functions in shared libraries: */
4770 /* #define REAL_NM_FILE_NAME */
4771
4772 /* Define this macro to a C string constant containing the name of the program
4773 which lists dynamic dependencies, like `"ldd"' under SunOS 4. */
4774 /* #define LDD_SUFFIX */
4775
4776 /* Define this macro to be C code that extracts filenames from the output of
4777 the program denoted by `LDD_SUFFIX'. PTR is a variable of type `char *'
4778 that points to the beginning of a line of output from `LDD_SUFFIX'. If the
4779 line lists a dynamic dependency, the code must advance PTR to the beginning
4780 of the filename on that line. Otherwise, it must set PTR to `NULL'. */
4781 /* #define PARSE_LDD_OUTPUT (PTR) */
4782
4783 \f
4784 /* Output of Assembler Instructions. */
4785
4786 /* A C initializer containing the assembler's names for the machine registers,
4787 each one as a C string constant. This is what translates register numbers
4788 in the compiler into assembler language. */
4789 #define REGISTER_NAMES \
4790 { \
4791 "r0", "r1", "r2", "r3", \
4792 "r4", "r5", "r6", "r7", \
4793 "r8", "r9", "r10", "r11", \
4794 "r12", "r13", "r14", "r15", \
4795 "r16", "r17", "r18", "r19", \
4796 "r20", "r21", "r22", "r23", \
4797 "r24", "r25", "r26", "r27", \
4798 "r28", "r29", "r30", "r31", \
4799 "r32", "r33", "r34", "r35", \
4800 "r36", "r37", "r38", "r39", \
4801 "r40", "r41", "r42", "r43", \
4802 "r44", "r45", "r46", "r47", \
4803 "r48", "r49", "r50", "r51", \
4804 "r52", "r53", "r54", "r55", \
4805 "r56", "r57", "r58", "r59", \
4806 "r60", "r61", "link", "sp", \
4807 "ap", \
4808 "f0", "f1", "f2", "f3", \
4809 "s", "v", "va", "c", \
4810 "a0", "a1", \
4811 "psw", "bpsw", "pc", "bpc", \
4812 "dpsw", "dpc", "rpt_c", "rpt_s", \
4813 "rpt_e", "mod_s", "mod_e", "iba", \
4814 "eit_vb", "int_s", "int_m", \
4815 }
4816
4817 /* If defined, a C initializer for an array of structures containing a name and
4818 a register number. This macro defines additional names for hard registers,
4819 thus allowing the `asm' option in declarations to refer to registers using
4820 alternate names. */
4821 #define ADDITIONAL_REGISTER_NAMES \
4822 { \
4823 {"r62", GPR_LINK}, \
4824 {"r63", GPR_SP}, \
4825 {"f4", FLAG_SAT}, \
4826 {"f5", FLAG_OVERFLOW}, \
4827 {"f6", FLAG_ACC_OVER}, \
4828 {"f7", FLAG_CARRY}, \
4829 {"carry", FLAG_CARRY}, \
4830 {"borrow", FLAG_BORROW}, \
4831 {"b", FLAG_BORROW}, \
4832 {"cr0", CR_PSW}, \
4833 {"cr1", CR_BPSW}, \
4834 {"cr2", CR_PC}, \
4835 {"cr3", CR_BPC}, \
4836 {"cr4", CR_DPSW}, \
4837 {"cr5", CR_DPC}, \
4838 {"cr7", CR_RPT_C}, \
4839 {"cr8", CR_RPT_S}, \
4840 {"cr9", CR_RPT_E}, \
4841 {"cr10", CR_MOD_S}, \
4842 {"cr11", CR_MOD_E}, \
4843 {"cr14", CR_IBA}, \
4844 {"cr15", CR_EIT_VB}, \
4845 {"cr16", CR_INT_S}, \
4846 {"cr17", CR_INT_M} \
4847 }
4848
4849 /* Define this macro if you are using an unusual assembler that requires
4850 different names for the machine instructions.
4851
4852 The definition is a C statement or statements which output an assembler
4853 instruction opcode to the stdio stream STREAM. The macro-operand PTR is a
4854 variable of type `char *' which points to the opcode name in its "internal"
4855 form--the form that is written in the machine description. The definition
4856 should output the opcode name to STREAM, performing any translation you
4857 desire, and increment the variable PTR to point at the end of the opcode so
4858 that it will not be output twice.
4859
4860 In fact, your macro definition may process less than the entire opcode name,
4861 or more than the opcode name; but if you want to process text that includes
4862 `%'-sequences to substitute operands, you must take care of the substitution
4863 yourself. Just be sure to increment PTR over whatever text should not be
4864 output normally.
4865
4866 If you need to look at the operand values, they can be found as the elements
4867 of `recog_data.operand'.
4868
4869 If the macro definition does nothing, the instruction is output in the usual
4870 way. */
4871 /* #define ASM_OUTPUT_OPCODE(STREAM, PTR) */
4872
4873 /* If defined, a C statement to be executed just prior to the output of
4874 assembler code for INSN, to modify the extracted operands so they will be
4875 output differently.
4876
4877 Here the argument OPVEC is the vector containing the operands extracted from
4878 INSN, and NOPERANDS is the number of elements of the vector which contain
4879 meaningful data for this insn. The contents of this vector are what will be
4880 used to convert the insn template into assembler code, so you can change the
4881 assembler output by changing the contents of the vector.
4882
4883 This macro is useful when various assembler syntaxes share a single file of
4884 instruction patterns; by defining this macro differently, you can cause a
4885 large class of instructions to be output differently (such as with
4886 rearranged operands). Naturally, variations in assembler syntax affecting
4887 individual insn patterns ought to be handled by writing conditional output
4888 routines in those patterns.
4889
4890 If this macro is not defined, it is equivalent to a null statement. */
4891 /* #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) */
4892
4893 /* If defined, `FINAL_PRESCAN_INSN' will be called on each
4894 `CODE_LABEL'. In that case, OPVEC will be a null pointer and
4895 NOPERANDS will be zero. */
4896 /* #define FINAL_PRESCAN_LABEL */
4897
4898 /* A C compound statement to output to stdio stream STREAM the assembler syntax
4899 for an instruction operand X. X is an RTL expression.
4900
4901 CODE is a value that can be used to specify one of several ways of printing
4902 the operand. It is used when identical operands must be printed differently
4903 depending on the context. CODE comes from the `%' specification that was
4904 used to request printing of the operand. If the specification was just
4905 `%DIGIT' then CODE is 0; if the specification was `%LTR DIGIT' then CODE is
4906 the ASCII code for LTR.
4907
4908 If X is a register, this macro should print the register's name. The names
4909 can be found in an array `reg_names' whose type is `char *[]'. `reg_names'
4910 is initialized from `REGISTER_NAMES'.
4911
4912 When the machine description has a specification `%PUNCT' (a `%' followed by
4913 a punctuation character), this macro is called with a null pointer for X and
4914 the punctuation character for CODE.
4915
4916 Standard operand flags that are handled elsewhere:
4917 `=' Output a number unique to each instruction in the compilation.
4918 `a' Substitute an operand as if it were a memory reference.
4919 `c' Omit the syntax that indicates an immediate operand.
4920 `l' Substitute a LABEL_REF into a jump instruction.
4921 `n' Like %cDIGIT, except negate the value before printing.
4922
4923 The d30v specific operand flags are:
4924 `.' Print r0.
4925 `f' Print a SF constant as an int.
4926 `s' Subtract 32 and negate.
4927 `A' Print accumulator number without an `a' in front of it.
4928 `B' Print bit offset for BSET, etc. instructions.
4929 `E' Print u if this is zero extend, nothing if this is sign extend.
4930 `F' Emit /{f,t,x}{f,t,x} for executing a false condition.
4931 `L' Print the lower half of a 64 bit item.
4932 `M' Print a memory reference for ld/st instructions.
4933 `R' Return appropriate cmp instruction for relational test.
4934 `S' Subtract 32.
4935 `T' Emit /{f,t,x}{f,t,x} for executing a true condition.
4936 `U' Print the upper half of a 64 bit item. */
4937
4938 #define PRINT_OPERAND(STREAM, X, CODE) d30v_print_operand (STREAM, X, CODE)
4939
4940 /* A C expression which evaluates to true if CODE is a valid punctuation
4941 character for use in the `PRINT_OPERAND' macro. If
4942 `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no punctuation
4943 characters (except for the standard one, `%') are used in this way. */
4944
4945 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '.' || (CODE) == ':')
4946
4947 /* A C compound statement to output to stdio stream STREAM the assembler syntax
4948 for an instruction operand that is a memory reference whose address is X. X
4949 is an RTL expression.
4950
4951 On some machines, the syntax for a symbolic address depends on the section
4952 that the address refers to. On these machines, define the macro
4953 `ENCODE_SECTION_INFO' to store the information into the `symbol_ref', and
4954 then check for it here. *Note Assembler Format::. */
4955
4956 #define PRINT_OPERAND_ADDRESS(STREAM, X) d30v_print_operand_address (STREAM, X)
4957
4958 /* A C statement, to be executed after all slot-filler instructions have been
4959 output. If necessary, call `dbr_sequence_length' to determine the number of
4960 slots filled in a sequence (zero if not currently outputting a sequence), to
4961 decide how many no-ops to output, or whatever.
4962
4963 Don't define this macro if it has nothing to do, but it is helpful in
4964 reading assembly output if the extent of the delay sequence is made explicit
4965 (e.g. with white space).
4966
4967 Note that output routines for instructions with delay slots must be prepared
4968 to deal with not being output as part of a sequence (i.e. when the
4969 scheduling pass is not run, or when no slot fillers could be found.) The
4970 variable `final_sequence' is null when not processing a sequence, otherwise
4971 it contains the `sequence' rtx being output. */
4972 /* #define DBR_OUTPUT_SEQEND(FILE) */
4973
4974 /* If defined, C string expressions to be used for the `%R', `%L', `%U', and
4975 `%I' options of `asm_fprintf' (see `final.c'). These are useful when a
4976 single `md' file must support multiple assembler formats. In that case, the
4977 various `tm.h' files can define these macros differently.
4978
4979 USER_LABEL_PREFIX is defined in svr4.h. */
4980
4981 #define REGISTER_PREFIX "%"
4982 #define LOCAL_LABEL_PREFIX "."
4983 #define USER_LABEL_PREFIX ""
4984 #define IMMEDIATE_PREFIX ""
4985
4986 /* If your target supports multiple dialects of assembler language (such as
4987 different opcodes), define this macro as a C expression that gives the
4988 numeric index of the assembler language dialect to use, with zero as the
4989 first variant.
4990
4991 If this macro is defined, you may use `{option0|option1|option2...}'
4992 constructs in the output templates of patterns (*note Output Template::.) or
4993 in the first argument of `asm_fprintf'. This construct outputs `option0',
4994 `option1' or `option2', etc., if the value of `ASSEMBLER_DIALECT' is zero,
4995 one or two, etc. Any special characters within these strings retain their
4996 usual meaning.
4997
4998 If you do not define this macro, the characters `{', `|' and `}' do not have
4999 any special meaning when used in templates or operands to `asm_fprintf'.
5000
5001 Define the macros `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX',
5002 `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' if you can express the variations
5003 in assemble language syntax with that mechanism. Define `ASSEMBLER_DIALECT'
5004 and use the `{option0|option1}' syntax if the syntax variant are larger and
5005 involve such things as different opcodes or operand order. */
5006 /* #define ASSEMBLER_DIALECT */
5007
5008 /* A C expression to output to STREAM some assembler code which will push hard
5009 register number REGNO onto the stack. The code need not be optimal, since
5010 this macro is used only when profiling. */
5011 /* #define ASM_OUTPUT_REG_PUSH (STREAM, REGNO) */
5012
5013 /* A C expression to output to STREAM some assembler code which will pop hard
5014 register number REGNO off of the stack. The code need not be optimal, since
5015 this macro is used only when profiling. */
5016 /* #define ASM_OUTPUT_REG_POP (STREAM, REGNO) */
5017
5018 \f
5019 /* Output of dispatch tables. */
5020
5021 /* This macro should be provided on machines where the addresses in a dispatch
5022 table are relative to the table's own address.
5023
5024 The definition should be a C statement to output to the stdio stream STREAM
5025 an assembler pseudo-instruction to generate a difference between two labels.
5026 VALUE and REL are the numbers of two internal labels. The definitions of
5027 these labels are output using `ASM_OUTPUT_INTERNAL_LABEL', and they must be
5028 printed in the same way here. For example,
5029
5030 fprintf (STREAM, "\t.word L%d-L%d\n", VALUE, REL) */
5031
5032 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
5033 fprintf (STREAM, "\t.word .L%d-.L%d\n", VALUE, REL)
5034
5035 /* This macro should be provided on machines where the addresses in a dispatch
5036 table are absolute.
5037
5038 The definition should be a C statement to output to the stdio stream STREAM
5039 an assembler pseudo-instruction to generate a reference to a label. VALUE
5040 is the number of an internal label whose definition is output using
5041 `ASM_OUTPUT_INTERNAL_LABEL'. For example,
5042
5043 fprintf (STREAM, "\t.word L%d\n", VALUE) */
5044
5045 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
5046 fprintf (STREAM, "\t.word .L%d\n", VALUE)
5047
5048 /* Define this if the label before a jump-table needs to be output specially.
5049 The first three arguments are the same as for `ASM_OUTPUT_INTERNAL_LABEL';
5050 the fourth argument is the jump-table which follows (a `jump_insn'
5051 containing an `addr_vec' or `addr_diff_vec').
5052
5053 This feature is used on system V to output a `swbeg' statement for the
5054 table.
5055
5056 If this macro is not defined, these labels are output with
5057 `ASM_OUTPUT_INTERNAL_LABEL'.
5058
5059 Defined in svr4.h. */
5060 /* #define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) */
5061
5062 /* Define this if something special must be output at the end of a jump-table.
5063 The definition should be a C statement to be executed after the assembler
5064 code for the table is written. It should write the appropriate code to
5065 stdio stream STREAM. The argument TABLE is the jump-table insn, and NUM is
5066 the label-number of the preceding label.
5067
5068 If this macro is not defined, nothing special is output at the end of the
5069 jump-table. */
5070 /* #define ASM_OUTPUT_CASE_END(STREAM, NUM, TABLE) */
5071
5072 \f
5073 /* Assembler Commands for Exception Regions. */
5074
5075 /* A C expression to output text to mark the start of an exception region.
5076
5077 This macro need not be defined on most platforms. */
5078 /* #define ASM_OUTPUT_EH_REGION_BEG() */
5079
5080 /* A C expression to output text to mark the end of an exception region.
5081
5082 This macro need not be defined on most platforms. */
5083 /* #define ASM_OUTPUT_EH_REGION_END() */
5084
5085 /* A C expression to switch to the section in which the main exception table is
5086 to be placed (*note Sections::.). The default is a section named
5087 `.gcc_except_table' on machines that support named sections via
5088 `ASM_OUTPUT_SECTION_NAME', otherwise if `-fpic' or `-fPIC' is in effect, the
5089 `data_section', otherwise the `readonly_data_section'. */
5090 /* #define EXCEPTION_SECTION() */
5091
5092 /* If defined, a C string constant for the assembler operation to switch to the
5093 section for exception handling frame unwind information. If not defined,
5094 GNU CC will provide a default definition if the target supports named
5095 sections. `crtstuff.c' uses this macro to switch to the appropriate
5096 section.
5097
5098 You should define this symbol if your target supports DWARF 2 frame unwind
5099 information and the default definition does not work. */
5100 /* #define EH_FRAME_SECTION_ASM_OP */
5101
5102 /* A C expression that is nonzero if the normal exception table output should
5103 be omitted.
5104
5105 This macro need not be defined on most platforms. */
5106 /* #define OMIT_EH_TABLE() */
5107
5108 /* Alternate runtime support for looking up an exception at runtime and finding
5109 the associated handler, if the default method won't work.
5110
5111 This macro need not be defined on most platforms. */
5112 /* #define EH_TABLE_LOOKUP() */
5113
5114 /* A C expression that decides whether or not the current function needs to
5115 have a function unwinder generated for it. See the file `except.c' for
5116 details on when to define this, and how. */
5117 /* #define DOESNT_NEED_UNWINDER */
5118
5119 /* An rtx used to mask the return address found via RETURN_ADDR_RTX, so that it
5120 does not contain any extraneous set bits in it. */
5121 /* #define MASK_RETURN_ADDR */
5122
5123 /* Define this macro to 0 if your target supports DWARF 2 frame unwind
5124 information, but it does not yet work with exception handling. Otherwise,
5125 if your target supports this information (if it defines
5126 `INCOMING_RETURN_ADDR_RTX' and either `UNALIGNED_INT_ASM_OP' or
5127 `OBJECT_FORMAT_ELF'), GCC will provide a default definition of 1.
5128
5129 If this macro is defined to 1, the DWARF 2 unwinder will be the default
5130 exception handling mechanism; otherwise, setjmp/longjmp will be used by
5131 default.
5132
5133 If this macro is defined to anything, the DWARF 2 unwinder will be used
5134 instead of inline unwinders and __unwind_function in the non-setjmp case. */
5135 /* #define DWARF2_UNWIND_INFO */
5136
5137 \f
5138 /* Assembler Commands for Alignment. */
5139
5140 /* The alignment (log base 2) to put in front of LABEL, which follows
5141 a BARRIER.
5142
5143 This macro need not be defined if you don't want any special alignment to be
5144 done at such a time. Most machine descriptions do not currently define the
5145 macro. */
5146 /* #define LABEL_ALIGN_AFTER_BARRIER(LABEL) */
5147
5148 /* The desired alignment for the location counter at the beginning
5149 of a loop.
5150
5151 This macro need not be defined if you don't want any special alignment to be
5152 done at such a time. Most machine descriptions do not currently define the
5153 macro. */
5154 /* #define LOOP_ALIGN(LABEL) */
5155
5156 /* A C statement to output to the stdio stream STREAM an assembler instruction
5157 to advance the location counter by NBYTES bytes. Those bytes should be zero
5158 when loaded. NBYTES will be a C expression of type `int'.
5159
5160 Defined in svr4.h. */
5161 /* #define ASM_OUTPUT_SKIP(STREAM, NBYTES) \
5162 fprintf (STREAM, "\t.zero\t%u\n", (NBYTES)) */
5163
5164 /* Define this macro if `ASM_OUTPUT_SKIP' should not be used in the text
5165 section because it fails put zeros in the bytes that are skipped. This is
5166 true on many Unix systems, where the pseudo-op to skip bytes produces no-op
5167 instructions rather than zeros when used in the text section. */
5168 /* #define ASM_NO_SKIP_IN_TEXT */
5169
5170 /* A C statement to output to the stdio stream STREAM an assembler command to
5171 advance the location counter to a multiple of 2 to the POWER bytes. POWER
5172 will be a C expression of type `int'. */
5173 #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
5174 fprintf ((STREAM), "\t.p2align %d\n", (POWER))
5175
5176 \f
5177 /* Macros Affecting all Debug Formats. */
5178
5179 /* A C expression that returns the DBX register number for the compiler
5180 register number REGNO. In simple cases, the value of this expression may be
5181 REGNO itself. But sometimes there are some registers that the compiler
5182 knows about and DBX does not, or vice versa. In such cases, some register
5183 may need to have one number in the compiler and another for DBX.
5184
5185 If two registers have consecutive numbers inside GNU CC, and they can be
5186 used as a pair to hold a multiword value, then they *must* have consecutive
5187 numbers after renumbering with `DBX_REGISTER_NUMBER'. Otherwise, debuggers
5188 will be unable to access such a pair, because they expect register pairs to
5189 be consecutive in their own numbering scheme.
5190
5191 If you find yourself defining `DBX_REGISTER_NUMBER' in way that does not
5192 preserve register pairs, then what you must do instead is redefine the
5193 actual register numbering scheme. */
5194 #define DBX_REGISTER_NUMBER(REGNO) \
5195 (GPR_P (REGNO) ? ((REGNO) - GPR_FIRST) \
5196 : ACCUM_P (REGNO) ? ((REGNO) - ACCUM_FIRST + 84) \
5197 : FLAG_P (REGNO) ? 66 /* return psw for all flags */ \
5198 : (REGNO) == ARG_POINTER_REGNUM ? (GPR_SP - GPR_FIRST) \
5199 : (REGNO) == CR_PSW ? (66 + 0) \
5200 : (REGNO) == CR_BPSW ? (66 + 1) \
5201 : (REGNO) == CR_PC ? (66 + 2) \
5202 : (REGNO) == CR_BPC ? (66 + 3) \
5203 : (REGNO) == CR_DPSW ? (66 + 4) \
5204 : (REGNO) == CR_DPC ? (66 + 5) \
5205 : (REGNO) == CR_RPT_C ? (66 + 7) \
5206 : (REGNO) == CR_RPT_S ? (66 + 8) \
5207 : (REGNO) == CR_RPT_E ? (66 + 9) \
5208 : (REGNO) == CR_MOD_S ? (66 + 10) \
5209 : (REGNO) == CR_MOD_E ? (66 + 11) \
5210 : (REGNO) == CR_IBA ? (66 + 14) \
5211 : (REGNO) == CR_EIT_VB ? (66 + 15) \
5212 : (REGNO) == CR_INT_S ? (66 + 16) \
5213 : (REGNO) == CR_INT_M ? (66 + 17) \
5214 : -1)
5215
5216 /* A C expression that returns the integer offset value for an automatic
5217 variable having address X (an RTL expression). The default computation
5218 assumes that X is based on the frame-pointer and gives the offset from the
5219 frame-pointer. This is required for targets that produce debugging output
5220 for DBX or COFF-style debugging output for SDB and allow the frame-pointer
5221 to be eliminated when the `-g' options is used. */
5222 /* #define DEBUGGER_AUTO_OFFSET(X) */
5223
5224 /* A C expression that returns the integer offset value for an argument having
5225 address X (an RTL expression). The nominal offset is OFFSET. */
5226 /* #define DEBUGGER_ARG_OFFSET(OFFSET, X) */
5227
5228 /* A C expression that returns the type of debugging output GNU CC produces
5229 when the user specifies `-g' or `-ggdb'. Define this if you have arranged
5230 for GNU CC to support more than one format of debugging output. Currently,
5231 the allowable values are `DBX_DEBUG', `SDB_DEBUG', `DWARF_DEBUG',
5232 `DWARF2_DEBUG', and `XCOFF_DEBUG'.
5233
5234 The value of this macro only affects the default debugging output; the user
5235 can always get a specific type of output by using `-gstabs', `-gcoff',
5236 `-gdwarf-1', `-gdwarf-2', or `-gxcoff'.
5237
5238 Defined in svr4.h. */
5239
5240 #undef PREFERRED_DEBUGGING_TYPE
5241 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
5242
5243 \f
5244 /* Specific Options for DBX Output. */
5245
5246 /* Define this macro if GNU CC should produce debugging output for DBX in
5247 response to the `-g' option.
5248
5249 Defined in svr4.h. */
5250 /* #define DBX_DEBUGGING_INFO */
5251
5252 /* Define this macro if GNU CC should produce XCOFF format debugging output in
5253 response to the `-g' option. This is a variant of DBX format. */
5254 /* #define XCOFF_DEBUGGING_INFO */
5255
5256 /* Define this macro to control whether GNU CC should by default generate GDB's
5257 extended version of DBX debugging information (assuming DBX-format debugging
5258 information is enabled at all). If you don't define the macro, the default
5259 is 1: always generate the extended information if there is any occasion to. */
5260 /* #define DEFAULT_GDB_EXTENSIONS */
5261
5262 /* Define this macro if all `.stabs' commands should be output while in the
5263 text section. */
5264 /* #define DEBUG_SYMS_TEXT */
5265
5266 /* A C string constant naming the assembler pseudo op to use instead of
5267 `.stabs' to define an ordinary debugging symbol. If you don't define this
5268 macro, `.stabs' is used. This macro applies only to DBX debugging
5269 information format. */
5270 /* #define ASM_STABS_OP */
5271
5272 /* A C string constant naming the assembler pseudo op to use instead of
5273 `.stabd' to define a debugging symbol whose value is the current location.
5274 If you don't define this macro, `.stabd' is used. This macro applies only
5275 to DBX debugging information format. */
5276 /* #define ASM_STABD_OP */
5277
5278 /* A C string constant naming the assembler pseudo op to use instead of
5279 `.stabn' to define a debugging symbol with no name. If you don't define
5280 this macro, `.stabn' is used. This macro applies only to DBX debugging
5281 information format. */
5282 /* #define ASM_STABN_OP */
5283
5284 /* Define this macro if DBX on your system does not support the construct
5285 `xsTAGNAME'. On some systems, this construct is used to describe a forward
5286 reference to a structure named TAGNAME. On other systems, this construct is
5287 not supported at all. */
5288 /* #define DBX_NO_XREFS */
5289
5290 /* A symbol name in DBX-format debugging information is normally continued
5291 (split into two separate `.stabs' directives) when it exceeds a certain
5292 length (by default, 80 characters). On some operating systems, DBX requires
5293 this splitting; on others, splitting must not be done. You can inhibit
5294 splitting by defining this macro with the value zero. You can override the
5295 default splitting-length by defining this macro as an expression for the
5296 length you desire. */
5297 /* #define DBX_CONTIN_LENGTH */
5298
5299 /* Normally continuation is indicated by adding a `\' character to the end of a
5300 `.stabs' string when a continuation follows. To use a different character
5301 instead, define this macro as a character constant for the character you
5302 want to use. Do not define this macro if backslash is correct for your
5303 system. */
5304 /* #define DBX_CONTIN_CHAR */
5305
5306 /* Define this macro if it is necessary to go to the data section before
5307 outputting the `.stabs' pseudo-op for a non-global static variable. */
5308 /* #define DBX_STATIC_STAB_DATA_SECTION */
5309
5310 /* The value to use in the "code" field of the `.stabs' directive for a
5311 typedef. The default is `N_LSYM'. */
5312 /* #define DBX_TYPE_DECL_STABS_CODE */
5313
5314 /* The value to use in the "code" field of the `.stabs' directive for a static
5315 variable located in the text section. DBX format does not provide any
5316 "right" way to do this. The default is `N_FUN'. */
5317 /* #define DBX_STATIC_CONST_VAR_CODE */
5318
5319 /* The value to use in the "code" field of the `.stabs' directive for a
5320 parameter passed in registers. DBX format does not provide any "right" way
5321 to do this. The default is `N_RSYM'. */
5322 /* #define DBX_REGPARM_STABS_CODE */
5323
5324 /* The letter to use in DBX symbol data to identify a symbol as a parameter
5325 passed in registers. DBX format does not customarily provide any way to do
5326 this. The default is `'P''. */
5327 /* #define DBX_REGPARM_STABS_LETTER */
5328
5329 /* The letter to use in DBX symbol data to identify a symbol as a stack
5330 parameter. The default is `'p''. */
5331 /* #define DBX_MEMPARM_STABS_LETTER */
5332
5333 /* Define this macro if the DBX information for a function and its arguments
5334 should precede the assembler code for the function. Normally, in DBX
5335 format, the debugging information entirely follows the assembler code.
5336
5337 Defined in svr4.h. */
5338 /* #define DBX_FUNCTION_FIRST */
5339
5340 /* Define this macro if the `N_LBRAC' symbol for a block should precede the
5341 debugging information for variables and functions defined in that block.
5342 Normally, in DBX format, the `N_LBRAC' symbol comes first. */
5343 /* #define DBX_LBRAC_FIRST */
5344
5345 /* Define this macro if the value of a symbol describing the scope of a block
5346 (`N_LBRAC' or `N_RBRAC') should be relative to the start of the enclosing
5347 function. Normally, GNU C uses an absolute address.
5348
5349 Defined in svr4.h. */
5350 /* #define DBX_BLOCKS_FUNCTION_RELATIVE */
5351
5352 /* Define this macro if GNU C should generate `N_BINCL' and `N_EINCL'
5353 stabs for included header files, as on Sun systems. This macro
5354 also directs GNU C to output a type number as a pair of a file
5355 number and a type number within the file. Normally, GNU C does not
5356 generate `N_BINCL' or `N_EINCL' stabs, and it outputs a single
5357 number for a type number. */
5358 /* #define DBX_USE_BINCL */
5359
5360 \f
5361 /* Open ended Hooks for DBX Output. */
5362
5363 /* Define this macro to say how to output to STREAM the debugging information
5364 for the start of a scope level for variable names. The argument NAME is the
5365 name of an assembler symbol (for use with `assemble_name') whose value is
5366 the address where the scope begins. */
5367 /* #define DBX_OUTPUT_LBRAC(STREAM, NAME) */
5368
5369 /* Like `DBX_OUTPUT_LBRAC', but for the end of a scope level. */
5370 /* #define DBX_OUTPUT_RBRAC(STREAM, NAME) */
5371
5372 /* Define this macro if the target machine requires special handling to output
5373 an enumeration type. The definition should be a C statement (sans
5374 semicolon) to output the appropriate information to STREAM for the type
5375 TYPE. */
5376 /* #define DBX_OUTPUT_ENUM(STREAM, TYPE) */
5377
5378 /* Define this macro if the target machine requires special output at the end
5379 of the debugging information for a function. The definition should be a C
5380 statement (sans semicolon) to output the appropriate information to STREAM.
5381 FUNCTION is the `FUNCTION_DECL' node for the function. */
5382 /* #define DBX_OUTPUT_FUNCTION_END(STREAM, FUNCTION) */
5383
5384 /* Define this macro if you need to control the order of output of the standard
5385 data types at the beginning of compilation. The argument SYMS is a `tree'
5386 which is a chain of all the predefined global symbols, including names of
5387 data types.
5388
5389 Normally, DBX output starts with definitions of the types for integers and
5390 characters, followed by all the other predefined types of the particular
5391 language in no particular order.
5392
5393 On some machines, it is necessary to output different particular types
5394 first. To do this, define `DBX_OUTPUT_STANDARD_TYPES' to output those
5395 symbols in the necessary order. Any predefined types that you don't
5396 explicitly output will be output afterward in no particular order.
5397
5398 Be careful not to define this macro so that it works only for C. There are
5399 no global variables to access most of the built-in types, because another
5400 language may have another set of types. The way to output a particular type
5401 is to look through SYMS to see if you can find it. Here is an example:
5402
5403 {
5404 tree decl;
5405 for (decl = syms; decl; decl = TREE_CHAIN (decl))
5406 if (!strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)),
5407 "long int"))
5408 dbxout_symbol (decl);
5409 ...
5410 }
5411
5412 This does nothing if the expected type does not exist.
5413
5414 See the function `init_decl_processing' in `c-decl.c' to find the names to
5415 use for all the built-in C types. */
5416 /* #define DBX_OUTPUT_STANDARD_TYPES(SYMS) */
5417
5418 /* Some stabs encapsulation formats (in particular ECOFF), cannot
5419 handle the `.stabs "",N_FUN,,0,0,Lscope-function-1' gdb dbx
5420 extention construct. On those machines, define this macro to turn
5421 this feature off without disturbing the rest of the gdb extensions. */
5422 /* #define NO_DBX_FUNCTION_END */
5423
5424 \f
5425 /* File names in DBX format. */
5426
5427 /* Define this if DBX wants to have the current directory recorded in each
5428 object file.
5429
5430 Note that the working directory is always recorded if GDB extensions are
5431 enabled. */
5432 /* #define DBX_WORKING_DIRECTORY */
5433
5434 /* A C statement to output DBX debugging information to the stdio stream STREAM
5435 which indicates that file NAME is the main source file--the file specified
5436 as the input file for compilation. This macro is called only once, at the
5437 beginning of compilation.
5438
5439 This macro need not be defined if the standard form of output for DBX
5440 debugging information is appropriate.
5441
5442 Defined in svr4.h. */
5443 /* #define DBX_OUTPUT_MAIN_SOURCE_FILENAME(STREAM, NAME) */
5444
5445 /* A C statement to output DBX debugging information to the stdio stream STREAM
5446 which indicates that the current directory during compilation is named NAME.
5447
5448 This macro need not be defined if the standard form of output for DBX
5449 debugging information is appropriate. */
5450 /* #define DBX_OUTPUT_MAIN_SOURCE_DIRECTORY(STREAM, NAME) */
5451
5452 /* A C statement to output DBX debugging information at the end of compilation
5453 of the main source file NAME.
5454
5455 If you don't define this macro, nothing special is output at the end of
5456 compilation, which is correct for most machines. */
5457 /* #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(STREAM, NAME) */
5458
5459 /* A C statement to output DBX debugging information to the stdio stream STREAM
5460 which indicates that file NAME is the current source file. This output is
5461 generated each time input shifts to a different source file as a result of
5462 `#include', the end of an included file, or a `#line' command.
5463
5464 This macro need not be defined if the standard form of output for DBX
5465 debugging information is appropriate. */
5466 /* #define DBX_OUTPUT_SOURCE_FILENAME(STREAM, NAME) */
5467
5468 \f
5469 /* Macros for SDB and Dwarf Output. */
5470
5471 /* Define this macro if GNU CC should produce COFF-style debugging output for
5472 SDB in response to the `-g' option. */
5473 /* #define SDB_DEBUGGING_INFO */
5474
5475 /* Define this macro if GNU CC should produce dwarf format debugging output in
5476 response to the `-g' option.
5477
5478 Defined in svr4.h. */
5479 /* #define DWARF_DEBUGGING_INFO */
5480
5481 /* Define this macro if GNU CC should produce dwarf version 2 format debugging
5482 output in response to the `-g' option.
5483
5484 To support optional call frame debugging information, you must also define
5485 `INCOMING_RETURN_ADDR_RTX' and either set `RTX_FRAME_RELATED_P' on the
5486 prologue insns if you use RTL for the prologue, or call `dwarf2out_def_cfa'
5487 and `dwarf2out_reg_save' as appropriate from `FUNCTION_PROLOGUE' if you
5488 don't.
5489
5490 Defined in svr4.h. */
5491 /* #define DWARF2_DEBUGGING_INFO */
5492
5493 /* Define these macros to override the assembler syntax for the special SDB
5494 assembler directives. See `sdbout.c' for a list of these macros and their
5495 arguments. If the standard syntax is used, you need not define them
5496 yourself. */
5497 /* #define PUT_SDB_... */
5498
5499 /* Some assemblers do not support a semicolon as a delimiter, even between SDB
5500 assembler directives. In that case, define this macro to be the delimiter
5501 to use (usually `\n'). It is not necessary to define a new set of
5502 `PUT_SDB_OP' macros if this is the only change required. */
5503 /* #define SDB_DELIM */
5504
5505 /* Define this macro to override the usual method of constructing a dummy name
5506 for anonymous structure and union types. See `sdbout.c' for more
5507 information. */
5508 /* #define SDB_GENERATE_FAKE */
5509
5510 /* Define this macro to allow references to unknown structure, union, or
5511 enumeration tags to be emitted. Standard COFF does not allow handling of
5512 unknown references, MIPS ECOFF has support for it. */
5513 /* #define SDB_ALLOW_UNKNOWN_REFERENCES */
5514
5515 /* Define this macro to allow references to structure, union, or enumeration
5516 tags that have not yet been seen to be handled. Some assemblers choke if
5517 forward tags are used, while some require it. */
5518 /* #define SDB_ALLOW_FORWARD_REFERENCES */
5519
5520 \f
5521 /* Cross Compilation and Floating Point. */
5522
5523 /* While all modern machines use 2's complement representation for integers,
5524 there are a variety of representations for floating point numbers. This
5525 means that in a cross-compiler the representation of floating point numbers
5526 in the compiled program may be different from that used in the machine doing
5527 the compilation.
5528
5529 Because different representation systems may offer different amounts of
5530 range and precision, the cross compiler cannot safely use the host machine's
5531 floating point arithmetic. Therefore, floating point constants must be
5532 represented in the target machine's format. This means that the cross
5533 compiler cannot use `atof' to parse a floating point constant; it must have
5534 its own special routine to use instead. Also, constant folding must emulate
5535 the target machine's arithmetic (or must not be done at all).
5536
5537 The macros in the following table should be defined only if you are cross
5538 compiling between different floating point formats.
5539
5540 Otherwise, don't define them. Then default definitions will be set up which
5541 use `double' as the data type, `==' to test for equality, etc.
5542
5543 You don't need to worry about how many times you use an operand of any of
5544 these macros. The compiler never uses operands which have side effects. */
5545
5546 /* A macro for the C data type to be used to hold a floating point value in the
5547 target machine's format. Typically this would be a `struct' containing an
5548 array of `int'. */
5549 /* #define REAL_VALUE_TYPE */
5550
5551 /* A macro for a C expression which compares for equality the two values, X and
5552 Y, both of type `REAL_VALUE_TYPE'. */
5553 /* #define REAL_VALUES_EQUAL(X, Y) */
5554
5555 /* A macro for a C expression which tests whether X is less than Y, both values
5556 being of type `REAL_VALUE_TYPE' and interpreted as floating point numbers in
5557 the target machine's representation. */
5558 /* #define REAL_VALUES_LESS(X, Y) */
5559
5560 /* A macro for a C expression which performs the standard library function
5561 `ldexp', but using the target machine's floating point representation. Both
5562 X and the value of the expression have type `REAL_VALUE_TYPE'. The second
5563 argument, SCALE, is an integer. */
5564 /* #define REAL_VALUE_LDEXP(X, SCALE) */
5565
5566 /* A macro whose definition is a C expression to convert the target-machine
5567 floating point value X to a signed integer. X has type `REAL_VALUE_TYPE'. */
5568 /* #define REAL_VALUE_FIX(X) */
5569
5570 /* A macro whose definition is a C expression to convert the target-machine
5571 floating point value X to an unsigned integer. X has type
5572 `REAL_VALUE_TYPE'. */
5573 /* #define REAL_VALUE_UNSIGNED_FIX(X) */
5574
5575 /* A macro whose definition is a C expression to round the target-machine
5576 floating point value X towards zero to an integer value (but still as a
5577 floating point number). X has type `REAL_VALUE_TYPE', and so does the
5578 value. */
5579 /* #define REAL_VALUE_RNDZINT(X) */
5580
5581 /* A macro whose definition is a C expression to round the target-machine
5582 floating point value X towards zero to an unsigned integer value (but still
5583 represented as a floating point number). X has type `REAL_VALUE_TYPE', and
5584 so does the value. */
5585 /* #define REAL_VALUE_UNSIGNED_RNDZINT(X) */
5586
5587 /* A macro for a C expression which converts STRING, an expression of type
5588 `char *', into a floating point number in the target machine's
5589 representation for mode MODE. The value has type `REAL_VALUE_TYPE'. */
5590 /* #define REAL_VALUE_ATOF(STRING, MODE) */
5591
5592 /* Define this macro if infinity is a possible floating point value, and
5593 therefore division by 0 is legitimate. */
5594 /* #define REAL_INFINITY */
5595
5596 /* A macro for a C expression which determines whether X, a floating point
5597 value, is infinity. The value has type `int'. By default, this is defined
5598 to call `isinf'. */
5599 /* #define REAL_VALUE_ISINF(X) */
5600
5601 /* A macro for a C expression which determines whether X, a floating point
5602 value, is a "nan" (not-a-number). The value has type `int'. By default,
5603 this is defined to call `isnan'. */
5604 /* #define REAL_VALUE_ISNAN(X) */
5605
5606 /* Define the following additional macros if you want to make floating point
5607 constant folding work while cross compiling. If you don't define them,
5608 cross compilation is still possible, but constant folding will not happen
5609 for floating point values. */
5610
5611 /* A macro for a C statement which calculates an arithmetic operation of the
5612 two floating point values X and Y, both of type `REAL_VALUE_TYPE' in the
5613 target machine's representation, to produce a result of the same type and
5614 representation which is stored in OUTPUT (which will be a variable).
5615
5616 The operation to be performed is specified by CODE, a tree code which will
5617 always be one of the following: `PLUS_EXPR', `MINUS_EXPR', `MULT_EXPR',
5618 `RDIV_EXPR', `MAX_EXPR', `MIN_EXPR'.
5619
5620 The expansion of this macro is responsible for checking for overflow. If
5621 overflow happens, the macro expansion should execute the statement `return
5622 0;', which indicates the inability to perform the arithmetic operation
5623 requested. */
5624 /* #define REAL_ARITHMETIC(OUTPUT, CODE, X, Y) */
5625
5626 /* The real.h file actually defines REAL_ARITHMETIC appropriately if it was
5627 defined at all before entering into the code, by using #undef first. */
5628 #define REAL_ARITHMETIC
5629
5630 /* A macro for a C expression which returns the negative of the floating point
5631 value X. Both X and the value of the expression have type `REAL_VALUE_TYPE'
5632 and are in the target machine's floating point representation.
5633
5634 There is no way for this macro to report overflow, since overflow can't
5635 happen in the negation operation. */
5636 /* #define REAL_VALUE_NEGATE(X) */
5637
5638 /* A macro for a C expression which converts the floating point value X to mode
5639 MODE.
5640
5641 Both X and the value of the expression are in the target machine's floating
5642 point representation and have type `REAL_VALUE_TYPE'. However, the value
5643 should have an appropriate bit pattern to be output properly as a floating
5644 constant whose precision accords with mode MODE.
5645
5646 There is no way for this macro to report overflow. */
5647 /* #define REAL_VALUE_TRUNCATE(MODE, X) */
5648
5649 /* A macro for a C expression which converts a floating point value X into a
5650 double-precision integer which is then stored into LOW and HIGH, two
5651 variables of type INT. */
5652 /* #define REAL_VALUE_TO_INT(LOW, HIGH, X) */
5653
5654 /* A macro for a C expression which converts a double-precision integer found
5655 in LOW and HIGH, two variables of type INT, into a floating point value
5656 which is then stored into X. */
5657 /* #define REAL_VALUE_FROM_INT(X, LOW, HIGH) */
5658
5659 \f
5660 /* Miscellaneous Parameters. */
5661
5662 /* Define this if you have defined special-purpose predicates in the file
5663 `MACHINE.c'. This macro is called within an initializer of an array of
5664 structures. The first field in the structure is the name of a predicate and
5665 the second field is an array of rtl codes. For each predicate, list all rtl
5666 codes that can be in expressions matched by the predicate. The list should
5667 have a trailing comma. Here is an example of two entries in the list for a
5668 typical RISC machine:
5669
5670 #define PREDICATE_CODES \
5671 {"gen_reg_rtx_operand", {SUBREG, REG}}, \
5672 {"reg_or_short_cint_operand", {SUBREG, REG, CONST_INT}},
5673
5674 Defining this macro does not affect the generated code (however, incorrect
5675 definitions that omit an rtl code that may be matched by the predicate can
5676 cause the compiler to malfunction). Instead, it allows the table built by
5677 `genrecog' to be more compact and efficient, thus speeding up the compiler.
5678 The most important predicates to include in the list specified by this macro
5679 are thoses used in the most insn patterns. */
5680
5681 #define PREDICATE_CODES \
5682 { "short_memory_operand", { MEM }}, \
5683 { "long_memory_operand", { MEM }}, \
5684 { "d30v_memory_operand", { MEM }}, \
5685 { "single_reg_memory_operand", { MEM }}, \
5686 { "const_addr_memory_operand", { MEM }}, \
5687 { "call_operand", { MEM }}, \
5688 { "gpr_operand", { REG, SUBREG }}, \
5689 { "accum_operand", { REG, SUBREG }}, \
5690 { "gpr_or_accum_operand", { REG, SUBREG }}, \
5691 { "cr_operand", { REG, SUBREG }}, \
5692 { "repeat_operand", { REG, SUBREG }}, \
5693 { "flag_operand", { REG, SUBREG }}, \
5694 { "br_flag_operand", { REG, SUBREG }}, \
5695 { "br_flag_or_constant_operand", { REG, SUBREG, CONST_INT }}, \
5696 { "gpr_or_br_flag_operand", { REG, SUBREG }}, \
5697 { "f0_operand", { REG, SUBREG }}, \
5698 { "f1_operand", { REG, SUBREG }}, \
5699 { "carry_operand", { REG, SUBREG }}, \
5700 { "reg_or_0_operand", { REG, SUBREG, CONST_INT, \
5701 CONST_DOUBLE }}, \
5702 { "gpr_or_signed6_operand", { REG, SUBREG, CONST_INT }}, \
5703 { "gpr_or_unsigned5_operand", { REG, SUBREG, CONST_INT }}, \
5704 { "gpr_or_unsigned6_operand", { REG, SUBREG, CONST_INT }}, \
5705 { "gpr_or_constant_operand", { REG, SUBREG, CONST_INT, \
5706 CONST, SYMBOL_REF, \
5707 LABEL_REF }}, \
5708 { "gpr_or_dbl_const_operand", { REG, SUBREG, CONST_INT, \
5709 CONST, SYMBOL_REF, \
5710 LABEL_REF, CONST_DOUBLE }}, \
5711 { "gpr_or_memory_operand", { REG, SUBREG, MEM }}, \
5712 { "move_input_operand", { REG, SUBREG, MEM, CONST_INT, \
5713 CONST, SYMBOL_REF, \
5714 LABEL_REF, CONST_DOUBLE }}, \
5715 { "move_output_operand", { REG, SUBREG, MEM }}, \
5716 { "signed6_operand", { CONST_INT }}, \
5717 { "unsigned5_operand", { CONST_INT }}, \
5718 { "unsigned6_operand", { CONST_INT }}, \
5719 { "bitset_operand", { CONST_INT }}, \
5720 { "condexec_test_operator", { EQ, NE }}, \
5721 { "condexec_branch_operator", { EQ, NE }}, \
5722 { "condexec_unary_operator", { ABS, NEG, NOT, ZERO_EXTEND }}, \
5723 { "condexec_addsub_operator", { PLUS, MINUS }}, \
5724 { "condexec_binary_operator", { MULT, AND, IOR, XOR, \
5725 ASHIFT, ASHIFTRT, LSHIFTRT, \
5726 ROTATE, ROTATERT }}, \
5727 { "condexec_shiftl_operator", { ASHIFT, ROTATE }}, \
5728 { "condexec_extend_operator", { SIGN_EXTEND, ZERO_EXTEND }}, \
5729 { "branch_zero_operator", { EQ, NE }}, \
5730 { "cond_move_dest_operand", { REG, SUBREG, MEM }}, \
5731 { "cond_move_operand", { REG, SUBREG, CONST_INT, \
5732 CONST, SYMBOL_REF, \
5733 LABEL_REF, MEM }}, \
5734 { "cond_exec_operand", { REG, SUBREG, CONST_INT, \
5735 CONST, SYMBOL_REF, \
5736 LABEL_REF, MEM }}, \
5737 { "srelational_si_operator", { EQ, NE, LT, LE, GT, GE }}, \
5738 { "urelational_si_operator", { LTU, LEU, GTU, GEU }}, \
5739 { "relational_di_operator", { EQ, NE, LT, LE, GT, GE, \
5740 LTU, LEU, GTU, GEU }},
5741
5742 /* An alias for a machine mode name. This is the machine mode that elements of
5743 a jump-table should have. */
5744 #define CASE_VECTOR_MODE SImode
5745
5746 /* Define as C expression which evaluates to nonzero if the tablejump
5747 instruction expects the table to contain offsets from the address of the
5748 table.
5749 Do not define this if the table should contain absolute addresses. */
5750 /* #define CASE_VECTOR_PC_RELATIVE 1 */
5751
5752 /* Define this if control falls through a `case' insn when the index value is
5753 out of range. This means the specified default-label is actually ignored by
5754 the `case' insn proper. */
5755 /* #define CASE_DROPS_THROUGH */
5756
5757 /* Define this to be the smallest number of different values for which it is
5758 best to use a jump-table instead of a tree of conditional branches. The
5759 default is four for machines with a `casesi' instruction and five otherwise.
5760 This is best for most machines. */
5761 /* #define CASE_VALUES_THRESHOLD */
5762
5763 /* Define this macro if operations between registers with integral mode smaller
5764 than a word are always performed on the entire register. Most RISC machines
5765 have this property and most CISC machines do not. */
5766 #define WORD_REGISTER_OPERATIONS 1
5767
5768 /* Define this macro to be a C expression indicating when insns that read
5769 memory in MODE, an integral mode narrower than a word, set the bits outside
5770 of MODE to be either the sign-extension or the zero-extension of the data
5771 read. Return `SIGN_EXTEND' for values of MODE for which the insn
5772 sign-extends, `ZERO_EXTEND' for which it zero-extends, and `NIL' for other
5773 modes.
5774
5775 This macro is not called with MODE non-integral or with a width greater than
5776 or equal to `BITS_PER_WORD', so you may return any value in this case. Do
5777 not define this macro if it would always return `NIL'. On machines where
5778 this macro is defined, you will normally define it as the constant
5779 `SIGN_EXTEND' or `ZERO_EXTEND'. */
5780
5781 #define LOAD_EXTEND_OP(MODE) SIGN_EXTEND
5782
5783 /* Define if loading short immediate values into registers sign extends. */
5784 #define SHORT_IMMEDIATES_SIGN_EXTEND
5785
5786 /* An alias for a tree code that should be used by default for conversion of
5787 floating point values to fixed point. Normally, `FIX_ROUND_EXPR' is used. */
5788 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
5789
5790 /* Define this macro if the same instructions that convert a floating point
5791 number to a signed fixed point number also convert validly to an unsigned
5792 one. */
5793 /* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC */
5794
5795 /* An alias for a tree code that is the easiest kind of division to compile
5796 code for in the general case. It may be `TRUNC_DIV_EXPR', `FLOOR_DIV_EXPR',
5797 `CEIL_DIV_EXPR' or `ROUND_DIV_EXPR'. These four division operators differ
5798 in how they round the result to an integer. `EASY_DIV_EXPR' is used when it
5799 is permissible to use any of those kinds of division and the choice should
5800 be made on the basis of efficiency. */
5801 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
5802
5803 /* The maximum number of bytes that a single instruction can move quickly from
5804 memory to memory. */
5805 #define MOVE_MAX 8
5806
5807 /* The maximum number of bytes that a single instruction can move quickly from
5808 memory to memory. If this is undefined, the default is `MOVE_MAX'.
5809 Otherwise, it is the constant value that is the largest value that
5810 `MOVE_MAX' can have at run-time. */
5811 /* #define MAX_MOVE_MAX */
5812
5813 /* A C expression that is nonzero if on this machine the number of bits
5814 actually used for the count of a shift operation is equal to the number of
5815 bits needed to represent the size of the object being shifted. When this
5816 macro is non-zero, the compiler will assume that it is safe to omit a
5817 sign-extend, zero-extend, and certain bitwise `and' instructions that
5818 truncates the count of a shift operation. On machines that have
5819 instructions that act on bitfields at variable positions, which may include
5820 `bit test' instructions, a nonzero `SHIFT_COUNT_TRUNCATED' also enables
5821 deletion of truncations of the values that serve as arguments to bitfield
5822 instructions.
5823
5824 If both types of instructions truncate the count (for shifts) and position
5825 (for bitfield operations), or if no variable-position bitfield instructions
5826 exist, you should define this macro.
5827
5828 However, on some machines, such as the 80386 and the 680x0, truncation only
5829 applies to shift operations and not the (real or pretended) bitfield
5830 operations. Define `SHIFT_COUNT_TRUNCATED' to be zero on such machines.
5831 Instead, add patterns to the `md' file that include the implied truncation
5832 of the shift instructions.
5833
5834 You need not define this macro if it would always have the value of zero. */
5835 /* #define SHIFT_COUNT_TRUNCATED */
5836
5837 /* A C expression which is nonzero if on this machine it is safe to "convert"
5838 an integer of INPREC bits to one of OUTPREC bits (where OUTPREC is smaller
5839 than INPREC) by merely operating on it as if it had only OUTPREC bits.
5840
5841 On many machines, this expression can be 1.
5842
5843 When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for modes for
5844 which `MODES_TIEABLE_P' is 0, suboptimal code can result. If this is the
5845 case, making `TRULY_NOOP_TRUNCATION' return 0 in such cases may improve
5846 things. */
5847 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
5848
5849 /* A C expression describing the value returned by a comparison operator with
5850 an integral mode and stored by a store-flag instruction (`sCOND') when the
5851 condition is true. This description must apply to *all* the `sCOND'
5852 patterns and all the comparison operators whose results have a `MODE_INT'
5853 mode.
5854
5855 A value of 1 or -1 means that the instruction implementing the comparison
5856 operator returns exactly 1 or -1 when the comparison is true and 0 when the
5857 comparison is false. Otherwise, the value indicates which bits of the
5858 result are guaranteed to be 1 when the comparison is true. This value is
5859 interpreted in the mode of the comparison operation, which is given by the
5860 mode of the first operand in the `sCOND' pattern. Either the low bit or the
5861 sign bit of `STORE_FLAG_VALUE' be on. Presently, only those bits are used
5862 by the compiler.
5863
5864 If `STORE_FLAG_VALUE' is neither 1 or -1, the compiler will generate code
5865 that depends only on the specified bits. It can also replace comparison
5866 operators with equivalent operations if they cause the required bits to be
5867 set, even if the remaining bits are undefined. For example, on a machine
5868 whose comparison operators return an `SImode' value and where
5869 `STORE_FLAG_VALUE' is defined as `0x80000000', saying that just the sign bit
5870 is relevant, the expression
5871
5872 (ne:SI (and:SI X (const_int POWER-OF-2)) (const_int 0))
5873
5874 can be converted to
5875
5876 (ashift:SI X (const_int N))
5877
5878 where N is the appropriate shift count to move the bit being tested into the
5879 sign bit.
5880
5881 There is no way to describe a machine that always sets the low-order bit for
5882 a true value, but does not guarantee the value of any other bits, but we do
5883 not know of any machine that has such an instruction. If you are trying to
5884 port GNU CC to such a machine, include an instruction to perform a
5885 logical-and of the result with 1 in the pattern for the comparison operators
5886 and let us know (*note How to Report Bugs: Bug Reporting.).
5887
5888 Often, a machine will have multiple instructions that obtain a value from a
5889 comparison (or the condition codes). Here are rules to guide the choice of
5890 value for `STORE_FLAG_VALUE', and hence the instructions to be used:
5891
5892 * Use the shortest sequence that yields a valid definition for
5893 `STORE_FLAG_VALUE'. It is more efficient for the compiler to
5894 "normalize" the value (convert it to, e.g., 1 or 0) than for
5895 the comparison operators to do so because there may be
5896 opportunities to combine the normalization with other
5897 operations.
5898
5899 * For equal-length sequences, use a value of 1 or -1, with -1
5900 being slightly preferred on machines with expensive jumps and
5901 1 preferred on other machines.
5902
5903 * As a second choice, choose a value of `0x80000001' if
5904 instructions exist that set both the sign and low-order bits
5905 but do not define the others.
5906
5907 * Otherwise, use a value of `0x80000000'.
5908
5909 Many machines can produce both the value chosen for `STORE_FLAG_VALUE' and
5910 its negation in the same number of instructions. On those machines, you
5911 should also define a pattern for those cases, e.g., one matching
5912
5913 (set A (neg:M (ne:M B C)))
5914
5915 Some machines can also perform `and' or `plus' operations on condition code
5916 values with less instructions than the corresponding `sCOND' insn followed
5917 by `and' or `plus'. On those machines, define the appropriate patterns.
5918 Use the names `incscc' and `decscc', respectively, for the the patterns
5919 which perform `plus' or `minus' operations on condition code values. See
5920 `rs6000.md' for some examples. The GNU Superoptizer can be used to find
5921 such instruction sequences on other machines.
5922
5923 You need not define `STORE_FLAG_VALUE' if the machine has no store-flag
5924 instructions. */
5925 /* #define STORE_FLAG_VALUE */
5926
5927 /* A C expression that gives a non-zero floating point value that is returned
5928 when comparison operators with floating-point results are true. Define this
5929 macro on machine that have comparison operations that return floating-point
5930 values. If there are no such operations, do not define this macro. */
5931 /* #define FLOAT_STORE_FLAG_VALUE */
5932
5933 /* An alias for the machine mode for pointers. On most machines, define this
5934 to be the integer mode corresponding to the width of a hardware pointer;
5935 `SImode' on 32-bit machine or `DImode' on 64-bit machines. On some machines
5936 you must define this to be one of the partial integer modes, such as
5937 `PSImode'.
5938
5939 The width of `Pmode' must be at least as large as the value of
5940 `POINTER_SIZE'. If it is not equal, you must define the macro
5941 `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to `Pmode'. */
5942 #define Pmode SImode
5943
5944 /* An alias for the machine mode used for memory references to functions being
5945 called, in `call' RTL expressions. On most machines this should be
5946 `QImode'. */
5947 #define FUNCTION_MODE QImode
5948
5949 /* A C expression for the maximum number of instructions above which the
5950 function DECL should not be inlined. DECL is a `FUNCTION_DECL' node.
5951
5952 The default definition of this macro is 64 plus 8 times the number of
5953 arguments that the function accepts. Some people think a larger threshold
5954 should be used on RISC machines. */
5955 /* #define INTEGRATE_THRESHOLD(DECL) */
5956
5957 /* Define this if the preprocessor should ignore `#sccs' directives and print
5958 no error message.
5959
5960 Defined in svr4.h. */
5961 /* #define SCCS_DIRECTIVE */
5962
5963 /* Define this macro if the system header files support C++ as well as C. This
5964 macro inhibits the usual method of using system header files in C++, which
5965 is to pretend that the file's contents are enclosed in `extern "C" {...}'. */
5966 /* #define NO_IMPLICIT_EXTERN_C */
5967
5968 /* Define this macro if you want to implement any pragmas. If defined, it
5969 should be a C statement to be executed when `#pragma' is seen. The argument
5970 STREAM is the stdio input stream from which the source text can be read.
5971
5972 It is generally a bad idea to implement new uses of `#pragma'. The only
5973 reason to define this macro is for compatibility with other compilers that
5974 do support `#pragma' for the sake of any user programs which already use it. */
5975 /* #define HANDLE_PRAGMA(STREAM) */
5976
5977 /* Define this macro to handle System V style pragmas (particularly #pack).
5978
5979 Defined in svr4.h. */
5980 #define HANDLE_SYSV_PRAGMA
5981
5982 /* Define this macro if you want to handle #pragma weak (HANDLE_SYSV_PRAGMA
5983 must also be defined). */
5984 /* #define HANDLE_WEAK_PRAGMA */
5985
5986 /* If defined, a C expression whose value is nonzero if IDENTIFIER with
5987 arguments ARGS is a valid machine specific attribute for DECL. The
5988 attributes in ATTRIBUTES have previously been assigned to DECL. */
5989 /* #define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) */
5990
5991 /* If defined, a C expression whose value is nonzero if IDENTIFIER with
5992 arguments ARGS is a valid machine specific attribute for TYPE. The
5993 attributes in ATTRIBUTES have previously been assigned to TYPE. */
5994 /* #define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) */
5995
5996 /* If defined, a C expression whose value is zero if the attributes on TYPE1
5997 and TYPE2 are incompatible, one if they are compatible, and two if they are
5998 nearly compatible (which causes a warning to be generated). */
5999 /* #define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) */
6000
6001 /* If defined, a C statement that assigns default attributes to newly defined
6002 TYPE. */
6003 /* #define SET_DEFAULT_TYPE_ATTRIBUTES(TYPE) */
6004
6005 /* Define this macro to control use of the character `$' in identifier names.
6006 The value should be 0, 1, or 2. 0 means `$' is not allowed by default; 1
6007 means it is allowed by default if `-traditional' is used; 2 means it is
6008 allowed by default provided `-ansi' is not used. 1 is the default; there is
6009 no need to define this macro in that case. */
6010 /* #define DOLLARS_IN_IDENTIFIERS */
6011
6012 /* Define this macro if the assembler does not accept the character `$' in
6013 label names. By default constructors and destructors in G++ have `$' in the
6014 identifiers. If this macro is defined, `.' is used instead.
6015
6016 Defined in svr4.h. */
6017 /* #define NO_DOLLAR_IN_LABEL */
6018
6019 /* Define this macro if the assembler does not accept the character `.' in
6020 label names. By default constructors and destructors in G++ have names that
6021 use `.'. If this macro is defined, these names are rewritten to avoid `.'. */
6022 /* #define NO_DOT_IN_LABEL */
6023
6024 /* Define this macro if the target system expects every program's `main'
6025 function to return a standard "success" value by default (if no other value
6026 is explicitly returned).
6027
6028 The definition should be a C statement (sans semicolon) to generate the
6029 appropriate rtl instructions. It is used only when compiling the end of
6030 `main'. */
6031 /* #define DEFAULT_MAIN_RETURN */
6032
6033 /* Define this if the target system supports the function `atexit' from the
6034 ANSI C standard. If this is not defined, and `INIT_SECTION_ASM_OP' is not
6035 defined, a default `exit' function will be provided to support C++.
6036
6037 Defined by svr4.h */
6038 /* #define HAVE_ATEXIT */
6039
6040 /* Define this if your `exit' function needs to do something besides calling an
6041 external function `_cleanup' before terminating with `_exit'. The
6042 `EXIT_BODY' macro is only needed if netiher `HAVE_ATEXIT' nor
6043 `INIT_SECTION_ASM_OP' are defined. */
6044 /* #define EXIT_BODY */
6045
6046 /* Define this macro as a C expression that is nonzero if it is safe for the
6047 delay slot scheduler to place instructions in the delay slot of INSN, even
6048 if they appear to use a resource set or clobbered in INSN. INSN is always a
6049 `jump_insn' or an `insn'; GNU CC knows that every `call_insn' has this
6050 behavior. On machines where some `insn' or `jump_insn' is really a function
6051 call and hence has this behavior, you should define this macro.
6052
6053 You need not define this macro if it would always return zero. */
6054 /* #define INSN_SETS_ARE_DELAYED(INSN) */
6055
6056 /* Define this macro as a C expression that is nonzero if it is safe for the
6057 delay slot scheduler to place instructions in the delay slot of INSN, even
6058 if they appear to set or clobber a resource referenced in INSN. INSN is
6059 always a `jump_insn' or an `insn'. On machines where some `insn' or
6060 `jump_insn' is really a function call and its operands are registers whose
6061 use is actually in the subroutine it calls, you should define this macro.
6062 Doing so allows the delay slot scheduler to move instructions which copy
6063 arguments into the argument registers into the delay slot of INSN.
6064
6065 You need not define this macro if it would always return zero. */
6066 /* #define INSN_REFERENCES_ARE_DELAYED(INSN) */
6067
6068 /* In rare cases, correct code generation requires extra machine dependent
6069 processing between the second jump optimization pass and delayed branch
6070 scheduling. On those machines, define this macro as a C statement to act on
6071 the code starting at INSN. */
6072 #define MACHINE_DEPENDENT_REORG(INSN) d30v_machine_dependent_reorg (INSN)
6073
6074 /* Define this macro if in some cases global symbols from one translation unit
6075 may not be bound to undefined symbols in another translation unit without
6076 user intervention. For instance, under Microsoft Windows symbols must be
6077 explicitly imported from shared libraries (DLLs). */
6078 /* #define MULTIPLE_SYMBOL_SPACES */
6079
6080 /* A C expression for the maximum number of instructions to execute via
6081 conditional execution instructions instead of a branch. A value of
6082 BRANCH_COST+1 is the default if the machine does not use cc0, and 1 if it
6083 does use cc0. */
6084 #define MAX_CONDITIONAL_EXECUTE d30v_cond_exec
6085
6086 #define D30V_DEFAULT_MAX_CONDITIONAL_EXECUTE 4
6087
6088 /* Values of the -mcond-exec=n string. */
6089 extern int d30v_cond_exec;
6090 extern const char *d30v_cond_exec_string;
6091
6092 /* Indicate how many instructions can be issued at the same time. */
6093 #define ISSUE_RATE 2