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
Содержание DSP56300
Страница 49: ...3 20 Optimizing DSP56300 DSP56600 Applications MOTOROLA Program Control Using Fast Interrupts ...
Страница 95: ...7 10 Optimizing DSP56300 DSP56600 Applications MOTOROLA Compact Opcode Use Special Instructions ...
Страница 99: ...A 4 Optimizing DSP56300 DSP56600 Applications MOTOROLA Saving Power Disabling Functional Blocks ...
Страница 103: ...B 4 Optimizing DSP56300 DSP56600 Applications MOTOROLA Debug and Test Support Address Tracing ...