Predict never taken always assumes that the branch will not be taken and continue to fetch instruction in sequence.
Predict always taken assumes that the branch will be taken and always fetch the branet target
In these two approaches it is also possible to minimize the effect of a wrong decision.
If the fetch of an instruction after the branch will cause a page fault or protection violation, the processor halts its prefetching until it is sure that the instruction should be fetched.
Studies analyzing program behaviour have shown that conditional branches are taken more than 50% of the time
, and so if the cost of prefetching from either path is the same, then always prefetching from the branch target address should give better performance than always prefetching from the sequential path.
However, in a paged machine, prefetching the branch target is more likely to cause a page fault than prefetching the next instruction in the sequence and so this performance penalty should be taken into account.
Predict by opcode approach makes the decision based on the opcade of the branch instruction. The processor assumes that the branch will be taken for certain branch opcodes and not for others. Studies reported in
showed that success rate is greater than 75% with the strategy.
Lilja,D "Reducing the branch penalty in pipeline processors", computer, July 1988.