Yank out part of last change
[official-gcc.git] / gcc / config / rs6000 / rs6000.h
blob2620d4dfc07ffad45cd0811a0bed80347c5a5ccc
1 /* Definitions of target machine for GNU compiler, for IBM RS/6000.
2 Copyright (C) 1992, 1993, 1994, 1995 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 \
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" */
50 /* Define appropriate architecture macros for preprocessor depending on
51 target switches. */
53 #define CPP_SPEC "\
54 %{posix: -D_POSIX_SOURCE} \
55 %{!mcpu*: \
56 %{mpower: %{!mpower2: -D_ARCH_PWR}} \
57 %{mpower2: -D_ARCH_PWR2} \
58 %{mpowerpc*: -D_ARCH_PPC} \
59 %{mno-power: %{!mpowerpc*: -D_ARCH_COM}} \
60 %{!mno-power: %{!mpower2: -D_ARCH_PWR}}} \
61 %{mcpu=common: -D_ARCH_COM} \
62 %{mcpu=power: -D_ARCH_PWR} \
63 %{mcpu=power2: -D_ARCH_PWR2} \
64 %{mcpu=powerpc: -D_ARCH_PPC} \
65 %{mcpu=rios: -D_ARCH_PWR} \
66 %{mcpu=rios1: -D_ARCH_PWR} \
67 %{mcpu=rios2: -D_ARCH_PWR2} \
68 %{mcpu=rsc: -D_ARCH_PWR} \
69 %{mcpu=rsc1: -D_ARCH_PWR} \
70 %{mcpu=403: -D_ARCH_PPC} \
71 %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
72 %{mcpu=602: -mppc} \
73 %{mcpu=603: -mppc} \
74 %{mcpu=603e: -mppc} \
75 %{mcpu=604: -mppc} \
76 %{mcpu=620: -mppc}"
78 /* Define the options for the binder: Start text at 512, align all segments
79 to 512 bytes, and warn if there is text relocation.
81 The -bhalt:4 option supposedly changes the level at which ld will abort,
82 but it also suppresses warnings about multiply defined symbols and is
83 used by the AIX cc command. So we use it here.
85 -bnodelcsect undoes a poor choice of default relating to multiply-defined
86 csects. See AIX documentation for more information about this.
88 -bM:SRE tells the linker that the output file is Shared REusable. Note
89 that to actually build a shared library you will also need to specify an
90 export list with the -Wl,-bE option. */
92 #ifndef CROSS_COMPILE
93 #define LINK_SPEC "-T512 -H512 %{!r:-btextro} -bhalt:4 -bnodelcsect\
94 %{static:-bnso} \
95 %{shared:-bM:SRE}"
96 #else
97 #define LINK_SPEC "-T512 -H512 %{!r:-btextro} -bhalt:4 -bnodelcsect\
98 %{static:-bnso -bI:/lib/syscalls.exp} \
99 %{!shared:%{g*:-bexport:/usr/lib/libg.exp}} %{shared:-bM:SRE}"
100 #endif
102 /* Profiled library versions are used by linking with special directories. */
103 #define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\
104 %{p:-L/lib/profiled -L/usr/lib/profiled} %{!shared:%{g*:-lg}} -lc"
106 /* gcc must do the search itself to find libgcc.a, not use -l. */
107 #define LIBGCC_SPEC "libgcc.a%s"
109 /* Don't turn -B into -L if the argument specifies a relative file name. */
110 #define RELATIVE_PREFIX_NOT_LINKDIR
112 /* Architecture type. */
114 extern int target_flags;
116 /* Use POWER architecture instructions and MQ register. */
117 #define MASK_POWER 0x01
119 /* Use POWER2 extensions to POWER architecture. */
120 #define MASK_POWER2 0x02
122 /* Use PowerPC architecture instructions. */
123 #define MASK_POWERPC 0x04
125 /* Use PowerPC General Purpose group optional instructions, e.g. fsqrt. */
126 #define MASK_PPC_GPOPT 0x08
128 /* Use PowerPC Graphics group optional instructions, e.g. fsel. */
129 #define MASK_PPC_GFXOPT 0x10
131 /* Use PowerPC-64 architecture instructions. */
132 #define MASK_POWERPC64 0x20
134 /* Use revised mnemonic names defined for PowerPC architecture. */
135 #define MASK_NEW_MNEMONICS 0x40
137 /* Disable placing fp constants in the TOC; can be turned on when the
138 TOC overflows. */
139 #define MASK_NO_FP_IN_TOC 0x80
141 /* Disable placing symbol+offset constants in the TOC; can be turned on when
142 the TOC overflows. */
143 #define MASK_NO_SUM_IN_TOC 0x100
145 /* Output only one TOC entry per module. Normally linking fails if
146 there are more than 16K unique variables/constants in an executable. With
147 this option, linking fails only if there are more than 16K modules, or
148 if there are more than 16K unique variables/constant in a single module.
150 This is at the cost of having 2 extra loads and one extra store per
151 function, and one less allocatable register. */
152 #define MASK_MINIMAL_TOC 0x200
154 /* Nonzero for the 64bit model: ints, longs, and pointers are 64 bits. */
155 #define MASK_64BIT 0x400
157 /* Disable use of FPRs. */
158 #define MASK_SOFT_FLOAT 0x800
160 /* Enable load/store multiple, even on powerpc */
161 #define MASK_MULTIPLE 0x1000
162 #define MASK_MULTIPLE_SET 0x2000
164 /* Use string instructions for block moves */
165 #define MASK_STRING 0x4000
166 #define MASK_STRING_SET 0x8000
168 /* Temporary debug switches */
169 #define MASK_DEBUG_STACK 0x10000
170 #define MASK_DEBUG_ARG 0x20000
172 #define TARGET_POWER (target_flags & MASK_POWER)
173 #define TARGET_POWER2 (target_flags & MASK_POWER2)
174 #define TARGET_POWERPC (target_flags & MASK_POWERPC)
175 #define TARGET_PPC_GPOPT (target_flags & MASK_PPC_GPOPT)
176 #define TARGET_PPC_GFXOPT (target_flags & MASK_PPC_GFXOPT)
177 #define TARGET_POWERPC64 (target_flags & MASK_POWERPC64)
178 #define TARGET_NEW_MNEMONICS (target_flags & MASK_NEW_MNEMONICS)
179 #define TARGET_NO_FP_IN_TOC (target_flags & MASK_NO_FP_IN_TOC)
180 #define TARGET_NO_SUM_IN_TOC (target_flags & MASK_NO_SUM_IN_TOC)
181 #define TARGET_MINIMAL_TOC (target_flags & MASK_MINIMAL_TOC)
182 #define TARGET_64BIT (target_flags & MASK_64BIT)
183 #define TARGET_SOFT_FLOAT (target_flags & MASK_SOFT_FLOAT)
184 #define TARGET_MULTIPLE (target_flags & MASK_MULTIPLE)
185 #define TARGET_MULTIPLE_SET (target_flags & MASK_MULTIPLE_SET)
186 #define TARGET_STRING (target_flags & MASK_STRING)
187 #define TARGET_STRING_SET (target_flags & MASK_STRING_SET)
188 #define TARGET_DEBUG_STACK (target_flags & MASK_DEBUG_STACK)
189 #define TARGET_DEBUG_ARG (target_flags & MASK_DEBUG_ARG)
191 #define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT)
193 /* Pseudo target to indicate whether the object format is ELF
194 (to get around not having conditional compilation in the md file) */
195 #ifndef TARGET_ELF
196 #define TARGET_ELF 0
197 #endif
199 /* If this isn't V.4, don't support -mno-toc. */
200 #ifndef TARGET_NO_TOC
201 #define TARGET_NO_TOC 0
202 #define TARGET_TOC 1
203 #endif
205 /* Pseudo target to say whether this is Windows NT */
206 #ifndef TARGET_WINDOWS_NT
207 #define TARGET_WINDOWS_NT 0
208 #endif
210 /* Pseudo target to say whether this is MAC */
211 #ifndef TARGET_MACOS
212 #define TARGET_MACOS 0
213 #endif
215 /* Pseudo target to say whether this is AIX */
216 #ifndef TARGET_AIX
217 #if (TARGET_ELF || TARGET_WINDOWS_NT || TARGET_MACOS)
218 #define TARGET_AIX 0
219 #else
220 #define TARGET_AIX 1
221 #endif
222 #endif
224 /* Run-time compilation parameters selecting different hardware subsets.
226 Macro to define tables used to set the flags.
227 This is a list in braces of pairs in braces,
228 each pair being { "NAME", VALUE }
229 where VALUE is the bits to set or minus the bits to clear.
230 An empty string NAME is used to identify the default VALUE. */
232 /* This is meant to be redefined in the host dependent files */
233 #ifndef SUBTARGET_SWITCHES
234 #define SUBTARGET_SWITCHES
235 #endif
237 #define TARGET_SWITCHES \
238 {{"power", MASK_POWER | MASK_MULTIPLE | MASK_STRING}, \
239 {"power2", (MASK_POWER | MASK_MULTIPLE | MASK_STRING \
240 | MASK_POWER2)}, \
241 {"no-power2", - MASK_POWER2}, \
242 {"no-power", - (MASK_POWER | MASK_POWER2 | MASK_MULTIPLE \
243 | MASK_STRING)}, \
244 {"powerpc", MASK_POWERPC}, \
245 {"no-powerpc", - (MASK_POWERPC | MASK_PPC_GPOPT \
246 | MASK_PPC_GFXOPT | MASK_POWERPC64)}, \
247 {"powerpc-gpopt", MASK_POWERPC | MASK_PPC_GPOPT}, \
248 {"no-powerpc-gpopt", - MASK_PPC_GPOPT}, \
249 {"powerpc-gfxopt", MASK_POWERPC | MASK_PPC_GFXOPT}, \
250 {"no-powerpc-gfxopt", - MASK_PPC_GFXOPT}, \
251 {"new-mnemonics", MASK_NEW_MNEMONICS}, \
252 {"old-mnemonics", -MASK_NEW_MNEMONICS}, \
253 {"full-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC \
254 | MASK_MINIMAL_TOC)}, \
255 {"fp-in-toc", - MASK_NO_FP_IN_TOC}, \
256 {"no-fp-in-toc", MASK_NO_FP_IN_TOC}, \
257 {"sum-in-toc", - MASK_NO_SUM_IN_TOC}, \
258 {"no-sum-in-toc", MASK_NO_SUM_IN_TOC}, \
259 {"minimal-toc", MASK_MINIMAL_TOC}, \
260 {"minimal-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC)}, \
261 {"no-minimal-toc", - MASK_MINIMAL_TOC}, \
262 {"hard-float", - MASK_SOFT_FLOAT}, \
263 {"soft-float", MASK_SOFT_FLOAT}, \
264 {"multiple", MASK_MULTIPLE | MASK_MULTIPLE_SET}, \
265 {"no-multiple", - MASK_MULTIPLE}, \
266 {"no-multiple", MASK_MULTIPLE_SET}, \
267 {"string", MASK_STRING | MASK_STRING_SET}, \
268 {"no-string", - MASK_STRING}, \
269 {"no-string", MASK_STRING_SET}, \
270 {"debug-stack", MASK_DEBUG_STACK}, \
271 {"debug-arg", MASK_DEBUG_ARG}, \
272 SUBTARGET_SWITCHES \
273 {"", TARGET_DEFAULT}}
275 #define TARGET_DEFAULT (MASK_POWER | MASK_MULTIPLE | MASK_STRING)
277 /* Processor type. */
278 enum processor_type
279 {PROCESSOR_RIOS1,
280 PROCESSOR_RIOS2,
281 PROCESSOR_PPC403,
282 PROCESSOR_PPC601,
283 PROCESSOR_PPC602,
284 PROCESSOR_PPC603,
285 PROCESSOR_PPC604,
286 PROCESSOR_PPC620};
288 extern enum processor_type rs6000_cpu;
290 /* Recast the processor type to the cpu attribute. */
291 #define rs6000_cpu_attr ((enum attr_cpu)rs6000_cpu)
293 /* Define generic processor types based upon current deployment. */
294 #define PROCESSOR_COMMON PROCESSOR_PPC601
295 #define PROCESSOR_POWER PROCESSOR_RIOS1
296 #define PROCESSOR_POWERPC PROCESSOR_PPC604
298 /* Define the default processor. This is overridden by other tm.h files. */
299 #define PROCESSOR_DEFAULT PROCESSOR_RIOS1
301 /* Specify the dialect of assembler to use. New mnemonics is dialect one
302 and the old mnemonics are dialect zero. */
303 #define ASSEMBLER_DIALECT TARGET_NEW_MNEMONICS ? 1 : 0
305 /* This macro is similar to `TARGET_SWITCHES' but defines names of
306 command options that have values. Its definition is an
307 initializer with a subgrouping for each command option.
309 Each subgrouping contains a string constant, that defines the
310 fixed part of the option name, and the address of a variable.
311 The variable, type `char *', is set to the variable part of the
312 given option if the fixed part matches. The actual option name
313 is made by appending `-m' to the specified name.
315 Here is an example which defines `-mshort-data-NUMBER'. If the
316 given option is `-mshort-data-512', the variable `m88k_short_data'
317 will be set to the string `"512"'.
319 extern char *m88k_short_data;
320 #define TARGET_OPTIONS { { "short-data-", &m88k_short_data } } */
322 /* This is meant to be overriden in target specific files. */
323 #ifndef SUBTARGET_OPTIONS
324 #define SUBTARGET_OPTIONS
325 #endif
327 #define TARGET_OPTIONS \
329 {"cpu=", &rs6000_select[1].string}, \
330 {"tune=", &rs6000_select[2].string}, \
331 SUBTARGET_OPTIONS \
334 /* rs6000_select[0] is reserved for the default cpu defined via --with-cpu */
335 struct rs6000_cpu_select
337 char *string;
338 char *name;
339 int set_tune_p;
340 int set_arch_p;
343 extern struct rs6000_cpu_select rs6000_select[];
345 /* Sometimes certain combinations of command options do not make sense
346 on a particular target machine. You can define a macro
347 `OVERRIDE_OPTIONS' to take account of this. This macro, if
348 defined, is executed once just after all the command options have
349 been parsed.
351 On the RS/6000 this is used to define the target cpu type. */
353 #define OVERRIDE_OPTIONS rs6000_override_options (TARGET_CPU_DEFAULT)
355 /* Show we can debug even without a frame pointer. */
356 #define CAN_DEBUG_WITHOUT_FP
358 /* target machine storage layout */
360 /* Define to support cross compilation to an RS6000 target. */
361 #define REAL_ARITHMETIC
363 /* Define this macro if it is advisable to hold scalars in registers
364 in a wider mode than that declared by the program. In such cases,
365 the value is constrained to be within the bounds of the declared
366 type, but kept valid in the wider mode. The signedness of the
367 extension may differ from that of the type. */
369 #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
370 if (GET_MODE_CLASS (MODE) == MODE_INT \
371 && GET_MODE_SIZE (MODE) < 4) \
372 (MODE) = SImode;
374 /* Define this if most significant bit is lowest numbered
375 in instructions that operate on numbered bit-fields. */
376 /* That is true on RS/6000. */
377 #define BITS_BIG_ENDIAN 1
379 /* Define this if most significant byte of a word is the lowest numbered. */
380 /* That is true on RS/6000. */
381 #define BYTES_BIG_ENDIAN 1
383 /* Define this if most significant word of a multiword number is lowest
384 numbered.
386 For RS/6000 we can decide arbitrarily since there are no machine
387 instructions for them. Might as well be consistent with bits and bytes. */
388 #define WORDS_BIG_ENDIAN 1
390 /* number of bits in an addressable storage unit */
391 #define BITS_PER_UNIT 8
393 /* Width in bits of a "word", which is the contents of a machine register.
394 Note that this is not necessarily the width of data type `int';
395 if using 16-bit ints on a 68000, this would still be 32.
396 But on a machine with 16-bit registers, this would be 16. */
397 #define BITS_PER_WORD (TARGET_POWERPC64 ? 64 : 32)
398 #define MAX_BITS_PER_WORD 64
400 /* Width of a word, in units (bytes). */
401 #define UNITS_PER_WORD (TARGET_POWERPC64 ? 8 : 4)
402 #define MIN_UNITS_PER_WORD 4
403 #define UNITS_PER_FP_WORD 8
405 /* Type used for ptrdiff_t, as a string used in a declaration. */
406 #define PTRDIFF_TYPE "int"
408 /* Type used for wchar_t, as a string used in a declaration. */
409 #define WCHAR_TYPE "short unsigned int"
411 /* Width of wchar_t in bits. */
412 #define WCHAR_TYPE_SIZE 16
414 /* A C expression for the size in bits of the type `short' on the
415 target machine. If you don't define this, the default is half a
416 word. (If this would be less than one storage unit, it is
417 rounded up to one unit.) */
418 #define SHORT_TYPE_SIZE 16
420 /* A C expression for the size in bits of the type `int' on the
421 target machine. If you don't define this, the default is one
422 word. */
423 #define INT_TYPE_SIZE 32
425 /* A C expression for the size in bits of the type `long' on the
426 target machine. If you don't define this, the default is one
427 word. */
428 #define LONG_TYPE_SIZE (TARGET_64BIT ? 64 : 32)
429 #define MAX_LONG_TYPE_SIZE 64
431 /* A C expression for the size in bits of the type `long long' on the
432 target machine. If you don't define this, the default is two
433 words. */
434 #define LONG_LONG_TYPE_SIZE 64
436 /* A C expression for the size in bits of the type `char' on the
437 target machine. If you don't define this, the default is one
438 quarter of a word. (If this would be less than one storage unit,
439 it is rounded up to one unit.) */
440 #define CHAR_TYPE_SIZE BITS_PER_UNIT
442 /* A C expression for the size in bits of the type `float' on the
443 target machine. If you don't define this, the default is one
444 word. */
445 #define FLOAT_TYPE_SIZE 32
447 /* A C expression for the size in bits of the type `double' on the
448 target machine. If you don't define this, the default is two
449 words. */
450 #define DOUBLE_TYPE_SIZE 64
452 /* A C expression for the size in bits of the type `long double' on
453 the target machine. If you don't define this, the default is two
454 words. */
455 #define LONG_DOUBLE_TYPE_SIZE 64
457 /* Width in bits of a pointer.
458 See also the macro `Pmode' defined below. */
459 #define POINTER_SIZE (TARGET_64BIT ? 64 : 32)
461 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
462 #define PARM_BOUNDARY (TARGET_64BIT ? 64 : 32)
464 /* Boundary (in *bits*) on which stack pointer should be aligned. */
465 #define STACK_BOUNDARY 64
467 /* Allocation boundary (in *bits*) for the code of a function. */
468 #define FUNCTION_BOUNDARY 32
470 /* No data type wants to be aligned rounder than this. */
471 #define BIGGEST_ALIGNMENT (TARGET_64BIT ? 64 : 32)
473 /* Alignment of field after `int : 0' in a structure. */
474 #define EMPTY_FIELD_BOUNDARY 32
476 /* Every structure's size must be a multiple of this. */
477 #define STRUCTURE_SIZE_BOUNDARY 8
479 /* A bitfield declared as `int' forces `int' alignment for the struct. */
480 #define PCC_BITFIELD_TYPE_MATTERS 1
482 /* Make strings word-aligned so strcpy from constants will be faster. */
483 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
484 (TREE_CODE (EXP) == STRING_CST \
485 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
487 /* Make arrays of chars word-aligned for the same reasons. */
488 #define DATA_ALIGNMENT(TYPE, ALIGN) \
489 (TREE_CODE (TYPE) == ARRAY_TYPE \
490 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
491 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
493 /* Non-zero if move instructions will actually fail to work
494 when given unaligned data. */
495 #define STRICT_ALIGNMENT 0
497 /* Standard register usage. */
499 /* Number of actual hardware registers.
500 The hardware registers are assigned numbers for the compiler
501 from 0 to just below FIRST_PSEUDO_REGISTER.
502 All registers that the compiler knows about must be given numbers,
503 even those that are not normally considered general registers.
505 RS/6000 has 32 fixed-point registers, 32 floating-point registers,
506 an MQ register, a count register, a link register, and 8 condition
507 register fields, which we view here as separate registers.
509 In addition, the difference between the frame and argument pointers is
510 a function of the number of registers saved, so we need to have a
511 register for AP that will later be eliminated in favor of SP or FP.
512 This is a normal register, but it is fixed. */
514 #define FIRST_PSEUDO_REGISTER 76
516 /* 1 for registers that have pervasive standard uses
517 and are not available for the register allocator.
519 On RS/6000, r1 is used for the stack and r2 is used as the TOC pointer.
521 cr5 is not supposed to be used.
523 On System V implementations, r13 is fixed and not available for use. */
525 #ifndef FIXED_R13
526 #define FIXED_R13 0
527 #endif
529 #define FIXED_REGISTERS \
530 {0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, FIXED_R13, 0, 0, \
531 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
532 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
533 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
534 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0}
536 /* 1 for registers not available across function calls.
537 These must include the FIXED_REGISTERS and also any
538 registers that can be used without being saved.
539 The latter must include the registers where values are returned
540 and the register where structure-value addresses are passed.
541 Aside from that, you can include as many other registers as you like. */
543 #define CALL_USED_REGISTERS \
544 {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, FIXED_R13, 0, 0, \
545 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
546 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, \
547 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
548 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1}
550 /* List the order in which to allocate registers. Each register must be
551 listed once, even those in FIXED_REGISTERS.
553 We allocate in the following order:
554 fp0 (not saved or used for anything)
555 fp13 - fp2 (not saved; incoming fp arg registers)
556 fp1 (not saved; return value)
557 fp31 - fp14 (saved; order given to save least number)
558 cr1, cr6, cr7 (not saved or special)
559 cr0 (not saved, but used for arithmetic operations)
560 cr2, cr3, cr4 (saved)
561 r0 (not saved; cannot be base reg)
562 r9 (not saved; best for TImode)
563 r11, r10, r8-r4 (not saved; highest used first to make less conflict)
564 r3 (not saved; return value register)
565 r31 - r13 (saved; order given to save least number)
566 r12 (not saved; if used for DImode or DFmode would use r13)
567 mq (not saved; best to use it if we can)
568 ctr (not saved; when we have the choice ctr is better)
569 lr (saved)
570 cr5, r1, r2, ap (fixed) */
572 #define REG_ALLOC_ORDER \
573 {32, \
574 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, \
575 33, \
576 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, \
577 50, 49, 48, 47, 46, \
578 69, 74, 75, 68, 70, 71, 72, \
579 0, \
580 9, 11, 10, 8, 7, 6, 5, 4, \
581 3, \
582 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, \
583 18, 17, 16, 15, 14, 13, 12, \
584 64, 66, 65, \
585 73, 1, 2, 67}
587 /* True if register is floating-point. */
588 #define FP_REGNO_P(N) ((N) >= 32 && (N) <= 63)
590 /* True if register is a condition register. */
591 #define CR_REGNO_P(N) ((N) >= 68 && (N) <= 75)
593 /* True if register is an integer register. */
594 #define INT_REGNO_P(N) ((N) <= 31 || (N) == 67)
596 /* Return number of consecutive hard regs needed starting at reg REGNO
597 to hold something of mode MODE.
598 This is ordinarily the length in words of a value of mode MODE
599 but can be less for certain modes in special long registers.
601 On RS/6000, ordinary registers hold 32 bits worth;
602 a single floating point register holds 64 bits worth. */
604 #define HARD_REGNO_NREGS(REGNO, MODE) \
605 (FP_REGNO_P (REGNO) \
606 ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \
607 : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
609 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
610 For POWER and PowerPC, the GPRs can hold any mode, but the float
611 registers only can hold floating modes and DImode, and CR register only
612 can hold CC modes. We cannot put TImode anywhere except general
613 register and it must be able to fit within the register set. */
615 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
616 (FP_REGNO_P (REGNO) ? \
617 (GET_MODE_CLASS (MODE) == MODE_FLOAT \
618 || (GET_MODE_CLASS (MODE) == MODE_INT \
619 && GET_MODE_SIZE (MODE) == UNITS_PER_FP_WORD)) \
620 : CR_REGNO_P (REGNO) ? GET_MODE_CLASS (MODE) == MODE_CC \
621 : ! INT_REGNO_P (REGNO) ? (GET_MODE_CLASS (MODE) == MODE_INT \
622 && GET_MODE_SIZE (MODE) <= UNITS_PER_WORD) \
623 : 1)
625 /* Value is 1 if it is a good idea to tie two pseudo registers
626 when one has mode MODE1 and one has mode MODE2.
627 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
628 for any hard reg, then this must be 0 for correct output. */
629 #define MODES_TIEABLE_P(MODE1, MODE2) \
630 (GET_MODE_CLASS (MODE1) == MODE_FLOAT \
631 ? GET_MODE_CLASS (MODE2) == MODE_FLOAT \
632 : GET_MODE_CLASS (MODE2) == MODE_FLOAT \
633 ? GET_MODE_CLASS (MODE1) == MODE_FLOAT \
634 : GET_MODE_CLASS (MODE1) == MODE_CC \
635 ? GET_MODE_CLASS (MODE2) == MODE_CC \
636 : GET_MODE_CLASS (MODE2) == MODE_CC \
637 ? GET_MODE_CLASS (MODE1) == MODE_CC \
638 : 1)
640 /* A C expression returning the cost of moving data from a register of class
641 CLASS1 to one of CLASS2.
643 On the RS/6000, copying between floating-point and fixed-point
644 registers is expensive. */
646 #define REGISTER_MOVE_COST(CLASS1, CLASS2) \
647 ((CLASS1) == FLOAT_REGS && (CLASS2) == FLOAT_REGS ? 2 \
648 : (CLASS1) == FLOAT_REGS && (CLASS2) != FLOAT_REGS ? 10 \
649 : (CLASS1) != FLOAT_REGS && (CLASS2) == FLOAT_REGS ? 10 \
650 : (((CLASS1) == SPECIAL_REGS || (CLASS1) == MQ_REGS \
651 || (CLASS1) == LINK_REGS || (CLASS1) == CTR_REGS \
652 || (CLASS1) == LINK_OR_CTR_REGS) \
653 && ((CLASS2) == SPECIAL_REGS || (CLASS2) == MQ_REGS \
654 || (CLASS2) == LINK_REGS || (CLASS2) == CTR_REGS \
655 || (CLASS2) == LINK_OR_CTR_REGS)) ? 10 \
656 : 2)
658 /* A C expressions returning the cost of moving data of MODE from a register to
659 or from memory.
661 On the RS/6000, bump this up a bit. */
663 #define MEMORY_MOVE_COST(MODE) \
664 ((GET_MODE_CLASS (MODE) == MODE_FLOAT \
665 && (rs6000_cpu == PROCESSOR_RIOS1 || rs6000_cpu == PROCESSOR_PPC601) \
666 ? 3 : 2) \
667 + 4)
669 /* Specify the cost of a branch insn; roughly the number of extra insns that
670 should be added to avoid a branch.
672 Set this to 3 on the RS/6000 since that is roughly the average cost of an
673 unscheduled conditional branch. */
675 #define BRANCH_COST 3
677 /* A C statement (sans semicolon) to update the integer variable COST
678 based on the relationship between INSN that is dependent on
679 DEP_INSN through the dependence LINK. The default is to make no
680 adjustment to COST. On the RS/6000, ignore the cost of anti- and
681 output-dependencies. In fact, output dependencies on the CR do have
682 a cost, but it is probably not worthwhile to track it. */
684 #define ADJUST_COST(INSN,LINK,DEP_INSN,COST) \
685 (COST) = rs6000_adjust_cost (INSN,LINK,DEP_INSN,COST)
687 /* Define this macro to change register usage conditional on target flags.
688 Set MQ register fixed (already call_used) if not POWER architecture
689 (RIOS1, RIOS2, RSC, and PPC601) so that it will not be allocated.
690 Conditionally disable FPRs. */
692 #define CONDITIONAL_REGISTER_USAGE \
694 if (! TARGET_POWER) \
695 fixed_regs[64] = 1; \
696 if (TARGET_SOFT_FLOAT) \
697 for (i = 32; i < 64; i++) \
698 fixed_regs[i] = call_used_regs[i] = 1; \
701 /* Specify the registers used for certain standard purposes.
702 The values of these macros are register numbers. */
704 /* RS/6000 pc isn't overloaded on a register that the compiler knows about. */
705 /* #define PC_REGNUM */
707 /* Register to use for pushing function arguments. */
708 #define STACK_POINTER_REGNUM 1
710 /* Base register for access to local variables of the function. */
711 #define FRAME_POINTER_REGNUM 31
713 /* Value should be nonzero if functions must have frame pointers.
714 Zero means the frame pointer need not be set up (and parms
715 may be accessed via the stack pointer) in functions that seem suitable.
716 This is computed in `reload', in reload1.c. */
717 #define FRAME_POINTER_REQUIRED 0
719 /* Base register for access to arguments of the function. */
720 #define ARG_POINTER_REGNUM 67
722 /* Place to put static chain when calling a function that requires it. */
723 #define STATIC_CHAIN_REGNUM 11
725 /* count register number for special purposes */
726 #define COUNT_REGISTER_REGNUM 66
728 /* Place that structure value return address is placed.
730 On the RS/6000, it is passed as an extra parameter. */
731 #define STRUCT_VALUE 0
733 /* Define the classes of registers for register constraints in the
734 machine description. Also define ranges of constants.
736 One of the classes must always be named ALL_REGS and include all hard regs.
737 If there is more than one class, another class must be named NO_REGS
738 and contain no registers.
740 The name GENERAL_REGS must be the name of a class (or an alias for
741 another name such as ALL_REGS). This is the class of registers
742 that is allowed by "g" or "r" in a register constraint.
743 Also, registers outside this class are allocated only when
744 instructions express preferences for them.
746 The classes must be numbered in nondecreasing order; that is,
747 a larger-numbered class must never be contained completely
748 in a smaller-numbered class.
750 For any two classes, it is very desirable that there be another
751 class that represents their union. */
753 /* The RS/6000 has three types of registers, fixed-point, floating-point,
754 and condition registers, plus three special registers, MQ, CTR, and the
755 link register.
757 However, r0 is special in that it cannot be used as a base register.
758 So make a class for registers valid as base registers.
760 Also, cr0 is the only condition code register that can be used in
761 arithmetic insns, so make a separate class for it. Common mode
762 needs to clobber cr1, so add a class for that as well. */
764 enum reg_class
766 NO_REGS,
767 R0_REGS,
768 R3_REGS,
769 R4_REGS,
770 R34_REGS,
771 BASE_REGS,
772 GENERAL_REGS,
773 FLOAT_REGS,
774 NON_SPECIAL_REGS,
775 MQ_REGS,
776 LINK_REGS,
777 CTR_REGS,
778 LINK_OR_CTR_REGS,
779 SPECIAL_REGS,
780 SPEC_OR_GEN_REGS,
781 CR0_REGS,
782 CR1_REGS,
783 CR_REGS,
784 NON_FLOAT_REGS,
785 ALL_REGS,
786 LIM_REG_CLASSES
789 #define N_REG_CLASSES (int) LIM_REG_CLASSES
791 /* Give names of register classes as strings for dump file. */
793 #define REG_CLASS_NAMES \
795 "NO_REGS", \
796 "R0_REGS", \
797 "R3_REGS", \
798 "R4_REGS", \
799 "R34_REGS", \
800 "BASE_REGS", \
801 "GENERAL_REGS", \
802 "FLOAT_REGS", \
803 "NON_SPECIAL_REGS", \
804 "MQ_REGS", \
805 "LINK_REGS", \
806 "CTR_REGS", \
807 "LINK_OR_CTR_REGS", \
808 "SPECIAL_REGS", \
809 "SPEC_OR_GEN_REGS", \
810 "CR0_REGS", \
811 "CR1_REGS", \
812 "CR_REGS", \
813 "NON_FLOAT_REGS", \
814 "ALL_REGS" \
817 /* Define which registers fit in which classes.
818 This is an initializer for a vector of HARD_REG_SET
819 of length N_REG_CLASSES. */
821 #define REG_CLASS_CONTENTS \
823 { 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS */ \
824 { 0x00000001, 0x00000000, 0x00000000 }, /* R0_REGS */ \
825 { 0x00000008, 0x00000000, 0x00000000 }, /* R3_REGS */ \
826 { 0x00000010, 0x00000000, 0x00000000 }, /* R4_REGS */ \
827 { 0x00000018, 0x00000000, 0x00000000 }, /* R34_REGS */ \
828 { 0xfffffffe, 0x00000000, 0x00000008 }, /* BASE_REGS */ \
829 { 0xffffffff, 0x00000000, 0x00000008 }, /* GENERAL_REGS */ \
830 { 0x00000000, 0xffffffff, 0x00000000 }, /* FLOAT_REGS */ \
831 { 0xffffffff, 0xffffffff, 0x00000008 }, /* NON_SPECIAL_REGS */ \
832 { 0x00000000, 0x00000000, 0x00000001 }, /* MQ_REGS */ \
833 { 0x00000000, 0x00000000, 0x00000002 }, /* LINK_REGS */ \
834 { 0x00000000, 0x00000000, 0x00000004 }, /* CTR_REGS */ \
835 { 0x00000000, 0x00000000, 0x00000006 }, /* LINK_OR_CTR_REGS */ \
836 { 0x00000000, 0x00000000, 0x00000007 }, /* SPECIAL_REGS */ \
837 { 0xffffffff, 0x00000000, 0x0000000f }, /* SPEC_OR_GEN_REGS */ \
838 { 0x00000000, 0x00000000, 0x00000010 }, /* CR0_REGS */ \
839 { 0x00000000, 0x00000000, 0x00000020 }, /* CR1_REGS */ \
840 { 0x00000000, 0x00000000, 0x00000ff0 }, /* CR_REGS */ \
841 { 0xffffffff, 0x00000000, 0x0000ffff }, /* NON_FLOAT_REGS */ \
842 { 0xffffffff, 0xffffffff, 0x0000ffff } /* ALL_REGS */ \
845 /* The same information, inverted:
846 Return the class number of the smallest class containing
847 reg number REGNO. This could be a conditional expression
848 or could index an array. */
850 #define REGNO_REG_CLASS(REGNO) \
851 ((REGNO) == 0 ? R0_REGS \
852 : (REGNO) == 3 ? R3_REGS \
853 : (REGNO) == 4 ? R4_REGS \
854 : (REGNO) < 32 ? BASE_REGS \
855 : FP_REGNO_P (REGNO) ? FLOAT_REGS \
856 : (REGNO) == 68 ? CR0_REGS \
857 : (REGNO) == 69 ? CR1_REGS \
858 : CR_REGNO_P (REGNO) ? CR_REGS \
859 : (REGNO) == 64 ? MQ_REGS \
860 : (REGNO) == 65 ? LINK_REGS \
861 : (REGNO) == 66 ? CTR_REGS \
862 : (REGNO) == 67 ? BASE_REGS \
863 : NO_REGS)
865 /* The class value for index registers, and the one for base regs. */
866 #define INDEX_REG_CLASS GENERAL_REGS
867 #define BASE_REG_CLASS BASE_REGS
869 /* Get reg_class from a letter such as appears in the machine description. */
871 #define REG_CLASS_FROM_LETTER(C) \
872 ((C) == 'f' ? FLOAT_REGS \
873 : (C) == 'b' ? BASE_REGS \
874 : (C) == 'h' ? SPECIAL_REGS \
875 : (C) == 'q' ? MQ_REGS \
876 : (C) == 'c' ? CTR_REGS \
877 : (C) == 'l' ? LINK_REGS \
878 : (C) == 't' ? CR1_REGS \
879 : (C) == 'u' ? R3_REGS \
880 : (C) == 'v' ? R4_REGS \
881 : (C) == 'w' ? R34_REGS \
882 : (C) == 'x' ? CR0_REGS \
883 : (C) == 'y' ? CR_REGS \
884 : (C) == 'z' ? R0_REGS \
885 : NO_REGS)
887 /* The letters I, J, K, L, M, N, and P in a register constraint string
888 can be used to stand for particular ranges of immediate operands.
889 This macro defines what the ranges are.
890 C is the letter, and VALUE is a constant value.
891 Return 1 if VALUE is in the range specified by C.
893 `I' is signed 16-bit constants
894 `J' is a constant with only the high-order 16 bits non-zero
895 `K' is a constant with only the low-order 16 bits non-zero
896 `L' is a constant that can be placed into a mask operand
897 `M' is a constant that is greater than 31
898 `N' is a constant that is an exact power of two
899 `O' is the constant zero
900 `P' is a constant whose negation is a signed 16-bit constant */
902 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
903 ( (C) == 'I' ? (unsigned) ((VALUE) + 0x8000) < 0x10000 \
904 : (C) == 'J' ? ((VALUE) & 0xffff) == 0 \
905 : (C) == 'K' ? ((VALUE) & 0xffff0000) == 0 \
906 : (C) == 'L' ? mask_constant (VALUE) \
907 : (C) == 'M' ? (VALUE) > 31 \
908 : (C) == 'N' ? exact_log2 (VALUE) >= 0 \
909 : (C) == 'O' ? (VALUE) == 0 \
910 : (C) == 'P' ? (unsigned) ((- (VALUE)) + 0x8000) < 0x1000 \
911 : 0)
913 /* Similar, but for floating constants, and defining letters G and H.
914 Here VALUE is the CONST_DOUBLE rtx itself.
916 We flag for special constants when we can copy the constant into
917 a general register in two insns for DF and one insn for SF. */
919 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
920 ((C) == 'G' ? easy_fp_constant (VALUE, GET_MODE (VALUE)) : 0)
922 /* Optional extra constraints for this machine.
924 'Q' means that is a memory operand that is just an offset from a reg.
925 'R' is for AIX TOC entries.
926 'S' is for Windows NT SYMBOL_REFs
927 'T' is for Windows NT LABEL_REFs. */
929 #define EXTRA_CONSTRAINT(OP, C) \
930 ((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG \
931 : (C) == 'R' ? LEGITIMATE_CONSTANT_POOL_ADDRESS_P (OP) \
932 : (C) == 'S' ? (TARGET_WINDOWS_NT && DEFAULT_ABI == ABI_NT && GET_CODE (OP) == SYMBOL_REF)\
933 : (C) == 'T' ? (TARGET_WINDOWS_NT && DEFAULT_ABI == ABI_NT && GET_CODE (OP) == LABEL_REF) \
934 : 0)
936 /* Given an rtx X being reloaded into a reg required to be
937 in class CLASS, return the class of reg to actually use.
938 In general this is just CLASS; but on some machines
939 in some cases it is preferable to use a more restrictive class.
941 On the RS/6000, we have to return NO_REGS when we want to reload a
942 floating-point CONST_DOUBLE to force it to be copied to memory. */
944 #define PREFERRED_RELOAD_CLASS(X,CLASS) \
945 ((GET_CODE (X) == CONST_DOUBLE \
946 && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \
947 ? NO_REGS : (CLASS))
949 /* Return the register class of a scratch register needed to copy IN into
950 or out of a register in CLASS in MODE. If it can be done directly,
951 NO_REGS is returned. */
953 #define SECONDARY_RELOAD_CLASS(CLASS,MODE,IN) \
954 secondary_reload_class (CLASS, MODE, IN)
956 /* If we are copying between FP registers and anything else, we need a memory
957 location. */
959 #define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) \
960 ((CLASS1) != (CLASS2) && ((CLASS1) == FLOAT_REGS || (CLASS2) == FLOAT_REGS))
962 /* Return the maximum number of consecutive registers
963 needed to represent mode MODE in a register of class CLASS.
965 On RS/6000, this is the size of MODE in words,
966 except in the FP regs, where a single reg is enough for two words. */
967 #define CLASS_MAX_NREGS(CLASS, MODE) \
968 ((CLASS) == FLOAT_REGS \
969 ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \
970 : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
972 /* If defined, gives a class of registers that cannot be used as the
973 operand of a SUBREG that changes the size of the object. */
975 #define CLASS_CANNOT_CHANGE_SIZE FLOAT_REGS
977 /* Stack layout; function entry, exit and calling. */
979 /* Enumeration to give which calling sequence to use. */
980 enum rs6000_abi {
981 ABI_NONE,
982 ABI_AIX, /* IBM's AIX */
983 ABI_AIX_NODESC, /* AIX calling sequence minus function descriptors */
984 ABI_V4, /* System V.4/eabi */
985 ABI_NT /* Windows/NT */
988 extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */
990 /* Default ABI to compile code for */
991 #ifndef DEFAULT_ABI
992 #define DEFAULT_ABI ABI_AIX
993 #endif
995 /* Structure used to define the rs6000 stack */
996 typedef struct rs6000_stack {
997 int first_gp_reg_save; /* first callee saved GP register used */
998 int first_fp_reg_save; /* first callee saved FP register used */
999 int lr_save_p; /* true if the link reg needs to be saved */
1000 int cr_save_p; /* true if the CR reg needs to be saved */
1001 int toc_save_p; /* true if the TOC needs to be saved */
1002 int push_p; /* true if we need to allocate stack space */
1003 int calls_p; /* true if the function makes any calls */
1004 int main_p; /* true if this is main */
1005 int main_save_p; /* true if this is main and we need to save args */
1006 enum rs6000_abi abi; /* which ABI to use */
1007 int gp_save_offset; /* offset to save GP regs from initial SP */
1008 int fp_save_offset; /* offset to save FP regs from initial SP */
1009 int lr_save_offset; /* offset to save LR from initial SP */
1010 int cr_save_offset; /* offset to save CR from initial SP */
1011 int toc_save_offset; /* offset to save the TOC pointer */
1012 int varargs_save_offset; /* offset to save the varargs registers */
1013 int main_save_offset; /* offset to save main's args */
1014 int reg_size; /* register size (4 or 8) */
1015 int varargs_size; /* size to hold V.4 args passed in regs */
1016 int vars_size; /* variable save area size */
1017 int parm_size; /* outgoing parameter size */
1018 int main_size; /* size to hold saving main's args */
1019 int save_size; /* save area size */
1020 int fixed_size; /* fixed size of stack frame */
1021 int gp_size; /* size of saved GP registers */
1022 int fp_size; /* size of saved FP registers */
1023 int cr_size; /* size to hold CR if not in save_size */
1024 int lr_size; /* size to hold LR if not in save_size */
1025 int toc_size; /* size to hold TOC if not in save_size */
1026 int total_size; /* total bytes allocated for stack */
1027 } rs6000_stack_t;
1029 /* Define this if pushing a word on the stack
1030 makes the stack pointer a smaller address. */
1031 #define STACK_GROWS_DOWNWARD
1033 /* Define this if the nominal address of the stack frame
1034 is at the high-address end of the local variables;
1035 that is, each additional local variable allocated
1036 goes at a more negative offset in the frame.
1038 On the RS/6000, we grow upwards, from the area after the outgoing
1039 arguments. */
1040 /* #define FRAME_GROWS_DOWNWARD */
1042 /* Size of the outgoing register save area */
1043 #define RS6000_REG_SAVE (TARGET_64BIT ? 64 : 32)
1045 /* Size of the fixed area on the stack */
1046 #define RS6000_SAVE_AREA (TARGET_64BIT ? 48 : 24)
1048 /* Address to save the TOC register */
1049 #define RS6000_SAVE_TOC plus_constant (stack_pointer_rtx, 20)
1051 /* Whether a separate TOC save area is needed */
1052 extern int rs6000_save_toc_p;
1054 /* Size of the V.4 varargs area if needed */
1055 #define RS6000_VARARGS_AREA 0
1057 /* Whether a V.4 varargs area is needed */
1058 extern int rs6000_sysv_varargs_p;
1060 /* Align an address */
1061 #define ALIGN(n,a) (((n) + (a) - 1) & ~((a) - 1))
1063 /* Size of V.4 varargs area in bytes */
1064 #define RS6000_VARARGS_SIZE \
1065 ((GP_ARG_NUM_REG * (TARGET_64BIT ? 8 : 4)) + (FP_ARG_NUM_REG * 8) + 8)
1067 /* Offset of V.4 varargs area */
1068 #define RS6000_VARARGS_OFFSET \
1069 (ALIGN (current_function_outgoing_args_size, 8) + RS6000_SAVE_AREA)
1071 /* Offset within stack frame to start allocating local variables at.
1072 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
1073 first local allocated. Otherwise, it is the offset to the BEGINNING
1074 of the first local allocated.
1076 On the RS/6000, the frame pointer is the same as the stack pointer,
1077 except for dynamic allocations. So we start after the fixed area and
1078 outgoing parameter area. */
1080 #define STARTING_FRAME_OFFSET (ALIGN (current_function_outgoing_args_size, 8) \
1081 + RS6000_VARARGS_AREA \
1082 + RS6000_SAVE_AREA)
1084 /* If we generate an insn to push BYTES bytes,
1085 this says how many the stack pointer really advances by.
1086 On RS/6000, don't define this because there are no push insns. */
1087 /* #define PUSH_ROUNDING(BYTES) */
1089 /* Offset of first parameter from the argument pointer register value.
1090 On the RS/6000, we define the argument pointer to the start of the fixed
1091 area. */
1092 #define FIRST_PARM_OFFSET(FNDECL) RS6000_SAVE_AREA
1094 /* Define this if stack space is still allocated for a parameter passed
1095 in a register. The value is the number of bytes allocated to this
1096 area. */
1097 #define REG_PARM_STACK_SPACE(FNDECL) RS6000_REG_SAVE
1099 /* Define this if the above stack space is to be considered part of the
1100 space allocated by the caller. */
1101 #define OUTGOING_REG_PARM_STACK_SPACE
1103 /* This is the difference between the logical top of stack and the actual sp.
1105 For the RS/6000, sp points past the fixed area. */
1106 #define STACK_POINTER_OFFSET RS6000_SAVE_AREA
1108 /* Define this if the maximum size of all the outgoing args is to be
1109 accumulated and pushed during the prologue. The amount can be
1110 found in the variable current_function_outgoing_args_size. */
1111 #define ACCUMULATE_OUTGOING_ARGS
1113 /* Value is the number of bytes of arguments automatically
1114 popped when returning from a subroutine call.
1115 FUNDECL is the declaration node of the function (as a tree),
1116 FUNTYPE is the data type of the function (as a tree),
1117 or for a library call it is an identifier node for the subroutine name.
1118 SIZE is the number of bytes of arguments passed on the stack. */
1120 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
1122 /* Define how to find the value returned by a function.
1123 VALTYPE is the data type of the value (as a tree).
1124 If the precise function being called is known, FUNC is its FUNCTION_DECL;
1125 otherwise, FUNC is 0.
1127 On RS/6000 an integer value is in r3 and a floating-point value is in
1128 fp1, unless -msoft-float. */
1130 #define FUNCTION_VALUE(VALTYPE, FUNC) \
1131 gen_rtx (REG, TYPE_MODE (VALTYPE), \
1132 TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_HARD_FLOAT ? 33 : 3)
1134 /* Define how to find the value returned by a library function
1135 assuming the value has mode MODE. */
1137 #define LIBCALL_VALUE(MODE) \
1138 gen_rtx (REG, MODE, GET_MODE_CLASS (MODE) == MODE_FLOAT && TARGET_HARD_FLOAT ? 33 : 3)
1140 /* The definition of this macro implies that there are cases where
1141 a scalar value cannot be returned in registers.
1143 For the RS/6000, any structure or union type is returned in memory. */
1145 #define RETURN_IN_MEMORY(TYPE) \
1146 (TYPE_MODE (TYPE) == BLKmode)
1148 /* Minimum and maximum general purpose registers used to hold arguments. */
1149 #define GP_ARG_MIN_REG 3
1150 #define GP_ARG_MAX_REG 10
1151 #define GP_ARG_NUM_REG (GP_ARG_MAX_REG - GP_ARG_MIN_REG + 1)
1153 /* Minimum and maximum floating point registers used to hold arguments. */
1154 #define FP_ARG_MIN_REG 33
1155 #define FP_ARG_MAX_REG 45
1156 #define FP_ARG_NUM_REG (FP_ARG_MAX_REG - FP_ARG_MIN_REG + 1)
1158 /* Return registers */
1159 #define GP_ARG_RETURN GP_ARG_MIN_REG
1160 #define FP_ARG_RETURN FP_ARG_MIN_REG
1162 /* Define cutoff for using external functions to save floating point */
1163 #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) == 62 || (FIRST_REG) == 63)
1165 /* 1 if N is a possible register number for a function value
1166 as seen by the caller.
1168 On RS/6000, this is r3 and fp1. */
1169 #define FUNCTION_VALUE_REGNO_P(N) ((N) == GP_ARG_RETURN || ((N) == FP_ARG_RETURN))
1171 /* 1 if N is a possible register number for function argument passing.
1172 On RS/6000, these are r3-r10 and fp1-fp13. */
1173 #define FUNCTION_ARG_REGNO_P(N) \
1174 (((unsigned)((N) - GP_ARG_MIN_REG) < (unsigned)(GP_ARG_NUM_REG)) \
1175 || ((unsigned)((N) - FP_ARG_MIN_REG) < (unsigned)(FP_ARG_NUM_REG)))
1178 /* Define a data type for recording info about an argument list
1179 during the scan of that argument list. This data type should
1180 hold all necessary information about the function itself
1181 and about the args processed so far, enough to enable macros
1182 such as FUNCTION_ARG to determine where the next arg should go.
1184 On the RS/6000, this is a structure. The first element is the number of
1185 total argument words, the second is used to store the next
1186 floating-point register number, and the third says how many more args we
1187 have prototype types for.
1189 The System V.4 varargs/stdarg support requires that this structure's size
1190 be a multiple of sizeof(int), and that WORDS, FREGNO, NARGS_PROTOTYPE,
1191 ORIG_NARGS, and VARARGS_OFFSET be the first five ints. */
1193 typedef struct rs6000_args
1195 int words; /* # words uses for passing GP registers */
1196 int fregno; /* next available FP register */
1197 int nargs_prototype; /* # args left in the current prototype */
1198 int orig_nargs; /* Original value of nargs_prototype */
1199 int varargs_offset; /* offset of the varargs save area */
1200 int prototype; /* Whether a prototype was defined */
1201 } CUMULATIVE_ARGS;
1203 /* Define intermediate macro to compute the size (in registers) of an argument
1204 for the RS/6000. */
1206 #define RS6000_ARG_SIZE(MODE, TYPE, NAMED) \
1207 (! (NAMED) ? 0 \
1208 : (MODE) != BLKmode \
1209 ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \
1210 : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)
1212 /* Initialize a variable CUM of type CUMULATIVE_ARGS
1213 for a call to a function whose data type is FNTYPE.
1214 For a library call, FNTYPE is 0. */
1216 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME) \
1217 init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE)
1219 /* Similar, but when scanning the definition of a procedure. We always
1220 set NARGS_PROTOTYPE large so we never return an EXPR_LIST. */
1222 #define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,LIBNAME) \
1223 init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE)
1225 /* Update the data in CUM to advance over an argument
1226 of mode MODE and data type TYPE.
1227 (TYPE is null for libcalls where that information may not be available.) */
1229 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
1230 function_arg_advance (&CUM, MODE, TYPE, NAMED)
1232 /* Non-zero if we can use a floating-point register to pass this arg. */
1233 #define USE_FP_FOR_ARG_P(CUM,MODE,TYPE) \
1234 (GET_MODE_CLASS (MODE) == MODE_FLOAT \
1235 && (CUM).fregno <= FP_ARG_MAX_REG \
1236 && TARGET_HARD_FLOAT)
1238 /* Determine where to put an argument to a function.
1239 Value is zero to push the argument on the stack,
1240 or a hard register in which to store the argument.
1242 MODE is the argument's machine mode.
1243 TYPE is the data type of the argument (as a tree).
1244 This is null for libcalls where that information may
1245 not be available.
1246 CUM is a variable of type CUMULATIVE_ARGS which gives info about
1247 the preceding args and about the function being called.
1248 NAMED is nonzero if this argument is a named parameter
1249 (otherwise it is an extra parameter matching an ellipsis).
1251 On RS/6000 the first eight words of non-FP are normally in registers
1252 and the rest are pushed. The first 13 FP args are in registers.
1254 If this is floating-point and no prototype is specified, we use
1255 both an FP and integer register (or possibly FP reg and stack). Library
1256 functions (when TYPE is zero) always have the proper types for args,
1257 so we can pass the FP value just in one register. emit_library_function
1258 doesn't support EXPR_LIST anyway. */
1260 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
1261 function_arg (&CUM, MODE, TYPE, NAMED)
1263 /* For an arg passed partly in registers and partly in memory,
1264 this is the number of registers used.
1265 For args passed entirely in registers or entirely in memory, zero. */
1267 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
1268 function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
1270 /* A C expression that indicates when an argument must be passed by
1271 reference. If nonzero for an argument, a copy of that argument is
1272 made in memory and a pointer to the argument is passed instead of
1273 the argument itself. The pointer is passed in whatever way is
1274 appropriate for passing a pointer to that type. */
1276 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
1277 function_arg_pass_by_reference(&CUM, MODE, TYPE, NAMED)
1279 /* If defined, a C expression that gives the alignment boundary, in bits,
1280 of an argument with the specified mode and type. If it is not defined,
1281 PARM_BOUNDARY is used for all arguments. */
1283 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
1284 function_arg_boundary (MODE, TYPE)
1286 /* Perform any needed actions needed for a function that is receiving a
1287 variable number of arguments.
1289 CUM is as above.
1291 MODE and TYPE are the mode and type of the current parameter.
1293 PRETEND_SIZE is a variable that should be set to the amount of stack
1294 that must be pushed by the prolog to pretend that our caller pushed
1297 Normally, this macro will push all remaining incoming registers on the
1298 stack and set PRETEND_SIZE to the length of the registers pushed. */
1300 #define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \
1301 setup_incoming_varargs (&CUM, MODE, TYPE, &PRETEND_SIZE, NO_RTL)
1303 /* If defined, is a C expression that produces the machine-specific
1304 code for a call to `__builtin_saveregs'. This code will be moved
1305 to the very beginning of the function, before any parameter access
1306 are made. The return value of this function should be an RTX that
1307 contains the value to use as the return of `__builtin_saveregs'.
1309 The argument ARGS is a `tree_list' containing the arguments that
1310 were passed to `__builtin_saveregs'.
1312 If this macro is not defined, the compiler will output an ordinary
1313 call to the library function `__builtin_saveregs'. */
1315 #define EXPAND_BUILTIN_SAVEREGS(ARGS) \
1316 expand_builtin_saveregs (ARGS)
1318 /* This macro generates the assembly code for function entry.
1319 FILE is a stdio stream to output the code to.
1320 SIZE is an int: how many units of temporary storage to allocate.
1321 Refer to the array `regs_ever_live' to determine which registers
1322 to save; `regs_ever_live[I]' is nonzero if register number I
1323 is ever used in the function. This macro is responsible for
1324 knowing which registers should not be saved even if used. */
1326 #define FUNCTION_PROLOGUE(FILE, SIZE) output_prolog (FILE, SIZE)
1328 /* Output assembler code to FILE to increment profiler label # LABELNO
1329 for profiling a function entry. */
1331 #define FUNCTION_PROFILER(FILE, LABELNO) \
1332 output_function_profiler ((FILE), (LABELNO));
1334 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
1335 the stack pointer does not matter. No definition is equivalent to
1336 always zero.
1338 On the RS/6000, this is non-zero because we can restore the stack from
1339 its backpointer, which we maintain. */
1340 #define EXIT_IGNORE_STACK 1
1342 /* This macro generates the assembly code for function exit,
1343 on machines that need it. If FUNCTION_EPILOGUE is not defined
1344 then individual return instructions are generated for each
1345 return statement. Args are same as for FUNCTION_PROLOGUE.
1347 The function epilogue should not depend on the current stack pointer!
1348 It should use the frame pointer only. This is mandatory because
1349 of alloca; we also take advantage of it to omit stack adjustments
1350 before returning. */
1352 #define FUNCTION_EPILOGUE(FILE, SIZE) output_epilog (FILE, SIZE)
1354 /* Output assembler code for a block containing the constant parts
1355 of a trampoline, leaving space for the variable parts.
1357 The trampoline should set the static chain pointer to value placed
1358 into the trampoline and should branch to the specified routine. */
1359 #define TRAMPOLINE_TEMPLATE(FILE) rs6000_trampoline_template (FILE)
1361 /* Length in units of the trampoline for entering a nested function. */
1363 #define TRAMPOLINE_SIZE rs6000_trampoline_size ()
1365 /* Emit RTL insns to initialize the variable parts of a trampoline.
1366 FNADDR is an RTX for the address of the function's pure code.
1367 CXT is an RTX for the static chain value for the function. */
1369 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \
1370 rs6000_initialize_trampoline (ADDR, FNADDR, CXT)
1372 /* Definitions for __builtin_return_address and __builtin_frame_address.
1373 __builtin_return_address (0) should give link register (65), enable
1374 this. */
1375 /* This should be uncommented, so that the link register is used, but
1376 currently this would result in unmatched insns and spilling fixed
1377 registers so we'll leave it for another day. When these problems are
1378 taken care of one additional fetch will be necessary in RETURN_ADDR_RTX.
1379 (mrs) */
1380 /* #define RETURN_ADDR_IN_PREVIOUS_FRAME */
1382 /* Number of bytes into the frame return addresses can be found. See
1383 rs6000_stack_info in rs6000.c for more information on how the different
1384 abi's store the return address. */
1385 #define RETURN_ADDRESS_OFFSET \
1386 ((DEFAULT_ABI == ABI_AIX \
1387 || DEFAULT_ABI == ABI_AIX_NODESC) ? 8 : \
1388 (DEFAULT_ABI == ABI_V4) ? (TARGET_64BIT ? 8 : 4) : \
1389 (DEFAULT_ABI == ABI_NT) ? -4 : \
1390 (fatal ("RETURN_ADDRESS_OFFSET not supported"), 0))
1392 /* The current return address is in link register (65). The return address
1393 of anything farther back is accessed normally at an offset of 8 from the
1394 frame pointer. */
1395 #define RETURN_ADDR_RTX(count, frame) \
1396 ((count == -1) \
1397 ? gen_rtx (REG, Pmode, 65) \
1398 : gen_rtx (MEM, Pmode, \
1399 memory_address (Pmode, \
1400 plus_constant (copy_to_reg (gen_rtx (MEM, Pmode, \
1401 memory_address (Pmode, frame))), \
1402 RETURN_ADDRESS_OFFSET))))
1404 /* Definitions for register eliminations.
1406 We have two registers that can be eliminated on the RS/6000. First, the
1407 frame pointer register can often be eliminated in favor of the stack
1408 pointer register. Secondly, the argument pointer register can always be
1409 eliminated; it is replaced with either the stack or frame pointer.
1411 In addition, we use the elimination mechanism to see if r30 is needed
1412 Initially we assume that it isn't. If it is, we spill it. This is done
1413 by making it an eliminable register. We replace it with itself so that
1414 if it isn't needed, then existing uses won't be modified. */
1416 /* This is an array of structures. Each structure initializes one pair
1417 of eliminable registers. The "from" register number is given first,
1418 followed by "to". Eliminations of the same "from" register are listed
1419 in order of preference. */
1420 #define ELIMINABLE_REGS \
1421 {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1422 { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1423 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
1424 { 30, 30} }
1426 /* Given FROM and TO register numbers, say whether this elimination is allowed.
1427 Frame pointer elimination is automatically handled.
1429 For the RS/6000, if frame pointer elimination is being done, we would like
1430 to convert ap into fp, not sp.
1432 We need r30 if -mminimal-toc was specified, and there are constant pool
1433 references. */
1435 #define CAN_ELIMINATE(FROM, TO) \
1436 ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \
1437 ? ! frame_pointer_needed \
1438 : (FROM) == 30 ? ! TARGET_MINIMAL_TOC || TARGET_NO_TOC || get_pool_size () == 0 \
1439 : 1)
1441 /* Define the offset between two registers, one to be eliminated, and the other
1442 its replacement, at the start of a routine. */
1443 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1445 rs6000_stack_t *info = rs6000_stack_info (); \
1447 if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
1448 (OFFSET) = (info->push_p) ? 0 : - info->total_size; \
1449 else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \
1450 (OFFSET) = info->total_size; \
1451 else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
1452 (OFFSET) = (info->push_p) ? info->total_size : 0; \
1453 else if ((FROM) == 30) \
1454 (OFFSET) = 0; \
1455 else \
1456 abort (); \
1459 /* Addressing modes, and classification of registers for them. */
1461 /* #define HAVE_POST_INCREMENT */
1462 /* #define HAVE_POST_DECREMENT */
1464 #define HAVE_PRE_DECREMENT
1465 #define HAVE_PRE_INCREMENT
1467 /* Macros to check register numbers against specific register classes. */
1469 /* These assume that REGNO is a hard or pseudo reg number.
1470 They give nonzero only if REGNO is a hard reg of the suitable class
1471 or a pseudo reg currently allocated to a suitable hard reg.
1472 Since they use reg_renumber, they are safe only once reg_renumber
1473 has been allocated, which happens in local-alloc.c. */
1475 #define REGNO_OK_FOR_INDEX_P(REGNO) \
1476 ((REGNO) < FIRST_PSEUDO_REGISTER \
1477 ? (REGNO) <= 31 || (REGNO) == 67 \
1478 : (reg_renumber[REGNO] >= 0 \
1479 && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67)))
1481 #define REGNO_OK_FOR_BASE_P(REGNO) \
1482 ((REGNO) < FIRST_PSEUDO_REGISTER \
1483 ? ((REGNO) > 0 && (REGNO) <= 31) || (REGNO) == 67 \
1484 : (reg_renumber[REGNO] > 0 \
1485 && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67)))
1487 /* Maximum number of registers that can appear in a valid memory address. */
1489 #define MAX_REGS_PER_ADDRESS 2
1491 /* Recognize any constant value that is a valid address. */
1493 #define CONSTANT_ADDRESS_P(X) \
1494 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
1495 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
1496 || GET_CODE (X) == HIGH)
1498 /* Nonzero if the constant value X is a legitimate general operand.
1499 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.
1501 On the RS/6000, all integer constants are acceptable, most won't be valid
1502 for particular insns, though. Only easy FP constants are
1503 acceptable. */
1505 #define LEGITIMATE_CONSTANT_P(X) \
1506 (GET_CODE (X) != CONST_DOUBLE || GET_MODE (X) == VOIDmode \
1507 || easy_fp_constant (X, GET_MODE (X)))
1509 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
1510 and check its validity for a certain class.
1511 We have two alternate definitions for each of them.
1512 The usual definition accepts all pseudo regs; the other rejects
1513 them unless they have been allocated suitable hard regs.
1514 The symbol REG_OK_STRICT causes the latter definition to be used.
1516 Most source files want to accept pseudo regs in the hope that
1517 they will get allocated to the class that the insn wants them to be in.
1518 Source files for reload pass need to be strict.
1519 After reload, it makes no difference, since pseudo regs have
1520 been eliminated by then. */
1522 #ifndef REG_OK_STRICT
1524 /* Nonzero if X is a hard reg that can be used as an index
1525 or if it is a pseudo reg. */
1526 #define REG_OK_FOR_INDEX_P(X) \
1527 (REGNO (X) <= 31 || REGNO (X) == 67 || REGNO (X) >= FIRST_PSEUDO_REGISTER)
1529 /* Nonzero if X is a hard reg that can be used as a base reg
1530 or if it is a pseudo reg. */
1531 #define REG_OK_FOR_BASE_P(X) \
1532 (REGNO (X) > 0 && REG_OK_FOR_INDEX_P (X))
1534 #else
1536 /* Nonzero if X is a hard reg that can be used as an index. */
1537 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
1538 /* Nonzero if X is a hard reg that can be used as a base reg. */
1539 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
1541 #endif
1543 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
1544 that is a valid memory address for an instruction.
1545 The MODE argument is the machine mode for the MEM expression
1546 that wants to use this address.
1548 On the RS/6000, there are four valid address: a SYMBOL_REF that
1549 refers to a constant pool entry of an address (or the sum of it
1550 plus a constant), a short (16-bit signed) constant plus a register,
1551 the sum of two registers, or a register indirect, possibly with an
1552 auto-increment. For DFmode and DImode with an constant plus register,
1553 we must ensure that both words are addressable. */
1555 #define LEGITIMATE_CONSTANT_POOL_BASE_P(X) \
1556 (TARGET_TOC && GET_CODE (X) == SYMBOL_REF \
1557 && CONSTANT_POOL_ADDRESS_P (X) \
1558 && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (X)))
1560 #define LEGITIMATE_CONSTANT_POOL_ADDRESS_P(X) \
1561 (LEGITIMATE_CONSTANT_POOL_BASE_P (X) \
1562 || (TARGET_TOC \
1563 && GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
1564 && GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT \
1565 && LEGITIMATE_CONSTANT_POOL_BASE_P (XEXP (XEXP (X, 0), 0))))
1567 #define LEGITIMATE_ADDRESS_INTEGER_P(X,OFFSET) \
1568 (GET_CODE (X) == CONST_INT \
1569 && (unsigned) (INTVAL (X) + (OFFSET) + 0x8000) < 0x10000)
1571 #define LEGITIMATE_OFFSET_ADDRESS_P(MODE,X) \
1572 (GET_CODE (X) == PLUS \
1573 && GET_CODE (XEXP (X, 0)) == REG \
1574 && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
1575 && LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 0) \
1576 && (((MODE) != DFmode && (MODE) != DImode) \
1577 || LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 4)))
1579 #define LEGITIMATE_INDEXED_ADDRESS_P(X) \
1580 (GET_CODE (X) == PLUS \
1581 && GET_CODE (XEXP (X, 0)) == REG \
1582 && GET_CODE (XEXP (X, 1)) == REG \
1583 && ((REG_OK_FOR_BASE_P (XEXP (X, 0)) \
1584 && REG_OK_FOR_INDEX_P (XEXP (X, 1))) \
1585 || (REG_OK_FOR_BASE_P (XEXP (X, 1)) \
1586 && REG_OK_FOR_INDEX_P (XEXP (X, 0)))))
1588 #define LEGITIMATE_INDIRECT_ADDRESS_P(X) \
1589 (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X))
1591 #define LEGITIMATE_LO_SUM_ADDRESS_P(MODE, X) \
1592 (TARGET_ELF \
1593 && (MODE) != DImode \
1594 && (MODE) != TImode \
1595 && (TARGET_HARD_FLOAT || (MODE) != DFmode) \
1596 && GET_CODE (X) == LO_SUM \
1597 && GET_CODE (XEXP (X, 0)) == REG \
1598 && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
1599 && CONSTANT_P (XEXP (X, 1)))
1601 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
1602 { if (LEGITIMATE_INDIRECT_ADDRESS_P (X)) \
1603 goto ADDR; \
1604 if (GET_CODE (X) == PRE_INC \
1605 && LEGITIMATE_INDIRECT_ADDRESS_P (XEXP (X, 0))) \
1606 goto ADDR; \
1607 if (GET_CODE (X) == PRE_DEC \
1608 && LEGITIMATE_INDIRECT_ADDRESS_P (XEXP (X, 0))) \
1609 goto ADDR; \
1610 if (LEGITIMATE_CONSTANT_POOL_ADDRESS_P (X)) \
1611 goto ADDR; \
1612 if (LEGITIMATE_OFFSET_ADDRESS_P (MODE, X)) \
1613 goto ADDR; \
1614 if ((MODE) != DImode && (MODE) != TImode \
1615 && (TARGET_HARD_FLOAT || (MODE) != DFmode) \
1616 && LEGITIMATE_INDEXED_ADDRESS_P (X)) \
1617 goto ADDR; \
1618 if (LEGITIMATE_LO_SUM_ADDRESS_P (MODE, X)) \
1619 goto ADDR; \
1622 /* Try machine-dependent ways of modifying an illegitimate address
1623 to be legitimate. If we find one, return the new, valid address.
1624 This macro is used in only one place: `memory_address' in explow.c.
1626 OLDX is the address as it was before break_out_memory_refs was called.
1627 In some cases it is useful to look at this to decide what needs to be done.
1629 MODE and WIN are passed so that this macro can use
1630 GO_IF_LEGITIMATE_ADDRESS.
1632 It is always safe for this macro to do nothing. It exists to recognize
1633 opportunities to optimize the output.
1635 On RS/6000, first check for the sum of a register with a constant
1636 integer that is out of range. If so, generate code to add the
1637 constant with the low-order 16 bits masked to the register and force
1638 this result into another register (this can be done with `cau').
1639 Then generate an address of REG+(CONST&0xffff), allowing for the
1640 possibility of bit 16 being a one.
1642 Then check for the sum of a register and something not constant, try to
1643 load the other things into a register and return the sum. */
1645 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
1646 { if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \
1647 && GET_CODE (XEXP (X, 1)) == CONST_INT \
1648 && (unsigned) (INTVAL (XEXP (X, 1)) + 0x8000) >= 0x10000) \
1649 { int high_int, low_int; \
1650 high_int = INTVAL (XEXP (X, 1)) >> 16; \
1651 low_int = INTVAL (XEXP (X, 1)) & 0xffff; \
1652 if (low_int & 0x8000) \
1653 high_int += 1, low_int |= 0xffff0000; \
1654 (X) = gen_rtx (PLUS, SImode, \
1655 force_operand \
1656 (gen_rtx (PLUS, SImode, XEXP (X, 0), \
1657 gen_rtx (CONST_INT, VOIDmode, \
1658 high_int << 16)), 0), \
1659 gen_rtx (CONST_INT, VOIDmode, low_int)); \
1660 goto WIN; \
1662 else if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \
1663 && GET_CODE (XEXP (X, 1)) != CONST_INT \
1664 && (TARGET_HARD_FLOAT || (MODE) != DFmode) \
1665 && (MODE) != DImode && (MODE) != TImode) \
1667 (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \
1668 force_reg (SImode, force_operand (XEXP (X, 1), 0))); \
1669 goto WIN; \
1671 else if (TARGET_ELF && !TARGET_64BIT && TARGET_NO_TOC \
1672 && GET_CODE (X) != CONST_INT \
1673 && GET_CODE (X) != CONST_DOUBLE && CONSTANT_P (X) \
1674 && (TARGET_HARD_FLOAT || (MODE) != DFmode) \
1675 && (MODE) != DImode && (MODE) != TImode) \
1677 rtx reg = gen_reg_rtx (Pmode); \
1678 emit_insn (gen_elf_high (reg, (X))); \
1679 (X) = gen_rtx (LO_SUM, Pmode, reg, (X)); \
1683 /* Go to LABEL if ADDR (a legitimate address expression)
1684 has an effect that depends on the machine mode it is used for.
1686 On the RS/6000 this is true if the address is valid with a zero offset
1687 but not with an offset of four (this means it cannot be used as an
1688 address for DImode or DFmode) or is a pre-increment or decrement. Since
1689 we know it is valid, we just check for an address that is not valid with
1690 an offset of four. */
1692 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
1693 { if (GET_CODE (ADDR) == PLUS \
1694 && LEGITIMATE_ADDRESS_INTEGER_P (XEXP (ADDR, 1), 0) \
1695 && ! LEGITIMATE_ADDRESS_INTEGER_P (XEXP (ADDR, 1), 4)) \
1696 goto LABEL; \
1697 if (GET_CODE (ADDR) == PRE_INC) \
1698 goto LABEL; \
1699 if (GET_CODE (ADDR) == PRE_DEC) \
1700 goto LABEL; \
1701 if (GET_CODE (ADDR) == LO_SUM) \
1702 goto LABEL; \
1705 /* Define this if some processing needs to be done immediately before
1706 emitting code for an insn. */
1708 /* #define FINAL_PRESCAN_INSN(INSN,OPERANDS,NOPERANDS) */
1710 /* Specify the machine mode that this machine uses
1711 for the index in the tablejump instruction. */
1712 #define CASE_VECTOR_MODE SImode
1714 /* Define this if the tablejump instruction expects the table
1715 to contain offsets from the address of the table.
1716 Do not define this if the table should contain absolute addresses. */
1717 #define CASE_VECTOR_PC_RELATIVE
1719 /* Specify the tree operation to be used to convert reals to integers. */
1720 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
1722 /* This is the kind of divide that is easiest to do in the general case. */
1723 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
1725 /* Define this as 1 if `char' should by default be signed; else as 0. */
1726 #define DEFAULT_SIGNED_CHAR 0
1728 /* This flag, if defined, says the same insns that convert to a signed fixnum
1729 also convert validly to an unsigned one. */
1731 /* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC */
1733 /* Max number of bytes we can move from memory to memory
1734 in one reasonably fast instruction. */
1735 #define MOVE_MAX (TARGET_POWERPC64 ? 8 : 4)
1736 #define MAX_MOVE_MAX 8
1738 /* Nonzero if access to memory by bytes is no faster than for words.
1739 Also non-zero if doing byte operations (specifically shifts) in registers
1740 is undesirable. */
1741 #define SLOW_BYTE_ACCESS 1
1743 /* Define if operations between registers always perform the operation
1744 on the full register even if a narrower mode is specified. */
1745 #define WORD_REGISTER_OPERATIONS
1747 /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
1748 will either zero-extend or sign-extend. The value of this macro should
1749 be the code that says which one of the two operations is implicitly
1750 done, NIL if none. */
1751 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
1753 /* Define if loading short immediate values into registers sign extends. */
1754 #define SHORT_IMMEDIATES_SIGN_EXTEND
1756 /* The RS/6000 uses the XCOFF format. */
1758 #define XCOFF_DEBUGGING_INFO
1760 /* Define if the object format being used is COFF or a superset. */
1761 #define OBJECT_FORMAT_COFF
1763 /* Define the magic numbers that we recognize as COFF. */
1765 #define MY_ISCOFF(magic) \
1766 ((magic) == U802WRMAGIC || (magic) == U802ROMAGIC || (magic) == U802TOCMAGIC)
1768 /* This is the only version of nm that collect2 can work with. */
1769 #define REAL_NM_FILE_NAME "/usr/ucb/nm"
1771 /* We don't have GAS for the RS/6000 yet, so don't write out special
1772 .stabs in cc1plus. */
1774 #define FASCIST_ASSEMBLER
1776 #ifndef ASM_OUTPUT_CONSTRUCTOR
1777 #define ASM_OUTPUT_CONSTRUCTOR(file, name)
1778 #endif
1779 #ifndef ASM_OUTPUT_DESTRUCTOR
1780 #define ASM_OUTPUT_DESTRUCTOR(file, name)
1781 #endif
1783 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
1784 is done just by pretending it is already truncated. */
1785 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
1787 /* Specify the machine mode that pointers have.
1788 After generation of rtl, the compiler makes no further distinction
1789 between pointers and any other objects of this machine mode. */
1790 #define Pmode (TARGET_64BIT ? DImode : SImode)
1792 /* Mode of a function address in a call instruction (for indexing purposes).
1794 Doesn't matter on RS/6000. */
1795 #define FUNCTION_MODE (TARGET_64BIT ? DImode : SImode)
1797 /* Define this if addresses of constant functions
1798 shouldn't be put through pseudo regs where they can be cse'd.
1799 Desirable on machines where ordinary constants are expensive
1800 but a CALL with constant address is cheap. */
1801 #define NO_FUNCTION_CSE
1803 /* Define this to be nonzero if shift instructions ignore all but the low-order
1804 few bits.
1806 The sle and sre instructions which allow SHIFT_COUNT_TRUNCATED
1807 have been dropped from the PowerPC architecture. */
1809 #define SHIFT_COUNT_TRUNCATED (TARGET_POWER ? 1 : 0)
1811 /* Use atexit for static constructors/destructors, instead of defining
1812 our own exit function. */
1813 #define HAVE_ATEXIT
1815 /* Compute the cost of computing a constant rtl expression RTX
1816 whose rtx-code is CODE. The body of this macro is a portion
1817 of a switch statement. If the code is computed here,
1818 return it with a return statement. Otherwise, break from the switch.
1820 On the RS/6000, if it is valid in the insn, it is free. So this
1821 always returns 0. */
1823 #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
1824 case CONST_INT: \
1825 case CONST: \
1826 case LABEL_REF: \
1827 case SYMBOL_REF: \
1828 case CONST_DOUBLE: \
1829 case HIGH: \
1830 return 0;
1832 /* Provide the costs of a rtl expression. This is in the body of a
1833 switch on CODE. */
1835 #define RTX_COSTS(X,CODE,OUTER_CODE) \
1836 case MULT: \
1837 switch (rs6000_cpu) \
1839 case PROCESSOR_RIOS1: \
1840 return (GET_CODE (XEXP (X, 1)) != CONST_INT \
1841 ? COSTS_N_INSNS (5) \
1842 : INTVAL (XEXP (X, 1)) >= -256 && INTVAL (XEXP (X, 1)) <= 255 \
1843 ? COSTS_N_INSNS (3) : COSTS_N_INSNS (4)); \
1844 case PROCESSOR_RIOS2: \
1845 return COSTS_N_INSNS (2); \
1846 case PROCESSOR_PPC601: \
1847 case PROCESSOR_PPC603: \
1848 return COSTS_N_INSNS (5); \
1849 case PROCESSOR_PPC403: \
1850 case PROCESSOR_PPC604: \
1851 case PROCESSOR_PPC620: \
1852 return COSTS_N_INSNS (4); \
1854 case DIV: \
1855 case MOD: \
1856 if (GET_CODE (XEXP (X, 1)) == CONST_INT \
1857 && exact_log2 (INTVAL (XEXP (X, 1))) >= 0) \
1858 return COSTS_N_INSNS (2); \
1859 /* otherwise fall through to normal divide. */ \
1860 case UDIV: \
1861 case UMOD: \
1862 switch (rs6000_cpu) \
1864 case PROCESSOR_RIOS1: \
1865 return COSTS_N_INSNS (19); \
1866 case PROCESSOR_RIOS2: \
1867 return COSTS_N_INSNS (13); \
1868 case PROCESSOR_PPC403: \
1869 return COSTS_N_INSNS (33); \
1870 case PROCESSOR_PPC601: \
1871 return COSTS_N_INSNS (36); \
1872 case PROCESSOR_PPC603: \
1873 return COSTS_N_INSNS (37); \
1874 case PROCESSOR_PPC604: \
1875 case PROCESSOR_PPC620: \
1876 return COSTS_N_INSNS (20); \
1878 case FFS: \
1879 return COSTS_N_INSNS (4); \
1880 case MEM: \
1881 /* MEM should be slightly more expensive than (plus (reg) (const)) */ \
1882 return 5;
1884 /* Compute the cost of an address. This is meant to approximate the size
1885 and/or execution delay of an insn using that address. If the cost is
1886 approximated by the RTL complexity, including CONST_COSTS above, as
1887 is usually the case for CISC machines, this macro should not be defined.
1888 For aggressively RISCy machines, only one insn format is allowed, so
1889 this macro should be a constant. The value of this macro only matters
1890 for valid addresses.
1892 For the RS/6000, everything is cost 0. */
1894 #define ADDRESS_COST(RTX) 0
1896 /* Adjust the length of an INSN. LENGTH is the currently-computed length and
1897 should be adjusted to reflect any required changes. This macro is used when
1898 there is some systematic length adjustment required that would be difficult
1899 to express in the length attribute. */
1901 /* #define ADJUST_INSN_LENGTH(X,LENGTH) */
1903 /* Add any extra modes needed to represent the condition code.
1905 For the RS/6000, we need separate modes when unsigned (logical) comparisons
1906 are being done and we need a separate mode for floating-point. We also
1907 use a mode for the case when we are comparing the results of two
1908 comparisons. */
1910 #define EXTRA_CC_MODES CCUNSmode, CCFPmode, CCEQmode
1912 /* Define the names for the modes specified above. */
1913 #define EXTRA_CC_NAMES "CCUNS", "CCFP", "CCEQ"
1915 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
1916 return the mode to be used for the comparison. For floating-point, CCFPmode
1917 should be used. CCUNSmode should be used for unsigned comparisons.
1918 CCEQmode should be used when we are doing an inequality comparison on
1919 the result of a comparison. CCmode should be used in all other cases. */
1921 #define SELECT_CC_MODE(OP,X,Y) \
1922 (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? CCFPmode \
1923 : (OP) == GTU || (OP) == LTU || (OP) == GEU || (OP) == LEU ? CCUNSmode \
1924 : (((OP) == EQ || (OP) == NE) && GET_RTX_CLASS (GET_CODE (X)) == '<' \
1925 ? CCEQmode : CCmode))
1927 /* Define the information needed to generate branch and scc insns. This is
1928 stored from the compare operation. Note that we can't use "rtx" here
1929 since it hasn't been defined! */
1931 extern struct rtx_def *rs6000_compare_op0, *rs6000_compare_op1;
1932 extern int rs6000_compare_fp_p;
1934 /* Set to non-zero by "fix" operation to indicate that itrunc and
1935 uitrunc must be defined. */
1937 extern int rs6000_trunc_used;
1939 /* Function names to call to do floating point truncation. */
1941 #define RS6000_ITRUNC "itrunc"
1942 #define RS6000_UITRUNC "uitrunc"
1944 /* Prefix and suffix to use to saving floating point */
1945 #ifndef SAVE_FP_PREFIX
1946 #define SAVE_FP_PREFIX "._savef"
1947 #define SAVE_FP_SUFFIX ""
1948 #endif
1950 /* Prefix and suffix to use to restoring floating point */
1951 #ifndef RESTORE_FP_PREFIX
1952 #define RESTORE_FP_PREFIX "._restf"
1953 #define RESTORE_FP_SUFFIX ""
1954 #endif
1957 /* Control the assembler format that we output. */
1959 /* Common macro to output the options used to the asm file. */
1960 #define ASM_OUTPUT_OPTIONS(FILE) \
1961 output_options (FILE, \
1962 f_options, sizeof (f_options) / sizeof (f_options[0]), \
1963 W_options, sizeof (W_options) / sizeof (W_options[0])) \
1965 /* Output at beginning of assembler file.
1967 Initialize the section names for the RS/6000 at this point.
1969 Specify filename to assembler.
1971 We want to go into the TOC section so at least one .toc will be emitted.
1972 Also, in order to output proper .bs/.es pairs, we need at least one static
1973 [RW] section emitted.
1975 We then switch back to text to force the gcc2_compiled. label and the space
1976 allocated after it (when profiling) into the text section.
1978 Finally, declare mcount when profiling to make the assembler happy. */
1980 #define ASM_FILE_START(FILE) \
1982 ASM_OUTPUT_OPTIONS (FILE); \
1983 rs6000_gen_section_name (&xcoff_bss_section_name, \
1984 main_input_filename, ".bss_"); \
1985 rs6000_gen_section_name (&xcoff_private_data_section_name, \
1986 main_input_filename, ".rw_"); \
1987 rs6000_gen_section_name (&xcoff_read_only_section_name, \
1988 main_input_filename, ".ro_"); \
1990 output_file_directive (FILE, main_input_filename); \
1991 toc_section (); \
1992 if (write_symbols != NO_DEBUG) \
1993 private_data_section (); \
1994 text_section (); \
1995 if (profile_flag) \
1996 fputs ("\t.extern .mcount\n", FILE); \
1999 /* Output at end of assembler file.
2001 On the RS/6000, referencing data should automatically pull in text. */
2003 #define ASM_FILE_END(FILE) \
2005 text_section (); \
2006 fputs ("_section_.text:\n", FILE); \
2007 data_section (); \
2008 fputs ("\t.long _section_.text\n", FILE); \
2011 /* We define this to prevent the name mangler from putting dollar signs into
2012 function names. */
2014 #define NO_DOLLAR_IN_LABEL
2016 /* We define this to 0 so that gcc will never accept a dollar sign in a
2017 variable name. This is needed because the AIX assembler will not accept
2018 dollar signs. */
2020 #define DOLLARS_IN_IDENTIFIERS 0
2022 /* Implicit library calls should use memcpy, not bcopy, etc. */
2024 #define TARGET_MEM_FUNCTIONS
2026 /* Define the extra sections we need. We define three: one is the read-only
2027 data section which is used for constants. This is a csect whose name is
2028 derived from the name of the input file. The second is for initialized
2029 global variables. This is a csect whose name is that of the variable.
2030 The third is the TOC. */
2032 #define EXTRA_SECTIONS \
2033 read_only_data, private_data, read_only_private_data, toc, bss
2035 /* Define the name of our readonly data section. */
2037 #define READONLY_DATA_SECTION read_only_data_section
2039 /* If we are referencing a function that is static or is known to be
2040 in this file, make the SYMBOL_REF special. We can use this to indicate
2041 that we can branch to this function without emitting a no-op after the
2042 call. */
2044 #define ENCODE_SECTION_INFO(DECL) \
2045 if (TREE_CODE (DECL) == FUNCTION_DECL \
2046 && (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL))) \
2047 SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;
2049 /* Indicate that jump tables go in the text section. */
2051 #define JUMP_TABLES_IN_TEXT_SECTION
2053 /* Define the routines to implement these extra sections. */
2055 #define EXTRA_SECTION_FUNCTIONS \
2057 void \
2058 read_only_data_section () \
2060 if (in_section != read_only_data) \
2062 fprintf (asm_out_file, ".csect %s[RO]\n", \
2063 xcoff_read_only_section_name); \
2064 in_section = read_only_data; \
2068 void \
2069 private_data_section () \
2071 if (in_section != private_data) \
2073 fprintf (asm_out_file, ".csect %s[RW]\n", \
2074 xcoff_private_data_section_name); \
2076 in_section = private_data; \
2080 void \
2081 read_only_private_data_section () \
2083 if (in_section != read_only_private_data) \
2085 fprintf (asm_out_file, ".csect %s[RO]\n", \
2086 xcoff_private_data_section_name); \
2087 in_section = read_only_private_data; \
2091 void \
2092 toc_section () \
2094 if (TARGET_MINIMAL_TOC) \
2096 static int toc_initialized = 0; \
2098 /* toc_section is always called at least once from ASM_FILE_START, \
2099 so this is guaranteed to always be defined once and only once \
2100 in each file. */ \
2101 if (! toc_initialized) \
2103 fputs (".toc\nLCTOC..0:\n", asm_out_file); \
2104 fputs ("\t.tc toc_table[TC],toc_table[RW]\n", asm_out_file); \
2105 toc_initialized = 1; \
2108 if (in_section != toc) \
2109 fputs (".csect toc_table[RW]\n", asm_out_file); \
2111 else \
2113 if (in_section != toc) \
2114 fputs (".toc\n", asm_out_file); \
2116 in_section = toc; \
2119 /* This macro produces the initial definition of a function name.
2120 On the RS/6000, we need to place an extra '.' in the function name and
2121 output the function descriptor.
2123 The csect for the function will have already been created by the
2124 `text_section' call previously done. We do have to go back to that
2125 csect, however. */
2127 /* ??? What do the 16 and 044 in the .function line really mean? */
2129 #define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
2130 { if (TREE_PUBLIC (DECL)) \
2132 fputs ("\t.globl .", FILE); \
2133 RS6000_OUTPUT_BASENAME (FILE, NAME); \
2134 putc ('\n', FILE); \
2136 else \
2138 fputs ("\t.lglobl .", FILE); \
2139 RS6000_OUTPUT_BASENAME (FILE, NAME); \
2140 putc ('\n', FILE); \
2142 fputs (".csect ", FILE); \
2143 RS6000_OUTPUT_BASENAME (FILE, NAME); \
2144 fputs ("[DS]\n", FILE); \
2145 RS6000_OUTPUT_BASENAME (FILE, NAME); \
2146 fputs (":\n", FILE); \
2147 fputs ("\t.long .", FILE); \
2148 RS6000_OUTPUT_BASENAME (FILE, NAME); \
2149 fputs (", TOC[tc0], 0\n", FILE); \
2150 fputs (".csect .text[PR]\n.", FILE); \
2151 RS6000_OUTPUT_BASENAME (FILE, NAME); \
2152 fputs (":\n", FILE); \
2153 if (write_symbols == XCOFF_DEBUG) \
2154 xcoffout_declare_function (FILE, DECL, NAME); \
2157 /* Return non-zero if this entry is to be written into the constant pool
2158 in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
2159 containing one of them. If -mfp-in-toc (the default), we also do
2160 this for floating-point constants. We actually can only do this
2161 if the FP formats of the target and host machines are the same, but
2162 we can't check that since not every file that uses
2163 GO_IF_LEGITIMATE_ADDRESS_P includes real.h. */
2165 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X) \
2166 (TARGET_TOC \
2167 && (GET_CODE (X) == SYMBOL_REF \
2168 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
2169 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
2170 || GET_CODE (X) == LABEL_REF \
2171 || (! (TARGET_NO_FP_IN_TOC && ! TARGET_MINIMAL_TOC) \
2172 && GET_CODE (X) == CONST_DOUBLE \
2173 && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
2174 && BITS_PER_WORD == HOST_BITS_PER_INT)))
2176 /* Select section for constant in constant pool.
2178 On RS/6000, all constants are in the private read-only data area.
2179 However, if this is being placed in the TOC it must be output as a
2180 toc entry. */
2182 #define SELECT_RTX_SECTION(MODE, X) \
2183 { if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X)) \
2184 toc_section (); \
2185 else \
2186 read_only_private_data_section (); \
2189 /* Macro to output a special constant pool entry. Go to WIN if we output
2190 it. Otherwise, it is written the usual way.
2192 On the RS/6000, toc entries are handled this way. */
2194 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, X, MODE, ALIGN, LABELNO, WIN) \
2195 { if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X)) \
2197 output_toc (FILE, X, LABELNO); \
2198 goto WIN; \
2202 /* Select the section for an initialized data object.
2204 On the RS/6000, we have a special section for all variables except those
2205 that are static. */
2207 #define SELECT_SECTION(EXP,RELOC) \
2209 if ((TREE_CODE (EXP) == STRING_CST \
2210 && !flag_writable_strings) \
2211 || (TREE_CODE_CLASS (TREE_CODE (EXP)) == 'd' \
2212 && TREE_READONLY (EXP) && ! TREE_THIS_VOLATILE (EXP) \
2213 && DECL_INITIAL (EXP) \
2214 && (DECL_INITIAL (EXP) == error_mark_node \
2215 || TREE_CONSTANT (DECL_INITIAL (EXP))) \
2216 && ! (RELOC))) \
2218 if (TREE_PUBLIC (EXP)) \
2219 read_only_data_section (); \
2220 else \
2221 read_only_private_data_section (); \
2223 else \
2225 if (TREE_PUBLIC (EXP)) \
2226 data_section (); \
2227 else \
2228 private_data_section (); \
2232 /* This outputs NAME to FILE up to the first null or '['. */
2234 #define RS6000_OUTPUT_BASENAME(FILE, NAME) \
2236 char *_p; \
2238 STRIP_NAME_ENCODING (_p, (NAME)); \
2239 assemble_name ((FILE), _p); \
2242 /* Remove any trailing [DS] or the like from the symbol name. */
2244 #define STRIP_NAME_ENCODING(VAR,NAME) \
2245 do \
2247 char *_name = (NAME); \
2248 int _len; \
2249 if (_name[0] == '*') \
2250 _name++; \
2251 _len = strlen (_name); \
2252 if (_name[_len - 1] != ']') \
2253 (VAR) = _name; \
2254 else \
2256 (VAR) = (char *) alloca (_len + 1); \
2257 strcpy ((VAR), _name); \
2258 (VAR)[_len - 4] = '\0'; \
2261 while (0)
2263 /* Output something to declare an external symbol to the assembler. Most
2264 assemblers don't need this.
2266 If we haven't already, add "[RW]" (or "[DS]" for a function) to the
2267 name. Normally we write this out along with the name. In the few cases
2268 where we can't, it gets stripped off. */
2270 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
2271 { rtx _symref = XEXP (DECL_RTL (DECL), 0); \
2272 if ((TREE_CODE (DECL) == VAR_DECL \
2273 || TREE_CODE (DECL) == FUNCTION_DECL) \
2274 && (NAME)[0] != '*' \
2275 && (NAME)[strlen (NAME) - 1] != ']') \
2277 char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
2278 strcpy (_name, XSTR (_symref, 0)); \
2279 strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \
2280 XSTR (_symref, 0) = _name; \
2282 fputs ("\t.extern ", FILE); \
2283 assemble_name (FILE, XSTR (_symref, 0)); \
2284 if (TREE_CODE (DECL) == FUNCTION_DECL) \
2286 fputs ("\n\t.extern .", FILE); \
2287 RS6000_OUTPUT_BASENAME (FILE, XSTR (_symref, 0)); \
2289 putc ('\n', FILE); \
2292 /* Similar, but for libcall. We only have to worry about the function name,
2293 not that of the descriptor. */
2295 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
2296 { fputs ("\t.extern .", FILE); \
2297 assemble_name (FILE, XSTR (FUN, 0)); \
2298 putc ('\n', FILE); \
2301 /* Output to assembler file text saying following lines
2302 may contain character constants, extra white space, comments, etc. */
2304 #define ASM_APP_ON ""
2306 /* Output to assembler file text saying following lines
2307 no longer contain unusual constructs. */
2309 #define ASM_APP_OFF ""
2311 /* Output before instructions. */
2313 #define TEXT_SECTION_ASM_OP ".csect .text[PR]"
2315 /* Output before writable data. */
2317 #define DATA_SECTION_ASM_OP ".csect .data[RW]"
2319 /* How to refer to registers in assembler output.
2320 This sequence is indexed by compiler's hard-register-number (see above). */
2322 #define REGISTER_NAMES \
2323 {"0", "1", "2", "3", "4", "5", "6", "7", \
2324 "8", "9", "10", "11", "12", "13", "14", "15", \
2325 "16", "17", "18", "19", "20", "21", "22", "23", \
2326 "24", "25", "26", "27", "28", "29", "30", "31", \
2327 "0", "1", "2", "3", "4", "5", "6", "7", \
2328 "8", "9", "10", "11", "12", "13", "14", "15", \
2329 "16", "17", "18", "19", "20", "21", "22", "23", \
2330 "24", "25", "26", "27", "28", "29", "30", "31", \
2331 "mq", "lr", "ctr", "ap", \
2332 "0", "1", "2", "3", "4", "5", "6", "7" }
2334 /* Table of additional register names to use in user input. */
2336 #define ADDITIONAL_REGISTER_NAMES \
2337 {"r0", 0, "r1", 1, "r2", 2, "r3", 3, \
2338 "r4", 4, "r5", 5, "r6", 6, "r7", 7, \
2339 "r8", 8, "r9", 9, "r10", 10, "r11", 11, \
2340 "r12", 12, "r13", 13, "r14", 14, "r15", 15, \
2341 "r16", 16, "r17", 17, "r18", 18, "r19", 19, \
2342 "r20", 20, "r21", 21, "r22", 22, "r23", 23, \
2343 "r24", 24, "r25", 25, "r26", 26, "r27", 27, \
2344 "r28", 28, "r29", 29, "r30", 30, "r31", 31, \
2345 "fr0", 32, "fr1", 33, "fr2", 34, "fr3", 35, \
2346 "fr4", 36, "fr5", 37, "fr6", 38, "fr7", 39, \
2347 "fr8", 40, "fr9", 41, "fr10", 42, "fr11", 43, \
2348 "fr12", 44, "fr13", 45, "fr14", 46, "fr15", 47, \
2349 "fr16", 48, "fr17", 49, "fr18", 50, "fr19", 51, \
2350 "fr20", 52, "fr21", 53, "fr22", 54, "fr23", 55, \
2351 "fr24", 56, "fr25", 57, "fr26", 58, "fr27", 59, \
2352 "fr28", 60, "fr29", 61, "fr30", 62, "fr31", 63, \
2353 /* no additional names for: mq, lr, ctr, ap */ \
2354 "cr0", 68, "cr1", 69, "cr2", 70, "cr3", 71, \
2355 "cr4", 72, "cr5", 73, "cr6", 74, "cr7", 75, \
2356 "cc", 68 }
2358 /* How to renumber registers for dbx and gdb. */
2360 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
2362 /* Text to write out after a CALL that may be replaced by glue code by
2363 the loader. This depends on the AIX version. */
2364 #define RS6000_CALL_GLUE "cror 31,31,31"
2366 /* This is how to output the definition of a user-level label named NAME,
2367 such as the label on a static function or variable NAME. */
2369 #define ASM_OUTPUT_LABEL(FILE,NAME) \
2370 do { RS6000_OUTPUT_BASENAME (FILE, NAME); fputs (":\n", FILE); } while (0)
2372 /* This is how to output a command to make the user-level label named NAME
2373 defined for reference from other files. */
2375 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
2376 do { fputs ("\t.globl ", FILE); \
2377 RS6000_OUTPUT_BASENAME (FILE, NAME); fputs ("\n", FILE);} while (0)
2379 /* This is how to output a reference to a user-level label named NAME.
2380 `assemble_name' uses this. */
2382 #define ASM_OUTPUT_LABELREF(FILE,NAME) \
2383 fprintf (FILE, NAME)
2385 /* This is how to output an internal numbered label where
2386 PREFIX is the class of label and NUM is the number within the class. */
2388 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
2389 fprintf (FILE, "%s..%d:\n", PREFIX, NUM)
2391 /* This is how to output an internal label prefix. rs6000.c uses this
2392 when generating traceback tables. */
2394 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \
2395 fprintf (FILE, "%s..", PREFIX)
2397 /* This is how to output a label for a jump table. Arguments are the same as
2398 for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is
2399 passed. */
2401 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
2402 { ASM_OUTPUT_ALIGN (FILE, 2); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
2404 /* This is how to store into the string LABEL
2405 the symbol_ref name of an internal numbered label where
2406 PREFIX is the class of label and NUM is the number within the class.
2407 This is suitable for output with `assemble_name'. */
2409 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
2410 sprintf (LABEL, "*%s..%d", PREFIX, NUM)
2412 /* This is how to output an assembler line defining a `double' constant. */
2414 #define ASM_OUTPUT_DOUBLE(FILE, VALUE) \
2416 if (REAL_VALUE_ISINF (VALUE) \
2417 || REAL_VALUE_ISNAN (VALUE) \
2418 || REAL_VALUE_MINUS_ZERO (VALUE)) \
2420 long t[2]; \
2421 REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t); \
2422 fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", \
2423 t[0] & 0xffffffff, t[1] & 0xffffffff); \
2425 else \
2427 char str[30]; \
2428 REAL_VALUE_TO_DECIMAL (VALUE, "%.20e", str); \
2429 fprintf (FILE, "\t.double 0d%s\n", str); \
2433 /* This is how to output an assembler line defining a `float' constant. */
2435 #define ASM_OUTPUT_FLOAT(FILE, VALUE) \
2437 if (REAL_VALUE_ISINF (VALUE) \
2438 || REAL_VALUE_ISNAN (VALUE) \
2439 || REAL_VALUE_MINUS_ZERO (VALUE)) \
2441 long t; \
2442 REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \
2443 fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \
2445 else \
2447 char str[30]; \
2448 REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \
2449 fprintf (FILE, "\t.float 0d%s\n", str); \
2453 /* This is how to output an assembler line defining an `int' constant. */
2455 #define ASM_OUTPUT_INT(FILE,VALUE) \
2456 ( fputs ("\t.long ", FILE), \
2457 output_addr_const (FILE, (VALUE)), \
2458 putc ('\n', FILE))
2460 /* Likewise for `char' and `short' constants. */
2462 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
2463 ( fputs ("\t.short ", FILE), \
2464 output_addr_const (FILE, (VALUE)), \
2465 putc ('\n', FILE))
2467 #define ASM_OUTPUT_CHAR(FILE,VALUE) \
2468 ( fputs ("\t.byte ", FILE), \
2469 output_addr_const (FILE, (VALUE)), \
2470 putc ('\n', FILE))
2472 /* This is how to output an assembler line for a numeric constant byte. */
2474 #define ASM_OUTPUT_BYTE(FILE,VALUE) \
2475 fprintf (FILE, "\t.byte 0x%x\n", (VALUE))
2477 /* This is how to output an assembler line to define N characters starting
2478 at P to FILE. */
2480 #define ASM_OUTPUT_ASCII(FILE, P, N) output_ascii ((FILE), (P), (N))
2482 /* This is how to output code to push a register on the stack.
2483 It need not be very fast code. */
2485 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
2486 do { \
2487 extern char *reg_names[]; \
2488 asm_fprintf (FILE, "\{tstu|stwu} %s,-4(%s)\n", reg_names[REGNO], \
2489 reg_names[1]); \
2490 } while (0)
2492 /* This is how to output an insn to pop a register from the stack.
2493 It need not be very fast code. */
2495 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
2496 do { \
2497 extern char *reg_names[]; \
2498 asm_fprintf (FILE, "\t{l|lwz} %s,0(%s)\n\t{ai|addic} %s,%s,4\n", \
2499 reg_names[REGNO], reg_names[1], reg_names[1], \
2500 reg_names[1]); \
2501 } while (0)
2503 /* This is how to output an element of a case-vector that is absolute.
2504 (RS/6000 does not use such vectors, but we must define this macro
2505 anyway.) */
2507 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
2508 do { char buf[100]; \
2509 fputs ("\t.long ", FILE); \
2510 ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \
2511 assemble_name (FILE, buf); \
2512 putc ('\n', FILE); \
2513 } while (0)
2515 /* This is how to output an element of a case-vector that is relative. */
2517 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
2518 do { char buf[100]; \
2519 fputs ("\t.long ", FILE); \
2520 ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \
2521 assemble_name (FILE, buf); \
2522 putc ('-', FILE); \
2523 ASM_GENERATE_INTERNAL_LABEL (buf, "L", REL); \
2524 assemble_name (FILE, buf); \
2525 putc ('\n', FILE); \
2526 } while (0)
2528 /* This is how to output an assembler line
2529 that says to advance the location counter
2530 to a multiple of 2**LOG bytes. */
2532 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
2533 if ((LOG) != 0) \
2534 fprintf (FILE, "\t.align %d\n", (LOG))
2536 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
2537 fprintf (FILE, "\t.space %d\n", (SIZE))
2539 /* This says how to output an assembler line
2540 to define a global common symbol. */
2542 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
2543 do { fputs (".comm ", (FILE)); \
2544 RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \
2545 fprintf ((FILE), ",%d\n", (SIZE)); } while (0)
2547 /* This says how to output an assembler line
2548 to define a local common symbol. */
2550 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE,ROUNDED) \
2551 do { fputs (".lcomm ", (FILE)); \
2552 RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \
2553 fprintf ((FILE), ",%d,%s\n", (SIZE), xcoff_bss_section_name); \
2554 } while (0)
2556 /* Store in OUTPUT a string (made with alloca) containing
2557 an assembler-name for a local static variable named NAME.
2558 LABELNO is an integer which is different for each call. */
2560 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
2561 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
2562 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
2564 /* Define the parentheses used to group arithmetic operations
2565 in assembler code. */
2567 #define ASM_OPEN_PAREN "("
2568 #define ASM_CLOSE_PAREN ")"
2570 /* Define results of standard character escape sequences. */
2571 #define TARGET_BELL 007
2572 #define TARGET_BS 010
2573 #define TARGET_TAB 011
2574 #define TARGET_NEWLINE 012
2575 #define TARGET_VT 013
2576 #define TARGET_FF 014
2577 #define TARGET_CR 015
2579 /* Print operand X (an rtx) in assembler syntax to file FILE.
2580 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
2581 For `%' followed by punctuation, CODE is the punctuation and X is null. */
2583 #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
2585 /* Define which CODE values are valid. */
2587 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '.' || (CODE) == '*')
2589 /* Print a memory address as an operand to reference that memory location. */
2591 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
2593 /* Define the codes that are matched by predicates in rs6000.c. */
2595 #define PREDICATE_CODES \
2596 {"short_cint_operand", {CONST_INT}}, \
2597 {"u_short_cint_operand", {CONST_INT}}, \
2598 {"non_short_cint_operand", {CONST_INT}}, \
2599 {"gpc_reg_operand", {SUBREG, REG}}, \
2600 {"gpc_reg0_operand", {SUBREG, REG}}, \
2601 {"gpc_reg3_operand", {SUBREG, REG}}, \
2602 {"gpc_reg4_operand", {SUBREG, REG}}, \
2603 {"cc_reg0_operand", {SUBREG, REG}}, \
2604 {"cc_reg1_operand", {SUBREG, REG}}, \
2605 {"cc_reg_operand", {SUBREG, REG}}, \
2606 {"reg_or_short_operand", {SUBREG, REG, CONST_INT}}, \
2607 {"reg_or_neg_short_operand", {SUBREG, REG, CONST_INT}}, \
2608 {"reg_or_u_short_operand", {SUBREG, REG, CONST_INT}}, \
2609 {"reg_or_cint_operand", {SUBREG, REG, CONST_INT}}, \
2610 {"easy_fp_constant", {CONST_DOUBLE}}, \
2611 {"reg_or_mem_operand", {SUBREG, MEM, REG}}, \
2612 {"lwa_operand", {SUBREG, MEM, REG}}, \
2613 {"volatile_mem_operand", {MEM}}, \
2614 {"offsettable_addr_operand", {REG, SUBREG, PLUS}}, \
2615 {"fp_reg_or_mem_operand", {SUBREG, MEM, REG}}, \
2616 {"mem_or_easy_const_operand", {SUBREG, MEM, CONST_DOUBLE}}, \
2617 {"add_operand", {SUBREG, REG, CONST_INT}}, \
2618 {"non_add_cint_operand", {CONST_INT}}, \
2619 {"and_operand", {SUBREG, REG, CONST_INT}}, \
2620 {"non_and_cint_operand", {CONST_INT}}, \
2621 {"logical_operand", {SUBREG, REG, CONST_INT}}, \
2622 {"non_logical_cint_operand", {CONST_INT}}, \
2623 {"mask_operand", {CONST_INT}}, \
2624 {"count_register_operand", {REG}}, \
2625 {"call_operand", {SYMBOL_REF, REG}}, \
2626 {"current_file_function_operand", {SYMBOL_REF}}, \
2627 {"input_operand", {SUBREG, MEM, REG, CONST_INT, SYMBOL_REF}}, \
2628 {"load_multiple_operation", {PARALLEL}}, \
2629 {"store_multiple_operation", {PARALLEL}}, \
2630 {"branch_comparison_operator", {EQ, NE, LE, LT, GE, \
2631 GT, LEU, LTU, GEU, GTU}}, \
2632 {"scc_comparison_operator", {EQ, NE, LE, LT, GE, \
2633 GT, LEU, LTU, GEU, GTU}},
2636 /* uncomment for disabling the corresponding default options */
2637 /* #define MACHINE_no_sched_interblock */
2638 /* #define MACHINE_no_sched_speculative */
2639 /* #define MACHINE_no_sched_speculative_load */
2641 /* indicate that issue rate is defined for this machine
2642 (no need to use the default) */
2643 #define MACHINE_issue_rate
2645 /* Declare functions in rs6000.c */
2646 extern void output_options ();
2647 extern void rs6000_override_options ();
2648 extern struct rtx_def *rs6000_float_const ();
2649 extern struct rtx_def *rs6000_immed_double_const ();
2650 extern int direct_return ();
2651 extern int any_operand ();
2652 extern int short_cint_operand ();
2653 extern int u_short_cint_operand ();
2654 extern int non_short_cint_operand ();
2655 extern int gpc_reg0_operand ();
2656 extern int gpc_reg3_operand ();
2657 extern int gpc_reg4_operand ();
2658 extern int gpc_reg_operand ();
2659 extern int cc_reg0_operand ();
2660 extern int cc_reg1_operand ();
2661 extern int cc_reg_operand ();
2662 extern int reg_or_short_operand ();
2663 extern int reg_or_neg_short_operand ();
2664 extern int reg_or_u_short_operand ();
2665 extern int reg_or_cint_operand ();
2666 extern int easy_fp_constant ();
2667 extern int volatile_mem_operand ();
2668 extern int offsettable_addr_operand ();
2669 extern int fp_reg_or_mem_operand ();
2670 extern int mem_or_easy_const_operand ();
2671 extern int add_operand ();
2672 extern int non_add_cint_operand ();
2673 extern int logical_operand ();
2674 extern int non_logical_operand ();
2675 extern int mask_constant ();
2676 extern int mask_operand ();
2677 extern int and_operand ();
2678 extern int non_and_cint_operand ();
2679 extern int reg_or_mem_operand ();
2680 extern int lwa_operand ();
2681 extern int call_operand ();
2682 extern int current_file_function_operand ();
2683 extern int input_operand ();
2684 extern void init_cumulative_args ();
2685 extern void function_arg_advance ();
2686 extern int function_arg_boundary ();
2687 extern struct rtx_def *function_arg ();
2688 extern int function_arg_partial_nregs ();
2689 extern int function_arg_pass_by_reference ();
2690 extern void setup_incoming_varargs ();
2691 extern struct rtx_def *expand_builtin_saveregs ();
2692 extern struct rtx_def *rs6000_stack_temp ();
2693 extern int expand_block_move ();
2694 extern int load_multiple_operation ();
2695 extern int store_multiple_operation ();
2696 extern int branch_comparison_operator ();
2697 extern int scc_comparison_operator ();
2698 extern int includes_lshift_p ();
2699 extern int includes_rshift_p ();
2700 extern int registers_ok_for_quad_peep ();
2701 extern int addrs_ok_for_quad_peep ();
2702 extern enum reg_class secondary_reload_class ();
2703 extern int ccr_bit ();
2704 extern void print_operand ();
2705 extern void print_operand_address ();
2706 extern int first_reg_to_save ();
2707 extern int first_fp_reg_to_save ();
2708 extern int rs6000_makes_calls ();
2709 extern rs6000_stack_t *rs6000_stack_info ();
2710 extern void svr4_traceback ();
2711 extern void output_prolog ();
2712 extern void output_epilog ();
2713 extern void output_toc ();
2714 extern void output_ascii ();
2715 extern void rs6000_gen_section_name ();
2716 extern void output_function_profiler ();
2717 extern int rs6000_adjust_cost ();
2718 extern void rs6000_trampoline_template ();
2719 extern int rs6000_trampoline_size ();
2720 extern void rs6000_initialize_trampoline ();