[PATCH] D125412: [ARM64EC 2/?] Add target triple, and allow targeting it.

Daniel Paoliello via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 13:28:48 PDT 2022


dpaoliello added a comment.

> We could do something like arm64ec-pc-windows-msvc, I guess.  That sort of goes against the spirit of target triples: the first part is usually used to describe the instruction set, and the fourth part is usually used to describe alternate ABI/environment/etc.  It's not like "arm64ec" makes sense anywhere other than Windows, anyway.
>
> Of course, everything related to triples is a bit fuzzy; if we want to use AArch64SubArch_arm64ec, there isn't really anything stopping us.

I would prefer it if we used a different first part to indicate that Arm64EC is a different "architecture" than AArch64.

>From a theoretical perspective, Arm64EC is a mix of AArch64 and x86_64: one can think of it as a weird processor that can run both AArch64 code (with some caveats, like the restricted registers) and x86_64 code, even if LLVM is only ever emitting AArch64 (which may not be true in the future if support for x86_64 assembly is added).

>From a practical perspective, MSVC uses a distinct set of architecture-specific preprocessor macros for Arm64EC vs AArch64: https://techcommunity.microsoft.com/t5/windows-kernel-internals-blog/getting-to-know-arm64ec-defines-and-intrinsic-functions/ba-p/2957235. Other languages should follow this pattern (i.e., disabling code that is targeted to AArch64 and instead enabling Arm64EC-specific code  - whether x86_64 code is also enabled is debatable), and having a different "architecture" part to the target-triple is an excellent way to signal this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125412/new/

https://reviews.llvm.org/D125412



More information about the llvm-commits mailing list