@@ -139,6 +139,10 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
139
139
EABI EABIVersion, StringRef ABIName) {
140
140
setTargetRuntimeLibcallSets (TT, FloatABI);
141
141
142
+ // Early exit for targets that have fully ported to tablegen.
143
+ if (TT.isAMDGPU () || TT.isNVPTX () || TT.isWasm ())
144
+ return ;
145
+
142
146
// Use the f128 variants of math functions on x86
143
147
if (TT.isX86 () && TT.isGNUEnvironment ())
144
148
setLongDoubleIsF128Libm (*this , /* FiniteOnlyFuncs=*/ true );
@@ -241,15 +245,13 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
241
245
if (TT.isARM () || TT.isThumb ())
242
246
setARMLibcallNames (*this , TT, FloatABI, EABIVersion);
243
247
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);
253
255
}
254
256
255
257
if (TT.getArch () == Triple::ArchType::msp430) {
0 commit comments