@@ -25,77 +25,6 @@ static cl::opt<bool>
2525static void setARMLibcallNames (RuntimeLibcallsInfo &Info, const Triple &TT,
2626 FloatABI::ABIType FloatABIType,
2727 EABI EABIVersion) {
28- if (!TT.isOSDarwin () && !TT.isiOS () && !TT.isWatchOS () && !TT.isDriverKit ()) {
29- CallingConv::ID DefaultCC = FloatABIType == FloatABI::Hard
30- ? CallingConv::ARM_AAPCS_VFP
31- : CallingConv::ARM_AAPCS;
32- for (RTLIB::LibcallImpl LC : RTLIB::libcall_impls ())
33- Info.setLibcallImplCallingConv (LC, DefaultCC);
34- }
35-
36- // Register based DivRem for AEABI (RTABI 4.2)
37- if (TT.isTargetAEABI () || TT.isAndroid () || TT.isTargetGNUAEABI () ||
38- TT.isTargetMuslAEABI () || TT.isOSWindows ()) {
39- if (TT.isOSWindows ()) {
40- const struct {
41- const RTLIB::Libcall Op;
42- const RTLIB::LibcallImpl Impl;
43- const CallingConv::ID CC;
44- } LibraryCalls[] = {
45- {RTLIB::SDIVREM_I32, RTLIB::__rt_sdiv, CallingConv::ARM_AAPCS},
46- {RTLIB::SDIVREM_I64, RTLIB::__rt_sdiv64, CallingConv::ARM_AAPCS},
47- {RTLIB::UDIVREM_I32, RTLIB::__rt_udiv, CallingConv::ARM_AAPCS},
48- {RTLIB::UDIVREM_I64, RTLIB::__rt_udiv64, CallingConv::ARM_AAPCS},
49- };
50-
51- for (const auto &LC : LibraryCalls) {
52- Info.setLibcallImpl (LC.Op , LC.Impl );
53- Info.setLibcallImplCallingConv (LC.Impl , LC.CC );
54- }
55- } else {
56- const struct {
57- const RTLIB::Libcall Op;
58- const RTLIB::LibcallImpl Impl;
59- } LibraryCalls[] = {
60- {RTLIB::SDIVREM_I32, RTLIB::__aeabi_idivmod},
61- {RTLIB::SDIVREM_I64, RTLIB::__aeabi_ldivmod},
62- {RTLIB::UDIVREM_I32, RTLIB::__aeabi_uidivmod},
63- {RTLIB::UDIVREM_I64, RTLIB::__aeabi_uldivmod},
64- };
65-
66- for (const auto &LC : LibraryCalls)
67- Info.setLibcallImpl (LC.Op , LC.Impl );
68- }
69- }
70-
71- if (TT.isOSWindows ()) {
72- static const struct {
73- const RTLIB::Libcall Op;
74- const RTLIB::LibcallImpl Impl;
75- const CallingConv::ID CC;
76- } LibraryCalls[] = {
77- {RTLIB::FPTOSINT_F32_I64, RTLIB::__stoi64, CallingConv::ARM_AAPCS_VFP},
78- {RTLIB::FPTOSINT_F64_I64, RTLIB::__dtoi64, CallingConv::ARM_AAPCS_VFP},
79- {RTLIB::FPTOUINT_F32_I64, RTLIB::__stou64, CallingConv::ARM_AAPCS_VFP},
80- {RTLIB::FPTOUINT_F64_I64, RTLIB::__dtou64, CallingConv::ARM_AAPCS_VFP},
81- {RTLIB::SINTTOFP_I64_F32, RTLIB::__i64tos, CallingConv::ARM_AAPCS_VFP},
82- {RTLIB::SINTTOFP_I64_F64, RTLIB::__i64tod, CallingConv::ARM_AAPCS_VFP},
83- {RTLIB::UINTTOFP_I64_F32, RTLIB::__u64tos, CallingConv::ARM_AAPCS_VFP},
84- {RTLIB::UINTTOFP_I64_F64, RTLIB::__u64tod, CallingConv::ARM_AAPCS_VFP},
85- };
86-
87- for (const auto &LC : LibraryCalls) {
88- Info.setLibcallImpl (LC.Op , LC.Impl );
89- Info.setLibcallImplCallingConv (LC.Impl , LC.CC );
90- }
91- }
92-
93- // Use divmod compiler-rt calls for iOS 5.0 and later.
94- if (TT.isOSBinFormatMachO () && (!TT.isiOS () || !TT.isOSVersionLT (5 , 0 ))) {
95- Info.setLibcallImpl (RTLIB::SDIVREM_I32, RTLIB::__divmodsi4);
96- Info.setLibcallImpl (RTLIB::UDIVREM_I32, RTLIB::__udivmodsi4);
97- }
98-
9928 static const RTLIB::LibcallImpl AAPCS_Libcalls[] = {
10029 RTLIB::__aeabi_dadd, RTLIB::__aeabi_ddiv,
10130 RTLIB::__aeabi_dmul, RTLIB::__aeabi_dsub,
@@ -212,7 +141,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
212141 ExceptionHandling ExceptionModel,
213142 FloatABI::ABIType FloatABI,
214143 EABI EABIVersion, StringRef ABIName) {
215- setTargetRuntimeLibcallSets (TT);
144+ setTargetRuntimeLibcallSets (TT, FloatABI );
216145
217146 // Use the f128 variants of math functions on x86
218147 if (TT.isX86 () && TT.isGNUEnvironment ())
0 commit comments