From f137b5eb9ca149f3ff63eda12805446781f82904 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 17 Nov 2025 08:28:27 +0100 Subject: [PATCH] [cmake] fix aarch64 neon detection patch by @whitpa posted in #11997 --- cmake/DetectIntrinsicSupport.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/DetectIntrinsicSupport.cmake b/cmake/DetectIntrinsicSupport.cmake index 80d8c9f51..77ae4bd56 100644 --- a/cmake/DetectIntrinsicSupport.cmake +++ b/cmake/DetectIntrinsicSupport.cmake @@ -20,7 +20,7 @@ macro(set_simd_source_file_properties INTRINSIC_TYPE) set(SSE_X86_LIST "i686;x86") set(SSE_LIST "x86_64;ia64;x64;amd64;ia64;em64t;${SSE_X86_LIST}") - set(NEON_LIST "arm;armv7;armv8b;armv8l") + set(NEON_LIST "arm;armv7;armv8b;armv8l;aarch64") set(SUPPORTED_INTRINSICS_LIST "neon;sse2;sse3;ssse3;sse4.1;sse4.2;avx2") string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSTEM_PROCESSOR) @@ -85,7 +85,11 @@ macro(set_simd_source_file_properties INTRINSIC_TYPE) if(MSVC) set(SIMD_LINK_ARG "/arch:VFPv4") elseif("${CMAKE_C_COMPILER_ID}" IN_LIST GCC_CLANG_NAMES) - set(SIMD_LINK_ARG "-mfpu=neon") + if("${SYSTEM_PROCESSOR}" STREQUAL "aarch64") + set(SIMD_LINK_ARG "ignore") + else() + set(SIMD_LINK_ARG "-mfpu=neon") + endif() else() message(WARNING "[SIMD] Unsupported compiler ${CMAKE_C_COMPILER_ID}, ignoring") endif()