OSDN Git Service

* arm.h (EXTRA_CONSTRAINT_STR_ARM): Update comment.
[pf3gnuchains/gcc-fork.git] / gcc / config / arm / arm.h
index 240595e..666ce74 100644 (file)
@@ -1,31 +1,76 @@
 /* Definitions of target machine for GNU compiler, for ARM.
    Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002 Free Software Foundation, Inc.
+   2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
    and Martin Simmons (@harleqn.co.uk).
    More major hacks by Richard Earnshaw (rearnsha@arm.com)
    Minor hacks by Nick Clifton (nickc@cygnus.com)
 
-This file is part of GNU CC.
+   This file is part of GCC.
 
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 2, or (at your
+   option) any later version.
 
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING.  If not, write to
+   the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+   MA 02111-1307, USA.  */
 
 #ifndef GCC_ARM_H
 #define GCC_ARM_H
 
+/* Target CPU builtins.  */
+#define TARGET_CPU_CPP_BUILTINS()                      \
+  do                                                   \
+    {                                                  \
+       /* Define __arm__ even when in thumb mode, for  \
+          consistency with armcc.  */                  \
+       builtin_define ("__arm__");                     \
+       if (TARGET_THUMB)                               \
+         builtin_define ("__thumb__");                 \
+                                                       \
+       if (TARGET_BIG_END)                             \
+         {                                             \
+           builtin_define ("__ARMEB__");               \
+           if (TARGET_THUMB)                           \
+             builtin_define ("__THUMBEB__");           \
+           if (TARGET_LITTLE_WORDS)                    \
+             builtin_define ("__ARMWEL__");            \
+         }                                             \
+        else                                           \
+         {                                             \
+           builtin_define ("__ARMEL__");               \
+           if (TARGET_THUMB)                           \
+             builtin_define ("__THUMBEL__");           \
+         }                                             \
+                                                       \
+       if (TARGET_APCS_32)                             \
+         builtin_define ("__APCS_32__");               \
+       else                                            \
+         builtin_define ("__APCS_26__");               \
+                                                       \
+       if (TARGET_SOFT_FLOAT)                          \
+         builtin_define ("__SOFTFP__");                \
+                                                       \
+       if (TARGET_VFP)                                 \
+         builtin_define ("__VFP_FP__");                \
+                                                       \
+       /* Add a define for interworking.               \
+          Needed when building libgcc.a.  */           \
+       if (TARGET_INTERWORK)                           \
+         builtin_define ("__THUMB_INTERWORK__");       \
+                                                       \
+       builtin_assert ("cpu=arm");                     \
+       builtin_assert ("machine=arm");                 \
+    } while (0)
+
 #define TARGET_CPU_arm2                0x0000
 #define TARGET_CPU_arm250      0x0000
 #define TARGET_CPU_arm3                0x0000
@@ -50,9 +95,29 @@ Boston, MA 02111-1307, USA.  */
 #define TARGET_CPU_arm9                0x0080
 #define TARGET_CPU_arm9tdmi    0x0080
 #define TARGET_CPU_xscale       0x0100
+#define TARGET_CPU_ep9312      0x0200
+#define TARGET_CPU_iwmmxt      0x0400
+#define TARGET_CPU_arm926ejs   0x0800
+#define TARGET_CPU_arm1026ejs  0x1000
+#define TARGET_CPU_arm1136js   0x2000
+#define TARGET_CPU_arm1136jfs  0x4000
 /* Configure didn't specify.  */
 #define TARGET_CPU_generic     0x8000
 
+/* The various ARM cores.  */
+enum processor_type
+{
+#define ARM_CORE(NAME, FLAGS, COSTS) \
+  NAME,
+#include "arm-cores.def"
+#undef ARM_CORE
+  /* Used to indicate that no processor has been specified.  */
+  arm_none
+};
+
+/* The processor for which instructions should be scheduled.  */
+extern enum processor_type arm_tune;
+
 typedef enum arm_cond_code
 {
   ARM_EQ = 0, ARM_NE, ARM_CS, ARM_CC, ARM_MI, ARM_PL, ARM_VS, ARM_VC,
@@ -66,23 +131,28 @@ extern arm_cc arm_current_cc;
 
 extern int arm_target_label;
 extern int arm_ccfsm_state;
-extern struct rtx_def * arm_target_insn;
+extern GTY(()) rtx arm_target_insn;
 /* Run-time compilation parameters selecting different hardware subsets.  */
 extern int target_flags;
-/* The floating point instruction architecture, can be 2 or 3 */
-extern const char * target_fp_name;
+/* The floating point mode.  */
+extern const char *target_fpu_name;
+/* For backwards compatibility.  */
+extern const char *target_fpe_name;
+/* Whether to use floating point hardware.  */
+extern const char *target_float_abi_name;
 /* Define the information needed to generate branch insns.  This is
-   stored from the compare operation.  Note that we can't use "rtx" here
-   since it hasn't been defined!  */
-extern struct rtx_def * arm_compare_op0;
-extern struct rtx_def * arm_compare_op1;
+   stored from the compare operation.  */
+extern GTY(()) rtx arm_compare_op0;
+extern GTY(()) rtx arm_compare_op1;
 /* The label of the current constant pool.  */
-extern struct rtx_def * pool_vector_label;
+extern rtx pool_vector_label;
 /* Set to 1 when a return insn is output, this means that the epilogue
-   is not needed. */
+   is not needed.  */
 extern int return_used_this_function;
+/* Used to produce AOF syntax assembler.  */
+extern GTY(()) rtx aof_pic_label;
 \f
-/* Just in case configure has failed to define anything. */
+/* Just in case configure has failed to define anything.  */
 #ifndef TARGET_CPU_DEFAULT
 #define TARGET_CPU_DEFAULT TARGET_CPU_generic
 #endif
@@ -117,7 +187,30 @@ extern int return_used_this_function;
 #if TARGET_CPU_DEFAULT == TARGET_CPU_xscale
 #define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_5TE__ -D__XSCALE__"
 #else
-Unrecognized value in TARGET_CPU_DEFAULT.
+#if TARGET_CPU_DEFAULT == TARGET_CPU_ep9312
+#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_4T__ -D__MAVERICK__"
+/* Set TARGET_DEFAULT to the default, but without soft-float.  */
+#ifdef  TARGET_DEFAULT
+#undef  TARGET_DEFAULT
+#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME)
+#endif
+#else
+#if TARGET_CPU_DEFAULT == TARGET_CPU_iwmmxt
+#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_5TE__ -D__XSCALE__ -D__IWMMXT__"
+#else
+#if (TARGET_CPU_DEFAULT == TARGET_CPU_arm926ejs || \
+     TARGET_CPU_DEFAULT == TARGET_CPU_arm1026ejs)
+#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_5TEJ__"
+#else
+#if (TARGET_CPU_DEFAULT == TARGET_CPU_arm1136js || \
+     TARGET_CPU_DEFAULT == TARGET_CPU_arm1136jfs)
+#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_6J__"
+#else
+#error Unrecognized value in TARGET_CPU_DEFAULT.
+#endif
+#endif
+#endif
+#endif
 #endif
 #endif
 #endif
@@ -126,16 +219,17 @@ Unrecognized value in TARGET_CPU_DEFAULT.
 #endif
 
 #undef  CPP_SPEC
-#define CPP_SPEC "\
-%(cpp_cpu_arch) %(cpp_apcs_pc) %(cpp_float) \
-%(cpp_endian) %(subtarget_cpp_spec) %(cpp_isa) %(cpp_interwork)"
-
-#define CPP_ISA_SPEC "%{mthumb:-D__thumb__} %{!mthumb:-D__arm__}"
+#define CPP_SPEC "%(cpp_cpu_arch) %(subtarget_cpp_spec)                        \
+%{mapcs-32:%{mapcs-26:                                                 \
+       %e-mapcs-26 and -mapcs-32 may not be used together}}            \
+%{msoft-float:%{mhard-float:                                           \
+       %e-msoft-float and -mhard_float may not be used together}}      \
+%{mbig-endian:%{mlittle-endian:                                                \
+       %e-mbig-endian and -mlittle-endian may not be used together}}"
 
 /* Set the architecture define -- if -march= is set, then it overrides
    the -mcpu= setting.  */
 #define CPP_CPU_ARCH_SPEC "\
--Acpu=arm -Amachine=arm \
 %{march=arm2:-D__ARM_ARCH_2__} \
 %{march=arm250:-D__ARM_ARCH_2__} \
 %{march=arm3:-D__ARM_ARCH_2__} \
@@ -158,12 +252,18 @@ Unrecognized value in TARGET_CPU_DEFAULT.
 %{march=arm9:-D__ARM_ARCH_4T__} \
 %{march=arm920:-D__ARM_ARCH_4__} \
 %{march=arm920t:-D__ARM_ARCH_4T__} \
+%{march=arm926ejs:-D__ARM_ARCH_5TEJ__} \
 %{march=arm9tdmi:-D__ARM_ARCH_4T__} \
+%{march=arm1026ejs:-D__ARM_ARCH_5TEJ__} \
+%{march=arm1136js:-D__ARM_ARCH_6J__} \
+%{march=arm1136jfs:-D__ARM_ARCH_6J__} \
 %{march=strongarm:-D__ARM_ARCH_4__} \
 %{march=strongarm110:-D__ARM_ARCH_4__} \
 %{march=strongarm1100:-D__ARM_ARCH_4__} \
 %{march=xscale:-D__ARM_ARCH_5TE__} \
 %{march=xscale:-D__XSCALE__} \
+%{march=ep9312:-D__ARM_ARCH_4T__} \
+%{march=ep9312:-D__MAVERICK__} \
 %{march=armv2:-D__ARM_ARCH_2__} \
 %{march=armv2a:-D__ARM_ARCH_2__} \
 %{march=armv3:-D__ARM_ARCH_3__} \
@@ -174,6 +274,8 @@ Unrecognized value in TARGET_CPU_DEFAULT.
 %{march=armv5t:-D__ARM_ARCH_5T__} \
 %{march=armv5e:-D__ARM_ARCH_5E__} \
 %{march=armv5te:-D__ARM_ARCH_5TE__} \
+%{march=armv6:-D__ARM_ARCH6__} \
+%{march=armv6j:-D__ARM_ARCH6J__} \
 %{!march=*: \
  %{mcpu=arm2:-D__ARM_ARCH_2__} \
  %{mcpu=arm250:-D__ARM_ARCH_2__} \
@@ -197,67 +299,24 @@ Unrecognized value in TARGET_CPU_DEFAULT.
  %{mcpu=arm9:-D__ARM_ARCH_4T__} \
  %{mcpu=arm920:-D__ARM_ARCH_4__} \
  %{mcpu=arm920t:-D__ARM_ARCH_4T__} \
+ %{mcpu=arm926ejs:-D__ARM_ARCH_5TEJ__} \
  %{mcpu=arm9tdmi:-D__ARM_ARCH_4T__} \
+ %{mcpu=arm1026ejs:-D__ARM_ARCH_5TEJ__} \
+ %{mcpu=arm1136js:-D__ARM_ARCH_6J__} \
+ %{mcpu=arm1136jfs:-D__ARM_ARCH_6J__} \
  %{mcpu=strongarm:-D__ARM_ARCH_4__} \
  %{mcpu=strongarm110:-D__ARM_ARCH_4__} \
  %{mcpu=strongarm1100:-D__ARM_ARCH_4__} \
  %{mcpu=xscale:-D__ARM_ARCH_5TE__} \
  %{mcpu=xscale:-D__XSCALE__} \
+ %{mcpu=ep9312:-D__ARM_ARCH_4T__} \
+ %{mcpu=ep9312:-D__MAVERICK__} \
+ %{mcpu=iwmmxt:-D__ARM_ARCH_5TE__} \
+ %{mcpu=iwmmxt:-D__XSCALE__} \
+ %{mcpu=iwmmxt:-D__IWMMXT__} \
  %{!mcpu*:%(cpp_cpu_arch_default)}} \
 "
 
-/* Define __APCS_26__ if the PC also contains the PSR */
-#define CPP_APCS_PC_SPEC "\
-%{mapcs-32:%{mapcs-26:%e-mapcs-26 and -mapcs-32 may not be used together} \
- -D__APCS_32__} \
-%{mapcs-26:-D__APCS_26__} \
-%{!mapcs-32: %{!mapcs-26:%(cpp_apcs_pc_default)}} \
-"
-
-#ifndef CPP_APCS_PC_DEFAULT_SPEC
-#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_26__"
-#endif
-
-#define CPP_FLOAT_SPEC "\
-%{msoft-float:\
-  %{mhard-float:%e-msoft-float and -mhard_float may not be used together} \
-  -D__SOFTFP__} \
-%{!mhard-float:%{!msoft-float:%(cpp_float_default)}} \
-"
-
-/* Default is hard float, which doesn't define anything */
-#define CPP_FLOAT_DEFAULT_SPEC ""
-
-#define CPP_ENDIAN_SPEC "\
-%{mbig-endian:                                                         \
-  %{mlittle-endian:                                                    \
-    %e-mbig-endian and -mlittle-endian may not be used together}       \
-  -D__ARMEB__ %{mwords-little-endian:-D__ARMWEL__} %{mthumb:-D__THUMBEB__}}\
-%{mlittle-endian:-D__ARMEL__ %{mthumb:-D__THUMBEL__}}                  \
-%{!mlittle-endian:%{!mbig-endian:%(cpp_endian_default)}}               \
-"
-
-/* Default is little endian.  */
-#define CPP_ENDIAN_DEFAULT_SPEC "-D__ARMEL__ %{mthumb:-D__THUMBEL__}"
-
-/* Add a define for interworking.  Needed when building libgcc.a.  
-   This must define __THUMB_INTERWORK__ to the pre-processor if
-   interworking is enabled by default.  */
-#ifndef CPP_INTERWORK_DEFAULT_SPEC
-#define CPP_INTERWORK_DEFAULT_SPEC ""
-#endif
-
-#define CPP_INTERWORK_SPEC "                                           \
-%{mthumb-interwork:                                                    \
-  %{mno-thumb-interwork: %eincompatible interworking options}          \
-  -D__THUMB_INTERWORK__}                                               \
-%{!mthumb-interwork:%{!mno-thumb-interwork:%(cpp_interwork_default)}}  \
-"
-
-#ifndef CPP_PREDEFINES
-#define CPP_PREDEFINES ""
-#endif
-
 #ifndef CC1_SPEC
 #define CC1_SPEC ""
 #endif
@@ -267,22 +326,13 @@ Unrecognized value in TARGET_CPU_DEFAULT.
    is an initializer with a subgrouping for each command option.
 
    Each subgrouping contains a string constant, that defines the
-   specification name, and a string constant that used by the GNU CC driver
+   specification name, and a string constant that used by the GCC driver
    program.
 
    Do not define this macro if it does not need to do anything.  */
 #define EXTRA_SPECS                                            \
   { "cpp_cpu_arch",            CPP_CPU_ARCH_SPEC },            \
   { "cpp_cpu_arch_default",    CPP_ARCH_DEFAULT_SPEC },        \
-  { "cpp_apcs_pc",             CPP_APCS_PC_SPEC },             \
-  { "cpp_apcs_pc_default",     CPP_APCS_PC_DEFAULT_SPEC },     \
-  { "cpp_float",               CPP_FLOAT_SPEC },               \
-  { "cpp_float_default",       CPP_FLOAT_DEFAULT_SPEC },       \
-  { "cpp_endian",              CPP_ENDIAN_SPEC },              \
-  { "cpp_endian_default",      CPP_ENDIAN_DEFAULT_SPEC },      \
-  { "cpp_isa",                 CPP_ISA_SPEC },                 \
-  { "cpp_interwork",           CPP_INTERWORK_SPEC },           \
-  { "cpp_interwork_default",   CPP_INTERWORK_DEFAULT_SPEC },   \
   { "subtarget_cpp_spec",      SUBTARGET_CPP_SPEC },           \
   SUBTARGET_EXTRA_SPECS
 
@@ -358,7 +408,7 @@ Unrecognized value in TARGET_CPU_DEFAULT.
    function tries to return.  */
 #define ARM_FLAG_ABORT_NORETURN        (1 << 13)
 
-/* Nonzero if function prologues should not load the PIC register. */
+/* Nonzero if function prologues should not load the PIC register.  */
 #define ARM_FLAG_SINGLE_PIC_BASE (1 << 14)
 
 /* Nonzero if all call instructions should be indirect.  */
@@ -383,6 +433,12 @@ Unrecognized value in TARGET_CPU_DEFAULT.
    destination is non-Thumb aware.  */
 #define THUMB_FLAG_CALLER_SUPER_INTERWORKING   (1 << 20)
 
+/* Nonzero means to use ARM/Thumb Procedure Call Standard conventions.  */
+#define ARM_FLAG_ATPCS         (1 << 21)
+
+/* Fix invalid Cirrus instruction combinations by inserting NOPs.  */
+#define CIRRUS_FIX_INVALID_INSNS (1 << 22)
+
 #define TARGET_APCS_FRAME              (target_flags & ARM_FLAG_APCS_FRAME)
 #define TARGET_POKE_FUNCTION_NAME      (target_flags & ARM_FLAG_POKE)
 #define TARGET_FPE                     (target_flags & ARM_FLAG_FPE)
@@ -390,9 +446,16 @@ Unrecognized value in TARGET_CPU_DEFAULT.
 #define TARGET_APCS_STACK              (target_flags & ARM_FLAG_APCS_STACK)
 #define TARGET_APCS_FLOAT              (target_flags & ARM_FLAG_APCS_FLOAT)
 #define TARGET_APCS_REENT              (target_flags & ARM_FLAG_APCS_REENT)
+#define TARGET_ATPCS                   (target_flags & ARM_FLAG_ATPCS)
 #define TARGET_MMU_TRAPS               (target_flags & ARM_FLAG_MMU_TRAPS)
-#define TARGET_SOFT_FLOAT              (target_flags & ARM_FLAG_SOFT_FLOAT)
-#define TARGET_HARD_FLOAT              (! TARGET_SOFT_FLOAT)
+#define TARGET_SOFT_FLOAT              (arm_float_abi == ARM_FLOAT_ABI_SOFT)
+#define TARGET_SOFT_FLOAT_ABI          (arm_float_abi != ARM_FLOAT_ABI_HARD)
+#define TARGET_HARD_FLOAT              (arm_float_abi == ARM_FLOAT_ABI_HARD)
+#define TARGET_FPA                     (arm_fp_model == ARM_FP_MODEL_FPA)
+#define TARGET_MAVERICK                        (arm_fp_model == ARM_FP_MODEL_MAVERICK)
+#define TARGET_VFP                     (arm_fp_model == ARM_FP_MODEL_VFP)
+#define TARGET_IWMMXT                  (arm_arch_iwmmxt)
+#define TARGET_REALLY_IWMMXT           (TARGET_IWMMXT && TARGET_ARM)
 #define TARGET_BIG_END                 (target_flags & ARM_FLAG_BIG_END)
 #define TARGET_INTERWORK               (target_flags & ARM_FLAG_INTERWORK)
 #define TARGET_LITTLE_WORDS            (target_flags & ARM_FLAG_LITTLE_WORDS)
