OSDN Git Service

* config/i386/i386.h (ix86_return_in_memory): Add prototype.
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / i386.h
index 0454cad..b46c99e 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler for IA-32.
    Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002 Free Software Foundation, Inc.
+   2001, 2002, 2003 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -34,20 +34,6 @@ Boston, MA 02111-1307, USA.  */
    ADDR_BEG, ADDR_END, PRINT_IREG, PRINT_SCALE, PRINT_B_I_S, and many
    that start with ASM_ or end in ASM_OP.  */
 
-/* Stubs for half-pic support if not OSF/1 reference platform.  */
-
-#ifndef HALF_PIC_P
-#define HALF_PIC_P() 0
-#define HALF_PIC_NUMBER_PTRS 0
-#define HALF_PIC_NUMBER_REFS 0
-#define HALF_PIC_ENCODE(DECL)
-#define HALF_PIC_DECLARE(NAME)
-#define HALF_PIC_INIT()        error ("half-pic init called on systems that don't support it")
-#define HALF_PIC_ADDRESS_P(X) 0
-#define HALF_PIC_PTR(X) (X)
-#define HALF_PIC_FINISH(STREAM)
-#endif
-
 /* Define the specific costs for a given cpu */
 
 struct processor_costs {
@@ -55,9 +41,11 @@ struct processor_costs {
   const int lea;               /* cost of a lea instruction */
   const int shift_var;         /* variable shift costs */
   const int shift_const;       /* constant shift costs */
-  const int mult_init;         /* cost of starting a multiply */
+  const int mult_init[5];      /* cost of starting a multiply 
+                                  in QImode, HImode, SImode, DImode, TImode*/
   const int mult_bit;          /* cost of multiply per each bit set */
-  const int divide;            /* cost of a divide/mod */
+  const int divide[5];         /* cost of a divide/mod 
+                                  in QImode, HImode, SImode, DImode, TImode*/
   int movsx;                   /* The cost of movsx operation.  */
   int movzx;                   /* The cost of movzx operation.  */
   const int large_insn;                /* insns larger than this cost more */
@@ -89,6 +77,13 @@ struct processor_costs {
   const int prefetch_block;    /* bytes moved to cache for prefetch.  */
   const int simultaneous_prefetches; /* number of parallel prefetch
                                   operations.  */
+  const int branch_cost;       /* Default value for BRANCH_COST.  */
+  const int fadd;              /* cost of FADD and FSUB instructions.  */
+  const int fmul;              /* cost of FMUL instruction.  */
+  const int fdiv;              /* cost of FDIV instruction.  */
+  const int fabs;              /* cost of FABS instruction.  */
+  const int fchs;              /* cost of FCHS instruction.  */
+  const int fsqrt;             /* cost of FSQRT instruction.  */
 };
 
 extern const struct processor_costs *ix86_cost;
@@ -102,8 +97,12 @@ extern int target_flags;
 /* configure can arrange to make this 2, to force a 486.  */
 
 #ifndef TARGET_CPU_DEFAULT
+#ifdef TARGET_64BIT_DEFAULT
+#define TARGET_CPU_DEFAULT TARGET_CPU_DEFAULT_k8
+#else
 #define TARGET_CPU_DEFAULT 0
 #endif
+#endif
 
 /* Masks for the -m switches */
 #define MASK_80387             0x00000001      /* Hardware floating point */
@@ -119,19 +118,19 @@ extern int target_flags;
 #define MASK_INLINE_ALL_STROPS 0x00000400      /* Inline stringops in all cases */
 #define MASK_NO_PUSH_ARGS      0x00000800      /* Use push instructions */
 #define MASK_ACCUMULATE_OUTGOING_ARGS 0x00001000/* Accumulate outgoing args */
-#define MASK_ACCUMULATE_OUTGOING_ARGS_SET 0x00002000
-#define MASK_MMX               0x00004000      /* Support MMX regs/builtins */
-#define MASK_MMX_SET           0x00008000
-#define MASK_SSE               0x00010000      /* Support SSE regs/builtins */
-#define MASK_SSE_SET           0x00020000
-#define MASK_SSE2              0x00040000      /* Support SSE2 regs/builtins */
-#define MASK_SSE2_SET          0x00080000
-#define MASK_3DNOW             0x00100000      /* Support 3Dnow builtins */
-#define MASK_3DNOW_SET         0x00200000
-#define MASK_3DNOW_A           0x00400000      /* Support Athlon 3Dnow builtins */
-#define MASK_3DNOW_A_SET       0x00800000
-#define MASK_128BIT_LONG_DOUBLE 0x01000000     /* long double size is 128bit */
-#define MASK_64BIT             0x02000000      /* Produce 64bit code */
+#define MASK_MMX               0x00002000      /* Support MMX regs/builtins */
+#define MASK_SSE               0x00004000      /* Support SSE regs/builtins */
+#define MASK_SSE2              0x00008000      /* Support SSE2 regs/builtins */
+#define MASK_PNI               0x00010000      /* Support PNI regs/builtins */
+#define MASK_3DNOW             0x00020000      /* Support 3Dnow builtins */
+#define MASK_3DNOW_A           0x00040000      /* Support Athlon 3Dnow builtins */
+#define MASK_128BIT_LONG_DOUBLE 0x00080000     /* long double size is 128bit */
+#define MASK_64BIT             0x00100000      /* Produce 64bit code */
+#define MASK_MS_BITFIELD_LAYOUT 0x00200000     /* Use native (MS) bitfield layout */
+#define MASK_TLS_DIRECT_SEG_REFS 0x00400000    /* Avoid adding %gs:0  */
+
+/* Unused:                     0x03e0000       */
+
 /* ... overlap with subtarget options starts by 0x04000000.  */
 #define MASK_NO_RED_ZONE       0x04000000      /* Do not use red zone */
 
@@ -140,7 +139,7 @@ extern int target_flags;
 
 /* Compile using ret insn that pops args.
    This will not work unless you use prototypes at least
-   for all functions that can take varying numbers of args.  */  
+   for all functions that can take varying numbers of args.  */
 #define TARGET_RTD (target_flags & MASK_RTD)
 
 /* Align doubles to a two word boundary.  This breaks compatibility with
@@ -188,26 +187,40 @@ extern int target_flags;
 /* Debug FUNCTION_ARG macros */
 #define TARGET_DEBUG_ARG (ix86_debug_arg_string != 0)
 
-/* 64bit Sledgehammer mode */
+/* 64bit Sledgehammer mode.  For libgcc2 we make sure this is a
+   compile-time constant.  */
+#ifdef IN_LIBGCC2
+#ifdef __x86_64__
+#define TARGET_64BIT 1
+#else
+#define TARGET_64BIT 0
+#endif
+#else
 #ifdef TARGET_BI_ARCH
 #define TARGET_64BIT (target_flags & MASK_64BIT)
 #else
-#ifdef TARGET_64BIT_DEFAULT
+#if TARGET_64BIT_DEFAULT
 #define TARGET_64BIT 1
 #else
 #define TARGET_64BIT 0
 #endif
 #endif
+#endif
 
-#define TARGET_386 (ix86_cpu == PROCESSOR_I386)
-#define TARGET_486 (ix86_cpu == PROCESSOR_I486)
-#define TARGET_PENTIUM (ix86_cpu == PROCESSOR_PENTIUM)
-#define TARGET_PENTIUMPRO (ix86_cpu == PROCESSOR_PENTIUMPRO)
-#define TARGET_K6 (ix86_cpu == PROCESSOR_K6)
-#define TARGET_ATHLON (ix86_cpu == PROCESSOR_ATHLON)
-#define TARGET_PENTIUM4 (ix86_cpu == PROCESSOR_PENTIUM4)
+/* Avoid adding %gs:0 in TLS references; use %gs:address directly.  */
+#define TARGET_TLS_DIRECT_SEG_REFS (target_flags & MASK_TLS_DIRECT_SEG_REFS)
 
-#define CPUMASK (1 << ix86_cpu)
+#define TARGET_386 (ix86_tune == PROCESSOR_I386)
+#define TARGET_486 (ix86_tune == PROCESSOR_I486)
+#define TARGET_PENTIUM (ix86_tune == PROCESSOR_PENTIUM)
+#define TARGET_PENTIUMPRO (ix86_tune == PROCESSOR_PENTIUMPRO)
+#define TARGET_K6 (ix86_tune == PROCESSOR_K6)
+#define TARGET_ATHLON (ix86_tune == PROCESSOR_ATHLON)
+#define TARGET_PENTIUM4 (ix86_tune == PROCESSOR_PENTIUM4)
+#define TARGET_K8 (ix86_tune == PROCESSOR_K8)
+#define TARGET_ATHLON_K8 (TARGET_K8 || TARGET_ATHLON)
+
+#define TUNEMASK (1 << ix86_tune)
 extern const int x86_use_leave, x86_push_memory, x86_zero_extend_with_and;
 extern const int x86_use_bit_test, x86_cmove, x86_deep_branch;
 extern const int x86_branch_hints, x86_unroll_strlen;
@@ -215,54 +228,71 @@ extern const int x86_double_with_add, x86_partial_reg_stall, x86_movx;
 extern const int x86_use_loop, x86_use_fiop, x86_use_mov0;
 extern const int x86_use_cltd, x86_read_modify_write;
 extern const int x86_read_modify, x86_split_long_moves;
-extern const int x86_promote_QImode, x86_single_stringop;
+extern const int x86_promote_QImode, x86_single_stringop, x86_fast_prefix;
 extern const int x86_himode_math, x86_qimode_math, x86_promote_qi_regs;
 extern const int x86_promote_hi_regs, x86_integer_DFmode_moves;
 extern const int x86_add_esp_4, x86_add_esp_8, x86_sub_esp_4, x86_sub_esp_8;
 extern const int x86_partial_reg_dependency, x86_memory_mismatch_stall;
 extern const int x86_accumulate_outgoing_args, x86_prologue_using_move;
 extern const int x86_epilogue_using_move, x86_decompose_lea;
-extern const int x86_arch_always_fancy_math_387;
+extern const int x86_arch_always_fancy_math_387, x86_shift1;
+extern const int x86_sse_partial_reg_dependency, x86_sse_partial_regs;
+extern const int x86_sse_typeless_stores, x86_sse_load0_by_pxor;
+extern const int x86_use_ffreep, x86_sse_partial_regs_for_cvtsd2ss;
+extern const int x86_inter_unit_moves;
 extern int x86_prefetch_sse;
 
-#define TARGET_USE_LEAVE (x86_use_leave & CPUMASK)
-#define TARGET_PUSH_MEMORY (x86_push_memory & CPUMASK)
-#define TARGET_ZERO_EXTEND_WITH_AND (x86_zero_extend_with_and & CPUMASK)
-#define TARGET_USE_BIT_TEST (x86_use_bit_test & CPUMASK)
-#define TARGET_UNROLL_STRLEN (x86_unroll_strlen & CPUMASK)
+#define TARGET_USE_LEAVE (x86_use_leave & TUNEMASK)
+#define TARGET_PUSH_MEMORY (x86_push_memory & TUNEMASK)
+#define TARGET_ZERO_EXTEND_WITH_AND (x86_zero_extend_with_and & TUNEMASK)
+#define TARGET_USE_BIT_TEST (x86_use_bit_test & TUNEMASK)
+#define TARGET_UNROLL_STRLEN (x86_unroll_strlen & TUNEMASK)
 /* For sane SSE instruction set generation we need fcomi instruction.  It is
    safe to enable all CMOVE instructions.  */
 #define TARGET_CMOVE ((x86_cmove & (1 << ix86_arch)) || TARGET_SSE)
-#define TARGET_DEEP_BRANCH_PREDICTION (x86_deep_branch & CPUMASK)
-#define TARGET_BRANCH_PREDICTION_HINTS (x86_branch_hints & CPUMASK)
-#define TARGET_DOUBLE_WITH_ADD (x86_double_with_add & CPUMASK)
-#define TARGET_USE_SAHF ((x86_use_sahf & CPUMASK) && !TARGET_64BIT)
-#define TARGET_MOVX (x86_movx & CPUMASK)
-#define TARGET_PARTIAL_REG_STALL (x86_partial_reg_stall & CPUMASK)
-#define TARGET_USE_LOOP (x86_use_loop & CPUMASK)
-#define TARGET_USE_FIOP (x86_use_fiop & CPUMASK)
-#define TARGET_USE_MOV0 (x86_use_mov0 & CPUMASK)
-#define TARGET_USE_CLTD (x86_use_cltd & CPUMASK)
-#define TARGET_SPLIT_LONG_MOVES (x86_split_long_moves & CPUMASK)
-#define TARGET_READ_MODIFY_WRITE (x86_read_modify_write & CPUMASK)
-#define TARGET_READ_MODIFY (x86_read_modify & CPUMASK)
-#define TARGET_PROMOTE_QImode (x86_promote_QImode & CPUMASK)
-#define TARGET_SINGLE_STRINGOP (x86_single_stringop & CPUMASK)
-#define TARGET_QIMODE_MATH (x86_qimode_math & CPUMASK)
-#define TARGET_HIMODE_MATH (x86_himode_math & CPUMASK)
-#define TARGET_PROMOTE_QI_REGS (x86_promote_qi_regs & CPUMASK)
-#define TARGET_PROMOTE_HI_REGS (x86_promote_hi_regs & CPUMASK)
-#define TARGET_ADD_ESP_4 (x86_add_esp_4 & CPUMASK)
-#define TARGET_ADD_ESP_8 (x86_add_esp_8 & CPUMASK)
-#define TARGET_SUB_ESP_4 (x86_sub_esp_4 & CPUMASK)
-#define TARGET_SUB_ESP_8 (x86_sub_esp_8 & CPUMASK)
-#define TARGET_INTEGER_DFMODE_MOVES (x86_integer_DFmode_moves & CPUMASK)
-#define TARGET_PARTIAL_REG_DEPENDENCY (x86_partial_reg_dependency & CPUMASK)
-#define TARGET_MEMORY_MISMATCH_STALL (x86_memory_mismatch_stall & CPUMASK)
-#define TARGET_PROLOGUE_USING_MOVE (x86_prologue_using_move & CPUMASK)
-#define TARGET_EPILOGUE_USING_MOVE (x86_epilogue_using_move & CPUMASK)
-#define TARGET_DECOMPOSE_LEA (x86_decompose_lea & CPUMASK)
+#define TARGET_DEEP_BRANCH_PREDICTION (x86_deep_branch & TUNEMASK)
+#define TARGET_BRANCH_PREDICTION_HINTS (x86_branch_hints & TUNEMASK)
+#define TARGET_DOUBLE_WITH_ADD (x86_double_with_add & TUNEMASK)
+#define TARGET_USE_SAHF ((x86_use_sahf & TUNEMASK) && !TARGET_64BIT)
+#define TARGET_MOVX (x86_movx & TUNEMASK)
+#define TARGET_PARTIAL_REG_STALL (x86_partial_reg_stall & TUNEMASK)
+#define TARGET_USE_LOOP (x86_use_loop & TUNEMASK)
+#define TARGET_USE_FIOP (x86_use_fiop & TUNEMASK)
+#define TARGET_USE_MOV0 (x86_use_mov0 & TUNEMASK)
+#define TARGET_USE_CLTD (x86_use_cltd & TUNEMASK)
+#define TARGET_SPLIT_LONG_MOVES (x86_split_long_moves & TUNEMASK)
+#define TARGET_READ_MODIFY_WRITE (x86_read_modify_write & TUNEMASK)
+#define TARGET_READ_MODIFY (x86_read_modify & TUNEMASK)
+#define TARGET_PROMOTE_QImode (x86_promote_QImode & TUNEMASK)
+#define TARGET_FAST_PREFIX (x86_fast_prefix & TUNEMASK)
+#define TARGET_SINGLE_STRINGOP (x86_single_stringop & TUNEMASK)
+#define TARGET_QIMODE_MATH (x86_qimode_math & TUNEMASK)
+#define TARGET_HIMODE_MATH (x86_himode_math & TUNEMASK)
+#define TARGET_PROMOTE_QI_REGS (x86_promote_qi_regs & TUNEMASK)
+#define TARGET_PROMOTE_HI_REGS (x86_promote_hi_regs & TUNEMASK)
+#define TARGET_ADD_ESP_4 (x86_add_esp_4 & TUNEMASK)
+#define TARGET_ADD_ESP_8 (x86_add_esp_8 & TUNEMASK)
+#define TARGET_SUB_ESP_4 (x86_sub_esp_4 & TUNEMASK)
+#define TARGET_SUB_ESP_8 (x86_sub_esp_8 & TUNEMASK)
+#define TARGET_INTEGER_DFMODE_MOVES (x86_integer_DFmode_moves & TUNEMASK)
+#define TARGET_PARTIAL_REG_DEPENDENCY (x86_partial_reg_dependency & TUNEMASK)
+#define TARGET_SSE_PARTIAL_REG_DEPENDENCY \
+                                     (x86_sse_partial_reg_dependency & TUNEMASK)
+#define TARGET_SSE_PARTIAL_REGS (x86_sse_partial_regs & TUNEMASK)
+#define TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS \
+                               (x86_sse_partial_regs_for_cvtsd2ss & TUNEMASK)
+#define TARGET_SSE_TYPELESS_STORES (x86_sse_typeless_stores & TUNEMASK)
+#define TARGET_SSE_TYPELESS_LOAD0 (x86_sse_typeless_load0 & TUNEMASK)
+#define TARGET_SSE_LOAD0_BY_PXOR (x86_sse_load0_by_pxor & TUNEMASK)
+#define TARGET_MEMORY_MISMATCH_STALL (x86_memory_mismatch_stall & TUNEMASK)
+#define TARGET_PROLOGUE_USING_MOVE (x86_prologue_using_move & TUNEMASK)
+#define TARGET_EPILOGUE_USING_MOVE (x86_epilogue_using_move & TUNEMASK)
+#define TARGET_DECOMPOSE_LEA (x86_decompose_lea & TUNEMASK)
 #define TARGET_PREFETCH_SSE (x86_prefetch_sse)
+#define TARGET_SHIFT1 (x86_shift1 & TUNEMASK)
+#define TARGET_USE_FFREEP (x86_use_ffreep & TUNEMASK)
+#define TARGET_REP_MOVL_OPTIMAL (x86_rep_movl_optimal & TUNEMASK)
+#define TARGET_INTER_UNIT_MOVES (x86_inter_unit_moves & TUNEMASK)
 
 #define TARGET_STACK_PROBE (target_flags & MASK_STACK_PROBE)
 
@@ -271,8 +301,9 @@ extern int x86_prefetch_sse;
 
 #define ASSEMBLER_DIALECT (ix86_asm_dialect)
 
-#define TARGET_SSE ((target_flags & (MASK_SSE | MASK_SSE2)) != 0)
+#define TARGET_SSE ((target_flags & MASK_SSE) != 0)
 #define TARGET_SSE2 ((target_flags & MASK_SSE2) != 0)
+#define TARGET_PNI ((target_flags & MASK_PNI) != 0)
 #define TARGET_SSE_MATH ((ix86_fpmath & FPMATH_SSE) != 0)
 #define TARGET_MIX_SSE_I387 ((ix86_fpmath & FPMATH_SSE) \
                             && (ix86_fpmath & FPMATH_387))
@@ -282,6 +313,11 @@ extern int x86_prefetch_sse;
 
 #define TARGET_RED_ZONE (!(target_flags & MASK_NO_RED_ZONE))
 
+#define TARGET_USE_MS_BITFIELD_LAYOUT  (target_flags & MASK_MS_BITFIELD_LAYOUT)
+
+#define TARGET_GNU_TLS (ix86_tls_dialect == TLS_DIALECT_GNU)
+#define TARGET_SUN_TLS (ix86_tls_dialect == TLS_DIALECT_SUN)
+
 /* WARNING: Do not mark empty strings for translation, as calling
             gettext on an empty string does NOT return an empty
             string. */
@@ -343,31 +379,30 @@ extern int x86_prefetch_sse;
     N_("Use push instructions to save outgoing arguments") },                \
   { "no-push-args",            MASK_NO_PUSH_ARGS,                            \
     N_("Do not use push instructions to save outgoing arguments") },         \
