fenv.h builtins
authorMarc Glisse <marc.glisse@inria.fr>
Tue, 27 Jun 2017 09:38:28 +0000 (11:38 +0200)
committerMarc Glisse <glisse@gcc.gnu.org>
Tue, 27 Jun 2017 09:38:28 +0000 (09:38 +0000)
2017-06-27  Marc Glisse  <marc.glisse@inria.fr>

* 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

gcc/ChangeLog
gcc/builtin-types.def
gcc/builtins.def
gcc/tree-core.h
gcc/tree.c
gcc/tree.h

index 2da6160a0b59f59b9e758cf3cb2685375a3d1aa1..3fd4629607ad76b48e4ae2441cc6ca1e0d92e27b 100644 (file)
@@ -1,3 +1,24 @@
+2017-06-27  Marc Glisse  <marc.glisse@inria.fr>
+
+       * 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  <lambourg@adacore.com>
             Olivier Hainque  <hainque@adacore.com>
 
index 2a51d2583553dd2364833b5a8b9a5e38bd1db728..a0d7d40ac36a0778cd537f6577ed5cb5b5a49da4 100644 (file)
@@ -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)
 
index f242137a1cba70b8a28843d7e06e398790f871aa..1c1efceea217339643aea1ec4f4e0e2423c90da2 100644 (file)
@@ -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)
index 34e5c17ab22a846f5ea21ac150a2b248bf4a07e6..278d0c9b8f887f4242e8230f7934d18e6f8db0e8 100644 (file)
@@ -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,
index 13c6c90ba9817500ac671507e3e8095dda5c897f..ca28afad0f2f048b5d5fc856bf41e923c078167f 100644 (file)
@@ -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
index 7a4f5d64f19082992a1dcf58820e5bba8644781e..91cf253dee5a9cedb2f7481bd6978b2c8ac97792 100644 (file)
@@ -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  */