[llvm] RuntimeLibcalls: Mostly move x86 configuration into tablegen (PR #148575)

Daniel Paoliello via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 14 09:27:05 PDT 2025


================
@@ -2001,28 +2052,59 @@ def SPARCSystemLibrary
 // Windows Runtime Libcalls
 //===----------------------------------------------------------------------===//
 
-// TT.isWindowsMSVCEnvironment() || TT.isWindowsItaniumEnvironment()
-
+defset list<RuntimeLibcallImpl> WindowsDivRemMulLibcalls = {
 def _alldiv : RuntimeLibcallImpl<SDIV_I64>;
 def _aulldiv : RuntimeLibcallImpl<UDIV_I64>;
 def _allrem : RuntimeLibcallImpl<SREM_I64>;
 def _aullrem : RuntimeLibcallImpl<UREM_I64>;
 def _allmul : RuntimeLibcallImpl<MUL_I64>;
+}
 
 //===----------------------------------------------------------------------===//
 // X86 Runtime Libcalls
 //===----------------------------------------------------------------------===//
 
 def isX86_32 : RuntimeLibcallPredicate<"TT.getArch() == Triple::x86">;
 def isX86_64 : RuntimeLibcallPredicate<"TT.getArch() == Triple::x86_64">;
+def isX86 : RuntimeLibcallPredicate<"TT.isX86()">;
+
+// Some darwins have an optimized __bzero/bzero function.
+def darwinHas__bzero : RuntimeLibcallPredicate<"TT.isMacOSX() && !TT.isMacOSXVersionLT(10, 6)">;
+
+// Use the f128 variants of math functions on x86
+defvar X86_F128_Libcalls = LibcallImpls<(add LibmF128Libcalls, LibmF128FiniteLibcalls), isGNUEnvironment>;
+
+defvar SinCosF32F64Libcalls = LibcallImpls<(add sincosf, sincos), hasSinCos_f32_f64>;
+
+defvar X86CommonLibcalls =
+  (add DarwinSinCosStret, DarwinExp10,
+       X86_F128_Libcalls,
+       sincos_f80,
+       LibmHasSinCosF80, // FIXME: Depends on long double
+       SinCosF32F64Libcalls,
+       LibcallImpls<(add __bzero), darwinHas__bzero>,
+       LibmHasFrexpF32, LibmHasLdexpF32,
+       LibmHasFrexpF80, LibmHasLdexpF80,
+       DefaultRuntimeLibcallImpls_f80,
+       // MSVCRT doesn't have powi
+       // FIXME: It's almost certainly correct that MSVCRT has
----------------
dpaoliello wrote:

This comment is confusing: does MSVC NOT have `__powitf2_f128` but there's a test relying on it, or does MSVC have `__powitf2_f128` and there's a test relying on it NOT having it.

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


More information about the llvm-commits mailing list