-  { "accumulate-outgoing-args",        (MASK_ACCUMULATE_OUTGOING_ARGS                \
-                                | MASK_ACCUMULATE_OUTGOING_ARGS_SET),        \
+  { "accumulate-outgoing-args",        MASK_ACCUMULATE_OUTGOING_ARGS,                \
     N_("Use push instructions to save outgoing arguments") },                \
-  { "no-accumulate-outgoing-args",MASK_ACCUMULATE_OUTGOING_ARGS_SET,         \
+  { "no-accumulate-outgoing-args",-MASK_ACCUMULATE_OUTGOING_ARGS,            \
     N_("Do not use push instructions to save outgoing arguments") },         \
-  { "mmx",                      MASK_MMX | MASK_MMX_SET,                     \
+  { "mmx",                      MASK_MMX,                                    \
     N_("Support MMX built-in functions") },                                  \
   { "no-mmx",                   -MASK_MMX,                                   \
     N_("Do not support MMX built-in functions") },                           \
-  { "no-mmx",                   MASK_MMX_SET, "" },                          \
-  { "3dnow",                     MASK_3DNOW | MASK_3DNOW_SET,                \
+  { "3dnow",                     MASK_3DNOW,                                 \
     N_("Support 3DNow! built-in functions") },                               \
-  { "no-3dnow",                  -MASK_3DNOW, "" },                          \
-  { "no-3dnow",                  MASK_3DNOW_SET,                             \
+  { "no-3dnow",                  -MASK_3DNOW,                                \
     N_("Do not support 3DNow! built-in functions") },                        \
-  { "sse",                      MASK_SSE | MASK_SSE_SET,                     \
+  { "sse",                      MASK_SSE,                                    \
     N_("Support MMX and SSE built-in functions and code generation") },              \
-  { "no-sse",                   -MASK_SSE, "" },                             \
-  { "no-sse",                   MASK_SSE_SET,                                \
+  { "no-sse",                   -MASK_SSE,                                   \
     N_("Do not support MMX and SSE built-in functions and code generation") },\
-  { "sse2",                     MASK_SSE2 | MASK_SSE2_SET,                   \
+  { "sse2",                     MASK_SSE2,                                   \
     N_("Support MMX, SSE and SSE2 built-in functions and code generation") }, \
-  { "no-sse2",                  -MASK_SSE2, "" },                            \
-  { "no-sse2",                  MASK_SSE2_SET,                               \
+  { "no-sse2",                  -MASK_SSE2,                                  \
     N_("Do not support MMX, SSE and SSE2 built-in functions and code generation") },    \
+  { "pni",                      MASK_PNI,                                    \
+    N_("Support MMX, SSE, SSE2 and PNI built-in functions and code generation") },\
+  { "no-pni",                   -MASK_PNI,                                   \
+    N_("Do not support MMX, SSE, SSE2 and PNI built-in functions and code generation") },\
   { "128bit-long-double",       MASK_128BIT_LONG_DOUBLE,                     \
     N_("sizeof(long double) is 16") },                                       \
   { "96bit-long-double",       -MASK_128BIT_LONG_DOUBLE,                     \
@@ -376,43 +411,39 @@ extern int x86_prefetch_sse;
     N_("Generate 64bit x86-64 code") },                                              \
   { "32",                      -MASK_64BIT,                                  \
     N_("Generate 32bit i386 code") },                                        \
+  { "ms-bitfields",            MASK_MS_BITFIELD_LAYOUT,                      \
+    N_("Use native (MS) bitfield layout") },                                 \
+  { "no-ms-bitfields",         -MASK_MS_BITFIELD_LAYOUT,                     \
+    N_("Use gcc default bitfield layout") },                                 \
   { "red-zone",                        -MASK_NO_RED_ZONE,                            \
     N_("Use red-zone in the x86-64 code") },                                 \
   { "no-red-zone",             MASK_NO_RED_ZONE,                             \
     N_("Do not use red-zone in the x86-64 code") },                          \
+  { "tls-direct-seg-refs",     MASK_TLS_DIRECT_SEG_REFS,                     \
+    N_("Use direct references against %gs when accessing tls data") },       \
+  { "no-tls-direct-seg-refs",  -MASK_TLS_DIRECT_SEG_REFS,                    \
+    N_("Do not use direct references against %gs when accessing tls data") }, \
   SUBTARGET_SWITCHES                                                         \
-  { "", TARGET_DEFAULT, 0 }}
+  { "",                                                                              \
+    TARGET_DEFAULT | TARGET_64BIT_DEFAULT | TARGET_SUBTARGET_DEFAULT         \
+    | TARGET_TLS_DIRECT_SEG_REFS_DEFAULT, 0 }}
 
-#ifdef TARGET_64BIT_DEFAULT
-#define TARGET_DEFAULT (MASK_64BIT | TARGET_SUBTARGET_DEFAULT)
-#else
-#define TARGET_DEFAULT TARGET_SUBTARGET_DEFAULT
+#ifndef TARGET_64BIT_DEFAULT
+#define TARGET_64BIT_DEFAULT 0
+#endif
+#ifndef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT
+#define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT 0
 #endif
 
-/* Which processor to schedule for. The cpu attribute defines a list that
-   mirrors this list, so changes to i386.md must be made at the same time.  */
-
-enum processor_type
-{
-  PROCESSOR_I386,                      /* 80386 */
-  PROCESSOR_I486,                      /* 80486DX, 80486SX, 80486DX[24] */
-  PROCESSOR_PENTIUM,
-  PROCESSOR_PENTIUMPRO,
-  PROCESSOR_K6,
-  PROCESSOR_ATHLON,
-  PROCESSOR_PENTIUM4,
-  PROCESSOR_max
-};
-enum fpmath_unit
-{
-  FPMATH_387 = 1,
-  FPMATH_SSE = 2
-};
-
-extern enum processor_type ix86_cpu;
-extern enum fpmath_unit ix86_fpmath;
+/* Once GDB has been enhanced to deal with functions without frame
+   pointers, we can change this to allow for elimination of
+   the frame pointer in leaf functions.  */
+#define TARGET_DEFAULT 0
 
-extern int ix86_arch;
+/* This is not really a target flag, but is done this way so that
+   it's analogous to similar code for Mach-O on PowerPC.  darwin.h
+   redefines this to 1.  */
+#define TARGET_MACHO 0
 
 /* This macro is similar to `TARGET_SWITCHES' but defines names of
    command options that have values.  Its definition is an
@@ -424,33 +455,35 @@ extern int ix86_arch;
    option if the fixed part matches.  The actual option name is made
    by appending `-m' to the specified name.  */
 #define TARGET_OPTIONS                                         \
-{ { "cpu=",            &ix86_cpu_string,                       \
-    N_("Schedule code for given CPU")},                                \
+{ { "tune=",           &ix86_tune_string,                      \
+    N_("Schedule code for given CPU"), 0},                     \
   { "fpmath=",         &ix86_fpmath_string,                    \
-    N_("Generate floating point mathematics using given instruction set")},\
+    N_("Generate floating point mathematics using given instruction set"), 0},\
   { "arch=",           &ix86_arch_string,                      \
-    N_("Generate code for given CPU")},                                \
+    N_("Generate code for given CPU"), 0},                     \
   { "regparm=",                &ix86_regparm_string,                   \
-    N_("Number of registers used to pass integer arguments") },        \
+    N_("Number of registers used to pass integer arguments"), 0},\
   { "align-loops=",    &ix86_align_loops_string,               \
-    N_("Loop code aligned to this power of 2") },              \
+    N_("Loop code aligned to this power of 2"), 0},            \
   { "align-jumps=",    &ix86_align_jumps_string,               \
-    N_("Jump targets are aligned to this power of 2") },       \
+    N_("Jump targets are aligned to this power of 2"), 0},     \
   { "align-functions=",        &ix86_align_funcs_string,               \
-    N_("Function starts are aligned to this power of 2") },    \
+    N_("Function starts are aligned to this power of 2"), 0},  \
   { "preferred-stack-boundary=",                               \
     &ix86_preferred_stack_boundary_string,                     \
-    N_("Attempt to keep stack aligned to this power of 2") },  \
+    N_("Attempt to keep stack aligned to this power of 2"), 0},        \
   { "branch-cost=",    &ix86_branch_cost_string,               \
-    N_("Branches are this expensive (1-5, arbitrary units)") },        \
+    N_("Branches are this expensive (1-5, arbitrary units)"), 0},\
   { "cmodel=", &ix86_cmodel_string,                            \
-    N_("Use given x86-64 code model") },                       \
+    N_("Use given x86-64 code model"), 0},                     \
   { "debug-arg", &ix86_debug_arg_string,                       \
-    "" /* Undocumented. */ },                                  \
+    "" /* Undocumented. */, 0},                                        \
   { "debug-addr", &ix86_debug_addr_string,                     \
-    "" /* Undocumented. */ },                                  \
+    "" /* Undocumented. */, 0},                                        \
   { "asm=", &ix86_asm_string,                                  \
-    N_("Use given assembler dialect") },                       \
+    N_("Use given assembler dialect"), 0},                     \
+  { "tls-dialect=", &ix86_tls_dialect_string,                  \
+    N_("Use given thread-local storage dialect"), 0},          \
   SUBTARGET_OPTIONS                                            \
 }
 
