[fortran, patch] Add Fortran 2003 IEEE intrinsic modules
Steve Kargl
sgk@troutmask.apl.washington.edu
Fri Nov 22 16:05:00 GMT 2013
On Fri, Nov 22, 2013 at 03:27:05PM +0100, FX wrote:
> > You can add glibc to the list to of libraries that may have issues
> > with its long double math functions.
>
> Yeah, I?m sure I can find bugs in any math library :)
It's not bug. It is implementation details. For example, e_sqrtl.c
contains
long double
__ieee754_sqrtl (long double x)
{
fputs ("__ieee754_sqrtl not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}
strong_alias (__ieee754_sqrtl, __sqrtl_finite)
stub_warning (sqrtl)
Yes, gcc probably generates a hardware fpu instruction from sqrtl
(when an fpu is available), but there are other functions that
have "not implemented" messages.
> Also, IIRC, you did some great job in improving FreeBSD?s math
> library some time ago, so that will be an interesting platform
> to test my patch on!
Yes, I've implemented some of the missing C99 math functions for
FreeBSD. The status of FreeBSD's libm can be found at
https://wiki.freebsd.org/Numerics. The wiki lists some functions
that are implement but have yet to be committed. These include
my sincos[fl], erfl, and erfcl functions. Along the way, I found
erff and erfcf were somewhat broken and fixed these functions. The
problems I found in erff and erfcf are still present in glibc.
Unfortunately, as with gfortran I have little time to work on FreeBSD's
libm, so it is getting done in spurts.
PS: FreeBSD implements both Intel 80-bit and IEEE 128-bit long double
formats and the implementations are done with round-to-nearest by
default (except sqrtl which should be correctly rounded in all rounding
mode).
PPS: Thanks for picking up the IEEE-754 support for gfortran.
--
Steve
More information about the Fortran
mailing list