1 | //===--- Builtins.def - Builtin function info database ----------*- 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 the standard builtin function database. Users of this file |
10 | // must define the BUILTIN macro to make use of this information. |
11 | // |
12 | //===----------------------------------------------------------------------===// |
13 | |
14 | // FIXME: This should really be a .td file, but that requires modifying tblgen. |
15 | // Perhaps tblgen should have plugins. |
16 | |
17 | // The first value provided to the macro specifies the function name of the |
18 | // builtin, and results in a clang::builtin::BIXX enum value for XX. |
19 | |
20 | // The second value provided to the macro specifies the type of the function |
21 | // (result value, then each argument) as follows: |
22 | // v -> void |
23 | // b -> boolean |
24 | // c -> char |
25 | // s -> short |
26 | // i -> int |
27 | // h -> half |
28 | // f -> float |
29 | // d -> double |
30 | // z -> size_t |
31 | // w -> wchar_t |
32 | // F -> constant CFString |
33 | // G -> id |
34 | // H -> SEL |
35 | // M -> struct objc_super |
36 | // a -> __builtin_va_list |
37 | // A -> "reference" to __builtin_va_list |
38 | // V -> Vector, followed by the number of elements and the base type. |
39 | // q -> Scalable vector, followed by the number of elements and the base type. |
40 | // E -> ext_vector, followed by the number of elements and the base type. |
41 | // X -> _Complex, followed by the base type. |
42 | // Y -> ptrdiff_t |
43 | // P -> FILE |
44 | // J -> jmp_buf |
45 | // SJ -> sigjmp_buf |
46 | // K -> ucontext_t |
47 | // p -> pid_t |
48 | // . -> "...". This may only occur at the end of the function list. |
49 | // |
50 | // Types may be prefixed with the following modifiers: |
51 | // L -> long (e.g. Li for 'long int', Ld for 'long double') |
52 | // LL -> long long (e.g. LLi for 'long long int', LLd for __float128) |
53 | // LLL -> __int128_t (e.g. LLLi) |
54 | // Z -> int32_t (require a native 32-bit integer type on the target) |
55 | // W -> int64_t (require a native 64-bit integer type on the target) |
56 | // N -> 'int' size if target is LP64, 'L' otherwise. |
57 | // O -> long for OpenCL targets, long long otherwise. |
58 | // S -> signed |
59 | // U -> unsigned |
60 | // I -> Required to constant fold to an integer constant expression. |
61 | // |
62 | // Types may be postfixed with the following modifiers: |
63 | // * -> pointer (optionally followed by an address space number, if no address |
64 | // space is specified than any address space will be accepted) |
65 | // & -> reference (optionally followed by an address space number) |
66 | // C -> const |
67 | // D -> volatile |
68 | // R -> restrict |
69 | |
70 | // The third value provided to the macro specifies information about attributes |
71 | // of the function. These must be kept in sync with the predicates in the |
72 | // Builtin::Context class. Currently we have: |
73 | // n -> nothrow |
74 | // r -> noreturn |
75 | // U -> pure |
76 | // c -> const |
77 | // t -> signature is meaningless, use custom typechecking |
78 | // T -> type is not important to semantic analysis and codegen; recognize as |
79 | // builtin even if type doesn't match signature, and don't warn if we |
80 | // can't be sure the type is right |
81 | // F -> this is a libc/libm function with a '__builtin_' prefix added. |
82 | // f -> this is a libc/libm function without the '__builtin_' prefix. It can |
83 | // be followed by ':headername:' to state which header this function |
84 | // comes from. |
85 | // h -> this function requires a specific header or an explicit declaration. |
86 | // i -> this is a runtime library implemented function without the |
87 | // '__builtin_' prefix. It will be implemented in compiler-rt or libgcc. |
88 | // p:N: -> this is a printf-like function whose Nth argument is the format |
89 | // string. |
90 | // P:N: -> similar to the p:N: attribute, but the function is like vprintf |
91 | // in that it accepts its arguments as a va_list rather than |
92 | // through an ellipsis |
93 | // s:N: -> this is a scanf-like function whose Nth argument is the format |
94 | // string. |
95 | // S:N: -> similar to the s:N: attribute, but the function is like vscanf |
96 | // in that it accepts its arguments as a va_list rather than |
97 | // through an ellipsis |
98 | // e -> const, but only when -fno-math-errno |
99 | // j -> returns_twice (like setjmp) |
100 | // u -> arguments are not evaluated for their side-effects |
101 | // V:N: -> requires vectors of at least N bits to be legal |
102 | // C<N,M_0,...,M_k> -> callback behavior: argument N is called with argument |
103 | // M_0, ..., M_k as payload |
104 | // FIXME: gcc has nonnull |
105 | |
106 | #if defined(BUILTIN) && !defined(LIBBUILTIN) |
107 | # define LIBBUILTIN(ID, TYPE, ATTRS, HEADER, BUILTIN_LANG) BUILTIN(ID, TYPE, ATTRS) |
108 | #endif |
109 | |
110 | #if defined(BUILTIN) && !defined(LANGBUILTIN) |
111 | # define LANGBUILTIN(ID, TYPE, ATTRS, BUILTIN_LANG) BUILTIN(ID, TYPE, ATTRS) |
112 | #endif |
113 | |
114 | // Standard libc/libm functions: |
115 | BUILTIN(__builtin_atan2 , "ddd" , "Fne" ) |
116 | BUILTIN(__builtin_atan2f, "fff" , "Fne" ) |
117 | BUILTIN(__builtin_atan2l, "LdLdLd" , "Fne" ) |
118 | BUILTIN(__builtin_atan2f128, "LLdLLdLLd" , "Fne" ) |
119 | BUILTIN(__builtin_abs , "ii" , "ncF" ) |
120 | BUILTIN(__builtin_copysign, "ddd" , "ncF" ) |
121 | BUILTIN(__builtin_copysignf, "fff" , "ncF" ) |
122 | BUILTIN(__builtin_copysignf16, "hhh" , "ncF" ) |
123 | BUILTIN(__builtin_copysignl, "LdLdLd" , "ncF" ) |
124 | BUILTIN(__builtin_copysignf128, "LLdLLdLLd" , "ncF" ) |
125 | BUILTIN(__builtin_fabs , "dd" , "ncF" ) |
126 | BUILTIN(__builtin_fabsf, "ff" , "ncF" ) |
127 | BUILTIN(__builtin_fabsl, "LdLd" , "ncF" ) |
128 | BUILTIN(__builtin_fabsf16, "hh" , "ncF" ) |
129 | BUILTIN(__builtin_fabsf128, "LLdLLd" , "ncF" ) |
130 | BUILTIN(__builtin_fmod , "ddd" , "Fne" ) |
131 | BUILTIN(__builtin_fmodf, "fff" , "Fne" ) |
132 | BUILTIN(__builtin_fmodf16, "hhh" , "Fne" ) |
133 | BUILTIN(__builtin_fmodl, "LdLdLd" , "Fne" ) |
134 | BUILTIN(__builtin_fmodf128, "LLdLLdLLd" , "Fne" ) |
135 | BUILTIN(__builtin_frexp , "ddi*" , "Fn" ) |
136 | BUILTIN(__builtin_frexpf, "ffi*" , "Fn" ) |
137 | BUILTIN(__builtin_frexpl, "LdLdi*" , "Fn" ) |
138 | BUILTIN(__builtin_frexpf128, "LLdLLdi*" , "Fn" ) |
139 | BUILTIN(__builtin_huge_val, "d" , "nc" ) |
140 | BUILTIN(__builtin_huge_valf, "f" , "nc" ) |
141 | BUILTIN(__builtin_huge_vall, "Ld" , "nc" ) |
142 | BUILTIN(__builtin_huge_valf128, "LLd" , "nc" ) |
143 | BUILTIN(__builtin_inf , "d" , "nc" ) |
144 | BUILTIN(__builtin_inff , "f" , "nc" ) |
145 | BUILTIN(__builtin_infl , "Ld" , "nc" ) |
146 | BUILTIN(__builtin_inff128 , "LLd" , "nc" ) |
147 | BUILTIN(__builtin_labs , "LiLi" , "Fnc" ) |
148 | BUILTIN(__builtin_llabs, "LLiLLi" , "Fnc" ) |
149 | BUILTIN(__builtin_ldexp , "ddi" , "Fne" ) |
150 | BUILTIN(__builtin_ldexpf, "ffi" , "Fne" ) |
151 | BUILTIN(__builtin_ldexpl, "LdLdi" , "Fne" ) |
152 | BUILTIN(__builtin_ldexpf128, "LLdLLdi" , "Fne" ) |
153 | BUILTIN(__builtin_modf , "ddd*" , "Fn" ) |
154 | BUILTIN(__builtin_modff, "fff*" , "Fn" ) |
155 | BUILTIN(__builtin_modfl, "LdLdLd*" , "Fn" ) |
156 | BUILTIN(__builtin_modff128, "LLdLLdLLd*" , "Fn" ) |
157 | BUILTIN(__builtin_nan, "dcC*" , "FnU" ) |
158 | BUILTIN(__builtin_nanf, "fcC*" , "FnU" ) |
159 | BUILTIN(__builtin_nanl, "LdcC*" , "FnU" ) |
160 | BUILTIN(__builtin_nanf128, "LLdcC*" , "FnU" ) |
161 | BUILTIN(__builtin_nans, "dcC*" , "FnU" ) |
162 | BUILTIN(__builtin_nansf, "fcC*" , "FnU" ) |
163 | BUILTIN(__builtin_nansl, "LdcC*" , "FnU" ) |
164 | BUILTIN(__builtin_nansf128, "LLdcC*" , "FnU" ) |
165 | BUILTIN(__builtin_powi , "ddi" , "Fnc" ) |
166 | BUILTIN(__builtin_powif, "ffi" , "Fnc" ) |
167 | BUILTIN(__builtin_powil, "LdLdi" , "Fnc" ) |
168 | BUILTIN(__builtin_pow , "ddd" , "Fne" ) |
169 | BUILTIN(__builtin_powf, "fff" , "Fne" ) |
170 | BUILTIN(__builtin_powf16, "hhh" , "Fne" ) |
171 | BUILTIN(__builtin_powl, "LdLdLd" , "Fne" ) |
172 | BUILTIN(__builtin_powf128, "LLdLLdLLd" , "Fne" ) |
173 | |
174 | // Standard unary libc/libm functions with double/float/long double variants: |
175 | BUILTIN(__builtin_acos , "dd" , "Fne" ) |
176 | BUILTIN(__builtin_acosf, "ff" , "Fne" ) |
177 | BUILTIN(__builtin_acosl, "LdLd" , "Fne" ) |
178 | BUILTIN(__builtin_acosf128, "LLdLLd" , "Fne" ) |
179 | BUILTIN(__builtin_acosh , "dd" , "Fne" ) |
180 | BUILTIN(__builtin_acoshf, "ff" , "Fne" ) |
181 | BUILTIN(__builtin_acoshl, "LdLd" , "Fne" ) |
182 | BUILTIN(__builtin_acoshf128, "LLdLLd" , "Fne" ) |
183 | BUILTIN(__builtin_asin , "dd" , "Fne" ) |
184 | BUILTIN(__builtin_asinf, "ff" , "Fne" ) |
185 | BUILTIN(__builtin_asinl, "LdLd" , "Fne" ) |
186 | BUILTIN(__builtin_asinf128, "LLdLLd" , "Fne" ) |
187 | BUILTIN(__builtin_asinh , "dd" , "Fne" ) |
188 | BUILTIN(__builtin_asinhf, "ff" , "Fne" ) |
189 | BUILTIN(__builtin_asinhl, "LdLd" , "Fne" ) |
190 | BUILTIN(__builtin_asinhf128, "LLdLLd" , "Fne" ) |
191 | BUILTIN(__builtin_atan , "dd" , "Fne" ) |
192 | BUILTIN(__builtin_atanf, "ff" , "Fne" ) |
193 | BUILTIN(__builtin_atanl, "LdLd" , "Fne" ) |
194 | BUILTIN(__builtin_atanf128, "LLdLLd" , "Fne" ) |
195 | BUILTIN(__builtin_atanh , "dd" , "Fne" ) |
196 | BUILTIN(__builtin_atanhf, "ff" , "Fne" ) |
197 | BUILTIN(__builtin_atanhl, "LdLd" , "Fne" ) |
198 | BUILTIN(__builtin_atanhf128, "LLdLLd" , "Fne" ) |
199 | BUILTIN(__builtin_cbrt , "dd" , "Fnc" ) |
200 | BUILTIN(__builtin_cbrtf, "ff" , "Fnc" ) |
201 | BUILTIN(__builtin_cbrtl, "LdLd" , "Fnc" ) |
202 | BUILTIN(__builtin_cbrtf128, "LLdLLd" , "Fnc" ) |
203 | BUILTIN(__builtin_ceil , "dd" , "Fnc" ) |
204 | BUILTIN(__builtin_ceilf, "ff" , "Fnc" ) |
205 | BUILTIN(__builtin_ceilf16, "hh" , "Fnc" ) |
206 | BUILTIN(__builtin_ceill, "LdLd" , "Fnc" ) |
207 | BUILTIN(__builtin_ceilf128, "LLdLLd" , "Fnc" ) |
208 | BUILTIN(__builtin_cos , "dd" , "Fne" ) |
209 | BUILTIN(__builtin_cosf, "ff" , "Fne" ) |
210 | BUILTIN(__builtin_cosf16, "hh" , "Fne" ) |
211 | BUILTIN(__builtin_cosh , "dd" , "Fne" ) |
212 | BUILTIN(__builtin_coshf, "ff" , "Fne" ) |
213 | BUILTIN(__builtin_coshl, "LdLd" , "Fne" ) |
214 | BUILTIN(__builtin_coshf128, "LLdLLd" , "Fne" ) |
215 | BUILTIN(__builtin_cosl, "LdLd" , "Fne" ) |
216 | BUILTIN(__builtin_cosf128, "LLdLLd" , "Fne" ) |
217 | BUILTIN(__builtin_erf , "dd" , "Fne" ) |
218 | BUILTIN(__builtin_erff, "ff" , "Fne" ) |
219 | BUILTIN(__builtin_erfl, "LdLd" , "Fne" ) |
220 | BUILTIN(__builtin_erff128, "LLdLLd" , "Fne" ) |
221 | BUILTIN(__builtin_erfc , "dd" , "Fne" ) |
222 | BUILTIN(__builtin_erfcf, "ff" , "Fne" ) |
223 | BUILTIN(__builtin_erfcl, "LdLd" , "Fne" ) |
224 | BUILTIN(__builtin_erfcf128, "LLdLLd" , "Fne" ) |
225 | BUILTIN(__builtin_exp , "dd" , "Fne" ) |
226 | BUILTIN(__builtin_expf, "ff" , "Fne" ) |
227 | BUILTIN(__builtin_expf16, "hh" , "Fne" ) |
228 | BUILTIN(__builtin_expl, "LdLd" , "Fne" ) |
229 | BUILTIN(__builtin_expf128, "LLdLLd" , "Fne" ) |
230 | BUILTIN(__builtin_exp2 , "dd" , "Fne" ) |
231 | BUILTIN(__builtin_exp2f, "ff" , "Fne" ) |
232 | BUILTIN(__builtin_exp2f16, "hh" , "Fne" ) |
233 | BUILTIN(__builtin_exp2l, "LdLd" , "Fne" ) |
234 | BUILTIN(__builtin_exp2f128, "LLdLLd" , "Fne" ) |
235 | BUILTIN(__builtin_expm1 , "dd" , "Fne" ) |
236 | BUILTIN(__builtin_expm1f, "ff" , "Fne" ) |
237 | BUILTIN(__builtin_expm1l, "LdLd" , "Fne" ) |
238 | BUILTIN(__builtin_expm1f128, "LLdLLd" , "Fne" ) |
239 | BUILTIN(__builtin_fdim, "ddd" , "Fne" ) |
240 | BUILTIN(__builtin_fdimf, "fff" , "Fne" ) |
241 | BUILTIN(__builtin_fdiml, "LdLdLd" , "Fne" ) |
242 | BUILTIN(__builtin_fdimf128, "LLdLLdLLd" , "Fne" ) |
243 | BUILTIN(__builtin_floor , "dd" , "Fnc" ) |
244 | BUILTIN(__builtin_floorf, "ff" , "Fnc" ) |
245 | BUILTIN(__builtin_floorf16, "hh" , "Fnc" ) |
246 | BUILTIN(__builtin_floorl, "LdLd" , "Fnc" ) |
247 | BUILTIN(__builtin_floorf128, "LLdLLd" , "Fnc" ) |
248 | BUILTIN(__builtin_fma, "dddd" , "Fne" ) |
249 | BUILTIN(__builtin_fmaf, "ffff" , "Fne" ) |
250 | BUILTIN(__builtin_fmaf16, "hhhh" , "Fne" ) |
251 | BUILTIN(__builtin_fmal, "LdLdLdLd" , "Fne" ) |
252 | BUILTIN(__builtin_fmaf128, "LLdLLdLLdLLd" , "Fne" ) |
253 | BUILTIN(__builtin_fmax, "ddd" , "Fnc" ) |
254 | BUILTIN(__builtin_fmaxf, "fff" , "Fnc" ) |
255 | BUILTIN(__builtin_fmaxf16, "hhh" , "Fnc" ) |
256 | BUILTIN(__builtin_fmaxl, "LdLdLd" , "Fnc" ) |
257 | BUILTIN(__builtin_fmaxf128, "LLdLLdLLd" , "Fnc" ) |
258 | BUILTIN(__builtin_fmin, "ddd" , "Fnc" ) |
259 | BUILTIN(__builtin_fminf, "fff" , "Fnc" ) |
260 | BUILTIN(__builtin_fminf16, "hhh" , "Fnc" ) |
261 | BUILTIN(__builtin_fminl, "LdLdLd" , "Fnc" ) |
262 | BUILTIN(__builtin_fminf128, "LLdLLdLLd" , "Fnc" ) |
263 | BUILTIN(__builtin_hypot , "ddd" , "Fne" ) |
264 | BUILTIN(__builtin_hypotf, "fff" , "Fne" ) |
265 | BUILTIN(__builtin_hypotl, "LdLdLd" , "Fne" ) |
266 | BUILTIN(__builtin_hypotf128, "LLdLLdLLd" , "Fne" ) |
267 | BUILTIN(__builtin_ilogb , "id" , "Fne" ) |
268 | BUILTIN(__builtin_ilogbf, "if" , "Fne" ) |
269 | BUILTIN(__builtin_ilogbl, "iLd" , "Fne" ) |
270 | BUILTIN(__builtin_ilogbf128, "iLLd" , "Fne" ) |
271 | BUILTIN(__builtin_lgamma , "dd" , "Fn" ) |
272 | BUILTIN(__builtin_lgammaf, "ff" , "Fn" ) |
273 | BUILTIN(__builtin_lgammal, "LdLd" , "Fn" ) |
274 | BUILTIN(__builtin_lgammaf128, "LLdLLd" , "Fn" ) |
275 | BUILTIN(__builtin_llrint, "LLid" , "Fne" ) |
276 | BUILTIN(__builtin_llrintf, "LLif" , "Fne" ) |
277 | BUILTIN(__builtin_llrintl, "LLiLd" , "Fne" ) |
278 | BUILTIN(__builtin_llrintf128, "LLiLLd" , "Fne" ) |
279 | BUILTIN(__builtin_llround , "LLid" , "Fne" ) |
280 | BUILTIN(__builtin_llroundf, "LLif" , "Fne" ) |
281 | BUILTIN(__builtin_llroundl, "LLiLd" , "Fne" ) |
282 | BUILTIN(__builtin_llroundf128, "LLiLLd" , "Fne" ) |
283 | BUILTIN(__builtin_log , "dd" , "Fne" ) |
284 | BUILTIN(__builtin_log10 , "dd" , "Fne" ) |
285 | BUILTIN(__builtin_log10f, "ff" , "Fne" ) |
286 | BUILTIN(__builtin_log10f16, "hh" , "Fne" ) |
287 | BUILTIN(__builtin_log10l, "LdLd" , "Fne" ) |
288 | BUILTIN(__builtin_log10f128, "LLdLLd" , "Fne" ) |
289 | BUILTIN(__builtin_log1p , "dd" , "Fne" ) |
290 | BUILTIN(__builtin_log1pf, "ff" , "Fne" ) |
291 | BUILTIN(__builtin_log1pl, "LdLd" , "Fne" ) |
292 | BUILTIN(__builtin_log1pf128, "LLdLLd" , "Fne" ) |
293 | BUILTIN(__builtin_log2, "dd" , "Fne" ) |
294 | BUILTIN(__builtin_log2f, "ff" , "Fne" ) |
295 | BUILTIN(__builtin_log2f16, "hh" , "Fne" ) |
296 | BUILTIN(__builtin_log2l, "LdLd" , "Fne" ) |
297 | BUILTIN(__builtin_log2f128, "LLdLLd" , "Fne" ) |
298 | BUILTIN(__builtin_logb , "dd" , "Fne" ) |
299 | BUILTIN(__builtin_logbf, "ff" , "Fne" ) |
300 | BUILTIN(__builtin_logbl, "LdLd" , "Fne" ) |
301 | BUILTIN(__builtin_logbf128, "LLdLLd" , "Fne" ) |
302 | BUILTIN(__builtin_logf, "ff" , "Fne" ) |
303 | BUILTIN(__builtin_logf16, "hh" , "Fne" ) |
304 | BUILTIN(__builtin_logl, "LdLd" , "Fne" ) |
305 | BUILTIN(__builtin_logf128, "LLdLLd" , "Fne" ) |
306 | BUILTIN(__builtin_lrint , "Lid" , "Fne" ) |
307 | BUILTIN(__builtin_lrintf, "Lif" , "Fne" ) |
308 | BUILTIN(__builtin_lrintl, "LiLd" , "Fne" ) |
309 | BUILTIN(__builtin_lrintf128, "LiLLd" , "Fne" ) |
310 | BUILTIN(__builtin_lround , "Lid" , "Fne" ) |
311 | BUILTIN(__builtin_lroundf, "Lif" , "Fne" ) |
312 | BUILTIN(__builtin_lroundl, "LiLd" , "Fne" ) |
313 | BUILTIN(__builtin_lroundf128, "LiLLd" , "Fne" ) |
314 | BUILTIN(__builtin_nearbyint , "dd" , "Fnc" ) |
315 | BUILTIN(__builtin_nearbyintf, "ff" , "Fnc" ) |
316 | BUILTIN(__builtin_nearbyintl, "LdLd" , "Fnc" ) |
317 | BUILTIN(__builtin_nearbyintf128, "LLdLLd" , "Fnc" ) |
318 | BUILTIN(__builtin_nextafter , "ddd" , "Fne" ) |
319 | BUILTIN(__builtin_nextafterf, "fff" , "Fne" ) |
320 | BUILTIN(__builtin_nextafterl, "LdLdLd" , "Fne" ) |
321 | BUILTIN(__builtin_nextafterf128, "LLdLLdLLd" , "Fne" ) |
322 | BUILTIN(__builtin_nexttoward , "ddLd" , "Fne" ) |
323 | BUILTIN(__builtin_nexttowardf, "ffLd" , "Fne" ) |
324 | BUILTIN(__builtin_nexttowardl, "LdLdLd" , "Fne" ) |
325 | BUILTIN(__builtin_nexttowardf128, "LLdLLdLLd" , "Fne" ) |
326 | BUILTIN(__builtin_remainder , "ddd" , "Fne" ) |
327 | BUILTIN(__builtin_remainderf, "fff" , "Fne" ) |
328 | BUILTIN(__builtin_remainderl, "LdLdLd" , "Fne" ) |
329 | BUILTIN(__builtin_remainderf128, "LLdLLdLLd" , "Fne" ) |
330 | BUILTIN(__builtin_remquo , "dddi*" , "Fn" ) |
331 | BUILTIN(__builtin_remquof, "fffi*" , "Fn" ) |
332 | BUILTIN(__builtin_remquol, "LdLdLdi*" , "Fn" ) |
333 | BUILTIN(__builtin_remquof128, "LLdLLdLLdi*" , "Fn" ) |
334 | BUILTIN(__builtin_rint , "dd" , "Fnc" ) |
335 | BUILTIN(__builtin_rintf, "ff" , "Fnc" ) |
336 | BUILTIN(__builtin_rintf16, "hh" , "Fnc" ) |
337 | BUILTIN(__builtin_rintl, "LdLd" , "Fnc" ) |
338 | BUILTIN(__builtin_rintf128, "LLdLLd" , "Fnc" ) |
339 | BUILTIN(__builtin_round, "dd" , "Fnc" ) |
340 | BUILTIN(__builtin_roundf, "ff" , "Fnc" ) |
341 | BUILTIN(__builtin_roundf16, "hh" , "Fnc" ) |
342 | BUILTIN(__builtin_roundl, "LdLd" , "Fnc" ) |
343 | BUILTIN(__builtin_roundf128, "LLdLLd" , "Fnc" ) |
344 | BUILTIN(__builtin_scalbln , "ddLi" , "Fne" ) |
345 | BUILTIN(__builtin_scalblnf, "ffLi" , "Fne" ) |
346 | BUILTIN(__builtin_scalblnl, "LdLdLi" , "Fne" ) |
347 | BUILTIN(__builtin_scalblnf128, "LLdLLdLi" , "Fne" ) |
348 | BUILTIN(__builtin_scalbn , "ddi" , "Fne" ) |
349 | BUILTIN(__builtin_scalbnf, "ffi" , "Fne" ) |
350 | BUILTIN(__builtin_scalbnl, "LdLdi" , "Fne" ) |
351 | BUILTIN(__builtin_scalbnf128, "LLdLLdi" , "Fne" ) |
352 | BUILTIN(__builtin_sin , "dd" , "Fne" ) |
353 | BUILTIN(__builtin_sinf, "ff" , "Fne" ) |
354 | BUILTIN(__builtin_sinf16, "hh" , "Fne" ) |
355 | BUILTIN(__builtin_sinh , "dd" , "Fne" ) |
356 | BUILTIN(__builtin_sinhf, "ff" , "Fne" ) |
357 | BUILTIN(__builtin_sinhl, "LdLd" , "Fne" ) |
358 | BUILTIN(__builtin_sinhf128, "LLdLLd" , "Fne" ) |
359 | BUILTIN(__builtin_sinl, "LdLd" , "Fne" ) |
360 | BUILTIN(__builtin_sinf128, "LLdLLd" , "Fne" ) |
361 | BUILTIN(__builtin_sqrt , "dd" , "Fne" ) |
362 | BUILTIN(__builtin_sqrtf, "ff" , "Fne" ) |
363 | BUILTIN(__builtin_sqrtf16, "hh" , "Fne" ) |
364 | BUILTIN(__builtin_sqrtl, "LdLd" , "Fne" ) |
365 | BUILTIN(__builtin_sqrtf128, "LLdLLd" , "Fne" ) |
366 | BUILTIN(__builtin_tan , "dd" , "Fne" ) |
367 | BUILTIN(__builtin_tanf, "ff" , "Fne" ) |
368 | BUILTIN(__builtin_tanh , "dd" , "Fne" ) |
369 | BUILTIN(__builtin_tanhf, "ff" , "Fne" ) |
370 | BUILTIN(__builtin_tanhl, "LdLd" , "Fne" ) |
371 | BUILTIN(__builtin_tanhf128, "LLdLLd" , "Fne" ) |
372 | BUILTIN(__builtin_tanl, "LdLd" , "Fne" ) |
373 | BUILTIN(__builtin_tanf128, "LLdLLd" , "Fne" ) |
374 | BUILTIN(__builtin_tgamma , "dd" , "Fne" ) |
375 | BUILTIN(__builtin_tgammaf, "ff" , "Fne" ) |
376 | BUILTIN(__builtin_tgammal, "LdLd" , "Fne" ) |
377 | BUILTIN(__builtin_tgammaf128, "LLdLLd" , "Fne" ) |
378 | BUILTIN(__builtin_trunc , "dd" , "Fnc" ) |
379 | BUILTIN(__builtin_truncf, "ff" , "Fnc" ) |
380 | BUILTIN(__builtin_truncl, "LdLd" , "Fnc" ) |
381 | BUILTIN(__builtin_truncf128, "LLdLLd" , "Fnc" ) |
382 | BUILTIN(__builtin_truncf16, "hh" , "Fnc" ) |
383 | |
384 | // Access to floating point environment |
385 | BUILTIN(__builtin_flt_rounds, "i" , "n" ) |
386 | |
387 | // C99 complex builtins |
388 | BUILTIN(__builtin_cabs, "dXd" , "Fne" ) |
389 | BUILTIN(__builtin_cabsf, "fXf" , "Fne" ) |
390 | BUILTIN(__builtin_cabsl, "LdXLd" , "Fne" ) |
391 | BUILTIN(__builtin_cacos, "XdXd" , "Fne" ) |
392 | BUILTIN(__builtin_cacosf, "XfXf" , "Fne" ) |
393 | BUILTIN(__builtin_cacosh, "XdXd" , "Fne" ) |
394 | BUILTIN(__builtin_cacoshf, "XfXf" , "Fne" ) |
395 | BUILTIN(__builtin_cacoshl, "XLdXLd" , "Fne" ) |
396 | BUILTIN(__builtin_cacosl, "XLdXLd" , "Fne" ) |
397 | BUILTIN(__builtin_carg, "dXd" , "Fne" ) |
398 | BUILTIN(__builtin_cargf, "fXf" , "Fne" ) |
399 | BUILTIN(__builtin_cargl, "LdXLd" , "Fne" ) |
400 | BUILTIN(__builtin_casin, "XdXd" , "Fne" ) |
401 | BUILTIN(__builtin_casinf, "XfXf" , "Fne" ) |
402 | BUILTIN(__builtin_casinh, "XdXd" , "Fne" ) |
403 | BUILTIN(__builtin_casinhf, "XfXf" , "Fne" ) |
404 | BUILTIN(__builtin_casinhl, "XLdXLd" , "Fne" ) |
405 | BUILTIN(__builtin_casinl, "XLdXLd" , "Fne" ) |
406 | BUILTIN(__builtin_catan, "XdXd" , "Fne" ) |
407 | BUILTIN(__builtin_catanf, "XfXf" , "Fne" ) |
408 | BUILTIN(__builtin_catanh, "XdXd" , "Fne" ) |
409 | BUILTIN(__builtin_catanhf, "XfXf" , "Fne" ) |
410 | BUILTIN(__builtin_catanhl, "XLdXLd" , "Fne" ) |
411 | BUILTIN(__builtin_catanl, "XLdXLd" , "Fne" ) |
412 | BUILTIN(__builtin_ccos, "XdXd" , "Fne" ) |
413 | BUILTIN(__builtin_ccosf, "XfXf" , "Fne" ) |
414 | BUILTIN(__builtin_ccosl, "XLdXLd" , "Fne" ) |
415 | BUILTIN(__builtin_ccosh, "XdXd" , "Fne" ) |
416 | BUILTIN(__builtin_ccoshf, "XfXf" , "Fne" ) |
417 | BUILTIN(__builtin_ccoshl, "XLdXLd" , "Fne" ) |
418 | BUILTIN(__builtin_cexp, "XdXd" , "Fne" ) |
419 | BUILTIN(__builtin_cexpf, "XfXf" , "Fne" ) |
420 | BUILTIN(__builtin_cexpl, "XLdXLd" , "Fne" ) |
421 | BUILTIN(__builtin_cimag, "dXd" , "Fnc" ) |
422 | BUILTIN(__builtin_cimagf, "fXf" , "Fnc" ) |
423 | BUILTIN(__builtin_cimagl, "LdXLd" , "Fnc" ) |
424 | BUILTIN(__builtin_conj, "XdXd" , "Fnc" ) |
425 | BUILTIN(__builtin_conjf, "XfXf" , "Fnc" ) |
426 | BUILTIN(__builtin_conjl, "XLdXLd" , "Fnc" ) |
427 | BUILTIN(__builtin_clog, "XdXd" , "Fne" ) |
428 | BUILTIN(__builtin_clogf, "XfXf" , "Fne" ) |
429 | BUILTIN(__builtin_clogl, "XLdXLd" , "Fne" ) |
430 | BUILTIN(__builtin_cproj, "XdXd" , "Fnc" ) |
431 | BUILTIN(__builtin_cprojf, "XfXf" , "Fnc" ) |
432 | BUILTIN(__builtin_cprojl, "XLdXLd" , "Fnc" ) |
433 | BUILTIN(__builtin_cpow, "XdXdXd" , "Fne" ) |
434 | BUILTIN(__builtin_cpowf, "XfXfXf" , "Fne" ) |
435 | BUILTIN(__builtin_cpowl, "XLdXLdXLd" , "Fne" ) |
436 | BUILTIN(__builtin_creal, "dXd" , "Fnc" ) |
437 | BUILTIN(__builtin_crealf, "fXf" , "Fnc" ) |
438 | BUILTIN(__builtin_creall, "LdXLd" , "Fnc" ) |
439 | BUILTIN(__builtin_csin, "XdXd" , "Fne" ) |
440 | BUILTIN(__builtin_csinf, "XfXf" , "Fne" ) |
441 | BUILTIN(__builtin_csinl, "XLdXLd" , "Fne" ) |
442 | BUILTIN(__builtin_csinh, "XdXd" , "Fne" ) |
443 | BUILTIN(__builtin_csinhf, "XfXf" , "Fne" ) |
444 | BUILTIN(__builtin_csinhl, "XLdXLd" , "Fne" ) |
445 | BUILTIN(__builtin_csqrt, "XdXd" , "Fne" ) |
446 | BUILTIN(__builtin_csqrtf, "XfXf" , "Fne" ) |
447 | BUILTIN(__builtin_csqrtl, "XLdXLd" , "Fne" ) |
448 | BUILTIN(__builtin_ctan, "XdXd" , "Fne" ) |
449 | BUILTIN(__builtin_ctanf, "XfXf" , "Fne" ) |
450 | BUILTIN(__builtin_ctanl, "XLdXLd" , "Fne" ) |
451 | BUILTIN(__builtin_ctanh, "XdXd" , "Fne" ) |
452 | BUILTIN(__builtin_ctanhf, "XfXf" , "Fne" ) |
453 | BUILTIN(__builtin_ctanhl, "XLdXLd" , "Fne" ) |
454 | |
455 | // GCC-compatible C99 CMPLX implementation. |
456 | BUILTIN(__builtin_complex, "v." , "nct" ) |
457 | |
458 | // FP Comparisons. |
459 | BUILTIN(__builtin_isgreater , "i." , "Fnct" ) |
460 | BUILTIN(__builtin_isgreaterequal, "i." , "Fnct" ) |
461 | BUILTIN(__builtin_isless , "i." , "Fnct" ) |
462 | BUILTIN(__builtin_islessequal , "i." , "Fnct" ) |
463 | BUILTIN(__builtin_islessgreater , "i." , "Fnct" ) |
464 | BUILTIN(__builtin_isunordered , "i." , "Fnct" ) |
465 | |
466 | // Unary FP classification |
467 | BUILTIN(__builtin_fpclassify, "iiiiii." , "Fnct" ) |
468 | BUILTIN(__builtin_isfinite, "i." , "Fnct" ) |
469 | BUILTIN(__builtin_isinf, "i." , "Fnct" ) |
470 | BUILTIN(__builtin_isinf_sign, "i." , "Fnct" ) |
471 | BUILTIN(__builtin_isnan, "i." , "Fnct" ) |
472 | BUILTIN(__builtin_isnormal, "i." , "Fnct" ) |
473 | |
474 | // FP signbit builtins |
475 | BUILTIN(__builtin_signbit, "i." , "Fnct" ) |
476 | BUILTIN(__builtin_signbitf, "if" , "Fnc" ) |
477 | BUILTIN(__builtin_signbitl, "iLd" , "Fnc" ) |
478 | |
479 | // Special FP builtins. |
480 | BUILTIN(__builtin_canonicalize, "dd" , "nc" ) |
481 | BUILTIN(__builtin_canonicalizef, "ff" , "nc" ) |
482 | BUILTIN(__builtin_canonicalizef16, "hh" , "nc" ) |
483 | BUILTIN(__builtin_canonicalizel, "LdLd" , "nc" ) |
484 | |
485 | // Builtins for arithmetic. |
486 | BUILTIN(__builtin_clzs , "iUs" , "nc" ) |
487 | BUILTIN(__builtin_clz , "iUi" , "nc" ) |
488 | BUILTIN(__builtin_clzl , "iULi" , "nc" ) |
489 | BUILTIN(__builtin_clzll, "iULLi" , "nc" ) |
490 | // TODO: int clzimax(uintmax_t) |
491 | BUILTIN(__builtin_ctzs , "iUs" , "nc" ) |
492 | BUILTIN(__builtin_ctz , "iUi" , "nc" ) |
493 | BUILTIN(__builtin_ctzl , "iULi" , "nc" ) |
494 | BUILTIN(__builtin_ctzll, "iULLi" , "nc" ) |
495 | // TODO: int ctzimax(uintmax_t) |
496 | BUILTIN(__builtin_ffs , "ii" , "Fnc" ) |
497 | BUILTIN(__builtin_ffsl , "iLi" , "Fnc" ) |
498 | BUILTIN(__builtin_ffsll, "iLLi" , "Fnc" ) |
499 | BUILTIN(__builtin_parity , "iUi" , "nc" ) |
500 | BUILTIN(__builtin_parityl , "iULi" , "nc" ) |
501 | BUILTIN(__builtin_parityll, "iULLi" , "nc" ) |
502 | BUILTIN(__builtin_popcount , "iUi" , "nc" ) |
503 | BUILTIN(__builtin_popcountl , "iULi" , "nc" ) |
504 | BUILTIN(__builtin_popcountll, "iULLi" , "nc" ) |
505 | BUILTIN(__builtin_clrsb , "ii" , "nc" ) |
506 | BUILTIN(__builtin_clrsbl , "iLi" , "nc" ) |
507 | BUILTIN(__builtin_clrsbll, "iLLi" , "nc" ) |
508 | |
509 | // The following builtins rely on that char == 8 bits, short == 16 bits and that |
510 | // there exists native types on the target that are 32- and 64-bits wide, unless |
511 | // these conditions are fulfilled these builtins will operate on a not intended |
512 | // bitwidth. |
513 | BUILTIN(__builtin_bswap16, "UsUs" , "nc" ) |
514 | BUILTIN(__builtin_bswap32, "UZiUZi" , "nc" ) |
515 | BUILTIN(__builtin_bswap64, "UWiUWi" , "nc" ) |
516 | |
517 | BUILTIN(__builtin_bitreverse8, "UcUc" , "nc" ) |
518 | BUILTIN(__builtin_bitreverse16, "UsUs" , "nc" ) |
519 | BUILTIN(__builtin_bitreverse32, "UZiUZi" , "nc" ) |
520 | BUILTIN(__builtin_bitreverse64, "UWiUWi" , "nc" ) |
521 | |
522 | BUILTIN(__builtin_rotateleft8, "UcUcUc" , "nc" ) |
523 | BUILTIN(__builtin_rotateleft16, "UsUsUs" , "nc" ) |
524 | BUILTIN(__builtin_rotateleft32, "UZiUZiUZi" , "nc" ) |
525 | BUILTIN(__builtin_rotateleft64, "UWiUWiUWi" , "nc" ) |
526 | BUILTIN(__builtin_rotateright8, "UcUcUc" , "nc" ) |
527 | BUILTIN(__builtin_rotateright16, "UsUsUs" , "nc" ) |
528 | BUILTIN(__builtin_rotateright32, "UZiUZiUZi" , "nc" ) |
529 | BUILTIN(__builtin_rotateright64, "UWiUWiUWi" , "nc" ) |
530 | |
531 | // Random GCC builtins |
532 | BUILTIN(__builtin_calloc, "v*zz" , "nF" ) |
533 | BUILTIN(__builtin_constant_p, "i." , "nctu" ) |
534 | BUILTIN(__builtin_classify_type, "i." , "nctu" ) |
535 | BUILTIN(__builtin___CFStringMakeConstantString, "FC*cC*" , "nc" ) |
536 | BUILTIN(__builtin___NSStringMakeConstantString, "FC*cC*" , "nc" ) |
537 | BUILTIN(__builtin_va_start, "vA." , "nt" ) |
538 | BUILTIN(__builtin_va_end, "vA" , "n" ) |
539 | BUILTIN(__builtin_va_copy, "vAA" , "n" ) |
540 | BUILTIN(__builtin_stdarg_start, "vA." , "nt" ) |
541 | BUILTIN(__builtin_assume_aligned, "v*vC*z." , "nc" ) |
542 | BUILTIN(__builtin_bcmp, "ivC*vC*z" , "Fn" ) |
543 | BUILTIN(__builtin_bcopy, "vv*v*z" , "n" ) |
544 | BUILTIN(__builtin_bzero, "vv*z" , "nF" ) |
545 | BUILTIN(__builtin_fprintf, "iP*cC*." , "Fp:1:" ) |
546 | BUILTIN(__builtin_free, "vv*" , "nF" ) |
547 | BUILTIN(__builtin_malloc, "v*z" , "nF" ) |
548 | BUILTIN(__builtin_memchr, "v*vC*iz" , "nF" ) |
549 | BUILTIN(__builtin_memcmp, "ivC*vC*z" , "nF" ) |
550 | BUILTIN(__builtin_memcpy, "v*v*vC*z" , "nF" ) |
551 | BUILTIN(__builtin_memcpy_inline, "vv*vC*Iz" , "nt" ) |
552 | BUILTIN(__builtin_memmove, "v*v*vC*z" , "nF" ) |
553 | BUILTIN(__builtin_mempcpy, "v*v*vC*z" , "nF" ) |
554 | BUILTIN(__builtin_memset, "v*v*iz" , "nF" ) |
555 | BUILTIN(__builtin_printf, "icC*." , "Fp:0:" ) |
556 | BUILTIN(__builtin_stpcpy, "c*c*cC*" , "nF" ) |
557 | BUILTIN(__builtin_stpncpy, "c*c*cC*z" , "nF" ) |
558 | BUILTIN(__builtin_strcasecmp, "icC*cC*" , "nF" ) |
559 | BUILTIN(__builtin_strcat, "c*c*cC*" , "nF" ) |
560 | BUILTIN(__builtin_strchr, "c*cC*i" , "nF" ) |
561 | BUILTIN(__builtin_strcmp, "icC*cC*" , "nF" ) |
562 | BUILTIN(__builtin_strcpy, "c*c*cC*" , "nF" ) |
563 | BUILTIN(__builtin_strcspn, "zcC*cC*" , "nF" ) |
564 | BUILTIN(__builtin_strdup, "c*cC*" , "nF" ) |
565 | BUILTIN(__builtin_strlen, "zcC*" , "nF" ) |
566 | BUILTIN(__builtin_strncasecmp, "icC*cC*z" , "nF" ) |
567 | BUILTIN(__builtin_strncat, "c*c*cC*z" , "nF" ) |
568 | BUILTIN(__builtin_strncmp, "icC*cC*z" , "nF" ) |
569 | BUILTIN(__builtin_strncpy, "c*c*cC*z" , "nF" ) |
570 | BUILTIN(__builtin_strndup, "c*cC*z" , "nF" ) |
571 | BUILTIN(__builtin_strpbrk, "c*cC*cC*" , "nF" ) |
572 | BUILTIN(__builtin_strrchr, "c*cC*i" , "nF" ) |
573 | BUILTIN(__builtin_strspn, "zcC*cC*" , "nF" ) |
574 | BUILTIN(__builtin_strstr, "c*cC*cC*" , "nF" ) |
575 | BUILTIN(__builtin_wcschr, "w*wC*w" , "nF" ) |
576 | BUILTIN(__builtin_wcscmp, "iwC*wC*" , "nF" ) |
577 | BUILTIN(__builtin_wcslen, "zwC*" , "nF" ) |
578 | BUILTIN(__builtin_wcsncmp, "iwC*wC*z" , "nF" ) |
579 | BUILTIN(__builtin_wmemchr, "w*wC*wz" , "nF" ) |
580 | BUILTIN(__builtin_wmemcmp, "iwC*wC*z" , "nF" ) |
581 | BUILTIN(__builtin_wmemcpy, "w*w*wC*z" , "nF" ) |
582 | BUILTIN(__builtin_wmemmove, "w*w*wC*z" , "nF" ) |
583 | BUILTIN(__builtin_realloc, "v*v*z" , "nF" ) |
584 | BUILTIN(__builtin_return_address, "v*IUi" , "n" ) |
585 | BUILTIN(__builtin_extract_return_addr, "v*v*" , "n" ) |
586 | BUILTIN(__builtin_frame_address, "v*IUi" , "n" ) |
587 | BUILTIN(__builtin___clear_cache, "vc*c*" , "n" ) |
588 | BUILTIN(__builtin_setjmp, "iv**" , "j" ) |
589 | BUILTIN(__builtin_longjmp, "vv**i" , "r" ) |
590 | BUILTIN(__builtin_unwind_init, "v" , "" ) |
591 | BUILTIN(__builtin_eh_return_data_regno, "iIi" , "nc" ) |
592 | BUILTIN(__builtin_snprintf, "ic*zcC*." , "nFp:2:" ) |
593 | BUILTIN(__builtin_sprintf, "ic*cC*." , "nFP:1:" ) |
594 | BUILTIN(__builtin_vsnprintf, "ic*zcC*a" , "nFP:2:" ) |
595 | BUILTIN(__builtin_vsprintf, "ic*cC*a" , "nFP:1:" ) |
596 | BUILTIN(__builtin_thread_pointer, "v*" , "nc" ) |
597 | BUILTIN(__builtin_launder, "v*v*" , "nt" ) |
598 | LANGBUILTIN(__builtin_is_constant_evaluated, "b" , "n" , CXX_LANG) |
599 | |
600 | // GCC exception builtins |
601 | BUILTIN(__builtin_eh_return, "vzv*" , "r" ) // FIXME: Takes intptr_t, not size_t! |
602 | BUILTIN(__builtin_frob_return_addr, "v*v*" , "n" ) |
603 | BUILTIN(__builtin_dwarf_cfa, "v*" , "n" ) |
604 | BUILTIN(__builtin_init_dwarf_reg_size_table, "vv*" , "n" ) |
605 | BUILTIN(__builtin_dwarf_sp_column, "Ui" , "n" ) |
606 | BUILTIN(__builtin_extend_pointer, "ULLiv*" , "n" ) // _Unwind_Word == uint64_t |
607 | |
608 | // GCC Object size checking builtins |
609 | BUILTIN(__builtin_object_size, "zvC*i" , "nu" ) |
610 | BUILTIN(__builtin_dynamic_object_size, "zvC*i" , "nu" ) // Clang only. |
611 | BUILTIN(__builtin___memcpy_chk, "v*v*vC*zz" , "nF" ) |
612 | BUILTIN(__builtin___memccpy_chk, "v*v*vC*izz" , "nF" ) |
613 | BUILTIN(__builtin___memmove_chk, "v*v*vC*zz" , "nF" ) |
614 | BUILTIN(__builtin___mempcpy_chk, "v*v*vC*zz" , "nF" ) |
615 | BUILTIN(__builtin___memset_chk, "v*v*izz" , "nF" ) |
616 | BUILTIN(__builtin___stpcpy_chk, "c*c*cC*z" , "nF" ) |
617 | BUILTIN(__builtin___strcat_chk, "c*c*cC*z" , "nF" ) |
618 | BUILTIN(__builtin___strcpy_chk, "c*c*cC*z" , "nF" ) |
619 | BUILTIN(__builtin___strlcat_chk, "zc*cC*zz" , "nF" ) |
620 | BUILTIN(__builtin___strlcpy_chk, "zc*cC*zz" , "nF" ) |
621 | BUILTIN(__builtin___strncat_chk, "c*c*cC*zz" , "nF" ) |
622 | BUILTIN(__builtin___strncpy_chk, "c*c*cC*zz" , "nF" ) |
623 | BUILTIN(__builtin___stpncpy_chk, "c*c*cC*zz" , "nF" ) |
624 | BUILTIN(__builtin___snprintf_chk, "ic*zizcC*." , "Fp:4:" ) |
625 | BUILTIN(__builtin___sprintf_chk, "ic*izcC*." , "Fp:3:" ) |
626 | BUILTIN(__builtin___vsnprintf_chk, "ic*zizcC*a" , "FP:4:" ) |
627 | BUILTIN(__builtin___vsprintf_chk, "ic*izcC*a" , "FP:3:" ) |
628 | BUILTIN(__builtin___fprintf_chk, "iP*icC*." , "Fp:2:" ) |
629 | BUILTIN(__builtin___printf_chk, "iicC*." , "Fp:1:" ) |
630 | BUILTIN(__builtin___vfprintf_chk, "iP*icC*a" , "FP:2:" ) |
631 | BUILTIN(__builtin___vprintf_chk, "iicC*a" , "FP:1:" ) |
632 | |
633 | BUILTIN(__builtin_unpredictable, "LiLi" , "nc" ) |
634 | BUILTIN(__builtin_expect, "LiLiLi" , "nc" ) |
635 | BUILTIN(__builtin_expect_with_probability, "LiLiLid" , "nc" ) |
636 | BUILTIN(__builtin_prefetch, "vvC*." , "nc" ) |
637 | BUILTIN(__builtin_readcyclecounter, "ULLi" , "n" ) |
638 | BUILTIN(__builtin_trap, "v" , "nr" ) |
639 | BUILTIN(__builtin_debugtrap, "v" , "n" ) |
640 | BUILTIN(__builtin_unreachable, "v" , "nr" ) |
641 | BUILTIN(__builtin_shufflevector, "v." , "nct" ) |
642 | BUILTIN(__builtin_convertvector, "v." , "nct" ) |
643 | BUILTIN(__builtin_alloca, "v*z" , "Fn" ) |
644 | BUILTIN(__builtin_alloca_with_align, "v*zIz" , "Fn" ) |
645 | BUILTIN(__builtin_call_with_static_chain, "v." , "nt" ) |
646 | |
647 | BUILTIN(__builtin_matrix_transpose, "v." , "nFt" ) |
648 | BUILTIN(__builtin_matrix_column_major_load, "v." , "nFt" ) |
649 | BUILTIN(__builtin_matrix_column_major_store, "v." , "nFt" ) |
650 | |
651 | // "Overloaded" Atomic operator builtins. These are overloaded to support data |
652 | // types of i8, i16, i32, i64, and i128. The front-end sees calls to the |
653 | // non-suffixed version of these (which has a bogus type) and transforms them to |
654 | // the right overloaded version in Sema (plus casts). |
655 | |
656 | // FIXME: These assume that char -> i8, short -> i16, int -> i32, |
657 | // long long -> i64. |
658 | |
659 | BUILTIN(__sync_fetch_and_add, "v." , "t" ) |
660 | BUILTIN(__sync_fetch_and_add_1, "ccD*c." , "nt" ) |
661 | BUILTIN(__sync_fetch_and_add_2, "ssD*s." , "nt" ) |
662 | BUILTIN(__sync_fetch_and_add_4, "iiD*i." , "nt" ) |
663 | BUILTIN(__sync_fetch_and_add_8, "LLiLLiD*LLi." , "nt" ) |
664 | BUILTIN(__sync_fetch_and_add_16, "LLLiLLLiD*LLLi." , "nt" ) |
665 | |
666 | BUILTIN(__sync_fetch_and_sub, "v." , "t" ) |
667 | BUILTIN(__sync_fetch_and_sub_1, "ccD*c." , "nt" ) |
668 | BUILTIN(__sync_fetch_and_sub_2, "ssD*s." , "nt" ) |
669 | BUILTIN(__sync_fetch_and_sub_4, "iiD*i." , "nt" ) |
670 | BUILTIN(__sync_fetch_and_sub_8, "LLiLLiD*LLi." , "nt" ) |
671 | BUILTIN(__sync_fetch_and_sub_16, "LLLiLLLiD*LLLi." , "nt" ) |
672 | |
673 | BUILTIN(__sync_fetch_and_or, "v." , "t" ) |
674 | BUILTIN(__sync_fetch_and_or_1, "ccD*c." , "nt" ) |
675 | BUILTIN(__sync_fetch_and_or_2, "ssD*s." , "nt" ) |
676 | BUILTIN(__sync_fetch_and_or_4, "iiD*i." , "nt" ) |
677 | BUILTIN(__sync_fetch_and_or_8, "LLiLLiD*LLi." , "nt" ) |
678 | BUILTIN(__sync_fetch_and_or_16, "LLLiLLLiD*LLLi." , "nt" ) |
679 | |
680 | BUILTIN(__sync_fetch_and_and, "v." , "t" ) |
681 | BUILTIN(__sync_fetch_and_and_1, "ccD*c." , "tn" ) |
682 | BUILTIN(__sync_fetch_and_and_2, "ssD*s." , "tn" ) |
683 | BUILTIN(__sync_fetch_and_and_4, "iiD*i." , "tn" ) |
684 | BUILTIN(__sync_fetch_and_and_8, "LLiLLiD*LLi." , "tn" ) |
685 | BUILTIN(__sync_fetch_and_and_16, "LLLiLLLiD*LLLi." , "tn" ) |
686 | |
687 | BUILTIN(__sync_fetch_and_xor, "v." , "t" ) |
688 | BUILTIN(__sync_fetch_and_xor_1, "ccD*c." , "tn" ) |
689 | BUILTIN(__sync_fetch_and_xor_2, "ssD*s." , "tn" ) |
690 | BUILTIN(__sync_fetch_and_xor_4, "iiD*i." , "tn" ) |
691 | BUILTIN(__sync_fetch_and_xor_8, "LLiLLiD*LLi." , "tn" ) |
692 | BUILTIN(__sync_fetch_and_xor_16, "LLLiLLLiD*LLLi." , "tn" ) |
693 | |
694 | BUILTIN(__sync_fetch_and_nand, "v." , "t" ) |
695 | BUILTIN(__sync_fetch_and_nand_1, "ccD*c." , "tn" ) |
696 | BUILTIN(__sync_fetch_and_nand_2, "ssD*s." , "tn" ) |
697 | BUILTIN(__sync_fetch_and_nand_4, "iiD*i." , "tn" ) |
698 | BUILTIN(__sync_fetch_and_nand_8, "LLiLLiD*LLi." , "tn" ) |
699 | BUILTIN(__sync_fetch_and_nand_16, "LLLiLLLiD*LLLi." , "tn" ) |
700 | |
701 | BUILTIN(__sync_add_and_fetch, "v." , "t" ) |
702 | BUILTIN(__sync_add_and_fetch_1, "ccD*c." , "tn" ) |
703 | BUILTIN(__sync_add_and_fetch_2, "ssD*s." , "tn" ) |
704 | BUILTIN(__sync_add_and_fetch_4, "iiD*i." , "tn" ) |
705 | BUILTIN(__sync_add_and_fetch_8, "LLiLLiD*LLi." , "tn" ) |
706 | BUILTIN(__sync_add_and_fetch_16, "LLLiLLLiD*LLLi." , "tn" ) |
707 | |
708 | BUILTIN(__sync_sub_and_fetch, "v." , "t" ) |
709 | BUILTIN(__sync_sub_and_fetch_1, "ccD*c." , "tn" ) |
710 | BUILTIN(__sync_sub_and_fetch_2, "ssD*s." , "tn" ) |
711 | BUILTIN(__sync_sub_and_fetch_4, "iiD*i." , "tn" ) |
712 | BUILTIN(__sync_sub_and_fetch_8, "LLiLLiD*LLi." , "tn" ) |
713 | BUILTIN(__sync_sub_and_fetch_16, "LLLiLLLiD*LLLi." , "tn" ) |
714 | |
715 | BUILTIN(__sync_or_and_fetch, "v." , "t" ) |
716 | BUILTIN(__sync_or_and_fetch_1, "ccD*c." , "tn" ) |
717 | BUILTIN(__sync_or_and_fetch_2, "ssD*s." , "tn" ) |
718 | BUILTIN(__sync_or_and_fetch_4, "iiD*i." , "tn" ) |
719 | BUILTIN(__sync_or_and_fetch_8, "LLiLLiD*LLi." , "tn" ) |
720 | BUILTIN(__sync_or_and_fetch_16, "LLLiLLLiD*LLLi." , "tn" ) |
721 | |
722 | BUILTIN(__sync_and_and_fetch, "v." , "t" ) |
723 | BUILTIN(__sync_and_and_fetch_1, "ccD*c." , "tn" ) |
724 | BUILTIN(__sync_and_and_fetch_2, "ssD*s." , "tn" ) |
725 | BUILTIN(__sync_and_and_fetch_4, "iiD*i." , "tn" ) |
726 | BUILTIN(__sync_and_and_fetch_8, "LLiLLiD*LLi." , "tn" ) |
727 | BUILTIN(__sync_and_and_fetch_16, "LLLiLLLiD*LLLi." , "tn" ) |
728 | |
729 | BUILTIN(__sync_xor_and_fetch, "v." , "t" ) |
730 | BUILTIN(__sync_xor_and_fetch_1, "ccD*c." , "tn" ) |
731 | BUILTIN(__sync_xor_and_fetch_2, "ssD*s." , "tn" ) |
732 | BUILTIN(__sync_xor_and_fetch_4, "iiD*i." , "tn" ) |
733 | BUILTIN(__sync_xor_and_fetch_8, "LLiLLiD*LLi." , "tn" ) |
734 | BUILTIN(__sync_xor_and_fetch_16, "LLLiLLLiD*LLLi." , "tn" ) |
735 | |
736 | BUILTIN(__sync_nand_and_fetch, "v." , "t" ) |
737 | BUILTIN(__sync_nand_and_fetch_1, "ccD*c." , "tn" ) |
738 | BUILTIN(__sync_nand_and_fetch_2, "ssD*s." , "tn" ) |
739 | BUILTIN(__sync_nand_and_fetch_4, "iiD*i." , "tn" ) |
740 | BUILTIN(__sync_nand_and_fetch_8, "LLiLLiD*LLi." , "tn" ) |
741 | BUILTIN(__sync_nand_and_fetch_16, "LLLiLLLiD*LLLi." , "tn" ) |
742 | |
743 | BUILTIN(__sync_bool_compare_and_swap, "v." , "t" ) |
744 | BUILTIN(__sync_bool_compare_and_swap_1, "bcD*cc." , "tn" ) |
745 | BUILTIN(__sync_bool_compare_and_swap_2, "bsD*ss." , "tn" ) |
746 | BUILTIN(__sync_bool_compare_and_swap_4, "biD*ii." , "tn" ) |
747 | BUILTIN(__sync_bool_compare_and_swap_8, "bLLiD*LLiLLi." , "tn" ) |
748 | BUILTIN(__sync_bool_compare_and_swap_16, "bLLLiD*LLLiLLLi." , "tn" ) |
749 | |
750 | BUILTIN(__sync_val_compare_and_swap, "v." , "t" ) |
751 | BUILTIN(__sync_val_compare_and_swap_1, "ccD*cc." , "tn" ) |
752 | BUILTIN(__sync_val_compare_and_swap_2, "ssD*ss." , "tn" ) |
753 | BUILTIN(__sync_val_compare_and_swap_4, "iiD*ii." , "tn" ) |
754 | BUILTIN(__sync_val_compare_and_swap_8, "LLiLLiD*LLiLLi." , "tn" ) |
755 | BUILTIN(__sync_val_compare_and_swap_16, "LLLiLLLiD*LLLiLLLi." , "tn" ) |
756 | |
757 | BUILTIN(__sync_lock_test_and_set, "v." , "t" ) |
758 | BUILTIN(__sync_lock_test_and_set_1, "ccD*c." , "tn" ) |
759 | BUILTIN(__sync_lock_test_and_set_2, "ssD*s." , "tn" ) |
760 | BUILTIN(__sync_lock_test_and_set_4, "iiD*i." , "tn" ) |
761 | BUILTIN(__sync_lock_test_and_set_8, "LLiLLiD*LLi." , "tn" ) |
762 | BUILTIN(__sync_lock_test_and_set_16, "LLLiLLLiD*LLLi." , "tn" ) |
763 | |
764 | BUILTIN(__sync_lock_release, "v." , "t" ) |
765 | BUILTIN(__sync_lock_release_1, "vcD*." , "tn" ) |
766 | BUILTIN(__sync_lock_release_2, "vsD*." , "tn" ) |
767 | BUILTIN(__sync_lock_release_4, "viD*." , "tn" ) |
768 | BUILTIN(__sync_lock_release_8, "vLLiD*." , "tn" ) |
769 | BUILTIN(__sync_lock_release_16, "vLLLiD*." , "tn" ) |
770 | |
771 | BUILTIN(__sync_swap, "v." , "t" ) |
772 | BUILTIN(__sync_swap_1, "ccD*c." , "tn" ) |
773 | BUILTIN(__sync_swap_2, "ssD*s." , "tn" ) |
774 | BUILTIN(__sync_swap_4, "iiD*i." , "tn" ) |
775 | BUILTIN(__sync_swap_8, "LLiLLiD*LLi." , "tn" ) |
776 | BUILTIN(__sync_swap_16, "LLLiLLLiD*LLLi." , "tn" ) |
777 | |
778 | // Some of our atomics builtins are handled by AtomicExpr rather than |
779 | // as normal builtin CallExprs. This macro is used for such builtins. |
780 | #ifndef ATOMIC_BUILTIN |
781 | #define ATOMIC_BUILTIN(ID, TYPE, ATTRS) BUILTIN(ID, TYPE, ATTRS) |
782 | #endif |
783 | |
784 | // C11 _Atomic operations for <stdatomic.h>. |
785 | ATOMIC_BUILTIN(__c11_atomic_init, "v." , "t" ) |
786 | ATOMIC_BUILTIN(__c11_atomic_load, "v." , "t" ) |
787 | ATOMIC_BUILTIN(__c11_atomic_store, "v." , "t" ) |
788 | ATOMIC_BUILTIN(__c11_atomic_exchange, "v." , "t" ) |
789 | ATOMIC_BUILTIN(__c11_atomic_compare_exchange_strong, "v." , "t" ) |
790 | ATOMIC_BUILTIN(__c11_atomic_compare_exchange_weak, "v." , "t" ) |
791 | ATOMIC_BUILTIN(__c11_atomic_fetch_add, "v." , "t" ) |
792 | ATOMIC_BUILTIN(__c11_atomic_fetch_sub, "v." , "t" ) |
793 | ATOMIC_BUILTIN(__c11_atomic_fetch_and, "v." , "t" ) |
794 | ATOMIC_BUILTIN(__c11_atomic_fetch_or, "v." , "t" ) |
795 | ATOMIC_BUILTIN(__c11_atomic_fetch_xor, "v." , "t" ) |
796 | ATOMIC_BUILTIN(__c11_atomic_fetch_max, "v." , "t" ) |
797 | ATOMIC_BUILTIN(__c11_atomic_fetch_min, "v." , "t" ) |
798 | BUILTIN(__c11_atomic_thread_fence, "vi" , "n" ) |
799 | BUILTIN(__c11_atomic_signal_fence, "vi" , "n" ) |
800 | BUILTIN(__c11_atomic_is_lock_free, "bz" , "n" ) |
801 | |
802 | // GNU atomic builtins. |
803 | ATOMIC_BUILTIN(__atomic_load, "v." , "t" ) |
804 | ATOMIC_BUILTIN(__atomic_load_n, "v." , "t" ) |
805 | ATOMIC_BUILTIN(__atomic_store, "v." , "t" ) |
806 | ATOMIC_BUILTIN(__atomic_store_n, "v." , "t" ) |
807 | ATOMIC_BUILTIN(__atomic_exchange, "v." , "t" ) |
808 | ATOMIC_BUILTIN(__atomic_exchange_n, "v." , "t" ) |
809 | ATOMIC_BUILTIN(__atomic_compare_exchange, "v." , "t" ) |
810 | ATOMIC_BUILTIN(__atomic_compare_exchange_n, "v." , "t" ) |
811 | ATOMIC_BUILTIN(__atomic_fetch_add, "v." , "t" ) |
812 | ATOMIC_BUILTIN(__atomic_fetch_sub, "v." , "t" ) |
813 | ATOMIC_BUILTIN(__atomic_fetch_and, "v." , "t" ) |
814 | ATOMIC_BUILTIN(__atomic_fetch_or, "v." , "t" ) |
815 | ATOMIC_BUILTIN(__atomic_fetch_xor, "v." , "t" ) |
816 | ATOMIC_BUILTIN(__atomic_fetch_nand, "v." , "t" ) |
817 | ATOMIC_BUILTIN(__atomic_add_fetch, "v." , "t" ) |
818 | ATOMIC_BUILTIN(__atomic_sub_fetch, "v." , "t" ) |
819 | ATOMIC_BUILTIN(__atomic_and_fetch, "v." , "t" ) |
820 | ATOMIC_BUILTIN(__atomic_or_fetch, "v." , "t" ) |
821 | ATOMIC_BUILTIN(__atomic_xor_fetch, "v." , "t" ) |
822 | ATOMIC_BUILTIN(__atomic_max_fetch, "v." , "t" ) |
823 | ATOMIC_BUILTIN(__atomic_min_fetch, "v." , "t" ) |
824 | ATOMIC_BUILTIN(__atomic_nand_fetch, "v." , "t" ) |
825 | BUILTIN(__atomic_test_and_set, "bvD*i" , "n" ) |
826 | BUILTIN(__atomic_clear, "vvD*i" , "n" ) |
827 | BUILTIN(__atomic_thread_fence, "vi" , "n" ) |
828 | BUILTIN(__atomic_signal_fence, "vi" , "n" ) |
829 | BUILTIN(__atomic_always_lock_free, "bzvCD*" , "n" ) |
830 | BUILTIN(__atomic_is_lock_free, "bzvCD*" , "n" ) |
831 | |
832 | // OpenCL 2.0 atomic builtins. |
833 | ATOMIC_BUILTIN(__opencl_atomic_init, "v." , "t" ) |
834 | ATOMIC_BUILTIN(__opencl_atomic_load, "v." , "t" ) |
835 | ATOMIC_BUILTIN(__opencl_atomic_store, "v." , "t" ) |
836 | ATOMIC_BUILTIN(__opencl_atomic_exchange, "v." , "t" ) |
837 | ATOMIC_BUILTIN(__opencl_atomic_compare_exchange_strong, "v." , "t" ) |
838 | ATOMIC_BUILTIN(__opencl_atomic_compare_exchange_weak, "v." , "t" ) |
839 | ATOMIC_BUILTIN(__opencl_atomic_fetch_add, "v." , "t" ) |
840 | ATOMIC_BUILTIN(__opencl_atomic_fetch_sub, "v." , "t" ) |
841 | ATOMIC_BUILTIN(__opencl_atomic_fetch_and, "v." , "t" ) |
842 | ATOMIC_BUILTIN(__opencl_atomic_fetch_or, "v." , "t" ) |
843 | ATOMIC_BUILTIN(__opencl_atomic_fetch_xor, "v." , "t" ) |
844 | ATOMIC_BUILTIN(__opencl_atomic_fetch_min, "v." , "t" ) |
845 | ATOMIC_BUILTIN(__opencl_atomic_fetch_max, "v." , "t" ) |
846 | |
847 | // GCC does not support these, they are a Clang extension. |
848 | ATOMIC_BUILTIN(__atomic_fetch_min, "v." , "t" ) |
849 | ATOMIC_BUILTIN(__atomic_fetch_max, "v." , "t" ) |
850 | |
851 | #undef ATOMIC_BUILTIN |
852 | |
853 | // Non-overloaded atomic builtins. |
854 | BUILTIN(__sync_synchronize, "v" , "n" ) |
855 | // GCC does not support these, they are a Clang extension. |
856 | BUILTIN(__sync_fetch_and_min, "iiD*i" , "n" ) |
857 | BUILTIN(__sync_fetch_and_max, "iiD*i" , "n" ) |
858 | BUILTIN(__sync_fetch_and_umin, "UiUiD*Ui" , "n" ) |
859 | BUILTIN(__sync_fetch_and_umax, "UiUiD*Ui" , "n" ) |
860 | |
861 | // Random libc builtins. |
862 | BUILTIN(__builtin_abort, "v" , "Fnr" ) |
863 | BUILTIN(__builtin_index, "c*cC*i" , "Fn" ) |
864 | BUILTIN(__builtin_rindex, "c*cC*i" , "Fn" ) |
865 | |
866 | // ignored glibc builtin, see https://sourceware.org/bugzilla/show_bug.cgi?id=25399 |
867 | BUILTIN(__warn_memset_zero_len, "v" , "nU" ) |
868 | |
869 | // Microsoft builtins. These are only active with -fms-extensions. |
870 | LANGBUILTIN(_alloca, "v*z" , "n" , ALL_MS_LANGUAGES) |
871 | LANGBUILTIN(__annotation, "wC*." ,"n" , ALL_MS_LANGUAGES) |
872 | LANGBUILTIN(__assume, "vb" , "n" , ALL_MS_LANGUAGES) |
873 | LANGBUILTIN(_bittest, "UcNiC*Ni" , "n" , ALL_MS_LANGUAGES) |
874 | LANGBUILTIN(_bittestandcomplement, "UcNi*Ni" , "n" , ALL_MS_LANGUAGES) |
875 | LANGBUILTIN(_bittestandreset, "UcNi*Ni" , "n" , ALL_MS_LANGUAGES) |
876 | LANGBUILTIN(_bittestandset, "UcNi*Ni" , "n" , ALL_MS_LANGUAGES) |
877 | LANGBUILTIN(_bittest64, "UcWiC*Wi" , "n" , ALL_MS_LANGUAGES) |
878 | LANGBUILTIN(_bittestandcomplement64, "UcWi*Wi" , "n" , ALL_MS_LANGUAGES) |
879 | LANGBUILTIN(_bittestandreset64, "UcWi*Wi" , "n" , ALL_MS_LANGUAGES) |
880 | LANGBUILTIN(_bittestandset64, "UcWi*Wi" , "n" , ALL_MS_LANGUAGES) |
881 | LIBBUILTIN(_byteswap_ushort, "UsUs" , "fnc" , "stdlib.h" , ALL_MS_LANGUAGES) |
882 | LIBBUILTIN(_byteswap_ulong, "UNiUNi" , "fnc" , "stdlib.h" , ALL_MS_LANGUAGES) |
883 | LIBBUILTIN(_byteswap_uint64, "ULLiULLi" , "fnc" , "stdlib.h" , ALL_MS_LANGUAGES) |
884 | LANGBUILTIN(__debugbreak, "v" , "n" , ALL_MS_LANGUAGES) |
885 | LANGBUILTIN(__exception_code, "UNi" , "n" , ALL_MS_LANGUAGES) |
886 | LANGBUILTIN(_exception_code, "UNi" , "n" , ALL_MS_LANGUAGES) |
887 | LANGBUILTIN(__exception_info, "v*" , "n" , ALL_MS_LANGUAGES) |
888 | LANGBUILTIN(_exception_info, "v*" , "n" , ALL_MS_LANGUAGES) |
889 | LANGBUILTIN(__abnormal_termination, "i" , "n" , ALL_MS_LANGUAGES) |
890 | LANGBUILTIN(_abnormal_termination, "i" , "n" , ALL_MS_LANGUAGES) |
891 | LANGBUILTIN(__GetExceptionInfo, "v*." , "ntu" , ALL_MS_LANGUAGES) |
892 | LANGBUILTIN(_InterlockedAnd8, "ccD*c" , "n" , ALL_MS_LANGUAGES) |
893 | LANGBUILTIN(_InterlockedAnd16, "ssD*s" , "n" , ALL_MS_LANGUAGES) |
894 | LANGBUILTIN(_InterlockedAnd, "NiNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
895 | LANGBUILTIN(_InterlockedCompareExchange8, "ccD*cc" , "n" , ALL_MS_LANGUAGES) |
896 | LANGBUILTIN(_InterlockedCompareExchange16, "ssD*ss" , "n" , ALL_MS_LANGUAGES) |
897 | LANGBUILTIN(_InterlockedCompareExchange, "NiNiD*NiNi" , "n" , ALL_MS_LANGUAGES) |
898 | LANGBUILTIN(_InterlockedCompareExchange64, "LLiLLiD*LLiLLi" , "n" , ALL_MS_LANGUAGES) |
899 | LANGBUILTIN(_InterlockedCompareExchangePointer, "v*v*D*v*v*" , "n" , ALL_MS_LANGUAGES) |
900 | LANGBUILTIN(_InterlockedCompareExchangePointer_nf, "v*v*D*v*v*" , "n" , ALL_MS_LANGUAGES) |
901 | LANGBUILTIN(_InterlockedDecrement16, "ssD*" , "n" , ALL_MS_LANGUAGES) |
902 | LANGBUILTIN(_InterlockedDecrement, "NiNiD*" , "n" , ALL_MS_LANGUAGES) |
903 | LANGBUILTIN(_InterlockedExchange, "NiNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
904 | LANGBUILTIN(_InterlockedExchange8, "ccD*c" , "n" , ALL_MS_LANGUAGES) |
905 | LANGBUILTIN(_InterlockedExchange16, "ssD*s" , "n" , ALL_MS_LANGUAGES) |
906 | LANGBUILTIN(_InterlockedExchangeAdd8, "ccD*c" , "n" , ALL_MS_LANGUAGES) |
907 | LANGBUILTIN(_InterlockedExchangeAdd16, "ssD*s" , "n" , ALL_MS_LANGUAGES) |
908 | LANGBUILTIN(_InterlockedExchangeAdd, "NiNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
909 | LANGBUILTIN(_InterlockedExchangePointer, "v*v*D*v*" , "n" , ALL_MS_LANGUAGES) |
910 | LANGBUILTIN(_InterlockedExchangeSub8, "ccD*c" , "n" , ALL_MS_LANGUAGES) |
911 | LANGBUILTIN(_InterlockedExchangeSub16, "ssD*s" , "n" , ALL_MS_LANGUAGES) |
912 | LANGBUILTIN(_InterlockedExchangeSub, "NiNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
913 | LANGBUILTIN(_InterlockedIncrement16, "ssD*" , "n" , ALL_MS_LANGUAGES) |
914 | LANGBUILTIN(_InterlockedIncrement, "NiNiD*" , "n" , ALL_MS_LANGUAGES) |
915 | LANGBUILTIN(_InterlockedOr8, "ccD*c" , "n" , ALL_MS_LANGUAGES) |
916 | LANGBUILTIN(_InterlockedOr16, "ssD*s" , "n" , ALL_MS_LANGUAGES) |
917 | LANGBUILTIN(_InterlockedOr, "NiNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
918 | LANGBUILTIN(_InterlockedXor8, "ccD*c" , "n" , ALL_MS_LANGUAGES) |
919 | LANGBUILTIN(_InterlockedXor16, "ssD*s" , "n" , ALL_MS_LANGUAGES) |
920 | LANGBUILTIN(_InterlockedXor, "NiNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
921 | LANGBUILTIN(_interlockedbittestandreset, "UcNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
922 | LANGBUILTIN(_interlockedbittestandreset64, "UcWiD*Wi" , "n" , ALL_MS_LANGUAGES) |
923 | LANGBUILTIN(_interlockedbittestandreset_acq, "UcNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
924 | LANGBUILTIN(_interlockedbittestandreset_nf, "UcNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
925 | LANGBUILTIN(_interlockedbittestandreset_rel, "UcNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
926 | LANGBUILTIN(_interlockedbittestandset, "UcNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
927 | LANGBUILTIN(_interlockedbittestandset64, "UcWiD*Wi" , "n" , ALL_MS_LANGUAGES) |
928 | LANGBUILTIN(_interlockedbittestandset_acq, "UcNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
929 | LANGBUILTIN(_interlockedbittestandset_nf, "UcNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
930 | LANGBUILTIN(_interlockedbittestandset_rel, "UcNiD*Ni" , "n" , ALL_MS_LANGUAGES) |
931 | LANGBUILTIN(__iso_volatile_load8, "ccCD*" , "n" , ALL_MS_LANGUAGES) |
932 | LANGBUILTIN(__iso_volatile_load16, "ssCD*" , "n" , ALL_MS_LANGUAGES) |
933 | LANGBUILTIN(__iso_volatile_load32, "iiCD*" , "n" , ALL_MS_LANGUAGES) |
934 | LANGBUILTIN(__iso_volatile_load64, "LLiLLiCD*" , "n" , ALL_MS_LANGUAGES) |
935 | LANGBUILTIN(__iso_volatile_store8, "vcD*c" , "n" , ALL_MS_LANGUAGES) |
936 | LANGBUILTIN(__iso_volatile_store16, "vsD*s" , "n" , ALL_MS_LANGUAGES) |
937 | LANGBUILTIN(__iso_volatile_store32, "viD*i" , "n" , ALL_MS_LANGUAGES) |
938 | LANGBUILTIN(__iso_volatile_store64, "vLLiD*LLi" , "n" , ALL_MS_LANGUAGES) |
939 | LANGBUILTIN(__noop, "i." , "n" , ALL_MS_LANGUAGES) |
940 | LANGBUILTIN(__lzcnt16, "UsUs" , "nc" , ALL_MS_LANGUAGES) |
941 | LANGBUILTIN(__lzcnt, "UiUi" , "nc" , ALL_MS_LANGUAGES) |
942 | LANGBUILTIN(__lzcnt64, "UWiUWi" , "nc" , ALL_MS_LANGUAGES) |
943 | LANGBUILTIN(__popcnt16, "UsUs" , "nc" , ALL_MS_LANGUAGES) |
944 | LANGBUILTIN(__popcnt, "UiUi" , "nc" , ALL_MS_LANGUAGES) |
945 | LANGBUILTIN(__popcnt64, "UWiUWi" , "nc" , ALL_MS_LANGUAGES) |
946 | LANGBUILTIN(_ReturnAddress, "v*" , "n" , ALL_MS_LANGUAGES) |
947 | LANGBUILTIN(_rotl8, "UcUcUc" , "n" , ALL_MS_LANGUAGES) |
948 | LANGBUILTIN(_rotl16, "UsUsUc" , "n" , ALL_MS_LANGUAGES) |
949 | LANGBUILTIN(_rotl, "UiUii" , "n" , ALL_MS_LANGUAGES) |
950 | LANGBUILTIN(_lrotl, "ULiULii" , "n" , ALL_MS_LANGUAGES) |
951 | LANGBUILTIN(_rotl64, "UWiUWii" , "n" , ALL_MS_LANGUAGES) |
952 | LANGBUILTIN(_rotr8, "UcUcUc" , "n" , ALL_MS_LANGUAGES) |
953 | LANGBUILTIN(_rotr16, "UsUsUc" , "n" , ALL_MS_LANGUAGES) |
954 | LANGBUILTIN(_rotr, "UiUii" , "n" , ALL_MS_LANGUAGES) |
955 | LANGBUILTIN(_lrotr, "ULiULii" , "n" , ALL_MS_LANGUAGES) |
956 | LANGBUILTIN(_rotr64, "UWiUWii" , "n" , ALL_MS_LANGUAGES) |
957 | LANGBUILTIN(__va_start, "vc**." , "nt" , ALL_MS_LANGUAGES) |
958 | LANGBUILTIN(__fastfail, "vUi" , "nr" , ALL_MS_LANGUAGES) |
959 | |
960 | // Microsoft library builtins. |
961 | LIBBUILTIN(_setjmpex, "iJ" , "fjT" , "setjmpex.h" , ALL_MS_LANGUAGES) |
962 | |
963 | // C99 library functions |
964 | // C99 stdarg.h |
965 | LIBBUILTIN(va_start, "vA." , "fn" , "stdarg.h" , ALL_LANGUAGES) |
966 | LIBBUILTIN(va_end, "vA" , "fn" , "stdarg.h" , ALL_LANGUAGES) |
967 | LIBBUILTIN(va_copy, "vAA" , "fn" , "stdarg.h" , ALL_LANGUAGES) |
968 | // C99 stdlib.h |
969 | LIBBUILTIN(abort, "v" , "fr" , "stdlib.h" , ALL_LANGUAGES) |
970 | LIBBUILTIN(calloc, "v*zz" , "f" , "stdlib.h" , ALL_LANGUAGES) |
971 | LIBBUILTIN(exit, "vi" , "fr" , "stdlib.h" , ALL_LANGUAGES) |
972 | LIBBUILTIN(_Exit, "vi" , "fr" , "stdlib.h" , ALL_LANGUAGES) |
973 | LIBBUILTIN(malloc, "v*z" , "f" , "stdlib.h" , ALL_LANGUAGES) |
974 | LIBBUILTIN(realloc, "v*v*z" , "f" , "stdlib.h" , ALL_LANGUAGES) |
975 | LIBBUILTIN(free, "vv*" , "f" , "stdlib.h" , ALL_LANGUAGES) |
976 | LIBBUILTIN(strtod, "dcC*c**" , "f" , "stdlib.h" , ALL_LANGUAGES) |
977 | LIBBUILTIN(strtof, "fcC*c**" , "f" , "stdlib.h" , ALL_LANGUAGES) |
978 | LIBBUILTIN(strtold, "LdcC*c**" , "f" , "stdlib.h" , ALL_LANGUAGES) |
979 | LIBBUILTIN(strtol, "LicC*c**i" , "f" , "stdlib.h" , ALL_LANGUAGES) |
980 | LIBBUILTIN(strtoll, "LLicC*c**i" , "f" , "stdlib.h" , ALL_LANGUAGES) |
981 | LIBBUILTIN(strtoul, "ULicC*c**i" , "f" , "stdlib.h" , ALL_LANGUAGES) |
982 | LIBBUILTIN(strtoull, "ULLicC*c**i" , "f" , "stdlib.h" , ALL_LANGUAGES) |
983 | // C11 stdlib.h |
984 | LIBBUILTIN(aligned_alloc, "v*zz" , "f" , "stdlib.h" , ALL_LANGUAGES) |
985 | // C99 string.h |
986 | LIBBUILTIN(memcpy, "v*v*vC*z" , "f" , "string.h" , ALL_LANGUAGES) |
987 | LIBBUILTIN(memcmp, "ivC*vC*z" , "f" , "string.h" , ALL_LANGUAGES) |
988 | LIBBUILTIN(memmove, "v*v*vC*z" , "f" , "string.h" , ALL_LANGUAGES) |
989 | LIBBUILTIN(strcpy, "c*c*cC*" , "f" , "string.h" , ALL_LANGUAGES) |
990 | LIBBUILTIN(strncpy, "c*c*cC*z" , "f" , "string.h" , ALL_LANGUAGES) |
991 | LIBBUILTIN(strcmp, "icC*cC*" , "f" , "string.h" , ALL_LANGUAGES) |
992 | LIBBUILTIN(strncmp, "icC*cC*z" , "f" , "string.h" , ALL_LANGUAGES) |
993 | LIBBUILTIN(strcat, "c*c*cC*" , "f" , "string.h" , ALL_LANGUAGES) |
994 | LIBBUILTIN(strncat, "c*c*cC*z" , "f" , "string.h" , ALL_LANGUAGES) |
995 | LIBBUILTIN(strxfrm, "zc*cC*z" , "f" , "string.h" , ALL_LANGUAGES) |
996 | LIBBUILTIN(memchr, "v*vC*iz" , "f" , "string.h" , ALL_LANGUAGES) |
997 | LIBBUILTIN(strchr, "c*cC*i" , "f" , "string.h" , ALL_LANGUAGES) |
998 | LIBBUILTIN(strcspn, "zcC*cC*" , "f" , "string.h" , ALL_LANGUAGES) |
999 | LIBBUILTIN(strpbrk, "c*cC*cC*" , "f" , "string.h" , ALL_LANGUAGES) |
1000 | LIBBUILTIN(strrchr, "c*cC*i" , "f" , "string.h" , ALL_LANGUAGES) |
1001 | LIBBUILTIN(strspn, "zcC*cC*" , "f" , "string.h" , ALL_LANGUAGES) |
1002 | LIBBUILTIN(strstr, "c*cC*cC*" , "f" , "string.h" , ALL_LANGUAGES) |
1003 | LIBBUILTIN(strtok, "c*c*cC*" , "f" , "string.h" , ALL_LANGUAGES) |
1004 | LIBBUILTIN(memset, "v*v*iz" , "f" , "string.h" , ALL_LANGUAGES) |
1005 | LIBBUILTIN(strerror, "c*i" , "f" , "string.h" , ALL_LANGUAGES) |
1006 | LIBBUILTIN(strlen, "zcC*" , "f" , "string.h" , ALL_LANGUAGES) |
1007 | // C99 stdio.h |
1008 | // FIXME: This list is incomplete. |
1009 | LIBBUILTIN(printf, "icC*." , "fp:0:" , "stdio.h" , ALL_LANGUAGES) |
1010 | LIBBUILTIN(fprintf, "iP*cC*." , "fp:1:" , "stdio.h" , ALL_LANGUAGES) |
1011 | LIBBUILTIN(snprintf, "ic*zcC*." , "fp:2:" , "stdio.h" , ALL_LANGUAGES) |
1012 | LIBBUILTIN(sprintf, "ic*cC*." , "fp:1:" , "stdio.h" , ALL_LANGUAGES) |
1013 | LIBBUILTIN(vprintf, "icC*a" , "fP:0:" , "stdio.h" , ALL_LANGUAGES) |
1014 | LIBBUILTIN(vfprintf, "iP*cC*a" , "fP:1:" , "stdio.h" , ALL_LANGUAGES) |
1015 | LIBBUILTIN(vsnprintf, "ic*zcC*a" , "fP:2:" , "stdio.h" , ALL_LANGUAGES) |
1016 | LIBBUILTIN(vsprintf, "ic*cC*a" , "fP:1:" , "stdio.h" , ALL_LANGUAGES) |
1017 | LIBBUILTIN(scanf, "icC*R." , "fs:0:" , "stdio.h" , ALL_LANGUAGES) |
1018 | LIBBUILTIN(fscanf, "iP*RcC*R." , "fs:1:" , "stdio.h" , ALL_LANGUAGES) |
1019 | LIBBUILTIN(sscanf, "icC*RcC*R." , "fs:1:" , "stdio.h" , ALL_LANGUAGES) |
1020 | LIBBUILTIN(vscanf, "icC*Ra" , "fS:0:" , "stdio.h" , ALL_LANGUAGES) |
1021 | LIBBUILTIN(vfscanf, "iP*RcC*Ra" , "fS:1:" , "stdio.h" , ALL_LANGUAGES) |
1022 | LIBBUILTIN(vsscanf, "icC*RcC*Ra" , "fS:1:" , "stdio.h" , ALL_LANGUAGES) |
1023 | LIBBUILTIN(fopen, "P*cC*cC*" , "f" , "stdio.h" , ALL_LANGUAGES) |
1024 | LIBBUILTIN(fread, "zv*zzP*" , "f" , "stdio.h" , ALL_LANGUAGES) |
1025 | LIBBUILTIN(fwrite, "zvC*zzP*" , "f" , "stdio.h" , ALL_LANGUAGES) |
1026 | |
1027 | // C99 ctype.h |
1028 | LIBBUILTIN(isalnum, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1029 | LIBBUILTIN(isalpha, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1030 | LIBBUILTIN(isblank, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1031 | LIBBUILTIN(iscntrl, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1032 | LIBBUILTIN(isdigit, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1033 | LIBBUILTIN(isgraph, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1034 | LIBBUILTIN(islower, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1035 | LIBBUILTIN(isprint, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1036 | LIBBUILTIN(ispunct, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1037 | LIBBUILTIN(isspace, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1038 | LIBBUILTIN(isupper, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1039 | LIBBUILTIN(isxdigit, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1040 | LIBBUILTIN(tolower, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1041 | LIBBUILTIN(toupper, "ii" , "fnU" , "ctype.h" , ALL_LANGUAGES) |
1042 | // C99 wchar.h |
1043 | // FIXME: This list is incomplete. We should cover at least the functions that |
1044 | // take format strings. |
1045 | LIBBUILTIN(wcschr, "w*wC*w" , "f" , "wchar.h" , ALL_LANGUAGES) |
1046 | LIBBUILTIN(wcscmp, "iwC*wC*" , "f" , "wchar.h" , ALL_LANGUAGES) |
1047 | LIBBUILTIN(wcslen, "zwC*" , "f" , "wchar.h" , ALL_LANGUAGES) |
1048 | LIBBUILTIN(wcsncmp, "iwC*wC*z" , "f" , "wchar.h" , ALL_LANGUAGES) |
1049 | LIBBUILTIN(wmemchr, "w*wC*wz" , "f" , "wchar.h" , ALL_LANGUAGES) |
1050 | LIBBUILTIN(wmemcmp, "iwC*wC*z" , "f" , "wchar.h" , ALL_LANGUAGES) |
1051 | LIBBUILTIN(wmemcpy, "w*w*wC*z" , "f" , "wchar.h" , ALL_LANGUAGES) |
1052 | LIBBUILTIN(wmemmove,"w*w*wC*z" , "f" , "wchar.h" , ALL_LANGUAGES) |
1053 | |
1054 | // C99 |
1055 | // In some systems setjmp is a macro that expands to _setjmp. We undefine |
1056 | // it here to avoid having two identical LIBBUILTIN entries. |
1057 | #undef setjmp |
1058 | LIBBUILTIN(setjmp, "iJ" , "fjT" , "setjmp.h" , ALL_LANGUAGES) |
1059 | LIBBUILTIN(longjmp, "vJi" , "frT" , "setjmp.h" , ALL_LANGUAGES) |
1060 | |
1061 | // Non-C library functions, active in GNU mode only. |
1062 | // Functions with (returns_twice) attribute (marked as "j") are still active in |
1063 | // all languages, because losing this attribute would result in miscompilation |
1064 | // when these functions are used in non-GNU mode. PR16138. |
1065 | LIBBUILTIN(alloca, "v*z" , "f" , "stdlib.h" , ALL_GNU_LANGUAGES) |
1066 | // POSIX malloc.h |
1067 | LIBBUILTIN(memalign, "v*zz" , "f" , "malloc.h" , ALL_GNU_LANGUAGES) |
1068 | // POSIX string.h |
1069 | LIBBUILTIN(memccpy, "v*v*vC*iz" , "f" , "string.h" , ALL_GNU_LANGUAGES) |
1070 | LIBBUILTIN(mempcpy, "v*v*vC*z" , "f" , "string.h" , ALL_GNU_LANGUAGES) |
1071 | LIBBUILTIN(stpcpy, "c*c*cC*" , "f" , "string.h" , ALL_GNU_LANGUAGES) |
1072 | LIBBUILTIN(stpncpy, "c*c*cC*z" , "f" , "string.h" , ALL_GNU_LANGUAGES) |
1073 | LIBBUILTIN(strdup, "c*cC*" , "f" , "string.h" , ALL_GNU_LANGUAGES) |
1074 | LIBBUILTIN(strndup, "c*cC*z" , "f" , "string.h" , ALL_GNU_LANGUAGES) |
1075 | // POSIX strings.h |
1076 | LIBBUILTIN(index, "c*cC*i" , "f" , "strings.h" , ALL_GNU_LANGUAGES) |
1077 | LIBBUILTIN(rindex, "c*cC*i" , "f" , "strings.h" , ALL_GNU_LANGUAGES) |
1078 | LIBBUILTIN(bzero, "vv*z" , "f" , "strings.h" , ALL_GNU_LANGUAGES) |
1079 | LIBBUILTIN(bcmp, "ivC*vC*z" , "f" , "strings.h" , ALL_GNU_LANGUAGES) |
1080 | // In some systems str[n]casejmp is a macro that expands to _str[n]icmp. |
1081 | // We undefine then here to avoid wrong name. |
1082 | #undef strcasecmp |
1083 | #undef strncasecmp |
1084 | LIBBUILTIN(strcasecmp, "icC*cC*" , "f" , "strings.h" , ALL_GNU_LANGUAGES) |
1085 | LIBBUILTIN(strncasecmp, "icC*cC*z" , "f" , "strings.h" , ALL_GNU_LANGUAGES) |
1086 | // POSIX unistd.h |
1087 | LIBBUILTIN(_exit, "vi" , "fr" , "unistd.h" , ALL_GNU_LANGUAGES) |
1088 | LIBBUILTIN(vfork, "p" , "fjT" , "unistd.h" , ALL_LANGUAGES) |
1089 | // POSIX pthread.h |
1090 | // FIXME: Should specify argument types. |
1091 | LIBBUILTIN(pthread_create, "" , "fC<2,3>" , "pthread.h" , ALL_GNU_LANGUAGES) |
1092 | |
1093 | // POSIX setjmp.h |
1094 | |
1095 | // FIXME: MinGW _setjmp has an additional void* parameter. |
1096 | LIBBUILTIN(_setjmp, "iJ" , "fjT" , "setjmp.h" , ALL_LANGUAGES) |
1097 | LIBBUILTIN(__sigsetjmp, "iSJi" , "fjT" , "setjmp.h" , ALL_LANGUAGES) |
1098 | LIBBUILTIN(sigsetjmp, "iSJi" , "fjT" , "setjmp.h" , ALL_LANGUAGES) |
1099 | LIBBUILTIN(savectx, "iJ" , "fjT" , "setjmp.h" , ALL_LANGUAGES) |
1100 | LIBBUILTIN(getcontext, "iK*" , "fjT" , "setjmp.h" , ALL_LANGUAGES) |
1101 | |
1102 | LIBBUILTIN(_longjmp, "vJi" , "frT" , "setjmp.h" , ALL_GNU_LANGUAGES) |
1103 | LIBBUILTIN(siglongjmp, "vSJi" , "frT" , "setjmp.h" , ALL_GNU_LANGUAGES) |
1104 | // non-standard but very common |
1105 | LIBBUILTIN(strlcpy, "zc*cC*z" , "f" , "string.h" , ALL_GNU_LANGUAGES) |
1106 | LIBBUILTIN(strlcat, "zc*cC*z" , "f" , "string.h" , ALL_GNU_LANGUAGES) |
1107 | // id objc_msgSend(id, SEL, ...) |
1108 | LIBBUILTIN(objc_msgSend, "GGH." , "f" , "objc/message.h" , OBJC_LANG) |
1109 | // long double objc_msgSend_fpret(id self, SEL op, ...) |
1110 | LIBBUILTIN(objc_msgSend_fpret, "LdGH." , "f" , "objc/message.h" , OBJC_LANG) |
1111 | // _Complex long double objc_msgSend_fp2ret(id self, SEL op, ...) |
1112 | LIBBUILTIN(objc_msgSend_fp2ret, "XLdGH." , "f" , "objc/message.h" , OBJC_LANG) |
1113 | // void objc_msgSend_stret (id, SEL, ...) |
1114 | LIBBUILTIN(objc_msgSend_stret, "vGH." , "f" , "objc/message.h" , OBJC_LANG) |
1115 | // id objc_msgSendSuper(struct objc_super *super, SEL op, ...) |
1116 | LIBBUILTIN(objc_msgSendSuper, "GM*H." , "f" , "objc/message.h" , OBJC_LANG) |
1117 | // void objc_msgSendSuper_stret(struct objc_super *super, SEL op, ...) |
1118 | LIBBUILTIN(objc_msgSendSuper_stret, "vM*H." , "f" , "objc/message.h" , OBJC_LANG) |
1119 | // id objc_getClass(const char *name) |
1120 | LIBBUILTIN(objc_getClass, "GcC*" , "f" , "objc/runtime.h" , OBJC_LANG) |
1121 | // id objc_getMetaClass(const char *name) |
1122 | LIBBUILTIN(objc_getMetaClass, "GcC*" , "f" , "objc/runtime.h" , OBJC_LANG) |
1123 | // void objc_enumerationMutation(id) |
1124 | LIBBUILTIN(objc_enumerationMutation, "vG" , "f" , "objc/runtime.h" , OBJC_LANG) |
1125 | |
1126 | // id objc_read_weak(id *location) |
1127 | LIBBUILTIN(objc_read_weak, "GG*" , "f" , "objc/objc-auto.h" , OBJC_LANG) |
1128 | // id objc_assign_weak(id value, id *location) |
1129 | LIBBUILTIN(objc_assign_weak, "GGG*" , "f" , "objc/objc-auto.h" , OBJC_LANG) |
1130 | // id objc_assign_ivar(id value, id dest, ptrdiff_t offset) |
1131 | LIBBUILTIN(objc_assign_ivar, "GGGY" , "f" , "objc/objc-auto.h" , OBJC_LANG) |
1132 | // id objc_assign_global(id val, id *dest) |
1133 | LIBBUILTIN(objc_assign_global, "GGG*" , "f" , "objc/objc-auto.h" , OBJC_LANG) |
1134 | // id objc_assign_strongCast(id val, id *dest |
1135 | LIBBUILTIN(objc_assign_strongCast, "GGG*" , "f" , "objc/objc-auto.h" , OBJC_LANG) |
1136 | |
1137 | // id objc_exception_extract(void *localExceptionData) |
1138 | LIBBUILTIN(objc_exception_extract, "Gv*" , "f" , "objc/objc-exception.h" , OBJC_LANG) |
1139 | // void objc_exception_try_enter(void *localExceptionData) |
1140 | LIBBUILTIN(objc_exception_try_enter, "vv*" , "f" , "objc/objc-exception.h" , OBJC_LANG) |
1141 | // void objc_exception_try_exit(void *localExceptionData) |
1142 | LIBBUILTIN(objc_exception_try_exit, "vv*" , "f" , "objc/objc-exception.h" , OBJC_LANG) |
1143 | // int objc_exception_match(Class exceptionClass, id exception) |
1144 | LIBBUILTIN(objc_exception_match, "iGG" , "f" , "objc/objc-exception.h" , OBJC_LANG) |
1145 | // void objc_exception_throw(id exception) |
1146 | LIBBUILTIN(objc_exception_throw, "vG" , "f" , "objc/objc-exception.h" , OBJC_LANG) |
1147 | |
1148 | // int objc_sync_enter(id obj) |
1149 | LIBBUILTIN(objc_sync_enter, "iG" , "f" , "objc/objc-sync.h" , OBJC_LANG) |
1150 | // int objc_sync_exit(id obj) |
1151 | LIBBUILTIN(objc_sync_exit, "iG" , "f" , "objc/objc-sync.h" , OBJC_LANG) |
1152 | |
1153 | BUILTIN(__builtin_objc_memmove_collectable, "v*v*vC*z" , "nF" ) |
1154 | |
1155 | // void NSLog(NSString *fmt, ...) |
1156 | LIBBUILTIN(NSLog, "vG." , "fp:0:" , "Foundation/NSObjCRuntime.h" , OBJC_LANG) |
1157 | // void NSLogv(NSString *fmt, va_list args) |
1158 | LIBBUILTIN(NSLogv, "vGa" , "fP:0:" , "Foundation/NSObjCRuntime.h" , OBJC_LANG) |
1159 | |
1160 | // Builtin math library functions |
1161 | LIBBUILTIN(atan2, "ddd" , "fne" , "math.h" , ALL_LANGUAGES) |
1162 | LIBBUILTIN(atan2f, "fff" , "fne" , "math.h" , ALL_LANGUAGES) |
1163 | LIBBUILTIN(atan2l, "LdLdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1164 | |
1165 | LIBBUILTIN(abs, "ii" , "fnc" , "stdlib.h" , ALL_LANGUAGES) |
1166 | LIBBUILTIN(labs, "LiLi" , "fnc" , "stdlib.h" , ALL_LANGUAGES) |
1167 | LIBBUILTIN(llabs, "LLiLLi" , "fnc" , "stdlib.h" , ALL_LANGUAGES) |
1168 | |
1169 | LIBBUILTIN(copysign, "ddd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1170 | LIBBUILTIN(copysignf, "fff" , "fnc" , "math.h" , ALL_LANGUAGES) |
1171 | LIBBUILTIN(copysignl, "LdLdLd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1172 | |
1173 | LIBBUILTIN(fabs, "dd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1174 | LIBBUILTIN(fabsf, "ff" , "fnc" , "math.h" , ALL_LANGUAGES) |
1175 | LIBBUILTIN(fabsl, "LdLd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1176 | |
1177 | // Some systems define finitef as alias of _finitef. |
1178 | #if defined (finitef) |
1179 | #undef finitef |
1180 | #endif |
1181 | LIBBUILTIN(finite, "id" , "fnc" , "math.h" , GNU_LANG) |
1182 | LIBBUILTIN(finitef, "if" , "fnc" , "math.h" , GNU_LANG) |
1183 | LIBBUILTIN(finitel, "iLd" , "fnc" , "math.h" , GNU_LANG) |
1184 | // glibc's math.h generates calls to __finite |
1185 | LIBBUILTIN(__finite, "id" , "fnc" , "math.h" , ALL_LANGUAGES) |
1186 | LIBBUILTIN(__finitef, "if" , "fnc" , "math.h" , ALL_LANGUAGES) |
1187 | LIBBUILTIN(__finitel, "iLd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1188 | |
1189 | LIBBUILTIN(fmod, "ddd" , "fne" , "math.h" , ALL_LANGUAGES) |
1190 | LIBBUILTIN(fmodf, "fff" , "fne" , "math.h" , ALL_LANGUAGES) |
1191 | LIBBUILTIN(fmodl, "LdLdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1192 | |
1193 | LIBBUILTIN(frexp, "ddi*" , "fn" , "math.h" , ALL_LANGUAGES) |
1194 | LIBBUILTIN(frexpf, "ffi*" , "fn" , "math.h" , ALL_LANGUAGES) |
1195 | LIBBUILTIN(frexpl, "LdLdi*" , "fn" , "math.h" , ALL_LANGUAGES) |
1196 | |
1197 | LIBBUILTIN(ldexp, "ddi" , "fne" , "math.h" , ALL_LANGUAGES) |
1198 | LIBBUILTIN(ldexpf, "ffi" , "fne" , "math.h" , ALL_LANGUAGES) |
1199 | LIBBUILTIN(ldexpl, "LdLdi" , "fne" , "math.h" , ALL_LANGUAGES) |
1200 | |
1201 | LIBBUILTIN(modf, "ddd*" , "fn" , "math.h" , ALL_LANGUAGES) |
1202 | LIBBUILTIN(modff, "fff*" , "fn" , "math.h" , ALL_LANGUAGES) |
1203 | LIBBUILTIN(modfl, "LdLdLd*" , "fn" , "math.h" , ALL_LANGUAGES) |
1204 | |
1205 | LIBBUILTIN(nan, "dcC*" , "fUn" , "math.h" , ALL_LANGUAGES) |
1206 | LIBBUILTIN(nanf, "fcC*" , "fUn" , "math.h" , ALL_LANGUAGES) |
1207 | LIBBUILTIN(nanl, "LdcC*" , "fUn" , "math.h" , ALL_LANGUAGES) |
1208 | |
1209 | LIBBUILTIN(pow, "ddd" , "fne" , "math.h" , ALL_LANGUAGES) |
1210 | LIBBUILTIN(powf, "fff" , "fne" , "math.h" , ALL_LANGUAGES) |
1211 | LIBBUILTIN(powl, "LdLdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1212 | |
1213 | LIBBUILTIN(acos, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1214 | LIBBUILTIN(acosf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1215 | LIBBUILTIN(acosl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1216 | |
1217 | LIBBUILTIN(acosh, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1218 | LIBBUILTIN(acoshf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1219 | LIBBUILTIN(acoshl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1220 | |
1221 | LIBBUILTIN(asin, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1222 | LIBBUILTIN(asinf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1223 | LIBBUILTIN(asinl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1224 | |
1225 | LIBBUILTIN(asinh, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1226 | LIBBUILTIN(asinhf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1227 | LIBBUILTIN(asinhl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1228 | |
1229 | LIBBUILTIN(atan, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1230 | LIBBUILTIN(atanf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1231 | LIBBUILTIN(atanl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1232 | |
1233 | LIBBUILTIN(atanh, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1234 | LIBBUILTIN(atanhf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1235 | LIBBUILTIN(atanhl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1236 | |
1237 | LIBBUILTIN(cbrt, "dd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1238 | LIBBUILTIN(cbrtf, "ff" , "fnc" , "math.h" , ALL_LANGUAGES) |
1239 | LIBBUILTIN(cbrtl, "LdLd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1240 | |
1241 | LIBBUILTIN(ceil, "dd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1242 | LIBBUILTIN(ceilf, "ff" , "fnc" , "math.h" , ALL_LANGUAGES) |
1243 | LIBBUILTIN(ceill, "LdLd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1244 | |
1245 | LIBBUILTIN(cos, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1246 | LIBBUILTIN(cosf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1247 | LIBBUILTIN(cosl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1248 | |
1249 | LIBBUILTIN(cosh, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1250 | LIBBUILTIN(coshf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1251 | LIBBUILTIN(coshl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1252 | |
1253 | LIBBUILTIN(erf, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1254 | LIBBUILTIN(erff, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1255 | LIBBUILTIN(erfl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1256 | |
1257 | LIBBUILTIN(erfc, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1258 | LIBBUILTIN(erfcf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1259 | LIBBUILTIN(erfcl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1260 | |
1261 | LIBBUILTIN(exp, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1262 | LIBBUILTIN(expf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1263 | LIBBUILTIN(expl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1264 | |
1265 | LIBBUILTIN(exp2, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1266 | LIBBUILTIN(exp2f, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1267 | LIBBUILTIN(exp2l, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1268 | |
1269 | LIBBUILTIN(expm1, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1270 | LIBBUILTIN(expm1f, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1271 | LIBBUILTIN(expm1l, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1272 | |
1273 | LIBBUILTIN(fdim, "ddd" , "fne" , "math.h" , ALL_LANGUAGES) |
1274 | LIBBUILTIN(fdimf, "fff" , "fne" , "math.h" , ALL_LANGUAGES) |
1275 | LIBBUILTIN(fdiml, "LdLdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1276 | |
1277 | LIBBUILTIN(floor, "dd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1278 | LIBBUILTIN(floorf, "ff" , "fnc" , "math.h" , ALL_LANGUAGES) |
1279 | LIBBUILTIN(floorl, "LdLd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1280 | |
1281 | LIBBUILTIN(fma, "dddd" , "fne" , "math.h" , ALL_LANGUAGES) |
1282 | LIBBUILTIN(fmaf, "ffff" , "fne" , "math.h" , ALL_LANGUAGES) |
1283 | LIBBUILTIN(fmal, "LdLdLdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1284 | |
1285 | LIBBUILTIN(fmax, "ddd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1286 | LIBBUILTIN(fmaxf, "fff" , "fnc" , "math.h" , ALL_LANGUAGES) |
1287 | LIBBUILTIN(fmaxl, "LdLdLd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1288 | |
1289 | LIBBUILTIN(fmin, "ddd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1290 | LIBBUILTIN(fminf, "fff" , "fnc" , "math.h" , ALL_LANGUAGES) |
1291 | LIBBUILTIN(fminl, "LdLdLd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1292 | |
1293 | LIBBUILTIN(hypot, "ddd" , "fne" , "math.h" , ALL_LANGUAGES) |
1294 | LIBBUILTIN(hypotf, "fff" , "fne" , "math.h" , ALL_LANGUAGES) |
1295 | LIBBUILTIN(hypotl, "LdLdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1296 | |
1297 | LIBBUILTIN(ilogb, "id" , "fne" , "math.h" , ALL_LANGUAGES) |
1298 | LIBBUILTIN(ilogbf, "if" , "fne" , "math.h" , ALL_LANGUAGES) |
1299 | LIBBUILTIN(ilogbl, "iLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1300 | |
1301 | // POSIX math.h declares a global, signgam, that lgamma writes to, so these |
1302 | // shouldn't have "e" or "c" attributes |
1303 | LIBBUILTIN(lgamma, "dd" , "fn" , "math.h" , ALL_LANGUAGES) |
1304 | LIBBUILTIN(lgammaf, "ff" , "fn" , "math.h" , ALL_LANGUAGES) |
1305 | LIBBUILTIN(lgammal, "LdLd" , "fn" , "math.h" , ALL_LANGUAGES) |
1306 | |
1307 | LIBBUILTIN(llrint, "LLid" , "fne" , "math.h" , ALL_LANGUAGES) |
1308 | LIBBUILTIN(llrintf, "LLif" , "fne" , "math.h" , ALL_LANGUAGES) |
1309 | LIBBUILTIN(llrintl, "LLiLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1310 | |
1311 | LIBBUILTIN(llround, "LLid" , "fne" , "math.h" , ALL_LANGUAGES) |
1312 | LIBBUILTIN(llroundf, "LLif" , "fne" , "math.h" , ALL_LANGUAGES) |
1313 | LIBBUILTIN(llroundl, "LLiLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1314 | |
1315 | LIBBUILTIN(log, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1316 | LIBBUILTIN(logf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1317 | LIBBUILTIN(logl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1318 | |
1319 | LIBBUILTIN(log10, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1320 | LIBBUILTIN(log10f, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1321 | LIBBUILTIN(log10l, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1322 | |
1323 | LIBBUILTIN(log1p, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1324 | LIBBUILTIN(log1pf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1325 | LIBBUILTIN(log1pl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1326 | |
1327 | LIBBUILTIN(log2, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1328 | LIBBUILTIN(log2f, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1329 | LIBBUILTIN(log2l, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1330 | |
1331 | LIBBUILTIN(logb, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1332 | LIBBUILTIN(logbf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1333 | LIBBUILTIN(logbl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1334 | |
1335 | LIBBUILTIN(lrint, "Lid" , "fne" , "math.h" , ALL_LANGUAGES) |
1336 | LIBBUILTIN(lrintf, "Lif" , "fne" , "math.h" , ALL_LANGUAGES) |
1337 | LIBBUILTIN(lrintl, "LiLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1338 | |
1339 | LIBBUILTIN(lround, "Lid" , "fne" , "math.h" , ALL_LANGUAGES) |
1340 | LIBBUILTIN(lroundf, "Lif" , "fne" , "math.h" , ALL_LANGUAGES) |
1341 | LIBBUILTIN(lroundl, "LiLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1342 | |
1343 | LIBBUILTIN(nearbyint, "dd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1344 | LIBBUILTIN(nearbyintf, "ff" , "fnc" , "math.h" , ALL_LANGUAGES) |
1345 | LIBBUILTIN(nearbyintl, "LdLd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1346 | |
1347 | LIBBUILTIN(nextafter, "ddd" , "fne" , "math.h" , ALL_LANGUAGES) |
1348 | LIBBUILTIN(nextafterf, "fff" , "fne" , "math.h" , ALL_LANGUAGES) |
1349 | LIBBUILTIN(nextafterl, "LdLdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1350 | |
1351 | LIBBUILTIN(nexttoward, "ddLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1352 | LIBBUILTIN(nexttowardf, "ffLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1353 | LIBBUILTIN(nexttowardl, "LdLdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1354 | |
1355 | LIBBUILTIN(remainder, "ddd" , "fne" , "math.h" , ALL_LANGUAGES) |
1356 | LIBBUILTIN(remainderf, "fff" , "fne" , "math.h" , ALL_LANGUAGES) |
1357 | LIBBUILTIN(remainderl, "LdLdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1358 | |
1359 | LIBBUILTIN(remquo, "dddi*" , "fn" , "math.h" , ALL_LANGUAGES) |
1360 | LIBBUILTIN(remquof, "fffi*" , "fn" , "math.h" , ALL_LANGUAGES) |
1361 | LIBBUILTIN(remquol, "LdLdLdi*" , "fn" , "math.h" , ALL_LANGUAGES) |
1362 | |
1363 | LIBBUILTIN(rint, "dd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1364 | LIBBUILTIN(rintf, "ff" , "fnc" , "math.h" , ALL_LANGUAGES) |
1365 | LIBBUILTIN(rintl, "LdLd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1366 | |
1367 | LIBBUILTIN(round, "dd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1368 | LIBBUILTIN(roundf, "ff" , "fnc" , "math.h" , ALL_LANGUAGES) |
1369 | LIBBUILTIN(roundl, "LdLd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1370 | |
1371 | LIBBUILTIN(scalbln, "ddLi" , "fne" , "math.h" , ALL_LANGUAGES) |
1372 | LIBBUILTIN(scalblnf, "ffLi" , "fne" , "math.h" , ALL_LANGUAGES) |
1373 | LIBBUILTIN(scalblnl, "LdLdLi" , "fne" , "math.h" , ALL_LANGUAGES) |
1374 | |
1375 | LIBBUILTIN(scalbn, "ddi" , "fne" , "math.h" , ALL_LANGUAGES) |
1376 | LIBBUILTIN(scalbnf, "ffi" , "fne" , "math.h" , ALL_LANGUAGES) |
1377 | LIBBUILTIN(scalbnl, "LdLdi" , "fne" , "math.h" , ALL_LANGUAGES) |
1378 | |
1379 | LIBBUILTIN(sin, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1380 | LIBBUILTIN(sinf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1381 | LIBBUILTIN(sinl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1382 | |
1383 | LIBBUILTIN(sinh, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1384 | LIBBUILTIN(sinhf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1385 | LIBBUILTIN(sinhl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1386 | |
1387 | LIBBUILTIN(sqrt, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1388 | LIBBUILTIN(sqrtf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1389 | LIBBUILTIN(sqrtl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1390 | |
1391 | LIBBUILTIN(tan, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1392 | LIBBUILTIN(tanf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1393 | LIBBUILTIN(tanl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1394 | |
1395 | LIBBUILTIN(tanh, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1396 | LIBBUILTIN(tanhf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1397 | LIBBUILTIN(tanhl, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1398 | |
1399 | LIBBUILTIN(tgamma, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1400 | LIBBUILTIN(tgammaf, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1401 | LIBBUILTIN(tgammal, "LdLd" , "fne" , "math.h" , ALL_LANGUAGES) |
1402 | |
1403 | LIBBUILTIN(trunc, "dd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1404 | LIBBUILTIN(truncf, "ff" , "fnc" , "math.h" , ALL_LANGUAGES) |
1405 | LIBBUILTIN(truncl, "LdLd" , "fnc" , "math.h" , ALL_LANGUAGES) |
1406 | |
1407 | LIBBUILTIN(cabs, "dXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1408 | LIBBUILTIN(cabsf, "fXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1409 | LIBBUILTIN(cabsl, "LdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1410 | |
1411 | LIBBUILTIN(cacos, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1412 | LIBBUILTIN(cacosf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1413 | LIBBUILTIN(cacosl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1414 | |
1415 | LIBBUILTIN(cacosh, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1416 | LIBBUILTIN(cacoshf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1417 | LIBBUILTIN(cacoshl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1418 | |
1419 | LIBBUILTIN(carg, "dXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1420 | LIBBUILTIN(cargf, "fXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1421 | LIBBUILTIN(cargl, "LdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1422 | |
1423 | LIBBUILTIN(casin, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1424 | LIBBUILTIN(casinf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1425 | LIBBUILTIN(casinl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1426 | |
1427 | LIBBUILTIN(casinh, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1428 | LIBBUILTIN(casinhf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1429 | LIBBUILTIN(casinhl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1430 | |
1431 | LIBBUILTIN(catan, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1432 | LIBBUILTIN(catanf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1433 | LIBBUILTIN(catanl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1434 | |
1435 | LIBBUILTIN(catanh, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1436 | LIBBUILTIN(catanhf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1437 | LIBBUILTIN(catanhl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1438 | |
1439 | LIBBUILTIN(ccos, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1440 | LIBBUILTIN(ccosf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1441 | LIBBUILTIN(ccosl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1442 | |
1443 | LIBBUILTIN(ccosh, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1444 | LIBBUILTIN(ccoshf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1445 | LIBBUILTIN(ccoshl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1446 | |
1447 | LIBBUILTIN(cexp, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1448 | LIBBUILTIN(cexpf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1449 | LIBBUILTIN(cexpl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1450 | |
1451 | LIBBUILTIN(cimag, "dXd" , "fnc" , "complex.h" , ALL_LANGUAGES) |
1452 | LIBBUILTIN(cimagf, "fXf" , "fnc" , "complex.h" , ALL_LANGUAGES) |
1453 | LIBBUILTIN(cimagl, "LdXLd" , "fnc" , "complex.h" , ALL_LANGUAGES) |
1454 | |
1455 | LIBBUILTIN(conj, "XdXd" , "fnc" , "complex.h" , ALL_LANGUAGES) |
1456 | LIBBUILTIN(conjf, "XfXf" , "fnc" , "complex.h" , ALL_LANGUAGES) |
1457 | LIBBUILTIN(conjl, "XLdXLd" , "fnc" , "complex.h" , ALL_LANGUAGES) |
1458 | |
1459 | LIBBUILTIN(clog, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1460 | LIBBUILTIN(clogf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1461 | LIBBUILTIN(clogl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1462 | |
1463 | LIBBUILTIN(cproj, "XdXd" , "fnc" , "complex.h" , ALL_LANGUAGES) |
1464 | LIBBUILTIN(cprojf, "XfXf" , "fnc" , "complex.h" , ALL_LANGUAGES) |
1465 | LIBBUILTIN(cprojl, "XLdXLd" , "fnc" , "complex.h" , ALL_LANGUAGES) |
1466 | |
1467 | LIBBUILTIN(cpow, "XdXdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1468 | LIBBUILTIN(cpowf, "XfXfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1469 | LIBBUILTIN(cpowl, "XLdXLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1470 | |
1471 | LIBBUILTIN(creal, "dXd" , "fnc" , "complex.h" , ALL_LANGUAGES) |
1472 | LIBBUILTIN(crealf, "fXf" , "fnc" , "complex.h" , ALL_LANGUAGES) |
1473 | LIBBUILTIN(creall, "LdXLd" , "fnc" , "complex.h" , ALL_LANGUAGES) |
1474 | |
1475 | LIBBUILTIN(csin, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1476 | LIBBUILTIN(csinf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1477 | LIBBUILTIN(csinl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1478 | |
1479 | LIBBUILTIN(csinh, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1480 | LIBBUILTIN(csinhf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1481 | LIBBUILTIN(csinhl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1482 | |
1483 | LIBBUILTIN(csqrt, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1484 | LIBBUILTIN(csqrtf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1485 | LIBBUILTIN(csqrtl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1486 | |
1487 | LIBBUILTIN(ctan, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1488 | LIBBUILTIN(ctanf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1489 | LIBBUILTIN(ctanl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1490 | |
1491 | LIBBUILTIN(ctanh, "XdXd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1492 | LIBBUILTIN(ctanhf, "XfXf" , "fne" , "complex.h" , ALL_LANGUAGES) |
1493 | LIBBUILTIN(ctanhl, "XLdXLd" , "fne" , "complex.h" , ALL_LANGUAGES) |
1494 | |
1495 | // __sinpi and friends are OS X specific library functions, but otherwise much |
1496 | // like the standard (non-complex) sin (etc). |
1497 | LIBBUILTIN(__sinpi, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1498 | LIBBUILTIN(__sinpif, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1499 | |
1500 | LIBBUILTIN(__cospi, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1501 | LIBBUILTIN(__cospif, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1502 | |
1503 | LIBBUILTIN(__tanpi, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1504 | LIBBUILTIN(__tanpif, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1505 | |
1506 | // Similarly, __exp10 is OS X only |
1507 | LIBBUILTIN(__exp10, "dd" , "fne" , "math.h" , ALL_LANGUAGES) |
1508 | LIBBUILTIN(__exp10f, "ff" , "fne" , "math.h" , ALL_LANGUAGES) |
1509 | |
1510 | // Blocks runtime Builtin math library functions |
1511 | LIBBUILTIN(_Block_object_assign, "vv*vC*iC" , "f" , "Blocks.h" , ALL_LANGUAGES) |
1512 | LIBBUILTIN(_Block_object_dispose, "vvC*iC" , "f" , "Blocks.h" , ALL_LANGUAGES) |
1513 | // FIXME: Also declare NSConcreteGlobalBlock and NSConcreteStackBlock. |
1514 | |
1515 | // Annotation function |
1516 | BUILTIN(__builtin_annotation, "v." , "tn" ) |
1517 | |
1518 | // Invariants |
1519 | BUILTIN(__builtin_assume, "vb" , "n" ) |
1520 | |
1521 | // Multiprecision Arithmetic Builtins. |
1522 | BUILTIN(__builtin_addcb, "UcUcCUcCUcCUc*" , "n" ) |
1523 | BUILTIN(__builtin_addcs, "UsUsCUsCUsCUs*" , "n" ) |
1524 | BUILTIN(__builtin_addc, "UiUiCUiCUiCUi*" , "n" ) |
1525 | BUILTIN(__builtin_addcl, "ULiULiCULiCULiCULi*" , "n" ) |
1526 | BUILTIN(__builtin_addcll, "ULLiULLiCULLiCULLiCULLi*" , "n" ) |
1527 | BUILTIN(__builtin_subcb, "UcUcCUcCUcCUc*" , "n" ) |
1528 | BUILTIN(__builtin_subcs, "UsUsCUsCUsCUs*" , "n" ) |
1529 | BUILTIN(__builtin_subc, "UiUiCUiCUiCUi*" , "n" ) |
1530 | BUILTIN(__builtin_subcl, "ULiULiCULiCULiCULi*" , "n" ) |
1531 | BUILTIN(__builtin_subcll, "ULLiULLiCULLiCULLiCULLi*" , "n" ) |
1532 | |
1533 | // Checked Arithmetic Builtins for Security. |
1534 | BUILTIN(__builtin_add_overflow, "b." , "nt" ) |
1535 | BUILTIN(__builtin_sub_overflow, "b." , "nt" ) |
1536 | BUILTIN(__builtin_mul_overflow, "b." , "nt" ) |
1537 | BUILTIN(__builtin_uadd_overflow, "bUiCUiCUi*" , "n" ) |
1538 | BUILTIN(__builtin_uaddl_overflow, "bULiCULiCULi*" , "n" ) |
1539 | BUILTIN(__builtin_uaddll_overflow, "bULLiCULLiCULLi*" , "n" ) |
1540 | BUILTIN(__builtin_usub_overflow, "bUiCUiCUi*" , "n" ) |
1541 | BUILTIN(__builtin_usubl_overflow, "bULiCULiCULi*" , "n" ) |
1542 | BUILTIN(__builtin_usubll_overflow, "bULLiCULLiCULLi*" , "n" ) |
1543 | BUILTIN(__builtin_umul_overflow, "bUiCUiCUi*" , "n" ) |
1544 | BUILTIN(__builtin_umull_overflow, "bULiCULiCULi*" , "n" ) |
1545 | BUILTIN(__builtin_umulll_overflow, "bULLiCULLiCULLi*" , "n" ) |
1546 | BUILTIN(__builtin_sadd_overflow, "bSiCSiCSi*" , "n" ) |
1547 | BUILTIN(__builtin_saddl_overflow, "bSLiCSLiCSLi*" , "n" ) |
1548 | BUILTIN(__builtin_saddll_overflow, "bSLLiCSLLiCSLLi*" , "n" ) |
1549 | BUILTIN(__builtin_ssub_overflow, "bSiCSiCSi*" , "n" ) |
1550 | BUILTIN(__builtin_ssubl_overflow, "bSLiCSLiCSLi*" , "n" ) |
1551 | BUILTIN(__builtin_ssubll_overflow, "bSLLiCSLLiCSLLi*" , "n" ) |
1552 | BUILTIN(__builtin_smul_overflow, "bSiCSiCSi*" , "n" ) |
1553 | BUILTIN(__builtin_smull_overflow, "bSLiCSLiCSLi*" , "n" ) |
1554 | BUILTIN(__builtin_smulll_overflow, "bSLLiCSLLiCSLLi*" , "n" ) |
1555 | |
1556 | // Clang builtins (not available in GCC). |
1557 | BUILTIN(__builtin_addressof, "v*v&" , "nct" ) |
1558 | BUILTIN(__builtin_operator_new, "v*z" , "tc" ) |
1559 | BUILTIN(__builtin_operator_delete, "vv*" , "tn" ) |
1560 | BUILTIN(__builtin_char_memchr, "c*cC*iz" , "n" ) |
1561 | BUILTIN(__builtin_dump_struct, "ivC*v*" , "tn" ) |
1562 | BUILTIN(__builtin_preserve_access_index, "v." , "t" ) |
1563 | |
1564 | // Alignment builtins (uses custom parsing to support pointers and integers) |
1565 | BUILTIN(__builtin_is_aligned, "bvC*z" , "nct" ) |
1566 | BUILTIN(__builtin_align_up, "v*vC*z" , "nct" ) |
1567 | BUILTIN(__builtin_align_down, "v*vC*z" , "nct" ) |
1568 | |
1569 | // Safestack builtins |
1570 | BUILTIN(__builtin___get_unsafe_stack_start, "v*" , "Fn" ) |
1571 | BUILTIN(__builtin___get_unsafe_stack_bottom, "v*" , "Fn" ) |
1572 | BUILTIN(__builtin___get_unsafe_stack_top, "v*" , "Fn" ) |
1573 | BUILTIN(__builtin___get_unsafe_stack_ptr, "v*" , "Fn" ) |
1574 | |
1575 | // Nontemporal loads/stores builtins |
1576 | BUILTIN(__builtin_nontemporal_store, "v." , "t" ) |
1577 | BUILTIN(__builtin_nontemporal_load, "v." , "t" ) |
1578 | |
1579 | // Coroutine intrinsics. |
1580 | BUILTIN(__builtin_coro_resume, "vv*" , "" ) |
1581 | BUILTIN(__builtin_coro_destroy, "vv*" , "" ) |
1582 | BUILTIN(__builtin_coro_done, "bv*" , "n" ) |
1583 | BUILTIN(__builtin_coro_promise, "v*v*IiIb" , "n" ) |
1584 | |
1585 | BUILTIN(__builtin_coro_size, "z" , "n" ) |
1586 | BUILTIN(__builtin_coro_frame, "v*" , "n" ) |
1587 | BUILTIN(__builtin_coro_noop, "v*" , "n" ) |
1588 | BUILTIN(__builtin_coro_free, "v*v*" , "n" ) |
1589 | |
1590 | BUILTIN(__builtin_coro_id, "v*Iiv*v*v*" , "n" ) |
1591 | BUILTIN(__builtin_coro_alloc, "b" , "n" ) |
1592 | BUILTIN(__builtin_coro_begin, "v*v*" , "n" ) |
1593 | BUILTIN(__builtin_coro_end, "bv*Ib" , "n" ) |
1594 | BUILTIN(__builtin_coro_suspend, "cIb" , "n" ) |
1595 | BUILTIN(__builtin_coro_param, "bv*v*" , "n" ) |
1596 | |
1597 | // OpenCL v2.0 s6.13.16, s9.17.3.5 - Pipe functions. |
1598 | // We need the generic prototype, since the packet type could be anything. |
1599 | LANGBUILTIN(read_pipe, "i." , "tn" , OCLC20_LANG) |
1600 | LANGBUILTIN(write_pipe, "i." , "tn" , OCLC20_LANG) |
1601 | |
1602 | LANGBUILTIN(reserve_read_pipe, "i." , "tn" , OCLC20_LANG) |
1603 | LANGBUILTIN(reserve_write_pipe, "i." , "tn" , OCLC20_LANG) |
1604 | |
1605 | LANGBUILTIN(commit_write_pipe, "v." , "tn" , OCLC20_LANG) |
1606 | LANGBUILTIN(commit_read_pipe, "v." , "tn" , OCLC20_LANG) |
1607 | |
1608 | LANGBUILTIN(sub_group_reserve_read_pipe, "i." , "tn" , OCLC20_LANG) |
1609 | LANGBUILTIN(sub_group_reserve_write_pipe, "i." , "tn" , OCLC20_LANG) |
1610 | |
1611 | LANGBUILTIN(sub_group_commit_read_pipe, "v." , "tn" , OCLC20_LANG) |
1612 | LANGBUILTIN(sub_group_commit_write_pipe, "v." , "tn" , OCLC20_LANG) |
1613 | |
1614 | LANGBUILTIN(work_group_reserve_read_pipe, "i." , "tn" , OCLC20_LANG) |
1615 | LANGBUILTIN(work_group_reserve_write_pipe, "i." , "tn" , OCLC20_LANG) |
1616 | |
1617 | LANGBUILTIN(work_group_commit_read_pipe, "v." , "tn" , OCLC20_LANG) |
1618 | LANGBUILTIN(work_group_commit_write_pipe, "v." , "tn" , OCLC20_LANG) |
1619 | |
1620 | LANGBUILTIN(get_pipe_num_packets, "Ui." , "tn" , OCLC20_LANG) |
1621 | LANGBUILTIN(get_pipe_max_packets, "Ui." , "tn" , OCLC20_LANG) |
1622 | |
1623 | // OpenCL v2.0 s6.13.17 - Enqueue kernel functions. |
1624 | // Custom builtin check allows to perform special check of passed block arguments. |
1625 | LANGBUILTIN(enqueue_kernel, "i." , "tn" , OCLC20_LANG) |
1626 | LANGBUILTIN(get_kernel_work_group_size, "Ui." , "tn" , OCLC20_LANG) |
1627 | LANGBUILTIN(get_kernel_preferred_work_group_size_multiple, "Ui." , "tn" , OCLC20_LANG) |
1628 | LANGBUILTIN(get_kernel_max_sub_group_size_for_ndrange, "Ui." , "tn" , OCLC20_LANG) |
1629 | LANGBUILTIN(get_kernel_sub_group_count_for_ndrange, "Ui." , "tn" , OCLC20_LANG) |
1630 | |
1631 | // OpenCL v2.0 s6.13.9 - Address space qualifier functions. |
1632 | // FIXME: Pointer parameters of OpenCL builtins should have their address space |
1633 | // requirement defined. |
1634 | LANGBUILTIN(to_global, "v*v*" , "tn" , OCLC20_LANG) |
1635 | LANGBUILTIN(to_local, "v*v*" , "tn" , OCLC20_LANG) |
1636 | LANGBUILTIN(to_private, "v*v*" , "tn" , OCLC20_LANG) |
1637 | |
1638 | // OpenCL half load/store builtin |
1639 | LANGBUILTIN(__builtin_store_half, "vdh*" , "n" , ALL_OCLC_LANGUAGES) |
1640 | LANGBUILTIN(__builtin_store_halff, "vfh*" , "n" , ALL_OCLC_LANGUAGES) |
1641 | LANGBUILTIN(__builtin_load_half, "dhC*" , "nc" , ALL_OCLC_LANGUAGES) |
1642 | LANGBUILTIN(__builtin_load_halff, "fhC*" , "nc" , ALL_OCLC_LANGUAGES) |
1643 | |
1644 | // Builtins for os_log/os_trace |
1645 | BUILTIN(__builtin_os_log_format_buffer_size, "zcC*." , "p:0:nut" ) |
1646 | BUILTIN(__builtin_os_log_format, "v*v*cC*." , "p:0:nt" ) |
1647 | |
1648 | // CUDA/HIP |
1649 | LANGBUILTIN(__builtin_get_device_side_mangled_name, "cC*." , "ncT" , CUDA_LANG) |
1650 | |
1651 | // Builtins for XRay |
1652 | BUILTIN(__xray_customevent, "vcC*z" , "" ) |
1653 | BUILTIN(__xray_typedevent, "vzcC*z" , "" ) |
1654 | |
1655 | // Win64-compatible va_list functions |
1656 | BUILTIN(__builtin_ms_va_start, "vc*&." , "nt" ) |
1657 | BUILTIN(__builtin_ms_va_end, "vc*&" , "n" ) |
1658 | BUILTIN(__builtin_ms_va_copy, "vc*&c*&" , "n" ) |
1659 | |
1660 | #undef BUILTIN |
1661 | #undef LIBBUILTIN |
1662 | #undef LANGBUILTIN |
1663 | |