From f386b119ee9542766169cbbdc698f024c4d74098 Mon Sep 17 00:00:00 2001 From: Jamie Vital Date: Fri, 30 Aug 2024 09:55:22 -0400 Subject: [PATCH 1/3] Windows does not define __ARM_NEON However, Windows requires NEON to work, so assume it is there if build with MSVC --- include/cpu_features_macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cpu_features_macros.h b/include/cpu_features_macros.h index b95cead9..b6c4b14e 100644 --- a/include/cpu_features_macros.h +++ b/include/cpu_features_macros.h @@ -235,7 +235,7 @@ #endif // defined(CPU_FEATURES_ARCH_X86) #if defined(CPU_FEATURES_ARCH_ANY_ARM) -#if defined(__ARM_NEON) +#if defined(__ARM_NEON) || defined(_MSC_VER) #define CPU_FEATURES_COMPILED_ANY_ARM_NEON 1 #else #define CPU_FEATURES_COMPILED_ANY_ARM_NEON 0 From 82256976624227032dfb238433897869b88de515 Mon Sep 17 00:00:00 2001 From: Jamie Vital Date: Thu, 5 Sep 2024 09:02:29 -0400 Subject: [PATCH 2/3] Clarify NEON availability in MSVC targeting arm64 --- include/cpu_features_macros.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/cpu_features_macros.h b/include/cpu_features_macros.h index b6c4b14e..f6ce89e5 100644 --- a/include/cpu_features_macros.h +++ b/include/cpu_features_macros.h @@ -234,13 +234,13 @@ #endif // defined(CPU_FEATURES_ARCH_X86) -#if defined(CPU_FEATURES_ARCH_ANY_ARM) -#if defined(__ARM_NEON) || defined(_MSC_VER) +// Note: MSVC targeting ARM does not define `__ARM_NEON` but Windows on ARM requires it. +// In that case we force NEON detection. +#if defined(__ARM_NEON) || (defined(CPU_FEATURES_COMPILER_MSC) && defined(CPU_FEATURES_ARCH_ANY_ARM)) #define CPU_FEATURES_COMPILED_ANY_ARM_NEON 1 #else #define CPU_FEATURES_COMPILED_ANY_ARM_NEON 0 -#endif // defined(__ARM_NEON) -#endif // defined(CPU_FEATURES_ARCH_ANY_ARM) +#endif // defined(__ARM_NEON) || (defined(CPU_FEATURES_COMPILER_MSC) && defined(CPU_FEATURES_ARCH_ANY_ARM)) #if defined(CPU_FEATURES_ARCH_MIPS) #if defined(__mips_msa) From 5802933416494c1d3db3e7df11ccd099d949e959 Mon Sep 17 00:00:00 2001 From: Jamie Vital Date: Thu, 5 Sep 2024 09:55:10 -0400 Subject: [PATCH 3/3] Fix Formatting --- include/cpu_features_macros.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/cpu_features_macros.h b/include/cpu_features_macros.h index f6ce89e5..11502242 100644 --- a/include/cpu_features_macros.h +++ b/include/cpu_features_macros.h @@ -234,13 +234,14 @@ #endif // defined(CPU_FEATURES_ARCH_X86) -// Note: MSVC targeting ARM does not define `__ARM_NEON` but Windows on ARM requires it. -// In that case we force NEON detection. -#if defined(__ARM_NEON) || (defined(CPU_FEATURES_COMPILER_MSC) && defined(CPU_FEATURES_ARCH_ANY_ARM)) +// Note: MSVC targeting ARM does not define `__ARM_NEON` but Windows on ARM +// requires it. In that case we force NEON detection. +#if defined(__ARM_NEON) || \ + (defined(CPU_FEATURES_COMPILER_MSC) && defined(CPU_FEATURES_ARCH_ANY_ARM)) #define CPU_FEATURES_COMPILED_ANY_ARM_NEON 1 #else #define CPU_FEATURES_COMPILED_ANY_ARM_NEON 0 -#endif // defined(__ARM_NEON) || (defined(CPU_FEATURES_COMPILER_MSC) && defined(CPU_FEATURES_ARCH_ANY_ARM)) +#endif #if defined(CPU_FEATURES_ARCH_MIPS) #if defined(__mips_msa)