aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/mathbuiltins.def
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2010-06-11 19:35:19 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2010-06-11 19:35:19 +0000
commit2921157dbf8c0ac389c3f04aaf73a0f6de50e93c (patch)
tree8757faf0742761a2cf2730ea7615a2dda97ab17a /gcc/fortran/mathbuiltins.def
parented9955f9285490aae391ffa48d39a1fa637eb1b9 (diff)
downloadgcc-2921157dbf8c0ac389c3f04aaf73a0f6de50e93c.zip
gcc-2921157dbf8c0ac389c3f04aaf73a0f6de50e93c.tar.gz
gcc-2921157dbf8c0ac389c3f04aaf73a0f6de50e93c.tar.bz2
mathbuiltins.def: Add builtins that do not directly correspond to a Fortran intrinsic...
* mathbuiltins.def: Add builtins that do not directly correspond to a Fortran intrinsic, with new macro OTHER_BUILTIN. * f95-lang.c (gfc_init_builtin_functions): Define OTHER_BUILTIN. * trans-intrinsic.c (gfc_intrinsic_map_t): Remove code_{r,c}{4,8,10,16} fields. Add {,complex}{float,double,long_double}_built_in fields. (gfc_intrinsic_map): Adjust definitions of DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C and LIB_FUNCTION accordingly. Add definition of OTHER_BUILTIN. (real_compnt_info): Remove unused struct. (builtin_decl_for_precision, builtin_decl_for_float_kind): New functions. (build_round_expr): Call builtin_decl_for_precision instead of series of if-else. (gfc_conv_intrinsic_aint): Call builtin_decl_for_float_kind instead of a switch. (gfc_build_intrinsic_lib_fndecls): Match {real,complex}{4,8,10,16}decl into the C-style built_in_decls. (gfc_get_intrinsic_lib_fndecl): Do not hardcode floating-point kinds. (gfc_conv_intrinsic_lib_function): Go through all the extended gfc_intrinsic_map. (gfc_trans_same_strlen_check): Call builtin_decl_for_float_kind instead of a switch. (gfc_conv_intrinsic_abs): Likewise. (gfc_conv_intrinsic_mod): Likewise. (gfc_conv_intrinsic_sign): Likewise. (gfc_conv_intrinsic_fraction): Likewise. (gfc_conv_intrinsic_nearest): Likewise. (gfc_conv_intrinsic_spacing): Likewise. (gfc_conv_intrinsic_rrspacing): Likewise. (gfc_conv_intrinsic_scale): Likewise. (gfc_conv_intrinsic_set_exponent): Likewise. From-SVN: r160628
Diffstat (limited to 'gcc/fortran/mathbuiltins.def')
-rw-r--r--gcc/fortran/mathbuiltins.def17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/fortran/mathbuiltins.def b/gcc/fortran/mathbuiltins.def
index 3bedc1a..2d6e967 100644
--- a/gcc/fortran/mathbuiltins.def
+++ b/gcc/fortran/mathbuiltins.def
@@ -51,3 +51,20 @@ DEFINE_MATH_BUILTIN (ERFC, "erfc", 0)
DEFINE_MATH_BUILTIN (TGAMMA,"tgamma", 0)
DEFINE_MATH_BUILTIN (LGAMMA,"lgamma", 0)
DEFINE_MATH_BUILTIN (HYPOT, "hypot", 1)
+
+/* OTHER_BUILTIN (CODE, NAME, PROTOTYPE_TYPE)
+ For floating-point builtins that do not directly correspond to a
+ Fortran intrinsic. This is used to map the different variants (float,
+ double and long double) and to build the quad-precision decls. */
+OTHER_BUILTIN (CABS, "cabs", cabs)
+OTHER_BUILTIN (COPYSIGN, "copysign", 2)
+OTHER_BUILTIN (FABS, "fabs", 1)
+OTHER_BUILTIN (FMOD, "fmod", 2)
+OTHER_BUILTIN (FREXP, "frexp", frexp)
+OTHER_BUILTIN (HUGE_VAL, "huge_val", 0)
+OTHER_BUILTIN (LLROUND, "llround", llround)
+OTHER_BUILTIN (LROUND, "lround", lround)
+OTHER_BUILTIN (NEXTAFTER, "nextafter", 2)
+OTHER_BUILTIN (ROUND, "round", 1)
+OTHER_BUILTIN (SCALBN, "scalbn", scalbn)
+OTHER_BUILTIN (TRUNC, "trunc", 1)