@@ -408,9 +471,9 @@ Unrecognized value in TARGET_CPU_DEFAULT.
 #define TARGET_BACKTRACE               (leaf_function_p ()                             \
                                         ? (target_flags & THUMB_FLAG_LEAF_BACKTRACE)   \
                                         : (target_flags & THUMB_FLAG_BACKTRACE))
+#define TARGET_CIRRUS_FIX_INVALID_INSNS        (target_flags & CIRRUS_FIX_INVALID_INSNS)
 
-/* SUBTARGET_SWITCHES is used to add flags on a per-config basis.
-   Bit 31 is reserved.  See riscix.h.  */
+/* SUBTARGET_SWITCHES is used to add flags on a per-config basis.  */
 #ifndef SUBTARGET_SWITCHES
 #define SUBTARGET_SWITCHES
 #endif
@@ -487,26 +550,50 @@ Unrecognized value in TARGET_CPU_DEFAULT.
    N_("Thumb: Assume function pointers may go to non-Thumb aware code") }, \
   {"no-caller-super-interworking", -THUMB_FLAG_CALLER_SUPER_INTERWORKING,  \
    "" },                                                                  \
+  {"cirrus-fix-invalid-insns",      CIRRUS_FIX_INVALID_INSNS,             \
+   N_("Cirrus: Place NOPs to avoid invalid instruction combinations") },   \
+  {"no-cirrus-fix-invalid-insns",  -CIRRUS_FIX_INVALID_INSNS,             \
+   N_("Cirrus: Do not break up invalid instruction combinations with NOPs") },\
   SUBTARGET_SWITCHES                                                      \
   {"",                         TARGET_DEFAULT, "" }                       \
 }
 
-#define TARGET_OPTIONS                                         \
-{                                                              \
-  {"cpu=",  & arm_select[0].string,                            \
-   N_("Specify the name of the target CPU") },                 \
-  {"arch=", & arm_select[1].string,                            \
-   N_("Specify the name of the target architecture") },        \
-  {"tune=", & arm_select[2].string, "" },                      \
-  {"fpe=",  & target_fp_name, "" },                            \
-  {"fp=",   & target_fp_name,                                  \
-   N_("Specify the version of the floating point emulator") }, \
-  {"structure-size-boundary=", & structure_size_string,        \
-   N_("Specify the minimum bit alignment of structures") },    \
-  {"pic-register=", & arm_pic_register_string,                 \
-   N_("Specify the register to be used for PIC addressing") }  \
+#define TARGET_OPTIONS                                                 \
+{                                                                      \
+  {"cpu=",  & arm_select[0].string,                                    \
+   N_("Specify the name of the target CPU"), 0},                       \
+  {"arch=", & arm_select[1].string,                                    \
+   N_("Specify the name of the target architecture"), 0},              \
+  {"tune=", & arm_select[2].string, "", 0},                            \
+  {"fpe=",  & target_fpe_name, "", 0},                                 \
+  {"fp=",  & target_fpe_name, "", 0},                                  \
+  {"fpu=",  & target_fpu_name,                                         \
+   N_("Specify the name of the target floating point hardware/format"), 0}, \
+  {"float-abi=", & target_float_abi_name,                              \
+   N_("Specify if floating point hardware should be used"), 0},                \
+  {"structure-size-boundary=", & structure_size_string,                        \
+   N_("Specify the minimum bit alignment of structures"), 0},          \
+  {"pic-register=", & arm_pic_register_string,                         \
+   N_("Specify the register to be used for PIC addressing"), 0}                \
 }
 
+/* Support for a compile-time default CPU, et cetera.  The rules are:
+   --with-arch is ignored if -march or -mcpu are specified.
+   --with-cpu is ignored if -march or -mcpu are specified, and is overridden
+    by --with-arch.
+   --with-tune is ignored if -mtune or -mcpu are specified (but not affected
+     by -march).
+   --with-float is ignored if -mhard-float, -msoft-float or -mfloat-abi are
+   specified.
+   --with-fpu is ignored if -mfpu is specified.  */
+#define OPTION_DEFAULT_SPECS \
+  {"arch", "%{!march=*:%{!mcpu=*:-march=%(VALUE)}}" }, \
+  {"cpu", "%{!march=*:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
+  {"tune", "%{!mcpu=*:%{!mtune=*:-mtune=%(VALUE)}}" }, \
+  {"float", \
+    "%{!msoft-float:%{!mhard-float:%{!mfloat-abi=*:-mfloat-abi=%(VALUE)}}}" }, \
+  {"fpu", "%{!mfpu=*:-mfpu=%(VALUE)}"},
+
 struct arm_cpu_select
 {
   const char *              string;
@@ -525,48 +612,91 @@ enum prog_mode_type
   prog_mode32
 };
 
-/* Recast the program mode class to be the prog_mode attribute */
+/* Recast the program mode class to be the prog_mode attribute */
 #define arm_prog_mode ((enum attr_prog_mode) arm_prgmode)
 
 extern enum prog_mode_type arm_prgmode;
 
-/* What sort of floating point unit do we have? Hardware or software.
-   If software, is it issue 2 or issue 3?  */
-enum floating_point_type
+/* Which floating point model to use.  */
+enum arm_fp_model
 {
-  FP_HARD,
-  FP_SOFT2,
-  FP_SOFT3
+  ARM_FP_MODEL_UNKNOWN,
+  /* FPA model (Hardware or software).  */
+  ARM_FP_MODEL_FPA,
+  /* Cirrus Maverick floating point model.  */
+  ARM_FP_MODEL_MAVERICK,
+  /* VFP floating point model.  */
+  ARM_FP_MODEL_VFP
+};
+
+extern enum arm_fp_model arm_fp_model;
+
+/* Which floating point hardware is available.  Also update
+   fp_model_for_fpu in arm.c when adding entries to this list.  */
+enum fputype
+{
+  /* No FP hardware.  */
+  FPUTYPE_NONE,
+  /* Full FPA support.  */
+  FPUTYPE_FPA,
+  /* Emulated FPA hardware, Issue 2 emulator (no LFM/SFM).  */
+  FPUTYPE_FPA_EMU2,
+  /* Emulated FPA hardware, Issue 3 emulator.  */
+  FPUTYPE_FPA_EMU3,
+  /* Cirrus Maverick floating point co-processor.  */
+  FPUTYPE_MAVERICK,
+  /* VFP.  */
+  FPUTYPE_VFP
 };
 
 /* Recast the floating point class to be the floating point attribute.  */
-#define arm_fpu_attr ((enum attr_fpu) arm_fpu)
+#define arm_fpu_attr ((enum attr_fpu) arm_fpu_tune)
 
 /* What type of floating point to tune for */
-extern enum floating_point_type arm_fpu;
+extern enum fputype arm_fpu_tune;
 
 /* What type of floating point instructions are available */
-extern enum floating_point_type arm_fpu_arch;
+extern enum fputype arm_fpu_arch;
+
+enum float_abi_type
+{
+  ARM_FLOAT_ABI_SOFT,
+  ARM_FLOAT_ABI_SOFTFP,
+  ARM_FLOAT_ABI_HARD
+};
+
+extern enum float_abi_type arm_float_abi;
 
 /* Default floating point architecture.  Override in sub-target if
-   necessary.  */
-#ifndef FP_DEFAULT
-#define FP_DEFAULT FP_SOFT2
+   necessary.
+   FIXME: Is this still necessary/desirable?  Do we want VFP chips to
+   default to VFP unless overridden by a subtarget?  If so it would be best
+   to remove these definitions.  It also assumes there is only one cpu model
+   with a Maverick fpu.  */
+#ifndef FPUTYPE_DEFAULT
+#define FPUTYPE_DEFAULT FPUTYPE_FPA_EMU2
+#endif
+
+#if TARGET_CPU_DEFAULT == TARGET_CPU_ep9312
+#undef  FPUTYPE_DEFAULT
+#define FPUTYPE_DEFAULT FPUTYPE_MAVERICK
 #endif
 
-/* Nonzero if the processor has a fast multiply insn, and one that does
-   a 64-bit multiply of two 32-bit values.  */
-extern int arm_fast_multiply;
+/* Nonzero if this chip supports the ARM Architecture 3M extensions.  */
+extern int arm_arch3m;
 
-/* Nonzero if this chip supports the ARM Architecture 4 extensions */
+/* Nonzero if this chip supports the ARM Architecture 4 extensions */
 extern int arm_arch4;
 
-/* Nonzero if this chip supports the ARM Architecture 5 extensions */
+/* Nonzero if this chip supports the ARM Architecture 5 extensions */
 extern int arm_arch5;
 
-/* Nonzero if this chip supports the ARM Architecture 5E extensions */
+/* Nonzero if this chip supports the ARM Architecture 5E extensions */
 extern int arm_arch5e;
 
+/* Nonzero if this chip supports the ARM Architecture 6 extensions.  */
+extern int arm_arch6;
+
 /* Nonzero if this chip can benefit from load scheduling.  */
 extern int arm_ld_sched;
 
@@ -576,8 +706,17 @@ extern int thumb_code;
 /* Nonzero if this chip is a StrongARM.  */
 extern int arm_is_strong;
 
+/* Nonzero if this chip is a Cirrus variant.  */
+extern int arm_is_cirrus;
+
+/* Nonzero if this chip supports Intel XScale with Wireless MMX technology.  */
+extern int arm_arch_iwmmxt;
+
 /* Nonzero if this chip is an XScale.  */
-extern int arm_is_xscale;
+extern int arm_arch_xscale;
+
+/* Nonzero if tuning for XScale  */
+extern int arm_tune_xscale;
 
 /* Nonzero if this chip is an ARM6 or an ARM7.  */
 extern int arm_is_6_or_7;
@@ -642,25 +781,6 @@ extern int arm_is_6_or_7;
       (MODE) = SImode;                         \
     }
 
-/* Define this macro if the promotion described by `PROMOTE_MODE'
-   should also be done for outgoing function arguments.  */
-/* This is required to ensure that push insns always push a word.  */
-#define PROMOTE_FUNCTION_ARGS
-
-/* For the ARM:
-   I think I have added all the code to make this work.  Unfortunately,
-   early releases of the floating point emulation code on RISCiX used a
-   different format for extended precision numbers.  On my RISCiX box there
-   is a bug somewhere which causes the machine to lock up when running enquire
-   with long doubles.  There is the additional aspect that Norcroft C
-   treats long doubles as doubles and we ought to remain compatible.
-   Perhaps someone with an FPA coprocessor and not running RISCiX would like
-   to try this someday. */
-/* #define LONG_DOUBLE_TYPE_SIZE 96 */
-
-/* Disable XFmode patterns in md file */
-#define ENABLE_XF_PATTERNS 0
-
 /* Define this if most significant bit is lowest numbered
    in instructions that operate on numbered bit-fields.  */
 #define BITS_BIG_ENDIAN  0
@@ -685,15 +805,20 @@ extern int arm_is_6_or_7;
 #endif
 
 /* Define this if most significant word of doubles is the lowest numbered.
-   This is always true, even when in little-endian mode.  */
-#define FLOAT_WORDS_BIG_ENDIAN 1
+   The rules are different based on whether or not we use FPA-format,
+   VFP-format or some other floating point co-processor's format doubles.  */
+#define FLOAT_WORDS_BIG_ENDIAN (arm_float_words_big_endian ())
 
 #define UNITS_PER_WORD 4
 
 #define PARM_BOUNDARY          32
 
+#define IWMMXT_ALIGNMENT   64
+
 #define STACK_BOUNDARY  32
 
+#define PREFERRED_STACK_BOUNDARY (TARGET_ATPCS ? 64 : 32)
+
 #define FUNCTION_BOUNDARY  32
 
 /* The lowest bit is used to indicate Thumb-mode functions, so the
@@ -703,13 +828,53 @@ extern int arm_is_6_or_7;
 
 #define EMPTY_FIELD_BOUNDARY  32
 
-#define BIGGEST_ALIGNMENT  32
+#define BIGGEST_ALIGNMENT  (TARGET_REALLY_IWMMXT ? 64 : 32)
+
+#define TYPE_NEEDS_IWMMXT_ALIGNMENT(TYPE)      \
+ (TARGET_REALLY_IWMMXT                         \
+   && ((TREE_CODE (TYPE) == VECTOR_TYPE) || (TYPE_MODE (TYPE) == DImode) || (TYPE_MODE (TYPE) == DFmode)))
+
+/* XXX Blah -- this macro is used directly by libobjc.  Since it
+   supports no vector modes, cut out the complexity and fall back
+   on BIGGEST_FIELD_ALIGNMENT.  */
+#ifdef IN_TARGET_LIBS
+#define BIGGEST_FIELD_ALIGNMENT 64
+#else
+/* An expression for the alignment of a structure field FIELD if the
+   alignment computed in the usual way is COMPUTED.  GCC uses this
+   value instead of the value in `BIGGEST_ALIGNMENT' or
+   `BIGGEST_FIELD_ALIGNMENT', if defined, for structure fields only.  */
+#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)            \
+  (TYPE_NEEDS_IWMMXT_ALIGNMENT (TREE_TYPE (FIELD))     \
+   ? IWMMXT_ALIGNMENT                                  \
+   : (COMPUTED))
+#endif
+
+/* If defined, a C expression to compute the alignment for a static variable.
+   TYPE is the data type, and ALIGN is the alignment that the object
+   would ordinarily have.  The value of this macro is used instead of that
+   alignment to align the object.
+
+   If this macro is not defined, then ALIGN is used.  */
+#define DATA_ALIGNMENT(TYPE, ALIGN) \
+  (TYPE_NEEDS_IWMMXT_ALIGNMENT (TYPE) ? IWMMXT_ALIGNMENT : ALIGN)
+
+/* If defined, a C expression to compute the alignment for a
+   variables in the local store.  TYPE is the data type, and
+   BASIC-ALIGN is the alignment that the object would ordinarily
+   have.  The value of this macro is used instead of that alignment
+   to align the object.
+
+   If this macro is not defined, then BASIC-ALIGN is used.  */
+#define LOCAL_ALIGNMENT(TYPE, ALIGN) \
+  (TYPE_NEEDS_IWMMXT_ALIGNMENT (TYPE) ? IWMMXT_ALIGNMENT : ALIGN)
 
 /* Make strings word-aligned so strcpy from constants will be faster.  */
-#define CONSTANT_ALIGNMENT_FACTOR (TARGET_THUMB || ! arm_is_xscale ? 1 : 2)
+#define CONSTANT_ALIGNMENT_FACTOR (TARGET_THUMB || ! arm_tune_xscale ? 1 : 2)
     
 #define CONSTANT_ALIGNMENT(EXP, ALIGN)                         \
-  ((TREE_CODE (EXP) == STRING_CST                              \
+  ((TARGET_REALLY_IWMMXT && TREE_CODE (EXP) == VECTOR_TYPE) ? IWMMXT_ALIGNMENT : \
+   (TREE_CODE (EXP) == STRING_CST                              \
     && (ALIGN) < BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR)    \
    ? BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR : (ALIGN))
 
@@ -722,9 +887,9 @@ extern int arm_is_6_or_7;
 #define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary
 extern int arm_structure_size_boundary;
 
-/* This is the value used to initialise arm_structure_size_boundary.  If a
+/* This is the value used to initialize arm_structure_size_boundary.  If a
    particular arm target wants to change the default value it should change
-   the definition of this macro, not STRUCTRUE_SIZE_BOUNDARY.  See netbsd.h
+   the definition of this macro, not STRUCTURE_SIZE_BOUNDARY.  See netbsd.h
    for an example of this.  */
 #ifndef DEFAULT_STRUCTURE_SIZE_BOUNDARY
 #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 32
@@ -733,12 +898,9 @@ extern int arm_structure_size_boundary;
 /* Used when parsing command line option -mstructure_size_boundary.  */
 extern const char * structure_size_string;
 
-/* Non-zero if move instructions will actually fail to work
+/* Nonzero if move instructions will actually fail to work
    when given unaligned data.  */
 #define STRICT_ALIGNMENT 1
-
-#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
-
 \f
 /* Standard register usage.  */
 
@@ -776,6 +938,16 @@ extern const char * structure_size_string;
 
    *: See CONDITIONAL_REGISTER_USAGE  */
 
+/*
+       mvf0            Cirrus floating point result
+       mvf1-mvf3       Cirrus floating point scratch
+       mvf4-mvf15   S  Cirrus floating point variable.  */
+
+/*     s0-s15          VFP scratch (aka d0-d7).
+       s16-s31       S VFP variable (aka d8-d15).
+       vfpcc           Not a real register.  Represents the VFP condition
+                       code flags.  */
+
 /* The stack backtrace structure is as follows:
   fp points to here:  |  save code pointer  |      [fp]
                       |  return link value  |      [fp, #-4]
@@ -800,12 +972,22 @@ extern const char * structure_size_string;
 
 /* 1 for registers that have pervasive standard uses
    and are not available for the register allocator.  */
-#define FIXED_REGISTERS  \
-{                        \
-  0,0,0,0,0,0,0,0,      \
-  0,0,0,0,0,1,0,1,      \
-  0,0,0,0,0,0,0,0,      \
-  1,1,1                         \
+#define FIXED_REGISTERS \
+{                       \
+  0,0,0,0,0,0,0,0,     \
+  0,0,0,0,0,1,0,1,     \
+  0,0,0,0,0,0,0,0,     \
+  1,1,1,               \
+  1,1,1,1,1,1,1,1,     \
+  1,1,1,1,1,1,1,1,     \
+  1,1,1,1,1,1,1,1,     \
+  1,1,1,1,1,1,1,1,     \
+  1,1,1,1,             \
+  1,1,1,1,1,1,1,1,     \
+  1,1,1,1,1,1,1,1,     \
+  1,1,1,1,1,1,1,1,     \
+  1,1,1,1,1,1,1,1,     \
+  1                    \
 }
 
 /* 1 for registers not available across function calls.
@@ -815,13 +997,23 @@ extern const char * structure_size_string;
    and the register where structure-value addresses are passed.
    Aside from that, you can include as many other registers as you like.
    The CC is not preserved over function calls on the ARM 6, so it is 
-   easier to assume this for all.  SFP is preserved, since FP is. */
+   easier to assume this for all.  SFP is preserved, since FP is.  */
 #define CALL_USED_REGISTERS  \
 {                            \
   1,1,1,1,0,0,0,0,          \
   0,0,0,0,1,1,1,1,          \
   1,1,1,1,0,0,0,0,          \
-  1,1,1                             \
+  1,1,1,                    \
+  1,1,1,1,1,1,1,1,          \
+  1,1,1,1,1,1,1,1,          \
+  1,1,1,1,1,1,1,1,          \
+  1,1,1,1,1,1,1,1,          \
+  1,1,1,1,                  \
+  1,1,1,1,1,1,1,1,          \
+  1,1,1,1,1,1,1,1,          \
+  1,1,1,1,1,1,1,1,          \
+  1,1,1,1,1,1,1,1,          \
+  1                         \
 }
 
 #ifndef SUBTARGET_CONDITIONAL_REGISTER_USAGE
@@ -832,13 +1024,75 @@ extern const char * structure_size_string;
 {                                                              \
   int regno;                                                   \
                                                                \
-  if (TARGET_SOFT_FLOAT || TARGET_THUMB)                       \
+  if (TARGET_SOFT_FLOAT || TARGET_THUMB || !TARGET_FPA)                \
     {                                                          \
-      for (regno = FIRST_ARM_FP_REGNUM;                                \
-          regno <= LAST_ARM_FP_REGNUM; ++regno)                \
+      for (regno = FIRST_FPA_REGNUM;                           \
+          regno <= LAST_FPA_REGNUM; ++regno)                   \
        fixed_regs[regno] = call_used_regs[regno] = 1;          \
     }                                                          \
-  if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)               \
+                                                               \
+  if (TARGET_THUMB && optimize_size)                           \
+    {                                                          \
+      /* When optimizing for size, it's better not to use      \
+        the HI regs, because of the overhead of stacking       \
+        them.  */                                              \
+      for (regno = FIRST_HI_REGNUM;                            \
+          regno <= LAST_HI_REGNUM; ++regno)                    \
+       fixed_regs[regno] = call_used_regs[regno] = 1;          \
+    }                                                          \
+                                                               \
+  /* The link register can be clobbered by any branch insn,    \
+     but we have no way to track that at present, so mark      \
+     it as unavailable.  */                                    \
+  if (TARGET_THUMB)                                            \
+    fixed_regs[LR_REGNUM] = call_used_regs[LR_REGNUM] = 1;     \
+                                                               \
+  if (TARGET_ARM && TARGET_HARD_FLOAT)                         \
+    {                                                          \
+      if (TARGET_MAVERICK)                                     \
+       {                                                       \
+         for (regno = FIRST_FPA_REGNUM;                        \
+              regno <= LAST_FPA_REGNUM; ++ regno)              \
+           fixed_regs[regno] = call_used_regs[regno] = 1;      \
+         for (regno = FIRST_CIRRUS_FP_REGNUM;                  \
+              regno <= LAST_CIRRUS_FP_REGNUM; ++ regno)        \
+           {                                                   \
+             fixed_regs[regno] = 0;                            \
+             call_used_regs[regno] = regno < FIRST_CIRRUS_FP_REGNUM + 4; \
+           }                                                   \
+       }                                                       \
+      if (TARGET_VFP)                                          \
+       {                                                       \
+         for (regno = FIRST_VFP_REGNUM;                        \
+              regno <= LAST_VFP_REGNUM; ++ regno)              \
+           {                                                   \
+             fixed_regs[regno] = 0;                            \
+             call_used_regs[regno] = regno < FIRST_VFP_REGNUM + 16; \
+           }                                                   \
+       }                                                       \
+    }                                                          \
+                                                               \
+  if (TARGET_REALLY_IWMMXT)                                    \
+    {                                                          \
+      regno = FIRST_IWMMXT_GR_REGNUM;                          \
+      /* The 2002/10/09 revision of the XScale ABI has wCG0     \
+         and wCG1 as call-preserved registers.  The 2002/11/21  \
+         revision changed this so that all wCG registers are    \
+         scratch registers.  */                                        \
+      for (regno = FIRST_IWMMXT_GR_REGNUM;                     \
+          regno <= LAST_IWMMXT_GR_REGNUM; ++ regno)            \
+       fixed_regs[regno] = call_used_regs[regno] = 0;          \
+      /* The XScale ABI has wR0 - wR9 as scratch registers,     \
+        the rest as call-preserved registers.  */              \
+      for (regno = FIRST_IWMMXT_REGNUM;                                \
+          regno <= LAST_IWMMXT_REGNUM; ++ regno)               \
+       {                                                       \
+         fixed_regs[regno] = 0;                                \
+         call_used_regs[regno] = regno < FIRST_IWMMXT_REGNUM + 10; \
+       }                                                       \
+    }                                                          \
+                                                               \
+  if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)    \
     {                                                          \
       fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;                 \
       call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;             \
@@ -856,7 +1110,7 @@ extern const char * structure_size_string;
   SUBTARGET_CONDITIONAL_REGISTER_USAGE                         \
 }
     
-/* These are a couple of extensions to the formats accecpted
+/* These are a couple of extensions to the formats accepted
    by asm_fprintf:
      %@ prints out ASM_COMMENT_START
      %r prints out REGISTER_PREFIX reg_names[arg]  */
@@ -871,48 +1125,38 @@ extern const char * structure_size_string;
     break;
 
 /* Round X up to the nearest word.  */
-#define ROUND_UP(X) (((X) + 3) & ~3)
+#define ROUND_UP_WORD(X) (((X) + 3) & ~3)
 
 /* Convert fron bytes to ints.  */
-#define NUM_INTS(X) (((X) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
+#define ARM_NUM_INTS(X) (((X) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
 
-/* The number of (integer) registers required to hold a quantity of type MODE.  */
-#define NUM_REGS(MODE)                         \
-  NUM_INTS (GET_MODE_SIZE (MODE))
+/* The number of (integer) registers required to hold a quantity of type MODE.
+   Also used for VFP registers.  */
+#define ARM_NUM_REGS(MODE)                             \
+  ARM_NUM_INTS (GET_MODE_SIZE (MODE))
 
 /* The number of (integer) registers required to hold a quantity of TYPE MODE.  */
-#define NUM_REGS2(MODE, TYPE)                   \
-  NUM_INTS ((MODE) == BLKmode ?                \
+#define ARM_NUM_REGS2(MODE, TYPE)                   \
+  ARM_NUM_INTS ((MODE) == BLKmode ?            \
   int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE))
 
 /* The number of (integer) argument register available.  */
 #define NUM_ARG_REGS           4
 
-/* Return the regiser number of the N'th (integer) argument.  */
+/* Return the register number of the N'th (integer) argument.  */
 #define ARG_REGISTER(N)        (N - 1)
 
-#if 0 /* FIXME: The ARM backend has special code to handle structure
-        returns, and will reserve its own hidden first argument.  So
-        if this macro is enabled a *second* hidden argument will be
-        reserved, which will break binary compatibility with old
-        toolchains and also thunk handling.  One day this should be
-        fixed.  */
-/* RTX for structure returns.  NULL means use a hidden first argument.  */
-#define STRUCT_VALUE           0
-#else
-/* Register in which address to store a structure value
-   is passed to a function.  */
-#define STRUCT_VALUE_REGNUM    ARG_REGISTER (1)
-#endif
-
 /* Specify the registers used for certain standard purposes.
    The values of these macros are register numbers.  */
 
 /* The number of the last argument register.  */
 #define LAST_ARG_REGNUM        ARG_REGISTER (NUM_ARG_REGS)
 
-/* The number of the last "lo" register (thumb).  */
+/* The numbers of the Thumb register ranges.  */
+#define FIRST_LO_REGNUM        0
 #define LAST_LO_REGNUM         7
+#define FIRST_HI_REGNUM                8
+#define LAST_HI_REGNUM         11
 
 /* The register that holds the return address in exception handlers.  */
 #define EXCEPTION_LR_REGNUM    2
@@ -928,7 +1172,7 @@ extern const char * structure_size_string;
    should point to a special register that we will make sure is eliminated.
 
    For the Thumb we have another problem.  The TPCS defines the frame pointer
-   as r11, and GCC belives that it is always possible to use the frame pointer
+   as r11, and GCC believes that it is always possible to use the frame pointer
    as base register for addressing purposes.  (See comments in
    find_reloads_address()).  But - the Thumb does not allow high registers,
    including r11, to be used as base address registers.  Hence our problem.
@@ -936,7 +1180,7 @@ extern const char * structure_size_string;
    The solution used here, and in the old thumb port is to use r7 instead of
    r11 as the hard frame pointer and to have special code to generate
    backtrace structures on the stack (if required to do so via a command line
-   option) using r11.  This is the only 'user visable' use of r11 as a frame
+   option) using r11.  This is the only 'user visible' use of r11 as a frame
    pointer.  */
 #define ARM_HARD_FRAME_POINTER_REGNUM  11
 #define THUMB_HARD_FRAME_POINTER_REGNUM         7
@@ -952,8 +1196,17 @@ extern const char * structure_size_string;
 #define STACK_POINTER_REGNUM   SP_REGNUM
 
 /* ARM floating pointer registers.  */
-#define FIRST_ARM_FP_REGNUM    16
-#define LAST_ARM_FP_REGNUM     23
+#define FIRST_FPA_REGNUM       16
+#define LAST_FPA_REGNUM        23
+
+#define FIRST_IWMMXT_GR_REGNUM 43
+#define LAST_IWMMXT_GR_REGNUM  46
+#define FIRST_IWMMXT_REGNUM    47
+#define LAST_IWMMXT_REGNUM     62
+#define IS_IWMMXT_REGNUM(REGNUM) \
+  (((REGNUM) >= FIRST_IWMMXT_REGNUM) && ((REGNUM) <= LAST_IWMMXT_REGNUM))
+#define IS_IWMMXT_GR_REGNUM(REGNUM) \
+  (((REGNUM) >= FIRST_IWMMXT_GR_REGNUM) && ((REGNUM) <= LAST_IWMMXT_GR_REGNUM))
 
 /* Base register for access to local variables of the function.  */
 #define FRAME_POINTER_REGNUM   25
@@ -961,8 +1214,21 @@ extern const char * structure_size_string;
 /* Base register for access to arguments of the function.  */
 #define ARG_POINTER_REGNUM     26
 
-/* The number of hard registers is 16 ARM + 8 FPU + 1 CC + 1 SFP.  */
-#define FIRST_PSEUDO_REGISTER  27
+#define FIRST_CIRRUS_FP_REGNUM 27
+#define LAST_CIRRUS_FP_REGNUM  42
+#define IS_CIRRUS_REGNUM(REGNUM) \
+  (((REGNUM) >= FIRST_CIRRUS_FP_REGNUM) && ((REGNUM) <= LAST_CIRRUS_FP_REGNUM))
+
+#define FIRST_VFP_REGNUM       63
+#define LAST_VFP_REGNUM                94
+#define IS_VFP_REGNUM(REGNUM) \
+  (((REGNUM) >= FIRST_VFP_REGNUM) && ((REGNUM) <= LAST_VFP_REGNUM))
+
+/* The number of hard registers is 16 ARM + 8 FPA + 1 CC + 1 SFP + 1 AFP.  */
+/* + 16 Cirrus registers take us up to 43.  */
+/* Intel Wireless MMX Technology registers add 16 + 4 more.  */
+/* VFP adds 32 + 1 more.  */
+#define FIRST_PSEUDO_REGISTER   96
 
 /* Value should be nonzero if functions must have frame pointers.
    Zero means the frame pointer need not be set up (and parms may be accessed
@@ -979,14 +1245,15 @@ extern const char * structure_size_string;
    This is ordinarily the length in words of a value of mode MODE
    but can be less for certain modes in special long registers.
 
-   On the ARM regs are UNITS_PER_WORD bits wide; FPU regs can hold any FP
+   On the ARM regs are UNITS_PER_WORD bits wide; FPA regs can hold any FP
    mode.  */
 #define HARD_REGNO_NREGS(REGNO, MODE)          \
   ((TARGET_ARM                                 \
-    && REGNO >= FIRST_ARM_FP_REGNUM    \
+    && REGNO >= FIRST_FPA_REGNUM       \
     && REGNO != FRAME_POINTER_REGNUM   \
     && REGNO != ARG_POINTER_REGNUM)    \
-   ? 1 : NUM_REGS (MODE))
+    && !IS_VFP_REGNUM (REGNO)          \
+   ? 1 : ARM_NUM_REGS (MODE))
 
 /* Return true if REGNO is suitable for holding a quantity of type MODE.  */
 #define HARD_REGNO_MODE_OK(REGNO, MODE)                                        \
@@ -999,18 +1266,35 @@ extern const char * structure_size_string;
 #define MODES_TIEABLE_P(MODE1, MODE2)  \
   (GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2))
 
