1 /* This file contains the definitions and documentation for the
2 builtins used in the GNU compiler.
3 Copyright (C
) 2000, 2001, 2002, 2003 Free Software Foundation
, Inc.
5 This file is part of GCC.
7 GCC is free software
; you can redistribute it and
/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation
; either version
2, or (at your option
) any later
12 GCC is distributed in the hope that it will be useful
, but WITHOUT ANY
13 WARRANTY
; without even the implied warranty of MERCHANTABILITY or
14 FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC
; see the file COPYING. If not
, write to the Free
19 Software Foundation
, 59 Temple Place
- Suite
330, Boston
, MA
22 /* Before including this file
, you should define a macro
:
24 DEF_BUILTIN (ENUM
, NAME
, CLASS
, TYPE, LIBTYPE
, BOTH_P
,
25 FALLBACK_P
, NONANSI_P
, ATTRS
, IMPLICIT
)
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.
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
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
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
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
53 exist when compiling in ANSI conformant mode.
55 ATTRs is an attribute list as defined in builtin
-attrs.def that
56 describes the attributes of this builtin function.
58 IMPLICIT specifies condition when the builtin can be produced by
59 compiler. For instance C90 reserves floorf function
, but does not
60 define it
's meaning. When user uses floorf we may assume that the
61 floorf has the meaning we expect, but we can't produce floorf by
62 simplifing
floor((double
)float
) since runtime don
't need to implement it. */
64 /* A GCC builtin (like __builtin_saveregs) is provided by the
65 compiler, but does not correspond to a function in the standard
67 #undef DEF_GCC_BUILTIN
68 #define DEF_GCC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
69 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
70 false, false, false, ATTRS, true)
73 /* A fallback builtin is a builtin (like __builtin_puts) that falls
74 back to the corresopnding library function if necessary -- but
75 for which we should not introduce the non-`__builtin' variant of
77 #undef DEF_FALLBACK_BUILTIN
78 #define
DEF_FALLBACK_BUILTIN(ENUM
, NAME
, TYPE, ATTRS
) \
79 DEF_BUILTIN (ENUM
, NAME
, BUILT_IN_NORMAL
, TYPE, TYPE, \
80 false
, true
, false
, ATTRS
, true
)
82 /* Like DEF_FALLBACK_BUILTIN
, except that the function is not one that
83 is specified by ANSI
/ISO C. So
, when we
're being fully conformant
84 we ignore the version of these builtins that does not begin with
86 #undef DEF_EXT_FALLBACK_BUILTIN
87 #define DEF_EXT_FALLBACK_BUILTIN(ENUM, NAME, TYPE) \
88 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
89 false, true, true, ATTR_NOTHROW_LIST, true)
91 /* A library builtin (like __builtin_strchr) is a builtin equivalent
92 of an ANSI/ISO standard library function. In addition to the
93 `__builtin' version
, we will create an ordinary
version (e.g
,
94 `strchr
') as well. If we cannot compute the answer using the
95 builtin function, we will fall back to the standard library
97 #undef DEF_LIB_BUILTIN
98 #define DEF_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
99 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
100 true, true, false, ATTRS, true)
102 /* Like DEF_LIB_BUILTIN, except that a call to the builtin should
103 never fall back to the library version. */
104 #undef DEF_LIB_ALWAYS_BUILTIN
105 #define DEF_LIB_ALWAYS_BUILTIN(ENUM, NAME, TYPE) \
106 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
107 true, false, true, ATTR_CONST_NOTHROW_LIST, true)
109 /* Like DEF_LIB_BUILTIN, except that the function is not one that is
110 specified by ANSI/ISO C. So, when we're being fully conformant we
111 ignore the version of these builtins that does not begin with
113 #undef DEF_EXT_LIB_BUILTIN
114 #define
DEF_EXT_LIB_BUILTIN(ENUM
, NAME
, TYPE, ATTRS
) \
115 DEF_BUILTIN (ENUM
, NAME
, BUILT_IN_NORMAL
, TYPE, TYPE, \
116 true
, true
, true
, ATTRS
, false
)
118 /* Like DEF_LIB_BUILTIN
, except that the function is only a part of
119 the standard in C99 or above.
*/
120 #undef DEF_C99_BUILTIN
121 #define
DEF_C99_BUILTIN(ENUM
, NAME
, TYPE, ATTRS
) \
122 DEF_BUILTIN (ENUM
, NAME
, BUILT_IN_NORMAL
, TYPE, TYPE, \
123 true
, true
, !flag_isoc99
, ATTRS
, TARGET_C99_FUNCTIONS
)
125 /* Builtin that is specified by C99 and C90 reserve the name for future use.
126 We can still recognize the builtin in C90 mode but we can
't produce it
128 #undef DEF_C99_C90RES_BUILTIN
129 #define DEF_C99_C90RES_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
130 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
131 true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS)
133 /* Like DEF_LIB_BUILTIN, except that the function is expanded in the
135 #undef DEF_FRONT_END_LIB_BUILTIN
136 #define DEF_FRONT_END_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
137 DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE, \
138 true, true, false, ATTRS, true)
140 /* Like DEF_FRONT_END_LIB_BUILTIN, except that the function is not one
141 that is specified by ANSI/ISO C. So, when we're being fully
142 conformant we ignore the version of these builtins that does not
143 begin with __builtin.
*/
144 #undef DEF_EXT_FRONT_END_LIB_BUILTIN
145 #define
DEF_EXT_FRONT_END_LIB_BUILTIN(ENUM
, NAME
, TYPE, ATTRS
) \
146 DEF_BUILTIN (ENUM
, NAME
, BUILT_IN_FRONTEND
, TYPE, TYPE, \
147 true
, true
, true
, ATTRS
, true
)
149 /* A built
-in that is not currently used.
*/
150 #undef DEF_UNUSED_BUILTIN
151 #define
DEF_UNUSED_BUILTIN(X
) \
152 DEF_BUILTIN (X
, (const char *) NULL
, NOT_BUILT_IN
, BT_LAST
, \
153 BT_LAST
, false
, false
, false
, ATTR_NOTHROW_LIST
, false
)
155 /* If SMALL_STACK is defined
, then `alloca
' is only defined in its
158 DEF_FALLBACK_BUILTIN(BUILT_IN_ALLOCA
,
161 ATTR_MALLOC_NOTHROW_LIST
)
163 DEF_EXT_LIB_BUILTIN(BUILT_IN_ALLOCA
,
166 ATTR_MALLOC_NOTHROW_LIST
)
169 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_ABS
,
172 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_LABS
,
176 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABS
,
179 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABSF
,
182 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABSL
,
184 BT_FN_LONG_DOUBLE_LONG_DOUBLE
)
186 DEF_LIB_BUILTIN(BUILT_IN_FLOOR
,
189 ATTR_CONST_NOTHROW_LIST
)
190 DEF_C99_C90RES_BUILTIN(BUILT_IN_FLOORF
,
193 ATTR_CONST_NOTHROW_LIST
)
194 DEF_C99_C90RES_BUILTIN(BUILT_IN_FLOORL
,
196 BT_FN_LONG_DOUBLE_LONG_DOUBLE
,
197 ATTR_CONST_NOTHROW_LIST
)
199 DEF_LIB_BUILTIN(BUILT_IN_CEIL
,
202 ATTR_CONST_NOTHROW_LIST
)
203 DEF_C99_C90RES_BUILTIN(BUILT_IN_CEILF
,
206 ATTR_CONST_NOTHROW_LIST
)
207 DEF_C99_C90RES_BUILTIN(BUILT_IN_CEILL
,
209 BT_FN_LONG_DOUBLE_LONG_DOUBLE
,
210 ATTR_CONST_NOTHROW_LIST
)
212 DEF_C99_BUILTIN(BUILT_IN_ROUND
,
215 ATTR_CONST_NOTHROW_LIST
)
216 DEF_C99_BUILTIN(BUILT_IN_ROUNDF
,
219 ATTR_CONST_NOTHROW_LIST
)
220 DEF_C99_BUILTIN(BUILT_IN_ROUNDL
,
222 BT_FN_LONG_DOUBLE_LONG_DOUBLE
,
223 ATTR_CONST_NOTHROW_LIST
)
225 DEF_C99_BUILTIN(BUILT_IN_TRUNC
,
228 ATTR_CONST_NOTHROW_LIST
)
229 DEF_C99_BUILTIN(BUILT_IN_TRUNCF
,
232 ATTR_CONST_NOTHROW_LIST
)
233 DEF_C99_BUILTIN(BUILT_IN_TRUNCL
,
235 BT_FN_LONG_DOUBLE_LONG_DOUBLE
,
236 ATTR_CONST_NOTHROW_LIST
)
238 DEF_C99_BUILTIN(BUILT_IN_NEARBYINT
,
239 "__builtin_nearbyint",
241 ATTR_CONST_NOTHROW_LIST
)
242 DEF_C99_BUILTIN(BUILT_IN_NEARBYINTF
,
243 "__builtin_nearbyintf",
245 ATTR_CONST_NOTHROW_LIST
)
246 DEF_C99_BUILTIN(BUILT_IN_NEARBYINTL
,
247 "__builtin_nearbyintl",
248 BT_FN_LONG_DOUBLE_LONG_DOUBLE
,
249 ATTR_CONST_NOTHROW_LIST
)
251 DEF_C99_BUILTIN(BUILT_IN_LLABS
,
253 BT_FN_LONGLONG_LONGLONG
,
254 ATTR_CONST_NOTHROW_LIST
)
255 DEF_C99_BUILTIN(BUILT_IN_IMAXABS
,
258 ATTR_CONST_NOTHROW_LIST
)
259 DEF_C99_BUILTIN(BUILT_IN_CONJ
,
261 BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE
,
262 ATTR_CONST_NOTHROW_LIST
)
263 DEF_C99_BUILTIN(BUILT_IN_CONJF
,
265 BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT
,
266 ATTR_CONST_NOTHROW_LIST
)
267 DEF_C99_BUILTIN(BUILT_IN_CONJL
,
269 BT_FN_COMPLEX_LONG_DOUBLE_COMPLEX_LONG_DOUBLE
,
270 ATTR_CONST_NOTHROW_LIST
)
271 DEF_C99_BUILTIN(BUILT_IN_CREAL
,
273 BT_FN_DOUBLE_COMPLEX_DOUBLE
,
274 ATTR_CONST_NOTHROW_LIST
)
275 DEF_C99_BUILTIN(BUILT_IN_CREALF
,
277 BT_FN_FLOAT_COMPLEX_FLOAT
,
278 ATTR_CONST_NOTHROW_LIST
)
279 DEF_C99_BUILTIN(BUILT_IN_CREALL
,
281 BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE
,
282 ATTR_CONST_NOTHROW_LIST
)
283 DEF_C99_BUILTIN(BUILT_IN_CIMAG
,
285 BT_FN_DOUBLE_COMPLEX_DOUBLE
,
286 ATTR_CONST_NOTHROW_LIST
)
287 DEF_C99_BUILTIN(BUILT_IN_CIMAGF
,
289 BT_FN_FLOAT_COMPLEX_FLOAT
,
290 ATTR_CONST_NOTHROW_LIST
)
291 DEF_C99_BUILTIN(BUILT_IN_CIMAGL
,
293 BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE
,
294 ATTR_CONST_NOTHROW_LIST
)
296 DEF_UNUSED_BUILTIN(BUILT_IN_DIV
)
297 DEF_UNUSED_BUILTIN(BUILT_IN_LDIV
)
298 DEF_UNUSED_BUILTIN(BUILT_IN_FFLOOR
)
299 DEF_UNUSED_BUILTIN(BUILT_IN_FCEIL
)
300 DEF_UNUSED_BUILTIN(BUILT_IN_FMOD
)
301 DEF_UNUSED_BUILTIN(BUILT_IN_FREM
)
303 /* The system prototypes for `bzero
' and `bcmp' functions have many
304 variations
, so don
't specify parameters to avoid conflicts. The
305 expand_* functions check the argument types anyway. */
306 DEF_BUILTIN (BUILT_IN_BZERO,
312 ATTR_NOTHROW_LIST, false)
313 DEF_BUILTIN (BUILT_IN_BCMP,
316 BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
319 ATTR_PURE_NOTHROW_LIST, false)
321 DEF_EXT_LIB_BUILTIN(BUILT_IN_FFS,
324 ATTR_CONST_NOTHROW_LIST)
325 DEF_GCC_BUILTIN(BUILT_IN_CLZ,
328 ATTR_CONST_NOTHROW_LIST)
329 DEF_GCC_BUILTIN(BUILT_IN_CTZ,
332 ATTR_CONST_NOTHROW_LIST)
333 DEF_GCC_BUILTIN(BUILT_IN_POPCOUNT,
334 "__builtin_popcount",
336 ATTR_CONST_NOTHROW_LIST)
337 DEF_GCC_BUILTIN(BUILT_IN_PARITY,
340 ATTR_CONST_NOTHROW_LIST)
342 DEF_GCC_BUILTIN(BUILT_IN_FFSL,
345 ATTR_CONST_NOTHROW_LIST)
346 DEF_GCC_BUILTIN(BUILT_IN_CLZL,
349 ATTR_CONST_NOTHROW_LIST)
350 DEF_GCC_BUILTIN(BUILT_IN_CTZL,
353 ATTR_CONST_NOTHROW_LIST)
354 DEF_GCC_BUILTIN(BUILT_IN_POPCOUNTL,
355 "__builtin_popcountl",
357 ATTR_CONST_NOTHROW_LIST)
358 DEF_GCC_BUILTIN(BUILT_IN_PARITYL,
361 ATTR_CONST_NOTHROW_LIST)
363 DEF_EXT_LIB_BUILTIN(BUILT_IN_FFSLL,
366 ATTR_CONST_NOTHROW_LIST)
367 DEF_GCC_BUILTIN(BUILT_IN_CLZLL,
370 ATTR_CONST_NOTHROW_LIST)
371 DEF_GCC_BUILTIN(BUILT_IN_CTZLL,
374 ATTR_CONST_NOTHROW_LIST)
375 DEF_GCC_BUILTIN(BUILT_IN_POPCOUNTLL,
376 "__builtin_popcountll",
378 ATTR_CONST_NOTHROW_LIST)
379 DEF_GCC_BUILTIN(BUILT_IN_PARITYLL,
380 "__builtin_parityll",
382 ATTR_CONST_NOTHROW_LIST)
384 DEF_EXT_LIB_BUILTIN(BUILT_IN_INDEX,
386 BT_FN_STRING_CONST_STRING_INT,
387 ATTR_PURE_NOTHROW_LIST)
388 DEF_EXT_LIB_BUILTIN(BUILT_IN_RINDEX,
390 BT_FN_STRING_CONST_STRING_INT,
391 ATTR_PURE_NOTHROW_LIST)
393 DEF_LIB_BUILTIN(BUILT_IN_MEMCPY,
395 BT_FN_PTR_PTR_CONST_PTR_SIZE,
397 DEF_LIB_BUILTIN(BUILT_IN_MEMCMP,
399 BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
400 ATTR_PURE_NOTHROW_LIST)
401 DEF_LIB_BUILTIN(BUILT_IN_MEMSET,
403 BT_FN_PTR_PTR_INT_SIZE,
406 DEF_LIB_BUILTIN(BUILT_IN_STRCAT,
408 BT_FN_STRING_STRING_CONST_STRING,
410 DEF_LIB_BUILTIN(BUILT_IN_STRNCAT,
412 BT_FN_STRING_STRING_CONST_STRING_SIZE,
414 DEF_LIB_BUILTIN(BUILT_IN_STRCPY,
416 BT_FN_STRING_STRING_CONST_STRING,
418 DEF_LIB_BUILTIN(BUILT_IN_STRNCPY,
420 BT_FN_STRING_STRING_CONST_STRING_SIZE,
422 DEF_LIB_BUILTIN(BUILT_IN_STRCMP,
424 BT_FN_INT_CONST_STRING_CONST_STRING,
425 ATTR_PURE_NOTHROW_LIST)
426 DEF_LIB_BUILTIN(BUILT_IN_STRNCMP,
428 BT_FN_INT_CONST_STRING_CONST_STRING_SIZE,
429 ATTR_PURE_NOTHROW_LIST)
430 DEF_LIB_BUILTIN(BUILT_IN_STRLEN,
432 BT_FN_SIZE_CONST_STRING,
433 ATTR_PURE_NOTHROW_LIST)
434 DEF_LIB_BUILTIN(BUILT_IN_STRSTR,
436 BT_FN_STRING_CONST_STRING_CONST_STRING,
437 ATTR_PURE_NOTHROW_LIST)
438 DEF_LIB_BUILTIN(BUILT_IN_STRPBRK,
440 BT_FN_STRING_CONST_STRING_CONST_STRING,
441 ATTR_PURE_NOTHROW_LIST)
442 DEF_LIB_BUILTIN(BUILT_IN_STRSPN,
444 BT_FN_SIZE_CONST_STRING_CONST_STRING,
445 ATTR_PURE_NOTHROW_LIST)
446 DEF_LIB_BUILTIN(BUILT_IN_STRCSPN,
448 BT_FN_SIZE_CONST_STRING_CONST_STRING,
449 ATTR_PURE_NOTHROW_LIST)
450 DEF_LIB_BUILTIN(BUILT_IN_STRCHR,
452 BT_FN_STRING_CONST_STRING_INT,
453 ATTR_PURE_NOTHROW_LIST)
454 DEF_LIB_BUILTIN(BUILT_IN_STRRCHR,
456 BT_FN_STRING_CONST_STRING_INT,
457 ATTR_PURE_NOTHROW_LIST)
459 DEF_LIB_BUILTIN(BUILT_IN_SQRT,
462 flag_errno_math ? ATTR_NOTHROW_LIST
463 : (flag_unsafe_math_optimizations
464 ? ATTR_CONST_NOTHROW_LIST
465 : ATTR_PURE_NOTHROW_LIST))
466 DEF_LIB_BUILTIN(BUILT_IN_SIN,
469 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
470 : ATTR_PURE_NOTHROW_LIST)
471 DEF_LIB_BUILTIN(BUILT_IN_COS,
474 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
475 : ATTR_PURE_NOTHROW_LIST)
476 DEF_LIB_BUILTIN(BUILT_IN_EXP,
479 flag_errno_math ? ATTR_NOTHROW_LIST
480 : (flag_unsafe_math_optimizations
481 ? ATTR_CONST_NOTHROW_LIST
482 : ATTR_PURE_NOTHROW_LIST))
483 DEF_LIB_BUILTIN(BUILT_IN_LOG,
486 flag_errno_math ? ATTR_NOTHROW_LIST
487 : (flag_unsafe_math_optimizations
488 ? ATTR_CONST_NOTHROW_LIST
489 : ATTR_PURE_NOTHROW_LIST))
490 DEF_LIB_BUILTIN(BUILT_IN_POW,
492 BT_FN_DOUBLE_DOUBLE_DOUBLE,
493 flag_errno_math ? ATTR_NOTHROW_LIST
494 : (flag_unsafe_math_optimizations
495 ? ATTR_CONST_NOTHROW_LIST
496 : ATTR_PURE_NOTHROW_LIST))
497 DEF_LIB_BUILTIN(BUILT_IN_ATAN2,
499 BT_FN_DOUBLE_DOUBLE_DOUBLE,
500 flag_errno_math ? ATTR_NOTHROW_LIST
501 : (flag_unsafe_math_optimizations
502 ? ATTR_CONST_NOTHROW_LIST
503 : ATTR_PURE_NOTHROW_LIST))
504 DEF_C99_C90RES_BUILTIN(BUILT_IN_SQRTF,
507 flag_errno_math ? ATTR_NOTHROW_LIST
508 : (flag_unsafe_math_optimizations
509 ? ATTR_CONST_NOTHROW_LIST
510 : ATTR_PURE_NOTHROW_LIST))
511 DEF_C99_C90RES_BUILTIN(BUILT_IN_SINF,
514 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
515 : ATTR_PURE_NOTHROW_LIST)
516 DEF_C99_C90RES_BUILTIN(BUILT_IN_COSF,
519 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
520 : ATTR_PURE_NOTHROW_LIST)
521 DEF_C99_C90RES_BUILTIN(BUILT_IN_EXPF,
524 flag_errno_math ? ATTR_NOTHROW_LIST
525 : (flag_unsafe_math_optimizations
526 ? ATTR_CONST_NOTHROW_LIST
527 : ATTR_PURE_NOTHROW_LIST))
528 DEF_C99_C90RES_BUILTIN(BUILT_IN_LOGF,
531 flag_errno_math ? ATTR_NOTHROW_LIST
532 : (flag_unsafe_math_optimizations
533 ? ATTR_CONST_NOTHROW_LIST
534 : ATTR_PURE_NOTHROW_LIST))
535 DEF_C99_C90RES_BUILTIN(BUILT_IN_POWF,
537 BT_FN_FLOAT_FLOAT_FLOAT,
538 flag_errno_math ? ATTR_NOTHROW_LIST
539 : (flag_unsafe_math_optimizations
540 ? ATTR_CONST_NOTHROW_LIST
541 : ATTR_PURE_NOTHROW_LIST))
542 DEF_C99_C90RES_BUILTIN(BUILT_IN_ATAN2F,
544 BT_FN_FLOAT_FLOAT_FLOAT,
545 flag_errno_math ? ATTR_NOTHROW_LIST
546 : (flag_unsafe_math_optimizations
547 ? ATTR_CONST_NOTHROW_LIST
548 : ATTR_PURE_NOTHROW_LIST))
549 DEF_C99_C90RES_BUILTIN(BUILT_IN_SQRTL,
551 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
552 flag_errno_math ? ATTR_NOTHROW_LIST
553 : (flag_unsafe_math_optimizations
554 ? ATTR_CONST_NOTHROW_LIST
555 : ATTR_PURE_NOTHROW_LIST))
556 DEF_C99_C90RES_BUILTIN(BUILT_IN_SINL,
558 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
559 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
560 : ATTR_PURE_NOTHROW_LIST)
561 DEF_C99_C90RES_BUILTIN(BUILT_IN_COSL,
563 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
564 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
565 : ATTR_PURE_NOTHROW_LIST)
566 DEF_C99_C90RES_BUILTIN(BUILT_IN_EXPL,
568 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
569 flag_errno_math ? ATTR_NOTHROW_LIST
570 : (flag_unsafe_math_optimizations
571 ? ATTR_CONST_NOTHROW_LIST
572 : ATTR_PURE_NOTHROW_LIST))
573 DEF_C99_C90RES_BUILTIN(BUILT_IN_LOGL,
575 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
576 flag_errno_math ? ATTR_NOTHROW_LIST
577 : (flag_unsafe_math_optimizations
578 ? ATTR_CONST_NOTHROW_LIST
579 : ATTR_PURE_NOTHROW_LIST))
580 DEF_C99_C90RES_BUILTIN(BUILT_IN_POWL,
582 BT_FN_LONG_DOUBLE_LONG_DOUBLE_LONG_DOUBLE,
583 flag_errno_math ? ATTR_NOTHROW_LIST
584 : (flag_unsafe_math_optimizations
585 ? ATTR_CONST_NOTHROW_LIST
586 : ATTR_PURE_NOTHROW_LIST))
587 DEF_C99_C90RES_BUILTIN(BUILT_IN_ATAN2L,
589 BT_FN_LONG_DOUBLE_LONG_DOUBLE_LONG_DOUBLE,
590 flag_errno_math ? ATTR_NOTHROW_LIST
591 : (flag_unsafe_math_optimizations
592 ? ATTR_CONST_NOTHROW_LIST
593 : ATTR_PURE_NOTHROW_LIST))
595 DEF_GCC_BUILTIN(BUILT_IN_INF,
598 ATTR_CONST_NOTHROW_LIST)
599 DEF_GCC_BUILTIN(BUILT_IN_INFF,
602 ATTR_CONST_NOTHROW_LIST)
603 DEF_GCC_BUILTIN(BUILT_IN_INFL,
606 ATTR_CONST_NOTHROW_LIST)
608 DEF_GCC_BUILTIN(BUILT_IN_HUGE_VAL,
609 "__builtin_huge_val",
611 ATTR_CONST_NOTHROW_LIST)
612 DEF_GCC_BUILTIN(BUILT_IN_HUGE_VALF,
613 "__builtin_huge_valf",
615 ATTR_CONST_NOTHROW_LIST)
616 DEF_GCC_BUILTIN(BUILT_IN_HUGE_VALL,
617 "__builtin_huge_vall",
619 ATTR_CONST_NOTHROW_LIST)
621 DEF_LIB_BUILTIN(BUILT_IN_NAN,
623 BT_FN_DOUBLE_CONST_STRING,
624 ATTR_CONST_NOTHROW_LIST)
625 DEF_LIB_BUILTIN(BUILT_IN_NANF,
627 BT_FN_FLOAT_CONST_STRING,
628 ATTR_CONST_NOTHROW_LIST)
629 DEF_LIB_BUILTIN(BUILT_IN_NANL,
631 BT_FN_LONG_DOUBLE_CONST_STRING,
632 ATTR_CONST_NOTHROW_LIST)
634 DEF_LIB_BUILTIN(BUILT_IN_NANS,
636 BT_FN_DOUBLE_CONST_STRING,
637 ATTR_CONST_NOTHROW_LIST)
638 DEF_LIB_BUILTIN(BUILT_IN_NANSF,
640 BT_FN_FLOAT_CONST_STRING,
641 ATTR_CONST_NOTHROW_LIST)
642 DEF_LIB_BUILTIN(BUILT_IN_NANSL,
644 BT_FN_LONG_DOUBLE_CONST_STRING,
645 ATTR_CONST_NOTHROW_LIST)
647 DEF_GCC_BUILTIN(BUILT_IN_SAVEREGS,
648 "__builtin_saveregs",
651 DEF_GCC_BUILTIN(BUILT_IN_CLASSIFY_TYPE,
652 "__builtin_classify_type",
655 DEF_GCC_BUILTIN(BUILT_IN_NEXT_ARG,
656 "__builtin_next_arg",
659 DEF_GCC_BUILTIN(BUILT_IN_ARGS_INFO,
660 "__builtin_args_info",
663 DEF_GCC_BUILTIN(BUILT_IN_CONSTANT_P,
664 "__builtin_constant_p",
667 DEF_GCC_BUILTIN(BUILT_IN_FRAME_ADDRESS,
668 "__builtin_frame_address",
671 DEF_GCC_BUILTIN(BUILT_IN_RETURN_ADDRESS,
672 "__builtin_return_address",
675 DEF_GCC_BUILTIN(BUILT_IN_AGGREGATE_INCOMING_ADDRESS,
676 "__builtin_aggregate_incoming_address",
679 DEF_GCC_BUILTIN(BUILT_IN_APPLY_ARGS,
680 "__builtin_apply_args",
683 DEF_GCC_BUILTIN(BUILT_IN_APPLY,
685 BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE,
687 DEF_GCC_BUILTIN(BUILT_IN_RETURN,
690 ATTR_NORETURN_NOTHROW_LIST)
691 DEF_GCC_BUILTIN(BUILT_IN_SETJMP,
695 DEF_GCC_BUILTIN(BUILT_IN_LONGJMP,
698 ATTR_NORETURN_NOTHROW_LIST)
699 DEF_GCC_BUILTIN(BUILT_IN_TRAP,
702 ATTR_NORETURN_NOTHROW_LIST)
703 DEF_GCC_BUILTIN(BUILT_IN_PREFETCH,
704 "__builtin_prefetch",
705 BT_FN_VOID_CONST_PTR_VAR,
708 /* Stdio builtins. */
709 DEF_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR,
713 DEF_FALLBACK_BUILTIN(BUILT_IN_PUTS,
715 BT_FN_INT_CONST_STRING,
717 DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF,
719 BT_FN_INT_CONST_STRING_VAR,
720 ATTR_FORMAT_PRINTF_1_2)
721 DEF_FALLBACK_BUILTIN(BUILT_IN_FPUTC,
725 /* Declare the __builtin_ style with arguments and the regular style
726 without them. We rely on stdio.h to supply the arguments for the
727 regular style declaration since we had to use void* instead of
728 FILE* in the __builtin_ prototype supplied here. */
729 DEF_BUILTIN (BUILT_IN_FPUTS,
732 BT_FN_INT_CONST_STRING_PTR,
734 true, true, false, ATTR_NOTHROW_LIST, true)
735 DEF_FALLBACK_BUILTIN(BUILT_IN_FWRITE,
737 BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
739 DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF,
741 BT_FN_INT_PTR_CONST_STRING_VAR,
742 ATTR_FORMAT_PRINTF_2_3)
744 /* Stdio unlocked builtins. */
746 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR_UNLOCKED,
747 "__builtin_putchar_unlocked",
749 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTS_UNLOCKED,
750 "__builtin_puts_unlocked",
751 BT_FN_INT_CONST_STRING)
752 DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF_UNLOCKED,
753 "__builtin_printf_unlocked",
754 BT_FN_INT_CONST_STRING_VAR,
755 ATTR_FORMAT_PRINTF_1_2)
756 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FPUTC_UNLOCKED,
757 "__builtin_fputc_unlocked",
759 /* Declare the __builtin_ style with arguments and the regular style
760 without them. We rely on stdio.h to supply the arguments for the
761 regular style declaration since we had to use void* instead of
762 FILE* in the __builtin_ prototype supplied here. */
763 DEF_BUILTIN (BUILT_IN_FPUTS_UNLOCKED,
764 "__builtin_fputs_unlocked",
766 BT_FN_INT_CONST_STRING_PTR,
768 true, true, true, ATTR_NOTHROW_LIST, true)
769 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FWRITE_UNLOCKED,
770 "__builtin_fwrite_unlocked",
771 BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR)
772 DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF_UNLOCKED,
773 "__builtin_fprintf_unlocked",
774 BT_FN_INT_PTR_CONST_STRING_VAR,
775 ATTR_FORMAT_PRINTF_2_3)
777 /* ISO C99 floating point unordered comparisons. */
778 DEF_GCC_BUILTIN(BUILT_IN_ISGREATER,
779 "__builtin_isgreater",
781 ATTR_CONST_NOTHROW_LIST)
782 DEF_GCC_BUILTIN(BUILT_IN_ISGREATEREQUAL,
783 "__builtin_isgreaterequal",
785 ATTR_CONST_NOTHROW_LIST)
786 DEF_GCC_BUILTIN(BUILT_IN_ISLESS,
789 ATTR_CONST_NOTHROW_LIST)
790 DEF_GCC_BUILTIN(BUILT_IN_ISLESSEQUAL,
791 "__builtin_islessequal",
793 ATTR_CONST_NOTHROW_LIST)
794 DEF_GCC_BUILTIN(BUILT_IN_ISLESSGREATER,
795 "__builtin_islessgreater",
797 ATTR_CONST_NOTHROW_LIST)
798 DEF_GCC_BUILTIN(BUILT_IN_ISUNORDERED,
799 "__builtin_isunordered",
801 ATTR_CONST_NOTHROW_LIST)
803 /* Various hooks for the DWARF 2 __throw routine. */
804 DEF_GCC_BUILTIN(BUILT_IN_UNWIND_INIT,
805 "__builtin_unwind_init",
808 DEF_GCC_BUILTIN(BUILT_IN_DWARF_CFA,
809 "__builtin_dwarf_cfa",
812 DEF_GCC_BUILTIN(BUILT_IN_DWARF_FP_REGNUM,
813 "__builtin_dwarf_fp_regnum",
816 DEF_GCC_BUILTIN(BUILT_IN_INIT_DWARF_REG_SIZES,
817 "__builtin_init_dwarf_reg_size_table",
820 DEF_GCC_BUILTIN(BUILT_IN_FROB_RETURN_ADDR,
821 "__builtin_frob_return_addr",
824 DEF_GCC_BUILTIN(BUILT_IN_EXTRACT_RETURN_ADDR,
825 "__builtin_extract_return_addr",
828 DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN,
829 "__builtin_eh_return",
830 BT_FN_VOID_PTRMODE_PTR,
831 ATTR_NORETURN_NOTHROW_LIST)
832 DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN_DATA_REGNO,
833 "__builtin_eh_return_data_regno",
837 /* Variable argument list (stdarg.h) support */
838 DEF_GCC_BUILTIN(BUILT_IN_VA_START,
839 "__builtin_va_start",
840 BT_FN_VOID_VALIST_REF_VAR,
842 DEF_GCC_BUILTIN(BUILT_IN_STDARG_START, /* backward compat */
843 "__builtin_stdarg_start",
844 BT_FN_VOID_VALIST_REF_VAR,
846 DEF_GCC_BUILTIN(BUILT_IN_VA_END,
848 BT_FN_VOID_VALIST_REF,
850 DEF_GCC_BUILTIN(BUILT_IN_VA_COPY,
852 BT_FN_VOID_VALIST_REF_VALIST_ARG,
855 DEF_GCC_BUILTIN(BUILT_IN_EXPECT,
857 BT_FN_LONG_LONG_LONG,
861 DEF_UNUSED_BUILTIN(BUILT_IN_NEW)
862 DEF_UNUSED_BUILTIN(BUILT_IN_VEC_NEW)
863 DEF_UNUSED_BUILTIN(BUILT_IN_DELETE)
864 DEF_UNUSED_BUILTIN(BUILT_IN_VEC_DELETE)
866 /* Declare abort, exit, _exit and _Exit */
867 DEF_BUILTIN (BUILT_IN_ABORT,
873 ATTR_NORETURN_NOTHROW_LIST, true)
875 DEF_BUILTIN (BUILT_IN_EXIT,
881 ATTR_NORETURN_NOTHROW_LIST, true)
883 DEF_BUILTIN (BUILT_IN__EXIT,
889 ATTR_NORETURN_NOTHROW_LIST, false)
891 DEF_BUILTIN (BUILT_IN__EXIT2,
897 ATTR_NORETURN_NOTHROW_LIST, false)