Skip to content

Commit cf353c7

Browse files
committed
Split int128 cases
1 parent 8e8c3bd commit cf353c7

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

llvm/include/llvm/IR/RuntimeLibcalls.td

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -990,15 +990,21 @@ defset list<RuntimeLibcallImpl> LibmF128FiniteLibcalls = {
990990
defvar AllDefaultLibCalls =
991991
!foreach(entry, AllDefaultRuntimeLibcallImpls, entry.Provides);
992992

993-
// These libcalls are only available in libgcc, not compiler-rt for
994-
// 32-bit arch. They are available on both for 64-bit.
995-
defvar LibCallsCompilerRT64OrLibGCC = [
993+
// Exist in libgcc and compiler-rt for 64-bit targets, or if
994+
// COMPILER_RT_ENABLE_SOFTWARE_INT128.
995+
defvar Int128RTLibcalls = [
996996
__ashlti3, __lshrti3, __ashrti3, __multi3, __mulodi4
997997
];
998998

999+
// Only available in compiler-rt
1000+
defvar CompilerRTOnlyInt128Libcalls = [
1001+
__mulodi4
1002+
];
1003+
9991004
defvar DefaultRuntimeLibcallImpls =
1000-
!listremove(AllDefaultRuntimeLibcallImpls,
1001-
LibCallsCompilerRT64OrLibGCC);
1005+
!listremove(!listremove(AllDefaultRuntimeLibcallImpls,
1006+
Int128RTLibcalls),
1007+
CompilerRTOnlyInt128Libcalls);
10021008

10031009
defvar DefaultRuntimeLibcallImpls_f128 =
10041010
!filter(entry, DefaultRuntimeLibcallImpls,
@@ -1013,7 +1019,7 @@ defvar DefaultLibcallImpls32 = DefaultRuntimeLibcallImpls;
10131019

10141020
/// Default set of libcall impls for 64-bit architectures.
10151021
defvar DefaultLibcallImpls64 = !listconcat(DefaultRuntimeLibcallImpls,
1016-
LibCallsCompilerRT64OrLibGCC);
1022+
Int128RTLibcalls);
10171023

10181024
defvar DarwinSinCosStret = LibcallImpls<(add __sincosf_stret, __sincos_stret),
10191025
darwinHasSinCosStret>;
@@ -1063,7 +1069,7 @@ def AArch64SystemLibrary : SystemRuntimeLibrary<
10631069
isAArch64_ExceptArm64EC,
10641070
(add DefaultRuntimeLibcallImpls,
10651071
AArch64LibcallImpls,
1066-
LibcallImpls<(add LibCallsCompilerRT64OrLibGCC), isAArch64_ILP64>,
1072+
LibcallImpls<(add Int128RTLibcalls), isAArch64_ILP64>,
10671073
LibcallImpls<(add bzero), isOSDarwin>,
10681074
DarwinExp10, DarwinSinCosStret,
10691075
LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128)
@@ -1644,8 +1650,7 @@ def PPCSystemLibrary
16441650
__extendkftf2, __trunctfkf2,
16451651
LibmF128Libcalls, AIX32Calls, AIX64Calls,
16461652
AvailableIf<memcpy, isNotAIX>,
1647-
LibcallImpls<(add LibCallsCompilerRT64OrLibGCC),
1648-
isPPC64/* or is libgcc*/>)>;
1653+
LibcallImpls<(add Int128RTLibcalls), isPPC64>)>;
16491654

16501655
//===----------------------------------------------------------------------===//
16511656
// SPARC Runtime Libcalls
@@ -1831,5 +1836,6 @@ def isWasm : RuntimeLibcallPredicate<"TT.isWasm()">;
18311836
// this on emscripten depending on what they end up doing.
18321837
def WasmSystemLibrary
18331838
: SystemRuntimeLibrary<isWasm,
1834-
(add DefaultRuntimeLibcallImpls, LibCallsCompilerRT64OrLibGCC,
1839+
(add DefaultRuntimeLibcallImpls, Int128RTLibcalls,
1840+
CompilerRTOnlyInt128Libcalls,
18351841
emscripten_return_address)>;

0 commit comments

Comments
 (0)