Instruction Execution Timing
8-10 MPC823e REFERENCE MANUAL MOTOROLA
INSTRUCTION EXECUTION
8
TIMING
8.2.6 Branch Prediction
while:
mulli r3,r12,r4
addi r4,3(r0)
...
lwz r12,64 (r2)
cmpi 0,r12,3
addic r6,r5,1
blt cr0,while
...
In this example, the blt instruction is dependent on the cmpi instruction. Nevertheless, the
branch unit predicts the correct path and allows an overlap of its bubbles with those of lwz.
When the cmpi writes back, the branch unit reevaluates the decision and if correct
prediction occurs no more action is taken and execution continues fluently. The fetched
instructions on the predicted path are not allowed to execute before the condition is finally
resolved. Instead, they are stacked in the instruction prefetch queue.
Figure 8-8. Example of Branch Prediction
ADDICLWZ
LWZ CMPI BLT BUBBLEADDIC MULLI
CMPI
CMPIBUBBLE
MULLILWZ BUBBLE
LWZ
LWZ
BLT
LWZ
BLT
CMP
ADDIC
ADD
MULLI
FETCH
DECODE
READ + EXECUTE
WRITEBACK
L ADDRESS DRIVE
L DATA
LOAD WRITEBACK
BRANCH DECODE
BRANCH EXECUTE
ADDI
BRANCH FINAL
DECISION
BLT
GCLK1