Branch Prediction - Motorola MPC823e Reference Manual

Microprocessor for mobile computing
Table of Contents

Advertisement

Instruction Execution 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
...
GCLK1
LWZ
FETCH
DECODE
READ + EXECUTE
WRITEBACK
L ADDRESS DRIVE
L DATA
LOAD WRITEBACK
BRANCH DECODE
BRANCH EXECUTE
BRANCH FINAL
DECISION
Figure 8-8. Example of Branch Prediction
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.
8-10
CMPI
ADDIC
BLT
LWZ
LWZ
BUBBLE
BUBBLE
LWZ
MPC823e REFERENCE MANUAL
BUBBLE
MULLI
ADDI
CMPI
ADDIC
MULLI
CMPI
ADDIC
CMP
ADD
LWZ
LWZ
BLT
BLT
BLT
MOTOROLA
MULLI

Advertisement

Table of Contents
loading

Table of Contents