ADSP-BF53x/BF56x Blackfin Processor Programming Reference
4-23
Program Sequencer
Listing 4-1. Loop Example
P5 = 0x20 ;
LSETUP ( lp_start, lp_end ) LCO = P5 ;
lp_start:
R5 = R0 + R1(ns) || R2 = [P2++] || R3 = [I1++] ;
lp_end:
R5 = R5 + R2 ;
When executing an
LSETUP
instruction, the program sequencer loads the
address of the loop’s last instruction into
LBx
and the address of the loop’s
first instruction into
LTx
. The top and bottom addresses of the loop are
computed as PC-relative addresses from the
LSETUP
instruction, plus an
offset. In each case, the offset value is added to the location of the
LSETUP
instruction.
The
LC0
and
LC1
registers are unsigned 32-bit registers, each supporting
2
32
–1 iterations through the loop.
[
When
LCx = 0
, the loop is disabled, and a single pass of the code
executes. If the loop counter is derived from a variable with a range
that may include zero, it is recommended to guard the loop against
the zero case.
P5 = [P4];
CC = P5 == 0;
IF CC JUMP lp_skip;
LSETUP (lp_start, lp_end) LC0 = P5;
lp_start:
...
lp_end:
...
lp_skip:
/* first instruction outside the loop */
Summary of Contents for ADSP-BF53x Blackfin
Page 38: ...Conventions xxxviii ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 134: ...System Reset and Powerup 3 18 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 324: ...Instruction Overview 7 20 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 486: ...Instruction Overview 13 28 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 512: ...Instruction Overview 14 26 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 604: ...Instruction Overview 15 92 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 688: ...Instruction Overview 18 48 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 742: ...Instruction Overview 19 54 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 752: ...Examples 20 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 790: ...ADSP BF535 Flags A 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 800: ...Performance Monitor Registers B 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 1042: ...Index I 40 ADSP BF53x BF56x Blackfin Processor Programming Reference...