OSDN Git Service

* config/rs6000/rs6000.md (UNSPEC constants): Add UNSPEC_STFIWX.
[pf3gnuchains/gcc-fork.git] / gcc / config / rs6000 / rs6000.h
index 3b14ce6..adef695 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler, for IBM RS/6000.
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
 
    This file is part of GCC.
 #define TARGET_AIX 0
 #endif
 
+/* Control whether function entry points use a "dot" symbol when
+   ABI_AIX.  */
+#define DOT_SYMBOLS 1
+
 /* Default string to use for cpu if not specified.  */
 #ifndef TARGET_CPU_DEFAULT
 #define TARGET_CPU_DEFAULT ((char *)0)
 "%{!mcpu*: \
   %{mpower: %{!mpower2: -mpwr}} \
   %{mpower2: -mpwrx} \
-  %{mpowerpc*: -mppc} \
+  %{mpowerpc64*: -mppc64} \
+  %{!mpowerpc64*: %{mpowerpc*: -mppc}} \
   %{mno-power: %{!mpowerpc*: -mcom}} \
-  %{!mno-power: %{!mpower2: %(asm_default)}}} \
+  %{!mno-power: %{!mpower*: %(asm_default)}}} \
 %{mcpu=common: -mcom} \
 %{mcpu=power: -mpwr} \
 %{mcpu=power2: -mpwrx} \
-%{mcpu=power3: -m604} \
+%{mcpu=power3: -mppc64} \
 %{mcpu=power4: -mpower4} \
+%{mcpu=power5: -mpower4} \
 %{mcpu=powerpc: -mppc} \
 %{mcpu=rios: -mpwr} \
 %{mcpu=rios1: -mpwr} \
 %{mcpu=rios2: -mpwrx} \
 %{mcpu=rsc: -mpwr} \
 %{mcpu=rsc1: -mpwr} \
+%{mcpu=rs64a: -mppc64} \
 %{mcpu=401: -mppc} \
 %{mcpu=403: -m403} \
 %{mcpu=405: -m405} \
 %{mcpu=ec603e: -mppc} \
 %{mcpu=604: -mppc} \
 %{mcpu=604e: -mppc} \
-%{mcpu=620: -mppc} \
-%{mcpu=630: -m604} \
+%{mcpu=620: -mppc64} \
+%{mcpu=630: -mppc64} \
 %{mcpu=740: -mppc} \
-%{mcpu=7400: -mppc} \
-%{mcpu=7450: -mppc} \
-%{mcpu=G4: -mppc} \
 %{mcpu=750: -mppc} \
 %{mcpu=G3: -mppc} \
+%{mcpu=7400: -mppc -maltivec} \
+%{mcpu=7450: -mppc -maltivec} \
+%{mcpu=G4: -mppc -maltivec} \
 %{mcpu=801: -mppc} \
 %{mcpu=821: -mppc} \
 %{mcpu=823: -mppc} \
 %{mcpu=860: -mppc} \
-%{mcpu=970: -mpower4} \
-%{mcpu=G5: -mpower4} \
+%{mcpu=970: -mpower4 -maltivec} \
+%{mcpu=G5: -mpower4 -maltivec} \
 %{mcpu=8540: -me500} \
-%{maltivec: -maltivec}"
+%{maltivec: -maltivec} \
+-many"
 
 #define CPP_DEFAULT_SPEC ""
 
@@ -160,7 +168,10 @@ extern int target_flags;
    function, and one less allocable register.  */
 #define MASK_MINIMAL_TOC       0x00000200
 
-/* Nonzero for the 64bit model: longs and pointers are 64 bits.  */
+/* Nonzero for the 64 bit ABIs: longs and pointers are 64 bits.  The
+   chip is running in "64-bit mode", in which CR0 is set in dot
+   operations based on all 64 bits of the register, bdnz works on 64-bit
+   ctr, lr is 64 bits, and so on.  Requires MASK_POWERPC64.  */
 #define MASK_64BIT             0x00000400
 
 /* Disable use of FPRs.  */
@@ -190,9 +201,9 @@ extern int target_flags;
 /* Use single field mfcr instruction.  */
 #define MASK_MFCRF             0x00080000
 
-/* The only remaining free bits are 0x00700000. sysv4.h uses
-   0x00800000 -> 0x40000000, and 0x80000000 is not available
-   because target_flags is signed.  */
+/* The only remaining free bits are 0x00600000.  linux64.h uses
+   0x00100000, and sysv4.h uses 0x00800000 -> 0x40000000.
+   0x80000000 is not available because target_flags is signed.  */
 
 #define TARGET_POWER           (target_flags & MASK_POWER)
 #define TARGET_POWER2          (target_flags & MASK_POWER2)
@@ -229,10 +240,21 @@ extern int target_flags;
 #define TARGET_UPDATE          (! TARGET_NO_UPDATE)
 #define TARGET_FUSED_MADD      (! TARGET_NO_FUSED_MADD)
 
+/* Emit a dtp-relative reference to a TLS variable.  */
+
+#ifdef HAVE_AS_TLS
+#define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \
+  rs6000_output_dwarf_dtprel (FILE, SIZE, X)
+#endif
+
 #ifndef HAVE_AS_TLS
 #define HAVE_AS_TLS 0
 #endif
 
+/* Return 1 for a symbol ref for a thread-local storage symbol.  */
+#define RS6000_SYMBOL_REF_TLS_P(RTX) \
+  (GET_CODE (RTX) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (RTX) != 0)
+
 #ifdef IN_LIBGCC2
 /* For libgcc2 we make sure this is a compile time constant */
 #if defined (__64BIT__) || defined (__powerpc64__)
@@ -244,7 +266,7 @@ extern int target_flags;
 #define TARGET_POWERPC64       (target_flags & MASK_POWERPC64)
 #endif
 