+#define VECTOR_MODE_SUPPORTED_P(MODE) \
+ ((MODE) == V2SImode || (MODE) == V4HImode || (MODE) == V8QImode)
+
+#define VALID_IWMMXT_REG_MODE(MODE) \
+ (VECTOR_MODE_SUPPORTED_P (MODE) || (MODE) == DImode)
+
 /* The order in which register should be allocated.  It is good to use ip
    since no saving is required (though calls clobber it) and it never contains
    function parameters.  It is quite good to use lr since other calls may
    clobber it anyway.  Allocate r0 through r3 in reverse order since r3 is 
    least likely to contain a function parameter; in addition results are
    returned in r0.  */
+
 #define REG_ALLOC_ORDER            \
 {                                   \
      3,  2,  1,  0, 12, 14,  4,  5, \
      6,  7,  8, 10,  9, 11, 13, 15, \
     16, 17, 18, 19, 20, 21, 22, 23, \
-    24, 25, 26                     \
+    27, 28, 29, 30, 31, 32, 33, 34, \
+    35, 36, 37, 38, 39, 40, 41, 42, \
+    43, 44, 45, 46, 47, 48, 49, 50, \
+    51, 52, 53, 54, 55, 56, 57, 58, \
+    59, 60, 61, 62,                \
+    24, 25, 26,                            \
+    78, 77, 76, 75, 74, 73, 72, 71, \
+    70, 69, 68, 67, 66, 65, 64, 63, \
+    79, 80, 81, 82, 83, 84, 85, 86, \
+    87, 88, 89, 90, 91, 92, 93, 94, \
+    95                             \
 }
 
 /* Interrupt functions can only use registers that have already been
@@ -1022,17 +1306,22 @@ extern const char * structure_size_string;
 \f
 /* Register and constant classes.  */
 
