diff options
author | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-08-28 22:10:52 +0000 |
---|---|---|
committer | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-08-28 22:10:52 +0000 |
commit | 9dc59fdf2f377ed3aea4eea47dd2cdd9082e685d (patch) | |
tree | 0834fa07275fef77737822694da3a4ad8215b389 /libgfortran/generated | |
parent | 7eae7954e3f64f036fa61628c30393e418189014 (diff) | |
download | ppe42-gcc-9dc59fdf2f377ed3aea4eea47dd2cdd9082e685d.tar.gz ppe42-gcc-9dc59fdf2f377ed3aea4eea47dd2cdd9082e685d.zip |
* m4/mtype.m4 (upcase, hasmathfunc, mathfunc_macro): New macros.
* m4/fraction.m4: Use new macros to support quad-float types.
* m4/set_exponent.m4: Likewise.
* m4/spacing.m4: Likewise.
* m4/exponent.m4: Likewise.
* m4/nearest.m4: Likewise.
* m4/norm2.m4: Likewise.
* m4/bessel.m4: Likewise.
* m4/rrspacing.m4: Likewise.
* generated/bessel_r4.c:Regenerated.
* generated/bessel_r8.c: Regenerated.
* generated/bessel_r10.c: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/exponent_r4.c: Regenerated.
* generated/exponent_r8.c: Regenerated.
* generated/exponent_r10.c: Regenerated.
* generated/exponent_r16.c: Regenerated.
* generated/fraction_r4.c: Regenerated.
* generated/fraction_r8.c: Regenerated.
* generated/fraction_r10.c: Regenerated.
* generated/fraction_r16.c: Regenerated.
* generated/nearest_r4.c: Regenerated.
* generated/nearest_r8.c: Regenerated.
* generated/nearest_r10.c: Regenerated.
* generated/nearest_r16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/rrspacing_r4.c: Regenerated.
* generated/rrspacing_r8.c: Regenerated.
* generated/rrspacing_r10.c: Regenerated.
* generated/rrspacing_r16.c: Regenerated.
* generated/set_exponent_r4.c: Regenerated.
* generated/set_exponent_r8.c: Regenerated.
* generated/set_exponent_r10.c: Regenerated.
* generated/set_exponent_r16.c: Regenerated.
* generated/spacing_r4.c: Regenerated.
* generated/spacing_r8.c: Regenerated.
* generated/spacing_r10.c: Regenerated.
* generated/spacing_r16.c: Regenerated.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163620 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/generated')
32 files changed, 262 insertions, 134 deletions
diff --git a/libgfortran/generated/bessel_r10.c b/libgfortran/generated/bessel_r10.c index 579de8445b0..efef4505188 100644 --- a/libgfortran/generated/bessel_r10.c +++ b/libgfortran/generated/bessel_r10.c @@ -29,6 +29,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <assert.h> + +#define MATHFUNC(funcname) funcname ## l + #if defined (HAVE_GFC_REAL_10) @@ -67,28 +70,28 @@ bessel_jn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2, GFC_REAL_10 x stride = GFC_DESCRIPTOR_STRIDE(ret,0); - if (unlikely (x == 0.0L)) + if (unlikely (x == 0)) { - ret->data[0] = 1.0L; + ret->data[0] = 1; for (i = 1; i <= n2-n1; i++) - ret->data[i*stride] = 0.0L; + ret->data[i*stride] = 0; return; } ret->data = ret->data; - last1 = jnl (n2, x); + last1 = MATHFUNC(jn) (n2, x); ret->data[(n2-n1)*stride] = last1; if (n1 == n2) return; - last2 = jnl (n2 - 1, x); + last2 = MATHFUNC(jn) (n2 - 1, x); ret->data[(n2-n1-1)*stride] = last2; if (n1 + 1 == n2) return; - x2rev = 2.0L/x; + x2rev = GFC_REAL_10_LITERAL(2.)/x; for (i = n2-n1-2; i >= 0; i--) { @@ -135,7 +138,7 @@ bessel_yn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2, stride = GFC_DESCRIPTOR_STRIDE(ret,0); - if (unlikely (x == 0.0L)) + if (unlikely (x == 0)) { for (i = 0; i <= n2-n1; i++) #if defined(GFC_REAL_10_INFINITY) @@ -147,19 +150,19 @@ bessel_yn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2, } ret->data = ret->data; - last1 = ynl (n1, x); + last1 = MATHFUNC(yn) (n1, x); ret->data[0] = last1; if (n1 == n2) return; - last2 = ynl (n1 + 1, x); + last2 = MATHFUNC(yn) (n1 + 1, x); ret->data[1*stride] = last2; if (n1 + 1 == n2) return; - x2rev = 2.0L/x; + x2rev = GFC_REAL_10_LITERAL(2.)/x; for (i = 2; i <= n1+n2; i++) { diff --git a/libgfortran/generated/bessel_r16.c b/libgfortran/generated/bessel_r16.c index a3ef181012e..d5ca883e899 100644 --- a/libgfortran/generated/bessel_r16.c +++ b/libgfortran/generated/bessel_r16.c @@ -29,11 +29,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <assert.h> + +#if defined(GFC_REAL_16_IS_FLOAT128) +#define MATHFUNC(funcname) funcname ## q +#else +#define MATHFUNC(funcname) funcname ## l +#endif + #if defined (HAVE_GFC_REAL_16) -#if defined (HAVE_JNL) +#if (defined(GFC_WITH_QUAD_LIB) || 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); @@ -67,28 +74,28 @@ bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2, GFC_REAL_16 x stride = GFC_DESCRIPTOR_STRIDE(ret,0); - if (unlikely (x == 0.0L)) + if (unlikely (x == 0)) { - ret->data[0] = 1.0L; + ret->data[0] = 1; for (i = 1; i <= n2-n1; i++) - ret->data[i*stride] = 0.0L; + ret->data[i*stride] = 0; return; } ret->data = ret->data; - last1 = jnl (n2, x); + last1 = MATHFUNC(jn) (n2, x); ret->data[(n2-n1)*stride] = last1; if (n1 == n2) return; - last2 = jnl (n2 - 1, x); + last2 = MATHFUNC(jn) (n2 - 1, x); ret->data[(n2-n1-1)*stride] = last2; if (n1 + 1 == n2) return; - x2rev = 2.0L/x; + x2rev = GFC_REAL_16_LITERAL(2.)/x; for (i = n2-n1-2; i >= 0; i--) { @@ -100,7 +107,7 @@ bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2, GFC_REAL_16 x #endif -#if defined (HAVE_YNL) +#if (defined(GFC_WITH_QUAD_LIB) || 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); @@ -135,7 +142,7 @@ bessel_yn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2, stride = GFC_DESCRIPTOR_STRIDE(ret,0); - if (unlikely (x == 0.0L)) + if (unlikely (x == 0)) { for (i = 0; i <= n2-n1; i++) #if defined(GFC_REAL_16_INFINITY) @@ -147,19 +154,19 @@ bessel_yn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2, } ret->data = ret->data; - last1 = ynl (n1, x); + last1 = MATHFUNC(yn) (n1, x); ret->data[0] = last1; if (n1 == n2) return; - last2 = ynl (n1 + 1, x); + last2 = MATHFUNC(yn) (n1 + 1, x); ret->data[1*stride] = last2; if (n1 + 1 == n2) return; - x2rev = 2.0L/x; + x2rev = GFC_REAL_16_LITERAL(2.)/x; for (i = 2; i <= n1+n2; i++) { diff --git a/libgfortran/generated/bessel_r4.c b/libgfortran/generated/bessel_r4.c index 961c67cb564..794a5f6b7f9 100644 --- a/libgfortran/generated/bessel_r4.c +++ b/libgfortran/generated/bessel_r4.c @@ -29,6 +29,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <assert.h> + +#define MATHFUNC(funcname) funcname ## f + #if defined (HAVE_GFC_REAL_4) @@ -67,28 +70,28 @@ bessel_jn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2, GFC_REAL_4 x) stride = GFC_DESCRIPTOR_STRIDE(ret,0); - if (unlikely (x == 0.0F)) + if (unlikely (x == 0)) { - ret->data[0] = 1.0F; + ret->data[0] = 1; for (i = 1; i <= n2-n1; i++) - ret->data[i*stride] = 0.0F; + ret->data[i*stride] = 0; return; } ret->data = ret->data; - last1 = jnf (n2, x); + last1 = MATHFUNC(jn) (n2, x); ret->data[(n2-n1)*stride] = last1; if (n1 == n2) return; - last2 = jnf (n2 - 1, x); + last2 = MATHFUNC(jn) (n2 - 1, x); ret->data[(n2-n1-1)*stride] = last2; if (n1 + 1 == n2) return; - x2rev = 2.0F/x; + x2rev = GFC_REAL_4_LITERAL(2.)/x; for (i = n2-n1-2; i >= 0; i--) { @@ -135,7 +138,7 @@ bessel_yn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2, stride = GFC_DESCRIPTOR_STRIDE(ret,0); - if (unlikely (x == 0.0F)) + if (unlikely (x == 0)) { for (i = 0; i <= n2-n1; i++) #if defined(GFC_REAL_4_INFINITY) @@ -147,19 +150,19 @@ bessel_yn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2, } ret->data = ret->data; - last1 = ynf (n1, x); + last1 = MATHFUNC(yn) (n1, x); ret->data[0] = last1; if (n1 == n2) return; - last2 = ynf (n1 + 1, x); + last2 = MATHFUNC(yn) (n1 + 1, x); ret->data[1*stride] = last2; if (n1 + 1 == n2) return; - x2rev = 2.0F/x; + x2rev = GFC_REAL_4_LITERAL(2.)/x; for (i = 2; i <= n1+n2; i++) { diff --git a/libgfortran/generated/bessel_r8.c b/libgfortran/generated/bessel_r8.c index c896ae41a91..e9f84b4ce54 100644 --- a/libgfortran/generated/bessel_r8.c +++ b/libgfortran/generated/bessel_r8.c @@ -29,6 +29,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <assert.h> + +#define MATHFUNC(funcname) funcname + #if defined (HAVE_GFC_REAL_8) @@ -67,28 +70,28 @@ bessel_jn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2, GFC_REAL_8 x) stride = GFC_DESCRIPTOR_STRIDE(ret,0); - if (unlikely (x == 0.0)) + if (unlikely (x == 0)) { - ret->data[0] = 1.0; + ret->data[0] = 1; for (i = 1; i <= n2-n1; i++) - ret->data[i*stride] = 0.0; + ret->data[i*stride] = 0; return; } ret->data = ret->data; - last1 = jn (n2, x); + last1 = MATHFUNC(jn) (n2, x); ret->data[(n2-n1)*stride] = last1; if (n1 == n2) return; - last2 = jn (n2 - 1, x); + last2 = MATHFUNC(jn) (n2 - 1, x); ret->data[(n2-n1-1)*stride] = last2; if (n1 + 1 == n2) return; - x2rev = 2.0/x; + x2rev = GFC_REAL_8_LITERAL(2.)/x; for (i = n2-n1-2; i >= 0; i--) { @@ -135,7 +138,7 @@ bessel_yn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2, stride = GFC_DESCRIPTOR_STRIDE(ret,0); - if (unlikely (x == 0.0)) + if (unlikely (x == 0)) { for (i = 0; i <= n2-n1; i++) #if defined(GFC_REAL_8_INFINITY) @@ -147,19 +150,19 @@ bessel_yn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2, } ret->data = ret->data; - last1 = yn (n1, x); + last1 = MATHFUNC(yn) (n1, x); ret->data[0] = last1; if (n1 == n2) return; - last2 = yn (n1 + 1, x); + last2 = MATHFUNC(yn) (n1 + 1, x); ret->data[1*stride] = last2; if (n1 + 1 == n2) return; - x2rev = 2.0/x; + x2rev = GFC_REAL_8_LITERAL(2.)/x; for (i = 2; i <= n1+n2; i++) { diff --git a/libgfortran/generated/exponent_r10.c b/libgfortran/generated/exponent_r10.c index 1b56765b3b1..ceafda30e2c 100644 --- a/libgfortran/generated/exponent_r10.c +++ b/libgfortran/generated/exponent_r10.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname ## l + #if defined (HAVE_GFC_REAL_10) && defined (HAVE_FREXPL) extern GFC_INTEGER_4 exponent_r10 (GFC_REAL_10 s); @@ -35,7 +38,7 @@ GFC_INTEGER_4 exponent_r10 (GFC_REAL_10 s) { int ret; - frexpl (s, &ret); + MATHFUNC(frexp) (s, &ret); return ret; } diff --git a/libgfortran/generated/exponent_r16.c b/libgfortran/generated/exponent_r16.c index 23f04152ddb..899a2aef359 100644 --- a/libgfortran/generated/exponent_r16.c +++ b/libgfortran/generated/exponent_r16.c @@ -26,7 +26,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" -#if defined (HAVE_GFC_REAL_16) && defined (HAVE_FREXPL) + +#if defined(GFC_REAL_16_IS_FLOAT128) +#define MATHFUNC(funcname) funcname ## q +#else +#define MATHFUNC(funcname) funcname ## l +#endif + +#if defined (HAVE_GFC_REAL_16) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_FREXPL)) extern GFC_INTEGER_4 exponent_r16 (GFC_REAL_16 s); export_proto(exponent_r16); @@ -35,7 +42,7 @@ GFC_INTEGER_4 exponent_r16 (GFC_REAL_16 s) { int ret; - frexpl (s, &ret); + MATHFUNC(frexp) (s, &ret); return ret; } diff --git a/libgfortran/generated/exponent_r4.c b/libgfortran/generated/exponent_r4.c index b2df840a48d..04aee1c922c 100644 --- a/libgfortran/generated/exponent_r4.c +++ b/libgfortran/generated/exponent_r4.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname ## f + #if defined (HAVE_GFC_REAL_4) && defined (HAVE_FREXPF) extern GFC_INTEGER_4 exponent_r4 (GFC_REAL_4 s); @@ -35,7 +38,7 @@ GFC_INTEGER_4 exponent_r4 (GFC_REAL_4 s) { int ret; - frexpf (s, &ret); + MATHFUNC(frexp) (s, &ret); return ret; } diff --git a/libgfortran/generated/exponent_r8.c b/libgfortran/generated/exponent_r8.c index ed4319ffa07..5c35c5d0de9 100644 --- a/libgfortran/generated/exponent_r8.c +++ b/libgfortran/generated/exponent_r8.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname + #if defined (HAVE_GFC_REAL_8) && defined (HAVE_FREXP) extern GFC_INTEGER_4 exponent_r8 (GFC_REAL_8 s); @@ -35,7 +38,7 @@ GFC_INTEGER_4 exponent_r8 (GFC_REAL_8 s) { int ret; - frexp (s, &ret); + MATHFUNC(frexp) (s, &ret); return ret; } diff --git a/libgfortran/generated/fraction_r10.c b/libgfortran/generated/fraction_r10.c index 46aa65d2cee..38cbdf8b44d 100644 --- a/libgfortran/generated/fraction_r10.c +++ b/libgfortran/generated/fraction_r10.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname ## l + #if defined (HAVE_GFC_REAL_10) && defined (HAVE_FREXPL) extern GFC_REAL_10 fraction_r10 (GFC_REAL_10 s); @@ -35,7 +38,7 @@ GFC_REAL_10 fraction_r10 (GFC_REAL_10 s) { int dummy_exp; - return frexpl (s, &dummy_exp); + return MATHFUNC(frexp) (s, &dummy_exp); } #endif diff --git a/libgfortran/generated/fraction_r16.c b/libgfortran/generated/fraction_r16.c index 1ae3262a43a..97e283dddc8 100644 --- a/libgfortran/generated/fraction_r16.c +++ b/libgfortran/generated/fraction_r16.c @@ -26,7 +26,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" -#if defined (HAVE_GFC_REAL_16) && defined (HAVE_FREXPL) + +#if defined(GFC_REAL_16_IS_FLOAT128) +#define MATHFUNC(funcname) funcname ## q +#else +#define MATHFUNC(funcname) funcname ## l +#endif + +#if defined (HAVE_GFC_REAL_16) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_FREXPL)) extern GFC_REAL_16 fraction_r16 (GFC_REAL_16 s); export_proto(fraction_r16); @@ -35,7 +42,7 @@ GFC_REAL_16 fraction_r16 (GFC_REAL_16 s) { int dummy_exp; - return frexpl (s, &dummy_exp); + return MATHFUNC(frexp) (s, &dummy_exp); } #endif diff --git a/libgfortran/generated/fraction_r4.c b/libgfortran/generated/fraction_r4.c index f2ea9e27918..a42e1468f51 100644 --- a/libgfortran/generated/fraction_r4.c +++ b/libgfortran/generated/fraction_r4.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname ## f + #if defined (HAVE_GFC_REAL_4) && defined (HAVE_FREXPF) extern GFC_REAL_4 fraction_r4 (GFC_REAL_4 s); @@ -35,7 +38,7 @@ GFC_REAL_4 fraction_r4 (GFC_REAL_4 s) { int dummy_exp; - return frexpf (s, &dummy_exp); + return MATHFUNC(frexp) (s, &dummy_exp); } #endif diff --git a/libgfortran/generated/fraction_r8.c b/libgfortran/generated/fraction_r8.c index 1e0f9361add..1e267091f37 100644 --- a/libgfortran/generated/fraction_r8.c +++ b/libgfortran/generated/fraction_r8.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname + #if defined (HAVE_GFC_REAL_8) && defined (HAVE_FREXP) extern GFC_REAL_8 fraction_r8 (GFC_REAL_8 s); @@ -35,7 +38,7 @@ GFC_REAL_8 fraction_r8 (GFC_REAL_8 s) { int dummy_exp; - return frexp (s, &dummy_exp); + return MATHFUNC(frexp) (s, &dummy_exp); } #endif diff --git a/libgfortran/generated/nearest_r10.c b/libgfortran/generated/nearest_r10.c index 9601e32332c..eb7a3b15a0d 100644 --- a/libgfortran/generated/nearest_r10.c +++ b/libgfortran/generated/nearest_r10.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname ## l + #if defined (HAVE_GFC_REAL_10) && defined (HAVE_COPYSIGNL) && defined (HAVE_NEXTAFTERL) extern GFC_REAL_10 nearest_r10 (GFC_REAL_10 s, GFC_REAL_10 dir); @@ -34,15 +37,15 @@ export_proto(nearest_r10); GFC_REAL_10 nearest_r10 (GFC_REAL_10 s, GFC_REAL_10 dir) { - dir = copysignl (__builtin_infl (), dir); + dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir); if (FLT_EVAL_METHOD != 0) { /* ??? Work around glibc bug on x86. */ - volatile GFC_REAL_10 r = nextafterl (s, dir); + volatile GFC_REAL_10 r = MATHFUNC(nextafter) (s, dir); return r; } else - return nextafterl (s, dir); + return MATHFUNC(nextafter) (s, dir); } #endif diff --git a/libgfortran/generated/nearest_r16.c b/libgfortran/generated/nearest_r16.c index 85499cbad14..474cf3609ae 100644 --- a/libgfortran/generated/nearest_r16.c +++ b/libgfortran/generated/nearest_r16.c @@ -26,7 +26,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" -#if defined (HAVE_GFC_REAL_16) && defined (HAVE_COPYSIGNL) && defined (HAVE_NEXTAFTERL) + +#if defined(GFC_REAL_16_IS_FLOAT128) +#define MATHFUNC(funcname) funcname ## q +#else +#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)) extern GFC_REAL_16 nearest_r16 (GFC_REAL_16 s, GFC_REAL_16 dir); export_proto(nearest_r16); @@ -34,15 +41,15 @@ export_proto(nearest_r16); GFC_REAL_16 nearest_r16 (GFC_REAL_16 s, GFC_REAL_16 dir) { - dir = copysignl (__builtin_infl (), dir); + dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir); if (FLT_EVAL_METHOD != 0) { /* ??? Work around glibc bug on x86. */ - volatile GFC_REAL_16 r = nextafterl (s, dir); + volatile GFC_REAL_16 r = MATHFUNC(nextafter) (s, dir); return r; } else - return nextafterl (s, dir); + return MATHFUNC(nextafter) (s, dir); } #endif diff --git a/libgfortran/generated/nearest_r4.c b/libgfortran/generated/nearest_r4.c index 8ef4f316400..076df4b33e8 100644 --- a/libgfortran/generated/nearest_r4.c +++ b/libgfortran/generated/nearest_r4.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname ## f + #if defined (HAVE_GFC_REAL_4) && defined (HAVE_COPYSIGNF) && defined (HAVE_NEXTAFTERF) extern GFC_REAL_4 nearest_r4 (GFC_REAL_4 s, GFC_REAL_4 dir); @@ -34,15 +37,15 @@ export_proto(nearest_r4); GFC_REAL_4 nearest_r4 (GFC_REAL_4 s, GFC_REAL_4 dir) { - dir = copysignf (__builtin_inff (), dir); + dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir); if (FLT_EVAL_METHOD != 0) { /* ??? Work around glibc bug on x86. */ - volatile GFC_REAL_4 r = nextafterf (s, dir); + volatile GFC_REAL_4 r = MATHFUNC(nextafter) (s, dir); return r; } else - return nextafterf (s, dir); + return MATHFUNC(nextafter) (s, dir); } #endif diff --git a/libgfortran/generated/nearest_r8.c b/libgfortran/generated/nearest_r8.c index 40e6590252b..8ac00b17c6d 100644 --- a/libgfortran/generated/nearest_r8.c +++ b/libgfortran/generated/nearest_r8.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname + #if defined (HAVE_GFC_REAL_8) && defined (HAVE_COPYSIGN) && defined (HAVE_NEXTAFTER) extern GFC_REAL_8 nearest_r8 (GFC_REAL_8 s, GFC_REAL_8 dir); @@ -34,15 +37,15 @@ export_proto(nearest_r8); GFC_REAL_8 nearest_r8 (GFC_REAL_8 s, GFC_REAL_8 dir) { - dir = copysign (__builtin_inf (), dir); + dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir); if (FLT_EVAL_METHOD != 0) { /* ??? Work around glibc bug on x86. */ - volatile GFC_REAL_8 r = nextafter (s, dir); + volatile GFC_REAL_8 r = MATHFUNC(nextafter) (s, dir); return r; } else - return nextafter (s, dir); + return MATHFUNC(nextafter) (s, dir); } #endif diff --git a/libgfortran/generated/norm2_r10.c b/libgfortran/generated/norm2_r10.c index 64cf404e0a6..475a8cfa110 100644 --- a/libgfortran/generated/norm2_r10.c +++ b/libgfortran/generated/norm2_r10.c @@ -29,7 +29,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <assert.h> -#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_REAL_10) + +#if defined (HAVE_GFC_REAL_10) && defined (HAVE_GFC_REAL_10) && defined (HAVE_SQRTL) && defined (HAVE_FABSL) + +#define MATHFUNC(funcname) funcname ## l extern void norm2_r10 (gfc_array_r10 * const restrict, @@ -144,23 +147,23 @@ norm2_r10 (gfc_array_r10 * const restrict retarray, { GFC_REAL_10 scale; - result = 0.0L; - scale = 1.0L; + result = 0; + scale = 1; if (len <= 0) - *dest = 0.0L; + *dest = 0; else { for (n = 0; n < len; n++, src += delta) { - if (*src != 0.0L) + if (*src != 0) { GFC_REAL_10 absX, val; - absX = fabsl (*src); + absX = MATHFUNC(fabs) (*src); if (scale < absX) { val = scale / absX; - result = 1.0L + result * val * val; + result = 1 + result * val * val; scale = absX; } else @@ -170,7 +173,7 @@ norm2_r10 (gfc_array_r10 * const restrict retarray, } } } - result = scale * sqrtl (result); + result = scale * MATHFUNC(sqrt) (result); *dest = result; } } diff --git a/libgfortran/generated/norm2_r16.c b/libgfortran/generated/norm2_r16.c index 1fc79ae278b..acd57790a3d 100644 --- a/libgfortran/generated/norm2_r16.c +++ b/libgfortran/generated/norm2_r16.c @@ -29,7 +29,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <assert.h> -#if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_REAL_16) + +#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(GFC_REAL_16_IS_FLOAT128) +#define MATHFUNC(funcname) funcname ## q +#else +#define MATHFUNC(funcname) funcname ## l +#endif extern void norm2_r16 (gfc_array_r16 * const restrict, @@ -144,23 +151,23 @@ norm2_r16 (gfc_array_r16 * const restrict retarray, { GFC_REAL_16 scale; - result = 0.0L; - scale = 1.0L; + result = 0; + scale = 1; if (len <= 0) - *dest = 0.0L; + *dest = 0; else { for (n = 0; n < len; n++, src += delta) { - if (*src != 0.0L) + if (*src != 0) { GFC_REAL_16 absX, val; - absX = fabsl (*src); + absX = MATHFUNC(fabs) (*src); if (scale < absX) { val = scale / absX; - result = 1.0L + result * val * val; + result = 1 + result * val * val; scale = absX; } else @@ -170,7 +177,7 @@ norm2_r16 (gfc_array_r16 * const restrict retarray, } } } - result = scale * sqrtl (result); + result = scale * MATHFUNC(sqrt) (result); *dest = result; } } diff --git a/libgfortran/generated/norm2_r4.c b/libgfortran/generated/norm2_r4.c index 78f28dc77fd..83e034fa613 100644 --- a/libgfortran/generated/norm2_r4.c +++ b/libgfortran/generated/norm2_r4.c @@ -29,7 +29,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <assert.h> -#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_REAL_4) + +#if defined (HAVE_GFC_REAL_4) && defined (HAVE_GFC_REAL_4) && defined (HAVE_SQRTF) && defined (HAVE_FABSF) + +#define MATHFUNC(funcname) funcname ## f extern void norm2_r4 (gfc_array_r4 * const restrict, @@ -144,23 +147,23 @@ norm2_r4 (gfc_array_r4 * const restrict retarray, { GFC_REAL_4 scale; - result = 0.0F; - scale = 1.0F; + result = 0; + scale = 1; if (len <= 0) - *dest = 0.0F; + *dest = 0; else { for (n = 0; n < len; n++, src += delta) { - if (*src != 0.0F) + if (*src != 0) { GFC_REAL_4 absX, val; - absX = fabsf (*src); + absX = MATHFUNC(fabs) (*src); if (scale < absX) { val = scale / absX; - result = 1.0F + result * val * val; + result = 1 + result * val * val; scale = absX; } else @@ -170,7 +173,7 @@ norm2_r4 (gfc_array_r4 * const restrict retarray, } } } - result = scale * sqrtf (result); + result = scale * MATHFUNC(sqrt) (result); *dest = result; } } diff --git a/libgfortran/generated/norm2_r8.c b/libgfortran/generated/norm2_r8.c index fd9aba7416d..88599e83c7f 100644 --- a/libgfortran/generated/norm2_r8.c +++ b/libgfortran/generated/norm2_r8.c @@ -29,7 +29,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <assert.h> -#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_REAL_8) + +#if defined (HAVE_GFC_REAL_8) && defined (HAVE_GFC_REAL_8) && defined (HAVE_SQRT) && defined (HAVE_FABS) + +#define MATHFUNC(funcname) funcname extern void norm2_r8 (gfc_array_r8 * const restrict, @@ -144,23 +147,23 @@ norm2_r8 (gfc_array_r8 * const restrict retarray, { GFC_REAL_8 scale; - result = 0.0; - scale = 1.0; + result = 0; + scale = 1; if (len <= 0) - *dest = 0.0; + *dest = 0; else { for (n = 0; n < len; n++, src += delta) { - if (*src != 0.0) + if (*src != 0) { GFC_REAL_8 absX, val; - absX = fabs (*src); + absX = MATHFUNC(fabs) (*src); if (scale < absX) { val = scale / absX; - result = 1.0 + result * val * val; + result = 1 + result * val * val; scale = absX; } else @@ -170,7 +173,7 @@ norm2_r8 (gfc_array_r8 * const restrict retarray, } } } - result = scale * sqrt (result); + result = scale * MATHFUNC(sqrt) (result); *dest = result; } } diff --git a/libgfortran/generated/rrspacing_r10.c b/libgfortran/generated/rrspacing_r10.c index 1889d0ffcf1..298c9d1388b 100644 --- a/libgfortran/generated/rrspacing_r10.c +++ b/libgfortran/generated/rrspacing_r10.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname ## l + #if defined (HAVE_GFC_REAL_10) && defined (HAVE_FABSL) && defined (HAVE_FREXPL) extern GFC_REAL_10 rrspacing_r10 (GFC_REAL_10 s, int p); @@ -36,14 +39,14 @@ rrspacing_r10 (GFC_REAL_10 s, int p) { int e; GFC_REAL_10 x; - x = fabsl (s); + x = MATHFUNC(fabs) (s); if (x == 0.) return 0.; - frexpl (s, &e); + MATHFUNC(frexp) (s, &e); #if defined (HAVE_LDEXPL) - return ldexpl (x, p - e); + return MATHFUNC(ldexp) (x, p - e); #else - return scalbnl (x, p - e); + return MATHFUNC(scalbn) (x, p - e); #endif } diff --git a/libgfortran/generated/rrspacing_r16.c b/libgfortran/generated/rrspacing_r16.c index 10de2448ebf..3812435ba80 100644 --- a/libgfortran/generated/rrspacing_r16.c +++ b/libgfortran/generated/rrspacing_r16.c @@ -26,7 +26,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" -#if defined (HAVE_GFC_REAL_16) && defined (HAVE_FABSL) && defined (HAVE_FREXPL) + +#if defined(GFC_REAL_16_IS_FLOAT128) +#define MATHFUNC(funcname) funcname ## q +#else +#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)) extern GFC_REAL_16 rrspacing_r16 (GFC_REAL_16 s, int p); export_proto(rrspacing_r16); @@ -36,14 +43,14 @@ rrspacing_r16 (GFC_REAL_16 s, int p) { int e; GFC_REAL_16 x; - x = fabsl (s); + x = MATHFUNC(fabs) (s); if (x == 0.) return 0.; - frexpl (s, &e); -#if defined (HAVE_LDEXPL) - return ldexpl (x, p - e); + MATHFUNC(frexp) (s, &e); +#if (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_LDEXPL)) + return MATHFUNC(ldexp) (x, p - e); #else - return scalbnl (x, p - e); + return MATHFUNC(scalbn) (x, p - e); #endif } diff --git a/libgfortran/generated/rrspacing_r4.c b/libgfortran/generated/rrspacing_r4.c index 48683db343f..74a2826065b 100644 --- a/libgfortran/generated/rrspacing_r4.c +++ b/libgfortran/generated/rrspacing_r4.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname ## f + #if defined (HAVE_GFC_REAL_4) && defined (HAVE_FABSF) && defined (HAVE_FREXPF) extern GFC_REAL_4 rrspacing_r4 (GFC_REAL_4 s, int p); @@ -36,14 +39,14 @@ rrspacing_r4 (GFC_REAL_4 s, int p) { int e; GFC_REAL_4 x; - x = fabsf (s); + x = MATHFUNC(fabs) (s); if (x == 0.) return 0.; - frexpf (s, &e); + MATHFUNC(frexp) (s, &e); #if defined (HAVE_LDEXPF) - return ldexpf (x, p - e); + return MATHFUNC(ldexp) (x, p - e); #else - return scalbnf (x, p - e); + return MATHFUNC(scalbn) (x, p - e); #endif } diff --git a/libgfortran/generated/rrspacing_r8.c b/libgfortran/generated/rrspacing_r8.c index 75f2244551c..cf364189307 100644 --- a/libgfortran/generated/rrspacing_r8.c +++ b/libgfortran/generated/rrspacing_r8.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname + #if defined (HAVE_GFC_REAL_8) && defined (HAVE_FABS) && defined (HAVE_FREXP) extern GFC_REAL_8 rrspacing_r8 (GFC_REAL_8 s, int p); @@ -36,14 +39,14 @@ rrspacing_r8 (GFC_REAL_8 s, int p) { int e; GFC_REAL_8 x; - x = fabs (s); + x = MATHFUNC(fabs) (s); if (x == 0.) return 0.; - frexp (s, &e); + MATHFUNC(frexp) (s, &e); #if defined (HAVE_LDEXP) - return ldexp (x, p - e); + return MATHFUNC(ldexp) (x, p - e); #else - return scalbn (x, p - e); + return MATHFUNC(scalbn) (x, p - e); #endif } diff --git a/libgfortran/generated/set_exponent_r10.c b/libgfortran/generated/set_exponent_r10.c index 3f5238ded51..f6435f89b50 100644 --- a/libgfortran/generated/set_exponent_r10.c +++ b/libgfortran/generated/set_exponent_r10.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname ## l + #if defined (HAVE_GFC_REAL_10) && defined (HAVE_SCALBNL) && defined (HAVE_FREXPL) extern GFC_REAL_10 set_exponent_r10 (GFC_REAL_10 s, GFC_INTEGER_4 i); @@ -35,7 +38,7 @@ GFC_REAL_10 set_exponent_r10 (GFC_REAL_10 s, GFC_INTEGER_4 i) { int dummy_exp; - return scalbnl (frexpl (s, &dummy_exp), i); + return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i); } #endif diff --git a/libgfortran/generated/set_exponent_r16.c b/libgfortran/generated/set_exponent_r16.c index 4cd1ed5a441..8842dad8993 100644 --- a/libgfortran/generated/set_exponent_r16.c +++ b/libgfortran/generated/set_exponent_r16.c @@ -26,7 +26,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" -#if defined (HAVE_GFC_REAL_16) && defined (HAVE_SCALBNL) && defined (HAVE_FREXPL) + +#if defined(GFC_REAL_16_IS_FLOAT128) +#define MATHFUNC(funcname) funcname ## q +#else +#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)) extern GFC_REAL_16 set_exponent_r16 (GFC_REAL_16 s, GFC_INTEGER_4 i); export_proto(set_exponent_r16); @@ -35,7 +42,7 @@ GFC_REAL_16 set_exponent_r16 (GFC_REAL_16 s, GFC_INTEGER_4 i) { int dummy_exp; - return scalbnl (frexpl (s, &dummy_exp), i); + return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i); } #endif diff --git a/libgfortran/generated/set_exponent_r4.c b/libgfortran/generated/set_exponent_r4.c index 4d765c2f035..f88060237e8 100644 --- a/libgfortran/generated/set_exponent_r4.c +++ b/libgfortran/generated/set_exponent_r4.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname ## f + #if defined (HAVE_GFC_REAL_4) && defined (HAVE_SCALBNF) && defined (HAVE_FREXPF) extern GFC_REAL_4 set_exponent_r4 (GFC_REAL_4 s, GFC_INTEGER_4 i); @@ -35,7 +38,7 @@ GFC_REAL_4 set_exponent_r4 (GFC_REAL_4 s, GFC_INTEGER_4 i) { int dummy_exp; - return scalbnf (frexpf (s, &dummy_exp), i); + return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i); } #endif diff --git a/libgfortran/generated/set_exponent_r8.c b/libgfortran/generated/set_exponent_r8.c index ad8c3af5ebe..9d6fd1395a1 100644 --- a/libgfortran/generated/set_exponent_r8.c +++ b/libgfortran/generated/set_exponent_r8.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname + #if defined (HAVE_GFC_REAL_8) && defined (HAVE_SCALBN) && defined (HAVE_FREXP) extern GFC_REAL_8 set_exponent_r8 (GFC_REAL_8 s, GFC_INTEGER_4 i); @@ -35,7 +38,7 @@ GFC_REAL_8 set_exponent_r8 (GFC_REAL_8 s, GFC_INTEGER_4 i) { int dummy_exp; - return scalbn (frexp (s, &dummy_exp), i); + return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i); } #endif diff --git a/libgfortran/generated/spacing_r10.c b/libgfortran/generated/spacing_r10.c index 10a907345f5..abf6784b3ee 100644 --- a/libgfortran/generated/spacing_r10.c +++ b/libgfortran/generated/spacing_r10.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname ## l + #if defined (HAVE_GFC_REAL_10) && defined (HAVE_FREXPL) extern GFC_REAL_10 spacing_r10 (GFC_REAL_10 s, int p, int emin, GFC_REAL_10 tiny); @@ -37,13 +40,13 @@ spacing_r10 (GFC_REAL_10 s, int p, int emin, GFC_REAL_10 tiny) int e; if (s == 0.) return tiny; - frexpl (s, &e); + MATHFUNC(frexp) (s, &e); e = e - p; e = e > emin ? e : emin; #if defined (HAVE_LDEXPL) - return ldexpl (1., e); + return MATHFUNC(ldexp) (1., e); #else - return scalbnl (1., e); + return MATHFUNC(scalbn) (1., e); #endif } diff --git a/libgfortran/generated/spacing_r16.c b/libgfortran/generated/spacing_r16.c index 82ef8353d49..c95c0bafde8 100644 --- a/libgfortran/generated/spacing_r16.c +++ b/libgfortran/generated/spacing_r16.c @@ -26,7 +26,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" -#if defined (HAVE_GFC_REAL_16) && defined (HAVE_FREXPL) + +#if defined(GFC_REAL_16_IS_FLOAT128) +#define MATHFUNC(funcname) funcname ## q +#else +#define MATHFUNC(funcname) funcname ## l +#endif + +#if defined (HAVE_GFC_REAL_16) && (defined(GFC_WITH_QUAD_LIB) || 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); @@ -37,13 +44,13 @@ spacing_r16 (GFC_REAL_16 s, int p, int emin, GFC_REAL_16 tiny) int e; if (s == 0.) return tiny; - frexpl (s, &e); + MATHFUNC(frexp) (s, &e); e = e - p; e = e > emin ? e : emin; -#if defined (HAVE_LDEXPL) - return ldexpl (1., e); +#if (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_LDEXPL)) + return MATHFUNC(ldexp) (1., e); #else - return scalbnl (1., e); + return MATHFUNC(scalbn) (1., e); #endif } diff --git a/libgfortran/generated/spacing_r4.c b/libgfortran/generated/spacing_r4.c index 7936ba982bf..2be2906536d 100644 --- a/libgfortran/generated/spacing_r4.c +++ b/libgfortran/generated/spacing_r4.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname ## f + #if defined (HAVE_GFC_REAL_4) && defined (HAVE_FREXPF) extern GFC_REAL_4 spacing_r4 (GFC_REAL_4 s, int p, int emin, GFC_REAL_4 tiny); @@ -37,13 +40,13 @@ spacing_r4 (GFC_REAL_4 s, int p, int emin, GFC_REAL_4 tiny) int e; if (s == 0.) return tiny; - frexpf (s, &e); + MATHFUNC(frexp) (s, &e); e = e - p; e = e > emin ? e : emin; #if defined (HAVE_LDEXPF) - return ldexpf (1., e); + return MATHFUNC(ldexp) (1., e); #else - return scalbnf (1., e); + return MATHFUNC(scalbn) (1., e); #endif } diff --git a/libgfortran/generated/spacing_r8.c b/libgfortran/generated/spacing_r8.c index 3debe49249c..aa140b53e51 100644 --- a/libgfortran/generated/spacing_r8.c +++ b/libgfortran/generated/spacing_r8.c @@ -26,6 +26,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" + +#define MATHFUNC(funcname) funcname + #if defined (HAVE_GFC_REAL_8) && defined (HAVE_FREXP) extern GFC_REAL_8 spacing_r8 (GFC_REAL_8 s, int p, int emin, GFC_REAL_8 tiny); @@ -37,13 +40,13 @@ spacing_r8 (GFC_REAL_8 s, int p, int emin, GFC_REAL_8 tiny) int e; if (s == 0.) return tiny; - frexp (s, &e); + MATHFUNC(frexp) (s, &e); e = e - p; e = e > emin ? e : emin; #if defined (HAVE_LDEXP) - return ldexp (1., e); + return MATHFUNC(ldexp) (1., e); #else - return scalbn (1., e); + return MATHFUNC(scalbn) (1., e); #endif } |