-#define TARGET_XL_CALL 0
+#define TARGET_XL_COMPAT 0
 
 /* Run-time compilation parameters selecting different hardware subsets.
 
@@ -376,7 +398,8 @@ enum processor_type
    PROCESSOR_PPC7400,
    PROCESSOR_PPC7450,
    PROCESSOR_PPC8540,
-   PROCESSOR_POWER4
+   PROCESSOR_POWER4,
+   PROCESSOR_POWER5
 };
 
 extern enum processor_type rs6000_cpu;
@@ -449,6 +472,9 @@ enum group_termination
    {"longcall", &rs6000_longcall_switch,                               \
     N_("Avoid all range limits on call instructions"), 0},             \
    {"no-longcall", &rs6000_longcall_switch, "", 0},                    \
+   {"warn-altivec-long", &rs6000_warn_altivec_long_switch, \
+    N_("Warn about deprecated 'vector long ...' AltiVec type usage"), 0}, \
+   {"no-warn-altivec-long", &rs6000_warn_altivec_long_switch, "", 0}, \
    {"sched-costly-dep=", &rs6000_sched_costly_dep_str,                  \
     N_("Determine which dependences between insns are considered costly"), 0}, \
    {"insert-sched-nops=", &rs6000_sched_insert_nops_str,                \
@@ -517,6 +543,9 @@ extern enum rs6000_dependence_cost rs6000_sched_costly_dep;
 extern const char *rs6000_sched_insert_nops_str;
 extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
 
+extern int rs6000_warn_altivec_long;
+extern const char *rs6000_warn_altivec_long_switch;
+
 /* Alignment options for fields in structures for sub-targets following
    AIX-like ABI.
    ALIGN_POWER word-aligns FP doubles (default AIX ABI).
@@ -525,7 +554,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
    Override the macro definitions when compiling libobjc to avoid undefined
    reference to rs6000_alignment_flags due to library's use of GCC alignment
    macros which use the macros below.  */
-   
+
 #ifndef IN_TARGET_LIBS
 #define MASK_ALIGN_POWER   0x00000000
 #define MASK_ALIGN_NATURAL 0x00000001
@@ -534,19 +563,6 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
 #define TARGET_ALIGN_NATURAL 0
 #endif
 
-/* Set a default value for DEFAULT_SCHED_COSTLY_DEP used by target hook
-   is_costly_dependence.  */ 
-#define DEFAULT_SCHED_COSTLY_DEP                           \
-  (rs6000_cpu == PROCESSOR_POWER4 ? store_to_load_dep_costly : no_dep_costly)
-
-/* Define if the target has restricted dispatch slot instructions.  */
-#define DEFAULT_RESTRICTED_INSNS_PRIORITY (rs6000_cpu == PROCESSOR_POWER4 ? 1 : 0)
-
-/* Set a default value for post scheduling nop insertion scheme
-   (used by taget hook sched_finish).  */
-#define DEFAULT_SCHED_FINISH_NOP_INSERTION_SCHEME          \
-  (rs6000_cpu == PROCESSOR_POWER4 ? sched_finish_regroup_exact : sched_finish_none)
-
 #define TARGET_LONG_DOUBLE_128 (rs6000_long_double_type_size == 128)
 #define TARGET_ALTIVEC_ABI rs6000_altivec_abi
 #define TARGET_ALTIVEC_VRSAVE rs6000_altivec_vrsave
@@ -556,6 +572,8 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
 #define TARGET_E500 0
 #define TARGET_ISEL 0
 #define TARGET_FPRS 1
+#define TARGET_E500_SINGLE 0
+#define TARGET_E500_DOUBLE 0
 
 /* Sometimes certain combinations of command options do not make sense
    on a particular target machine.  You can define a macro
@@ -674,7 +692,6 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
    target machine.  If you don't define this, the default is one
    word.  */
 #define LONG_TYPE_SIZE (TARGET_32BIT ? 32 : 64)
-#define MAX_LONG_TYPE_SIZE 64
 
 /* A C expression for the size in bits of the type `long long' on the
    target machine.  If you don't define this, the default is two
@@ -696,9 +713,6 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
    words.  */
 #define LONG_DOUBLE_TYPE_SIZE rs6000_long_double_type_size
 
-/* Constant which presents upper bound of the above value.  */
-#define MAX_LONG_DOUBLE_TYPE_SIZE 128
-
 /* Define this to set long double type size to use in libgcc2.c, which can
    not depend on target_flags.  */
 #ifdef __LONG_DOUBLE_128__
@@ -718,7 +732,8 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
 #define PARM_BOUNDARY (TARGET_32BIT ? 32 : 64)
 
 /* Boundary (in *bits*) on which stack pointer should be aligned.  */
-#define STACK_BOUNDARY ((TARGET_32BIT && !TARGET_ALTIVEC_ABI) ? 64 : 128)
+#define STACK_BOUNDARY \
+  ((TARGET_32BIT && !TARGET_ALTIVEC && !TARGET_ALTIVEC_ABI) ? 64 : 128)
 
 /* Allocation boundary (in *bits*) for the code of a function.  */
 #define FUNCTION_BOUNDARY 32
@@ -731,6 +746,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
    that the object would ordinarily have.  */
 #define LOCAL_ALIGNMENT(TYPE, ALIGN)                           \
   ((TARGET_ALTIVEC && TREE_CODE (TYPE) == VECTOR_TYPE) ? 128 : \
+    (TARGET_E500_DOUBLE && TYPE_MODE (TYPE) == DFmode) ? 64 : \
     (TARGET_SPE && TREE_CODE (TYPE) == VECTOR_TYPE) ? 64 : ALIGN)
 
 /* Alignment of field after `int : 0' in a structure.  */
@@ -747,9 +763,13 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
    store_bit_field() will force (subreg:DI (reg:V2SI x))'s to the
    back-end.  Because a single GPR can hold a V2SI, but not a DI, the
    best thing to do is set structs to BLKmode and avoid Severe Tire
-   Damage.  */
+   Damage.
+
+   On e500 v2, DF and DI modes suffer from the same anomaly.  DF can
+   fit into 1, whereas DI still needs two.  */
 #define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) \
