]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: testsuite: Fix do-assemble tests for SME
authorSpencer Abson <spencer.abson@arm.com>
Thu, 31 Jul 2025 10:01:01 +0000 (10:01 +0000)
committerSpencer Abson <spencer.abson@arm.com>
Thu, 31 Jul 2025 10:08:18 +0000 (10:08 +0000)
GCC doesn't support SME without SVE2, so the -march=armv8-a+<ext> argument to
check_no_compiler_messages causes aarch64_asm_<ext>_ok to return zero for SME
and any <ext> that implies it.  This patch changes the baseline architecure to
armv9-a for these extensions.

The tests for ACLE SME2 intrinsics that require FEAT_FAMINMAX were configured
to do-assemble if aarch64_asm_sme2_ok returned 1 (by default), but they really
need to check if +faminmax is supported too.  The fix above exposed this, so
we also fix the do-assemble/do-compile choice for those tests here.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/sme2/acle-asm/amax_f16_x2.c: Gate do-assemble on
assembler support for +faminmax and +sme2.
* gcc.target/aarch64/sme2/acle-asm/amax_f16_x4.c: Likewise.
* gcc.target/aarch64/sme2/acle-asm/amax_f32_x2.c: Likewise.
* gcc.target/aarch64/sme2/acle-asm/amax_f32_x4.c: Likewise.
* gcc.target/aarch64/sme2/acle-asm/amax_f64_x2.c: Likewise.
* gcc.target/aarch64/sme2/acle-asm/amax_f64_x4.c: Likewise.
* gcc.target/aarch64/sme2/acle-asm/amin_f16_x2.c: Likewise.
* gcc.target/aarch64/sme2/acle-asm/amin_f16_x4.c: Likewise.
* gcc.target/aarch64/sme2/acle-asm/amin_f32_x2.c: Likewise.
* gcc.target/aarch64/sme2/acle-asm/amin_f32_x4.c: Likewise.
* gcc.target/aarch64/sme2/acle-asm/amin_f64_x2.c: Likewise.
* gcc.target/aarch64/sme2/acle-asm/amin_f64_x4.c: Likewise.
* lib/target-supports.exp: Split the extensions that require SME into
a separate set, and use armv9-a as their baseline.

13 files changed:
gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f16_x2.c
gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f16_x4.c
gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f32_x2.c
gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f32_x4.c
gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f64_x2.c
gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f64_x4.c
gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f16_x2.c
gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f16_x4.c
gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f32_x2.c
gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f32_x4.c
gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f64_x2.c
gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f64_x4.c
gcc/testsuite/lib/target-supports.exp

index 90b5438e173851521c3e19ea4af0ef42bf02c39f..b9fd96ac84f3a1902376463f05f1974a9c06f894 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-do assemble { target { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } */
+/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } } */
 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
 
 #include "test_sme2_acle.h"
index d168ad7ee8e2428d77ba3277efd9d44fcd0ff11a..70e269761acdc61f880fce129be1424e55634a8c 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-do assemble { target { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } */
+/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } } */
 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
 
 #include "test_sme2_acle.h"
index 618d50b9b61dc1664b83e02643856213ca3aba11..cf57d1b41632e50c2d1fd2d7229cf3e0fff49fca 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-do assemble { target { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } */
+/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } } */
 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
 
 #include "test_sme2_acle.h"
index 981e78c1b5c7cb9d35e0af0ec1eb04fdb5027f57..10d91757066c9552f2e32fbef8c2309e32898581 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-do assemble { target { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } */
+/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } } */
 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
 
 #include "test_sme2_acle.h"
index e93a409475e084c41fd733849b565efae8a9f77d..b7918ab44870514d21a4b3a4fd3c523be436ad21 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-do assemble { target { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } */
+/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } } */
 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
 
 #include "test_sme2_acle.h"
index 2db629e147c507683b108ab44b38941c6c467191..153a37a005db462310aa4552800621525c8f1ea6 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-do assemble { target { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } */
+/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } } */
 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
 
 #include "test_sme2_acle.h"
