This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
RE: [PATCH][AArch64] Add inlines for signbit (v2)
- From: "Wilco Dijkstra" <wdijkstr at arm dot com>
- To: "'Joseph Myers'" <joseph at codesourcery dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 28 May 2015 16:09:20 +0100
- Subject: RE: [PATCH][AArch64] Add inlines for signbit (v2)
- Authentication-results: sourceware.org; auth=none
- References: <000001d07775$77c71880$67554980$ at com> <alpine dot DEB dot 2 dot 10 dot 1504241724020 dot 30193 at digraph dot polyomino dot org dot uk> <000001d080d7$830485a0$890d90e0$ at com> <alpine dot DEB dot 2 dot 10 dot 1504271707220 dot 17788 at digraph dot polyomino dot org dot uk> <000801d0947e$3af04780$b0d0d680$ at com> <alpine dot DEB dot 2 dot 10 dot 1505221423190 dot 16611 at digraph dot polyomino dot org dot uk> <000901d094ad$4799f6f0$d6cde4d0$ at com> <alpine dot DEB dot 2 dot 10 dot 1505221703500 dot 16611 at digraph dot polyomino dot org dot uk>
> Joseph Myers wrote:
> On Fri, 22 May 2015, Wilco Dijkstra wrote:
>
> > > Why the #undef? I don't see any headers with macro definitions of
> > > __signbitl that need to be removed in math.h.
> >
> > Unless nldbl support is dead we need it as
> > sysdeps/ldbl-opt/nldbl-signbit.c does:
> >
> > #define __signbitl __signbitl_XXX
> > #include "nldbl-compat.h"
> >
> > nldbl-compat.h includes math/math.h, which would define __signbitl
> > again. I couldn't force nldbl to build but replacing
> > sysdeps/ieee754/ldbl-128/s_signbitl.c with nldlb-signbit.c confirmed the
> > #undef fixes the issue.
>
> Thanks - I was only looking in headers for a #define. I think the nldbl
> code is for linking -mlong-double-64 objects with libm, although I'm not
> aware of any documentation for it. Having a #undef in an installed header
> that's only relevant for building glibc seems unfortunate. Maybe it would
> be cleaner to (a) convert all glibc-internal calls to __signbit* into
> calls to the signbit macro (which should make no difference to the code
> generated at all), then (b) conditionally change the definition of the
> signbit macro to use __builtin_signbit*, rather than ever defining
> __signbit* as macros.
Yes (a) seems like a good idea - I'll commit a trivial no-diff patch that does
that for __isinf*, __isnan*, __finite* and __signbit*. __copysign* and __isinf_ns
need more work as they are currently inlined inside GLIBC, so I'll leave those
for later.
The generic signbit definitions should use the built-ins like I did for fabs
(in principle the target assembler implementations could be removed as the
generic implementation using the builtin should be as good for all targets).
Also we could remove all the target math-inlines of __signbit as they are no
longer used when doing (b) given there is general agreement on no longer doing
header optimizations for older GCC versions.
Wilco