likely and unlikely
Paul Zimmerman
paul-zimmerman at sbcglobal.net
Thu Apr 15 05:43:39 UTC 2010
On 2010-Mar-21 19:52:40 -0600, Peter Jeremy <peterjeremy () acm ! org> wrote:
>I suspect predict_true/predict_false is unlikely to help in most cases.
>
>What would probably be more useful for Atom would be gcc scheduling
>support. This is available in gcc 4.3 (ie GPL3) but not in gcc 4.2.
>I've had a look at dumping the gcc 4.3 Atom scheduler into my gcc 4.2
>but the infrastructure has changed sufficiently that this would be a
>non-trivial task. (And since it would not be committable, I don't
>think it's worth my time). Likewise, implementing scheduling from
>scratch in gcc 4.2 would be a non-trivial task.
Just FYI, the use of likely/unlikely in the Linux kernel is not for branch
prediction. It is a hint to gcc which branch of the if() should be moved
out-of-line. The idea is to reduce the cache footprint of the most
frequently executed code paths.
--
Paul
More information about the freebsd-arch
mailing list