|
|
|
|
|
|
(c) Guess target and go to target. |
|
|
|
|
|
|
|
|
The four-cycle delay here is the same as that seen in an unconditional branch. By guessing the target path, we have made sure that the primary path and both words of the IB are filled before T + 1 decodes, so further delays are avoided. |
|
|
|
|
|
|
|
|
(d) Guess target and go in-line. |
|
|
|
|
|
|
|
|
The target strategy is not invoked until the end of * decode. By this time, both instructions * + 1 and * + 2 have begun to be fetched from the cache. Either we discard the * + 2 I-fetch or we use an additional word of alternate path IB to hold this information, since it has already begun IF. Assuming the latter situation, the penalty is 5 cycles. |
|
|
|
|
|
|
|
|
Let P = probability that the branch is taken. |
|
|
|
|
|
|
|
|
Guess target: Delay = 4P + 5(1 - P). |
|
|
|
|
|
|
|
|
Guess in-line: Delay = 6P + 0(1 - P). |
|
|
|
|
|
|
|
|
We should guess target if 6P ³ 4P + 5(1- P); P ³ 5/7 = .71 |
|
|
|
|
|
|
|
|
Study 4.7 More on Static Branch Prediction |
|
|
|
 |
|
|
|
|
Assumptions: |
|
|
|
 |
|
|
|
|
This study uses the same assumptions as study 4.6, only here we complete the analysis begun there using the actual data from Chapter 3 to determine the advantage of static prediction over a simple in-line strategy, at least for this particular machine with its particular constructs. |
|
|
|
|
|
|
|
|
Using the data on branch opcode distribution in Tables 3.4, 3.5, 3.10, and the timing template of study 4.2, we now evaluate the effect of selectively |
|
|
|
|
|