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