]> gcc.gnu.org Git - gcc.git/blame - gcc/builtins.def
builtins.def: Fix comment formatting.
[gcc.git] / gcc / builtins.def
CommitLineData
cb1072f4
KG
1/* This file contains the definitions and documentation for the
2 builtins used in the GNU compiler.
341e3d11 3 Copyright (C) 2000, 2001 Free Software Foundation, Inc.
cb1072f4 4
1322177d 5This file is part of GCC.
cb1072f4 6
1322177d
LB
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 2, or (at your option) any later
10version.
cb1072f4 11
1322177d
LB
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
cb1072f4
KG
16
17You should have received a copy of the GNU General Public License
1322177d
LB
18along with GCC; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA
2002111-1307, USA. */
cb1072f4 21
10841285
MM
22/* Before including this file, you should define a macro:
23
24 DEF_BUILTIN (ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P,
df061a43 25 FALLBACK_P, NONANSI_P, ATTRS)
10841285
MM
26
27 This macro will be called once for each builtin function. The
28 ENUM will be of type `enum built_in_function', and will indicate
29 which builtin function is being processed. The NAME of the builtin
30 function (which will always start with `__builtin_') is a string
31 literal. The CLASS is of type `enum built_in_class' and indicates
32 what kind of builtin is being processed.
33
34 Some builtins are actually two separate functions. For example,
35 for `strcmp' there are two builtin functions; `__builtin_strcmp'
36 and `strcmp' itself. Both behave identically. Other builtins
37 define only the `__builtin' variant. If BOTH_P is TRUE, then this
38 builtin has both variants; otherwise, it is has only the first
39 variant.
40
41 TYPE indicates the type of the function. The symbols correspond to
42 enumerals from builtin-types.def. If BOTH_P is true, then LIBTYPE
43 is the type of the non-`__builtin_' variant. Otherwise, LIBTYPE
44 should be ignored.
45
46 If FALLBACK_P is true then, if for some reason, the compiler cannot
47 expand the builtin function directly, it will call the
48 corresponding library function (which does not have the
49 `__builtin_' prefix.
50
51 If NONANSI_P is true, then the non-`__builtin_' variant is not an
52 ANSI/ISO library function, and so we should pretend it does not
df061a43
RS
53 exist when compiling in ANSI conformant mode.
54
55 ATTRs is an attribute list as defined in builtin-attrs.def that
56 describes the attributes of this builtin function. */
10841285
MM
57
58/* A GCC builtin (like __builtin_saveregs) is provided by the
59 compiler, but does not correspond to a function in the standard
60 library. */
61#undef DEF_GCC_BUILTIN
c2ef6d34 62#define DEF_GCC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
10841285 63 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
c2ef6d34 64 false, false, false, ATTRS)
10841285
MM
65
66
67/* A fallback builtin is a builtin (like __builtin_puts) that falls
68 back to the corresopnding library function if necessary -- but
69 for which we should not introduce the non-`__builtin' variant of
70 the name. */
71#undef DEF_FALLBACK_BUILTIN
df061a43 72#define DEF_FALLBACK_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
10841285 73 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
df061a43 74 false, true, false, ATTRS)
10841285 75
b4c984fb
KG
76/* Like DEF_FALLBACK_BUILTIN, except that the function is not one that
77 is specified by ANSI/ISO C. So, when we're being fully conformant
78 we ignore the version of these builtins that does not begin with
79 __builtin. */
80#undef DEF_EXT_FALLBACK_BUILTIN
81#define DEF_EXT_FALLBACK_BUILTIN(ENUM, NAME, TYPE) \
82 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
df061a43 83 false, true, true, ATTR_NOTHROW_LIST)
b4c984fb 84
10841285
MM
85/* A library builtin (like __builtin_strchr) is a builtin equivalent
86 of an ANSI/ISO standard library function. In addition to the
5519a4f9 87 `__builtin' version, we will create an ordinary version (e.g,
10841285
MM
88 `strchr') as well. If we cannot compute the answer using the
89 builtin function, we will fall back to the standard library
991b6592 90 version. */
10841285 91#undef DEF_LIB_BUILTIN
df061a43 92#define DEF_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
10841285 93 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
df061a43 94 true, true, false, ATTRS)
10841285
MM
95
96/* Like DEF_LIB_BUILTIN, except that a call to the builtin should
97 never fall back to the library version. */
98#undef DEF_LIB_ALWAYS_BUILTIN
99#define DEF_LIB_ALWAYS_BUILTIN(ENUM, NAME, TYPE) \
100 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
df061a43 101 true, false, true, ATTR_CONST_NOTHROW_LIST)
10841285
MM
102
103/* Like DEF_LIB_BUILTIN, except that the function is not one that is
104 specified by ANSI/ISO C. So, when we're being fully conformant we
105 ignore the version of these builtins that does not begin with
106 __builtin. */
107#undef DEF_EXT_LIB_BUILTIN
df061a43 108#define DEF_EXT_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
10841285 109 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
df061a43 110 true, true, true, ATTRS)
10841285
MM
111
112/* Like DEF_LIB_BUILTIN, except that the function is only a part of
113 the standard in C99 or above. */
114#undef DEF_C99_BUILTIN
115#define DEF_C99_BUILTIN(ENUM, NAME, TYPE) \
116 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
df061a43 117 true, !flag_isoc99, true, ATTR_NOTHROW_LIST)
10841285
MM
118
119/* Like DEF_LIB_BUILTIN, except that the function is expanded in the
120 front-end. */
121#undef DEF_FRONT_END_LIB_BUILTIN
df061a43 122#define DEF_FRONT_END_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
10841285 123 DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE, \
df061a43 124 true, true, false, ATTRS)
10841285 125
b4c984fb
KG
126/* Like DEF_FRONT_END_LIB_BUILTIN, except that the function is not one
127 that is specified by ANSI/ISO C. So, when we're being fully
128 conformant we ignore the version of these builtins that does not
129 begin with __builtin. */
130#undef DEF_EXT_FRONT_END_LIB_BUILTIN
df061a43 131#define DEF_EXT_FRONT_END_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
b4c984fb 132 DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE, \
df061a43 133 true, true, true, ATTRS)
b4c984fb 134
10841285
MM
135/* A built-in that is not currently used. */
136#undef DEF_UNUSED_BUILTIN
137#define DEF_UNUSED_BUILTIN(X) \
138 DEF_BUILTIN (X, (const char *) NULL, NOT_BUILT_IN, BT_LAST, \
df061a43 139 BT_LAST, false, false, false, ATTR_NOTHROW_LIST)
10841285
MM
140
141/* If SMALL_STACK is defined, then `alloca' is only defined in its
142 `__builtin' form. */
143#if SMALL_STACK
144DEF_FALLBACK_BUILTIN(BUILT_IN_ALLOCA,
145 "__builtin_alloca",
df061a43
RS
146 BT_FN_PTR_SIZE,
147 ATTR_MALLOC_NOTHROW_LIST)
10841285
MM
148#else
149DEF_EXT_LIB_BUILTIN(BUILT_IN_ALLOCA,
150 "__builtin_alloca",
df061a43
RS
151 BT_FN_PTR_SIZE,
152 ATTR_MALLOC_NOTHROW_LIST)
10841285
MM
153#endif
154
155DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_ABS,
156 "__builtin_abs",
157 BT_FN_INT_INT)
158DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_LABS,
159 "__builtin_labs",
160 BT_FN_LONG_LONG)
161
162DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABS,
163 "__builtin_fabs",
164 BT_FN_DOUBLE_DOUBLE)
165DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABSF,
166 "__builtin_fabsf",
167 BT_FN_FLOAT_FLOAT)
168DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABSL,
169 "__builtin_fabsl",
170 BT_FN_LONG_DOUBLE_LONG_DOUBLE)
171
172DEF_C99_BUILTIN(BUILT_IN_LLABS,
173 "__builtin_llabs",
174 BT_FN_LONGLONG_LONGLONG)
175DEF_C99_BUILTIN(BUILT_IN_IMAXABS,
176 "__builtin_imaxabs",
177 BT_FN_INTMAX_INTMAX)
178DEF_C99_BUILTIN(BUILT_IN_CONJ,
179 "__builtin_conj",
180 BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE)
181DEF_C99_BUILTIN(BUILT_IN_CONJF,
182 "__builtin_conjf",
183 BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT)
184DEF_C99_BUILTIN(BUILT_IN_CONJL,
185 "__builtin_conjl",
186 BT_FN_COMPLEX_LONG_DOUBLE_COMPLEX_LONG_DOUBLE)
187DEF_C99_BUILTIN(BUILT_IN_CREAL,
188 "__builtin_creal",
189 BT_FN_DOUBLE_COMPLEX_DOUBLE)
190DEF_C99_BUILTIN(BUILT_IN_CREALF,
191 "__builtin_crealf",
192 BT_FN_FLOAT_COMPLEX_FLOAT)
193DEF_C99_BUILTIN(BUILT_IN_CREALL,
194 "__builtin_creall",
195 BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE)
196DEF_C99_BUILTIN(BUILT_IN_CIMAG,
197 "__builtin_cimag",
198 BT_FN_DOUBLE_COMPLEX_DOUBLE)
199DEF_C99_BUILTIN(BUILT_IN_CIMAGF,
200 "__builtin_cimagf",
201 BT_FN_FLOAT_COMPLEX_FLOAT)
202DEF_C99_BUILTIN(BUILT_IN_CIMAGL,
203 "__builtin_cimagl",
204 BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE)
205
206DEF_UNUSED_BUILTIN(BUILT_IN_DIV)
207DEF_UNUSED_BUILTIN(BUILT_IN_LDIV)
208DEF_UNUSED_BUILTIN(BUILT_IN_FFLOOR)
209DEF_UNUSED_BUILTIN(BUILT_IN_FCEIL)
210DEF_UNUSED_BUILTIN(BUILT_IN_FMOD)
211DEF_UNUSED_BUILTIN(BUILT_IN_FREM)
212
213/* The system prototypes for `bzero' and `bcmp' functions have many
214 variations, so don't specify parameters to avoid conflicts. The
215 expand_* functions check the argument types anyway. */
216DEF_BUILTIN (BUILT_IN_BZERO,
217 "__builtin_bzero",
218 BUILT_IN_NORMAL,
f458d1d5 219 BT_FN_VOID_PTR_SIZE,
10841285 220 BT_FN_VOID_VAR,
df061a43
RS
221 true, true, true,
222 ATTR_NOTHROW_LIST)
10841285
MM
223DEF_BUILTIN (BUILT_IN_BCMP,
224 "__builtin_bcmp",
225 BUILT_IN_NORMAL,
f458d1d5 226 BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
10841285 227 BT_FN_INT_VAR,
df061a43
RS
228 true, true, true,
229 ATTR_PURE_NOTHROW_LIST)
10841285
MM
230
231DEF_EXT_LIB_BUILTIN(BUILT_IN_FFS,
232 "__builtin_ffs",
df061a43
RS
233 BT_FN_INT_INT,
234 ATTR_CONST_NOTHROW_LIST)
10841285
MM
235DEF_EXT_LIB_BUILTIN(BUILT_IN_INDEX,
236 "__builtin_index",
df061a43
RS
237 BT_FN_STRING_CONST_STRING_INT,
238 ATTR_PURE_NOTHROW_LIST)
10841285
MM
239DEF_EXT_LIB_BUILTIN(BUILT_IN_RINDEX,
240 "__builtin_rindex",
df061a43
RS
241 BT_FN_STRING_CONST_STRING_INT,
242 ATTR_PURE_NOTHROW_LIST)
10841285
MM
243
244DEF_LIB_BUILTIN(BUILT_IN_MEMCPY,
245 "__builtin_memcpy",
df061a43
RS
246 BT_FN_PTR_PTR_CONST_PTR_SIZE,
247 ATTR_NOTHROW_LIST)
10841285
MM
248DEF_LIB_BUILTIN(BUILT_IN_MEMCMP,
249 "__builtin_memcmp",
df061a43
RS
250 BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
251 ATTR_PURE_NOTHROW_LIST)
10841285
MM
252DEF_LIB_BUILTIN(BUILT_IN_MEMSET,
253 "__builtin_memset",
df061a43
RS
254 BT_FN_PTR_PTR_INT_SIZE,
255 ATTR_NOTHROW_LIST)
10841285
MM
256
257DEF_LIB_BUILTIN(BUILT_IN_STRCAT,
258 "__builtin_strcat",
df061a43
RS
259 BT_FN_STRING_STRING_CONST_STRING,
260 ATTR_NOTHROW_LIST)
10841285
MM
261DEF_LIB_BUILTIN(BUILT_IN_STRNCAT,
262 "__builtin_strncat",
df061a43
RS
263 BT_FN_STRING_STRING_CONST_STRING_SIZE,
264 ATTR_NOTHROW_LIST)
10841285
MM
265DEF_LIB_BUILTIN(BUILT_IN_STRCPY,
266 "__builtin_strcpy",
df061a43
RS
267 BT_FN_STRING_STRING_CONST_STRING,
268 ATTR_NOTHROW_LIST)
10841285
MM
269DEF_LIB_BUILTIN(BUILT_IN_STRNCPY,
270 "__builtin_strncpy",
df061a43
RS
271 BT_FN_STRING_STRING_CONST_STRING_SIZE,
272 ATTR_NOTHROW_LIST)
10841285
MM
273DEF_LIB_BUILTIN(BUILT_IN_STRCMP,
274 "__builtin_strcmp",
df061a43
RS
275 BT_FN_INT_CONST_STRING_CONST_STRING,
276 ATTR_PURE_NOTHROW_LIST)
10841285
MM
277DEF_LIB_BUILTIN(BUILT_IN_STRNCMP,
278 "__builtin_strncmp",
df061a43
RS
279 BT_FN_INT_CONST_STRING_CONST_STRING_SIZE,
280 ATTR_PURE_NOTHROW_LIST)
10841285
MM
281DEF_LIB_BUILTIN(BUILT_IN_STRLEN,
282 "__builtin_strlen",
df061a43
RS
283 BT_FN_SIZE_CONST_STRING,
284 ATTR_PURE_NOTHROW_LIST)
10841285
MM
285DEF_LIB_BUILTIN(BUILT_IN_STRSTR,
286 "__builtin_strstr",
df061a43
RS
287 BT_FN_STRING_CONST_STRING_CONST_STRING,
288 ATTR_PURE_NOTHROW_LIST)
10841285
MM
289DEF_LIB_BUILTIN(BUILT_IN_STRPBRK,
290 "__builtin_strpbrk",
df061a43
RS
291 BT_FN_STRING_CONST_STRING_CONST_STRING,
292 ATTR_PURE_NOTHROW_LIST)
10841285
MM
293DEF_LIB_BUILTIN(BUILT_IN_STRSPN,
294 "__builtin_strspn",
df061a43
RS
295 BT_FN_SIZE_CONST_STRING_CONST_STRING,
296 ATTR_PURE_NOTHROW_LIST)
10841285
MM
297DEF_LIB_BUILTIN(BUILT_IN_STRCSPN,
298 "__builtin_strcspn",
df061a43
RS
299 BT_FN_SIZE_CONST_STRING_CONST_STRING,
300 ATTR_PURE_NOTHROW_LIST)
10841285
MM
301DEF_LIB_BUILTIN(BUILT_IN_STRCHR,
302 "__builtin_strchr",
df061a43
RS
303 BT_FN_STRING_CONST_STRING_INT,
304 ATTR_PURE_NOTHROW_LIST)
10841285
MM
305DEF_LIB_BUILTIN(BUILT_IN_STRRCHR,
306 "__builtin_strrchr",
df061a43
RS
307 BT_FN_STRING_CONST_STRING_INT,
308 ATTR_PURE_NOTHROW_LIST)
10841285 309
dc6f4158
AJ
310DEF_LIB_BUILTIN(BUILT_IN_SQRT,
311 "__builtin_sqrt",
df061a43
RS
312 BT_FN_DOUBLE_DOUBLE,
313 flag_errno_math ? ATTR_NOTHROW_LIST
314 : (flag_unsafe_math_optimizations
315 ? ATTR_CONST_NOTHROW_LIST
316 : ATTR_PURE_NOTHROW_LIST))
10841285
MM
317DEF_LIB_BUILTIN(BUILT_IN_SIN,
318 "__builtin_sin",
df061a43
RS
319 BT_FN_DOUBLE_DOUBLE,
320 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
321 : ATTR_PURE_NOTHROW_LIST)
10841285
MM
322DEF_LIB_BUILTIN(BUILT_IN_COS,
323 "__builtin_cos",
df061a43
RS
324 BT_FN_DOUBLE_DOUBLE,
325 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
326 : ATTR_PURE_NOTHROW_LIST)
e7b489c8
RS
327DEF_LIB_BUILTIN(BUILT_IN_EXP,
328 "__builtin_exp",
329 BT_FN_DOUBLE_DOUBLE,
330 flag_errno_math ? ATTR_NOTHROW_LIST
331 : (flag_unsafe_math_optimizations
332 ? ATTR_CONST_NOTHROW_LIST
333 : ATTR_PURE_NOTHROW_LIST))
334DEF_LIB_BUILTIN(BUILT_IN_LOG,
335 "__builtin_log",
336 BT_FN_DOUBLE_DOUBLE,
337 flag_errno_math ? ATTR_NOTHROW_LIST
338 : (flag_unsafe_math_optimizations
339 ? ATTR_CONST_NOTHROW_LIST
340 : ATTR_PURE_NOTHROW_LIST))
10841285
MM
341DEF_LIB_BUILTIN(BUILT_IN_SQRTF,
342 "__builtin_sqrtf",
df061a43
RS
343 BT_FN_FLOAT_FLOAT,
344 flag_errno_math ? ATTR_NOTHROW_LIST
345 : (flag_unsafe_math_optimizations
346 ? ATTR_CONST_NOTHROW_LIST
347 : ATTR_PURE_NOTHROW_LIST))
10841285
MM
348DEF_LIB_BUILTIN(BUILT_IN_SINF,
349 "__builtin_sinf",
df061a43
RS
350 BT_FN_FLOAT_FLOAT,
351 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
352 : ATTR_PURE_NOTHROW_LIST)
10841285
MM
353DEF_LIB_BUILTIN(BUILT_IN_COSF,
354 "__builtin_cosf",
df061a43
RS
355 BT_FN_FLOAT_FLOAT,
356 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
357 : ATTR_PURE_NOTHROW_LIST)
e7b489c8
RS
358DEF_LIB_BUILTIN(BUILT_IN_EXPF,
359 "__builtin_expf",
360 BT_FN_FLOAT_FLOAT,
361 flag_errno_math ? ATTR_NOTHROW_LIST
362 : (flag_unsafe_math_optimizations
363 ? ATTR_CONST_NOTHROW_LIST
364 : ATTR_PURE_NOTHROW_LIST))
365DEF_LIB_BUILTIN(BUILT_IN_LOGF,
366 "__builtin_logf",
367 BT_FN_FLOAT_FLOAT,
368 flag_errno_math ? ATTR_NOTHROW_LIST
369 : (flag_unsafe_math_optimizations
370 ? ATTR_CONST_NOTHROW_LIST
371 : ATTR_PURE_NOTHROW_LIST))
10841285
MM
372DEF_LIB_BUILTIN(BUILT_IN_SQRTL,
373 "__builtin_sqrtl",
df061a43
RS
374 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
375 flag_errno_math ? ATTR_NOTHROW_LIST
376 : (flag_unsafe_math_optimizations
377 ? ATTR_CONST_NOTHROW_LIST
378 : ATTR_PURE_NOTHROW_LIST))
10841285
MM
379DEF_LIB_BUILTIN(BUILT_IN_SINL,
380 "__builtin_sinl",
df061a43
RS
381 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
382 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
383 : ATTR_PURE_NOTHROW_LIST)
10841285
MM
384DEF_LIB_BUILTIN(BUILT_IN_COSL,
385 "__builtin_cosl",
df061a43
RS
386 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
387 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
388 : ATTR_PURE_NOTHROW_LIST)
e7b489c8
RS
389DEF_LIB_BUILTIN(BUILT_IN_EXPL,
390 "__builtin_expl",
391 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
392 flag_errno_math ? ATTR_NOTHROW_LIST
393 : (flag_unsafe_math_optimizations
394 ? ATTR_CONST_NOTHROW_LIST
395 : ATTR_PURE_NOTHROW_LIST))
396DEF_LIB_BUILTIN(BUILT_IN_LOGL,
397 "__builtin_logl",
398 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
399 flag_errno_math ? ATTR_NOTHROW_LIST
400 : (flag_unsafe_math_optimizations
401 ? ATTR_CONST_NOTHROW_LIST
402 : ATTR_PURE_NOTHROW_LIST))
10841285 403
ab5e2615
RH
404DEF_GCC_BUILTIN(BUILT_IN_INF,
405 "__builtin_inf",
406 BT_FN_DOUBLE,
3aa4cad7 407 ATTR_CONST_NOTHROW_LIST)
ab5e2615
RH
408DEF_GCC_BUILTIN(BUILT_IN_INFF,
409 "__builtin_inff",
410 BT_FN_FLOAT,
3aa4cad7 411 ATTR_CONST_NOTHROW_LIST)
ab5e2615
RH
412DEF_GCC_BUILTIN(BUILT_IN_INFL,
413 "__builtin_infl",
414 BT_FN_LONG_DOUBLE,
3aa4cad7 415 ATTR_CONST_NOTHROW_LIST)
ab5e2615
RH
416
417DEF_GCC_BUILTIN(BUILT_IN_HUGE_VAL,
418 "__builtin_huge_val",
419 BT_FN_DOUBLE,
3aa4cad7 420 ATTR_CONST_NOTHROW_LIST)
ab5e2615
RH
421DEF_GCC_BUILTIN(BUILT_IN_HUGE_VALF,
422 "__builtin_huge_valf",
423 BT_FN_FLOAT,
3aa4cad7 424 ATTR_CONST_NOTHROW_LIST)
ab5e2615
RH
425DEF_GCC_BUILTIN(BUILT_IN_HUGE_VALL,
426 "__builtin_huge_vall",
427 BT_FN_LONG_DOUBLE,
3aa4cad7 428 ATTR_CONST_NOTHROW_LIST)
10841285 429
1472e41c
RH
430DEF_LIB_BUILTIN(BUILT_IN_NAN,
431 "__builtin_nan",
432 BT_FN_DOUBLE_CONST_STRING,
433 ATTR_CONST_NOTHROW_LIST)
434DEF_LIB_BUILTIN(BUILT_IN_NANF,
435 "__builtin_nanf",
436 BT_FN_FLOAT_CONST_STRING,
437 ATTR_CONST_NOTHROW_LIST)
438DEF_LIB_BUILTIN(BUILT_IN_NANL,
439 "__builtin_nanl",
440 BT_FN_LONG_DOUBLE_CONST_STRING,
441 ATTR_CONST_NOTHROW_LIST)
442
443DEF_LIB_BUILTIN(BUILT_IN_NANS,
444 "__builtin_nans",
445 BT_FN_DOUBLE_CONST_STRING,
446 ATTR_CONST_NOTHROW_LIST)
447DEF_LIB_BUILTIN(BUILT_IN_NANSF,
448 "__builtin_nansf",
449 BT_FN_FLOAT_CONST_STRING,
450 ATTR_CONST_NOTHROW_LIST)
451DEF_LIB_BUILTIN(BUILT_IN_NANSL,
452 "__builtin_nansl",
453 BT_FN_LONG_DOUBLE_CONST_STRING,
454 ATTR_CONST_NOTHROW_LIST)
455
10841285
MM
456DEF_GCC_BUILTIN(BUILT_IN_SAVEREGS,
457 "__builtin_saveregs",
c2ef6d34
RS
458 BT_FN_PTR_VAR,
459 ATTR_NULL)
10841285
MM
460DEF_GCC_BUILTIN(BUILT_IN_CLASSIFY_TYPE,
461 "__builtin_classify_type",
c2ef6d34
RS
462 BT_FN_INT_VAR,
463 ATTR_NULL)
10841285
MM
464DEF_GCC_BUILTIN(BUILT_IN_NEXT_ARG,
465 "__builtin_next_arg",
c2ef6d34
RS
466 BT_FN_PTR_VAR,
467 ATTR_NULL)
10841285
MM
468DEF_GCC_BUILTIN(BUILT_IN_ARGS_INFO,
469 "__builtin_args_info",
c2ef6d34
RS
470 BT_FN_INT_INT,
471 ATTR_NULL)
10841285
MM
472DEF_GCC_BUILTIN(BUILT_IN_CONSTANT_P,
473 "__builtin_constant_p",
c2ef6d34
RS
474 BT_FN_INT_VAR,
475 ATTR_NULL)
10841285
MM
476DEF_GCC_BUILTIN(BUILT_IN_FRAME_ADDRESS,
477 "__builtin_frame_address",
c2ef6d34
RS
478 BT_FN_PTR_UNSIGNED,
479 ATTR_NULL)
10841285
MM
480DEF_GCC_BUILTIN(BUILT_IN_RETURN_ADDRESS,
481 "__builtin_return_address",
c2ef6d34
RS
482 BT_FN_PTR_UNSIGNED,
483 ATTR_NULL)
10841285
MM
484DEF_GCC_BUILTIN(BUILT_IN_AGGREGATE_INCOMING_ADDRESS,
485 "__builtin_aggregate_incoming_address",
c2ef6d34
RS
486 BT_FN_PTR_VAR,
487 ATTR_NULL)
10841285
MM
488DEF_GCC_BUILTIN(BUILT_IN_APPLY_ARGS,
489 "__builtin_apply_args",
c2ef6d34
RS
490 BT_FN_PTR_VAR,
491 ATTR_NULL)
10841285
MM
492DEF_GCC_BUILTIN(BUILT_IN_APPLY,
493 "__builtin_apply",
c2ef6d34
RS
494 BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE,
495 ATTR_NULL)
10841285
MM
496DEF_GCC_BUILTIN(BUILT_IN_RETURN,
497 "__builtin_return",
c2ef6d34
RS
498 BT_FN_VOID_PTR,
499 ATTR_NORETURN_NOTHROW_LIST)
10841285
MM
500DEF_GCC_BUILTIN(BUILT_IN_SETJMP,
501 "__builtin_setjmp",
c2ef6d34
RS
502 BT_FN_INT_PTR,
503 ATTR_NULL)
10841285
MM
504DEF_GCC_BUILTIN(BUILT_IN_LONGJMP,
505 "__builtin_longjmp",
c2ef6d34
RS
506 BT_FN_VOID_PTR_INT,
507 ATTR_NORETURN_NOTHROW_LIST)
10841285
MM
508DEF_GCC_BUILTIN(BUILT_IN_TRAP,
509 "__builtin_trap",
c2ef6d34
RS
510 BT_FN_VOID,
511 ATTR_NORETURN_NOTHROW_LIST)
a9ccbb60
JJ
512DEF_GCC_BUILTIN(BUILT_IN_PREFETCH,
513 "__builtin_prefetch",
c2ef6d34
RS
514 BT_FN_VOID_CONST_PTR_VAR,
515 ATTR_NULL)
10841285
MM
516
517/* Stdio builtins. */
518DEF_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR,
519 "__builtin_putchar",
df061a43
RS
520 BT_FN_INT_INT,
521 ATTR_NOTHROW_LIST)
10841285
MM
522DEF_FALLBACK_BUILTIN(BUILT_IN_PUTS,
523 "__builtin_puts",
df061a43
RS
524 BT_FN_INT_CONST_STRING,
525 ATTR_NOTHROW_LIST)
10841285
MM
526DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF,
527 "__builtin_printf",
df061a43
RS
528 BT_FN_INT_CONST_STRING_VAR,
529 ATTR_FORMAT_PRINTF_1_2)
10841285
MM
530DEF_FALLBACK_BUILTIN(BUILT_IN_FPUTC,
531 "__builtin_fputc",
df061a43
RS
532 BT_FN_INT_INT_PTR,
533 ATTR_NOTHROW_LIST)
10841285
MM
534/* Declare the __builtin_ style with arguments and the regular style
535 without them. We rely on stdio.h to supply the arguments for the
536 regular style declaration since we had to use void* instead of
537 FILE* in the __builtin_ prototype supplied here. */
538DEF_BUILTIN (BUILT_IN_FPUTS,
539 "__builtin_fputs",
540 BUILT_IN_NORMAL,
541 BT_FN_INT_CONST_STRING_PTR,
542 BT_FN_INT_VAR,
df061a43 543 true, true, false, ATTR_NOTHROW_LIST)
10841285
MM
544DEF_FALLBACK_BUILTIN(BUILT_IN_FWRITE,
545 "__builtin_fwrite",
df061a43
RS
546 BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
547 ATTR_NOTHROW_LIST)
10841285
MM
548DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF,
549 "__builtin_fprintf",
df061a43
RS
550 BT_FN_INT_PTR_CONST_STRING_VAR,
551 ATTR_FORMAT_PRINTF_2_3)
3ff5f682 552
b4c984fb
KG
553/* Stdio unlocked builtins. */
554
555DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR_UNLOCKED,
556 "__builtin_putchar_unlocked",
557 BT_FN_INT_INT)
558DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTS_UNLOCKED,
559 "__builtin_puts_unlocked",
560 BT_FN_INT_CONST_STRING)
561DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF_UNLOCKED,
562 "__builtin_printf_unlocked",
df061a43
RS
563 BT_FN_INT_CONST_STRING_VAR,
564 ATTR_FORMAT_PRINTF_1_2)
b4c984fb
KG
565DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FPUTC_UNLOCKED,
566 "__builtin_fputc_unlocked",
567 BT_FN_INT_INT_PTR)
568/* Declare the __builtin_ style with arguments and the regular style
569 without them. We rely on stdio.h to supply the arguments for the
570 regular style declaration since we had to use void* instead of
571 FILE* in the __builtin_ prototype supplied here. */
572DEF_BUILTIN (BUILT_IN_FPUTS_UNLOCKED,
573 "__builtin_fputs_unlocked",
574 BUILT_IN_NORMAL,
575 BT_FN_INT_CONST_STRING_PTR,
576 BT_FN_INT_VAR,
df061a43 577 true, true, true, ATTR_NOTHROW_LIST)
b4c984fb
KG
578DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FWRITE_UNLOCKED,
579 "__builtin_fwrite_unlocked",
580 BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR)
581DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF_UNLOCKED,
582 "__builtin_fprintf_unlocked",
df061a43
RS
583 BT_FN_INT_PTR_CONST_STRING_VAR,
584 ATTR_FORMAT_PRINTF_2_3)
b4c984fb 585
cb1072f4 586 /* ISO C99 floating point unordered comparisons. */
10841285
MM
587DEF_GCC_BUILTIN(BUILT_IN_ISGREATER,
588 "__builtin_isgreater",
c2ef6d34
RS
589 BT_FN_INT_VAR,
590 ATTR_CONST_NOTHROW_LIST)
10841285
MM
591DEF_GCC_BUILTIN(BUILT_IN_ISGREATEREQUAL,
592 "__builtin_isgreaterequal",
c2ef6d34
RS
593 BT_FN_INT_VAR,
594 ATTR_CONST_NOTHROW_LIST)
10841285
MM
595DEF_GCC_BUILTIN(BUILT_IN_ISLESS,
596 "__builtin_isless",
c2ef6d34
RS
597 BT_FN_INT_VAR,
598 ATTR_CONST_NOTHROW_LIST)
10841285
MM
599DEF_GCC_BUILTIN(BUILT_IN_ISLESSEQUAL,
600 "__builtin_islessequal",
c2ef6d34
RS
601 BT_FN_INT_VAR,
602 ATTR_CONST_NOTHROW_LIST)
10841285
MM
603DEF_GCC_BUILTIN(BUILT_IN_ISLESSGREATER,
604 "__builtin_islessgreater",
c2ef6d34
RS
605 BT_FN_INT_VAR,
606 ATTR_CONST_NOTHROW_LIST)
10841285
MM
607DEF_GCC_BUILTIN(BUILT_IN_ISUNORDERED,
608 "__builtin_isunordered",
c2ef6d34
RS
609 BT_FN_INT_VAR,
610 ATTR_CONST_NOTHROW_LIST)
10841285
MM
611
612/* Various hooks for the DWARF 2 __throw routine. */
613DEF_GCC_BUILTIN(BUILT_IN_UNWIND_INIT,
614 "__builtin_unwind_init",
c2ef6d34
RS
615 BT_FN_VOID,
616 ATTR_NULL)
10841285
MM
617DEF_GCC_BUILTIN(BUILT_IN_DWARF_CFA,
618 "__builtin_dwarf_cfa",
c2ef6d34
RS
619 BT_FN_PTR,
620 ATTR_NULL)
10841285
MM
621DEF_GCC_BUILTIN(BUILT_IN_DWARF_FP_REGNUM,
622 "__builtin_dwarf_fp_regnum",
c2ef6d34
RS
623 BT_FN_UNSIGNED,
624 ATTR_NULL)
10841285
MM
625DEF_GCC_BUILTIN(BUILT_IN_INIT_DWARF_REG_SIZES,
626 "__builtin_init_dwarf_reg_size_table",
c2ef6d34
RS
627 BT_FN_VOID_PTR,
628 ATTR_NULL)
10841285
MM
629DEF_GCC_BUILTIN(BUILT_IN_FROB_RETURN_ADDR,
630 "__builtin_frob_return_addr",
c2ef6d34
RS
631 BT_FN_PTR_PTR,
632 ATTR_NULL)
10841285
MM
633DEF_GCC_BUILTIN(BUILT_IN_EXTRACT_RETURN_ADDR,
634 "__builtin_extract_return_addr",
c2ef6d34
RS
635 BT_FN_PTR_PTR,
636 ATTR_NULL)
10841285
MM
637DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN,
638 "__builtin_eh_return",
c2ef6d34
RS
639 BT_FN_VOID_PTRMODE_PTR,
640 ATTR_NORETURN_NOTHROW_LIST)
10841285
MM
641DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN_DATA_REGNO,
642 "__builtin_eh_return_data_regno",
c2ef6d34
RS
643 BT_FN_INT_INT,
644 ATTR_NULL)
10841285 645
6c535c69
ZW
646/* Variable argument list (stdarg.h) support */
647DEF_GCC_BUILTIN(BUILT_IN_VA_START,
648 "__builtin_va_start",
c2ef6d34
RS
649 BT_FN_VOID_VALIST_REF_VAR,
650 ATTR_NULL)
6c535c69 651DEF_GCC_BUILTIN(BUILT_IN_STDARG_START, /* backward compat */
10841285 652 "__builtin_stdarg_start",
c2ef6d34
RS
653 BT_FN_VOID_VALIST_REF_VAR,
654 ATTR_NULL)
10841285
MM
655DEF_GCC_BUILTIN(BUILT_IN_VA_END,
656 "__builtin_va_end",
c2ef6d34
RS
657 BT_FN_VOID_VALIST_REF,
658 ATTR_NULL)
10841285
MM
659DEF_GCC_BUILTIN(BUILT_IN_VA_COPY,
660 "__builtin_va_copy",
c2ef6d34
RS
661 BT_FN_VOID_VALIST_REF_VALIST_ARG,
662 ATTR_NULL)
6c535c69 663
10841285
MM
664DEF_GCC_BUILTIN(BUILT_IN_EXPECT,
665 "__builtin_expect",
c2ef6d34
RS
666 BT_FN_LONG_LONG_LONG,
667 ATTR_NULL)
10841285
MM
668
669/* C++ extensions */
670DEF_UNUSED_BUILTIN(BUILT_IN_NEW)
671DEF_UNUSED_BUILTIN(BUILT_IN_VEC_NEW)
672DEF_UNUSED_BUILTIN(BUILT_IN_DELETE)
673DEF_UNUSED_BUILTIN(BUILT_IN_VEC_DELETE)
df061a43
RS
674
675/* Declare abort, exit, _exit and _Exit */
676DEF_BUILTIN (BUILT_IN_ABORT,
677 "__builtin_abort",
678 NOT_BUILT_IN,
c5358a5d
RS
679 BT_FN_VOID,
680 BT_FN_VOID,
df061a43
RS
681 1, 0, 0,
682 ATTR_NORETURN_NOTHROW_LIST)
683
684DEF_BUILTIN (BUILT_IN_EXIT,
685 "__builtin_exit",
686 NOT_BUILT_IN,
c5358a5d
RS
687 BT_FN_VOID_INT,
688 BT_FN_VOID_INT,
df061a43
RS
689 1, 0, 0,
690 ATTR_NORETURN_NOTHROW_LIST)
691
692DEF_BUILTIN (BUILT_IN__EXIT,
693 "__builtin__exit",
694 NOT_BUILT_IN,
695 BT_FN_VOID_INT,
696 BT_FN_VOID_INT,
697 1, 0, 1,
698 ATTR_NORETURN_NOTHROW_LIST)
699
700DEF_BUILTIN (BUILT_IN__EXIT2,
701 "__builtin__Exit",
702 NOT_BUILT_IN,
703 BT_FN_VOID_INT,
704 BT_FN_VOID_INT,
705 1, 0, !flag_isoc99,
706 ATTR_NORETURN_NOTHROW_LIST)
707
This page took 0.542515 seconds and 5 git commands to generate.