This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [fortran,patch] Higher-level access to floating-point builtins
- From: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- To: FX <fxcoudert at gmail dot com>, fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 11 Jun 2010 17:40:20 +0200
- Subject: Re: [fortran,patch] Higher-level access to floating-point builtins
Hi Fabriçe-Xavier,
FX wrote:
> In the front-end is deeply hardcoded the universal truth that
> real(kind=4) corresponds to the C "float" type, real(kind=8) to
> the C "double", and that one and only one of real(kind=10) and
> real(kind=16) exists, which corresponds to the "long double" type.
> [...] The goal of this patch is to get rid of this, in order to:
> 1. simplify the code
f95-lang.c | 3
mathbuiltins.def | 17 +
trans-intrinsic.c | 506 +++++++++++++++++-------------------------------------
3 files changed, 182 insertions(+), 344 deletions(-)
That looks good - I always like code-size reductions.
> 3. have only one place to change to introduce new floating-point
> types, such as __float128
Nit:
+ /* For now, we assume that if real(kind=10) exists, it is long double.
+ Later, we will deal with __float128 and break this assumption. */
I think that should be kind=16.
> Bootstrapped and regtested on x86_64-linux (both 32 and 64-bit, with LTO).
> OK to commit?
Looks fine to me - and it is certainly better not to assume the
real(kind=4/8/(10,16)) = C's float/double/long double correspondence.
Tobias