Previous: Why the hell do
Home: Contents
Next: Assume The Position
Subsections
Sorry, you're not getting away without a few calculations.
(The complexity of this part is debatable.) Two things we need to keep
track of: the CPIs of the loop initiation interval and the loop latency. These terms are NOT DEFINED IN THE BOOK: I wanted a way
to easily show the CPI of the loop by itself and the all of the
unrolled code. In order to take this into account, I have to include a
NOP in the branch delay slot for ``rolled'' code, and include it in
the CPI. This is only fair, because when the bds is used, it changes
the numbers slightly. I borrowed these terms from the multicycle DLX
FP pipelines.
When you are asked on an exam to calculate the CPI of a loop, you are
to calculate the CPI of the contents of the loop up until the branch
instruction.
This is the time between the start of one loop iteration and the start
of the next loop iteration, including the NOP in the bds. As we change
the amount of work done in each loop, this gives a measure of how
efficient the loop is, and makes it easy to count the number of cycles
in the unrolled loop.
This is the time that each loop will take to execute AS IF IT STOOD ON
ITS OWN. Namely, the number of cycles between the first instruction of
the loop to the last instruction of the branch.
This gives us an idea of how moving instructions into the bds helps
the code, and reminds us of a possible stall cycle before the branch.
Previous: Why the hell do
Up: No Title
Next: Assume The Position