]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
SVE2 is armv9-a but gcc 11 does not recognize that
authorKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Mon, 9 Oct 2023 12:02:37 +0000 (20:02 +0800)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Mon, 9 Oct 2023 12:02:37 +0000 (20:02 +0800)
cmake/cflags-arm.cmake

index 4ed9145500b511a7d4b669f2a0d689257068629b..3a29209ebb3dcdb15c2fa8636a967f12934a6434 100644 (file)
@@ -9,10 +9,19 @@ if (NOT FAT_RUNTIME)
     endif ()
 endif ()
 
-set(SVE2_BITPERM_ARCH "armv9-a+sve2-bitperm")
-set(SVE2_ARCH "armv9-a")
-set(SVE_ARCH "armv8-a+sve")
+
+if (CMAKE_COMPILER_IS_GNUCXX)
+    set(ARMV9BASE_MINVER "12")
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ARMV9BASE_MINVER)
+        set(SVE2_ARCH "armv8-a+sve2")
+    else()
+        set(SVE2_ARCH "armv9-a")
+    endif()
+endif()
+
 set(ARMV8_ARCH "armv8-a")
+set(SVE_ARCH "${ARMV8_ARCH}+sve")
+set(SVE2_BITPERM_ARCH "${SVE2_ARCH}+sve2-bitperm")
 
 CHECK_INCLUDE_FILE_CXX(arm_neon.h HAVE_C_ARM_NEON_H)
 if (BUILD_SVE OR BUILD_SVE2 OR BUILD_SVE2_BITPERM OR FAT_RUNTIME)