-/* Register classes: used to be simple, just all ARM regs or all FPU regs
+/* Register classes: used to be simple, just all ARM regs or all FPA regs
    Now that the Thumb is involved it has become more complicated.  */
 enum reg_class
 {
   NO_REGS,
-  FPU_REGS,
+  FPA_REGS,
+  CIRRUS_REGS,
+  VFP_REGS,
+  IWMMXT_GR_REGS,
+  IWMMXT_REGS,
   LO_REGS,
   STACK_REG,
   BASE_REGS,
   HI_REGS,
   CC_REG,
+  VFPCC_REG,
   GENERAL_REGS,
   ALL_REGS,
   LIM_REG_CLASSES
@@ -1040,16 +1329,21 @@ enum reg_class
 
 #define N_REG_CLASSES  (int) LIM_REG_CLASSES
 
-/* Give names of register classes as strings for dump file.   */
+/* Give names of register classes as strings for dump file.  */
 #define REG_CLASS_NAMES  \
 {                      \
   "NO_REGS",           \
-  "FPU_REGS",          \
+  "FPA_REGS",          \
+  "CIRRUS_REGS",       \
+  "VFP_REGS",          \
+  "IWMMXT_GR_REGS",    \
+  "IWMMXT_REGS",       \
   "LO_REGS",           \
   "STACK_REG",         \
   "BASE_REGS",         \
   "HI_REGS",           \
   "CC_REG",            \
+  "VFPCC_REG",         \
   "GENERAL_REGS",      \
   "ALL_REGS",          \
 }
@@ -1057,17 +1351,22 @@ enum reg_class
 /* Define which registers fit in which classes.
    This is an initializer for a vector of HARD_REG_SET
    of length N_REG_CLASSES.  */
-#define REG_CLASS_CONTENTS             \
-{                                      \
-  { 0x0000000 }, /* NO_REGS  */                \
-  { 0x0FF0000 }, /* FPU_REGS */                \
-  { 0x00000FF }, /* LO_REGS */         \
-  { 0x0002000 }, /* STACK_REG */       \
-  { 0x00020FF }, /* BASE_REGS */       \
-  { 0x000FF00 }, /* HI_REGS */         \
-  { 0x1000000 }, /* CC_REG */          \
-  { 0x200FFFF }, /* GENERAL_REGS */    \
-  { 0x2FFFFFF }  /* ALL_REGS */                \
+#define REG_CLASS_CONTENTS                                     \
+{                                                              \
+  { 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS  */       \
+  { 0x00FF0000, 0x00000000, 0x00000000 }, /* FPA_REGS */       \
+  { 0xF8000000, 0x000007FF, 0x00000000 }, /* CIRRUS_REGS */    \
+  { 0x00000000, 0x80000000, 0x7FFFFFFF }, /* VFP_REGS  */      \
+  { 0x00000000, 0x00007800, 0x00000000 }, /* IWMMXT_GR_REGS */ \
+  { 0x00000000, 0x7FFF8000, 0x00000000 }, /* IWMMXT_REGS */    \
+  { 0x000000FF, 0x00000000, 0x00000000 }, /* LO_REGS */                \
+  { 0x00002000, 0x00000000, 0x00000000 }, /* STACK_REG */      \
+  { 0x000020FF, 0x00000000, 0x00000000 }, /* BASE_REGS */      \
+  { 0x0000FF00, 0x00000000, 0x00000000 }, /* HI_REGS */                \
+  { 0x01000000, 0x00000000, 0x00000000 }, /* CC_REG */         \
+  { 0x00000000, 0x00000000, 0x80000000 }, /* VFPCC_REG */      \
+  { 0x0200FFFF, 0x00000000, 0x00000000 }, /* GENERAL_REGS */   \
+  { 0xFAFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF }  /* ALL_REGS */       \
 }
 
 /* The same information, inverted:
@@ -1076,28 +1375,43 @@ enum reg_class
    or could index an array.  */
 #define REGNO_REG_CLASS(REGNO)  arm_regno_class (REGNO)
 
+/* FPA registers can't do subreg as all values are reformatted to internal
+   precision.  VFP registers may only be accessed in the mode they
+   were set.  */
+#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)      \
+  (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)          \
+   ? reg_classes_intersect_p (FPA_REGS, (CLASS))       \
+     || reg_classes_intersect_p (VFP_REGS, (CLASS))    \
+   : 0)
+
 /* The class value for index registers, and the one for base regs.  */
 #define INDEX_REG_CLASS  (TARGET_THUMB ? LO_REGS : GENERAL_REGS)
-#define BASE_REG_CLASS   (TARGET_THUMB ? BASE_REGS : GENERAL_REGS)
+#define BASE_REG_CLASS   (TARGET_THUMB ? LO_REGS : GENERAL_REGS)
 
-/* For the Thumb the high registers cannot be used as base
-   registers when addressing quanitities in QI or HI mode.  */
+/* For the Thumb the high registers cannot be used as base registers
+   when addressing quantities in QI or HI mode; if we don't know the
+   mode, then we must be conservative.  After reload we must also be
+   conservative, since we can't support SP+reg addressing, and we
+   can't fix up any bad substitutions.  */
 #define MODE_BASE_REG_CLASS(MODE)                                      \
-    (TARGET_ARM ? BASE_REGS :                                          \
-     (((MODE) == QImode || (MODE) == HImode || (MODE) == VOIDmode)     \
-     ? LO_REGS : BASE_REGS))
+    (TARGET_ARM ? GENERAL_REGS :                                       \
+     (((MODE) == SImode && !reload_completed) ? BASE_REGS : LO_REGS))
 
 /* When SMALL_REGISTER_CLASSES is nonzero, the compiler allows
    registers explicitly used in the rtl to be used as spill registers
    but prevents the compiler from extending the lifetime of these
-   registers. */
+   registers.  */
 #define SMALL_REGISTER_CLASSES   TARGET_THUMB
 
 /* Get reg_class from a letter such as appears in the machine description.
-   We only need constraint `f' for FPU_REGS (`r' == GENERAL_REGS) for the
+   We only need constraint `f' for FPA_REGS (`r' == GENERAL_REGS) for the
    ARM, but several more letters for the Thumb.  */
 #define REG_CLASS_FROM_LETTER(C)       \
-  (  (C) == 'f' ? FPU_REGS             \
+  (  (C) == 'f' ? FPA_REGS             \
+   : (C) == 'v' ? CIRRUS_REGS          \
+   : (C) == 'w' ? VFP_REGS             \
+   : (C) == 'y' ? IWMMXT_REGS          \
+   : (C) == 'z' ? IWMMXT_GR_REGS       \
    : (C) == 'l' ? (TARGET_ARM ? GENERAL_REGS : LO_REGS)        \
    : TARGET_ARM ? NO_REGS              \
    : (C) == 'h' ? HI_REGS              \
@@ -1140,11 +1454,11 @@ enum reg_class
   (TARGET_ARM ?                                                                \
    CONST_OK_FOR_ARM_LETTER (VALUE, C) : CONST_OK_FOR_THUMB_LETTER (VALUE, C))
      
-/* Constant letter 'G' for the FPU immediate constants. 
+/* Constant letter 'G' for the FP immediate constants.
    'H' means the same constant negated.  */
 #define CONST_DOUBLE_OK_FOR_ARM_LETTER(X, C)                   \
-    ((C) == 'G' ? const_double_rtx_ok_for_fpu (X) :            \
-     (C) == 'H' ? neg_const_double_rtx_ok_for_fpu (X) : 0)
+    ((C) == 'G' ? arm_const_double_rtx (X) :                   \
+     (C) == 'H' ? neg_const_double_rtx_ok_for_fpa (X) : 0)
 
 #define CONST_DOUBLE_OK_FOR_LETTER_P(X, C)                     \
   (TARGET_ARM ?                                                        \
@@ -1154,23 +1468,37 @@ enum reg_class
    an offset from a register.  
    `S' means any symbol that has the SYMBOL_REF_FLAG set or a CONSTANT_POOL
    address.  This means that the symbol is in the text segment and can be
-   accessed without using a load. */
-
-#define EXTRA_CONSTRAINT_ARM(OP, C)                                        \
-  ((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG :    \
-   (C) == 'R' ? (GET_CODE (OP) == MEM                                      \
-                && GET_CODE (XEXP (OP, 0)) == SYMBOL_REF                   \
-                && CONSTANT_POOL_ADDRESS_P (XEXP (OP, 0))) :               \
-   (C) == 'S' ? (optimize > 0 && CONSTANT_ADDRESS_P (OP))                  \
-   : 0)
+   accessed without using a load.
+   'U' Prefixes an extended memory constraint where:
+   'Uv' is an address valid for VFP load/store insns.  
+   'Uq' is an address valid for ldrsb.  */
+
+#define EXTRA_CONSTRAINT_STR_ARM(OP, C, STR)                   \
+  (((C) == 'Q') ? (GET_CODE (OP) == MEM                                \
+                && GET_CODE (XEXP (OP, 0)) == REG) :           \
+   ((C) == 'R') ? (GET_CODE (OP) == MEM                                \
+                  && GET_CODE (XEXP (OP, 0)) == SYMBOL_REF     \
+                  && CONSTANT_POOL_ADDRESS_P (XEXP (OP, 0))) : \
+   ((C) == 'S') ? (optimize > 0 && CONSTANT_ADDRESS_P (OP)) :  \
+   ((C) == 'T') ? cirrus_memory_offset (OP) :                  \
+   ((C) == 'U' && (STR)[1] == 'v') ? vfp_mem_operand (OP) :    \
+   ((C) == 'U' && (STR)[1] == 'q')                             \
+    ? arm_extendqisi_mem_op (OP, GET_MODE (OP))                        \
+      : 0)
+
+#define CONSTRAINT_LEN(C,STR)                          \
+  ((C) == 'U' ? 2 : DEFAULT_CONSTRAINT_LEN (C, STR))
 
 #define EXTRA_CONSTRAINT_THUMB(X, C)                                   \
   ((C) == 'Q' ? (GET_CODE (X) == MEM                                   \
                 && GET_CODE (XEXP (X, 0)) == LABEL_REF) : 0)
 
-#define EXTRA_CONSTRAINT(X, C)                                         \
-  (TARGET_ARM ?                                                                \
-   EXTRA_CONSTRAINT_ARM (X, C) : EXTRA_CONSTRAINT_THUMB (X, C))
+#define EXTRA_CONSTRAINT_STR(X, C, STR)                \
+  (TARGET_ARM                                  \
+   ? EXTRA_CONSTRAINT_STR_ARM (X, C, STR)      \
+   : EXTRA_CONSTRAINT_THUMB (X, C))
+
+#define EXTRA_MEMORY_CONSTRAINT(C, STR) ((C) == 'U')
 
 /* Given an rtx X being reloaded into a reg required to be
    in class CLASS, return the class of reg to actually use.
@@ -1199,20 +1527,36 @@ enum reg_class
    or out of a register in CLASS in MODE.  If it can be done directly,
    NO_REGS is returned.  */
 #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X)          \
-  (TARGET_ARM ?                                                        \
-   (((MODE) == HImode && ! arm_arch4 && true_regnum (X) == -1) \
+  /* Restrict which direct reloads are allowed for VFP regs.  */ \
+  ((TARGET_VFP && TARGET_HARD_FLOAT                            \
+    && (CLASS) == VFP_REGS)                                    \
+   ? vfp_secondary_reload_class (MODE, X)                      \
+   : TARGET_ARM                                                        \
+   ? (((MODE) == HImode && ! arm_arch4 && true_regnum (X) == -1) \
     ? GENERAL_REGS : NO_REGS)                                  \
    : THUMB_SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X))
    
-/* If we need to load shorts byte-at-a-time, then we need a scratch. */
+/* If we need to load shorts byte-at-a-time, then we need a scratch.  */
 #define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X)           \
+  /* Restrict which direct reloads are allowed for VFP regs.  */ \
+  ((TARGET_VFP && TARGET_HARD_FLOAT                            \
+    && (CLASS) == VFP_REGS)                                    \
+    ? vfp_secondary_reload_class (MODE, X) :                   \
+  /* Cannot load constants into Cirrus registers.  */          \
+   (TARGET_MAVERICK && TARGET_HARD_FLOAT                       \
+     && (CLASS) == CIRRUS_REGS                                 \
+     && (CONSTANT_P (X) || GET_CODE (X) == SYMBOL_REF))                \
+    ? GENERAL_REGS :                                           \
   (TARGET_ARM ?                                                        \
+   (((CLASS) == IWMMXT_REGS || (CLASS) == IWMMXT_GR_REGS)      \
+      && CONSTANT_P (X))                                       \
+   ? GENERAL_REGS :                                            \
    (((MODE) == HImode && ! arm_arch4 && TARGET_MMU_TRAPS       \
      && (GET_CODE (X) == MEM                                   \
         || ((GET_CODE (X) == REG || GET_CODE (X) == SUBREG)    \
             && true_regnum (X) == -1)))                        \
     ? GENERAL_REGS : NO_REGS)                                  \
-   : THUMB_SECONDARY_INPUT_RELOAD_CLASS (CLASS, MODE, X))
+   : THUMB_SECONDARY_INPUT_RELOAD_CLASS (CLASS, MODE, X)))
 
 /* Try a machine-dependent way of reloading an illegitimate address
    operand.  If we find one, push the reload and jump to WIN.  This
@@ -1233,10 +1577,14 @@ enum reg_class
          HOST_WIDE_INT val = INTVAL (XEXP (X, 1));                        \
          HOST_WIDE_INT low, high;                                         \
                                                                           \
-         if (MODE == DImode || (TARGET_SOFT_FLOAT && MODE == DFmode))     \
+         if (MODE == DImode || (TARGET_SOFT_FLOAT && TARGET_FPA           \
+                                && MODE == DFmode))                       \
            low = ((val & 0xf) ^ 0x8) - 0x8;                               \
+         else if (TARGET_MAVERICK && TARGET_HARD_FLOAT)                   \
+           /* Need to be careful, -256 is not a valid offset.  */         \
+           low = val >= 0 ? (val & 0xff) : -((-val) & 0xff);              \
          else if (MODE == SImode                                          \
-                  || (MODE == SFmode && TARGET_SOFT_FLOAT)                \
+                  || (MODE == SFmode && TARGET_SOFT_FLOAT && TARGET_FPA)  \
                   || ((MODE == HImode || MODE == QImode) && ! arm_arch4)) \
            /* Need to be careful, -4096 is not a valid offset.  */        \
            low = val >= 0 ? (val & 0xfff) : -((-val) & 0xfff);            \
@@ -1244,7 +1592,7 @@ enum reg_class
            /* Need to be careful, -256 is not a valid offset.  */         \
            low = val >= 0 ? (val & 0xff) : -((-val) & 0xff);              \
          else if (GET_MODE_CLASS (MODE) == MODE_FLOAT                     \
-                  && TARGET_HARD_FLOAT)                                   \
+                  && TARGET_HARD_FLOAT && TARGET_FPA)                     \
            /* Need to be careful, -1024 is not a valid offset.  */        \
            low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff);            \
          else                                                             \
@@ -1271,7 +1619,7 @@ enum reg_class
     }                                                                     \
   while (0)
 
-/* ??? If an HImode FP+large_offset address is converted to an HImode
+/* XXX If an HImode FP+large_offset address is converted to an HImode
    SP+large_offset address, then reload won't know how to fix it.  It sees
    only that SP isn't valid for HImode, and so reloads the SP into an index
    register, but the resulting address is still invalid because the offset
@@ -1286,7 +1634,7 @@ enum reg_class
       && GET_CODE (XEXP (X, 0)) == REG                                 \
       && XEXP (X, 0) == stack_pointer_rtx                              \
       && GET_CODE (XEXP (X, 1)) == CONST_INT                           \
-      && ! THUMB_LEGITIMATE_OFFSET (MODE, INTVAL (XEXP (X, 1))))       \
+      && ! thumb_legitimate_offset_p (MODE, INTVAL (XEXP (X, 1))))     \
     {                                                                  \
       rtx orig_X = X;                                                  \
       X = copy_rtx (X);                                                        \
@@ -1305,15 +1653,26 @@ enum reg_class
   
 /* Return the maximum number of consecutive registers
    needed to represent mode MODE in a register of class CLASS.
-   ARM regs are UNITS_PER_WORD bits while FPU regs can hold any FP mode */
+   ARM regs are UNITS_PER_WORD bits while FPA regs can hold any FP mode */
 #define CLASS_MAX_NREGS(CLASS, MODE)  \
-  ((CLASS) == FPU_REGS ? 1 : NUM_REGS (MODE))
+  (((CLASS) == FPA_REGS || (CLASS) == CIRRUS_REGS) ? 1 : ARM_NUM_REGS (MODE))
+
+/* If defined, gives a class of registers that cannot be used as the
+   operand of a SUBREG that changes the mode of the object illegally.  */
 
-/* Moves between FPU_REGS and GENERAL_REGS are two memory insns.  */
+/* Moves between FPA_REGS and GENERAL_REGS are two memory insns.  */
 #define REGISTER_MOVE_COST(MODE, FROM, TO)             \
   (TARGET_ARM ?                                                \
-   ((FROM) == FPU_REGS && (TO) != FPU_REGS ? 20 :      \
-    (FROM) != FPU_REGS && (TO) == FPU_REGS ? 20 : 2)   \
+   ((FROM) == FPA_REGS && (TO) != FPA_REGS ? 20 :      \
+    (FROM) != FPA_REGS && (TO) == FPA_REGS ? 20 :      \
+    (FROM) == VFP_REGS && (TO) != VFP_REGS ? 10 :  \
+    (FROM) != VFP_REGS && (TO) == VFP_REGS ? 10 :  \
+    (FROM) == IWMMXT_REGS && (TO) != IWMMXT_REGS ? 4 :  \
+    (FROM) != IWMMXT_REGS && (TO) == IWMMXT_REGS ? 4 :  \
+    (FROM) == IWMMXT_GR_REGS || (TO) == IWMMXT_GR_REGS ? 20 :  \
+    (FROM) == CIRRUS_REGS && (TO) != CIRRUS_REGS ? 20 :        \
+    (FROM) != CIRRUS_REGS && (TO) == CIRRUS_REGS ? 20 :        \
+   2)                                                  \
    :                                                   \
    ((FROM) == HI_REGS || (TO) == HI_REGS) ? 4 : 2)
 \f
@@ -1338,8 +1697,8 @@ enum reg_class
 /* If we generate an insn to push BYTES bytes,
    this says how many the stack pointer really advances by.  */
 /* The push insns do not do this rounding implicitly.
-   So don't define this. */
-/* #define PUSH_ROUNDING(NPUSHED)  ROUND_UP (NPUSHED) */
+   So don't define this.  */
+/* #define PUSH_ROUNDING(NPUSHED)  ROUND_UP_WORD (NPUSHED) */
 
 /* Define this if the maximum size of all the outgoing args is to be
    accumulated and pushed during the prologue.  The amount can be
@@ -1363,8 +1722,14 @@ enum reg_class
 /* Define how to find the value returned by a library function
    assuming the value has mode MODE.  */
 #define LIBCALL_VALUE(MODE)  \
-  (TARGET_ARM && TARGET_HARD_FLOAT && GET_MODE_CLASS (MODE) == MODE_FLOAT \
-   ? gen_rtx_REG (MODE, FIRST_ARM_FP_REGNUM) \
+  (TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA                       \
+   && GET_MODE_CLASS (MODE) == MODE_FLOAT                              \
+   ? gen_rtx_REG (MODE, FIRST_FPA_REGNUM)                              \
+   : TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK                        \
+     && GET_MODE_CLASS (MODE) == MODE_FLOAT                            \
+   ? gen_rtx_REG (MODE, FIRST_CIRRUS_FP_REGNUM)                        \
+   : TARGET_REALLY_IWMMXT && VECTOR_MODE_SUPPORTED_P (MODE)            \
+   ? gen_rtx_REG (MODE, FIRST_IWMMXT_REGNUM)                           \
    : gen_rtx_REG (MODE, ARG_REGISTER (1)))
 
 /* Define how to find the value returned by a function.
@@ -1376,18 +1741,23 @@ enum reg_class
 
 /* 1 if N is a possible register number for a function value.
    On the ARM, only r0 and f0 can return results.  */
+/* On a Cirrus chip, mvf0 can return results.  */
 #define FUNCTION_VALUE_REGNO_P(REGNO)  \
   ((REGNO) == ARG_REGISTER (1) \
-   || (TARGET_ARM && ((REGNO) == FIRST_ARM_FP_REGNUM) && TARGET_HARD_FLOAT))
+   || (TARGET_ARM && ((REGNO) == FIRST_CIRRUS_FP_REGNUM)               \
+       && TARGET_HARD_FLOAT && TARGET_MAVERICK)                                \
+   || (TARGET_ARM && ((REGNO) == FIRST_IWMMXT_REGNUM) && TARGET_IWMMXT) \
+   || (TARGET_ARM && ((REGNO) == FIRST_FPA_REGNUM)                     \
+       && TARGET_HARD_FLOAT && TARGET_FPA))
 
 /* How large values are returned */
 /* A C expression which can inhibit the returning of certain function values
-   in registers, based on the type of value. */
+   in registers, based on the type of value.  */
 #define RETURN_IN_MEMORY(TYPE) arm_return_in_memory (TYPE)
 
 /* Define DEFAULT_PCC_STRUCT_RETURN to 1 if all structure and union return
    values must be in memory.  On the ARM, they need only do so if larger
-   than a word, or if they contain elements offset from zero in the struct. */
+   than a word, or if they contain elements offset from zero in the struct.  */
 #define DEFAULT_PCC_STRUCT_RETURN 0
 
 /* Flags for the call/call_value rtl operations set up by function_arg.  */
@@ -1403,7 +1773,7 @@ enum reg_class
    Note value 7 is currently unassigned.  Also note that the interrupt
    function types all have bit 2 set, so that they can be tested for easily.
    Note that 0 is deliberately chosen for ARM_FT_UNKNOWN so that when the
-   machine_function structure is initialised (to zero) func_type will
+   machine_function structure is initialized (to zero) func_type will
    default to unknown.  This will force the first use of arm_current_func_type
    to call arm_compute_func_type.  */
 #define ARM_FT_UNKNOWN          0 /* Type has not yet been determined.  */
@@ -1421,7 +1791,7 @@ enum reg_class
 #define ARM_FT_INTERRUPT       (1 << 2) /* Note overlap with FT_ISR and above.  */
 #define ARM_FT_NAKED           (1 << 3) /* No prologue or epilogue.  */
 #define ARM_FT_VOLATILE                (1 << 4) /* Does not return.  */
-#define ARM_FT_NESTED          (1 << 5) /* Embedded inside another func. */
+#define ARM_FT_NESTED          (1 << 5) /* Embedded inside another func.  */
 
 /* Some macros to test these flags.  */
 #define ARM_FUNC_TYPE(t)       (t & ARM_FT_TYPE_MASK)
@@ -1432,20 +1802,25 @@ enum reg_class
 
 /* A C structure for machine-specific, per-function data.
    This is added to the cfun structure.  */
-typedef struct machine_function
+typedef struct machine_function GTY(())
 {
-  /* Additionsl stack adjustment in __builtin_eh_throw.  */
-  struct rtx_def *eh_epilogue_sp_ofs;
+  /* Additional stack adjustment in __builtin_eh_throw.  */
+  rtx eh_epilogue_sp_ofs;
   /* Records if LR has to be saved for far jumps.  */
   int far_jump_used;
   /* Records if ARG_POINTER was ever live.  */
   int arg_pointer_live;
   /* Records if the save of LR has been eliminated.  */
   int lr_save_eliminated;
+  /* The size of the stack frame.  Only valid after reload.  */
+  int frame_size;
   /* Records the type of the current function.  */
   unsigned long func_type;
   /* Record if the function has a variable argument list.  */
   int uses_anonymous_args;
+  /* Records if sibcalls are blocked because an argument
+     register is needed to preserve stack alignment.  */
+  int sibcall_blocked;
 }
 machine_function;
 
@@ -1456,7 +1831,11 @@ typedef struct
 {
   /* This is the number of registers of arguments scanned so far.  */
   int nregs;
-  /* One of CALL_NORMAL, CALL_LONG or CALL_SHORT . */
+  /* This is the number of iWMMXt register arguments scanned so far.  */
+  int iwmmxt_nregs;
+  int named_count;
+  int nargs;
+  /* One of CALL_NORMAL, CALL_LONG or CALL_SHORT.  */
   int call_cookie;
 } CUMULATIVE_ARGS;
 
@@ -1475,9 +1854,9 @@ typedef struct
 
    On the ARM, normally the first 16 bytes are passed in registers r0-r3; all
    other arguments are passed on the stack.  If (NAMED == 0) (which happens
-   only in assign_parms, since SETUP_INCOMING_VARARGS is defined), say it is
-   passed in the stack (function_prologue will indeed make it pass in the
-   stack if necessary).  */
+   only in assign_parms, since TARGET_SETUP_INCOMING_VARARGS is
+   defined), say it is passed in the stack (function_prologue will
+   indeed make it pass in the stack if necessary).  */
 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
   arm_function_arg (&(CUM), (MODE), (TYPE), (NAMED))
 
@@ -1485,54 +1864,57 @@ typedef struct
    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)     \
-  (    NUM_ARG_REGS > (CUM).nregs                              \
-   && (NUM_ARG_REGS < ((CUM).nregs + NUM_REGS2 (MODE, TYPE)))  \
+  (VECTOR_MODE_SUPPORTED_P (MODE) ? 0 :                                \
+       NUM_ARG_REGS > (CUM).nregs                              \
+   && (NUM_ARG_REGS < ((CUM).nregs + ARM_NUM_REGS2 (MODE, TYPE)))      \
    ?   NUM_ARG_REGS - (CUM).nregs : 0)
 
+/* 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) \
+  arm_function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED)
+
 /* 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.
    On the ARM, the offset starts at 0.  */
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
-  arm_init_cumulative_args (&(CUM), (FNTYPE), (LIBNAME), (INDIRECT))
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
+  arm_init_cumulative_args (&(CUM), (FNTYPE), (LIBNAME), (FNDECL))
 
 /* 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)   \
-  (CUM).nregs += NUM_REGS2 (MODE, TYPE)
+  (CUM).nargs += 1;                                    \
+  if (VECTOR_MODE_SUPPORTED_P (MODE))                  \
+     if ((CUM).named_count <= (CUM).nargs)             \
+        (CUM).nregs += 2;                              \
+     else                                              \
+        (CUM).iwmmxt_nregs += 1;                       \
+  else                                                 \
+  (CUM).nregs += ARM_NUM_REGS2 (MODE, TYPE)
+
+/* If defined, a C expression that gives the alignment boundary, in bits, of an
+   argument with the specified mode and type.  If it is not defined,
+   `PARM_BOUNDARY' is used for all arguments.  */
+#define FUNCTION_ARG_BOUNDARY(MODE,TYPE) \
+  (TARGET_REALLY_IWMMXT && (VALID_IWMMXT_REG_MODE (MODE) || ((MODE) == DFmode)) \
+   ? IWMMXT_ALIGNMENT : PARM_BOUNDARY)
 
 /* 1 if N is a possible register number for function argument passing.
    On the ARM, r0-r3 are used to pass args.  */
-#define FUNCTION_ARG_REGNO_P(REGNO)    (IN_RANGE ((REGNO), 0, 3))
+#define FUNCTION_ARG_REGNO_P(REGNO)    \
+   (IN_RANGE ((REGNO), 0, 3)           \
+    || (TARGET_REALLY_IWMMXT && IN_RANGE ((REGNO), FIRST_IWMMXT_REGNUM, FIRST_IWMMXT_REGNUM + 9)))
 
-\f
-/* Tail calling.  */
-
-/* A C expression that evaluates to true if it is ok to perform a sibling
-   call to DECL.  */
-#define FUNCTION_OK_FOR_SIBCALL(DECL) arm_function_ok_for_sibcall ((DECL))
-
-/* Perform any actions needed for a function that is receiving a variable
-   number of arguments.  CUM is as above.  MODE and TYPE are the mode and type
-   of the current parameter.  PRETEND_SIZE is a variable that should be set to
-   the amount of stack that must be pushed by the prolog to pretend that our
-   caller pushed it.
-
-   Normally, this macro will push all remaining incoming registers on the
-   stack and set PRETEND_SIZE to the length of the registers pushed.
-
-   On the ARM, PRETEND_SIZE is set in order to have the prologue push the last
-   named arg and all anonymous args onto the stack.
-   XXX I know the prologue shouldn't be pushing registers, but it is faster
-   that way.  */
-#define SETUP_INCOMING_VARARGS(CUM, MODE, TYPE, PRETEND_SIZE, NO_RTL)  \
-{                                                                      \
-  cfun->machine->uses_anonymous_args = 1;                              \
-  if ((CUM).nregs < NUM_ARG_REGS)                                      \
-    (PRETEND_SIZE) = (NUM_ARG_REGS - (CUM).nregs) * UNITS_PER_WORD;    \
-}
+/* Implement `va_arg'.  */
+#define EXPAND_BUILTIN_VA_ARG(valist, type) \
+  arm_va_arg (valist, type)
 
+\f
 /* If your target environment doesn't prefix user functions with an
    underscore, you may wish to re-define this to prevent any conflicts.
    e.g. AOF may prefix mcount with an underscore.  */
@@ -1555,7 +1937,10 @@ typedef struct
    will output the .text section.
 
    The ``mov ip,lr'' seems like a good idea to stick with cc convention.
-   ``prof'' doesn't seem to mind about this!  */
+   ``prof'' doesn't seem to mind about this!
+
+   Note - this version of the code is designed to work in both ARM and
+   Thumb modes.  */
 #ifndef ARM_FUNCTION_PROFILER
 #define ARM_FUNCTION_PROFILER(STREAM, LABELNO)         \
 {                                                      \
@@ -1567,25 +1952,21 @@ typedef struct
   assemble_name (STREAM, ARM_MCOUNT_NAME);             \
   fputc ('\n', STREAM);                                        \
   ASM_GENERATE_INTERNAL_LABEL (temp, "LP", LABELNO);   \
-  sym = gen_rtx (SYMBOL_REF, Pmode, temp);             \
+  sym = gen_rtx_SYMBOL_REF (Pmode, temp);              \
   assemble_aligned_integer (UNITS_PER_WORD, sym);      \
 }
 #endif
 
-#ifndef THUMB_FUNCTION_PROFILER
-#define THUMB_FUNCTION_PROFILER(STREAM, LABELNO)       \
-{                                                      \
-  fprintf (STREAM, "\tmov\tip, lr\n");                 \
-  fprintf (STREAM, "\tbl\tmcount\n");                  \
-  fprintf (STREAM, "\t.word\tLP%d\n", LABELNO);                \
-}
-#endif
-
+#ifdef THUMB_FUNCTION_PROFILER
 #define FUNCTION_PROFILER(STREAM, LABELNO)             \
   if (TARGET_ARM)                                      \
     ARM_FUNCTION_PROFILER (STREAM, LABELNO)            \
   else                                                 \
     THUMB_FUNCTION_PROFILER (STREAM, LABELNO)
+#else
+#define FUNCTION_PROFILER(STREAM, LABELNO)             \
+    ARM_FUNCTION_PROFILER (STREAM, LABELNO)
+#endif
 
 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
    the stack pointer does not matter.  The value is tested only in
@@ -1601,7 +1982,7 @@ typedef struct
 /* Determine if the epilogue should be output as RTL.
    You should override this if you define FUNCTION_EXTRA_EPILOGUE.  */
 #define USE_RETURN_INSN(ISCOND)                                \
-  (TARGET_ARM ? use_return_insn (ISCOND) : 0)
+  (TARGET_ARM ? use_return_insn (ISCOND, NULL) : 0)
 
 /* Definitions for register eliminations.
 
@@ -1640,7 +2021,13 @@ typedef struct
    ((TO) == ARM_HARD_FRAME_POINTER_REGNUM && TARGET_THUMB) ? 0 :       \
    ((TO) == THUMB_HARD_FRAME_POINTER_REGNUM && TARGET_ARM) ? 0 :       \
    1)
-                                                                
+
+#define THUMB_REG_PUSHED_P(reg)                                        \
+  (regs_ever_live [reg]                                                \
+   && (! call_used_regs [reg]                                  \
+       || (flag_pic && (reg) == PIC_OFFSET_TABLE_REGNUM))      \
+   && !(TARGET_SINGLE_PIC_BASE && ((reg) == arm_pic_register)))
+     
 /* Define the offset between two registers, one to be eliminated, and the
    other its replacement, at the start of a routine.  */
 #define ARM_INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET)               \
@@ -1659,13 +2046,13 @@ typedef struct
       int count_regs = 0;                                              \
       int regno;                                                       \
       for (regno = 8; regno < 13; regno ++)                            \
-       if (regs_ever_live[regno] && ! call_used_regs[regno])           \
-         count_regs ++;                                                \
+        if (THUMB_REG_PUSHED_P (regno))                                        \
+          count_regs ++;                                               \
       if (count_regs)                                                  \
        (OFFSET) += 4 * count_regs;                                     \
       count_regs = 0;                                                  \
       for (regno = 0; regno <= LAST_LO_REGNUM; regno ++)               \
-       if (regs_ever_live[regno] && ! call_used_regs[regno])           \
+        if (THUMB_REG_PUSHED_P (regno))                                        \
          count_regs ++;                                                \
       if (count_regs || ! leaf_function_p () || thumb_far_jump_used_p (0))\
        (OFFSET) += 4 * (count_regs + 1);                               \
@@ -1680,7 +2067,7 @@ typedef struct
   if ((TO) == STACK_POINTER_REGNUM)                                    \
     {                                                                  \
       (OFFSET) += current_function_outgoing_args_size;                 \
-      (OFFSET) += ROUND_UP (get_frame_size ());                                \
+      (OFFSET) += thumb_get_frame_size ();                             \
      }                                                                 \
 }
 
@@ -1706,7 +2093,7 @@ typedef struct
           ldr          pc, [pc]
           .word        static chain value
           .word        function's address
-   ??? FIXME: When the trampoline returns, r8 will be clobbered.  */
+   XXX FIXME: When the trampoline returns, r8 will be clobbered.  */
 #define ARM_TRAMPOLINE_TEMPLATE(FILE)                          \
 {                                                              \
   asm_fprintf (FILE, "\tldr\t%r, [%r, #0]\n",                  \
@@ -1755,20 +2142,30 @@ typedef struct
 /* Emit RTL insns to initialize the variable parts of a trampoline.
    FNADDR is an RTX for the address of the function's pure code.
    CXT is an RTX for the static chain value for the function.  */
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT)                                      \
-{                                                                                      \
-  emit_move_insn                                                                       \
-    (gen_rtx_MEM (SImode, plus_constant (TRAMP, TARGET_ARM ? 8 : 16)), CXT);           \
-  emit_move_insn                                                                       \
-    (gen_rtx_MEM (SImode, plus_constant (TRAMP, TARGET_ARM ? 12 : 20)),        FNADDR);        \
+#ifndef INITIALIZE_TRAMPOLINE
+#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT)                      \
+{                                                                      \
+  emit_move_insn (gen_rtx_MEM (SImode,                                 \
+                              plus_constant (TRAMP,                    \
+                                             TARGET_ARM ? 8 : 16)),    \
+                 CXT);                                                 \
+  emit_move_insn (gen_rtx_MEM (SImode,                                 \
+                              plus_constant (TRAMP,                    \
+                                             TARGET_ARM ? 12 : 20)),   \
+                 FNADDR);                                              \
 }
+#endif
 
 \f
 /* Addressing modes, and classification of registers for them.  */
-#define HAVE_POST_INCREMENT  1
-#define HAVE_PRE_INCREMENT   TARGET_ARM
-#define HAVE_POST_DECREMENT  TARGET_ARM
-#define HAVE_PRE_DECREMENT   TARGET_ARM
+#define HAVE_POST_INCREMENT   1
+#define HAVE_PRE_INCREMENT    TARGET_ARM
+#define HAVE_POST_DECREMENT   TARGET_ARM
+#define HAVE_PRE_DECREMENT    TARGET_ARM
+#define HAVE_PRE_MODIFY_DISP  TARGET_ARM
+#define HAVE_POST_MODIFY_DISP TARGET_ARM
+#define HAVE_PRE_MODIFY_REG   TARGET_ARM
+#define HAVE_POST_MODIFY_REG  TARGET_ARM
 
 /* Macros to check register numbers against specific register classes.  */
 
@@ -1776,7 +2173,7 @@ typedef struct
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c. */
+   has been allocated, which happens in local-alloc.c.  */
 #define TEST_REGNO(R, TEST, VALUE) \
   ((R TEST VALUE) || ((unsigned) reg_renumber[R] TEST VALUE))
 
@@ -1802,7 +2199,7 @@ typedef struct
   REGNO_MODE_OK_FOR_BASE_P (REGNO, QImode)
 
 /* Maximum number of registers that can appear in a valid memory address.
-   Shifts in addresses can't be by a register. */
+   Shifts in addresses can't be by a register.  */
 #define MAX_REGS_PER_ADDRESS 2
 
 /* Recognize any constant value that is a valid address.  */
@@ -1835,6 +2232,7 @@ typedef struct
 #define THUMB_LEGITIMATE_CONSTANT_P(X) \
  (   GET_CODE (X) == CONST_INT         \
   || GET_CODE (X) == CONST_DOUBLE      \
+  || GET_CODE (X) == CONSTANT_P_RTX     \
   || CONSTANT_ADDRESS_P (X)            \
   || flag_pic)
 
@@ -1857,7 +2255,7 @@ typedef struct
 #define SUBTARGET_NAME_ENCODING_LENGTHS
 #endif
 
-/* This is a C fragement for the inside of a switch statement.
+/* This is a C fragment for the inside of a switch statement.
    Each case label should return the number of characters to
    be stripped from the start of a function's name, if that
    name starts with the indicated character.  */
@@ -1867,58 +2265,11 @@ typedef struct
   case '*':  return 1;                         \
   SUBTARGET_NAME_ENCODING_LENGTHS              
 
-/* This has to be handled by a function because more than part of the
-   ARM backend uses function name prefixes to encode attributes.  */
-#undef  STRIP_NAME_ENCODING
-#define STRIP_NAME_ENCODING(VAR, SYMBOL_NAME)  \
-  (VAR) = arm_strip_name_encoding (SYMBOL_NAME)
-
 /* This is how to output a reference to a user-level label named NAME.
    `assemble_name' uses this.  */
 #undef  ASM_OUTPUT_LABELREF
 #define ASM_OUTPUT_LABELREF(FILE, NAME)                \
-  asm_fprintf (FILE, "%U%s", arm_strip_name_encoding (NAME))
-
-/* If we are referencing a function that is weak then encode a long call
-   flag in the function name, otherwise if the function is static or
-   or known to be defined in this file then encode a short call flag.
-   This macro is used inside the ENCODE_SECTION macro.  */
-#define ARM_ENCODE_CALL_TYPE(decl)                                     \
-  if (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd')                       \
-    {                                                                  \
-      if (TREE_CODE (decl) == FUNCTION_DECL && DECL_WEAK (decl))       \
-        arm_encode_call_attribute (decl, LONG_CALL_FLAG_CHAR);         \
-      else if (! TREE_PUBLIC (decl))                                   \
-        arm_encode_call_attribute (decl, SHORT_CALL_FLAG_CHAR);                \
-    }
-
-/* Symbols in the text segment can be accessed without indirecting via the
-   constant pool; it may take an extra binary operation, but this is still
-   faster than indirecting via memory.  Don't do this when not optimizing,
-   since we won't be calculating al of the offsets necessary to do this
-   simplification.  */
-/* This doesn't work with AOF syntax, since the string table may be in
-   a different AREA.  */
-#ifndef AOF_ASSEMBLER
-#define ENCODE_SECTION_INFO(decl, first)                               \
-{                                                                      \
-  if (optimize > 0 && TREE_CONSTANT (decl)                             \
-      && (!flag_writable_strings || TREE_CODE (decl) != STRING_CST))   \
-    {                                                                  \
-      rtx rtl = (TREE_CODE_CLASS (TREE_CODE (decl)) != 'd'             \
-                 ? TREE_CST_RTL (decl) : DECL_RTL (decl));             \
-      SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;                             \
-    }                                                                  \
-  if (first)                                                           \
-    ARM_ENCODE_CALL_TYPE (decl)                                                \
-}
-#else
-#define ENCODE_SECTION_INFO(decl, first)                               \
-{                                                                      \
-  if (first)                                                           \
-    ARM_ENCODE_CALL_TYPE (decl)                                                \
-}
-#endif
+   arm_asm_output_labelref (FILE, NAME)
 
 #define ARM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL)  \
   arm_encode_call_attribute (DECL, SHORT_CALL_FLAG_CHAR)
@@ -1945,6 +2296,8 @@ typedef struct
           || (X) == hard_frame_pointer_rtx     \
           || (X) == arg_pointer_rtx)))
 
+#define REG_STRICT_P 0
+
 #else /* REG_OK_STRICT */
 
 #define ARM_REG_OK_FOR_BASE_P(X)               \
@@ -1953,6 +2306,8 @@ typedef struct
 #define THUMB_REG_MODE_OK_FOR_BASE_P(X, MODE)  \
   THUMB_REGNO_MODE_OK_FOR_BASE_P (REGNO (X), MODE)
 
+#define REG_STRICT_P 1
+
 #endif /* REG_OK_STRICT */
 
 /* Now define some helpers in terms of the above.  */
@@ -1980,339 +2335,55 @@ typedef struct
 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
    that is a valid memory address for an instruction.
    The MODE argument is the machine mode for the MEM expression
-   that wants to use this address.
-
-   The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS. */
+   that wants to use this address.  */
      
-/* --------------------------------arm version----------------------------- */
 #define ARM_BASE_REGISTER_RTX_P(X)  \
   (GET_CODE (X) == REG && ARM_REG_OK_FOR_BASE_P (X))
 
 #define ARM_INDEX_REGISTER_RTX_P(X)  \
   (GET_CODE (X) == REG && ARM_REG_OK_FOR_INDEX_P (X))
 
-/* A C statement (sans semicolon) to jump to LABEL for legitimate index RTXs
-   used by the macro GO_IF_LEGITIMATE_ADDRESS.  Floating point indices can
-   only be small constants. */
-#define ARM_GO_IF_LEGITIMATE_INDEX(MODE, BASE_REGNO, INDEX, LABEL)     \
-  do                                                                   \
-    {                                                                  \
-      HOST_WIDE_INT range;                                             \
-      enum rtx_code code = GET_CODE (INDEX);                           \
-                                                                       \
-      if (TARGET_HARD_FLOAT && GET_MODE_CLASS (MODE) == MODE_FLOAT)    \
-       {                                                               \
-         if (code == CONST_INT && INTVAL (INDEX) < 1024                \
-             && INTVAL (INDEX) > -1024                                 \
-             && (INTVAL (INDEX) & 3) == 0)                             \
-           goto LABEL;                                                 \
-       }                                                               \
-      else                                                             \
-       {                                                               \
-         if (ARM_INDEX_REGISTER_RTX_P (INDEX)                          \
-             && GET_MODE_SIZE (MODE) <= 4)                             \
-           goto LABEL;                                                 \
-         if (GET_MODE_SIZE (MODE) <= 4  && code == MULT                \
-             && (! arm_arch4 || (MODE) != HImode))                     \
-           {                                                           \
-             rtx xiop0 = XEXP (INDEX, 0);                              \
-             rtx xiop1 = XEXP (INDEX, 1);                              \
-             if (ARM_INDEX_REGISTER_RTX_P (xiop0)                      \
-                 && power_of_two_operand (xiop1, SImode))              \
-               goto LABEL;                                             \
-             if (ARM_INDEX_REGISTER_RTX_P (xiop1)                      \
-                 && power_of_two_operand (xiop0, SImode))              \
-               goto LABEL;                                             \
-           }                                                           \
-         if (GET_MODE_SIZE (MODE) <= 4                                 \
-             && (code == LSHIFTRT || code == ASHIFTRT                  \
-                 || code == ASHIFT || code == ROTATERT)                \
-             && (! arm_arch4 || (MODE) != HImode))                     \
-           {                                                           \
-             rtx op = XEXP (INDEX, 1);                                 \
-             if (ARM_INDEX_REGISTER_RTX_P (XEXP (INDEX, 0))            \
-                 && GET_CODE (op) == CONST_INT && INTVAL (op) > 0      \
-                 && INTVAL (op) <= 31)                                 \
-               goto LABEL;                                             \
-           }                                                           \
-         /* NASTY: Since this limits the addressing of unsigned        \
-            byte loads.  */                                            \
-         range = ((MODE) == HImode || (MODE) == QImode)                \
-           ? (arm_arch4 ? 256 : 4095) : 4096;                          \
-         if (code == CONST_INT && INTVAL (INDEX) < range               \
-             && INTVAL (INDEX) > -range)                               \
-           goto LABEL;                                                 \
-       }                                                               \
-    }                                                                  \
-  while (0)
-
-/* Jump to LABEL if X is a valid address RTX.  This must take
-   REG_OK_STRICT into account when deciding about valid registers.
+#define ARM_GO_IF_LEGITIMATE_ADDRESS(MODE,X,WIN)               \
+  {                                                            \
+    if (arm_legitimate_address_p (MODE, X, SET, REG_STRICT_P)) \
+      goto WIN;                                                        \
+  }
 
-   Allow REG, REG+REG, REG+INDEX, INDEX+REG, REG-INDEX, and non
-   floating SYMBOL_REF to the constant pool.  Allow REG-only and
-   AUTINC-REG if handling TImode or HImode.  Other symbol refs must be
-   forced though a static cell to ensure addressability.  */
-#define ARM_GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)                   \
-{                                                                      \
-  if (ARM_BASE_REGISTER_RTX_P (X))                                     \
-    goto LABEL;                                                                \
-  else if ((GET_CODE (X) == POST_INC || GET_CODE (X) == PRE_DEC)       \
-          && GET_CODE (XEXP (X, 0)) == REG                             \
-          && ARM_REG_OK_FOR_BASE_P (XEXP (X, 0)))                      \
-    goto LABEL;                                                                \
-  else if (GET_MODE_SIZE (MODE) >= 4 && reload_completed               \
-          && (GET_CODE (X) == LABEL_REF                                \
-              || (GET_CODE (X) == CONST                                \
-                  && GET_CODE (XEXP ((X), 0)) == PLUS                  \
-                  && GET_CODE (XEXP (XEXP ((X), 0), 0)) == LABEL_REF   \
-                  && GET_CODE (XEXP (XEXP ((X), 0), 1)) == CONST_INT)))\
-    goto LABEL;                                                                \
-  else if ((MODE) == TImode)                                           \
-    ;                                                                  \
-  else if ((MODE) == DImode || (TARGET_SOFT_FLOAT && (MODE) == DFmode))        \
-    {                                                                  \
-      if (GET_CODE (X) == PLUS && ARM_BASE_REGISTER_RTX_P (XEXP (X, 0))        \
-         && GET_CODE (XEXP (X, 1)) == CONST_INT)                       \
-       {                                                               \
-         HOST_WIDE_INT val = INTVAL (XEXP (X, 1));                     \
-          if (val == 4 || val == -4 || val == -8)                      \
-           goto LABEL;                                                 \
-       }                                                               \
-    }                                                                  \
-  else if (GET_CODE (X) == PLUS)                                       \
-    {                                                                  \
-      rtx xop0 = XEXP (X, 0);                                          \
-      rtx xop1 = XEXP (X, 1);                                          \
-                                                                       \
-      if (ARM_BASE_REGISTER_RTX_P (xop0))                              \
-       ARM_GO_IF_LEGITIMATE_INDEX (MODE, REGNO (xop0), xop1, LABEL);   \
-      else if (ARM_BASE_REGISTER_RTX_P (xop1))                         \
-       ARM_GO_IF_LEGITIMATE_INDEX (MODE, REGNO (xop1), xop0, LABEL);   \
-    }                                                                  \
-  /* Reload currently can't handle MINUS, so disable this for now */   \
-  /* else if (GET_CODE (X) == MINUS)                                   \
-    {                                                                  \
-      rtx xop0 = XEXP (X,0);                                           \
-      rtx xop1 = XEXP (X,1);                                           \
-                                                                       \
-      if (ARM_BASE_REGISTER_RTX_P (xop0))                              \
-       ARM_GO_IF_LEGITIMATE_INDEX (MODE, -1, xop1, LABEL);             \
-    } */                                                               \
-  else if (GET_MODE_CLASS (MODE) != MODE_FLOAT                         \
-          && GET_CODE (X) == SYMBOL_REF                                \
-          && CONSTANT_POOL_ADDRESS_P (X)                               \
-          && ! (flag_pic                                               \
-                && symbol_mentioned_p (get_pool_constant (X))))        \
-    goto LABEL;                                                                \
-  else if ((GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_DEC)       \
-          && (GET_MODE_SIZE (MODE) <= 4)                               \
-          && GET_CODE (XEXP (X, 0)) == REG                             \
-          && ARM_REG_OK_FOR_BASE_P (XEXP (X, 0)))                      \
-    goto LABEL;                                                                \
-}
-     
-/* ---------------------thumb version----------------------------------*/     
-#define THUMB_LEGITIMATE_OFFSET(MODE, VAL)                             \
-  (GET_MODE_SIZE (MODE) == 1 ? ((unsigned HOST_WIDE_INT) (VAL) < 32)   \
-   : GET_MODE_SIZE (MODE) == 2 ? ((unsigned HOST_WIDE_INT) (VAL) < 64  \
-                                 && ((VAL) & 1) == 0)                  \
-   : ((VAL) >= 0 && ((VAL) + GET_MODE_SIZE (MODE)) <= 128              \
-      && ((VAL) & 3) == 0))
-
-/* The AP may be eliminated to either the SP or the FP, so we use the
-   least common denominator, e.g. SImode, and offsets from 0 to 64.  */
-
-/* ??? Verify whether the above is the right approach.  */
-
-/* ??? Also, the FP may be eliminated to the SP, so perhaps that
-   needs special handling also.  */
-
-/* ??? Look at how the mips16 port solves this problem.  It probably uses
-   better ways to solve some of these problems.  */
-
-/* Although it is not incorrect, we don't accept QImode and HImode
-   addresses based on the frame pointer or arg pointer until the
-   reload pass starts.  This is so that eliminating such addresses
-   into stack based ones won't produce impossible code.  */
-#define THUMB_GO_IF_LEGITIMATE_ADDRESS(MODE, X, WIN)                   \
-{                                                                      \
-/* ??? Not clear if this is right.  Experiment.  */                    \
-  if (GET_MODE_SIZE (MODE) < 4                                         \
-      && ! (reload_in_progress || reload_completed)                    \
-      && (   reg_mentioned_p (frame_pointer_rtx, X)                    \
-         || reg_mentioned_p (arg_pointer_rtx, X)                       \
-         || reg_mentioned_p (virtual_incoming_args_rtx, X)             \
-         || reg_mentioned_p (virtual_outgoing_args_rtx, X)             \
-         || reg_mentioned_p (virtual_stack_dynamic_rtx, X)             \
-         || reg_mentioned_p (virtual_stack_vars_rtx, X)))              \
-    ;                                                                  \
-  /* Accept any base register.  SP only in SImode or larger.  */       \
-  else if (GET_CODE (X) == REG                                         \
-          && THUMB_REG_MODE_OK_FOR_BASE_P (X, MODE))                   \
-    goto WIN;                                                          \
-  /* This is PC relative data before MACHINE_DEPENDENT_REORG runs.  */ \
-  else if (GET_MODE_SIZE (MODE) >= 4 && CONSTANT_P (X)                 \
-          && CONSTANT_POOL_ADDRESS_P (X) && ! flag_pic)                \
-    goto WIN;                                                          \
-  /* This is PC relative data after MACHINE_DEPENDENT_REORG runs.  */  \
-  else if (GET_MODE_SIZE (MODE) >= 4 && reload_completed               \
-          && (GET_CODE (X) == LABEL_REF                                \
-              || (GET_CODE (X) == CONST                                \
-                  && GET_CODE (XEXP (X, 0)) == PLUS                    \
-                  && GET_CODE (XEXP (XEXP (X, 0), 0)) == LABEL_REF     \
-                  && GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT)))  \
-    goto WIN;                                                          \
-  /* Post-inc indexing only supported for SImode and larger.  */       \
-  else if (GET_CODE (X) == POST_INC && GET_MODE_SIZE (MODE) >= 4       \
-          && GET_CODE (XEXP (X, 0)) == REG                             \
-          && THUMB_REG_OK_FOR_INDEX_P (XEXP (X, 0)))                   \
-    goto WIN;                                                          \
-  else if (GET_CODE (X) == PLUS)                                       \
-    {                                                                  \
-      /* REG+REG address can be any two index registers.  */           \
-      /* We disallow FRAME+REG addressing since we know that FRAME     \
-        will be replaced with STACK, and SP relative addressing only   \
-        permits SP+OFFSET.  */                                         \
-      if (GET_MODE_SIZE (MODE) <= 4                                    \
-         && GET_CODE (XEXP (X, 0)) == REG                              \
-         && GET_CODE (XEXP (X, 1)) == REG                              \
-         && XEXP (X, 0) != frame_pointer_rtx                           \
-         && XEXP (X, 1) != frame_pointer_rtx                           \
-         && XEXP (X, 0) != virtual_stack_vars_rtx                      \
-         && XEXP (X, 1) != virtual_stack_vars_rtx                      \
-         && THUMB_REG_OK_FOR_INDEX_P (XEXP (X, 0))                     \
-         && THUMB_REG_OK_FOR_INDEX_P (XEXP (X, 1)))                    \
-       goto WIN;                                                       \
-      /* REG+const has 5-7 bit offset for non-SP registers.  */                \
-      else if (GET_CODE (XEXP (X, 0)) == REG                           \
-              && (THUMB_REG_OK_FOR_INDEX_P (XEXP (X, 0))               \
-                  || XEXP (X, 0) == arg_pointer_rtx)                   \
-              && GET_CODE (XEXP (X, 1)) == CONST_INT                   \
-              && THUMB_LEGITIMATE_OFFSET (MODE, INTVAL (XEXP (X, 1)))) \
-       goto WIN;                                                       \
-      /* REG+const has 10 bit offset for SP, but only SImode and       \
-        larger is supported.  */                                       \
-      /* ??? Should probably check for DI/DFmode overflow here         \
-        just like GO_IF_LEGITIMATE_OFFSET does.  */                    \
-      else if (GET_CODE (XEXP (X, 0)) == REG                           \
-              && REGNO (XEXP (X, 0)) == STACK_POINTER_REGNUM           \
-              && GET_MODE_SIZE (MODE) >= 4                             \
-              && GET_CODE (XEXP (X, 1)) == CONST_INT                   \
-              && ((unsigned HOST_WIDE_INT) INTVAL (XEXP (X, 1))        \
-                  + GET_MODE_SIZE (MODE)) <= 1024                      \
-              && (INTVAL (XEXP (X, 1)) & 3) == 0)                      \
-       goto WIN;                                                       \
-      else if (GET_CODE (XEXP (X, 0)) == REG                           \
-              && REGNO (XEXP (X, 0)) == FRAME_POINTER_REGNUM           \
-              && GET_MODE_SIZE (MODE) >= 4                             \
-              && GET_CODE (XEXP (X, 1)) == CONST_INT                   \
-              && (INTVAL (XEXP (X, 1)) & 3) == 0)                      \
-       goto WIN;                                                       \
-    }                                                                  \
-  else if (GET_MODE_CLASS (MODE) != MODE_FLOAT                         \
-          && GET_CODE (X) == SYMBOL_REF                                \
-          && CONSTANT_POOL_ADDRESS_P (X)                               \
-          && ! (flag_pic                                               \
-                && symbol_mentioned_p (get_pool_constant (X))))        \
-    goto WIN;                                                          \
-}
+#define THUMB_GO_IF_LEGITIMATE_ADDRESS(MODE,X,WIN)             \
+  {                                                            \
+    if (thumb_legitimate_address_p (MODE, X, REG_STRICT_P))    \
+      goto WIN;                                                        \
+  }
 
-/* ------------------------------------------------------------------- */
 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, WIN)                         \
   if (TARGET_ARM)                                                      \
     ARM_GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN)                        \
   else /* if (TARGET_THUMB) */                                         \
     THUMB_GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN)      
-/* ------------------------------------------------------------------- */
+
 \f
 /* Try machine-dependent ways of modifying an illegitimate address
-   to be legitimate.  If we find one, return the new, valid address.
-   This macro is used in only one place: `memory_address' in explow.c.
-
-   OLDX is the address as it was before break_out_memory_refs was called.
-   In some cases it is useful to look at this to decide what needs to be done.
-
-   MODE and WIN are passed so that this macro can use
-   GO_IF_LEGITIMATE_ADDRESS.
-
-   It is always safe for this macro to do nothing.  It exists to recognize
-   opportunities to optimize the output.
-
-   On the ARM, try to convert [REG, #BIGCONST]
-   into ADD BASE, REG, #UPPERCONST and [BASE, #VALIDCONST],
-   where VALIDCONST == 0 in case of TImode.  */
-#define ARM_LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)                      \
-{                                                                       \
-  if (GET_CODE (X) == PLUS)                                             \
-    {                                                                   \
-      rtx xop0 = XEXP (X, 0);                                           \
-      rtx xop1 = XEXP (X, 1);                                           \
-                                                                        \
-      if (CONSTANT_P (xop0) && ! symbol_mentioned_p (xop0))             \
-       xop0 = force_reg (SImode, xop0);                                 \
-      if (CONSTANT_P (xop1) && ! symbol_mentioned_p (xop1))             \
-       xop1 = force_reg (SImode, xop1);                                 \
-      if (ARM_BASE_REGISTER_RTX_P (xop0)                                \
-         && GET_CODE (xop1) == CONST_INT)                               \
-       {                                                                \
-         HOST_WIDE_INT n, low_n;                                        \
-         rtx base_reg, val;                                             \
-         n = INTVAL (xop1);                                             \
-                                                                        \
-         if (MODE == DImode || (TARGET_SOFT_FLOAT && MODE == DFmode))   \
-           {                                                            \
-             low_n = n & 0x0f;                                          \
-             n &= ~0x0f;                                                \
-             if (low_n > 4)                                             \
-               {                                                        \
-                 n += 16;                                               \
-                 low_n -= 16;                                           \
-               }                                                        \
-           }                                                            \
-         else                                                           \
-           {                                                            \
-             low_n = ((MODE) == TImode ? 0                              \
-                      : n >= 0 ? (n & 0xfff) : -((-n) & 0xfff));        \
-             n -= low_n;                                                \
-           }                                                            \
-         base_reg = gen_reg_rtx (SImode);                               \
-         val = force_operand (gen_rtx_PLUS (SImode, xop0,               \
-                                            GEN_INT (n)), NULL_RTX);    \
-         emit_move_insn (base_reg, val);                                \
-         (X) = (low_n == 0 ? base_reg                                   \
-                : gen_rtx_PLUS (SImode, base_reg, GEN_INT (low_n)));    \
-       }                                                                \
-      else if (xop0 != XEXP (X, 0) || xop1 != XEXP (x, 1))              \
-       (X) = gen_rtx_PLUS (SImode, xop0, xop1);                         \
-    }                                                                   \
-  else if (GET_CODE (X) == MINUS)                                       \
-    {                                                                   \
-      rtx xop0 = XEXP (X, 0);                                           \
-      rtx xop1 = XEXP (X, 1);                                           \
-                                                                        \
-      if (CONSTANT_P (xop0))                                            \
-       xop0 = force_reg (SImode, xop0);                                 \
-      if (CONSTANT_P (xop1) && ! symbol_mentioned_p (xop1))             \
-       xop1 = force_reg (SImode, xop1);                                 \
-      if (xop0 != XEXP (X, 0) || xop1 != XEXP (X, 1))                   \
-       (X) = gen_rtx_MINUS (SImode, xop0, xop1);                        \
-    }                                                                   \
-  if (flag_pic)                                                                 \
-    (X) = legitimize_pic_address (OLDX, MODE, NULL_RTX);                \
-  if (memory_address_p (MODE, X))                                       \
-    goto WIN;                                                           \
-}
+   to be legitimate.  If we find one, return the new, valid address.  */
+#define ARM_LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)     \
+do {                                                   \
+  X = arm_legitimize_address (X, OLDX, MODE);          \
+} while (0)
 
 #define THUMB_LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)   \
-  if (flag_pic)                                                \
-    (X) = legitimize_pic_address (OLDX, MODE, NULL_RTX);               
-     
-#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
-  if (TARGET_ARM)                              \
-    ARM_LEGITIMIZE_ADDRESS (X, OLDX, MODE, WIN)        \
-  else                                         \
-    THUMB_LEGITIMIZE_ADDRESS (X, OLDX, MODE, WIN)
+do {                                                   \
+  X = thumb_legitimize_address (X, OLDX, MODE);                \
+} while (0)
+
+#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)         \
+do {                                                   \
+  if (TARGET_ARM)                                      \
+    ARM_LEGITIMIZE_ADDRESS (X, OLDX, MODE, WIN);       \
+  else                                                 \
+    THUMB_LEGITIMIZE_ADDRESS (X, OLDX, MODE, WIN);     \
+                                                       \
+  if (memory_address_p (MODE, X))                      \
+    goto WIN;                                          \
+} while (0)
      
 /* Go to LABEL if ADDR (a legitimate address expression)
    has an effect that depends on the machine mode it is used for.  */
@@ -2333,12 +2404,6 @@ typedef struct
    for the index in the tablejump instruction.  */
 #define CASE_VECTOR_MODE Pmode
 
-/* Define as C expression which evaluates to nonzero if the tablejump
-   instruction expects the table to contain offsets from the address of the
-   table.
-   Do not define this if the table should contain absolute addresses. */
-/* #define CASE_VECTOR_PC_RELATIVE 1 */
-
 /* signed 'char' is most compatible, but RISC OS wants it unsigned.
    unsigned is probably best, but may break some code.  */
 #ifndef DEFAULT_SIGNED_CHAR
@@ -2353,7 +2418,7 @@ typedef struct
 #define MOVE_MAX 4
 
 #undef  MOVE_RATIO
-#define MOVE_RATIO (arm_is_xscale ? 4 : 2)
+#define MOVE_RATIO (arm_tune_xscale ? 4 : 2)
 
 /* Define if operations between registers always perform the operation
    on the full register even if a narrower mode is specified.  */
@@ -2381,7 +2446,7 @@ typedef struct
 /* This is all wrong.  Defining SHIFT_COUNT_TRUNCATED tells combine that
    code like (X << (Y % 32)) for register X, Y is equivalent to (X << Y).
    On the arm, Y in a register is used modulo 256 for the shift. Only for
-   rotates is modulo 32 used. */
+   rotates is modulo 32 used.  */
 /* #define SHIFT_COUNT_TRUNCATED 1 */
 
 /* All integers have the same format so truncation is easy.  */
@@ -2390,9 +2455,6 @@ typedef struct
 /* Calling from registers is a massive pain.  */
 #define NO_FUNCTION_CSE 1
 
-/* Chars and shorts should be passed as ints.  */
-#define PROMOTE_PROTOTYPES 1
-
 /* The machine modes of pointers and functions */
 #define Pmode  SImode
 #define FUNCTION_MODE  Pmode
@@ -2401,44 +2463,12 @@ typedef struct
   (   (X) == frame_pointer_rtx || (X) == stack_pointer_rtx     \
    || (X) == arg_pointer_rtx)
 
-#define DEFAULT_RTX_COSTS(X, CODE, OUTER_CODE)         \
-  return arm_rtx_costs (X, CODE, OUTER_CODE);
-
 /* Moves to and from memory are quite expensive */
 #define MEMORY_MOVE_COST(M, CLASS, IN)                 \
   (TARGET_ARM ? 10 :                                   \
    ((GET_MODE_SIZE (M) < 4 ? 8 : 2 * GET_MODE_SIZE (M))        \
     * (CLASS == LO_REGS ? 1 : 2)))
  
-/* All address computations that can be done are free, but rtx cost returns
-   the same for practically all of them.  So we weight the different types
-   of address here in the order (most pref first):
-   PRE/POST_INC/DEC, SHIFT or NON-INT sum, INT sum, REG, MEM or LABEL. */
-#define ARM_ADDRESS_COST(X)                                                 \
-  (10 - ((GET_CODE (X) == MEM || GET_CODE (X) == LABEL_REF                  \
-         || GET_CODE (X) == SYMBOL_REF)                                     \
-        ? 0                                                                 \
-        : ((GET_CODE (X) == PRE_INC || GET_CODE (X) == PRE_DEC              \
-            || GET_CODE (X) == POST_INC || GET_CODE (X) == POST_DEC)        \
-           ? 10                                                             \
-           : (((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS)              \
-               ? 6 + (GET_CODE (XEXP (X, 1)) == CONST_INT ? 2               \
-                      : ((GET_RTX_CLASS (GET_CODE (XEXP (X, 0))) == '2'     \
-                          || GET_RTX_CLASS (GET_CODE (XEXP (X, 0))) == 'c'  \
-                          || GET_RTX_CLASS (GET_CODE (XEXP (X, 1))) == '2'  \
-                          || GET_RTX_CLASS (GET_CODE (XEXP (X, 1))) == 'c') \
-                         ? 1 : 0))                                          \
-               : 4)))))
-        
-#define THUMB_ADDRESS_COST(X)                                  \
-  ((GET_CODE (X) == REG                                        \
-    || (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG  \
-       && GET_CODE (XEXP (X, 1)) == CONST_INT))                \
-   ? 1 : 2)
-     
-#define ADDRESS_COST(X) \
-     (TARGET_ARM ? ARM_ADDRESS_COST (X) : THUMB_ADDRESS_COST (X))
-   
 /* Try to generate sequences that don't involve branches, we can then use
    conditional instructions */
 #define BRANCH_COST \
@@ -2462,50 +2492,28 @@ extern const char * arm_pic_register_string;
 /* We can't directly access anything that contains a symbol,
    nor can we indirect via the constant pool.  */
 #define LEGITIMATE_PIC_OPERAND_P(X)                                    \
-       (   ! symbol_mentioned_p (X)                                    \
-        && ! label_mentioned_p (X)                                     \
-        && (! CONSTANT_POOL_ADDRESS_P (X)                              \
-            || (   ! symbol_mentioned_p (get_pool_constant (X))        \
-                && ! label_mentioned_p (get_pool_constant (X)))))
-     
+       (!(symbol_mentioned_p (X)                                       \
+          || label_mentioned_p (X)                                     \
+          || (GET_CODE (X) == SYMBOL_REF                               \
+              && CONSTANT_POOL_ADDRESS_P (X)                           \
+              && (symbol_mentioned_p (get_pool_constant (X))           \
+                  || label_mentioned_p (get_pool_constant (X))))))
+
 /* We need to know when we are making a constant pool; this determines
    whether data needs to be in the GOT or can be referenced via a GOT
    offset.  */
 extern int making_const_table;
 \f
 /* Handle pragmas for compatibility with Intel's compilers.  */
-#define REGISTER_TARGET_PRAGMAS(PFILE) do { \
-  cpp_register_pragma (PFILE, 0, "long_calls", arm_pr_long_calls); \
-  cpp_register_pragma (PFILE, 0, "no_long_calls", arm_pr_no_long_calls); \
-  cpp_register_pragma (PFILE, 0, "long_calls_off", arm_pr_long_calls_off); \
+#define REGISTER_TARGET_PRAGMAS() do {                                 \
+  c_register_pragma (0, "long_calls", arm_pr_long_calls);              \
+  c_register_pragma (0, "no_long_calls", arm_pr_no_long_calls);                \
+  c_register_pragma (0, "long_calls_off", arm_pr_long_calls_off);      \
 } while (0)
 
