Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR solves compilation errors when building for the Windows ARM64EC ABI.
You can repro in an ARM64 Visual Studio Developer Command Prompt:
When building for the ARM64EC ABI, the compiler defines the
_M_X64
macro and not the_M_ARM64
macro, to make incremental porting existing X64 Windows code to ARM easier.This means that the library was detecting ARM64EC as AMD64 and trying to compile in the Intel SIMD vector implementations instead of NEON. This actually works in simple cases when building existing code that uses Intel intrinsics up to SSE4.2, because Windows provides an emulated implementation of those SIMD instruction sets in the
softintrin.lib
library, but it doesn't work at all for AVX+ intrinsics. It's also less efficient than using NEON directly.The change makes the CPU architecture detection aware of the ARM64EC ABI so it can correctly detect the code as being built for ARM64 and use the right intrinsics.
See also: simdjson/simdjson#2165