@@ -473,25 +506,177 @@ extern int ix86_arch;
 #define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
   optimization_options ((LEVEL), (SIZE))
 
+/* Support for configure-time defaults of some command line options.  */
+#define OPTION_DEFAULT_SPECS \
+  {"arch", "%{!march=*:-march=%(VALUE)}"}, \
+  {"tune", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \
+  {"cpu", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }
+
 /* Specs for the compiler proper */
 
 #ifndef CC1_CPU_SPEC
 #define CC1_CPU_SPEC "\
-%{!mcpu*: \
-%{m386:-mcpu=i386 \
-%n`-m386' is deprecated. Use `-march=i386' or `-mcpu=i386' instead.\n} \
-%{m486:-mcpu=i486 \
-%n`-m486' is deprecated. Use `-march=i486' or `-mcpu=i486' instead.\n} \
-%{mpentium:-mcpu=pentium \
-%n`-mpentium' is deprecated. Use `-march=pentium' or `-mcpu=pentium' instead.\n} \
-%{mpentiumpro:-mcpu=pentiumpro \
-%n`-mpentiumpro' is deprecated. Use `-march=pentiumpro' or `-mcpu=pentiumpro' instead.\n}} \
+%{!mtune*: \
+%{m386:mtune=i386 \
+%n`-m386' is deprecated. Use `-march=i386' or `-mtune=i386' instead.\n} \
+%{m486:-mtune=i486 \
+%n`-m486' is deprecated. Use `-march=i486' or `-mtune=i486' instead.\n} \
+%{mpentium:-mtune=pentium \
+%n`-mpentium' is deprecated. Use `-march=pentium' or `-mtune=pentium' instead.\n} \
+%{mpentiumpro:-mtune=pentiumpro \
+%n`-mpentiumpro' is deprecated. Use `-march=pentiumpro' or `-mtune=pentiumpro' instead.\n} \
+%{mcpu=*:-mtune=%* \
+%n`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.\n}} \
+%<mcpu=* \
 %{mintel-syntax:-masm=intel \
 %n`-mintel-syntax' is deprecated. Use `-masm=intel' instead.\n} \
 %{mno-intel-syntax:-masm=att \
 %n`-mno-intel-syntax' is deprecated. Use `-masm=att' instead.\n}"
 #endif
 \f
+/* Target CPU builtins.  */
+#define TARGET_CPU_CPP_BUILTINS()                              \
+  do                                                           \
+    {                                                          \
+      size_t arch_len = strlen (ix86_arch_string);             \
+      size_t tune_len = strlen (ix86_tune_string);             \
+      int last_arch_char = ix86_arch_string[arch_len - 1];     \
+      int last_tune_char = ix86_tune_string[tune_len - 1];             \
+                                                               \
+      if (TARGET_64BIT)                                                \
+       {                                                       \
+         builtin_assert ("cpu=x86_64");                        \
+         builtin_define ("__amd64");                           \
+         builtin_define ("__amd64__");                         \
+         builtin_define ("__x86_64");                          \
+         builtin_define ("__x86_64__");                        \
+         builtin_define ("__amd64");                           \
+         builtin_define ("__amd64__");                         \
+       }                                                       \
+      else                                                     \
+       {                                                       \
+         builtin_assert ("cpu=i386");                          \
+         builtin_assert ("machine=i386");                      \
+         builtin_define_std ("i386");                          \
+       }                                                       \
+                                                               \
+      /* Built-ins based on -mtune= (or -march= if no          \
+        -mtune= given).  */                                    \
+      if (TARGET_386)                                          \
+       builtin_define ("__tune_i386__");                       \
+      else if (TARGET_486)                                     \
+       builtin_define ("__tune_i486__");                       \
+      else if (TARGET_PENTIUM)                                 \
+       {                                                       \
+         builtin_define ("__tune_i586__");                     \
+         builtin_define ("__tune_pentium__");                  \
+         if (last_tune_char == 'x')                            \
+           builtin_define ("__tune_pentium_mmx__");            \
+       }                                                       \
+      else if (TARGET_PENTIUMPRO)                              \
+       {                                                       \
+         builtin_define ("__tune_i686__");                     \
+         builtin_define ("__tune_pentiumpro__");               \
+         switch (last_tune_char)                               \
+           {                                                   \
+           case '3':                                           \
+             builtin_define ("__tune_pentium3__");             \
+             /* FALLTHRU */                                    \
+           case '2':                                           \
+             builtin_define ("__tune_pentium2__");             \
+             break;                                            \
+           }                                                   \
+       }                                                       \
+      else if (TARGET_K6)                                      \
+       {                                                       \
+         builtin_define ("__tune_k6__");                       \
+         if (last_tune_char == '2')                            \
+           builtin_define ("__tune_k6_2__");                   \
+         else if (last_tune_char == '3')                       \
+           builtin_define ("__tune_k6_3__");                   \
+       }                                                       \
+      else if (TARGET_ATHLON)                                  \
+       {                                                       \
+         builtin_define ("__tune_athlon__");                   \
+         /* Only plain "athlon" lacks SSE.  */                 \
+         if (last_tune_char != 'n')                            \
+           builtin_define ("__tune_athlon_sse__");             \
+       }                                                       \
+      else if (TARGET_K8)                                      \
+       builtin_define ("__tune_k8__");                         \
+      else if (TARGET_PENTIUM4)                                        \
+       builtin_define ("__tune_pentium4__");                   \
+                                                               \
+      if (TARGET_MMX)                                          \
+       builtin_define ("__MMX__");                             \
+      if (TARGET_3DNOW)                                                \
+       builtin_define ("__3dNOW__");                           \
+      if (TARGET_3DNOW_A)                                      \
+       builtin_define ("__3dNOW_A__");                         \
+      if (TARGET_SSE)                                          \
+       builtin_define ("__SSE__");                             \
+      if (TARGET_SSE2)                                         \
+       builtin_define ("__SSE2__");                            \
+      if (TARGET_PNI)                                          \
+       builtin_define ("__PNI__");                             \
+      if (TARGET_SSE_MATH && TARGET_SSE)                       \
+       builtin_define ("__SSE_MATH__");                        \
+      if (TARGET_SSE_MATH && TARGET_SSE2)                      \
+       builtin_define ("__SSE2_MATH__");                       \
+                                                               \
+      /* Built-ins based on -march=.  */                       \
+      if (ix86_arch == PROCESSOR_I486)                         \
+       {                                                       \
+         builtin_define ("__i486");                            \
+         builtin_define ("__i486__");                          \
+       }                                                       \
+      else if (ix86_arch == PROCESSOR_PENTIUM)                 \
+       {                                                       \
+         builtin_define ("__i586");                            \
+         builtin_define ("__i586__");                          \
+         builtin_define ("__pentium");                         \
+         builtin_define ("__pentium__");                       \
+         if (last_arch_char == 'x')                            \
+           builtin_define ("__pentium_mmx__");                 \
+       }                                                       \
+      else if (ix86_arch == PROCESSOR_PENTIUMPRO)              \
+       {                                                       \
+         builtin_define ("__i686");                            \
+         builtin_define ("__i686__");                          \
+         builtin_define ("__pentiumpro");                      \
+         builtin_define ("__pentiumpro__");                    \
+       }                                                       \
+      else if (ix86_arch == PROCESSOR_K6)                      \
+       {                                                       \
+                                                               \
+         builtin_define ("__k6");                              \
+         builtin_define ("__k6__");                            \
+         if (last_arch_char == '2')                            \
+           builtin_define ("__k6_2__");                        \
+         else if (last_arch_char == '3')                       \
+           builtin_define ("__k6_3__");                        \
+       }                                                       \
+      else if (ix86_arch == PROCESSOR_ATHLON)                  \
+       {                                                       \
+         builtin_define ("__athlon");                          \
+         builtin_define ("__athlon__");                        \
+         /* Only plain "athlon" lacks SSE.  */                 \
+         if (last_arch_char != 'n')                            \
+           builtin_define ("__athlon_sse__");                  \
+       }                                                       \
+      else if (ix86_arch == PROCESSOR_K8)                      \
+       {                                                       \
+         builtin_define ("__k8");                              \
+         builtin_define ("__k8__");                            \
+       }                                                       \
+      else if (ix86_arch == PROCESSOR_PENTIUM4)                        \
+       {                                                       \
+         builtin_define ("__pentium4");                        \
+         builtin_define ("__pentium4__");                      \
+       }                                                       \
+    }                                                          \
+  while (0)
+
 #define TARGET_CPU_DEFAULT_i386 0
 #define TARGET_CPU_DEFAULT_i486 1
 #define TARGET_CPU_DEFAULT_pentium 2
@@ -505,138 +690,12 @@ extern int ix86_arch;
 #define TARGET_CPU_DEFAULT_k6_3 10
 #define TARGET_CPU_DEFAULT_athlon 11
 #define TARGET_CPU_DEFAULT_athlon_sse 12
+#define TARGET_CPU_DEFAULT_k8 13
 
 #define TARGET_CPU_DEFAULT_NAMES {"i386", "i486", "pentium", "pentium-mmx",\
                                  "pentiumpro", "pentium2", "pentium3", \
                                  "pentium4", "k6", "k6-2", "k6-3",\
-                                 "athlon", "athlon-4"}
-#ifndef CPP_CPU_DEFAULT_SPEC
-#if TARGET_CPU_DEFAULT == TARGET_CPU_DEFAULT_i486
-#define CPP_CPU_DEFAULT_SPEC "-D__tune_i486__"
-#endif
-#if TARGET_CPU_DEFAULT == TARGET_CPU_DEFAULT_pentium
-#define CPP_CPU_DEFAULT_SPEC "-D__tune_i586__ -D__tune_pentium__"
-#endif
-#if TARGET_CPU_DEFAULT == TARGET_CPU_DEFAULT_pentium_mmx
-#define CPP_CPU_DEFAULT_SPEC "-D__tune_i586__ -D__tune_pentium__ -D__tune_pentium_mmx__"
-#endif
-#if TARGET_CPU_DEFAULT == TARGET_CPU_DEFAULT_pentiumpro
-#define CPP_CPU_DEFAULT_SPEC "-D__tune_i686__ -D__tune_pentiumpro__"
-#endif
-#if TARGET_CPU_DEFAULT == TARGET_CPU_DEFAULT_pentium2
-#define CPP_CPU_DEFAULT_SPEC "-D__tune_i686__ -D__tune_pentiumpro__\
--D__tune_pentium2__"
-#endif
-#if TARGET_CPU_DEFAULT == TARGET_CPU_DEFAULT_pentium3
-#define CPP_CPU_DEFAULT_SPEC "-D__tune_i686__ -D__tune_pentiumpro__\
--D__tune_pentium2__ -D__tune_pentium3__"
-#endif
-#if TARGET_CPU_DEFAULT == TARGET_CPU_DEFAULT_pentium4
-#define CPP_CPU_DEFAULT_SPEC "-D__tune_pentium4__"
-#endif
-#if TARGET_CPU_DEFAULT == TARGET_CPU_DEFAULT_k6
-#define CPP_CPU_DEFAULT_SPEC "-D__tune_k6__"
-#endif
-#if TARGET_CPU_DEFAULT == TARGET_CPU_DEFAULT_k6_2
-#define CPP_CPU_DEFAULT_SPEC "-D__tune_k6__ -D__tune_k6_2__"
-#endif
-#if TARGET_CPU_DEFAULT == TARGET_CPU_DEFAULT_k6_3
-#define CPP_CPU_DEFAULT_SPEC "-D__tune_k6__ -D__tune_k6_3__"
-#endif
-#if TARGET_CPU_DEFAULT == TARGET_CPU_DEFAULT_athlon
-#define CPP_CPU_DEFAULT_SPEC "-D__tune_athlon__"
-#endif
-#if TARGET_CPU_DEFAULT == TARGET_CPU_DEFAULT_athlon_sse
-#define CPP_CPU_DEFAULT_SPEC "-D__tune_athlon__ -D__tune_athlon_sse__"
-#endif
-#ifndef CPP_CPU_DEFAULT_SPEC
-#define CPP_CPU_DEFAULT_SPEC "-D__tune_i386__"
-#endif
-#endif /* CPP_CPU_DEFAULT_SPEC */
-
-#ifdef TARGET_BI_ARCH
-#define NO_BUILTIN_SIZE_TYPE
-#define NO_BUILTIN_PTRDIFF_TYPE
-#endif
-
-#ifdef NO_BUILTIN_SIZE_TYPE
-#define CPP_CPU32_SIZE_TYPE_SPEC \
-  " -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int"
-#define CPP_CPU64_SIZE_TYPE_SPEC \
-  " -D__SIZE_TYPE__=unsigned\\ long\\ int -D__PTRDIFF_TYPE__=long\\ int"
-#else
-#define CPP_CPU32_SIZE_TYPE_SPEC ""
-#define CPP_CPU64_SIZE_TYPE_SPEC ""
-#endif
-
-#define CPP_CPU32_SPEC \
-  "-Acpu=i386 -Amachine=i386 %{!ansi:%{!std=c*:%{!std=i*:-Di386}}} -D__i386 \
--D__i386__ %(cpp_cpu32sizet)"
-
-#define CPP_CPU64_SPEC \
-  "-Acpu=x86_64 -Amachine=x86_64 -D__x86_64 -D__x86_64__ %(cpp_cpu64sizet)"
-
-#define CPP_CPUCOMMON_SPEC "\
-%{march=i386:%{!mcpu*:-D__tune_i386__ }}\
-%{march=i486:-D__i486 -D__i486__ %{!mcpu*:-D__tune_i486__ }}\
-%{march=pentium|march=i586:-D__i586 -D__i586__ -D__pentium -D__pentium__ \
-  %{!mcpu*:-D__tune_i586__ -D__tune_pentium__ }}\
-%{march=pentium-mmx:-D__i586 -D__i586__ -D__pentium -D__pentium__ \
-  -D__pentium__mmx__ \
-  %{!mcpu*:-D__tune_i586__ -D__tune_pentium__ -D__tune_pentium_mmx__}}\
-%{march=pentiumpro|march=i686:-D__i686 -D__i686__ \
-  -D__pentiumpro -D__pentiumpro__ \
-  %{!mcpu*:-D__tune_i686__ -D__tune_pentiumpro__ }}\
-%{march=k6:-D__k6 -D__k6__ %{!mcpu*:-D__tune_k6__ }}\
-%{march=k6-2:-D__k6 -D__k6__ -D__k6_2__ \
-  %{!mcpu*:-D__tune_k6__ -D__tune_k6_2__ }}\
-%{march=k6-3:-D__k6 -D__k6__ -D__k6_3__ \
-  %{!mcpu*:-D__tune_k6__ -D__tune_k6_3__ }}\
-%{march=athlon|march=athlon-tbird:-D__athlon -D__athlon__ \
-  %{!mcpu*:-D__tune_athlon__ }}\
-%{march=athlon-4|march=athlon-xp|march=athlon-mp:-D__athlon -D__athlon__ \
-  -D__athlon_sse__ \
-  %{!mcpu*:-D__tune_athlon__ -D__tune_athlon_sse__ }}\
-%{march=pentium4:-D__pentium4 -D__pentium4__ %{!mcpu*:-D__tune_pentium4__ }}\
-%{m386|mcpu=i386:-D__tune_i386__ }\
-%{m486|mcpu=i486:-D__tune_i486__ }\
-%{mpentium|mcpu=pentium|mcpu=i586|mcpu=pentium-mmx:-D__tune_i586__ -D__tune_pentium__ }\
-%{mpentiumpro|mcpu=pentiumpro|mcpu=i686|cpu=pentium2|cpu=pentium3:-D__tune_i686__ \
--D__tune_pentiumpro__ }\
-%{mcpu=k6|mcpu=k6-2|mcpu=k6-3:-D__tune_k6__ }\
-%{mcpu=athlon|mcpu=athlon-tbird|mcpu=athlon-4|mcpu=athlon-xp|mcpu=athlon-mp:\
--D__tune_athlon__ }\
-%{mcpu=athlon-4|mcpu=athlon-xp|mcpu=athlon-mp:\
--D__tune_athlon_sse__ }\
-%{mcpu=pentium4:-D__tune_pentium4__ }\
-%{march=athlon-tbird|march=athlon-xp|march=athlon-mp|march=pentium3|march=pentium4:\
--D__SSE__ }\
-%{march=pentium-mmx|march=k6|march=k6-2|march=k6-3\
-|march=athlon|march=athlon-tbird|march=athlon-4|march=athlon-xp\
-|march=athlon-mp|march=pentium2|march=pentium3|march=pentium4: -D__MMX__ }\
-%{march=k6-2|march=k6-3\
-|march=athlon|march=athlon-tbird|march=athlon-4|march=athlon-xp\
-|march=athlon-mp: -D__3dNOW__ }\
-%{march=athlon|march=athlon-tbird|march=athlon-4|march=athlon-xp\
-|march=athlon-mp: -D__3dNOW_A__ }\
-%{march=pentium4: -D__SSE2__ }\
-%{!march*:%{!mcpu*:%{!m386:%{!m486:%{!mpentium*:%(cpp_cpu_default)}}}}}"
-
-#ifndef CPP_CPU_SPEC
-#ifdef TARGET_BI_ARCH
-#ifdef TARGET_64BIT_DEFAULT
-#define CPP_CPU_SPEC "%{m32:%(cpp_cpu32)}%{!m32:%(cpp_cpu64)} %(cpp_cpucommon)"
-#else
-#define CPP_CPU_SPEC "%{m64:%(cpp_cpu64)}%{!m64:%(cpp_cpu32)} %(cpp_cpucommon)"
-#endif
-#else
-#ifdef TARGET_64BIT_DEFAULT
-#define CPP_CPU_SPEC "%(cpp_cpu64) %(cpp_cpucommon)"
-#else
-#define CPP_CPU_SPEC "%(cpp_cpu32) %(cpp_cpucommon)"
-#endif
-#endif
-#endif
+                                 "athlon", "athlon-4", "k8"}
 
 #ifndef CC1_SPEC
 #define CC1_SPEC "%(cc1_cpu) "
@@ -657,13 +716,6 @@ extern int ix86_arch;
 #endif
 
 #define EXTRA_SPECS                                                    \
-  { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC },                         \
-  { "cpp_cpu", CPP_CPU_SPEC },                                         \
-  { "cpp_cpu32", CPP_CPU32_SPEC },                                     \
-  { "cpp_cpu64", CPP_CPU64_SPEC },                                     \
-  { "cpp_cpu32sizet", CPP_CPU32_SIZE_TYPE_SPEC },                      \
-  { "cpp_cpu64sizet", CPP_CPU64_SIZE_TYPE_SPEC },                      \
-  { "cpp_cpucommon", CPP_CPUCOMMON_SPEC },                             \
   { "cc1_cpu",  CC1_CPU_SPEC },                                                \
   SUBTARGET_EXTRA_SPECS
 \f
@@ -671,8 +723,7 @@ extern int ix86_arch;
 
 /* Define for XFmode or TFmode extended real floating point support.
    The XFmode is specified by i386 ABI, while TFmode may be faster
-   due to alignment and simplifications in the address calculations.
- */
+   due to alignment and simplifications in the address calculations.  */
 #define LONG_DOUBLE_TYPE_SIZE (TARGET_128BIT_LONG_DOUBLE ? 128 : 96)
 #define MAX_LONG_DOUBLE_TYPE_SIZE 128
 #ifdef __x86_64__
@@ -680,10 +731,14 @@ extern int ix86_arch;
 #else
 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 96
 #endif
-/* Tell real.c that this is the 80-bit Intel extended float format
-   packaged in a 128-bit or 96bit entity.  */
-#define INTEL_EXTENDED_IEEE_FORMAT 1
 
+/* Set the value of FLT_EVAL_METHOD in float.h.  When using only the
+   FPU, assume that the fpcw is set to extended precision; when using
+   only SSE, rounding is correct; when using both SSE and the FPU,
+   the rounding precision is indeterminate, since either may be chosen
+   apparently at random.  */
+#define TARGET_FLT_EVAL_METHOD \
+  (TARGET_MIX_SSE_I387 ? -1 : TARGET_SSE_MATH ? 0 : 2)
 
 #define SHORT_TYPE_SIZE 16
 #define INT_TYPE_SIZE 32
@@ -693,7 +748,7 @@ extern int ix86_arch;
 #define DOUBLE_TYPE_SIZE 64
 #define LONG_LONG_TYPE_SIZE 64
 
-#if defined (TARGET_BI_ARCH) || defined (TARGET_64BIT_DEFAULT)
+#if defined (TARGET_BI_ARCH) || TARGET_64BIT_DEFAULT
 #define MAX_BITS_PER_WORD 64
 #define MAX_LONG_TYPE_SIZE 64
 #else
@@ -717,7 +772,11 @@ extern int ix86_arch;
 
 /* Width of a word, in units (bytes).  */
 #define UNITS_PER_WORD (TARGET_64BIT ? 8 : 4)
-#define MIN_UNITS_PER_WORD 4
+#ifdef IN_LIBGCC2
+#define MIN_UNITS_PER_WORD     (TARGET_64BIT ? 8 : 4)
+#else
+#define MIN_UNITS_PER_WORD     4
+#endif
 
 /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
 #define PARM_BOUNDARY BITS_PER_WORD
@@ -725,19 +784,22 @@ extern int ix86_arch;
 /* Boundary (in *bits*) on which stack pointer should be aligned.  */
 #define STACK_BOUNDARY BITS_PER_WORD
 
-/* Boundary (in *bits*) on which the stack pointer preferrs to be
+/* Boundary (in *bits*) on which the stack pointer prefers to be
    aligned; the compiler cannot rely on having this alignment.  */
 #define PREFERRED_STACK_BOUNDARY ix86_preferred_stack_boundary
 
 /* As of July 2001, many runtimes to not align the stack properly when
-   entering main.  This causes expand_main_function to forcably align
+   entering main.  This causes expand_main_function to forcibly align
    the stack, which results in aligned frames for functions called from
    main, though it does nothing for the alignment of main itself.  */
 #define FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN \
   (ix86_preferred_stack_boundary > STACK_BOUNDARY && !TARGET_64BIT)
 
-/* Allocation boundary for the code of a function.  */
-#define FUNCTION_BOUNDARY 16
+/* Minimum allocation boundary for the code of a function.  */
+#define FUNCTION_BOUNDARY 8
+
+/* C++ stores the virtual bit in the lowest bit of function pointers.  */
+#define TARGET_PTRMEMFUNC_VBIT_LOCATION ptrmemfunc_vbit_in_pfn
 
 /* Alignment of field after `int : 0' in a structure.  */
 
@@ -747,27 +809,33 @@ extern int ix86_arch;
    and all fundamental data types supported by the hardware
    might need to be aligned. No data type wants to be aligned
    rounder than this.
-   
-   Pentium+ preferrs DFmode values to be aligned to 64 bit boundary
+
+   Pentium+ prefers DFmode values to be aligned to 64 bit boundary
    and Pentium Pro XFmode values at 128 bit boundaries.  */
 
 #define BIGGEST_ALIGNMENT 128
 
-/* Decide whether a variable of mode MODE must be 128 bit aligned.  */
+/* Decide whether a variable of mode MODE should be 128 bit aligned.  */
 #define ALIGN_MODE_128(MODE) \
- ((MODE) == XFmode || (MODE) == TFmode || ((MODE) == TImode) \
-  || (MODE) == V4SFmode        || (MODE) == V4SImode)
+ ((MODE) == XFmode || (MODE) == TFmode || SSE_REG_MODE_P (MODE))
 
 /* The published ABIs say that doubles should be aligned on word
-   boundaries, so lower the aligment for structure fields unless
+   boundaries, so lower the alignment for structure fields unless
    -malign-double is set.  */
-/* BIGGEST_FIELD_ALIGNMENT is also used in libobjc, where it must be
-   constant.  Use the smaller value in that context.  */
-#ifndef IN_TARGET_LIBS
-#define BIGGEST_FIELD_ALIGNMENT (TARGET_64BIT ? 128 : (TARGET_ALIGN_DOUBLE ? 64 : 32))
+
+/* ??? 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
+#ifdef __x86_64__
+#define BIGGEST_FIELD_ALIGNMENT 128
 #else
 #define BIGGEST_FIELD_ALIGNMENT 32
 #endif
+#else
+#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
+   x86_field_alignment (FIELD, COMPUTED)
+#endif
 
 /* If defined, a C expression to compute the alignment given to a
    constant that is being placed in memory.  EXP is the constant
@@ -816,13 +884,13 @@ extern int ix86_arch;
 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
   ix86_function_arg_boundary ((MODE), (TYPE))
 
-/* Set this non-zero if move instructions will actually fail to work
+/* Set this nonzero if move instructions will actually fail to work
    when given unaligned data.  */
 #define STRICT_ALIGNMENT 0
 
 /* If bit field type is int, don't let it cross an int,
    and give entire struct the alignment of an int.  */
-/* Required on the 386 since it doesn't have bitfield insns.  */
+/* Required on the 386 since it doesn't have bit-field insns.  */
 #define PCC_BITFIELD_TYPE_MATTERS 1
 \f
 /* Standard register usage.  */
@@ -861,8 +929,8 @@ extern int ix86_arch;
 /* 1 for registers that have pervasive standard uses
    and are not available for the register allocator.
    On the 80386, the stack pointer is such, as is the arg pointer.
-   The value is an mask - bit 1 is set for fixed registers
+
+   The value is a mask - bit 1 is set for fixed registers
    for 32bit target, while 2 is set for fixed registers for 64bit.
    Proper value is computed in the CONDITIONAL_REGISTER_USAGE.
  */
@@ -879,16 +947,16 @@ extern int ix86_arch;
      1,   1,   1,   1,   1,   1,   1,   1,                     \
 /*xmm8,xmm9,xmm10,xmm11,xmm12,xmm13,xmm14,xmm15*/              \
      1,   1,    1,    1,    1,    1,    1,    1}
