[llvm] RuntimeLibcalls: Mostly move x86 configuration into tablegen (PR #148575)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 14 16:50:01 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
----------------
arsenm wrote:
It doesn't have it, I assume (none of this stuff is documented but it would be weird if it had the f128 version and not the f32/f64). There's a test that tests all the types for the constrained powi intrinsic that happens to use an mcvc run line which currently compiles, this is avoiding turning that into an error
https://github.com/llvm/llvm-project/pull/148575
More information about the llvm-commits
mailing list