arm.c (target_float_switch): New variable..
authorPaul Brook <pbrook@gcc.gnu.org>
Thu, 18 Nov 2004 15:59:48 +0000 (15:59 +0000)
committerPaul Brook <pbrook@gcc.gnu.org>
Thu, 18 Nov 2004 15:59:48 +0000 (15:59 +0000)
* config/arm/arm.c (target_float_switch): New variable..
(arm_override_options): Use TARGET_DEFAULT_FLOAT_ABI and
target_float_switch.
* config/arm/arm.h (target_float_switch): Declare.
(ARM_FLAG_SOFT_FLOAT): Remove.
(TARGET_SWITCHES): Remove hard-float and soft-float.
(TARGET_OPTIONS): Add hard-float and soft-float.
(TARGET_DEFAULT_FLOAT_ABI): Define.
* config/arm/coff.h (TARGET_DEFAULT_FLOAT_ABI): Define
(TARGET_DEFAULT): Don't use ARM_FLAG_SOFT_FLOAT.
* config/arm/elf.h: Don't use ARM_FLAG_SOFT_FLOAT.
* config/arm/netbsd-elf.h: Ditto.
* config/arm/netbsd.h: Ditto.
* config/arm/pe.h: Ditto.
* config/arm/unknown-elf.h: Ditto.
* config/arm/wince-pe.h: Ditto.
* config/arm/linux-elf.h (TARGET_DEFAULT_FLOAT_ABI): Define.
* config/arm/semi.h (TARGET_DEFAULT_FLOAT_ABI): Define.
* config/arm/semiaof.h (TARGET_DEFAULT_FLOAT_ABI): Define.

From-SVN: r90872

12 files changed:
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/arm/coff.h
gcc/config/arm/elf.h
gcc/config/arm/linux-elf.h
gcc/config/arm/netbsd-elf.h
gcc/config/arm/netbsd.h
gcc/config/arm/pe.h
gcc/config/arm/semi.h
gcc/config/arm/semiaof.h
gcc/config/arm/unknown-elf.h
gcc/config/arm/wince-pe.h

index 4a9d5f1cd557ea146527ee8872d45e7c8e336da7..80f1f582a01c0e8ead7d87e7df29998243fe78fb 100644 (file)
@@ -352,6 +352,9 @@ const char * target_fpe_name = NULL;
 /* Set by the -mfloat-abi=... option.  */
 const char * target_float_abi_name = NULL;
 
+/* Set by the legacy -mhard-float and -msoft-float options.  */
+const char * target_float_switch = NULL;
+
 /* Set by the -mabi=... option.  */
 const char * target_abi_name = NULL;
 
@@ -1078,14 +1081,16 @@ arm_override_options (void)
        error ("invalid floating point abi: -mfloat-abi=%s",
               target_float_abi_name);
     }
-  else
+  else if (target_float_switch)
     {
-      /* Use soft-float target flag.  */
-      if (target_flags & ARM_FLAG_SOFT_FLOAT)
-       arm_float_abi = ARM_FLOAT_ABI_SOFT;
-      else
+      /* This is a bit of a hack to avoid needing target flags for these.  */
+      if (target_float_switch[1] == 'h')
        arm_float_abi = ARM_FLOAT_ABI_HARD;
+      else
+       arm_float_abi = ARM_FLOAT_ABI_SOFT;
     }
+  else
+    arm_float_abi = TARGET_DEFAULT_FLOAT_ABI;
 
   if (arm_float_abi == ARM_FLOAT_ABI_HARD && TARGET_VFP)
     sorry ("-mfloat-abi=hard and VFP");
index 8e3844787eff10950c5ae8b46c91f33927a7b75e..f8a000255bddf77571d53e45897b3f6d0c508d7f 100644 (file)
@@ -125,6 +125,8 @@ extern const char *target_fpu_name;
 extern const char *target_fpe_name;
 /* Whether to use floating point hardware.  */
 extern const char *target_float_abi_name;