+
 
 /* 1 for registers not available across function calls.
    These must include the FIXED_REGISTERS and also any
    registers that can be used without being saved.
    The latter must include the registers where values are returned
    and the register where structure-value addresses are passed.
-   Aside from that, you can include as many other registers as you like. 
-   The value is an mask - bit 1 is set for call used
+   Aside from that, you can include as many other registers as you like.
+
+   The value is a mask - bit 1 is set for call used
    for 32bit target, while 2 is set for call used for 64bit.
    Proper value is computed in the CONDITIONAL_REGISTER_USAGE.
 */
@@ -923,7 +991,7 @@ extern int ix86_arch;
 
 /* ORDER_REGS_FOR_LOCAL_ALLOC is a macro which permits reg_alloc_order
    to be rearranged based on a particular function.  When using sse math,
-   we want to allocase SSE before x87 registers and vice vera.  */
+   we want to allocate SSE before x87 registers and vice vera.  */
 
 #define ORDER_REGS_FOR_LOCAL_ALLOC x86_order_regs_for_local_alloc ()
 
@@ -973,7 +1041,7 @@ do {                                                                       \
    This is ordinarily the length in words of a value of mode MODE
    but can be less for certain modes in special long registers.
 
-   Actually there are no two word move instructions for consecutive 
+   Actually there are no two word move instructions for consecutive
    registers.  And only registers 0-3 may have mov byte instructions
    applied to them.
    */
@@ -1023,6 +1091,17 @@ do {                                                                     \
      || (MODE) == CDImode                                              \
      || (TARGET_64BIT && ((MODE) == TImode || (MODE) == CTImode)))
 
+/* Return true for modes passed in SSE registers.  */
+#define SSE_REG_MODE_P(MODE) \
+ ((MODE) == TImode || (MODE) == V16QImode                              \
+   || (MODE) == V8HImode || (MODE) == V2DFmode || (MODE) == V2DImode   \
+   || (MODE) == V4SFmode || (MODE) == V4SImode)
+
+/* Return true for modes passed in MMX registers.  */
+#define MMX_REG_MODE_P(MODE) \
+ ((MODE) == V8QImode || (MODE) == V4HImode || (MODE) == V2SImode       \
+   || (MODE) == V2SFmode)
+
 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.  */
 
 #define HARD_REGNO_MODE_OK(REGNO, MODE)        \
@@ -1040,10 +1119,13 @@ do {                                                                    \
            && (TARGET_64BIT || !TARGET_PARTIAL_REG_STALL))     \
         || ((MODE1) == DImode && TARGET_64BIT))                        \
        && ((MODE2) == HImode || (MODE2) == SImode              \
-          || ((MODE1) == QImode                                \
+          || ((MODE2) == QImode                                \
               && (TARGET_64BIT || !TARGET_PARTIAL_REG_STALL))  \
           || ((MODE2) == DImode && TARGET_64BIT))))
 
