]> 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 13:53:08 +0000 (13:53 +0000)
committerSpencer Abson <spencer.abson@arm.com>
Thu, 31 Jul 2025 14:21:07 +0000 (14:21 +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.

gcc/testsuite/ChangeLog:

* lib/target-supports.exp: Split the extensions that require SME into
a separate set, and use armv9-a as their baseline.

(cherry picked from commit 9793ffce9332349441b5c83f8c1809ac4264a0f2)

gcc/testsuite/lib/target-supports.exp

index 35dca396f4efab5799bf8284b82186a2b88ed179..c0376b04551e507d0f47199567f52ddfbe44cec5 100644 (file)
@@ -12367,12 +12367,20 @@ proc check_effective_target_aarch64_tiny { } {
 # Create functions to check that the AArch64 assembler supports the
 # various architecture extensions via the .arch_extension pseudo-op.
 
-foreach { aarch64_ext } { "fp" "simd" "crypto" "crc" "lse" "dotprod" "sve"
-                         "i8mm" "f32mm" "f64mm" "bf16" "sb" "sve2" "ls64"
-                         "lut" "sme" "sme-i16i64" "sme2" "sve-b16b16"
-                         "sme-b16b16" "sme-f16f16" "sme2p1" "fp8" "fp8fma"
-                         "ssve-fp8fma" "fp8dot2" "ssve-fp8dot2" "fp8dot4"
-                         "ssve-fp8dot4"} {
+set exts {
+    "bf16" "crc" "crypto" "dotprod" "f32mm" "f64mm" "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 {
     eval [string map [list FUNC $aarch64_ext] {
        proc check_effective_target_aarch64_asm_FUNC_ok { } {
          if { [istarget aarch64*-*-*] } {
@@ -12386,6 +12394,20 @@ foreach { aarch64_ext } { "fp" "simd" "crypto" "crc" "lse" "dotprod" "sve"
     }]
 }
 
+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 {