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