Skip to content

Conversation

@kobykahane
Copy link

In MSVC, ARM64EC is a variant of the Windows ARM64 ABI that allows mixing native ARM64 code and emulated x64 code in the same process. It is useful, e.g., for programs that need to be able to load legacy x64 plugin DLLs.
When building for ARM64EC, _M_X64 is defined and many x64 intrinsics are available for compatibility. All ARM64 intrinsics are still available and while _M_ARM64 is not defined, _M_ARM64EC is.

Changes include:

  • Treat presence of _M_ARM64EC like _M_ARM64. In many cases this appears to be dead code because it's ignored when CRYPTOPP_DISABLE_ASM is set, which appears to be currently required for successful non-x64 Windows builds, but I've nevertheless made the changes everywhere for uniformity.
  • Add inclusion of winnt.h (indirectly, by way of minwindef.h) to pick up the declarations of intrinsics like __shiftleft128 on ARM64EC, when necessary.

For the actual build, I've used cryptopp-cmake with some tweaks for ARM64EC detection.
Verified by running the resulting ARM64EC build of cryptest.exe v on a Windows ARM64 device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant