• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//===--- Builtins.def - Builtin function info database ----------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the standard builtin function database.  Users of this file
11// must define the BUILTIN macro to make use of this information.
12//
13//===----------------------------------------------------------------------===//
14
15// FIXME: This should really be a .td file, but that requires modifying tblgen.
16// Perhaps tblgen should have plugins.
17
18// The first value provided to the macro specifies the function name of the
19// builtin, and results in a clang::builtin::BIXX enum value for XX.
20
21// The second value provided to the macro specifies the type of the function
22// (result value, then each argument) as follows:
23//  v -> void
24//  b -> boolean
25//  c -> char
26//  s -> short
27//  i -> int
28//  f -> float
29//  d -> double
30//  z -> size_t
31//  F -> constant CFString
32//  G -> id
33//  H -> SEL
34//  a -> __builtin_va_list
35//  A -> "reference" to __builtin_va_list
36//  V -> Vector, following num elements and a base type.
37//  X -> _Complex, followed by the base type.
38//  P -> FILE
39//  J -> jmp_buf
40//  SJ -> sigjmp_buf
41//  . -> "...".  This may only occur at the end of the function list.
42//
43// Types may be prefixed with the following modifiers:
44//  L   -> long (e.g. Li for 'long int')
45//  LL  -> long long
46//  LLL -> __int128_t (e.g. LLLi)
47//  S   -> signed
48//  U   -> unsigned
49//  I   -> Required to constant fold to an integer constant expression.
50//
51// Types may be postfixed with the following modifiers:
52// * -> pointer (optionally followed by an address space number)
53// & -> reference (optionally followed by an address space number)
54// C -> const
55// D -> volatile
56
57// The third value provided to the macro specifies information about attributes
58// of the function.  These must be kept in sync with the predicates in the
59// Builtin::Context class.  Currently we have:
60//  n -> nothrow
61//  r -> noreturn
62//  c -> const
63//  t -> signature is meaningless, use custom typechecking
64//  F -> this is a libc/libm function with a '__builtin_' prefix added.
65//  f -> this is a libc/libm function without the '__builtin_' prefix. It can
66//       be followed by ':headername:' to state which header this function
67//       comes from.
68//  p:N: -> this is a printf-like function whose Nth argument is the format
69//          string.
70//  P:N: -> similar to the p:N: attribute, but the function is like vprintf
71//          in that it accepts its arguments as a va_list rather than
72//          through an ellipsis
73//  s:N: -> this is a scanf-like function whose Nth argument is the format
74//          string.
75//  S:N: -> similar to the s:N: attribute, but the function is like vscanf
76//          in that it accepts its arguments as a va_list rather than
77//          through an ellipsis
78//  e -> const, but only when -fmath-errno=0
79//  FIXME: gcc has nonnull
80
81#if defined(BUILTIN) && !defined(LIBBUILTIN)
82#  define LIBBUILTIN(ID, TYPE, ATTRS, HEADER, BUILTIN_LANG) BUILTIN(ID, TYPE, ATTRS)
83#endif
84
85// Standard libc/libm functions:
86BUILTIN(__builtin_atan2 , "ddd"  , "Fnc")
87BUILTIN(__builtin_atan2f, "fff"  , "Fnc")
88BUILTIN(__builtin_atan2l, "LdLdLd", "Fnc")
89BUILTIN(__builtin_abs  , "ii"  , "ncF")
90BUILTIN(__builtin_copysign, "ddd", "ncF")
91BUILTIN(__builtin_copysignf, "fff", "ncF")
92BUILTIN(__builtin_copysignl, "LdLdLd", "ncF")
93BUILTIN(__builtin_fabs , "dd"  , "ncF")
94BUILTIN(__builtin_fabsf, "ff"  , "ncF")
95BUILTIN(__builtin_fabsl, "LdLd", "ncF")
96BUILTIN(__builtin_fmod , "ddd"  , "Fnc")
97BUILTIN(__builtin_fmodf, "fff"  , "Fnc")
98BUILTIN(__builtin_fmodl, "LdLdLd", "Fnc")
99BUILTIN(__builtin_frexp , "ddi*"  , "Fnc")
100BUILTIN(__builtin_frexpf, "ffi*"  , "Fnc")
101BUILTIN(__builtin_frexpl, "LdLdi*", "Fnc")
102BUILTIN(__builtin_huge_val, "d", "nc")
103BUILTIN(__builtin_huge_valf, "f", "nc")
104BUILTIN(__builtin_huge_vall, "Ld", "nc")
105BUILTIN(__builtin_inf  , "d"   , "nc")
106BUILTIN(__builtin_inff , "f"   , "nc")
107BUILTIN(__builtin_infl , "Ld"  , "nc")
108BUILTIN(__builtin_ldexp , "ddi"  , "Fnc")
109BUILTIN(__builtin_ldexpf, "ffi"  , "Fnc")
110BUILTIN(__builtin_ldexpl, "LdLdi", "Fnc")
111BUILTIN(__builtin_modf , "ddd*"  , "Fnc")
112BUILTIN(__builtin_modff, "fff*"  , "Fnc")
113BUILTIN(__builtin_modfl, "LdLdLd*", "Fnc")
114BUILTIN(__builtin_nan,  "dcC*" , "ncF")
115BUILTIN(__builtin_nanf, "fcC*" , "ncF")
116BUILTIN(__builtin_nanl, "LdcC*", "ncF")
117BUILTIN(__builtin_nans,  "dcC*" , "ncF")
118BUILTIN(__builtin_nansf, "fcC*" , "ncF")
119BUILTIN(__builtin_nansl, "LdcC*", "ncF")
120BUILTIN(__builtin_powi , "ddi"  , "Fnc")
121BUILTIN(__builtin_powif, "ffi"  , "Fnc")
122BUILTIN(__builtin_powil, "LdLdi", "Fnc")
123BUILTIN(__builtin_pow , "ddd"  , "Fnc")
124BUILTIN(__builtin_powf, "fff"  , "Fnc")
125BUILTIN(__builtin_powl, "LdLdLd", "Fnc")
126
127// Standard unary libc/libm functions with double/float/long double variants:
128BUILTIN(__builtin_acos , "dd"  , "Fnc")
129BUILTIN(__builtin_acosf, "ff"  , "Fnc")
130BUILTIN(__builtin_acosl, "LdLd", "Fnc")
131BUILTIN(__builtin_acosh , "dd"  , "Fnc")
132BUILTIN(__builtin_acoshf, "ff"  , "Fnc")
133BUILTIN(__builtin_acoshl, "LdLd", "Fnc")
134BUILTIN(__builtin_asin , "dd"  , "Fnc")
135BUILTIN(__builtin_asinf, "ff"  , "Fnc")
136BUILTIN(__builtin_asinl, "LdLd", "Fnc")
137BUILTIN(__builtin_asinh , "dd"  , "Fnc")
138BUILTIN(__builtin_asinhf, "ff"  , "Fnc")
139BUILTIN(__builtin_asinhl, "LdLd", "Fnc")
140BUILTIN(__builtin_atan , "dd"  , "Fnc")
141BUILTIN(__builtin_atanf, "ff"  , "Fnc")
142BUILTIN(__builtin_atanl, "LdLd", "Fnc")
143BUILTIN(__builtin_atanh , "dd", "Fnc")
144BUILTIN(__builtin_atanhf, "ff", "Fnc")
145BUILTIN(__builtin_atanhl, "LdLd", "Fnc")
146BUILTIN(__builtin_cbrt , "dd", "Fnc")
147BUILTIN(__builtin_cbrtf, "ff", "Fnc")
148BUILTIN(__builtin_cbrtl, "LdLd", "Fnc")
149BUILTIN(__builtin_ceil , "dd"  , "Fnc")
150BUILTIN(__builtin_ceilf, "ff"  , "Fnc")
151BUILTIN(__builtin_ceill, "LdLd", "Fnc")
152BUILTIN(__builtin_cos , "dd"  , "Fnc")
153BUILTIN(__builtin_cosf, "ff"  , "Fnc")
154BUILTIN(__builtin_cosh , "dd"  , "Fnc")
155BUILTIN(__builtin_coshf, "ff"  , "Fnc")
156BUILTIN(__builtin_coshl, "LdLd", "Fnc")
157BUILTIN(__builtin_cosl, "LdLd", "Fnc")
158BUILTIN(__builtin_erf , "dd", "Fnc")
159BUILTIN(__builtin_erff, "ff", "Fnc")
160BUILTIN(__builtin_erfl, "LdLd", "Fnc")
161BUILTIN(__builtin_erfc , "dd", "Fnc")
162BUILTIN(__builtin_erfcf, "ff", "Fnc")
163BUILTIN(__builtin_erfcl, "LdLd", "Fnc")
164BUILTIN(__builtin_exp , "dd"  , "Fnc")
165BUILTIN(__builtin_expf, "ff"  , "Fnc")
166BUILTIN(__builtin_expl, "LdLd", "Fnc")
167BUILTIN(__builtin_exp2 , "dd"  , "Fnc")
168BUILTIN(__builtin_exp2f, "ff"  , "Fnc")
169BUILTIN(__builtin_exp2l, "LdLd", "Fnc")
170BUILTIN(__builtin_expm1 , "dd", "Fnc")
171BUILTIN(__builtin_expm1f, "ff", "Fnc")
172BUILTIN(__builtin_expm1l, "LdLd", "Fnc")
173BUILTIN(__builtin_fdim, "ddd", "Fnc")
174BUILTIN(__builtin_fdimf, "fff", "Fnc")
175BUILTIN(__builtin_fdiml, "LdLdLd", "Fnc")
176BUILTIN(__builtin_floor , "dd"  , "Fnc")
177BUILTIN(__builtin_floorf, "ff"  , "Fnc")
178BUILTIN(__builtin_floorl, "LdLd", "Fnc")
179BUILTIN(__builtin_fma, "dddd", "Fnc")
180BUILTIN(__builtin_fmaf, "ffff", "Fnc")
181BUILTIN(__builtin_fmal, "LdLdLdLd", "Fnc")
182BUILTIN(__builtin_fmax, "ddd", "Fnc")
183BUILTIN(__builtin_fmaxf, "fff", "Fnc")
184BUILTIN(__builtin_fmaxl, "LdLdLd", "Fnc")
185BUILTIN(__builtin_fmin, "ddd", "Fnc")
186BUILTIN(__builtin_fminf, "fff", "Fnc")
187BUILTIN(__builtin_fminl, "LdLdLd", "Fnc")
188BUILTIN(__builtin_hypot , "ddd"  , "Fnc")
189BUILTIN(__builtin_hypotf, "fff"  , "Fnc")
190BUILTIN(__builtin_hypotl, "LdLdLd", "Fnc")
191BUILTIN(__builtin_ilogb , "id", "Fnc")
192BUILTIN(__builtin_ilogbf, "if", "Fnc")
193BUILTIN(__builtin_ilogbl, "iLd", "Fnc")
194BUILTIN(__builtin_lgamma , "dd", "Fnc")
195BUILTIN(__builtin_lgammaf, "ff", "Fnc")
196BUILTIN(__builtin_lgammal, "LdLd", "Fnc")
197BUILTIN(__builtin_llrint, "LLid", "Fnc")
198BUILTIN(__builtin_llrintf, "LLif", "Fnc")
199BUILTIN(__builtin_llrintl, "LLiLd", "Fnc")
200BUILTIN(__builtin_llround , "LLid", "Fnc")
201BUILTIN(__builtin_llroundf, "LLif", "Fnc")
202BUILTIN(__builtin_llroundl, "LLiLd", "Fnc")
203BUILTIN(__builtin_log , "dd"  , "Fnc")
204BUILTIN(__builtin_log10 , "dd"  , "Fnc")
205BUILTIN(__builtin_log10f, "ff"  , "Fnc")
206BUILTIN(__builtin_log10l, "LdLd", "Fnc")
207BUILTIN(__builtin_log1p , "dd"  , "Fnc")
208BUILTIN(__builtin_log1pf, "ff"  , "Fnc")
209BUILTIN(__builtin_log1pl, "LdLd", "Fnc")
210BUILTIN(__builtin_log2, "dd"  , "Fnc")
211BUILTIN(__builtin_log2f, "ff"  , "Fnc")
212BUILTIN(__builtin_log2l, "LdLd"  , "Fnc")
213BUILTIN(__builtin_logb , "dd", "Fnc")
214BUILTIN(__builtin_logbf, "ff", "Fnc")
215BUILTIN(__builtin_logbl, "LdLd", "Fnc")
216BUILTIN(__builtin_logf, "ff"  , "Fnc")
217BUILTIN(__builtin_logl, "LdLd", "Fnc")
218BUILTIN(__builtin_lrint , "Lid", "Fnc")
219BUILTIN(__builtin_lrintf, "Lif", "Fnc")
220BUILTIN(__builtin_lrintl, "LiLd", "Fnc")
221BUILTIN(__builtin_lround , "Lid", "Fnc")
222BUILTIN(__builtin_lroundf, "Lif", "Fnc")
223BUILTIN(__builtin_lroundl, "LiLd", "Fnc")
224BUILTIN(__builtin_nearbyint , "dd", "Fnc")
225BUILTIN(__builtin_nearbyintf, "ff", "Fnc")
226BUILTIN(__builtin_nearbyintl, "LdLd", "Fnc")
227BUILTIN(__builtin_nextafter , "ddd", "Fnc")
228BUILTIN(__builtin_nextafterf, "fff", "Fnc")
229BUILTIN(__builtin_nextafterl, "LdLdLd", "Fnc")
230BUILTIN(__builtin_nexttoward , "ddd", "Fnc")
231BUILTIN(__builtin_nexttowardf, "fff", "Fnc")
232BUILTIN(__builtin_nexttowardl, "LdLdLd", "Fnc")
233BUILTIN(__builtin_remainder , "ddd", "Fnc")
234BUILTIN(__builtin_remainderf, "fff", "Fnc")
235BUILTIN(__builtin_remainderl, "LdLdLd", "Fnc")
236BUILTIN(__builtin_remquo , "dddi*", "Fnc")
237BUILTIN(__builtin_remquof, "fffi*", "Fnc")
238BUILTIN(__builtin_remquol, "LdLdLdi*", "Fnc")
239BUILTIN(__builtin_rint , "dd", "Fnc")
240BUILTIN(__builtin_rintf, "ff", "Fnc")
241BUILTIN(__builtin_rintl, "LdLd", "Fnc")
242BUILTIN(__builtin_round, "dd"  , "Fnc")
243BUILTIN(__builtin_roundf, "ff"  , "Fnc")
244BUILTIN(__builtin_roundl, "LdLd"  , "Fnc")
245BUILTIN(__builtin_scalbln , "ddLi", "Fnc")
246BUILTIN(__builtin_scalblnf, "ffLi", "Fnc")
247BUILTIN(__builtin_scalblnl, "LdLdLi", "Fnc")
248BUILTIN(__builtin_scalbn , "ddi", "Fnc")
249BUILTIN(__builtin_scalbnf, "ffi", "Fnc")
250BUILTIN(__builtin_scalbnl, "LdLdi", "Fnc")
251BUILTIN(__builtin_sin , "dd"  , "Fnc")
252BUILTIN(__builtin_sinf, "ff"  , "Fnc")
253BUILTIN(__builtin_sinh , "dd"  , "Fnc")
254BUILTIN(__builtin_sinhf, "ff"  , "Fnc")
255BUILTIN(__builtin_sinhl, "LdLd", "Fnc")
256BUILTIN(__builtin_sinl, "LdLd", "Fnc")
257BUILTIN(__builtin_sqrt , "dd"  , "Fnc")
258BUILTIN(__builtin_sqrtf, "ff"  , "Fnc")
259BUILTIN(__builtin_sqrtl, "LdLd", "Fnc")
260BUILTIN(__builtin_tan , "dd"  , "Fnc")
261BUILTIN(__builtin_tanf, "ff"  , "Fnc")
262BUILTIN(__builtin_tanh , "dd"  , "Fnc")
263BUILTIN(__builtin_tanhf, "ff"  , "Fnc")
264BUILTIN(__builtin_tanhl, "LdLd", "Fnc")
265BUILTIN(__builtin_tanl, "LdLd", "Fnc")
266BUILTIN(__builtin_tgamma , "dd", "Fnc")
267BUILTIN(__builtin_tgammaf, "ff", "Fnc")
268BUILTIN(__builtin_tgammal, "LdLd", "Fnc")
269BUILTIN(__builtin_trunc , "dd", "Fnc")
270BUILTIN(__builtin_truncf, "ff", "Fnc")
271BUILTIN(__builtin_truncl, "LdLd", "Fnc")
272
273// C99 complex builtins
274BUILTIN(__builtin_cabs, "dXd", "Fnc")
275BUILTIN(__builtin_cabsf, "fXf", "Fnc")
276BUILTIN(__builtin_cabsl, "LdXLd", "Fnc")
277BUILTIN(__builtin_cacos, "XdXd", "Fnc")
278BUILTIN(__builtin_cacosf, "XfXf", "Fnc")
279BUILTIN(__builtin_cacosh, "XdXd", "Fnc")
280BUILTIN(__builtin_cacoshf, "XfXf", "Fnc")
281BUILTIN(__builtin_cacoshl, "XLdXLd", "Fnc")
282BUILTIN(__builtin_cacosl, "XLdXLd", "Fnc")
283BUILTIN(__builtin_carg, "dXd", "Fnc")
284BUILTIN(__builtin_cargf, "fXf", "Fnc")
285BUILTIN(__builtin_cargl, "LdXLd", "Fnc")
286BUILTIN(__builtin_casin, "XdXd", "Fnc")
287BUILTIN(__builtin_casinf, "XfXf", "Fnc")
288BUILTIN(__builtin_casinh, "XdXd", "Fnc")
289BUILTIN(__builtin_casinhf, "XfXf", "Fnc")
290BUILTIN(__builtin_casinhl, "XLdXLd", "Fnc")
291BUILTIN(__builtin_casinl, "XLdXLd", "Fnc")
292BUILTIN(__builtin_catan, "XdXd", "Fnc")
293BUILTIN(__builtin_catanf, "XfXf", "Fnc")
294BUILTIN(__builtin_catanh, "XdXd", "Fnc")
295BUILTIN(__builtin_catanhf, "XfXf", "Fnc")
296BUILTIN(__builtin_catanhl, "XLdXLd", "Fnc")
297BUILTIN(__builtin_catanl, "XLdXLd", "Fnc")
298BUILTIN(__builtin_ccos, "XdXd", "Fnc")
299BUILTIN(__builtin_ccosf, "XfXf", "Fnc")
300BUILTIN(__builtin_ccosl, "XLdXLd", "Fnc")
301BUILTIN(__builtin_ccosh, "XdXd", "Fnc")
302BUILTIN(__builtin_ccoshf, "XfXf", "Fnc")
303BUILTIN(__builtin_ccoshl, "XLdXLd", "Fnc")
304BUILTIN(__builtin_cexp, "XdXd", "Fnc")
305BUILTIN(__builtin_cexpf, "XfXf", "Fnc")
306BUILTIN(__builtin_cexpl, "XLdXLd", "Fnc")
307BUILTIN(__builtin_cimag, "dXd", "Fnc")
308BUILTIN(__builtin_cimagf, "fXf", "Fnc")
309BUILTIN(__builtin_cimagl, "LdXLd", "Fnc")
310BUILTIN(__builtin_conj, "XdXd", "Fnc")
311BUILTIN(__builtin_conjf, "XfXf", "Fnc")
312BUILTIN(__builtin_conjl, "XLdXLd", "Fnc")
313BUILTIN(__builtin_clog, "XdXd", "Fnc")
314BUILTIN(__builtin_clogf, "XfXf", "Fnc")
315BUILTIN(__builtin_clogl, "XLdXLd", "Fnc")
316BUILTIN(__builtin_cproj, "XdXd", "Fnc")
317BUILTIN(__builtin_cprojf, "XfXf", "Fnc")
318BUILTIN(__builtin_cprojl, "XLdXLd", "Fnc")
319BUILTIN(__builtin_cpow, "XdXdXd", "Fnc")
320BUILTIN(__builtin_cpowf, "XfXfXf", "Fnc")
321BUILTIN(__builtin_cpowl, "XLdXLdXLd", "Fnc")
322BUILTIN(__builtin_creal, "dXd", "Fnc")
323BUILTIN(__builtin_crealf, "fXf", "Fnc")
324BUILTIN(__builtin_creall, "LdXLd", "Fnc")
325BUILTIN(__builtin_csin, "XdXd", "Fnc")
326BUILTIN(__builtin_csinf, "XfXf", "Fnc")
327BUILTIN(__builtin_csinl, "XLdXLd", "Fnc")
328BUILTIN(__builtin_csinh, "XdXd", "Fnc")
329BUILTIN(__builtin_csinhf, "XfXf", "Fnc")
330BUILTIN(__builtin_csinhl, "XLdXLd", "Fnc")
331BUILTIN(__builtin_csqrt, "XdXd", "Fnc")
332BUILTIN(__builtin_csqrtf, "XfXf", "Fnc")
333BUILTIN(__builtin_csqrtl, "XLdXLd", "Fnc")
334BUILTIN(__builtin_ctan, "XdXd", "Fnc")
335BUILTIN(__builtin_ctanf, "XfXf", "Fnc")
336BUILTIN(__builtin_ctanl, "XLdXLd", "Fnc")
337BUILTIN(__builtin_ctanh, "XdXd", "Fnc")
338BUILTIN(__builtin_ctanhf, "XfXf", "Fnc")
339BUILTIN(__builtin_ctanhl, "XLdXLd", "Fnc")
340
341// FP Comparisons.
342BUILTIN(__builtin_isgreater     , "i.", "nc")
343BUILTIN(__builtin_isgreaterequal, "i.", "nc")
344BUILTIN(__builtin_isless        , "i.", "nc")
345BUILTIN(__builtin_islessequal   , "i.", "nc")
346BUILTIN(__builtin_islessgreater , "i.", "nc")
347BUILTIN(__builtin_isunordered   , "i.", "nc")
348
349// Unary FP classification
350BUILTIN(__builtin_fpclassify, "iiiii.", "nc")
351BUILTIN(__builtin_isfinite,   "i.", "nc")
352BUILTIN(__builtin_isinf,      "i.", "nc")
353BUILTIN(__builtin_isinf_sign, "i.", "nc")
354BUILTIN(__builtin_isnan,      "i.", "nc")
355BUILTIN(__builtin_isnormal,   "i.", "nc")
356
357// FP signbit builtins
358BUILTIN(__builtin_signbit, "id", "nc")
359BUILTIN(__builtin_signbitf, "if", "nc")
360BUILTIN(__builtin_signbitl, "iLd", "nc")
361
362// Builtins for arithmetic.
363BUILTIN(__builtin_clz  , "iUi"  , "nc")
364BUILTIN(__builtin_clzl , "iULi" , "nc")
365BUILTIN(__builtin_clzll, "iULLi", "nc")
366// TODO: int clzimax(uintmax_t)
367BUILTIN(__builtin_ctz  , "iUi"  , "nc")
368BUILTIN(__builtin_ctzl , "iULi" , "nc")
369BUILTIN(__builtin_ctzll, "iULLi", "nc")
370// TODO: int ctzimax(uintmax_t)
371BUILTIN(__builtin_ffs  , "iUi"  , "nc")
372BUILTIN(__builtin_ffsl , "iULi" , "nc")
373BUILTIN(__builtin_ffsll, "iULLi", "nc")
374BUILTIN(__builtin_parity  , "iUi"  , "nc")
375BUILTIN(__builtin_parityl , "iULi" , "nc")
376BUILTIN(__builtin_parityll, "iULLi", "nc")
377BUILTIN(__builtin_popcount  , "iUi"  , "nc")
378BUILTIN(__builtin_popcountl , "iULi" , "nc")
379BUILTIN(__builtin_popcountll, "iULLi", "nc")
380
381// FIXME: These type signatures are not correct for targets with int != 32-bits
382// or with ULL != 64-bits.
383BUILTIN(__builtin_bswap32, "UiUi", "nc")
384BUILTIN(__builtin_bswap64, "ULLiULLi", "nc")
385
386// Random GCC builtins
387BUILTIN(__builtin_constant_p, "i.", "nct")
388BUILTIN(__builtin_classify_type, "i.", "nct")
389BUILTIN(__builtin___CFStringMakeConstantString, "FC*cC*", "nc")
390BUILTIN(__builtin___NSStringMakeConstantString, "FC*cC*", "nc")
391BUILTIN(__builtin_va_start, "vA.", "n")
392BUILTIN(__builtin_va_end, "vA", "n")
393BUILTIN(__builtin_va_copy, "vAA", "n")
394BUILTIN(__builtin_stdarg_start, "vA.", "n")
395BUILTIN(__builtin_bcmp, "iv*v*z", "n")
396BUILTIN(__builtin_bcopy, "vv*v*z", "n")
397BUILTIN(__builtin_bzero, "vv*z", "nF")
398BUILTIN(__builtin_fprintf, "iP*cC*.", "Fp:1:")
399BUILTIN(__builtin_memchr, "v*vC*iz", "nF")
400BUILTIN(__builtin_memcmp, "ivC*vC*z", "nF")
401BUILTIN(__builtin_memcpy, "v*v*vC*z", "nF")
402BUILTIN(__builtin_memmove, "v*v*vC*z", "nF")
403BUILTIN(__builtin_mempcpy, "v*v*vC*z", "nF")
404BUILTIN(__builtin_memset, "v*v*iz", "nF")
405BUILTIN(__builtin_printf, "icC*.", "Fp:0:")
406BUILTIN(__builtin_stpcpy, "c*c*cC*", "nF")
407BUILTIN(__builtin_stpncpy, "c*c*cC*z", "nF")
408BUILTIN(__builtin_strcasecmp, "icC*cC*", "nF")
409BUILTIN(__builtin_strcat, "c*c*cC*", "nF")
410BUILTIN(__builtin_strchr, "c*cC*i", "nF")
411BUILTIN(__builtin_strcmp, "icC*cC*", "nF")
412BUILTIN(__builtin_strcpy, "c*c*cC*", "nF")
413BUILTIN(__builtin_strcspn, "zcC*cC*", "nF")
414BUILTIN(__builtin_strdup, "c*cC*", "nF")
415BUILTIN(__builtin_strlen, "zcC*", "nF")
416BUILTIN(__builtin_strncasecmp, "icC*cC*z", "nF")
417BUILTIN(__builtin_strncat, "c*c*cC*z", "nF")
418BUILTIN(__builtin_strncmp, "icC*cC*z", "nF")
419BUILTIN(__builtin_strncpy, "c*c*cC*z", "nF")
420BUILTIN(__builtin_strndup, "c*cC*z", "nF")
421BUILTIN(__builtin_strpbrk, "c*cC*cC*", "nF")
422BUILTIN(__builtin_strrchr, "c*cC*i", "nF")
423BUILTIN(__builtin_strspn, "zcC*cC*", "nF")
424BUILTIN(__builtin_strstr, "c*cC*cC*", "nF")
425BUILTIN(__builtin_return_address, "v*IUi", "n")
426BUILTIN(__builtin_extract_return_addr, "v*v*", "n")
427BUILTIN(__builtin_frame_address, "v*IUi", "n")
428BUILTIN(__builtin_flt_rounds, "i", "nc")
429BUILTIN(__builtin_setjmp, "iv**", "")
430BUILTIN(__builtin_longjmp, "vv**i", "r")
431BUILTIN(__builtin_unwind_init, "v", "")
432BUILTIN(__builtin_eh_return_data_regno, "iIi", "nc")
433BUILTIN(__builtin_snprintf, "ic*zcC*.", "nFp:2:")
434BUILTIN(__builtin_vsprintf, "ic*cC*a", "nFP:1:")
435BUILTIN(__builtin_vsnprintf, "ic*zcC*a", "nFP:2:")
436
437// GCC exception builtins
438BUILTIN(__builtin_eh_return, "vzv*", "r") // FIXME: Takes intptr_t, not size_t!
439BUILTIN(__builtin_frob_return_addr, "v*v*", "n")
440BUILTIN(__builtin_dwarf_cfa, "v*", "n")
441BUILTIN(__builtin_init_dwarf_reg_size_table, "vv*", "n")
442BUILTIN(__builtin_dwarf_sp_column, "Ui", "n")
443BUILTIN(__builtin_extend_pointer, "ULLiv*", "n") // _Unwind_Word == uint64_t
444
445// GCC Object size checking builtins
446BUILTIN(__builtin_object_size, "zvC*i", "n")
447BUILTIN(__builtin___memcpy_chk, "v*v*vC*zz", "nF")
448BUILTIN(__builtin___memmove_chk, "v*v*vC*zz", "nF")
449BUILTIN(__builtin___mempcpy_chk, "v*v*vC*zz", "nF")
450BUILTIN(__builtin___memset_chk, "v*v*izz", "nF")
451BUILTIN(__builtin___stpcpy_chk, "c*c*cC*z", "nF")
452BUILTIN(__builtin___strcat_chk, "c*c*cC*z", "nF")
453BUILTIN(__builtin___strcpy_chk, "c*c*cC*z", "nF")
454BUILTIN(__builtin___strncat_chk, "c*c*cC*zz", "nF")
455BUILTIN(__builtin___strncpy_chk, "c*c*cC*zz", "nF")
456BUILTIN(__builtin___stpncpy_chk, "c*c*cC*zz", "nF")
457BUILTIN(__builtin___snprintf_chk, "ic*zizcC*.", "Fp:4:")
458BUILTIN(__builtin___sprintf_chk, "ic*izcC*.", "Fp:3:")
459BUILTIN(__builtin___vsnprintf_chk, "ic*zizcC*a", "FP:4:")
460BUILTIN(__builtin___vsprintf_chk, "ic*izcC*a", "FP:3:")
461BUILTIN(__builtin___fprintf_chk, "iP*icC*.", "Fp:2:")
462BUILTIN(__builtin___printf_chk, "iicC*.", "Fp:1:")
463BUILTIN(__builtin___vfprintf_chk, "iP*icC*a", "FP:2:")
464BUILTIN(__builtin___vprintf_chk, "iicC*a", "FP:1:")
465
466BUILTIN(__builtin_expect, "LiLiLi"   , "nc")
467BUILTIN(__builtin_prefetch, "vvC*.", "nc")
468BUILTIN(__builtin_trap, "v", "nr")
469BUILTIN(__builtin_unreachable, "v", "nr")
470BUILTIN(__builtin_shufflevector, "v."   , "nc")
471BUILTIN(__builtin_alloca, "v*z"   , "n")
472
473// "Overloaded" Atomic operator builtins.  These are overloaded to support data
474// types of i8, i16, i32, i64, and i128.  The front-end sees calls to the
475// non-suffixed version of these (which has a bogus type) and transforms them to
476// the right overloaded version in Sema (plus casts).
477
478// FIXME: These assume that char -> i8, short -> i16, int -> i32,
479// long long -> i64.
480
481BUILTIN(__sync_fetch_and_add, "v.", "")
482BUILTIN(__sync_fetch_and_add_1, "ccD*c.", "n")
483BUILTIN(__sync_fetch_and_add_2, "ssD*s.", "n")
484BUILTIN(__sync_fetch_and_add_4, "iiD*i.", "n")
485BUILTIN(__sync_fetch_and_add_8, "LLiLLiD*LLi.", "n")
486BUILTIN(__sync_fetch_and_add_16, "LLLiLLLiD*LLLi.", "n")
487
488BUILTIN(__sync_fetch_and_sub, "v.", "")
489BUILTIN(__sync_fetch_and_sub_1, "ccD*c.", "n")
490BUILTIN(__sync_fetch_and_sub_2, "ssD*s.", "n")
491BUILTIN(__sync_fetch_and_sub_4, "iiD*i.", "n")
492BUILTIN(__sync_fetch_and_sub_8, "LLiLLiD*LLi.", "n")
493BUILTIN(__sync_fetch_and_sub_16, "LLLiLLLiD*LLLi.", "n")
494
495BUILTIN(__sync_fetch_and_or, "v.", "")
496BUILTIN(__sync_fetch_and_or_1, "ccD*c.", "n")
497BUILTIN(__sync_fetch_and_or_2, "ssD*s.", "n")
498BUILTIN(__sync_fetch_and_or_4, "iiD*i.", "n")
499BUILTIN(__sync_fetch_and_or_8, "LLiLLiD*LLi.", "n")
500BUILTIN(__sync_fetch_and_or_16, "LLLiLLLiD*LLLi.", "n")
501
502BUILTIN(__sync_fetch_and_and, "v.", "")
503BUILTIN(__sync_fetch_and_and_1, "ccD*c.", "n")
504BUILTIN(__sync_fetch_and_and_2, "ssD*s.", "n")
505BUILTIN(__sync_fetch_and_and_4, "iiD*i.", "n")
506BUILTIN(__sync_fetch_and_and_8, "LLiLLiD*LLi.", "n")
507BUILTIN(__sync_fetch_and_and_16, "LLLiLLLiD*LLLi.", "n")
508
509BUILTIN(__sync_fetch_and_xor, "v.", "")
510BUILTIN(__sync_fetch_and_xor_1, "ccD*c.", "n")
511BUILTIN(__sync_fetch_and_xor_2, "ssD*s.", "n")
512BUILTIN(__sync_fetch_and_xor_4, "iiD*i.", "n")
513BUILTIN(__sync_fetch_and_xor_8, "LLiLLiD*LLi.", "n")
514BUILTIN(__sync_fetch_and_xor_16, "LLLiLLLiD*LLLi.", "n")
515
516
517BUILTIN(__sync_add_and_fetch, "v.", "")
518BUILTIN(__sync_add_and_fetch_1, "ccD*c.", "n")
519BUILTIN(__sync_add_and_fetch_2, "ssD*s.", "n")
520BUILTIN(__sync_add_and_fetch_4, "iiD*i.", "n")
521BUILTIN(__sync_add_and_fetch_8, "LLiLLiD*LLi.", "n")
522BUILTIN(__sync_add_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
523
524BUILTIN(__sync_sub_and_fetch, "v.", "")
525BUILTIN(__sync_sub_and_fetch_1, "ccD*c.", "n")
526BUILTIN(__sync_sub_and_fetch_2, "ssD*s.", "n")
527BUILTIN(__sync_sub_and_fetch_4, "iiD*i.", "n")
528BUILTIN(__sync_sub_and_fetch_8, "LLiLLiD*LLi.", "n")
529BUILTIN(__sync_sub_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
530
531BUILTIN(__sync_or_and_fetch, "v.", "")
532BUILTIN(__sync_or_and_fetch_1, "ccD*c.", "n")
533BUILTIN(__sync_or_and_fetch_2, "ssD*s.", "n")
534BUILTIN(__sync_or_and_fetch_4, "iiD*i.", "n")
535BUILTIN(__sync_or_and_fetch_8, "LLiLLiD*LLi.", "n")
536BUILTIN(__sync_or_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
537
538BUILTIN(__sync_and_and_fetch, "v.", "")
539BUILTIN(__sync_and_and_fetch_1, "ccD*c.", "n")
540BUILTIN(__sync_and_and_fetch_2, "ssD*s.", "n")
541BUILTIN(__sync_and_and_fetch_4, "iiD*i.", "n")
542BUILTIN(__sync_and_and_fetch_8, "LLiLLiD*LLi.", "n")
543BUILTIN(__sync_and_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
544
545BUILTIN(__sync_xor_and_fetch, "v.", "")
546BUILTIN(__sync_xor_and_fetch_1, "ccD*c.", "n")
547BUILTIN(__sync_xor_and_fetch_2, "ssD*s.", "n")
548BUILTIN(__sync_xor_and_fetch_4, "iiD*i.", "n")
549BUILTIN(__sync_xor_and_fetch_8, "LLiLLiD*LLi.", "n")
550BUILTIN(__sync_xor_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
551
552BUILTIN(__sync_bool_compare_and_swap, "v.", "")
553BUILTIN(__sync_bool_compare_and_swap_1, "bcD*cc.", "n")
554BUILTIN(__sync_bool_compare_and_swap_2, "bsD*ss.", "n")
555BUILTIN(__sync_bool_compare_and_swap_4, "biD*ii.", "n")
556BUILTIN(__sync_bool_compare_and_swap_8, "bLLiD*LLiLLi.", "n")
557BUILTIN(__sync_bool_compare_and_swap_16, "bLLLiD*LLLiLLLi.", "n")
558
559BUILTIN(__sync_val_compare_and_swap, "v.", "")
560BUILTIN(__sync_val_compare_and_swap_1, "ccD*cc.", "n")
561BUILTIN(__sync_val_compare_and_swap_2, "ssD*ss.", "n")
562BUILTIN(__sync_val_compare_and_swap_4, "iiD*ii.", "n")
563BUILTIN(__sync_val_compare_and_swap_8, "LLiLLiD*LLiLLi.", "n")
564BUILTIN(__sync_val_compare_and_swap_16, "LLLiLLLiD*LLLiLLLi.", "n")
565
566BUILTIN(__sync_lock_test_and_set, "v.", "")
567BUILTIN(__sync_lock_test_and_set_1, "ccD*c.", "n")
568BUILTIN(__sync_lock_test_and_set_2, "ssD*s.", "n")
569BUILTIN(__sync_lock_test_and_set_4, "iiD*i.", "n")
570BUILTIN(__sync_lock_test_and_set_8, "LLiLLiD*LLi.", "n")
571BUILTIN(__sync_lock_test_and_set_16, "LLLiLLLiD*LLLi.", "n")
572
573BUILTIN(__sync_lock_release, "v.", "")
574BUILTIN(__sync_lock_release_1, "vcD*.", "n")
575BUILTIN(__sync_lock_release_2, "vsD*.", "n")
576BUILTIN(__sync_lock_release_4, "viD*.", "n")
577BUILTIN(__sync_lock_release_8, "vLLiD*.", "n")
578BUILTIN(__sync_lock_release_16, "vLLLiD*.", "n")
579
580BUILTIN(__sync_swap, "v.", "")
581BUILTIN(__sync_swap_1, "ccD*c.", "n")
582BUILTIN(__sync_swap_2, "ssD*s.", "n")
583BUILTIN(__sync_swap_4, "iiD*i.", "n")
584BUILTIN(__sync_swap_8, "LLiLLiD*LLi.", "n")
585BUILTIN(__sync_swap_16, "LLLiLLLiD*LLLi.", "n")
586
587
588
589// Non-overloaded atomic builtins.
590BUILTIN(__sync_synchronize, "v.", "n")
591// LLVM instruction builtin [Clang extension].
592BUILTIN(__builtin_llvm_memory_barrier,"vbbbbb", "n")
593// GCC does not support these, they are a Clang extension.
594BUILTIN(__sync_fetch_and_min, "iiD*i", "n")
595BUILTIN(__sync_fetch_and_max, "iiD*i", "n")
596BUILTIN(__sync_fetch_and_umin, "UiUiD*Ui", "n")
597BUILTIN(__sync_fetch_and_umax, "UiUiD*Ui", "n")
598
599// Random libc builtins.
600BUILTIN(__builtin_abort, "v", "Fnr")
601BUILTIN(__builtin_index, "c*cC*i", "Fn")
602BUILTIN(__builtin_rindex, "c*cC*i", "Fn")
603
604// Microsoft builtins.
605BUILTIN(__assume, "vb", "n")
606BUILTIN(__noop, "v.", "n")
607BUILTIN(__debugbreak, "v", "n")
608
609
610// C99 library functions
611// C99 stdlib.h
612LIBBUILTIN(abort, "v",            "fr",    "stdlib.h", ALL_LANGUAGES)
613LIBBUILTIN(calloc, "v*zz",        "f",     "stdlib.h", ALL_LANGUAGES)
614LIBBUILTIN(exit, "vi",            "fr",    "stdlib.h", ALL_LANGUAGES)
615LIBBUILTIN(_Exit, "vi",           "fr",    "stdlib.h", ALL_LANGUAGES)
616LIBBUILTIN(malloc, "v*z",         "f",     "stdlib.h", ALL_LANGUAGES)
617LIBBUILTIN(realloc, "v*v*z",      "f",     "stdlib.h", ALL_LANGUAGES)
618// C99 string.h
619LIBBUILTIN(memcpy, "v*v*vC*z",    "f",     "string.h", ALL_LANGUAGES)
620LIBBUILTIN(memmove, "v*v*vC*z",   "f",     "string.h", ALL_LANGUAGES)
621LIBBUILTIN(strcpy, "c*c*cC*",     "f",     "string.h", ALL_LANGUAGES)
622LIBBUILTIN(strncpy, "c*c*cC*z",   "f",     "string.h", ALL_LANGUAGES)
623LIBBUILTIN(strcat, "c*c*cC*",     "f",     "string.h", ALL_LANGUAGES)
624LIBBUILTIN(strncat, "c*c*cC*z",   "f",     "string.h", ALL_LANGUAGES)
625LIBBUILTIN(strxfrm, "zc*cC*z",    "f",     "string.h", ALL_LANGUAGES)
626LIBBUILTIN(memchr, "v*vC*iz",     "f",     "string.h", ALL_LANGUAGES)
627LIBBUILTIN(strchr, "c*cC*i",      "f",     "string.h", ALL_LANGUAGES)
628LIBBUILTIN(strcspn, "zcC*cC*",    "f",     "string.h", ALL_LANGUAGES)
629LIBBUILTIN(strpbrk, "c*cC*cC*",   "f",     "string.h", ALL_LANGUAGES)
630LIBBUILTIN(strrchr, "c*cC*i",     "f",     "string.h", ALL_LANGUAGES)
631LIBBUILTIN(strspn, "zcC*cC*",     "f",     "string.h", ALL_LANGUAGES)
632LIBBUILTIN(strstr, "c*cC*cC*",    "f",     "string.h", ALL_LANGUAGES)
633LIBBUILTIN(strtok, "c*c*cC*",     "f",     "string.h", ALL_LANGUAGES)
634LIBBUILTIN(memset, "v*v*iz",      "f",     "string.h", ALL_LANGUAGES)
635LIBBUILTIN(strerror, "c*i",       "f",     "string.h", ALL_LANGUAGES)
636LIBBUILTIN(strlen, "zcC*",        "f",     "string.h", ALL_LANGUAGES)
637// C99 stdio.h
638LIBBUILTIN(printf, "icC*.",       "fp:0:", "stdio.h", ALL_LANGUAGES)
639LIBBUILTIN(fprintf, "iP*cC*.",    "fp:1:", "stdio.h", ALL_LANGUAGES)
640LIBBUILTIN(snprintf, "ic*zcC*.",  "fp:2:", "stdio.h", ALL_LANGUAGES)
641LIBBUILTIN(sprintf, "ic*cC*.",    "fp:1:", "stdio.h", ALL_LANGUAGES)
642LIBBUILTIN(vprintf, "icC*a",      "fP:0:", "stdio.h", ALL_LANGUAGES)
643LIBBUILTIN(vfprintf, "i.",        "fP:1:", "stdio.h", ALL_LANGUAGES)
644LIBBUILTIN(vsnprintf, "ic*zcC*a", "fP:2:", "stdio.h", ALL_LANGUAGES)
645LIBBUILTIN(vsprintf, "ic*cC*a",   "fP:1:", "stdio.h", ALL_LANGUAGES)
646LIBBUILTIN(scanf, "icC*.",       "fs:0:", "stdio.h", ALL_LANGUAGES)
647// C99
648LIBBUILTIN(longjmp, "vJi",        "fr",    "setjmp.h", ALL_LANGUAGES)
649
650// Non-C library functions
651// FIXME: Non-C-standard stuff shouldn't be builtins in non-GNU mode!
652LIBBUILTIN(alloca, "v*z",         "f",     "stdlib.h", ALL_LANGUAGES)
653// POSIX string.h
654LIBBUILTIN(stpcpy, "c*c*cC*",     "f",     "string.h", ALL_LANGUAGES)
655LIBBUILTIN(stpncpy, "c*c*cC*z",   "f",     "string.h", ALL_LANGUAGES)
656LIBBUILTIN(strdup, "c*cC*",       "f",     "string.h", ALL_LANGUAGES)
657LIBBUILTIN(strndup, "c*cC*z",     "f",     "string.h", ALL_LANGUAGES)
658// POSIX strings.h
659LIBBUILTIN(index, "c*cC*i",       "f",     "strings.h", ALL_LANGUAGES)
660LIBBUILTIN(rindex, "c*cC*i",      "f",     "strings.h", ALL_LANGUAGES)
661LIBBUILTIN(bzero, "vv*z",         "f",     "strings.h", ALL_LANGUAGES)
662// POSIX unistd.h
663LIBBUILTIN(_exit, "vi",           "fr",    "unistd.h", ALL_LANGUAGES)
664// POSIX setjmp.h
665LIBBUILTIN(_longjmp, "vJi",       "fr",    "setjmp.h", ALL_LANGUAGES)
666LIBBUILTIN(siglongjmp, "vSJi",    "fr",    "setjmp.h", ALL_LANGUAGES)
667//   id objc_msgSend(id, SEL, ...)
668LIBBUILTIN(objc_msgSend, "GGH.",   "f",     "objc/message.h", OBJC_LANG)
669
670// long double objc_msgSend_fpret(id self, SEL op, ...)
671LIBBUILTIN(objc_msgSend_fpret, "LdGH.", "f", "objc/message.h", OBJC_LANG)
672// id objc_msgSend_stret (id, SEL, ...)
673LIBBUILTIN(objc_msgSend_stret, "GGH.", "f", "objc/message.h", OBJC_LANG)
674// id objc_msgSendSuper(struct objc_super *super, SEL op, ...)
675LIBBUILTIN(objc_msgSendSuper, "Gv*H.", "f", "objc/message.h", OBJC_LANG)
676// void objc_msgSendSuper_stret(struct objc_super *super, SEL op, ...)
677LIBBUILTIN(objc_msgSendSuper_stret, "vv*H.", "f", "objc/message.h", OBJC_LANG)
678//   id objc_getClass(const char *name)
679LIBBUILTIN(objc_getClass, "GcC*",   "f",     "objc/runtime.h", OBJC_LANG)
680//   id objc_getMetaClass(const char *name)
681LIBBUILTIN(objc_getMetaClass, "GcC*",   "f", "objc/runtime.h", OBJC_LANG)
682// void objc_enumerationMutation(id)
683LIBBUILTIN(objc_enumerationMutation, "vG", "f", "objc/runtime.h", OBJC_LANG)
684
685// id objc_read_weak(id *location)
686LIBBUILTIN(objc_read_weak, "GG*", "f", "/objc/objc-auto.h", OBJC_LANG)
687// id objc_assign_weak(id value, id *location)
688LIBBUILTIN(objc_assign_weak, "GGG*", "f", "/objc/objc-auto.h", OBJC_LANG)
689// id objc_assign_ivar(id value, id dest, ptrdiff_t offset)
690// FIXME. Darwin has ptrdiff_t typedef'ed to int.
691LIBBUILTIN(objc_assign_ivar, "GGGi", "f", "/objc/objc-auto.h", OBJC_LANG)
692// id objc_assign_global(id val, id *dest)
693LIBBUILTIN(objc_assign_global, "GGG*", "f", "/objc/objc-auto.h", OBJC_LANG)
694// id objc_assign_strongCast(id val, id *dest
695LIBBUILTIN(objc_assign_strongCast, "GGG*", "f", "/objc/objc-auto.h", OBJC_LANG)
696
697// id objc_exception_extract(void *localExceptionData)
698LIBBUILTIN(objc_exception_extract, "Gv*", "f", "/objc/objc-exception.h", OBJC_LANG)
699// void objc_exception_try_enter(void *localExceptionData)
700LIBBUILTIN(objc_exception_try_enter, "vv*", "f", "/objc/objc-exception.h", OBJC_LANG)
701// void objc_exception_try_exit(void *localExceptionData)
702LIBBUILTIN(objc_exception_try_exit, "vv*", "f", "/objc/objc-exception.h", OBJC_LANG)
703// int objc_exception_match(Class exceptionClass, id exception)
704LIBBUILTIN(objc_exception_match, "iGG", "f", "/objc/objc-exception.h", OBJC_LANG)
705// void objc_exception_throw(id exception)
706LIBBUILTIN(objc_exception_throw, "vG", "f", "/objc/objc-exception.h", OBJC_LANG)
707
708// int objc_sync_enter(id obj)
709LIBBUILTIN(objc_sync_enter, "iG", "f", "/objc/objc-sync.h", OBJC_LANG)
710// int objc_sync_exit(id obj)
711LIBBUILTIN(objc_sync_exit, "iG", "f", "/objc/objc-sync.h", OBJC_LANG)
712
713BUILTIN(__builtin_objc_memmove_collectable, "v*v*vC*z", "nF")
714
715// Builtin math library functions
716LIBBUILTIN(pow, "ddd", "fe", "math.h", ALL_LANGUAGES)
717LIBBUILTIN(powl, "LdLdLd", "fe", "math.h", ALL_LANGUAGES)
718LIBBUILTIN(powf, "fff", "fe", "math.h", ALL_LANGUAGES)
719
720LIBBUILTIN(sqrt, "dd", "fe", "math.h", ALL_LANGUAGES)
721LIBBUILTIN(sqrtl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
722LIBBUILTIN(sqrtf, "ff", "fe", "math.h", ALL_LANGUAGES)
723
724LIBBUILTIN(sin, "dd", "fe", "math.h", ALL_LANGUAGES)
725LIBBUILTIN(sinl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
726LIBBUILTIN(sinf, "ff", "fe", "math.h", ALL_LANGUAGES)
727
728LIBBUILTIN(cos, "dd", "fe", "math.h", ALL_LANGUAGES)
729LIBBUILTIN(cosl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
730LIBBUILTIN(cosf, "ff", "fe", "math.h", ALL_LANGUAGES)
731
732LIBBUILTIN(fma, "dddd", "fc", "math.h", ALL_LANGUAGES)
733LIBBUILTIN(fmal, "LdLdLdLd", "fc", "math.h", ALL_LANGUAGES)
734LIBBUILTIN(fmaf, "ffff", "fc", "math.h", ALL_LANGUAGES)
735
736// Blocks runtime Builtin math library functions
737LIBBUILTIN(_Block_object_assign, "vv*vC*iC", "f", "Blocks.h", ALL_LANGUAGES)
738LIBBUILTIN(_Block_object_dispose, "vvC*iC", "f", "Blocks.h", ALL_LANGUAGES)
739// FIXME: Also declare NSConcreteGlobalBlock and NSConcreteStackBlock.
740
741#undef BUILTIN
742#undef LIBBUILTIN
743