-  (TARGET_SPE && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)
+  ((TARGET_SPE && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
+   || (TARGET_E500_DOUBLE && (MODE) == DFmode))
 
 /* A bit-field declared as `int' forces `int' alignment for the struct.  */
 #define PCC_BITFIELD_TYPE_MATTERS 1
@@ -763,9 +783,11 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
    : (ALIGN))
 
 /* Make arrays of chars word-aligned for the same reasons.
-   Align vectors to 128 bits.  */
+   Align vectors to 128 bits.  Align SPE vectors and E500 v2 doubles to
+   64 bits.  */
 #define DATA_ALIGNMENT(TYPE, ALIGN)            \
   (TREE_CODE (TYPE) == VECTOR_TYPE ? (TARGET_SPE_ABI ? 64 : 128)       \
+   : (TARGET_E500_DOUBLE && TYPE_MODE (TYPE) == DFmode) ? 64 \
    : TREE_CODE (TYPE) == ARRAY_TYPE            \
    && TYPE_MODE (TREE_TYPE (TYPE)) == QImode   \
    && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
@@ -811,19 +833,27 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
 /* This must be included for pre gcc 3.0 glibc compatibility.  */
 #define PRE_GCC3_DWARF_FRAME_REGISTERS 77
 
-/* Add 32 dwarf columns for synthetic SPE registers.  The SPE
-   synthetic registers are 113 through 145.  */
+/* Add 32 dwarf columns for synthetic SPE registers.  */
 #define DWARF_FRAME_REGISTERS (FIRST_PSEUDO_REGISTER + 32)
 
-/* The SPE has an additional 32 synthetic registers starting at 1200.
-   We must map them here to sane values in the unwinder to avoid a
-   huge hole in the unwind tables.
-
-   FIXME: the AltiVec ABI has AltiVec registers being 1124-1155, and
-   the VRSAVE SPR (SPR256) assigned to register 356.  When AltiVec EH
-   is verified to be working, this macro should be changed
-   accordingly.  */
-#define DWARF_REG_TO_UNWIND_COLUMN(r) ((r) > 1200 ? ((r) - 1200 + 113) : (r))
+/* The SPE has an additional 32 synthetic registers, with DWARF debug
+   info numbering for these registers starting at 1200.  While eh_frame
+   register numbering need not be the same as the debug info numbering,
+   we choose to number these regs for eh_frame at 1200 too.  This allows
+   future versions of the rs6000 backend to add hard registers and
+   continue to use the gcc hard register numbering for eh_frame.  If the
+   extra SPE registers in eh_frame were numbered starting from the
+   current value of FIRST_PSEUDO_REGISTER, then if FIRST_PSEUDO_REGISTER
+   changed we'd need to introduce a mapping in DWARF_FRAME_REGNUM to
+   avoid invalidating older SPE eh_frame info.
+
+   We must map them here to avoid huge unwinder tables mostly consisting
+   of unused space.  */
+#define DWARF_REG_TO_UNWIND_COLUMN(r) \
+  ((r) > 1200 ? ((r) - 1200 + FIRST_PSEUDO_REGISTER) : (r))
+
+/* Use gcc hard register numbering for eh_frame.  */
+#define DWARF_FRAME_REGNUM(REGNO) (REGNO)
 
 /* 1 for registers that have pervasive standard uses
    and are not available for the register allocator.
@@ -873,7 +903,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
    (`CALL_USED_REGISTERS' must be a superset of `FIXED_REGISTERS').
    This macro is optional.  If not specified, it defaults to the value
    of `CALL_USED_REGISTERS'.  */
-                      
+
 #define CALL_REALLY_USED_REGISTERS  \
   {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, FIXED_R13, 0, 0, \
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
@@ -903,6 +933,10 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
 #define SPE_ACC_REGNO          111
 #define SPEFSCR_REGNO          112
 
+#define FIRST_SAVED_ALTIVEC_REGNO (FIRST_ALTIVEC_REGNO+20)
+#define FIRST_SAVED_FP_REGNO    (14+32)
+#define FIRST_SAVED_GP_REGNO 13
+
 /* List the order in which to allocate registers.  Each register must be
    listed once, even those in FIXED_REGISTERS.
 
@@ -910,31 +944,30 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
        fp0             (not saved or used for anything)
        fp13 - fp2      (not saved; incoming fp arg registers)
        fp1             (not saved; return value)
-       fp31 - fp14     (saved; order given to save least number)
+       fp31 - fp14     (saved; order given to save least number)
        cr7, cr6        (not saved or special)
        cr1             (not saved, but used for FP operations)
        cr0             (not saved, but used for arithmetic operations)
        cr4, cr3, cr2   (saved)
-        r0             (not saved; cannot be base reg)
+       r0              (not saved; cannot be base reg)
        r9              (not saved; best for TImode)
        r11, r10, r8-r4 (not saved; highest used first to make less conflict)
-       r3              (not saved; return value register)
+       r3              (not saved; return value register)
        r31 - r13       (saved; order given to save least number)
        r12             (not saved; if used for DImode or DFmode would use r13)
        mq              (not saved; best to use it if we can)
        ctr             (not saved; when we have the choice ctr is better)
        lr              (saved)
-        cr5, r1, r2, ap, xer, vrsave, vscr (fixed)
+       cr5, r1, r2, ap, xer (fixed)
+       v0 - v1         (not saved or used for anything)
+       v13 - v3        (not saved; incoming vector arg registers)
+       v2              (not saved; incoming vector arg reg; return value)
+       v19 - v14       (not saved or used for anything)
+       v31 - v20       (saved; order given to save least number)
+       vrsave, vscr    (fixed)
        spe_acc, spefscr (fixed)
-
-       AltiVec registers:
-       v0 - v1         (not saved or used for anything)
-       v13 - v3        (not saved; incoming vector arg registers)
-       v2              (not saved; incoming vector arg reg; return value)
-       v19 - v14       (not saved or used for anything)
-       v31 - v20       (saved; order given to save least number)
 */
-                                               
+
 #if FIXED_R2 == 1
 #define MAYBE_R2_AVAILABLE
 #define MAYBE_R2_FIXED 2,
@@ -943,28 +976,28 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
 #define MAYBE_R2_FIXED
 #endif
 
-#define REG_ALLOC_ORDER                                        \
-  {32,                                                         \
-   45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34,     \
-   33,                                                 \
-   63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, \
-   50, 49, 48, 47, 46,                                         \
-   75, 74, 69, 68, 72, 71, 70,                         \
-   0, MAYBE_R2_AVAILABLE                               \
-   9, 11, 10, 8, 7, 6, 5, 4,                           \
-   3,                                                  \
-   31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, \
-   18, 17, 16, 15, 14, 13, 12,                         \
-   64, 66, 65,                                                 \
-   73, 1, MAYBE_R2_FIXED 67, 76,                       \
-   /* AltiVec registers.  */                           \
-   77, 78,                                             \
-   90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80,         \
-   79,                                                 \
-   96, 95, 94, 93, 92, 91,                             \
-   108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98,        \
-   97, 109, 110                                                \
-   , 111, 112                                              \
+#define REG_ALLOC_ORDER                                                \
+  {32,                                                         \
+   45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34,             \
+   33,                                                         \
+   63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51,         \
+   50, 49, 48, 47, 46,                                         \
+   75, 74, 69, 68, 72, 71, 70,                                 \
+   0, MAYBE_R2_AVAILABLE                                       \
+   9, 11, 10, 8, 7, 6, 5, 4,                                   \
+   3,                                                          \
+   31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19,         \
+   18, 17, 16, 15, 14, 13, 12,                                 \
+   64, 66, 65,                                                 \
+   73, 1, MAYBE_R2_FIXED 67, 76,                               \
+   /* AltiVec registers.  */                                   \
+   77, 78,                                                     \
+   90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80,                 \
+   79,                                                         \
+   96, 95, 94, 93, 92, 91,                                     \
+   108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97,    \
+   109, 110,                                                   \
+   111, 112                                                    \
 }
 
 /* True if register is floating-point.  */
@@ -989,29 +1022,13 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
 #define ALTIVEC_REGNO_P(N) ((N) >= FIRST_ALTIVEC_REGNO && (N) <= LAST_ALTIVEC_REGNO)
 
 /* Return number of consecutive hard regs needed starting at reg REGNO
-   to hold something of mode MODE.
-   This is ordinarily the length in words of a value of mode MODE
-   but can be less for certain modes in special long registers.
-
-   For the SPE, GPRs are 64 bits but only 32 bits are visible in
-   scalar instructions.  The upper 32 bits are only available to the
-   SIMD instructions.
-
-   POWER and PowerPC GPRs hold 32 bits worth;
-   PowerPC64 GPRs and FPRs point register holds 64 bits worth.  */
-
-#define HARD_REGNO_NREGS(REGNO, MODE)                                  \
-  (FP_REGNO_P (REGNO)                                                  \
-   ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \
-   : (SPE_SIMD_REGNO_P (REGNO) && TARGET_SPE && SPE_VECTOR_MODE (MODE))   \
-   ? ((GET_MODE_SIZE (MODE) + UNITS_PER_SPE_WORD - 1) / UNITS_PER_SPE_WORD) \
-   : ALTIVEC_REGNO_P (REGNO)                                           \
-   ? ((GET_MODE_SIZE (MODE) + UNITS_PER_ALTIVEC_WORD - 1) / UNITS_PER_ALTIVEC_WORD) \
-   : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
+   to hold something of mode MODE.  */
+
+#define HARD_REGNO_NREGS(REGNO, MODE) rs6000_hard_regno_nregs ((REGNO), (MODE))
 
 #define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE)    \
   ((TARGET_32BIT && TARGET_POWERPC64                   \
-    && (MODE == DImode || MODE == DFmode)              \
+    && (GET_MODE_SIZE (MODE) > 4)  \
     && INT_REGNO_P (REGNO)) ? 1 : 0)
 
 #define ALTIVEC_VECTOR_MODE(MODE)      \
@@ -1026,33 +1043,13 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
          || (MODE) == V1DImode          \
          || (MODE) == V2SImode)
 
-/* Define this macro to be nonzero if the port is prepared to handle
-   insns involving vector mode MODE.  At the very least, it must have
-   move patterns for this mode.  */
-
-#define VECTOR_MODE_SUPPORTED_P(MODE)                  \
-        ((TARGET_SPE && SPE_VECTOR_MODE (MODE))                \
-        || (TARGET_ALTIVEC && ALTIVEC_VECTOR_MODE (MODE)))
-
-/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
-   For POWER and PowerPC, the GPRs can hold any mode, but values bigger
-   than one register cannot go past R31.  The float
-   registers only can hold floating modes and DImode, and CR register only
-   can hold CC modes.  We cannot put TImode anywhere except general
-   register and it must be able to fit within the register set.  */
-
-#define HARD_REGNO_MODE_OK(REGNO, MODE)                                        \
-  (INT_REGNO_P (REGNO) ?                                               \
-     INT_REGNO_P (REGNO + HARD_REGNO_NREGS (REGNO, MODE) - 1)          \
-   : FP_REGNO_P (REGNO) ?                                              \
-     (GET_MODE_CLASS (MODE) == MODE_FLOAT                              \
-      || (GET_MODE_CLASS (MODE) == MODE_INT                            \
-         && GET_MODE_SIZE (MODE) == UNITS_PER_FP_WORD))                \
-   : ALTIVEC_REGNO_P (REGNO) ? ALTIVEC_VECTOR_MODE (MODE)              \
-   : SPE_SIMD_REGNO_P (REGNO) && TARGET_SPE && SPE_VECTOR_MODE (MODE) ? 1 \
-   : CR_REGNO_P (REGNO) ? GET_MODE_CLASS (MODE) == MODE_CC             \
-   : XER_REGNO_P (REGNO) ? (MODE) == PSImode                           \
-   : GET_MODE_SIZE (MODE) <= UNITS_PER_WORD)
+#define UNITS_PER_SIMD_WORD     \
+        (TARGET_ALTIVEC ? 16 : (TARGET_SPE ? 8 : 0) )
+
+/* Value is TRUE if hard register REGNO can hold a value of
+   machine-mode MODE.  */
+#define HARD_REGNO_MODE_OK(REGNO, MODE) \
+  rs6000_hard_regno_mode_ok_p[(int)(MODE)][REGNO]
 
 /* Value is 1 if it is a good idea to tie two pseudo registers
    when one has mode MODE1 and one has mode MODE2.
@@ -1102,9 +1099,9 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
 #define BRANCH_COST 3
 
 /* Override BRANCH_COST heuristic which empirically produces worse
-   performance for fold_range_test().  */
+   performance for removing short circuiting from the logical ops.  */
 
-#define RANGE_TEST_NON_SHORT_CIRCUIT 0
+#define LOGICAL_OP_NON_SHORT_CIRCUIT 0
 
 /* A fixed register used at prologue and epilogue generation to fix
    addressing modes.  The SPE needs heavy addressing fixes at the last
@@ -1119,59 +1116,10 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
 
 #define FIXED_SCRATCH (TARGET_SPE ? 14 : 11)
 
-/* Define this macro to change register usage conditional on target flags.
-   Set MQ register fixed (already call_used) if not POWER architecture
-   (RIOS1, RIOS2, RSC, and PPC601) so that it will not be allocated.
-   64-bit AIX reserves GPR13 for thread-private data.
-   Conditionally disable FPRs.  */
+/* Define this macro to change register usage conditional on target
+   flags.  */
 
-#define CONDITIONAL_REGISTER_USAGE                                     \
-{                                                                      \
-  int i;                                                               \
-  if (! TARGET_POWER)                                                  \
-    fixed_regs[64] = 1;                                                        \
-  if (TARGET_64BIT)                                                    \
-    fixed_regs[13] = call_used_regs[13]                                        \
-      = call_really_used_regs[13] = 1;                                         \
-  if (TARGET_SOFT_FLOAT || !TARGET_FPRS)                               \
-    for (i = 32; i < 64; i++)                                          \
-      fixed_regs[i] = call_used_regs[i]                                        \
-        = call_really_used_regs[i] = 1;                                        \
-  if (DEFAULT_ABI == ABI_V4                                            \
-      && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM                     \
-      && flag_pic == 2)                                                        \
-    fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;                    \
-  if (DEFAULT_ABI == ABI_V4                                            \
-      && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM                     \
-      && flag_pic == 1)                                                        \
-    fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]                         \
-      = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]                 \
-      = call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;     \
-  if (DEFAULT_ABI == ABI_DARWIN                                                \
-      && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)                    \
-    global_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]                                \
-      = fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]                     \
-      = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]                 \
-      = call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;     \
-  if (TARGET_ALTIVEC)                                                   \
-    global_regs[VSCR_REGNO] = 1;                                        \
-  if (TARGET_SPE)                                                      \
-    {                                                                   \
-      global_regs[SPEFSCR_REGNO] = 1;                                  \
-      fixed_regs[FIXED_SCRATCH]                                                \
-        = call_used_regs[FIXED_SCRATCH]                                        \
-       = call_really_used_regs[FIXED_SCRATCH] = 1;                     \
-    }                                                                   \
-  if (! TARGET_ALTIVEC)                                                        \
-    {                                                                  \
-      for (i = FIRST_ALTIVEC_REGNO; i <= LAST_ALTIVEC_REGNO; ++i)      \
-       fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1; \
-      call_really_used_regs[VRSAVE_REGNO] = 1;                         \
-    }                                                                  \
-  if (TARGET_ALTIVEC_ABI)                                              \
-    for (i = FIRST_ALTIVEC_REGNO; i < FIRST_ALTIVEC_REGNO + 20; ++i)   \
-      call_used_regs[i] = call_really_used_regs[i] = 1;                        \
-}
+#define CONDITIONAL_REGISTER_USAGE rs6000_conditional_register_usage ()
 
 /* Specify the registers used for certain standard purposes.
    The values of these macros are register numbers.  */