-/* Condition code information. */
+/* Condition code information.  */
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
-   return the mode to be used for the comparison. 
-   CCFPEmode should be used with floating inequalities,
-   CCFPmode should be used with floating equalities.
-   CC_NOOVmode should be used with SImode integer equalities.
-   CC_Zmode should be used if only the Z flag is set correctly
-   CCmode should be used otherwise. */
-
-#define EXTRA_CC_MODES \
-        CC(CC_NOOVmode, "CC_NOOV") \
-        CC(CC_Zmode, "CC_Z") \
-        CC(CC_SWPmode, "CC_SWP") \
-        CC(CCFPmode, "CCFP") \
-        CC(CCFPEmode, "CCFPE") \
-        CC(CC_DNEmode, "CC_DNE") \
-        CC(CC_DEQmode, "CC_DEQ") \
-        CC(CC_DLEmode, "CC_DLE") \
-        CC(CC_DLTmode, "CC_DLT") \
-        CC(CC_DGEmode, "CC_DGE") \
-        CC(CC_DGTmode, "CC_DGT") \
-        CC(CC_DLEUmode, "CC_DLEU") \
-        CC(CC_DLTUmode, "CC_DLTU") \
-        CC(CC_DGEUmode, "CC_DGEU") \
-        CC(CC_DGTUmode, "CC_DGTU") \
-        CC(CC_Cmode, "CC_C")
+   return the mode to be used for the comparison.  */
 
 #define SELECT_CC_MODE(OP, X, Y)  arm_select_cc_mode (OP, X, Y)
 
