Pipeline Interlocks
Program Flow-Control Pipeline Interlocks
6-12
Optimizing DSP56300/DSP56600 Applications
cmp
B,x0
blt
cont
move
sub
x0,b
cont
add
b,a
LoopEnd
;efficient version - loop reordered.
;the main point - the CMP and subsequent branch are split between two
;iterations
;execution time of one iteration (condition true): 7 clocks
move
X:(r0)+,B
cmp
B,x0
DO
#(N-1),LoopEnd1
blt
<cont
move
sub
x0,b
cont
add
b,a
move
X:(r0)+,B
cmp
B,A
LoopEnd1
cmp
B,A
blt
contin1
move
sub
x0,b
cont1
add
b,a
;compare to threshold
(r4)+
;increment counter
;subtract threshold from sum
;read first data to B
;first compare - before loop.
;SR updated in previous loop iteration
(r4)+
;read next data to B
;after SR pop, new CMP is needed.
(r4)+
MOTOROLA