1

Why do we have two versions of 2-bit branch prediction as shown in the figures below?

First Scheme

Alternate Scheme

In the first scheme, the transition is from weakly not taken to weakly taken and weakly taken to weakly not taken if it is misprediction but in the alternative scheme, the transition is from weakly not taken to strongly taken and from weakly taken to strongly not taken if it is misprediction. How does one scheme compared to the other or does both give the same accuracy?

Krishna Chaurasia
  • 8,924
  • 6
  • 22
  • 35

1 Answers1

3

The first scheme seems to be Strategy 7 described by James Smiths Paper "A study about branch prediction strategies" (here). Figure 8 and 10 show the interesting numbers. The accuracy for this scheme ranges from 80,1% to 99,4%.

Both schemes are described in "Branch Prediction Strategies and Branch Target Buffer Design" from J.K.F. Lee and A.J. Smith. Also both schemes are compared and they don't differ much in their accuracy.

Even without reading the papers you can see that there are some patterns that favor one scheme over the other. E.g. with the pattern taken, not taken, taken, not taken, the first scheme will always be wrong if it begins in the state WN. The second scheme has no problem with the pattern but with the pattern taken, taken, not taken, not taken, taken, taken, etc.

fsasm
  • 531
  • 1
  • 8
  • 23