sparc.h ({MASK,TARGET}_FPU_SET): Define.

* sparc/sparc.h ({MASK,TARGET}_FPU_SET): Define.
	(TARGET_SWITCHES): Record if -m{,no-}fpu passed.
	* sparc/sparc.c (sparc_override_options): Don't clobber explicit
	-m{,no-}fpu setting with cpu default.

From-SVN: r12693
This commit is contained in:
Doug Evans 1996-09-09 21:57:25 +00:00
parent 7c9ad19eda
commit 1f1406b451
2 changed files with 15 additions and 2 deletions

View File

@ -179,6 +179,8 @@ sparc_override_options ()
struct cpu_table *cpu;
struct sparc_cpu_select *sel;
int fpu = TARGET_FPU; /* save current -mfpu status */
/* Set the default. */
for (def = &cpu_default[0]; def->name; ++def)
if (def->cpu == TARGET_CPU_DEFAULT)
@ -210,6 +212,11 @@ sparc_override_options ()
}
}
/* If -mfpu or -mno-fpu was explicitly used, don't override with
the processor default. */
if (TARGET_FPU_SET)
target_flags = (target_flags & ~MASK_FPU) | fpu;
/* Use the deprecated v8 insns for sparc64 in 32 bit mode. */
if (TARGET_V9 && TARGET_ARCH32)
target_flags |= MASK_DEPRECATED_V8_INSNS;

View File

@ -394,6 +394,10 @@ extern int target_flags;
#define MASK_BROKEN_SAVERESTORE 0x200000
#define TARGET_BROKEN_SAVERESTORE (target_flags & MASK_BROKEN_SAVERESTORE)
/* Non-zero means -m{,no-}fpu was passed on the command line. */
#define MASK_FPU_SET 0x400000
#define TARGET_FPU_SET (target_flags & MASK_FPU_SET)
/* Macro to define tables used to set the flags.
This is a list in braces of pairs in braces,
each pair being { "NAME", VALUE }
@ -401,10 +405,12 @@ extern int target_flags;
An empty string NAME is used to identify the default VALUE. */
#define TARGET_SWITCHES \
{ {"fpu", MASK_FPU}, \
{ {"fpu", MASK_FPU | MASK_FPU_SET}, \
{"no-fpu", -MASK_FPU}, \
{"hard-float", MASK_FPU}, \
{"no-fpu", MASK_FPU_SET}, \
{"hard-float", MASK_FPU | MASK_FPU_SET}, \
{"soft-float", -MASK_FPU}, \
{"soft-float", MASK_FPU_SET}, \
{"epilogue", MASK_EPILOGUE}, \
{"no-epilogue", -MASK_EPILOGUE}, \
{"unaligned-doubles", MASK_UNALIGNED_DOUBLES}, \