Performance Considerations
6-54
6.4.2
Multicycle NOPs
The NOP instruction has an optional operand,
count, that allows you to issue
a single instruction for multicycle NOPs. A NOP 2, for example, fills in extra
delay slots for the instructions in its execute packet and for all previous execute
packets. If a NOP 2 is in parallel with an MPY instruction, the MPY’s results
will be available for use by instructions in the next execute packet.
Figure 6–27 shows how a multicycle NOP can drive the execution of other
instructions in the same execute packet. Figure 6–27(a) shows a NOP in an
execute packet (in parallel) with other code. The results of the LD, ADD, and
MPY will all be available during the proper cycle for each instruction. Hence
NOP has no effect on the execute packet.
Figure 6–27(b) shows the replacement of a single-cycle NOP with a multi-
cycle NOP (NOP 5) in the same execute packet. The NOP
5 will cause no op-
eration to perform other than the operations from the instructions inside its
execute packet. The results of the LD, ADD, and MPY cannot be used by any
other instructions until the NOP
5 period has completed.
Figure 6–27. Multicycle NOP in an Execute Packet
Execute packet
Cycle
i + 5
i + 4
i + 3
i + 2
i + 1
i
Can use LD result
Can use MPY results
Can use ADD results
NOP
MPY
ADD
LD
(a)
Execute packet
Cycle
i + 5
i + 4
i + 3
i + 2
i + 1
i
All values available on i + 5
NOP 5
MPY
ADD
LD
(b)