This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Inline C99 math functions
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Wilco Dijkstra <wdijkstr at arm dot com>
- Cc: 'Joseph Myers' <joseph at codesourcery dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 17 Jun 2015 18:37:02 +0200
- Subject: Re: [PATCH] Inline C99 math functions
- Authentication-results: sourceware.org; auth=none
- References: <001201d0a75b$921d9860$b658c920$ at com> <alpine dot DEB dot 2 dot 10 dot 1506151431490 dot 26683 at digraph dot polyomino dot org dot uk> <001701d0a789$f2ab86f0$d80294d0$ at com> <alpine dot DEB dot 2 dot 10 dot 1506151654100 dot 26683 at digraph dot polyomino dot org dot uk> <001801d0a84c$8c5cd7a0$a51686e0$ at com> <20150616164020 dot GA8970 at domone> <001901d0a85d$60857bd0$21907370$ at com> <20150617053502 dot GA13762 at domone> <001b01d0a911$be986160$3bc92420$ at com> <20150617163433 dot GA27278 at domone>
On Wed, Jun 17, 2015 at 06:34:33PM +0200, OndÅej BÃlka wrote:
>
> > I tried, but I don't think this is a good benchmark - you're not measuring
> > the FP->int move for the branched version, and you're comparing the signed
> > version of isinf vs the builtin which does isinf_ns.
> >
> Wilco that isinf is signed is again completely irrelevant. gcc is smart.
> It get expanded into
> if (foo ? (bar ? 1 : -1) : 0)
> that gcc simplifies to
> if (foo)
> so it doesn't matter that checking sign would take 100 cycles as its
> deleted code.
>
Forgot to add that you should use gcc-4.9 or higher. I know that 4.7
doesn't do that and don't remember if 4.8 does that.