When program execution flow reaches an unconditional jump, would the CPU pipeline be flushed? (The next prefetched instruction is the next instruction after jump, or the one at the jump target?) And would the branch target prediction buffer work here?
1 Answers
1
votes
On most architectures, unconditional branches aren't treated much different than conditional branches...
Your branch predictor will scan instructions ahead, looking for instruction addresses that it thinks are branches based on prior visits, and will predict taken/not taken/target.
So for an unconditional branch that doesn't have any prediction issues, it will be predicted as "taken" with the give target, without affecting the pipeline. If they mispredict (and the can), then you will need to flush the pipe.
Intel(R) Core(TM) i7-3770S
,microcode : 0x16
. Do you know how to get this kind of information on Linux? – WindChaserIvy Bridge
microarchitecture. – EOF