2002-06-26 Aldy Hernandez <aldyh@redhat.com>
[official-gcc.git] / gcc / config / rs6000 / rs6000.h
blob100f27e8f3f3e01721d93769b6139fe847a8199a
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)
6 This file is part of GNU CC.
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.
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.
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. */
24 /* Note that some other tm.h files include this one and then override
25 many of the definitions. */
27 /* Definitions for the object file format. These are set at
28 compile-time. */
30 #define OBJECT_XCOFF 1
31 #define OBJECT_ELF 2
32 #define OBJECT_PEF 3
33 #define OBJECT_MACHO 4
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)
40 #ifndef TARGET_AIX
41 #define TARGET_AIX 0
42 #endif
44 /* Default string to use for cpu if not specified. */
45 #ifndef TARGET_CPU_DEFAULT
46 #define TARGET_CPU_DEFAULT ((char *)0)
47 #endif
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}"
92 #define CPP_DEFAULT_SPEC ""
94 #define ASM_DEFAULT_SPEC ""
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.
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.
104 Do not define this macro if it does not need to do anything. */
106 #define SUBTARGET_EXTRA_SPECS
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
114 /* Architecture type. */
116 extern int target_flags;
118 /* Use POWER architecture instructions and MQ register. */
119 #define MASK_POWER 0x00000001
121 /* Use POWER2 extensions to POWER architecture. */
122 #define MASK_POWER2 0x00000002
124 /* Use PowerPC architecture instructions. */
125 #define MASK_POWERPC 0x00000004
127 /* Use PowerPC General Purpose group optional instructions, e.g. fsqrt. */
128 #define MASK_PPC_GPOPT 0x00000008
130 /* Use PowerPC Graphics group optional instructions, e.g. fsel. */
131 #define MASK_PPC_GFXOPT 0x00000010
133 /* Use PowerPC-64 architecture instructions. */
134 #define MASK_POWERPC64 0x00000020
136 /* Use revised mnemonic names defined for PowerPC architecture. */
137 #define MASK_NEW_MNEMONICS 0x00000040
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
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
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.
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
156 /* Nonzero for the 64bit model: longs and pointers are 64 bits. */
157 #define MASK_64BIT 0x00000400
159 /* Disable use of FPRs. */
160 #define MASK_SOFT_FLOAT 0x00000800
162 /* Enable load/store multiple, even on powerpc */
163 #define MASK_MULTIPLE 0x00001000
164 #define MASK_MULTIPLE_SET 0x00002000
166 /* Use string instructions for block moves */
167 #define MASK_STRING 0x00004000
168 #define MASK_STRING_SET 0x00008000
170 /* Disable update form of load/store */
171 #define MASK_NO_UPDATE 0x00010000
173 /* Disable fused multiply/add operations */
174 #define MASK_NO_FUSED_MADD 0x00020000
176 /* Nonzero if we need to schedule the prolog and epilog. */
177 #define MASK_SCHED_PROLOG 0x00040000
179 /* Use AltiVec instructions. */
180 #define MASK_ALTIVEC 0x00080000
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
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. */
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)
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)
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
227 #define TARGET_XL_CALL 0
229 /* Run-time compilation parameters selecting different hardware subsets.
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. */
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 ""}}
338 #define TARGET_DEFAULT (MASK_POWER | MASK_MULTIPLE | MASK_STRING)
340 /* This is meant to be redefined in the host dependent files */
341 #define SUBTARGET_SWITCHES
343 /* Processor type. Order must match cpu attribute in MD file. */
344 enum processor_type
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
364 extern enum processor_type rs6000_cpu;
366 /* Recast the processor type to the cpu attribute. */
367 #define rs6000_cpu_attr ((enum attr_cpu)rs6000_cpu)
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
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
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)
383 /* This is meant to be overridden in target specific files. */
384 #define SUBTARGET_OPTIONS
386 #define TARGET_OPTIONS \
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 \
404 /* rs6000_select[0] is reserved for the default cpu defined via --with-cpu */
405 struct rs6000_cpu_select
407 const char *string;
408 const char *name;
409 int set_tune_p;
410 int set_arch_p;
413 extern struct rs6000_cpu_select rs6000_select[];
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 */
421 #define TARGET_DEBUG_STACK rs6000_debug_stack
422 #define TARGET_DEBUG_ARG rs6000_debug_arg
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;
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
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.
444 Don't use this macro to turn on various extra optimizations for
445 `-O'. That is what `OPTIMIZATION_OPTIONS' is for.
447 On the RS/6000 this is used to define the target cpu type. */
449 #define OVERRIDE_OPTIONS rs6000_override_options (TARGET_CPU_DEFAULT)
451 /* Define this to change the optimizations performed by default. */
452 #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) optimization_options(LEVEL,SIZE)
454 /* Show we can debug even without a frame pointer. */
455 #define CAN_DEBUG_WITHOUT_FP
457 /* Target pragma. */
458 #define REGISTER_TARGET_PRAGMAS(PFILE) do { \
459 cpp_register_pragma (PFILE, 0, "longcall", rs6000_pragma_longcall); \
460 } while (0)
462 /* Target #defines. */
463 #define TARGET_CPU_CPP_BUILTINS() \
464 rs6000_cpu_cpp_builtins (pfile)
466 /* Target machine storage layout. */
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. */
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;
479 /* Define this if function arguments should also be promoted using the above
480 procedure. */
482 #define PROMOTE_FUNCTION_ARGS
484 /* Likewise, if the function return value is promoted. */
486 #define PROMOTE_FUNCTION_RETURN
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
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
497 /* Define this if most significant word of a multiword number is lowest
498 numbered.
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
504 #define MAX_BITS_PER_WORD 64
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
512 /* Type used for ptrdiff_t, as a string used in a declaration. */
513 #define PTRDIFF_TYPE "int"
515 /* Type used for size_t, as a string used in a declaration. */
516 #define SIZE_TYPE "long unsigned int"
518 /* Type used for wchar_t, as a string used in a declaration. */
519 #define WCHAR_TYPE "short unsigned int"
521 /* Width of wchar_t in bits. */
522 #define WCHAR_TYPE_SIZE 16
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
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
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
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
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
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
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
561 /* Constant which presents upper bound of the above value. */
562 #define MAX_LONG_DOUBLE_TYPE_SIZE 128
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
572 /* Width in bits of a pointer.
573 See also the macro `Pmode' defined below. */
574 #define POINTER_SIZE (TARGET_32BIT ? 32 : 64)
576 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
577 #define PARM_BOUNDARY (TARGET_32BIT ? 32 : 64)
579 /* Boundary (in *bits*) on which stack pointer should be aligned. */
580 #define STACK_BOUNDARY ((TARGET_32BIT && !TARGET_ALTIVEC_ABI) ? 64 : 128)
582 /* Allocation boundary (in *bits*) for the code of a function. */
583 #define FUNCTION_BOUNDARY 32
585 /* No data type wants to be aligned rounder than this. */
586 #define BIGGEST_ALIGNMENT 128
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)
594 /* Alignment of field after `int : 0' in a structure. */
595 #define EMPTY_FIELD_BOUNDARY 32
597 /* Every structure's size must be a multiple of this. */
598 #define STRUCTURE_SIZE_BOUNDARY 8
600 /* A bitfield declared as `int' forces `int' alignment for the struct. */
601 #define PCC_BITFIELD_TYPE_MATTERS 1
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))
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))
619 /* Non-zero if move instructions will actually fail to work
620 when given unaligned data. */
621 #define STRICT_ALIGNMENT 0
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))
631 /* Standard register usage. */
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.
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.
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.
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. */
653 #define FIRST_PSEUDO_REGISTER 111
655 /* This must be included for pre gcc 3.0 glibc compatibility. */
656 #define PRE_GCC3_DWARF_FRAME_REGISTERS 77
658 /* 1 for registers that have pervasive standard uses
659 and are not available for the register allocator.
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.
664 cr5 is not supposed to be used.
666 On System V implementations, r13 is fixed and not available for use. */
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 \
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. */
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 \
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'. */
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 \
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
731 /* List the order in which to allocate registers. Each register must be
732 listed once, even those in FIXED_REGISTERS.
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)
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)
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 \
786 /* True if register is floating-point. */
787 #define FP_REGNO_P(N) ((N) >= 32 && (N) <= 63)
789 /* True if register is a condition register. */
790 #define CR_REGNO_P(N) ((N) >= 68 && (N) <= 75)
792 /* True if register is a condition register, but not cr0. */
793 #define CR_REGNO_NOT_CR0_P(N) ((N) >= 69 && (N) <= 75)
795 /* True if register is an integer register. */
796 #define INT_REGNO_P(N) ((N) <= 31 || (N) == ARG_POINTER_REGNUM)
798 /* True if register is the XER register. */
799 #define XER_REGNO_P(N) ((N) == XER_REGNO)
801 /* True if register is an AltiVec register. */
802 #define ALTIVEC_REGNO_P(N) ((N) >= FIRST_ALTIVEC_REGNO && (N) <= LAST_ALTIVEC_REGNO)
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.
809 POWER and PowerPC GPRs hold 32 bits worth;
810 PowerPC64 GPRs and FPRs point register holds 64 bits worth. */
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))
819 #define ALTIVEC_VECTOR_MODE(MODE) \
820 ((MODE) == V16QImode \
821 || (MODE) == V8HImode \
822 || (MODE) == V4SFmode \
823 || (MODE) == V4SImode)
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. */
829 #define VECTOR_MODE_SUPPORTED_P(MODE) \
830 (TARGET_ALTIVEC && ALTIVEC_VECTOR_MODE (MODE))
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. */
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)
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)
869 /* A C expression returning the cost of moving data from a register of class
870 CLASS1 to one of CLASS2.
872 On the RS/6000, copying between floating-point and fixed-point
873 registers is expensive. */
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)
889 /* A C expressions returning the cost of moving data of MODE from a register to
890 or from memory.
892 On the RS/6000, bump this up a bit. */
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)
900 /* Specify the cost of a branch insn; roughly the number of extra insns that
901 should be added to avoid a branch.
903 Set this to 3 on the RS/6000 since that is roughly the average cost of an
904 unscheduled conditional branch. */
906 #define BRANCH_COST 3
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. */
914 #define CONDITIONAL_REGISTER_USAGE \
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) \
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; \
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; \
951 /* Specify the registers used for certain standard purposes.
952 The values of these macros are register numbers. */
954 /* RS/6000 pc isn't overloaded on a register that the compiler knows about. */
955 /* #define PC_REGNUM */
957 /* Register to use for pushing function arguments. */
958 #define STACK_POINTER_REGNUM 1
960 /* Base register for access to local variables of the function. */
961 #define FRAME_POINTER_REGNUM 31
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
969 /* Base register for access to arguments of the function. */
970 #define ARG_POINTER_REGNUM 67
972 /* Place to put static chain when calling a function that requires it. */
973 #define STATIC_CHAIN_REGNUM 11
975 /* Link register number. */
976 #define LINK_REGISTER_REGNUM 65
978 /* Count register number. */
979 #define COUNT_REGISTER_REGNUM 66
981 /* Place that structure value return address is placed.
983 On the RS/6000, it is passed as an extra parameter. */
984 #define STRUCT_VALUE 0
986 /* Define the classes of registers for register constraints in the
987 machine description. Also define ranges of constants.
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.
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.
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.
1003 For any two classes, it is very desirable that there be another
1004 class that represents their union. */
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.
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.
1013 Also, cr0 is the only condition code register that can be used in
1014 arithmetic insns, so make a separate class for it. */
1016 enum reg_class
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
1040 #define N_REG_CLASSES (int) LIM_REG_CLASSES
1042 /* Give names of register classes as strings for dump file. */
1044 #define REG_CLASS_NAMES \
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" \
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. */
1071 #define REG_CLASS_CONTENTS \
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 */ \
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. */
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)
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
1119 /* Get reg_class from a letter such as appears in the machine description. */
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)
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.
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 */
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)
1161 /* Similar, but for floating constants, and defining letters G and H.
1162 Here VALUE is the CONST_DOUBLE rtx itself.
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.
1167 'H' is used for DI/DF constants that take 3 insns. */
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)
1175 /* Optional extra constraints for this machine.
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. */
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)
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.
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.
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.
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?
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)))
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. */
1223 #define SECONDARY_RELOAD_CLASS(CLASS,MODE,IN) \
1224 secondary_reload_class (CLASS, MODE, IN)
1226 /* If we are copying between FP or AltiVec registers and anything
1227 else, we need a memory location. */
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))
1235 /* Return the maximum number of consecutive registers
1236 needed to represent mode MODE in a register of class CLASS.
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))
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. */
1248 #define CLASS_CANNOT_CHANGE_MODE FLOAT_REGS
1250 /* Defines illegal mode changes for CLASS_CANNOT_CHANGE_MODE. */
1252 #define CLASS_CANNOT_CHANGE_MODE_P(FROM,TO) \
1253 (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO))
1255 /* Stack layout; function entry, exit and calling. */
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) */
1267 extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */
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;
1308 /* Define this if pushing a word on the stack
1309 makes the stack pointer a smaller address. */
1310 #define STACK_GROWS_DOWNWARD
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.
1317 On the RS/6000, we grow upwards, from the area after the outgoing
1318 arguments. */
1319 /* #define FRAME_GROWS_DOWNWARD */
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)
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))
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)))
1338 /* Size of the V.4 varargs area if needed */
1339 #define RS6000_VARARGS_AREA 0
1341 /* Align an address */
1342 #define RS6000_ALIGN(n,a) (((n) + (a) - 1) & ~((a) - 1))
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)
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.
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. */
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)
1363 /* Offset from the stack pointer register to an item dynamically
1364 allocated on the stack, e.g., by `alloca'.
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))
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) */
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
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
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
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
1398 /* This is the difference between the logical top of stack and the actual sp.
1400 For the RS/6000, sp points past the fixed area. */
1401 #define STACK_POINTER_OFFSET RS6000_SAVE_AREA
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
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. */
1415 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
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.
1422 On RS/6000 an integer value is in r3 and a floating-point value is in
1423 fp1, unless -msoft-float. */
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)
1435 /* Define how to find the value returned by a library function
1436 assuming the value has mode MODE. */
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)
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.
1454 int_size_in_bytes returns -1 for variable size objects, which go in
1455 memory always. The cast to unsigned makes -1 > 8. */
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))
1462 /* DRAFT_V4_STRUCT_RET defaults off. */
1463 #define DRAFT_V4_STRUCT_RET 0
1465 /* Let RETURN_IN_MEMORY control what happens. */
1466 #define DEFAULT_PCC_STRUCT_RETURN 0
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)
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)
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)
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)
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)
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 */
1508 /* 1 if N is a possible register number for a function value
1509 as seen by the caller.
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))
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)))
1527 /* A C structure for machine-specific, per-function data.
1528 This is added to the cfun structure. */
1529 typedef struct machine_function GTY(())
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;
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.
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.
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.
1552 The varargs/stdarg support requires that this structure's size
1553 be a multiple of sizeof(int). */
1555 typedef struct rs6000_args
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;
1567 /* Define intermediate macro to compute the size (in registers) of an argument
1568 for the RS/6000. */
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)
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. */
1579 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
1580 init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE)
1582 /* Similar, but when scanning the definition of a procedure. We always
1583 set NARGS_PROTOTYPE large so we never return an EXPR_LIST. */
1585 #define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,LIBNAME) \
1586 init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE)
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.) */
1592 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
1593 function_arg_advance (&CUM, MODE, TYPE, NAMED)
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)
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)
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.
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).
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.
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. */
1629 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
1630 function_arg (&CUM, MODE, TYPE, NAMED)
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. */
1636 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
1637 function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
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. */
1645 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
1646 function_arg_pass_by_reference(&CUM, MODE, TYPE, NAMED)
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. */
1654 #define FUNCTION_ARG_PADDING(MODE, TYPE) function_arg_padding (MODE, TYPE)
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. */
1660 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
1661 function_arg_boundary (MODE, TYPE)
1663 /* Perform any needed actions needed for a function that is receiving a
1664 variable number of arguments.
1666 CUM is as above.
1668 MODE and TYPE are the mode and type of the current parameter.
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
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. */
1677 #define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \
1678 setup_incoming_varargs (&CUM, MODE, TYPE, &PRETEND_SIZE, NO_RTL)
1680 /* Define the `__builtin_va_list' type for the ABI. */
1681 #define BUILD_VA_LIST_TYPE(VALIST) \
1682 (VALIST) = rs6000_build_va_list ()
1684 /* Implement `va_start' for varargs and stdarg. */
1685 #define EXPAND_BUILTIN_VA_START(stdarg, valist, nextarg) \
1686 rs6000_va_start (stdarg, valist, nextarg)
1688 /* Implement `va_arg'. */
1689 #define EXPAND_BUILTIN_VA_ARG(valist, type) \
1690 rs6000_va_arg (valist, type)
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)
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
1704 /* Output assembler code to FILE to increment profiler label # LABELNO
1705 for profiling a function entry. */
1707 #define FUNCTION_PROFILER(FILE, LABELNO) \
1708 output_function_profiler ((FILE), (LABELNO));
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.
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
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. */
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))
1731 /* TRAMPOLINE_TEMPLATE deleted */
1733 /* Length in units of the trampoline for entering a nested function. */
1735 #define TRAMPOLINE_SIZE rs6000_trampoline_size ()
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. */
1741 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \
1742 rs6000_initialize_trampoline (ADDR, FNADDR, CXT)
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 */
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))
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))
1771 /* Definitions for register eliminations.
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.
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. */
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} }
1793 /* Given FROM and TO register numbers, say whether this elimination is allowed.
1794 Frame pointer elimination is automatically handled.
1796 For the RS/6000, if frame pointer elimination is being done, we would like
1797 to convert ap into fp, not sp.
1799 We need r30 if -mminimal-toc was specified, and there are constant pool
1800 references. */
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)
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) \
1812 rs6000_stack_t *info = rs6000_stack_info (); \
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 (); \
1826 /* Addressing modes, and classification of registers for them. */
1828 /* #define HAVE_POST_INCREMENT 0 */
1829 /* #define HAVE_POST_DECREMENT 0 */
1831 #define HAVE_PRE_DECREMENT 1
1832 #define HAVE_PRE_INCREMENT 1
1834 /* Macros to check register numbers against specific register classes. */
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. */
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)))
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)))
1854 /* Maximum number of registers that can appear in a valid memory address. */
1856 #define MAX_REGS_PER_ADDRESS 2
1858 /* Recognize any constant value that is a valid address. */
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)
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.
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. */
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)))
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.
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. */
1890 #ifdef REG_OK_STRICT
1891 # define REG_OK_STRICT_FLAG 1
1892 #else
1893 # define REG_OK_STRICT_FLAG 0
1894 #endif
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))))
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)))
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)
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.
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.
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. */
1931 #define CONSTANT_POOL_EXPR_P(X) (constant_pool_expr_p (X))
1933 #define TOC_RELATIVE_EXPR_P(X) (toc_relative_expr_p (X))
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)))
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))
1948 #define LEGITIMATE_ADDRESS_INTEGER_P(X, OFFSET) \
1949 (GET_CODE (X) == CONST_INT \
1950 && (unsigned HOST_WIDE_INT) (INTVAL (X) + (OFFSET) + 0x8000) < 0x10000)
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)))))
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)))))
1978 #define LEGITIMATE_INDIRECT_ADDRESS_P(X, STRICT) \
1979 (GET_CODE (X) == REG && INT_REG_OK_FOR_BASE_P (X, (STRICT)))
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)))
1992 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
1993 { if (rs6000_legitimate_address (MODE, X, REG_OK_STRICT_FLAG)) \
1994 goto ADDR; \
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.
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.
2004 MODE and WIN are passed so that this macro can use
2005 GO_IF_LEGITIMATE_ADDRESS.
2007 It is always safe for this macro to do nothing. It exists to recognize
2008 opportunities to optimize the output.
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.
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. */
2020 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
2021 { rtx result = rs6000_legitimize_address (X, OLDX, MODE); \
2022 if (result != NULL_RTX) \
2024 (X) = result; \
2025 goto WIN; \
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.
2033 Implemented on rs6000 by rs6000_legitimize_reload_address.
2034 Note that (X) is evaluated twice; this is safe in current usage. */
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)
2045 /* Go to LABEL if ADDR (a legitimate address expression)
2046 has an effect that depends on the machine mode it is used for.
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. */
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; \
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). */
2076 #define RS6000_PIC_OFFSET_TABLE_REGNUM 30
2077 #define PIC_OFFSET_TABLE_REGNUM (flag_pic ? RS6000_PIC_OFFSET_TABLE_REGNUM : INVALID_REGNUM)
2079 #define TOC_REGISTER (TARGET_MINIMAL_TOC ? 30 : 2)
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. */
2085 /* #define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED */
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.
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.) */
2102 /* #define FINALIZE_PIC */
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. */
2112 /* #define LEGITIMATE_PIC_OPERAND_P (X) */
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. */
2119 /* #define MACHINE_DEPENDENT_REORG(INSN) */
2122 /* Define this if some processing needs to be done immediately before
2123 emitting code for an insn. */
2125 /* #define FINAL_PRESCAN_INSN(INSN,OPERANDS,NOPERANDS) */
2127 /* Specify the machine mode that this machine uses
2128 for the index in the tablejump instruction. */
2129 #define CASE_VECTOR_MODE SImode
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
2137 /* Define this as 1 if `char' should by default be signed; else as 0. */
2138 #define DEFAULT_SIGNED_CHAR 0
2140 /* This flag, if defined, says the same insns that convert to a signed fixnum
2141 also convert validly to an unsigned one. */
2143 /* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC */
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
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
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
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
2165 /* Define if loading short immediate values into registers sign extends. */
2166 #define SHORT_IMMEDIATES_SIGN_EXTEND
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
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)
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)
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
2187 /* Define this to be nonzero if shift instructions ignore all but the low-order
2188 few bits.
2190 The sle and sre instructions which allow SHIFT_COUNT_TRUNCATED
2191 have been dropped from the PowerPC architecture. */
2193 #define SHIFT_COUNT_TRUNCATED (TARGET_POWER ? 1 : 0)
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.
2200 On the RS/6000, if it is valid in the insn, it is free. So this
2201 always returns 0. */
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;
2212 /* Provide the costs of a rtl expression. This is in the body of a
2213 switch on CODE. */
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) \
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)); \
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) \
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); \
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;
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.
2332 For the RS/6000, everything is cost 0. */
2334 #define ADDRESS_COST(RTX) 0
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. */
2341 /* #define ADJUST_INSN_LENGTH(X,LENGTH) */
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. */
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))
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! */
2360 extern GTY(()) rtx rs6000_compare_op0;
2361 extern GTY(()) rtx rs6000_compare_op1;
2362 extern int rs6000_compare_fp_p;
2364 /* Control the assembler format that we output. */
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 " #"
2371 /* Implicit library calls should use memcpy, not bcopy, etc. */
2373 #define TARGET_MEM_FUNCTIONS
2375 /* Flag to say the TOC is initialized */
2376 extern int toc_initialized;
2378 /* Macro to output a special constant pool entry. Go to WIN if we output
2379 it. Otherwise, it is written the usual way.
2381 On the RS/6000, toc entries are handled this way. */
2383 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, X, MODE, ALIGN, LABELNO, WIN) \
2384 { if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X, MODE)) \
2386 output_toc (FILE, X, LABELNO, MODE); \
2387 goto WIN; \
2391 #ifdef HAVE_GAS_WEAK
2392 #define RS6000_WEAK 1
2393 #else
2394 #define RS6000_WEAK 0
2395 #endif
2397 #if RS6000_WEAK
2398 /* Used in lieu of ASM_WEAKEN_LABEL. */
2399 #define ASM_WEAKEN_DECL(FILE, DECL, NAME, VAL) \
2400 do \
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) \
2407 if (TARGET_XCOFF) \
2408 fputs ("[DS]", (FILE)); \
2409 fputs ("\n\t.weak\t.", (FILE)); \
2410 RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \
2412 fputc ('\n', (FILE)); \
2413 if (VAL) \
2415 ASM_OUTPUT_DEF ((FILE), (NAME), (VAL)); \
2416 if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL \
2417 && DEFAULT_ABI == ABI_AIX) \
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)); \
2427 while (0)
2428 #endif
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 \
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) \
2440 if (TREE_PUBLIC (DECL)) \
2442 if (!RS6000_WEAK || !DECL_WEAK (DECL)) \
2444 fputs ("\t.globl\t.", FILE); \
2445 RS6000_OUTPUT_BASENAME (FILE, alias); \
2446 putc ('\n', FILE); \
2449 else if (TARGET_XCOFF) \
2451 fputs ("\t.lglobl\t.", FILE); \
2452 RS6000_OUTPUT_BASENAME (FILE, alias); \
2453 putc ('\n', FILE); \
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); \
2461 ASM_OUTPUT_DEF (FILE, alias, name); \
2463 while (0)
2465 /* Output to assembler file text saying following lines
2466 may contain character constants, extra white space, comments, etc. */
2468 #define ASM_APP_ON ""
2470 /* Output to assembler file text saying following lines
2471 no longer contain unusual constructs. */
2473 #define ASM_APP_OFF ""
2475 /* How to refer to registers in assembler output.
2476 This sequence is indexed by compiler's hard-register-number (see above). */
2478 extern char rs6000_reg_names[][8]; /* register names (0 vs. %r0). */
2480 #define REGISTER_NAMES \
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 */ \
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 */ \
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 */ \
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 */ \
2562 &rs6000_reg_names[76][0], /* xer */ \
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 */ \
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. */
2604 #define DEBUG_REGISTER_NAMES \
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" \
2624 /* Table of additional register names to use in user input. */
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} }
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"
2661 /* This is how to output an element of a case-vector that is relative. */
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)
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. */
2678 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
2679 if ((LOG) != 0) \
2680 fprintf (FILE, "\t.align %d\n", (LOG))
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. */
2686 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
2687 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
2688 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
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. */
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)
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)
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. */
2705 #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
2707 /* Define which CODE values are valid. */
2709 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
2710 ((CODE) == '.')
2712 /* Print a memory address as an operand to reference that memory location. */
2714 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
2716 /* Define the codes that are matched by predicates in rs6000.c. */
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}},
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 */
2788 /* General flags. */
2789 extern int flag_pic;
2790 extern int optimize;
2791 extern int flag_expensive_optimizations;
2792 extern int frame_pointer_needed;
2794 enum rs6000_builtins
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