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.
---
 gcc/testsuite/lib/target-supports.exp | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index e375b1ec02b..e8b403ca02c 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -12524,8 +12524,14 @@ proc 
check_effective_target_aarch64_gas_has_build_attributes { } {
 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"
+    "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 {
-- 
2.34.1

Reply via email to