This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 6/8] float128: Expose _Float128 finite math functions.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Gabriel F. T. Gomes" <gftg at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Fri, 3 Mar 2017 20:50:21 +0000
- Subject: Re: [PATCH 6/8] float128: Expose _Float128 finite math functions.
- Authentication-results: sourceware.org; auth=none
- References: <1478716859-3246-1-git-send-email-gftg@linux.vnet.ibm.com> <1478716859-3246-7-git-send-email-gftg@linux.vnet.ibm.com> <alpine.DEB.2.20.1611092204000.6428@digraph.polyomino.org.uk> <20170303171700.48699970@keller>
On Fri, 3 Mar 2017, Gabriel F. T. Gomes wrote:
> On Wed, 9 Nov 2016 22:05:57 +0000
> Joseph Myers <joseph@codesourcery.com> wrote:
>
> > Rather than a load of repetitive boilerplate, the function declarations
> > here should be macroized, with only the definition of the macros depending
> > on __USE_ISOC99, __MATH_DECLARE_LDOUBLE, __NO_LONG_DOUBLE_MATH and
> > float128 presence etc. (for most functions, maybe obsolete and lgamma ones
> > are more complicated).
> >
>
> My attempts to macroize the function declarations were a bit
> frustrating. While some of the declarations follow a nice pattern
> (always declare for double; always declare for float when __USE_ISOC99;
> declare for long double based on __USE_ISOC99, __MATH_DECLARE_LDOUBLE,
> and __NO_LONG_DOUBLE_MATH), when that is not the case, the declarations
> are somewhat less clear and trickier to read, imo.
In subsequent discussions
<https://sourceware.org/ml/libc-alpha/2017-01/msg00404.html> I suggested
the right approach was like bits/mathcalls.h: make bits/math-finite.h into
a header included once for each type, with different macros defined. The
inclusions for float and long double would be conditional on __USE_ISOC99
(and the inclusions for _Float128 would be conditional on the same
conditions under which bits/mathcalls.h is included for _Float128).
An alternative would be merging bits/math-finite.h into bits/mathcalls.h
as I suggested in
<https://sourceware.org/ml/libc-alpha/2016-11/msg01098.html>, but I think
that would be more complicated to implement.
> For exp10 and pow10, the float version is declared *even* when
> __USE_ISOC99 is not. This means that I cannot create a macro that
That's because __USE_GNU implies __USE_ISOC99. That also means that there
is no change in semantics from making the inclusion for float conditional
on __USE_ISOC99, as those float versions will still be declared exactly
for __USE_GNU.
--
Joseph S. Myers
joseph@codesourcery.com