@@ -459,7 +459,6 @@ def __multi3 : RuntimeLibcallImpl<MUL_I128>;
459459
460460def __mulosi4 : RuntimeLibcallImpl<MULO_I32>;
461461def __mulodi4 : RuntimeLibcallImpl<MULO_I64>;
462- def __muloti4 : RuntimeLibcallImpl<MULO_I128>;
463462
464463def __divqi3 : RuntimeLibcallImpl<SDIV_I8>;
465464def __divhi3 : RuntimeLibcallImpl<SDIV_I16>;
@@ -935,6 +934,12 @@ def calloc : RuntimeLibcallImpl<CALLOC>;
935934
936935} // End let IsDefault = true
937936
937+ //--------------------------------------------------------------------
938+ // compiler-rt, not available for most architectures
939+ //--------------------------------------------------------------------
940+
941+ def __muloti4 : RuntimeLibcallImpl<MULO_I128>;
942+
938943//--------------------------------------------------------------------
939944// Define implementation other libcalls
940945//--------------------------------------------------------------------
@@ -1032,14 +1037,18 @@ defvar AllDefaultRuntimeLibcallImpls
10321037// Exist in libgcc and compiler-rt for 64-bit targets, or if
10331038// COMPILER_RT_ENABLE_SOFTWARE_INT128.
10341039defvar Int128RTLibcalls = [
1035- __ashlti3, __lshrti3, __ashrti3, __multi3, __mulodi4
1040+ __ashlti3, __lshrti3, __ashrti3, __multi3
10361041];
10371042
10381043// Only available in compiler-rt
1039- defvar CompilerRTOnlyInt128Libcalls = [
1044+ defvar CompilerRTOnlyInt64Libcalls = [
10401045 __mulodi4
10411046];
10421047
1048+ defvar CompilerRTOnlyInt128Libcalls = [
1049+ __muloti4
1050+ ];
1051+
10431052defvar DefaultRuntimeLibcallImpls_f80 =
10441053 !filter(entry, AllDefaultRuntimeLibcallImpls,
10451054 !match(!cast<string>(entry.Provides), "F80"));
@@ -1057,7 +1066,8 @@ defvar DefaultRuntimeLibcallImpls =
10571066 !listremove(
10581067 !listremove(
10591068 !listremove(AllDefaultRuntimeLibcallImpls, Int128RTLibcalls),
1060- CompilerRTOnlyInt128Libcalls),
1069+ !listconcat(CompilerRTOnlyInt64Libcalls,
1070+ CompilerRTOnlyInt128Libcalls)),
10611071 DefaultRuntimeLibcallImpls_f80),
10621072 DefaultRuntimeLibcallImpls_ppcf128);
10631073
@@ -2143,5 +2153,5 @@ def isWasm : RuntimeLibcallPredicate<"TT.isWasm()">;
21432153def WasmSystemLibrary
21442154 : SystemRuntimeLibrary<isWasm,
21452155 (add DefaultRuntimeLibcallImpls, Int128RTLibcalls,
2146- CompilerRTOnlyInt128Libcalls,
2156+ CompilerRTOnlyInt64Libcalls, CompilerRTOnlyInt128Libcalls,
21472157 emscripten_return_address)>;
0 commit comments