[fortran,patch] Complete front-end support for __float128

Jakub Jelinek jakub@redhat.com
Thu Aug 26 19:37:00 GMT 2010


On Thu, Aug 26, 2010 at 08:23:12PM +0200, FX wrote:
> >>> Oh, and last but not least: I don't know how the quad-math library will turn up being licensed/distributed, but we probably should only link it in when necessary, shouldn't we?
> >> Well, let's see how that part of intergation will turn out.
> > 
> > Yep, that's my responsibility ;-) I hope to find some time Saturday (in spite of the fact that this technically still my summer holiday, I have very little time now).
> 
> In order for this to progress, please find at http://quatramaran.ens.fr/~coudert/tmp/libquad.tar.bz2 my first attempt at making a clean package of the quad math support library.
> 
> The prototypes of the exported functions are in src/quad.h. They are:
> 
>  -- rounding functions, division: lroundq, llroundq, truncq, roundq, ceilq, floorq, fmodq, modfq, remainderq
>  -- exponent manipulation: frexpq, ldexpq, scalbnq, scalblnq
>  -- sign/infinities/NaNs: isinfq, isnanq, nanq, finiteq, fabsq, copysignq, signbitq, nextafterq
>  -- roots and powers: sqrtq, cbrtq, powq, hypotq
>  -- exp and log: expq, expm1q, logq, log10q, log1pq
>  -- trigonometric functions: {a,}{cos,sin,tan}{h,}q, sincosq, atan2q
>  -- special functions: erfq, erfcq, tgammaq, lgammaq
>  -- Bessel functions: j0q, j1q, jnq, y0q, y1q, ynq
>  -- complex C99-like functions: cabsq, cargq, csqrtq, cpowq, cexpq, cexpiq, clogq, clog10q, csinq, ccosq, ctanq, csinhq, ccoshq, ctanhq
> 
> The I/O routines have two entry points specifically tailored for libgfortran: strtopQ and g_Qfmt.

If it isn't linked into libgfortran, but is a standalone library, I think
exporting functions like strtopQ and g_Qfmt from it is bad idea. 
Preferrably export some non-fortran specific APIs that other programs/libs
can use too for implementing IO (e.g. something usable for libc printf
hooks).  For string to __float128 it should probably have API similar to
strtold and be called strtolq (strtoq is already taken by BSDs).
And for the non-standard names, the mixed case is
weird and if it isn't a name of a standard function with q suffix instead of
l, it should be clearly from libquadmath's namespace, so say
quadmath_ prefixed or something.

	Jakub



More information about the Fortran mailing list