[webkit-dev] Time to remove LIKELY and UNLIKELY macros?

Mike Lawther mikelawther at google.com
Tue Oct 2 00:17:00 PDT 2012

On 2 October 2012 16:29, Maciej Stachowiak <mjs at apple.com> wrote:

> Note, despite the stackoverflow thread cited, I would be highly surprised
> if static branch predicition had no effect ever, even on modern
> architectures. While recent intel CPUs have very good dynamic branch
> prediction, the basic block reordering should still have a significant
> impact in some cases due to cache effects.
> Aside: interestingly, the Core2 family of CPUs doesn't do 'static branch
prediction' in the traditional sense. When they encounter a branch not
already in the BTB, a BTB index is assigned to it. The prediction now
proceeds as though it were dynamic - meaning that this first time, it
predicts based on the previous data in that index. That is, it's
effectively a 50% chance of taken/not taken the first time the branch is
encountered (source: http://www.agner.org/optimize/microarchitecture.pdf,
Section 3.15).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20121002/b69c6a64/attachment.html>

More information about the webkit-dev mailing list