summaryrefslogtreecommitdiff
path: root/gcc/config/i386
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/i386')
-rw-r--r--gcc/config/i386/i386.c41
-rw-r--r--gcc/config/i386/i386.h8
2 files changed, 25 insertions, 24 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index a4f4b6fb8ab..c800145fa3c 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4295,6 +4295,7 @@ ix86_option_override_internal (bool main_args_p,
#define PTA_PCOMMIT (HOST_WIDE_INT_1 << 56)
#define PTA_MWAITX (HOST_WIDE_INT_1 << 57)
#define PTA_CLZERO (HOST_WIDE_INT_1 << 58)
+#define PTA_NO_80387 (HOST_WIDE_INT_1 << 59)
#define PTA_CORE2 \
(PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3 | PTA_SSSE3 \
@@ -4339,7 +4340,7 @@ ix86_option_override_internal (bool main_args_p,
{"i486", PROCESSOR_I486, CPU_NONE, 0},
{"i586", PROCESSOR_PENTIUM, CPU_PENTIUM, 0},
{"pentium", PROCESSOR_PENTIUM, CPU_PENTIUM, 0},
- {"lakemont", PROCESSOR_LAKEMONT, CPU_PENTIUM, 0},
+ {"lakemont", PROCESSOR_LAKEMONT, CPU_PENTIUM, PTA_NO_80387},
{"pentium-mmx", PROCESSOR_PENTIUM, CPU_PENTIUM, PTA_MMX},
{"winchip-c6", PROCESSOR_I486, CPU_NONE, PTA_MMX},
{"winchip2", PROCESSOR_I486, CPU_NONE, PTA_MMX | PTA_3DNOW | PTA_PRFCHW},
@@ -4920,6 +4921,13 @@ ix86_option_override_internal (bool main_args_p,
&& !(opts->x_ix86_isa_flags_explicit & OPTION_MASK_ISA_MWAITX))
opts->x_ix86_isa_flags |= OPTION_MASK_ISA_MWAITX;
+ if (!(opts_set->x_target_flags & MASK_80387))
+ {
+ if (processor_alias_table[i].flags & PTA_NO_80387)
+ opts->x_target_flags &= ~MASK_80387;
+ else
+ opts->x_target_flags |= MASK_80387;
+ }
break;
}
@@ -4929,20 +4937,6 @@ ix86_option_override_internal (bool main_args_p,
if (TARGET_X32 && (ix86_isa_flags & OPTION_MASK_ISA_MPX))
error ("Intel MPX does not support x32");
- if (TARGET_IAMCU_P (opts->x_target_flags))
- {
- /* Verify that x87/MMX/SSE/AVX is off for -miamcu. */
- if (TARGET_80387_P (opts->x_target_flags))
- sorry ("X87 FPU isn%'t supported in Intel MCU psABI");
- else if ((opts->x_ix86_isa_flags & (OPTION_MASK_ISA_MMX
- | OPTION_MASK_ISA_SSE
- | OPTION_MASK_ISA_AVX)))
- sorry ("%s isn%'t supported in Intel MCU psABI",
- TARGET_MMX_P (opts->x_ix86_isa_flags)
- ? "MMX"
- : TARGET_SSE_P (opts->x_ix86_isa_flags) ? "SSE" : "AVX");
- }
-
if (!strcmp (opts->x_ix86_arch_string, "generic"))
error ("generic CPU can be used only for %stune=%s %s",
prefix, suffix, sw);
@@ -5226,8 +5220,11 @@ ix86_option_override_internal (bool main_args_p,
{
if (!TARGET_SSE_P (opts->x_ix86_isa_flags))
{
- warning (0, "SSE instruction set disabled, using 387 arithmetics");
- opts->x_ix86_fpmath = FPMATH_387;
+ if (TARGET_80387_P (opts->x_target_flags))
+ {
+ warning (0, "SSE instruction set disabled, using 387 arithmetics");
+ opts->x_ix86_fpmath = FPMATH_387;
+ }
}
else if ((opts->x_ix86_fpmath & FPMATH_387)
&& !TARGET_80387_P (opts->x_target_flags))
@@ -5253,10 +5250,6 @@ ix86_option_override_internal (bool main_args_p,
else
opts->x_ix86_fpmath = TARGET_FPMATH_DEFAULT_P (opts->x_ix86_isa_flags);
- /* If the i387 is disabled, then do not return values in it. */
- if (!TARGET_80387_P (opts->x_target_flags))
- opts->x_target_flags &= ~MASK_FLOAT_RETURNS;
-
/* Use external vectorized library in vectorizing intrinsics. */
if (opts_set->x_ix86_veclibabi_type)
switch (opts->x_ix86_veclibabi_type)
@@ -6155,7 +6148,11 @@ ix86_valid_target_attribute_tree (tree args,
else if (!TARGET_64BIT_P (opts->x_ix86_isa_flags)
&& TARGET_SSE_P (opts->x_ix86_isa_flags))
{
- opts->x_ix86_fpmath = (enum fpmath_unit) (FPMATH_SSE | FPMATH_387);
+ if (TARGET_80387_P (opts->x_target_flags))
+ opts->x_ix86_fpmath = (enum fpmath_unit) (FPMATH_SSE
+ | FPMATH_387);
+ else
+ opts->x_ix86_fpmath = (enum fpmath_unit) FPMATH_SSE;
opts_set->x_ix86_fpmath = (enum fpmath_unit) 1;
}
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 435312f0afc..be96c75df77 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -295,8 +295,12 @@ extern const struct processor_costs ix86_size_cost;
(TARGET_64BIT_P(x) && TARGET_SSE_P(x) ? FPMATH_SSE : FPMATH_387)
#endif
-#define TARGET_FLOAT_RETURNS_IN_80387 TARGET_FLOAT_RETURNS
-#define TARGET_FLOAT_RETURNS_IN_80387_P(x) TARGET_FLOAT_RETURNS_P(x)
+/* If the i387 is disabled or -miamcu is used , then do not return
+ values in it. */
+#define TARGET_FLOAT_RETURNS_IN_80387 \
+ (TARGET_FLOAT_RETURNS && TARGET_80387 && !TARGET_IAMCU)
+#define TARGET_FLOAT_RETURNS_IN_80387_P(x) \
+ (TARGET_FLOAT_RETURNS_P(x) && TARGET_80387_P(x) && !TARGET_IAMCU_P(x))
/* 64bit Sledgehammer mode. For libgcc2 we make sure this is a
compile-time constant. */