This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix tgamma errno setting on domain error (bug 6809)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: <libc-alpha at sourceware dot org>
- Date: Fri, 10 May 2013 11:39:25 +0000
- Subject: Re: Fix tgamma errno setting on domain error (bug 6809)
- References: <Pine dot LNX dot 4 dot 64 dot 1305092231060 dot 29757 at digraph dot polyomino dot org dot uk> <20130510085104 dot GA9329 at domone dot kolej dot mff dot cuni dot cz>
On Fri, 10 May 2013, Ondrej Bilka wrote:
> > - if(__builtin_expect(!__finite(y), 0)&&__finite(x)
> > + if(__builtin_expect(!__finite(y), 0)
> > + && (__finite (x) || __isinf (x) < 0)
> A nit why expect here is only in part of expression but not whole
> expression?
If the return value isn't finite, we're already in the unlikely case and
there isn't really much point optimizing the conditionals that come after
that. It makes sense for the first conditional to be the one that splits
things into likely / unlikely cases, since it's the likely case (finite
result) that's most important to optimize.
--
Joseph S. Myers
joseph@codesourcery.com