@@ -25,80 +25,6 @@ static cl::opt<bool>
25
25
static void setARMLibcallNames (RuntimeLibcallsInfo &Info, const Triple &TT,
26
26
FloatABI::ABIType FloatABIType,
27
27
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
- const CallingConv::ID CC;
60
- } LibraryCalls[] = {
61
- {RTLIB::SDIVREM_I32, RTLIB::__aeabi_idivmod, CallingConv::ARM_AAPCS},
62
- {RTLIB::SDIVREM_I64, RTLIB::__aeabi_ldivmod, CallingConv::ARM_AAPCS},
63
- {RTLIB::UDIVREM_I32, RTLIB::__aeabi_uidivmod, CallingConv::ARM_AAPCS},
64
- {RTLIB::UDIVREM_I64, RTLIB::__aeabi_uldivmod, CallingConv::ARM_AAPCS},
65
- };
66
-
67
- for (const auto &LC : LibraryCalls) {
68
- Info.setLibcallImpl (LC.Op , LC.Impl );
69
- Info.setLibcallImplCallingConv (LC.Impl , LC.CC );
70
- }
71
- }
72
- }
73
-
74
- if (TT.isOSWindows ()) {
75
- static const struct {
76
- const RTLIB::Libcall Op;
77
- const RTLIB::LibcallImpl Impl;
78
- const CallingConv::ID CC;
79
- } LibraryCalls[] = {
80
- {RTLIB::FPTOSINT_F32_I64, RTLIB::__stoi64, CallingConv::ARM_AAPCS_VFP},
81
- {RTLIB::FPTOSINT_F64_I64, RTLIB::__dtoi64, CallingConv::ARM_AAPCS_VFP},
82
- {RTLIB::FPTOUINT_F32_I64, RTLIB::__stou64, CallingConv::ARM_AAPCS_VFP},
83
- {RTLIB::FPTOUINT_F64_I64, RTLIB::__dtou64, CallingConv::ARM_AAPCS_VFP},
84
- {RTLIB::SINTTOFP_I64_F32, RTLIB::__i64tos, CallingConv::ARM_AAPCS_VFP},
85
- {RTLIB::SINTTOFP_I64_F64, RTLIB::__i64tod, CallingConv::ARM_AAPCS_VFP},
86
- {RTLIB::UINTTOFP_I64_F32, RTLIB::__u64tos, CallingConv::ARM_AAPCS_VFP},
87
- {RTLIB::UINTTOFP_I64_F64, RTLIB::__u64tod, CallingConv::ARM_AAPCS_VFP},
88
- };
89
-
90
- for (const auto &LC : LibraryCalls) {
91
- Info.setLibcallImpl (LC.Op , LC.Impl );
92
- Info.setLibcallImplCallingConv (LC.Impl , LC.CC );
93
- }
94
- }
95
-
96
- // Use divmod compiler-rt calls for iOS 5.0 and later.
97
- if (TT.isOSBinFormatMachO () && (!TT.isiOS () || !TT.isOSVersionLT (5 , 0 ))) {
98
- Info.setLibcallImpl (RTLIB::SDIVREM_I32, RTLIB::__divmodsi4);
99
- Info.setLibcallImpl (RTLIB::UDIVREM_I32, RTLIB::__udivmodsi4);
100
- }
101
-
102
28
static const RTLIB::LibcallImpl AAPCS_Libcalls[] = {
103
29
RTLIB::__aeabi_dadd, RTLIB::__aeabi_ddiv,
104
30
RTLIB::__aeabi_dmul, RTLIB::__aeabi_dsub,
@@ -214,7 +140,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
214
140
ExceptionHandling ExceptionModel,
215
141
FloatABI::ABIType FloatABI,
216
142
EABI EABIVersion, StringRef ABIName) {
217
- setTargetRuntimeLibcallSets (TT);
143
+ setTargetRuntimeLibcallSets (TT, FloatABI );
218
144
219
145
// Use the f128 variants of math functions on x86
220
146
if (TT.isX86 () && TT.isGNUEnvironment ())
0 commit comments