likely and unlikely

Peter Jeremy peterjeremy at
Sun Mar 21 19:52:55 UTC 2010

On 2010-Mar-18 19:43:57 -0600, Scott Long <scottl at> wrote:
>My understanding was that Atom wasn't super-scalar at all and has no
>branch prediction or out-of-order logic.  It's basically an 80486
>with a modern instruction set.

Not quite.  It only has in-order pipelines (though it does have a
some very limited instruction re-ordering capablities) but is
super-scalar (it can issue up to two instructions per cycle) and
does have branch prediction.

On the latter point, Intel states "branch predictors in Intel Atom
processors do not distinguish between different branch types.
Sometimes mixing different branch types can cause confusion in the
branch prediction hardware."  On my netbook, I'm seeing about 15%
misprediction whilst idle but this drops to ~3% when I start OOo.
Overall it looks like it's around 7%.

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.

Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url :

More information about the freebsd-arch mailing list