+2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/67963
+ PR target/67985
+ * common/config/i386/i386-common.c (ix86_handle_option): Remove
+ OPT_miamcu handling.
+ * config/i386/i386.c (PTA_NO_80387): New macro.
+ (processor_alias_table): Add PTA_NO_80387 to lakemont.
+ (ix86_option_override_internal): Update MASK_80387 from
+ PTA_NO_80387. Don't warn x87/MMX/SSE/AVX for -miamcu. Warn
+ SSE math only if 80387 is supported. Don't change
+ MASK_FLOAT_RETURNS.
+ (ix86_valid_target_attribute_tree): Enable FPMATH_387 only if
+ 80387 is supported.
+ * config/i386/i386.h (TARGET_FLOAT_RETURNS_IN_80387): True only
+ if TARGET_80387 is true and TARGET_IAMCU is false.
+ (TARGET_FLOAT_RETURNS_IN_80387_P): True only if TARGET_80387_P
+ is true and TARGET_IAMCU_P is false.
+
2015-10-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/68017
#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 \
{"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},
&& !(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;
}
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);
{
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))
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)
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;
}