index 74604e14f01932d9af4e7e1042f61a78f3ff24b5..bd6e13b695f36d5f52722d43cff5357d561440f2 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-do assemble { target { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } */
+/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } } */
 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
 
 #include "test_sme2_acle.h"
index bc3779bca6ca383d121beaed422dfe79850b9209..9f71b1f8ae6cf88f81b2ff093039c38565a789db 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-do assemble { target { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } */
+/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } } */
 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
 
 #include "test_sme2_acle.h"
index 43e3075d40fc5c3deb821e2d050472408e140f5b..aaa6a2e8941c2d9d32e1d95149ccfcf7ae4a8205 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-do assemble { target { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } */
+/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } } */
 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
 
 #include "test_sme2_acle.h"
index 6bd20f8fdd9b70a2065f1ab3c112f5f7c2401d89..34c1098d285052b0bf6ba29ea9cb110d5f55f3b6 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-do assemble { target { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } */
+/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } } */
 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
 
 #include "test_sme2_acle.h"
index 3bbef3f27cdad8b72f418aeb441846e407f4a36b..e4138e0cdc9d57683d03db18e9efe91c605ec5ba 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-do assemble { target { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } */
+/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } } */
 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
 
 #include "test_sme2_acle.h"
index 6f4c9b7787a44b425abb7e7674e4874a87cfe783..8fbabe78b45875edd221a6f99104df7b8cc76ede 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-do assemble { target { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } */
+/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && aarch64_asm_faminmax_ok } } } } */
 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
 
 #include "test_sme2_acle.h"
index e375b1ec02b85d85dc8fd1112b885f17e0b3ebe0..74355194b7611196140be3e2f6c4a8f98ab24fa3 100644 (file)
@@ -12522,10 +12522,16 @@ proc check_effective_target_aarch64_gas_has_build_attributes { } {
 # various architecture extensions via the .arch_extension pseudo-op.
 
 set exts {
-    "bf16" "cmpbr" "crc" "crypto" "dotprod" "f32mm" "f64mm" "fp" "fp8"
-    "fp8dot2" "fp8dot4" "fp8fma" "i8mm" "ls64" "lse" "lut" "sb" "simd"
-    "sme-b16b16" "sme-f16f16" "sme-i16i64" "sme" "sme2" "sme2p1" "ssve-fp8dot2"
-    "ssve-fp8dot4" "ssve-fp8fma" "sve-b16b16" "sve" "sve2"
+    "bf16" "cmpbr" "crc" "crypto" "dotprod" "f32mm" "f64mm" "faminmax"
+    "fp" "fp8" "fp8dot2" "fp8dot4" "fp8fma" "i8mm" "ls64" "lse" "lut"
+    "sb" "simd" "sve-b16b16" "sve" "sve2"
+}
+
+# We don't support SME without SVE2, so we'll use armv9 as the base
+# archiecture for SME and the features that require it.
+set exts_sve2 {
+    "sme-b16b16" "sme-f16f16" "sme-i16i64" "sme" "sme2" "sme2p1"
+    "ssve-fp8dot2" "ssve-fp8dot4" "ssve-fp8fma"
 }
 
 foreach { aarch64_ext } $exts {
@@ -12542,6 +12548,20 @@ foreach { aarch64_ext } $exts {
     }]
 }
 
+foreach { aarch64_ext } $exts_sve2 {
+    eval [string map [list FUNC $aarch64_ext] {
+       proc check_effective_target_aarch64_asm_FUNC_ok { } {
+         if { [istarget aarch64*-*-*] } {
+               return [check_no_compiler_messages aarch64_FUNC_assembler object {
+                       __asm__ (".arch_extension FUNC");
+               } "-march=armv9-a+FUNC"]
+         } else {
+               return 0
+         }
+       }
+    }]
+}
+
 proc check_effective_target_aarch64_asm_sve2p1_ok { } {
     if { [istarget aarch64*-*-*] } {
        return [check_no_compiler_messages aarch64_sve2p1_assembler object {