6-12 Optimizing DSP56300/DSP56600 Applications MOTOROLA
Pipeline Interlocks
Program Flow-Control Pipeline Interlocks
cmp B,x0 ;compare to threshold
blt cont
move (r4)+ ;increment counter
sub x0,b ;subtract threshold from sum
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 ;read first data to B
cmp B,x0 ;first compare - before loop.
DO #(N-1),LoopEnd1
blt <cont ;SR updated in previous loop iteration
move (r4)+
sub x0,b
cont
add b,a
move X:(r0)+,B ;read next data to B
cmp B,A
LoopEnd1
cmp B,A ;after SR pop, new CMP is needed.
blt contin1
move (r4)+
sub x0,b
cont1
add b,a
Comments to this Manuals