Coverage Report

Created: 2019-07-24 05:18

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