Eric Johnson <eric.eerriicc@gmail.com> writes:
> Another thing to consider is that modern CPUs perform branch
> prediction, so it might not really matter that much whether your
> compiler optimizes in a certain particular way.
Yep, when code is run for the first time processor has no data about
execution of code and branches taken previously so it can only guess.
In x86 the guess is as follows: If the branch is forward it is guessed
not to be taken and if the branch is backward it is guessed to be taken.
--
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +--<mina86*tlen.pl>---<jid:mina86*chrome.pl>--ooO--(_)--Ooo--