2002-02-01 18:16:02 +00:00
|
|
|
/* This file contains the definitions and documentation for the
|
|
|
|
builtins used in the GNU compiler.
|
|
|
|
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
This file is part of GCC.
|
|
|
|
|
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free
|
|
|
|
Software Foundation; either version 2, or (at your option) any later
|
|
|
|
version.
|
|
|
|
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
|
|
|
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
02111-1307, USA. */
|
|
|
|
|
|
|
|
/* Before including this file, you should define a macro:
|
|
|
|
|
|
|
|
DEF_BUILTIN (ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P,
|
2003-07-11 03:40:53 +00:00
|
|
|
FALLBACK_P, NONANSI_P, ATTRS)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
This macro will be called once for each builtin function. The
|
|
|
|
ENUM will be of type `enum built_in_function', and will indicate
|
|
|
|
which builtin function is being processed. The NAME of the builtin
|
|
|
|
function (which will always start with `__builtin_') is a string
|
|
|
|
literal. The CLASS is of type `enum built_in_class' and indicates
|
|
|
|
what kind of builtin is being processed.
|
|
|
|
|
|
|
|
Some builtins are actually two separate functions. For example,
|
|
|
|
for `strcmp' there are two builtin functions; `__builtin_strcmp'
|
|
|
|
and `strcmp' itself. Both behave identically. Other builtins
|
|
|
|
define only the `__builtin' variant. If BOTH_P is TRUE, then this
|
|
|
|
builtin has both variants; otherwise, it is has only the first
|
|
|
|
variant.
|
|
|
|
|
|
|
|
TYPE indicates the type of the function. The symbols correspond to
|
|
|
|
enumerals from builtin-types.def. If BOTH_P is true, then LIBTYPE
|
|
|
|
is the type of the non-`__builtin_' variant. Otherwise, LIBTYPE
|
|
|
|
should be ignored.
|
|
|
|
|
|
|
|
If FALLBACK_P is true then, if for some reason, the compiler cannot
|
|
|
|
expand the builtin function directly, it will call the
|
|
|
|
corresponding library function (which does not have the
|
|
|
|
`__builtin_' prefix.
|
|
|
|
|
|
|
|
If NONANSI_P is true, then the non-`__builtin_' variant is not an
|
|
|
|
ANSI/ISO library function, and so we should pretend it does not
|
2003-07-11 03:40:53 +00:00
|
|
|
exist when compiling in ANSI conformant mode.
|
|
|
|
|
|
|
|
ATTRs is an attribute list as defined in builtin-attrs.def that
|
|
|
|
describes the attributes of this builtin function. */
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
/* A GCC builtin (like __builtin_saveregs) is provided by the
|
|
|
|
compiler, but does not correspond to a function in the standard
|
|
|
|
library. */
|
|
|
|
#undef DEF_GCC_BUILTIN
|
2003-07-11 03:40:53 +00:00
|
|
|
#define DEF_GCC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
|
2003-07-11 03:40:53 +00:00
|
|
|
false, false, false, ATTRS)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* A fallback builtin is a builtin (like __builtin_puts) that falls
|
|
|
|
back to the corresopnding library function if necessary -- but
|
|
|
|
for which we should not introduce the non-`__builtin' variant of
|
|
|
|
the name. */
|
|
|
|
#undef DEF_FALLBACK_BUILTIN
|
2003-07-11 03:40:53 +00:00
|
|
|
#define DEF_FALLBACK_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
2003-07-11 03:40:53 +00:00
|
|
|
false, true, false, ATTRS)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
/* Like DEF_FALLBACK_BUILTIN, except that the function is not one that
|
|
|
|
is specified by ANSI/ISO C. So, when we're being fully conformant
|
|
|
|
we ignore the version of these builtins that does not begin with
|
|
|
|
__builtin. */
|
|
|
|
#undef DEF_EXT_FALLBACK_BUILTIN
|
|
|
|
#define DEF_EXT_FALLBACK_BUILTIN(ENUM, NAME, TYPE) \
|
|
|
|
DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
2003-07-11 03:40:53 +00:00
|
|
|
false, true, true, ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
/* A library builtin (like __builtin_strchr) is a builtin equivalent
|
|
|
|
of an ANSI/ISO standard library function. In addition to the
|
|
|
|
`__builtin' version, we will create an ordinary version (e.g,
|
|
|
|
`strchr') as well. If we cannot compute the answer using the
|
|
|
|
builtin function, we will fall back to the standard library
|
2003-07-11 03:40:53 +00:00
|
|
|
version. */
|
2002-02-01 18:16:02 +00:00
|
|
|
#undef DEF_LIB_BUILTIN
|
2003-07-11 03:40:53 +00:00
|
|
|
#define DEF_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
2003-07-11 03:40:53 +00:00
|
|
|
true, true, false, ATTRS)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
/* Like DEF_LIB_BUILTIN, except that a call to the builtin should
|
|
|
|
never fall back to the library version. */
|
|
|
|
#undef DEF_LIB_ALWAYS_BUILTIN
|
|
|
|
#define DEF_LIB_ALWAYS_BUILTIN(ENUM, NAME, TYPE) \
|
|
|
|
DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
2003-07-11 03:40:53 +00:00
|
|
|
true, false, true, ATTR_CONST_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
/* Like DEF_LIB_BUILTIN, except that the function is not one that is
|
|
|
|
specified by ANSI/ISO C. So, when we're being fully conformant we
|
|
|
|
ignore the version of these builtins that does not begin with
|
|
|
|
__builtin. */
|
|
|
|
#undef DEF_EXT_LIB_BUILTIN
|
2003-07-11 03:40:53 +00:00
|
|
|
#define DEF_EXT_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
2003-07-11 03:40:53 +00:00
|
|
|
true, true, true, ATTRS)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
/* Like DEF_LIB_BUILTIN, except that the function is only a part of
|
|
|
|
the standard in C99 or above. */
|
|
|
|
#undef DEF_C99_BUILTIN
|
2003-07-11 03:40:53 +00:00
|
|
|
#define DEF_C99_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
2003-07-11 03:40:53 +00:00
|
|
|
true, true, !flag_isoc99, ATTRS)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
/* Like DEF_LIB_BUILTIN, except that the function is expanded in the
|
|
|
|
front-end. */
|
|
|
|
#undef DEF_FRONT_END_LIB_BUILTIN
|
2003-07-11 03:40:53 +00:00
|
|
|
#define DEF_FRONT_END_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE, \
|
2003-07-11 03:40:53 +00:00
|
|
|
true, true, false, ATTRS)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
/* Like DEF_FRONT_END_LIB_BUILTIN, except that the function is not one
|
|
|
|
that is specified by ANSI/ISO C. So, when we're being fully
|
|
|
|
conformant we ignore the version of these builtins that does not
|
|
|
|
begin with __builtin. */
|
|
|
|
#undef DEF_EXT_FRONT_END_LIB_BUILTIN
|
2003-07-11 03:40:53 +00:00
|
|
|
#define DEF_EXT_FRONT_END_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE, \
|
2003-07-11 03:40:53 +00:00
|
|
|
true, true, true, ATTRS)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
/* A built-in that is not currently used. */
|
|
|
|
#undef DEF_UNUSED_BUILTIN
|
|
|
|
#define DEF_UNUSED_BUILTIN(X) \
|
|
|
|
DEF_BUILTIN (X, (const char *) NULL, NOT_BUILT_IN, BT_LAST, \
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_LAST, false, false, false, ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
/* If SMALL_STACK is defined, then `alloca' is only defined in its
|
|
|
|
`__builtin' form. */
|
|
|
|
#if SMALL_STACK
|
|
|
|
DEF_FALLBACK_BUILTIN(BUILT_IN_ALLOCA,
|
|
|
|
"__builtin_alloca",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR_SIZE,
|
|
|
|
ATTR_MALLOC_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
#else
|
|
|
|
DEF_EXT_LIB_BUILTIN(BUILT_IN_ALLOCA,
|
|
|
|
"__builtin_alloca",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR_SIZE,
|
|
|
|
ATTR_MALLOC_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_ABS,
|
|
|
|
"__builtin_abs",
|
|
|
|
BT_FN_INT_INT)
|
|
|
|
DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_LABS,
|
|
|
|
"__builtin_labs",
|
|
|
|
BT_FN_LONG_LONG)
|
|
|
|
|
|
|
|
DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABS,
|
|
|
|
"__builtin_fabs",
|
|
|
|
BT_FN_DOUBLE_DOUBLE)
|
|
|
|
DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABSF,
|
|
|
|
"__builtin_fabsf",
|
|
|
|
BT_FN_FLOAT_FLOAT)
|
|
|
|
DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABSL,
|
|
|
|
"__builtin_fabsl",
|
|
|
|
BT_FN_LONG_DOUBLE_LONG_DOUBLE)
|
|
|
|
|
|
|
|
DEF_C99_BUILTIN(BUILT_IN_LLABS,
|
|
|
|
"__builtin_llabs",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_LONGLONG_LONGLONG,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_C99_BUILTIN(BUILT_IN_IMAXABS,
|
|
|
|
"__builtin_imaxabs",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INTMAX_INTMAX,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_C99_BUILTIN(BUILT_IN_CONJ,
|
|
|
|
"__builtin_conj",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_C99_BUILTIN(BUILT_IN_CONJF,
|
|
|
|
"__builtin_conjf",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_C99_BUILTIN(BUILT_IN_CONJL,
|
|
|
|
"__builtin_conjl",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_COMPLEX_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_C99_BUILTIN(BUILT_IN_CREAL,
|
|
|
|
"__builtin_creal",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_DOUBLE_COMPLEX_DOUBLE,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_C99_BUILTIN(BUILT_IN_CREALF,
|
|
|
|
"__builtin_crealf",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_FLOAT_COMPLEX_FLOAT,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_C99_BUILTIN(BUILT_IN_CREALL,
|
|
|
|
"__builtin_creall",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_C99_BUILTIN(BUILT_IN_CIMAG,
|
|
|
|
"__builtin_cimag",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_DOUBLE_COMPLEX_DOUBLE,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_C99_BUILTIN(BUILT_IN_CIMAGF,
|
|
|
|
"__builtin_cimagf",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_FLOAT_COMPLEX_FLOAT,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_C99_BUILTIN(BUILT_IN_CIMAGL,
|
|
|
|
"__builtin_cimagl",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
DEF_UNUSED_BUILTIN(BUILT_IN_DIV)
|
|
|
|
DEF_UNUSED_BUILTIN(BUILT_IN_LDIV)
|
|
|
|
DEF_UNUSED_BUILTIN(BUILT_IN_FFLOOR)
|
|
|
|
DEF_UNUSED_BUILTIN(BUILT_IN_FCEIL)
|
|
|
|
DEF_UNUSED_BUILTIN(BUILT_IN_FMOD)
|
|
|
|
DEF_UNUSED_BUILTIN(BUILT_IN_FREM)
|
|
|
|
|
|
|
|
/* The system prototypes for `bzero' and `bcmp' functions have many
|
|
|
|
variations, so don't specify parameters to avoid conflicts. The
|
|
|
|
expand_* functions check the argument types anyway. */
|
|
|
|
DEF_BUILTIN (BUILT_IN_BZERO,
|
|
|
|
"__builtin_bzero",
|
|
|
|
BUILT_IN_NORMAL,
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_VOID_PTR_SIZE,
|
2002-02-01 18:16:02 +00:00
|
|
|
BT_FN_VOID_VAR,
|
2003-07-11 03:40:53 +00:00
|
|
|
true, true, true,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_BUILTIN (BUILT_IN_BCMP,
|
|
|
|
"__builtin_bcmp",
|
|
|
|
BUILT_IN_NORMAL,
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
|
2002-02-01 18:16:02 +00:00
|
|
|
BT_FN_INT_VAR,
|
2003-07-11 03:40:53 +00:00
|
|
|
true, true, true,
|
|
|
|
ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
DEF_EXT_LIB_BUILTIN(BUILT_IN_FFS,
|
|
|
|
"__builtin_ffs",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_INT,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_EXT_LIB_BUILTIN(BUILT_IN_INDEX,
|
|
|
|
"__builtin_index",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_STRING_CONST_STRING_INT,
|
|
|
|
ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_EXT_LIB_BUILTIN(BUILT_IN_RINDEX,
|
|
|
|
"__builtin_rindex",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_STRING_CONST_STRING_INT,
|
|
|
|
ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_MEMCPY,
|
|
|
|
"__builtin_memcpy",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR_PTR_CONST_PTR_SIZE,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_MEMCMP,
|
|
|
|
"__builtin_memcmp",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
|
|
|
|
ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_MEMSET,
|
|
|
|
"__builtin_memset",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR_PTR_INT_SIZE,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_STRCAT,
|
|
|
|
"__builtin_strcat",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_STRING_STRING_CONST_STRING,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_STRNCAT,
|
|
|
|
"__builtin_strncat",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_STRING_STRING_CONST_STRING_SIZE,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_STRCPY,
|
|
|
|
"__builtin_strcpy",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_STRING_STRING_CONST_STRING,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_STRNCPY,
|
|
|
|
"__builtin_strncpy",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_STRING_STRING_CONST_STRING_SIZE,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_STRCMP,
|
|
|
|
"__builtin_strcmp",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_CONST_STRING_CONST_STRING,
|
|
|
|
ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_STRNCMP,
|
|
|
|
"__builtin_strncmp",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_CONST_STRING_CONST_STRING_SIZE,
|
|
|
|
ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_STRLEN,
|
|
|
|
"__builtin_strlen",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_SIZE_CONST_STRING,
|
|
|
|
ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_STRSTR,
|
|
|
|
"__builtin_strstr",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_STRING_CONST_STRING_CONST_STRING,
|
|
|
|
ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_STRPBRK,
|
|
|
|
"__builtin_strpbrk",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_STRING_CONST_STRING_CONST_STRING,
|
|
|
|
ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_STRSPN,
|
|
|
|
"__builtin_strspn",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_SIZE_CONST_STRING_CONST_STRING,
|
|
|
|
ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_STRCSPN,
|
|
|
|
"__builtin_strcspn",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_SIZE_CONST_STRING_CONST_STRING,
|
|
|
|
ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_STRCHR,
|
|
|
|
"__builtin_strchr",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_STRING_CONST_STRING_INT,
|
|
|
|
ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_STRRCHR,
|
|
|
|
"__builtin_strrchr",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_STRING_CONST_STRING_INT,
|
|
|
|
ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_SQRT,
|
|
|
|
"__builtin_sqrt",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_DOUBLE_DOUBLE,
|
|
|
|
flag_errno_math ? ATTR_NOTHROW_LIST
|
|
|
|
: (flag_unsafe_math_optimizations
|
|
|
|
? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST))
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_SIN,
|
|
|
|
"__builtin_sin",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_DOUBLE_DOUBLE,
|
|
|
|
flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_COS,
|
|
|
|
"__builtin_cos",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_DOUBLE_DOUBLE,
|
|
|
|
flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_EXP,
|
|
|
|
"__builtin_exp",
|
|
|
|
BT_FN_DOUBLE_DOUBLE,
|
|
|
|
flag_errno_math ? ATTR_NOTHROW_LIST
|
|
|
|
: (flag_unsafe_math_optimizations
|
|
|
|
? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST))
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_LOG,
|
|
|
|
"__builtin_log",
|
|
|
|
BT_FN_DOUBLE_DOUBLE,
|
|
|
|
flag_errno_math ? ATTR_NOTHROW_LIST
|
|
|
|
: (flag_unsafe_math_optimizations
|
|
|
|
? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST))
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_SQRTF,
|
|
|
|
"__builtin_sqrtf",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_FLOAT_FLOAT,
|
|
|
|
flag_errno_math ? ATTR_NOTHROW_LIST
|
|
|
|
: (flag_unsafe_math_optimizations
|
|
|
|
? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST))
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_SINF,
|
|
|
|
"__builtin_sinf",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_FLOAT_FLOAT,
|
|
|
|
flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_COSF,
|
|
|
|
"__builtin_cosf",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_FLOAT_FLOAT,
|
|
|
|
flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_EXPF,
|
|
|
|
"__builtin_expf",
|
|
|
|
BT_FN_FLOAT_FLOAT,
|
|
|
|
flag_errno_math ? ATTR_NOTHROW_LIST
|
|
|
|
: (flag_unsafe_math_optimizations
|
|
|
|
? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST))
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_LOGF,
|
|
|
|
"__builtin_logf",
|
|
|
|
BT_FN_FLOAT_FLOAT,
|
|
|
|
flag_errno_math ? ATTR_NOTHROW_LIST
|
|
|
|
: (flag_unsafe_math_optimizations
|
|
|
|
? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST))
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_SQRTL,
|
|
|
|
"__builtin_sqrtl",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_LONG_DOUBLE_LONG_DOUBLE,
|
|
|
|
flag_errno_math ? ATTR_NOTHROW_LIST
|
|
|
|
: (flag_unsafe_math_optimizations
|
|
|
|
? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST))
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_SINL,
|
|
|
|
"__builtin_sinl",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_LONG_DOUBLE_LONG_DOUBLE,
|
|
|
|
flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_COSL,
|
|
|
|
"__builtin_cosl",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_LONG_DOUBLE_LONG_DOUBLE,
|
|
|
|
flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_EXPL,
|
|
|
|
"__builtin_expl",
|
|
|
|
BT_FN_LONG_DOUBLE_LONG_DOUBLE,
|
|
|
|
flag_errno_math ? ATTR_NOTHROW_LIST
|
|
|
|
: (flag_unsafe_math_optimizations
|
|
|
|
? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST))
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_LOGL,
|
|
|
|
"__builtin_logl",
|
|
|
|
BT_FN_LONG_DOUBLE_LONG_DOUBLE,
|
|
|
|
flag_errno_math ? ATTR_NOTHROW_LIST
|
|
|
|
: (flag_unsafe_math_optimizations
|
|
|
|
? ATTR_CONST_NOTHROW_LIST
|
|
|
|
: ATTR_PURE_NOTHROW_LIST))
|
|
|
|
|
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_INF,
|
|
|
|
"__builtin_inf",
|
|
|
|
BT_FN_DOUBLE,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_INFF,
|
|
|
|
"__builtin_inff",
|
|
|
|
BT_FN_FLOAT,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_INFL,
|
|
|
|
"__builtin_infl",
|
|
|
|
BT_FN_LONG_DOUBLE,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
|
|
|
|
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_HUGE_VAL,
|
|
|
|
"__builtin_huge_val",
|
|
|
|
BT_FN_DOUBLE,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_HUGE_VALF,
|
|
|
|
"__builtin_huge_valf",
|
|
|
|
BT_FN_FLOAT,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_HUGE_VALL,
|
|
|
|
"__builtin_huge_vall",
|
|
|
|
BT_FN_LONG_DOUBLE,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
|
|
|
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_NAN,
|
|
|
|
"__builtin_nan",
|
|
|
|
BT_FN_DOUBLE_CONST_STRING,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_NANF,
|
|
|
|
"__builtin_nanf",
|
|
|
|
BT_FN_FLOAT_CONST_STRING,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_NANL,
|
|
|
|
"__builtin_nanl",
|
|
|
|
BT_FN_LONG_DOUBLE_CONST_STRING,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
|
|
|
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_NANS,
|
|
|
|
"__builtin_nans",
|
|
|
|
BT_FN_DOUBLE_CONST_STRING,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_NANSF,
|
|
|
|
"__builtin_nansf",
|
|
|
|
BT_FN_FLOAT_CONST_STRING,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_NANSL,
|
|
|
|
"__builtin_nansl",
|
|
|
|
BT_FN_LONG_DOUBLE_CONST_STRING,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_SAVEREGS,
|
|
|
|
"__builtin_saveregs",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR_VAR,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_CLASSIFY_TYPE,
|
|
|
|
"__builtin_classify_type",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_VAR,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_NEXT_ARG,
|
|
|
|
"__builtin_next_arg",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR_VAR,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_ARGS_INFO,
|
|
|
|
"__builtin_args_info",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_INT,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_CONSTANT_P,
|
|
|
|
"__builtin_constant_p",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_VAR,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_FRAME_ADDRESS,
|
|
|
|
"__builtin_frame_address",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR_UNSIGNED,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_RETURN_ADDRESS,
|
|
|
|
"__builtin_return_address",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR_UNSIGNED,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_AGGREGATE_INCOMING_ADDRESS,
|
|
|
|
"__builtin_aggregate_incoming_address",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR_VAR,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_APPLY_ARGS,
|
|
|
|
"__builtin_apply_args",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR_VAR,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_APPLY,
|
|
|
|
"__builtin_apply",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_RETURN,
|
|
|
|
"__builtin_return",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_VOID_PTR,
|
|
|
|
ATTR_NORETURN_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_SETJMP,
|
|
|
|
"__builtin_setjmp",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_PTR,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_LONGJMP,
|
|
|
|
"__builtin_longjmp",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_VOID_PTR_INT,
|
|
|
|
ATTR_NORETURN_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_TRAP,
|
|
|
|
"__builtin_trap",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_VOID,
|
|
|
|
ATTR_NORETURN_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_PREFETCH,
|
|
|
|
"__builtin_prefetch",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_VOID_CONST_PTR_VAR,
|
|
|
|
ATTR_NULL)
|
|
|
|
|
|
|
|
/* stdio.h builtins (without FILE *). */
|
|
|
|
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF,
|
|
|
|
"__builtin_printf",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_CONST_STRING_VAR,
|
|
|
|
ATTR_FORMAT_PRINTF_1_2)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_PUTCHAR,
|
|
|
|
"__builtin_putchar",
|
|
|
|
BT_FN_INT_INT,
|
|
|
|
ATTR_NOTHROW_LIST)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_PUTS,
|
|
|
|
"__builtin_puts",
|
|
|
|
BT_FN_INT_CONST_STRING,
|
|
|
|
ATTR_NOTHROW_LIST)
|
|
|
|
DEF_C99_BUILTIN(BUILT_IN_SNPRINTF,
|
|
|
|
"__builtin_snprintf",
|
|
|
|
BT_FN_INT_STRING_SIZE_CONST_STRING_VAR,
|
|
|
|
ATTR_FORMAT_PRINTF_3_4)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_SPRINTF,
|
|
|
|
"__builtin_sprintf",
|
|
|
|
BT_FN_INT_STRING_CONST_STRING_VAR,
|
|
|
|
ATTR_FORMAT_PRINTF_2_3)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_SCANF,
|
|
|
|
"__builtin_scanf",
|
|
|
|
BT_FN_INT_CONST_STRING_VAR,
|
|
|
|
ATTR_FORMAT_SCANF_1_2)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_SSCANF,
|
|
|
|
"__builtin_sscanf",
|
|
|
|
BT_FN_INT_CONST_STRING_CONST_STRING_VAR,
|
|
|
|
ATTR_FORMAT_SCANF_2_3)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_VPRINTF,
|
|
|
|
"__builtin_vprintf",
|
|
|
|
BT_FN_INT_CONST_STRING_VALIST_ARG,
|
|
|
|
ATTR_FORMAT_PRINTF_1_0)
|
|
|
|
DEF_C99_BUILTIN(BUILT_IN_VSCANF,
|
|
|
|
"__builtin_vscanf",
|
|
|
|
BT_FN_INT_CONST_STRING_VALIST_ARG,
|
|
|
|
ATTR_FORMAT_SCANF_1_0)
|
|
|
|
DEF_C99_BUILTIN(BUILT_IN_VSSCANF,
|
|
|
|
"__builtin_vsscanf",
|
|
|
|
BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG,
|
|
|
|
ATTR_FORMAT_SCANF_2_0)
|
|
|
|
DEF_C99_BUILTIN(BUILT_IN_VSNPRINTF,
|
|
|
|
"__builtin_vsnprintf",
|
|
|
|
BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG,
|
|
|
|
ATTR_FORMAT_PRINTF_3_0)
|
|
|
|
DEF_LIB_BUILTIN(BUILT_IN_VSPRINTF,
|
|
|
|
"__builtin_vsprintf",
|
|
|
|
BT_FN_INT_STRING_CONST_STRING_VALIST_ARG,
|
|
|
|
ATTR_FORMAT_PRINTF_2_0)
|
|
|
|
|
|
|
|
|
|
|
|
/* stdio.h builtins (with FILE *). */
|
|
|
|
|
2002-02-01 18:16:02 +00:00
|
|
|
/* Declare the __builtin_ style with arguments and the regular style
|
|
|
|
without them. We rely on stdio.h to supply the arguments for the
|
|
|
|
regular style declaration since we had to use void* instead of
|
|
|
|
FILE* in the __builtin_ prototype supplied here. */
|
2003-07-11 03:40:53 +00:00
|
|
|
|
|
|
|
DEF_FALLBACK_BUILTIN(BUILT_IN_FPUTC,
|
|
|
|
"__builtin_fputc",
|
|
|
|
BT_FN_INT_INT_PTR,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_BUILTIN (BUILT_IN_FPUTS,
|
|
|
|
"__builtin_fputs",
|
|
|
|
BUILT_IN_NORMAL,
|
|
|
|
BT_FN_INT_CONST_STRING_PTR,
|
|
|
|
BT_FN_INT_VAR,
|
2003-07-11 03:40:53 +00:00
|
|
|
true, true, false, ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_FALLBACK_BUILTIN(BUILT_IN_FWRITE,
|
|
|
|
"__builtin_fwrite",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
|
|
|
|
ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF,
|
|
|
|
"__builtin_fprintf",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_PTR_CONST_STRING_VAR,
|
|
|
|
ATTR_FORMAT_PRINTF_2_3)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
2003-07-11 03:40:53 +00:00
|
|
|
/* stdio unlocked builtins (without FILE *). */
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR_UNLOCKED,
|
|
|
|
"__builtin_putchar_unlocked",
|
|
|
|
BT_FN_INT_INT)
|
|
|
|
DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTS_UNLOCKED,
|
|
|
|
"__builtin_puts_unlocked",
|
|
|
|
BT_FN_INT_CONST_STRING)
|
|
|
|
DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF_UNLOCKED,
|
|
|
|
"__builtin_printf_unlocked",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_CONST_STRING_VAR,
|
|
|
|
ATTR_FORMAT_PRINTF_1_2)
|
|
|
|
|
|
|
|
/* stdio unlocked builtins (with FILE *). */
|
|
|
|
|
2002-02-01 18:16:02 +00:00
|
|
|
/* Declare the __builtin_ style with arguments and the regular style
|
|
|
|
without them. We rely on stdio.h to supply the arguments for the
|
|
|
|
regular style declaration since we had to use void* instead of
|
|
|
|
FILE* in the __builtin_ prototype supplied here. */
|
2003-07-11 03:40:53 +00:00
|
|
|
|
|
|
|
DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FPUTC_UNLOCKED,
|
|
|
|
"__builtin_fputc_unlocked",
|
|
|
|
BT_FN_INT_INT_PTR)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_BUILTIN (BUILT_IN_FPUTS_UNLOCKED,
|
|
|
|
"__builtin_fputs_unlocked",
|
|
|
|
BUILT_IN_NORMAL,
|
|
|
|
BT_FN_INT_CONST_STRING_PTR,
|
|
|
|
BT_FN_INT_VAR,
|
2003-07-11 03:40:53 +00:00
|
|
|
true, true, true, ATTR_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FWRITE_UNLOCKED,
|
|
|
|
"__builtin_fwrite_unlocked",
|
|
|
|
BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR)
|
|
|
|
DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF_UNLOCKED,
|
|
|
|
"__builtin_fprintf_unlocked",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_PTR_CONST_STRING_VAR,
|
|
|
|
ATTR_FORMAT_PRINTF_2_3)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
/* ISO C99 floating point unordered comparisons. */
|
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_ISGREATER,
|
|
|
|
"__builtin_isgreater",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_VAR,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_ISGREATEREQUAL,
|
|
|
|
"__builtin_isgreaterequal",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_VAR,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_ISLESS,
|
|
|
|
"__builtin_isless",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_VAR,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_ISLESSEQUAL,
|
|
|
|
"__builtin_islessequal",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_VAR,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_ISLESSGREATER,
|
|
|
|
"__builtin_islessgreater",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_VAR,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_ISUNORDERED,
|
|
|
|
"__builtin_isunordered",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_VAR,
|
|
|
|
ATTR_CONST_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
/* Various hooks for the DWARF 2 __throw routine. */
|
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_UNWIND_INIT,
|
|
|
|
"__builtin_unwind_init",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_VOID,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_DWARF_CFA,
|
|
|
|
"__builtin_dwarf_cfa",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR,
|
|
|
|
ATTR_NULL)
|
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_DWARF_SP_COLUMN,
|
|
|
|
"__builtin_dwarf_sp_column",
|
|
|
|
BT_FN_UNSIGNED,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_INIT_DWARF_REG_SIZES,
|
|
|
|
"__builtin_init_dwarf_reg_size_table",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_VOID_PTR,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_FROB_RETURN_ADDR,
|
|
|
|
"__builtin_frob_return_addr",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR_PTR,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_EXTRACT_RETURN_ADDR,
|
|
|
|
"__builtin_extract_return_addr",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_PTR_PTR,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN,
|
|
|
|
"__builtin_eh_return",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_VOID_PTRMODE_PTR,
|
|
|
|
ATTR_NORETURN_NOTHROW_LIST)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN_DATA_REGNO,
|
|
|
|
"__builtin_eh_return_data_regno",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_INT_INT,
|
|
|
|
ATTR_NULL)
|
|
|
|
|
|
|
|
/* Variable argument list (stdarg.h) support */
|
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_VA_START,
|
|
|
|
"__builtin_va_start",
|
|
|
|
BT_FN_VOID_VALIST_REF_VAR,
|
|
|
|
ATTR_NULL)
|
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_STDARG_START, /* backward compat */
|
2002-02-01 18:16:02 +00:00
|
|
|
"__builtin_stdarg_start",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_VOID_VALIST_REF_VAR,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_VA_END,
|
|
|
|
"__builtin_va_end",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_VOID_VALIST_REF,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_VA_COPY,
|
|
|
|
"__builtin_va_copy",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_VOID_VALIST_REF_VALIST_ARG,
|
|
|
|
ATTR_NULL)
|
|
|
|
|
2002-02-01 18:16:02 +00:00
|
|
|
DEF_GCC_BUILTIN(BUILT_IN_EXPECT,
|
|
|
|
"__builtin_expect",
|
2003-07-11 03:40:53 +00:00
|
|
|
BT_FN_LONG_LONG_LONG,
|
|
|
|
ATTR_NULL)
|
2002-02-01 18:16:02 +00:00
|
|
|
|
|
|
|
/* C++ extensions */
|
|
|
|
DEF_UNUSED_BUILTIN(BUILT_IN_NEW)
|
|
|
|
DEF_UNUSED_BUILTIN(BUILT_IN_VEC_NEW)
|
|
|
|
DEF_UNUSED_BUILTIN(BUILT_IN_DELETE)
|
|
|
|
DEF_UNUSED_BUILTIN(BUILT_IN_VEC_DELETE)
|
2003-07-11 03:40:53 +00:00
|
|
|
|
|
|
|
/* Declare abort, exit, _exit and _Exit */
|
|
|
|
DEF_BUILTIN (BUILT_IN_ABORT,
|
|
|
|
"__builtin_abort",
|
|
|
|
NOT_BUILT_IN,
|
|
|
|
BT_FN_VOID,
|
|
|
|
BT_FN_VOID,
|
|
|
|
1, 0, 0,
|
|
|
|
ATTR_NORETURN_NOTHROW_LIST)
|
|
|
|
|
|
|
|
DEF_BUILTIN (BUILT_IN_EXIT,
|
|
|
|
"__builtin_exit",
|
|
|
|
NOT_BUILT_IN,
|
|
|
|
BT_FN_VOID_INT,
|
|
|
|
BT_FN_VOID_INT,
|
|
|
|
1, 0, 0,
|
|
|
|
ATTR_NORETURN_NOTHROW_LIST)
|
|
|
|
|
|
|
|
DEF_BUILTIN (BUILT_IN__EXIT,
|
|
|
|
"__builtin__exit",
|
|
|
|
NOT_BUILT_IN,
|
|
|
|
BT_FN_VOID_INT,
|
|
|
|
BT_FN_VOID_INT,
|
|
|
|
1, 0, 1,
|
|
|
|
ATTR_NORETURN_NOTHROW_LIST)
|
|
|
|
|
|
|
|
DEF_BUILTIN (BUILT_IN__EXIT2,
|
|
|
|
"__builtin__Exit",
|
|
|
|
NOT_BUILT_IN,
|
|
|
|
BT_FN_VOID_INT,
|
|
|
|
BT_FN_VOID_INT,
|
|
|
|
1, 0, !flag_isoc99,
|
|
|
|
ATTR_NORETURN_NOTHROW_LIST)
|
|
|
|
|