@@ -1347,7 +1295,7 @@ enum reg_class
 /* Get reg_class from a letter such as appears in the machine description.  */
 
 #define REG_CLASS_FROM_LETTER(C) \
-  ((C) == 'f' ? FLOAT_REGS     \
+  ((C) == 'f' ? ((TARGET_HARD_FLOAT && TARGET_FPRS) ? FLOAT_REGS : NO_REGS) \
    : (C) == 'b' ? BASE_REGS    \
    : (C) == 'h' ? SPECIAL_REGS \
    : (C) == 'q' ? MQ_REGS      \
@@ -1408,6 +1356,8 @@ enum reg_class
    'T' is a constant that can be placed into a 32-bit mask operand
    'U' is for V.4 small data references.
    'W' is a vector constant that can be easily generated (no mem refs).
+   'Y' is a indexed or word-aligned displacement memory operand.
+   'Z' is an indexed or indirect memory operand.
    't' is for AND masks that can be performed by two rldic{l,r} insns.  */
 
 #define EXTRA_CONSTRAINT(OP, C)                                                \
@@ -1422,15 +1372,24 @@ enum reg_class
                       || !logical_operand (OP, DImode))                \
                   && !mask64_operand (OP, DImode))                     \
    : (C) == 'W' ? (easy_vector_constant (OP, GET_MODE (OP)))           \
