Skip to content

Commit

Permalink
Fix: Windows does not define __ARM_NEON (#363)
Browse files Browse the repository at this point in the history
* Windows does not define __ARM_NEON

However, Windows requires NEON to work, so assume it is there if build with MSVC

* Clarify NEON availability in MSVC targeting arm64

* Fix Formatting
  • Loading branch information
JVital2013 authored Sep 5, 2024
1 parent c5fc491 commit 6aecde5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/cpu_features_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,14 @@

#endif // defined(CPU_FEATURES_ARCH_X86)

#if defined(CPU_FEATURES_ARCH_ANY_ARM)
#if defined(__ARM_NEON)
// 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

#if defined(CPU_FEATURES_ARCH_MIPS)
#if defined(__mips_msa)
Expand Down

0 comments on commit 6aecde5

Please sign in to comment.