@@ -139,6 +139,10 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
139139 EABI EABIVersion, StringRef ABIName) {
140140 setTargetRuntimeLibcallSets (TT, FloatABI);
141141
142+ // Early exit for targets that have fully ported to tablegen.
143+ if (TT.isAMDGPU () || TT.isNVPTX () || TT.isWasm ())
144+ return ;
145+
142146 // Use the f128 variants of math functions on x86
143147 if (TT.isX86 () && TT.isGNUEnvironment ())
144148 setLongDoubleIsF128Libm (*this , /* FiniteOnlyFuncs=*/ true );
@@ -241,15 +245,13 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
241245 if (TT.isARM () || TT.isThumb ())
242246 setARMLibcallNames (*this , TT, FloatABI, EABIVersion);
243247
244- if (!TT.isWasm ()) {
245- // These libcalls are only available in compiler-rt, not libgcc.
246- if (TT.isArch32Bit ()) {
247- setLibcallImpl (RTLIB::SHL_I128, RTLIB::Unsupported);
248- setLibcallImpl (RTLIB::SRL_I128, RTLIB::Unsupported);
249- setLibcallImpl (RTLIB::SRA_I128, RTLIB::Unsupported);
250- setLibcallImpl (RTLIB::MUL_I128, RTLIB::Unsupported);
251- setLibcallImpl (RTLIB::MULO_I64, RTLIB::Unsupported);
252- }
248+ // These libcalls are only available in compiler-rt, not libgcc.
249+ if (TT.isArch64Bit ()) {
250+ setLibcallImpl (RTLIB::SHL_I128, RTLIB::__ashlti3);
251+ setLibcallImpl (RTLIB::SRL_I128, RTLIB::__lshrti3);
252+ setLibcallImpl (RTLIB::SRA_I128, RTLIB::__ashrti3);
253+ setLibcallImpl (RTLIB::MUL_I128, RTLIB::__multi3);
254+ setLibcallImpl (RTLIB::MULO_I64, RTLIB::__mulodi4);
253255 }
254256
255257 if (TT.getArch () == Triple::ArchType::msp430) {
0 commit comments