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]

Re: What is the current status of Quad-float support in Fortran?


----- Mensaje original -----
> De: "Tobias Burnus" <burnus@net-b.de>
> Para: "Alan W. Irwin" <irwin@beluga.phys.uvic.ca>
> CC: "gfortran List" <fortran@gcc.gnu.org>
> Enviados: Jueves, 7 de Julio 2011 7:03:55
> Asunto: Re: What is the current status of Quad-float support in Fortran?
>
> Dear Alan,
> 
> Le 7 juil. 2011 Ã 04:33, Alan W. Irwin a Ãcrit :
> 
> > What is the status now of that quadruple-precision gfortran effort?
> 
> The quad-precision library is part of GCC since its 4.6, which 
> was released on 25 March 2011. The library is described in
> http://gcc.gnu.org/onlinedocs/libquadmath/, although that
> documentation should be mostly of interest to C/C++ developers 
> as gfortran handles REAL(16) transparently. Libquadmath should 
> support all C99/Fortran 2008 functions and should be reasonably 
> stable and fast.
> 
> The libquadmath library is (by default) automatically build on
> systems, where GCC supports the __float128 data type. And, thus, 
> is available with gfortran 4.6/4.7 on systems supporting libquadmath.
> 
> See also the 4.6 release notes at
> http://gcc.gnu.org/gcc-4.6/changes.html
> 
> Thus, on x86-64 systems (possibly except systems such as NetBSD), GCC
> 4.6/4.7's gfortran offers the REAL data types of kind 4 (32 bit), 8
> (64), 10 (80) and 16 (128, via libquadmath).
> 
> > My platform is Debian stable (on AMD64 hardware) with gfortran
> > version "GNU Fortran (Debian 4.4.5-8) 4.4.5",
> 
> You could consider installing the "gfortran-4.6" package from wheezy
> (testing), which offers libquadmath and REAL(16) support.
> 
> Alternatively, there are (unofficial) builds available at
> http://gcc.gnu.org/wiki/GFortranBinaries ; in case of AMD64 both of
> 4.6 and of 4.7; those can also be installed as user, e.g. in $HOME, 
> which allows one to safely mix the system compiler and the other 
> compiler; one just needs to set PATH, LD_LIBRARY_PATH (and MANPATH) 
> accordingly.
> 
> If you want to build GCC yourself, see at the bottom of that
> GFortranBinaries page and follow the links mentioned there.
> 
> 
> On 07/07/2011 11:00 AM, FX wrote:
> > Quad-float (aka IEEE binary128) support was merged into mainline GCC
> > thanks to the efforts of Tobias Burnus and the gfortran maintainers,
>
> And thanks to Jakub Jelinek.
> 
> Tobias Burnus


Perhaps, for end users, a test case may be useful. 

Here attached a demo whose output is:

$ gfortran-beta --version
   GNU Fortran (GCC) 4.7.0 20110516 (experimental) 
   [trunk revision 173802]
   Copyright (C) 2011 Free Software Foundation, Inc.

$ gfortran-beta -o precisiontest.exe precisiontest.f90

$ precisiontest.exe
           4           8          10          16
  3.14159274    
  3.1415926535897931     
  3.14159265358979323851      
  3.14159265358979323846264338327950280 

that was obtained over a 32-bit processor (a Pentium 4 CPU 3.0GHz), 
using the binary:

gfortran-4.7-20110517-linux-i686.tar.gz 17-May-2011 7:20 35M

which is available in http://gcc.gnu.org/wiki/GFortranBinaries32Linux.


And thanks to the efforts of all Gfortran developers and users!



Regards,
Jorge.
--
! -----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
! $ gfortran-beta -o precisiontest.exe precisiontest.f90
! $ precisiontest.exe
!           4           8          10          16
!  3.14159274    
!  3.1415926535897931     
!  3.14159265358979323851      
!  3.14159265358979323846264338327950280   
! -----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
module precisionkinds
   use ISO_FORTRAN_ENV
   implicit none
   private
   public isp, idp, iep, iqp
   integer, parameter :: isp = REAL_KINDS (1)
   integer, parameter :: idp = REAL_KINDS (2)
   integer, parameter :: iep = REAL_KINDS (3)
   integer, parameter :: iqp = REAL_KINDS (4)
end module precisionkinds
!
program precisiontest
   use precisionkinds
   implicit none
   real (isp), parameter :: pi1 = 4*atan (1.0_isp)
   real (idp), parameter :: pi2 = 4*atan (1.0_idp)
   real (iep), parameter :: pi3 = 4*atan (1.0_iep)
   real (iqp), parameter :: pi4 = 4*atan (1.0_iqp)
   write (*,*) isp, idp, iep, iqp
   write (*,*) pi1
   write (*,*) pi2
   write (*,*) pi3
   write (*,*) pi4
end program precisiontest

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