From: Marc Glisse Date: Tue, 27 Jun 2017 09:38:28 +0000 (+0200) Subject: fenv.h builtins X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a889d6aa2730c084c338576b5a133134f142ce88;p=gcc.git fenv.h builtins 2017-06-27 Marc Glisse * builtin-types.def (BT_FENV_T_PTR, BT_CONST_FENV_T_PTR, BT_FEXCEPT_T_PTR, BT_CONST_FEXCEPT_T_PTR): New primitive types. (BT_FN_INT_FENV_T_PTR, BT_FN_INT_CONST_FENV_T_PTR, BT_FN_INT_FEXCEPT_T_PTR_INT, BT_FN_INT_CONST_FEXCEPT_T_PTR_INT): New function types. * builtins.def (BUILT_IN_FECLEAREXCEPT, BUILT_IN_FEGETENV, BUILT_IN_FEGETEXCEPTFLAG, BUILT_IN_FEGETROUND, BUILT_IN_FEHOLDEXCEPT, BUILT_IN_FERAISEEXCEPT, BUILT_IN_FESETENV, BUILT_IN_FESETEXCEPTFLAG, BUILT_IN_FESETROUND, BUILT_IN_FETESTEXCEPT, BUILT_IN_FEUPDATEENV): New builtins. * tree-core.h (TI_FENV_T_PTR_TYPE, TI_CONST_FENV_T_PTR_TYPE, TI_FEXCEPT_T_PTR_TYPE, TI_CONST_FEXCEPT_T_PTR_TYPE): New entries. * tree.h (fenv_t_ptr_type_node, const_fenv_t_ptr_type_node, fexcept_t_ptr_type_node, const_fexcept_t_ptr_type_node): New macros. (builtin_structptr_types): Adjust size. * tree.c (builtin_structptr_types): Add four entries. From-SVN: r249685 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2da6160a0b5..3fd4629607a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,24 @@ +2017-06-27 Marc Glisse + + * builtin-types.def (BT_FENV_T_PTR, BT_CONST_FENV_T_PTR, + BT_FEXCEPT_T_PTR, BT_CONST_FEXCEPT_T_PTR): New primitive types. + (BT_FN_INT_FENV_T_PTR, BT_FN_INT_CONST_FENV_T_PTR, + BT_FN_INT_FEXCEPT_T_PTR_INT, BT_FN_INT_CONST_FEXCEPT_T_PTR_INT): + New function types. + * builtins.def (BUILT_IN_FECLEAREXCEPT, BUILT_IN_FEGETENV, + BUILT_IN_FEGETEXCEPTFLAG, BUILT_IN_FEGETROUND, + BUILT_IN_FEHOLDEXCEPT, BUILT_IN_FERAISEEXCEPT, + BUILT_IN_FESETENV, BUILT_IN_FESETEXCEPTFLAG, + BUILT_IN_FESETROUND, BUILT_IN_FETESTEXCEPT, + BUILT_IN_FEUPDATEENV): New builtins. + * tree-core.h (TI_FENV_T_PTR_TYPE, TI_CONST_FENV_T_PTR_TYPE, + TI_FEXCEPT_T_PTR_TYPE, TI_CONST_FEXCEPT_T_PTR_TYPE): New entries. + * tree.h (fenv_t_ptr_type_node, const_fenv_t_ptr_type_node, + fexcept_t_ptr_type_node, const_fexcept_t_ptr_type_node): New + macros. + (builtin_structptr_types): Adjust size. + * tree.c (builtin_structptr_types): Add four entries. + 2017-06-27 Jerome Lambourg Olivier Hainque diff --git a/gcc/builtin-types.def b/gcc/builtin-types.def index 2a51d258355..a0d7d40ac36 100644 --- a/gcc/builtin-types.def +++ b/gcc/builtin-types.def @@ -107,6 +107,10 @@ DEF_PRIMITIVE_TYPE (BT_COMPLEX_LONGDOUBLE, complex_long_double_type_node) DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node) DEF_PRIMITIVE_TYPE (BT_FILEPTR, fileptr_type_node) DEF_PRIMITIVE_TYPE (BT_CONST_TM_PTR, const_tm_ptr_type_node) +DEF_PRIMITIVE_TYPE (BT_FENV_T_PTR, fenv_t_ptr_type_node) +DEF_PRIMITIVE_TYPE (BT_CONST_FENV_T_PTR, const_fenv_t_ptr_type_node) +DEF_PRIMITIVE_TYPE (BT_FEXCEPT_T_PTR, fexcept_t_ptr_type_node) +DEF_PRIMITIVE_TYPE (BT_CONST_FEXCEPT_T_PTR, const_fexcept_t_ptr_type_node) DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node) DEF_PRIMITIVE_TYPE (BT_VOLATILE_PTR, build_pointer_type @@ -298,6 +302,8 @@ DEF_FUNCTION_TYPE_1 (BT_FN_BND_CONST_PTR, BT_BND, BT_CONST_PTR) DEF_FUNCTION_TYPE_1 (BT_FN_CONST_PTR_BND, BT_CONST_PTR, BT_BND) DEF_FUNCTION_TYPE_1 (BT_FN_UINT16_UINT32, BT_UINT16, BT_UINT32) DEF_FUNCTION_TYPE_1 (BT_FN_UINT32_UINT16, BT_UINT32, BT_UINT16) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_FENV_T_PTR, BT_INT, BT_FENV_T_PTR) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_CONST_FENV_T_PTR, BT_INT, BT_CONST_FENV_T_PTR) DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR) @@ -471,6 +477,10 @@ DEF_FUNCTION_TYPE_2 (BT_FN_CONST_PTR_CONST_PTR_CONST_PTR, BT_CONST_PTR, BT_CONST DEF_FUNCTION_TYPE_2 (BT_FN_BND_CONST_PTR_SIZE, BT_BND, BT_CONST_PTR, BT_SIZE) DEF_FUNCTION_TYPE_2 (BT_FN_UINT32_UINT64_PTR, BT_UINT32, BT_UINT64, BT_PTR) +DEF_FUNCTION_TYPE_2 (BT_FN_INT_FEXCEPT_T_PTR_INT, BT_INT, BT_FEXCEPT_T_PTR, + BT_INT) +DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_FEXCEPT_T_PTR_INT, BT_INT, + BT_CONST_FEXCEPT_T_PTR, BT_INT) DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR_PTR, BT_FN_VOID_PTR_PTR) diff --git a/gcc/builtins.def b/gcc/builtins.def index f242137a1cb..1c1efceea21 100644 --- a/gcc/builtins.def +++ b/gcc/builtins.def @@ -365,6 +365,17 @@ DEF_GCC_BUILTIN (BUILT_IN_FABSD128, "fabsd128", BT_FN_DFLOAT128_DFLOAT128 DEF_C99_BUILTIN (BUILT_IN_FDIM, "fdim", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_FDIMF, "fdimf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_FDIML, "fdiml", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) +DEF_C99_BUILTIN (BUILT_IN_FECLEAREXCEPT, "feclearexcept", BT_FN_INT_INT, ATTR_NOTHROW_LEAF_LIST) +DEF_C99_BUILTIN (BUILT_IN_FEGETENV, "fegetenv", BT_FN_INT_FENV_T_PTR, ATTR_NOTHROW_LEAF_LIST) +DEF_C99_BUILTIN (BUILT_IN_FEGETEXCEPTFLAG, "fegetexceptflag", BT_FN_INT_FEXCEPT_T_PTR_INT, ATTR_NOTHROW_LEAF_LIST) +DEF_C99_BUILTIN (BUILT_IN_FEGETROUND, "fegetround", BT_FN_INT, ATTR_PURE_NOTHROW_LEAF_LIST) +DEF_C99_BUILTIN (BUILT_IN_FEHOLDEXCEPT, "feholdexcept", BT_FN_INT_FENV_T_PTR, ATTR_NOTHROW_LEAF_LIST) +DEF_C99_BUILTIN (BUILT_IN_FERAISEEXCEPT, "feraiseexcept", BT_FN_INT_INT, ATTR_NULL) +DEF_C99_BUILTIN (BUILT_IN_FESETENV, "fesetenv", BT_FN_INT_CONST_FENV_T_PTR, ATTR_NOTHROW_LEAF_LIST) +DEF_C99_BUILTIN (BUILT_IN_FESETEXCEPTFLAG, "fesetexceptflag", BT_FN_INT_CONST_FEXCEPT_T_PTR_INT, ATTR_NULL) +DEF_C99_BUILTIN (BUILT_IN_FESETROUND, "fesetround", BT_FN_INT_INT, ATTR_NOTHROW_LEAF_LIST) +DEF_C99_BUILTIN (BUILT_IN_FETESTEXCEPT, "fetestexcept", BT_FN_INT_INT, ATTR_NOTHROW_LEAF_LIST) +DEF_C99_BUILTIN (BUILT_IN_FEUPDATEENV, "feupdateenv", BT_FN_INT_CONST_FENV_T_PTR, ATTR_NULL) DEF_LIB_BUILTIN (BUILT_IN_FLOOR, "floor", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST) DEF_C99_C90RES_BUILTIN (BUILT_IN_FLOORF, "floorf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST) DEF_C99_C90RES_BUILTIN (BUILT_IN_FLOORL, "floorl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST) diff --git a/gcc/tree-core.h b/gcc/tree-core.h index 34e5c17ab22..278d0c9b8f8 100644 --- a/gcc/tree-core.h +++ b/gcc/tree-core.h @@ -627,6 +627,10 @@ enum tree_index { TI_BOOLEAN_TYPE, TI_FILEPTR_TYPE, TI_CONST_TM_PTR_TYPE, + TI_FENV_T_PTR_TYPE, + TI_CONST_FENV_T_PTR_TYPE, + TI_FEXCEPT_T_PTR_TYPE, + TI_CONST_FEXCEPT_T_PTR_TYPE, TI_POINTER_SIZED_TYPE, TI_POINTER_BOUNDS_TYPE, diff --git a/gcc/tree.c b/gcc/tree.c index 13c6c90ba98..ca28afad0f2 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -14552,10 +14552,14 @@ get_nonnull_args (const_tree fntype) real declaration. Keep the size up to date in tree.h ! */ -const builtin_structptr_type builtin_structptr_types[2] = +const builtin_structptr_type builtin_structptr_types[6] = { { fileptr_type_node, ptr_type_node, "FILE" }, - { const_tm_ptr_type_node, const_ptr_type_node, "tm" } + { const_tm_ptr_type_node, const_ptr_type_node, "tm" }, + { fenv_t_ptr_type_node, ptr_type_node, "fenv_t" }, + { const_fenv_t_ptr_type_node, const_ptr_type_node, "fenv_t" }, + { fexcept_t_ptr_type_node, ptr_type_node, "fexcept_t" }, + { const_fexcept_t_ptr_type_node, const_ptr_type_node, "fexcept_t" } }; #if CHECKING_P diff --git a/gcc/tree.h b/gcc/tree.h index 7a4f5d64f19..91cf253dee5 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -3725,6 +3725,12 @@ id_equal (const char *str, const_tree id) #define fileptr_type_node global_trees[TI_FILEPTR_TYPE] /* The C type `const struct tm *'. */ #define const_tm_ptr_type_node global_trees[TI_CONST_TM_PTR_TYPE] +/* The C type `fenv_t *'. */ +#define fenv_t_ptr_type_node global_trees[TI_FENV_T_PTR_TYPE] +#define const_fenv_t_ptr_type_node global_trees[TI_CONST_FENV_T_PTR_TYPE] +/* The C type `fexcept_t *'. */ +#define fexcept_t_ptr_type_node global_trees[TI_FEXCEPT_T_PTR_TYPE] +#define const_fexcept_t_ptr_type_node global_trees[TI_CONST_FEXCEPT_T_PTR_TYPE] #define pointer_sized_int_node global_trees[TI_POINTER_SIZED_TYPE] #define boolean_type_node global_trees[TI_BOOLEAN_TYPE] @@ -5531,5 +5537,5 @@ struct builtin_structptr_type tree& base; const char *str; }; -extern const builtin_structptr_type builtin_structptr_types[2]; +extern const builtin_structptr_type builtin_structptr_types[6]; #endif /* GCC_TREE_H */