diff options
Diffstat (limited to 'libgfortran/generated')
-rw-r--r-- | libgfortran/generated/bessel_r10.c | 1 | ||||
-rw-r--r-- | libgfortran/generated/bessel_r16.c | 9 | ||||
-rw-r--r-- | libgfortran/generated/bessel_r4.c | 1 | ||||
-rw-r--r-- | libgfortran/generated/bessel_r8.c | 1 | ||||
-rw-r--r-- | libgfortran/generated/exponent_r16.c | 2 | ||||
-rw-r--r-- | libgfortran/generated/fraction_r16.c | 2 | ||||
-rw-r--r-- | libgfortran/generated/nearest_r16.c | 2 | ||||
-rw-r--r-- | libgfortran/generated/norm2_r10.c | 1 | ||||
-rw-r--r-- | libgfortran/generated/norm2_r16.c | 7 | ||||
-rw-r--r-- | libgfortran/generated/norm2_r4.c | 1 | ||||
-rw-r--r-- | libgfortran/generated/norm2_r8.c | 1 | ||||
-rw-r--r-- | libgfortran/generated/pow_r16_i4.c | 75 | ||||
-rw-r--r-- | libgfortran/generated/rrspacing_r16.c | 4 | ||||
-rw-r--r-- | libgfortran/generated/set_exponent_r16.c | 2 | ||||
-rw-r--r-- | libgfortran/generated/spacing_r16.c | 4 |
15 files changed, 102 insertions, 11 deletions
diff --git a/libgfortran/generated/bessel_r10.c b/libgfortran/generated/bessel_r10.c index 93d08d6..87599fe 100644 --- a/libgfortran/generated/bessel_r10.c +++ b/libgfortran/generated/bessel_r10.c @@ -31,6 +31,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define MATHFUNC(funcname) funcname ## l +#define BUILTINMATHFUNC(funcname) MATHFUNC(funcname) #if defined (HAVE_GFC_REAL_10) diff --git a/libgfortran/generated/bessel_r16.c b/libgfortran/generated/bessel_r16.c index da9ab97..7097f6b 100644 --- a/libgfortran/generated/bessel_r16.c +++ b/libgfortran/generated/bessel_r16.c @@ -35,12 +35,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #else #define MATHFUNC(funcname) funcname ## l #endif +#if defined(GFC_REAL_16_IS_FLOAT128) +#define BUILTINMATHFUNC(funcname) funcname ## q +#else +#define BUILTINMATHFUNC(funcname) funcname ## l +#endif #if defined (HAVE_GFC_REAL_16) -#if (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_JNL)) +#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_JNL)) extern void bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2, GFC_REAL_16 x); export_proto(bessel_jn_r16); @@ -107,7 +112,7 @@ bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2, GFC_REAL_16 x #endif -#if (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_YNL)) +#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_YNL)) extern void bessel_yn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2, GFC_REAL_16 x); export_proto(bessel_yn_r16); diff --git a/libgfortran/generated/bessel_r4.c b/libgfortran/generated/bessel_r4.c index 3d6e3ca..75d2ff0 100644 --- a/libgfortran/generated/bessel_r4.c +++ b/libgfortran/generated/bessel_r4.c @@ -31,6 +31,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define MATHFUNC(funcname) funcname ## f +#define BUILTINMATHFUNC(funcname) MATHFUNC(funcname) #if defined (HAVE_GFC_REAL_4) diff --git a/libgfortran/generated/bessel_r8.c b/libgfortran/generated/bessel_r8.c index 7e3bcab..899237b 100644 --- a/libgfortran/generated/bessel_r8.c +++ b/libgfortran/generated/bessel_r8.c @@ -31,6 +31,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define MATHFUNC(funcname) funcname +#define BUILTINMATHFUNC(funcname) MATHFUNC(funcname) #if defined (HAVE_GFC_REAL_8) diff --git a/libgfortran/generated/exponent_r16.c b/libgfortran/generated/exponent_r16.c index 899a2ae..24a115f 100644 --- a/libgfortran/generated/exponent_r16.c +++ b/libgfortran/generated/exponent_r16.c @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define MATHFUNC(funcname) funcname ## l #endif -#if defined (HAVE_GFC_REAL_16) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_FREXPL)) +#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL)) extern GFC_INTEGER_4 exponent_r16 (GFC_REAL_16 s); export_proto(exponent_r16); diff --git a/libgfortran/generated/fraction_r16.c b/libgfortran/generated/fraction_r16.c index 97e283d..1481485 100644 --- a/libgfortran/generated/fraction_r16.c +++ b/libgfortran/generated/fraction_r16.c @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define MATHFUNC(funcname) funcname ## l #endif -#if defined (HAVE_GFC_REAL_16) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_FREXPL)) +#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL)) extern GFC_REAL_16 fraction_r16 (GFC_REAL_16 s); export_proto(fraction_r16); diff --git a/libgfortran/generated/nearest_r16.c b/libgfortran/generated/nearest_r16.c index 474cf36..7a7f430 100644 --- a/libgfortran/generated/nearest_r16.c +++ b/libgfortran/generated/nearest_r16.c @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define MATHFUNC(funcname) funcname ## l #endif -#if defined (HAVE_GFC_REAL_16) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_COPYSIGNL)) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_NEXTAFTERL)) +#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_COPYSIGNL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_NEXTAFTERL)) extern GFC_REAL_16 nearest_r16 (GFC_REAL_16 s, GFC_REAL_16 dir); export_proto(nearest_r16); diff --git a/libgfortran/generated/norm2_r10.c b/libgfortran/generated/norm2_r10.c index 475a8cf..404cb1c 100644 --- a/libgfortran/generated/norm2_r10.c +++ b/libgfortran/generated/norm2_r10.c @@ -33,6 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_REAL_10) && defined (HAVE_SQRTL) && defined (HAVE_FABSL) #define MATHFUNC(funcname) funcname ## l +#define BUILTINMATHFUNC(funcname) MATHFUNC(funcname) extern void norm2_r10 (gfc_array_r10 * const restrict, diff --git a/libgfortran/generated/norm2_r16.c b/libgfortran/generated/norm2_r16.c index acd5779..100f2e7 100644 --- a/libgfortran/generated/norm2_r16.c +++ b/libgfortran/generated/norm2_r16.c @@ -30,13 +30,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_REAL_16) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_SQRTL)) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_FABSL)) +#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_SQRTL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FABSL)) #if defined(GFC_REAL_16_IS_FLOAT128) #define MATHFUNC(funcname) funcname ## q #else #define MATHFUNC(funcname) funcname ## l #endif +#if defined(GFC_REAL_16_IS_FLOAT128) +#define BUILTINMATHFUNC(funcname) funcname ## q +#else +#define BUILTINMATHFUNC(funcname) funcname ## l +#endif extern void norm2_r16 (gfc_array_r16 * const restrict, diff --git a/libgfortran/generated/norm2_r4.c b/libgfortran/generated/norm2_r4.c index 83e034f..a86f76e 100644 --- a/libgfortran/generated/norm2_r4.c +++ b/libgfortran/generated/norm2_r4.c @@ -33,6 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_REAL_4) && defined (HAVE_SQRTF) && defined (HAVE_FABSF) #define MATHFUNC(funcname) funcname ## f +#define BUILTINMATHFUNC(funcname) MATHFUNC(funcname) extern void norm2_r4 (gfc_array_r4 * const restrict, diff --git a/libgfortran/generated/norm2_r8.c b/libgfortran/generated/norm2_r8.c index 88599e8..14487e8 100644 --- a/libgfortran/generated/norm2_r8.c +++ b/libgfortran/generated/norm2_r8.c @@ -33,6 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_REAL_8) && defined (HAVE_SQRT) && defined (HAVE_FABS) #define MATHFUNC(funcname) funcname +#define BUILTINMATHFUNC(funcname) MATHFUNC(funcname) extern void norm2_r8 (gfc_array_r8 * const restrict, diff --git a/libgfortran/generated/pow_r16_i4.c b/libgfortran/generated/pow_r16_i4.c new file mode 100644 index 0000000..bba2a84 --- /dev/null +++ b/libgfortran/generated/pow_r16_i4.c @@ -0,0 +1,75 @@ +/* Support routines for the intrinsic power (**) operator. + Copyright 2004, 2007, 2009 Free Software Foundation, Inc. + Contributed by Paul Brook + +This file is part of the GNU Fortran 95 runtime library (libgfortran). + +Libgfortran 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 3 of the License, or (at your option) any later version. + +Libgfortran 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. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +<http://www.gnu.org/licenses/>. */ + +#include "libgfortran.h" + + +/* Use Binary Method to calculate the powi. This is not an optimal but + a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of + Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art + of Computer Programming", 3rd Edition, 1998. */ + +#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_INTEGER_4) + +GFC_REAL_16 pow_r16_i4 (GFC_REAL_16 a, GFC_INTEGER_4 b); +export_proto(pow_r16_i4); + +GFC_REAL_16 +pow_r16_i4 (GFC_REAL_16 a, GFC_INTEGER_4 b) +{ + GFC_REAL_16 pow, x; + GFC_INTEGER_4 n; + GFC_UINTEGER_4 u; + + n = b; + x = a; + pow = 1; + if (n != 0) + { + if (n < 0) + { + + u = -n; + x = pow / x; + } + else + { + u = n; + } + for (;;) + { + if (u & 1) + pow *= x; + u >>= 1; + if (u) + x *= x; + else + break; + } + } + return pow; +} + +#endif diff --git a/libgfortran/generated/rrspacing_r16.c b/libgfortran/generated/rrspacing_r16.c index 3812435..8c6aae1 100644 --- a/libgfortran/generated/rrspacing_r16.c +++ b/libgfortran/generated/rrspacing_r16.c @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define MATHFUNC(funcname) funcname ## l #endif -#if defined (HAVE_GFC_REAL_16) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_FABSL)) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_FREXPL)) +#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FABSL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL)) extern GFC_REAL_16 rrspacing_r16 (GFC_REAL_16 s, int p); export_proto(rrspacing_r16); @@ -47,7 +47,7 @@ rrspacing_r16 (GFC_REAL_16 s, int p) if (x == 0.) return 0.; MATHFUNC(frexp) (s, &e); -#if (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_LDEXPL)) +#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_LDEXPL)) return MATHFUNC(ldexp) (x, p - e); #else return MATHFUNC(scalbn) (x, p - e); diff --git a/libgfortran/generated/set_exponent_r16.c b/libgfortran/generated/set_exponent_r16.c index 8842dad..e138344 100644 --- a/libgfortran/generated/set_exponent_r16.c +++ b/libgfortran/generated/set_exponent_r16.c @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define MATHFUNC(funcname) funcname ## l #endif -#if defined (HAVE_GFC_REAL_16) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_SCALBNL)) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_FREXPL)) +#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_SCALBNL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL)) extern GFC_REAL_16 set_exponent_r16 (GFC_REAL_16 s, GFC_INTEGER_4 i); export_proto(set_exponent_r16); diff --git a/libgfortran/generated/spacing_r16.c b/libgfortran/generated/spacing_r16.c index c95c0ba..f26b9fc 100644 --- a/libgfortran/generated/spacing_r16.c +++ b/libgfortran/generated/spacing_r16.c @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define MATHFUNC(funcname) funcname ## l #endif -#if defined (HAVE_GFC_REAL_16) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_FREXPL)) +#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL)) extern GFC_REAL_16 spacing_r16 (GFC_REAL_16 s, int p, int emin, GFC_REAL_16 tiny); export_proto(spacing_r16); @@ -47,7 +47,7 @@ spacing_r16 (GFC_REAL_16 s, int p, int emin, GFC_REAL_16 tiny) MATHFUNC(frexp) (s, &e); e = e - p; e = e > emin ? e : emin; -#if (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_LDEXPL)) +#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_LDEXPL)) return MATHFUNC(ldexp) (1., e); #else return MATHFUNC(scalbn) (1., e); |