+   : (C) == 'Y' ? (word_offset_memref_operand (OP, GET_MODE (OP)))      \
+   : (C) == 'Z' ? (indexed_or_indirect_operand (OP, GET_MODE (OP)))    \
    : 0)
 
+/* Define which constraints are memory constraints.  Tell reload
+   that any memory address can be reloaded by copying the
+   memory address into a base register if required.  */
+
+#define EXTRA_MEMORY_CONSTRAINT(C, STR)                                \
+  ((C) == 'Q' || (C) == 'Y' || (C) == 'Z')
+
 /* Given an rtx X being reloaded into a reg required to be
    in class CLASS, return the class of reg to actually use.
    In general this is just CLASS; but on some machines
    in some cases it is preferable to use a more restrictive class.
 
    On the RS/6000, we have to return NO_REGS when we want to reload a
-   floating-point CONST_DOUBLE to force it to be copied to memory.  
+   floating-point CONST_DOUBLE to force it to be copied to memory.
 
    We also don't want to reload integer values into floating-point
    registers if we can at all help it.  In fact, this can
@@ -1443,13 +1402,13 @@ enum reg_class
  */
 
 #define PREFERRED_RELOAD_CLASS(X,CLASS)                        \
-  (((GET_CODE (X) == CONST_DOUBLE                      \
-     && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT)   \
-    ? NO_REGS                                          \
-    : (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT       \
-       && (CLASS) == NON_SPECIAL_REGS)                 \
-    ? GENERAL_REGS                                     \
-    : (CLASS)))
+  ((CONSTANT_P (X)                                     \
+    && reg_classes_intersect_p ((CLASS), FLOAT_REGS))  \
+   ? NO_REGS                                           \
+   : (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT        \
+      && (CLASS) == NON_SPECIAL_REGS)                  \
+   ? GENERAL_REGS                                      \
+   : (CLASS))
 
 /* Return the register class of a scratch register needed to copy IN into
    or out of a register in CLASS in MODE.  If it can be done directly,
@@ -1475,6 +1434,8 @@ enum reg_class
 #define CLASS_MAX_NREGS(CLASS, MODE)                                   \
  (((CLASS) == FLOAT_REGS)                                              \
   ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \
+  : (TARGET_E500_DOUBLE && (CLASS) == GENERAL_REGS && (MODE) == DFmode) \
+  ? 1                                                                   \
   : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
 
 
@@ -1486,6 +1447,10 @@ enum reg_class
    ? 0                                                                   \
    : GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)                                  \
    ? reg_classes_intersect_p (FLOAT_REGS, CLASS)                         \
+   : (TARGET_E500_DOUBLE && (((TO) == DFmode) + ((FROM) == DFmode)) == 1) \
+   ? reg_classes_intersect_p (GENERAL_REGS, CLASS)                       \
+   : (TARGET_E500_DOUBLE && (((TO) == DImode) + ((FROM) == DImode)) == 1) \
+   ? reg_classes_intersect_p (GENERAL_REGS, CLASS)                       \
    : (TARGET_SPE && (SPE_VECTOR_MODE (FROM) + SPE_VECTOR_MODE (TO)) == 1) \
    ? reg_classes_intersect_p (GENERAL_REGS, CLASS)                       \
    : 0)
@@ -1506,6 +1471,9 @@ extern enum rs6000_abi rs6000_current_abi;        /* available for use by subtarget */
    makes the stack pointer a smaller address.  */
 #define STACK_GROWS_DOWNWARD
 