@@ -2525,54 +2533,33 @@ extern int making_const_table;
     }                                                                  \
   while (0)
 
-#define STORE_FLAG_VALUE 1
-
+/* The arm5 clz instruction returns 32.  */
+#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE)  ((VALUE) = 32, 1)
 \f
-
-/* Gcc puts the pool in the wrong place for ARM, since we can only
-   load addresses a limited distance around the pc.  We do some
-   special munging to move the constant pool values to the correct
-   point in the code.  */
-#define MACHINE_DEPENDENT_REORG(INSN)  \
-    arm_reorg (INSN);                  \
-
 #undef  ASM_APP_OFF
 #define ASM_APP_OFF (TARGET_THUMB ? "\t.code\t16\n" : "")
 
-/* Output an internal label definition.  */
-#ifndef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM)         \
-  do                                                           \
-    {                                                          \
-      char * s = (char *) alloca (40 + strlen (PREFIX));       \
-                                                               \
-      if (arm_ccfsm_state == 3 && arm_target_label == (NUM)    \
-         && !strcmp (PREFIX, "L"))                             \
-       {                                                       \
-         arm_ccfsm_state = 0;                                  \
-         arm_target_insn = NULL;                               \
-       }                                                       \
-      ASM_GENERATE_INTERNAL_LABEL (s, (PREFIX), (NUM));                \
-      ASM_OUTPUT_LABEL (STREAM, s);                            \
-    }                                                          \
-  while (0)
-#endif
-
 /* Output a push or a pop instruction (only used when profiling).  */
 #define ASM_OUTPUT_REG_PUSH(STREAM, REGNO)             \
