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