I was reading the popular answer about Branch Prediction from http://ift.tt/1B2BcJO, and there is something confusing me:
- If you guessed right, it continues on.
- If you guessed wrong, the captain will stop, back up, and yell at you to flip the switch. Then it can restart down the other path.
If you guess right every time, the train will never have to stop.
If you guess wrong too often, the train will spend a lot of time stopping, backing up, and restarting.
But this is what I don't get: to know whether your guess was right or wrong, you have to make a condition check anyway . So how does branch prediction even work, if either way you are still doing the same conditional check?
What I am trying to say is, isn't branch prediction exactly the same as having no branch prediction at all because you are doing the same conditional checks anyway? (obviously I'm wrong, but I don't get it)
Aucun commentaire:
Enregistrer un commentaire