Import final gcc2 snapshot (990109)
[official-gcc.git] / gcc / config / rs6000 / rs6000.h
blob5bf7caa717f4f133f740aa6a7ef1f02127193eec
1 /* Definitions of target machine for GNU compiler, for IBM RS/6000.
2 Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
3 Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
5 This file is part of GNU CC.
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.
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.
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. */
23 /* Note that some other tm.h files include this one and then override
24 many of the definitions that relate to assembler syntax. */
27 /* Names to predefine in the preprocessor for this target machine. */
29 #define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_LONG_LONG\
30 -Asystem(unix) -Asystem(aix) -Acpu(rs6000) -Amachine(rs6000)"
32 /* Print subsidiary information on the compiler version in use. */
33 #define TARGET_VERSION ;
35 /* Default string to use for cpu if not specified. */
36 #ifndef TARGET_CPU_DEFAULT
37 #define TARGET_CPU_DEFAULT ((char *)0)
38 #endif
40 /* Tell the assembler to assume that all undefined names are external.
42 Don't do this until the fixed IBM assembler is more generally available.
43 When this becomes permanently defined, the ASM_OUTPUT_EXTERNAL,
44 ASM_OUTPUT_EXTERNAL_LIBCALL, and RS6000_OUTPUT_BASENAME macros will no
45 longer be needed. Also, the extern declaration of mcount in ASM_FILE_START
46 will no longer be needed. */
48 /* #define ASM_SPEC "-u %(asm_cpu)" */
50 /* Define appropriate architecture macros for preprocessor depending on
51 target switches. */
53 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_cpu)"
55 /* Common CPP definitions used by CPP_SPEC among the various targets
56 for handling -mcpu=xxx switches. */
57 #define CPP_CPU_SPEC \
58 "%{!mcpu*: \
59 %{mpower: %{!mpower2: -D_ARCH_PWR}} \
60 %{mpower2: -D_ARCH_PWR2} \
61 %{mpowerpc*: -D_ARCH_PPC} \
62 %{mno-power: %{!mpowerpc*: -D_ARCH_COM}} \
63 %{!mno-power: %{!mpower2: %(cpp_default)}}} \
64 %{mcpu=common: -D_ARCH_COM} \
65 %{mcpu=power: -D_ARCH_PWR} \
66 %{mcpu=power2: -D_ARCH_PWR2} \
67 %{mcpu=powerpc: -D_ARCH_PPC} \
68 %{mcpu=rios: -D_ARCH_PWR} \
69 %{mcpu=rios1: -D_ARCH_PWR} \
70 %{mcpu=rios2: -D_ARCH_PWR2} \
71 %{mcpu=rsc: -D_ARCH_PWR} \
72 %{mcpu=rsc1: -D_ARCH_PWR} \
73 %{mcpu=403: -D_ARCH_PPC} \
74 %{mcpu=505: -D_ARCH_PPC} \
75 %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
76 %{mcpu=602: -D_ARCH_PPC} \
77 %{mcpu=603: -D_ARCH_PPC} \
78 %{mcpu=603e: -D_ARCH_PPC} \
79 %{mcpu=604: -D_ARCH_PPC} \
80 %{mcpu=620: -D_ARCH_PPC} \
81 %{mcpu=821: -D_ARCH_PPC} \
82 %{mcpu=860: -D_ARCH_PPC}"
84 #ifndef CPP_DEFAULT_SPEC
85 #define CPP_DEFAULT_SPEC "-D_ARCH_PWR"
86 #endif
88 #ifndef CPP_SYSV_SPEC
89 #define CPP_SYSV_SPEC ""
90 #endif
92 #ifndef CPP_ENDIAN_SPEC
93 #define CPP_ENDIAN_SPEC ""
94 #endif
96 #ifndef CPP_ENDIAN_DEFAULT_SPEC
97 #define CPP_ENDIAN_DEFAULT_SPEC ""
98 #endif
100 #ifndef CPP_SYSV_DEFAULT_SPEC
101 #define CPP_SYSV_DEFAULT_SPEC ""
102 #endif
104 /* Common ASM definitions used by ASM_SPEC among the various targets
105 for handling -mcpu=xxx switches. */
106 #define ASM_CPU_SPEC \
107 "%{!mcpu*: \
108 %{mpower: %{!mpower2: -mpwr}} \
109 %{mpower2: -mpwrx} \
110 %{mpowerpc*: -mppc} \
111 %{mno-power: %{!mpowerpc*: -mcom}} \
112 %{!mno-power: %{!mpower2: %(asm_default)}}} \
113 %{mcpu=common: -mcom} \
114 %{mcpu=power: -mpwr} \
115 %{mcpu=power2: -mpwrx} \
116 %{mcpu=powerpc: -mppc} \
117 %{mcpu=rios: -mpwr} \
118 %{mcpu=rios1: -mpwr} \
119 %{mcpu=rios2: -mpwrx} \
120 %{mcpu=rsc: -mpwr} \
121 %{mcpu=rsc1: -mpwr} \
122 %{mcpu=403: -mppc} \
123 %{mcpu=505: -mppc} \
124 %{mcpu=601: -m601} \
125 %{mcpu=602: -mppc} \
126 %{mcpu=603: -mppc} \
127 %{mcpu=603e: -mppc} \
128 %{mcpu=604: -mppc} \
129 %{mcpu=620: -mppc} \
130 %{mcpu=821: -mppc} \
131 %{mcpu=860: -mppc}"
133 #ifndef ASM_DEFAULT_SPEC
134 #define ASM_DEFAULT_SPEC ""
135 #endif
137 /* This macro defines names of additional specifications to put in the specs
138 that can be used in various specifications like CC1_SPEC. Its definition
139 is an initializer with a subgrouping for each command option.
141 Each subgrouping contains a string constant, that defines the
142 specification name, and a string constant that used by the GNU CC driver
143 program.
145 Do not define this macro if it does not need to do anything. */
147 #ifndef SUBTARGET_EXTRA_SPECS
148 #define SUBTARGET_EXTRA_SPECS
149 #endif
151 #define EXTRA_SPECS \
152 { "cpp_cpu", CPP_CPU_SPEC }, \
153 { "cpp_default", CPP_DEFAULT_SPEC }, \
154 { "cpp_sysv", CPP_SYSV_SPEC }, \
155 { "cpp_sysv_default", CPP_SYSV_DEFAULT_SPEC }, \
156 { "cpp_endian_default", CPP_ENDIAN_DEFAULT_SPEC }, \
157 { "cpp_endian", CPP_ENDIAN_SPEC }, \
158 { "asm_cpu", ASM_CPU_SPEC }, \
159 { "asm_default", ASM_DEFAULT_SPEC }, \
160 { "link_syscalls", LINK_SYSCALLS_SPEC }, \
161 { "link_libg", LINK_LIBG_SPEC }, \
162 SUBTARGET_EXTRA_SPECS
164 /* Default location of syscalls.exp under AIX */
165 #ifndef CROSS_COMPILE
166 #define LINK_SYSCALLS_SPEC "-bI:/lib/syscalls.exp"
167 #else
168 #define LINK_SYSCALLS_SPEC ""
169 #endif
171 /* Default location of libg.exp under AIX */
172 #ifndef CROSS_COMPILE
173 #define LINK_LIBG_SPEC "-bexport:/usr/lib/libg.exp"
174 #else
175 #define LINK_LIBG_SPEC ""
176 #endif
178 /* Define the options for the binder: Start text at 512, align all segments
179 to 512 bytes, and warn if there is text relocation.
181 The -bhalt:4 option supposedly changes the level at which ld will abort,
182 but it also suppresses warnings about multiply defined symbols and is
183 used by the AIX cc command. So we use it here.
185 -bnodelcsect undoes a poor choice of default relating to multiply-defined
186 csects. See AIX documentation for more information about this.
188 -bM:SRE tells the linker that the output file is Shared REusable. Note
189 that to actually build a shared library you will also need to specify an
190 export list with the -Wl,-bE option. */
192 #define LINK_SPEC "-T512 -H512 %{!r:-btextro} -bhalt:4 -bnodelcsect\
193 %{static:-bnso %(link_syscalls) } \
194 %{!shared:%{g*: %(link_libg) }} %{shared:-bM:SRE}"
196 /* Profiled library versions are used by linking with special directories. */
197 #define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\
198 %{p:-L/lib/profiled -L/usr/lib/profiled} %{!shared:%{g*:-lg}} -lc"
200 /* gcc must do the search itself to find libgcc.a, not use -l. */
201 #define LIBGCC_SPEC "libgcc.a%s"
203 /* Don't turn -B into -L if the argument specifies a relative file name. */
204 #define RELATIVE_PREFIX_NOT_LINKDIR
206 /* Architecture type. */
208 extern int target_flags;
210 /* Use POWER architecture instructions and MQ register. */
211 #define MASK_POWER 0x00000001
213 /* Use POWER2 extensions to POWER architecture. */
214 #define MASK_POWER2 0x00000002
216 /* Use PowerPC architecture instructions. */
217 #define MASK_POWERPC 0x00000004
219 /* Use PowerPC General Purpose group optional instructions, e.g. fsqrt. */
220 #define MASK_PPC_GPOPT 0x00000008
222 /* Use PowerPC Graphics group optional instructions, e.g. fsel. */
223 #define MASK_PPC_GFXOPT 0x00000010
225 /* Use PowerPC-64 architecture instructions. */
226 #define MASK_POWERPC64 0x00000020
228 /* Use revised mnemonic names defined for PowerPC architecture. */
229 #define MASK_NEW_MNEMONICS 0x00000040
231 /* Disable placing fp constants in the TOC; can be turned on when the
232 TOC overflows. */
233 #define MASK_NO_FP_IN_TOC 0x00000080
235 /* Disable placing symbol+offset constants in the TOC; can be turned on when
236 the TOC overflows. */
237 #define MASK_NO_SUM_IN_TOC 0x00000100
239 /* Output only one TOC entry per module. Normally linking fails if
240 there are more than 16K unique variables/constants in an executable. With
241 this option, linking fails only if there are more than 16K modules, or
242 if there are more than 16K unique variables/constant in a single module.
244 This is at the cost of having 2 extra loads and one extra store per
245 function, and one less allocable register. */
246 #define MASK_MINIMAL_TOC 0x00000200
248 /* Nonzero for the 64bit model: ints, longs, and pointers are 64 bits. */
249 #define MASK_64BIT 0x00000400
251 /* Disable use of FPRs. */
252 #define MASK_SOFT_FLOAT 0x00000800
254 /* Enable load/store multiple, even on powerpc */
255 #define MASK_MULTIPLE 0x00001000
256 #define MASK_MULTIPLE_SET 0x00002000
258 /* Use string instructions for block moves */
259 #define MASK_STRING 0x00004000
260 #define MASK_STRING_SET 0x00008000
262 /* Disable update form of load/store */
263 #define MASK_NO_UPDATE 0x00010000
265 /* Disable fused multiply/add operations */
266 #define MASK_NO_FUSED_MADD 0x00020000
268 #define TARGET_POWER (target_flags & MASK_POWER)
269 #define TARGET_POWER2 (target_flags & MASK_POWER2)
270 #define TARGET_POWERPC (target_flags & MASK_POWERPC)
271 #define TARGET_PPC_GPOPT (target_flags & MASK_PPC_GPOPT)
272 #define TARGET_PPC_GFXOPT (target_flags & MASK_PPC_GFXOPT)
273 #define TARGET_POWERPC64 (target_flags & MASK_POWERPC64)
274 #define TARGET_NEW_MNEMONICS (target_flags & MASK_NEW_MNEMONICS)
275 #define TARGET_NO_FP_IN_TOC (target_flags & MASK_NO_FP_IN_TOC)
276 #define TARGET_NO_SUM_IN_TOC (target_flags & MASK_NO_SUM_IN_TOC)
277 #define TARGET_MINIMAL_TOC (target_flags & MASK_MINIMAL_TOC)
278 #define TARGET_64BIT (target_flags & MASK_64BIT)
279 #define TARGET_SOFT_FLOAT (target_flags & MASK_SOFT_FLOAT)
280 #define TARGET_MULTIPLE (target_flags & MASK_MULTIPLE)
281 #define TARGET_MULTIPLE_SET (target_flags & MASK_MULTIPLE_SET)
282 #define TARGET_STRING (target_flags & MASK_STRING)
283 #define TARGET_STRING_SET (target_flags & MASK_STRING_SET)
284 #define TARGET_NO_UPDATE (target_flags & MASK_NO_UPDATE)
285 #define TARGET_NO_FUSED_MADD (target_flags & MASK_NO_FUSED_MADD)
287 #define TARGET_32BIT (! TARGET_64BIT)
288 #define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT)
289 #define TARGET_UPDATE (! TARGET_NO_UPDATE)
290 #define TARGET_FUSED_MADD (! TARGET_NO_FUSED_MADD)
292 /* Pseudo target to indicate whether the object format is ELF
293 (to get around not having conditional compilation in the md file) */
294 #ifndef TARGET_ELF
295 #define TARGET_ELF 0
296 #endif
298 /* If this isn't V.4, don't support -mno-toc. */
299 #ifndef TARGET_NO_TOC
300 #define TARGET_NO_TOC 0
301 #define TARGET_TOC 1
302 #endif
304 /* Pseudo target to say whether this is Windows NT */
305 #ifndef TARGET_WINDOWS_NT
306 #define TARGET_WINDOWS_NT 0
307 #endif
309 /* Pseudo target to say whether this is MAC */
310 #ifndef TARGET_MACOS
311 #define TARGET_MACOS 0
312 #endif
314 /* Pseudo target to say whether this is AIX */
315 #ifndef TARGET_AIX
316 #if (TARGET_ELF || TARGET_WINDOWS_NT || TARGET_MACOS)
317 #define TARGET_AIX 0
318 #else
319 #define TARGET_AIX 1
320 #endif
321 #endif
323 #ifndef TARGET_XL_CALL
324 #define TARGET_XL_CALL 0
325 #endif
327 /* Run-time compilation parameters selecting different hardware subsets.
329 Macro to define tables used to set the flags.
330 This is a list in braces of pairs in braces,
331 each pair being { "NAME", VALUE }
332 where VALUE is the bits to set or minus the bits to clear.
333 An empty string NAME is used to identify the default VALUE. */
335 /* This is meant to be redefined in the host dependent files */
336 #ifndef SUBTARGET_SWITCHES
337 #define SUBTARGET_SWITCHES
338 #endif
340 #define TARGET_SWITCHES \
341 {{"power", MASK_POWER | MASK_MULTIPLE | MASK_STRING}, \
342 {"power2", (MASK_POWER | MASK_MULTIPLE | MASK_STRING \
343 | MASK_POWER2)}, \
344 {"no-power2", - MASK_POWER2}, \
345 {"no-power", - (MASK_POWER | MASK_POWER2 | MASK_MULTIPLE \
346 | MASK_STRING)}, \
347 {"powerpc", MASK_POWERPC}, \
348 {"no-powerpc", - (MASK_POWERPC | MASK_PPC_GPOPT \
349 | MASK_PPC_GFXOPT | MASK_POWERPC64)}, \
350 {"powerpc-gpopt", MASK_POWERPC | MASK_PPC_GPOPT}, \
351 {"no-powerpc-gpopt", - MASK_PPC_GPOPT}, \
352 {"powerpc-gfxopt", MASK_POWERPC | MASK_PPC_GFXOPT}, \
353 {"no-powerpc-gfxopt", - MASK_PPC_GFXOPT}, \
354 {"powerpc64", MASK_POWERPC64}, \
355 {"no-powerpc64", - MASK_POWERPC64}, \
356 {"new-mnemonics", MASK_NEW_MNEMONICS}, \
357 {"old-mnemonics", -MASK_NEW_MNEMONICS}, \
358 {"full-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC \
359 | MASK_MINIMAL_TOC)}, \
360 {"fp-in-toc", - MASK_NO_FP_IN_TOC}, \
361 {"no-fp-in-toc", MASK_NO_FP_IN_TOC}, \
362 {"sum-in-toc", - MASK_NO_SUM_IN_TOC}, \
363 {"no-sum-in-toc", MASK_NO_SUM_IN_TOC}, \
364 {"minimal-toc", MASK_MINIMAL_TOC}, \
365 {"minimal-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC)}, \
366 {"no-minimal-toc", - MASK_MINIMAL_TOC}, \
367 {"hard-float", - MASK_SOFT_FLOAT}, \
368 {"soft-float", MASK_SOFT_FLOAT}, \
369 {"multiple", MASK_MULTIPLE | MASK_MULTIPLE_SET}, \
370 {"no-multiple", - MASK_MULTIPLE}, \
371 {"no-multiple", MASK_MULTIPLE_SET}, \
372 {"string", MASK_STRING | MASK_STRING_SET}, \
373 {"no-string", - MASK_STRING}, \
374 {"no-string", MASK_STRING_SET}, \
375 {"update", - MASK_NO_UPDATE}, \
376 {"no-update", MASK_NO_UPDATE}, \
377 {"fused-madd", - MASK_NO_FUSED_MADD}, \
378 {"no-fused-madd", MASK_NO_FUSED_MADD}, \
379 SUBTARGET_SWITCHES \
380 {"", TARGET_DEFAULT}}
382 #define TARGET_DEFAULT (MASK_POWER | MASK_MULTIPLE | MASK_STRING)
384 /* Processor type. */
385 enum processor_type
386 {PROCESSOR_RIOS1,
387 PROCESSOR_RIOS2,
388 PROCESSOR_MPCCORE,
389 PROCESSOR_PPC403,
390 PROCESSOR_PPC601,
391 PROCESSOR_PPC603,
392 PROCESSOR_PPC604,
393 PROCESSOR_PPC620};
395 extern enum processor_type rs6000_cpu;
397 /* Recast the processor type to the cpu attribute. */
398 #define rs6000_cpu_attr ((enum attr_cpu)rs6000_cpu)
400 /* Define generic processor types based upon current deployment. */
401 #define PROCESSOR_COMMON PROCESSOR_PPC601
402 #define PROCESSOR_POWER PROCESSOR_RIOS1
403 #define PROCESSOR_POWERPC PROCESSOR_PPC604
405 /* Define the default processor. This is overridden by other tm.h files. */
406 #define PROCESSOR_DEFAULT PROCESSOR_RIOS1
408 /* Specify the dialect of assembler to use. New mnemonics is dialect one
409 and the old mnemonics are dialect zero. */
410 #define ASSEMBLER_DIALECT TARGET_NEW_MNEMONICS ? 1 : 0
412 /* This macro is similar to `TARGET_SWITCHES' but defines names of
413 command options that have values. Its definition is an
414 initializer with a subgrouping for each command option.
416 Each subgrouping contains a string constant, that defines the
417 fixed part of the option name, and the address of a variable.
418 The variable, type `char *', is set to the variable part of the
419 given option if the fixed part matches. The actual option name
420 is made by appending `-m' to the specified name.
422 Here is an example which defines `-mshort-data-NUMBER'. If the
423 given option is `-mshort-data-512', the variable `m88k_short_data'
424 will be set to the string `"512"'.
426 extern char *m88k_short_data;
427 #define TARGET_OPTIONS { { "short-data-", &m88k_short_data } } */
429 /* This is meant to be overridden in target specific files. */
430 #ifndef SUBTARGET_OPTIONS
431 #define SUBTARGET_OPTIONS
432 #endif
434 #define TARGET_OPTIONS \
436 {"cpu=", &rs6000_select[1].string}, \
437 {"tune=", &rs6000_select[2].string}, \
438 {"debug-", &rs6000_debug_name}, \
439 {"debug=", &rs6000_debug_name}, \
440 SUBTARGET_OPTIONS \
443 /* rs6000_select[0] is reserved for the default cpu defined via --with-cpu */
444 struct rs6000_cpu_select
446 char *string;
447 char *name;
448 int set_tune_p;
449 int set_arch_p;
452 extern struct rs6000_cpu_select rs6000_select[];
454 /* Debug support */
455 extern char *rs6000_debug_name; /* Name for -mdebug-xxxx option */
456 extern int rs6000_debug_stack; /* debug stack applications */
457 extern int rs6000_debug_arg; /* debug argument handling */
459 #define TARGET_DEBUG_STACK rs6000_debug_stack
460 #define TARGET_DEBUG_ARG rs6000_debug_arg
462 /* Sometimes certain combinations of command options do not make sense
463 on a particular target machine. You can define a macro
464 `OVERRIDE_OPTIONS' to take account of this. This macro, if
465 defined, is executed once just after all the command options have
466 been parsed.
468 On the RS/6000 this is used to define the target cpu type. */
470 #define OVERRIDE_OPTIONS rs6000_override_options (TARGET_CPU_DEFAULT)
472 /* Show we can debug even without a frame pointer. */
473 #define CAN_DEBUG_WITHOUT_FP
475 /* target machine storage layout */
477 /* Define to support cross compilation to an RS6000 target. */
478 #define REAL_ARITHMETIC
480 /* Define this macro if it is advisable to hold scalars in registers
481 in a wider mode than that declared by the program. In such cases,
482 the value is constrained to be within the bounds of the declared
483 type, but kept valid in the wider mode. The signedness of the
484 extension may differ from that of the type. */
486 #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
487 if (GET_MODE_CLASS (MODE) == MODE_INT \
488 && GET_MODE_SIZE (MODE) < 4) \
489 (MODE) = SImode;
491 /* Define this if most significant bit is lowest numbered
492 in instructions that operate on numbered bit-fields. */
493 /* That is true on RS/6000. */
494 #define BITS_BIG_ENDIAN 1
496 /* Define this if most significant byte of a word is the lowest numbered. */
497 /* That is true on RS/6000. */
498 #define BYTES_BIG_ENDIAN 1
500 /* Define this if most significant word of a multiword number is lowest
501 numbered.
503 For RS/6000 we can decide arbitrarily since there are no machine
504 instructions for them. Might as well be consistent with bits and bytes. */
505 #define WORDS_BIG_ENDIAN 1
507 /* number of bits in an addressable storage unit */
508 #define BITS_PER_UNIT 8
510 /* Width in bits of a "word", which is the contents of a machine register.
511 Note that this is not necessarily the width of data type `int';
512 if using 16-bit ints on a 68000, this would still be 32.
513 But on a machine with 16-bit registers, this would be 16. */
514 #define BITS_PER_WORD (! TARGET_POWERPC64 ? 32 : 64)
515 #define MAX_BITS_PER_WORD 64
517 /* Width of a word, in units (bytes). */
518 #define UNITS_PER_WORD (! TARGET_POWERPC64 ? 4 : 8)
519 #define MIN_UNITS_PER_WORD 4
520 #define UNITS_PER_FP_WORD 8
522 /* Type used for ptrdiff_t, as a string used in a declaration. */
523 #define PTRDIFF_TYPE "int"
525 /* Type used for wchar_t, as a string used in a declaration. */
526 #define WCHAR_TYPE "short unsigned int"
528 /* Width of wchar_t in bits. */
529 #define WCHAR_TYPE_SIZE 16
531 /* A C expression for the size in bits of the type `short' on the
532 target machine. If you don't define this, the default is half a
533 word. (If this would be less than one storage unit, it is
534 rounded up to one unit.) */
535 #define SHORT_TYPE_SIZE 16
537 /* A C expression for the size in bits of the type `int' on the
538 target machine. If you don't define this, the default is one
539 word. */
540 #define INT_TYPE_SIZE 32
542 /* A C expression for the size in bits of the type `long' on the
543 target machine. If you don't define this, the default is one
544 word. */
545 #define LONG_TYPE_SIZE (TARGET_32BIT ? 32 : 64)
546 #define MAX_LONG_TYPE_SIZE 64
548 /* A C expression for the size in bits of the type `long long' on the
549 target machine. If you don't define this, the default is two
550 words. */
551 #define LONG_LONG_TYPE_SIZE 64
553 /* A C expression for the size in bits of the type `char' on the
554 target machine. If you don't define this, the default is one
555 quarter of a word. (If this would be less than one storage unit,
556 it is rounded up to one unit.) */
557 #define CHAR_TYPE_SIZE BITS_PER_UNIT
559 /* A C expression for the size in bits of the type `float' on the
560 target machine. If you don't define this, the default is one
561 word. */
562 #define FLOAT_TYPE_SIZE 32
564 /* A C expression for the size in bits of the type `double' on the
565 target machine. If you don't define this, the default is two
566 words. */
567 #define DOUBLE_TYPE_SIZE 64
569 /* A C expression for the size in bits of the type `long double' on
570 the target machine. If you don't define this, the default is two
571 words. */
572 #define LONG_DOUBLE_TYPE_SIZE 64
574 /* Width in bits of a pointer.
575 See also the macro `Pmode' defined below. */
576 #define POINTER_SIZE (TARGET_32BIT ? 32 : 64)
578 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
579 #define PARM_BOUNDARY (TARGET_32BIT ? 32 : 64)
581 /* Boundary (in *bits*) on which stack pointer should be aligned. */
582 #define STACK_BOUNDARY (TARGET_32BIT ? 64 : 128)
584 /* Allocation boundary (in *bits*) for the code of a function. */
585 #define FUNCTION_BOUNDARY 32
587 /* No data type wants to be aligned rounder than this. */
588 #define BIGGEST_ALIGNMENT 64
590 /* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints. */
591 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
592 (TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \
593 ? get_inner_array_type (FIELD) \
594 : TREE_TYPE (FIELD)) == DFmode \
595 ? MIN ((COMPUTED), 32) : (COMPUTED))
597 /* Alignment of field after `int : 0' in a structure. */
598 #define EMPTY_FIELD_BOUNDARY 32
600 /* Every structure's size must be a multiple of this. */
601 #define STRUCTURE_SIZE_BOUNDARY 8
603 /* A bitfield declared as `int' forces `int' alignment for the struct. */
604 #define PCC_BITFIELD_TYPE_MATTERS 1
606 /* AIX increases natural record alignment to doubleword if the first
607 field is an FP double while the FP fields remain word aligned. */
608 #define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
609 ((TREE_CODE (STRUCT) == RECORD_TYPE \
610 || TREE_CODE (STRUCT) == UNION_TYPE \
611 || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
612 && TYPE_FIELDS (STRUCT) != 0 \
613 && DECL_MODE (TYPE_FIELDS (STRUCT)) == DFmode \
614 ? MAX (MAX ((COMPUTED), (SPECIFIED)), BIGGEST_ALIGNMENT) \
615 : MAX ((COMPUTED), (SPECIFIED)))
617 /* Make strings word-aligned so strcpy from constants will be faster. */
618 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
619 (TREE_CODE (EXP) == STRING_CST \
620 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
622 /* Make arrays of chars word-aligned for the same reasons. */
623 #define DATA_ALIGNMENT(TYPE, ALIGN) \
624 (TREE_CODE (TYPE) == ARRAY_TYPE \
625 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
626 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
628 /* Non-zero if move instructions will actually fail to work
629 when given unaligned data. */
630 #define STRICT_ALIGNMENT 0
632 /* Standard register usage. */
634 /* Number of actual hardware registers.
635 The hardware registers are assigned numbers for the compiler
636 from 0 to just below FIRST_PSEUDO_REGISTER.
637 All registers that the compiler knows about must be given numbers,
638 even those that are not normally considered general registers.
640 RS/6000 has 32 fixed-point registers, 32 floating-point registers,
641 an MQ register, a count register, a link register, and 8 condition
642 register fields, which we view here as separate registers.
644 In addition, the difference between the frame and argument pointers is
645 a function of the number of registers saved, so we need to have a
646 register for AP that will later be eliminated in favor of SP or FP.
647 This is a normal register, but it is fixed.
649 We also create a pseudo register for float/int conversions, that will
650 really represent the memory location used. It is represented here as
651 a register, in order to work around problems in allocating stack storage
652 in inline functions. */
654 #define FIRST_PSEUDO_REGISTER 77
656 /* 1 for registers that have pervasive standard uses
657 and are not available for the register allocator.
659 On RS/6000, r1 is used for the stack and r2 is used as the TOC pointer.
661 cr5 is not supposed to be used.
663 On System V implementations, r13 is fixed and not available for use. */
665 #ifndef FIXED_R13
666 #define FIXED_R13 0
667 #endif
669 #define FIXED_REGISTERS \
670 {0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, FIXED_R13, 0, 0, \
671 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
672 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
673 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
674 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1}
676 /* 1 for registers not available across function calls.
677 These must include the FIXED_REGISTERS and also any
678 registers that can be used without being saved.
679 The latter must include the registers where values are returned
680 and the register where structure-value addresses are passed.
681 Aside from that, you can include as many other registers as you like. */
683 #define CALL_USED_REGISTERS \
684 {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, FIXED_R13, 0, 0, \
685 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
686 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, \
687 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
688 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1}
690 /* List the order in which to allocate registers. Each register must be
691 listed once, even those in FIXED_REGISTERS.
693 We allocate in the following order:
694 fp0 (not saved or used for anything)
695 fp13 - fp2 (not saved; incoming fp arg registers)
696 fp1 (not saved; return value)
697 fp31 - fp14 (saved; order given to save least number)
698 cr1, cr6, cr7 (not saved or special)
699 cr0 (not saved, but used for arithmetic operations)
700 cr2, cr3, cr4 (saved)
701 r0 (not saved; cannot be base reg)
702 r9 (not saved; best for TImode)
703 r11, r10, r8-r4 (not saved; highest used first to make less conflict)
704 r3 (not saved; return value register)
705 r31 - r13 (saved; order given to save least number)
706 r12 (not saved; if used for DImode or DFmode would use r13)
707 mq (not saved; best to use it if we can)
708 ctr (not saved; when we have the choice ctr is better)
709 lr (saved)
710 cr5, r1, r2, ap (fixed) */
712 #define REG_ALLOC_ORDER \
713 {32, \
714 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, \
715 33, \
716 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, \
717 50, 49, 48, 47, 46, \
718 69, 74, 75, 68, 70, 71, 72, \
719 0, \
720 9, 11, 10, 8, 7, 6, 5, 4, \
721 3, \
722 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, \
723 18, 17, 16, 15, 14, 13, 12, \
724 64, 66, 65, \
725 73, 1, 2, 67, 76}
727 /* True if register is floating-point. */
728 #define FP_REGNO_P(N) ((N) >= 32 && (N) <= 63)
730 /* True if register is a condition register. */
731 #define CR_REGNO_P(N) ((N) >= 68 && (N) <= 75)
733 /* True if register is an integer register. */
734 #define INT_REGNO_P(N) ((N) <= 31 || (N) == 67)
736 /* True if register is the temporary memory location used for int/float
737 conversion. */
738 #define FPMEM_REGNO_P(N) ((N) == FPMEM_REGNUM)
740 /* Return number of consecutive hard regs needed starting at reg REGNO
741 to hold something of mode MODE.
742 This is ordinarily the length in words of a value of mode MODE
743 but can be less for certain modes in special long registers.
745 POWER and PowerPC GPRs hold 32 bits worth;
746 PowerPC64 GPRs and FPRs point register holds 64 bits worth. */
748 #define HARD_REGNO_NREGS(REGNO, MODE) \
749 (FP_REGNO_P (REGNO) || FPMEM_REGNO_P (REGNO) \
750 ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \
751 : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
753 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
754 For POWER and PowerPC, the GPRs can hold any mode, but the float
755 registers only can hold floating modes and DImode, and CR register only
756 can hold CC modes. We cannot put TImode anywhere except general
757 register and it must be able to fit within the register set. */
759 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
760 (FP_REGNO_P (REGNO) ? \
761 (GET_MODE_CLASS (MODE) == MODE_FLOAT \
762 || (GET_MODE_CLASS (MODE) == MODE_INT \
763 && GET_MODE_SIZE (MODE) == UNITS_PER_FP_WORD)) \
764 : CR_REGNO_P (REGNO) ? GET_MODE_CLASS (MODE) == MODE_CC \
765 : FPMEM_REGNO_P (REGNO) ? ((MODE) == DImode || (MODE) == DFmode) \
766 : ! INT_REGNO_P (REGNO) ? (GET_MODE_CLASS (MODE) == MODE_INT \
767 && GET_MODE_SIZE (MODE) <= UNITS_PER_WORD) \
768 : 1)
770 /* Value is 1 if it is a good idea to tie two pseudo registers
771 when one has mode MODE1 and one has mode MODE2.
772 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
773 for any hard reg, then this must be 0 for correct output. */
774 #define MODES_TIEABLE_P(MODE1, MODE2) \
775 (GET_MODE_CLASS (MODE1) == MODE_FLOAT \
776 ? GET_MODE_CLASS (MODE2) == MODE_FLOAT \
777 : GET_MODE_CLASS (MODE2) == MODE_FLOAT \
778 ? GET_MODE_CLASS (MODE1) == MODE_FLOAT \
779 : GET_MODE_CLASS (MODE1) == MODE_CC \
780 ? GET_MODE_CLASS (MODE2) == MODE_CC \
781 : GET_MODE_CLASS (MODE2) == MODE_CC \
782 ? GET_MODE_CLASS (MODE1) == MODE_CC \
783 : 1)
785 /* A C expression returning the cost of moving data from a register of class
786 CLASS1 to one of CLASS2.
788 On the RS/6000, copying between floating-point and fixed-point
789 registers is expensive. */
791 #define REGISTER_MOVE_COST(CLASS1, CLASS2) \
792 ((CLASS1) == FLOAT_REGS && (CLASS2) == FLOAT_REGS ? 2 \
793 : (CLASS1) == FLOAT_REGS && (CLASS2) != FLOAT_REGS ? 10 \
794 : (CLASS1) != FLOAT_REGS && (CLASS2) == FLOAT_REGS ? 10 \
795 : (((CLASS1) == SPECIAL_REGS || (CLASS1) == MQ_REGS \
796 || (CLASS1) == LINK_REGS || (CLASS1) == CTR_REGS \
797 || (CLASS1) == LINK_OR_CTR_REGS) \
798 && ((CLASS2) == SPECIAL_REGS || (CLASS2) == MQ_REGS \
799 || (CLASS2) == LINK_REGS || (CLASS2) == CTR_REGS \
800 || (CLASS2) == LINK_OR_CTR_REGS)) ? 10 \
801 : 2)
803 /* A C expressions returning the cost of moving data of MODE from a register to
804 or from memory.
806 On the RS/6000, bump this up a bit. */
808 #define MEMORY_MOVE_COST(MODE,CLASS,IN) \
809 ((GET_MODE_CLASS (MODE) == MODE_FLOAT \
810 && (rs6000_cpu == PROCESSOR_RIOS1 || rs6000_cpu == PROCESSOR_PPC601) \
811 ? 3 : 2) \
812 + 4)
814 /* Specify the cost of a branch insn; roughly the number of extra insns that
815 should be added to avoid a branch.
817 Set this to 3 on the RS/6000 since that is roughly the average cost of an
818 unscheduled conditional branch. */
820 #define BRANCH_COST 3
822 /* A C statement (sans semicolon) to update the integer variable COST
823 based on the relationship between INSN that is dependent on
824 DEP_INSN through the dependence LINK. The default is to make no
825 adjustment to COST. On the RS/6000, ignore the cost of anti- and
826 output-dependencies. In fact, output dependencies on the CR do have
827 a cost, but it is probably not worthwhile to track it. */
829 #define ADJUST_COST(INSN,LINK,DEP_INSN,COST) \
830 (COST) = rs6000_adjust_cost (INSN,LINK,DEP_INSN,COST)
832 /* Define this macro to change register usage conditional on target flags.
833 Set MQ register fixed (already call_used) if not POWER architecture
834 (RIOS1, RIOS2, RSC, and PPC601) so that it will not be allocated.
835 Conditionally disable FPRs. */
837 #define CONDITIONAL_REGISTER_USAGE \
839 if (! TARGET_POWER) \
840 fixed_regs[64] = 1; \
841 if (TARGET_SOFT_FLOAT) \
842 for (i = 32; i < 64; i++) \
843 fixed_regs[i] = call_used_regs[i] = 1; \
846 /* Specify the registers used for certain standard purposes.
847 The values of these macros are register numbers. */
849 /* RS/6000 pc isn't overloaded on a register that the compiler knows about. */
850 /* #define PC_REGNUM */
852 /* Register to use for pushing function arguments. */
853 #define STACK_POINTER_REGNUM 1
855 /* Base register for access to local variables of the function. */
856 #define FRAME_POINTER_REGNUM 31
858 /* Value should be nonzero if functions must have frame pointers.
859 Zero means the frame pointer need not be set up (and parms
860 may be accessed via the stack pointer) in functions that seem suitable.
861 This is computed in `reload', in reload1.c. */
862 #define FRAME_POINTER_REQUIRED 0
864 /* Base register for access to arguments of the function. */
865 #define ARG_POINTER_REGNUM 67
867 /* Place to put static chain when calling a function that requires it. */
868 #define STATIC_CHAIN_REGNUM 11
870 /* count register number for special purposes */
871 #define COUNT_REGISTER_REGNUM 66
873 /* Special register that represents memory, used for float/int conversions. */
874 #define FPMEM_REGNUM 76
876 /* Register to use as a placeholder for the GOT/allocated TOC register.
877 FINALIZE_PIC will change all uses of this register to a an appropriate
878 pseudo register when it adds the code to setup the GOT. We use r2
879 because it is a reserved register in all of the ABI's. */
880 #define GOT_TOC_REGNUM 2
882 /* Place that structure value return address is placed.
884 On the RS/6000, it is passed as an extra parameter. */
885 #define STRUCT_VALUE 0
887 /* Define the classes of registers for register constraints in the
888 machine description. Also define ranges of constants.
890 One of the classes must always be named ALL_REGS and include all hard regs.
891 If there is more than one class, another class must be named NO_REGS
892 and contain no registers.
894 The name GENERAL_REGS must be the name of a class (or an alias for
895 another name such as ALL_REGS). This is the class of registers
896 that is allowed by "g" or "r" in a register constraint.
897 Also, registers outside this class are allocated only when
898 instructions express preferences for them.
900 The classes must be numbered in nondecreasing order; that is,
901 a larger-numbered class must never be contained completely
902 in a smaller-numbered class.
904 For any two classes, it is very desirable that there be another
905 class that represents their union. */
907 /* The RS/6000 has three types of registers, fixed-point, floating-point,
908 and condition registers, plus three special registers, MQ, CTR, and the
909 link register.
911 However, r0 is special in that it cannot be used as a base register.
912 So make a class for registers valid as base registers.
914 Also, cr0 is the only condition code register that can be used in
915 arithmetic insns, so make a separate class for it.
917 There is a special 'register' (76), which is not a register, but a
918 placeholder for memory allocated to convert between floating point and
919 integral types. This works around a problem where if we allocate memory
920 with allocate_stack_{local,temp} and the function is an inline function, the
921 memory allocated will clobber memory in the caller. So we use a special
922 register, and if that is used, we allocate stack space for it. */
924 enum reg_class
926 NO_REGS,
927 BASE_REGS,
928 GENERAL_REGS,
929 FLOAT_REGS,
930 NON_SPECIAL_REGS,
931 MQ_REGS,
932 LINK_REGS,
933 CTR_REGS,
934 LINK_OR_CTR_REGS,
935 SPECIAL_REGS,
936 SPEC_OR_GEN_REGS,
937 CR0_REGS,
938 CR_REGS,
939 NON_FLOAT_REGS,
940 FPMEM_REGS,
941 FLOAT_OR_FPMEM_REGS,
942 ALL_REGS,
943 LIM_REG_CLASSES
946 #define N_REG_CLASSES (int) LIM_REG_CLASSES
948 /* Give names of register classes as strings for dump file. */
950 #define REG_CLASS_NAMES \
952 "NO_REGS", \
953 "BASE_REGS", \
954 "GENERAL_REGS", \
955 "FLOAT_REGS", \
956 "NON_SPECIAL_REGS", \
957 "MQ_REGS", \
958 "LINK_REGS", \
959 "CTR_REGS", \
960 "LINK_OR_CTR_REGS", \
961 "SPECIAL_REGS", \
962 "SPEC_OR_GEN_REGS", \
963 "CR0_REGS", \
964 "CR_REGS", \
965 "NON_FLOAT_REGS", \
966 "FPMEM_REGS", \
967 "FLOAT_OR_FPMEM_REGS", \
968 "ALL_REGS" \
971 /* Define which registers fit in which classes.
972 This is an initializer for a vector of HARD_REG_SET
973 of length N_REG_CLASSES. */
975 #define REG_CLASS_CONTENTS \
977 { 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS */ \
978 { 0xfffffffe, 0x00000000, 0x00000008 }, /* BASE_REGS */ \
979 { 0xffffffff, 0x00000000, 0x00000008 }, /* GENERAL_REGS */ \
980 { 0x00000000, 0xffffffff, 0x00000000 }, /* FLOAT_REGS */ \
981 { 0xffffffff, 0xffffffff, 0x00000008 }, /* NON_SPECIAL_REGS */ \
982 { 0x00000000, 0x00000000, 0x00000001 }, /* MQ_REGS */ \
983 { 0x00000000, 0x00000000, 0x00000002 }, /* LINK_REGS */ \
984 { 0x00000000, 0x00000000, 0x00000004 }, /* CTR_REGS */ \
985 { 0x00000000, 0x00000000, 0x00000006 }, /* LINK_OR_CTR_REGS */ \
986 { 0x00000000, 0x00000000, 0x00000007 }, /* SPECIAL_REGS */ \
987 { 0xffffffff, 0x00000000, 0x0000000f }, /* SPEC_OR_GEN_REGS */ \
988 { 0x00000000, 0x00000000, 0x00000010 }, /* CR0_REGS */ \
989 { 0x00000000, 0x00000000, 0x00000ff0 }, /* CR_REGS */ \
990 { 0xffffffff, 0x00000000, 0x0000ffff }, /* NON_FLOAT_REGS */ \
991 { 0x00000000, 0x00000000, 0x00010000 }, /* FPMEM_REGS */ \
992 { 0x00000000, 0xffffffff, 0x00010000 }, /* FLOAT_OR_FPMEM_REGS */ \
993 { 0xffffffff, 0xffffffff, 0x0001ffff } /* ALL_REGS */ \
996 /* The same information, inverted:
997 Return the class number of the smallest class containing
998 reg number REGNO. This could be a conditional expression
999 or could index an array. */
1001 #define REGNO_REG_CLASS(REGNO) \
1002 ((REGNO) == 0 ? GENERAL_REGS \
1003 : (REGNO) < 32 ? BASE_REGS \
1004 : FP_REGNO_P (REGNO) ? FLOAT_REGS \
1005 : (REGNO) == 68 ? CR0_REGS \
1006 : CR_REGNO_P (REGNO) ? CR_REGS \
1007 : (REGNO) == 64 ? MQ_REGS \
1008 : (REGNO) == 65 ? LINK_REGS \
1009 : (REGNO) == 66 ? CTR_REGS \
1010 : (REGNO) == 67 ? BASE_REGS \
1011 : (REGNO) == 76 ? FPMEM_REGS \
1012 : NO_REGS)
1014 /* The class value for index registers, and the one for base regs. */
1015 #define INDEX_REG_CLASS GENERAL_REGS
1016 #define BASE_REG_CLASS BASE_REGS
1018 /* Get reg_class from a letter such as appears in the machine description. */
1020 #define REG_CLASS_FROM_LETTER(C) \
1021 ((C) == 'f' ? FLOAT_REGS \
1022 : (C) == 'b' ? BASE_REGS \
1023 : (C) == 'h' ? SPECIAL_REGS \
1024 : (C) == 'q' ? MQ_REGS \
1025 : (C) == 'c' ? CTR_REGS \
1026 : (C) == 'l' ? LINK_REGS \
1027 : (C) == 'x' ? CR0_REGS \
1028 : (C) == 'y' ? CR_REGS \
1029 : (C) == 'z' ? FPMEM_REGS \
1030 : NO_REGS)
1032 /* The letters I, J, K, L, M, N, and P in a register constraint string
1033 can be used to stand for particular ranges of immediate operands.
1034 This macro defines what the ranges are.
1035 C is the letter, and VALUE is a constant value.
1036 Return 1 if VALUE is in the range specified by C.
1038 `I' is signed 16-bit constants
1039 `J' is a constant with only the high-order 16 bits non-zero
1040 `K' is a constant with only the low-order 16 bits non-zero
1041 `L' is a constant that can be placed into a mask operand
1042 `M' is a constant that is greater than 31
1043 `N' is a constant that is an exact power of two
1044 `O' is the constant zero
1045 `P' is a constant whose negation is a signed 16-bit constant */
1047 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
1048 ( (C) == 'I' ? (unsigned HOST_WIDE_INT) ((VALUE) + 0x8000) < 0x10000 \
1049 : (C) == 'J' ? ((VALUE) & 0xffff) == 0 \
1050 : (C) == 'K' ? ((VALUE) & (~ (HOST_WIDE_INT) 0xffff)) == 0 \
1051 : (C) == 'L' ? mask_constant (VALUE) \
1052 : (C) == 'M' ? (VALUE) > 31 \
1053 : (C) == 'N' ? exact_log2 (VALUE) >= 0 \
1054 : (C) == 'O' ? (VALUE) == 0 \
1055 : (C) == 'P' ? (unsigned HOST_WIDE_INT) ((- (VALUE)) + 0x8000) < 0x1000 \
1056 : 0)
1058 /* Similar, but for floating constants, and defining letters G and H.
1059 Here VALUE is the CONST_DOUBLE rtx itself.
1061 We flag for special constants when we can copy the constant into
1062 a general register in two insns for DF/DI and one insn for SF.
1064 'H' is used for DI/DF constants that take 3 insns. */
1066 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
1067 ( (C) == 'G' ? (num_insns_constant (VALUE, GET_MODE (VALUE)) \
1068 == ((GET_MODE (VALUE) == SFmode) ? 1 : 2)) \
1069 : (C) == 'H' ? (num_insns_constant (VALUE, GET_MODE (VALUE)) == 3) \
1070 : 0)
1072 /* Optional extra constraints for this machine.
1074 'Q' means that is a memory operand that is just an offset from a reg.
1075 'R' is for AIX TOC entries.
1076 'S' is a constant that can be placed into a 64-bit mask operand
1077 'U' is for V.4 small data references. */
1079 #define EXTRA_CONSTRAINT(OP, C) \
1080 ((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG \
1081 : (C) == 'R' ? LEGITIMATE_CONSTANT_POOL_ADDRESS_P (OP) \
1082 : (C) == 'S' ? mask64_operand (OP, VOIDmode) \
1083 : (C) == 'U' ? ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) \
1084 && small_data_operand (OP, GET_MODE (OP))) \
1085 : 0)
1087 /* Given an rtx X being reloaded into a reg required to be
1088 in class CLASS, return the class of reg to actually use.
1089 In general this is just CLASS; but on some machines
1090 in some cases it is preferable to use a more restrictive class.
1092 On the RS/6000, we have to return NO_REGS when we want to reload a
1093 floating-point CONST_DOUBLE to force it to be copied to memory. */
1095 #define PREFERRED_RELOAD_CLASS(X,CLASS) \
1096 ((GET_CODE (X) == CONST_DOUBLE \
1097 && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \
1098 ? NO_REGS : (CLASS))
1100 /* Return the register class of a scratch register needed to copy IN into
1101 or out of a register in CLASS in MODE. If it can be done directly,
1102 NO_REGS is returned. */
1104 #define SECONDARY_RELOAD_CLASS(CLASS,MODE,IN) \
1105 secondary_reload_class (CLASS, MODE, IN)
1107 /* If we are copying between FP registers and anything else, we need a memory
1108 location. */
1110 #define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) \
1111 ((CLASS1) != (CLASS2) && ((CLASS1) == FLOAT_REGS || (CLASS2) == FLOAT_REGS))
1113 /* Return the maximum number of consecutive registers
1114 needed to represent mode MODE in a register of class CLASS.
1116 On RS/6000, this is the size of MODE in words,
1117 except in the FP regs, where a single reg is enough for two words. */
1118 #define CLASS_MAX_NREGS(CLASS, MODE) \
1119 (((CLASS) == FLOAT_REGS || (CLASS) == FPMEM_REGS \
1120 || (CLASS) == FLOAT_OR_FPMEM_REGS) \
1121 ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \
1122 : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
1124 /* If defined, gives a class of registers that cannot be used as the
1125 operand of a SUBREG that changes the size of the object. */
1127 #define CLASS_CANNOT_CHANGE_SIZE FLOAT_OR_FPMEM_REGS
1129 /* Stack layout; function entry, exit and calling. */
1131 /* Enumeration to give which calling sequence to use. */
1132 enum rs6000_abi {
1133 ABI_NONE,
1134 ABI_AIX, /* IBM's AIX */
1135 ABI_AIX_NODESC, /* AIX calling sequence minus function descriptors */
1136 ABI_V4, /* System V.4/eabi */
1137 ABI_NT, /* Windows/NT */
1138 ABI_SOLARIS /* Solaris */
1141 extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */
1143 /* Default ABI to compile code for */
1144 #ifndef DEFAULT_ABI
1145 #define DEFAULT_ABI ABI_AIX
1146 /* The prefix to add to user-visible assembler symbols. */
1147 #define USER_LABEL_PREFIX "."
1148 #endif
1150 /* Structure used to define the rs6000 stack */
1151 typedef struct rs6000_stack {
1152 int first_gp_reg_save; /* first callee saved GP register used */
1153 int first_fp_reg_save; /* first callee saved FP register used */
1154 int lr_save_p; /* true if the link reg needs to be saved */
1155 int cr_save_p; /* true if the CR reg needs to be saved */
1156 int toc_save_p; /* true if the TOC needs to be saved */
1157 int push_p; /* true if we need to allocate stack space */
1158 int calls_p; /* true if the function makes any calls */
1159 int main_p; /* true if this is main */
1160 int main_save_p; /* true if this is main and we need to save args */
1161 int fpmem_p; /* true if float/int conversion temp needed */
1162 enum rs6000_abi abi; /* which ABI to use */
1163 int gp_save_offset; /* offset to save GP regs from initial SP */
1164 int fp_save_offset; /* offset to save FP regs from initial SP */
1165 int lr_save_offset; /* offset to save LR from initial SP */
1166 int cr_save_offset; /* offset to save CR from initial SP */
1167 int toc_save_offset; /* offset to save the TOC pointer */
1168 int varargs_save_offset; /* offset to save the varargs registers */
1169 int main_save_offset; /* offset to save main's args */
1170 int fpmem_offset; /* offset for float/int conversion temp */
1171 int reg_size; /* register size (4 or 8) */
1172 int varargs_size; /* size to hold V.4 args passed in regs */
1173 int vars_size; /* variable save area size */
1174 int parm_size; /* outgoing parameter size */
1175 int main_size; /* size to hold saving main's args */
1176 int save_size; /* save area size */
1177 int fixed_size; /* fixed size of stack frame */
1178 int gp_size; /* size of saved GP registers */
1179 int fp_size; /* size of saved FP registers */
1180 int cr_size; /* size to hold CR if not in save_size */
1181 int lr_size; /* size to hold LR if not in save_size */
1182 int fpmem_size; /* size to hold float/int conversion */
1183 int toc_size; /* size to hold TOC if not in save_size */
1184 int total_size; /* total bytes allocated for stack */
1185 } rs6000_stack_t;
1187 /* Define this if pushing a word on the stack
1188 makes the stack pointer a smaller address. */
1189 #define STACK_GROWS_DOWNWARD
1191 /* Define this if the nominal address of the stack frame
1192 is at the high-address end of the local variables;
1193 that is, each additional local variable allocated
1194 goes at a more negative offset in the frame.
1196 On the RS/6000, we grow upwards, from the area after the outgoing
1197 arguments. */
1198 /* #define FRAME_GROWS_DOWNWARD */
1200 /* Size of the outgoing register save area */
1201 #define RS6000_REG_SAVE (TARGET_32BIT ? 32 : 64)
1203 /* Size of the fixed area on the stack */
1204 #define RS6000_SAVE_AREA (TARGET_32BIT ? 24 : 48)
1206 /* Address to save the TOC register */
1207 #define RS6000_SAVE_TOC plus_constant (stack_pointer_rtx, (TARGET_32BIT ? 20 : 40))
1209 /* Offset & size for fpmem stack locations used for converting between
1210 float and integral types. */
1211 extern int rs6000_fpmem_offset;
1212 extern int rs6000_fpmem_size;
1214 /* Size of the V.4 varargs area if needed */
1215 #define RS6000_VARARGS_AREA 0
1217 /* Whether a V.4 varargs area is needed */
1218 extern int rs6000_sysv_varargs_p;
1220 /* Align an address */
1221 #define RS6000_ALIGN(n,a) (((n) + (a) - 1) & ~((a) - 1))
1223 /* Initialize data used by insn expanders. This is called from
1224 init_emit, once for each function, before code is generated. */
1225 #define INIT_EXPANDERS rs6000_init_expanders ()
1227 /* Size of V.4 varargs area in bytes */
1228 #define RS6000_VARARGS_SIZE \
1229 ((GP_ARG_NUM_REG * (TARGET_32BIT ? 4 : 8)) + (FP_ARG_NUM_REG * 8) + 8)
1231 /* Offset of V.4 varargs area */
1232 #define RS6000_VARARGS_OFFSET \
1233 (RS6000_ALIGN (current_function_outgoing_args_size, 8) \
1234 + RS6000_SAVE_AREA)
1236 /* Offset within stack frame to start allocating local variables at.
1237 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
1238 first local allocated. Otherwise, it is the offset to the BEGINNING
1239 of the first local allocated.
1241 On the RS/6000, the frame pointer is the same as the stack pointer,
1242 except for dynamic allocations. So we start after the fixed area and
1243 outgoing parameter area. */
1245 #define STARTING_FRAME_OFFSET \
1246 (RS6000_ALIGN (current_function_outgoing_args_size, 8) \
1247 + RS6000_VARARGS_AREA \
1248 + RS6000_SAVE_AREA)
1250 /* Offset from the stack pointer register to an item dynamically
1251 allocated on the stack, e.g., by `alloca'.
1253 The default value for this macro is `STACK_POINTER_OFFSET' plus the
1254 length of the outgoing arguments. The default is correct for most
1255 machines. See `function.c' for details. */
1256 #define STACK_DYNAMIC_OFFSET(FUNDECL) \
1257 (RS6000_ALIGN (current_function_outgoing_args_size, 8) \
1258 + (STACK_POINTER_OFFSET))
1260 /* If we generate an insn to push BYTES bytes,
1261 this says how many the stack pointer really advances by.
1262 On RS/6000, don't define this because there are no push insns. */
1263 /* #define PUSH_ROUNDING(BYTES) */
1265 /* Offset of first parameter from the argument pointer register value.
1266 On the RS/6000, we define the argument pointer to the start of the fixed
1267 area. */
1268 #define FIRST_PARM_OFFSET(FNDECL) RS6000_SAVE_AREA
1270 /* Define this if stack space is still allocated for a parameter passed
1271 in a register. The value is the number of bytes allocated to this
1272 area. */
1273 #define REG_PARM_STACK_SPACE(FNDECL) RS6000_REG_SAVE
1275 /* Define this if the above stack space is to be considered part of the
1276 space allocated by the caller. */
1277 #define OUTGOING_REG_PARM_STACK_SPACE
1279 /* This is the difference between the logical top of stack and the actual sp.
1281 For the RS/6000, sp points past the fixed area. */
1282 #define STACK_POINTER_OFFSET RS6000_SAVE_AREA
1284 /* Define this if the maximum size of all the outgoing args is to be
1285 accumulated and pushed during the prologue. The amount can be
1286 found in the variable current_function_outgoing_args_size. */
1287 #define ACCUMULATE_OUTGOING_ARGS
1289 /* Value is the number of bytes of arguments automatically
1290 popped when returning from a subroutine call.
1291 FUNDECL is the declaration node of the function (as a tree),
1292 FUNTYPE is the data type of the function (as a tree),
1293 or for a library call it is an identifier node for the subroutine name.
1294 SIZE is the number of bytes of arguments passed on the stack. */
1296 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
1298 /* Define how to find the value returned by a function.
1299 VALTYPE is the data type of the value (as a tree).
1300 If the precise function being called is known, FUNC is its FUNCTION_DECL;
1301 otherwise, FUNC is 0.
1303 On RS/6000 an integer value is in r3 and a floating-point value is in
1304 fp1, unless -msoft-float. */
1306 #define FUNCTION_VALUE(VALTYPE, FUNC) \
1307 gen_rtx_REG (TYPE_MODE (VALTYPE), \
1308 TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_HARD_FLOAT ? 33 : 3)
1310 /* Define how to find the value returned by a library function
1311 assuming the value has mode MODE. */
1313 #define LIBCALL_VALUE(MODE) \
1314 gen_rtx_REG (MODE, (GET_MODE_CLASS (MODE) == MODE_FLOAT \
1315 && TARGET_HARD_FLOAT ? 33 : 3))
1317 /* The definition of this macro implies that there are cases where
1318 a scalar value cannot be returned in registers.
1320 For the RS/6000, any structure or union type is returned in memory, except for
1321 Solaris, which returns structures <= 8 bytes in registers. */
1323 #define RETURN_IN_MEMORY(TYPE) \
1324 (TYPE_MODE (TYPE) == BLKmode \
1325 && (DEFAULT_ABI != ABI_SOLARIS || int_size_in_bytes (TYPE) > 8))
1327 /* Mode of stack savearea.
1328 FUNCTION is VOIDmode because calling convention maintains SP.
1329 BLOCK needs Pmode for SP.
1330 NONLOCAL needs twice Pmode to maintain both backchain and SP. */
1331 #define STACK_SAVEAREA_MODE(MODE,LEVEL) \
1332 (LEVEL == SAVE_FUNCTION ? VOIDmode \
1333 : LEVEL == SAVE_NONLOCAL ? (TARGET_32BIT ? DImode : TImode) : Pmode)
1335 /* Minimum and maximum general purpose registers used to hold arguments. */
1336 #define GP_ARG_MIN_REG 3
1337 #define GP_ARG_MAX_REG 10
1338 #define GP_ARG_NUM_REG (GP_ARG_MAX_REG - GP_ARG_MIN_REG + 1)
1340 /* Minimum and maximum floating point registers used to hold arguments. */
1341 #define FP_ARG_MIN_REG 33
1342 #define FP_ARG_AIX_MAX_REG 45
1343 #define FP_ARG_V4_MAX_REG 40
1344 #define FP_ARG_MAX_REG FP_ARG_AIX_MAX_REG
1345 #define FP_ARG_NUM_REG (FP_ARG_MAX_REG - FP_ARG_MIN_REG + 1)
1347 /* Return registers */
1348 #define GP_ARG_RETURN GP_ARG_MIN_REG
1349 #define FP_ARG_RETURN FP_ARG_MIN_REG
1351 /* Flags for the call/call_value rtl operations set up by function_arg */
1352 #define CALL_NORMAL 0x00000000 /* no special processing */
1353 #define CALL_NT_DLLIMPORT 0x00000001 /* NT, this is a DLL import call */
1354 #define CALL_V4_CLEAR_FP_ARGS 0x00000002 /* V.4, no FP args passed */
1355 #define CALL_V4_SET_FP_ARGS 0x00000004 /* V.4, FP args were passed */
1356 #define CALL_LONG 0x00000008 /* always call indirect */
1358 /* Define cutoff for using external functions to save floating point */
1359 #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) == 62 || (FIRST_REG) == 63)
1361 /* 1 if N is a possible register number for a function value
1362 as seen by the caller.
1364 On RS/6000, this is r3 and fp1. */
1365 #define FUNCTION_VALUE_REGNO_P(N) ((N) == GP_ARG_RETURN || ((N) == FP_ARG_RETURN))
1367 /* 1 if N is a possible register number for function argument passing.
1368 On RS/6000, these are r3-r10 and fp1-fp13. */
1369 #define FUNCTION_ARG_REGNO_P(N) \
1370 (((unsigned)((N) - GP_ARG_MIN_REG) < (unsigned)(GP_ARG_NUM_REG)) \
1371 || ((unsigned)((N) - FP_ARG_MIN_REG) < (unsigned)(FP_ARG_NUM_REG)))
1374 /* Define a data type for recording info about an argument list
1375 during the scan of that argument list. This data type should
1376 hold all necessary information about the function itself
1377 and about the args processed so far, enough to enable macros
1378 such as FUNCTION_ARG to determine where the next arg should go.
1380 On the RS/6000, this is a structure. The first element is the number of
1381 total argument words, the second is used to store the next
1382 floating-point register number, and the third says how many more args we
1383 have prototype types for.
1385 The System V.4 varargs/stdarg support requires that this structure's size
1386 be a multiple of sizeof(int), and that WORDS, FREGNO, NARGS_PROTOTYPE,
1387 ORIG_NARGS, and VARARGS_OFFSET be the first five ints. */
1389 typedef struct rs6000_args
1391 int words; /* # words uses for passing GP registers */
1392 int fregno; /* next available FP register */
1393 int nargs_prototype; /* # args left in the current prototype */
1394 int orig_nargs; /* Original value of nargs_prototype */
1395 int varargs_offset; /* offset of the varargs save area */
1396 int prototype; /* Whether a prototype was defined */
1397 int call_cookie; /* Do special things for this call */
1398 } CUMULATIVE_ARGS;
1400 /* Define intermediate macro to compute the size (in registers) of an argument
1401 for the RS/6000. */
1403 #define RS6000_ARG_SIZE(MODE, TYPE, NAMED) \
1404 (! (NAMED) ? 0 \
1405 : (MODE) != BLKmode \
1406 ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \
1407 : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)
1409 /* Initialize a variable CUM of type CUMULATIVE_ARGS
1410 for a call to a function whose data type is FNTYPE.
1411 For a library call, FNTYPE is 0. */
1413 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
1414 init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE)
1416 /* Similar, but when scanning the definition of a procedure. We always
1417 set NARGS_PROTOTYPE large so we never return an EXPR_LIST. */
1419 #define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,LIBNAME) \
1420 init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE)
1422 /* Update the data in CUM to advance over an argument
1423 of mode MODE and data type TYPE.
1424 (TYPE is null for libcalls where that information may not be available.) */
1426 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
1427 function_arg_advance (&CUM, MODE, TYPE, NAMED)
1429 /* Non-zero if we can use a floating-point register to pass this arg. */
1430 #define USE_FP_FOR_ARG_P(CUM,MODE,TYPE) \
1431 (GET_MODE_CLASS (MODE) == MODE_FLOAT \
1432 && (CUM).fregno <= FP_ARG_MAX_REG \
1433 && TARGET_HARD_FLOAT)
1435 /* Determine where to put an argument to a function.
1436 Value is zero to push the argument on the stack,
1437 or a hard register in which to store the argument.
1439 MODE is the argument's machine mode.
1440 TYPE is the data type of the argument (as a tree).
1441 This is null for libcalls where that information may
1442 not be available.
1443 CUM is a variable of type CUMULATIVE_ARGS which gives info about
1444 the preceding args and about the function being called.
1445 NAMED is nonzero if this argument is a named parameter
1446 (otherwise it is an extra parameter matching an ellipsis).
1448 On RS/6000 the first eight words of non-FP are normally in registers
1449 and the rest are pushed. The first 13 FP args are in registers.
1451 If this is floating-point and no prototype is specified, we use
1452 both an FP and integer register (or possibly FP reg and stack). Library
1453 functions (when TYPE is zero) always have the proper types for args,
1454 so we can pass the FP value just in one register. emit_library_function
1455 doesn't support EXPR_LIST anyway. */
1457 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
1458 function_arg (&CUM, MODE, TYPE, NAMED)
1460 /* For an arg passed partly in registers and partly in memory,
1461 this is the number of registers used.
1462 For args passed entirely in registers or entirely in memory, zero. */
1464 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
1465 function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
1467 /* A C expression that indicates when an argument must be passed by
1468 reference. If nonzero for an argument, a copy of that argument is
1469 made in memory and a pointer to the argument is passed instead of
1470 the argument itself. The pointer is passed in whatever way is
1471 appropriate for passing a pointer to that type. */
1473 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
1474 function_arg_pass_by_reference(&CUM, MODE, TYPE, NAMED)
1476 /* If defined, a C expression which determines whether, and in which
1477 direction, to pad out an argument with extra space. The value
1478 should be of type `enum direction': either `upward' to pad above
1479 the argument, `downward' to pad below, or `none' to inhibit
1480 padding. */
1482 #define FUNCTION_ARG_PADDING(MODE, TYPE) \
1483 (enum direction) function_arg_padding (MODE, TYPE)
1485 /* If defined, a C expression that gives the alignment boundary, in bits,
1486 of an argument with the specified mode and type. If it is not defined,
1487 PARM_BOUNDARY is used for all arguments. */
1489 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
1490 function_arg_boundary (MODE, TYPE)
1492 /* Perform any needed actions needed for a function that is receiving a
1493 variable number of arguments.
1495 CUM is as above.
1497 MODE and TYPE are the mode and type of the current parameter.
1499 PRETEND_SIZE is a variable that should be set to the amount of stack
1500 that must be pushed by the prolog to pretend that our caller pushed
1503 Normally, this macro will push all remaining incoming registers on the
1504 stack and set PRETEND_SIZE to the length of the registers pushed. */
1506 #define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \
1507 setup_incoming_varargs (&CUM, MODE, TYPE, &PRETEND_SIZE, NO_RTL)
1509 /* If defined, is a C expression that produces the machine-specific
1510 code for a call to `__builtin_saveregs'. This code will be moved
1511 to the very beginning of the function, before any parameter access
1512 are made. The return value of this function should be an RTX that
1513 contains the value to use as the return of `__builtin_saveregs'.
1515 The argument ARGS is a `tree_list' containing the arguments that
1516 were passed to `__builtin_saveregs'.
1518 If this macro is not defined, the compiler will output an ordinary
1519 call to the library function `__builtin_saveregs'. */
1521 #define EXPAND_BUILTIN_SAVEREGS(ARGS) \
1522 expand_builtin_saveregs (ARGS)
1524 /* This macro generates the assembly code for function entry.
1525 FILE is a stdio stream to output the code to.
1526 SIZE is an int: how many units of temporary storage to allocate.
1527 Refer to the array `regs_ever_live' to determine which registers
1528 to save; `regs_ever_live[I]' is nonzero if register number I
1529 is ever used in the function. This macro is responsible for
1530 knowing which registers should not be saved even if used. */
1532 #define FUNCTION_PROLOGUE(FILE, SIZE) output_prolog (FILE, SIZE)
1534 /* Output assembler code to FILE to increment profiler label # LABELNO
1535 for profiling a function entry. */
1537 #define FUNCTION_PROFILER(FILE, LABELNO) \
1538 output_function_profiler ((FILE), (LABELNO));
1540 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
1541 the stack pointer does not matter. No definition is equivalent to
1542 always zero.
1544 On the RS/6000, this is non-zero because we can restore the stack from
1545 its backpointer, which we maintain. */
1546 #define EXIT_IGNORE_STACK 1
1548 /* This macro generates the assembly code for function exit,
1549 on machines that need it. If FUNCTION_EPILOGUE is not defined
1550 then individual return instructions are generated for each
1551 return statement. Args are same as for FUNCTION_PROLOGUE.
1553 The function epilogue should not depend on the current stack pointer!
1554 It should use the frame pointer only. This is mandatory because
1555 of alloca; we also take advantage of it to omit stack adjustments
1556 before returning. */
1558 #define FUNCTION_EPILOGUE(FILE, SIZE) output_epilog (FILE, SIZE)
1560 /* TRAMPOLINE_TEMPLATE deleted */
1562 /* Length in units of the trampoline for entering a nested function. */
1564 #define TRAMPOLINE_SIZE rs6000_trampoline_size ()
1566 /* Emit RTL insns to initialize the variable parts of a trampoline.
1567 FNADDR is an RTX for the address of the function's pure code.
1568 CXT is an RTX for the static chain value for the function. */
1570 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \
1571 rs6000_initialize_trampoline (ADDR, FNADDR, CXT)
1573 /* If defined, a C expression whose value is nonzero if IDENTIFIER
1574 with arguments ARGS is a valid machine specific attribute for DECL.
1575 The attributes in ATTRIBUTES have previously been assigned to DECL. */
1577 #define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, NAME, ARGS) \
1578 (rs6000_valid_decl_attribute_p (DECL, ATTRIBUTES, NAME, ARGS))
1580 /* If defined, a C expression whose value is nonzero if IDENTIFIER
1581 with arguments ARGS is a valid machine specific attribute for TYPE.
1582 The attributes in ATTRIBUTES have previously been assigned to TYPE. */
1584 #define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, NAME, ARGS) \
1585 (rs6000_valid_type_attribute_p (TYPE, ATTRIBUTES, NAME, ARGS))
1587 /* If defined, a C expression whose value is zero if the attributes on
1588 TYPE1 and TYPE2 are incompatible, one if they are compatible, and
1589 two if they are nearly compatible (which causes a warning to be
1590 generated). */
1592 #define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) \
1593 (rs6000_comp_type_attributes (TYPE1, TYPE2))
1595 /* If defined, a C statement that assigns default attributes to newly
1596 defined TYPE. */
1598 #define SET_DEFAULT_TYPE_ATTRIBUTES(TYPE) \
1599 (rs6000_set_default_type_attributes (TYPE))
1602 /* Definitions for __builtin_return_address and __builtin_frame_address.
1603 __builtin_return_address (0) should give link register (65), enable
1604 this. */
1605 /* This should be uncommented, so that the link register is used, but
1606 currently this would result in unmatched insns and spilling fixed
1607 registers so we'll leave it for another day. When these problems are
1608 taken care of one additional fetch will be necessary in RETURN_ADDR_RTX.
1609 (mrs) */
1610 /* #define RETURN_ADDR_IN_PREVIOUS_FRAME */
1612 /* Number of bytes into the frame return addresses can be found. See
1613 rs6000_stack_info in rs6000.c for more information on how the different
1614 abi's store the return address. */
1615 #define RETURN_ADDRESS_OFFSET \
1616 ((DEFAULT_ABI == ABI_AIX \
1617 || DEFAULT_ABI == ABI_AIX_NODESC) ? 8 : \
1618 (DEFAULT_ABI == ABI_V4 \
1619 || DEFAULT_ABI == ABI_SOLARIS) ? (TARGET_32BIT ? 4 : 8) : \
1620 (DEFAULT_ABI == ABI_NT) ? -4 : \
1621 (fatal ("RETURN_ADDRESS_OFFSET not supported"), 0))
1623 /* The current return address is in link register (65). The return address
1624 of anything farther back is accessed normally at an offset of 8 from the
1625 frame pointer. */
1626 #define RETURN_ADDR_RTX(count, frame) \
1627 ((count == -1) \
1628 ? gen_rtx_REG (Pmode, 65) \
1629 : gen_rtx_MEM (Pmode, \
1630 memory_address \
1631 (Pmode, \
1632 plus_constant (copy_to_reg \
1633 (gen_rtx_MEM (Pmode, \
1634 memory_address (Pmode, \
1635 frame))), \
1636 RETURN_ADDRESS_OFFSET))))
1638 /* Definitions for register eliminations.
1640 We have two registers that can be eliminated on the RS/6000. First, the
1641 frame pointer register can often be eliminated in favor of the stack
1642 pointer register. Secondly, the argument pointer register can always be
1643 eliminated; it is replaced with either the stack or frame pointer.
1645 In addition, we use the elimination mechanism to see if r30 is needed
1646 Initially we assume that it isn't. If it is, we spill it. This is done
1647 by making it an eliminable register. We replace it with itself so that
1648 if it isn't needed, then existing uses won't be modified. */
1650 /* This is an array of structures. Each structure initializes one pair
1651 of eliminable registers. The "from" register number is given first,
1652 followed by "to". Eliminations of the same "from" register are listed
1653 in order of preference. */
1654 #define ELIMINABLE_REGS \
1655 {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1656 { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1657 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
1658 { 30, 30} }
1660 /* Given FROM and TO register numbers, say whether this elimination is allowed.
1661 Frame pointer elimination is automatically handled.
1663 For the RS/6000, if frame pointer elimination is being done, we would like
1664 to convert ap into fp, not sp.
1666 We need r30 if -mminimal-toc was specified, and there are constant pool
1667 references. */
1669 #define CAN_ELIMINATE(FROM, TO) \
1670 ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \
1671 ? ! frame_pointer_needed \
1672 : (FROM) == 30 ? ! TARGET_MINIMAL_TOC || TARGET_NO_TOC || get_pool_size () == 0 \
1673 : 1)
1675 /* Define the offset between two registers, one to be eliminated, and the other
1676 its replacement, at the start of a routine. */
1677 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1679 rs6000_stack_t *info = rs6000_stack_info (); \
1681 if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
1682 (OFFSET) = (info->push_p) ? 0 : - info->total_size; \
1683 else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \
1684 (OFFSET) = info->total_size; \
1685 else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
1686 (OFFSET) = (info->push_p) ? info->total_size : 0; \
1687 else if ((FROM) == 30) \
1688 (OFFSET) = 0; \
1689 else \
1690 abort (); \
1693 /* Addressing modes, and classification of registers for them. */
1695 /* #define HAVE_POST_INCREMENT */
1696 /* #define HAVE_POST_DECREMENT */
1698 #define HAVE_PRE_DECREMENT
1699 #define HAVE_PRE_INCREMENT
1701 /* Macros to check register numbers against specific register classes. */
1703 /* These assume that REGNO is a hard or pseudo reg number.
1704 They give nonzero only if REGNO is a hard reg of the suitable class
1705 or a pseudo reg currently allocated to a suitable hard reg.
1706 Since they use reg_renumber, they are safe only once reg_renumber
1707 has been allocated, which happens in local-alloc.c. */
1709 #define REGNO_OK_FOR_INDEX_P(REGNO) \
1710 ((REGNO) < FIRST_PSEUDO_REGISTER \
1711 ? (REGNO) <= 31 || (REGNO) == 67 \
1712 : (reg_renumber[REGNO] >= 0 \
1713 && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67)))
1715 #define REGNO_OK_FOR_BASE_P(REGNO) \
1716 ((REGNO) < FIRST_PSEUDO_REGISTER \
1717 ? ((REGNO) > 0 && (REGNO) <= 31) || (REGNO) == 67 \
1718 : (reg_renumber[REGNO] > 0 \
1719 && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67)))
1721 /* Maximum number of registers that can appear in a valid memory address. */
1723 #define MAX_REGS_PER_ADDRESS 2
1725 /* Recognize any constant value that is a valid address. */
1727 #define CONSTANT_ADDRESS_P(X) \
1728 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
1729 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
1730 || GET_CODE (X) == HIGH)
1732 /* Nonzero if the constant value X is a legitimate general operand.
1733 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.
1735 On the RS/6000, all integer constants are acceptable, most won't be valid
1736 for particular insns, though. Only easy FP constants are
1737 acceptable. */
1739 #define LEGITIMATE_CONSTANT_P(X) \
1740 (GET_CODE (X) != CONST_DOUBLE || GET_MODE (X) == VOIDmode \
1741 || (TARGET_POWERPC64 && GET_MODE (X) == DImode) \
1742 || easy_fp_constant (X, GET_MODE (X)))
1744 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
1745 and check its validity for a certain class.
1746 We have two alternate definitions for each of them.
1747 The usual definition accepts all pseudo regs; the other rejects
1748 them unless they have been allocated suitable hard regs.
1749 The symbol REG_OK_STRICT causes the latter definition to be used.
1751 Most source files want to accept pseudo regs in the hope that
1752 they will get allocated to the class that the insn wants them to be in.
1753 Source files for reload pass need to be strict.
1754 After reload, it makes no difference, since pseudo regs have
1755 been eliminated by then. */
1757 #ifndef REG_OK_STRICT
1759 /* Nonzero if X is a hard reg that can be used as an index
1760 or if it is a pseudo reg. */
1761 #define REG_OK_FOR_INDEX_P(X) \
1762 (REGNO (X) <= 31 || REGNO (X) == 67 || REGNO (X) >= FIRST_PSEUDO_REGISTER)
1764 /* Nonzero if X is a hard reg that can be used as a base reg
1765 or if it is a pseudo reg. */
1766 #define REG_OK_FOR_BASE_P(X) \
1767 (REGNO (X) > 0 && REG_OK_FOR_INDEX_P (X))
1769 #else
1771 /* Nonzero if X is a hard reg that can be used as an index. */
1772 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
1773 /* Nonzero if X is a hard reg that can be used as a base reg. */
1774 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
1776 #endif
1778 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
1779 that is a valid memory address for an instruction.
1780 The MODE argument is the machine mode for the MEM expression
1781 that wants to use this address.
1783 On the RS/6000, there are four valid address: a SYMBOL_REF that
1784 refers to a constant pool entry of an address (or the sum of it
1785 plus a constant), a short (16-bit signed) constant plus a register,
1786 the sum of two registers, or a register indirect, possibly with an
1787 auto-increment. For DFmode and DImode with an constant plus register,
1788 we must ensure that both words are addressable or PowerPC64 with offset
1789 word aligned. */
1791 #define LEGITIMATE_CONSTANT_POOL_BASE_P(X) \
1792 (TARGET_TOC && GET_CODE (X) == SYMBOL_REF \
1793 && CONSTANT_POOL_ADDRESS_P (X) \
1794 && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (X)))
1796 /* AIX64 guaranteed to have 64 bit TOC alignment. */
1797 #define LEGITIMATE_CONSTANT_POOL_ADDRESS_P(X) \
1798 (LEGITIMATE_CONSTANT_POOL_BASE_P (X) \
1799 || (TARGET_TOC \
1800 && GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
1801 && GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT \
1802 && LEGITIMATE_CONSTANT_POOL_BASE_P (XEXP (XEXP (X, 0), 0))))
1804 #define LEGITIMATE_SMALL_DATA_P(MODE, X) \
1805 ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) \
1806 && !flag_pic && !TARGET_TOC \
1807 && (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == CONST) \
1808 && small_data_operand (X, MODE))
1810 #define LEGITIMATE_ADDRESS_INTEGER_P(X,OFFSET) \
1811 (GET_CODE (X) == CONST_INT \
1812 && (unsigned HOST_WIDE_INT) (INTVAL (X) + (OFFSET) + 0x8000) < 0x10000)
1814 #define LEGITIMATE_OFFSET_ADDRESS_P(MODE,X) \
1815 (GET_CODE (X) == PLUS \
1816 && GET_CODE (XEXP (X, 0)) == REG \
1817 && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
1818 && LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 0) \
1819 && (((MODE) != DFmode && (MODE) != DImode) \
1820 || (TARGET_32BIT \
1821 ? LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 4) \
1822 : ! (INTVAL (XEXP (X, 1)) & 3))) \
1823 && ((MODE) != TImode \
1824 || (TARGET_32BIT \
1825 ? LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 12) \
1826 : (LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 8) \
1827 && ! (INTVAL (XEXP (X, 1)) & 3)))))
1829 #define LEGITIMATE_INDEXED_ADDRESS_P(X) \
1830 (GET_CODE (X) == PLUS \
1831 && GET_CODE (XEXP (X, 0)) == REG \
1832 && GET_CODE (XEXP (X, 1)) == REG \
1833 && ((REG_OK_FOR_BASE_P (XEXP (X, 0)) \
1834 && REG_OK_FOR_INDEX_P (XEXP (X, 1))) \
1835 || (REG_OK_FOR_BASE_P (XEXP (X, 1)) \
1836 && REG_OK_FOR_INDEX_P (XEXP (X, 0)))))
1838 #define LEGITIMATE_INDIRECT_ADDRESS_P(X) \
1839 (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X))
1841 #define LEGITIMATE_LO_SUM_ADDRESS_P(MODE, X) \
1842 (TARGET_ELF \
1843 && !flag_pic && !TARGET_TOC \
1844 && (MODE) != DImode \
1845 && (MODE) != TImode \
1846 && (TARGET_HARD_FLOAT || (MODE) != DFmode) \
1847 && GET_CODE (X) == LO_SUM \
1848 && GET_CODE (XEXP (X, 0)) == REG \
1849 && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
1850 && CONSTANT_P (XEXP (X, 1)))
1852 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
1853 { if (LEGITIMATE_INDIRECT_ADDRESS_P (X)) \
1854 goto ADDR; \
1855 if ((GET_CODE (X) == PRE_INC || GET_CODE (X) == PRE_DEC) \
1856 && TARGET_UPDATE \
1857 && LEGITIMATE_INDIRECT_ADDRESS_P (XEXP (X, 0))) \
1858 goto ADDR; \
1859 if (LEGITIMATE_SMALL_DATA_P (MODE, X)) \
1860 goto ADDR; \
1861 if (LEGITIMATE_CONSTANT_POOL_ADDRESS_P (X)) \
1862 goto ADDR; \
1863 if (LEGITIMATE_OFFSET_ADDRESS_P (MODE, X)) \
1864 goto ADDR; \
1865 if ((MODE) != TImode \
1866 && (TARGET_HARD_FLOAT || TARGET_64BIT || (MODE) != DFmode) \
1867 && (TARGET_64BIT || (MODE) != DImode) \
1868 && LEGITIMATE_INDEXED_ADDRESS_P (X)) \
1869 goto ADDR; \
1870 if (LEGITIMATE_LO_SUM_ADDRESS_P (MODE, X)) \
1871 goto ADDR; \
1874 /* Try machine-dependent ways of modifying an illegitimate address
1875 to be legitimate. If we find one, return the new, valid address.
1876 This macro is used in only one place: `memory_address' in explow.c.
1878 OLDX is the address as it was before break_out_memory_refs was called.
1879 In some cases it is useful to look at this to decide what needs to be done.
1881 MODE and WIN are passed so that this macro can use
1882 GO_IF_LEGITIMATE_ADDRESS.
1884 It is always safe for this macro to do nothing. It exists to recognize
1885 opportunities to optimize the output.
1887 On RS/6000, first check for the sum of a register with a constant
1888 integer that is out of range. If so, generate code to add the
1889 constant with the low-order 16 bits masked to the register and force
1890 this result into another register (this can be done with `cau').
1891 Then generate an address of REG+(CONST&0xffff), allowing for the
1892 possibility of bit 16 being a one.
1894 Then check for the sum of a register and something not constant, try to
1895 load the other things into a register and return the sum. */
1897 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
1898 { if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \
1899 && GET_CODE (XEXP (X, 1)) == CONST_INT \
1900 && (unsigned HOST_WIDE_INT) (INTVAL (XEXP (X, 1)) + 0x8000) >= 0x10000) \
1901 { HOST_WIDE_INT high_int, low_int; \
1902 rtx sum; \
1903 high_int = INTVAL (XEXP (X, 1)) & (~ (HOST_WIDE_INT) 0xffff); \
1904 low_int = INTVAL (XEXP (X, 1)) & 0xffff; \
1905 if (low_int & 0x8000) \
1906 high_int += 0x10000, low_int |= ((HOST_WIDE_INT) -1) << 16; \
1907 sum = force_operand (gen_rtx_PLUS (Pmode, XEXP (X, 0), \
1908 GEN_INT (high_int)), 0); \
1909 (X) = gen_rtx_PLUS (Pmode, sum, GEN_INT (low_int)); \
1910 goto WIN; \
1912 else if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \
1913 && GET_CODE (XEXP (X, 1)) != CONST_INT \
1914 && (TARGET_HARD_FLOAT || TARGET_64BIT || (MODE) != DFmode) \
1915 && (TARGET_64BIT || (MODE) != DImode) \
1916 && (MODE) != TImode) \
1918 (X) = gen_rtx_PLUS (Pmode, XEXP (X, 0), \
1919 force_reg (Pmode, force_operand (XEXP (X, 1), 0))); \
1920 goto WIN; \
1922 else if (TARGET_ELF && TARGET_32BIT && TARGET_NO_TOC \
1923 && !flag_pic \
1924 && GET_CODE (X) != CONST_INT \
1925 && GET_CODE (X) != CONST_DOUBLE && CONSTANT_P (X) \
1926 && (TARGET_HARD_FLOAT || (MODE) != DFmode) \
1927 && (MODE) != DImode && (MODE) != TImode) \
1929 rtx reg = gen_reg_rtx (Pmode); \
1930 emit_insn (gen_elf_high (reg, (X))); \
1931 (X) = gen_rtx_LO_SUM (Pmode, reg, (X)); \
1935 /* Go to LABEL if ADDR (a legitimate address expression)
1936 has an effect that depends on the machine mode it is used for.
1938 On the RS/6000 this is true if the address is valid with a zero offset
1939 but not with an offset of four (this means it cannot be used as an
1940 address for DImode or DFmode) or is a pre-increment or decrement. Since
1941 we know it is valid, we just check for an address that is not valid with
1942 an offset of four. */
1944 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
1945 { if (GET_CODE (ADDR) == PLUS \
1946 && LEGITIMATE_ADDRESS_INTEGER_P (XEXP (ADDR, 1), 0) \
1947 && ! LEGITIMATE_ADDRESS_INTEGER_P (XEXP (ADDR, 1), \
1948 (TARGET_32BIT ? 4 : 8))) \
1949 goto LABEL; \
1950 if (TARGET_UPDATE && GET_CODE (ADDR) == PRE_INC) \
1951 goto LABEL; \
1952 if (TARGET_UPDATE && GET_CODE (ADDR) == PRE_DEC) \
1953 goto LABEL; \
1954 if (GET_CODE (ADDR) == LO_SUM) \
1955 goto LABEL; \
1958 /* The register number of the register used to address a table of
1959 static data addresses in memory. In some cases this register is
1960 defined by a processor's "application binary interface" (ABI).
1961 When this macro is defined, RTL is generated for this register
1962 once, as with the stack pointer and frame pointer registers. If
1963 this macro is not defined, it is up to the machine-dependent files
1964 to allocate such a register (if necessary). */
1966 /* #define PIC_OFFSET_TABLE_REGNUM */
1968 /* Define this macro if the register defined by
1969 `PIC_OFFSET_TABLE_REGNUM' is clobbered by calls. Do not define
1970 this macro if `PPIC_OFFSET_TABLE_REGNUM' is not defined. */
1972 /* #define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED */
1974 /* By generating position-independent code, when two different
1975 programs (A and B) share a common library (libC.a), the text of
1976 the library can be shared whether or not the library is linked at
1977 the same address for both programs. In some of these
1978 environments, position-independent code requires not only the use
1979 of different addressing modes, but also special code to enable the
1980 use of these addressing modes.
1982 The `FINALIZE_PIC' macro serves as a hook to emit these special
1983 codes once the function is being compiled into assembly code, but
1984 not before. (It is not done before, because in the case of
1985 compiling an inline function, it would lead to multiple PIC
1986 prologues being included in functions which used inline functions
1987 and were compiled to assembly language.) */
1989 #define FINALIZE_PIC rs6000_finalize_pic ()
1991 /* A C expression that is nonzero if X is a legitimate immediate
1992 operand on the target machine when generating position independent
1993 code. You can assume that X satisfies `CONSTANT_P', so you need
1994 not check this. You can also assume FLAG_PIC is true, so you need
1995 not check it either. You need not define this macro if all
1996 constants (including `SYMBOL_REF') can be immediate operands when
1997 generating position independent code. */
1999 /* #define LEGITIMATE_PIC_OPERAND_P (X) */
2001 /* In rare cases, correct code generation requires extra machine
2002 dependent processing between the second jump optimization pass and
2003 delayed branch scheduling. On those machines, define this macro
2004 as a C statement to act on the code starting at INSN.
2006 On the RS/6000, we use it to make sure the GOT_TOC register marker
2007 that FINALIZE_PIC is supposed to remove actually got removed. */
2009 #define MACHINE_DEPENDENT_REORG(INSN) rs6000_reorg (INSN)
2012 /* Define this if some processing needs to be done immediately before
2013 emitting code for an insn. */
2015 /* #define FINAL_PRESCAN_INSN(INSN,OPERANDS,NOPERANDS) */
2017 /* Specify the machine mode that this machine uses
2018 for the index in the tablejump instruction. */
2019 #define CASE_VECTOR_MODE (TARGET_32BIT ? SImode : DImode)
2021 /* Define this if the tablejump instruction expects the table
2022 to contain offsets from the address of the table.
2023 Do not define this if the table should contain absolute addresses. */
2024 #define CASE_VECTOR_PC_RELATIVE
2026 /* Specify the tree operation to be used to convert reals to integers. */
2027 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
2029 /* This is the kind of divide that is easiest to do in the general case. */
2030 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
2032 /* Define this as 1 if `char' should by default be signed; else as 0. */
2033 #define DEFAULT_SIGNED_CHAR 0
2035 /* This flag, if defined, says the same insns that convert to a signed fixnum
2036 also convert validly to an unsigned one. */
2038 /* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC */
2040 /* Max number of bytes we can move from memory to memory
2041 in one reasonably fast instruction. */
2042 #define MOVE_MAX (! TARGET_POWERPC64 ? 4 : 8)
2043 #define MAX_MOVE_MAX 8
2045 /* Nonzero if access to memory by bytes is no faster than for words.
2046 Also non-zero if doing byte operations (specifically shifts) in registers
2047 is undesirable. */
2048 #define SLOW_BYTE_ACCESS 1
2050 /* Define if operations between registers always perform the operation
2051 on the full register even if a narrower mode is specified. */
2052 #define WORD_REGISTER_OPERATIONS
2054 /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
2055 will either zero-extend or sign-extend. The value of this macro should
2056 be the code that says which one of the two operations is implicitly
2057 done, NIL if none. */
2058 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
2060 /* Define if loading short immediate values into registers sign extends. */
2061 #define SHORT_IMMEDIATES_SIGN_EXTEND
2063 /* The RS/6000 uses the XCOFF format. */
2065 #define XCOFF_DEBUGGING_INFO
2067 /* Define if the object format being used is COFF or a superset. */
2068 #define OBJECT_FORMAT_COFF
2070 /* Define the magic numbers that we recognize as COFF.
2071 AIX 4.3 adds U803XTOCMAGIC (0757) for 64-bit objects, but collect2.c
2072 does not include files in the correct order to conditionally define
2073 the symbolic name in this macro. */
2074 #define MY_ISCOFF(magic) \
2075 ((magic) == U802WRMAGIC || (magic) == U802ROMAGIC \
2076 || (magic) == U802TOCMAGIC || (magic) == 0757)
2078 /* This is the only version of nm that collect2 can work with. */
2079 #define REAL_NM_FILE_NAME "/usr/ucb/nm"
2081 /* We don't have GAS for the RS/6000 yet, so don't write out special
2082 .stabs in cc1plus. */
2084 #define FASCIST_ASSEMBLER
2086 /* AIX does not have any init/fini or ctor/dtor sections, so create
2087 static constructors and destructors as normal functions. */
2088 /* #define ASM_OUTPUT_CONSTRUCTOR(file, name) */
2089 /* #define ASM_OUTPUT_DESTRUCTOR(file, name) */
2091 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
2092 is done just by pretending it is already truncated. */
2093 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
2095 /* Specify the machine mode that pointers have.
2096 After generation of rtl, the compiler makes no further distinction
2097 between pointers and any other objects of this machine mode. */
2098 #define Pmode (TARGET_32BIT ? SImode : DImode)
2100 /* Mode of a function address in a call instruction (for indexing purposes).
2101 Doesn't matter on RS/6000. */
2102 #define FUNCTION_MODE (TARGET_32BIT ? SImode : DImode)
2104 /* Define this if addresses of constant functions
2105 shouldn't be put through pseudo regs where they can be cse'd.
2106 Desirable on machines where ordinary constants are expensive
2107 but a CALL with constant address is cheap. */
2108 #define NO_FUNCTION_CSE
2110 /* Define this to be nonzero if shift instructions ignore all but the low-order
2111 few bits.
2113 The sle and sre instructions which allow SHIFT_COUNT_TRUNCATED
2114 have been dropped from the PowerPC architecture. */
2116 #define SHIFT_COUNT_TRUNCATED (TARGET_POWER ? 1 : 0)
2118 /* Use atexit for static constructors/destructors, instead of defining
2119 our own exit function. */
2120 #define HAVE_ATEXIT
2122 /* Compute the cost of computing a constant rtl expression RTX
2123 whose rtx-code is CODE. The body of this macro is a portion
2124 of a switch statement. If the code is computed here,
2125 return it with a return statement. Otherwise, break from the switch.
2127 On the RS/6000, if it is valid in the insn, it is free. So this
2128 always returns 0. */
2130 #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
2131 case CONST_INT: \
2132 case CONST: \
2133 case LABEL_REF: \
2134 case SYMBOL_REF: \
2135 case CONST_DOUBLE: \
2136 case HIGH: \
2137 return 0;
2139 /* Provide the costs of a rtl expression. This is in the body of a
2140 switch on CODE. */
2142 #define RTX_COSTS(X,CODE,OUTER_CODE) \
2143 case PLUS: \
2144 return ((GET_CODE (XEXP (X, 1)) == CONST_INT \
2145 && ((unsigned HOST_WIDE_INT) (INTVAL (XEXP (X, 1)) \
2146 + 0x8000) >= 0x10000) \
2147 && (INTVAL (XEXP (X, 1)) & 0xffff != 0)) \
2148 ? COSTS_N_INSNS (2) \
2149 : COSTS_N_INSNS (1)); \
2150 case AND: \
2151 case IOR: \
2152 case XOR: \
2153 return ((GET_CODE (XEXP (X, 1)) == CONST_INT \
2154 && (INTVAL (XEXP (X, 1)) & (~ (HOST_WIDE_INT) 0xffff)) != 0 \
2155 && (INTVAL (XEXP (X, 1)) & 0xffff != 0)) \
2156 ? COSTS_N_INSNS (2) \
2157 : COSTS_N_INSNS (1)); \
2158 case MULT: \
2159 switch (rs6000_cpu) \
2161 case PROCESSOR_RIOS1: \
2162 return (GET_CODE (XEXP (X, 1)) != CONST_INT \
2163 ? COSTS_N_INSNS (5) \
2164 : INTVAL (XEXP (X, 1)) >= -256 && INTVAL (XEXP (X, 1)) <= 255 \
2165 ? COSTS_N_INSNS (3) : COSTS_N_INSNS (4)); \
2166 case PROCESSOR_RIOS2: \
2167 case PROCESSOR_MPCCORE: \
2168 return COSTS_N_INSNS (2); \
2169 case PROCESSOR_PPC601: \
2170 return COSTS_N_INSNS (5); \
2171 case PROCESSOR_PPC603: \
2172 return (GET_CODE (XEXP (X, 1)) != CONST_INT \
2173 ? COSTS_N_INSNS (5) \
2174 : INTVAL (XEXP (X, 1)) >= -256 && INTVAL (XEXP (X, 1)) <= 255 \
2175 ? COSTS_N_INSNS (2) : COSTS_N_INSNS (3)); \
2176 case PROCESSOR_PPC403: \
2177 case PROCESSOR_PPC604: \
2178 case PROCESSOR_PPC620: \
2179 return COSTS_N_INSNS (4); \
2181 case DIV: \
2182 case MOD: \
2183 if (GET_CODE (XEXP (X, 1)) == CONST_INT \
2184 && exact_log2 (INTVAL (XEXP (X, 1))) >= 0) \
2185 return COSTS_N_INSNS (2); \
2186 /* otherwise fall through to normal divide. */ \
2187 case UDIV: \
2188 case UMOD: \
2189 switch (rs6000_cpu) \
2191 case PROCESSOR_RIOS1: \
2192 return COSTS_N_INSNS (19); \
2193 case PROCESSOR_RIOS2: \
2194 return COSTS_N_INSNS (13); \
2195 case PROCESSOR_MPCCORE: \
2196 return COSTS_N_INSNS (6); \
2197 case PROCESSOR_PPC403: \
2198 return COSTS_N_INSNS (33); \
2199 case PROCESSOR_PPC601: \
2200 return COSTS_N_INSNS (36); \
2201 case PROCESSOR_PPC603: \
2202 return COSTS_N_INSNS (37); \
2203 case PROCESSOR_PPC604: \
2204 case PROCESSOR_PPC620: \
2205 return COSTS_N_INSNS (20); \
2207 case FFS: \
2208 return COSTS_N_INSNS (4); \
2209 case MEM: \
2210 /* MEM should be slightly more expensive than (plus (reg) (const)) */ \
2211 return 5;
2213 /* Compute the cost of an address. This is meant to approximate the size
2214 and/or execution delay of an insn using that address. If the cost is
2215 approximated by the RTL complexity, including CONST_COSTS above, as
2216 is usually the case for CISC machines, this macro should not be defined.
2217 For aggressively RISCy machines, only one insn format is allowed, so
2218 this macro should be a constant. The value of this macro only matters
2219 for valid addresses.
2221 For the RS/6000, everything is cost 0. */
2223 #define ADDRESS_COST(RTX) 0
2225 /* Adjust the length of an INSN. LENGTH is the currently-computed length and
2226 should be adjusted to reflect any required changes. This macro is used when
2227 there is some systematic length adjustment required that would be difficult
2228 to express in the length attribute. */
2230 /* #define ADJUST_INSN_LENGTH(X,LENGTH) */
2232 /* Add any extra modes needed to represent the condition code.
2234 For the RS/6000, we need separate modes when unsigned (logical) comparisons
2235 are being done and we need a separate mode for floating-point. We also
2236 use a mode for the case when we are comparing the results of two
2237 comparisons. */
2239 #define EXTRA_CC_MODES CCUNSmode, CCFPmode, CCEQmode
2241 /* Define the names for the modes specified above. */
2242 #define EXTRA_CC_NAMES "CCUNS", "CCFP", "CCEQ"
2244 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
2245 return the mode to be used for the comparison. For floating-point, CCFPmode
2246 should be used. CCUNSmode should be used for unsigned comparisons.
2247 CCEQmode should be used when we are doing an inequality comparison on
2248 the result of a comparison. CCmode should be used in all other cases. */
2250 #define SELECT_CC_MODE(OP,X,Y) \
2251 (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? CCFPmode \
2252 : (OP) == GTU || (OP) == LTU || (OP) == GEU || (OP) == LEU ? CCUNSmode \
2253 : (((OP) == EQ || (OP) == NE) && GET_RTX_CLASS (GET_CODE (X)) == '<' \
2254 ? CCEQmode : CCmode))
2256 /* Define the information needed to generate branch and scc insns. This is
2257 stored from the compare operation. Note that we can't use "rtx" here
2258 since it hasn't been defined! */
2260 extern struct rtx_def *rs6000_compare_op0, *rs6000_compare_op1;
2261 extern int rs6000_compare_fp_p;
2263 /* Set to non-zero by "fix" operation to indicate that itrunc and
2264 uitrunc must be defined. */
2266 extern int rs6000_trunc_used;
2268 /* Function names to call to do floating point truncation. */
2270 #define RS6000_ITRUNC "__itrunc"
2271 #define RS6000_UITRUNC "__uitrunc"
2273 /* Prefix and suffix to use to saving floating point */
2274 #ifndef SAVE_FP_PREFIX
2275 #define SAVE_FP_PREFIX "._savef"
2276 #define SAVE_FP_SUFFIX ""
2277 #endif
2279 /* Prefix and suffix to use to restoring floating point */
2280 #ifndef RESTORE_FP_PREFIX
2281 #define RESTORE_FP_PREFIX "._restf"
2282 #define RESTORE_FP_SUFFIX ""
2283 #endif
2285 /* Function name to call to do profiling. */
2286 #define RS6000_MCOUNT ".__mcount"
2289 /* Control the assembler format that we output. */
2291 /* A C string constant describing how to begin a comment in the target
2292 assembler language. The compiler assumes that the comment will end at
2293 the end of the line. */
2294 #define ASM_COMMENT_START " #"
2296 /* Output at beginning of assembler file.
2298 Initialize the section names for the RS/6000 at this point.
2300 Specify filename to assembler.
2302 We want to go into the TOC section so at least one .toc will be emitted.
2303 Also, in order to output proper .bs/.es pairs, we need at least one static
2304 [RW] section emitted.
2306 We then switch back to text to force the gcc2_compiled. label and the space
2307 allocated after it (when profiling) into the text section.
2309 Finally, declare mcount when profiling to make the assembler happy. */
2311 #define ASM_FILE_START(FILE) \
2313 rs6000_gen_section_name (&xcoff_bss_section_name, \
2314 main_input_filename, ".bss_"); \
2315 rs6000_gen_section_name (&xcoff_private_data_section_name, \
2316 main_input_filename, ".rw_"); \
2317 rs6000_gen_section_name (&xcoff_read_only_section_name, \
2318 main_input_filename, ".ro_"); \
2320 output_file_directive (FILE, main_input_filename); \
2321 if (TARGET_64BIT) \
2322 fputs ("\t.machine\t\"ppc64\"\n", FILE); \
2323 toc_section (); \
2324 if (write_symbols != NO_DEBUG) \
2325 private_data_section (); \
2326 text_section (); \
2327 if (profile_flag) \
2328 fprintf (FILE, "\t.extern %s\n", RS6000_MCOUNT); \
2329 rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
2332 /* Output at end of assembler file.
2334 On the RS/6000, referencing data should automatically pull in text. */
2336 #define ASM_FILE_END(FILE) \
2338 text_section (); \
2339 fputs ("_section_.text:\n", FILE); \
2340 data_section (); \
2341 fputs ("\t.long _section_.text\n", FILE); \
2344 /* We define this to prevent the name mangler from putting dollar signs into
2345 function names. */
2347 #define NO_DOLLAR_IN_LABEL
2349 /* We define this to 0 so that gcc will never accept a dollar sign in a
2350 variable name. This is needed because the AIX assembler will not accept
2351 dollar signs. */
2353 #define DOLLARS_IN_IDENTIFIERS 0
2355 /* Implicit library calls should use memcpy, not bcopy, etc. */
2357 #define TARGET_MEM_FUNCTIONS
2359 /* Define the extra sections we need. We define three: one is the read-only
2360 data section which is used for constants. This is a csect whose name is
2361 derived from the name of the input file. The second is for initialized
2362 global variables. This is a csect whose name is that of the variable.
2363 The third is the TOC. */
2365 #define EXTRA_SECTIONS \
2366 read_only_data, private_data, read_only_private_data, toc, bss
2368 /* Define the name of our readonly data section. */
2370 #define READONLY_DATA_SECTION read_only_data_section
2373 /* Define the name of the section to use for the exception tables.
2374 TODO: test and see if we can use read_only_data_section, if so,
2375 remove this. */
2377 #define EXCEPTION_SECTION data_section
2379 /* If we are referencing a function that is static or is known to be
2380 in this file, make the SYMBOL_REF special. We can use this to indicate
2381 that we can branch to this function without emitting a no-op after the
2382 call. */
2384 #define ENCODE_SECTION_INFO(DECL) \
2385 if (TREE_CODE (DECL) == FUNCTION_DECL \
2386 && (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL))) \
2387 SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;
2389 /* Indicate that jump tables go in the text section. */
2391 #define JUMP_TABLES_IN_TEXT_SECTION 1
2393 /* Define the routines to implement these extra sections. */
2395 #define EXTRA_SECTION_FUNCTIONS \
2397 void \
2398 read_only_data_section () \
2400 if (in_section != read_only_data) \
2402 fprintf (asm_out_file, ".csect %s[RO]\n", \
2403 xcoff_read_only_section_name); \
2404 in_section = read_only_data; \
2408 void \
2409 private_data_section () \
2411 if (in_section != private_data) \
2413 fprintf (asm_out_file, ".csect %s[RW]\n", \
2414 xcoff_private_data_section_name); \
2416 in_section = private_data; \
2420 void \
2421 read_only_private_data_section () \
2423 if (in_section != read_only_private_data) \
2425 fprintf (asm_out_file, ".csect %s[RO]\n", \
2426 xcoff_private_data_section_name); \
2427 in_section = read_only_private_data; \
2431 void \
2432 toc_section () \
2434 if (TARGET_MINIMAL_TOC) \
2436 /* toc_section is always called at least once from ASM_FILE_START, \
2437 so this is guaranteed to always be defined once and only once \
2438 in each file. */ \
2439 if (! toc_initialized) \
2441 fputs (".toc\nLCTOC..0:\n", asm_out_file); \
2442 fputs ("\t.tc toc_table[TC],toc_table[RW]\n", asm_out_file); \
2443 toc_initialized = 1; \
2446 if (in_section != toc) \
2447 fputs (".csect toc_table[RW]\n", asm_out_file); \
2449 else \
2451 if (in_section != toc) \
2452 fputs (".toc\n", asm_out_file); \
2454 in_section = toc; \
2457 /* Flag to say the TOC is initialized */
2458 extern int toc_initialized;
2460 /* This macro produces the initial definition of a function name.
2461 On the RS/6000, we need to place an extra '.' in the function name and
2462 output the function descriptor.
2464 The csect for the function will have already been created by the
2465 `text_section' call previously done. We do have to go back to that
2466 csect, however. */
2468 /* ??? What do the 16 and 044 in the .function line really mean? */
2470 #define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
2471 { if (TREE_PUBLIC (DECL)) \
2473 fputs ("\t.globl .", FILE); \
2474 RS6000_OUTPUT_BASENAME (FILE, NAME); \
2475 putc ('\n', FILE); \
2477 else \
2479 fputs ("\t.lglobl .", FILE); \
2480 RS6000_OUTPUT_BASENAME (FILE, NAME); \
2481 putc ('\n', FILE); \
2483 fputs (".csect ", FILE); \
2484 RS6000_OUTPUT_BASENAME (FILE, NAME); \
2485 fputs (TARGET_32BIT ? "[DS]\n" : "[DS],3\n", FILE); \
2486 RS6000_OUTPUT_BASENAME (FILE, NAME); \
2487 fputs (":\n", FILE); \
2488 fputs (TARGET_32BIT ? "\t.long ." : "\t.llong .", FILE); \
2489 RS6000_OUTPUT_BASENAME (FILE, NAME); \
2490 fputs (", TOC[tc0], 0\n", FILE); \
2491 fputs (".csect .text[PR]\n.", FILE); \
2492 RS6000_OUTPUT_BASENAME (FILE, NAME); \
2493 fputs (":\n", FILE); \
2494 if (write_symbols == XCOFF_DEBUG) \
2495 xcoffout_declare_function (FILE, DECL, NAME); \
2498 /* Return non-zero if this entry is to be written into the constant pool
2499 in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
2500 containing one of them. If -mfp-in-toc (the default), we also do
2501 this for floating-point constants. We actually can only do this
2502 if the FP formats of the target and host machines are the same, but
2503 we can't check that since not every file that uses
2504 GO_IF_LEGITIMATE_ADDRESS_P includes real.h. */
2506 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X) \
2507 (TARGET_TOC \
2508 && (GET_CODE (X) == SYMBOL_REF \
2509 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
2510 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
2511 || GET_CODE (X) == LABEL_REF \
2512 || (! (TARGET_NO_FP_IN_TOC && ! TARGET_MINIMAL_TOC) \
2513 && GET_CODE (X) == CONST_DOUBLE \
2514 && (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
2515 || (TARGET_POWERPC64 && GET_MODE (X) == DImode)))))
2516 #if 0
2517 && BITS_PER_WORD == HOST_BITS_PER_INT)))
2518 #endif
2520 /* Select section for constant in constant pool.
2522 On RS/6000, all constants are in the private read-only data area.
2523 However, if this is being placed in the TOC it must be output as a
2524 toc entry. */
2526 #define SELECT_RTX_SECTION(MODE, X) \
2527 { if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X)) \
2528 toc_section (); \
2529 else \
2530 read_only_private_data_section (); \
2533 /* Macro to output a special constant pool entry. Go to WIN if we output
2534 it. Otherwise, it is written the usual way.
2536 On the RS/6000, toc entries are handled this way. */
2538 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, X, MODE, ALIGN, LABELNO, WIN) \
2539 { if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X)) \
2541 output_toc (FILE, X, LABELNO); \
2542 goto WIN; \
2546 /* Select the section for an initialized data object.
2548 On the RS/6000, we have a special section for all variables except those
2549 that are static. */
2551 #define SELECT_SECTION(EXP,RELOC) \
2553 if ((TREE_CODE (EXP) == STRING_CST \
2554 && !flag_writable_strings) \
2555 || (TREE_CODE_CLASS (TREE_CODE (EXP)) == 'd' \
2556 && TREE_READONLY (EXP) && ! TREE_THIS_VOLATILE (EXP) \
2557 && DECL_INITIAL (EXP) \
2558 && (DECL_INITIAL (EXP) == error_mark_node \
2559 || TREE_CONSTANT (DECL_INITIAL (EXP))) \
2560 && ! (RELOC))) \
2562 if (TREE_PUBLIC (EXP)) \
2563 read_only_data_section (); \
2564 else \
2565 read_only_private_data_section (); \
2567 else \
2569 if (TREE_PUBLIC (EXP)) \
2570 data_section (); \
2571 else \
2572 private_data_section (); \
2576 /* This outputs NAME to FILE up to the first null or '['. */
2578 #define RS6000_OUTPUT_BASENAME(FILE, NAME) \
2580 char *_p; \
2582 STRIP_NAME_ENCODING (_p, (NAME)); \
2583 assemble_name ((FILE), _p); \
2586 /* Remove any trailing [DS] or the like from the symbol name. */
2588 #define STRIP_NAME_ENCODING(VAR,NAME) \
2589 do \
2591 char *_name = (NAME); \
2592 int _len; \
2593 if (_name[0] == '*') \
2594 _name++; \
2595 _len = strlen (_name); \
2596 if (_name[_len - 1] != ']') \
2597 (VAR) = _name; \
2598 else \
2600 (VAR) = (char *) alloca (_len + 1); \
2601 strcpy ((VAR), _name); \
2602 (VAR)[_len - 4] = '\0'; \
2605 while (0)
2607 /* Output something to declare an external symbol to the assembler. Most
2608 assemblers don't need this.
2610 If we haven't already, add "[RW]" (or "[DS]" for a function) to the
2611 name. Normally we write this out along with the name. In the few cases
2612 where we can't, it gets stripped off. */
2614 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
2615 { rtx _symref = XEXP (DECL_RTL (DECL), 0); \
2616 if ((TREE_CODE (DECL) == VAR_DECL \
2617 || TREE_CODE (DECL) == FUNCTION_DECL) \
2618 && (NAME)[strlen (NAME) - 1] != ']') \
2620 char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
2621 strcpy (_name, XSTR (_symref, 0)); \
2622 strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \
2623 XSTR (_symref, 0) = _name; \
2625 fputs ("\t.extern ", FILE); \
2626 assemble_name (FILE, XSTR (_symref, 0)); \
2627 if (TREE_CODE (DECL) == FUNCTION_DECL) \
2629 fputs ("\n\t.extern .", FILE); \
2630 RS6000_OUTPUT_BASENAME (FILE, XSTR (_symref, 0)); \
2632 putc ('\n', FILE); \
2635 /* Similar, but for libcall. We only have to worry about the function name,
2636 not that of the descriptor. */
2638 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
2639 { fputs ("\t.extern .", FILE); \
2640 assemble_name (FILE, XSTR (FUN, 0)); \
2641 putc ('\n', FILE); \
2644 /* Output to assembler file text saying following lines
2645 may contain character constants, extra white space, comments, etc. */
2647 #define ASM_APP_ON ""
2649 /* Output to assembler file text saying following lines
2650 no longer contain unusual constructs. */
2652 #define ASM_APP_OFF ""
2654 /* Output before instructions. */
2656 #define TEXT_SECTION_ASM_OP ".csect .text[PR]"
2658 /* Output before writable data. */
2660 #define DATA_SECTION_ASM_OP ".csect .data[RW]"
2662 /* How to refer to registers in assembler output.
2663 This sequence is indexed by compiler's hard-register-number (see above). */
2665 extern char rs6000_reg_names[][8]; /* register names (0 vs. %r0). */
2667 #define REGISTER_NAMES \
2669 &rs6000_reg_names[ 0][0], /* r0 */ \
2670 &rs6000_reg_names[ 1][0], /* r1 */ \
2671 &rs6000_reg_names[ 2][0], /* r2 */ \
2672 &rs6000_reg_names[ 3][0], /* r3 */ \
2673 &rs6000_reg_names[ 4][0], /* r4 */ \
2674 &rs6000_reg_names[ 5][0], /* r5 */ \
2675 &rs6000_reg_names[ 6][0], /* r6 */ \
2676 &rs6000_reg_names[ 7][0], /* r7 */ \
2677 &rs6000_reg_names[ 8][0], /* r8 */ \
2678 &rs6000_reg_names[ 9][0], /* r9 */ \
2679 &rs6000_reg_names[10][0], /* r10 */ \
2680 &rs6000_reg_names[11][0], /* r11 */ \
2681 &rs6000_reg_names[12][0], /* r12 */ \
2682 &rs6000_reg_names[13][0], /* r13 */ \
2683 &rs6000_reg_names[14][0], /* r14 */ \
2684 &rs6000_reg_names[15][0], /* r15 */ \
2685 &rs6000_reg_names[16][0], /* r16 */ \
2686 &rs6000_reg_names[17][0], /* r17 */ \
2687 &rs6000_reg_names[18][0], /* r18 */ \
2688 &rs6000_reg_names[19][0], /* r19 */ \
2689 &rs6000_reg_names[20][0], /* r20 */ \
2690 &rs6000_reg_names[21][0], /* r21 */ \
2691 &rs6000_reg_names[22][0], /* r22 */ \
2692 &rs6000_reg_names[23][0], /* r23 */ \
2693 &rs6000_reg_names[24][0], /* r24 */ \
2694 &rs6000_reg_names[25][0], /* r25 */ \
2695 &rs6000_reg_names[26][0], /* r26 */ \
2696 &rs6000_reg_names[27][0], /* r27 */ \
2697 &rs6000_reg_names[28][0], /* r28 */ \
2698 &rs6000_reg_names[29][0], /* r29 */ \
2699 &rs6000_reg_names[30][0], /* r30 */ \
2700 &rs6000_reg_names[31][0], /* r31 */ \
2702 &rs6000_reg_names[32][0], /* fr0 */ \
2703 &rs6000_reg_names[33][0], /* fr1 */ \
2704 &rs6000_reg_names[34][0], /* fr2 */ \
2705 &rs6000_reg_names[35][0], /* fr3 */ \
2706 &rs6000_reg_names[36][0], /* fr4 */ \
2707 &rs6000_reg_names[37][0], /* fr5 */ \
2708 &rs6000_reg_names[38][0], /* fr6 */ \
2709 &rs6000_reg_names[39][0], /* fr7 */ \
2710 &rs6000_reg_names[40][0], /* fr8 */ \
2711 &rs6000_reg_names[41][0], /* fr9 */ \
2712 &rs6000_reg_names[42][0], /* fr10 */ \
2713 &rs6000_reg_names[43][0], /* fr11 */ \
2714 &rs6000_reg_names[44][0], /* fr12 */ \
2715 &rs6000_reg_names[45][0], /* fr13 */ \
2716 &rs6000_reg_names[46][0], /* fr14 */ \
2717 &rs6000_reg_names[47][0], /* fr15 */ \
2718 &rs6000_reg_names[48][0], /* fr16 */ \
2719 &rs6000_reg_names[49][0], /* fr17 */ \
2720 &rs6000_reg_names[50][0], /* fr18 */ \
2721 &rs6000_reg_names[51][0], /* fr19 */ \
2722 &rs6000_reg_names[52][0], /* fr20 */ \
2723 &rs6000_reg_names[53][0], /* fr21 */ \
2724 &rs6000_reg_names[54][0], /* fr22 */ \
2725 &rs6000_reg_names[55][0], /* fr23 */ \
2726 &rs6000_reg_names[56][0], /* fr24 */ \
2727 &rs6000_reg_names[57][0], /* fr25 */ \
2728 &rs6000_reg_names[58][0], /* fr26 */ \
2729 &rs6000_reg_names[59][0], /* fr27 */ \
2730 &rs6000_reg_names[60][0], /* fr28 */ \
2731 &rs6000_reg_names[61][0], /* fr29 */ \
2732 &rs6000_reg_names[62][0], /* fr30 */ \
2733 &rs6000_reg_names[63][0], /* fr31 */ \
2735 &rs6000_reg_names[64][0], /* mq */ \
2736 &rs6000_reg_names[65][0], /* lr */ \
2737 &rs6000_reg_names[66][0], /* ctr */ \
2738 &rs6000_reg_names[67][0], /* ap */ \
2740 &rs6000_reg_names[68][0], /* cr0 */ \
2741 &rs6000_reg_names[69][0], /* cr1 */ \
2742 &rs6000_reg_names[70][0], /* cr2 */ \
2743 &rs6000_reg_names[71][0], /* cr3 */ \
2744 &rs6000_reg_names[72][0], /* cr4 */ \
2745 &rs6000_reg_names[73][0], /* cr5 */ \
2746 &rs6000_reg_names[74][0], /* cr6 */ \
2747 &rs6000_reg_names[75][0], /* cr7 */ \
2749 &rs6000_reg_names[76][0], /* fpmem */ \
2752 /* print-rtl can't handle the above REGISTER_NAMES, so define the
2753 following for it. Switch to use the alternate names since
2754 they are more mnemonic. */
2756 #define DEBUG_REGISTER_NAMES \
2758 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
2759 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
2760 "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
2761 "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", \
2762 "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
2763 "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
2764 "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
2765 "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
2766 "mq", "lr", "ctr", "ap", \
2767 "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", \
2768 "fpmem" \
2771 /* Table of additional register names to use in user input. */
2773 #define ADDITIONAL_REGISTER_NAMES \
2774 {{"r0", 0}, {"r1", 1}, {"r2", 2}, {"r3", 3}, \
2775 {"r4", 4}, {"r5", 5}, {"r6", 6}, {"r7", 7}, \
2776 {"r8", 8}, {"r9", 9}, {"r10", 10}, {"r11", 11}, \
2777 {"r12", 12}, {"r13", 13}, {"r14", 14}, {"r15", 15}, \
2778 {"r16", 16}, {"r17", 17}, {"r18", 18}, {"r19", 19}, \
2779 {"r20", 20}, {"r21", 21}, {"r22", 22}, {"r23", 23}, \
2780 {"r24", 24}, {"r25", 25}, {"r26", 26}, {"r27", 27}, \
2781 {"r28", 28}, {"r29", 29}, {"r30", 30}, {"r31", 31}, \
2782 {"fr0", 32}, {"fr1", 33}, {"fr2", 34}, {"fr3", 35}, \
2783 {"fr4", 36}, {"fr5", 37}, {"fr6", 38}, {"fr7", 39}, \
2784 {"fr8", 40}, {"fr9", 41}, {"fr10", 42}, {"fr11", 43}, \
2785 {"fr12", 44}, {"fr13", 45}, {"fr14", 46}, {"fr15", 47}, \
2786 {"fr16", 48}, {"fr17", 49}, {"fr18", 50}, {"fr19", 51}, \
2787 {"fr20", 52}, {"fr21", 53}, {"fr22", 54}, {"fr23", 55}, \
2788 {"fr24", 56}, {"fr25", 57}, {"fr26", 58}, {"fr27", 59}, \
2789 {"fr28", 60}, {"fr29", 61}, {"fr30", 62}, {"fr31", 63}, \
2790 /* no additional names for: mq, lr, ctr, ap */ \
2791 {"cr0", 68}, {"cr1", 69}, {"cr2", 70}, {"cr3", 71}, \
2792 {"cr4", 72}, {"cr5", 73}, {"cr6", 74}, {"cr7", 75}, \
2793 {"cc", 68}, {"sp", 1}, {"toc", 2} }
2795 /* How to renumber registers for dbx and gdb. */
2797 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
2799 /* Text to write out after a CALL that may be replaced by glue code by
2800 the loader. This depends on the AIX version. */
2801 #define RS6000_CALL_GLUE "cror 31,31,31"
2803 /* This is how to output the definition of a user-level label named NAME,
2804 such as the label on a static function or variable NAME. */
2806 #define ASM_OUTPUT_LABEL(FILE,NAME) \
2807 do { RS6000_OUTPUT_BASENAME (FILE, NAME); fputs (":\n", FILE); } while (0)
2809 /* This is how to output a command to make the user-level label named NAME
2810 defined for reference from other files. */
2812 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
2813 do { fputs ("\t.globl ", FILE); \
2814 RS6000_OUTPUT_BASENAME (FILE, NAME); fputs ("\n", FILE);} while (0)
2816 /* This is how to output a reference to a user-level label named NAME.
2817 `assemble_name' uses this. */
2819 #define ASM_OUTPUT_LABELREF(FILE,NAME) \
2820 fputs (NAME, FILE)
2822 /* This is how to output an internal numbered label where
2823 PREFIX is the class of label and NUM is the number within the class. */
2825 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
2826 fprintf (FILE, "%s..%d:\n", PREFIX, NUM)
2828 /* This is how to output an internal label prefix. rs6000.c uses this
2829 when generating traceback tables. */
2831 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \
2832 fprintf (FILE, "%s..", PREFIX)
2834 /* This is how to output a label for a jump table. Arguments are the same as
2835 for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is
2836 passed. */
2838 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
2839 { ASM_OUTPUT_ALIGN (FILE, 2); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
2841 /* This is how to store into the string LABEL
2842 the symbol_ref name of an internal numbered label where
2843 PREFIX is the class of label and NUM is the number within the class.
2844 This is suitable for output with `assemble_name'. */
2846 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
2847 sprintf (LABEL, "*%s..%d", PREFIX, NUM)
2849 /* This is how to output an assembler line defining a `double' constant. */
2851 #define ASM_OUTPUT_DOUBLE(FILE, VALUE) \
2853 if (REAL_VALUE_ISINF (VALUE) \
2854 || REAL_VALUE_ISNAN (VALUE) \
2855 || REAL_VALUE_MINUS_ZERO (VALUE)) \
2857 long t[2]; \
2858 REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t); \
2859 fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", \
2860 t[0] & 0xffffffff, t[1] & 0xffffffff); \
2862 else \
2864 char str[30]; \
2865 REAL_VALUE_TO_DECIMAL (VALUE, "%.20e", str); \
2866 fprintf (FILE, "\t.double 0d%s\n", str); \
2870 /* This is how to output an assembler line defining a `float' constant. */
2872 #define ASM_OUTPUT_FLOAT(FILE, VALUE) \
2874 if (REAL_VALUE_ISINF (VALUE) \
2875 || REAL_VALUE_ISNAN (VALUE) \
2876 || REAL_VALUE_MINUS_ZERO (VALUE)) \
2878 long t; \
2879 REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \
2880 fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \
2882 else \
2884 char str[30]; \
2885 REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \
2886 fprintf (FILE, "\t.float 0d%s\n", str); \
2890 /* This is how to output an assembler line defining an `int' constant. */
2892 #define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE) \
2893 do { \
2894 if (TARGET_32BIT) \
2896 assemble_integer (operand_subword ((VALUE), 0, 0, DImode), \
2897 UNITS_PER_WORD, 1); \
2898 assemble_integer (operand_subword ((VALUE), 1, 0, DImode), \
2899 UNITS_PER_WORD, 1); \
2901 else \
2903 fputs ("\t.llong ", FILE); \
2904 output_addr_const (FILE, (VALUE)); \
2905 putc ('\n', FILE); \
2907 } while (0)
2909 #define ASM_OUTPUT_INT(FILE,VALUE) \
2910 ( fputs ("\t.long ", FILE), \
2911 output_addr_const (FILE, (VALUE)), \
2912 putc ('\n', FILE))
2914 /* Likewise for `char' and `short' constants. */
2916 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
2917 ( fputs ("\t.short ", FILE), \
2918 output_addr_const (FILE, (VALUE)), \
2919 putc ('\n', FILE))
2921 #define ASM_OUTPUT_CHAR(FILE,VALUE) \
2922 ( fputs ("\t.byte ", FILE), \
2923 output_addr_const (FILE, (VALUE)), \
2924 putc ('\n', FILE))
2926 /* This is how to output an assembler line for a numeric constant byte. */
2928 #define ASM_OUTPUT_BYTE(FILE,VALUE) \
2929 fprintf (FILE, "\t.byte 0x%x\n", (VALUE))
2931 /* This is how to output an assembler line to define N characters starting
2932 at P to FILE. */
2934 #define ASM_OUTPUT_ASCII(FILE, P, N) output_ascii ((FILE), (P), (N))
2936 /* This is how to output code to push a register on the stack.
2937 It need not be very fast code.
2939 On the rs6000, we must keep the backchain up to date. In order
2940 to simplify things, always allocate 16 bytes for a push (System V
2941 wants to keep stack aligned to a 16 byte boundary). */
2943 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
2944 do { \
2945 extern char *reg_names[]; \
2946 asm_fprintf (FILE, "\t{stu|stwu} %s,-16(%s)\n\t{st|stw} %s,8(%s)\n", \
2947 reg_names[1], reg_names[1], reg_names[REGNO], \
2948 reg_names[1]); \
2949 } while (0)
2951 /* This is how to output an insn to pop a register from the stack.
2952 It need not be very fast code. */
2954 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
2955 do { \
2956 extern char *reg_names[]; \
2957 asm_fprintf (FILE, "\t{l|lwz} %s,8(%s)\n\t{ai|addic} %s,%s,16\n", \
2958 reg_names[REGNO], reg_names[1], reg_names[1], \
2959 reg_names[1]); \
2960 } while (0)
2962 /* This is how to output an element of a case-vector that is absolute.
2963 (RS/6000 does not use such vectors, but we must define this macro
2964 anyway.) */
2966 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
2967 do { char buf[100]; \
2968 fputs (TARGET_32BIT ? "\t.long " : "\t.llong ", FILE); \
2969 ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \
2970 assemble_name (FILE, buf); \
2971 putc ('\n', FILE); \
2972 } while (0)
2974 /* This is how to output an element of a case-vector that is relative. */
2976 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
2977 do { char buf[100]; \
2978 fputs (TARGET_32BIT ? "\t.long " : "\t.llong ", FILE); \
2979 ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \
2980 assemble_name (FILE, buf); \
2981 putc ('-', FILE); \
2982 ASM_GENERATE_INTERNAL_LABEL (buf, "L", REL); \
2983 assemble_name (FILE, buf); \
2984 putc ('\n', FILE); \
2985 } while (0)
2987 /* This is how to output an assembler line
2988 that says to advance the location counter
2989 to a multiple of 2**LOG bytes. */
2991 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
2992 if ((LOG) != 0) \
2993 fprintf (FILE, "\t.align %d\n", (LOG))
2995 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
2996 fprintf (FILE, "\t.space %d\n", (SIZE))
2998 /* This says how to output an assembler line
2999 to define a global common symbol. */
3001 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGNMENT) \
3002 do { fputs (".comm ", (FILE)); \
3003 RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \
3004 if ( (SIZE) > 4) \
3005 fprintf ((FILE), ",%d,3\n", (SIZE)); \
3006 else \
3007 fprintf( (FILE), ",%d\n", (SIZE)); \
3008 } while (0)
3010 /* This says how to output an assembler line
3011 to define a local common symbol. */
3013 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE,ROUNDED) \
3014 do { fputs (".lcomm ", (FILE)); \
3015 RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \
3016 fprintf ((FILE), ",%d,%s\n", (SIZE), xcoff_bss_section_name); \
3017 } while (0)
3019 /* Store in OUTPUT a string (made with alloca) containing
3020 an assembler-name for a local static variable named NAME.
3021 LABELNO is an integer which is different for each call. */
3023 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
3024 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
3025 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
3027 /* Define the parentheses used to group arithmetic operations
3028 in assembler code. */
3030 #define ASM_OPEN_PAREN "("
3031 #define ASM_CLOSE_PAREN ")"
3033 /* Define results of standard character escape sequences. */
3034 #define TARGET_BELL 007
3035 #define TARGET_BS 010
3036 #define TARGET_TAB 011
3037 #define TARGET_NEWLINE 012
3038 #define TARGET_VT 013
3039 #define TARGET_FF 014
3040 #define TARGET_CR 015
3042 /* Print operand X (an rtx) in assembler syntax to file FILE.
3043 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
3044 For `%' followed by punctuation, CODE is the punctuation and X is null. */
3046 #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
3048 /* Define which CODE values are valid. */
3050 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
3051 ((CODE) == '.' || (CODE) == '*' || (CODE) == '$')
3053 /* Print a memory address as an operand to reference that memory location. */
3055 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
3057 /* Define the codes that are matched by predicates in rs6000.c. */
3059 #define PREDICATE_CODES \
3060 {"short_cint_operand", {CONST_INT}}, \
3061 {"u_short_cint_operand", {CONST_INT}}, \
3062 {"non_short_cint_operand", {CONST_INT}}, \
3063 {"gpc_reg_operand", {SUBREG, REG}}, \
3064 {"cc_reg_operand", {SUBREG, REG}}, \
3065 {"reg_or_short_operand", {SUBREG, REG, CONST_INT}}, \
3066 {"reg_or_neg_short_operand", {SUBREG, REG, CONST_INT}}, \
3067 {"reg_or_u_short_operand", {SUBREG, REG, CONST_INT}}, \
3068 {"reg_or_cint_operand", {SUBREG, REG, CONST_INT}}, \
3069 {"got_operand", {SYMBOL_REF, CONST, LABEL_REF}}, \
3070 {"got_no_const_operand", {SYMBOL_REF, LABEL_REF}}, \
3071 {"easy_fp_constant", {CONST_DOUBLE}}, \
3072 {"reg_or_mem_operand", {SUBREG, MEM, REG}}, \
3073 {"lwa_operand", {SUBREG, MEM, REG}}, \
3074 {"volatile_mem_operand", {MEM}}, \
3075 {"offsettable_addr_operand", {REG, SUBREG, PLUS}}, \
3076 {"mem_or_easy_const_operand", {SUBREG, MEM, CONST_DOUBLE}}, \
3077 {"add_operand", {SUBREG, REG, CONST_INT}}, \
3078 {"non_add_cint_operand", {CONST_INT}}, \
3079 {"and_operand", {SUBREG, REG, CONST_INT}}, \
3080 {"and64_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \
3081 {"logical_operand", {SUBREG, REG, CONST_INT}}, \
3082 {"non_logical_cint_operand", {CONST_INT}}, \
3083 {"mask_operand", {CONST_INT}}, \
3084 {"mask64_operand", {CONST_INT, CONST_DOUBLE}}, \
3085 {"count_register_operand", {REG}}, \
3086 {"fpmem_operand", {REG}}, \
3087 {"call_operand", {SYMBOL_REF, REG}}, \
3088 {"current_file_function_operand", {SYMBOL_REF}}, \
3089 {"input_operand", {SUBREG, MEM, REG, CONST_INT, CONST_DOUBLE, SYMBOL_REF}}, \
3090 {"load_multiple_operation", {PARALLEL}}, \
3091 {"store_multiple_operation", {PARALLEL}}, \
3092 {"branch_comparison_operator", {EQ, NE, LE, LT, GE, \
3093 GT, LEU, LTU, GEU, GTU}}, \
3094 {"scc_comparison_operator", {EQ, NE, LE, LT, GE, \
3095 GT, LEU, LTU, GEU, GTU}},
3098 /* uncomment for disabling the corresponding default options */
3099 /* #define MACHINE_no_sched_interblock */
3100 /* #define MACHINE_no_sched_speculative */
3101 /* #define MACHINE_no_sched_speculative_load */
3103 /* indicate that issue rate is defined for this machine
3104 (no need to use the default) */
3105 #define ISSUE_RATE get_issue_rate ()
3107 /* General flags. */
3108 extern int flag_pic;
3109 extern int optimize;
3110 extern int flag_expensive_optimizations;
3111 extern int frame_pointer_needed;
3113 /* Declare functions in rs6000.c */
3114 extern void output_options ();
3115 extern void rs6000_override_options ();
3116 extern void rs6000_file_start ();
3117 extern struct rtx_def *rs6000_float_const ();
3118 extern struct rtx_def *rs6000_got_register ();
3119 extern int direct_return ();
3120 extern int get_issue_rate ();
3121 extern int any_operand ();
3122 extern int short_cint_operand ();
3123 extern int u_short_cint_operand ();
3124 extern int non_short_cint_operand ();
3125 extern int gpc_reg_operand ();
3126 extern int cc_reg_operand ();
3127 extern int reg_or_short_operand ();
3128 extern int reg_or_neg_short_operand ();
3129 extern int reg_or_u_short_operand ();
3130 extern int reg_or_cint_operand ();
3131 extern int got_operand ();
3132 extern int got_no_const_operand ();
3133 extern int num_insns_constant ();
3134 extern int easy_fp_constant ();
3135 extern int volatile_mem_operand ();
3136 extern int offsettable_addr_operand ();
3137 extern int mem_or_easy_const_operand ();
3138 extern int add_operand ();
3139 extern int non_add_cint_operand ();
3140 extern int non_logical_cint_operand ();
3141 extern int logical_operand ();
3142 extern int mask_constant ();
3143 extern int mask_operand ();
3144 extern int mask64_operand ();
3145 extern int and64_operand ();
3146 extern int and_operand ();
3147 extern int count_register_operand ();
3148 extern int fpmem_operand ();
3149 extern int reg_or_mem_operand ();
3150 extern int lwa_operand ();
3151 extern int call_operand ();
3152 extern int current_file_function_operand ();
3153 extern int input_operand ();
3154 extern int small_data_operand ();
3155 extern void init_cumulative_args ();
3156 extern void function_arg_advance ();
3157 extern int function_arg_boundary ();
3158 extern struct rtx_def *function_arg ();
3159 extern int function_arg_partial_nregs ();
3160 extern int function_arg_pass_by_reference ();
3161 extern void setup_incoming_varargs ();
3162 extern struct rtx_def *expand_builtin_saveregs ();
3163 extern struct rtx_def *rs6000_stack_temp ();
3164 extern int expand_block_move ();
3165 extern int load_multiple_operation ();
3166 extern int store_multiple_operation ();
3167 extern int branch_comparison_operator ();
3168 extern int scc_comparison_operator ();
3169 extern int includes_lshift_p ();
3170 extern int includes_rshift_p ();
3171 extern int registers_ok_for_quad_peep ();
3172 extern int addrs_ok_for_quad_peep ();
3173 extern enum reg_class secondary_reload_class ();
3174 extern int ccr_bit ();
3175 extern void rs6000_finalize_pic ();
3176 extern void rs6000_reorg ();
3177 extern void rs6000_save_machine_status ();
3178 extern void rs6000_restore_machine_status ();
3179 extern void rs6000_init_expanders ();
3180 extern void print_operand ();
3181 extern void print_operand_address ();
3182 extern int first_reg_to_save ();
3183 extern int first_fp_reg_to_save ();
3184 extern int rs6000_makes_calls ();
3185 extern rs6000_stack_t *rs6000_stack_info ();
3186 extern void output_prolog ();
3187 extern void output_epilog ();
3188 extern void output_toc ();
3189 extern void output_ascii ();
3190 extern void rs6000_gen_section_name ();
3191 extern void output_function_profiler ();
3192 extern int rs6000_adjust_cost ();
3193 extern void rs6000_trampoline_template ();
3194 extern int rs6000_trampoline_size ();
3195 extern void rs6000_initialize_trampoline ();
3196 extern void rs6000_output_load_toc_table ();
3197 extern int rs6000_comp_type_attributes ();
3198 extern int rs6000_valid_decl_attribute_p ();
3199 extern int rs6000_valid_type_attribute_p ();
3200 extern void rs6000_set_default_type_attributes ();
3201 extern struct rtx_def *rs6000_dll_import_ref ();
3202 extern struct rtx_def *rs6000_longcall_ref ();
3203 extern int function_arg_padding ();
3204 extern void rs6000_fatal_bad_address ();
3206 /* See nonlocal_goto_receiver for when this must be set. */
3208 #define DONT_ACCESS_GBLS_AFTER_EPILOGUE (TARGET_TOC && TARGET_MINIMAL_TOC)