Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Mar 2010 21:50:33 +0000
From:      Bruce Cran <bruce@cran.org.uk>
To:        freebsd-arch@freebsd.org
Cc:        Max Laier <max@love2party.net>
Subject:   Re: likely and unlikely
Message-ID:  <201003162150.33852.bruce@cran.org.uk>
In-Reply-To: <20100313200155.O22734@delplex.bde.org>
References:  <hndbed$vok$1@dough.gmane.org> <201003121513.38721.max@love2party.net> <20100313200155.O22734@delplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 13 March 2010 09:24:39 Bruce Evans wrote:

> These macros may have useful 15-25 years ago for i386, i486 and Pentium1,
> since CPU branch predictors were either nonexistent or not so good.
> After that, CPU branch predictors became quite good.  The macros should
> have been mostly unused 15-25 years ago too, since they optimize for
> unreadability and unwritability.  Fortunately they are rarely used in
> FreeBSD.  They were imported from NetBSD in 2003 where they are used
> more (306 instances in 2005 NetBSD /sys vs 28 instances in 2004 FreeBSD
> /sys; there are 2208 instances of likely() in 2004 linux-2.6.10).

The Cell powerpc processor doesn't have a dynamic branch prediction unit. 
Quite a few articles recommend using __builtin_expect to improve performance.

-- 
Bruce Cran



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003162150.33852.bruce>