+/* Offsets recorded in opcodes are a multiple of this alignment factor.  */
+#define DWARF_CIE_DATA_ALIGNMENT (-((int) (TARGET_32BIT ? 4 : 8)))
+
 /* Define this if the nominal address of the stack frame
    is at the high-address end of the local variables;
    that is, each additional local variable allocated
@@ -1625,7 +1593,7 @@ extern enum rs6000_abi rs6000_current_abi;        /* available for use by subtarget */
 /* DRAFT_V4_STRUCT_RET defaults off.  */
 #define DRAFT_V4_STRUCT_RET 0
 
-/* Let RETURN_IN_MEMORY control what happens.  */
+/* Let TARGET_RETURN_IN_MEMORY control what happens.  */
 #define DEFAULT_PCC_STRUCT_RETURN 0
 
 /* Mode of stack savearea.
@@ -1668,14 +1636,18 @@ extern enum rs6000_abi rs6000_current_abi;      /* available for use by subtarget */
 #define CALL_LONG              0x00000008      /* always call indirect */
 #define CALL_LIBCALL           0x00000010      /* libcall */
 
+/* We don't have prologue and epilogue functions to save/restore
+   everything for most ABIs.  */
+#define WORLD_SAVE_P(INFO) 0
+
 /* 1 if N is a possible register number for a function value
    as seen by the caller.
 
    On RS/6000, this is r3, fp1, and v2 (for AltiVec).  */
 #define FUNCTION_VALUE_REGNO_P(N)                                      \
   ((N) == GP_ARG_RETURN                                                        \
-   || ((N) == FP_ARG_RETURN && TARGET_HARD_FLOAT)                      \
-   || ((N) == ALTIVEC_ARG_RETURN && TARGET_ALTIVEC))
+   || ((N) == FP_ARG_RETURN && TARGET_HARD_FLOAT && TARGET_FPRS)       \
+   || ((N) == ALTIVEC_ARG_RETURN && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI))
 
 /* 1 if N is a possible register number for function argument passing.
    On RS/6000, these are r3-r10 and fp1-fp13.
@@ -1683,16 +1655,14 @@ extern enum rs6000_abi rs6000_current_abi;      /* available for use by subtarget */
 #define FUNCTION_ARG_REGNO_P(N)                                                \
   ((unsigned) (N) - GP_ARG_MIN_REG < GP_ARG_NUM_REG                    \
    || ((unsigned) (N) - ALTIVEC_ARG_MIN_REG < ALTIVEC_ARG_NUM_REG      \
-       && TARGET_ALTIVEC)                                              \
+       && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI)                                \
    || ((unsigned) (N) - FP_ARG_MIN_REG < FP_ARG_NUM_REG                        \
-       && TARGET_HARD_FLOAT))
+       && TARGET_HARD_FLOAT && TARGET_FPRS))
 \f
 /* A C structure for machine-specific, per-function data.
    This is added to the cfun structure.  */
 typedef struct machine_function GTY(())
 {
-  /* Whether a System V.4 varargs area was created.  */
-  int sysv_varargs_p;
   /* Flags if __builtin_return_address (n) with n >= 1 was used.  */
   int ra_needs_full_frame;
   /* Some local-dynamic symbol.  */
@@ -1731,42 +1701,35 @@ typedef struct rs6000_args
   int stdarg;                  /* Whether function is a stdarg function.  */
   int call_cookie;             /* Do special things for this call */
   int sysv_gregno;             /* next available GP register */
+  int intoffset;               /* running offset in struct (darwin64) */
+  int use_stack;               /* any part of struct on stack (darwin64) */
+  int named;                   /* false for varargs params */
 } CUMULATIVE_ARGS;
 
-/* Define intermediate macro to compute the size (in registers) of an argument
-   for the RS/6000.  */
-
-#define UNITS_PER_ARG (TARGET_32BIT ? 4 : 8)
-
-#define RS6000_ARG_SIZE(MODE, TYPE)                                    \
-((MODE) != BLKmode                                                     \
- ? (GET_MODE_SIZE (MODE) + (UNITS_PER_ARG - 1)) / UNITS_PER_ARG                \
- : (int_size_in_bytes (TYPE) + (UNITS_PER_ARG - 1)) / UNITS_PER_ARG)
-
 /* Initialize a variable CUM of type CUMULATIVE_ARGS
    for a call to a function whose data type is FNTYPE.
    For a library call, FNTYPE is 0.  */
 
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
-  init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE, FALSE)
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
+  init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE, FALSE, N_NAMED_ARGS)
 
 /* Similar, but when scanning the definition of a procedure.  We always
    set NARGS_PROTOTYPE large so we never return an EXPR_LIST.  */
 
-#define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,LIBNAME) \
-  init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE, FALSE)
+#define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
+  init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE, FALSE, 1000)
 
 /* Like INIT_CUMULATIVE_ARGS' but only used for outgoing libcalls.  */
 
 #define INIT_CUMULATIVE_LIBCALL_ARGS(CUM, MODE, LIBNAME) \
-  init_cumulative_args (&CUM, NULL_TREE, LIBNAME, FALSE, TRUE)
+  init_cumulative_args (&CUM, NULL_TREE, LIBNAME, FALSE, TRUE, 0)
 
 /* Update the data in CUM to advance over an argument
    of mode MODE and data type TYPE.
    (TYPE is null for libcalls where that information may not be available.)  */
 
 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)   \
