Correlating Predictors

Often in programs the direction of one branch is dependent on other branches in the program.

The idea of correlating branch predictors is to attempt to capture this behavior.

Consider the code:

     if( d == 0 )
           d = 1;
     if( d == 1 )

compiled as:
          bnez  r1, L1      ; branch b1 (d !=0)
          addi  r1, r0, #1  ; d = 1
     L1:  subi  r3, r1, #1   
          bnez  r3, L2      ; branch b2 (d !=1)
     ...
     L2:

d =

branch history:

Branchif history not takenif history taken
b1
b2

Prediction:

Performance.


[up] to Branch Prediction.