]>
Commit | Line | Data |
---|---|---|
f045b2c9 | 1 | /* Definitions of target machine for GNU compiler, for IBM RS/6000. |
9ebbca7d | 2 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
16c484c7 | 3 | 2000, 2001, 2002 Free Software Foundation, Inc. |
6a7ec0a7 | 4 | Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) |
f045b2c9 RS |
5 | |
6 | This file is part of GNU CC. | |
7 | ||
8 | GNU CC is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 2, or (at your option) | |
11 | any later version. | |
12 | ||
13 | GNU CC is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with GNU CC; see the file COPYING. If not, write to | |
c15c9075 RK |
20 | the Free Software Foundation, 59 Temple Place - Suite 330, |
21 | Boston, MA 02111-1307, USA. */ | |
f045b2c9 RS |
22 | |
23 | ||
24 | /* Note that some other tm.h files include this one and then override | |
9ebbca7d | 25 | many of the definitions. */ |
f045b2c9 | 26 | |
9ebbca7d GK |
27 | /* Definitions for the object file format. These are set at |
28 | compile-time. */ | |
f045b2c9 | 29 | |
9ebbca7d GK |
30 | #define OBJECT_XCOFF 1 |
31 | #define OBJECT_ELF 2 | |
32 | #define OBJECT_PEF 3 | |
ee890fe2 | 33 | #define OBJECT_MACHO 4 |
f045b2c9 | 34 | |
9ebbca7d | 35 | #define TARGET_ELF (TARGET_OBJECT_FORMAT == OBJECT_ELF) |
2bfcf297 | 36 | #define TARGET_XCOFF (TARGET_OBJECT_FORMAT == OBJECT_XCOFF) |
9ebbca7d | 37 | #define TARGET_MACOS (TARGET_OBJECT_FORMAT == OBJECT_PEF) |
ee890fe2 | 38 | #define TARGET_MACHO (TARGET_OBJECT_FORMAT == OBJECT_MACHO) |
f045b2c9 | 39 | |
2bfcf297 DB |
40 | #ifndef TARGET_AIX |
41 | #define TARGET_AIX 0 | |
42 | #endif | |
43 | ||
8e3f41e7 MM |
44 | /* Default string to use for cpu if not specified. */ |
45 | #ifndef TARGET_CPU_DEFAULT | |
46 | #define TARGET_CPU_DEFAULT ((char *)0) | |
47 | #endif | |
48 | ||
f984d8df DB |
49 | /* Common CPP definitions used by CPP_SPEC among the various targets |
50 | for handling -mcpu=xxx switches. */ | |
51 | #define CPP_CPU_SPEC \ | |
52 | "%{!mcpu*: \ | |
53 | %{mpower: %{!mpower2: -D_ARCH_PWR}} \ | |
54 | %{mpower2: -D_ARCH_PWR2} \ | |
55 | %{mpowerpc*: -D_ARCH_PPC} \ | |
56 | %{mno-power: %{!mpowerpc*: -D_ARCH_COM}} \ | |
57 | %{!mno-power: %{!mpower2: %(cpp_default)}}} \ | |
58 | %{mcpu=common: -D_ARCH_COM} \ | |
59 | %{mcpu=power: -D_ARCH_PWR} \ | |
60 | %{mcpu=power2: -D_ARCH_PWR2} \ | |
61 | %{mcpu=powerpc: -D_ARCH_PPC} \ | |
62 | %{mcpu=rios: -D_ARCH_PWR} \ | |
63 | %{mcpu=rios1: -D_ARCH_PWR} \ | |
64 | %{mcpu=rios2: -D_ARCH_PWR2} \ | |
65 | %{mcpu=rsc: -D_ARCH_PWR} \ | |
66 | %{mcpu=rsc1: -D_ARCH_PWR} \ | |
67 | %{mcpu=401: -D_ARCH_PPC} \ | |
68 | %{mcpu=403: -D_ARCH_PPC} \ | |
3b370352 | 69 | %{mcpu=405: -D_ARCH_PPC} \ |
f984d8df DB |
70 | %{mcpu=505: -D_ARCH_PPC} \ |
71 | %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ | |
72 | %{mcpu=602: -D_ARCH_PPC} \ | |
73 | %{mcpu=603: -D_ARCH_PPC} \ | |
74 | %{mcpu=603e: -D_ARCH_PPC} \ | |
75 | %{mcpu=ec603e: -D_ARCH_PPC} \ | |
76 | %{mcpu=604: -D_ARCH_PPC} \ | |
77 | %{mcpu=604e: -D_ARCH_PPC} \ | |
78 | %{mcpu=620: -D_ARCH_PPC} \ | |
79 | %{mcpu=740: -D_ARCH_PPC} \ | |
fd3b43f2 | 80 | %{mcpu=7400: -D_ARCH_PPC} \ |
f18c054f | 81 | %{mcpu=7450: -D_ARCH_PPC} \ |
f984d8df DB |
82 | %{mcpu=750: -D_ARCH_PPC} \ |
83 | %{mcpu=801: -D_ARCH_PPC} \ | |
84 | %{mcpu=821: -D_ARCH_PPC} \ | |
85 | %{mcpu=823: -D_ARCH_PPC} \ | |
0ac081f6 AH |
86 | %{mcpu=860: -D_ARCH_PPC} \ |
87 | %{maltivec: -D__ALTIVEC__}" | |
f984d8df DB |
88 | |
89 | /* Common ASM definitions used by ASM_SPEC among the various targets | |
90 | for handling -mcpu=xxx switches. */ | |
91 | #define ASM_CPU_SPEC \ | |
92 | "%{!mcpu*: \ | |
93 | %{mpower: %{!mpower2: -mpwr}} \ | |
94 | %{mpower2: -mpwrx} \ | |
95 | %{mpowerpc*: -mppc} \ | |
96 | %{mno-power: %{!mpowerpc*: -mcom}} \ | |
97 | %{!mno-power: %{!mpower2: %(asm_default)}}} \ | |
98 | %{mcpu=common: -mcom} \ | |
99 | %{mcpu=power: -mpwr} \ | |
100 | %{mcpu=power2: -mpwrx} \ | |
101 | %{mcpu=powerpc: -mppc} \ | |
102 | %{mcpu=rios: -mpwr} \ | |
103 | %{mcpu=rios1: -mpwr} \ | |
104 | %{mcpu=rios2: -mpwrx} \ | |
105 | %{mcpu=rsc: -mpwr} \ | |
106 | %{mcpu=rsc1: -mpwr} \ | |
107 | %{mcpu=401: -mppc} \ | |
108 | %{mcpu=403: -mppc} \ | |
3b370352 | 109 | %{mcpu=405: -mppc} \ |
f984d8df DB |
110 | %{mcpu=505: -mppc} \ |
111 | %{mcpu=601: -m601} \ | |
112 | %{mcpu=602: -mppc} \ | |
113 | %{mcpu=603: -mppc} \ | |
114 | %{mcpu=603e: -mppc} \ | |
115 | %{mcpu=ec603e: -mppc} \ | |
116 | %{mcpu=604: -mppc} \ | |
117 | %{mcpu=604e: -mppc} \ | |
118 | %{mcpu=620: -mppc} \ | |
119 | %{mcpu=740: -mppc} \ | |
fd3b43f2 | 120 | %{mcpu=7400: -mppc} \ |
f18c054f | 121 | %{mcpu=7450: -mppc} \ |
f984d8df DB |
122 | %{mcpu=750: -mppc} \ |
123 | %{mcpu=801: -mppc} \ | |
124 | %{mcpu=821: -mppc} \ | |
125 | %{mcpu=823: -mppc} \ | |
775db490 AH |
126 | %{mcpu=860: -mppc} \ |
127 | %{maltivec: -maltivec}" | |
f984d8df DB |
128 | |
129 | #define CPP_DEFAULT_SPEC "" | |
130 | ||
131 | #define ASM_DEFAULT_SPEC "" | |
132 | ||
841faeed MM |
133 | /* This macro defines names of additional specifications to put in the specs |
134 | that can be used in various specifications like CC1_SPEC. Its definition | |
135 | is an initializer with a subgrouping for each command option. | |
136 | ||
137 | Each subgrouping contains a string constant, that defines the | |
138 | specification name, and a string constant that used by the GNU CC driver | |
139 | program. | |
140 | ||
141 | Do not define this macro if it does not need to do anything. */ | |
142 | ||
7509c759 | 143 | #define SUBTARGET_EXTRA_SPECS |
7509c759 | 144 | |
c81bebd7 MM |
145 | #define EXTRA_SPECS \ |
146 | { "cpp_cpu", CPP_CPU_SPEC }, \ | |
147 | { "cpp_default", CPP_DEFAULT_SPEC }, \ | |
c81bebd7 MM |
148 | { "asm_cpu", ASM_CPU_SPEC }, \ |
149 | { "asm_default", ASM_DEFAULT_SPEC }, \ | |
7509c759 MM |
150 | SUBTARGET_EXTRA_SPECS |
151 | ||
fb623df5 | 152 | /* Architecture type. */ |
f045b2c9 | 153 | |
fb623df5 RK |
154 | extern int target_flags; |
155 | ||
156 | /* Use POWER architecture instructions and MQ register. */ | |
38c1f2d7 | 157 | #define MASK_POWER 0x00000001 |
fb623df5 | 158 | |
6febd581 | 159 | /* Use POWER2 extensions to POWER architecture. */ |
38c1f2d7 | 160 | #define MASK_POWER2 0x00000002 |
6febd581 | 161 | |
fb623df5 | 162 | /* Use PowerPC architecture instructions. */ |
38c1f2d7 | 163 | #define MASK_POWERPC 0x00000004 |
6febd581 | 164 | |
583cf4db | 165 | /* Use PowerPC General Purpose group optional instructions, e.g. fsqrt. */ |
38c1f2d7 | 166 | #define MASK_PPC_GPOPT 0x00000008 |
583cf4db RK |
167 | |
168 | /* Use PowerPC Graphics group optional instructions, e.g. fsel. */ | |
38c1f2d7 | 169 | #define MASK_PPC_GFXOPT 0x00000010 |
f045b2c9 | 170 | |
fb623df5 | 171 | /* Use PowerPC-64 architecture instructions. */ |
38c1f2d7 | 172 | #define MASK_POWERPC64 0x00000020 |
f045b2c9 | 173 | |
fb623df5 | 174 | /* Use revised mnemonic names defined for PowerPC architecture. */ |
38c1f2d7 | 175 | #define MASK_NEW_MNEMONICS 0x00000040 |
fb623df5 RK |
176 | |
177 | /* Disable placing fp constants in the TOC; can be turned on when the | |
178 | TOC overflows. */ | |
38c1f2d7 | 179 | #define MASK_NO_FP_IN_TOC 0x00000080 |
fb623df5 | 180 | |
0b9ccabc RK |
181 | /* Disable placing symbol+offset constants in the TOC; can be turned on when |
182 | the TOC overflows. */ | |
38c1f2d7 | 183 | #define MASK_NO_SUM_IN_TOC 0x00000100 |
0b9ccabc | 184 | |
fb623df5 | 185 | /* Output only one TOC entry per module. Normally linking fails if |
642a35f1 JW |
186 | there are more than 16K unique variables/constants in an executable. With |
187 | this option, linking fails only if there are more than 16K modules, or | |
188 | if there are more than 16K unique variables/constant in a single module. | |
189 | ||
190 | This is at the cost of having 2 extra loads and one extra store per | |
956d6950 | 191 | function, and one less allocable register. */ |
38c1f2d7 | 192 | #define MASK_MINIMAL_TOC 0x00000200 |
642a35f1 | 193 | |
9e654916 | 194 | /* Nonzero for the 64bit model: ints, longs, and pointers are 64 bits. */ |
38c1f2d7 | 195 | #define MASK_64BIT 0x00000400 |
9e654916 | 196 | |
f85f4585 | 197 | /* Disable use of FPRs. */ |
38c1f2d7 | 198 | #define MASK_SOFT_FLOAT 0x00000800 |
f85f4585 | 199 | |
4d30c363 | 200 | /* Enable load/store multiple, even on powerpc */ |
38c1f2d7 MM |
201 | #define MASK_MULTIPLE 0x00001000 |
202 | #define MASK_MULTIPLE_SET 0x00002000 | |
4d30c363 | 203 | |
7e69e155 | 204 | /* Use string instructions for block moves */ |
38c1f2d7 MM |
205 | #define MASK_STRING 0x00004000 |
206 | #define MASK_STRING_SET 0x00008000 | |
7e69e155 | 207 | |
38c1f2d7 MM |
208 | /* Disable update form of load/store */ |
209 | #define MASK_NO_UPDATE 0x00010000 | |
210 | ||
211 | /* Disable fused multiply/add operations */ | |
212 | #define MASK_NO_FUSED_MADD 0x00020000 | |
4697a36c | 213 | |
9ebbca7d GK |
214 | /* Nonzero if we need to schedule the prolog and epilog. */ |
215 | #define MASK_SCHED_PROLOG 0x00040000 | |
216 | ||
0ac081f6 AH |
217 | /* Use AltiVec instructions. */ |
218 | #define MASK_ALTIVEC 0x00080000 | |
219 | ||
6fa3f289 ZW |
220 | /* Return small structures in memory (as the AIX ABI requires). */ |
221 | #define MASK_AIX_STRUCT_RET 0x00100000 | |
222 | #define MASK_AIX_STRUCT_RET_SET 0x00200000 | |
0ac081f6 | 223 | |
6fa3f289 ZW |
224 | /* The only remaining free bit is 0x00400000. sysv4.h uses |
225 | 0x00800000 -> 0x40000000, and 0x80000000 is not available | |
226 | because target_flags is signed. */ | |
06f4e019 | 227 | |
7e69e155 MM |
228 | #define TARGET_POWER (target_flags & MASK_POWER) |
229 | #define TARGET_POWER2 (target_flags & MASK_POWER2) | |
230 | #define TARGET_POWERPC (target_flags & MASK_POWERPC) | |
231 | #define TARGET_PPC_GPOPT (target_flags & MASK_PPC_GPOPT) | |
232 | #define TARGET_PPC_GFXOPT (target_flags & MASK_PPC_GFXOPT) | |
7e69e155 MM |
233 | #define TARGET_NEW_MNEMONICS (target_flags & MASK_NEW_MNEMONICS) |
234 | #define TARGET_NO_FP_IN_TOC (target_flags & MASK_NO_FP_IN_TOC) | |
235 | #define TARGET_NO_SUM_IN_TOC (target_flags & MASK_NO_SUM_IN_TOC) | |
236 | #define TARGET_MINIMAL_TOC (target_flags & MASK_MINIMAL_TOC) | |
237 | #define TARGET_64BIT (target_flags & MASK_64BIT) | |
238 | #define TARGET_SOFT_FLOAT (target_flags & MASK_SOFT_FLOAT) | |
239 | #define TARGET_MULTIPLE (target_flags & MASK_MULTIPLE) | |
240 | #define TARGET_MULTIPLE_SET (target_flags & MASK_MULTIPLE_SET) | |
241 | #define TARGET_STRING (target_flags & MASK_STRING) | |
938937d8 | 242 | #define TARGET_STRING_SET (target_flags & MASK_STRING_SET) |
38c1f2d7 MM |
243 | #define TARGET_NO_UPDATE (target_flags & MASK_NO_UPDATE) |
244 | #define TARGET_NO_FUSED_MADD (target_flags & MASK_NO_FUSED_MADD) | |
9ebbca7d | 245 | #define TARGET_SCHED_PROLOG (target_flags & MASK_SCHED_PROLOG) |
0ac081f6 | 246 | #define TARGET_ALTIVEC (target_flags & MASK_ALTIVEC) |
6fa3f289 | 247 | #define TARGET_AIX_STRUCT_RET (target_flags & MASK_AIX_STRUCT_RET) |
7e69e155 | 248 | |
2f3e5814 | 249 | #define TARGET_32BIT (! TARGET_64BIT) |
7e69e155 | 250 | #define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT) |
38c1f2d7 MM |
251 | #define TARGET_UPDATE (! TARGET_NO_UPDATE) |
252 | #define TARGET_FUSED_MADD (! TARGET_NO_FUSED_MADD) | |
d14a6d05 | 253 | |
996ed075 JJ |
254 | #ifdef IN_LIBGCC2 |
255 | /* For libgcc2 we make sure this is a compile time constant */ | |
0134bf2d | 256 | #if defined (__64BIT__) || defined (__powerpc64__) |
996ed075 JJ |
257 | #define TARGET_POWERPC64 1 |
258 | #else | |
259 | #define TARGET_POWERPC64 0 | |
260 | #endif | |
b6c9286a | 261 | #else |
9ebbca7d | 262 | #define TARGET_POWERPC64 (target_flags & MASK_POWERPC64) |
b6c9286a MM |
263 | #endif |
264 | ||
a3950905 | 265 | #define TARGET_XL_CALL 0 |
a3950905 | 266 | |
fb623df5 | 267 | /* Run-time compilation parameters selecting different hardware subsets. |
f045b2c9 | 268 | |
fb623df5 | 269 | Macro to define tables used to set the flags. |
f045b2c9 RS |
270 | This is a list in braces of pairs in braces, |
271 | each pair being { "NAME", VALUE } | |
272 | where VALUE is the bits to set or minus the bits to clear. | |
273 | An empty string NAME is used to identify the default VALUE. */ | |
274 | ||
938937d8 | 275 | #define TARGET_SWITCHES \ |
9ebbca7d | 276 | {{"power", MASK_POWER | MASK_MULTIPLE | MASK_STRING, \ |
047142d3 | 277 | N_("Use POWER instruction set")}, \ |
938937d8 | 278 | {"power2", (MASK_POWER | MASK_MULTIPLE | MASK_STRING \ |
9ebbca7d | 279 | | MASK_POWER2), \ |
047142d3 | 280 | N_("Use POWER2 instruction set")}, \ |
9ebbca7d | 281 | {"no-power2", - MASK_POWER2, \ |
047142d3 | 282 | N_("Do not use POWER2 instruction set")}, \ |
938937d8 | 283 | {"no-power", - (MASK_POWER | MASK_POWER2 | MASK_MULTIPLE \ |
9ebbca7d | 284 | | MASK_STRING), \ |
047142d3 | 285 | N_("Do not use POWER instruction set")}, \ |
9ebbca7d | 286 | {"powerpc", MASK_POWERPC, \ |
047142d3 | 287 | N_("Use PowerPC instruction set")}, \ |
938937d8 | 288 | {"no-powerpc", - (MASK_POWERPC | MASK_PPC_GPOPT \ |
9ebbca7d | 289 | | MASK_PPC_GFXOPT | MASK_POWERPC64), \ |
047142d3 | 290 | N_("Do not use PowerPC instruction set")}, \ |
9ebbca7d | 291 | {"powerpc-gpopt", MASK_POWERPC | MASK_PPC_GPOPT, \ |
047142d3 | 292 | N_("Use PowerPC General Purpose group optional instructions")},\ |
9ebbca7d | 293 | {"no-powerpc-gpopt", - MASK_PPC_GPOPT, \ |
047142d3 | 294 | N_("Don't use PowerPC General Purpose group optional instructions")},\ |
9ebbca7d | 295 | {"powerpc-gfxopt", MASK_POWERPC | MASK_PPC_GFXOPT, \ |
047142d3 | 296 | N_("Use PowerPC Graphics group optional instructions")},\ |
9ebbca7d | 297 | {"no-powerpc-gfxopt", - MASK_PPC_GFXOPT, \ |
047142d3 | 298 | N_("Don't use PowerPC Graphics group optional instructions")},\ |
9ebbca7d | 299 | {"powerpc64", MASK_POWERPC64, \ |
047142d3 | 300 | N_("Use PowerPC-64 instruction set")}, \ |
9ebbca7d | 301 | {"no-powerpc64", - MASK_POWERPC64, \ |
047142d3 | 302 | N_("Don't use PowerPC-64 instruction set")}, \ |
f18c054f | 303 | {"altivec", MASK_ALTIVEC , \ |
c725bd79 | 304 | N_("Use AltiVec instructions")}, \ |
f18c054f | 305 | {"no-altivec", - MASK_ALTIVEC , \ |
c725bd79 | 306 | N_("Don't use AltiVec instructions")}, \ |
9ebbca7d | 307 | {"new-mnemonics", MASK_NEW_MNEMONICS, \ |
047142d3 | 308 | N_("Use new mnemonics for PowerPC architecture")},\ |
9ebbca7d | 309 | {"old-mnemonics", -MASK_NEW_MNEMONICS, \ |
047142d3 | 310 | N_("Use old mnemonics for PowerPC architecture")},\ |
938937d8 | 311 | {"full-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC \ |
9ebbca7d | 312 | | MASK_MINIMAL_TOC), \ |
047142d3 | 313 | N_("Put everything in the regular TOC")}, \ |
9ebbca7d | 314 | {"fp-in-toc", - MASK_NO_FP_IN_TOC, \ |
047142d3 | 315 | N_("Place floating point constants in TOC")}, \ |
9ebbca7d | 316 | {"no-fp-in-toc", MASK_NO_FP_IN_TOC, \ |
047142d3 | 317 | N_("Don't place floating point constants in TOC")},\ |
9ebbca7d | 318 | {"sum-in-toc", - MASK_NO_SUM_IN_TOC, \ |
047142d3 | 319 | N_("Place symbol+offset constants in TOC")}, \ |
9ebbca7d | 320 | {"no-sum-in-toc", MASK_NO_SUM_IN_TOC, \ |
047142d3 | 321 | N_("Don't place symbol+offset constants in TOC")},\ |
9ebbca7d GK |
322 | {"minimal-toc", MASK_MINIMAL_TOC, \ |
323 | "Use only one TOC entry per procedure"}, \ | |
324 | {"minimal-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC), \ | |
047142d3 | 325 | ""}, \ |
9ebbca7d | 326 | {"no-minimal-toc", - MASK_MINIMAL_TOC, \ |
047142d3 | 327 | N_("Place variable addresses in the regular TOC")},\ |
9ebbca7d | 328 | {"hard-float", - MASK_SOFT_FLOAT, \ |
047142d3 | 329 | N_("Use hardware fp")}, \ |
9ebbca7d | 330 | {"soft-float", MASK_SOFT_FLOAT, \ |
047142d3 | 331 | N_("Do not use hardware fp")}, \ |
9ebbca7d | 332 | {"multiple", MASK_MULTIPLE | MASK_MULTIPLE_SET, \ |
047142d3 | 333 | N_("Generate load/store multiple instructions")}, \ |
9ebbca7d | 334 | {"no-multiple", - MASK_MULTIPLE, \ |
047142d3 | 335 | N_("Do not generate load/store multiple instructions")},\ |
9ebbca7d | 336 | {"no-multiple", MASK_MULTIPLE_SET, \ |
047142d3 | 337 | ""}, \ |
9ebbca7d | 338 | {"string", MASK_STRING | MASK_STRING_SET, \ |
047142d3 | 339 | N_("Generate string instructions for block moves")},\ |
9ebbca7d | 340 | {"no-string", - MASK_STRING, \ |
047142d3 | 341 | N_("Do not generate string instructions for block moves")},\ |
9ebbca7d | 342 | {"no-string", MASK_STRING_SET, \ |
047142d3 | 343 | ""}, \ |
9ebbca7d | 344 | {"update", - MASK_NO_UPDATE, \ |
047142d3 | 345 | N_("Generate load/store with update instructions")},\ |
9ebbca7d | 346 | {"no-update", MASK_NO_UPDATE, \ |
047142d3 | 347 | N_("Do not generate load/store with update instructions")},\ |
9ebbca7d | 348 | {"fused-madd", - MASK_NO_FUSED_MADD, \ |
047142d3 | 349 | N_("Generate fused multiply/add instructions")},\ |
9ebbca7d | 350 | {"no-fused-madd", MASK_NO_FUSED_MADD, \ |
047142d3 | 351 | N_("Don't generate fused multiply/add instructions")},\ |
9ebbca7d GK |
352 | {"sched-prolog", MASK_SCHED_PROLOG, \ |
353 | ""}, \ | |
354 | {"no-sched-prolog", -MASK_SCHED_PROLOG, \ | |
047142d3 | 355 | N_("Don't schedule the start and end of the procedure")},\ |
9ebbca7d GK |
356 | {"sched-epilog", MASK_SCHED_PROLOG, \ |
357 | ""}, \ | |
358 | {"no-sched-epilog", -MASK_SCHED_PROLOG, \ | |
359 | ""}, \ | |
6fa3f289 ZW |
360 | {"aix-struct-return", MASK_AIX_STRUCT_RET | MASK_AIX_STRUCT_RET_SET, \ |
361 | N_("Return all structures in memory (AIX default)")},\ | |
362 | {"svr4-struct-return", - MASK_AIX_STRUCT_RET,\ | |
363 | N_("Return small structures in registers (SVR4 default)")},\ | |
364 | {"svr4-struct-return",MASK_AIX_STRUCT_RET_SET,\ | |
365 | ""},\ | |
366 | {"no-aix-struct-return", - MASK_AIX_STRUCT_RET,\ | |
367 | ""},\ | |
368 | {"no-aix-struct-return", MASK_AIX_STRUCT_RET_SET,\ | |
369 | ""},\ | |
370 | {"no-svr4-struct-return", MASK_AIX_STRUCT_RET | MASK_AIX_STRUCT_RET_SET,\ | |
371 | ""},\ | |
938937d8 | 372 | SUBTARGET_SWITCHES \ |
9ebbca7d GK |
373 | {"", TARGET_DEFAULT | MASK_SCHED_PROLOG, \ |
374 | ""}} | |
fb623df5 | 375 | |
938937d8 | 376 | #define TARGET_DEFAULT (MASK_POWER | MASK_MULTIPLE | MASK_STRING) |
9ebbca7d GK |
377 | |
378 | /* This is meant to be redefined in the host dependent files */ | |
379 | #define SUBTARGET_SWITCHES | |
fb623df5 | 380 | |
cac8ce95 | 381 | /* Processor type. Order must match cpu attribute in MD file. */ |
fb623df5 | 382 | enum processor_type |
bef84347 VM |
383 | { |
384 | PROCESSOR_RIOS1, | |
385 | PROCESSOR_RIOS2, | |
3cb999d8 | 386 | PROCESSOR_RS64A, |
bef84347 VM |
387 | PROCESSOR_MPCCORE, |
388 | PROCESSOR_PPC403, | |
fe7f5677 | 389 | PROCESSOR_PPC405, |
bef84347 VM |
390 | PROCESSOR_PPC601, |
391 | PROCESSOR_PPC603, | |
392 | PROCESSOR_PPC604, | |
393 | PROCESSOR_PPC604e, | |
394 | PROCESSOR_PPC620, | |
3cb999d8 | 395 | PROCESSOR_PPC630, |
ed947a96 DJ |
396 | PROCESSOR_PPC750, |
397 | PROCESSOR_PPC7400, | |
398 | PROCESSOR_PPC7450 | |
bef84347 | 399 | }; |
fb623df5 RK |
400 | |
401 | extern enum processor_type rs6000_cpu; | |
402 | ||
403 | /* Recast the processor type to the cpu attribute. */ | |
404 | #define rs6000_cpu_attr ((enum attr_cpu)rs6000_cpu) | |
405 | ||
8482e358 | 406 | /* Define generic processor types based upon current deployment. */ |
3cb999d8 DE |
407 | #define PROCESSOR_COMMON PROCESSOR_PPC601 |
408 | #define PROCESSOR_POWER PROCESSOR_RIOS1 | |
409 | #define PROCESSOR_POWERPC PROCESSOR_PPC604 | |
410 | #define PROCESSOR_POWERPC64 PROCESSOR_RS64A | |
6e151478 | 411 | |
fb623df5 | 412 | /* Define the default processor. This is overridden by other tm.h files. */ |
3cb999d8 DE |
413 | #define PROCESSOR_DEFAULT PROCESSOR_RIOS1 |
414 | #define PROCESSOR_DEFAULT64 PROCESSOR_RS64A | |
fb623df5 | 415 | |
6febd581 RK |
416 | /* Specify the dialect of assembler to use. New mnemonics is dialect one |
417 | and the old mnemonics are dialect zero. */ | |
9ebbca7d | 418 | #define ASSEMBLER_DIALECT (TARGET_NEW_MNEMONICS ? 1 : 0) |
6febd581 | 419 | |
fb623df5 RK |
420 | /* This macro is similar to `TARGET_SWITCHES' but defines names of |
421 | command options that have values. Its definition is an | |
422 | initializer with a subgrouping for each command option. | |
423 | ||
424 | Each subgrouping contains a string constant, that defines the | |
425 | fixed part of the option name, and the address of a variable. | |
426 | The variable, type `char *', is set to the variable part of the | |
427 | given option if the fixed part matches. The actual option name | |
428 | is made by appending `-m' to the specified name. | |
429 | ||
430 | Here is an example which defines `-mshort-data-NUMBER'. If the | |
431 | given option is `-mshort-data-512', the variable `m88k_short_data' | |
432 | will be set to the string `"512"'. | |
433 | ||
434 | extern char *m88k_short_data; | |
435 | #define TARGET_OPTIONS { { "short-data-", &m88k_short_data } } */ | |
436 | ||
956d6950 | 437 | /* This is meant to be overridden in target specific files. */ |
b6c9286a | 438 | #define SUBTARGET_OPTIONS |
b6c9286a | 439 | |
9ebbca7d GK |
440 | #define TARGET_OPTIONS \ |
441 | { \ | |
047142d3 PT |
442 | {"cpu=", &rs6000_select[1].string, \ |
443 | N_("Use features of and schedule code for given CPU") }, \ | |
444 | {"tune=", &rs6000_select[2].string, \ | |
445 | N_("Schedule code for given CPU") }, \ | |
446 | {"debug=", &rs6000_debug_name, N_("Enable debug output") }, \ | |
0ac081f6 | 447 | {"abi=", &rs6000_abi_string, N_("Specify ABI to use") }, \ |
6fa3f289 ZW |
448 | {"long-double-", &rs6000_long_double_size_string, \ |
449 | N_("Specify size of long double (64 or 128 bits)") }, \ | |
9ebbca7d | 450 | SUBTARGET_OPTIONS \ |
b6c9286a | 451 | } |
fb623df5 | 452 | |
ff222560 | 453 | /* rs6000_select[0] is reserved for the default cpu defined via --with-cpu */ |
8e3f41e7 MM |
454 | struct rs6000_cpu_select |
455 | { | |
815cdc52 MM |
456 | const char *string; |
457 | const char *name; | |
8e3f41e7 MM |
458 | int set_tune_p; |
459 | int set_arch_p; | |
460 | }; | |
461 | ||
462 | extern struct rs6000_cpu_select rs6000_select[]; | |
fb623df5 | 463 | |
38c1f2d7 | 464 | /* Debug support */ |
0ac081f6 | 465 | extern const char *rs6000_debug_name; /* Name for -mdebug-xxxx option */ |
f607bc57 | 466 | extern const char *rs6000_abi_string; /* for -mabi={sysv,darwin,eabi,aix,altivec} */ |
38c1f2d7 MM |
467 | extern int rs6000_debug_stack; /* debug stack applications */ |
468 | extern int rs6000_debug_arg; /* debug argument handling */ | |
469 | ||
470 | #define TARGET_DEBUG_STACK rs6000_debug_stack | |
471 | #define TARGET_DEBUG_ARG rs6000_debug_arg | |
472 | ||
6fa3f289 ZW |
473 | /* These are separate from target_flags because we've run out of bits |
474 | there. */ | |
475 | extern const char *rs6000_long_double_size_string; | |
476 | extern int rs6000_long_double_type_size; | |
477 | extern int rs6000_altivec_abi; | |
478 | ||
479 | #define TARGET_LONG_DOUBLE_128 (rs6000_long_double_type_size == 128) | |
480 | #define TARGET_ALTIVEC_ABI rs6000_altivec_abi | |
481 | ||
fb623df5 RK |
482 | /* Sometimes certain combinations of command options do not make sense |
483 | on a particular target machine. You can define a macro | |
484 | `OVERRIDE_OPTIONS' to take account of this. This macro, if | |
485 | defined, is executed once just after all the command options have | |
486 | been parsed. | |
487 | ||
5accd822 DE |
488 | Don't use this macro to turn on various extra optimizations for |
489 | `-O'. That is what `OPTIMIZATION_OPTIONS' is for. | |
490 | ||
fb623df5 RK |
491 | On the RS/6000 this is used to define the target cpu type. */ |
492 | ||
8e3f41e7 | 493 | #define OVERRIDE_OPTIONS rs6000_override_options (TARGET_CPU_DEFAULT) |
f045b2c9 | 494 | |
5accd822 DE |
495 | /* Define this to change the optimizations performed by default. */ |
496 | #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) optimization_options(LEVEL,SIZE) | |
497 | ||
4f074454 RK |
498 | /* Show we can debug even without a frame pointer. */ |
499 | #define CAN_DEBUG_WITHOUT_FP | |
f045b2c9 RS |
500 | \f |
501 | /* target machine storage layout */ | |
502 | ||
df44fa77 RK |
503 | /* Define to support cross compilation to an RS6000 target. */ |
504 | #define REAL_ARITHMETIC | |
505 | ||
13d39dbc | 506 | /* Define this macro if it is advisable to hold scalars in registers |
c81bebd7 | 507 | in a wider mode than that declared by the program. In such cases, |
ef457bda RK |
508 | the value is constrained to be within the bounds of the declared |
509 | type, but kept valid in the wider mode. The signedness of the | |
510 | extension may differ from that of the type. */ | |
511 | ||
39403d82 DE |
512 | #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \ |
513 | if (GET_MODE_CLASS (MODE) == MODE_INT \ | |
514 | && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ | |
3cb999d8 | 515 | (MODE) = word_mode; |
39403d82 DE |
516 | |
517 | /* Define this if function arguments should also be promoted using the above | |
518 | procedure. */ | |
519 | ||
520 | #define PROMOTE_FUNCTION_ARGS | |
521 | ||
522 | /* Likewise, if the function return value is promoted. */ | |
523 | ||
524 | #define PROMOTE_FUNCTION_RETURN | |
ef457bda | 525 | |
f045b2c9 | 526 | /* Define this if most significant bit is lowest numbered |
82e41834 KH |
527 | in instructions that operate on numbered bit-fields. */ |
528 | /* That is true on RS/6000. */ | |
f045b2c9 RS |
529 | #define BITS_BIG_ENDIAN 1 |
530 | ||
531 | /* Define this if most significant byte of a word is the lowest numbered. */ | |
532 | /* That is true on RS/6000. */ | |
533 | #define BYTES_BIG_ENDIAN 1 | |
534 | ||
535 | /* Define this if most significant word of a multiword number is lowest | |
c81bebd7 | 536 | numbered. |
f045b2c9 RS |
537 | |
538 | For RS/6000 we can decide arbitrarily since there are no machine | |
82e41834 | 539 | instructions for them. Might as well be consistent with bits and bytes. */ |
f045b2c9 RS |
540 | #define WORDS_BIG_ENDIAN 1 |
541 | ||
fdaff8ba | 542 | /* number of bits in an addressable storage unit */ |
f045b2c9 RS |
543 | #define BITS_PER_UNIT 8 |
544 | ||
545 | /* Width in bits of a "word", which is the contents of a machine register. | |
546 | Note that this is not necessarily the width of data type `int'; | |
547 | if using 16-bit ints on a 68000, this would still be 32. | |
548 | But on a machine with 16-bit registers, this would be 16. */ | |
2f3e5814 | 549 | #define BITS_PER_WORD (! TARGET_POWERPC64 ? 32 : 64) |
2e360ab3 | 550 | #define MAX_BITS_PER_WORD 64 |
f045b2c9 RS |
551 | |
552 | /* Width of a word, in units (bytes). */ | |
2f3e5814 | 553 | #define UNITS_PER_WORD (! TARGET_POWERPC64 ? 4 : 8) |
ef0e53ce | 554 | #define MIN_UNITS_PER_WORD 4 |
2e360ab3 | 555 | #define UNITS_PER_FP_WORD 8 |
0ac081f6 | 556 | #define UNITS_PER_ALTIVEC_WORD 16 |
f045b2c9 | 557 | |
915f619f JW |
558 | /* Type used for ptrdiff_t, as a string used in a declaration. */ |
559 | #define PTRDIFF_TYPE "int" | |
560 | ||
058ef853 DE |
561 | /* Type used for size_t, as a string used in a declaration. */ |
562 | #define SIZE_TYPE "long unsigned int" | |
563 | ||
f045b2c9 RS |
564 | /* Type used for wchar_t, as a string used in a declaration. */ |
565 | #define WCHAR_TYPE "short unsigned int" | |
566 | ||
567 | /* Width of wchar_t in bits. */ | |
568 | #define WCHAR_TYPE_SIZE 16 | |
569 | ||
9e654916 RK |
570 | /* A C expression for the size in bits of the type `short' on the |
571 | target machine. If you don't define this, the default is half a | |
572 | word. (If this would be less than one storage unit, it is | |
573 | rounded up to one unit.) */ | |
574 | #define SHORT_TYPE_SIZE 16 | |
575 | ||
576 | /* A C expression for the size in bits of the type `int' on the | |
577 | target machine. If you don't define this, the default is one | |
578 | word. */ | |
19d2d16f | 579 | #define INT_TYPE_SIZE 32 |
9e654916 RK |
580 | |
581 | /* A C expression for the size in bits of the type `long' on the | |
582 | target machine. If you don't define this, the default is one | |
583 | word. */ | |
2f3e5814 | 584 | #define LONG_TYPE_SIZE (TARGET_32BIT ? 32 : 64) |
9e654916 RK |
585 | #define MAX_LONG_TYPE_SIZE 64 |
586 | ||
587 | /* A C expression for the size in bits of the type `long long' on the | |
588 | target machine. If you don't define this, the default is two | |
589 | words. */ | |
590 | #define LONG_LONG_TYPE_SIZE 64 | |
591 | ||
592 | /* A C expression for the size in bits of the type `char' on the | |
593 | target machine. If you don't define this, the default is one | |
594 | quarter of a word. (If this would be less than one storage unit, | |
595 | it is rounded up to one unit.) */ | |
596 | #define CHAR_TYPE_SIZE BITS_PER_UNIT | |
597 | ||
598 | /* A C expression for the size in bits of the type `float' on the | |
599 | target machine. If you don't define this, the default is one | |
600 | word. */ | |
601 | #define FLOAT_TYPE_SIZE 32 | |
602 | ||
603 | /* A C expression for the size in bits of the type `double' on the | |
604 | target machine. If you don't define this, the default is two | |
605 | words. */ | |
606 | #define DOUBLE_TYPE_SIZE 64 | |
607 | ||
608 | /* A C expression for the size in bits of the type `long double' on | |
609 | the target machine. If you don't define this, the default is two | |
610 | words. */ | |
6fa3f289 | 611 | #define LONG_DOUBLE_TYPE_SIZE rs6000_long_double_type_size |
06f4e019 DE |
612 | |
613 | /* Constant which presents upper bound of the above value. */ | |
614 | #define MAX_LONG_DOUBLE_TYPE_SIZE 128 | |
615 | ||
616 | /* Define this to set long double type size to use in libgcc2.c, which can | |
617 | not depend on target_flags. */ | |
618 | #ifdef __LONG_DOUBLE_128__ | |
619 | #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128 | |
620 | #else | |
621 | #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 | |
622 | #endif | |
9e654916 | 623 | |
f045b2c9 RS |
624 | /* Width in bits of a pointer. |
625 | See also the macro `Pmode' defined below. */ | |
2f3e5814 | 626 | #define POINTER_SIZE (TARGET_32BIT ? 32 : 64) |
f045b2c9 RS |
627 | |
628 | /* Allocation boundary (in *bits*) for storing arguments in argument list. */ | |
2f3e5814 | 629 | #define PARM_BOUNDARY (TARGET_32BIT ? 32 : 64) |
f045b2c9 RS |
630 | |
631 | /* Boundary (in *bits*) on which stack pointer should be aligned. */ | |
0ac081f6 | 632 | #define STACK_BOUNDARY ((TARGET_32BIT && !TARGET_ALTIVEC_ABI) ? 64 : 128) |
f045b2c9 RS |
633 | |
634 | /* Allocation boundary (in *bits*) for the code of a function. */ | |
635 | #define FUNCTION_BOUNDARY 32 | |
636 | ||
637 | /* No data type wants to be aligned rounder than this. */ | |
0ac081f6 AH |
638 | #define BIGGEST_ALIGNMENT 128 |
639 | ||
640 | /* A C expression to compute the alignment for a variables in the | |
641 | local store. TYPE is the data type, and ALIGN is the alignment | |
642 | that the object would ordinarily have. */ | |
643 | #define LOCAL_ALIGNMENT(TYPE, ALIGN) \ | |
a4edd584 | 644 | ((TARGET_ALTIVEC && TREE_CODE (TYPE) == VECTOR_TYPE) ? 128 : ALIGN) |
b73fd26c | 645 | |
e1565e65 DE |
646 | /* Handle #pragma pack. */ |
647 | #define HANDLE_PRAGMA_PACK 1 | |
648 | ||
f045b2c9 RS |
649 | /* Alignment of field after `int : 0' in a structure. */ |
650 | #define EMPTY_FIELD_BOUNDARY 32 | |
651 | ||
652 | /* Every structure's size must be a multiple of this. */ | |
653 | #define STRUCTURE_SIZE_BOUNDARY 8 | |
654 | ||
655 | /* A bitfield declared as `int' forces `int' alignment for the struct. */ | |
656 | #define PCC_BITFIELD_TYPE_MATTERS 1 | |
657 | ||
658 | /* Make strings word-aligned so strcpy from constants will be faster. */ | |
659 | #define CONSTANT_ALIGNMENT(EXP, ALIGN) \ | |
660 | (TREE_CODE (EXP) == STRING_CST \ | |
661 | && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) | |
662 | ||
0ac081f6 AH |
663 | /* Make arrays of chars word-aligned for the same reasons. |
664 | Align vectors to 128 bits. */ | |
f045b2c9 | 665 | #define DATA_ALIGNMENT(TYPE, ALIGN) \ |
0ac081f6 AH |
666 | (TREE_CODE (TYPE) == VECTOR_TYPE ? 128 \ |
667 | : TREE_CODE (TYPE) == ARRAY_TYPE \ | |
f045b2c9 RS |
668 | && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \ |
669 | && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) | |
670 | ||
fdaff8ba | 671 | /* Non-zero if move instructions will actually fail to work |
f045b2c9 | 672 | when given unaligned data. */ |
fdaff8ba | 673 | #define STRICT_ALIGNMENT 0 |
e1565e65 DE |
674 | |
675 | /* Define this macro to be the value 1 if unaligned accesses have a cost | |
676 | many times greater than aligned accesses, for example if they are | |
677 | emulated in a trap handler. */ | |
41543739 GK |
678 | #define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) \ |
679 | (STRICT_ALIGNMENT \ | |
680 | || (((MODE) == SFmode || (MODE) == DFmode || (MODE) == DImode) \ | |
681 | && (ALIGN) < 32)) | |
f045b2c9 RS |
682 | \f |
683 | /* Standard register usage. */ | |
684 | ||
685 | /* Number of actual hardware registers. | |
686 | The hardware registers are assigned numbers for the compiler | |
687 | from 0 to just below FIRST_PSEUDO_REGISTER. | |
688 | All registers that the compiler knows about must be given numbers, | |
689 | even those that are not normally considered general registers. | |
690 | ||
691 | RS/6000 has 32 fixed-point registers, 32 floating-point registers, | |
692 | an MQ register, a count register, a link register, and 8 condition | |
693 | register fields, which we view here as separate registers. | |
694 | ||
695 | In addition, the difference between the frame and argument pointers is | |
696 | a function of the number of registers saved, so we need to have a | |
697 | register for AP that will later be eliminated in favor of SP or FP. | |
802a0058 | 698 | This is a normal register, but it is fixed. |
f045b2c9 | 699 | |
802a0058 MM |
700 | We also create a pseudo register for float/int conversions, that will |
701 | really represent the memory location used. It is represented here as | |
702 | a register, in order to work around problems in allocating stack storage | |
703 | in inline functions. */ | |
704 | ||
0ac081f6 | 705 | #define FIRST_PSEUDO_REGISTER 110 |
f045b2c9 | 706 | |
d6a7951f | 707 | /* This must be included for pre gcc 3.0 glibc compatibility. */ |
7d5f33bc | 708 | #define PRE_GCC3_DWARF_FRAME_REGISTERS 77 |
62153b61 | 709 | |
f045b2c9 RS |
710 | /* 1 for registers that have pervasive standard uses |
711 | and are not available for the register allocator. | |
712 | ||
5dead3e5 DJ |
713 | On RS/6000, r1 is used for the stack. On Darwin, r2 is available |
714 | as a local register; for all other OS's r2 is the TOC pointer. | |
f045b2c9 | 715 | |
a127c4e5 RK |
716 | cr5 is not supposed to be used. |
717 | ||
718 | On System V implementations, r13 is fixed and not available for use. */ | |
719 | ||
f045b2c9 | 720 | #define FIXED_REGISTERS \ |
5dead3e5 | 721 | {0, 1, FIXED_R2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, FIXED_R13, 0, 0, \ |
f045b2c9 RS |
722 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
723 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
724 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
0ac081f6 AH |
725 | 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, \ |
726 | /* AltiVec registers. */ \ | |
727 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
728 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
2473ee11 | 729 | 1 \ |
0ac081f6 | 730 | } |
f045b2c9 RS |
731 | |
732 | /* 1 for registers not available across function calls. | |
733 | These must include the FIXED_REGISTERS and also any | |
734 | registers that can be used without being saved. | |
735 | The latter must include the registers where values are returned | |
736 | and the register where structure-value addresses are passed. | |
737 | Aside from that, you can include as many other registers as you like. */ | |
738 | ||
739 | #define CALL_USED_REGISTERS \ | |
a127c4e5 | 740 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, FIXED_R13, 0, 0, \ |
f045b2c9 RS |
741 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
742 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, \ | |
743 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
0ac081f6 AH |
744 | 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, \ |
745 | /* AltiVec registers. */ \ | |
746 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
747 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
2473ee11 | 748 | 1 \ |
0ac081f6 AH |
749 | } |
750 | ||
289e96b2 AH |
751 | /* Like `CALL_USED_REGISTERS' except this macro doesn't require that |
752 | the entire set of `FIXED_REGISTERS' be included. | |
753 | (`CALL_USED_REGISTERS' must be a superset of `FIXED_REGISTERS'). | |
754 | This macro is optional. If not specified, it defaults to the value | |
755 | of `CALL_USED_REGISTERS'. */ | |
756 | ||
757 | #define CALL_REALLY_USED_REGISTERS \ | |
758 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, FIXED_R13, 0, 0, \ | |
759 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
760 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, \ | |
761 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
762 | 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, \ | |
763 | /* AltiVec registers. */ \ | |
764 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
765 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
766 | 0 \ | |
767 | } | |
f045b2c9 | 768 | |
9ebbca7d GK |
769 | #define MQ_REGNO 64 |
770 | #define CR0_REGNO 68 | |
771 | #define CR1_REGNO 69 | |
772 | #define CR2_REGNO 70 | |
773 | #define CR3_REGNO 71 | |
774 | #define CR4_REGNO 72 | |
775 | #define MAX_CR_REGNO 75 | |
776 | #define XER_REGNO 76 | |
0ac081f6 AH |
777 | #define FIRST_ALTIVEC_REGNO 77 |
778 | #define LAST_ALTIVEC_REGNO 108 | |
00b960c7 | 779 | #define TOTAL_ALTIVEC_REGS (LAST_ALTIVEC_REGNO - FIRST_ALTIVEC_REGNO) |
0ac081f6 | 780 | #define VRSAVE_REGNO 109 |
9ebbca7d | 781 | |
f045b2c9 RS |
782 | /* List the order in which to allocate registers. Each register must be |
783 | listed once, even those in FIXED_REGISTERS. | |
784 | ||
785 | We allocate in the following order: | |
786 | fp0 (not saved or used for anything) | |
787 | fp13 - fp2 (not saved; incoming fp arg registers) | |
788 | fp1 (not saved; return value) | |
789 | fp31 - fp14 (saved; order given to save least number) | |
5accd822 DE |
790 | cr7, cr6 (not saved or special) |
791 | cr1 (not saved, but used for FP operations) | |
f045b2c9 | 792 | cr0 (not saved, but used for arithmetic operations) |
5accd822 | 793 | cr4, cr3, cr2 (saved) |
f045b2c9 RS |
794 | r0 (not saved; cannot be base reg) |
795 | r9 (not saved; best for TImode) | |
796 | r11, r10, r8-r4 (not saved; highest used first to make less conflict) | |
797 | r3 (not saved; return value register) | |
798 | r31 - r13 (saved; order given to save least number) | |
799 | r12 (not saved; if used for DImode or DFmode would use r13) | |
800 | mq (not saved; best to use it if we can) | |
801 | ctr (not saved; when we have the choice ctr is better) | |
802 | lr (saved) | |
0ac081f6 AH |
803 | cr5, r1, r2, ap, xer, vrsave (fixed) |
804 | ||
805 | AltiVec registers: | |
806 | v0 - v1 (not saved or used for anything) | |
807 | v13 - v3 (not saved; incoming vector arg registers) | |
808 | v2 (not saved; incoming vector arg reg; return value) | |
809 | v19 - v14 (not saved or used for anything) | |
810 | v31 - v20 (saved; order given to save least number) | |
811 | */ | |
812 | ||
f045b2c9 RS |
813 | |
814 | #define REG_ALLOC_ORDER \ | |
815 | {32, \ | |
816 | 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, \ | |
817 | 33, \ | |
818 | 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, \ | |
819 | 50, 49, 48, 47, 46, \ | |
5accd822 | 820 | 75, 74, 69, 68, 72, 71, 70, \ |
f045b2c9 RS |
821 | 0, \ |
822 | 9, 11, 10, 8, 7, 6, 5, 4, \ | |
823 | 3, \ | |
824 | 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, \ | |
825 | 18, 17, 16, 15, 14, 13, 12, \ | |
826 | 64, 66, 65, \ | |
0ac081f6 AH |
827 | 73, 1, 2, 67, 76, \ |
828 | /* AltiVec registers. */ \ | |
829 | 77, 78, \ | |
830 | 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, \ | |
831 | 79, \ | |
832 | 96, 95, 94, 93, 92, 91, \ | |
58568475 AH |
833 | 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, \ |
834 | 97, 109 \ | |
0ac081f6 | 835 | } |
f045b2c9 RS |
836 | |
837 | /* True if register is floating-point. */ | |
838 | #define FP_REGNO_P(N) ((N) >= 32 && (N) <= 63) | |
839 | ||
840 | /* True if register is a condition register. */ | |
841 | #define CR_REGNO_P(N) ((N) >= 68 && (N) <= 75) | |
842 | ||
815cdc52 MM |
843 | /* True if register is a condition register, but not cr0. */ |
844 | #define CR_REGNO_NOT_CR0_P(N) ((N) >= 69 && (N) <= 75) | |
845 | ||
f045b2c9 | 846 | /* True if register is an integer register. */ |
9ebbca7d | 847 | #define INT_REGNO_P(N) ((N) <= 31 || (N) == ARG_POINTER_REGNUM) |
f045b2c9 | 848 | |
0d86f538 | 849 | /* True if register is the XER register. */ |
9ebbca7d | 850 | #define XER_REGNO_P(N) ((N) == XER_REGNO) |
802a0058 | 851 | |
0ac081f6 AH |
852 | /* True if register is an AltiVec register. */ |
853 | #define ALTIVEC_REGNO_P(N) ((N) >= FIRST_ALTIVEC_REGNO && (N) <= LAST_ALTIVEC_REGNO) | |
854 | ||
f045b2c9 RS |
855 | /* Return number of consecutive hard regs needed starting at reg REGNO |
856 | to hold something of mode MODE. | |
857 | This is ordinarily the length in words of a value of mode MODE | |
858 | but can be less for certain modes in special long registers. | |
859 | ||
a260abc9 DE |
860 | POWER and PowerPC GPRs hold 32 bits worth; |
861 | PowerPC64 GPRs and FPRs point register holds 64 bits worth. */ | |
f045b2c9 | 862 | |
802a0058 | 863 | #define HARD_REGNO_NREGS(REGNO, MODE) \ |
9ebbca7d | 864 | (FP_REGNO_P (REGNO) \ |
2e360ab3 | 865 | ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \ |
0ac081f6 AH |
866 | : ALTIVEC_REGNO_P (REGNO) \ |
867 | ? ((GET_MODE_SIZE (MODE) + UNITS_PER_ALTIVEC_WORD - 1) / UNITS_PER_ALTIVEC_WORD) \ | |
f045b2c9 RS |
868 | : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) |
869 | ||
0ac081f6 AH |
870 | #define ALTIVEC_VECTOR_MODE(MODE) \ |
871 | ((MODE) == V16QImode \ | |
872 | || (MODE) == V8HImode \ | |
873 | || (MODE) == V4SFmode \ | |
874 | || (MODE) == V4SImode) | |
875 | ||
876 | /* Define this macro to be nonzero if the port is prepared to handle | |
877 | insns involving vector mode MODE. At the very least, it must have | |
878 | move patterns for this mode. */ | |
879 | ||
880 | #define VECTOR_MODE_SUPPORTED_P(MODE) \ | |
881 | (TARGET_ALTIVEC && ALTIVEC_VECTOR_MODE (MODE)) | |
882 | ||
f045b2c9 | 883 | /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. |
bdfd4e31 RK |
884 | For POWER and PowerPC, the GPRs can hold any mode, but the float |
885 | registers only can hold floating modes and DImode, and CR register only | |
886 | can hold CC modes. We cannot put TImode anywhere except general | |
82e41834 | 887 | register and it must be able to fit within the register set. */ |
f045b2c9 | 888 | |
802a0058 MM |
889 | #define HARD_REGNO_MODE_OK(REGNO, MODE) \ |
890 | (FP_REGNO_P (REGNO) ? \ | |
891 | (GET_MODE_CLASS (MODE) == MODE_FLOAT \ | |
892 | || (GET_MODE_CLASS (MODE) == MODE_INT \ | |
893 | && GET_MODE_SIZE (MODE) == UNITS_PER_FP_WORD)) \ | |
0ac081f6 | 894 | : ALTIVEC_REGNO_P (REGNO) ? ALTIVEC_VECTOR_MODE (MODE) \ |
802a0058 | 895 | : CR_REGNO_P (REGNO) ? GET_MODE_CLASS (MODE) == MODE_CC \ |
9ebbca7d | 896 | : XER_REGNO_P (REGNO) ? (MODE) == PSImode \ |
802a0058 | 897 | : ! INT_REGNO_P (REGNO) ? (GET_MODE_CLASS (MODE) == MODE_INT \ |
bdfd4e31 | 898 | && GET_MODE_SIZE (MODE) <= UNITS_PER_WORD) \ |
f045b2c9 RS |
899 | : 1) |
900 | ||
901 | /* Value is 1 if it is a good idea to tie two pseudo registers | |
902 | when one has mode MODE1 and one has mode MODE2. | |
903 | If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, | |
904 | for any hard reg, then this must be 0 for correct output. */ | |
905 | #define MODES_TIEABLE_P(MODE1, MODE2) \ | |
906 | (GET_MODE_CLASS (MODE1) == MODE_FLOAT \ | |
907 | ? GET_MODE_CLASS (MODE2) == MODE_FLOAT \ | |
908 | : GET_MODE_CLASS (MODE2) == MODE_FLOAT \ | |
909 | ? GET_MODE_CLASS (MODE1) == MODE_FLOAT \ | |
910 | : GET_MODE_CLASS (MODE1) == MODE_CC \ | |
911 | ? GET_MODE_CLASS (MODE2) == MODE_CC \ | |
912 | : GET_MODE_CLASS (MODE2) == MODE_CC \ | |
913 | ? GET_MODE_CLASS (MODE1) == MODE_CC \ | |
0ac081f6 AH |
914 | : ALTIVEC_VECTOR_MODE (MODE1) \ |
915 | ? ALTIVEC_VECTOR_MODE (MODE2) \ | |
916 | : ALTIVEC_VECTOR_MODE (MODE2) \ | |
917 | ? ALTIVEC_VECTOR_MODE (MODE1) \ | |
f045b2c9 RS |
918 | : 1) |
919 | ||
920 | /* A C expression returning the cost of moving data from a register of class | |
921 | CLASS1 to one of CLASS2. | |
922 | ||
923 | On the RS/6000, copying between floating-point and fixed-point | |
924 | registers is expensive. */ | |
925 | ||
cf011243 | 926 | #define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \ |
0ac081f6 | 927 | ((CLASS1) == FLOAT_REGS && (CLASS2) == FLOAT_REGS ? 2 \ |
f045b2c9 RS |
928 | : (CLASS1) == FLOAT_REGS && (CLASS2) != FLOAT_REGS ? 10 \ |
929 | : (CLASS1) != FLOAT_REGS && (CLASS2) == FLOAT_REGS ? 10 \ | |
0ac081f6 AH |
930 | : (CLASS1) == ALTIVEC_REGS && (CLASS2) != ALTIVEC_REGS ? 20 \ |
931 | : (CLASS1) != ALTIVEC_REGS && (CLASS2) == ALTIVEC_REGS ? 20 \ | |
a4b970a0 | 932 | : (((CLASS1) == SPECIAL_REGS || (CLASS1) == MQ_REGS \ |
5119dc13 RK |
933 | || (CLASS1) == LINK_REGS || (CLASS1) == CTR_REGS \ |
934 | || (CLASS1) == LINK_OR_CTR_REGS) \ | |
a4b970a0 | 935 | && ((CLASS2) == SPECIAL_REGS || (CLASS2) == MQ_REGS \ |
5119dc13 | 936 | || (CLASS2) == LINK_REGS || (CLASS2) == CTR_REGS \ |
802a0058 | 937 | || (CLASS2) == LINK_OR_CTR_REGS)) ? 10 \ |
f045b2c9 RS |
938 | : 2) |
939 | ||
940 | /* A C expressions returning the cost of moving data of MODE from a register to | |
941 | or from memory. | |
942 | ||
943 | On the RS/6000, bump this up a bit. */ | |
944 | ||
e1565e65 DE |
945 | #define MEMORY_MOVE_COST(MODE, CLASS, IN) \ |
946 | ((GET_MODE_CLASS (MODE) == MODE_FLOAT \ | |
ab4a5fc9 RK |
947 | && (rs6000_cpu == PROCESSOR_RIOS1 || rs6000_cpu == PROCESSOR_PPC601) \ |
948 | ? 3 : 2) \ | |
949 | + 4) | |
f045b2c9 RS |
950 | |
951 | /* Specify the cost of a branch insn; roughly the number of extra insns that | |
952 | should be added to avoid a branch. | |
953 | ||
ef457bda | 954 | Set this to 3 on the RS/6000 since that is roughly the average cost of an |
f045b2c9 RS |
955 | unscheduled conditional branch. */ |
956 | ||
ef457bda | 957 | #define BRANCH_COST 3 |
f045b2c9 | 958 | |
6febd581 RK |
959 | /* Define this macro to change register usage conditional on target flags. |
960 | Set MQ register fixed (already call_used) if not POWER architecture | |
f85f4585 | 961 | (RIOS1, RIOS2, RSC, and PPC601) so that it will not be allocated. |
a238cd8b | 962 | 64-bit AIX reserves GPR13 for thread-private data. |
f85f4585 RK |
963 | Conditionally disable FPRs. */ |
964 | ||
8d30c4ee FS |
965 | #define CONDITIONAL_REGISTER_USAGE \ |
966 | { \ | |
e9e4208a | 967 | int i; \ |
8d30c4ee FS |
968 | if (! TARGET_POWER) \ |
969 | fixed_regs[64] = 1; \ | |
970 | if (TARGET_64BIT) \ | |
289e96b2 AH |
971 | fixed_regs[13] = call_used_regs[13] \ |
972 | = call_really_used_regs[13] = 1; \ | |
8d30c4ee FS |
973 | if (TARGET_SOFT_FLOAT) \ |
974 | for (i = 32; i < 64; i++) \ | |
289e96b2 AH |
975 | fixed_regs[i] = call_used_regs[i] \ |
976 | = call_really_used_regs[i] = 1; \ | |
f607bc57 | 977 | if (DEFAULT_ABI == ABI_V4 && flag_pic == 1) \ |
8d30c4ee | 978 | fixed_regs[PIC_OFFSET_TABLE_REGNUM] \ |
289e96b2 AH |
979 | = call_used_regs[PIC_OFFSET_TABLE_REGNUM] \ |
980 | = call_really_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ | |
ee890fe2 SS |
981 | if (DEFAULT_ABI == ABI_DARWIN && flag_pic) \ |
982 | global_regs[PIC_OFFSET_TABLE_REGNUM] \ | |
983 | = fixed_regs[PIC_OFFSET_TABLE_REGNUM] \ | |
289e96b2 AH |
984 | = call_used_regs[PIC_OFFSET_TABLE_REGNUM] \ |
985 | = call_really_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ | |
2473ee11 AH |
986 | if (! TARGET_ALTIVEC) \ |
987 | for (i = FIRST_ALTIVEC_REGNO; i <= LAST_ALTIVEC_REGNO; ++i) \ | |
289e96b2 | 988 | fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1; \ |
0ac081f6 | 989 | if (TARGET_ALTIVEC_ABI) \ |
2473ee11 | 990 | for (i = FIRST_ALTIVEC_REGNO; i < FIRST_ALTIVEC_REGNO + 20; ++i) \ |
289e96b2 | 991 | call_used_regs[i] = call_really_used_regs[i] = 1; \ |
f85f4585 | 992 | } |
6febd581 | 993 | |
f045b2c9 RS |
994 | /* Specify the registers used for certain standard purposes. |
995 | The values of these macros are register numbers. */ | |
996 | ||
997 | /* RS/6000 pc isn't overloaded on a register that the compiler knows about. */ | |
998 | /* #define PC_REGNUM */ | |
999 | ||
1000 | /* Register to use for pushing function arguments. */ | |
1001 | #define STACK_POINTER_REGNUM 1 | |
1002 | ||
1003 | /* Base register for access to local variables of the function. */ | |
1004 | #define FRAME_POINTER_REGNUM 31 | |
1005 | ||
1006 | /* Value should be nonzero if functions must have frame pointers. | |
1007 | Zero means the frame pointer need not be set up (and parms | |
1008 | may be accessed via the stack pointer) in functions that seem suitable. | |
1009 | This is computed in `reload', in reload1.c. */ | |
1010 | #define FRAME_POINTER_REQUIRED 0 | |
1011 | ||
1012 | /* Base register for access to arguments of the function. */ | |
1013 | #define ARG_POINTER_REGNUM 67 | |
1014 | ||
1015 | /* Place to put static chain when calling a function that requires it. */ | |
1016 | #define STATIC_CHAIN_REGNUM 11 | |
1017 | ||
82e41834 | 1018 | /* Link register number. */ |
9ebbca7d | 1019 | #define LINK_REGISTER_REGNUM 65 |
b6c9286a | 1020 | |
82e41834 | 1021 | /* Count register number. */ |
9ebbca7d | 1022 | #define COUNT_REGISTER_REGNUM 66 |
802a0058 | 1023 | |
f045b2c9 RS |
1024 | /* Place that structure value return address is placed. |
1025 | ||
1026 | On the RS/6000, it is passed as an extra parameter. */ | |
1ff7789b | 1027 | #define STRUCT_VALUE 0 |
f045b2c9 RS |
1028 | \f |
1029 | /* Define the classes of registers for register constraints in the | |
1030 | machine description. Also define ranges of constants. | |
1031 | ||
1032 | One of the classes must always be named ALL_REGS and include all hard regs. | |
1033 | If there is more than one class, another class must be named NO_REGS | |
1034 | and contain no registers. | |
1035 | ||
1036 | The name GENERAL_REGS must be the name of a class (or an alias for | |
1037 | another name such as ALL_REGS). This is the class of registers | |
1038 | that is allowed by "g" or "r" in a register constraint. | |
1039 | Also, registers outside this class are allocated only when | |
1040 | instructions express preferences for them. | |
1041 | ||
1042 | The classes must be numbered in nondecreasing order; that is, | |
1043 | a larger-numbered class must never be contained completely | |
1044 | in a smaller-numbered class. | |
1045 | ||
1046 | For any two classes, it is very desirable that there be another | |
1047 | class that represents their union. */ | |
c81bebd7 | 1048 | |
f045b2c9 RS |
1049 | /* The RS/6000 has three types of registers, fixed-point, floating-point, |
1050 | and condition registers, plus three special registers, MQ, CTR, and the | |
1051 | link register. | |
1052 | ||
1053 | However, r0 is special in that it cannot be used as a base register. | |
1054 | So make a class for registers valid as base registers. | |
1055 | ||
1056 | Also, cr0 is the only condition code register that can be used in | |
0d86f538 | 1057 | arithmetic insns, so make a separate class for it. */ |
f045b2c9 | 1058 | |
ebedb4dd MM |
1059 | enum reg_class |
1060 | { | |
1061 | NO_REGS, | |
ebedb4dd MM |
1062 | BASE_REGS, |
1063 | GENERAL_REGS, | |
1064 | FLOAT_REGS, | |
0ac081f6 AH |
1065 | ALTIVEC_REGS, |
1066 | VRSAVE_REGS, | |
ebedb4dd MM |
1067 | NON_SPECIAL_REGS, |
1068 | MQ_REGS, | |
1069 | LINK_REGS, | |
1070 | CTR_REGS, | |
1071 | LINK_OR_CTR_REGS, | |
1072 | SPECIAL_REGS, | |
1073 | SPEC_OR_GEN_REGS, | |
1074 | CR0_REGS, | |
ebedb4dd MM |
1075 | CR_REGS, |
1076 | NON_FLOAT_REGS, | |
9ebbca7d | 1077 | XER_REGS, |
ebedb4dd MM |
1078 | ALL_REGS, |
1079 | LIM_REG_CLASSES | |
1080 | }; | |
f045b2c9 RS |
1081 | |
1082 | #define N_REG_CLASSES (int) LIM_REG_CLASSES | |
1083 | ||
82e41834 | 1084 | /* Give names of register classes as strings for dump file. */ |
f045b2c9 | 1085 | |
ebedb4dd MM |
1086 | #define REG_CLASS_NAMES \ |
1087 | { \ | |
1088 | "NO_REGS", \ | |
ebedb4dd MM |
1089 | "BASE_REGS", \ |
1090 | "GENERAL_REGS", \ | |
1091 | "FLOAT_REGS", \ | |
0ac081f6 AH |
1092 | "ALTIVEC_REGS", \ |
1093 | "VRSAVE_REGS", \ | |
ebedb4dd MM |
1094 | "NON_SPECIAL_REGS", \ |
1095 | "MQ_REGS", \ | |
1096 | "LINK_REGS", \ | |
1097 | "CTR_REGS", \ | |
1098 | "LINK_OR_CTR_REGS", \ | |
1099 | "SPECIAL_REGS", \ | |
1100 | "SPEC_OR_GEN_REGS", \ | |
1101 | "CR0_REGS", \ | |
ebedb4dd MM |
1102 | "CR_REGS", \ |
1103 | "NON_FLOAT_REGS", \ | |
9ebbca7d | 1104 | "XER_REGS", \ |
ebedb4dd MM |
1105 | "ALL_REGS" \ |
1106 | } | |
f045b2c9 RS |
1107 | |
1108 | /* Define which registers fit in which classes. | |
1109 | This is an initializer for a vector of HARD_REG_SET | |
1110 | of length N_REG_CLASSES. */ | |
1111 | ||
0ac081f6 AH |
1112 | #define REG_CLASS_CONTENTS \ |
1113 | { \ | |
1114 | { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS */ \ | |
1115 | { 0xfffffffe, 0x00000000, 0x00000008, 0x00000000 }, /* BASE_REGS */ \ | |
1116 | { 0xffffffff, 0x00000000, 0x00000008, 0x00000000 }, /* GENERAL_REGS */ \ | |
1117 | { 0x00000000, 0xffffffff, 0x00000000, 0x00000000 }, /* FLOAT_REGS */ \ | |
089a05b8 SS |
1118 | { 0x00000000, 0x00000000, 0xffffe000, 0x00001fff }, /* ALTIVEC_REGS */ \ |
1119 | { 0x00000000, 0x00000000, 0x00000000, 0x00002000 }, /* VRSAVE_REGS */ \ | |
0ac081f6 AH |
1120 | { 0xffffffff, 0xffffffff, 0x00000008, 0x00000000 }, /* NON_SPECIAL_REGS */ \ |
1121 | { 0x00000000, 0x00000000, 0x00000001, 0x00000000 }, /* MQ_REGS */ \ | |
1122 | { 0x00000000, 0x00000000, 0x00000002, 0x00000000 }, /* LINK_REGS */ \ | |
1123 | { 0x00000000, 0x00000000, 0x00000004, 0x00000000 }, /* CTR_REGS */ \ | |
1124 | { 0x00000000, 0x00000000, 0x00000006, 0x00000000 }, /* LINK_OR_CTR_REGS */ \ | |
a004eb82 | 1125 | { 0x00000000, 0x00000000, 0x00000007, 0x00002000 }, /* SPECIAL_REGS */ \ |
0ac081f6 AH |
1126 | { 0xffffffff, 0x00000000, 0x0000000f, 0x00000000 }, /* SPEC_OR_GEN_REGS */ \ |
1127 | { 0x00000000, 0x00000000, 0x00000010, 0x00000000 }, /* CR0_REGS */ \ | |
1128 | { 0x00000000, 0x00000000, 0x00000ff0, 0x00000000 }, /* CR_REGS */ \ | |
089a05b8 SS |
1129 | { 0xffffffff, 0x00000000, 0x0000efff, 0x00000000 }, /* NON_FLOAT_REGS */ \ |
1130 | { 0x00000000, 0x00000000, 0x00001000, 0x00000000 }, /* XER_REGS */ \ | |
1131 | { 0xffffffff, 0xffffffff, 0xffffffff, 0x00003fff } /* ALL_REGS */ \ | |
ebedb4dd | 1132 | } |
f045b2c9 RS |
1133 | |
1134 | /* The same information, inverted: | |
1135 | Return the class number of the smallest class containing | |
1136 | reg number REGNO. This could be a conditional expression | |
1137 | or could index an array. */ | |
1138 | ||
0d86f538 GK |
1139 | #define REGNO_REG_CLASS(REGNO) \ |
1140 | ((REGNO) == 0 ? GENERAL_REGS \ | |
1141 | : (REGNO) < 32 ? BASE_REGS \ | |
1142 | : FP_REGNO_P (REGNO) ? FLOAT_REGS \ | |
0ac081f6 | 1143 | : ALTIVEC_REGNO_P (REGNO) ? ALTIVEC_REGS \ |
0d86f538 GK |
1144 | : (REGNO) == CR0_REGNO ? CR0_REGS \ |
1145 | : CR_REGNO_P (REGNO) ? CR_REGS \ | |
1146 | : (REGNO) == MQ_REGNO ? MQ_REGS \ | |
1147 | : (REGNO) == LINK_REGISTER_REGNUM ? LINK_REGS \ | |
1148 | : (REGNO) == COUNT_REGISTER_REGNUM ? CTR_REGS \ | |
1149 | : (REGNO) == ARG_POINTER_REGNUM ? BASE_REGS \ | |
1150 | : (REGNO) == XER_REGNO ? XER_REGS \ | |
0ac081f6 | 1151 | : (REGNO) == VRSAVE_REGNO ? VRSAVE_REGS \ |
f045b2c9 RS |
1152 | : NO_REGS) |
1153 | ||
1154 | /* The class value for index registers, and the one for base regs. */ | |
1155 | #define INDEX_REG_CLASS GENERAL_REGS | |
1156 | #define BASE_REG_CLASS BASE_REGS | |
1157 | ||
1158 | /* Get reg_class from a letter such as appears in the machine description. */ | |
1159 | ||
1160 | #define REG_CLASS_FROM_LETTER(C) \ | |
1161 | ((C) == 'f' ? FLOAT_REGS \ | |
1162 | : (C) == 'b' ? BASE_REGS \ | |
1163 | : (C) == 'h' ? SPECIAL_REGS \ | |
1164 | : (C) == 'q' ? MQ_REGS \ | |
1165 | : (C) == 'c' ? CTR_REGS \ | |
1166 | : (C) == 'l' ? LINK_REGS \ | |
0ac081f6 | 1167 | : (C) == 'v' ? ALTIVEC_REGS \ |
f045b2c9 RS |
1168 | : (C) == 'x' ? CR0_REGS \ |
1169 | : (C) == 'y' ? CR_REGS \ | |
9ebbca7d | 1170 | : (C) == 'z' ? XER_REGS \ |
f045b2c9 RS |
1171 | : NO_REGS) |
1172 | ||
1173 | /* The letters I, J, K, L, M, N, and P in a register constraint string | |
1174 | can be used to stand for particular ranges of immediate operands. | |
1175 | This macro defines what the ranges are. | |
1176 | C is the letter, and VALUE is a constant value. | |
1177 | Return 1 if VALUE is in the range specified by C. | |
1178 | ||
9615f239 | 1179 | `I' is a signed 16-bit constant |
f045b2c9 RS |
1180 | `J' is a constant with only the high-order 16 bits non-zero |
1181 | `K' is a constant with only the low-order 16 bits non-zero | |
9615f239 | 1182 | `L' is a signed 16-bit constant shifted left 16 bits |
f045b2c9 | 1183 | `M' is a constant that is greater than 31 |
2bfcf297 | 1184 | `N' is a positive constant that is an exact power of two |
f045b2c9 RS |
1185 | `O' is the constant zero |
1186 | `P' is a constant whose negation is a signed 16-bit constant */ | |
1187 | ||
5b6f7b96 RK |
1188 | #define CONST_OK_FOR_LETTER_P(VALUE, C) \ |
1189 | ( (C) == 'I' ? (unsigned HOST_WIDE_INT) ((VALUE) + 0x8000) < 0x10000 \ | |
0858c623 | 1190 | : (C) == 'J' ? ((VALUE) & (~ (unsigned HOST_WIDE_INT) 0xffff0000)) == 0 \ |
a260abc9 | 1191 | : (C) == 'K' ? ((VALUE) & (~ (HOST_WIDE_INT) 0xffff)) == 0 \ |
9615f239 DE |
1192 | : (C) == 'L' ? (((VALUE) & 0xffff) == 0 \ |
1193 | && ((VALUE) >> 31 == -1 || (VALUE) >> 31 == 0)) \ | |
5b6f7b96 | 1194 | : (C) == 'M' ? (VALUE) > 31 \ |
2bfcf297 | 1195 | : (C) == 'N' ? (VALUE) > 0 && exact_log2 (VALUE) >= 0 \ |
5b6f7b96 | 1196 | : (C) == 'O' ? (VALUE) == 0 \ |
9615f239 | 1197 | : (C) == 'P' ? (unsigned HOST_WIDE_INT) ((- (VALUE)) + 0x8000) < 0x10000 \ |
f045b2c9 RS |
1198 | : 0) |
1199 | ||
1200 | /* Similar, but for floating constants, and defining letters G and H. | |
1201 | Here VALUE is the CONST_DOUBLE rtx itself. | |
1202 | ||
1203 | We flag for special constants when we can copy the constant into | |
4e74d8ec | 1204 | a general register in two insns for DF/DI and one insn for SF. |
f045b2c9 | 1205 | |
c4c40373 | 1206 | 'H' is used for DI/DF constants that take 3 insns. */ |
4e74d8ec MM |
1207 | |
1208 | #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ | |
c4c40373 MM |
1209 | ( (C) == 'G' ? (num_insns_constant (VALUE, GET_MODE (VALUE)) \ |
1210 | == ((GET_MODE (VALUE) == SFmode) ? 1 : 2)) \ | |
1211 | : (C) == 'H' ? (num_insns_constant (VALUE, GET_MODE (VALUE)) == 3) \ | |
1212 | : 0) | |
f045b2c9 RS |
1213 | |
1214 | /* Optional extra constraints for this machine. | |
1215 | ||
b6c9286a MM |
1216 | 'Q' means that is a memory operand that is just an offset from a reg. |
1217 | 'R' is for AIX TOC entries. | |
a260abc9 | 1218 | 'S' is a constant that can be placed into a 64-bit mask operand |
9615f239 | 1219 | 'T' is a consatnt that can be placed into a 32-bit mask operand |
88228c4b | 1220 | 'U' is for V.4 small data references. */ |
f045b2c9 | 1221 | |
e8a8bc24 RK |
1222 | #define EXTRA_CONSTRAINT(OP, C) \ |
1223 | ((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG \ | |
d537c24d | 1224 | : (C) == 'R' ? LEGITIMATE_CONSTANT_POOL_ADDRESS_P (OP) \ |
a260abc9 | 1225 | : (C) == 'S' ? mask64_operand (OP, VOIDmode) \ |
9615f239 | 1226 | : (C) == 'T' ? mask_operand (OP, VOIDmode) \ |
f607bc57 | 1227 | : (C) == 'U' ? (DEFAULT_ABI == ABI_V4 \ |
c81bebd7 | 1228 | && small_data_operand (OP, GET_MODE (OP))) \ |
e8a8bc24 | 1229 | : 0) |
f045b2c9 RS |
1230 | |
1231 | /* Given an rtx X being reloaded into a reg required to be | |
1232 | in class CLASS, return the class of reg to actually use. | |
1233 | In general this is just CLASS; but on some machines | |
c81bebd7 | 1234 | in some cases it is preferable to use a more restrictive class. |
f045b2c9 RS |
1235 | |
1236 | On the RS/6000, we have to return NO_REGS when we want to reload a | |
1e66d555 GK |
1237 | floating-point CONST_DOUBLE to force it to be copied to memory. |
1238 | ||
1239 | We also don't want to reload integer values into floating-point | |
1240 | registers if we can at all help it. In fact, this can | |
1241 | cause reload to abort, if it tries to generate a reload of CTR | |
1242 | into a FP register and discovers it doesn't have the memory location | |
1243 | required. | |
1244 | ||
1245 | ??? Would it be a good idea to have reload do the converse, that is | |
1246 | try to reload floating modes into FP registers if possible? | |
1247 | */ | |
f045b2c9 | 1248 | |
802a0058 | 1249 | #define PREFERRED_RELOAD_CLASS(X,CLASS) \ |
1e66d555 GK |
1250 | (((GET_CODE (X) == CONST_DOUBLE \ |
1251 | && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \ | |
1252 | ? NO_REGS \ | |
1253 | : (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \ | |
1254 | && (CLASS) == NON_SPECIAL_REGS) \ | |
1255 | ? GENERAL_REGS \ | |
1256 | : (CLASS))) | |
c81bebd7 | 1257 | |
f045b2c9 RS |
1258 | /* Return the register class of a scratch register needed to copy IN into |
1259 | or out of a register in CLASS in MODE. If it can be done directly, | |
1260 | NO_REGS is returned. */ | |
1261 | ||
1262 | #define SECONDARY_RELOAD_CLASS(CLASS,MODE,IN) \ | |
1263 | secondary_reload_class (CLASS, MODE, IN) | |
1264 | ||
0ac081f6 AH |
1265 | /* If we are copying between FP or AltiVec registers and anything |
1266 | else, we need a memory location. */ | |
7ea555a4 | 1267 | |
0ac081f6 AH |
1268 | #define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) \ |
1269 | ((CLASS1) != (CLASS2) && ((CLASS1) == FLOAT_REGS \ | |
1270 | || (CLASS2) == FLOAT_REGS \ | |
1271 | || (CLASS1) == ALTIVEC_REGS \ | |
1272 | || (CLASS2) == ALTIVEC_REGS)) | |
7ea555a4 | 1273 | |
f045b2c9 RS |
1274 | /* Return the maximum number of consecutive registers |
1275 | needed to represent mode MODE in a register of class CLASS. | |
1276 | ||
1277 | On RS/6000, this is the size of MODE in words, | |
1278 | except in the FP regs, where a single reg is enough for two words. */ | |
802a0058 | 1279 | #define CLASS_MAX_NREGS(CLASS, MODE) \ |
9ebbca7d | 1280 | (((CLASS) == FLOAT_REGS) \ |
2e360ab3 | 1281 | ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \ |
f045b2c9 | 1282 | : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) |
580d3230 RK |
1283 | |
1284 | /* If defined, gives a class of registers that cannot be used as the | |
02188693 | 1285 | operand of a SUBREG that changes the mode of the object illegally. */ |
580d3230 | 1286 | |
02188693 RH |
1287 | #define CLASS_CANNOT_CHANGE_MODE FLOAT_REGS |
1288 | ||
1289 | /* Defines illegal mode changes for CLASS_CANNOT_CHANGE_MODE. */ | |
1290 | ||
1291 | #define CLASS_CANNOT_CHANGE_MODE_P(FROM,TO) \ | |
1292 | (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)) | |
f045b2c9 RS |
1293 | \f |
1294 | /* Stack layout; function entry, exit and calling. */ | |
1295 | ||
6b67933e RK |
1296 | /* Enumeration to give which calling sequence to use. */ |
1297 | enum rs6000_abi { | |
1298 | ABI_NONE, | |
1299 | ABI_AIX, /* IBM's AIX */ | |
f607bc57 ZW |
1300 | ABI_AIX_NODESC, /* AIX calling sequence minus |
1301 | function descriptors */ | |
b6c9286a | 1302 | ABI_V4, /* System V.4/eabi */ |
ee890fe2 | 1303 | ABI_DARWIN /* Apple's Darwin (OS X kernel) */ |
6b67933e RK |
1304 | }; |
1305 | ||
b6c9286a MM |
1306 | extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */ |
1307 | ||
4697a36c MM |
1308 | /* Structure used to define the rs6000 stack */ |
1309 | typedef struct rs6000_stack { | |
1310 | int first_gp_reg_save; /* first callee saved GP register used */ | |
1311 | int first_fp_reg_save; /* first callee saved FP register used */ | |
00b960c7 | 1312 | int first_altivec_reg_save; /* first callee saved AltiVec register used */ |
4697a36c MM |
1313 | int lr_save_p; /* true if the link reg needs to be saved */ |
1314 | int cr_save_p; /* true if the CR reg needs to be saved */ | |
00b960c7 | 1315 | unsigned int vrsave_mask; /* mask of vec registers to save */ |
b6c9286a | 1316 | int toc_save_p; /* true if the TOC needs to be saved */ |
4697a36c MM |
1317 | int push_p; /* true if we need to allocate stack space */ |
1318 | int calls_p; /* true if the function makes any calls */ | |
6b67933e | 1319 | enum rs6000_abi abi; /* which ABI to use */ |
abc95ed3 RK |
1320 | int gp_save_offset; /* offset to save GP regs from initial SP */ |
1321 | int fp_save_offset; /* offset to save FP regs from initial SP */ | |
00b960c7 | 1322 | int altivec_save_offset; /* offset to save AltiVec regs from inital SP */ |
4697a36c MM |
1323 | int lr_save_offset; /* offset to save LR from initial SP */ |
1324 | int cr_save_offset; /* offset to save CR from initial SP */ | |
00b960c7 | 1325 | int vrsave_save_offset; /* offset to save VRSAVE from initial SP */ |
b6c9286a | 1326 | int toc_save_offset; /* offset to save the TOC pointer */ |
4697a36c | 1327 | int varargs_save_offset; /* offset to save the varargs registers */ |
83720594 | 1328 | int ehrd_offset; /* offset to EH return data */ |
4697a36c MM |
1329 | int reg_size; /* register size (4 or 8) */ |
1330 | int varargs_size; /* size to hold V.4 args passed in regs */ | |
1331 | int vars_size; /* variable save area size */ | |
1332 | int parm_size; /* outgoing parameter size */ | |
1333 | int save_size; /* save area size */ | |
1334 | int fixed_size; /* fixed size of stack frame */ | |
1335 | int gp_size; /* size of saved GP registers */ | |
1336 | int fp_size; /* size of saved FP registers */ | |
00b960c7 | 1337 | int altivec_size; /* size of saved AltiVec registers */ |
4697a36c | 1338 | int cr_size; /* size to hold CR if not in save_size */ |
b6c9286a | 1339 | int lr_size; /* size to hold LR if not in save_size */ |
00b960c7 AH |
1340 | int vrsave_size; /* size to hold VRSAVE if not in save_size */ |
1341 | int altivec_padding_size; /* size of altivec alignment padding if | |
1342 | not in save_size */ | |
b6c9286a | 1343 | int toc_size; /* size to hold TOC if not in save_size */ |
4697a36c MM |
1344 | int total_size; /* total bytes allocated for stack */ |
1345 | } rs6000_stack_t; | |
1346 | ||
f045b2c9 RS |
1347 | /* Define this if pushing a word on the stack |
1348 | makes the stack pointer a smaller address. */ | |
1349 | #define STACK_GROWS_DOWNWARD | |
1350 | ||
1351 | /* Define this if the nominal address of the stack frame | |
1352 | is at the high-address end of the local variables; | |
1353 | that is, each additional local variable allocated | |
1354 | goes at a more negative offset in the frame. | |
1355 | ||
1356 | On the RS/6000, we grow upwards, from the area after the outgoing | |
1357 | arguments. */ | |
1358 | /* #define FRAME_GROWS_DOWNWARD */ | |
1359 | ||
4697a36c | 1360 | /* Size of the outgoing register save area */ |
9ebbca7d | 1361 | #define RS6000_REG_SAVE ((DEFAULT_ABI == ABI_AIX \ |
ee890fe2 SS |
1362 | || DEFAULT_ABI == ABI_AIX_NODESC \ |
1363 | || DEFAULT_ABI == ABI_DARWIN) \ | |
9ebbca7d GK |
1364 | ? (TARGET_64BIT ? 64 : 32) \ |
1365 | : 0) | |
4697a36c MM |
1366 | |
1367 | /* Size of the fixed area on the stack */ | |
9ebbca7d | 1368 | #define RS6000_SAVE_AREA \ |
ee890fe2 | 1369 | (((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC || DEFAULT_ABI == ABI_DARWIN) ? 24 : 8) \ |
9ebbca7d | 1370 | << (TARGET_64BIT ? 1 : 0)) |
4697a36c | 1371 | |
97f6e72f DE |
1372 | /* MEM representing address to save the TOC register */ |
1373 | #define RS6000_SAVE_TOC gen_rtx_MEM (Pmode, \ | |
1374 | plus_constant (stack_pointer_rtx, \ | |
1375 | (TARGET_32BIT ? 20 : 40))) | |
b6c9286a | 1376 | |
4697a36c MM |
1377 | /* Size of the V.4 varargs area if needed */ |
1378 | #define RS6000_VARARGS_AREA 0 | |
1379 | ||
4697a36c | 1380 | /* Align an address */ |
ed33106f | 1381 | #define RS6000_ALIGN(n,a) (((n) + (a) - 1) & ~((a) - 1)) |
4697a36c MM |
1382 | |
1383 | /* Size of V.4 varargs area in bytes */ | |
1384 | #define RS6000_VARARGS_SIZE \ | |
2f3e5814 | 1385 | ((GP_ARG_NUM_REG * (TARGET_32BIT ? 4 : 8)) + (FP_ARG_NUM_REG * 8) + 8) |
4697a36c | 1386 | |
f045b2c9 RS |
1387 | /* Offset within stack frame to start allocating local variables at. |
1388 | If FRAME_GROWS_DOWNWARD, this is the offset to the END of the | |
1389 | first local allocated. Otherwise, it is the offset to the BEGINNING | |
c81bebd7 | 1390 | of the first local allocated. |
f045b2c9 RS |
1391 | |
1392 | On the RS/6000, the frame pointer is the same as the stack pointer, | |
1393 | except for dynamic allocations. So we start after the fixed area and | |
1394 | outgoing parameter area. */ | |
1395 | ||
802a0058 | 1396 | #define STARTING_FRAME_OFFSET \ |
7b094d6e AH |
1397 | (RS6000_ALIGN (current_function_outgoing_args_size, \ |
1398 | TARGET_ALTIVEC ? 16 : 8) \ | |
802a0058 MM |
1399 | + RS6000_VARARGS_AREA \ |
1400 | + RS6000_SAVE_AREA) | |
1401 | ||
1402 | /* Offset from the stack pointer register to an item dynamically | |
1403 | allocated on the stack, e.g., by `alloca'. | |
1404 | ||
1405 | The default value for this macro is `STACK_POINTER_OFFSET' plus the | |
1406 | length of the outgoing arguments. The default is correct for most | |
1407 | machines. See `function.c' for details. */ | |
1408 | #define STACK_DYNAMIC_OFFSET(FUNDECL) \ | |
7b094d6e AH |
1409 | (RS6000_ALIGN (current_function_outgoing_args_size, \ |
1410 | TARGET_ALTIVEC ? 16 : 8) \ | |
802a0058 | 1411 | + (STACK_POINTER_OFFSET)) |
f045b2c9 RS |
1412 | |
1413 | /* If we generate an insn to push BYTES bytes, | |
1414 | this says how many the stack pointer really advances by. | |
1415 | On RS/6000, don't define this because there are no push insns. */ | |
1416 | /* #define PUSH_ROUNDING(BYTES) */ | |
1417 | ||
1418 | /* Offset of first parameter from the argument pointer register value. | |
1419 | On the RS/6000, we define the argument pointer to the start of the fixed | |
1420 | area. */ | |
4697a36c | 1421 | #define FIRST_PARM_OFFSET(FNDECL) RS6000_SAVE_AREA |
f045b2c9 | 1422 | |
62153b61 JM |
1423 | /* Offset from the argument pointer register value to the top of |
1424 | stack. This is different from FIRST_PARM_OFFSET because of the | |
1425 | register save area. */ | |
1426 | #define ARG_POINTER_CFA_OFFSET(FNDECL) 0 | |
1427 | ||
f045b2c9 RS |
1428 | /* Define this if stack space is still allocated for a parameter passed |
1429 | in a register. The value is the number of bytes allocated to this | |
1430 | area. */ | |
4697a36c | 1431 | #define REG_PARM_STACK_SPACE(FNDECL) RS6000_REG_SAVE |
f045b2c9 RS |
1432 | |
1433 | /* Define this if the above stack space is to be considered part of the | |
1434 | space allocated by the caller. */ | |
1435 | #define OUTGOING_REG_PARM_STACK_SPACE | |
1436 | ||
1437 | /* This is the difference between the logical top of stack and the actual sp. | |
1438 | ||
82e41834 | 1439 | For the RS/6000, sp points past the fixed area. */ |
4697a36c | 1440 | #define STACK_POINTER_OFFSET RS6000_SAVE_AREA |
f045b2c9 RS |
1441 | |
1442 | /* Define this if the maximum size of all the outgoing args is to be | |
1443 | accumulated and pushed during the prologue. The amount can be | |
1444 | found in the variable current_function_outgoing_args_size. */ | |
f73ad30e | 1445 | #define ACCUMULATE_OUTGOING_ARGS 1 |
f045b2c9 RS |
1446 | |
1447 | /* Value is the number of bytes of arguments automatically | |
1448 | popped when returning from a subroutine call. | |
8b109b37 | 1449 | FUNDECL is the declaration node of the function (as a tree), |
f045b2c9 RS |
1450 | FUNTYPE is the data type of the function (as a tree), |
1451 | or for a library call it is an identifier node for the subroutine name. | |
1452 | SIZE is the number of bytes of arguments passed on the stack. */ | |
1453 | ||
8b109b37 | 1454 | #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 |
f045b2c9 RS |
1455 | |
1456 | /* Define how to find the value returned by a function. | |
1457 | VALTYPE is the data type of the value (as a tree). | |
1458 | If the precise function being called is known, FUNC is its FUNCTION_DECL; | |
1459 | otherwise, FUNC is 0. | |
1460 | ||
c81bebd7 | 1461 | On RS/6000 an integer value is in r3 and a floating-point value is in |
d14a6d05 | 1462 | fp1, unless -msoft-float. */ |
f045b2c9 | 1463 | |
39403d82 DE |
1464 | #define FUNCTION_VALUE(VALTYPE, FUNC) \ |
1465 | gen_rtx_REG ((INTEGRAL_TYPE_P (VALTYPE) \ | |
1466 | && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \ | |
1467 | || POINTER_TYPE_P (VALTYPE) \ | |
1468 | ? word_mode : TYPE_MODE (VALTYPE), \ | |
0ac081f6 AH |
1469 | TREE_CODE (VALTYPE) == VECTOR_TYPE ? ALTIVEC_ARG_RETURN \ |
1470 | : TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_HARD_FLOAT \ | |
e9cf9523 | 1471 | ? FP_ARG_RETURN : GP_ARG_RETURN) |
f045b2c9 RS |
1472 | |
1473 | /* Define how to find the value returned by a library function | |
1474 | assuming the value has mode MODE. */ | |
1475 | ||
0ac081f6 AH |
1476 | #define LIBCALL_VALUE(MODE) \ |
1477 | gen_rtx_REG (MODE, ALTIVEC_VECTOR_MODE (MODE) ? ALTIVEC_ARG_RETURN \ | |
1478 | : GET_MODE_CLASS (MODE) == MODE_FLOAT \ | |
1479 | && TARGET_HARD_FLOAT \ | |
1480 | ? FP_ARG_RETURN : GP_ARG_RETURN) | |
f045b2c9 | 1481 | |
6fa3f289 ZW |
1482 | /* The AIX ABI for the RS/6000 specifies that all structures are |
1483 | returned in memory. The Darwin ABI does the same. The SVR4 ABI | |
1484 | specifies that structures <= 8 bytes are returned in r3/r4, but a | |
1485 | draft put them in memory, and GCC used to implement the draft | |
1486 | instead of the final standard. Therefore, TARGET_AIX_STRUCT_RET | |
1487 | controls this instead of DEFAULT_ABI; V.4 targets needing backward | |
1488 | compatibility can change DRAFT_V4_STRUCT_RET to override the | |
1489 | default, and -m switches get the final word. See | |
52acbdcb ZW |
1490 | rs6000_override_options for more details. |
1491 | ||
1492 | int_size_in_bytes returns -1 for variable size objects, which go in | |
1493 | memory always. The cast to unsigned makes -1 > 8. */ | |
1494 | ||
6fa3f289 ZW |
1495 | #define RETURN_IN_MEMORY(TYPE) \ |
1496 | (AGGREGATE_TYPE_P (TYPE) && \ | |
52acbdcb ZW |
1497 | (TARGET_AIX_STRUCT_RET || \ |
1498 | (unsigned HOST_WIDEST_INT) int_size_in_bytes (TYPE) > 8)) | |
f045b2c9 | 1499 | |
6fa3f289 ZW |
1500 | /* DRAFT_V4_STRUCT_RET defaults off. */ |
1501 | #define DRAFT_V4_STRUCT_RET 0 | |
f607bc57 ZW |
1502 | |
1503 | /* Let RETURN_IN_MEMORY control what happens. */ | |
1504 | #define DEFAULT_PCC_STRUCT_RETURN 0 | |
f045b2c9 | 1505 | |
a260abc9 | 1506 | /* Mode of stack savearea. |
dfdfa60f DE |
1507 | FUNCTION is VOIDmode because calling convention maintains SP. |
1508 | BLOCK needs Pmode for SP. | |
a260abc9 DE |
1509 | NONLOCAL needs twice Pmode to maintain both backchain and SP. */ |
1510 | #define STACK_SAVEAREA_MODE(LEVEL) \ | |
dfdfa60f DE |
1511 | (LEVEL == SAVE_FUNCTION ? VOIDmode \ |
1512 | : LEVEL == SAVE_NONLOCAL ? (TARGET_32BIT ? DImode : TImode) : Pmode) | |
a260abc9 | 1513 | |
4697a36c MM |
1514 | /* Minimum and maximum general purpose registers used to hold arguments. */ |
1515 | #define GP_ARG_MIN_REG 3 | |
1516 | #define GP_ARG_MAX_REG 10 | |
1517 | #define GP_ARG_NUM_REG (GP_ARG_MAX_REG - GP_ARG_MIN_REG + 1) | |
1518 | ||
1519 | /* Minimum and maximum floating point registers used to hold arguments. */ | |
1520 | #define FP_ARG_MIN_REG 33 | |
7509c759 MM |
1521 | #define FP_ARG_AIX_MAX_REG 45 |
1522 | #define FP_ARG_V4_MAX_REG 40 | |
9ebbca7d | 1523 | #define FP_ARG_MAX_REG ((DEFAULT_ABI == ABI_AIX \ |
ee890fe2 SS |
1524 | || DEFAULT_ABI == ABI_AIX_NODESC \ |
1525 | || DEFAULT_ABI == ABI_DARWIN) \ | |
9ebbca7d | 1526 | ? FP_ARG_AIX_MAX_REG : FP_ARG_V4_MAX_REG) |
4697a36c MM |
1527 | #define FP_ARG_NUM_REG (FP_ARG_MAX_REG - FP_ARG_MIN_REG + 1) |
1528 | ||
0ac081f6 AH |
1529 | /* Minimum and maximum AltiVec registers used to hold arguments. */ |
1530 | #define ALTIVEC_ARG_MIN_REG (FIRST_ALTIVEC_REGNO + 2) | |
1531 | #define ALTIVEC_ARG_MAX_REG (ALTIVEC_ARG_MIN_REG + 11) | |
1532 | #define ALTIVEC_ARG_NUM_REG (ALTIVEC_ARG_MAX_REG - ALTIVEC_ARG_MIN_REG + 1) | |
1533 | ||
4697a36c MM |
1534 | /* Return registers */ |
1535 | #define GP_ARG_RETURN GP_ARG_MIN_REG | |
1536 | #define FP_ARG_RETURN FP_ARG_MIN_REG | |
0ac081f6 | 1537 | #define ALTIVEC_ARG_RETURN (FIRST_ALTIVEC_REGNO + 2) |
4697a36c | 1538 | |
7509c759 | 1539 | /* Flags for the call/call_value rtl operations set up by function_arg */ |
6a4cee5f | 1540 | #define CALL_NORMAL 0x00000000 /* no special processing */ |
9ebbca7d | 1541 | /* Bits in 0x00000001 are unused. */ |
6a4cee5f MM |
1542 | #define CALL_V4_CLEAR_FP_ARGS 0x00000002 /* V.4, no FP args passed */ |
1543 | #define CALL_V4_SET_FP_ARGS 0x00000004 /* V.4, FP args were passed */ | |
1544 | #define CALL_LONG 0x00000008 /* always call indirect */ | |
7509c759 | 1545 | |
f045b2c9 RS |
1546 | /* 1 if N is a possible register number for a function value |
1547 | as seen by the caller. | |
1548 | ||
0ac081f6 AH |
1549 | On RS/6000, this is r3, fp1, and v2 (for AltiVec). */ |
1550 | #define FUNCTION_VALUE_REGNO_P(N) ((N) == GP_ARG_RETURN \ | |
1551 | || ((N) == FP_ARG_RETURN) \ | |
1552 | || (TARGET_ALTIVEC && \ | |
1553 | (N) == ALTIVEC_ARG_RETURN)) | |
f045b2c9 RS |
1554 | |
1555 | /* 1 if N is a possible register number for function argument passing. | |
0ac081f6 AH |
1556 | On RS/6000, these are r3-r10 and fp1-fp13. |
1557 | On AltiVec, v2 - v13 are used for passing vectors. */ | |
4697a36c | 1558 | #define FUNCTION_ARG_REGNO_P(N) \ |
6d0f55e6 | 1559 | ((unsigned)(((N) - GP_ARG_MIN_REG) < (unsigned)(GP_ARG_NUM_REG)) \ |
0ac081f6 | 1560 | || (TARGET_ALTIVEC && \ |
1a3ab9e1 | 1561 | (unsigned)((N) - ALTIVEC_ARG_MIN_REG) < (unsigned)(ALTIVEC_ARG_NUM_REG)) \ |
6d0f55e6 | 1562 | || ((unsigned)((N) - FP_ARG_MIN_REG) < (unsigned)(FP_ARG_NUM_REG))) |
f045b2c9 | 1563 | |
f045b2c9 | 1564 | \f |
00dba523 NC |
1565 | /* A C structure for machine-specific, per-function data. |
1566 | This is added to the cfun structure. */ | |
1567 | typedef struct machine_function | |
1568 | { | |
1569 | /* Whether a System V.4 varargs area was created. */ | |
1570 | int sysv_varargs_p; | |
71f123ca FS |
1571 | /* Flags if __builtin_return_address (n) with n >= 1 was used. */ |
1572 | int ra_needs_full_frame; | |
00dba523 NC |
1573 | } machine_function; |
1574 | ||
f045b2c9 RS |
1575 | /* Define a data type for recording info about an argument list |
1576 | during the scan of that argument list. This data type should | |
1577 | hold all necessary information about the function itself | |
1578 | and about the args processed so far, enough to enable macros | |
1579 | such as FUNCTION_ARG to determine where the next arg should go. | |
1580 | ||
1581 | On the RS/6000, this is a structure. The first element is the number of | |
1582 | total argument words, the second is used to store the next | |
1583 | floating-point register number, and the third says how many more args we | |
4697a36c MM |
1584 | have prototype types for. |
1585 | ||
4cc833b7 RH |
1586 | For ABI_V4, we treat these slightly differently -- `sysv_gregno' is |
1587 | the next availible GP register, `fregno' is the next available FP | |
1588 | register, and `words' is the number of words used on the stack. | |
1589 | ||
bd227acc | 1590 | The varargs/stdarg support requires that this structure's size |
4cc833b7 | 1591 | be a multiple of sizeof(int). */ |
4697a36c MM |
1592 | |
1593 | typedef struct rs6000_args | |
1594 | { | |
4cc833b7 | 1595 | int words; /* # words used for passing GP registers */ |
6a4cee5f | 1596 | int fregno; /* next available FP register */ |
0ac081f6 | 1597 | int vregno; /* next available AltiVec register */ |
6a4cee5f MM |
1598 | int nargs_prototype; /* # args left in the current prototype */ |
1599 | int orig_nargs; /* Original value of nargs_prototype */ | |
6a4cee5f MM |
1600 | int prototype; /* Whether a prototype was defined */ |
1601 | int call_cookie; /* Do special things for this call */ | |
4cc833b7 | 1602 | int sysv_gregno; /* next available GP register */ |
4697a36c | 1603 | } CUMULATIVE_ARGS; |
f045b2c9 RS |
1604 | |
1605 | /* Define intermediate macro to compute the size (in registers) of an argument | |
1606 | for the RS/6000. */ | |
1607 | ||
d34c5b80 DE |
1608 | #define RS6000_ARG_SIZE(MODE, TYPE) \ |
1609 | ((MODE) != BLKmode \ | |
c5d71f39 GK |
1610 | ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \ |
1611 | : ((unsigned HOST_WIDE_INT) int_size_in_bytes (TYPE) \ | |
1612 | + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) | |
f045b2c9 RS |
1613 | |
1614 | /* Initialize a variable CUM of type CUMULATIVE_ARGS | |
1615 | for a call to a function whose data type is FNTYPE. | |
1616 | For a library call, FNTYPE is 0. */ | |
1617 | ||
2c7ee1a6 | 1618 | #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \ |
4697a36c | 1619 | init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE) |
f045b2c9 RS |
1620 | |
1621 | /* Similar, but when scanning the definition of a procedure. We always | |
1622 | set NARGS_PROTOTYPE large so we never return an EXPR_LIST. */ | |
1623 | ||
4697a36c MM |
1624 | #define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,LIBNAME) \ |
1625 | init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE) | |
f045b2c9 RS |
1626 | |
1627 | /* Update the data in CUM to advance over an argument | |
1628 | of mode MODE and data type TYPE. | |
1629 | (TYPE is null for libcalls where that information may not be available.) */ | |
1630 | ||
1631 | #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ | |
4697a36c | 1632 | function_arg_advance (&CUM, MODE, TYPE, NAMED) |
f045b2c9 RS |
1633 | |
1634 | /* Non-zero if we can use a floating-point register to pass this arg. */ | |
4697a36c MM |
1635 | #define USE_FP_FOR_ARG_P(CUM,MODE,TYPE) \ |
1636 | (GET_MODE_CLASS (MODE) == MODE_FLOAT \ | |
1637 | && (CUM).fregno <= FP_ARG_MAX_REG \ | |
1638 | && TARGET_HARD_FLOAT) | |
f045b2c9 | 1639 | |
0ac081f6 AH |
1640 | /* Non-zero if we can use an AltiVec register to pass this arg. */ |
1641 | #define USE_ALTIVEC_FOR_ARG_P(CUM,MODE,TYPE) \ | |
1642 | (ALTIVEC_VECTOR_MODE (MODE) \ | |
1643 | && (CUM).vregno <= ALTIVEC_ARG_MAX_REG \ | |
1644 | && TARGET_ALTIVEC_ABI) | |
1645 | ||
f045b2c9 RS |
1646 | /* Determine where to put an argument to a function. |
1647 | Value is zero to push the argument on the stack, | |
1648 | or a hard register in which to store the argument. | |
1649 | ||
1650 | MODE is the argument's machine mode. | |
1651 | TYPE is the data type of the argument (as a tree). | |
1652 | This is null for libcalls where that information may | |
1653 | not be available. | |
1654 | CUM is a variable of type CUMULATIVE_ARGS which gives info about | |
1655 | the preceding args and about the function being called. | |
1656 | NAMED is nonzero if this argument is a named parameter | |
1657 | (otherwise it is an extra parameter matching an ellipsis). | |
1658 | ||
1659 | On RS/6000 the first eight words of non-FP are normally in registers | |
1660 | and the rest are pushed. The first 13 FP args are in registers. | |
1661 | ||
1662 | If this is floating-point and no prototype is specified, we use | |
4d6697ca RK |
1663 | both an FP and integer register (or possibly FP reg and stack). Library |
1664 | functions (when TYPE is zero) always have the proper types for args, | |
1665 | so we can pass the FP value just in one register. emit_library_function | |
1666 | doesn't support EXPR_LIST anyway. */ | |
f045b2c9 | 1667 | |
4697a36c MM |
1668 | #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ |
1669 | function_arg (&CUM, MODE, TYPE, NAMED) | |
f045b2c9 RS |
1670 | |
1671 | /* For an arg passed partly in registers and partly in memory, | |
1672 | this is the number of registers used. | |
1673 | For args passed entirely in registers or entirely in memory, zero. */ | |
1674 | ||
4697a36c MM |
1675 | #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ |
1676 | function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED) | |
1677 | ||
1678 | /* A C expression that indicates when an argument must be passed by | |
1679 | reference. If nonzero for an argument, a copy of that argument is | |
1680 | made in memory and a pointer to the argument is passed instead of | |
1681 | the argument itself. The pointer is passed in whatever way is | |
82e41834 | 1682 | appropriate for passing a pointer to that type. */ |
4697a36c MM |
1683 | |
1684 | #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ | |
1685 | function_arg_pass_by_reference(&CUM, MODE, TYPE, NAMED) | |
f045b2c9 | 1686 | |
c229cba9 DE |
1687 | /* If defined, a C expression which determines whether, and in which |
1688 | direction, to pad out an argument with extra space. The value | |
1689 | should be of type `enum direction': either `upward' to pad above | |
1690 | the argument, `downward' to pad below, or `none' to inhibit | |
1691 | padding. */ | |
1692 | ||
9ebbca7d | 1693 | #define FUNCTION_ARG_PADDING(MODE, TYPE) function_arg_padding (MODE, TYPE) |
c229cba9 | 1694 | |
b6c9286a | 1695 | /* If defined, a C expression that gives the alignment boundary, in bits, |
c81bebd7 | 1696 | of an argument with the specified mode and type. If it is not defined, |
b6c9286a MM |
1697 | PARM_BOUNDARY is used for all arguments. */ |
1698 | ||
1699 | #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \ | |
1700 | function_arg_boundary (MODE, TYPE) | |
1701 | ||
f045b2c9 | 1702 | /* Perform any needed actions needed for a function that is receiving a |
c81bebd7 | 1703 | variable number of arguments. |
f045b2c9 RS |
1704 | |
1705 | CUM is as above. | |
1706 | ||
1707 | MODE and TYPE are the mode and type of the current parameter. | |
1708 | ||
1709 | PRETEND_SIZE is a variable that should be set to the amount of stack | |
1710 | that must be pushed by the prolog to pretend that our caller pushed | |
1711 | it. | |
1712 | ||
1713 | Normally, this macro will push all remaining incoming registers on the | |
1714 | stack and set PRETEND_SIZE to the length of the registers pushed. */ | |
1715 | ||
4697a36c MM |
1716 | #define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \ |
1717 | setup_incoming_varargs (&CUM, MODE, TYPE, &PRETEND_SIZE, NO_RTL) | |
1718 | ||
dfafc897 FS |
1719 | /* Define the `__builtin_va_list' type for the ABI. */ |
1720 | #define BUILD_VA_LIST_TYPE(VALIST) \ | |
1721 | (VALIST) = rs6000_build_va_list () | |
4697a36c | 1722 | |
dfafc897 FS |
1723 | /* Implement `va_start' for varargs and stdarg. */ |
1724 | #define EXPAND_BUILTIN_VA_START(stdarg, valist, nextarg) \ | |
1725 | rs6000_va_start (stdarg, valist, nextarg) | |
1726 | ||
1727 | /* Implement `va_arg'. */ | |
1728 | #define EXPAND_BUILTIN_VA_ARG(valist, type) \ | |
1729 | rs6000_va_arg (valist, type) | |
f045b2c9 | 1730 | |
d34c5b80 DE |
1731 | /* Define this macro to be a nonzero value if the location where a function |
1732 | argument is passed depends on whether or not it is a named argument. */ | |
1733 | #define STRICT_ARGUMENT_NAMING 1 | |
1734 | ||
f045b2c9 | 1735 | /* Output assembler code to FILE to increment profiler label # LABELNO |
58a39e45 | 1736 | for profiling a function entry. */ |
f045b2c9 RS |
1737 | |
1738 | #define FUNCTION_PROFILER(FILE, LABELNO) \ | |
58a39e45 | 1739 | output_function_profiler ((FILE), (LABELNO)); |
f045b2c9 RS |
1740 | |
1741 | /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, | |
1742 | the stack pointer does not matter. No definition is equivalent to | |
1743 | always zero. | |
1744 | ||
1745 | On the RS/6000, this is non-zero because we can restore the stack from | |
1746 | its backpointer, which we maintain. */ | |
1747 | #define EXIT_IGNORE_STACK 1 | |
1748 | ||
a701949a FS |
1749 | /* Define this macro as a C expression that is nonzero for registers |
1750 | that are used by the epilogue or the return' pattern. The stack | |
1751 | and frame pointer registers are already be assumed to be used as | |
1752 | needed. */ | |
1753 | ||
83720594 RH |
1754 | #define EPILOGUE_USES(REGNO) \ |
1755 | ((reload_completed && (REGNO) == LINK_REGISTER_REGNUM) \ | |
00b960c7 | 1756 | || (REGNO) == VRSAVE_REGNO \ |
83720594 | 1757 | || (current_function_calls_eh_return \ |
3553b09d | 1758 | && TARGET_AIX \ |
83720594 | 1759 | && (REGNO) == TOC_REGISTER)) |
2bfcf297 | 1760 | |
f045b2c9 | 1761 | \f |
eaf1bcf1 | 1762 | /* TRAMPOLINE_TEMPLATE deleted */ |
f045b2c9 RS |
1763 | |
1764 | /* Length in units of the trampoline for entering a nested function. */ | |
1765 | ||
b6c9286a | 1766 | #define TRAMPOLINE_SIZE rs6000_trampoline_size () |
f045b2c9 RS |
1767 | |
1768 | /* Emit RTL insns to initialize the variable parts of a trampoline. | |
1769 | FNADDR is an RTX for the address of the function's pure code. | |
1770 | CXT is an RTX for the static chain value for the function. */ | |
1771 | ||
1772 | #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \ | |
b6c9286a | 1773 | rs6000_initialize_trampoline (ADDR, FNADDR, CXT) |
f045b2c9 | 1774 | \f |
f33985c6 MS |
1775 | /* Definitions for __builtin_return_address and __builtin_frame_address. |
1776 | __builtin_return_address (0) should give link register (65), enable | |
82e41834 | 1777 | this. */ |
f33985c6 MS |
1778 | /* This should be uncommented, so that the link register is used, but |
1779 | currently this would result in unmatched insns and spilling fixed | |
1780 | registers so we'll leave it for another day. When these problems are | |
1781 | taken care of one additional fetch will be necessary in RETURN_ADDR_RTX. | |
1782 | (mrs) */ | |
1783 | /* #define RETURN_ADDR_IN_PREVIOUS_FRAME */ | |
f09d4c33 | 1784 | |
b6c9286a MM |
1785 | /* Number of bytes into the frame return addresses can be found. See |
1786 | rs6000_stack_info in rs6000.c for more information on how the different | |
1787 | abi's store the return address. */ | |
1788 | #define RETURN_ADDRESS_OFFSET \ | |
1789 | ((DEFAULT_ABI == ABI_AIX \ | |
ee890fe2 | 1790 | || DEFAULT_ABI == ABI_DARWIN \ |
05ef2698 | 1791 | || DEFAULT_ABI == ABI_AIX_NODESC) ? (TARGET_32BIT ? 8 : 16) : \ |
3b370352 | 1792 | (DEFAULT_ABI == ABI_V4) ? 4 : \ |
c4636dd1 | 1793 | (internal_error ("RETURN_ADDRESS_OFFSET not supported"), 0)) |
f09d4c33 | 1794 | |
f33985c6 MS |
1795 | /* The current return address is in link register (65). The return address |
1796 | of anything farther back is accessed normally at an offset of 8 from the | |
1797 | frame pointer. */ | |
71f123ca FS |
1798 | #define RETURN_ADDR_RTX(COUNT, FRAME) \ |
1799 | (rs6000_return_addr (COUNT, FRAME)) | |
1800 | ||
f33985c6 | 1801 | \f |
f045b2c9 RS |
1802 | /* Definitions for register eliminations. |
1803 | ||
1804 | We have two registers that can be eliminated on the RS/6000. First, the | |
1805 | frame pointer register can often be eliminated in favor of the stack | |
1806 | pointer register. Secondly, the argument pointer register can always be | |
642a35f1 JW |
1807 | eliminated; it is replaced with either the stack or frame pointer. |
1808 | ||
1809 | In addition, we use the elimination mechanism to see if r30 is needed | |
1810 | Initially we assume that it isn't. If it is, we spill it. This is done | |
1811 | by making it an eliminable register. We replace it with itself so that | |
1812 | if it isn't needed, then existing uses won't be modified. */ | |
f045b2c9 RS |
1813 | |
1814 | /* This is an array of structures. Each structure initializes one pair | |
1815 | of eliminable registers. The "from" register number is given first, | |
1816 | followed by "to". Eliminations of the same "from" register are listed | |
1817 | in order of preference. */ | |
1818 | #define ELIMINABLE_REGS \ | |
1819 | {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ | |
1820 | { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ | |
642a35f1 JW |
1821 | { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ |
1822 | { 30, 30} } | |
f045b2c9 RS |
1823 | |
1824 | /* Given FROM and TO register numbers, say whether this elimination is allowed. | |
1825 | Frame pointer elimination is automatically handled. | |
1826 | ||
1827 | For the RS/6000, if frame pointer elimination is being done, we would like | |
642a35f1 JW |
1828 | to convert ap into fp, not sp. |
1829 | ||
abc95ed3 | 1830 | We need r30 if -mminimal-toc was specified, and there are constant pool |
642a35f1 | 1831 | references. */ |
f045b2c9 RS |
1832 | |
1833 | #define CAN_ELIMINATE(FROM, TO) \ | |
1834 | ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \ | |
1835 | ? ! frame_pointer_needed \ | |
4697a36c | 1836 | : (FROM) == 30 ? ! TARGET_MINIMAL_TOC || TARGET_NO_TOC || get_pool_size () == 0 \ |
f045b2c9 RS |
1837 | : 1) |
1838 | ||
1839 | /* Define the offset between two registers, one to be eliminated, and the other | |
1840 | its replacement, at the start of a routine. */ | |
1841 | #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ | |
1842 | { \ | |
4697a36c | 1843 | rs6000_stack_t *info = rs6000_stack_info (); \ |
f045b2c9 RS |
1844 | \ |
1845 | if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ | |
4697a36c MM |
1846 | (OFFSET) = (info->push_p) ? 0 : - info->total_size; \ |
1847 | else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \ | |
1848 | (OFFSET) = info->total_size; \ | |
1849 | else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ | |
1850 | (OFFSET) = (info->push_p) ? info->total_size : 0; \ | |
642a35f1 JW |
1851 | else if ((FROM) == 30) \ |
1852 | (OFFSET) = 0; \ | |
f045b2c9 RS |
1853 | else \ |
1854 | abort (); \ | |
1855 | } | |
1856 | \f | |
1857 | /* Addressing modes, and classification of registers for them. */ | |
1858 | ||
940da324 JL |
1859 | /* #define HAVE_POST_INCREMENT 0 */ |
1860 | /* #define HAVE_POST_DECREMENT 0 */ | |
f045b2c9 | 1861 | |
940da324 JL |
1862 | #define HAVE_PRE_DECREMENT 1 |
1863 | #define HAVE_PRE_INCREMENT 1 | |
f045b2c9 RS |
1864 | |
1865 | /* Macros to check register numbers against specific register classes. */ | |
1866 | ||
1867 | /* These assume that REGNO is a hard or pseudo reg number. | |
1868 | They give nonzero only if REGNO is a hard reg of the suitable class | |
1869 | or a pseudo reg currently allocated to a suitable hard reg. | |
1870 | Since they use reg_renumber, they are safe only once reg_renumber | |
1871 | has been allocated, which happens in local-alloc.c. */ | |
1872 | ||
1873 | #define REGNO_OK_FOR_INDEX_P(REGNO) \ | |
1874 | ((REGNO) < FIRST_PSEUDO_REGISTER \ | |
1875 | ? (REGNO) <= 31 || (REGNO) == 67 \ | |
1876 | : (reg_renumber[REGNO] >= 0 \ | |
1877 | && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67))) | |
1878 | ||
1879 | #define REGNO_OK_FOR_BASE_P(REGNO) \ | |
1880 | ((REGNO) < FIRST_PSEUDO_REGISTER \ | |
1881 | ? ((REGNO) > 0 && (REGNO) <= 31) || (REGNO) == 67 \ | |
1882 | : (reg_renumber[REGNO] > 0 \ | |
1883 | && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67))) | |
1884 | \f | |
1885 | /* Maximum number of registers that can appear in a valid memory address. */ | |
1886 | ||
1887 | #define MAX_REGS_PER_ADDRESS 2 | |
1888 | ||
1889 | /* Recognize any constant value that is a valid address. */ | |
1890 | ||
6eff269e BK |
1891 | #define CONSTANT_ADDRESS_P(X) \ |
1892 | (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \ | |
1893 | || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \ | |
1894 | || GET_CODE (X) == HIGH) | |
f045b2c9 RS |
1895 | |
1896 | /* Nonzero if the constant value X is a legitimate general operand. | |
1897 | It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. | |
1898 | ||
1899 | On the RS/6000, all integer constants are acceptable, most won't be valid | |
1900 | for particular insns, though. Only easy FP constants are | |
1901 | acceptable. */ | |
1902 | ||
1903 | #define LEGITIMATE_CONSTANT_P(X) \ | |
1904 | (GET_CODE (X) != CONST_DOUBLE || GET_MODE (X) == VOIDmode \ | |
a260abc9 | 1905 | || (TARGET_POWERPC64 && GET_MODE (X) == DImode) \ |
f045b2c9 RS |
1906 | || easy_fp_constant (X, GET_MODE (X))) |
1907 | ||
1908 | /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx | |
1909 | and check its validity for a certain class. | |
1910 | We have two alternate definitions for each of them. | |
1911 | The usual definition accepts all pseudo regs; the other rejects | |
1912 | them unless they have been allocated suitable hard regs. | |
1913 | The symbol REG_OK_STRICT causes the latter definition to be used. | |
1914 | ||
1915 | Most source files want to accept pseudo regs in the hope that | |
1916 | they will get allocated to the class that the insn wants them to be in. | |
1917 | Source files for reload pass need to be strict. | |
1918 | After reload, it makes no difference, since pseudo regs have | |
1919 | been eliminated by then. */ | |
1920 | ||
258bfae2 FS |
1921 | #ifdef REG_OK_STRICT |
1922 | # define REG_OK_STRICT_FLAG 1 | |
1923 | #else | |
1924 | # define REG_OK_STRICT_FLAG 0 | |
1925 | #endif | |
f045b2c9 RS |
1926 | |
1927 | /* Nonzero if X is a hard reg that can be used as an index | |
258bfae2 FS |
1928 | or if it is a pseudo reg in the non-strict case. */ |
1929 | #define INT_REG_OK_FOR_INDEX_P(X, STRICT) \ | |
1930 | ((! (STRICT) \ | |
1931 | && (REGNO (X) <= 31 \ | |
1932 | || REGNO (X) == ARG_POINTER_REGNUM \ | |
1933 | || REGNO (X) >= FIRST_PSEUDO_REGISTER)) \ | |
1934 | || ((STRICT) && REGNO_OK_FOR_INDEX_P (REGNO (X)))) | |
f045b2c9 RS |
1935 | |
1936 | /* Nonzero if X is a hard reg that can be used as a base reg | |
258bfae2 FS |
1937 | or if it is a pseudo reg in the non-strict case. */ |
1938 | #define INT_REG_OK_FOR_BASE_P(X, STRICT) \ | |
1939 | (REGNO (X) > 0 && INT_REG_OK_FOR_INDEX_P (X, (STRICT))) | |
f045b2c9 | 1940 | |
258bfae2 FS |
1941 | #define REG_OK_FOR_INDEX_P(X) INT_REG_OK_FOR_INDEX_P (X, REG_OK_STRICT_FLAG) |
1942 | #define REG_OK_FOR_BASE_P(X) INT_REG_OK_FOR_BASE_P (X, REG_OK_STRICT_FLAG) | |
f045b2c9 RS |
1943 | \f |
1944 | /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression | |
1945 | that is a valid memory address for an instruction. | |
1946 | The MODE argument is the machine mode for the MEM expression | |
1947 | that wants to use this address. | |
1948 | ||
1949 | On the RS/6000, there are four valid address: a SYMBOL_REF that | |
1950 | refers to a constant pool entry of an address (or the sum of it | |
1951 | plus a constant), a short (16-bit signed) constant plus a register, | |
1952 | the sum of two registers, or a register indirect, possibly with an | |
1953 | auto-increment. For DFmode and DImode with an constant plus register, | |
2f3e5814 | 1954 | we must ensure that both words are addressable or PowerPC64 with offset |
1427100a DE |
1955 | word aligned. |
1956 | ||
1957 | For modes spanning multiple registers (DFmode in 32-bit GPRs, | |
1958 | 32-bit DImode, TImode), indexed addressing cannot be used because | |
1959 | adjacent memory cells are accessed by adding word-sized offsets | |
1960 | during assembly output. */ | |
f045b2c9 | 1961 | |
9ebbca7d GK |
1962 | #define CONSTANT_POOL_EXPR_P(X) (constant_pool_expr_p (X)) |
1963 | ||
1964 | #define TOC_RELATIVE_EXPR_P(X) (toc_relative_expr_p (X)) | |
f045b2c9 RS |
1965 | |
1966 | #define LEGITIMATE_CONSTANT_POOL_ADDRESS_P(X) \ | |
9ebbca7d GK |
1967 | (TARGET_TOC \ |
1968 | && GET_CODE (X) == PLUS \ | |
1969 | && GET_CODE (XEXP (X, 0)) == REG \ | |
1970 | && (TARGET_MINIMAL_TOC || REGNO (XEXP (X, 0)) == TOC_REGISTER) \ | |
1971 | && CONSTANT_POOL_EXPR_P (XEXP (X, 1))) | |
f045b2c9 | 1972 | |
7509c759 | 1973 | #define LEGITIMATE_SMALL_DATA_P(MODE, X) \ |
f607bc57 | 1974 | (DEFAULT_ABI == ABI_V4 \ |
81795281 | 1975 | && !flag_pic && !TARGET_TOC \ |
88228c4b MM |
1976 | && (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == CONST) \ |
1977 | && small_data_operand (X, MODE)) | |
7509c759 | 1978 | |
258bfae2 | 1979 | #define LEGITIMATE_ADDRESS_INTEGER_P(X, OFFSET) \ |
f045b2c9 | 1980 | (GET_CODE (X) == CONST_INT \ |
5b6f7b96 | 1981 | && (unsigned HOST_WIDE_INT) (INTVAL (X) + (OFFSET) + 0x8000) < 0x10000) |
f045b2c9 | 1982 | |
258bfae2 FS |
1983 | #define LEGITIMATE_OFFSET_ADDRESS_P(MODE, X, STRICT) \ |
1984 | (GET_CODE (X) == PLUS \ | |
1985 | && GET_CODE (XEXP (X, 0)) == REG \ | |
1986 | && INT_REG_OK_FOR_BASE_P (XEXP (X, 0), (STRICT)) \ | |
1987 | && LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 0) \ | |
0ac081f6 | 1988 | && (! ALTIVEC_VECTOR_MODE (MODE) || INTVAL (X) == 0) \ |
258bfae2 FS |
1989 | && (((MODE) != DFmode && (MODE) != DImode) \ |
1990 | || (TARGET_32BIT \ | |
1991 | ? LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 4) \ | |
1992 | : ! (INTVAL (XEXP (X, 1)) & 3))) \ | |
1993 | && ((MODE) != TImode \ | |
1994 | || (TARGET_32BIT \ | |
1995 | ? LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 12) \ | |
1996 | : (LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 8) \ | |
1465faec | 1997 | && ! (INTVAL (XEXP (X, 1)) & 3))))) |
f045b2c9 | 1998 | |
258bfae2 FS |
1999 | #define LEGITIMATE_INDEXED_ADDRESS_P(X, STRICT) \ |
2000 | (GET_CODE (X) == PLUS \ | |
2001 | && GET_CODE (XEXP (X, 0)) == REG \ | |
2002 | && GET_CODE (XEXP (X, 1)) == REG \ | |
2003 | && ((INT_REG_OK_FOR_BASE_P (XEXP (X, 0), (STRICT)) \ | |
2004 | && INT_REG_OK_FOR_INDEX_P (XEXP (X, 1), (STRICT))) \ | |
2005 | || (INT_REG_OK_FOR_BASE_P (XEXP (X, 1), (STRICT)) \ | |
2006 | && INT_REG_OK_FOR_INDEX_P (XEXP (X, 0), (STRICT))))) | |
2007 | ||
2008 | #define LEGITIMATE_INDIRECT_ADDRESS_P(X, STRICT) \ | |
2009 | (GET_CODE (X) == REG && INT_REG_OK_FOR_BASE_P (X, (STRICT))) | |
2010 | ||
6ac7bf2c GK |
2011 | #define LEGITIMATE_LO_SUM_ADDRESS_P(MODE, X, STRICT) \ |
2012 | (TARGET_ELF \ | |
2013 | && ! flag_pic && ! TARGET_TOC \ | |
2014 | && GET_MODE_NUNITS (MODE) == 1 \ | |
2015 | && (GET_MODE_BITSIZE (MODE) <= 32 \ | |
c3bb62b9 | 2016 | || (TARGET_HARD_FLOAT && (MODE) == DFmode)) \ |
6ac7bf2c GK |
2017 | && GET_CODE (X) == LO_SUM \ |
2018 | && GET_CODE (XEXP (X, 0)) == REG \ | |
2019 | && INT_REG_OK_FOR_BASE_P (XEXP (X, 0), (STRICT)) \ | |
4697a36c MM |
2020 | && CONSTANT_P (XEXP (X, 1))) |
2021 | ||
258bfae2 FS |
2022 | #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ |
2023 | { if (rs6000_legitimate_address (MODE, X, REG_OK_STRICT_FLAG)) \ | |
2024 | goto ADDR; \ | |
f045b2c9 RS |
2025 | } |
2026 | \f | |
2027 | /* Try machine-dependent ways of modifying an illegitimate address | |
2028 | to be legitimate. If we find one, return the new, valid address. | |
2029 | This macro is used in only one place: `memory_address' in explow.c. | |
2030 | ||
2031 | OLDX is the address as it was before break_out_memory_refs was called. | |
2032 | In some cases it is useful to look at this to decide what needs to be done. | |
2033 | ||
2034 | MODE and WIN are passed so that this macro can use | |
2035 | GO_IF_LEGITIMATE_ADDRESS. | |
2036 | ||
2037 | It is always safe for this macro to do nothing. It exists to recognize | |
2038 | opportunities to optimize the output. | |
2039 | ||
2040 | On RS/6000, first check for the sum of a register with a constant | |
2041 | integer that is out of range. If so, generate code to add the | |
2042 | constant with the low-order 16 bits masked to the register and force | |
2043 | this result into another register (this can be done with `cau'). | |
c81bebd7 | 2044 | Then generate an address of REG+(CONST&0xffff), allowing for the |
f045b2c9 RS |
2045 | possibility of bit 16 being a one. |
2046 | ||
2047 | Then check for the sum of a register and something not constant, try to | |
2048 | load the other things into a register and return the sum. */ | |
2049 | ||
9ebbca7d GK |
2050 | #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \ |
2051 | { rtx result = rs6000_legitimize_address (X, OLDX, MODE); \ | |
2052 | if (result != NULL_RTX) \ | |
2053 | { \ | |
2054 | (X) = result; \ | |
2055 | goto WIN; \ | |
2056 | } \ | |
f045b2c9 RS |
2057 | } |
2058 | ||
a260abc9 DE |
2059 | /* Try a machine-dependent way of reloading an illegitimate address |
2060 | operand. If we find one, push the reload and jump to WIN. This | |
2061 | macro is used in only one place: `find_reloads_address' in reload.c. | |
2062 | ||
24ea750e DJ |
2063 | Implemented on rs6000 by rs6000_legitimize_reload_address. |
2064 | Note that (X) is evaluated twice; this is safe in current usage. */ | |
a260abc9 | 2065 | |
a9098fd0 GK |
2066 | #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN) \ |
2067 | do { \ | |
24ea750e DJ |
2068 | int win; \ |
2069 | (X) = rs6000_legitimize_reload_address ((X), (MODE), (OPNUM), \ | |
2070 | (int)(TYPE), (IND_LEVELS), &win); \ | |
2071 | if ( win ) \ | |
2072 | goto WIN; \ | |
a260abc9 DE |
2073 | } while (0) |
2074 | ||
f045b2c9 RS |
2075 | /* Go to LABEL if ADDR (a legitimate address expression) |
2076 | has an effect that depends on the machine mode it is used for. | |
2077 | ||
2078 | On the RS/6000 this is true if the address is valid with a zero offset | |
2079 | but not with an offset of four (this means it cannot be used as an | |
2080 | address for DImode or DFmode) or is a pre-increment or decrement. Since | |
2081 | we know it is valid, we just check for an address that is not valid with | |
2082 | an offset of four. */ | |
2083 | ||
2084 | #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ | |
2085 | { if (GET_CODE (ADDR) == PLUS \ | |
2086 | && LEGITIMATE_ADDRESS_INTEGER_P (XEXP (ADDR, 1), 0) \ | |
2f3e5814 DE |
2087 | && ! LEGITIMATE_ADDRESS_INTEGER_P (XEXP (ADDR, 1), \ |
2088 | (TARGET_32BIT ? 4 : 8))) \ | |
f045b2c9 | 2089 | goto LABEL; \ |
38c1f2d7 | 2090 | if (TARGET_UPDATE && GET_CODE (ADDR) == PRE_INC) \ |
f045b2c9 | 2091 | goto LABEL; \ |
38c1f2d7 | 2092 | if (TARGET_UPDATE && GET_CODE (ADDR) == PRE_DEC) \ |
f045b2c9 | 2093 | goto LABEL; \ |
4697a36c MM |
2094 | if (GET_CODE (ADDR) == LO_SUM) \ |
2095 | goto LABEL; \ | |
f045b2c9 | 2096 | } |
766a866c MM |
2097 | \f |
2098 | /* The register number of the register used to address a table of | |
2099 | static data addresses in memory. In some cases this register is | |
2100 | defined by a processor's "application binary interface" (ABI). | |
2101 | When this macro is defined, RTL is generated for this register | |
2102 | once, as with the stack pointer and frame pointer registers. If | |
2103 | this macro is not defined, it is up to the machine-dependent files | |
2104 | to allocate such a register (if necessary). */ | |
2105 | ||
8d30c4ee | 2106 | #define PIC_OFFSET_TABLE_REGNUM 30 |
766a866c | 2107 | |
9ebbca7d GK |
2108 | #define TOC_REGISTER (TARGET_MINIMAL_TOC ? 30 : 2) |
2109 | ||
766a866c MM |
2110 | /* Define this macro if the register defined by |
2111 | `PIC_OFFSET_TABLE_REGNUM' is clobbered by calls. Do not define | |
089a05b8 | 2112 | this macro if `PIC_OFFSET_TABLE_REGNUM' is not defined. */ |
766a866c MM |
2113 | |
2114 | /* #define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED */ | |
2115 | ||
2116 | /* By generating position-independent code, when two different | |
2117 | programs (A and B) share a common library (libC.a), the text of | |
2118 | the library can be shared whether or not the library is linked at | |
2119 | the same address for both programs. In some of these | |
2120 | environments, position-independent code requires not only the use | |
2121 | of different addressing modes, but also special code to enable the | |
2122 | use of these addressing modes. | |
2123 | ||
2124 | The `FINALIZE_PIC' macro serves as a hook to emit these special | |
2125 | codes once the function is being compiled into assembly code, but | |
2126 | not before. (It is not done before, because in the case of | |
2127 | compiling an inline function, it would lead to multiple PIC | |
2128 | prologues being included in functions which used inline functions | |
2129 | and were compiled to assembly language.) */ | |
2130 | ||
8d30c4ee | 2131 | /* #define FINALIZE_PIC */ |
766a866c | 2132 | |
766a866c MM |
2133 | /* A C expression that is nonzero if X is a legitimate immediate |
2134 | operand on the target machine when generating position independent | |
2135 | code. You can assume that X satisfies `CONSTANT_P', so you need | |
2136 | not check this. You can also assume FLAG_PIC is true, so you need | |
2137 | not check it either. You need not define this macro if all | |
2138 | constants (including `SYMBOL_REF') can be immediate operands when | |
2139 | generating position independent code. */ | |
2140 | ||
2141 | /* #define LEGITIMATE_PIC_OPERAND_P (X) */ | |
2142 | ||
30ea98f1 MM |
2143 | /* In rare cases, correct code generation requires extra machine |
2144 | dependent processing between the second jump optimization pass and | |
2145 | delayed branch scheduling. On those machines, define this macro | |
9ebbca7d | 2146 | as a C statement to act on the code starting at INSN. */ |
30ea98f1 | 2147 | |
9ebbca7d | 2148 | /* #define MACHINE_DEPENDENT_REORG(INSN) */ |
30ea98f1 | 2149 | |
f045b2c9 RS |
2150 | \f |
2151 | /* Define this if some processing needs to be done immediately before | |
4255474b | 2152 | emitting code for an insn. */ |
f045b2c9 | 2153 | |
4255474b | 2154 | /* #define FINAL_PRESCAN_INSN(INSN,OPERANDS,NOPERANDS) */ |
f045b2c9 RS |
2155 | |
2156 | /* Specify the machine mode that this machine uses | |
2157 | for the index in the tablejump instruction. */ | |
e1565e65 | 2158 | #define CASE_VECTOR_MODE SImode |
f045b2c9 | 2159 | |
18543a22 ILT |
2160 | /* Define as C expression which evaluates to nonzero if the tablejump |
2161 | instruction expects the table to contain offsets from the address of the | |
2162 | table. | |
82e41834 | 2163 | Do not define this if the table should contain absolute addresses. */ |
18543a22 | 2164 | #define CASE_VECTOR_PC_RELATIVE 1 |
f045b2c9 | 2165 | |
f045b2c9 RS |
2166 | /* Define this as 1 if `char' should by default be signed; else as 0. */ |
2167 | #define DEFAULT_SIGNED_CHAR 0 | |
2168 | ||
2169 | /* This flag, if defined, says the same insns that convert to a signed fixnum | |
2170 | also convert validly to an unsigned one. */ | |
2171 | ||
2172 | /* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC */ | |
2173 | ||
2174 | /* Max number of bytes we can move from memory to memory | |
2175 | in one reasonably fast instruction. */ | |
2f3e5814 | 2176 | #define MOVE_MAX (! TARGET_POWERPC64 ? 4 : 8) |
7e69e155 | 2177 | #define MAX_MOVE_MAX 8 |
f045b2c9 RS |
2178 | |
2179 | /* Nonzero if access to memory by bytes is no faster than for words. | |
2180 | Also non-zero if doing byte operations (specifically shifts) in registers | |
2181 | is undesirable. */ | |
2182 | #define SLOW_BYTE_ACCESS 1 | |
2183 | ||
9a63901f RK |
2184 | /* Define if operations between registers always perform the operation |
2185 | on the full register even if a narrower mode is specified. */ | |
2186 | #define WORD_REGISTER_OPERATIONS | |
2187 | ||
2188 | /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD | |
2189 | will either zero-extend or sign-extend. The value of this macro should | |
2190 | be the code that says which one of the two operations is implicitly | |
2191 | done, NIL if none. */ | |
2192 | #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND | |
225211e2 RK |
2193 | |
2194 | /* Define if loading short immediate values into registers sign extends. */ | |
2195 | #define SHORT_IMMEDIATES_SIGN_EXTEND | |
fdaff8ba | 2196 | \f |
f045b2c9 RS |
2197 | /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits |
2198 | is done just by pretending it is already truncated. */ | |
2199 | #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 | |
2200 | ||
2201 | /* Specify the machine mode that pointers have. | |
2202 | After generation of rtl, the compiler makes no further distinction | |
2203 | between pointers and any other objects of this machine mode. */ | |
2f3e5814 | 2204 | #define Pmode (TARGET_32BIT ? SImode : DImode) |
f045b2c9 RS |
2205 | |
2206 | /* Mode of a function address in a call instruction (for indexing purposes). | |
f045b2c9 | 2207 | Doesn't matter on RS/6000. */ |
2f3e5814 | 2208 | #define FUNCTION_MODE (TARGET_32BIT ? SImode : DImode) |
f045b2c9 RS |
2209 | |
2210 | /* Define this if addresses of constant functions | |
2211 | shouldn't be put through pseudo regs where they can be cse'd. | |
2212 | Desirable on machines where ordinary constants are expensive | |
2213 | but a CALL with constant address is cheap. */ | |
2214 | #define NO_FUNCTION_CSE | |
2215 | ||
d969caf8 | 2216 | /* Define this to be nonzero if shift instructions ignore all but the low-order |
6febd581 RK |
2217 | few bits. |
2218 | ||
2219 | The sle and sre instructions which allow SHIFT_COUNT_TRUNCATED | |
2220 | have been dropped from the PowerPC architecture. */ | |
2221 | ||
4697a36c | 2222 | #define SHIFT_COUNT_TRUNCATED (TARGET_POWER ? 1 : 0) |
f045b2c9 | 2223 | |
f045b2c9 RS |
2224 | /* Compute the cost of computing a constant rtl expression RTX |
2225 | whose rtx-code is CODE. The body of this macro is a portion | |
2226 | of a switch statement. If the code is computed here, | |
2227 | return it with a return statement. Otherwise, break from the switch. | |
2228 | ||
01554f00 | 2229 | On the RS/6000, if it is valid in the insn, it is free. So this |
f045b2c9 RS |
2230 | always returns 0. */ |
2231 | ||
4697a36c | 2232 | #define CONST_COSTS(RTX,CODE,OUTER_CODE) \ |
f045b2c9 RS |
2233 | case CONST_INT: \ |
2234 | case CONST: \ | |
2235 | case LABEL_REF: \ | |
2236 | case SYMBOL_REF: \ | |
2237 | case CONST_DOUBLE: \ | |
4697a36c | 2238 | case HIGH: \ |
f045b2c9 RS |
2239 | return 0; |
2240 | ||
2241 | /* Provide the costs of a rtl expression. This is in the body of a | |
2242 | switch on CODE. */ | |
2243 | ||
38c1f2d7 MM |
2244 | #define RTX_COSTS(X,CODE,OUTER_CODE) \ |
2245 | case PLUS: \ | |
2246 | return ((GET_CODE (XEXP (X, 1)) == CONST_INT \ | |
a260abc9 DE |
2247 | && ((unsigned HOST_WIDE_INT) (INTVAL (XEXP (X, 1)) \ |
2248 | + 0x8000) >= 0x10000) \ | |
296b8152 | 2249 | && ((INTVAL (XEXP (X, 1)) & 0xffff) != 0)) \ |
38c1f2d7 MM |
2250 | ? COSTS_N_INSNS (2) \ |
2251 | : COSTS_N_INSNS (1)); \ | |
2252 | case AND: \ | |
38c1f2d7 MM |
2253 | case IOR: \ |
2254 | case XOR: \ | |
a260abc9 DE |
2255 | return ((GET_CODE (XEXP (X, 1)) == CONST_INT \ |
2256 | && (INTVAL (XEXP (X, 1)) & (~ (HOST_WIDE_INT) 0xffff)) != 0 \ | |
296b8152 | 2257 | && ((INTVAL (XEXP (X, 1)) & 0xffff) != 0)) \ |
38c1f2d7 MM |
2258 | ? COSTS_N_INSNS (2) \ |
2259 | : COSTS_N_INSNS (1)); \ | |
2260 | case MULT: \ | |
2261 | switch (rs6000_cpu) \ | |
2262 | { \ | |
2263 | case PROCESSOR_RIOS1: \ | |
fe7f5677 | 2264 | case PROCESSOR_PPC405: \ |
38c1f2d7 MM |
2265 | return (GET_CODE (XEXP (X, 1)) != CONST_INT \ |
2266 | ? COSTS_N_INSNS (5) \ | |
2267 | : INTVAL (XEXP (X, 1)) >= -256 && INTVAL (XEXP (X, 1)) <= 255 \ | |
2268 | ? COSTS_N_INSNS (3) : COSTS_N_INSNS (4)); \ | |
3cb999d8 DE |
2269 | case PROCESSOR_RS64A: \ |
2270 | return (GET_CODE (XEXP (X, 1)) != CONST_INT \ | |
2271 | ? GET_MODE (XEXP (X, 1)) != DImode \ | |
2272 | ? COSTS_N_INSNS (20) : COSTS_N_INSNS (34) \ | |
2273 | : INTVAL (XEXP (X, 1)) >= -256 && INTVAL (XEXP (X, 1)) <= 255 \ | |
fe7f5677 | 2274 | ? COSTS_N_INSNS (8) : COSTS_N_INSNS (12)); \ |
38c1f2d7 MM |
2275 | case PROCESSOR_RIOS2: \ |
2276 | case PROCESSOR_MPCCORE: \ | |
5a41b476 | 2277 | case PROCESSOR_PPC604e: \ |
38c1f2d7 MM |
2278 | return COSTS_N_INSNS (2); \ |
2279 | case PROCESSOR_PPC601: \ | |
2280 | return COSTS_N_INSNS (5); \ | |
2281 | case PROCESSOR_PPC603: \ | |
7960cfbb | 2282 | case PROCESSOR_PPC7400: \ |
bef84347 | 2283 | case PROCESSOR_PPC750: \ |
38c1f2d7 MM |
2284 | return (GET_CODE (XEXP (X, 1)) != CONST_INT \ |
2285 | ? COSTS_N_INSNS (5) \ | |
2286 | : INTVAL (XEXP (X, 1)) >= -256 && INTVAL (XEXP (X, 1)) <= 255 \ | |
2287 | ? COSTS_N_INSNS (2) : COSTS_N_INSNS (3)); \ | |
fd3b43f2 DJ |
2288 | case PROCESSOR_PPC7450: \ |
2289 | return (GET_CODE (XEXP (X, 1)) != CONST_INT \ | |
2290 | ? COSTS_N_INSNS (4) \ | |
2291 | : COSTS_N_INSNS (3)); \ | |
38c1f2d7 MM |
2292 | case PROCESSOR_PPC403: \ |
2293 | case PROCESSOR_PPC604: \ | |
38c1f2d7 | 2294 | return COSTS_N_INSNS (4); \ |
3cb999d8 DE |
2295 | case PROCESSOR_PPC620: \ |
2296 | case PROCESSOR_PPC630: \ | |
2297 | return (GET_CODE (XEXP (X, 1)) != CONST_INT \ | |
2298 | ? GET_MODE (XEXP (X, 1)) != DImode \ | |
fe7f5677 | 2299 | ? COSTS_N_INSNS (5) : COSTS_N_INSNS (7) \ |
3cb999d8 DE |
2300 | : INTVAL (XEXP (X, 1)) >= -256 && INTVAL (XEXP (X, 1)) <= 255 \ |
2301 | ? COSTS_N_INSNS (3) : COSTS_N_INSNS (4)); \ | |
38c1f2d7 MM |
2302 | } \ |
2303 | case DIV: \ | |
2304 | case MOD: \ | |
2305 | if (GET_CODE (XEXP (X, 1)) == CONST_INT \ | |
2306 | && exact_log2 (INTVAL (XEXP (X, 1))) >= 0) \ | |
2307 | return COSTS_N_INSNS (2); \ | |
2308 | /* otherwise fall through to normal divide. */ \ | |
2309 | case UDIV: \ | |
2310 | case UMOD: \ | |
2311 | switch (rs6000_cpu) \ | |
2312 | { \ | |
2313 | case PROCESSOR_RIOS1: \ | |
2314 | return COSTS_N_INSNS (19); \ | |
2315 | case PROCESSOR_RIOS2: \ | |
2316 | return COSTS_N_INSNS (13); \ | |
3cb999d8 DE |
2317 | case PROCESSOR_RS64A: \ |
2318 | return (GET_MODE (XEXP (X, 1)) != DImode \ | |
2319 | ? COSTS_N_INSNS (65) \ | |
2320 | : COSTS_N_INSNS (67)); \ | |
38c1f2d7 MM |
2321 | case PROCESSOR_MPCCORE: \ |
2322 | return COSTS_N_INSNS (6); \ | |
2323 | case PROCESSOR_PPC403: \ | |
2324 | return COSTS_N_INSNS (33); \ | |
fe7f5677 DE |
2325 | case PROCESSOR_PPC405: \ |
2326 | return COSTS_N_INSNS (35); \ | |
38c1f2d7 MM |
2327 | case PROCESSOR_PPC601: \ |
2328 | return COSTS_N_INSNS (36); \ | |
2329 | case PROCESSOR_PPC603: \ | |
2330 | return COSTS_N_INSNS (37); \ | |
2331 | case PROCESSOR_PPC604: \ | |
5a41b476 | 2332 | case PROCESSOR_PPC604e: \ |
38c1f2d7 | 2333 | return COSTS_N_INSNS (20); \ |
3cb999d8 DE |
2334 | case PROCESSOR_PPC620: \ |
2335 | case PROCESSOR_PPC630: \ | |
2336 | return (GET_MODE (XEXP (X, 1)) != DImode \ | |
2337 | ? COSTS_N_INSNS (21) \ | |
2338 | : COSTS_N_INSNS (37)); \ | |
bef84347 | 2339 | case PROCESSOR_PPC750: \ |
ed947a96 | 2340 | case PROCESSOR_PPC7400: \ |
bef84347 | 2341 | return COSTS_N_INSNS (19); \ |
ed947a96 DJ |
2342 | case PROCESSOR_PPC7450: \ |
2343 | return COSTS_N_INSNS (23); \ | |
38c1f2d7 MM |
2344 | } \ |
2345 | case FFS: \ | |
2346 | return COSTS_N_INSNS (4); \ | |
2347 | case MEM: \ | |
f045b2c9 RS |
2348 | /* MEM should be slightly more expensive than (plus (reg) (const)) */ \ |
2349 | return 5; | |
2350 | ||
2351 | /* Compute the cost of an address. This is meant to approximate the size | |
2352 | and/or execution delay of an insn using that address. If the cost is | |
2353 | approximated by the RTL complexity, including CONST_COSTS above, as | |
2354 | is usually the case for CISC machines, this macro should not be defined. | |
2355 | For aggressively RISCy machines, only one insn format is allowed, so | |
2356 | this macro should be a constant. The value of this macro only matters | |
2357 | for valid addresses. | |
2358 | ||
2359 | For the RS/6000, everything is cost 0. */ | |
2360 | ||
2361 | #define ADDRESS_COST(RTX) 0 | |
2362 | ||
2363 | /* Adjust the length of an INSN. LENGTH is the currently-computed length and | |
2364 | should be adjusted to reflect any required changes. This macro is used when | |
2365 | there is some systematic length adjustment required that would be difficult | |
2366 | to express in the length attribute. */ | |
2367 | ||
2368 | /* #define ADJUST_INSN_LENGTH(X,LENGTH) */ | |
2369 | ||
2370 | /* Add any extra modes needed to represent the condition code. | |
2371 | ||
2372 | For the RS/6000, we need separate modes when unsigned (logical) comparisons | |
c5defebb RK |
2373 | are being done and we need a separate mode for floating-point. We also |
2374 | use a mode for the case when we are comparing the results of two | |
39a10a29 | 2375 | comparisons, as then only the EQ bit is valid in the register. */ |
f045b2c9 | 2376 | |
aa0b4465 ZW |
2377 | #define EXTRA_CC_MODES \ |
2378 | CC(CCUNSmode, "CCUNS") \ | |
2379 | CC(CCFPmode, "CCFP") \ | |
2380 | CC(CCEQmode, "CCEQ") | |
f045b2c9 | 2381 | |
39a10a29 GK |
2382 | /* Given a comparison code (EQ, NE, etc.) and the first operand of a |
2383 | COMPARE, return the mode to be used for the comparison. For | |
2384 | floating-point, CCFPmode should be used. CCUNSmode should be used | |
2385 | for unsigned comparisons. CCEQmode should be used when we are | |
2386 | doing an inequality comparison on the result of a | |
2387 | comparison. CCmode should be used in all other cases. */ | |
c5defebb | 2388 | |
b565a316 | 2389 | #define SELECT_CC_MODE(OP,X,Y) \ |
f045b2c9 | 2390 | (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? CCFPmode \ |
c5defebb RK |
2391 | : (OP) == GTU || (OP) == LTU || (OP) == GEU || (OP) == LEU ? CCUNSmode \ |
2392 | : (((OP) == EQ || (OP) == NE) && GET_RTX_CLASS (GET_CODE (X)) == '<' \ | |
2393 | ? CCEQmode : CCmode)) | |
f045b2c9 RS |
2394 | |
2395 | /* Define the information needed to generate branch and scc insns. This is | |
2396 | stored from the compare operation. Note that we can't use "rtx" here | |
2397 | since it hasn't been defined! */ | |
2398 | ||
2399 | extern struct rtx_def *rs6000_compare_op0, *rs6000_compare_op1; | |
2400 | extern int rs6000_compare_fp_p; | |
f045b2c9 RS |
2401 | \f |
2402 | /* Control the assembler format that we output. */ | |
2403 | ||
1b279f39 DE |
2404 | /* A C string constant describing how to begin a comment in the target |
2405 | assembler language. The compiler assumes that the comment will end at | |
2406 | the end of the line. */ | |
2407 | #define ASM_COMMENT_START " #" | |
6b67933e | 2408 | |
fdaff8ba RS |
2409 | /* Implicit library calls should use memcpy, not bcopy, etc. */ |
2410 | ||
2411 | #define TARGET_MEM_FUNCTIONS | |
2412 | ||
38c1f2d7 MM |
2413 | /* Flag to say the TOC is initialized */ |
2414 | extern int toc_initialized; | |
2415 | ||
f045b2c9 RS |
2416 | /* Macro to output a special constant pool entry. Go to WIN if we output |
2417 | it. Otherwise, it is written the usual way. | |
2418 | ||
2419 | On the RS/6000, toc entries are handled this way. */ | |
2420 | ||
a9098fd0 GK |
2421 | #define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, X, MODE, ALIGN, LABELNO, WIN) \ |
2422 | { if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X, MODE)) \ | |
2423 | { \ | |
2424 | output_toc (FILE, X, LABELNO, MODE); \ | |
2425 | goto WIN; \ | |
2426 | } \ | |
f045b2c9 RS |
2427 | } |
2428 | ||
ebd97b96 DE |
2429 | #ifdef HAVE_GAS_WEAK |
2430 | #define RS6000_WEAK 1 | |
2431 | #else | |
2432 | #define RS6000_WEAK 0 | |
2433 | #endif | |
290ad355 | 2434 | |
ebd97b96 | 2435 | /* This implementes the `alias' attribute. */ |
9ebbca7d GK |
2436 | #define ASM_OUTPUT_DEF_FROM_DECLS(FILE,decl,target) \ |
2437 | do { \ | |
53cd5d6c | 2438 | const char * alias = XSTR (XEXP (DECL_RTL (decl), 0), 0); \ |
9ebbca7d GK |
2439 | char * name = IDENTIFIER_POINTER (target); \ |
2440 | if (TREE_CODE (decl) == FUNCTION_DECL \ | |
2441 | && DEFAULT_ABI == ABI_AIX) \ | |
2442 | { \ | |
2443 | if (TREE_PUBLIC (decl)) \ | |
2444 | { \ | |
ebd97b96 DE |
2445 | if (RS6000_WEAK && DECL_WEAK (decl)) \ |
2446 | { \ | |
2447 | fputs ("\t.weak .", FILE); \ | |
2448 | assemble_name (FILE, alias); \ | |
2449 | putc ('\n', FILE); \ | |
2450 | } \ | |
2451 | else \ | |
2452 | { \ | |
2453 | fputs ("\t.globl .", FILE); \ | |
2454 | assemble_name (FILE, alias); \ | |
2455 | putc ('\n', FILE); \ | |
2456 | } \ | |
9ebbca7d GK |
2457 | } \ |
2458 | else \ | |
2459 | { \ | |
2460 | fputs ("\t.lglobl .", FILE); \ | |
2461 | assemble_name (FILE, alias); \ | |
2462 | putc ('\n', FILE); \ | |
2463 | } \ | |
2464 | fputs ("\t.set .", FILE); \ | |
2465 | assemble_name (FILE, alias); \ | |
2466 | fputs (",.", FILE); \ | |
2467 | assemble_name (FILE, name); \ | |
2468 | fputc ('\n', FILE); \ | |
2469 | } \ | |
2470 | ASM_OUTPUT_DEF (FILE, alias, name); \ | |
290ad355 RH |
2471 | } while (0) |
2472 | ||
f045b2c9 RS |
2473 | /* Output to assembler file text saying following lines |
2474 | may contain character constants, extra white space, comments, etc. */ | |
2475 | ||
2476 | #define ASM_APP_ON "" | |
2477 | ||
2478 | /* Output to assembler file text saying following lines | |
2479 | no longer contain unusual constructs. */ | |
2480 | ||
2481 | #define ASM_APP_OFF "" | |
2482 | ||
f045b2c9 RS |
2483 | /* How to refer to registers in assembler output. |
2484 | This sequence is indexed by compiler's hard-register-number (see above). */ | |
2485 | ||
82e41834 | 2486 | extern char rs6000_reg_names[][8]; /* register names (0 vs. %r0). */ |
c81bebd7 MM |
2487 | |
2488 | #define REGISTER_NAMES \ | |
2489 | { \ | |
2490 | &rs6000_reg_names[ 0][0], /* r0 */ \ | |
2491 | &rs6000_reg_names[ 1][0], /* r1 */ \ | |
2492 | &rs6000_reg_names[ 2][0], /* r2 */ \ | |
2493 | &rs6000_reg_names[ 3][0], /* r3 */ \ | |
2494 | &rs6000_reg_names[ 4][0], /* r4 */ \ | |
2495 | &rs6000_reg_names[ 5][0], /* r5 */ \ | |
2496 | &rs6000_reg_names[ 6][0], /* r6 */ \ | |
2497 | &rs6000_reg_names[ 7][0], /* r7 */ \ | |
2498 | &rs6000_reg_names[ 8][0], /* r8 */ \ | |
2499 | &rs6000_reg_names[ 9][0], /* r9 */ \ | |
2500 | &rs6000_reg_names[10][0], /* r10 */ \ | |
2501 | &rs6000_reg_names[11][0], /* r11 */ \ | |
2502 | &rs6000_reg_names[12][0], /* r12 */ \ | |
2503 | &rs6000_reg_names[13][0], /* r13 */ \ | |
2504 | &rs6000_reg_names[14][0], /* r14 */ \ | |
2505 | &rs6000_reg_names[15][0], /* r15 */ \ | |
2506 | &rs6000_reg_names[16][0], /* r16 */ \ | |
2507 | &rs6000_reg_names[17][0], /* r17 */ \ | |
2508 | &rs6000_reg_names[18][0], /* r18 */ \ | |
2509 | &rs6000_reg_names[19][0], /* r19 */ \ | |
2510 | &rs6000_reg_names[20][0], /* r20 */ \ | |
2511 | &rs6000_reg_names[21][0], /* r21 */ \ | |
2512 | &rs6000_reg_names[22][0], /* r22 */ \ | |
2513 | &rs6000_reg_names[23][0], /* r23 */ \ | |
2514 | &rs6000_reg_names[24][0], /* r24 */ \ | |
2515 | &rs6000_reg_names[25][0], /* r25 */ \ | |
2516 | &rs6000_reg_names[26][0], /* r26 */ \ | |
2517 | &rs6000_reg_names[27][0], /* r27 */ \ | |
2518 | &rs6000_reg_names[28][0], /* r28 */ \ | |
2519 | &rs6000_reg_names[29][0], /* r29 */ \ | |
2520 | &rs6000_reg_names[30][0], /* r30 */ \ | |
2521 | &rs6000_reg_names[31][0], /* r31 */ \ | |
2522 | \ | |
2523 | &rs6000_reg_names[32][0], /* fr0 */ \ | |
2524 | &rs6000_reg_names[33][0], /* fr1 */ \ | |
2525 | &rs6000_reg_names[34][0], /* fr2 */ \ | |
2526 | &rs6000_reg_names[35][0], /* fr3 */ \ | |
2527 | &rs6000_reg_names[36][0], /* fr4 */ \ | |
2528 | &rs6000_reg_names[37][0], /* fr5 */ \ | |
2529 | &rs6000_reg_names[38][0], /* fr6 */ \ | |
2530 | &rs6000_reg_names[39][0], /* fr7 */ \ | |
2531 | &rs6000_reg_names[40][0], /* fr8 */ \ | |
2532 | &rs6000_reg_names[41][0], /* fr9 */ \ | |
2533 | &rs6000_reg_names[42][0], /* fr10 */ \ | |
2534 | &rs6000_reg_names[43][0], /* fr11 */ \ | |
2535 | &rs6000_reg_names[44][0], /* fr12 */ \ | |
2536 | &rs6000_reg_names[45][0], /* fr13 */ \ | |
2537 | &rs6000_reg_names[46][0], /* fr14 */ \ | |
2538 | &rs6000_reg_names[47][0], /* fr15 */ \ | |
2539 | &rs6000_reg_names[48][0], /* fr16 */ \ | |
2540 | &rs6000_reg_names[49][0], /* fr17 */ \ | |
2541 | &rs6000_reg_names[50][0], /* fr18 */ \ | |
2542 | &rs6000_reg_names[51][0], /* fr19 */ \ | |
2543 | &rs6000_reg_names[52][0], /* fr20 */ \ | |
2544 | &rs6000_reg_names[53][0], /* fr21 */ \ | |
2545 | &rs6000_reg_names[54][0], /* fr22 */ \ | |
2546 | &rs6000_reg_names[55][0], /* fr23 */ \ | |
2547 | &rs6000_reg_names[56][0], /* fr24 */ \ | |
2548 | &rs6000_reg_names[57][0], /* fr25 */ \ | |
2549 | &rs6000_reg_names[58][0], /* fr26 */ \ | |
2550 | &rs6000_reg_names[59][0], /* fr27 */ \ | |
2551 | &rs6000_reg_names[60][0], /* fr28 */ \ | |
2552 | &rs6000_reg_names[61][0], /* fr29 */ \ | |
2553 | &rs6000_reg_names[62][0], /* fr30 */ \ | |
2554 | &rs6000_reg_names[63][0], /* fr31 */ \ | |
2555 | \ | |
2556 | &rs6000_reg_names[64][0], /* mq */ \ | |
2557 | &rs6000_reg_names[65][0], /* lr */ \ | |
2558 | &rs6000_reg_names[66][0], /* ctr */ \ | |
2559 | &rs6000_reg_names[67][0], /* ap */ \ | |
2560 | \ | |
2561 | &rs6000_reg_names[68][0], /* cr0 */ \ | |
2562 | &rs6000_reg_names[69][0], /* cr1 */ \ | |
2563 | &rs6000_reg_names[70][0], /* cr2 */ \ | |
2564 | &rs6000_reg_names[71][0], /* cr3 */ \ | |
2565 | &rs6000_reg_names[72][0], /* cr4 */ \ | |
2566 | &rs6000_reg_names[73][0], /* cr5 */ \ | |
2567 | &rs6000_reg_names[74][0], /* cr6 */ \ | |
2568 | &rs6000_reg_names[75][0], /* cr7 */ \ | |
802a0058 | 2569 | \ |
9ebbca7d | 2570 | &rs6000_reg_names[76][0], /* xer */ \ |
0ac081f6 AH |
2571 | \ |
2572 | &rs6000_reg_names[77][0], /* v0 */ \ | |
2573 | &rs6000_reg_names[78][0], /* v1 */ \ | |
2574 | &rs6000_reg_names[79][0], /* v2 */ \ | |
2575 | &rs6000_reg_names[80][0], /* v3 */ \ | |
2576 | &rs6000_reg_names[81][0], /* v4 */ \ | |
2577 | &rs6000_reg_names[82][0], /* v5 */ \ | |
2578 | &rs6000_reg_names[83][0], /* v6 */ \ | |
2579 | &rs6000_reg_names[84][0], /* v7 */ \ | |
2580 | &rs6000_reg_names[85][0], /* v8 */ \ | |
2581 | &rs6000_reg_names[86][0], /* v9 */ \ | |
2582 | &rs6000_reg_names[87][0], /* v10 */ \ | |
2583 | &rs6000_reg_names[88][0], /* v11 */ \ | |
2584 | &rs6000_reg_names[89][0], /* v12 */ \ | |
2585 | &rs6000_reg_names[90][0], /* v13 */ \ | |
2586 | &rs6000_reg_names[91][0], /* v14 */ \ | |
2587 | &rs6000_reg_names[92][0], /* v15 */ \ | |
2588 | &rs6000_reg_names[93][0], /* v16 */ \ | |
2589 | &rs6000_reg_names[94][0], /* v17 */ \ | |
2590 | &rs6000_reg_names[95][0], /* v18 */ \ | |
2591 | &rs6000_reg_names[96][0], /* v19 */ \ | |
2592 | &rs6000_reg_names[97][0], /* v20 */ \ | |
2593 | &rs6000_reg_names[98][0], /* v21 */ \ | |
2594 | &rs6000_reg_names[99][0], /* v22 */ \ | |
2595 | &rs6000_reg_names[100][0], /* v23 */ \ | |
2596 | &rs6000_reg_names[101][0], /* v24 */ \ | |
2597 | &rs6000_reg_names[102][0], /* v25 */ \ | |
2598 | &rs6000_reg_names[103][0], /* v26 */ \ | |
2599 | &rs6000_reg_names[104][0], /* v27 */ \ | |
2600 | &rs6000_reg_names[105][0], /* v28 */ \ | |
2601 | &rs6000_reg_names[106][0], /* v29 */ \ | |
2602 | &rs6000_reg_names[107][0], /* v30 */ \ | |
2603 | &rs6000_reg_names[108][0], /* v31 */ \ | |
2604 | &rs6000_reg_names[109][0], /* vrsave */ \ | |
c81bebd7 MM |
2605 | } |
2606 | ||
2607 | /* print-rtl can't handle the above REGISTER_NAMES, so define the | |
2608 | following for it. Switch to use the alternate names since | |
2609 | they are more mnemonic. */ | |
2610 | ||
2611 | #define DEBUG_REGISTER_NAMES \ | |
2612 | { \ | |
802a0058 MM |
2613 | "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ |
2614 | "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \ | |
2615 | "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \ | |
2616 | "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", \ | |
2617 | "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ | |
2618 | "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ | |
2619 | "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ | |
2620 | "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ | |
2621 | "mq", "lr", "ctr", "ap", \ | |
2622 | "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", \ | |
0ac081f6 AH |
2623 | "xer", \ |
2624 | "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", \ | |
2625 | "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15", \ | |
2626 | "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", \ | |
2627 | "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", \ | |
2628 | "vrsave" \ | |
c81bebd7 | 2629 | } |
f045b2c9 RS |
2630 | |
2631 | /* Table of additional register names to use in user input. */ | |
2632 | ||
2633 | #define ADDITIONAL_REGISTER_NAMES \ | |
c4d38ccb MM |
2634 | {{"r0", 0}, {"r1", 1}, {"r2", 2}, {"r3", 3}, \ |
2635 | {"r4", 4}, {"r5", 5}, {"r6", 6}, {"r7", 7}, \ | |
2636 | {"r8", 8}, {"r9", 9}, {"r10", 10}, {"r11", 11}, \ | |
2637 | {"r12", 12}, {"r13", 13}, {"r14", 14}, {"r15", 15}, \ | |
2638 | {"r16", 16}, {"r17", 17}, {"r18", 18}, {"r19", 19}, \ | |
2639 | {"r20", 20}, {"r21", 21}, {"r22", 22}, {"r23", 23}, \ | |
2640 | {"r24", 24}, {"r25", 25}, {"r26", 26}, {"r27", 27}, \ | |
2641 | {"r28", 28}, {"r29", 29}, {"r30", 30}, {"r31", 31}, \ | |
2642 | {"fr0", 32}, {"fr1", 33}, {"fr2", 34}, {"fr3", 35}, \ | |
2643 | {"fr4", 36}, {"fr5", 37}, {"fr6", 38}, {"fr7", 39}, \ | |
2644 | {"fr8", 40}, {"fr9", 41}, {"fr10", 42}, {"fr11", 43}, \ | |
2645 | {"fr12", 44}, {"fr13", 45}, {"fr14", 46}, {"fr15", 47}, \ | |
2646 | {"fr16", 48}, {"fr17", 49}, {"fr18", 50}, {"fr19", 51}, \ | |
2647 | {"fr20", 52}, {"fr21", 53}, {"fr22", 54}, {"fr23", 55}, \ | |
2648 | {"fr24", 56}, {"fr25", 57}, {"fr26", 58}, {"fr27", 59}, \ | |
2649 | {"fr28", 60}, {"fr29", 61}, {"fr30", 62}, {"fr31", 63}, \ | |
0ac081f6 AH |
2650 | {"v0", 77}, {"v1", 78}, {"v2", 79}, {"v3", 80}, \ |
2651 | {"v4", 81}, {"v5", 82}, {"v6", 83}, {"v7", 84}, \ | |
2652 | {"v8", 85}, {"v9", 86}, {"v10", 87}, {"v11", 88}, \ | |
2653 | {"v12", 89}, {"v13", 90}, {"v14", 91}, {"v15", 92}, \ | |
2654 | {"v16", 93}, {"v17", 94}, {"v18", 95}, {"v19", 96}, \ | |
2655 | {"v20", 97}, {"v21", 98}, {"v22", 99}, {"v23", 100}, \ | |
2656 | {"v24", 101},{"v25", 102},{"v26", 103},{"v27", 104}, \ | |
2657 | {"v28", 105},{"v29", 106},{"v30", 107},{"v31", 108}, \ | |
2658 | {"vrsave", 109}, \ | |
c4d38ccb MM |
2659 | /* no additional names for: mq, lr, ctr, ap */ \ |
2660 | {"cr0", 68}, {"cr1", 69}, {"cr2", 70}, {"cr3", 71}, \ | |
2661 | {"cr4", 72}, {"cr5", 73}, {"cr6", 74}, {"cr7", 75}, \ | |
2662 | {"cc", 68}, {"sp", 1}, {"toc", 2} } | |
f045b2c9 | 2663 | |
0da40b09 RK |
2664 | /* Text to write out after a CALL that may be replaced by glue code by |
2665 | the loader. This depends on the AIX version. */ | |
2666 | #define RS6000_CALL_GLUE "cror 31,31,31" | |
11117bb9 | 2667 | |
f045b2c9 RS |
2668 | /* This is how to output an element of a case-vector that is relative. */ |
2669 | ||
e1565e65 | 2670 | #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ |
3daf36a4 | 2671 | do { char buf[100]; \ |
e1565e65 | 2672 | fputs ("\t.long ", FILE); \ |
3daf36a4 ILT |
2673 | ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \ |
2674 | assemble_name (FILE, buf); \ | |
19d2d16f | 2675 | putc ('-', FILE); \ |
3daf36a4 ILT |
2676 | ASM_GENERATE_INTERNAL_LABEL (buf, "L", REL); \ |
2677 | assemble_name (FILE, buf); \ | |
19d2d16f | 2678 | putc ('\n', FILE); \ |
3daf36a4 | 2679 | } while (0) |
f045b2c9 RS |
2680 | |
2681 | /* This is how to output an assembler line | |
2682 | that says to advance the location counter | |
2683 | to a multiple of 2**LOG bytes. */ | |
2684 | ||
2685 | #define ASM_OUTPUT_ALIGN(FILE,LOG) \ | |
2686 | if ((LOG) != 0) \ | |
2687 | fprintf (FILE, "\t.align %d\n", (LOG)) | |
2688 | ||
f045b2c9 RS |
2689 | /* Store in OUTPUT a string (made with alloca) containing |
2690 | an assembler-name for a local static variable named NAME. | |
2691 | LABELNO is an integer which is different for each call. */ | |
2692 | ||
2693 | #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ | |
2694 | ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \ | |
2695 | sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO))) | |
2696 | ||
9ebbca7d GK |
2697 | /* Pick up the return address upon entry to a procedure. Used for |
2698 | dwarf2 unwind information. This also enables the table driven | |
2699 | mechanism. */ | |
2700 | ||
2701 | #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM) | |
8034da37 | 2702 | #define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (LINK_REGISTER_REGNUM) |
9ebbca7d | 2703 | |
83720594 RH |
2704 | /* Describe how we implement __builtin_eh_return. */ |
2705 | #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 3 : INVALID_REGNUM) | |
2706 | #define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 10) | |
2707 | ||
f045b2c9 RS |
2708 | /* Print operand X (an rtx) in assembler syntax to file FILE. |
2709 | CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified. | |
2710 | For `%' followed by punctuation, CODE is the punctuation and X is null. */ | |
2711 | ||
2712 | #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE) | |
2713 | ||
2714 | /* Define which CODE values are valid. */ | |
2715 | ||
c81bebd7 | 2716 | #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \ |
6fa3f289 | 2717 | ((CODE) == '.') |
f045b2c9 RS |
2718 | |
2719 | /* Print a memory address as an operand to reference that memory location. */ | |
2720 | ||
2721 | #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR) | |
2722 | ||
2723 | /* Define the codes that are matched by predicates in rs6000.c. */ | |
2724 | ||
39a10a29 GK |
2725 | #define PREDICATE_CODES \ |
2726 | {"short_cint_operand", {CONST_INT}}, \ | |
2727 | {"u_short_cint_operand", {CONST_INT}}, \ | |
2728 | {"non_short_cint_operand", {CONST_INT}}, \ | |
2bfcf297 | 2729 | {"exact_log2_cint_operand", {CONST_INT}}, \ |
39a10a29 GK |
2730 | {"gpc_reg_operand", {SUBREG, REG}}, \ |
2731 | {"cc_reg_operand", {SUBREG, REG}}, \ | |
2732 | {"cc_reg_not_cr0_operand", {SUBREG, REG}}, \ | |
2733 | {"reg_or_short_operand", {SUBREG, REG, CONST_INT}}, \ | |
2734 | {"reg_or_neg_short_operand", {SUBREG, REG, CONST_INT}}, \ | |
2735 | {"reg_or_u_short_operand", {SUBREG, REG, CONST_INT}}, \ | |
2736 | {"reg_or_cint_operand", {SUBREG, REG, CONST_INT}}, \ | |
2737 | {"reg_or_arith_cint_operand", {SUBREG, REG, CONST_INT}}, \ | |
2bfcf297 DB |
2738 | {"reg_or_add_cint64_operand", {SUBREG, REG, CONST_INT}}, \ |
2739 | {"reg_or_sub_cint64_operand", {SUBREG, REG, CONST_INT}}, \ | |
1d328b19 | 2740 | {"reg_or_logical_cint_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ |
39a10a29 GK |
2741 | {"got_operand", {SYMBOL_REF, CONST, LABEL_REF}}, \ |
2742 | {"got_no_const_operand", {SYMBOL_REF, LABEL_REF}}, \ | |
2743 | {"easy_fp_constant", {CONST_DOUBLE}}, \ | |
50a0b056 | 2744 | {"zero_fp_constant", {CONST_DOUBLE}}, \ |
39a10a29 GK |
2745 | {"reg_or_mem_operand", {SUBREG, MEM, REG}}, \ |
2746 | {"lwa_operand", {SUBREG, MEM, REG}}, \ | |
2747 | {"volatile_mem_operand", {MEM}}, \ | |
2748 | {"offsettable_mem_operand", {MEM}}, \ | |
2749 | {"mem_or_easy_const_operand", {SUBREG, MEM, CONST_DOUBLE}}, \ | |
2750 | {"add_operand", {SUBREG, REG, CONST_INT}}, \ | |
2751 | {"non_add_cint_operand", {CONST_INT}}, \ | |
2752 | {"and_operand", {SUBREG, REG, CONST_INT}}, \ | |
2753 | {"and64_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ | |
2754 | {"logical_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ | |
2755 | {"non_logical_cint_operand", {CONST_INT, CONST_DOUBLE}}, \ | |
2756 | {"mask_operand", {CONST_INT}}, \ | |
2757 | {"mask64_operand", {CONST_INT, CONST_DOUBLE}}, \ | |
39a10a29 GK |
2758 | {"count_register_operand", {REG}}, \ |
2759 | {"xer_operand", {REG}}, \ | |
2760 | {"call_operand", {SYMBOL_REF, REG}}, \ | |
2761 | {"current_file_function_operand", {SYMBOL_REF}}, \ | |
2762 | {"input_operand", {SUBREG, MEM, REG, CONST_INT, \ | |
2763 | CONST_DOUBLE, SYMBOL_REF}}, \ | |
2764 | {"load_multiple_operation", {PARALLEL}}, \ | |
2765 | {"store_multiple_operation", {PARALLEL}}, \ | |
00b960c7 | 2766 | {"vrsave_operation", {PARALLEL}}, \ |
39a10a29 GK |
2767 | {"branch_comparison_operator", {EQ, NE, LE, LT, GE, \ |
2768 | GT, LEU, LTU, GEU, GTU, \ | |
2769 | UNORDERED, ORDERED, \ | |
2770 | UNGE, UNLE }}, \ | |
2771 | {"branch_positive_comparison_operator", {EQ, LT, GT, LTU, GTU, \ | |
2772 | UNORDERED }}, \ | |
2773 | {"scc_comparison_operator", {EQ, NE, LE, LT, GE, \ | |
2774 | GT, LEU, LTU, GEU, GTU, \ | |
2775 | UNORDERED, ORDERED, \ | |
2776 | UNGE, UNLE }}, \ | |
2777 | {"trap_comparison_operator", {EQ, NE, LE, LT, GE, \ | |
2778 | GT, LEU, LTU, GEU, GTU}}, \ | |
2779 | {"boolean_operator", {AND, IOR, XOR}}, \ | |
50a0b056 GK |
2780 | {"boolean_or_operator", {IOR, XOR}}, \ |
2781 | {"min_max_operator", {SMIN, SMAX, UMIN, UMAX}}, | |
75814ad4 | 2782 | |
b6c9286a MM |
2783 | /* uncomment for disabling the corresponding default options */ |
2784 | /* #define MACHINE_no_sched_interblock */ | |
2785 | /* #define MACHINE_no_sched_speculative */ | |
2786 | /* #define MACHINE_no_sched_speculative_load */ | |
2787 | ||
766a866c MM |
2788 | /* General flags. */ |
2789 | extern int flag_pic; | |
354b734b MM |
2790 | extern int optimize; |
2791 | extern int flag_expensive_optimizations; | |
a7df97e6 | 2792 | extern int frame_pointer_needed; |
0ac081f6 AH |
2793 | |
2794 | enum rs6000_builtins | |
2795 | { | |
2796 | /* AltiVec builtins. */ | |
f18c054f DB |
2797 | ALTIVEC_BUILTIN_ST_INTERNAL_4si, |
2798 | ALTIVEC_BUILTIN_LD_INTERNAL_4si, | |
2799 | ALTIVEC_BUILTIN_ST_INTERNAL_8hi, | |
2800 | ALTIVEC_BUILTIN_LD_INTERNAL_8hi, | |
2801 | ALTIVEC_BUILTIN_ST_INTERNAL_16qi, | |
2802 | ALTIVEC_BUILTIN_LD_INTERNAL_16qi, | |
2803 | ALTIVEC_BUILTIN_ST_INTERNAL_4sf, | |
2804 | ALTIVEC_BUILTIN_LD_INTERNAL_4sf, | |
0ac081f6 AH |
2805 | ALTIVEC_BUILTIN_VADDUBM, |
2806 | ALTIVEC_BUILTIN_VADDUHM, | |
2807 | ALTIVEC_BUILTIN_VADDUWM, | |
2808 | ALTIVEC_BUILTIN_VADDFP, | |
2809 | ALTIVEC_BUILTIN_VADDCUW, | |
2810 | ALTIVEC_BUILTIN_VADDUBS, | |
2811 | ALTIVEC_BUILTIN_VADDSBS, | |
2812 | ALTIVEC_BUILTIN_VADDUHS, | |
2813 | ALTIVEC_BUILTIN_VADDSHS, | |
2814 | ALTIVEC_BUILTIN_VADDUWS, | |
2815 | ALTIVEC_BUILTIN_VADDSWS, | |
2816 | ALTIVEC_BUILTIN_VAND, | |
2817 | ALTIVEC_BUILTIN_VANDC, | |
2818 | ALTIVEC_BUILTIN_VAVGUB, | |
2819 | ALTIVEC_BUILTIN_VAVGSB, | |
2820 | ALTIVEC_BUILTIN_VAVGUH, | |
2821 | ALTIVEC_BUILTIN_VAVGSH, | |
2822 | ALTIVEC_BUILTIN_VAVGUW, | |
2823 | ALTIVEC_BUILTIN_VAVGSW, | |
617e0e1d DB |
2824 | ALTIVEC_BUILTIN_VCFUX, |
2825 | ALTIVEC_BUILTIN_VCFSX, | |
2826 | ALTIVEC_BUILTIN_VCTSXS, | |
2827 | ALTIVEC_BUILTIN_VCTUXS, | |
0ac081f6 AH |
2828 | ALTIVEC_BUILTIN_VCMPBFP, |
2829 | ALTIVEC_BUILTIN_VCMPEQUB, | |
2830 | ALTIVEC_BUILTIN_VCMPEQUH, | |
2831 | ALTIVEC_BUILTIN_VCMPEQUW, | |
2832 | ALTIVEC_BUILTIN_VCMPEQFP, | |
2833 | ALTIVEC_BUILTIN_VCMPGEFP, | |
2834 | ALTIVEC_BUILTIN_VCMPGTUB, | |
2835 | ALTIVEC_BUILTIN_VCMPGTSB, | |
2836 | ALTIVEC_BUILTIN_VCMPGTUH, | |
2837 | ALTIVEC_BUILTIN_VCMPGTSH, | |
2838 | ALTIVEC_BUILTIN_VCMPGTUW, | |
2839 | ALTIVEC_BUILTIN_VCMPGTSW, | |
2840 | ALTIVEC_BUILTIN_VCMPGTFP, | |
617e0e1d DB |
2841 | ALTIVEC_BUILTIN_VEXPTEFP, |
2842 | ALTIVEC_BUILTIN_VLOGEFP, | |
2212663f | 2843 | ALTIVEC_BUILTIN_VMADDFP, |
0ac081f6 AH |
2844 | ALTIVEC_BUILTIN_VMAXUB, |
2845 | ALTIVEC_BUILTIN_VMAXSB, | |
2846 | ALTIVEC_BUILTIN_VMAXUH, | |
2847 | ALTIVEC_BUILTIN_VMAXSH, | |
2848 | ALTIVEC_BUILTIN_VMAXUW, | |
2849 | ALTIVEC_BUILTIN_VMAXSW, | |
2850 | ALTIVEC_BUILTIN_VMAXFP, | |
2212663f DB |
2851 | ALTIVEC_BUILTIN_VMHADDSHS, |
2852 | ALTIVEC_BUILTIN_VMHRADDSHS, | |
2853 | ALTIVEC_BUILTIN_VMLADDUHM, | |
0ac081f6 AH |
2854 | ALTIVEC_BUILTIN_VMRGHB, |
2855 | ALTIVEC_BUILTIN_VMRGHH, | |
2856 | ALTIVEC_BUILTIN_VMRGHW, | |
2857 | ALTIVEC_BUILTIN_VMRGLB, | |
2858 | ALTIVEC_BUILTIN_VMRGLH, | |
2859 | ALTIVEC_BUILTIN_VMRGLW, | |
2212663f DB |
2860 | ALTIVEC_BUILTIN_VMSUMUBM, |
2861 | ALTIVEC_BUILTIN_VMSUMMBM, | |
2862 | ALTIVEC_BUILTIN_VMSUMUHM, | |
2863 | ALTIVEC_BUILTIN_VMSUMSHM, | |
2864 | ALTIVEC_BUILTIN_VMSUMUHS, | |
2865 | ALTIVEC_BUILTIN_VMSUMSHS, | |
0ac081f6 AH |
2866 | ALTIVEC_BUILTIN_VMINUB, |
2867 | ALTIVEC_BUILTIN_VMINSB, | |
2868 | ALTIVEC_BUILTIN_VMINUH, | |
2869 | ALTIVEC_BUILTIN_VMINSH, | |
2870 | ALTIVEC_BUILTIN_VMINUW, | |
2871 | ALTIVEC_BUILTIN_VMINSW, | |
2872 | ALTIVEC_BUILTIN_VMINFP, | |
2873 | ALTIVEC_BUILTIN_VMULEUB, | |
2874 | ALTIVEC_BUILTIN_VMULESB, | |
2875 | ALTIVEC_BUILTIN_VMULEUH, | |
2876 | ALTIVEC_BUILTIN_VMULESH, | |
2877 | ALTIVEC_BUILTIN_VMULOUB, | |
2878 | ALTIVEC_BUILTIN_VMULOSB, | |
2879 | ALTIVEC_BUILTIN_VMULOUH, | |
2880 | ALTIVEC_BUILTIN_VMULOSH, | |
2212663f | 2881 | ALTIVEC_BUILTIN_VNMSUBFP, |
0ac081f6 AH |
2882 | ALTIVEC_BUILTIN_VNOR, |
2883 | ALTIVEC_BUILTIN_VOR, | |
617e0e1d DB |
2884 | ALTIVEC_BUILTIN_VSEL_4SI, |
2885 | ALTIVEC_BUILTIN_VSEL_4SF, | |
2886 | ALTIVEC_BUILTIN_VSEL_8HI, | |
2887 | ALTIVEC_BUILTIN_VSEL_16QI, | |
2212663f DB |
2888 | ALTIVEC_BUILTIN_VPERM_4SI, |
2889 | ALTIVEC_BUILTIN_VPERM_4SF, | |
2890 | ALTIVEC_BUILTIN_VPERM_8HI, | |
2891 | ALTIVEC_BUILTIN_VPERM_16QI, | |
0ac081f6 AH |
2892 | ALTIVEC_BUILTIN_VPKUHUM, |
2893 | ALTIVEC_BUILTIN_VPKUWUM, | |
2894 | ALTIVEC_BUILTIN_VPKPX, | |
2895 | ALTIVEC_BUILTIN_VPKUHSS, | |
2896 | ALTIVEC_BUILTIN_VPKSHSS, | |
2897 | ALTIVEC_BUILTIN_VPKUWSS, | |
2898 | ALTIVEC_BUILTIN_VPKSWSS, | |
2899 | ALTIVEC_BUILTIN_VPKUHUS, | |
2900 | ALTIVEC_BUILTIN_VPKSHUS, | |
2901 | ALTIVEC_BUILTIN_VPKUWUS, | |
2902 | ALTIVEC_BUILTIN_VPKSWUS, | |
617e0e1d DB |
2903 | ALTIVEC_BUILTIN_VREFP, |
2904 | ALTIVEC_BUILTIN_VRFIM, | |
2905 | ALTIVEC_BUILTIN_VRFIN, | |
2906 | ALTIVEC_BUILTIN_VRFIP, | |
2907 | ALTIVEC_BUILTIN_VRFIZ, | |
0ac081f6 AH |
2908 | ALTIVEC_BUILTIN_VRLB, |
2909 | ALTIVEC_BUILTIN_VRLH, | |
2910 | ALTIVEC_BUILTIN_VRLW, | |
617e0e1d | 2911 | ALTIVEC_BUILTIN_VRSQRTEFP, |
0ac081f6 AH |
2912 | ALTIVEC_BUILTIN_VSLB, |
2913 | ALTIVEC_BUILTIN_VSLH, | |
2914 | ALTIVEC_BUILTIN_VSLW, | |
2915 | ALTIVEC_BUILTIN_VSL, | |
2916 | ALTIVEC_BUILTIN_VSLO, | |
2212663f DB |
2917 | ALTIVEC_BUILTIN_VSPLTB, |
2918 | ALTIVEC_BUILTIN_VSPLTH, | |
2919 | ALTIVEC_BUILTIN_VSPLTW, | |
2920 | ALTIVEC_BUILTIN_VSPLTISB, | |
2921 | ALTIVEC_BUILTIN_VSPLTISH, | |
2922 | ALTIVEC_BUILTIN_VSPLTISW, | |
0ac081f6 | 2923 | ALTIVEC_BUILTIN_VSRB, |
f18c054f DB |
2924 | ALTIVEC_BUILTIN_VSRH, |
2925 | ALTIVEC_BUILTIN_VSRW, | |
0ac081f6 AH |
2926 | ALTIVEC_BUILTIN_VSRAB, |
2927 | ALTIVEC_BUILTIN_VSRAH, | |
2928 | ALTIVEC_BUILTIN_VSRAW, | |
2929 | ALTIVEC_BUILTIN_VSR, | |
2930 | ALTIVEC_BUILTIN_VSRO, | |
2931 | ALTIVEC_BUILTIN_VSUBUBM, | |
2932 | ALTIVEC_BUILTIN_VSUBUHM, | |
2933 | ALTIVEC_BUILTIN_VSUBUWM, | |
2934 | ALTIVEC_BUILTIN_VSUBFP, | |
2935 | ALTIVEC_BUILTIN_VSUBCUW, | |
2936 | ALTIVEC_BUILTIN_VSUBUBS, | |
2937 | ALTIVEC_BUILTIN_VSUBSBS, | |
2938 | ALTIVEC_BUILTIN_VSUBUHS, | |
2939 | ALTIVEC_BUILTIN_VSUBSHS, | |
2940 | ALTIVEC_BUILTIN_VSUBUWS, | |
2941 | ALTIVEC_BUILTIN_VSUBSWS, | |
2942 | ALTIVEC_BUILTIN_VSUM4UBS, | |
2943 | ALTIVEC_BUILTIN_VSUM4SBS, | |
2944 | ALTIVEC_BUILTIN_VSUM4SHS, | |
2945 | ALTIVEC_BUILTIN_VSUM2SWS, | |
2946 | ALTIVEC_BUILTIN_VSUMSWS, | |
24408032 AH |
2947 | ALTIVEC_BUILTIN_VXOR, |
2948 | ALTIVEC_BUILTIN_VSLDOI_16QI, | |
2949 | ALTIVEC_BUILTIN_VSLDOI_8HI, | |
2950 | ALTIVEC_BUILTIN_VSLDOI_4SI, | |
20e26713 AH |
2951 | ALTIVEC_BUILTIN_VSLDOI_4SF, |
2952 | ALTIVEC_BUILTIN_VUPKHSB, | |
2953 | ALTIVEC_BUILTIN_VUPKHPX, | |
2954 | ALTIVEC_BUILTIN_VUPKHSH, | |
2955 | ALTIVEC_BUILTIN_VUPKLSB, | |
2956 | ALTIVEC_BUILTIN_VUPKLPX, | |
fa066a23 AH |
2957 | ALTIVEC_BUILTIN_VUPKLSH, |
2958 | ALTIVEC_BUILTIN_VCMPBFP_P, | |
2959 | ALTIVEC_BUILTIN_VCMPEQFP_P, | |
2960 | ALTIVEC_BUILTIN_VCMPEQUB_P, | |
2961 | ALTIVEC_BUILTIN_VCMPEQUH_P, | |
2962 | ALTIVEC_BUILTIN_VCMPEQUW_P, | |
2963 | ALTIVEC_BUILTIN_VCMPGEFP_P, | |
2964 | ALTIVEC_BUILTIN_VCMPGTFP_P, | |
2965 | ALTIVEC_BUILTIN_VCMPGTSB_P, | |
2966 | ALTIVEC_BUILTIN_VCMPGTSH_P, | |
2967 | ALTIVEC_BUILTIN_VCMPGTSW_P, | |
2968 | ALTIVEC_BUILTIN_VCMPGTUB_P, | |
2969 | ALTIVEC_BUILTIN_VCMPGTUH_P, | |
2970 | ALTIVEC_BUILTIN_VCMPGTUW_P | |
0ac081f6 | 2971 | }; |