]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
config.gcc (mips*-sde-elf*): Don't use sdemtk.opt.
authorRichard Sandiford <rdsandiford@googlemail.com>
Thu, 20 May 2010 22:20:34 +0000 (22:20 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 20 May 2010 22:20:34 +0000 (22:20 +0000)
2010-05-08  Richard Sandiford  <rdsandiford@googlemail.com>
    Jim Wilson  <wilson@codesourcery.com>

gcc/
* config.gcc (mips*-sde-elf*): Don't use sdemtk.opt.
* config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Define __mips_no_float
for TARGET_NO_FLOAT.
* config/mips/mips.c (mips_file_start): Expand conditional expression
into "if" statements.  Use .gnu_attribute 4,0 for TARGET_NO_FLOAT.
(mips_override_options): Move -mno-float override -msoft-float and
-mhard-float.
* config/mips/mips.opt (mno-float): Move from sdemtk.opt, but add
Condition(TARGET_SUPPORTS_NO_FLOAT).
* config/mips/sdemtk.h (TARGET_OS_CPP_BUILTINS): Don't set
__mips_no_float here.
(SUBTARGET_OVERRIDE_OPTIONS): Delete.
(TARGET_SUPPORTS_NO_FLOAT): Define.
* config/mips/sdemtk.opt: Delete.

From-SVN: r159642

gcc/ChangeLog
gcc/config.gcc
gcc/config/mips/mips.c
gcc/config/mips/mips.h
gcc/config/mips/mips.opt
gcc/config/mips/sdemtk.h
gcc/config/mips/sdemtk.opt [deleted file]

index 5ab1bcaaec64275531b049b362af27579f654881..5687a0c295ed3b318dd2d5ea19d432b515bfec3b 100644 (file)
@@ -1,3 +1,20 @@
+2010-05-20  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * config.gcc (mips*-sde-elf*): Don't use sdemtk.opt.
+       * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Define __mips_no_float
+       for TARGET_NO_FLOAT.
+       * config/mips/mips.c (mips_file_start): Expand conditional expression
+       into "if" statements.  Use .gnu_attribute 4,0 for TARGET_NO_FLOAT.
+       (mips_override_options): Move -mno-float override -msoft-float and
+       -mhard-float.
+       * config/mips/mips.opt (mno-float): Move from sdemtk.opt, but add
+       Condition(TARGET_SUPPORTS_NO_FLOAT).
+       * config/mips/sdemtk.h (TARGET_OS_CPP_BUILTINS): Don't set
+       __mips_no_float here.
+       (SUBTARGET_OVERRIDE_OPTIONS): Delete.
+       (TARGET_SUPPORTS_NO_FLOAT): Define.
+       * config/mips/sdemtk.opt: Delete.
+
 2010-05-20  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * ipa-prop.c (compute_complex_ancestor_jump_func): Bail
index 30c15ad116d97cbf06afd062a4c745e38408a8a7..06e694baded1968e6f454f05f878bb5a5f24b029 100644 (file)
@@ -1760,7 +1760,6 @@ mips*-sde-elf*)
            # MIPS toolkit libraries.
            tm_file="$tm_file mips/sdemtk.h"
            tmake_file="$tmake_file mips/t-sdemtk"
-           extra_options="$extra_options mips/sdemtk.opt"
            case ${enable_threads} in
              "" | yes | mipssde)
                thread_file='mipssde'
index 38664b5aac485d6123a02ae550374f5f70400468..9c897c24ef888467323f7c183f3b12d5bd5f670c 100644 (file)
@@ -8172,10 +8172,27 @@ mips_file_start (void)
                 "\t.previous\n", TARGET_LONG64 ? 64 : 32);
 
 #ifdef HAVE_AS_GNU_ATTRIBUTE
-      fprintf (asm_out_file, "\t.gnu_attribute 4, %d\n",
-              (TARGET_HARD_FLOAT_ABI
-               ? (TARGET_DOUBLE_FLOAT
-                  ? ((!TARGET_64BIT && TARGET_FLOAT64) ? 4 : 1) : 2) : 3));
+      {
+       int attr;
+
+       /* No floating-point operations, -mno-float.  */
+       if (TARGET_NO_FLOAT)
+         attr = 0;
+       /* Soft-float code, -msoft-float.  */
+       else if (!TARGET_HARD_FLOAT_ABI)
+         attr = 3;
+       /* Single-float code, -msingle-float.  */
+       else if (!TARGET_DOUBLE_FLOAT)
+         attr = 2;
+       /* 64-bit FP registers on a 32-bit target, -mips32r2 -mfp64.  */
+       else if (!TARGET_64BIT && TARGET_FLOAT64)
+         attr = 4;
+       /* Regular FP code, FP regs same size as GP regs, -mdouble-float.  */
+       else
+         attr = 1;
+
+       fprintf (asm_out_file, "\t.gnu_attribute 4, %d\n", attr);
+      }
 #endif
     }
 
