|
|
|
|
|
|
If we guess in-line and go to the target, we have: |
|
|
|
|
|
|
|
|
In-line penalty = 0 cycles |
|
|
|
|
|
|
|
|
Target penalty = 6 cycles |
|
|
|
|
|
|
|
|
If we guess the target and go in-line we have: |
|
|
|
|
|
|
|
|
If we guess the target and go to the target, we have: |
|
|
|
|
|
|
|
|
In-line penalty = 5 cycles |
|
|
|
|
|
|
|
|
Target penalty = 3 cycles |
|
|
|
|
|
|
|
|
Let P = the probability of branch going to target. Then expected in-line delay is 6P + 0(1 P). expected target delay is 3P + 5(1 P). Then we should guess the target path if |
|
|
|
 |
|
|
|
|
3P + 5(1- P) < 6 P ® P > 5/8 |
|
|
|
|
|
|
|
|
(c) For BR (unconditional) or for BAL: |
|
|
|
|
|
|
|
|
Target penalty = 4 cycles |
|
|
|
|
|
|
|
|
(d) For BC (conditional branch): |
|
|
|
|
|
|
|
|
If we guess in-line and go in-line: |
|
|
|
|
|
|
|
|
If we guess in-line and go to target: |
|
|
|
|
|
|
|
|
In-line penalty = 0 cycles |
|
|
|
|
|
|
|
|
Target penalty = 6 cycles |
|
|
|
|
|
|
|
|
If we guess target and go in-line:* |
|
|
|
|
|
|
|
|
* Assumes in-line instructions already fetched are kept in IB. |
|
|
|
|
|
|
|
|
If we guess target and go to target: |
|
|
|
|
|