ldc icon indicating copy to clipboard operation
ldc copied to clipboard

arm64ec support?

Open p0nce opened this issue 1 year ago • 4 comments

On Windows the x86_64 and arm64ec are made to interoperate (each can host the other in the same process). arm64ec may well be there for a long time.

p0nce avatar Nov 04 '24 10:11 p0nce

Some implementation hints:

  • triple: arm64ec-windows-msvc. LLVM has a bool Triple::isWindowsArm64EC() function.
  • quote from clang PR: For the Arm64EC ABI, ARM64 functions have an alternate name. For C code, this name is just the original name prefixed with "#". For C++ code, we stick a "$$h" modifier in the middle of the mangling. https://reviews.llvm.org/D125418
  • ABI conventions: https://github.com/MicrosoftDocs/cpp-docs/blob/main/docs/build/arm64ec-windows-abi-conventions.md
  • some more info: https://learn.microsoft.com/en-us/windows/arm/arm64ec-abi
  • entry and exit thunks... don't know how much we have to do vs. what LLVM already does for us...

JohanEngelen avatar Nov 04 '24 21:11 JohanEngelen

extra reference about LLD support [WiP]:

  • https://github.com/llvm/llvm-project/issues/113658#issuecomment-2437513232

kassane avatar Nov 23 '24 16:11 kassane

It seems to me D compilers will need a way to separate arm64 (version identifier AArch64 from arm64ec (could be AArch64ec ?)

p0nce avatar Nov 24 '24 16:11 p0nce

It seems to me D compilers will need a way to separate arm64 (version identifier AArch64 from arm64ec (could be AArch64ec ?)

Yes indeed. The precedent of ABI version identifiers seems to follow ARCH_ABINAME naming, e.g. ARM_HardFloat. https://dlang.org/spec/version.html#predefined-versions So maybe AArch64_ARM64CE.

JohanEngelen avatar Nov 29 '24 19:11 JohanEngelen