This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
RE: [PATCH][PING] Inline C99 math functions
- From: "Wilco Dijkstra" <wdijkstr at arm dot com>
- To: "'Joseph Myers'" <joseph at codesourcery dot com>
- Cc: "'GNU C Library'" <libc-alpha at sourceware dot org>
- Date: Wed, 22 Jul 2015 16:58:19 +0100
- Subject: RE: [PATCH][PING] Inline C99 math functions
- Authentication-results: sourceware.org; auth=none
- References: <001c01d0bd7e$25a147c0$70e3d740$ at com> <alpine dot DEB dot 2 dot 10 dot 1507221514520 dot 21570 at digraph dot polyomino dot org dot uk>
> Joseph Myers wrote:
> On Mon, 13 Jul 2015, Wilco Dijkstra wrote:
>
> > > Wilco Dijkstra wrote:
> > > Add inlining of the C99 math functions isinf/isnan/signbit/isfinite/isnormal/fpclassify
> using
> > > GCC built-ins when available. Since going through the PLT is expensive for these small
> > > functions, inlining results in major speedups (about 7x on Cortex-A57 for isinf). The GCC
> > > built-ins are not correct if signalling NaN support is required, and thus are turned off
> in
> > > that case (see GCC bug 66462). The test-snan.c tests sNaNs and so must be explicitly built
> > > with -fsignaling-nans.
> > >
> > > As a result of this many target overrides and the various __isnan/__finite inlines in
> > > math_private.h are no longer required. If agreed we could remove all this code and only
> keep
> > > the generic definition of isinf/etc which will use the builtin.
> > >
> > > Tested on AArch64. OK for commit?
> > >
> > > ChangeLog:
> > > 2015-06-15 Wilco Dijkstra <wdijkstr@arm.com>
> > >
> > > * math/Makefile: Build test-snan.c with -fsignaling-nans.
> > > * math/math.h (fpclassify): Use __builtin_fpclassify when
> > > available. (signbit): Use __builtin_signbit(f/l).
> > > (isfinite): Use__builtin_isfinite. (isnormal): Use
> > > __builtin_isnormal. (isnan): Use __builtin_isnan.
> > > (isinf): Use __builtin_isinf_sign.
> >
> > As suggested __fpclassify is not inlined when optimizing for size, and a benchmark
> > has been created (json output for x64 attached showing the large gains due to inlining).
>
> I don't see an updated ChangeLog entry (with the [BZ #N] notation I
> requested). Please include the ChangeLog entry with each patch
> submission.
It was still in the quotes. Something like this?
2015-07-xx Wilco Dijkstra <wdijkstr@arm.com>
* math/Makefile: Build test-snan.c with -fsignaling-nans.
* math/math.h (fpclassify): Use __builtin_fpclassify when
available. (signbit): Use __builtin_signbit(f/l).
(isfinite): Use__builtin_isfinite. (isnormal): Use
__builtin_isnormal. (isnan): Use __builtin_isnan - fixes [BZ #17441].
(isinf): Use __builtin_isinf_sign - fixes [BZ #15367].