diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-20 15:12:37 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-20 15:12:37 +0000 |
commit | 80d3e9ad6d0cf30b4a077096f107440089ce6707 (patch) | |
tree | b76424fab18f2876ae7b035e65425e4945d7a305 /gcc/testsuite/gcc.target/i386/pr67963-1.c | |
parent | 08881cb89cd8460d0181c0b2b7f6da79db9e5967 (diff) | |
download | gcc-80d3e9ad6d0cf30b4a077096f107440089ce6707.tar.gz |
Properly handle -miamcu and -march=lakemont
-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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229082 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pr67963-1.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr67963-1.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr67963-1.c b/gcc/testsuite/gcc.target/i386/pr67963-1.c new file mode 100644 index 00000000000..1b6e596888c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr67963-1.c @@ -0,0 +1,9 @@ +/* { dg-do compile { target ia32 } } */ +/* { dg-options "-O2 -march=lakemont" } */ + +float foo (void) +{ + return 0.0f; +} + +/* { dg-final { scan-assembler-not "fldz" } } */ |