From 382b9b8584da730f206122cd2ebac6a9cb903e19 Mon Sep 17 00:00:00 2001 From: dje Date: Mon, 9 Sep 1996 21:57:25 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12693 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/sparc/sparc.c | 7 +++++++ gcc/config/sparc/sparc.h | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 5b80dcb43c2..566d41a06e7 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -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; diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 7157100ce88..d3e18c289b7 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -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}, \ -- 2.11.0