aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/f95-lang.c
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2012-03-15 22:27:07 +0200
committerJanne Blomqvist <jb@gcc.gnu.org>2012-03-15 22:27:07 +0200
commit6715d47bba944ef7b268ef54fde1c918013f480b (patch)
tree9579173dd828b7321d6ff0bd81d503222d4a0b19 /gcc/fortran/f95-lang.c
parent28eccf2d94aa9a1e3c11db6f7ebcbaf8968718b6 (diff)
downloadgcc-6715d47bba944ef7b268ef54fde1c918013f480b.zip
gcc-6715d47bba944ef7b268ef54fde1c918013f480b.tar.gz
gcc-6715d47bba944ef7b268ef54fde1c918013f480b.tar.bz2
Enable BUILT_IN_IROUND.
2012-03-15 Janne Blomqvist <jb@gcc.gnu.org> * f95-lang.c (gfc_init_builtin_functions): Initialize BUILT_IN_IROUND. * mathbuiltins.def: Add IROUND. * trans-intrinsic.c (build_round_expr): Use BUILT_IN_IROUND if type size matches. (gfc_build_intrinsic_lib_fndecls): Build iround functions. From-SVN: r185442
Diffstat (limited to 'gcc/fortran/f95-lang.c')
-rw-r--r--gcc/fortran/f95-lang.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index 05b598f..3f28e67 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -773,7 +773,11 @@ gfc_init_builtin_functions (void)
gfc_define_builtin ("__builtin_fmodf", mfunc_float[1],
BUILT_IN_FMODF, "fmodf", ATTR_CONST_NOTHROW_LEAF_LIST);
- /* lround{f,,l} and llround{f,,l} */
+ /* iround{f,,l}, lround{f,,l} and llround{f,,l} */
+ ftype = build_function_type_list (integer_type_node,
+ float_type_node, NULL_TREE);
+ gfc_define_builtin("__builtin_iroundf", ftype, BUILT_IN_IROUNDF,
+ "iroundf", ATTR_CONST_NOTHROW_LEAF_LIST);
ftype = build_function_type_list (long_integer_type_node,
float_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_lroundf", ftype, BUILT_IN_LROUNDF,
@@ -783,6 +787,10 @@ gfc_init_builtin_functions (void)
gfc_define_builtin ("__builtin_llroundf", ftype, BUILT_IN_LLROUNDF,
"llroundf", ATTR_CONST_NOTHROW_LEAF_LIST);
+ ftype = build_function_type_list (integer_type_node,
+ double_type_node, NULL_TREE);
+ gfc_define_builtin("__builtin_iround", ftype, BUILT_IN_IROUND,
+ "iround", ATTR_CONST_NOTHROW_LEAF_LIST);
ftype = build_function_type_list (long_integer_type_node,
double_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_lround", ftype, BUILT_IN_LROUND,
@@ -792,6 +800,10 @@ gfc_init_builtin_functions (void)
gfc_define_builtin ("__builtin_llround", ftype, BUILT_IN_LLROUND,
"llround", ATTR_CONST_NOTHROW_LEAF_LIST);
+ ftype = build_function_type_list (integer_type_node,
+ long_double_type_node, NULL_TREE);
+ gfc_define_builtin("__builtin_iroundl", ftype, BUILT_IN_IROUNDL,
+ "iroundl", ATTR_CONST_NOTHROW_LEAF_LIST);
ftype = build_function_type_list (long_integer_type_node,
long_double_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_lroundl", ftype, BUILT_IN_LROUNDL,