@@ -15405,6 +15422,13 @@ mips_override_options (void)
   SUBTARGET_OVERRIDE_OPTIONS;
 #endif
 
+  /* -mno-float overrides -mhard-float and -msoft-float.  */
+  if (TARGET_NO_FLOAT)
+    {
+      target_flags |= MASK_SOFT_FLOAT_ABI;
+      target_flags_explicit |= MASK_SOFT_FLOAT_ABI;
+    }
+
   /* Set the small data limit.  */
   mips_small_data_threshold = (g_switch_set
                               ? g_switch_value
index 891ea1ffddc06e6148a0c4f855bc772959cfbac0..dcac46ba45acf5abc20ef169d60f18424198a9b5 100644 (file)
@@ -536,7 +536,9 @@ enum mips_code_readable_setting {
                                                                        \
       /* These defines reflect the ABI in use, not whether the         \
         FPU is directly accessible.  */                                \
-      if (TARGET_HARD_FLOAT_ABI)                                       \
+      if (TARGET_NO_FLOAT)                                             \
+       builtin_define ("__mips_no_float");                             \
+      else if (TARGET_HARD_FLOAT_ABI)                                  \
        builtin_define ("__mips_hard_float");                           \
       else                                                             \
        builtin_define ("__mips_soft_float");                           \
index 188d5e1700690f5d4acdd7d338ebe0f53b81319f..94714878debbc5c7808054f52235d4c02ff2606a 100644 (file)
@@ -224,6 +224,10 @@ mmt
 Target Report Var(TARGET_MT)
 Allow the use of MT instructions
 
+mno-float
+Target Report RejectNegative Var(TARGET_NO_FLOAT) Condition(TARGET_SUPPORTS_NO_FLOAT)
+Prevent the use of all floating-point operations
+
 mno-flush-func
 Target RejectNegative
 Do not use a cache-flushing function before calling stack trampolines
index a9bb85e82b6e240df6b18cc9609a09fa4ac0a3b9..e927a6021b1de7409668f532c583c8ec7bba5a95 100644 (file)
@@ -35,10 +35,7 @@ along with GCC; see the file COPYING3.  If not see
        builtin_define ("__mipsfp64");                  \
                                                        \
       if (TARGET_NO_FLOAT)                             \
-       {                                               \
-         builtin_define ("__NO_FLOAT");                \
-         builtin_define ("__mips_no_float");           \
-       }                                               \
+       builtin_define ("__NO_FLOAT");                  \
       else if (TARGET_SOFT_FLOAT_ABI)                  \
        builtin_define ("__SOFT_FLOAT");                \
       else if (TARGET_SINGLE_FLOAT)                    \
@@ -57,18 +54,6 @@ along with GCC; see the file COPYING3.  If not see
     }                                                  \
   while (0)
 
-#undef SUBTARGET_OVERRIDE_OPTIONS
-#define SUBTARGET_OVERRIDE_OPTIONS                     \
-  do                                                   \
-    {                                                  \
-      if (TARGET_NO_FLOAT)                             \
-       {                                               \
-         target_flags |= MASK_SOFT_FLOAT_ABI;          \
-         target_flags_explicit |= MASK_SOFT_FLOAT_ABI; \
-       }                                               \
-    }                                                  \
-  while (0)
-
 /* For __clear_cache in libgcc2.c.  */
 #ifdef IN_LIBGCC2
 extern void mips_sync_icache (void *beg, unsigned long len);
@@ -113,3 +98,6 @@ extern void mips_sync_icache (void *beg, unsigned long len);
 /* ...nor does the call sequence preserve $31.  */
 #undef MIPS_SAVE_REG_FOR_PROFILING_P
 #define MIPS_SAVE_REG_FOR_PROFILING_P(REGNO) ((REGNO) == RETURN_ADDR_REGNUM)
+
+/* Compile in support for the -mno-float option.  */
+#define TARGET_SUPPORTS_NO_FLOAT 1
diff --git a/gcc/config/mips/sdemtk.opt b/gcc/config/mips/sdemtk.opt
deleted file mode 100644 (file)
index c1d2949..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-; Options for the MIPS SDE configuration.
-;
-; Copyright (C) 2007 Free Software Foundation, Inc.
-;
-; This file is part of GCC.
-;
-; GCC is free software; you can redistribute it and/or modify it under
-; the terms of the GNU General Public License as published by the Free
-; Software Foundation; either version 3, or (at your option) any later
-; version.
-;
-; GCC is distributed in the hope that it will be useful, but WITHOUT
-; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
-; License for more details.
-;
-; You should have received a copy of the GNU General Public License
-; along with GCC; see the file COPYING3.  If not see
-; <http://www.gnu.org/licenses/>.
-
-mno-float
-Target Report RejectNegative Var(TARGET_NO_FLOAT)
-Prevent the use of all floating-point operations