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: Fix tgamma errno setting on domain error (bug 6809)


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


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