aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/generated
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2010-11-16 21:23:19 +0000
committerTobias Burnus <burnus@gcc.gnu.org>2010-11-16 22:23:19 +0100
commit1ec601bf9fb0fbc39b3a6cb90450500f857adae8 (patch)
treee26ad385cfada5f1f2c55f92057a0259de8b98d2 /libgfortran/generated
parent07078664fd6fdcb046cee4adf01ee697e56fcbd3 (diff)
downloadgcc-1ec601bf9fb0fbc39b3a6cb90450500f857adae8.zip
gcc-1ec601bf9fb0fbc39b3a6cb90450500f857adae8.tar.gz
gcc-1ec601bf9fb0fbc39b3a6cb90450500f857adae8.tar.bz2
re PR fortran/32049 (Support on x86_64 also kind=16)
/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * Makefile.def: Add libquadmath; build it with language=fortran. * configure.ac: Add libquadmath. * Makefile.tpl: Handle multiple libs in check-[+language+]. * Makefile.in: Regenerate. * configure: Regenerate. libquadmath/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 Initial implementation and checkin. gcc/fortran/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * gfortranspec.c (find_spec_file): New function. (lang_specific_driver): Try to find .spec file and use it. * trans-io.c (iocall): Define * IOCALL_X_REAL128/COMPLEX128(,write). (gfc_build_io_library_fndecls): Build decl for __float128 I/O. (transfer_expr): Call __float128 I/O functions. * trans-types.c (gfc_init_kinds): Allow kind-16 belonging to __float128. gcc/testsuite/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * gfortran.dg/quad_1.f90: New. * lib/gcc-defs.exp (gcc-set-multilib-library-path): Use also compiler arguments. * lib/gfortran.exp (gfortran_link_flags): Add libquadmath to library search path; call gcc-set-multilib-library-path with arguments such that libgfortran.spec is found. (gfortran_init): Add path for libgfortran.spec to GFORTRAN_UNDER_TEST. libgomp/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * configure.ac: * configure: Regenerate. libgfortran/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * Makefile.am: Add missing pow_r16_i4.c, add transfer128.c, link libquadmath, if used. * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Add. * configure.ac: Use it, touch spec file. * gfortran.map: Add pow_r16_i4 and transfer_(real,complex)128(,write) functions. * intrinsics/cshift0.c (cshift0): Handle __float128 type. * intrinsics/erfc_scaled_inc.c: Ditto. * intrinsics/pack_generic.c (pack): Ditto * intrinsics/spread_generic.c (spread): Ditto. * intrinsics/unpack_generic.c (unpack1): Ditto. * io/read.c (convert_real): Ditto. * io/transfer.c: Update comments. * io/transfer128.c: New file. * io/write_float.def (write_float): Handle __float128 type. * libgfortran.h: #include quadmath_weak.h, define __builtin_infq and nanq. * m4/mtype.m4: Handle __float128 type. * runtime/in_pack_generic.c (internal_pack): Ditto. * runtime/in_unpack_generic.c (internal_unpack): Ditto. * kinds-override.h: New file. * libgfortran.spec.in: Ditto. * generated/pow_r16_i4.c: Generated. * Makefile.in: Regenerate. * configure: Regenerate. * config.h: Regenerate. * bessel_r10.c: Regenerate. * bessel_r16.c: Regenerate. * bessel_r4.c: Regenerate. * bessel_r8.c: Regenerate. * exponent_r16.c: Regenerate. * fraction_r16.c: Regenerate. * nearest_r16.c: Regenerate. * norm2_r10.c: Regenerate. * norm2_r16.c: Regenerate. * norm2_r4.c: Regenerate. * norm2_r8.c: Regenerate. * rrspacing_r16.c: Regenerate. * set_exponent_r16.c: Regenerate. * spacing_r16.c: Regenerate. Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r166825
Diffstat (limited to 'libgfortran/generated')
-rw-r--r--libgfortran/generated/bessel_r10.c1
-rw-r--r--libgfortran/generated/bessel_r16.c9
-rw-r--r--libgfortran/generated/bessel_r4.c1
-rw-r--r--libgfortran/generated/bessel_r8.c1
-rw-r--r--libgfortran/generated/exponent_r16.c2
-rw-r--r--libgfortran/generated/fraction_r16.c2
-rw-r--r--libgfortran/generated/nearest_r16.c2
-rw-r--r--libgfortran/generated/norm2_r10.c1
-rw-r--r--libgfortran/generated/norm2_r16.c7
-rw-r--r--libgfortran/generated/norm2_r4.c1
-rw-r--r--libgfortran/generated/norm2_r8.c1
-rw-r--r--libgfortran/generated/pow_r16_i4.c75
-rw-r--r--libgfortran/generated/rrspacing_r16.c4
-rw-r--r--libgfortran/generated/set_exponent_r16.c2
-rw-r--r--libgfortran/generated/spacing_r16.c4
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);