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] Use __glibc_(un)likely instead __builtin_expect.


On Wednesday 30 October 2013 09:12:45 OndÅej BÃlka wrote:
> On Tue, Oct 29, 2013 at 10:01:38AM +0900, Namhyung Kim wrote:
> > On Mon, 28 Oct 2013 12:48:43 +0530, Siddhesh Poyarekar wrote:
> > > On Wed, Oct 23, 2013 at 12:01:31AM +0200, OndÅej BÃlka wrote:
> > >> Hi,
> > >> 
> > >> Now I return to one of todo-list issues which is using
> > >> glibc-likely/unlikely.
> > >> 
> > >> First comes a easy case which can be expressed as following script.
> > >> 
> > >> cat $1 | sed -e "s/if (__builtin_expect (\(.*\), 0))/if
> > >> (__glibc_unlikely (\1))/" | sed -e "s/if (__builtin_expect (\(.*\),
> > >> 1))/if (__glibc_likely (\1))/"
> > > 
> > > Based on Roland's comment, I did some automated verification of the
> > > patch.  I found the following problems:
> > > 
> > > 1. Changes in whitespace in macro definitions
> > > 2. Changes in whitespace in malloc routines
> > > 
> > > Could you fix these and repost?
> > 
> > I can see following cases also:
> > 
> > 1. if (__builtin_expect (XXX, 0) == 0)
> > 
> > Shouldn't it look like below?
> > 
> >    if (__glibc_likely (XXX == 0))
> > 
> > 2. if (__builtin_expect (YYY, 1) == 0)
> > 
> > Likewise
> > 
> >    if (__glibc_unlikely (YYY == 0))
> 
> Could but it would come as separate patch.

were you going to merge this as is then ?  i agree this second cleanup should 
happen, but i don't think it needs to happen with this obviously correct one.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


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