This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH][AArch64] Add inlines for signbit (v2)


> 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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]