diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2023-11-03 10:34:40 +0000 |
---|---|---|
committer | Richard Earnshaw <rearnsha@arm.com> | 2023-11-13 14:15:54 +0000 |
commit | ccbc8bd4d4df71c9a55722761bf9c7d3c924d8b9 (patch) | |
tree | 0d0ec5065a9ff29d2be433801c0923e1d1f96bb4 | |
parent | 04367b11ecad7aecd9dc94cd71671757c9be12c9 (diff) | |
download | gcc-ccbc8bd4d4df71c9a55722761bf9c7d3c924d8b9.zip gcc-ccbc8bd4d4df71c9a55722761bf9c7d3c924d8b9.tar.gz gcc-ccbc8bd4d4df71c9a55722761bf9c7d3c924d8b9.tar.bz2 |
arm: testsuite: correctly detect hard_float
Add an arm-specific test to check_effective_target_hard_float for
Arm to handle cases where we only have single-precision FP in hardware.
gcc/testsuite:
* lib/target-supports.exp (check_effective_target_hard_float): Add
arm-specific test.
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index d414cdd..ee173b9 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1420,6 +1420,17 @@ proc check_effective_target_mpaired_single { args } { # Return true if the target has access to FPU instructions. proc check_effective_target_hard_float { } { + # This should work on cores that only have single-precision, + # and should also correctly handle legacy cores that had thumb1 and + # lacked FP support for that, but had it in Arm state. + if { [istarget arm*-*-*] } { + return [check_no_compiler_messages hard_float assembly { + #if __ARM_FP == 0 + #error __arm_soft_float + #endif + }] + } + if { [istarget loongarch*-*-*] } { return [check_no_compiler_messages hard_float assembly { #if (defined __loongarch_soft_float) |