OSDN Git Service

* config/i386/i386.h (TARGET_FPMATH_DEFAULT): New.
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Apr 2005 01:46:38 +0000 (01:46 +0000)
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Apr 2005 01:46:38 +0000 (01:46 +0000)
* config/i386/darwin.h (TARGET_FPMATH_DEFAULT): New.
* config/i386/i386.c (override_options): Use TARGET_FPMATH_DEFAULT.

* config/i386/darwin.h (ASM_SPEC): Use -arch i386 not -arch i686.
(SUBTARGET_EXTRA_SPECS): Always 'i386'.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98001 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/darwin.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h

index 09b82ce..80308c8 100644 (file)
        
 2005-04-11  Geoffrey Keating  <geoffk@apple.com>
 
+       * config/i386/i386.h (TARGET_FPMATH_DEFAULT): New.
+       * config/i386/darwin.h (TARGET_FPMATH_DEFAULT): New.
+       * config/i386/i386.c (override_options): Use TARGET_FPMATH_DEFAULT.
+
+       * config/i386/darwin.h (ASM_SPEC): Use -arch i386 not -arch i686.
+       (SUBTARGET_EXTRA_SPECS): Always 'i386'.
+
        * dwarf2out.c (output_line_info): Don't try to dereference
        a NULL current_function_decl.
 
index 7d16c36..b526e22 100644 (file)
@@ -1,5 +1,5 @@
 /* Target definitions for x86 running Darwin.
-   Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
    Contributed by Apple Computer Inc.
 
 This file is part of GCC.
@@ -25,6 +25,9 @@ Boston, MA 02111-1307, USA.  */
 
 #define TARGET_VERSION fprintf (stderr, " (i686 Darwin)");
 
+#undef TARGET_FPMATH_DEFAULT
+#define TARGET_FPMATH_DEFAULT (TARGET_SSE ? FPMATH_SSE : FPMATH_387)
+
 #define TARGET_OS_CPP_BUILTINS()                \
   do                                            \
     {                                           \
@@ -43,13 +46,12 @@ Boston, MA 02111-1307, USA.  */
   %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }}"
 
 #undef ASM_SPEC
-#define ASM_SPEC "-arch i686 -force_cpusubtype_ALL"
+#define ASM_SPEC "-arch i386 -force_cpusubtype_ALL"
 
 #undef SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS                                  \
-  { "darwin_arch", "i686" },                                   \
-  { "darwin_subarch", "%{march=pentium3:pentIIm3;:i686}" },
-   
+  { "darwin_arch", "i386" },                                   \
+  { "darwin_subarch", "i386" },
 
 /* Use the following macro for any Darwin/x86-specific command-line option
    translation.  */
index 9634ff4..b567069 100644 (file)
@@ -1516,19 +1516,17 @@ override_options (void)
       target_flags
        |= ((MASK_SSE2 | MASK_SSE | MASK_MMX | MASK_128BIT_LONG_DOUBLE)
            & ~target_flags_explicit);
-
-      if (TARGET_SSE)
-       ix86_fpmath = FPMATH_SSE;
      }
   else
     {
-      ix86_fpmath = FPMATH_387;
       /* i386 ABI does not specify red zone.  It still makes sense to use it
          when programmer takes care to stack from being destroyed.  */
       if (!(target_flags_explicit & MASK_NO_RED_ZONE))
         target_flags |= MASK_NO_RED_ZONE;
     }
 
+  ix86_fpmath = TARGET_FPMATH_DEFAULT;
+
   if (ix86_fpmath_string != 0)
     {
       if (! strcmp (ix86_fpmath_string, "387"))
index ffba1d7..20bd099 100644 (file)
@@ -104,6 +104,11 @@ extern int target_flags;
 #endif
 #endif
 
+#ifndef TARGET_FPMATH_DEFAULT
+#define TARGET_FPMATH_DEFAULT \
+  (TARGET_64BIT && TARGET_SSE ? FPMATH_SSE : FPMATH_387)
+#endif
+
 /* Masks for the -m switches */
 #define MASK_80387             0x00000001      /* Hardware floating point */
 #define MASK_RTD               0x00000002      /* Use ret that pops args */