google / cpu_features

A cross platform C99 library to get cpu features at runtime.
Apache License 2.0
2.44k stars 258 forks source link

Fix: Windows does not define __ARM_NEON #363

Closed JVital2013 closed 1 week ago

JVital2013 commented 2 weeks ago

On MSVC for ARM/ARM64, __ARM_NEON is not defined. However, Windows requires NEON on ARM, so it should be safe to assume that if CPU_FEATURES_ARCH_ANY_ARM is defined and we're in MSVC, NEON is also available.

There may be a better way to do this, but this patch has helped get my project running at full speed on Windows ARM64 machines and wanted to share. Thanks for this great library!

gchatelet commented 1 week ago

@JVital2013 do you mind clang-formating the patch?

JVital2013 commented 1 week ago

@gchatelet I fixed the formatting, sorry about that!