This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC patch: Add libquadmath - and use it in gfortran (round THREE)


Hi all,

this patch is an updated version of the one posted at http://gcc.gnu.org/ml/gcc-patches/2010-11/msg00790.html

As libquadmath remained unchanged, I did not include the 180K file but I just refer to http://gcc.gnu.org/ml/gcc-patches/2010-11/msg00790/libquadmath.tar.bz2

TODO: Fix using gfortran in libgomp. Currently, no .mod files are generated. It works if one manually runs "make omp_lib.mod" but it won't happen automatically.

General remark: Finding the libgfortran.spec makes huge troubles; I wonder whether using a spec file is really needed.

Changes:
- Fixed the complete nonsense in transfer.c (thanks Jack, Jerry et al.)
- Moved 128 functions into a separate translation unit (thanks Jakub) and added a comment
- Fixed -Wl,--as-needed detection (thanks to Rainer and Ralf)
- Fixed linkage of libquad during build (should help for Darwin, thanks to Ralf and Jack)
- Fixed testsuite (thanks to Jerry)


The weakref seems to work, though I still get a dependence on libquad with -static-libgfortran. The a.out then only contains a weakref ("w") while with a REAL(16) WRITE it contains a hardref ("U"). I thus assume it works.


The following description still applies:


On 11/08/2010 09:33 PM, Tobias Burnus wrote:
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.

Tobias


Current diffstat:

$ 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/gcc/testsuite/lib/gcc-defs.exp | 3
b/gcc/testsuite/lib/gfortran.exp | 14 +++
b/libgfortran/Makefile.am | 7 +
b/libgfortran/acinclude.m4 | 62 ++++++++++++++++
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 | 20 ++++-
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/runtime/in_pack_generic.c | 29 ++++++-
b/libgfortran/runtime/in_unpack_generic.c | 31 ++++++--
b/libgomp/configure.ac | 6 +
gcc/libgfortran/io/transfer128.c | 108 +++++++++++++++++++++++++++++
gcc/libgfortran/kinds-override.h | 46 ++++++++++++
gcc/libgfortran/libgfortran.spec.in | 8 ++
28 files changed, 599 insertions(+), 71 deletions(-)


$ diffstat quad-gen.diff
b/Makefile.in | 467 +
b/configure | 1
b/libgfortran/Makefile.in | 86
b/libgfortran/config.h.in | 3
b/libgfortran/configure | 119
b/libgomp/configure | 6
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 +++++++++++++++++++++++++++++++++
11 files changed, 16284 insertions(+), 27 deletions(-)

Attachment: quad.diff.bz2
Description: application/bzip

Attachment: quad-gen.diff.bz2
Description: application/bzip


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]