@@ -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//--------------------------------------------------------------------
@@ -1097,6 +1100,12 @@ defvar LibmHasSinCosF80 = LibcallImpls<(add sincos_f80), hasSinCos>;
10971100defvar LibmHasSinCosF128 = LibcallImpls<(add sincos_f128), hasSinCos>;
10981101defvar LibmHasSinCosPPCF128 = LibcallImpls<(add sincos_ppcf128), hasSinCos>;
10991102
1103+ defvar LibmHasExp10F32 = LibcallImpls<(add exp10f), hasExp10>;
1104+ defvar LibmHasExp10F64 = LibcallImpls<(add exp10), hasExp10>;
1105+ defvar LibmHasExp10F80 = LibcallImpls<(add exp10l_f80), hasExp10>;
1106+ defvar LibmHasExp10F128 = LibcallImpls<(add exp10l_f128), hasExp10>;
1107+ defvar LibmHasExp10PPCF128 = LibcallImpls<(add exp10l_ppcf128), hasExp10>;
1108+
11001109defvar WindowsMathRemovals = [
11011110 ldexpf, ldexp_f80, ldexp_f128, ldexp_ppcf128,
11021111 frexpf, frexp_f80, frexp_f128, frexp_ppcf128
@@ -1195,7 +1204,8 @@ def AArch64SystemLibrary : SystemRuntimeLibrary<
11951204 LibcallImpls<(add Int128RTLibcalls), isAArch64_ILP64>,
11961205 LibcallImpls<(add bzero), isOSDarwin>,
11971206 DarwinExp10, DarwinSinCosStret,
1198- LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128)
1207+ LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
1208+ LibmHasExp10F32, LibmHasExp10F64, LibmHasExp10F128)
11991209>;
12001210
12011211// Prepend a # to every name
@@ -1466,6 +1476,7 @@ def ARMSystemLibrary
14661476 AEABIDivRemCalls,
14671477 DarwinSinCosStret, DarwinExp10,
14681478 LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
1479+ LibmHasExp10F32, LibmHasExp10F64, LibmHasExp10F128,
14691480
14701481 // Use divmod compiler-rt calls for iOS 5.0 and later.
14711482 LibcallImpls<(add __divmodsi4, __udivmodsi4),
@@ -1958,6 +1969,7 @@ def PPCSystemLibrary
19581969 DefaultRuntimeLibcallImpls_f128),
19591970 __extendkftf2, __trunctfkf2,
19601971 DefaultRuntimeLibcallImpls_ppcf128,
1972+ exp10f, exp10, exp10l_ppcf128,
19611973 LibmF128Libcalls, AIX32Calls, AIX64Calls,
19621974 LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
19631975 LibmHasSinCosPPCF128,
@@ -1973,7 +1985,9 @@ def isRISCV64 : RuntimeLibcallPredicate<"TT.isRISCV64()">;
19731985
19741986def RISCVSystemLibrary
19751987 : SystemRuntimeLibrary<isRISCV,
1976- (add DefaultRuntimeLibcallImpls, __riscv_flush_icache,
1988+ (add DefaultRuntimeLibcallImpls,
1989+ exp10f, exp10, exp10l_f128,
1990+ __riscv_flush_icache,
19771991 LibcallImpls<(add Int128RTLibcalls), isRISCV64>)>;
19781992
19791993//===----------------------------------------------------------------------===//
@@ -2068,7 +2082,7 @@ def isX86 : RuntimeLibcallPredicate<"TT.isX86()">;
20682082def darwinHas__bzero : RuntimeLibcallPredicate<"TT.isMacOSX() && !TT.isMacOSXVersionLT(10, 6)">;
20692083
20702084// FIXME: This is has ldexpl/frexpl plus use f128 for long double.
2071- def hasFrexplLdexplF128
2085+ def hasExpFrexplLdexplF128
20722086 : RuntimeLibcallPredicate<[{(!TT.isOSWindows() || TT.isOSCygMing()) && !TT.isGNUEnvironment()}]>;
20732087
20742088// Use the f128 variants of math functions on x86
@@ -2084,12 +2098,13 @@ defvar X86CommonLibcalls =
20842098 LibcallImpls<(add __bzero), darwinHas__bzero>,
20852099 LibmHasFrexpF32, LibmHasLdexpF32,
20862100 LibmHasFrexpF80, LibmHasLdexpF80,
2087- LibcallImpls<(add frexp_f128, ldexp_f128), hasFrexplLdexplF128 >,
2101+ LibcallImpls<(add frexp_f128, ldexp_f128, exp10l_f128 ), hasExpFrexplLdexplF128 >,
20882102 DefaultRuntimeLibcallImpls_f80,
2103+ LibmHasExp10F32, LibmHasExp10F64, LibmHasExp10F80,
2104+ LibcallImpls<(add MostPowI), isNotOSMSVCRT>,
20892105 // FIXME: MSVCRT doesn't have powi. The f128 case is added as a
20902106 // hack for one test relying on it.
2091- __powitf2_f128,
2092- LibcallImpls<(add MostPowI), isNotOSMSVCRT>
2107+ __powitf2_f128
20932108);
20942109
20952110defvar Windows32DivRemMulCalls =
@@ -2229,4 +2244,5 @@ def WasmSystemLibrary
22292244 : SystemRuntimeLibrary<isWasm,
22302245 (add DefaultRuntimeLibcallImpls, Int128RTLibcalls,
22312246 CompilerRTOnlyInt64Libcalls, CompilerRTOnlyInt128Libcalls,
2247+ exp10f, exp10,
22322248 emscripten_return_address)>;
0 commit comments