This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug c/26366] __builtin_expect needs better documentation



------- Comment #5 from acahalan at gmail dot com  2006-02-22 03:14 -------
The code in comment #4 really isn't the same as the original. The original is a
decorated version of this:

if(x && y)

It is meant to express that:

x is likely
y is likely
x&&y is unlikely

Here, the probability of x times the probability of y is less than 0.5 even
though the probability of x and the probability of y are both greater than 0.5.

Nothing says that standalone __builtin_expect() calls should have no effect.
This can be much more readable than using the calls in a test.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26366


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