|
|
|
|
|
by edge17
5544 days ago
|
|
haven't seen this stuff in a while... given the complexity and large history-tracking tables of modern branch predictors, is this stuff still useful? or is the code written in this manner just to make it more platform independent (i.e. cycles still matter for embedded applications, etc)? |
|
The gcc built-in simply will organize the code in a manner that makes the likely statement faster to execute (e.g. branching the unlikely block).
Branch predictors are a runtime mechanism so the processor guesses which outcome of the "if" is more likely.
One is a static optimization, the other is dynamic; if you like to think about it that way.