+/* It is possible to write patterns to move flags; but until someone
+   does it,  */
+#define AVOID_CCMODE_COPIES
 
 /* Specify the modes required to caller save a given hard regno.
    We do this on i386 to prevent flags from being saved at all.
@@ -1053,7 +1135,7 @@ do {                                                                      \
 #define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE)                        \
   (CC_REGNO_P (REGNO) ? VOIDmode                                       \
    : (MODE) == VOIDmode && (NREGS) != 1 ? VOIDmode                     \
-   : (MODE) == VOIDmode ? choose_hard_reg_mode ((REGNO), (NREGS))      \
+   : (MODE) == VOIDmode ? choose_hard_reg_mode ((REGNO), (NREGS), false)\
    : (MODE) == HImode && !TARGET_PARTIAL_REG_STALL ? SImode            \
    : (MODE) == QImode && (REGNO) >= 4 && !TARGET_64BIT ? SImode        \
    : (MODE))
@@ -1086,7 +1168,7 @@ do {                                                                      \
 
 #define FIRST_SSE_REG (FRAME_POINTER_REGNUM + 1)
 #define LAST_SSE_REG  (FIRST_SSE_REG + 7)
+
 #define FIRST_MMX_REG  (LAST_SSE_REG + 1)
 #define LAST_MMX_REG   (FIRST_MMX_REG + 7)
 
@@ -1122,9 +1204,20 @@ do {                                                                     \
 /* Register to hold the addressing base for position independent
    code access to data items.  We don't use PIC pointer for 64bit
    mode.  Define the regnum to dummy value to prevent gcc from
-   pessimizing code dealing with EBX.  */
-#define PIC_OFFSET_TABLE_REGNUM \
-  (TARGET_64BIT || !flag_pic ? INVALID_REGNUM : 3)
+   pessimizing code dealing with EBX.
+
+   To avoid clobbering a call-saved register unnecessarily, we renumber
+   the pic register when possible.  The change is visible after the
+   prologue has been emitted.  */
+
+#define REAL_PIC_OFFSET_TABLE_REGNUM  3
+
+#define PIC_OFFSET_TABLE_REGNUM                                \
+  (TARGET_64BIT || !flag_pic ? INVALID_REGNUM          \
+   : reload_completed ? REGNO (pic_offset_table_rtx)   \
+   : REAL_PIC_OFFSET_TABLE_REGNUM)
+
+#define GOT_SYMBOL_NAME "_GLOBAL_OFFSET_TABLE_"
 
 /* Register in which address to store a structure value
    arrives in the function.  On the 386, the prologue
@@ -1152,9 +1245,13 @@ do {                                                                     \
    should always be returned in memory.  You should instead use
    `DEFAULT_PCC_STRUCT_RETURN' to indicate this.  */
 
+int ix86_return_in_memory (tree type);
 #define RETURN_IN_MEMORY(TYPE) \
   ix86_return_in_memory (TYPE)
 
+/* This is overridden by <cygwin.h>.  */
+#define MS_AGGREGATE_RETURN 0
+
 \f
 /* Define the classes of registers for register constraints in the
    machine description.  Also define ranges of constants.
@@ -1317,6 +1414,9 @@ enum reg_class
   (((N) >= FIRST_SSE_REG && (N) <= LAST_SSE_REG) \
    || ((N) >= FIRST_REX_SSE_REG && (N) <= LAST_REX_SSE_REG))
 
+#define REX_SSE_REGNO_P(N) \
+   ((N) >= FIRST_REX_SSE_REG && (N) <= LAST_REX_SSE_REG)
+
 #define SSE_REGNO(N) \
   ((N) < 8 ? FIRST_SSE_REG + (N) : FIRST_REX_SSE_REG + (N) - 8)
 #define SSE_REG_P(N) (REG_P (N) && SSE_REGNO_P (REGNO (N)))
@@ -1326,7 +1426,7 @@ enum reg_class
 
 #define MMX_REGNO_P(N) ((N) >= FIRST_MMX_REG && (N) <= LAST_MMX_REG)
 #define MMX_REG_P(XOP) (REG_P (XOP) && MMX_REGNO_P (REGNO (XOP)))
-  
+
 #define STACK_REG_P(XOP)               \
   (REG_P (XOP) &&                      \
    REGNO (XOP) >= FIRST_STACK_REG &&   \
@@ -1387,7 +1487,7 @@ enum reg_class
    K is for signed imm8 operands.
    L is for andsi as zero-extending move.
    M is for shifts that can be executed by the "lea" opcode.
-   N is for immedaite operands for out/in instructions (0-255)
+   N is for immediate operands for out/in instructions (0-255)
    */
 
 #define CONST_OK_FOR_LETTER_P(VALUE, C)                                \
@@ -1406,7 +1506,7 @@ enum reg_class
 
 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)  \
   ((C) == 'G' ? standard_80387_constant_p (VALUE) \
-   : ((C) == 'H' ? standard_sse_constant_p (VALUE) : 0))
+   : 0)
 
 /* A C expression that defines the optional machine-dependent
    constraint letters that can be used to segregate specific types of
@@ -1420,9 +1520,10 @@ enum reg_class
    the constraint letter C.  If C is not defined as an extra
    constraint, the value returned should be 0 regardless of VALUE.  */
 
-#define EXTRA_CONSTRAINT(VALUE, C)                             \
-  ((C) == 'e' ? x86_64_sign_extended_value (VALUE)             \
-   : (C) == 'Z' ? x86_64_zero_extended_value (VALUE)           \
+#define EXTRA_CONSTRAINT(VALUE, D)                             \
+  ((D) == 'e' ? x86_64_sign_extended_value (VALUE)             \
+   : (D) == 'Z' ? x86_64_zero_extended_value (VALUE)           \
+   : (D) == 'C' ? standard_sse_constant_p (VALUE)              \
    : 0)
 
 /* Place additional restrictions on the register class to use when it
@@ -1457,7 +1558,7 @@ enum reg_class
   ix86_secondary_memory_needed ((CLASS1), (CLASS2), (MODE), 1)
 
 /* QImode spills from non-QI registers need a scratch.  This does not
-   happen often -- the only example so far requires an uninitialized 
+   happen often -- the only example so far requires an uninitialized
    pseudo.  */
 
 #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, OUT)                        \
@@ -1503,8 +1604,22 @@ enum reg_class
    || ((CLASS) == SIREG)                                               \
    || ((CLASS) == DIREG))
 
+/* Return a class of registers that cannot change FROM mode to TO mode.
+  
+   x87 registers can't do subreg as all values are reformated to extended
+   precision.  XMM registers does not support with nonzero offsets equal
+   to 4, 8 and 12 otherwise valid for integer registers. Since we can't
+   determine these, prohibit all nonparadoxical subregs changing size.  */
+
+#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)      \
+  (GET_MODE_SIZE (TO) < GET_MODE_SIZE (FROM)           \
+   ? reg_classes_intersect_p (FLOAT_SSE_REGS, (CLASS)) \
+     || MAYBE_MMX_CLASS_P (CLASS)                      \
+   : GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)                \
+   ? reg_classes_intersect_p (FLOAT_REGS, (CLASS)) : 0)
+
 /* A C statement that adds to CLOBBERS any hard regs the port wishes
-   to automatically clobber for all asms. 
+   to automatically clobber for all asms.
 
    We do this in the new i386 backend to maintain source compatibility
    with the old cc0-based compiler.  */
@@ -1542,7 +1657,7 @@ enum reg_class
    On 386 pushw decrements by exactly 2 no matter what the position was.
    On the 386 there is no pushb; we use pushw instead, and this
    has the effect of rounding up to 2.
+
    For 64bit ABI we round up to 8 bytes.
  */
 
@@ -1564,6 +1679,10 @@ enum reg_class
 
 #define PUSH_ARGS (TARGET_PUSH_ARGS && !ACCUMULATE_OUTGOING_ARGS)
 
+/* We want the stack and args grow in opposite directions, even if
+   PUSH_ARGS is 0.  */
+#define PUSH_ARGS_REVERSED 1
+
 /* Offset of first parameter from the argument pointer register value.  */
 #define FIRST_PARM_OFFSET(FNDECL) 0
 
@@ -1583,18 +1702,7 @@ enum reg_class
    definition that is usually appropriate, refer to expr.h for additional
    documentation. If `REG_PARM_STACK_SPACE' is defined, the argument will be
    computed in the stack and then loaded into a register.  */
-#define MUST_PASS_IN_STACK(MODE, TYPE)                         \
-  ((TYPE) != 0                                                 \
-   && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST             \
-       || TREE_ADDRESSABLE (TYPE)                              \
-       || ((MODE) == TImode)                                   \
-       || ((MODE) == BLKmode                                   \
-          && ! ((TYPE) != 0                                    \
-                && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \
-                && 0 == (int_size_in_bytes (TYPE)              \
-                         % (PARM_BOUNDARY / BITS_PER_UNIT)))   \
-          && (FUNCTION_ARG_PADDING (MODE, TYPE)                \
-              == (BYTES_BIG_ENDIAN ? upward : downward)))))
+#define MUST_PASS_IN_STACK(MODE, TYPE)  ix86_must_pass_in_stack ((MODE), (TYPE))
 
 /* Value is the number of bytes of arguments automatically
    popped when returning from a subroutine call.
@@ -1651,6 +1759,7 @@ typedef struct ix86_args {
   int words;                   /* # words passed so far */
   int nregs;                   /* # registers available for passing */
   int regno;                   /* next available register number */
+  int fastcall;                /* fastcall calling convention is used */
   int sse_words;               /* # sse words passed so far */
   int sse_nregs;               /* # sse registers available for passing */
   int sse_regno;               /* next available sse register number */
@@ -1661,8 +1770,8 @@ typedef struct ix86_args {
    for a call to a function whose data type is FNTYPE.
    For a library call, FNTYPE is 0.  */
 
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
-  init_cumulative_args (&(CUM), (FNTYPE), (LIBNAME))
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL) \
+  init_cumulative_args (&(CUM), (FNTYPE), (LIBNAME), (FNDECL))
 
 /* Update the data in CUM to advance over an argument
    of mode MODE and data type TYPE.
@@ -1693,18 +1802,15 @@ typedef struct ix86_args {
 
 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
 
-/* If PIC, we cannot make sibling calls to global functions
-   because the PLT requires %ebx live.
-   If we are returning floats on the register stack, we cannot make
-   sibling calls to functions that return floats.  (The stack adjust
-   instruction will wind up after the sibcall jump, and not be executed.) */
-#define FUNCTION_OK_FOR_SIBCALL(DECL)                                  \
-  ((DECL)                                                              \
-   && (! flag_pic || ! TREE_PUBLIC (DECL))                             \
-   && (! TARGET_FLOAT_RETURNS_IN_80387                                 \
-       || ! FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (TREE_TYPE (DECL))))    \
-       || FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (TREE_TYPE (cfun->decl))))))
-
+/* A C expression that indicates when an argument must be passed by
+   reference.  If nonzero for an argument, a copy of that argument is
+   made in memory and a pointer to the argument is passed instead of
+   the argument itself.  The pointer is passed in whatever way is
+   appropriate for passing a pointer to that type.  */
+#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
+  function_arg_pass_by_reference(&CUM, MODE, TYPE, NAMED)
 /* Perform any needed actions needed for a function that is receiving a
    variable number of arguments.
 
@@ -1728,42 +1834,30 @@ typedef struct ix86_args {
   ((VALIST) = ix86_build_va_list ())
 
 /* Implement `va_start' for varargs and stdarg.  */
-#define EXPAND_BUILTIN_VA_START(STDARG, VALIST, NEXTARG) \
-  ix86_va_start ((STDARG), (VALIST), (NEXTARG))
+#define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG) \
+  ix86_va_start (VALIST, NEXTARG)
 
 /* Implement `va_arg'.  */
 #define EXPAND_BUILTIN_VA_ARG(VALIST, TYPE) \
   ix86_va_arg ((VALIST), (TYPE))
 
-/* This macro is invoked at the end of compilation.  It is used here to
-   output code for -fpic that will load the return address into %ebx.  */
-
-#undef ASM_FILE_END
-#define ASM_FILE_END(FILE)  ix86_asm_file_end (FILE)
+#define TARGET_ASM_FILE_END ix86_file_end
+#define NEED_INDICATE_EXEC_STACK 0
 
 /* Output assembler code to FILE to increment profiler label # LABELNO
    for profiling a function entry.  */
 
-#define FUNCTION_PROFILER(FILE, LABELNO)                               \
-do {                                                                   \
-  if (flag_pic)                                                                \
-    {                                                                  \
-      fprintf ((FILE), "\tleal\t%sP%d@GOTOFF(%%ebx),%%edx\n",          \
-              LPREFIX, (LABELNO));                                     \
-      fprintf ((FILE), "\tcall\t*_mcount@GOT(%%ebx)\n");               \
-    }                                                                  \
-  else                                                                 \
-    {                                                                  \
-      fprintf ((FILE), "\tmovl\t$%sP%d,%%edx\n", LPREFIX, (LABELNO));  \
-      fprintf ((FILE), "\tcall\t_mcount\n");                           \
-    }                                                                  \
-} while (0)
+#define FUNCTION_PROFILER(FILE, LABELNO) x86_function_profiler (FILE, LABELNO)
+
+#define MCOUNT_NAME "_mcount"
+
+#define PROFILE_COUNT_REGISTER "edx"
 
 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
    the stack pointer does not matter.  The value is tested only in
    functions that have frame pointers.
    No definition is equivalent to always zero.  */
-/* Note on the 386 it might be more efficient not to define this since 
+/* Note on the 386 it might be more efficient not to define this since
    we have to restore it ourselves from the frame pointer, in order to
    use pop */
 
