arm.c (target_float_switch): New variable..

* 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
This commit is contained in:
Paul Brook 2004-11-18 15:59:48 +00:00
parent 94b112fb24
commit 3d8532aa2a
12 changed files with 41 additions and 21 deletions

View 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");

View 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
{

View File

@ -30,8 +30,11 @@
#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 \

View File

@ -108,7 +108,7 @@
#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

View 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)

View 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

View 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__. */

View 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 \

View File

@ -38,6 +38,10 @@
#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

View 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". */

View 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. */

View 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 \