-  if (TARGET_ARM)                                      \
-    asm_fprintf (STREAM,"\tstmfd\t%r!,{%r}\n",                 \
-                STACK_POINTER_REGNUM, REGNO);          \
-  else                                                 \
-    asm_fprintf (STREAM, "\tpush {%r}\n", REGNO)
+  do                                                   \
+    {                                                  \
+      if (TARGET_ARM)                                  \
+       asm_fprintf (STREAM,"\tstmfd\t%r!,{%r}\n",      \
+                    STACK_POINTER_REGNUM, REGNO);      \
+      else                                             \
+       asm_fprintf (STREAM, "\tpush {%r}\n", REGNO);   \
+    } while (0)
 
 
 #define ASM_OUTPUT_REG_POP(STREAM, REGNO)              \
-  if (TARGET_ARM)                                      \
-    asm_fprintf (STREAM, "\tldmfd\t%r!,{%r}\n",                \
-                 STACK_POINTER_REGNUM, REGNO);         \
-  else                                                 \
-    asm_fprintf (STREAM, "\tpop {%r}\n", REGNO)
+  do                                                   \
+    {                                                  \
+      if (TARGET_ARM)                                  \
+       asm_fprintf (STREAM, "\tldmfd\t%r!,{%r}\n",     \
+                    STACK_POINTER_REGNUM, REGNO);      \
+      else                                             \
+       asm_fprintf (STREAM, "\tpop {%r}\n", REGNO);    \
+    } while (0)
 
 /* This is how to output a label which precedes a jumptable.  Since
    Thumb instructions are 2 bytes, we may need explicit alignment here.  */
@@ -2582,7 +2569,7 @@ extern int making_const_table;
     {                                                          \
       if (TARGET_THUMB)                                                \
         ASM_OUTPUT_ALIGN (FILE, 2);                            \
-      ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM);           \
+      (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM);   \
     }                                                          \
   while (0)
 
@@ -2591,10 +2578,11 @@ extern int making_const_table;
     {                                                  \
       if (TARGET_THUMB)                                \
         {                                              \
-          if (is_called_in_ARM_mode (DECL))            \
+          if (is_called_in_ARM_mode (DECL)      \
+                         || current_function_is_thunk)         \
             fprintf (STREAM, "\t.code 32\n") ;         \
           else                                         \
-           fprintf (STREAM, "\t.thumb_func\n") ;       \
+           fprintf (STREAM, "\t.code 16\n\t.thumb_func\n") ;   \
         }                                              \
       if (TARGET_POKE_FUNCTION_NAME)                   \
         arm_poke_function_name (STREAM, (char *) NAME);        \
@@ -2625,19 +2613,19 @@ extern int making_const_table;
 /* To support -falign-* switches we need to use .p2align so
    that alignment directives in code sections will be padded
    with no-op instructions, rather than zeroes.  */
-#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)           \
+#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP)         \
   if ((LOG) != 0)                                              \
     {                                                          \
       if ((MAX_SKIP) == 0)                                     \
-        fprintf ((FILE), "\t.p2align %d\n", (LOG));            \
+        fprintf ((FILE), "\t.p2align %d\n", (int) (LOG));      \
       else                                                     \
         fprintf ((FILE), "\t.p2align %d,,%d\n",                        \
-                 (LOG), (MAX_SKIP));                           \
+                 (int) (LOG), (int) (MAX_SKIP));               \
     }
 #endif
 \f
 /* Only perform branch elimination (by making instructions conditional) if
-   we're optimising.  Otherwise it's of no use anyway.  */
+   we're optimizing.  Otherwise it's of no use anyway.  */
 #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS)     \
   if (TARGET_ARM && optimize)                          \
     arm_final_prescan_insn (INSN);                     \
@@ -2662,79 +2650,99 @@ extern int making_const_table;
        : 0))))
 
 /* Output the address of an operand.  */