@@ -1825,12 +1919,6 @@ do {                                                                     \
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT 0 */
-/* #define HAVE_POST_DECREMENT 0 */
-
-/* #define HAVE_PRE_DECREMENT 0 */
-/* #define HAVE_PRE_INCREMENT 0 */
-
 /* Macros to check register numbers against specific register classes.  */
 
 /* These assume that REGNO is a hard or pseudo reg number.
@@ -1917,15 +2005,12 @@ do {                                                                    \
 
 #define MAX_REGS_PER_ADDRESS 2
 
-#define CONSTANT_ADDRESS_P(X)                                  \
-  (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF     \
-   || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST       \
-   || GET_CODE (X) == CONST_DOUBLE)
+#define CONSTANT_ADDRESS_P(X)  constant_address_p (X)
 
 /* Nonzero if the constant value X is a legitimate general operand.
    It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
 
-#define LEGITIMATE_CONSTANT_P(X) 1
+#define LEGITIMATE_CONSTANT_P(X)  legitimate_constant_p (X)
 
 #ifdef REG_OK_STRICT
 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                                \
@@ -1985,12 +2070,10 @@ do {                                                                    \
 #define REWRITE_ADDRESS(X) rewrite_address (X)
 
 /* Nonzero if the constant value X is a legitimate general operand
-   when generating PIC code.  It is given that flag_pic is on and 
+   when generating PIC code.  It is given that flag_pic is on and
    that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
 
-#define LEGITIMATE_PIC_OPERAND_P(X)            \
-  (! SYMBOLIC_CONST (X)                                \
-   || legitimate_pic_address_disp_p (X))
+#define LEGITIMATE_PIC_OPERAND_P(X) legitimate_pic_operand_p (X)
 
 #define SYMBOLIC_CONST(X)      \
   (GET_CODE (X) == SYMBOL_REF                                          \
@@ -2036,13 +2119,9 @@ enum ix86_builtins
   IX86_BUILTIN_CMPEQSS,
   IX86_BUILTIN_CMPLTSS,
   IX86_BUILTIN_CMPLESS,
-  IX86_BUILTIN_CMPGTSS,
-  IX86_BUILTIN_CMPGESS,
   IX86_BUILTIN_CMPNEQSS,
   IX86_BUILTIN_CMPNLTSS,
   IX86_BUILTIN_CMPNLESS,
-  IX86_BUILTIN_CMPNGTSS,
-  IX86_BUILTIN_CMPNGESS,
   IX86_BUILTIN_CMPORDSS,
   IX86_BUILTIN_CMPUNORDSS,
   IX86_BUILTIN_CMPNESS,
@@ -2063,9 +2142,12 @@ enum ix86_builtins
   IX86_BUILTIN_CVTPI2PS,
   IX86_BUILTIN_CVTPS2PI,
   IX86_BUILTIN_CVTSI2SS,
+  IX86_BUILTIN_CVTSI642SS,
   IX86_BUILTIN_CVTSS2SI,
+  IX86_BUILTIN_CVTSS2SI64,
   IX86_BUILTIN_CVTTPS2PI,
   IX86_BUILTIN_CVTTSS2SI,
+  IX86_BUILTIN_CVTTSS2SI64,
 
   IX86_BUILTIN_MAXPS,
   IX86_BUILTIN_MAXSS,
@@ -2094,6 +2176,16 @@ enum ix86_builtins
   IX86_BUILTIN_MOVNTPS,
   IX86_BUILTIN_MOVNTQ,
 
+  IX86_BUILTIN_LOADDQA,
+  IX86_BUILTIN_LOADDQU,
+  IX86_BUILTIN_STOREDQA,
+  IX86_BUILTIN_STOREDQU,
+  IX86_BUILTIN_MOVQ,
+  IX86_BUILTIN_LOADD,
+  IX86_BUILTIN_STORED,
+
+  IX86_BUILTIN_CLRTI,
+
   IX86_BUILTIN_PACKSSWB,
   IX86_BUILTIN_PACKSSDW,
   IX86_BUILTIN_PACKUSWB,
@@ -2101,6 +2193,7 @@ enum ix86_builtins
   IX86_BUILTIN_PADDB,
   IX86_BUILTIN_PADDW,
   IX86_BUILTIN_PADDD,
+  IX86_BUILTIN_PADDQ,
   IX86_BUILTIN_PADDSB,
   IX86_BUILTIN_PADDSW,
   IX86_BUILTIN_PADDUSB,
@@ -2108,6 +2201,7 @@ enum ix86_builtins
   IX86_BUILTIN_PSUBB,
   IX86_BUILTIN_PSUBW,
   IX86_BUILTIN_PSUBD,
+  IX86_BUILTIN_PSUBQ,
   IX86_BUILTIN_PSUBSB,
   IX86_BUILTIN_PSUBSW,
   IX86_BUILTIN_PSUBUSB,
@@ -2177,7 +2271,7 @@ enum ix86_builtins
   IX86_BUILTIN_RSQRTSS,
   IX86_BUILTIN_SQRTPS,
   IX86_BUILTIN_SQRTSS,
-  
+
   IX86_BUILTIN_UNPCKHPS,
   IX86_BUILTIN_UNPCKLPS,
 
@@ -2250,13 +2344,9 @@ enum ix86_builtins
   IX86_BUILTIN_CMPEQSD,
   IX86_BUILTIN_CMPLTSD,
   IX86_BUILTIN_CMPLESD,
-  IX86_BUILTIN_CMPGTSD,
-  IX86_BUILTIN_CMPGESD,
   IX86_BUILTIN_CMPNEQSD,
   IX86_BUILTIN_CMPNLTSD,
   IX86_BUILTIN_CMPNLESD,
-  IX86_BUILTIN_CMPNGTSD,
-  IX86_BUILTIN_CMPNGESD,
   IX86_BUILTIN_CMPORDSD,
   IX86_BUILTIN_CMPUNORDSD,
   IX86_BUILTIN_CMPNESD,
@@ -2316,11 +2406,14 @@ enum ix86_builtins
 
   IX86_BUILTIN_CVTPI2PD,
   IX86_BUILTIN_CVTSI2SD,
+  IX86_BUILTIN_CVTSI642SD,
 
   IX86_BUILTIN_CVTSD2SI,
+  IX86_BUILTIN_CVTSD2SI64,
   IX86_BUILTIN_CVTSD2SS,
   IX86_BUILTIN_CVTSS2SD,
   IX86_BUILTIN_CVTTSD2SI,
+  IX86_BUILTIN_CVTTSD2SI64,
 
   IX86_BUILTIN_CVTPS2DQ,
   IX86_BUILTIN_CVTPS2PD,
@@ -2344,6 +2437,7 @@ enum ix86_builtins
   IX86_BUILTIN_MOVMSKPD,
   IX86_BUILTIN_PMOVMSKB128,
   IX86_BUILTIN_MOVQ2DQ,
+  IX86_BUILTIN_MOVDQ2Q,
 
   IX86_BUILTIN_PACKSSWB128,
   IX86_BUILTIN_PACKSSDW128,
@@ -2410,11 +2504,13 @@ enum ix86_builtins
   IX86_BUILTIN_PSRLW128,
   IX86_BUILTIN_PSRLD128,
   IX86_BUILTIN_PSRLQ128,
+  IX86_BUILTIN_PSLLDQI128,
   IX86_BUILTIN_PSLLWI128,
   IX86_BUILTIN_PSLLDI128,
   IX86_BUILTIN_PSLLQI128,
   IX86_BUILTIN_PSRAWI128,
   IX86_BUILTIN_PSRADI128,
+  IX86_BUILTIN_PSRLDQI128,
   IX86_BUILTIN_PSRLWI128,
   IX86_BUILTIN_PSRLDI128,
   IX86_BUILTIN_PSRLQI128,
@@ -2422,60 +2518,35 @@ enum ix86_builtins
   IX86_BUILTIN_PUNPCKHBW128,
   IX86_BUILTIN_PUNPCKHWD128,
   IX86_BUILTIN_PUNPCKHDQ128,
+  IX86_BUILTIN_PUNPCKHQDQ128,
   IX86_BUILTIN_PUNPCKLBW128,
   IX86_BUILTIN_PUNPCKLWD128,
   IX86_BUILTIN_PUNPCKLDQ128,
+  IX86_BUILTIN_PUNPCKLQDQ128,
 
   IX86_BUILTIN_CLFLUSH,
   IX86_BUILTIN_MFENCE,
   IX86_BUILTIN_LFENCE,
 
+  /* Prescott New Instructions.  */
+  IX86_BUILTIN_ADDSUBPS,
+  IX86_BUILTIN_HADDPS,
+  IX86_BUILTIN_HSUBPS,
+  IX86_BUILTIN_MOVSHDUP,
+  IX86_BUILTIN_MOVSLDUP,
+  IX86_BUILTIN_ADDSUBPD,
+  IX86_BUILTIN_HADDPD,
+  IX86_BUILTIN_HSUBPD,
+  IX86_BUILTIN_LOADDDUP,
+  IX86_BUILTIN_MOVDDUP,
+  IX86_BUILTIN_LDDQU,
+
+  IX86_BUILTIN_MONITOR,
+  IX86_BUILTIN_MWAIT,
+
   IX86_BUILTIN_MAX
 };
 \f
-/* Define this macro if references to a symbol must be treated
-   differently depending on something about the variable or
-   function named by the symbol (such as what section it is in).
-
-   On i386, if using PIC, mark a SYMBOL_REF for a non-global symbol
-   so that we may access it directly in the GOT.  */
-
-#define ENCODE_SECTION_INFO(DECL, FIRST)                       \
-do {                                                           \
-    if (flag_pic)                                              \
-      {                                                                \
-       rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'    \
-                  ? TREE_CST_RTL (DECL) : DECL_RTL (DECL));    \
-                                                               \
-       if (GET_CODE (rtl) == MEM)                              \
-         {                                                     \
-           if (TARGET_DEBUG_ADDR                               \
-               && TREE_CODE_CLASS (TREE_CODE (DECL)) == 'd')   \
-             {                                                 \
-               fprintf (stderr, "Encode %s, public = %d\n",    \
-                        IDENTIFIER_POINTER (DECL_NAME (DECL)), \
-                        TREE_PUBLIC (DECL));                   \
-             }                                                 \
-                                                               \
-           SYMBOL_REF_FLAG (XEXP (rtl, 0))                     \
-             = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'      \
-                || ! TREE_PUBLIC (DECL)                        \
-                || MODULE_LOCAL_P (DECL));                     \
-         }                                                     \
-      }                                                                \
-} while (0)
-
-/* The `FINALIZE_PIC' macro serves as a hook to emit these special
-   codes once the function is being compiled into assembly code, but
-   not before.  (It is not done before, because in the case of
-   compiling an inline function, it would lead to multiple PIC
-   prologues being included in functions which used inline functions
-   and were compiled to assembly language.)  */
-
-#define FINALIZE_PIC \
-  (current_function_uses_pic_offset_table |= current_function_profile)
-
-\f
 /* Max number of args passed in registers.  If this is more than 3, we will
    have problems with ebx (register #4), since it is a caller save register and
    is also used as the pic register in ELF.  So for now, don't allow more than
@@ -2534,11 +2605,6 @@ do {                                                             \
    is done just by pretending it is already truncated.  */
 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
 
-/* We assume that the store-condition-codes instructions store 0 for false
-   and some other value for true.  This is the value stored for true.  */
-
-#define STORE_FLAG_VALUE 1
-
 /* When a prototype says `char' or `short', really pass an `int'.
    (The 386 can't easily push less than an int.)  */
 