-  function_arg_advance (&CUM, MODE, TYPE, NAMED)
+  function_arg_advance (&CUM, MODE, TYPE, NAMED, 0)
 
 /* Determine where to put an argument to a function.
    Value is zero to push the argument on the stack,
@@ -1793,22 +1756,6 @@ typedef struct rs6000_args
 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
   function_arg (&CUM, MODE, TYPE, NAMED)
 
-/* For an arg passed partly in registers and partly in memory,
-   this is the number of registers used.
-   For args passed entirely in registers or entirely in memory, zero.  */
-
-#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
-  function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
-
-/* A C expression that indicates when an argument must be passed by
-   reference.  If nonzero for an argument, a copy of that argument is
-   made in memory and a pointer to the argument is passed instead of
-   the argument itself.  The pointer is passed in whatever way is
-   appropriate for passing a pointer to that type.  */
-
-#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
-  function_arg_pass_by_reference(&CUM, MODE, TYPE, NAMED)
-
 /* If defined, a C expression which determines whether, and in which
    direction, to pad out an argument with extra space.  The value
    should be of type `enum direction': either `upward' to pad above
@@ -1824,28 +1771,13 @@ typedef struct rs6000_args
 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
   function_arg_boundary (MODE, TYPE)
 
-/* Define to nonzero if complex arguments should be split into their
-   corresponding components.
-
-   This should be set for Linux and Darwin as well, but we can't break
-   the ABIs at the moment.  For now, only AIX gets fixed.  */
-#define SPLIT_COMPLEX_ARGS (DEFAULT_ABI == ABI_AIX)
-
 /* Implement `va_start' for varargs and stdarg.  */
 #define EXPAND_BUILTIN_VA_START(valist, nextarg) \
   rs6000_va_start (valist, nextarg)
 
-/* Implement `va_arg'.  */
-#define EXPAND_BUILTIN_VA_ARG(valist, type) \
-  rs6000_va_arg (valist, type)
-
 #define PAD_VARARGS_DOWN \
    (FUNCTION_ARG_PADDING (TYPE_MODE (type), type) == downward)
 
-/* Define this macro to be a nonzero value if the location where a function
-   argument is passed depends on whether or not it is a named argument.  */
-#define STRICT_ARGUMENT_NAMING 1
-
 /* Output assembler code to FILE to increment profiler label # LABELNO
    for profiling a function entry.  */
 
@@ -2007,6 +1939,9 @@ typedef struct rs6000_args
     || easy_vector_constant (X, GET_MODE (X)))                 \
    && !rs6000_tls_referenced_p (X))
 
+#define EASY_VECTOR_15(n) ((n) >= -16 && (n) <= 15)
+#define EASY_VECTOR_15_ADD_SELF(n) ((n) >= 0x10 && (n) <= 0x1e && !((n) & 1))
+
 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
    and check its validity for a certain class.
    We have two alternate definitions for each of them.
