ADSP-BF53x/BF56x Blackfin Processor Programming Reference
4-25
Program Sequencer
Therefore, two-dimensional loops are supported directly in hardware,
consisting of an outer loop and a nested inner loop.
L
The outer loop is always represented by loop unit 0 (
LC0
,
LT0
,
LB0
)
while loop unit 1 (
LC1
,
LT1
,
LB1
) manages the inner loop.
To enable the two nested loops to end at the same instruction (
LB1
equals
LB0
), loop unit 1 is assigned higher priority than loop unit 0. A loopback
caused by loop unit 1 on a particular instruction (
PC==LB1
,
LC1>=2
) will
prevent loop unit 0 from looping back on that same instruction, even if
the address matches. Loop unit 0 is allowed to loop back only after the
loop count 1 is exhausted. The following example shows a two-dimen-
sional loop.
#define M 32
#define N 1024
P4 = M (Z);
P5 = N-1 (Z);
LSETUP ( lpo_start, lpo_end ) LCO = P4;
lpo_start:
R7 = 0;
MNOP || R2 = [I0++] || R3 = [I1++] ;
LSETUP (lpi_start, lpi_end) LC1 = P5;
lpi_start:
R5 = R2 + R3 (NS) || R2 = [I0] || R3 = [I1++] ;
lpi_end:
R7 = R5 + R7 (NS) || [I0++] = R5;
R5 = R2 + R3;
R7 = R5 + R7 (NS) || [I0++] = R5;
lpo_end:
[I2++] = R7;
The example processes an M by N data structure. The inner loop is
unrolled and passes only N-1 times. The outer loop is not unrolled and
still provides room for optimization.
Содержание ADSP-BF53x Blackfin
Страница 38: ...Conventions xxxviii ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 134: ...System Reset and Powerup 3 18 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 324: ...Instruction Overview 7 20 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 486: ...Instruction Overview 13 28 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 512: ...Instruction Overview 14 26 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 604: ...Instruction Overview 15 92 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 688: ...Instruction Overview 18 48 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 742: ...Instruction Overview 19 54 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 752: ...Examples 20 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 780: ...Product Identification Register 21 28 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 790: ...ADSP BF535 Flags A 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 800: ...Performance Monitor Registers B 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 994: ...Instructions Listed By Operation Code C 194 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 1042: ...Index I 40 ADSP BF53x BF56x Blackfin Processor Programming Reference...