aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2020-03-23 17:59:51 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2020-03-24 20:53:16 +0000
commit8001f59c82b98c4348e00183fe83621d649dafca (patch)
tree54d5e273d09f5d6a7106a7f3e7b8f5b21999f236
parent04099157691ec6ff25d8d32e30b04eec89dcf94b (diff)
downloadgcc-8001f59c82b98c4348e00183fe83621d649dafca.zip
gcc-8001f59c82b98c4348e00183fe83621d649dafca.tar.gz
gcc-8001f59c82b98c4348e00183fe83621d649dafca.tar.bz2
[testsuite,arm] target-supports.exp: Add arm_fp_dp_ok effective-target
Some tests require double-precision support, but the existing arm_fp_ok effective-target only checks if hardware floating-point is available, not what level. So this patch adds a new arm_fp_dp_ok effective-target to check that double-precision is supported. 2020-03-24 Christophe Lyon <christophe.lyon@linaro.org> gcc/ * doc/sourcebuild.texi (ARM-specific attributes): Add arm_fp_dp_ok. (Features for dg-add-options): Add arm_fp_dp. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_arm_fp_dp_ok_nocache): New. (check_effective_target_arm_fp_dp_ok): New. (add_options_for_arm_fp_dp): New.
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/doc/sourcebuild.texi11
-rw-r--r--gcc/testsuite/ChangeLog9
-rw-r--r--gcc/testsuite/lib/target-supports.exp44
4 files changed, 69 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 81d90c3..4edf212 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2020-03-24 Christophe Lyon <christophe.lyon@linaro.org>
+
+ * doc/sourcebuild.texi (ARM-specific attributes): Add
+ arm_fp_dp_ok.
+ (Features for dg-add-options): Add arm_fp_dp.
+
2020-03-24 John David Anglin <danglin@gcc.gnu.org>
PR lto/94249
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index eef1432..91b46cc 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1733,6 +1733,12 @@ ARM target defines @code{__ARM_FP} using @code{-mfloat-abi=softfp} or
equivalent options. Some multilibs may be incompatible with these
options.
+@item arm_fp_dp_ok
+@anchor{arm_fp_dp_ok}
+ARM target defines @code{__ARM_FP} with double-precision support using
+@code{-mfloat-abi=softfp} or equivalent options. Some multilibs may
+be incompatible with these options.
+
@item arm_hf_eabi
ARM target adheres to the VFP and Advanced SIMD Register Arguments
variant of the ABI for the ARM Architecture (as selected with
@@ -2504,6 +2510,11 @@ are:
in certain modes; see the @ref{arm_fp_ok,,arm_fp_ok effective target
keyword}.
+@item arm_fp_dp
+@code{__ARM_FP} definition with double-precision support. Only ARM
+targets support this feature, and only then in certain modes; see the
+@ref{arm_fp_dp_ok,,arm_fp_dp_ok effective target keyword}.
+
@item arm_neon
NEON support. Only ARM targets support this feature, and only then
in certain modes; see the @ref{arm_neon_ok,,arm_neon_ok effective target
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6747258..adce8ed 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2020-03-24 Christophe Lyon <christophe.lyon@linaro.org>
+
+ * lib/target-supports.exp
+ (check_effective_target_arm_fp_dp_ok_nocache): New.
+ (check_effective_target_arm_fp_dp_ok): New.
+ (add_options_for_arm_fp_dp): New.
+
2020-03-24 Jakub Jelinek <jakub@redhat.com>
PR target/94286
@@ -18,7 +25,7 @@
PR target/94238
* gcc.c-torture/compile/pr94144.c: New test.
* gcc.c-torture/compile/pr94238.c: New test.
-
+
2020-03-23 Patrick Palka <ppalka@redhat.com>
PR c++/93805
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 9f3f96f..f9794b6 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -3679,6 +3679,50 @@ proc add_options_for_arm_fp { flags } {
return "$flags $et_arm_fp_flags"
}
+# Return 1 if this is an ARM target defining __ARM_FP with
+# double-precision support. We may need -mfloat-abi=softfp or
+# equivalent options. Some multilibs may be incompatible with these
+# options. Also set et_arm_fp_dp_flags to the best options to add.
+
+proc check_effective_target_arm_fp_dp_ok_nocache { } {
+ global et_arm_fp_dp_flags
+ set et_arm_fp_dp_flags ""
+ if { [check_effective_target_arm32] } {
+ foreach flags {"" "-mfloat-abi=softfp" "-mfloat-abi=hard"} {
+ if { [check_no_compiler_messages_nocache arm_fp_dp_ok object {
+ #ifndef __ARM_FP
+ #error __ARM_FP not defined
+ #endif
+ #if ((__ARM_FP & 8) == 0)
+ #error __ARM_FP indicates that double-precision is not supported
+ #endif
+ } "$flags"] } {
+ set et_arm_fp_dp_flags $flags
+ return 1
+ }
+ }
+ }
+
+ return 0
+}
+
+proc check_effective_target_arm_fp_dp_ok { } {
+ return [check_cached_effective_target arm_fp_dp_ok \
+ check_effective_target_arm_fp_dp_ok_nocache]
+}
+
+# Add the options needed to define __ARM_FP with double-precision
+# support. We need either -mfloat-abi=softfp or -mfloat-abi=hard, but
+# if one is already specified by the multilib, use it.
+
+proc add_options_for_arm_fp_dp { flags } {
+ if { ! [check_effective_target_arm_fp_dp_ok] } {
+ return "$flags"
+ }
+ global et_arm_fp_dp_flags
+ return "$flags $et_arm_fp_dp_flags"
+}
+
# Return 1 if this is an ARM target that supports DSP multiply with
# current multilib flags.