-#define ARM_PRINT_OPERAND_ADDRESS(STREAM, X)                   \
-{                                                              \
-    int is_minus = GET_CODE (X) == MINUS;                      \
-                                                               \
-    if (GET_CODE (X) == REG)                                   \
-      asm_fprintf (STREAM, "[%r, #0]", REGNO (X));             \
-    else if (GET_CODE (X) == PLUS || is_minus)                 \
-      {                                                                \
-       rtx base = XEXP (X, 0);                                 \
-       rtx index = XEXP (X, 1);                                \
-       HOST_WIDE_INT offset = 0;                               \
-       if (GET_CODE (base) != REG)                             \
-         {                                                     \
-           /* Ensure that BASE is a register */                \
-            /* (one of them must be). */                       \
-           rtx temp = base;                                    \
-           base = index;                                       \
-           index = temp;                                       \
-         }                                                     \
-       switch (GET_CODE (index))                               \
-         {                                                     \
-         case CONST_INT:                                       \
-           offset = INTVAL (index);                            \
-           if (is_minus)                                       \
-             offset = -offset;                                 \
-           asm_fprintf (STREAM, "[%r, #%d]",                   \
-                        REGNO (base), offset);                 \
-           break;                                              \
-                                                               \
-         case REG:                                             \
-           asm_fprintf (STREAM, "[%r, %s%r]",                  \
-                    REGNO (base), is_minus ? "-" : "",         \
-                    REGNO (index));                            \
-           break;                                              \
-                                                               \
-         case MULT:                                            \
-         case ASHIFTRT:                                        \
-         case LSHIFTRT:                                        \
-         case ASHIFT:                                          \
-         case ROTATERT:                                        \
-         {                                                     \
-           asm_fprintf (STREAM, "[%r, %s%r",                   \
-                        REGNO (base), is_minus ? "-" : "",     \
-                         REGNO (XEXP (index, 0)));             \
-           arm_print_operand (STREAM, index, 'S');             \
-           fputs ("]", STREAM);                                \
-           break;                                              \
-         }                                                     \
-                                                               \
-         default:                                              \
-           abort();                                            \
-       }                                                       \
-    }                                                          \
-  else if (   GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_INC\
-          || GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_DEC)\
-    {                                                          \
-      extern int output_memory_reference_mode;                 \
-                                                               \
-      if (GET_CODE (XEXP (X, 0)) != REG)                       \
-       abort ();                                               \
-                                                               \
-      if (GET_CODE (X) == PRE_DEC || GET_CODE (X) == PRE_INC)  \
-       asm_fprintf (STREAM, "[%r, #%s%d]!",                    \
-                    REGNO (XEXP (X, 0)),                       \
-                    GET_CODE (X) == PRE_DEC ? "-" : "",        \
-                    GET_MODE_SIZE (output_memory_reference_mode));\
-      else                                                     \
-       asm_fprintf (STREAM, "[%r], #%s%d",                     \
-                    REGNO (XEXP (X, 0)),                       \
-                    GET_CODE (X) == POST_DEC ? "-" : "",       \
-                    GET_MODE_SIZE (output_memory_reference_mode));\
-    }                                                          \
-  else output_addr_const (STREAM, X);                          \
+#define ARM_PRINT_OPERAND_ADDRESS(STREAM, X)                           \
+{                                                                      \
+    int is_minus = GET_CODE (X) == MINUS;                              \
+                                                                       \
+    if (GET_CODE (X) == REG)                                           \
+      asm_fprintf (STREAM, "[%r, #0]", REGNO (X));                     \
+    else if (GET_CODE (X) == PLUS || is_minus)                         \
+      {                                                                        \
+       rtx base = XEXP (X, 0);                                         \
+       rtx index = XEXP (X, 1);                                        \
+       HOST_WIDE_INT offset = 0;                                       \
+       if (GET_CODE (base) != REG)                                     \
+         {                                                             \
+           /* Ensure that BASE is a register.  */                      \
+            /* (one of them must be).  */                              \
+           rtx temp = base;                                            \
+           base = index;                                               \
+           index = temp;                                               \
+         }                                                             \
+       switch (GET_CODE (index))                                       \
+         {                                                             \
+         case CONST_INT:                                               \
+           offset = INTVAL (index);                                    \
+           if (is_minus)                                               \
+             offset = -offset;                                         \
+           asm_fprintf (STREAM, "[%r, #%wd]",                          \
+                        REGNO (base), offset);                         \
+           break;                                                      \
+                                                                       \
+         case REG:                                                     \
+           asm_fprintf (STREAM, "[%r, %s%r]",                          \
+                    REGNO (base), is_minus ? "-" : "",                 \
+                    REGNO (index));                                    \
+           break;                                                      \
+                                                                       \
+         case MULT:                                                    \
+         case ASHIFTRT:                                                \
+         case LSHIFTRT:                                                \
+         case ASHIFT:                                                  \
+         case ROTATERT:                                                \
+         {                                                             \
+           asm_fprintf (STREAM, "[%r, %s%r",                           \
+                        REGNO (base), is_minus ? "-" : "",             \
+                         REGNO (XEXP (index, 0)));                     \
+           arm_print_operand (STREAM, index, 'S');                     \
+           fputs ("]", STREAM);                                        \
+           break;                                                      \
+         }                                                             \
+                                                                       \
+         default:                                                      \
+           abort();                                                    \
+       }                                                               \
+    }                                                                  \
+  else if (GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_INC         \
+          || GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_DEC)      \
+    {                                                                  \
+      extern enum machine_mode output_memory_reference_mode;           \
+                                                                       \
+      if (GET_CODE (XEXP (X, 0)) != REG)                               \
+       abort ();                                                       \
+                                                                       \
+      if (GET_CODE (X) == PRE_DEC || GET_CODE (X) == PRE_INC)          \
+       asm_fprintf (STREAM, "[%r, #%s%d]!",                            \
+                    REGNO (XEXP (X, 0)),                               \
+                    GET_CODE (X) == PRE_DEC ? "-" : "",                \
+                    GET_MODE_SIZE (output_memory_reference_mode));     \
+      else                                                             \
+       asm_fprintf (STREAM, "[%r], #%s%d",                             \
+                    REGNO (XEXP (X, 0)),                               \
+                    GET_CODE (X) == POST_DEC ? "-" : "",               \
+                    GET_MODE_SIZE (output_memory_reference_mode));     \
+    }                                                                  \
+  else if (GET_CODE (X) == PRE_MODIFY)                                 \
+    {                                                                  \
+      asm_fprintf (STREAM, "[%r, ", REGNO (XEXP (X, 0)));              \
+      if (GET_CODE (XEXP (XEXP (X, 1), 1)) == CONST_INT)               \
+       asm_fprintf (STREAM, "#%wd]!",                                  \
+                    INTVAL (XEXP (XEXP (X, 1), 1)));                   \
+      else                                                             \
+       asm_fprintf (STREAM, "%r]!",                                    \
+                    REGNO (XEXP (XEXP (X, 1), 1)));                    \
+    }                                                                  \
+  else if (GET_CODE (X) == POST_MODIFY)                                        \
+    {                                                                  \
+      asm_fprintf (STREAM, "[%r], ", REGNO (XEXP (X, 0)));             \
+      if (GET_CODE (XEXP (XEXP (X, 1), 1)) == CONST_INT)               \
+       asm_fprintf (STREAM, "#%wd",                                    \
+                    INTVAL (XEXP (XEXP (X, 1), 1)));                   \
+      else                                                             \
+       asm_fprintf (STREAM, "%r",                                      \
+                    REGNO (XEXP (XEXP (X, 1), 1)));                    \
+    }                                                                  \
+  else output_addr_const (STREAM, X);                                  \
 }
 
 #define THUMB_PRINT_OPERAND_ADDRESS(STREAM, X)         \
@@ -2745,10 +2753,12 @@ extern int making_const_table;
     asm_fprintf (STREAM, "%r!", REGNO (XEXP (X, 0)));  \
   else if (GET_CODE (X) == PLUS)                       \
     {                                                  \
+      if (GET_CODE (XEXP (X, 0)) != REG)               \
+        abort ();                                      \
       if (GET_CODE (XEXP (X, 1)) == CONST_INT)         \
-       asm_fprintf (STREAM, "[%r, #%d]",               \
+       asm_fprintf (STREAM, "[%r, #%wd]",              \
                     REGNO (XEXP (X, 0)),               \
-                    (int) INTVAL (XEXP (X, 1)));       \
+                    INTVAL (XEXP (X, 1)));             \
       else                                             \
        asm_fprintf (STREAM, "[%r, %r]",                \
                     REGNO (XEXP (X, 0)),               \
@@ -2763,39 +2773,11 @@ extern int making_const_table;
     ARM_PRINT_OPERAND_ADDRESS (STREAM, X)      \
   else                                         \
     THUMB_PRINT_OPERAND_ADDRESS (STREAM, X)
-     
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
-   Used for C++ multiple inheritance.  */
-#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION)               \
-  do                                                                           \
-    {                                                                          \
-      int mi_delta = (DELTA);                                                  \
-      const char *const mi_op = mi_delta < 0 ? "sub" : "add";                  \
-      int shift = 0;                                                           \
-      int this_regno = (aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION)))   \
-                       ? 1 : 0);                                               \
-      if (mi_delta < 0)                                                                \
-        mi_delta = - mi_delta;                                                 \
-      while (mi_delta != 0)                                                    \
-        {                                                                      \
-          if ((mi_delta & (3 << shift)) == 0)                                  \
-           shift += 2;                                                         \
-          else                                                                 \
-           {                                                                   \
-             asm_fprintf (FILE, "\t%s\t%r, %r, #%d\n",                         \
-                          mi_op, this_regno, this_regno,                       \
-                          mi_delta & (0xff << shift));                         \
-             mi_delta &= ~(0xff << shift);                                     \
-             shift += 8;                                                       \
-           }                                                                   \
-        }                                                                      \
-      fputs ("\tb\t", FILE);                                                   \
-      assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0));           \
-      if (NEED_PLT_RELOC)                                                      \
-        fputs ("(PLT)", FILE);                                                 \
-      fputc ('\n', FILE);                                                      \
-    }                                                                          \
-  while (0)
+
+#define OUTPUT_ADDR_CONST_EXTRA(FILE, X, FAIL) \
+  if (GET_CODE (X) != CONST_VECTOR             \
+      || ! arm_emit_vector_const (FILE, X))    \
+    goto FAIL;
 
 /* A C expression whose value is RTL representing the value of the return
    address for the frame COUNT steps up from the current frame.  */
@@ -2820,25 +2802,30 @@ extern int making_const_table;
      in 26 bit mode, the condition codes must be masked out of the     \
      return address.  This does not apply to ARM6 and later processors \
      when running in 32 bit mode.  */                                  \
-  ((!TARGET_APCS_32) ? (GEN_INT (RETURN_ADDR_MASK26))                  \
-   : (GEN_INT ((unsigned long)0xffffffff)))
+  ((!TARGET_APCS_32) ? (gen_int_mode (RETURN_ADDR_MASK26, Pmode))      \
+   : (arm_arch4 || TARGET_THUMB) ?                                     \
+     (gen_int_mode ((unsigned long)0xffffffff, Pmode))                 \
+   : arm_gen_return_addr_mask ())
 
 \f
 /* Define the codes that are matched by predicates in arm.c */
 #define PREDICATE_CODES                                                        \
   {"s_register_operand", {SUBREG, REG}},                               \
+  {"arm_general_register_operand", {SUBREG, REG}},                     \
   {"arm_hard_register_operand", {REG}},                                        \
   {"f_register_operand", {SUBREG, REG}},                               \
   {"arm_add_operand",    {SUBREG, REG, CONST_INT}},                    \
-  {"fpu_add_operand",    {SUBREG, REG, CONST_DOUBLE}},                 \
-  {"fpu_rhs_operand",    {SUBREG, REG, CONST_DOUBLE}},                 \
+  {"arm_addimm_operand", {CONST_INT}},                                 \
+  {"arm_float_add_operand",    {SUBREG, REG, CONST_DOUBLE}},           \
+  {"arm_float_rhs_operand",    {SUBREG, REG, CONST_DOUBLE}},           \
   {"arm_rhs_operand",    {SUBREG, REG, CONST_INT}},                    \
   {"arm_not_operand",    {SUBREG, REG, CONST_INT}},                    \
   {"reg_or_int_operand", {SUBREG, REG, CONST_INT}},                    \
   {"index_operand",      {SUBREG, REG, CONST_INT}},                    \
   {"thumb_cmp_operand",  {SUBREG, REG, CONST_INT}},                    \
+  {"thumb_cmpneg_operand", {CONST_INT}},                               \
+  {"thumb_cbrch_target_operand", {SUBREG, REG, MEM}},                  \
   {"offsettable_memory_operand", {MEM}},                               \
-  {"bad_signed_byte_operand", {MEM}},                                  \
   {"alignable_memory_operand", {MEM}},                                 \
   {"shiftable_operator", {PLUS, MINUS, AND, IOR, XOR}},                        \
   {"minmax_operator", {SMIN, SMAX, UMIN, UMAX}},                       \
@@ -2858,18 +2845,182 @@ extern int making_const_table;
   {"multi_register_push", {PARALLEL}},                                 \
   {"cc_register", {REG}},                                              \
   {"logical_binary_operator", {AND, IOR, XOR}},                                \
-  {"dominant_cc_register", {REG}},
+  {"cirrus_register_operand", {REG}},                                  \
+  {"cirrus_fp_register", {REG}},                                       \
+  {"cirrus_shift_const", {CONST_INT}},                                 \
+  {"dominant_cc_register", {REG}},                                     \
+  {"arm_float_compare_operand", {REG, CONST_DOUBLE}},                  \
+  {"vfp_compare_operand", {REG, CONST_DOUBLE}},
 
 /* Define this if you have special predicates that know special things
    about modes.  Genrecog will warn about certain forms of
    match_operand without a mode; if the operand predicate is listed in
-   SPECIAL_MODE_PREDICATES, the warning will be suppressed. */
+   SPECIAL_MODE_PREDICATES, the warning will be suppressed.  */
 #define SPECIAL_MODE_PREDICATES                        \
  "cc_register", "dominant_cc_register",
 
 enum arm_builtins
 {
-  ARM_BUILTIN_CLZ,
+  ARM_BUILTIN_GETWCX,
+  ARM_BUILTIN_SETWCX,
+
+  ARM_BUILTIN_WZERO,
+
+  ARM_BUILTIN_WAVG2BR,
+  ARM_BUILTIN_WAVG2HR,
+  ARM_BUILTIN_WAVG2B,
+  ARM_BUILTIN_WAVG2H,
+
+  ARM_BUILTIN_WACCB,
+  ARM_BUILTIN_WACCH,
+  ARM_BUILTIN_WACCW,
+
+  ARM_BUILTIN_WMACS,
+  ARM_BUILTIN_WMACSZ,
+  ARM_BUILTIN_WMACU,
+  ARM_BUILTIN_WMACUZ,
+
+  ARM_BUILTIN_WSADB,
+  ARM_BUILTIN_WSADBZ,
+  ARM_BUILTIN_WSADH,
+  ARM_BUILTIN_WSADHZ,
+
+  ARM_BUILTIN_WALIGN,
+
+  ARM_BUILTIN_TMIA,
+  ARM_BUILTIN_TMIAPH,
+  ARM_BUILTIN_TMIABB,
+  ARM_BUILTIN_TMIABT,
+  ARM_BUILTIN_TMIATB,
+  ARM_BUILTIN_TMIATT,
+
+  ARM_BUILTIN_TMOVMSKB,
+  ARM_BUILTIN_TMOVMSKH,
+  ARM_BUILTIN_TMOVMSKW,
+
+  ARM_BUILTIN_TBCSTB,
+  ARM_BUILTIN_TBCSTH,
+  ARM_BUILTIN_TBCSTW,
+
+  ARM_BUILTIN_WMADDS,
+  ARM_BUILTIN_WMADDU,
+
+  ARM_BUILTIN_WPACKHSS,
+  ARM_BUILTIN_WPACKWSS,
+  ARM_BUILTIN_WPACKDSS,
+  ARM_BUILTIN_WPACKHUS,
+  ARM_BUILTIN_WPACKWUS,
+  ARM_BUILTIN_WPACKDUS,
+
+  ARM_BUILTIN_WADDB,
+  ARM_BUILTIN_WADDH,
+  ARM_BUILTIN_WADDW,
+  ARM_BUILTIN_WADDSSB,
+  ARM_BUILTIN_WADDSSH,
+  ARM_BUILTIN_WADDSSW,
+  ARM_BUILTIN_WADDUSB,
+  ARM_BUILTIN_WADDUSH,
+  ARM_BUILTIN_WADDUSW,
+  ARM_BUILTIN_WSUBB,
+  ARM_BUILTIN_WSUBH,
+  ARM_BUILTIN_WSUBW,
+  ARM_BUILTIN_WSUBSSB,
+  ARM_BUILTIN_WSUBSSH,
+  ARM_BUILTIN_WSUBSSW,
+  ARM_BUILTIN_WSUBUSB,
+  ARM_BUILTIN_WSUBUSH,
+  ARM_BUILTIN_WSUBUSW,
+
+  ARM_BUILTIN_WAND,
+  ARM_BUILTIN_WANDN,
+  ARM_BUILTIN_WOR,
+  ARM_BUILTIN_WXOR,
+
+  ARM_BUILTIN_WCMPEQB,
+  ARM_BUILTIN_WCMPEQH,
+  ARM_BUILTIN_WCMPEQW,
+  ARM_BUILTIN_WCMPGTUB,
+  ARM_BUILTIN_WCMPGTUH,
+  ARM_BUILTIN_WCMPGTUW,
+  ARM_BUILTIN_WCMPGTSB,
+  ARM_BUILTIN_WCMPGTSH,
+  ARM_BUILTIN_WCMPGTSW,
+
+  ARM_BUILTIN_TEXTRMSB,
+  ARM_BUILTIN_TEXTRMSH,
+  ARM_BUILTIN_TEXTRMSW,
+  ARM_BUILTIN_TEXTRMUB,
+  ARM_BUILTIN_TEXTRMUH,
+  ARM_BUILTIN_TEXTRMUW,
+  ARM_BUILTIN_TINSRB,
+  ARM_BUILTIN_TINSRH,
+  ARM_BUILTIN_TINSRW,
+
+  ARM_BUILTIN_WMAXSW,
+  ARM_BUILTIN_WMAXSH,
+  ARM_BUILTIN_WMAXSB,
+  ARM_BUILTIN_WMAXUW,
+  ARM_BUILTIN_WMAXUH,
+  ARM_BUILTIN_WMAXUB,
+  ARM_BUILTIN_WMINSW,
+  ARM_BUILTIN_WMINSH,
+  ARM_BUILTIN_WMINSB,
+  ARM_BUILTIN_WMINUW,
+  ARM_BUILTIN_WMINUH,
+  ARM_BUILTIN_WMINUB,
+
+  ARM_BUILTIN_WMULUM,
+  ARM_BUILTIN_WMULSM,
+  ARM_BUILTIN_WMULUL,
+
+  ARM_BUILTIN_PSADBH,
+  ARM_BUILTIN_WSHUFH,
+
+  ARM_BUILTIN_WSLLH,
+  ARM_BUILTIN_WSLLW,
+  ARM_BUILTIN_WSLLD,
+  ARM_BUILTIN_WSRAH,
+  ARM_BUILTIN_WSRAW,
+  ARM_BUILTIN_WSRAD,
+  ARM_BUILTIN_WSRLH,
+  ARM_BUILTIN_WSRLW,
+  ARM_BUILTIN_WSRLD,
+  ARM_BUILTIN_WRORH,
+  ARM_BUILTIN_WRORW,
+  ARM_BUILTIN_WRORD,
+  ARM_BUILTIN_WSLLHI,
+  ARM_BUILTIN_WSLLWI,
+  ARM_BUILTIN_WSLLDI,
+  ARM_BUILTIN_WSRAHI,
+  ARM_BUILTIN_WSRAWI,
+  ARM_BUILTIN_WSRADI,
+  ARM_BUILTIN_WSRLHI,
+  ARM_BUILTIN_WSRLWI,
+  ARM_BUILTIN_WSRLDI,
+  ARM_BUILTIN_WRORHI,
+  ARM_BUILTIN_WRORWI,
+  ARM_BUILTIN_WRORDI,
+
+  ARM_BUILTIN_WUNPCKIHB,
+  ARM_BUILTIN_WUNPCKIHH,
+  ARM_BUILTIN_WUNPCKIHW,
+  ARM_BUILTIN_WUNPCKILB,
+  ARM_BUILTIN_WUNPCKILH,
+  ARM_BUILTIN_WUNPCKILW,
+
+  ARM_BUILTIN_WUNPCKEHSB,
+  ARM_BUILTIN_WUNPCKEHSH,
+  ARM_BUILTIN_WUNPCKEHSW,
+  ARM_BUILTIN_WUNPCKEHUB,
+  ARM_BUILTIN_WUNPCKEHUH,
+  ARM_BUILTIN_WUNPCKEHUW,
+  ARM_BUILTIN_WUNPCKELSB,
+  ARM_BUILTIN_WUNPCKELSH,
+  ARM_BUILTIN_WUNPCKELSW,
+  ARM_BUILTIN_WUNPCKELUB,
+  ARM_BUILTIN_WUNPCKELUH,
+  ARM_BUILTIN_WUNPCKELUW,
+
   ARM_BUILTIN_MAX
 };
 #endif /* ! GCC_ARM_H */