@@ -2102,9 +2037,9 @@ typedef struct rs6000_args
    operand.  If we find one, push the reload and jump to WIN.  This
    macro is used in only one place: `find_reloads_address' in reload.c.
 
-   Implemented on rs6000 by rs6000_legitimize_reload_address.  
+   Implemented on rs6000 by rs6000_legitimize_reload_address.
    Note that (X) is evaluated twice; this is safe in current usage.  */
-   
+
 #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN)         \
 do {                                                                        \
   int win;                                                                  \
@@ -2192,6 +2127,12 @@ do {                                                             \
 
 /* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC */
 
+/* An integer expression for the size in bits of the largest integer machine
+   mode that should actually be used.  */
+
+/* Allow pairs of registers to be used, which is the intent of the default.  */
+#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_POWERPC64 ? TImode : DImode)
+
 /* Max number of bytes we can move from memory to memory
    in one reasonably fast instruction.  */
 #define MOVE_MAX (! TARGET_POWERPC64 ? 4 : 8)
@@ -2209,7 +2150,7 @@ do {                                                              \
 /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
    will either zero-extend or sign-extend.  The value of this macro should
    be the code that says which one of the two operations is implicitly
-   done, NIL if none.  */
+   done, UNKNOWN if none.  */
 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
 
 /* Define if loading short immediate values into registers sign extends.  */
@@ -2269,7 +2210,7 @@ do {                                                              \
 #define SELECT_CC_MODE(OP,X,Y) \
   (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? CCFPmode      \
    : (OP) == GTU || (OP) == LTU || (OP) == GEU || (OP) == LEU ? CCUNSmode \
-   : (((OP) == EQ || (OP) == NE) && GET_RTX_CLASS (GET_CODE (X)) == '<'   \
+   : (((OP) == EQ || (OP) == NE) && COMPARISON_P (X)                     \
       ? CCEQmode : CCmode))
 
 /* Can the condition code MODE be safely reversed?  This is safe in
@@ -2294,10 +2235,6 @@ extern int rs6000_compare_fp_p;
    the end of the line.  */
 #define ASM_COMMENT_START " #"
 
-/* Implicit library calls should use memcpy, not bcopy, etc.  */
-
-#define TARGET_MEM_FUNCTIONS
-
 /* Flag to say the TOC is initialized */
 extern int toc_initialized;
 
@@ -2326,9 +2263,9 @@ extern int toc_initialized;
   do                                                                   \
     {                                                                  \
       fputs ("\t.weak\t", (FILE));                                     \
-      RS6000_OUTPUT_BASENAME ((FILE), (NAME));                         \
+      RS6000_OUTPUT_BASENAME ((FILE), (NAME));                                 \
       if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL                  \
-         && DEFAULT_ABI == ABI_AIX)                                    \
+         && DEFAULT_ABI == ABI_AIX && DOT_SYMBOLS)                     \
        {                                                               \
          if (TARGET_XCOFF)                                             \
            fputs ("[DS]", (FILE));                                     \
@@ -2340,7 +2277,7 @@ extern int toc_initialized;
        {                                                               \
          ASM_OUTPUT_DEF ((FILE), (NAME), (VAL));                       \
          if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL               \
-             && DEFAULT_ABI == ABI_AIX)                                \
+             && DEFAULT_ABI == ABI_AIX && DOT_SYMBOLS)                 \
            {                                                           \
              fputs ("\t.set\t.", (FILE));                              \
              RS6000_OUTPUT_BASENAME ((FILE), (NAME));                  \
@@ -2361,7 +2298,7 @@ extern int toc_initialized;
       const char *alias = XSTR (XEXP (DECL_RTL (DECL), 0), 0);         \
       const char *name = IDENTIFIER_POINTER (TARGET);                  \
       if (TREE_CODE (DECL) == FUNCTION_DECL                            \
-         && DEFAULT_ABI == ABI_AIX)                                    \
+         && DEFAULT_ABI == ABI_AIX && DOT_SYMBOLS)                     \
        {                                                               \
          if (TREE_PUBLIC (DECL))                                       \
            {                                                           \
@@ -2612,80 +2549,6 @@ extern char rs6000_reg_names[][8];       /* register names (0 vs. %r0).  */
 
 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
 
-/* Define the codes that are matched by predicates in rs6000.c.  */
-
-#define PREDICATE_CODES                                                           \
-  {"any_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,            \
-                  LABEL_REF, SUBREG, REG, MEM, PARALLEL}},                \
-  {"zero_constant", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,          \
-                   LABEL_REF, SUBREG, REG, MEM}},                         \
-  {"short_cint_operand", {CONST_INT}},                                    \
-  {"u_short_cint_operand", {CONST_INT}},                                  \
-  {"non_short_cint_operand", {CONST_INT}},                                \
-  {"exact_log2_cint_operand", {CONST_INT}},                               \
-  {"gpc_reg_operand", {SUBREG, REG}},                                     \
-  {"cc_reg_operand", {SUBREG, REG}},                                      \
-  {"cc_reg_not_cr0_operand", {SUBREG, REG}},                              \
-  {"reg_or_short_operand", {SUBREG, REG, CONST_INT}},                     \
-  {"reg_or_neg_short_operand", {SUBREG, REG, CONST_INT}},                 \
-  {"reg_or_aligned_short_operand", {SUBREG, REG, CONST_INT}},             \
-  {"reg_or_u_short_operand", {SUBREG, REG, CONST_INT}},                           \
-  {"reg_or_cint_operand", {SUBREG, REG, CONST_INT}},                      \
-  {"reg_or_arith_cint_operand", {SUBREG, REG, CONST_INT}},                \
-  {"reg_or_add_cint64_operand", {SUBREG, REG, CONST_INT}},                \
-  {"reg_or_sub_cint64_operand", {SUBREG, REG, CONST_INT}},                \
-  {"reg_or_logical_cint_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \
-  {"got_operand", {SYMBOL_REF, CONST, LABEL_REF}},                        \
-  {"got_no_const_operand", {SYMBOL_REF, LABEL_REF}},                      \
-  {"rs6000_tls_symbol_ref", {SYMBOL_REF}},                                \
-  {"easy_fp_constant", {CONST_DOUBLE}},                                           \
-  {"easy_vector_constant", {CONST_VECTOR}},                               \
-  {"easy_vector_constant_add_self", {CONST_VECTOR}},                      \
-  {"zero_fp_constant", {CONST_DOUBLE}},                                           \
-  {"reg_or_mem_operand", {SUBREG, MEM, REG}},                             \
-  {"lwa_operand", {SUBREG, MEM, REG}},                                    \
-  {"volatile_mem_operand", {MEM}},                                        \
-  {"offsettable_mem_operand", {MEM}},                                     \
-  {"mem_or_easy_const_operand", {SUBREG, MEM, CONST_DOUBLE}},             \
-  {"add_operand", {SUBREG, REG, CONST_INT}},                              \
-  {"non_add_cint_operand", {CONST_INT}},                                  \
-  {"and_operand", {SUBREG, REG, CONST_INT}},                              \
-  {"and64_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}},              \
-  {"and64_2_operand", {SUBREG, REG, CONST_INT}},                          \
-  {"logical_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}},            \
-  {"non_logical_cint_operand", {CONST_INT, CONST_DOUBLE}},                \
-  {"mask_operand", {CONST_INT}},                                          \
-  {"mask_operand_wrap", {CONST_INT}},                                     \
-  {"mask64_operand", {CONST_INT}},                                        \
-  {"mask64_2_operand", {CONST_INT}},                                      \
-  {"count_register_operand", {REG}},                                      \
-  {"xer_operand", {REG}},                                                 \
-  {"symbol_ref_operand", {SYMBOL_REF}},                                           \
-  {"rs6000_tls_symbol_ref", {SYMBOL_REF}},                                \
-  {"call_operand", {SYMBOL_REF, REG}},                                    \
-  {"current_file_function_operand", {SYMBOL_REF}},                        \
-  {"input_operand", {SUBREG, MEM, REG, CONST_INT,                         \
-                    CONST_DOUBLE, SYMBOL_REF}},                           \
-  {"load_multiple_operation", {PARALLEL}},                                \
-  {"store_multiple_operation", {PARALLEL}},                               \
-  {"vrsave_operation", {PARALLEL}},                                       \
-  {"branch_comparison_operator", {EQ, NE, LE, LT, GE,                     \
-                                 GT, LEU, LTU, GEU, GTU,                  \
-                                 UNORDERED, ORDERED,                      \
-                                 UNGE, UNLE }},                           \
-  {"branch_positive_comparison_operator", {EQ, LT, GT, LTU, GTU,          \
-                                          UNORDERED }},                   \
-  {"scc_comparison_operator", {EQ, NE, LE, LT, GE,                        \
-                              GT, LEU, LTU, GEU, GTU,                     \
-                              UNORDERED, ORDERED,                         \
-                              UNGE, UNLE }},                              \
-  {"trap_comparison_operator", {EQ, NE, LE, LT, GE,                       \
-                               GT, LEU, LTU, GEU, GTU}},                  \
-  {"boolean_operator", {AND, IOR, XOR}},                                  \
-  {"boolean_or_operator", {IOR, XOR}},                                    \
-  {"altivec_register_operand", {REG}},                                    \
-  {"min_max_operator", {SMIN, SMAX, UMIN, UMAX}},
-
 /* uncomment for disabling the corresponding default options */
 /* #define  MACHINE_no_sched_interblock */
 /* #define  MACHINE_no_sched_speculative */
@@ -2900,9 +2763,13 @@ enum rs6000_builtins
   ALTIVEC_BUILTIN_ABS_V4SI,
   ALTIVEC_BUILTIN_ABS_V4SF,
   ALTIVEC_BUILTIN_ABS_V8HI,
-  ALTIVEC_BUILTIN_ABS_V16QI
+  ALTIVEC_BUILTIN_ABS_V16QI,
+  ALTIVEC_BUILTIN_COMPILETIME_ERROR,
+  ALTIVEC_BUILTIN_MASK_FOR_LOAD,
+  ALTIVEC_BUILTIN_MASK_FOR_STORE,
+
   /* SPE builtins.  */
-  SPE_BUILTIN_EVADDW,
+  SPE_BUILTIN_EVADDW,
   SPE_BUILTIN_EVAND,
   SPE_BUILTIN_EVANDC,
   SPE_BUILTIN_EVDIVWS,