Does/will gcc support REAL(16) in Fortran?
Jim Wilson
wilson@specifixinc.com
Fri Jan 9 21:30:00 GMT 2004
H. J. Lu wrote:
> Is REAL(16) supported in Fortran? I was told that most of Fortran
> compilers use IEEE 128bit quad precision for REAL(16), even on IA32
> and IA64 where 128bit quad precision is not supported by hardware.
> I was wondering if/when gcc would support REAL(16) on IA32/IA64 and
> what format would be used.
Any particular feature will be implemented when someone volunteers
patches for the feature. It is impossible to predict when that will happen.
ia64-hpux supports a 16-byte long double type which is the 128-bit quad
precision type you are looking for. This is for upwards compatibility
with hppa-hpux systems.
AMD64 and ia64-linux however support 16-byte long double types which are
80-bit (IEEE extended-double) precision values. This is for upward
compatibility with x86 systems.
Thanks to Zack's patches in November, it is now possible for gcc to
support two 16-byte FP types at the same time, so we can have both the
16-byte extended-double and the 16-byte quad-precision types. The IA-64
port already supports this via the __float80 and __float128 built-in
types. _float80 is the default long double type on linux, and
__float128 is the default long double type on hpux.
Getting the quad-precision support working for ia32/ia64 linux means
that we will need libgcc library routines for quad-precision values,
since we do not have hardware support for them. These could possibly
come from glibc if we only want this support to work under linux.
We will also need a full set of math library routines for quad-precision
values, and here it seems to get tricky, as we need two different sets
of long double routines depending on which long double type is being
used. This implies we need two different copies of libc, and all other
libraries that use long doubles. This could get messy.
If you can solve all of those problems, then you can have quad-precision
long double types in ia32/ia64 linux.
There is also the issue of adding fortran front end support to accept
these declarations. I can't comment on how much work that is.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
More information about the Gcc-patches
mailing list