@@ -29,6 +29,9 @@ def isNotOSWindowsOrIsCygwinMinGW
2929def isGNUEnvironment : RuntimeLibcallPredicate<"TT.isGNUEnvironment()">;
3030def darwinHasSinCosStret : RuntimeLibcallPredicate<"darwinHasSinCosStret(TT)">;
3131def darwinHasExp10 : RuntimeLibcallPredicate<"darwinHasExp10(TT)">;
32+
33+ def hasExp10 : RuntimeLibcallPredicate<[{!TT.isOSDarwin()}]>;
34+
3235def hasSinCos : RuntimeLibcallPredicate<"hasSinCos(TT)">;
3336
3437// FIXME: Way to combine predicates
@@ -776,12 +779,6 @@ def __exp2l_finite_f80 : RuntimeLibcallImpl<EXP2_FINITE_F80, "__exp2l_finite">;
776779def __exp2l_finite_f128 : RuntimeLibcallImpl<EXP2_FINITE_F128, "__exp2l_finite">;
777780def __exp2l_finite_ppcf128 : RuntimeLibcallImpl<EXP2_FINITE_PPCF128, "__exp2l_finite">;
778781
779- def exp10f : RuntimeLibcallImpl<EXP10_F32>;
780- def exp10 : RuntimeLibcallImpl<EXP10_F64>;
781- def exp10l_f80 : RuntimeLibcallImpl<EXP10_F80, "exp10l">;
782- def exp10l_f128 : RuntimeLibcallImpl<EXP10_F128, "exp10l">;
783- def exp10l_ppcf128 : RuntimeLibcallImpl<EXP10_PPCF128, "exp10l">;
784-
785782def sinf : RuntimeLibcallImpl<SIN_F32>;
786783def sin : RuntimeLibcallImpl<SIN_F64>;
787784defm sin : LibmLongDoubleLibCall;
@@ -942,6 +939,12 @@ def calloc : RuntimeLibcallImpl<CALLOC>;
942939
943940} // End let IsDefault = true
944941
942+ def exp10f : RuntimeLibcallImpl<EXP10_F32>;
943+ def exp10 : RuntimeLibcallImpl<EXP10_F64>;
944+ def exp10l_f80 : RuntimeLibcallImpl<EXP10_F80, "exp10l">;
945+ def exp10l_f128 : RuntimeLibcallImpl<EXP10_F128, "exp10l">;
946+ def exp10l_ppcf128 : RuntimeLibcallImpl<EXP10_PPCF128, "exp10l">;
947+
945948//--------------------------------------------------------------------
946949// compiler-rt/libgcc but 64-bit only, not available by default
947950//--------------------------------------------------------------------
@@ -1101,6 +1104,12 @@ defvar LibmHasSinCosF80 = LibcallImpls<(add sincos_f80), hasSinCos>;
11011104defvar LibmHasSinCosF128 = LibcallImpls<(add sincos_f128), hasSinCos>;
11021105defvar LibmHasSinCosPPCF128 = LibcallImpls<(add sincos_ppcf128), hasSinCos>;
11031106
1107+ defvar LibmHasExp10F32 = LibcallImpls<(add exp10f), hasExp10>;
1108+ defvar LibmHasExp10F64 = LibcallImpls<(add exp10), hasExp10>;
1109+ defvar LibmHasExp10F80 = LibcallImpls<(add exp10l_f80), hasExp10>;
1110+ defvar LibmHasExp10F128 = LibcallImpls<(add exp10l_f128), hasExp10>;
1111+ defvar LibmHasExp10PPCF128 = LibcallImpls<(add exp10l_ppcf128), hasExp10>;
1112+
11041113defvar WindowsMathRemovals = [
11051114 ldexpf, ldexp_f80, ldexp_f128, ldexp_ppcf128,
11061115 frexpf, frexp_f80, frexp_f128, frexp_ppcf128
@@ -1199,7 +1208,8 @@ def AArch64SystemLibrary : SystemRuntimeLibrary<
11991208 LibcallImpls<(add Int128RTLibcalls), isAArch64_ILP64>,
12001209 LibcallImpls<(add bzero), isOSDarwin>,
12011210 DarwinExp10, DarwinSinCosStret,
1202- LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128)
1211+ LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
1212+ LibmHasExp10F32, LibmHasExp10F64, LibmHasExp10F128)
12031213>;
12041214
12051215// Prepend a # to every name
@@ -1470,6 +1480,7 @@ def ARMSystemLibrary
14701480 AEABIDivRemCalls,
14711481 DarwinSinCosStret, DarwinExp10,
14721482 LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
1483+ LibmHasExp10F32, LibmHasExp10F64, LibmHasExp10F128,
14731484
14741485 // Use divmod compiler-rt calls for iOS 5.0 and later.
14751486 LibcallImpls<(add __divmodsi4, __udivmodsi4),
@@ -1962,6 +1973,7 @@ def PPCSystemLibrary
19621973 DefaultRuntimeLibcallImpls_f128),
19631974 __extendkftf2, __trunctfkf2,
19641975 DefaultRuntimeLibcallImpls_ppcf128,
1976+ exp10f, exp10, exp10l_ppcf128,
19651977 LibmF128Libcalls, AIX32Calls, AIX64Calls,
19661978 LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
19671979 LibmHasSinCosPPCF128,
@@ -1977,7 +1989,9 @@ def isRISCV64 : RuntimeLibcallPredicate<"TT.isRISCV64()">;
19771989
19781990def RISCVSystemLibrary
19791991 : SystemRuntimeLibrary<isRISCV,
1980- (add DefaultRuntimeLibcallImpls, __riscv_flush_icache,
1992+ (add DefaultRuntimeLibcallImpls,
1993+ exp10f, exp10, exp10l_f128,
1994+ __riscv_flush_icache,
19811995 LibcallImpls<(add Int128RTLibcalls), isRISCV64>)>;
19821996
19831997//===----------------------------------------------------------------------===//
@@ -2086,6 +2100,10 @@ defvar X86CommonLibcalls =
20862100 LibmHasFrexpF32, LibmHasLdexpF32,
20872101 LibmHasFrexpF80, LibmHasLdexpF80,
20882102 DefaultRuntimeLibcallImpls_f80,
2103+
2104+ LibmHasExp10F32, LibmHasExp10F64, LibmHasExp10F80,
2105+ LibmHasExp10F128,
2106+
20892107 // MSVCRT doesn't have powi
20902108 // FIXME: It's almost certainly correct that MSVCRT has
20912109 // __powitf2_f128, but at least one test is relying on it.
@@ -2230,4 +2248,5 @@ def WasmSystemLibrary
22302248 : SystemRuntimeLibrary<isWasm,
22312249 (add DefaultRuntimeLibcallImpls, Int128RTLibcalls,
22322250 CompilerRTOnlyInt64Libcalls, CompilerRTOnlyInt128Libcalls,
2251+ exp10f, exp10,
22332252 emscripten_return_address)>;
0 commit comments