summaryrefslogtreecommitdiff
path: root/gcc/config/i386/i386.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-10-16 06:48:11 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-10-19 11:00:35 -0700
commit7ca3b353a988a22bd5d1f6197eeacd852020a94d (patch)
tree4e5feb6e6c0c93ce2f67d24c1c236f70b0db9f0f /gcc/config/i386/i386.h
parent8587f7ea1c8d73512444c83fd26cca25de844160 (diff)
downloadgcc-7ca3b353a988a22bd5d1f6197eeacd852020a94d.tar.gz
Properly handle -miamcu and -march=lakemonthjl/pr67963/master
-miamcu specifies how parameters are passed to functions and how value is returned from a function. Inside function, we can use instructions supported by -march=XXX. -miamcu -march=haswell can generate x87, SSE and AVX instructions as long as the IA MCU psABI is followed. But since Lakemont processor doesn't support x87 instructions, we shouldn't generate x87 instructions with -march=lakemont. This patch separates code generation from -miamcu and makes -march=lakemont not to generate x87 instructions. gcc/ 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. gcc/testsuite/ PR target/67963 PR target/67985 * gcc.target/i386/pr67963-1.c: New test. * gcc.target/i386/pr67963-2.c: Likewise. * gcc.target/i386/pr67963-3.c: Likewise. * gcc.target/i386/pr67985-1.c: Likewise. * gcc.target/i386/pr67985-2.c: Likewise. * gcc.target/i386/pr67985-3.c: Likewise.
Diffstat (limited to 'gcc/config/i386/i386.h')
-rw-r--r--gcc/config/i386/i386.h8
1 files changed, 6 insertions, 2 deletions
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. */