]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite/arm: Fix -mfloat-abi order in arm_v8_1m_mve_ok_nocache and arm_v8_1m_mve_fp...
authorChristophe Lyon <christophe.lyon@linaro.org>
Tue, 21 Apr 2020 17:45:02 +0000 (17:45 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Tue, 23 Mar 2021 15:11:51 +0000 (15:11 +0000)
Make the order in which we try -mfloat-abi options consistent with the
other similar effective targets: try softfp first, then hard.

This shows that a few tests implicitly rely on -mfloat-abi=hard, so we
add this option via dg-additional-options so that it comes after any
potential -mfloat-abi option that the preceding effective-targets
might have added.

armv8_1m-fpXX-move-1.c tests don't need arm_hard_ok because they don't
include arm_mve.h: adding -mfloat-abi=hard when using a soft/softfp
toolchain does not lead to the missing include gnu/stubs-*.h error.

This patch makes armv8_1m-fpXX-move-1.c pass on arm-linux-gnueabi, and
the other tests become unsupported (instead of fail) on this target.

On arm-eabi with default cpu/fpu/mode and a+rm multilibs, the same
mve/intrinsics/* tests become unsupported instead of pass because
arm_hard_ok fails with "selected processor lacks an FPU". Since we
also override the fpu via dg-options, we'd need another effective
target (say arm_hard_mve_ok) that would check -mfloat-abi=hard
-mfpu=auto -march=armv8.1-m.main+mve.fp at the same time. But we have
already so many arm effective targets, it doesn't seem like a good way
forward.

2021-03-19  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/testsuite/
* lib/target-supports.exp
(check_effective_target_arm_v8_1m_mve_fp_ok_nocache): Fix
-mfloat-abi= options order.
(check_effective_target_arm_v8_1m_mve_ok_nocache): Likewise
* gcc.target/arm/mve/intrinsics/mve_vector_float2.c: Add
arm_hard_ok effective target and -mfloat-abi=hard additional
option.
* gcc.target/arm/mve/intrinsics/mve_vector_int.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_vector_uint.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_vector_uint1.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_vector_uint2.c: Likewise.
* gcc.target/arm/mve/intrinsics/vgetq_lane_s64.c: Likewise.
* gcc.target/arm/mve/intrinsics/vgetq_lane_u64.c: Likewise.
* gcc.target/arm/mve/intrinsics/vsetq_lane_s64.c: Likewise.
* gcc.target/arm/mve/intrinsics/vsetq_lane_u64.c: Likewise.
* gcc.target/arm/armv8_1m-fp16-move-1.c: Add -mfloat-abi=hard
additional option.
* gcc.target/arm/armv8_1m-fp32-move-1.c: Likewise.
* gcc.target/arm/armv8_1m-fp64-move-1.c: Likewise.

13 files changed:
gcc/testsuite/gcc.target/arm/armv8_1m-fp16-move-1.c
gcc/testsuite/gcc.target/arm/armv8_1m-fp32-move-1.c
gcc/testsuite/gcc.target/arm/armv8_1m-fp64-move-1.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vector_float2.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vector_int.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vector_uint.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vector_uint1.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vector_uint2.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s64.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u64.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_s64.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_u64.c
gcc/testsuite/lib/target-supports.exp

index 67a9f416adf68708c44363c3b2eedb1cdd4604ab..f5ab6e719f412619d9ee51d4dd5359ed48a74f54 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-options "-O -mfloat-abi=hard -mfp16-format=ieee" } */
+/* { dg-options "-O -mfp16-format=ieee" } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
+/* { dg-additional-options "-mfloat-abi=hard" } *
 /* { dg-final { check-function-bodies "**" "" } } */
 
 /*
index 1ecb839bfe739d91a7496325bd42c8bf5e998cdb..2f62e839545145156be3f3273762189e037ebbcd 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-options "-O -mfloat-abi=hard" } */
+/* { dg-options "-O" } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
+/* { dg-additional-options "-mfloat-abi=hard" } *
 /* { dg-final { check-function-bodies "**" "" } } */
 
 /*
index 3f81350697aa4181f46b6e111186f95606d68ff6..d236f0826c309fce39f75d0b6cc98777cdbd3196 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-options "-O -mfloat-abi=hard" } */
+/* { dg-options "-O" } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
+/* { dg-additional-options "-mfloat-abi=hard" } *
 /* { dg-final { check-function-bodies "**" "" } } */
 
 /*
index 35f83c6b298aaf2b8093713159b32de17ff96bd2..6728776da28bbf4d813adc0e3f16af232f3d3b4c 100644 (file)
@@ -1,5 +1,7 @@
+/* { dg-require-effective-target arm_hard_ok } */
 /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
 /* { dg-add-options arm_v8_1m_mve_fp } */
+/* { dg-additional-options "-mfloat-abi=hard" } */
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
 
 #include "arm_mve.h"
index e70cbc12b1a65be9e110c9aa73effb2c3ea22f71..029e02f0c6ae12009ee44b9c794775c83df843e4 100644 (file)
@@ -1,5 +1,7 @@
+/* { dg-require-effective-target arm_hard_ok } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
+/* { dg-additional-options "-mfloat-abi=hard" } */
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
 
 #include "arm_mve.h"
index 0c4e763626e12bbe3352c7ecb3d4b325abe033e8..c15810015b9ed2d8d009c85891eacb8f2a012f46 100644 (file)
@@ -1,5 +1,7 @@
+/* { dg-require-effective-target arm_hard_ok } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
+/* { dg-additional-options "-mfloat-abi=hard" } */
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
 
 #include "arm_mve.h"
index fce69eb276ddb53446e01f88fa7756cb2a38a9f4..d30fce05f6863fb28b07b2807419c1d614a1a8ee 100644 (file)
@@ -1,5 +1,7 @@
+/* { dg-require-effective-target arm_hard_ok } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
+/* { dg-additional-options "-mfloat-abi=hard" } */
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
 
 #include "arm_mve.h"
index e0d6dcbe4bcedd65f700c70fd92ff2bb2c56ec4c..ae689144cd164ddb1793451a3b9ebdc31899f7ad 100644 (file)
@@ -1,5 +1,7 @@
+/* { dg-require-effective-target arm_hard_ok } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
+/* { dg-additional-options "-mfloat-abi=hard" } */
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
 
 #include "arm_mve.h"
index a7457f86320b6277aba26236715a69bd05b60d89..63b25088eeea01acf8885d295170b7f245acfc94 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
+/* { dg-require-effective-target arm_hard_ok } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
-/* { dg-additional-options "-O2" } */
+/* { dg-additional-options "-mfloat-abi=hard -O2" } */
 
 #include "arm_mve.h"
 
index 3cbbef520aee0731277883ae2449e9d2968c8683..a4b900fc66bfd6e06588473aa0a59f3cb3a3ec0a 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
+/* { dg-require-effective-target arm_hard_ok } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
-/* { dg-additional-options "-O2" } */
+/* { dg-additional-options "-mfloat-abi=hard -O2" } */
 
 #include "arm_mve.h"
 
index e487b73d417a2af5a35560fda19f0c40d05a4315..430df669f2a72311c548b92b519888c4ef2b6974 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
+/* { dg-require-effective-target arm_hard_ok } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
-/* { dg-additional-options "-O2" } */
+/* { dg-additional-options "-mfloat-abi=hard -O2" } */
 
 #include "arm_mve.h"
 
index ae57b9c947c3e7ff878c9d6c36880dd42ebbe88d..0e040121cf0037f8232c9e5a63d06d99cba6fe6f 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
+/* { dg-require-effective-target arm_hard_ok } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
-/* { dg-additional-options "-O2" } */
+/* { dg-additional-options "-mfloat-abi=hard -O2" } */
 
 #include "arm_mve.h"
 
index e42d711fe65acccf27de1529fd42a0f727def72a..1af7619273fefde9673ec99ab6e943863d3579ca 100644 (file)
@@ -5025,7 +5025,7 @@ proc check_effective_target_arm_v8_1m_mve_fp_ok_nocache { } {
 
     # Iterate through sets of options to find the compiler flags that
     # need to be added to the -march option.
-    foreach flags {"" "-mfloat-abi=hard -mfpu=auto -march=armv8.1-m.main+mve.fp" "-mfloat-abi=softfp -mfpu=auto -march=armv8.1-m.main+mve.fp"} {
+    foreach flags {"" "-mfloat-abi=softfp -mfpu=auto -march=armv8.1-m.main+mve.fp" "-mfloat-abi=hard -mfpu=auto -march=armv8.1-m.main+mve.fp"} {
        if { [check_no_compiler_messages_nocache \
                  arm_v8_1m_mve_fp_ok object {
            #include <arm_mve.h>
@@ -5208,7 +5208,7 @@ proc check_effective_target_arm_v8_1m_mve_ok_nocache { } {
 
     # Iterate through sets of options to find the compiler flags that
     # need to be added to the -march option.
-    foreach flags {"" "-mfloat-abi=hard -mfpu=auto -march=armv8.1-m.main+mve" "-mfloat-abi=softfp -mfpu=auto -march=armv8.1-m.main+mve"} {
+    foreach flags {"" "-mfloat-abi=softfp -mfpu=auto -march=armv8.1-m.main+mve" "-mfloat-abi=hard -mfpu=auto -march=armv8.1-m.main+mve"} {
         if { [check_no_compiler_messages_nocache \
                   arm_v8_1m_mve_ok object {
             #if !defined (__ARM_FEATURE_MVE)