Chapter 6. Instruction Timing
6-25
Execution Unit Timings
Figure 6-13. Branch Completion
In this example, the
not-taken in clock cycle 0. In clock cycle 2,
3, the architected CTR is updated and the
bc
instruction is encoded to decrement the CTR. It is predicted as
bc
and add3 are both dispatched. In clock cycle
bc
instruction is retired from the CQ.
6.4.1.3 Branch Prediction and Resolution
The MPC7400 supports the following two types of branch prediction:
¥
Static branch predictionThis is deTned by the PowerPC architecture as part of the
encoding of branch instructions.
Dynamic branch predictionThis is a processor-speciTc mechanism implemented
in hardware (in particular the branch history table, or BHT) that monitors branch
instruction behavior and maintains a record from which the next occurrence of the
branch instruction is predicted.
¥
When a conditional branch cannot be resolved due to a CR data dependency, the BPU
predicts whether it will be taken, and instruction fetching proceeds down the predicted path.
If the branch prediction resolves as incorrect, the instruction queue and all subsequently
executed instructions are purged, instructions executed prior to the predicted branch are
allowed to complete, and instruction fetching resumes down the correct path.
The MPC7400 executes through two levels of prediction. Instructions from the Trst
unresolved branch can execute, but they cannot complete until the branch is resolved. If a
second branch instruction is encountered in the predicted instruction stream, it can be
predicted and instructions can be fetched, but not executed, from the second branch. No
action can be taken for a third branch instruction until at least one of the two previous
branch instructions is resolved.
IQ5
IQ4
IQ3
IQ2
IQ1
IQ0
add5
add4
add3
bc
add2
add1
add5
add4
add3
bc
Branch Completion
(LR/CTR Write-Back)
Clock 1
CQ7
CQ6
CQ5
CQ4
CQ3
CQ2
CQ1
CQ0
add2
add1
Clock 0
add7
add6
add5
add4
add3
bc
Clock 2
add9
add8
add7
add6
add5
add4
Clock 3