+/* For -m{soft,hard}-float.  */
+extern const char *target_float_switch;
 /* Which ABI to use.  */
 extern const char *target_abi_name;
 /* Define the information needed to generate branch insns.  This is
@@ -212,9 +214,7 @@ extern GTY(()) rtx aof_pic_label;
 #define ARM_FLAG_APCS_REENT    (1 << 6)
 
   /* FLAG 0x0080 now spare (used to be alignment traps).  */
-/* Nonzero if all floating point instructions are missing (and there is no
-   emulator either).  Generate function calls for all ops in this case.  */
-#define ARM_FLAG_SOFT_FLOAT    (1 << 8)
+  /* FLAG (1 << 8) is now spare (used to be soft-float).  */
 
 /* Nonzero if we should compile with BYTES_BIG_ENDIAN set to 1.  */
 #define ARM_FLAG_BIG_END       (1 << 9)
@@ -329,10 +329,6 @@ extern GTY(()) rtx aof_pic_label;
   {"apcs-reentrant",           ARM_FLAG_APCS_REENT,                    \
    N_("Generate re-entrant, PIC code") },                              \
   {"no-apcs-reentrant",               -ARM_FLAG_APCS_REENT, "" },              \
-  {"soft-float",               ARM_FLAG_SOFT_FLOAT,                    \
-   N_("Use library calls to perform FP operations") },                 \
-  {"hard-float",              -ARM_FLAG_SOFT_FLOAT,                    \
-   N_("Use hardware floating point instructions") },                   \
   {"big-endian",               ARM_FLAG_BIG_END,                       \
    N_("Assume target CPU is configured as big endian") },              \
   {"little-endian",           -ARM_FLAG_BIG_END,                       \
@@ -397,7 +393,11 @@ extern GTY(()) rtx aof_pic_label;
    N_("Specify the minimum bit alignment of structures"), 0},          \
   {"pic-register=", & arm_pic_register_string,                         \
    N_("Specify the register to be used for PIC addressing"), 0},       \
-  {"abi=", &target_abi_name, N_("Specify an ABI"), 0}                  \
+  {"abi=", &target_abi_name, N_("Specify an ABI"), 0},                 \
+  {"soft-float", &target_float_switch,                                 \
+   N_("Alias for -mfloat-abi=soft"), 0},                               \
+  {"hard-float", &target_float_switch,                                 \
+   N_("Alias for -mfloat-abi=hard"), 0}                                        \
 }
 
 /* Support for a compile-time default CPU, et cetera.  The rules are:
@@ -481,6 +481,10 @@ enum float_abi_type
 
 extern enum float_abi_type arm_float_abi;
 
+#ifndef TARGET_DEFAULT_FLOAT_ABI
+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
+#endif
+
 /* Which ABI to use.  */
 enum arm_abi_type
 {
index 1be5ea1fa85ccd68742b9bee059a6cc8160838e3..5ad7fb68e2f84398c38414ec8bc04154bc94ee8c 100644 (file)
 #undef  TARGET_VERSION
 #define TARGET_VERSION fputs (" (ARM/coff)", stderr)
 
+#undef  TARGET_DEFAULT_FLOAT_ABI
+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
+
 #undef  TARGET_DEFAULT
-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_FRAME)
+#define TARGET_DEFAULT (ARM_FLAG_APCS_FRAME)
 
 #ifndef MULTILIB_DEFAULTS
 #define MULTILIB_DEFAULTS \
index 12759566ac4c52034848b6ed153569310e4e8d05..a6c6102d088932153ba3e0119eb409a758752914 100644 (file)
 #endif
 
 #ifndef TARGET_DEFAULT
-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_FRAME)
+#define TARGET_DEFAULT (ARM_FLAG_APCS_FRAME)
 #endif
 
 #ifndef MULTILIB_DEFAULTS
