[libc-commits] [libc] [libc][arm64ec] Make Arm64EC its own architecture in libc instead of defaulting to x64 (PR #227093)

Jacek Caban via libc-commits libc-commits at lists.llvm.org
Fri Oct 2 06:49:48 PDT 2026


================
@@ -48,9 +48,13 @@ template <> LIBC_INLINE long double sqrt<long double>(long double x) {
 
 #else // __builtin_elementwise_sqrt
 // Use inline assembly when __builtin_elementwise_sqrt is not available.
-#if defined(LIBC_TARGET_CPU_HAS_SSE2) && defined(LIBC_TARGET_ARCH_IS_X86_64)
+#if defined(LIBC_TARGET_CPU_HAS_SSE2) &&                                       \
+    defined(LIBC_TARGET_ARCH_IS_X86_64) &&                                     \
+    !defined(LIBC_TARGET_ARCH_IS_ARM64EC)
----------------
cjacek wrote:

This seems redundant, with architectures.h change `LIBC_TARGET_ARCH_IS_X86_64` is not defined for arm64ec.

Having `LIBC_TARGET_ARCH_IS_X86_64` defined for arm64ec would be more consistent with how builtin macros work on arm64ec (and then this change would be needed), but it would seem impractical for libc to use it like that, so I think I can see why you decided to have it undefined instead. Looks good to me overall, thanks.

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


More information about the libc-commits mailing list