[Alignment][NFC] Support compile time constants
[llvm-core.git] / include / llvm / IR / RuntimeLibcalls.def
blobf6c74d497b188688207ae47386b0b904f1e63c90
1 //===-- llvm/RuntimeLibcalls.def - File that describes libcalls -*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
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".
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.
17 //===----------------------------------------------------------------------===//
19 // NOTE: NO INCLUDE GUARD DESIRED!
21 // Provide definitions of macros so that users of this file do not have to
22 // define everything to use it...
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
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 HANDLE_LIBCALL(CTLZ_I32, "__clzsi2")
86 HANDLE_LIBCALL(CTLZ_I64, "__clzdi2")
87 HANDLE_LIBCALL(CTLZ_I128, "__clzti2")
89 // Floating-point
90 HANDLE_LIBCALL(ADD_F32, "__addsf3")
91 HANDLE_LIBCALL(ADD_F64, "__adddf3")
92 HANDLE_LIBCALL(ADD_F80, "__addxf3")
93 HANDLE_LIBCALL(ADD_F128, "__addtf3")
94 HANDLE_LIBCALL(ADD_PPCF128, "__gcc_qadd")
95 HANDLE_LIBCALL(SUB_F32, "__subsf3")
96 HANDLE_LIBCALL(SUB_F64, "__subdf3")
97 HANDLE_LIBCALL(SUB_F80, "__subxf3")
98 HANDLE_LIBCALL(SUB_F128, "__subtf3")
99 HANDLE_LIBCALL(SUB_PPCF128, "__gcc_qsub")
100 HANDLE_LIBCALL(MUL_F32, "__mulsf3")
101 HANDLE_LIBCALL(MUL_F64, "__muldf3")
102 HANDLE_LIBCALL(MUL_F80, "__mulxf3")
103 HANDLE_LIBCALL(MUL_F128, "__multf3")
104 HANDLE_LIBCALL(MUL_PPCF128, "__gcc_qmul")
105 HANDLE_LIBCALL(DIV_F32, "__divsf3")
106 HANDLE_LIBCALL(DIV_F64, "__divdf3")
107 HANDLE_LIBCALL(DIV_F80, "__divxf3")
108 HANDLE_LIBCALL(DIV_F128, "__divtf3")
109 HANDLE_LIBCALL(DIV_PPCF128, "__gcc_qdiv")
110 HANDLE_LIBCALL(REM_F32, "fmodf")
111 HANDLE_LIBCALL(REM_F64, "fmod")
112 HANDLE_LIBCALL(REM_F80, "fmodl")
113 HANDLE_LIBCALL(REM_F128, "fmodl")
114 HANDLE_LIBCALL(REM_PPCF128, "fmodl")
115 HANDLE_LIBCALL(FMA_F32, "fmaf")
116 HANDLE_LIBCALL(FMA_F64, "fma")
117 HANDLE_LIBCALL(FMA_F80, "fmal")
118 HANDLE_LIBCALL(FMA_F128, "fmal")
119 HANDLE_LIBCALL(FMA_PPCF128, "fmal")
120 HANDLE_LIBCALL(POWI_F32, "__powisf2")
121 HANDLE_LIBCALL(POWI_F64, "__powidf2")
122 HANDLE_LIBCALL(POWI_F80, "__powixf2")
123 HANDLE_LIBCALL(POWI_F128, "__powitf2")
124 HANDLE_LIBCALL(POWI_PPCF128, "__powitf2")
125 HANDLE_LIBCALL(SQRT_F32, "sqrtf")
126 HANDLE_LIBCALL(SQRT_F64, "sqrt")
127 HANDLE_LIBCALL(SQRT_F80, "sqrtl")
128 HANDLE_LIBCALL(SQRT_F128, "sqrtl")
129 HANDLE_LIBCALL(SQRT_PPCF128, "sqrtl")
130 HANDLE_LIBCALL(CBRT_F32, "cbrtf")
131 HANDLE_LIBCALL(CBRT_F64, "cbrt")
132 HANDLE_LIBCALL(CBRT_F80, "cbrtl")
133 HANDLE_LIBCALL(CBRT_F128, "cbrtl")
134 HANDLE_LIBCALL(CBRT_PPCF128, "cbrtl")
135 HANDLE_LIBCALL(LOG_F32, "logf")
136 HANDLE_LIBCALL(LOG_F64, "log")
137 HANDLE_LIBCALL(LOG_F80, "logl")
138 HANDLE_LIBCALL(LOG_F128, "logl")
139 HANDLE_LIBCALL(LOG_PPCF128, "logl")
140 HANDLE_LIBCALL(LOG_FINITE_F32, "__logf_finite")
141 HANDLE_LIBCALL(LOG_FINITE_F64, "__log_finite")
142 HANDLE_LIBCALL(LOG_FINITE_F80, "__logl_finite")
143 HANDLE_LIBCALL(LOG_FINITE_F128, "__logl_finite")
144 HANDLE_LIBCALL(LOG_FINITE_PPCF128, "__logl_finite")
145 HANDLE_LIBCALL(LOG2_F32, "log2f")
146 HANDLE_LIBCALL(LOG2_F64, "log2")
147 HANDLE_LIBCALL(LOG2_F80, "log2l")
148 HANDLE_LIBCALL(LOG2_F128, "log2l")
149 HANDLE_LIBCALL(LOG2_PPCF128, "log2l")
150 HANDLE_LIBCALL(LOG2_FINITE_F32, "__log2f_finite")
151 HANDLE_LIBCALL(LOG2_FINITE_F64, "__log2_finite")
152 HANDLE_LIBCALL(LOG2_FINITE_F80, "__log2l_finite")
153 HANDLE_LIBCALL(LOG2_FINITE_F128, "__log2l_finite")
154 HANDLE_LIBCALL(LOG2_FINITE_PPCF128, "__log2l_finite")
155 HANDLE_LIBCALL(LOG10_F32, "log10f")
156 HANDLE_LIBCALL(LOG10_F64, "log10")
157 HANDLE_LIBCALL(LOG10_F80, "log10l")
158 HANDLE_LIBCALL(LOG10_F128, "log10l")
159 HANDLE_LIBCALL(LOG10_PPCF128, "log10l")
160 HANDLE_LIBCALL(LOG10_FINITE_F32, "__log10f_finite")
161 HANDLE_LIBCALL(LOG10_FINITE_F64, "__log10_finite")
162 HANDLE_LIBCALL(LOG10_FINITE_F80, "__log10l_finite")
163 HANDLE_LIBCALL(LOG10_FINITE_F128, "__log10l_finite")
164 HANDLE_LIBCALL(LOG10_FINITE_PPCF128, "__log10l_finite")
165 HANDLE_LIBCALL(EXP_F32, "expf")
166 HANDLE_LIBCALL(EXP_F64, "exp")
167 HANDLE_LIBCALL(EXP_F80, "expl")
168 HANDLE_LIBCALL(EXP_F128, "expl")
169 HANDLE_LIBCALL(EXP_PPCF128, "expl")
170 HANDLE_LIBCALL(EXP_FINITE_F32, "__expf_finite")
171 HANDLE_LIBCALL(EXP_FINITE_F64, "__exp_finite")
172 HANDLE_LIBCALL(EXP_FINITE_F80, "__expl_finite")
173 HANDLE_LIBCALL(EXP_FINITE_F128, "__expl_finite")
174 HANDLE_LIBCALL(EXP_FINITE_PPCF128, "__expl_finite")
175 HANDLE_LIBCALL(EXP2_F32, "exp2f")
176 HANDLE_LIBCALL(EXP2_F64, "exp2")
177 HANDLE_LIBCALL(EXP2_F80, "exp2l")
178 HANDLE_LIBCALL(EXP2_F128, "exp2l")
179 HANDLE_LIBCALL(EXP2_PPCF128, "exp2l")
180 HANDLE_LIBCALL(EXP2_FINITE_F32, "__exp2f_finite")
181 HANDLE_LIBCALL(EXP2_FINITE_F64, "__exp2_finite")
182 HANDLE_LIBCALL(EXP2_FINITE_F80, "__exp2l_finite")
183 HANDLE_LIBCALL(EXP2_FINITE_F128, "__exp2l_finite")
184 HANDLE_LIBCALL(EXP2_FINITE_PPCF128, "__exp2l_finite")
185 HANDLE_LIBCALL(SIN_F32, "sinf")
186 HANDLE_LIBCALL(SIN_F64, "sin")
187 HANDLE_LIBCALL(SIN_F80, "sinl")
188 HANDLE_LIBCALL(SIN_F128, "sinl")
189 HANDLE_LIBCALL(SIN_PPCF128, "sinl")
190 HANDLE_LIBCALL(COS_F32, "cosf")
191 HANDLE_LIBCALL(COS_F64, "cos")
192 HANDLE_LIBCALL(COS_F80, "cosl")
193 HANDLE_LIBCALL(COS_F128, "cosl")
194 HANDLE_LIBCALL(COS_PPCF128, "cosl")
195 HANDLE_LIBCALL(SINCOS_F32, nullptr)
196 HANDLE_LIBCALL(SINCOS_F64, nullptr)
197 HANDLE_LIBCALL(SINCOS_F80, nullptr)
198 HANDLE_LIBCALL(SINCOS_F128, nullptr)
199 HANDLE_LIBCALL(SINCOS_PPCF128, nullptr)
200 HANDLE_LIBCALL(SINCOS_STRET_F32, nullptr)
201 HANDLE_LIBCALL(SINCOS_STRET_F64, nullptr)
202 HANDLE_LIBCALL(POW_F32, "powf")
203 HANDLE_LIBCALL(POW_F64, "pow")
204 HANDLE_LIBCALL(POW_F80, "powl")
205 HANDLE_LIBCALL(POW_F128, "powl")
206 HANDLE_LIBCALL(POW_PPCF128, "powl")
207 HANDLE_LIBCALL(POW_FINITE_F32, "__powf_finite")
208 HANDLE_LIBCALL(POW_FINITE_F64, "__pow_finite")
209 HANDLE_LIBCALL(POW_FINITE_F80, "__powl_finite")
210 HANDLE_LIBCALL(POW_FINITE_F128, "__powl_finite")
211 HANDLE_LIBCALL(POW_FINITE_PPCF128, "__powl_finite")
212 HANDLE_LIBCALL(CEIL_F32, "ceilf")
213 HANDLE_LIBCALL(CEIL_F64, "ceil")
214 HANDLE_LIBCALL(CEIL_F80, "ceill")
215 HANDLE_LIBCALL(CEIL_F128, "ceill")
216 HANDLE_LIBCALL(CEIL_PPCF128, "ceill")
217 HANDLE_LIBCALL(TRUNC_F32, "truncf")
218 HANDLE_LIBCALL(TRUNC_F64, "trunc")
219 HANDLE_LIBCALL(TRUNC_F80, "truncl")
220 HANDLE_LIBCALL(TRUNC_F128, "truncl")
221 HANDLE_LIBCALL(TRUNC_PPCF128, "truncl")
222 HANDLE_LIBCALL(RINT_F32, "rintf")
223 HANDLE_LIBCALL(RINT_F64, "rint")
224 HANDLE_LIBCALL(RINT_F80, "rintl")
225 HANDLE_LIBCALL(RINT_F128, "rintl")
226 HANDLE_LIBCALL(RINT_PPCF128, "rintl")
227 HANDLE_LIBCALL(NEARBYINT_F32, "nearbyintf")
228 HANDLE_LIBCALL(NEARBYINT_F64, "nearbyint")
229 HANDLE_LIBCALL(NEARBYINT_F80, "nearbyintl")
230 HANDLE_LIBCALL(NEARBYINT_F128, "nearbyintl")
231 HANDLE_LIBCALL(NEARBYINT_PPCF128, "nearbyintl")
232 HANDLE_LIBCALL(ROUND_F32, "roundf")
233 HANDLE_LIBCALL(ROUND_F64, "round")
234 HANDLE_LIBCALL(ROUND_F80, "roundl")
235 HANDLE_LIBCALL(ROUND_F128, "roundl")
236 HANDLE_LIBCALL(ROUND_PPCF128, "roundl")
237 HANDLE_LIBCALL(FLOOR_F32, "floorf")
238 HANDLE_LIBCALL(FLOOR_F64, "floor")
239 HANDLE_LIBCALL(FLOOR_F80, "floorl")
240 HANDLE_LIBCALL(FLOOR_F128, "floorl")
241 HANDLE_LIBCALL(FLOOR_PPCF128, "floorl")
242 HANDLE_LIBCALL(COPYSIGN_F32, "copysignf")
243 HANDLE_LIBCALL(COPYSIGN_F64, "copysign")
244 HANDLE_LIBCALL(COPYSIGN_F80, "copysignl")
245 HANDLE_LIBCALL(COPYSIGN_F128, "copysignl")
246 HANDLE_LIBCALL(COPYSIGN_PPCF128, "copysignl")
247 HANDLE_LIBCALL(FMIN_F32, "fminf")
248 HANDLE_LIBCALL(FMIN_F64, "fmin")
249 HANDLE_LIBCALL(FMIN_F80, "fminl")
250 HANDLE_LIBCALL(FMIN_F128, "fminl")
251 HANDLE_LIBCALL(FMIN_PPCF128, "fminl")
252 HANDLE_LIBCALL(FMAX_F32, "fmaxf")
253 HANDLE_LIBCALL(FMAX_F64, "fmax")
254 HANDLE_LIBCALL(FMAX_F80, "fmaxl")
255 HANDLE_LIBCALL(FMAX_F128, "fmaxl")
256 HANDLE_LIBCALL(FMAX_PPCF128, "fmaxl")
257 HANDLE_LIBCALL(LROUND_F32, "lroundf")
258 HANDLE_LIBCALL(LROUND_F64, "lround")
259 HANDLE_LIBCALL(LROUND_F80, "lroundl")
260 HANDLE_LIBCALL(LROUND_F128, "lroundl")
261 HANDLE_LIBCALL(LROUND_PPCF128, "lroundl")
262 HANDLE_LIBCALL(LLROUND_F32, "llroundf")
263 HANDLE_LIBCALL(LLROUND_F64, "llround")
264 HANDLE_LIBCALL(LLROUND_F80, "llroundl")
265 HANDLE_LIBCALL(LLROUND_F128, "llroundl")
266 HANDLE_LIBCALL(LLROUND_PPCF128, "llroundl")
267 HANDLE_LIBCALL(LRINT_F32, "lrintf")
268 HANDLE_LIBCALL(LRINT_F64, "lrint")
269 HANDLE_LIBCALL(LRINT_F80, "lrintl")
270 HANDLE_LIBCALL(LRINT_F128, "lrintl")
271 HANDLE_LIBCALL(LRINT_PPCF128, "lrintl")
272 HANDLE_LIBCALL(LLRINT_F32, "llrintf")
273 HANDLE_LIBCALL(LLRINT_F64, "llrint")
274 HANDLE_LIBCALL(LLRINT_F80, "llrintl")
275 HANDLE_LIBCALL(LLRINT_F128, "llrintl")
276 HANDLE_LIBCALL(LLRINT_PPCF128, "llrintl")
278 // Conversion
279 HANDLE_LIBCALL(FPEXT_F32_PPCF128, "__gcc_stoq")
280 HANDLE_LIBCALL(FPEXT_F64_PPCF128, "__gcc_dtoq")
281 HANDLE_LIBCALL(FPEXT_F80_F128, "__extendxftf2")
282 HANDLE_LIBCALL(FPEXT_F64_F128, "__extenddftf2")
283 HANDLE_LIBCALL(FPEXT_F32_F128, "__extendsftf2")
284 HANDLE_LIBCALL(FPEXT_F32_F64, "__extendsfdf2")
285 HANDLE_LIBCALL(FPEXT_F16_F32, "__gnu_h2f_ieee")
286 HANDLE_LIBCALL(FPROUND_F32_F16, "__gnu_f2h_ieee")
287 HANDLE_LIBCALL(FPROUND_F64_F16, "__truncdfhf2")
288 HANDLE_LIBCALL(FPROUND_F80_F16, "__truncxfhf2")
289 HANDLE_LIBCALL(FPROUND_F128_F16, "__trunctfhf2")
290 HANDLE_LIBCALL(FPROUND_PPCF128_F16, "__trunctfhf2")
291 HANDLE_LIBCALL(FPROUND_F64_F32, "__truncdfsf2")
292 HANDLE_LIBCALL(FPROUND_F80_F32, "__truncxfsf2")
293 HANDLE_LIBCALL(FPROUND_F128_F32, "__trunctfsf2")
294 HANDLE_LIBCALL(FPROUND_PPCF128_F32, "__gcc_qtos")
295 HANDLE_LIBCALL(FPROUND_F80_F64, "__truncxfdf2")
296 HANDLE_LIBCALL(FPROUND_F128_F64, "__trunctfdf2")
297 HANDLE_LIBCALL(FPROUND_PPCF128_F64, "__gcc_qtod")
298 HANDLE_LIBCALL(FPROUND_F128_F80, "__trunctfxf2")
299 HANDLE_LIBCALL(FPTOSINT_F32_I32, "__fixsfsi")
300 HANDLE_LIBCALL(FPTOSINT_F32_I64, "__fixsfdi")
301 HANDLE_LIBCALL(FPTOSINT_F32_I128, "__fixsfti")
302 HANDLE_LIBCALL(FPTOSINT_F64_I32, "__fixdfsi")
303 HANDLE_LIBCALL(FPTOSINT_F64_I64, "__fixdfdi")
304 HANDLE_LIBCALL(FPTOSINT_F64_I128, "__fixdfti")
305 HANDLE_LIBCALL(FPTOSINT_F80_I32, "__fixxfsi")
306 HANDLE_LIBCALL(FPTOSINT_F80_I64, "__fixxfdi")
307 HANDLE_LIBCALL(FPTOSINT_F80_I128, "__fixxfti")
308 HANDLE_LIBCALL(FPTOSINT_F128_I32, "__fixtfsi")
309 HANDLE_LIBCALL(FPTOSINT_F128_I64, "__fixtfdi")
310 HANDLE_LIBCALL(FPTOSINT_F128_I128, "__fixtfti")
311 HANDLE_LIBCALL(FPTOSINT_PPCF128_I32, "__gcc_qtou")
312 HANDLE_LIBCALL(FPTOSINT_PPCF128_I64, "__fixtfdi")
313 HANDLE_LIBCALL(FPTOSINT_PPCF128_I128, "__fixtfti")
314 HANDLE_LIBCALL(FPTOUINT_F32_I32, "__fixunssfsi")
315 HANDLE_LIBCALL(FPTOUINT_F32_I64, "__fixunssfdi")
316 HANDLE_LIBCALL(FPTOUINT_F32_I128, "__fixunssfti")
317 HANDLE_LIBCALL(FPTOUINT_F64_I32, "__fixunsdfsi")
318 HANDLE_LIBCALL(FPTOUINT_F64_I64, "__fixunsdfdi")
319 HANDLE_LIBCALL(FPTOUINT_F64_I128, "__fixunsdfti")
320 HANDLE_LIBCALL(FPTOUINT_F80_I32, "__fixunsxfsi")
321 HANDLE_LIBCALL(FPTOUINT_F80_I64, "__fixunsxfdi")
322 HANDLE_LIBCALL(FPTOUINT_F80_I128, "__fixunsxfti")
323 HANDLE_LIBCALL(FPTOUINT_F128_I32, "__fixunstfsi")
324 HANDLE_LIBCALL(FPTOUINT_F128_I64, "__fixunstfdi")
325 HANDLE_LIBCALL(FPTOUINT_F128_I128, "__fixunstfti")
326 HANDLE_LIBCALL(FPTOUINT_PPCF128_I32, "__fixunstfsi")
327 HANDLE_LIBCALL(FPTOUINT_PPCF128_I64, "__fixunstfdi")
328 HANDLE_LIBCALL(FPTOUINT_PPCF128_I128, "__fixunstfti")
329 HANDLE_LIBCALL(SINTTOFP_I32_F32, "__floatsisf")
330 HANDLE_LIBCALL(SINTTOFP_I32_F64, "__floatsidf")
331 HANDLE_LIBCALL(SINTTOFP_I32_F80, "__floatsixf")
332 HANDLE_LIBCALL(SINTTOFP_I32_F128, "__floatsitf")
333 HANDLE_LIBCALL(SINTTOFP_I32_PPCF128, "__gcc_itoq")
334 HANDLE_LIBCALL(SINTTOFP_I64_F32, "__floatdisf")
335 HANDLE_LIBCALL(SINTTOFP_I64_F64, "__floatdidf")
336 HANDLE_LIBCALL(SINTTOFP_I64_F80, "__floatdixf")
337 HANDLE_LIBCALL(SINTTOFP_I64_F128, "__floatditf")
338 HANDLE_LIBCALL(SINTTOFP_I64_PPCF128, "__floatditf")
339 HANDLE_LIBCALL(SINTTOFP_I128_F32, "__floattisf")
340 HANDLE_LIBCALL(SINTTOFP_I128_F64, "__floattidf")
341 HANDLE_LIBCALL(SINTTOFP_I128_F80, "__floattixf")
342 HANDLE_LIBCALL(SINTTOFP_I128_F128, "__floattitf")
343 HANDLE_LIBCALL(SINTTOFP_I128_PPCF128, "__floattitf")
344 HANDLE_LIBCALL(UINTTOFP_I32_F32, "__floatunsisf")
345 HANDLE_LIBCALL(UINTTOFP_I32_F64, "__floatunsidf")
346 HANDLE_LIBCALL(UINTTOFP_I32_F80, "__floatunsixf")
347 HANDLE_LIBCALL(UINTTOFP_I32_F128, "__floatunsitf")
348 HANDLE_LIBCALL(UINTTOFP_I32_PPCF128, "__gcc_utoq")
349 HANDLE_LIBCALL(UINTTOFP_I64_F32, "__floatundisf")
350 HANDLE_LIBCALL(UINTTOFP_I64_F64, "__floatundidf")
351 HANDLE_LIBCALL(UINTTOFP_I64_F80, "__floatundixf")
352 HANDLE_LIBCALL(UINTTOFP_I64_F128, "__floatunditf")
353 HANDLE_LIBCALL(UINTTOFP_I64_PPCF128, "__floatunditf")
354 HANDLE_LIBCALL(UINTTOFP_I128_F32, "__floatuntisf")
355 HANDLE_LIBCALL(UINTTOFP_I128_F64, "__floatuntidf")
356 HANDLE_LIBCALL(UINTTOFP_I128_F80, "__floatuntixf")
357 HANDLE_LIBCALL(UINTTOFP_I128_F128, "__floatuntitf")
358 HANDLE_LIBCALL(UINTTOFP_I128_PPCF128, "__floatuntitf")
360 // Comparison
361 HANDLE_LIBCALL(OEQ_F32, "__eqsf2")
362 HANDLE_LIBCALL(OEQ_F64, "__eqdf2")
363 HANDLE_LIBCALL(OEQ_F128, "__eqtf2")
364 HANDLE_LIBCALL(OEQ_PPCF128, "__gcc_qeq")
365 HANDLE_LIBCALL(UNE_F32, "__nesf2")
366 HANDLE_LIBCALL(UNE_F64, "__nedf2")
367 HANDLE_LIBCALL(UNE_F128, "__netf2")
368 HANDLE_LIBCALL(UNE_PPCF128, "__gcc_qne")
369 HANDLE_LIBCALL(OGE_F32, "__gesf2")
370 HANDLE_LIBCALL(OGE_F64, "__gedf2")
371 HANDLE_LIBCALL(OGE_F128, "__getf2")
372 HANDLE_LIBCALL(OGE_PPCF128, "__gcc_qge")
373 HANDLE_LIBCALL(OLT_F32, "__ltsf2")
374 HANDLE_LIBCALL(OLT_F64, "__ltdf2")
375 HANDLE_LIBCALL(OLT_F128, "__lttf2")
376 HANDLE_LIBCALL(OLT_PPCF128, "__gcc_qlt")
377 HANDLE_LIBCALL(OLE_F32, "__lesf2")
378 HANDLE_LIBCALL(OLE_F64, "__ledf2")
379 HANDLE_LIBCALL(OLE_F128, "__letf2")
380 HANDLE_LIBCALL(OLE_PPCF128, "__gcc_qle")
381 HANDLE_LIBCALL(OGT_F32, "__gtsf2")
382 HANDLE_LIBCALL(OGT_F64, "__gtdf2")
383 HANDLE_LIBCALL(OGT_F128, "__gttf2")
384 HANDLE_LIBCALL(OGT_PPCF128, "__gcc_qgt")
385 HANDLE_LIBCALL(UO_F32, "__unordsf2")
386 HANDLE_LIBCALL(UO_F64, "__unorddf2")
387 HANDLE_LIBCALL(UO_F128, "__unordtf2")
388 HANDLE_LIBCALL(UO_PPCF128, "__gcc_qunord")
389 HANDLE_LIBCALL(O_F32, "__unordsf2")
390 HANDLE_LIBCALL(O_F64, "__unorddf2")
391 HANDLE_LIBCALL(O_F128, "__unordtf2")
392 HANDLE_LIBCALL(O_PPCF128, "__gcc_qunord")
394 // Memory
395 HANDLE_LIBCALL(MEMCPY, "memcpy")
396 HANDLE_LIBCALL(MEMMOVE, "memmove")
397 HANDLE_LIBCALL(MEMSET, "memset")
398 HANDLE_LIBCALL(BZERO, nullptr)
400 // Element-wise unordered-atomic memory of different sizes
401 HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memcpy_element_unordered_atomic_1")
402 HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memcpy_element_unordered_atomic_2")
403 HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memcpy_element_unordered_atomic_4")
404 HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memcpy_element_unordered_atomic_8")
405 HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memcpy_element_unordered_atomic_16")
406 HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memmove_element_unordered_atomic_1")
407 HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memmove_element_unordered_atomic_2")
408 HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memmove_element_unordered_atomic_4")
409 HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memmove_element_unordered_atomic_8")
410 HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memmove_element_unordered_atomic_16")
411 HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memset_element_unordered_atomic_1")
412 HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memset_element_unordered_atomic_2")
413 HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memset_element_unordered_atomic_4")
414 HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memset_element_unordered_atomic_8")
415 HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memset_element_unordered_atomic_16")
417 // Exception handling
418 HANDLE_LIBCALL(UNWIND_RESUME, "_Unwind_Resume")
420 // Note: there are two sets of atomics libcalls; see
421 // <https://llvm.org/docs/Atomics.html> for more info on the
422 // difference between them.
424 // Atomic '__sync_*' libcalls.
425 HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_1, "__sync_val_compare_and_swap_1")
426 HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_2, "__sync_val_compare_and_swap_2")
427 HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_4, "__sync_val_compare_and_swap_4")
428 HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_8, "__sync_val_compare_and_swap_8")
429 HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_16, "__sync_val_compare_and_swap_16")
430 HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_1, "__sync_lock_test_and_set_1")
431 HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_2, "__sync_lock_test_and_set_2")
432 HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_4, "__sync_lock_test_and_set_4")
433 HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_8, "__sync_lock_test_and_set_8")
434 HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_16, "__sync_lock_test_and_set_16")
435 HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_1, "__sync_fetch_and_add_1")
436 HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_2, "__sync_fetch_and_add_2")
437 HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_4, "__sync_fetch_and_add_4")
438 HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_8, "__sync_fetch_and_add_8")
439 HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_16, "__sync_fetch_and_add_16")
440 HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_1, "__sync_fetch_and_sub_1")
441 HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_2, "__sync_fetch_and_sub_2")
442 HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_4, "__sync_fetch_and_sub_4")
443 HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_8, "__sync_fetch_and_sub_8")
444 HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_16, "__sync_fetch_and_sub_16")
445 HANDLE_LIBCALL(SYNC_FETCH_AND_AND_1, "__sync_fetch_and_and_1")
446 HANDLE_LIBCALL(SYNC_FETCH_AND_AND_2, "__sync_fetch_and_and_2")
447 HANDLE_LIBCALL(SYNC_FETCH_AND_AND_4, "__sync_fetch_and_and_4")
448 HANDLE_LIBCALL(SYNC_FETCH_AND_AND_8, "__sync_fetch_and_and_8")
449 HANDLE_LIBCALL(SYNC_FETCH_AND_AND_16, "__sync_fetch_and_and_16")
450 HANDLE_LIBCALL(SYNC_FETCH_AND_OR_1, "__sync_fetch_and_or_1")
451 HANDLE_LIBCALL(SYNC_FETCH_AND_OR_2, "__sync_fetch_and_or_2")
452 HANDLE_LIBCALL(SYNC_FETCH_AND_OR_4, "__sync_fetch_and_or_4")
453 HANDLE_LIBCALL(SYNC_FETCH_AND_OR_8, "__sync_fetch_and_or_8")
454 HANDLE_LIBCALL(SYNC_FETCH_AND_OR_16, "__sync_fetch_and_or_16")
455 HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_1, "__sync_fetch_and_xor_1")
456 HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_2, "__sync_fetch_and_xor_2")
457 HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_4, "__sync_fetch_and_xor_4")
458 HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_8, "__sync_fetch_and_xor_8")
459 HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_16, "__sync_fetch_and_xor_16")
460 HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_1, "__sync_fetch_and_nand_1")
461 HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_2, "__sync_fetch_and_nand_2")
462 HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_4, "__sync_fetch_and_nand_4")
463 HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_8, "__sync_fetch_and_nand_8")
464 HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_16, "__sync_fetch_and_nand_16")
465 HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_1, "__sync_fetch_and_max_1")
466 HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_2, "__sync_fetch_and_max_2")
467 HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_4, "__sync_fetch_and_max_4")
468 HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_8, "__sync_fetch_and_max_8")
469 HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_16, "__sync_fetch_and_max_16")
470 HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_1, "__sync_fetch_and_umax_1")
471 HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_2, "__sync_fetch_and_umax_2")
472 HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_4, "__sync_fetch_and_umax_4")
473 HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_8, "__sync_fetch_and_umax_8")
474 HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_16, "__sync_fetch_and_umax_16")
475 HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_1, "__sync_fetch_and_min_1")
476 HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_2, "__sync_fetch_and_min_2")
477 HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_4, "__sync_fetch_and_min_4")
478 HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_8, "__sync_fetch_and_min_8")
479 HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_16, "__sync_fetch_and_min_16")
480 HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_1, "__sync_fetch_and_umin_1")
481 HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_2, "__sync_fetch_and_umin_2")
482 HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_4, "__sync_fetch_and_umin_4")
483 HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_8, "__sync_fetch_and_umin_8")
484 HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_16, "__sync_fetch_and_umin_16")
486 // Atomic `__atomic_*' libcalls.
487 HANDLE_LIBCALL(ATOMIC_LOAD, "__atomic_load")
488 HANDLE_LIBCALL(ATOMIC_LOAD_1, "__atomic_load_1")
489 HANDLE_LIBCALL(ATOMIC_LOAD_2, "__atomic_load_2")
490 HANDLE_LIBCALL(ATOMIC_LOAD_4, "__atomic_load_4")
491 HANDLE_LIBCALL(ATOMIC_LOAD_8, "__atomic_load_8")
492 HANDLE_LIBCALL(ATOMIC_LOAD_16, "__atomic_load_16")
494 HANDLE_LIBCALL(ATOMIC_STORE, "__atomic_store")
495 HANDLE_LIBCALL(ATOMIC_STORE_1, "__atomic_store_1")
496 HANDLE_LIBCALL(ATOMIC_STORE_2, "__atomic_store_2")
497 HANDLE_LIBCALL(ATOMIC_STORE_4, "__atomic_store_4")
498 HANDLE_LIBCALL(ATOMIC_STORE_8, "__atomic_store_8")
499 HANDLE_LIBCALL(ATOMIC_STORE_16, "__atomic_store_16")
501 HANDLE_LIBCALL(ATOMIC_EXCHANGE, "__atomic_exchange")
502 HANDLE_LIBCALL(ATOMIC_EXCHANGE_1, "__atomic_exchange_1")
503 HANDLE_LIBCALL(ATOMIC_EXCHANGE_2, "__atomic_exchange_2")
504 HANDLE_LIBCALL(ATOMIC_EXCHANGE_4, "__atomic_exchange_4")
505 HANDLE_LIBCALL(ATOMIC_EXCHANGE_8, "__atomic_exchange_8")
506 HANDLE_LIBCALL(ATOMIC_EXCHANGE_16, "__atomic_exchange_16")
508 HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE, "__atomic_compare_exchange")
509 HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_1, "__atomic_compare_exchange_1")
510 HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_2, "__atomic_compare_exchange_2")
511 HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_4, "__atomic_compare_exchange_4")
512 HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_8, "__atomic_compare_exchange_8")
513 HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_16, "__atomic_compare_exchange_16")
515 HANDLE_LIBCALL(ATOMIC_FETCH_ADD_1, "__atomic_fetch_add_1")
516 HANDLE_LIBCALL(ATOMIC_FETCH_ADD_2, "__atomic_fetch_add_2")
517 HANDLE_LIBCALL(ATOMIC_FETCH_ADD_4, "__atomic_fetch_add_4")
518 HANDLE_LIBCALL(ATOMIC_FETCH_ADD_8, "__atomic_fetch_add_8")
519 HANDLE_LIBCALL(ATOMIC_FETCH_ADD_16, "__atomic_fetch_add_16")
520 HANDLE_LIBCALL(ATOMIC_FETCH_SUB_1, "__atomic_fetch_sub_1")
521 HANDLE_LIBCALL(ATOMIC_FETCH_SUB_2, "__atomic_fetch_sub_2")
522 HANDLE_LIBCALL(ATOMIC_FETCH_SUB_4, "__atomic_fetch_sub_4")
523 HANDLE_LIBCALL(ATOMIC_FETCH_SUB_8, "__atomic_fetch_sub_8")
524 HANDLE_LIBCALL(ATOMIC_FETCH_SUB_16, "__atomic_fetch_sub_16")
525 HANDLE_LIBCALL(ATOMIC_FETCH_AND_1, "__atomic_fetch_and_1")
526 HANDLE_LIBCALL(ATOMIC_FETCH_AND_2, "__atomic_fetch_and_2")
527 HANDLE_LIBCALL(ATOMIC_FETCH_AND_4, "__atomic_fetch_and_4")
528 HANDLE_LIBCALL(ATOMIC_FETCH_AND_8, "__atomic_fetch_and_8")
529 HANDLE_LIBCALL(ATOMIC_FETCH_AND_16, "__atomic_fetch_and_16")
530 HANDLE_LIBCALL(ATOMIC_FETCH_OR_1, "__atomic_fetch_or_1")
531 HANDLE_LIBCALL(ATOMIC_FETCH_OR_2, "__atomic_fetch_or_2")
532 HANDLE_LIBCALL(ATOMIC_FETCH_OR_4, "__atomic_fetch_or_4")
533 HANDLE_LIBCALL(ATOMIC_FETCH_OR_8, "__atomic_fetch_or_8")
534 HANDLE_LIBCALL(ATOMIC_FETCH_OR_16, "__atomic_fetch_or_16")
535 HANDLE_LIBCALL(ATOMIC_FETCH_XOR_1, "__atomic_fetch_xor_1")
536 HANDLE_LIBCALL(ATOMIC_FETCH_XOR_2, "__atomic_fetch_xor_2")
537 HANDLE_LIBCALL(ATOMIC_FETCH_XOR_4, "__atomic_fetch_xor_4")
538 HANDLE_LIBCALL(ATOMIC_FETCH_XOR_8, "__atomic_fetch_xor_8")
539 HANDLE_LIBCALL(ATOMIC_FETCH_XOR_16, "__atomic_fetch_xor_16")
540 HANDLE_LIBCALL(ATOMIC_FETCH_NAND_1, "__atomic_fetch_nand_1")
541 HANDLE_LIBCALL(ATOMIC_FETCH_NAND_2, "__atomic_fetch_nand_2")
542 HANDLE_LIBCALL(ATOMIC_FETCH_NAND_4, "__atomic_fetch_nand_4")
543 HANDLE_LIBCALL(ATOMIC_FETCH_NAND_8, "__atomic_fetch_nand_8")
544 HANDLE_LIBCALL(ATOMIC_FETCH_NAND_16, "__atomic_fetch_nand_16")
546 // Stack Protector Fail
547 HANDLE_LIBCALL(STACKPROTECTOR_CHECK_FAIL, "__stack_chk_fail")
549 // Deoptimization
550 HANDLE_LIBCALL(DEOPTIMIZE, "__llvm_deoptimize")
552 // Return address
553 HANDLE_LIBCALL(RETURN_ADDRESS, nullptr)
555 HANDLE_LIBCALL(UNKNOWN_LIBCALL, nullptr)
557 #undef HANDLE_LIBCALL