@@ -2569,255 +2635,6 @@ do {                                                    \
    so give the MEM rtx a byte's mode.  */
 #define FUNCTION_MODE QImode
 \f
-/* A part of a C `switch' statement that describes the relative costs
-   of constant RTL expressions.  It must contain `case' labels for
-   expression codes `const_int', `const', `symbol_ref', `label_ref'
-   and `const_double'.  Each case must ultimately reach a `return'
-   statement to return the relative cost of the use of that kind of
-   constant value in an expression.  The cost may depend on the
-   precise value of the constant, which is available for examination
-   in X, and the rtx code of the expression in which it is contained,
-   found in OUTER_CODE.
-  
-   CODE is the expression code--redundant, since it can be obtained
-   with `GET_CODE (X)'.  */
-
-#define CONST_COSTS(RTX, CODE, OUTER_CODE)                     \
-  case CONST_INT:                                              \
-  case CONST:                                                  \
-  case LABEL_REF:                                              \
-  case SYMBOL_REF:                                             \
-    if (TARGET_64BIT && !x86_64_sign_extended_value (RTX))     \
-      return 3;                                                        \
-    if (TARGET_64BIT && !x86_64_zero_extended_value (RTX))     \
-      return 2;                                                        \
-    return flag_pic && SYMBOLIC_CONST (RTX) ? 1 : 0;           \
-                                                               \
-  case CONST_DOUBLE:                                           \
-    {                                                          \
-      int code;                                                        \
-      if (GET_MODE (RTX) == VOIDmode)                          \
-       return 0;                                               \
-                                                               \
-      code = standard_80387_constant_p (RTX);                  \
-      return code == 1 ? 1 :                                   \
-            code == 2 ? 2 :                                    \
-                        3;                                     \
-    }
-
-/* Delete the definition here when TOPLEVEL_COSTS_N_INSNS gets added to cse.c */
-#define TOPLEVEL_COSTS_N_INSNS(N) \
-  do { total = COSTS_N_INSNS (N); goto egress_rtx_costs; } while (0)
-
-/* Like `CONST_COSTS' but applies to nonconstant RTL expressions.
-   This can be used, for example, to indicate how costly a multiply
-   instruction is.  In writing this macro, you can use the construct
-   `COSTS_N_INSNS (N)' to specify a cost equal to N fast
-   instructions.  OUTER_CODE is the code of the expression in which X
-   is contained.
-
-   This macro is optional; do not define it if the default cost
-   assumptions are adequate for the target machine.  */
-
-#define RTX_COSTS(X, CODE, OUTER_CODE)                                 \
-  case ZERO_EXTEND:                                                    \
-    /* The zero extensions is often completely free on x86_64, so make \
-       it as cheap as possible.  */                                    \
-    if (TARGET_64BIT && GET_MODE (X) == DImode                         \
-       && GET_MODE (XEXP (X, 0)) == SImode)                            \
-      {                                                                        \
-       total = 1; goto egress_rtx_costs;                               \
-      }                                                                \
-    else                                                               \
-      TOPLEVEL_COSTS_N_INSNS (TARGET_ZERO_EXTEND_WITH_AND ?            \
-                             ix86_cost->add : ix86_cost->movzx);       \
-    break;                                                             \
-  case SIGN_EXTEND:                                                    \
-    TOPLEVEL_COSTS_N_INSNS (ix86_cost->movsx);                         \
-    break;                                                             \
-  case ASHIFT:                                                         \
-    if (GET_CODE (XEXP (X, 1)) == CONST_INT                            \
-       && (GET_MODE (XEXP (X, 0)) != DImode || TARGET_64BIT))          \
-      {                                                                        \
-       HOST_WIDE_INT value = INTVAL (XEXP (X, 1));                     \
-       if (value == 1)                                                 \
-         TOPLEVEL_COSTS_N_INSNS (ix86_cost->add);                      \
-       if ((value == 2 || value == 3)                                  \
-           && !TARGET_DECOMPOSE_LEA                                    \
-           && ix86_cost->lea <= ix86_cost->shift_const)                \
-         TOPLEVEL_COSTS_N_INSNS (ix86_cost->lea);                      \
-      }                                                                        \
-    /* fall through */                                                 \
-                                                                       \
-  case ROTATE:                                                         \
-  case ASHIFTRT:                                                       \
-  case LSHIFTRT:                                                       \
-  case ROTATERT:                                                       \
-    if (!TARGET_64BIT && GET_MODE (XEXP (X, 0)) == DImode)             \
-      {                                                                        \
-       if (GET_CODE (XEXP (X, 1)) == CONST_INT)                        \
-         {                                                             \
-           if (INTVAL (XEXP (X, 1)) > 32)                              \
-             TOPLEVEL_COSTS_N_INSNS(ix86_cost->shift_const + 2);       \
-           else                                                        \
-             TOPLEVEL_COSTS_N_INSNS(ix86_cost->shift_const * 2);       \
-         }                                                             \
-       else                                                            \
-         {                                                             \
-           if (GET_CODE (XEXP (X, 1)) == AND)                          \
-             TOPLEVEL_COSTS_N_INSNS(ix86_cost->shift_var * 2);         \
-           else                                                        \
-             TOPLEVEL_COSTS_N_INSNS(ix86_cost->shift_var * 6 + 2);     \
-         }                                                             \
-      }                                                                        \
-    else                                                               \
-      {                                                                        \
-       if (GET_CODE (XEXP (X, 1)) == CONST_INT)                        \
-         TOPLEVEL_COSTS_N_INSNS (ix86_cost->shift_const);              \
-       else                                                            \
-         TOPLEVEL_COSTS_N_INSNS (ix86_cost->shift_var);                \
-      }                                                                        \
-    break;                                                             \
-                                                                       \
-  case MULT:                                                           \
-    if (GET_CODE (XEXP (X, 1)) == CONST_INT)                           \
-      {                                                                        \
-       unsigned HOST_WIDE_INT value = INTVAL (XEXP (X, 1));            \
-       int nbits = 0;                                                  \
-                                                                       \
-       while (value != 0)                                              \
-         {                                                             \
-           nbits++;                                                    \
-           value >>= 1;                                                \
-         }                                                             \
-                                                                       \
-       TOPLEVEL_COSTS_N_INSNS (ix86_cost->mult_init                    \
-                               + nbits * ix86_cost->mult_bit);         \
-      }                                                                        \
-    else                       /* This is arbitrary */                 \
-      TOPLEVEL_COSTS_N_INSNS (ix86_cost->mult_init                     \
-                             + 7 * ix86_cost->mult_bit);               \
-                                                                       \
-  case DIV:                                                            \
-  case UDIV:                                                           \
-  case MOD:                                                            \
-  case UMOD:                                                           \
-    TOPLEVEL_COSTS_N_INSNS (ix86_cost->divide);                                \
-                                                                       \
-  case PLUS:                                                           \
-    if (!TARGET_DECOMPOSE_LEA                                          \
-       && INTEGRAL_MODE_P (GET_MODE (X))                               \
-       && GET_MODE_BITSIZE (GET_MODE (X)) <= GET_MODE_BITSIZE (Pmode)) \
-      {                                                                        \
-        if (GET_CODE (XEXP (X, 0)) == PLUS                             \
-           && GET_CODE (XEXP (XEXP (X, 0), 0)) == MULT                 \
-           && GET_CODE (XEXP (XEXP (XEXP (X, 0), 0), 1)) == CONST_INT  \
-           && CONSTANT_P (XEXP (X, 1)))                                \
-         {                                                             \
-           HOST_WIDE_INT val = INTVAL (XEXP (XEXP (XEXP (X, 0), 0), 1));\
-           if (val == 2 || val == 4 || val == 8)                       \
-             {                                                         \
-               return (COSTS_N_INSNS (ix86_cost->lea)                  \
-                       + rtx_cost (XEXP (XEXP (X, 0), 1),              \
-                                   (OUTER_CODE))                       \
-                       + rtx_cost (XEXP (XEXP (XEXP (X, 0), 0), 0),    \
-                                   (OUTER_CODE))                       \
-                       + rtx_cost (XEXP (X, 1), (OUTER_CODE)));        \
-             }                                                         \
-         }                                                             \
-       else if (GET_CODE (XEXP (X, 0)) == MULT                         \
-                && GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT)      \
-         {                                                             \
-           HOST_WIDE_INT val = INTVAL (XEXP (XEXP (X, 0), 1));         \
-           if (val == 2 || val == 4 || val == 8)                       \
-             {                                                         \
-               return (COSTS_N_INSNS (ix86_cost->lea)                  \
-                       + rtx_cost (XEXP (XEXP (X, 0), 0),              \
-                                   (OUTER_CODE))                       \
-                       + rtx_cost (XEXP (X, 1), (OUTER_CODE)));        \
-             }                                                         \
-         }                                                             \
-       else if (GET_CODE (XEXP (X, 0)) == PLUS)                        \
-         {                                                             \
-           return (COSTS_N_INSNS (ix86_cost->lea)                      \
-                   + rtx_cost (XEXP (XEXP (X, 0), 0), (OUTER_CODE))    \
-                   + rtx_cost (XEXP (XEXP (X, 0), 1), (OUTER_CODE))    \
-                   + rtx_cost (XEXP (X, 1), (OUTER_CODE)));            \
-         }                                                             \
-      }                                                                        \
-                                                                       \
-    /* fall through */                                                 \
-  case AND:                                                            \
-  case IOR:                                                            \
-  case XOR:                                                            \
-  case MINUS:                                                          \
-    if (!TARGET_64BIT && GET_MODE (X) == DImode)                       \
-      return (COSTS_N_INSNS (ix86_cost->add) * 2                       \
-             + (rtx_cost (XEXP (X, 0), (OUTER_CODE))                   \
-                << (GET_MODE (XEXP (X, 0)) != DImode))                 \
-             + (rtx_cost (XEXP (X, 1), (OUTER_CODE))                   \
-                << (GET_MODE (XEXP (X, 1)) != DImode)));               \
-                                                                       \
-    /* fall through */                                                 \
-  case NEG:                                                            \
-  case NOT:                                                            \
-    if (!TARGET_64BIT && GET_MODE (X) == DImode)                       \
-      TOPLEVEL_COSTS_N_INSNS (ix86_cost->add * 2);                     \
-    TOPLEVEL_COSTS_N_INSNS (ix86_cost->add);                           \
-                                                                       \
-  egress_rtx_costs:                                                    \
-    break;
-
-
-/* An expression giving the cost of an addressing mode that contains
-   ADDRESS.  If not defined, the cost is computed from the ADDRESS
-   expression and the `CONST_COSTS' values.
-
-   For most CISC machines, the default cost is a good approximation
-   of the true cost of the addressing mode.  However, on RISC
-   machines, all instructions normally have the same length and
-   execution time.  Hence all addresses will have equal costs.
-
-   In cases where more than one form of an address is known, the form
-   with the lowest cost will be used.  If multiple forms have the
-   same, lowest, cost, the one that is the most complex will be used.
-
-   For example, suppose an address that is equal to the sum of a
-   register and a constant is used twice in the same basic block.
-   When this macro is not defined, the address will be computed in a
-   register and memory references will be indirect through that
-   register.  On machines where the cost of the addressing mode
-   containing the sum is no higher than that of a simple indirect
-   reference, this will produce an additional instruction and
-   possibly require an additional register.  Proper specification of
-   this macro eliminates this overhead for such machines.
-
-   Similar use of this macro is made in strength reduction of loops.
-
-   ADDRESS need not be valid as an address.  In such a case, the cost
-   is not relevant and can be any value; invalid addresses need not be
-   assigned a different cost.
-
-   On machines where an address involving more than one register is as
-   cheap as an address computation involving only one register,
-   defining `ADDRESS_COST' to reflect this can cause two registers to
-   be live over a region of code where only one would have been if
-   `ADDRESS_COST' were not defined in that manner.  This effect should
-   be considered in the definition of this macro.  Equivalent costs
-   should probably only be given to addresses with different numbers
-   of registers on machines with lots of registers.
-
-   This macro will normally either not be defined or be defined as a
-   constant.
-
-   For i386, it is better to use a complex address than let gcc copy
-   the address into a reg and make a new pseudo.  But not if the address
-   requires to two regs - that would mean more pseudos with longer
-   lifetimes.  */
-
-#define ADDRESS_COST(RTX) \
-  ix86_address_cost (RTX)
-
 /* A C expression for the cost of moving data from a register in class FROM to
    one in class TO.  The classes are expressed using the enumeration values
    such as `GENERAL_REGS'.  A value of 2 is the default; other values are
@@ -2869,22 +2686,16 @@ do {                                                    \
    cost many times greater than aligned accesses, for example if they
    are emulated in a trap handler.
 
-   When this macro is non-zero, the compiler will act as if
-   `STRICT_ALIGNMENT' were non-zero when generating code for block
+   When this macro is nonzero, the compiler will act as if
+   `STRICT_ALIGNMENT' were nonzero when generating code for block
    moves.  This can cause significantly more instructions to be
-   produced.  Therefore, do not set this macro non-zero if unaligned
+   produced.  Therefore, do not set this macro nonzero if unaligned
    accesses only add a cycle or two to the time for a memory access.
 
    If the value of this macro is always zero, it need not be defined.  */
 
 /* #define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) 0 */
 
-/* Define this macro to inhibit strength reduction of memory
-   addresses.  (On some machines, such strength reduction seems to do
-   harm rather than good.)  */
-
-/* #define DONT_REDUCE_ADDR */
-
 /* Define this macro if it is as good or better to call a constant
    function address than to call an address kept in a register.
 
@@ -2899,34 +2710,6 @@ do {                                                     \
 
 #define NO_RECURSIVE_FUNCTION_CSE
 \f
-/* Add any extra modes needed to represent the condition code.
-
-   For the i386, we need separate modes when floating-point
-   equality comparisons are being done. 
-   
-   Add CCNO to indicate comparisons against zero that requires
-   Overflow flag to be unset.  Sign bit test is used instead and
-   thus can be used to form "a&b>0" type of tests.
-
-   Add CCGC to indicate comparisons agains zero that allows
-   unspecified garbage in the Carry flag.  This mode is used
-   by inc/dec instructions.
-
-   Add CCGOC to indicate comparisons agains zero that allows
-   unspecified garbage in the Carry and Overflow flag. This
-   mode is used to simulate comparisons of (a-b) and (a+b)
-   against zero using sub/cmp/add operations.
-
-   Add CCZ to indicate that only the Zero flag is valid.  */
-
-#define EXTRA_CC_MODES         \
-       CC (CCGCmode, "CCGC")   \
-       CC (CCGOCmode, "CCGOC") \
-       CC (CCNOmode, "CCNO")   \
-       CC (CCZmode, "CCZ")     \
-       CC (CCFPmode, "CCFP")   \
-       CC (CCFPUmode, "CCFPU")
-
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.
 
@@ -2938,7 +2721,7 @@ do {                                                      \
 
 #define SELECT_CC_MODE(OP, X, Y) ix86_cc_mode ((OP), (X), (Y))
 
-/* Return non-zero if MODE implies a floating point inequality can be
+/* Return nonzero if MODE implies a floating point inequality can be
    reversed.  */
 
 #define REVERSIBLE_CC_MODE(MODE) 1
@@ -2962,7 +2745,7 @@ do {                                                      \
    For float regs, the stack top is sometimes referred to as "%st(0)"
    instead of just "%st".  PRINT_REG handles this with the "y" code.  */
 
-#undef  HI_REGISTER_NAMES                                              
+#undef  HI_REGISTER_NAMES
 #define HI_REGISTER_NAMES                                              \
 {"ax","dx","cx","bx","si","di","bp","sp",                              \
  "st","st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)","",      \
@@ -3012,7 +2795,7 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
 /* Before the prologue, RA is at 0(%esp).  */
 #define INCOMING_RETURN_ADDR_RTX \
   gen_rtx_MEM (VOIDmode, gen_rtx_REG (VOIDmode, STACK_POINTER_REGNUM))
+
 /* After the prologue, RA is at -4(AP) in the current frame.  */
 #define RETURN_ADDR_RTX(COUNT, FRAME)                                     \
   ((COUNT) == 0                                                                   \
@@ -3043,31 +2826,29 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
     ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4\
    : DW_EH_PE_absptr)
 
-/* This is how to output the definition of a user-level label named NAME,
-   such as the label on a static function or variable NAME.  */
-
-#define ASM_OUTPUT_LABEL(FILE, NAME)   \
-  (assemble_name ((FILE), (NAME)), fputs (":\n", (FILE)))
-
-/* Store in OUTPUT a string (made with alloca) containing
-   an assembler-name for a local static variable named NAME.
-   LABELNO is an integer which is different for each call.  */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10),   \
-  sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
 /* This is how to output an insn to push a register on the stack.
    It need not be very fast code.  */
 
 #define ASM_OUTPUT_REG_PUSH(FILE, REGNO)  \
-  asm_fprintf ((FILE), "\tpush{l}\t%%e%s\n", reg_names[(REGNO)])
+do {                                                                   \
+  if (TARGET_64BIT)                                                    \
+    asm_fprintf ((FILE), "\tpush{q}\t%%r%s\n",                         \
+                reg_names[(REGNO)] + (REX_INT_REGNO_P (REGNO) != 0));  \
+  else                                                                 \
+    asm_fprintf ((FILE), "\tpush{l}\t%%e%s\n", reg_names[(REGNO)]);    \
+} while (0)
 
 /* This is how to output an insn to pop a register from the stack.
    It need not be very fast code.  */
 
 #define ASM_OUTPUT_REG_POP(FILE, REGNO)  \
-  asm_fprintf ((FILE), "\tpop{l}\t%%e%s\n", reg_names[(REGNO)])
+do {                                                                   \
+  if (TARGET_64BIT)                                                    \
+    asm_fprintf ((FILE), "\tpop{q}\t%%r%s\n",                          \
+                reg_names[(REGNO)] + (REX_INT_REGNO_P (REGNO) != 0));  \
+  else                                                                 \
+    asm_fprintf ((FILE), "\tpop{l}\t%%e%s\n", reg_names[(REGNO)]);     \
+} while (0)
 
 /* This is how to output an element of a case-vector that is absolute.  */
 
@@ -3085,16 +2866,18 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
 #define JUMP_TABLES_IN_TEXT_SECTION \
   (!TARGET_64BIT && flag_pic && !HAVE_AS_GOTOFF_IN_DATA)
 
-/* A C statement that outputs an address constant appropriate to 
+/* A C statement that outputs an address constant appropriate to
    for DWARF debugging.  */
 
 #define ASM_OUTPUT_DWARF_ADDR_CONST(FILE, X) \
   i386_dwarf_output_addr_const ((FILE), (X))
 
-/* Either simplify a location expression, or return the original.  */
+/* Emit a dtp-relative reference to a TLS variable.  */
 
-#define ASM_SIMPLIFY_DWARF_ADDR(X) \
-  i386_simplify_dwarf_addr (X)
+#ifdef HAVE_AS_TLS
+#define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \
+  i386_output_dwarf_dtprel (FILE, SIZE, X)
+#endif
 
 /* Switch to init or fini section via SECTION_OP, emit a call to FUNC,
    and switch back.  For x86 we do this only to save a few bytes that
@@ -3110,7 +2893,7 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
    print_operand function.  */
 
 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
-  ((CODE) == '*' || (CODE) == '+')
+  ((CODE) == '*' || (CODE) == '+' || (CODE) == '&')
 
 /* Print the name of a register based on its machine mode and number.
    If CODE is 'w', pretend the mode is HImode.
@@ -3129,6 +2912,12 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
 #define PRINT_OPERAND_ADDRESS(FILE, ADDR)  \
   print_operand_address ((FILE), (ADDR))
 
+#define OUTPUT_ADDR_CONST_EXTRA(FILE, X, FAIL) \
+do {                                           \
+  if (! output_addr_const_extra (FILE, (X)))   \
+    goto FAIL;                                 \
+} while (0);
+
 /* Print the name of a register for based on its machine mode and number.
    This macro is used to print debugging output.
    This macro is different from PRINT_REG in that it may be used in
@@ -3219,21 +3008,29 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
                                       SYMBOL_REF, LABEL_REF}},         \
   {"shiftdi_operand", {SUBREG, REG, MEM}},                             \
   {"const_int_1_operand", {CONST_INT}},                                        \
+  {"const_int_1_31_operand", {CONST_INT}},                             \
   {"symbolic_operand", {SYMBOL_REF, LABEL_REF, CONST}},                        \
   {"aligned_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,     \
                       LABEL_REF, SUBREG, REG, MEM}},                   \
   {"pic_symbolic_operand", {CONST}},                                   \
   {"call_insn_operand", {REG, SUBREG, MEM, SYMBOL_REF}},               \
+  {"sibcall_insn_operand", {REG, SUBREG, SYMBOL_REF}},                 \
   {"constant_call_address_operand", {SYMBOL_REF, CONST}},              \
   {"const0_operand", {CONST_INT, CONST_DOUBLE}},                       \
   {"const1_operand", {CONST_INT}},                                     \
   {"const248_operand", {CONST_INT}},                                   \
+  {"const_0_to_3_operand", {CONST_INT}},                               \
+  {"const_0_to_7_operand", {CONST_INT}},                               \
+  {"const_0_to_15_operand", {CONST_INT}},                              \
+  {"const_0_to_255_operand", {CONST_INT}},                             \
   {"incdec_operand", {CONST_INT}},                                     \
   {"mmx_reg_operand", {REG}},                                          \
   {"reg_no_sp_operand", {SUBREG, REG}},                                        \
   {"general_no_elim_operand", {CONST_INT, CONST_DOUBLE, CONST,         \
                        SYMBOL_REF, LABEL_REF, SUBREG, REG, MEM}},      \
   {"nonmemory_no_elim_operand", {CONST_INT, REG, SUBREG}},             \
+  {"index_register_operand", {SUBREG, REG}},                           \
+  {"flags_reg_operand", {REG}},                                                \
   {"q_regs_operand", {SUBREG, REG}},                                   \
   {"non_q_regs_operand", {SUBREG, REG}},                               \
   {"fcmov_comparison_operator", {EQ, NE, LTU, GTU, LEU, GEU, UNORDERED, \
@@ -3245,6 +3042,8 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
   {"ix86_comparison_operator", {EQ, NE, LE, LT, GE, GT, LEU, LTU, GEU, \
                               GTU, UNORDERED, ORDERED, UNLE, UNLT,     \
                               UNGE, UNGT, LTGT, UNEQ }},               \
+  {"ix86_carry_flag_operator", {LTU, LT, UNLT, GT, UNGT, LE, UNLE,     \
+                                GE, UNGE, LTGT, UNEQ}},                \
   {"cmp_fp_expander_operand", {CONST_DOUBLE, SUBREG, REG, MEM}},       \
   {"ext_register_operand", {SUBREG, REG}},                             \
   {"binary_fp_operator", {PLUS, MINUS, MULT, DIV}},                    \
@@ -3258,7 +3057,20 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
   {"memory_displacement_operand", {MEM}},                              \
   {"cmpsi_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,       \
                     LABEL_REF, SUBREG, REG, MEM, AND}},                \
-  {"long_memory_operand", {MEM}},
+  {"long_memory_operand", {MEM}},                                      \
+  {"tls_symbolic_operand", {SYMBOL_REF}},                              \
+  {"global_dynamic_symbolic_operand", {SYMBOL_REF}},                   \
+  {"local_dynamic_symbolic_operand", {SYMBOL_REF}},                    \
+  {"initial_exec_symbolic_operand", {SYMBOL_REF}},                     \
+  {"local_exec_symbolic_operand", {SYMBOL_REF}},                       \
+  {"any_fp_register_operand", {REG}},                                  \
+  {"register_and_not_any_fp_reg_operand", {REG}},                      \
+  {"fp_register_operand", {REG}},                                      \
+  {"register_and_not_fp_reg_operand", {REG}},                          \
+  {"zero_extended_scalar_load_operand", {MEM}},                                \
+  {"vector_move_operand", {CONST_VECTOR, SUBREG, REG, MEM}},           \
+  {"no_seg_address_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \
+                             LABEL_REF, SUBREG, REG, MEM, PLUS, MULT}},
 
 /* A list of predicates that do special things with modes, and so
    should not elicit warnings for VOIDmode match_operand.  */
@@ -3266,57 +3078,91 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
 #define SPECIAL_MODE_PREDICATES \
   "ext_register_operand",
 \f
-/* CM_32 is used by 32bit ABI
-   CM_SMALL is small model assuming that all code and data fits in the first
-   31bits of address space.
-   CM_KERNEL is model assuming that all code and data fits in the negative
-   31bits of address space.
-   CM_MEDIUM is model assuming that code fits in the first 31bits of address
-   space.  Size of data is unlimited.
-   CM_LARGE is model making no assumptions about size of particular sections.
-  
-   CM_SMALL_PIC is model for PIC libraries assuming that code+data+got/plt
-   tables first in 31bits of address space.
- */
+/* Which processor to schedule for. The cpu attribute defines a list that
+   mirrors this list, so changes to i386.md must be made at the same time.  */
+
+enum processor_type
+{
+  PROCESSOR_I386,                      /* 80386 */
+  PROCESSOR_I486,                      /* 80486DX, 80486SX, 80486DX[24] */
+  PROCESSOR_PENTIUM,
+  PROCESSOR_PENTIUMPRO,
+  PROCESSOR_K6,
+  PROCESSOR_ATHLON,
+  PROCESSOR_PENTIUM4,
+  PROCESSOR_K8,
+  PROCESSOR_max
+};
+
+extern enum processor_type ix86_tune;
+extern const char *ix86_tune_string;
+
+extern enum processor_type ix86_arch;
+extern const char *ix86_arch_string;
+
+enum fpmath_unit
+{
+  FPMATH_387 = 1,
+  FPMATH_SSE = 2
+};
+
+extern enum fpmath_unit ix86_fpmath;
+extern const char *ix86_fpmath_string;
+
+enum tls_dialect
+{
+  TLS_DIALECT_GNU,
+  TLS_DIALECT_SUN
+};
+
+extern enum tls_dialect ix86_tls_dialect;
+extern const char *ix86_tls_dialect_string;
+
 enum cmodel {
-  CM_32,
-  CM_SMALL,
-  CM_KERNEL,
-  CM_MEDIUM,
-  CM_LARGE,
-  CM_SMALL_PIC
+  CM_32,       /* The traditional 32-bit ABI.  */
+  CM_SMALL,    /* Assumes all code and data fits in the low 31 bits.  */
+  CM_KERNEL,   /* Assumes all code and data fits in the high 31 bits.  */
+  CM_MEDIUM,   /* Assumes code fits in the low 31 bits; data unlimited.  */
+  CM_LARGE,    /* No assumptions.  */
+  CM_SMALL_PIC /* Assumes code+data+got/plt fits in a 31 bit region.  */
 };
 
+extern enum cmodel ix86_cmodel;
+extern const char *ix86_cmodel_string;
+
 /* Size of the RED_ZONE area.  */
 #define RED_ZONE_SIZE 128
 /* Reserved area of the red zone for temporaries.  */
 #define RED_ZONE_RESERVE 8
-extern const char *ix86_debug_arg_string, *ix86_debug_addr_string;
 
 enum asm_dialect {
   ASM_ATT,
   ASM_INTEL
 };
+
 extern const char *ix86_asm_string;
 extern enum asm_dialect ix86_asm_dialect;
-/* Value of -mcmodel specified by user.  */
-extern const char *ix86_cmodel_string;
-extern enum cmodel ix86_cmodel;
-\f
-/* Variables in i386.c */
-extern const char *ix86_cpu_string;            /* for -mcpu=<xxx> */
-extern const char *ix86_arch_string;           /* for -march=<xxx> */
-extern const char *ix86_fpmath_string;         /* for -mfpmath=<xxx> */
-extern const char *ix86_regparm_string;                /* # registers to use to pass args */
-extern const char *ix86_align_loops_string;    /* power of two alignment for loops */
-extern const char *ix86_align_jumps_string;    /* power of two alignment for non-loop jumps */
-extern const char *ix86_align_funcs_string;    /* power of two alignment for functions */
-extern const char *ix86_preferred_stack_boundary_string;/* power of two alignment for stack boundary */
-extern const char *ix86_branch_cost_string;    /* values 1-5: see jump.c */
-extern int ix86_regparm;                       /* ix86_regparm_string as a number */
-extern int ix86_preferred_stack_boundary;      /* preferred stack boundary alignment in bits */
-extern int ix86_branch_cost;                   /* values 1-5: see jump.c */
-extern enum reg_class const regclass_map[FIRST_PSEUDO_REGISTER]; /* smalled class containing REGNO */
+
+extern int ix86_regparm;
+extern const char *ix86_regparm_string;
+
+extern int ix86_preferred_stack_boundary;
+extern const char *ix86_preferred_stack_boundary_string;
+
+extern int ix86_branch_cost;
+extern const char *ix86_branch_cost_string;
+
+extern const char *ix86_debug_arg_string;
+extern const char *ix86_debug_addr_string;
+
+/* Obsoleted by -f options.  Remove before 3.2 ships.  */
+extern const char *ix86_align_loops_string;
+extern const char *ix86_align_jumps_string;
+extern const char *ix86_align_funcs_string;
+
+/* Smallest class containing REGNO.  */
+extern enum reg_class const regclass_map[FIRST_PSEUDO_REGISTER];
+
 extern rtx ix86_compare_op0;   /* operand 0 for comparisons */
 extern rtx ix86_compare_op1;   /* operand 1 for comparisons */
 \f
@@ -3326,12 +3172,12 @@ extern rtx ix86_compare_op1;    /* operand 1 for comparisons */
    redundant computation of new control word by the mode switching pass.
    The fldcw instructions are still emitted redundantly, but this is probably
    not going to be noticeable problem, as most CPUs do have fast path for
-   the sequence.  
+   the sequence.
 
    The machinery is to emit simple truncation instructions and split them
    before reload to instructions having USEs of two memory locations that
    are filled by this code to old and new control word.
+
    Post-reload pass may be later used to eliminate the redundant fildcw if
    needed.  */
 
@@ -3340,7 +3186,7 @@ enum fp_cw_mode {FP_CW_STORED, FP_CW_UNINITIALIZED, FP_CW_ANY};
 /* Define this macro if the port needs extra instructions inserted
    for mode switching in an optimizing compilation.  */
 
-#define OPTIMIZE_MODE_SWITCHING(ENTITY) 1
+#define OPTIMIZE_MODE_SWITCHING(ENTITY) ix86_optimize_mode_switching
 
 /* If you define `OPTIMIZE_MODE_SWITCHING', you have to define this as
    initializer for an array of integers.  Each initializer element N
@@ -3392,6 +3238,33 @@ enum fp_cw_mode {FP_CW_STORED, FP_CW_UNINITIALIZED, FP_CW_ANY};
    ((SRC) < FIRST_STACK_REG || (SRC) > LAST_STACK_REG)
 
 \f
+#define DLL_IMPORT_EXPORT_PREFIX '#'
+
+#define FASTCALL_PREFIX '@'
+\f
+struct machine_function GTY(())
+{
+  struct stack_local_entry *stack_locals;
+  const char *some_ld_name;
+  int save_varrargs_registers;
+  int accesses_prev_frame;
+  int optimize_mode_switching;
+  /* Set by ix86_compute_frame_layout and used by prologue/epilogue expander to
+     determine the style used.  */
+  int use_fast_prologue_epilogue;
+  /* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE has been computed
+     for.  */
+  int use_fast_prologue_epilogue_nregs;
+};
+
+#define ix86_stack_locals (cfun->machine->stack_locals)
+#define ix86_save_varrargs_registers (cfun->machine->save_varrargs_registers)
+#define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching)
+
+/* Control behavior of x86_file_start.  */
+#define X86_FILE_START_VERSION_DIRECTIVE false
+#define X86_FILE_START_FLTUSED false
+
 /*
 Local variables:
 version-control: t