This is the mail archive of the java-patches@sourceware.cygnus.com mailing list for the Java project.


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

Re: Patch proposal: use __builtin_expect


> Date: Sat, 22 Apr 2000 10:57:18 -0700
> From: Anthony Green <green@cygnus.com>
> 
> Andrew wrote:
> > Hmm.  So __builtin_expect means that we expect the result *not* to be
> > true; it actually means "expect false". 
> 
> Not quite.  You always provide the expected result.  I always gave `0',
> so it does mean expect false in those cases.
> 
>     __builtin_expect (x, 5)
> 
> ...means we expect x to be 5.  It seems safest/easiest to just expect 0.

Ah, so it's easy to replace those examples with 

__builtin_expect (x, false)

To say we expect the result to be false.  Better, no?

Andrew.
(easily confused, evidently)

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