diff options
author | Yvan Roux <yvan.roux@linaro.org> | 2017-09-11 10:46:04 +0200 |
---|---|---|
committer | Yvan Roux <yvan.roux@linaro.org> | 2017-09-11 10:46:04 +0200 |
commit | ab9fea02e1c38a8d87b03c7dc957b6cd0220325a (patch) | |
tree | e34d91234d720795359c5e96d9cae26fb2f50409 | |
parent | 645e8907c7c425c076708ec7778b9a2885789085 (diff) |
gcc/
Backport from trunk r249639.
2017-06-26 Christophe Lyon <christophe.lyon@linaro.org>
* doc/sourcebuild.texi (ARM-specific attributes): Document new
arm_neon_ok_no_float_abi effective target.
gcc/testsuite/
Backport from trunk r249639.
2017-06-26 Christophe Lyon <christophe.lyon@linaro.org>
* lib/target-supports.exp
(check_effective_target_arm_neon_ok_nocache): Add flags with
-mfloat-abi=hard. Include arm_neon.h.
(check_effective_target_arm_neon_ok_no_float_abi_nocache): New.
(check_effective_target_arm_neon_ok_no_float_abi): New.
* gcc.target/arm/lto/pr65837_0.c: Require
arm_neon_ok_no_float_abi. Add -mfpu=neon to dg-lto-options.
* gcc.target/arm/lto/pr65837-attr_0.c: Require
arm_neon_ok_no_float_abi. Remove dg-suppress-ld-options.
Change-Id: If06e216d53f2e09f93b28bd2b7b9e8388de49aaa
-rw-r--r-- | gcc/doc/sourcebuild.texi | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/arm/lto/pr65837-attr_0.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/arm/lto/pr65837_0.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 35 |
4 files changed, 43 insertions, 3 deletions
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 003199a9a87..35b5b87ac8a 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1570,6 +1570,12 @@ Test system supports executing NEON v2 instructions. ARM Target supports @code{-mfpu=neon -mfloat-abi=softfp} or compatible options. Some multilibs may be incompatible with these options. +@item arm_neon_ok_no_float_abi +@anchor{arm_neon_ok_no_float_abi} +ARM Target supports NEON with @code{-mfpu=neon}, but without any +-mfloat-abi= option. Some multilibs may be incompatible with this +option. + @item arm_neonv2_ok @anchor{arm_neonv2_ok} ARM Target supports @code{-mfpu=neon-vfpv4 -mfloat-abi=softfp} or compatible diff --git a/gcc/testsuite/gcc.target/arm/lto/pr65837-attr_0.c b/gcc/testsuite/gcc.target/arm/lto/pr65837-attr_0.c index ebc5f447a08..f00480b5c02 100644 --- a/gcc/testsuite/gcc.target/arm/lto/pr65837-attr_0.c +++ b/gcc/testsuite/gcc.target/arm/lto/pr65837-attr_0.c @@ -1,6 +1,7 @@ /* { dg-lto-do run } */ /* { dg-require-effective-target arm_neon_hw } */ -/* { dg-lto-options {{-flto}} } */ +/* { dg-require-effective-target arm_neon_ok_no_float_abi } */ +/* { dg-lto-options {{-flto -mfpu=neon}} } */ #include "arm_neon.h" diff --git a/gcc/testsuite/gcc.target/arm/lto/pr65837_0.c b/gcc/testsuite/gcc.target/arm/lto/pr65837_0.c index 6b2def9985d..5d7cea7b2e4 100644 --- a/gcc/testsuite/gcc.target/arm/lto/pr65837_0.c +++ b/gcc/testsuite/gcc.target/arm/lto/pr65837_0.c @@ -1,7 +1,7 @@ /* { dg-lto-do run } */ /* { dg-require-effective-target arm_neon_hw } */ +/* { dg-require-effective-target arm_neon_ok_no_float_abi } */ /* { dg-lto-options {{-flto -mfpu=neon}} } */ -/* { dg-suppress-ld-options {-mfpu=neon} } */ #include "arm_neon.h" diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 22b80172145..940e946ece4 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -3438,8 +3438,9 @@ proc check_effective_target_arm_neon_ok_nocache { } { global et_arm_neon_flags set et_arm_neon_flags "" if { [check_effective_target_arm32] } { - foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon" "-mfpu=neon -mfloat-abi=softfp" "-mfpu=neon -mfloat-abi=softfp -march=armv7-a"} { + foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon" "-mfpu=neon -mfloat-abi=softfp" "-mfpu=neon -mfloat-abi=softfp -march=armv7-a" "-mfloat-abi=hard" "-mfpu=neon -mfloat-abi=hard" "-mfpu=neon -mfloat-abi=hard -march=armv7-a"} { if { [check_no_compiler_messages_nocache arm_neon_ok object { + #include <arm_neon.h> int dummy; #ifndef __ARM_NEON__ #error not NEON @@ -3464,6 +3465,38 @@ proc check_effective_target_arm_neon_ok { } { check_effective_target_arm_neon_ok_nocache] } +# Return 1 if this is an ARM target supporting -mfpu=neon without any +# -mfloat-abi= option. Useful in tests where add_options is not +# supported (such as lto tests). + +proc check_effective_target_arm_neon_ok_no_float_abi_nocache { } { + if { [check_effective_target_arm32] } { + foreach flags {"-mfpu=neon"} { + if { [check_no_compiler_messages_nocache arm_neon_ok_no_float_abi object { + #include <arm_neon.h> + int dummy; + #ifndef __ARM_NEON__ + #error not NEON + #endif + /* Avoid the case where a test adds -mfpu=neon, but the toolchain is + configured for -mcpu=arm926ej-s, for example. */ + #if __ARM_ARCH < 7 || __ARM_ARCH_PROFILE == 'M' + #error Architecture does not support NEON. + #endif + } "$flags"] } { + return 1 + } + } + } + + return 0 +} + +proc check_effective_target_arm_neon_ok_no_float_abi { } { + return [check_cached_effective_target arm_neon_ok_no_float_abi \ + check_effective_target_arm_neon_ok_no_float_abi_nocache] +} + proc check_effective_target_arm_crc_ok_nocache { } { global et_arm_crc_flags set et_arm_crc_flags "-march=armv8-a+crc" |