index 892acf2d86c2817e9908c4ff68f1e32cde1411ae..e85b6d035c69038cc98ea6cc37917b3c7d963439 100644 (file)
@@ -30,6 +30,9 @@
 /* Do not assume anything about header files.  */
 #define NO_IMPLICIT_EXTERN_C
 
+#undef  TARGET_DEFAULT_FLOAT_ABI
+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
+
 #undef  TARGET_DEFAULT
 #define TARGET_DEFAULT (0)
 
index 32251bcec5403732e3c758711226160c2fb4ff7f..cc69064c70fe54d35498f5dddc5754ce812d5e2b 100644 (file)
@@ -35,8 +35,7 @@
 /* Default it to use ATPCS with soft-VFP.  */
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT                 \
-  (ARM_FLAG_SOFT_FLOAT                 \
-   | ARM_FLAG_APCS_FRAME               \
+  (ARM_FLAG_APCS_FRAME                 \
    | TARGET_ENDIAN_DEFAULT)
 
 #undef ARM_DEFAULT_ABI
index 326fabaf8b251b99eb50567dc4321779aba2fcaf..8b9e437a66ba43db5cd45fe4b1a6a74f808afbe4 100644 (file)
@@ -36,7 +36,7 @@
 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
 
 #undef TARGET_DEFAULT
-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_FRAME)
+#define TARGET_DEFAULT (ARM_FLAG_APCS_FRAME)
 
 /* Some defines for CPP.
    arm32 is the NetBSD port name, so we always define arm32 and __arm32__.  */
index afaade2cb61629c4576191a4402f0fc3efa0ee6f..d47489574a181775ba9aae5201fe3dbf2a5e0e3d 100644 (file)
@@ -60,7 +60,7 @@
 { "no-nop-fun-dllimport",      - TARGET_FLAG_NOP_FUN, "" },
 
 #undef  TARGET_DEFAULT
-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | TARGET_FLAG_NOP_FUN)
+#define TARGET_DEFAULT (TARGET_FLAG_NOP_FUN)
 
 #undef  MULTILIB_DEFAULTS
 #define MULTILIB_DEFAULTS \
index e30c0fcc326cdbb0366e1554e06e22563fbefb25..d12ef4bacc1f0fcaa3e7cbfdf97b83a44fb3c531 100644 (file)
 #define TARGET_VERSION fputs (" (ARM/semi-hosted)", stderr);
 #endif
 
+#ifndef TARGET_DEFAULT_FLOAT_ABI
+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
+#endif
+
 #ifndef TARGET_DEFAULT
 #define TARGET_DEFAULT (ARM_FLAG_APCS_FRAME)
 #endif
index 8e660836890b9464abcc6a3ef85eec31eaf92657..acce6448a85f5dd11b0d768304a0854d3494043f 100644 (file)
@@ -32,6 +32,8 @@
 
 #define TARGET_VERSION fputs (" (ARM/semi-hosted)", stderr);
 
+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
+
 #define TARGET_DEFAULT (0)
 
 /* The Norcroft C library defines size_t as "unsigned int".  */
index dd51c533b4d83073bf7980d366c15494686a323a..775e1e9f188128f0bef944bde4279a190891b2b2 100644 (file)
@@ -30,7 +30,7 @@
 
 /* Default to using software floating point.  */
 #ifndef TARGET_DEFAULT
-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT)
+#define TARGET_DEFAULT (0)
 #endif
 
 /* Now we define the strings used to build the spec file.  */
index 143ed204b078cbc3fd3363087c1bf1042ce8b99d..121848b44c93be313a412dd07d6b122485719bba 100644 (file)
@@ -20,7 +20,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #undef  TARGET_DEFAULT
-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | TARGET_FLAG_NOP_FUN)
+#define TARGET_DEFAULT (TARGET_FLAG_NOP_FUN)
 
 #undef  MULTILIB_DEFAULTS
 #define MULTILIB_DEFAULTS \