This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFC patch: Add libquadmath - and use it in gfortran (round two)
- From: Tobias Burnus <burnus at net-b dot de>
- To: gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 08 Nov 2010 21:33:21 +0100
- Subject: RFC patch: Add libquadmath - and use it in gfortran (round two)
- Reply-to: gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
Hi all,
that's an updated version of my patch at
http://gcc.gnu.org/ml/gcc-patches/2010-11/msg00653.html
which is in turn based on FX's patch at
http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02388.html
The patch contains:
a) libquadmath(.tar.bz2): __float128 math library. It exports all math
functions with the suffix "q" ("tanq", "jnq" etc.); it also exports two
I/O related functions with the prefix quadmath_. The library is used
from libgfortran but can also be used from C/C++. However, there is no
printf hook thus doing I/O from C/C++ is a bit more effort. The library
is automatically build if language=fortran is enabled, but on systems
without __float128 it is a no op.
b) quad.diff: The changes to the toplevel Makefile.def/configure.ac to
build libquad with language=fortran; changes to gcc/fortran to use
__float128; changes to libgfortran to use libquadmath.
Libgfortran automatically links libquadmath if it is available; if
-static-libgfortran is used, the (dynamically linked) libquadmath is
surounded by --as-needed/--no-as-needed.
c) quad_gen.diff: Due to popular request, the generated files.
Changes to previous patch:
- Fixed several issues regarding configure. I hope that it now builds on
Darwin and creates a DLL under Cygwin/MinGW(.org/64)*
- It does no longer use weakrefs for the math functions
- It uses a weakref for I/O (write_float etc.), but
- There is now a transfer_{complex,real}{,write}128 function, whose only
purpose is to drag in the libquadmath I/O function.
(* I got some feedback from Kai that with a stupid configure fix it now
should work on Cygwin.)
Comments?
Tobias
$ diffstat quad.diff
b/Makefile.def | 3 +
b/configure.ac | 1
b/gcc/fortran/gfortranspec.c | 38 +++++++++++++++++++
b/gcc/fortran/trans-io.c | 49
+++++++++++++++++++++++--
b/gcc/fortran/trans-types.c | 8 +++-
b/libgfortran/Makefile.am | 6 ++-
b/libgfortran/acinclude.m4 | 51
++++++++++++++++++++++++++
b/libgfortran/configure.ac | 13 +++++-
b/libgfortran/gfortran.map | 5 ++
b/libgfortran/intrinsics/cshift0.c | 28 +++++++++++---
b/libgfortran/intrinsics/erfc_scaled_inc.c | 11 +++++
b/libgfortran/intrinsics/pack_generic.c | 28 +++++++++++---
b/libgfortran/intrinsics/spread_generic.c | 56
++++++++++++++++++++++-------
b/libgfortran/intrinsics/unpack_generic.c | 56
++++++++++++++++++++++-------
b/libgfortran/io/read.c | 8 +++-
b/libgfortran/io/transfer.c | 56
++++++++++++++++++++++++++++-
b/libgfortran/io/write.c | 1
b/libgfortran/io/write_float.def | 11 +++++
b/libgfortran/libgfortran.h | 18 ++++++++-
b/libgfortran/m4/mtype.m4 | 2 -
b/libgfortran/mk-kinds-h.sh | 39 +++++++++++++-------
b/libgfortran/runtime/in_pack_generic.c | 29 +++++++++++----
b/libgfortran/runtime/in_unpack_generic.c | 31 ++++++++++++----
gcc/libgfortran/kinds-override.h | 46 +++++++++++++++++++++++
gcc/libgfortran/libgfortran.spec.in | 8 ++++
25 files changed, 524 insertions(+), 78 deletions(-)
$ diffstat quad-gen.diff
b/Makefile.in | 467 +
b/configure | 1
b/libgfortran/Makefile.in | 74
b/libgfortran/config.h.in | 3
b/libgfortran/configure | 139
gcc/libgfortran/generated/pow_r16_i4.c | 75
gcc/libquadmath/Makefile.in | 1219 +++
gcc/libquadmath/aclocal.m4 | 979 ++
gcc/libquadmath/config.h.in | 68
gcc/libquadmath/configure |13288
+++++++++++++++++++++++++++++++++
10 files changed, 16289 insertions(+), 24 deletions(-)
Attachment:
libquadmath.tar.bz2
Description: application/bzip
Attachment:
quad.diff.bz2
Description: application/bzip
Attachment:
quad-gen.diff.bz2
Description: application/bzip