@@ -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
@@ -786,12 +789,6 @@ def __exp2l_finite_f80 : RuntimeLibcallImpl<EXP2_FINITE_F80, "__exp2l_finite">;
786789def __exp2l_finite_f128 : RuntimeLibcallImpl<EXP2_FINITE_F128, "__exp2l_finite">;
787790def __exp2l_finite_ppcf128 : RuntimeLibcallImpl<EXP2_FINITE_PPCF128, "__exp2l_finite">;
788791
789- def exp10f : RuntimeLibcallImpl<EXP10_F32>;
790- def exp10 : RuntimeLibcallImpl<EXP10_F64>;
791- def exp10l_f80 : RuntimeLibcallImpl<EXP10_F80, "exp10l">;
792- def exp10l_f128 : RuntimeLibcallImpl<EXP10_F128, "exp10l">;
793- def exp10l_ppcf128 : RuntimeLibcallImpl<EXP10_PPCF128, "exp10l">;
794-
795792def sinf : RuntimeLibcallImpl<SIN_F32>;
796793def sin : RuntimeLibcallImpl<SIN_F64>;
797794defm sin : LibmLongDoubleLibCall;
@@ -952,6 +949,12 @@ def calloc : RuntimeLibcallImpl<CALLOC>;
952949
953950} // End let IsDefault = true
954951
952+ def exp10f : RuntimeLibcallImpl<EXP10_F32>;
953+ def exp10 : RuntimeLibcallImpl<EXP10_F64>;
954+ def exp10l_f80 : RuntimeLibcallImpl<EXP10_F80, "exp10l">;
955+ def exp10l_f128 : RuntimeLibcallImpl<EXP10_F128, "exp10l">;
956+ def exp10l_ppcf128 : RuntimeLibcallImpl<EXP10_PPCF128, "exp10l">;
957+
955958//--------------------------------------------------------------------
956959// compiler-rt/libgcc but 64-bit only, not available by default
957960//--------------------------------------------------------------------
@@ -1113,6 +1116,17 @@ defvar LibmHasSinCosF80 = LibcallImpls<(add sincos_f80), hasSinCos>;
11131116defvar LibmHasSinCosF128 = LibcallImpls<(add sincos_f128), hasSinCos>;
11141117defvar LibmHasSinCosPPCF128 = LibcallImpls<(add sincos_ppcf128), hasSinCos>;
11151118
1119+ defvar LibmHasExp10F32 = LibcallImpls<(add exp10f), hasExp10>;
1120+ defvar LibmHasExp10F64 = LibcallImpls<(add exp10), hasExp10>;
1121+ defvar LibmHasExp10F80 = LibcallImpls<(add exp10l_f80), hasExp10>;
1122+ defvar LibmHasExp10F128 = LibcallImpls<(add exp10l_f128), hasExp10>;
1123+ defvar LibmHasExp10PPCF128 = LibcallImpls<(add exp10l_ppcf128), hasExp10>;
1124+
1125+ defvar DefaultLibmExp10 = [
1126+ LibmHasExp10F32, LibmHasExp10F64, LibmHasExp10F128
1127+ ];
1128+
1129+
11161130defvar WindowsMathRemovals = [
11171131 ldexpf, ldexp_f80, ldexp_f128, ldexp_ppcf128,
11181132 frexpf, frexp_f80, frexp_f128, frexp_ppcf128
@@ -1135,7 +1149,6 @@ defvar LibmHasLdexpF80 = LibcallImpls<(add ldexp_f80), isNotOSWindowsOrIsCygwinM
11351149defvar LibmHasFrexpF128 = LibcallImpls<(add frexp_f128), isNotOSWindowsOrIsCygwinMinGW>;
11361150defvar LibmHasLdexpF128 = LibcallImpls<(add ldexp_f128), isNotOSWindowsOrIsCygwinMinGW>;
11371151
1138-
11391152//===----------------------------------------------------------------------===//
11401153// Objective-C Runtime Libcalls
11411154//===----------------------------------------------------------------------===//
@@ -1211,7 +1224,8 @@ def AArch64SystemLibrary : SystemRuntimeLibrary<
12111224 LibcallImpls<(add Int128RTLibcalls), isAArch64_ILP64>,
12121225 LibcallImpls<(add bzero), isOSDarwin>,
12131226 DarwinExp10, DarwinSinCosStret,
1214- LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128)
1227+ LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
1228+ DefaultLibmExp10)
12151229>;
12161230
12171231// Prepend a # to every name
@@ -1482,6 +1496,7 @@ def ARMSystemLibrary
14821496 AEABIDivRemCalls,
14831497 DarwinSinCosStret, DarwinExp10,
14841498 LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
1499+ DefaultLibmExp10,
14851500
14861501 // Use divmod compiler-rt calls for iOS 5.0 and later.
14871502 LibcallImpls<(add __divmodsi4, __udivmodsi4),
@@ -1983,6 +1998,7 @@ def PPCSystemLibrary
19831998 DefaultRuntimeLibcallImpls_f128),
19841999 __extendkftf2, __trunctfkf2,
19852000 DefaultRuntimeLibcallImpls_ppcf128,
2001+ exp10f, exp10, exp10l_ppcf128,
19862002 LibmF128Libcalls, AIX32Calls, AIX64Calls,
19872003 LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
19882004 LibmHasSinCosPPCF128,
@@ -1998,7 +2014,9 @@ def isRISCV64 : RuntimeLibcallPredicate<"TT.isRISCV64()">;
19982014
19992015def RISCVSystemLibrary
20002016 : SystemRuntimeLibrary<isRISCV,
2001- (add DefaultRuntimeLibcallImpls, __riscv_flush_icache,
2017+ (add DefaultRuntimeLibcallImpls,
2018+ exp10f, exp10, exp10l_f128,
2019+ __riscv_flush_icache,
20022020 LibcallImpls<(add Int128RTLibcalls), isRISCV64>)>;
20032021
20042022//===----------------------------------------------------------------------===//
@@ -2104,7 +2122,7 @@ def isX86 : RuntimeLibcallPredicate<"TT.isX86()">;
21042122def darwinHas__bzero : RuntimeLibcallPredicate<"TT.isMacOSX() && !TT.isMacOSXVersionLT(10, 6)">;
21052123
21062124// FIXME: This is has ldexpl/frexpl plus use f128 for long double.
2107- def hasFrexplLdexplF128
2125+ def hasExpFrexplLdexplF128
21082126 : RuntimeLibcallPredicate<[{(!TT.isOSWindows() || TT.isOSCygMing()) && !TT.isGNUEnvironment()}]>;
21092127
21102128// Use the f128 variants of math functions on x86
@@ -2120,12 +2138,13 @@ defvar X86CommonLibcalls =
21202138 LibcallImpls<(add __bzero), darwinHas__bzero>,
21212139 LibmHasFrexpF32, LibmHasLdexpF32,
21222140 LibmHasFrexpF80, LibmHasLdexpF80,
2123- LibcallImpls<(add frexp_f128, ldexp_f128), hasFrexplLdexplF128 >,
2141+ LibcallImpls<(add frexp_f128, ldexp_f128, exp10l_f128 ), hasExpFrexplLdexplF128 >,
21242142 DefaultRuntimeLibcallImpls_f80,
2143+ LibmHasExp10F32, LibmHasExp10F64, LibmHasExp10F80,
2144+ LibcallImpls<(add MostPowI), isNotOSMSVCRT>,
21252145 // FIXME: MSVCRT doesn't have powi. The f128 case is added as a
21262146 // hack for one test relying on it.
2127- __powitf2_f128,
2128- LibcallImpls<(add MostPowI), isNotOSMSVCRT>
2147+ __powitf2_f128
21292148);
21302149
21312150defvar Windows32DivRemMulCalls =
@@ -2265,4 +2284,5 @@ def WasmSystemLibrary
22652284 : SystemRuntimeLibrary<isWasm,
22662285 (add DefaultRuntimeLibcallImpls, Int128RTLibcalls,
22672286 CompilerRTOnlyInt64Libcalls, CompilerRTOnlyInt128Libcalls,
2287+ exp10f, exp10,
22682288 emscripten_return_address)>;
0 commit comments