[llvm] [Arm64EC] Add support for `half` (PR #152843)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 10 23:17:54 PDT 2025


================
@@ -316,6 +316,11 @@ ThunkArgInfo AArch64Arm64ECCallLowering::canonicalizeThunkType(
                         ThunkArgTranslation::PointerIndirection};
   };
 
+  if (T->isHalfTy()) {
+    Out << "h";
----------------
efriedma-quic wrote:

The "namespace" here is arm64ec thunks.  For which there is no publicly documented mangling.  I think the intent might have been that you don't actually need to match MSVC's mangling, but in practice we get weird linker errors if we don't match.  Which leads to a problem here: MSVC doesn't support scalar half types.  So there's no documentation or code that can give us any hints here.

If we're going to pick something ourselves, I'd prefer to pick something that's very unlikely to conflict with anything Microsoft does, like `__llvm_half__` or something like that.

Of course, if Microsoft gives an answer, that would be better.

https://github.com/llvm/llvm-project/pull/152843


More information about the llvm-commits mailing list