llvm.org GIT mirror llvm / acdb8f9
Move Runtime libcall definitions to a .def file This will allow eliminating the duplication of the names, and allow adding extra information such as signatures in a future commit. Differential Revision: https://reviews.llvm.org/D35522 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308531 91177308-0d34-0410-b5e6-96231b3b80d8 Derek Schuff 3 years ago
3 changed file(s) with 504 addition(s) and 904 deletion(s). Raw diff Collapse all Expand all
0 //===-- llvm/RuntimeLibcalls.def - File that describes libcalls -*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines all of the runtime library calls the backend can emit.
10 // The various long double types cannot be merged, because 80-bit library
11 // functions use "xf" and 128-bit use "tf".
12 //
13 // When adding PPCF128 functions here, note that their names generally need
14 // to be overridden for Darwin with the xxx$LDBL128 form. See
15 // PPCISelLowering.cpp.
16 //
17 //===----------------------------------------------------------------------===//
18
19 // NOTE: NO INCLUDE GUARD DESIRED!
20
21 // Provide definitions of macros so that users of this file do not have to
22 // define everything to use it...
23
24 // Declare the enumerator for each libcall, along with its default name. Some
25 // libcalls have different names on particular OSes or architectures. These
26 // are set in InitLibcallNames() in TargetLoweringBase.cpp and/or by targets
27 // using TargetLoweringBase::setLibcallName()
28 #ifndef HANDLE_LIBCALL
29 #error "HANDLE_LIBCALL must be defined"
30 #endif
31
32 // Integer
33 HANDLE_LIBCALL(SHL_I16, "__ashlhi3")
34 HANDLE_LIBCALL(SHL_I32, "__ashlsi3")
35 HANDLE_LIBCALL(SHL_I64, "__ashldi3")
36 HANDLE_LIBCALL(SHL_I128, "__ashlti3")
37 HANDLE_LIBCALL(SRL_I16, "__lshrhi3")
38 HANDLE_LIBCALL(SRL_I32, "__lshrsi3")
39 HANDLE_LIBCALL(SRL_I64, "__lshrdi3")
40 HANDLE_LIBCALL(SRL_I128, "__lshrti3")
41 HANDLE_LIBCALL(SRA_I16, "__ashrhi3")
42 HANDLE_LIBCALL(SRA_I32, "__ashrsi3")
43 HANDLE_LIBCALL(SRA_I64, "__ashrdi3")
44 HANDLE_LIBCALL(SRA_I128, "__ashrti3")
45 HANDLE_LIBCALL(MUL_I8, "__mulqi3")
46 HANDLE_LIBCALL(MUL_I16, "__mulhi3")
47 HANDLE_LIBCALL(MUL_I32, "__mulsi3")
48 HANDLE_LIBCALL(MUL_I64, "__muldi3")
49 HANDLE_LIBCALL(MUL_I128, "__multi3")
50 HANDLE_LIBCALL(MULO_I32, "__mulosi4")
51 HANDLE_LIBCALL(MULO_I64, "__mulodi4")
52 HANDLE_LIBCALL(MULO_I128, "__muloti4")
53 HANDLE_LIBCALL(SDIV_I8, "__divqi3")
54 HANDLE_LIBCALL(SDIV_I16, "__divhi3")
55 HANDLE_LIBCALL(SDIV_I32, "__divsi3")
56 HANDLE_LIBCALL(SDIV_I64, "__divdi3")
57 HANDLE_LIBCALL(SDIV_I128, "__divti3")
58 HANDLE_LIBCALL(UDIV_I8, "__udivqi3")
59 HANDLE_LIBCALL(UDIV_I16, "__udivhi3")
60 HANDLE_LIBCALL(UDIV_I32, "__udivsi3")
61 HANDLE_LIBCALL(UDIV_I64, "__udivdi3")
62 HANDLE_LIBCALL(UDIV_I128, "__udivti3")
63 HANDLE_LIBCALL(SREM_I8, "__modqi3")
64 HANDLE_LIBCALL(SREM_I16, "__modhi3")
65 HANDLE_LIBCALL(SREM_I32, "__modsi3")
66 HANDLE_LIBCALL(SREM_I64, "__moddi3")
67 HANDLE_LIBCALL(SREM_I128, "__modti3")
68 HANDLE_LIBCALL(UREM_I8, "__umodqi3")
69 HANDLE_LIBCALL(UREM_I16, "__umodhi3")
70 HANDLE_LIBCALL(UREM_I32, "__umodsi3")
71 HANDLE_LIBCALL(UREM_I64, "__umoddi3")
72 HANDLE_LIBCALL(UREM_I128, "__umodti3")
73 HANDLE_LIBCALL(SDIVREM_I8, nullptr)
74 HANDLE_LIBCALL(SDIVREM_I16, nullptr)
75 HANDLE_LIBCALL(SDIVREM_I32, nullptr)
76 HANDLE_LIBCALL(SDIVREM_I64, nullptr)
77 HANDLE_LIBCALL(SDIVREM_I128, nullptr)
78 HANDLE_LIBCALL(UDIVREM_I8, nullptr)
79 HANDLE_LIBCALL(UDIVREM_I16, nullptr)
80 HANDLE_LIBCALL(UDIVREM_I32, nullptr)
81 HANDLE_LIBCALL(UDIVREM_I64, nullptr)
82 HANDLE_LIBCALL(UDIVREM_I128, nullptr)
83 HANDLE_LIBCALL(NEG_I32, "__negsi2")
84 HANDLE_LIBCALL(NEG_I64, "__negdi2")
85
86 // Floating-point
87 HANDLE_LIBCALL(ADD_F32, "__addsf3")
88 HANDLE_LIBCALL(ADD_F64, "__adddf3")
89 HANDLE_LIBCALL(ADD_F80, "__addxf3")
90 HANDLE_LIBCALL(ADD_F128, "__addtf3")
91 HANDLE_LIBCALL(ADD_PPCF128, "__gcc_qadd")
92 HANDLE_LIBCALL(SUB_F32, "__subsf3")
93 HANDLE_LIBCALL(SUB_F64, "__subdf3")
94 HANDLE_LIBCALL(SUB_F80, "__subxf3")
95 HANDLE_LIBCALL(SUB_F128, "__subtf3")
96 HANDLE_LIBCALL(SUB_PPCF128, "__gcc_qsub")
97 HANDLE_LIBCALL(MUL_F32, "__mulsf3")
98 HANDLE_LIBCALL(MUL_F64, "__muldf3")
99 HANDLE_LIBCALL(MUL_F80, "__mulxf3")
100 HANDLE_LIBCALL(MUL_F128, "__multf3")
101 HANDLE_LIBCALL(MUL_PPCF128, "__gcc_qmul")
102 HANDLE_LIBCALL(DIV_F32, "__divsf3")
103 HANDLE_LIBCALL(DIV_F64, "__divdf3")
104 HANDLE_LIBCALL(DIV_F80, "__divxf3")
105 HANDLE_LIBCALL(DIV_F128, "__divtf3")
106 HANDLE_LIBCALL(DIV_PPCF128, "__gcc_qdiv")
107 HANDLE_LIBCALL(REM_F32, "fmodf")
108 HANDLE_LIBCALL(REM_F64, "fmod")
109 HANDLE_LIBCALL(REM_F80, "fmodl")
110 HANDLE_LIBCALL(REM_F128, "fmodl")
111 HANDLE_LIBCALL(REM_PPCF128, "fmodl")
112 HANDLE_LIBCALL(FMA_F32, "fmaf")
113 HANDLE_LIBCALL(FMA_F64, "fma")
114 HANDLE_LIBCALL(FMA_F80, "fmal")
115 HANDLE_LIBCALL(FMA_F128, "fmal")
116 HANDLE_LIBCALL(FMA_PPCF128, "fmal")
117 HANDLE_LIBCALL(POWI_F32, "__powisf2")
118 HANDLE_LIBCALL(POWI_F64, "__powidf2")
119 HANDLE_LIBCALL(POWI_F80, "__powixf2")
120 HANDLE_LIBCALL(POWI_F128, "__powitf2")
121 HANDLE_LIBCALL(POWI_PPCF128, "__powitf2")
122 HANDLE_LIBCALL(SQRT_F32, "sqrtf")
123 HANDLE_LIBCALL(SQRT_F64, "sqrt")
124 HANDLE_LIBCALL(SQRT_F80, "sqrtl")
125 HANDLE_LIBCALL(SQRT_F128, "sqrtl")
126 HANDLE_LIBCALL(SQRT_PPCF128, "sqrtl")
127 HANDLE_LIBCALL(LOG_F32, "logf")
128 HANDLE_LIBCALL(LOG_F64, "log")
129 HANDLE_LIBCALL(LOG_F80, "logl")
130 HANDLE_LIBCALL(LOG_F128, "logl")
131 HANDLE_LIBCALL(LOG_PPCF128, "logl")
132 HANDLE_LIBCALL(LOG2_F32, "log2f")
133 HANDLE_LIBCALL(LOG2_F64, "log2")
134 HANDLE_LIBCALL(LOG2_F80, "log2l")
135 HANDLE_LIBCALL(LOG2_F128, "log2l")
136 HANDLE_LIBCALL(LOG2_PPCF128, "log2l")
137 HANDLE_LIBCALL(LOG10_F32, "log10f")
138 HANDLE_LIBCALL(LOG10_F64, "log10")
139 HANDLE_LIBCALL(LOG10_F80, "log10l")
140 HANDLE_LIBCALL(LOG10_F128, "log10l")
141 HANDLE_LIBCALL(LOG10_PPCF128, "log10l")
142 HANDLE_LIBCALL(EXP_F32, "expf")
143 HANDLE_LIBCALL(EXP_F64, "exp")
144 HANDLE_LIBCALL(EXP_F80, "expl")
145 HANDLE_LIBCALL(EXP_F128, "expl")
146 HANDLE_LIBCALL(EXP_PPCF128, "expl")
147 HANDLE_LIBCALL(EXP2_F32, "exp2f")
148 HANDLE_LIBCALL(EXP2_F64, "exp2")
149 HANDLE_LIBCALL(EXP2_F80, "exp2l")
150 HANDLE_LIBCALL(EXP2_F128, "exp2l")
151 HANDLE_LIBCALL(EXP2_PPCF128, "exp2l")
152 HANDLE_LIBCALL(SIN_F32, "sinf")
153 HANDLE_LIBCALL(SIN_F64, "sin")
154 HANDLE_LIBCALL(SIN_F80, "sinl")
155 HANDLE_LIBCALL(SIN_F128, "sinl")
156 HANDLE_LIBCALL(SIN_PPCF128, "sinl")
157 HANDLE_LIBCALL(COS_F32, "cosf")
158 HANDLE_LIBCALL(COS_F64, "cos")
159 HANDLE_LIBCALL(COS_F80, "cosl")
160 HANDLE_LIBCALL(COS_F128, "cosl")
161 HANDLE_LIBCALL(COS_PPCF128, "cosl")
162 HANDLE_LIBCALL(SINCOS_F32, nullptr)
163 HANDLE_LIBCALL(SINCOS_F64, nullptr)
164 HANDLE_LIBCALL(SINCOS_F80, nullptr)
165 HANDLE_LIBCALL(SINCOS_F128, nullptr)
166 HANDLE_LIBCALL(SINCOS_PPCF128, nullptr)
167 HANDLE_LIBCALL(POW_F32, "powf")
168 HANDLE_LIBCALL(POW_F64, "pow")
169 HANDLE_LIBCALL(POW_F80, "powl")
170 HANDLE_LIBCALL(POW_F128, "powl")
171 HANDLE_LIBCALL(POW_PPCF128, "powl")
172 HANDLE_LIBCALL(CEIL_F32, "ceilf")
173 HANDLE_LIBCALL(CEIL_F64, "ceil")
174 HANDLE_LIBCALL(CEIL_F80, "ceill")
175 HANDLE_LIBCALL(CEIL_F128, "ceill")
176 HANDLE_LIBCALL(CEIL_PPCF128, "ceill")
177 HANDLE_LIBCALL(TRUNC_F32, "truncf")
178 HANDLE_LIBCALL(TRUNC_F64, "trunc")
179 HANDLE_LIBCALL(TRUNC_F80, "truncl")
180 HANDLE_LIBCALL(TRUNC_F128, "truncl")
181 HANDLE_LIBCALL(TRUNC_PPCF128, "truncl")
182 HANDLE_LIBCALL(RINT_F32, "rintf")
183 HANDLE_LIBCALL(RINT_F64, "rint")
184 HANDLE_LIBCALL(RINT_F80, "rintl")
185 HANDLE_LIBCALL(RINT_F128, "rintl")
186 HANDLE_LIBCALL(RINT_PPCF128, "rintl")
187 HANDLE_LIBCALL(NEARBYINT_F32, "nearbyintf")
188 HANDLE_LIBCALL(NEARBYINT_F64, "nearbyint")
189 HANDLE_LIBCALL(NEARBYINT_F80, "nearbyintl")
190 HANDLE_LIBCALL(NEARBYINT_F128, "nearbyintl")
191 HANDLE_LIBCALL(NEARBYINT_PPCF128, "nearbyintl")
192 HANDLE_LIBCALL(ROUND_F32, "roundf")
193 HANDLE_LIBCALL(ROUND_F64, "round")
194 HANDLE_LIBCALL(ROUND_F80, "roundl")
195 HANDLE_LIBCALL(ROUND_F128, "roundl")
196 HANDLE_LIBCALL(ROUND_PPCF128, "roundl")
197 HANDLE_LIBCALL(FLOOR_F32, "floorf")
198 HANDLE_LIBCALL(FLOOR_F64, "floor")
199 HANDLE_LIBCALL(FLOOR_F80, "floorl")
200 HANDLE_LIBCALL(FLOOR_F128, "floorl")
201 HANDLE_LIBCALL(FLOOR_PPCF128, "floorl")
202 HANDLE_LIBCALL(COPYSIGN_F32, "copysignf")
203 HANDLE_LIBCALL(COPYSIGN_F64, "copysign")
204 HANDLE_LIBCALL(COPYSIGN_F80, "copysignl")
205 HANDLE_LIBCALL(COPYSIGN_F128, "copysignl")
206 HANDLE_LIBCALL(COPYSIGN_PPCF128, "copysignl")
207 HANDLE_LIBCALL(FMIN_F32, "fminf")
208 HANDLE_LIBCALL(FMIN_F64, "fmin")
209 HANDLE_LIBCALL(FMIN_F80, "fminl")
210 HANDLE_LIBCALL(FMIN_F128, "fminl")
211 HANDLE_LIBCALL(FMIN_PPCF128, "fminl")
212 HANDLE_LIBCALL(FMAX_F32, "fmaxf")
213 HANDLE_LIBCALL(FMAX_F64, "fmax")
214 HANDLE_LIBCALL(FMAX_F80, "fmaxl")
215 HANDLE_LIBCALL(FMAX_F128, "fmaxl")
216 HANDLE_LIBCALL(FMAX_PPCF128, "fmaxl")
217
218 // Conversion
219 HANDLE_LIBCALL(FPEXT_F32_PPCF128, "__gcc_stoq")
220 HANDLE_LIBCALL(FPEXT_F64_PPCF128, "__gcc_dtoq")
221 HANDLE_LIBCALL(FPEXT_F64_F128, "__extenddftf2")
222 HANDLE_LIBCALL(FPEXT_F32_F128, "__extendsftf2")
223 HANDLE_LIBCALL(FPEXT_F32_F64, "__extendsfdf2")
224 HANDLE_LIBCALL(FPEXT_F16_F32, "__gnu_h2f_ieee")
225 HANDLE_LIBCALL(FPROUND_F32_F16, "__gnu_f2h_ieee")
226 HANDLE_LIBCALL(FPROUND_F64_F16, "__truncdfhf2")
227 HANDLE_LIBCALL(FPROUND_F80_F16, "__truncxfhf2")
228 HANDLE_LIBCALL(FPROUND_F128_F16, "__trunctfhf2")
229 HANDLE_LIBCALL(FPROUND_PPCF128_F16, "__trunctfhf2")
230 HANDLE_LIBCALL(FPROUND_F64_F32, "__truncdfsf2")
231 HANDLE_LIBCALL(FPROUND_F80_F32, "__truncxfsf2")
232 HANDLE_LIBCALL(FPROUND_F128_F32, "__trunctfsf2")
233 HANDLE_LIBCALL(FPROUND_PPCF128_F32, "__gcc_qtos")
234 HANDLE_LIBCALL(FPROUND_F80_F64, "__truncxfdf2")
235 HANDLE_LIBCALL(FPROUND_F128_F64, "__trunctfdf2")
236 HANDLE_LIBCALL(FPROUND_PPCF128_F64, "__gcc_qtod")
237 HANDLE_LIBCALL(FPTOSINT_F32_I32, "__fixsfsi")
238 HANDLE_LIBCALL(FPTOSINT_F32_I64, "__fixsfdi")
239 HANDLE_LIBCALL(FPTOSINT_F32_I128, "__fixsfti")
240 HANDLE_LIBCALL(FPTOSINT_F64_I32, "__fixdfsi")
241 HANDLE_LIBCALL(FPTOSINT_F64_I64, "__fixdfdi")
242 HANDLE_LIBCALL(FPTOSINT_F64_I128, "__fixdfti")
243 HANDLE_LIBCALL(FPTOSINT_F80_I32, "__fixxfsi")
244 HANDLE_LIBCALL(FPTOSINT_F80_I64, "__fixxfdi")
245 HANDLE_LIBCALL(FPTOSINT_F80_I128, "__fixxfti")
246 HANDLE_LIBCALL(FPTOSINT_F128_I32, "__fixtfsi")
247 HANDLE_LIBCALL(FPTOSINT_F128_I64, "__fixtfdi")
248 HANDLE_LIBCALL(FPTOSINT_F128_I128, "__fixtfti")
249 HANDLE_LIBCALL(FPTOSINT_PPCF128_I32, "__gcc_qtou")
250 HANDLE_LIBCALL(FPTOSINT_PPCF128_I64, "__fixtfdi")
251 HANDLE_LIBCALL(FPTOSINT_PPCF128_I128, "__fixtfti")
252 HANDLE_LIBCALL(FPTOUINT_F32_I32, "__fixunssfsi")
253 HANDLE_LIBCALL(FPTOUINT_F32_I64, "__fixunssfdi")
254 HANDLE_LIBCALL(FPTOUINT_F32_I128, "__fixunssfti")
255 HANDLE_LIBCALL(FPTOUINT_F64_I32, "__fixunsdfsi")
256 HANDLE_LIBCALL(FPTOUINT_F64_I64, "__fixunsdfdi")
257 HANDLE_LIBCALL(FPTOUINT_F64_I128, "__fixunsdfti")
258 HANDLE_LIBCALL(FPTOUINT_F80_I32, "__fixunsxfsi")
259 HANDLE_LIBCALL(FPTOUINT_F80_I64, "__fixunsxfdi")
260 HANDLE_LIBCALL(FPTOUINT_F80_I128, "__fixunsxfti")
261 HANDLE_LIBCALL(FPTOUINT_F128_I32, "__fixunstfsi")
262 HANDLE_LIBCALL(FPTOUINT_F128_I64, "__fixunstfdi")
263 HANDLE_LIBCALL(FPTOUINT_F128_I128, "__fixunstfti")
264 HANDLE_LIBCALL(FPTOUINT_PPCF128_I32, "__fixunstfsi")
265 HANDLE_LIBCALL(FPTOUINT_PPCF128_I64, "__fixunstfdi")
266 HANDLE_LIBCALL(FPTOUINT_PPCF128_I128, "__fixunstfti")
267 HANDLE_LIBCALL(SINTTOFP_I32_F32, "__floatsisf")
268 HANDLE_LIBCALL(SINTTOFP_I32_F64, "__floatsidf")
269 HANDLE_LIBCALL(SINTTOFP_I32_F80, "__floatsixf")
270 HANDLE_LIBCALL(SINTTOFP_I32_F128, "__floatsitf")
271 HANDLE_LIBCALL(SINTTOFP_I32_PPCF128, "__gcc_itoq")
272 HANDLE_LIBCALL(SINTTOFP_I64_F32, "__floatdisf")
273 HANDLE_LIBCALL(SINTTOFP_I64_F64, "__floatdidf")
274 HANDLE_LIBCALL(SINTTOFP_I64_F80, "__floatdixf")
275 HANDLE_LIBCALL(SINTTOFP_I64_F128, "__floatditf")
276 HANDLE_LIBCALL(SINTTOFP_I64_PPCF128, "__floatditf")
277 HANDLE_LIBCALL(SINTTOFP_I128_F32, "__floattisf")
278 HANDLE_LIBCALL(SINTTOFP_I128_F64, "__floattidf")
279 HANDLE_LIBCALL(SINTTOFP_I128_F80, "__floattixf")
280 HANDLE_LIBCALL(SINTTOFP_I128_F128, "__floattitf")
281 HANDLE_LIBCALL(SINTTOFP_I128_PPCF128, "__floattitf")
282 HANDLE_LIBCALL(UINTTOFP_I32_F32, "__floatunsisf")
283 HANDLE_LIBCALL(UINTTOFP_I32_F64, "__floatunsidf")
284 HANDLE_LIBCALL(UINTTOFP_I32_F80, "__floatunsixf")
285 HANDLE_LIBCALL(UINTTOFP_I32_F128, "__floatunsitf")
286 HANDLE_LIBCALL(UINTTOFP_I32_PPCF128, "__gcc_utoq")
287 HANDLE_LIBCALL(UINTTOFP_I64_F32, "__floatundisf")
288 HANDLE_LIBCALL(UINTTOFP_I64_F64, "__floatundidf")
289 HANDLE_LIBCALL(UINTTOFP_I64_F80, "__floatundixf")
290 HANDLE_LIBCALL(UINTTOFP_I64_F128, "__floatunditf")
291 HANDLE_LIBCALL(UINTTOFP_I64_PPCF128, "__floatunditf")
292 HANDLE_LIBCALL(UINTTOFP_I128_F32, "__floatuntisf")
293 HANDLE_LIBCALL(UINTTOFP_I128_F64, "__floatuntidf")
294 HANDLE_LIBCALL(UINTTOFP_I128_F80, "__floatuntixf")
295 HANDLE_LIBCALL(UINTTOFP_I128_F128, "__floatuntitf")
296 HANDLE_LIBCALL(UINTTOFP_I128_PPCF128, "__floatuntitf")
297
298 // Comparison
299 HANDLE_LIBCALL(OEQ_F32, "__eqsf2")
300 HANDLE_LIBCALL(OEQ_F64, "__eqdf2")
301 HANDLE_LIBCALL(OEQ_F128, "__eqtf2")
302 HANDLE_LIBCALL(OEQ_PPCF128, "__gcc_qeq")
303 HANDLE_LIBCALL(UNE_F32, "__nesf2")
304 HANDLE_LIBCALL(UNE_F64, "__nedf2")
305 HANDLE_LIBCALL(UNE_F128, "__netf2")
306 HANDLE_LIBCALL(UNE_PPCF128, "__gcc_qne")
307 HANDLE_LIBCALL(OGE_F32, "__gesf2")
308 HANDLE_LIBCALL(OGE_F64, "__gedf2")
309 HANDLE_LIBCALL(OGE_F128, "__getf2")
310 HANDLE_LIBCALL(OGE_PPCF128, "__gcc_qge")
311 HANDLE_LIBCALL(OLT_F32, "__ltsf2")
312 HANDLE_LIBCALL(OLT_F64, "__ltdf2")
313 HANDLE_LIBCALL(OLT_F128, "__lttf2")
314 HANDLE_LIBCALL(OLT_PPCF128, "__gcc_qlt")
315 HANDLE_LIBCALL(OLE_F32, "__lesf2")
316 HANDLE_LIBCALL(OLE_F64, "__ledf2")
317 HANDLE_LIBCALL(OLE_F128, "__letf2")
318 HANDLE_LIBCALL(OLE_PPCF128, "__gcc_qle")
319 HANDLE_LIBCALL(OGT_F32, "__gtsf2")
320 HANDLE_LIBCALL(OGT_F64, "__gtdf2")
321 HANDLE_LIBCALL(OGT_F128, "__gttf2")
322 HANDLE_LIBCALL(OGT_PPCF128, "__gcc_qgt")
323 HANDLE_LIBCALL(UO_F32, "__unordsf2")
324 HANDLE_LIBCALL(UO_F64, "__unorddf2")
325 HANDLE_LIBCALL(UO_F128, "__unordtf2")
326 HANDLE_LIBCALL(UO_PPCF128, "__gcc_qunord")
327 HANDLE_LIBCALL(O_F32, "__unordsf2")
328 HANDLE_LIBCALL(O_F64, "__unorddf2")
329 HANDLE_LIBCALL(O_F128, "__unordtf2")
330 HANDLE_LIBCALL(O_PPCF128, "__gcc_qunord")
331
332 // Memory
333 HANDLE_LIBCALL(MEMCPY, "memcpy")
334 HANDLE_LIBCALL(MEMMOVE, "memmove")
335 HANDLE_LIBCALL(MEMSET, "memset")
336
337 // Element-wise unordered-atomic memory of different sizes
338 HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memcpy_element_unordered_atomic_1")
339 HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memcpy_element_unordered_atomic_2")
340 HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memcpy_element_unordered_atomic_4")
341 HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memcpy_element_unordered_atomic_8")
342 HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memcpy_element_unordered_atomic_16")
343 HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memmove_element_unordered_atomic_1")
344 HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memmove_element_unordered_atomic_2")
345 HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memmove_element_unordered_atomic_4")
346 HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memmove_element_unordered_atomic_8")
347 HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memmove_element_unordered_atomic_16")
348 HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memset_element_unordered_atomic_1")
349 HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memset_element_unordered_atomic_2")
350 HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memset_element_unordered_atomic_4")
351 HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memset_element_unordered_atomic_8")
352 HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memset_element_unordered_atomic_16")
353
354 // Exception handling
355 HANDLE_LIBCALL(UNWIND_RESUME, "_Unwind_Resume")
356
357 // Note: there are two sets of atomics libcalls; see
358 // for more info on the
359 // difference between them.
360
361 // Atomic '__sync_*' libcalls.
362 HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_1, "__sync_val_compare_and_swap_1")
363 HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_2, "__sync_val_compare_and_swap_2")
364 HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_4, "__sync_val_compare_and_swap_4")
365 HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_8, "__sync_val_compare_and_swap_8")
366 HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_16, "__sync_val_compare_and_swap_16")
367 HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_1, "__sync_lock_test_and_set_1")
368 HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_2, "__sync_lock_test_and_set_2")
369 HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_4, "__sync_lock_test_and_set_4")
370 HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_8, "__sync_lock_test_and_set_8")
371 HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_16, "__sync_lock_test_and_set_16")
372 HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_1, "__sync_fetch_and_add_1")
373 HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_2, "__sync_fetch_and_add_2")
374 HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_4, "__sync_fetch_and_add_4")
375 HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_8, "__sync_fetch_and_add_8")
376 HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_16, "__sync_fetch_and_add_16")
377 HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_1, "__sync_fetch_and_sub_1")
378 HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_2, "__sync_fetch_and_sub_2")
379 HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_4, "__sync_fetch_and_sub_4")
380 HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_8, "__sync_fetch_and_sub_8")
381 HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_16, "__sync_fetch_and_sub_16")
382 HANDLE_LIBCALL(SYNC_FETCH_AND_AND_1, "__sync_fetch_and_and_1")
383 HANDLE_LIBCALL(SYNC_FETCH_AND_AND_2, "__sync_fetch_and_and_2")
384 HANDLE_LIBCALL(SYNC_FETCH_AND_AND_4, "__sync_fetch_and_and_4")
385 HANDLE_LIBCALL(SYNC_FETCH_AND_AND_8, "__sync_fetch_and_and_8")
386 HANDLE_LIBCALL(SYNC_FETCH_AND_AND_16, "__sync_fetch_and_and_16")
387 HANDLE_LIBCALL(SYNC_FETCH_AND_OR_1, "__sync_fetch_and_or_1")
388 HANDLE_LIBCALL(SYNC_FETCH_AND_OR_2, "__sync_fetch_and_or_2")
389 HANDLE_LIBCALL(SYNC_FETCH_AND_OR_4, "__sync_fetch_and_or_4")
390 HANDLE_LIBCALL(SYNC_FETCH_AND_OR_8, "__sync_fetch_and_or_8")
391 HANDLE_LIBCALL(SYNC_FETCH_AND_OR_16, "__sync_fetch_and_or_16")
392 HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_1, "__sync_fetch_and_xor_1")
393 HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_2, "__sync_fetch_and_xor_2")
394 HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_4, "__sync_fetch_and_xor_4")
395 HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_8, "__sync_fetch_and_xor_8")
396 HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_16, "__sync_fetch_and_xor_16")
397 HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_1, "__sync_fetch_and_nand_1")
398 HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_2, "__sync_fetch_and_nand_2")
399 HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_4, "__sync_fetch_and_nand_4")
400 HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_8, "__sync_fetch_and_nand_8")
401 HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_16, "__sync_fetch_and_nand_16")
402 HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_1, "__sync_fetch_and_max_1")
403 HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_2, "__sync_fetch_and_max_2")
404 HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_4, "__sync_fetch_and_max_4")
405 HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_8, "__sync_fetch_and_max_8")
406 HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_16, "__sync_fetch_and_max_16")
407 HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_1, "__sync_fetch_and_umax_1")
408 HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_2, "__sync_fetch_and_umax_2")
409 HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_4, "__sync_fetch_and_umax_4")
410 HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_8, "__sync_fetch_and_umax_8")
411 HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_16, "__sync_fetch_and_umax_16")
412 HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_1, "__sync_fetch_and_min_1")
413 HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_2, "__sync_fetch_and_min_2")
414 HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_4, "__sync_fetch_and_min_4")
415 HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_8, "__sync_fetch_and_min_8")
416 HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_16, "__sync_fetch_and_min_16")
417 HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_1, "__sync_fetch_and_umin_1")
418 HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_2, "__sync_fetch_and_umin_2")
419 HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_4, "__sync_fetch_and_umin_4")
420 HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_8, "__sync_fetch_and_umin_8")
421 HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_16, "__sync_fetch_and_umin_16")
422
423 // Atomic `__atomic_*' libcalls.
424 HANDLE_LIBCALL(ATOMIC_LOAD, "__atomic_load")
425 HANDLE_LIBCALL(ATOMIC_LOAD_1, "__atomic_load_1")
426 HANDLE_LIBCALL(ATOMIC_LOAD_2, "__atomic_load_2")
427 HANDLE_LIBCALL(ATOMIC_LOAD_4, "__atomic_load_4")
428 HANDLE_LIBCALL(ATOMIC_LOAD_8, "__atomic_load_8")
429 HANDLE_LIBCALL(ATOMIC_LOAD_16, "__atomic_load_16")
430
431 HANDLE_LIBCALL(ATOMIC_STORE, "__atomic_store")
432 HANDLE_LIBCALL(ATOMIC_STORE_1, "__atomic_store_1")
433 HANDLE_LIBCALL(ATOMIC_STORE_2, "__atomic_store_2")
434 HANDLE_LIBCALL(ATOMIC_STORE_4, "__atomic_store_4")
435 HANDLE_LIBCALL(ATOMIC_STORE_8, "__atomic_store_8")
436 HANDLE_LIBCALL(ATOMIC_STORE_16, "__atomic_store_16")
437
438 HANDLE_LIBCALL(ATOMIC_EXCHANGE, "__atomic_exchange")
439 HANDLE_LIBCALL(ATOMIC_EXCHANGE_1, "__atomic_exchange_1")
440 HANDLE_LIBCALL(ATOMIC_EXCHANGE_2, "__atomic_exchange_2")
441 HANDLE_LIBCALL(ATOMIC_EXCHANGE_4, "__atomic_exchange_4")
442 HANDLE_LIBCALL(ATOMIC_EXCHANGE_8, "__atomic_exchange_8")
443 HANDLE_LIBCALL(ATOMIC_EXCHANGE_16, "__atomic_exchange_16")
444
445 HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE, "__atomic_compare_exchange")
446 HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_1, "__atomic_compare_exchange_1")
447 HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_2, "__atomic_compare_exchange_2")
448 HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_4, "__atomic_compare_exchange_4")
449 HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_8, "__atomic_compare_exchange_8")
450 HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_16, "__atomic_compare_exchange_16")
451
452 HANDLE_LIBCALL(ATOMIC_FETCH_ADD_1, "__atomic_fetch_add_1")
453 HANDLE_LIBCALL(ATOMIC_FETCH_ADD_2, "__atomic_fetch_add_2")
454 HANDLE_LIBCALL(ATOMIC_FETCH_ADD_4, "__atomic_fetch_add_4")
455 HANDLE_LIBCALL(ATOMIC_FETCH_ADD_8, "__atomic_fetch_add_8")
456 HANDLE_LIBCALL(ATOMIC_FETCH_ADD_16, "__atomic_fetch_add_16")
457 HANDLE_LIBCALL(ATOMIC_FETCH_SUB_1, "__atomic_fetch_sub_1")
458 HANDLE_LIBCALL(ATOMIC_FETCH_SUB_2, "__atomic_fetch_sub_2")
459 HANDLE_LIBCALL(ATOMIC_FETCH_SUB_4, "__atomic_fetch_sub_4")
460 HANDLE_LIBCALL(ATOMIC_FETCH_SUB_8, "__atomic_fetch_sub_8")
461 HANDLE_LIBCALL(ATOMIC_FETCH_SUB_16, "__atomic_fetch_sub_16")
462 HANDLE_LIBCALL(ATOMIC_FETCH_AND_1, "__atomic_fetch_and_1")
463 HANDLE_LIBCALL(ATOMIC_FETCH_AND_2, "__atomic_fetch_and_2")
464 HANDLE_LIBCALL(ATOMIC_FETCH_AND_4, "__atomic_fetch_and_4")
465 HANDLE_LIBCALL(ATOMIC_FETCH_AND_8, "__atomic_fetch_and_8")
466 HANDLE_LIBCALL(ATOMIC_FETCH_AND_16, "__atomic_fetch_and_16")
467 HANDLE_LIBCALL(ATOMIC_FETCH_OR_1, "__atomic_fetch_or_1")
468 HANDLE_LIBCALL(ATOMIC_FETCH_OR_2, "__atomic_fetch_or_2")
469 HANDLE_LIBCALL(ATOMIC_FETCH_OR_4, "__atomic_fetch_or_4")
470 HANDLE_LIBCALL(ATOMIC_FETCH_OR_8, "__atomic_fetch_or_8")
471 HANDLE_LIBCALL(ATOMIC_FETCH_OR_16, "__atomic_fetch_or_16")
472 HANDLE_LIBCALL(ATOMIC_FETCH_XOR_1, "__atomic_fetch_xor_1")
473 HANDLE_LIBCALL(ATOMIC_FETCH_XOR_2, "__atomic_fetch_xor_2")
474 HANDLE_LIBCALL(ATOMIC_FETCH_XOR_4, "__atomic_fetch_xor_4")
475 HANDLE_LIBCALL(ATOMIC_FETCH_XOR_8, "__atomic_fetch_xor_8")
476 HANDLE_LIBCALL(ATOMIC_FETCH_XOR_16, "__atomic_fetch_xor_16")
477 HANDLE_LIBCALL(ATOMIC_FETCH_NAND_1, "__atomic_fetch_nand_1")
478 HANDLE_LIBCALL(ATOMIC_FETCH_NAND_2, "__atomic_fetch_nand_2")
479 HANDLE_LIBCALL(ATOMIC_FETCH_NAND_4, "__atomic_fetch_nand_4")
480 HANDLE_LIBCALL(ATOMIC_FETCH_NAND_8, "__atomic_fetch_nand_8")
481 HANDLE_LIBCALL(ATOMIC_FETCH_NAND_16, "__atomic_fetch_nand_16")
482
483 // Stack Protector Fail
484 HANDLE_LIBCALL(STACKPROTECTOR_CHECK_FAIL, "__stack_chk_fail")
485
486 // Deoptimization
487 HANDLE_LIBCALL(DEOPTIMIZE, "__llvm_deoptimize")
488
489 HANDLE_LIBCALL(UNKNOWN_LIBCALL, nullptr)
490
491 #undef HANDLE_LIBCALL
2727 /// PPCISelLowering.cpp.
2828 ///
2929 enum Libcall {
30 // Integer
31 SHL_I16,
32 SHL_I32,
33 SHL_I64,
34 SHL_I128,
35 SRL_I16,
36 SRL_I32,
37 SRL_I64,
38 SRL_I128,
39 SRA_I16,
40 SRA_I32,
41 SRA_I64,
42 SRA_I128,
43 MUL_I8,
44 MUL_I16,
45 MUL_I32,
46 MUL_I64,
47 MUL_I128,
48 MULO_I32,
49 MULO_I64,
50 MULO_I128,
51 SDIV_I8,
52 SDIV_I16,
53 SDIV_I32,
54 SDIV_I64,
55 SDIV_I128,
56 UDIV_I8,
57 UDIV_I16,
58 UDIV_I32,
59 UDIV_I64,
60 UDIV_I128,
61 SREM_I8,
62 SREM_I16,
63 SREM_I32,
64 SREM_I64,
65 SREM_I128,
66 UREM_I8,
67 UREM_I16,
68 UREM_I32,
69 UREM_I64,
70 UREM_I128,
71 SDIVREM_I8,
72 SDIVREM_I16,
73 SDIVREM_I32,
74 SDIVREM_I64,
75 SDIVREM_I128,
76 UDIVREM_I8,
77 UDIVREM_I16,
78 UDIVREM_I32,
79 UDIVREM_I64,
80 UDIVREM_I128,
81 NEG_I32,
82 NEG_I64,
83
84 // FLOATING POINT
85 ADD_F32,
86 ADD_F64,
87 ADD_F80,
88 ADD_F128,
89 ADD_PPCF128,
90 SUB_F32,
91 SUB_F64,
92 SUB_F80,
93 SUB_F128,
94 SUB_PPCF128,
95 MUL_F32,
96 MUL_F64,
97 MUL_F80,
98 MUL_F128,
99 MUL_PPCF128,
100 DIV_F32,
101 DIV_F64,
102 DIV_F80,
103 DIV_F128,
104 DIV_PPCF128,
105 REM_F32,
106 REM_F64,
107 REM_F80,
108 REM_F128,
109 REM_PPCF128,
110 FMA_F32,
111 FMA_F64,
112 FMA_F80,
113 FMA_F128,
114 FMA_PPCF128,
115 POWI_F32,
116 POWI_F64,
117 POWI_F80,
118 POWI_F128,
119 POWI_PPCF128,
120 SQRT_F32,
121 SQRT_F64,
122 SQRT_F80,
123 SQRT_F128,
124 SQRT_PPCF128,
125 LOG_F32,
126 LOG_F64,
127 LOG_F80,
128 LOG_F128,
129 LOG_PPCF128,
130 LOG2_F32,
131 LOG2_F64,
132 LOG2_F80,
133 LOG2_F128,
134 LOG2_PPCF128,
135 LOG10_F32,
136 LOG10_F64,
137 LOG10_F80,
138 LOG10_F128,
139 LOG10_PPCF128,
140 EXP_F32,
141 EXP_F64,
142 EXP_F80,
143 EXP_F128,
144 EXP_PPCF128,
145 EXP2_F32,
146 EXP2_F64,
147 EXP2_F80,
148 EXP2_F128,
149 EXP2_PPCF128,
150 SIN_F32,
151 SIN_F64,
152 SIN_F80,
153 SIN_F128,
154 SIN_PPCF128,
155 COS_F32,
156 COS_F64,
157 COS_F80,
158 COS_F128,
159 COS_PPCF128,
160 SINCOS_F32,
161 SINCOS_F64,
162 SINCOS_F80,
163 SINCOS_F128,
164 SINCOS_PPCF128,
165 POW_F32,
166 POW_F64,
167 POW_F80,
168 POW_F128,
169 POW_PPCF128,
170 CEIL_F32,
171 CEIL_F64,
172 CEIL_F80,
173 CEIL_F128,
174 CEIL_PPCF128,
175 TRUNC_F32,
176 TRUNC_F64,
177 TRUNC_F80,
178 TRUNC_F128,
179 TRUNC_PPCF128,
180 RINT_F32,
181 RINT_F64,
182 RINT_F80,
183 RINT_F128,
184 RINT_PPCF128,
185 NEARBYINT_F32,
186 NEARBYINT_F64,
187 NEARBYINT_F80,
188 NEARBYINT_F128,
189 NEARBYINT_PPCF128,
190 ROUND_F32,
191 ROUND_F64,
192 ROUND_F80,
193 ROUND_F128,
194 ROUND_PPCF128,
195 FLOOR_F32,
196 FLOOR_F64,
197 FLOOR_F80,
198 FLOOR_F128,
199 FLOOR_PPCF128,
200 COPYSIGN_F32,
201 COPYSIGN_F64,
202 COPYSIGN_F80,
203 COPYSIGN_F128,
204 COPYSIGN_PPCF128,
205 FMIN_F32,
206 FMIN_F64,
207 FMIN_F80,
208 FMIN_F128,
209 FMIN_PPCF128,
210 FMAX_F32,
211 FMAX_F64,
212 FMAX_F80,
213 FMAX_F128,
214 FMAX_PPCF128,
215
216 // CONVERSION
217 FPEXT_F32_PPCF128,
218 FPEXT_F64_PPCF128,
219 FPEXT_F64_F128,
220 FPEXT_F32_F128,
221 FPEXT_F32_F64,
222 FPEXT_F16_F32,
223 FPROUND_F32_F16,
224 FPROUND_F64_F16,
225 FPROUND_F80_F16,
226 FPROUND_F128_F16,
227 FPROUND_PPCF128_F16,
228 FPROUND_F64_F32,
229 FPROUND_F80_F32,
230 FPROUND_F128_F32,
231 FPROUND_PPCF128_F32,
232 FPROUND_F80_F64,
233 FPROUND_F128_F64,
234 FPROUND_PPCF128_F64,
235 FPTOSINT_F32_I32,
236 FPTOSINT_F32_I64,
237 FPTOSINT_F32_I128,
238 FPTOSINT_F64_I32,
239 FPTOSINT_F64_I64,
240 FPTOSINT_F64_I128,
241 FPTOSINT_F80_I32,
242 FPTOSINT_F80_I64,
243 FPTOSINT_F80_I128,
244 FPTOSINT_F128_I32,
245 FPTOSINT_F128_I64,
246 FPTOSINT_F128_I128,
247 FPTOSINT_PPCF128_I32,
248 FPTOSINT_PPCF128_I64,
249 FPTOSINT_PPCF128_I128,
250 FPTOUINT_F32_I32,
251 FPTOUINT_F32_I64,
252 FPTOUINT_F32_I128,
253 FPTOUINT_F64_I32,
254 FPTOUINT_F64_I64,
255 FPTOUINT_F64_I128,
256 FPTOUINT_F80_I32,
257 FPTOUINT_F80_I64,
258 FPTOUINT_F80_I128,
259 FPTOUINT_F128_I32,
260 FPTOUINT_F128_I64,
261 FPTOUINT_F128_I128,
262 FPTOUINT_PPCF128_I32,
263 FPTOUINT_PPCF128_I64,
264 FPTOUINT_PPCF128_I128,
265 SINTTOFP_I32_F32,
266 SINTTOFP_I32_F64,
267 SINTTOFP_I32_F80,
268 SINTTOFP_I32_F128,
269 SINTTOFP_I32_PPCF128,
270 SINTTOFP_I64_F32,
271 SINTTOFP_I64_F64,
272 SINTTOFP_I64_F80,
273 SINTTOFP_I64_F128,
274 SINTTOFP_I64_PPCF128,
275 SINTTOFP_I128_F32,
276 SINTTOFP_I128_F64,
277 SINTTOFP_I128_F80,
278 SINTTOFP_I128_F128,
279 SINTTOFP_I128_PPCF128,
280 UINTTOFP_I32_F32,
281 UINTTOFP_I32_F64,
282 UINTTOFP_I32_F80,
283 UINTTOFP_I32_F128,
284 UINTTOFP_I32_PPCF128,
285 UINTTOFP_I64_F32,
286 UINTTOFP_I64_F64,
287 UINTTOFP_I64_F80,
288 UINTTOFP_I64_F128,
289 UINTTOFP_I64_PPCF128,
290 UINTTOFP_I128_F32,
291 UINTTOFP_I128_F64,
292 UINTTOFP_I128_F80,
293 UINTTOFP_I128_F128,
294 UINTTOFP_I128_PPCF128,
295
296 // COMPARISON
297 OEQ_F32,
298 OEQ_F64,
299 OEQ_F128,
300 OEQ_PPCF128,
301 UNE_F32,
302 UNE_F64,
303 UNE_F128,
304 UNE_PPCF128,
305 OGE_F32,
306 OGE_F64,
307 OGE_F128,
308 OGE_PPCF128,
309 OLT_F32,
310 OLT_F64,
311 OLT_F128,
312 OLT_PPCF128,
313 OLE_F32,
314 OLE_F64,
315 OLE_F128,
316 OLE_PPCF128,
317 OGT_F32,
318 OGT_F64,
319 OGT_F128,
320 OGT_PPCF128,
321 UO_F32,
322 UO_F64,
323 UO_F128,
324 UO_PPCF128,
325 O_F32,
326 O_F64,
327 O_F128,
328 O_PPCF128,
329
330 // MEMORY
331 MEMCPY,
332 MEMSET,
333 MEMMOVE,
334
335 // ELEMENT-WISE UNORDERED-ATOMIC MEMORY of different element sizes
336 MEMCPY_ELEMENT_UNORDERED_ATOMIC_1,
337 MEMCPY_ELEMENT_UNORDERED_ATOMIC_2,
338 MEMCPY_ELEMENT_UNORDERED_ATOMIC_4,
339 MEMCPY_ELEMENT_UNORDERED_ATOMIC_8,
340 MEMCPY_ELEMENT_UNORDERED_ATOMIC_16,
341
342 MEMMOVE_ELEMENT_UNORDERED_ATOMIC_1,
343 MEMMOVE_ELEMENT_UNORDERED_ATOMIC_2,
344 MEMMOVE_ELEMENT_UNORDERED_ATOMIC_4,
345 MEMMOVE_ELEMENT_UNORDERED_ATOMIC_8,
346 MEMMOVE_ELEMENT_UNORDERED_ATOMIC_16,
347
348 MEMSET_ELEMENT_UNORDERED_ATOMIC_1,
349 MEMSET_ELEMENT_UNORDERED_ATOMIC_2,
350 MEMSET_ELEMENT_UNORDERED_ATOMIC_4,
351 MEMSET_ELEMENT_UNORDERED_ATOMIC_8,
352 MEMSET_ELEMENT_UNORDERED_ATOMIC_16,
353
354 // EXCEPTION HANDLING
355 UNWIND_RESUME,
356
357 // Note: there's two sets of atomics libcalls; see
358 // for more info on the
359 // difference between them.
360
361 // Atomic '__sync_*' libcalls.
362 SYNC_VAL_COMPARE_AND_SWAP_1,
363 SYNC_VAL_COMPARE_AND_SWAP_2,
364 SYNC_VAL_COMPARE_AND_SWAP_4,
365 SYNC_VAL_COMPARE_AND_SWAP_8,
366 SYNC_VAL_COMPARE_AND_SWAP_16,
367 SYNC_LOCK_TEST_AND_SET_1,
368 SYNC_LOCK_TEST_AND_SET_2,
369 SYNC_LOCK_TEST_AND_SET_4,
370 SYNC_LOCK_TEST_AND_SET_8,
371 SYNC_LOCK_TEST_AND_SET_16,
372 SYNC_FETCH_AND_ADD_1,
373 SYNC_FETCH_AND_ADD_2,
374 SYNC_FETCH_AND_ADD_4,
375 SYNC_FETCH_AND_ADD_8,
376 SYNC_FETCH_AND_ADD_16,
377 SYNC_FETCH_AND_SUB_1,
378 SYNC_FETCH_AND_SUB_2,
379 SYNC_FETCH_AND_SUB_4,
380 SYNC_FETCH_AND_SUB_8,
381 SYNC_FETCH_AND_SUB_16,
382 SYNC_FETCH_AND_AND_1,
383 SYNC_FETCH_AND_AND_2,
384 SYNC_FETCH_AND_AND_4,
385 SYNC_FETCH_AND_AND_8,
386 SYNC_FETCH_AND_AND_16,
387 SYNC_FETCH_AND_OR_1,
388 SYNC_FETCH_AND_OR_2,
389 SYNC_FETCH_AND_OR_4,
390 SYNC_FETCH_AND_OR_8,
391 SYNC_FETCH_AND_OR_16,
392 SYNC_FETCH_AND_XOR_1,
393 SYNC_FETCH_AND_XOR_2,
394 SYNC_FETCH_AND_XOR_4,
395 SYNC_FETCH_AND_XOR_8,
396 SYNC_FETCH_AND_XOR_16,
397 SYNC_FETCH_AND_NAND_1,
398 SYNC_FETCH_AND_NAND_2,
399 SYNC_FETCH_AND_NAND_4,
400 SYNC_FETCH_AND_NAND_8,
401 SYNC_FETCH_AND_NAND_16,
402 SYNC_FETCH_AND_MAX_1,
403 SYNC_FETCH_AND_MAX_2,
404 SYNC_FETCH_AND_MAX_4,
405 SYNC_FETCH_AND_MAX_8,
406 SYNC_FETCH_AND_MAX_16,
407 SYNC_FETCH_AND_UMAX_1,
408 SYNC_FETCH_AND_UMAX_2,
409 SYNC_FETCH_AND_UMAX_4,
410 SYNC_FETCH_AND_UMAX_8,
411 SYNC_FETCH_AND_UMAX_16,
412 SYNC_FETCH_AND_MIN_1,
413 SYNC_FETCH_AND_MIN_2,
414 SYNC_FETCH_AND_MIN_4,
415 SYNC_FETCH_AND_MIN_8,
416 SYNC_FETCH_AND_MIN_16,
417 SYNC_FETCH_AND_UMIN_1,
418 SYNC_FETCH_AND_UMIN_2,
419 SYNC_FETCH_AND_UMIN_4,
420 SYNC_FETCH_AND_UMIN_8,
421 SYNC_FETCH_AND_UMIN_16,
422
423 // Atomic '__atomic_*' libcalls.
424 ATOMIC_LOAD,
425 ATOMIC_LOAD_1,
426 ATOMIC_LOAD_2,
427 ATOMIC_LOAD_4,
428 ATOMIC_LOAD_8,
429 ATOMIC_LOAD_16,
430
431 ATOMIC_STORE,
432 ATOMIC_STORE_1,
433 ATOMIC_STORE_2,
434 ATOMIC_STORE_4,
435 ATOMIC_STORE_8,
436 ATOMIC_STORE_16,
437
438 ATOMIC_EXCHANGE,
439 ATOMIC_EXCHANGE_1,
440 ATOMIC_EXCHANGE_2,
441 ATOMIC_EXCHANGE_4,
442 ATOMIC_EXCHANGE_8,
443 ATOMIC_EXCHANGE_16,
444
445 ATOMIC_COMPARE_EXCHANGE,
446 ATOMIC_COMPARE_EXCHANGE_1,
447 ATOMIC_COMPARE_EXCHANGE_2,
448 ATOMIC_COMPARE_EXCHANGE_4,
449 ATOMIC_COMPARE_EXCHANGE_8,
450 ATOMIC_COMPARE_EXCHANGE_16,
451
452 ATOMIC_FETCH_ADD_1,
453 ATOMIC_FETCH_ADD_2,
454 ATOMIC_FETCH_ADD_4,
455 ATOMIC_FETCH_ADD_8,
456 ATOMIC_FETCH_ADD_16,
457
458 ATOMIC_FETCH_SUB_1,
459 ATOMIC_FETCH_SUB_2,
460 ATOMIC_FETCH_SUB_4,
461 ATOMIC_FETCH_SUB_8,
462 ATOMIC_FETCH_SUB_16,
463
464 ATOMIC_FETCH_AND_1,
465 ATOMIC_FETCH_AND_2,
466 ATOMIC_FETCH_AND_4,
467 ATOMIC_FETCH_AND_8,
468 ATOMIC_FETCH_AND_16,
469
470 ATOMIC_FETCH_OR_1,
471 ATOMIC_FETCH_OR_2,
472 ATOMIC_FETCH_OR_4,
473 ATOMIC_FETCH_OR_8,
474 ATOMIC_FETCH_OR_16,
475
476 ATOMIC_FETCH_XOR_1,
477 ATOMIC_FETCH_XOR_2,
478 ATOMIC_FETCH_XOR_4,
479 ATOMIC_FETCH_XOR_8,
480 ATOMIC_FETCH_XOR_16,
481
482 ATOMIC_FETCH_NAND_1,
483 ATOMIC_FETCH_NAND_2,
484 ATOMIC_FETCH_NAND_4,
485 ATOMIC_FETCH_NAND_8,
486 ATOMIC_FETCH_NAND_16,
487
488 // Stack Protector Fail.
489 STACKPROTECTOR_CHECK_FAIL,
490
491 // Deoptimization.
492 DEOPTIMIZE,
493
494 UNKNOWN_LIBCALL
30 #define HANDLE_LIBCALL(code, name) code,
31 #include "RuntimeLibcalls.def"
32 #undef HANDLE_LIBCALL
49533 };
49634
49735 /// getFPEXT - Return the FPEXT_*_* value for the given types, or
7979 /// InitLibcallNames - Set default libcall names.
8080 ///
8181 static void InitLibcallNames(const char **Names, const Triple &TT) {
82 Names[RTLIB::SHL_I16] = "__ashlhi3";
83 Names[RTLIB::SHL_I32] = "__ashlsi3";
84 Names[RTLIB::SHL_I64] = "__ashldi3";
85 Names[RTLIB::SHL_I128] = "__ashlti3";
86 Names[RTLIB::SRL_I16] = "__lshrhi3";
87 Names[RTLIB::SRL_I32] = "__lshrsi3";
88 Names[RTLIB::SRL_I64] = "__lshrdi3";
89 Names[RTLIB::SRL_I128] = "__lshrti3";
90 Names[RTLIB::SRA_I16] = "__ashrhi3";
91 Names[RTLIB::SRA_I32] = "__ashrsi3";
92 Names[RTLIB::SRA_I64] = "__ashrdi3";
93 Names[RTLIB::SRA_I128] = "__ashrti3";
94 Names[RTLIB::MUL_I8] = "__mulqi3";
95 Names[RTLIB::MUL_I16] = "__mulhi3";
96 Names[RTLIB::MUL_I32] = "__mulsi3";
97 Names[RTLIB::MUL_I64] = "__muldi3";
98 Names[RTLIB::MUL_I128] = "__multi3";
99 Names[RTLIB::MULO_I32] = "__mulosi4";
100 Names[RTLIB::MULO_I64] = "__mulodi4";
101 Names[RTLIB::MULO_I128] = "__muloti4";
102 Names[RTLIB::SDIV_I8] = "__divqi3";
103 Names[RTLIB::SDIV_I16] = "__divhi3";
104 Names[RTLIB::SDIV_I32] = "__divsi3";
105 Names[RTLIB::SDIV_I64] = "__divdi3";
106 Names[RTLIB::SDIV_I128] = "__divti3";
107 Names[RTLIB::UDIV_I8] = "__udivqi3";
108 Names[RTLIB::UDIV_I16] = "__udivhi3";
109 Names[RTLIB::UDIV_I32] = "__udivsi3";
110 Names[RTLIB::UDIV_I64] = "__udivdi3";
111 Names[RTLIB::UDIV_I128] = "__udivti3";
112 Names[RTLIB::SREM_I8] = "__modqi3";
113 Names[RTLIB::SREM_I16] = "__modhi3";
114 Names[RTLIB::SREM_I32] = "__modsi3";
115 Names[RTLIB::SREM_I64] = "__moddi3";
116 Names[RTLIB::SREM_I128] = "__modti3";
117 Names[RTLIB::UREM_I8] = "__umodqi3";
118 Names[RTLIB::UREM_I16] = "__umodhi3";
119 Names[RTLIB::UREM_I32] = "__umodsi3";
120 Names[RTLIB::UREM_I64] = "__umoddi3";
121 Names[RTLIB::UREM_I128] = "__umodti3";
122
123 Names[RTLIB::NEG_I32] = "__negsi2";
124 Names[RTLIB::NEG_I64] = "__negdi2";
125 Names[RTLIB::ADD_F32] = "__addsf3";
126 Names[RTLIB::ADD_F64] = "__adddf3";
127 Names[RTLIB::ADD_F80] = "__addxf3";
128 Names[RTLIB::ADD_F128] = "__addtf3";
129 Names[RTLIB::ADD_PPCF128] = "__gcc_qadd";
130 Names[RTLIB::SUB_F32] = "__subsf3";
131 Names[RTLIB::SUB_F64] = "__subdf3";
132 Names[RTLIB::SUB_F80] = "__subxf3";
133 Names[RTLIB::SUB_F128] = "__subtf3";
134 Names[RTLIB::SUB_PPCF128] = "__gcc_qsub";
135 Names[RTLIB::MUL_F32] = "__mulsf3";
136 Names[RTLIB::MUL_F64] = "__muldf3";
137 Names[RTLIB::MUL_F80] = "__mulxf3";
138 Names[RTLIB::MUL_F128] = "__multf3";
139 Names[RTLIB::MUL_PPCF128] = "__gcc_qmul";
140 Names[RTLIB::DIV_F32] = "__divsf3";
141 Names[RTLIB::DIV_F64] = "__divdf3";
142 Names[RTLIB::DIV_F80] = "__divxf3";
143 Names[RTLIB::DIV_F128] = "__divtf3";
144 Names[RTLIB::DIV_PPCF128] = "__gcc_qdiv";
145 Names[RTLIB::REM_F32] = "fmodf";
146 Names[RTLIB::REM_F64] = "fmod";
147 Names[RTLIB::REM_F80] = "fmodl";
148 Names[RTLIB::REM_F128] = "fmodl";
149 Names[RTLIB::REM_PPCF128] = "fmodl";
150 Names[RTLIB::FMA_F32] = "fmaf";
151 Names[RTLIB::FMA_F64] = "fma";
152 Names[RTLIB::FMA_F80] = "fmal";
153 Names[RTLIB::FMA_F128] = "fmal";
154 Names[RTLIB::FMA_PPCF128] = "fmal";
155 Names[RTLIB::POWI_F32] = "__powisf2";
156 Names[RTLIB::POWI_F64] = "__powidf2";
157 Names[RTLIB::POWI_F80] = "__powixf2";
158 Names[RTLIB::POWI_F128] = "__powitf2";
159 Names[RTLIB::POWI_PPCF128] = "__powitf2";
160 Names[RTLIB::SQRT_F32] = "sqrtf";
161 Names[RTLIB::SQRT_F64] = "sqrt";
162 Names[RTLIB::SQRT_F80] = "sqrtl";
163 Names[RTLIB::SQRT_F128] = "sqrtl";
164 Names[RTLIB::SQRT_PPCF128] = "sqrtl";
165 Names[RTLIB::LOG_F32] = "logf";
166 Names[RTLIB::LOG_F64] = "log";
167 Names[RTLIB::LOG_F80] = "logl";
168 Names[RTLIB::LOG_F128] = "logl";
169 Names[RTLIB::LOG_PPCF128] = "logl";
170 Names[RTLIB::LOG2_F32] = "log2f";
171 Names[RTLIB::LOG2_F64] = "log2";
172 Names[RTLIB::LOG2_F80] = "log2l";
173 Names[RTLIB::LOG2_F128] = "log2l";
174 Names[RTLIB::LOG2_PPCF128] = "log2l";
175 Names[RTLIB::LOG10_F32] = "log10f";
176 Names[RTLIB::LOG10_F64] = "log10";
177 Names[RTLIB::LOG10_F80] = "log10l";
178 Names[RTLIB::LOG10_F128] = "log10l";
179 Names[RTLIB::LOG10_PPCF128] = "log10l";
180 Names[RTLIB::EXP_F32] = "expf";
181 Names[RTLIB::EXP_F64] = "exp";
182 Names[RTLIB::EXP_F80] = "expl";
183 Names[RTLIB::EXP_F128] = "expl";
184 Names[RTLIB::EXP_PPCF128] = "expl";
185 Names[RTLIB::EXP2_F32] = "exp2f";
186 Names[RTLIB::EXP2_F64] = "exp2";
187 Names[RTLIB::EXP2_F80] = "exp2l";
188 Names[RTLIB::EXP2_F128] = "exp2l";
189 Names[RTLIB::EXP2_PPCF128] = "exp2l";
190 Names[RTLIB::SIN_F32] = "sinf";
191 Names[RTLIB::SIN_F64] = "sin";
192 Names[RTLIB::SIN_F80] = "sinl";
193 Names[RTLIB::SIN_F128] = "sinl";
194 Names[RTLIB::SIN_PPCF128] = "sinl";
195 Names[RTLIB::COS_F32] = "cosf";
196 Names[RTLIB::COS_F64] = "cos";
197 Names[RTLIB::COS_F80] = "cosl";
198 Names[RTLIB::COS_F128] = "cosl";
199 Names[RTLIB::COS_PPCF128] = "cosl";
200 Names[RTLIB::POW_F32] = "powf";
201 Names[RTLIB::POW_F64] = "pow";
202 Names[RTLIB::POW_F80] = "powl";
203 Names[RTLIB::POW_F128] = "powl";
204 Names[RTLIB::POW_PPCF128] = "powl";
205 Names[RTLIB::CEIL_F32] = "ceilf";
206 Names[RTLIB::CEIL_F64] = "ceil";
207 Names[RTLIB::CEIL_F80] = "ceill";
208 Names[RTLIB::CEIL_F128] = "ceill";
209 Names[RTLIB::CEIL_PPCF128] = "ceill";
210 Names[RTLIB::TRUNC_F32] = "truncf";
211 Names[RTLIB::TRUNC_F64] = "trunc";
212 Names[RTLIB::TRUNC_F80] = "truncl";
213 Names[RTLIB::TRUNC_F128] = "truncl";
214 Names[RTLIB::TRUNC_PPCF128] = "truncl";
215 Names[RTLIB::RINT_F32] = "rintf";
216 Names[RTLIB::RINT_F64] = "rint";
217 Names[RTLIB::RINT_F80] = "rintl";
218 Names[RTLIB::RINT_F128] = "rintl";
219 Names[RTLIB::RINT_PPCF128] = "rintl";
220 Names[RTLIB::NEARBYINT_F32] = "nearbyintf";
221 Names[RTLIB::NEARBYINT_F64] = "nearbyint";
222 Names[RTLIB::NEARBYINT_F80] = "nearbyintl";
223 Names[RTLIB::NEARBYINT_F128] = "nearbyintl";
224 Names[RTLIB::NEARBYINT_PPCF128] = "nearbyintl";
225 Names[RTLIB::ROUND_F32] = "roundf";
226 Names[RTLIB::ROUND_F64] = "round";
227 Names[RTLIB::ROUND_F80] = "roundl";
228 Names[RTLIB::ROUND_F128] = "roundl";
229 Names[RTLIB::ROUND_PPCF128] = "roundl";
230 Names[RTLIB::FLOOR_F32] = "floorf";
231 Names[RTLIB::FLOOR_F64] = "floor";
232 Names[RTLIB::FLOOR_F80] = "floorl";
233 Names[RTLIB::FLOOR_F128] = "floorl";
234 Names[RTLIB::FLOOR_PPCF128] = "floorl";
235 Names[RTLIB::FMIN_F32] = "fminf";
236 Names[RTLIB::FMIN_F64] = "fmin";
237 Names[RTLIB::FMIN_F80] = "fminl";
238 Names[RTLIB::FMIN_F128] = "fminl";
239 Names[RTLIB::FMIN_PPCF128] = "fminl";
240 Names[RTLIB::FMAX_F32] = "fmaxf";
241 Names[RTLIB::FMAX_F64] = "fmax";
242 Names[RTLIB::FMAX_F80] = "fmaxl";
243 Names[RTLIB::FMAX_F128] = "fmaxl";
244 Names[RTLIB::FMAX_PPCF128] = "fmaxl";
245 Names[RTLIB::ROUND_F32] = "roundf";
246 Names[RTLIB::ROUND_F64] = "round";
247 Names[RTLIB::ROUND_F80] = "roundl";
248 Names[RTLIB::ROUND_F128] = "roundl";
249 Names[RTLIB::ROUND_PPCF128] = "roundl";
250 Names[RTLIB::COPYSIGN_F32] = "copysignf";
251 Names[RTLIB::COPYSIGN_F64] = "copysign";
252 Names[RTLIB::COPYSIGN_F80] = "copysignl";
253 Names[RTLIB::COPYSIGN_F128] = "copysignl";
254 Names[RTLIB::COPYSIGN_PPCF128] = "copysignl";
255 Names[RTLIB::FPEXT_F32_PPCF128] = "__gcc_stoq";
256 Names[RTLIB::FPEXT_F64_PPCF128] = "__gcc_dtoq";
257 Names[RTLIB::FPEXT_F64_F128] = "__extenddftf2";
258 Names[RTLIB::FPEXT_F32_F128] = "__extendsftf2";
259 Names[RTLIB::FPEXT_F32_F64] = "__extendsfdf2";
82 #define HANDLE_LIBCALL(code, name) \
83 Names[RTLIB::code] = name;
84 #include "llvm/CodeGen/RuntimeLibcalls.def"
85 #undef HANDLE_LIBCALL
86
87 // A few names are different on particular architectures or environments.
26088 if (TT.isOSDarwin()) {
26189 // For f16/f32 conversions, Darwin uses the standard naming scheme, instead
26290 // of the gnueabi-style __gnu_*_ieee.
26795 Names[RTLIB::FPEXT_F16_F32] = "__gnu_h2f_ieee";
26896 Names[RTLIB::FPROUND_F32_F16] = "__gnu_f2h_ieee";
26997 }
270 Names[RTLIB::FPROUND_F64_F16] = "__truncdfhf2";
271 Names[RTLIB::FPROUND_F80_F16] = "__truncxfhf2";
272 Names[RTLIB::FPROUND_F128_F16] = "__trunctfhf2";
273 Names[RTLIB::FPROUND_PPCF128_F16] = "__trunctfhf2";
274 Names[RTLIB::FPROUND_F64_F32] = "__truncdfsf2";
275 Names[RTLIB::FPROUND_F80_F32] = "__truncxfsf2";
276 Names[RTLIB::FPROUND_F128_F32] = "__trunctfsf2";
277 Names[RTLIB::FPROUND_PPCF128_F32] = "__gcc_qtos";
278 Names[RTLIB::FPROUND_F80_F64] = "__truncxfdf2";
279 Names[RTLIB::FPROUND_F128_F64] = "__trunctfdf2";
280 Names[RTLIB::FPROUND_PPCF128_F64] = "__gcc_qtod";
281 Names[RTLIB::FPTOSINT_F32_I32] = "__fixsfsi";
282 Names[RTLIB::FPTOSINT_F32_I64] = "__fixsfdi";
283 Names[RTLIB::FPTOSINT_F32_I128] = "__fixsfti";
284 Names[RTLIB::FPTOSINT_F64_I32] = "__fixdfsi";
285 Names[RTLIB::FPTOSINT_F64_I64] = "__fixdfdi";
286 Names[RTLIB::FPTOSINT_F64_I128] = "__fixdfti";
287 Names[RTLIB::FPTOSINT_F80_I32] = "__fixxfsi";
288 Names[RTLIB::FPTOSINT_F80_I64] = "__fixxfdi";
289 Names[RTLIB::FPTOSINT_F80_I128] = "__fixxfti";
290 Names[RTLIB::FPTOSINT_F128_I32] = "__fixtfsi";
291 Names[RTLIB::FPTOSINT_F128_I64] = "__fixtfdi";
292 Names[RTLIB::FPTOSINT_F128_I128] = "__fixtfti";
293 Names[RTLIB::FPTOSINT_PPCF128_I32] = "__gcc_qtou";
294 Names[RTLIB::FPTOSINT_PPCF128_I64] = "__fixtfdi";
295 Names[RTLIB::FPTOSINT_PPCF128_I128] = "__fixtfti";
296 Names[RTLIB::FPTOUINT_F32_I32] = "__fixunssfsi";
297 Names[RTLIB::FPTOUINT_F32_I64] = "__fixunssfdi";
298 Names[RTLIB::FPTOUINT_F32_I128] = "__fixunssfti";
299 Names[RTLIB::FPTOUINT_F64_I32] = "__fixunsdfsi";
300 Names[RTLIB::FPTOUINT_F64_I64] = "__fixunsdfdi";
301 Names[RTLIB::FPTOUINT_F64_I128] = "__fixunsdfti";
302 Names[RTLIB::FPTOUINT_F80_I32] = "__fixunsxfsi";
303 Names[RTLIB::FPTOUINT_F80_I64] = "__fixunsxfdi";
304 Names[RTLIB::FPTOUINT_F80_I128] = "__fixunsxfti";
305 Names[RTLIB::FPTOUINT_F128_I32] = "__fixunstfsi";
306 Names[RTLIB::FPTOUINT_F128_I64] = "__fixunstfdi";
307 Names[RTLIB::FPTOUINT_F128_I128] = "__fixunstfti";
308 Names[RTLIB::FPTOUINT_PPCF128_I32] = "__fixunstfsi";
309 Names[RTLIB::FPTOUINT_PPCF128_I64] = "__fixunstfdi";
310 Names[RTLIB::FPTOUINT_PPCF128_I128] = "__fixunstfti";
311 Names[RTLIB::SINTTOFP_I32_F32] = "__floatsisf";
312 Names[RTLIB::SINTTOFP_I32_F64] = "__floatsidf";
313 Names[RTLIB::SINTTOFP_I32_F80] = "__floatsixf";
314 Names[RTLIB::SINTTOFP_I32_F128] = "__floatsitf";
315 Names[RTLIB::SINTTOFP_I32_PPCF128] = "__gcc_itoq";
316 Names[RTLIB::SINTTOFP_I64_F32] = "__floatdisf";
317 Names[RTLIB::SINTTOFP_I64_F64] = "__floatdidf";
318 Names[RTLIB::SINTTOFP_I64_F80] = "__floatdixf";
319 Names[RTLIB::SINTTOFP_I64_F128] = "__floatditf";
320 Names[RTLIB::SINTTOFP_I64_PPCF128] = "__floatditf";
321 Names[RTLIB::SINTTOFP_I128_F32] = "__floattisf";
322 Names[RTLIB::SINTTOFP_I128_F64] = "__floattidf";
323 Names[RTLIB::SINTTOFP_I128_F80] = "__floattixf";
324 Names[RTLIB::SINTTOFP_I128_F128] = "__floattitf";
325 Names[RTLIB::SINTTOFP_I128_PPCF128] = "__floattitf";
326 Names[RTLIB::UINTTOFP_I32_F32] = "__floatunsisf";
327 Names[RTLIB::UINTTOFP_I32_F64] = "__floatunsidf";
328 Names[RTLIB::UINTTOFP_I32_F80] = "__floatunsixf";
329 Names[RTLIB::UINTTOFP_I32_F128] = "__floatunsitf";
330 Names[RTLIB::UINTTOFP_I32_PPCF128] = "__gcc_utoq";
331 Names[RTLIB::UINTTOFP_I64_F32] = "__floatundisf";
332 Names[RTLIB::UINTTOFP_I64_F64] = "__floatundidf";
333 Names[RTLIB::UINTTOFP_I64_F80] = "__floatundixf";
334 Names[RTLIB::UINTTOFP_I64_F128] = "__floatunditf";
335 Names[RTLIB::UINTTOFP_I64_PPCF128] = "__floatunditf";
336 Names[RTLIB::UINTTOFP_I128_F32] = "__floatuntisf";
337 Names[RTLIB::UINTTOFP_I128_F64] = "__floatuntidf";
338 Names[RTLIB::UINTTOFP_I128_F80] = "__floatuntixf";
339 Names[RTLIB::UINTTOFP_I128_F128] = "__floatuntitf";
340 Names[RTLIB::UINTTOFP_I128_PPCF128] = "__floatuntitf";
341 Names[RTLIB::OEQ_F32] = "__eqsf2";
342 Names[RTLIB::OEQ_F64] = "__eqdf2";
343 Names[RTLIB::OEQ_F128] = "__eqtf2";
344 Names[RTLIB::OEQ_PPCF128] = "__gcc_qeq";
345 Names[RTLIB::UNE_F32] = "__nesf2";
346 Names[RTLIB::UNE_F64] = "__nedf2";
347 Names[RTLIB::UNE_F128] = "__netf2";
348 Names[RTLIB::UNE_PPCF128] = "__gcc_qne";
349 Names[RTLIB::OGE_F32] = "__gesf2";
350 Names[RTLIB::OGE_F64] = "__gedf2";
351 Names[RTLIB::OGE_F128] = "__getf2";
352 Names[RTLIB::OGE_PPCF128] = "__gcc_qge";
353 Names[RTLIB::OLT_F32] = "__ltsf2";
354 Names[RTLIB::OLT_F64] = "__ltdf2";
355 Names[RTLIB::OLT_F128] = "__lttf2";
356 Names[RTLIB::OLT_PPCF128] = "__gcc_qlt";
357 Names[RTLIB::OLE_F32] = "__lesf2";
358 Names[RTLIB::OLE_F64] = "__ledf2";
359 Names[RTLIB::OLE_F128] = "__letf2";
360 Names[RTLIB::OLE_PPCF128] = "__gcc_qle";
361 Names[RTLIB::OGT_F32] = "__gtsf2";
362 Names[RTLIB::OGT_F64] = "__gtdf2";
363 Names[RTLIB::OGT_F128] = "__gttf2";
364 Names[RTLIB::OGT_PPCF128] = "__gcc_qgt";
365 Names[RTLIB::UO_F32] = "__unordsf2";
366 Names[RTLIB::UO_F64] = "__unorddf2";
367 Names[RTLIB::UO_F128] = "__unordtf2";
368 Names[RTLIB::UO_PPCF128] = "__gcc_qunord";
369 Names[RTLIB::O_F32] = "__unordsf2";
370 Names[RTLIB::O_F64] = "__unorddf2";
371 Names[RTLIB::O_F128] = "__unordtf2";
372 Names[RTLIB::O_PPCF128] = "__gcc_qunord";
373 Names[RTLIB::MEMCPY] = "memcpy";
374 Names[RTLIB::MEMMOVE] = "memmove";
375 Names[RTLIB::MEMSET] = "memset";
376 Names[RTLIB::MEMCPY_ELEMENT_UNORDERED_ATOMIC_1] =
377 "__llvm_memcpy_element_unordered_atomic_1";
378 Names[RTLIB::MEMCPY_ELEMENT_UNORDERED_ATOMIC_2] =
379 "__llvm_memcpy_element_unordered_atomic_2";
380 Names[RTLIB::MEMCPY_ELEMENT_UNORDERED_ATOMIC_4] =
381 "__llvm_memcpy_element_unordered_atomic_4";
382 Names[RTLIB::MEMCPY_ELEMENT_UNORDERED_ATOMIC_8] =
383 "__llvm_memcpy_element_unordered_atomic_8";
384 Names[RTLIB::MEMCPY_ELEMENT_UNORDERED_ATOMIC_16] =
385 "__llvm_memcpy_element_unordered_atomic_16";
386 Names[RTLIB::MEMMOVE_ELEMENT_UNORDERED_ATOMIC_1] =
387 "__llvm_memmove_element_unordered_atomic_1";
388 Names[RTLIB::MEMMOVE_ELEMENT_UNORDERED_ATOMIC_2] =
389 "__llvm_memmove_element_unordered_atomic_2";
390 Names[RTLIB::MEMMOVE_ELEMENT_UNORDERED_ATOMIC_4] =
391 "__llvm_memmove_element_unordered_atomic_4";
392 Names[RTLIB::MEMMOVE_ELEMENT_UNORDERED_ATOMIC_8] =
393 "__llvm_memmove_element_unordered_atomic_8";
394 Names[RTLIB::MEMMOVE_ELEMENT_UNORDERED_ATOMIC_16] =
395 "__llvm_memmove_element_unordered_atomic_16";
396 Names[RTLIB::MEMSET_ELEMENT_UNORDERED_ATOMIC_1] =
397 "__llvm_memset_element_unordered_atomic_1";
398 Names[RTLIB::MEMSET_ELEMENT_UNORDERED_ATOMIC_2] =
399 "__llvm_memset_element_unordered_atomic_2";
400 Names[RTLIB::MEMSET_ELEMENT_UNORDERED_ATOMIC_4] =
401 "__llvm_memset_element_unordered_atomic_4";
402 Names[RTLIB::MEMSET_ELEMENT_UNORDERED_ATOMIC_8] =
403 "__llvm_memset_element_unordered_atomic_8";
404 Names[RTLIB::MEMSET_ELEMENT_UNORDERED_ATOMIC_16] =
405 "__llvm_memset_element_unordered_atomic_16";
406 Names[RTLIB::UNWIND_RESUME] = "_Unwind_Resume";
407 Names[RTLIB::SYNC_VAL_COMPARE_AND_SWAP_1] = "__sync_val_compare_and_swap_1";
408 Names[RTLIB::SYNC_VAL_COMPARE_AND_SWAP_2] = "__sync_val_compare_and_swap_2";
409 Names[RTLIB::SYNC_VAL_COMPARE_AND_SWAP_4] = "__sync_val_compare_and_swap_4";
410 Names[RTLIB::SYNC_VAL_COMPARE_AND_SWAP_8] = "__sync_val_compare_and_swap_8";
411 Names[RTLIB::SYNC_VAL_COMPARE_AND_SWAP_16] = "__sync_val_compare_and_swap_16";
412 Names[RTLIB::SYNC_LOCK_TEST_AND_SET_1] = "__sync_lock_test_and_set_1";
413 Names[RTLIB::SYNC_LOCK_TEST_AND_SET_2] = "__sync_lock_test_and_set_2";
414 Names[RTLIB::SYNC_LOCK_TEST_AND_SET_4] = "__sync_lock_test_and_set_4";
415 Names[RTLIB::SYNC_LOCK_TEST_AND_SET_8] = "__sync_lock_test_and_set_8";
416 Names[RTLIB::SYNC_LOCK_TEST_AND_SET_16] = "__sync_lock_test_and_set_16";
417 Names[RTLIB::SYNC_FETCH_AND_ADD_1] = "__sync_fetch_and_add_1";
418 Names[RTLIB::SYNC_FETCH_AND_ADD_2] = "__sync_fetch_and_add_2";
419 Names[RTLIB::SYNC_FETCH_AND_ADD_4] = "__sync_fetch_and_add_4";
420 Names[RTLIB::SYNC_FETCH_AND_ADD_8] = "__sync_fetch_and_add_8";
421 Names[RTLIB::SYNC_FETCH_AND_ADD_16] = "__sync_fetch_and_add_16";
422 Names[RTLIB::SYNC_FETCH_AND_SUB_1] = "__sync_fetch_and_sub_1";
423 Names[RTLIB::SYNC_FETCH_AND_SUB_2] = "__sync_fetch_and_sub_2";
424 Names[RTLIB::SYNC_FETCH_AND_SUB_4] = "__sync_fetch_and_sub_4";
425 Names[RTLIB::SYNC_FETCH_AND_SUB_8] = "__sync_fetch_and_sub_8";
426 Names[RTLIB::SYNC_FETCH_AND_SUB_16] = "__sync_fetch_and_sub_16";
427 Names[RTLIB::SYNC_FETCH_AND_AND_1] = "__sync_fetch_and_and_1";
428 Names[RTLIB::SYNC_FETCH_AND_AND_2] = "__sync_fetch_and_and_2";
429 Names[RTLIB::SYNC_FETCH_AND_AND_4] = "__sync_fetch_and_and_4";
430 Names[RTLIB::SYNC_FETCH_AND_AND_8] = "__sync_fetch_and_and_8";
431 Names[RTLIB::SYNC_FETCH_AND_AND_16] = "__sync_fetch_and_and_16";
432 Names[RTLIB::SYNC_FETCH_AND_OR_1] = "__sync_fetch_and_or_1";
433 Names[RTLIB::SYNC_FETCH_AND_OR_2] = "__sync_fetch_and_or_2";
434 Names[RTLIB::SYNC_FETCH_AND_OR_4] = "__sync_fetch_and_or_4";
435 Names[RTLIB::SYNC_FETCH_AND_OR_8] = "__sync_fetch_and_or_8";
436 Names[RTLIB::SYNC_FETCH_AND_OR_16] = "__sync_fetch_and_or_16";
437 Names[RTLIB::SYNC_FETCH_AND_XOR_1] = "__sync_fetch_and_xor_1";
438 Names[RTLIB::SYNC_FETCH_AND_XOR_2] = "__sync_fetch_and_xor_2";
439 Names[RTLIB::SYNC_FETCH_AND_XOR_4] = "__sync_fetch_and_xor_4";
440 Names[RTLIB::SYNC_FETCH_AND_XOR_8] = "__sync_fetch_and_xor_8";
441 Names[RTLIB::SYNC_FETCH_AND_XOR_16] = "__sync_fetch_and_xor_16";
442 Names[RTLIB::SYNC_FETCH_AND_NAND_1] = "__sync_fetch_and_nand_1";
443 Names[RTLIB::SYNC_FETCH_AND_NAND_2] = "__sync_fetch_and_nand_2";
444 Names[RTLIB::SYNC_FETCH_AND_NAND_4] = "__sync_fetch_and_nand_4";
445 Names[RTLIB::SYNC_FETCH_AND_NAND_8] = "__sync_fetch_and_nand_8";
446 Names[RTLIB::SYNC_FETCH_AND_NAND_16] = "__sync_fetch_and_nand_16";
447 Names[RTLIB::SYNC_FETCH_AND_MAX_1] = "__sync_fetch_and_max_1";
448 Names[RTLIB::SYNC_FETCH_AND_MAX_2] = "__sync_fetch_and_max_2";
449 Names[RTLIB::SYNC_FETCH_AND_MAX_4] = "__sync_fetch_and_max_4";
450 Names[RTLIB::SYNC_FETCH_AND_MAX_8] = "__sync_fetch_and_max_8";
451 Names[RTLIB::SYNC_FETCH_AND_MAX_16] = "__sync_fetch_and_max_16";
452 Names[RTLIB::SYNC_FETCH_AND_UMAX_1] = "__sync_fetch_and_umax_1";
453 Names[RTLIB::SYNC_FETCH_AND_UMAX_2] = "__sync_fetch_and_umax_2";
454 Names[RTLIB::SYNC_FETCH_AND_UMAX_4] = "__sync_fetch_and_umax_4";
455 Names[RTLIB::SYNC_FETCH_AND_UMAX_8] = "__sync_fetch_and_umax_8";
456 Names[RTLIB::SYNC_FETCH_AND_UMAX_16] = "__sync_fetch_and_umax_16";
457 Names[RTLIB::SYNC_FETCH_AND_MIN_1] = "__sync_fetch_and_min_1";
458 Names[RTLIB::SYNC_FETCH_AND_MIN_2] = "__sync_fetch_and_min_2";
459 Names[RTLIB::SYNC_FETCH_AND_MIN_4] = "__sync_fetch_and_min_4";
460 Names[RTLIB::SYNC_FETCH_AND_MIN_8] = "__sync_fetch_and_min_8";
461 Names[RTLIB::SYNC_FETCH_AND_MIN_16] = "__sync_fetch_and_min_16";
462 Names[RTLIB::SYNC_FETCH_AND_UMIN_1] = "__sync_fetch_and_umin_1";
463 Names[RTLIB::SYNC_FETCH_AND_UMIN_2] = "__sync_fetch_and_umin_2";
464 Names[RTLIB::SYNC_FETCH_AND_UMIN_4] = "__sync_fetch_and_umin_4";
465 Names[RTLIB::SYNC_FETCH_AND_UMIN_8] = "__sync_fetch_and_umin_8";
466 Names[RTLIB::SYNC_FETCH_AND_UMIN_16] = "__sync_fetch_and_umin_16";
467
468 Names[RTLIB::ATOMIC_LOAD] = "__atomic_load";
469 Names[RTLIB::ATOMIC_LOAD_1] = "__atomic_load_1";
470 Names[RTLIB::ATOMIC_LOAD_2] = "__atomic_load_2";
471 Names[RTLIB::ATOMIC_LOAD_4] = "__atomic_load_4";
472 Names[RTLIB::ATOMIC_LOAD_8] = "__atomic_load_8";
473 Names[RTLIB::ATOMIC_LOAD_16] = "__atomic_load_16";
474
475 Names[RTLIB::ATOMIC_STORE] = "__atomic_store";
476 Names[RTLIB::ATOMIC_STORE_1] = "__atomic_store_1";
477 Names[RTLIB::ATOMIC_STORE_2] = "__atomic_store_2";
478 Names[RTLIB::ATOMIC_STORE_4] = "__atomic_store_4";
479 Names[RTLIB::ATOMIC_STORE_8] = "__atomic_store_8";
480 Names[RTLIB::ATOMIC_STORE_16] = "__atomic_store_16";
481
482 Names[RTLIB::ATOMIC_EXCHANGE] = "__atomic_exchange";
483 Names[RTLIB::ATOMIC_EXCHANGE_1] = "__atomic_exchange_1";
484 Names[RTLIB::ATOMIC_EXCHANGE_2] = "__atomic_exchange_2";
485 Names[RTLIB::ATOMIC_EXCHANGE_4] = "__atomic_exchange_4";
486 Names[RTLIB::ATOMIC_EXCHANGE_8] = "__atomic_exchange_8";
487 Names[RTLIB::ATOMIC_EXCHANGE_16] = "__atomic_exchange_16";
488
489 Names[RTLIB::ATOMIC_COMPARE_EXCHANGE] = "__atomic_compare_exchange";
490 Names[RTLIB::ATOMIC_COMPARE_EXCHANGE_1] = "__atomic_compare_exchange_1";
491 Names[RTLIB::ATOMIC_COMPARE_EXCHANGE_2] = "__atomic_compare_exchange_2";
492 Names[RTLIB::ATOMIC_COMPARE_EXCHANGE_4] = "__atomic_compare_exchange_4";
493 Names[RTLIB::ATOMIC_COMPARE_EXCHANGE_8] = "__atomic_compare_exchange_8";
494 Names[RTLIB::ATOMIC_COMPARE_EXCHANGE_16] = "__atomic_compare_exchange_16";
495
496 Names[RTLIB::ATOMIC_FETCH_ADD_1] = "__atomic_fetch_add_1";
497 Names[RTLIB::ATOMIC_FETCH_ADD_2] = "__atomic_fetch_add_2";
498 Names[RTLIB::ATOMIC_FETCH_ADD_4] = "__atomic_fetch_add_4";
499 Names[RTLIB::ATOMIC_FETCH_ADD_8] = "__atomic_fetch_add_8";
500 Names[RTLIB::ATOMIC_FETCH_ADD_16] = "__atomic_fetch_add_16";
501 Names[RTLIB::ATOMIC_FETCH_SUB_1] = "__atomic_fetch_sub_1";
502 Names[RTLIB::ATOMIC_FETCH_SUB_2] = "__atomic_fetch_sub_2";
503 Names[RTLIB::ATOMIC_FETCH_SUB_4] = "__atomic_fetch_sub_4";
504 Names[RTLIB::ATOMIC_FETCH_SUB_8] = "__atomic_fetch_sub_8";
505 Names[RTLIB::ATOMIC_FETCH_SUB_16] = "__atomic_fetch_sub_16";
506 Names[RTLIB::ATOMIC_FETCH_AND_1] = "__atomic_fetch_and_1";
507 Names[RTLIB::ATOMIC_FETCH_AND_2] = "__atomic_fetch_and_2";
508 Names[RTLIB::ATOMIC_FETCH_AND_4] = "__atomic_fetch_and_4";
509 Names[RTLIB::ATOMIC_FETCH_AND_8] = "__atomic_fetch_and_8";
510 Names[RTLIB::ATOMIC_FETCH_AND_16] = "__atomic_fetch_and_16";
511 Names[RTLIB::ATOMIC_FETCH_OR_1] = "__atomic_fetch_or_1";
512 Names[RTLIB::ATOMIC_FETCH_OR_2] = "__atomic_fetch_or_2";
513 Names[RTLIB::ATOMIC_FETCH_OR_4] = "__atomic_fetch_or_4";
514 Names[RTLIB::ATOMIC_FETCH_OR_8] = "__atomic_fetch_or_8";
515 Names[RTLIB::ATOMIC_FETCH_OR_16] = "__atomic_fetch_or_16";
516 Names[RTLIB::ATOMIC_FETCH_XOR_1] = "__atomic_fetch_xor_1";
517 Names[RTLIB::ATOMIC_FETCH_XOR_2] = "__atomic_fetch_xor_2";
518 Names[RTLIB::ATOMIC_FETCH_XOR_4] = "__atomic_fetch_xor_4";
519 Names[RTLIB::ATOMIC_FETCH_XOR_8] = "__atomic_fetch_xor_8";
520 Names[RTLIB::ATOMIC_FETCH_XOR_16] = "__atomic_fetch_xor_16";
521 Names[RTLIB::ATOMIC_FETCH_NAND_1] = "__atomic_fetch_nand_1";
522 Names[RTLIB::ATOMIC_FETCH_NAND_2] = "__atomic_fetch_nand_2";
523 Names[RTLIB::ATOMIC_FETCH_NAND_4] = "__atomic_fetch_nand_4";
524 Names[RTLIB::ATOMIC_FETCH_NAND_8] = "__atomic_fetch_nand_8";
525 Names[RTLIB::ATOMIC_FETCH_NAND_16] = "__atomic_fetch_nand_16";
52698
52799 if (TT.isGNUEnvironment()) {
528100 Names[RTLIB::SINCOS_F32] = "sincosf";
532104 Names[RTLIB::SINCOS_PPCF128] = "sincosl";
533105 }
534106
535 if (!TT.isOSOpenBSD()) {
536 Names[RTLIB::STACKPROTECTOR_CHECK_FAIL] = "__stack_chk_fail";
537 }
538
539 Names[RTLIB::DEOPTIMIZE] = "__llvm_deoptimize";
107 if (TT.isOSOpenBSD()) {
108 Names[RTLIB::STACKPROTECTOR_CHECK_FAIL] = nullptr;
109 }
540110 }
541111
542112 /// Set default libcall CallingConvs.