Loops and Sequencing
3-28
ADSP-2126x SHARC Processor Hardware Reference
• An instruction that writes to the loop counter from memory can-
not be used as the third-to-last instruction of a counter-based loop
(at
e–2
, where
e
is the end-of-loop address).
• An
IF NOT LCE
instruction cannot be used as the instruction that
follows a write to
CURLCNTR
from memory.
• Branch (
JUMP
or
CALL
/
RETURN
) instructions may not be used as any
of the last three instructions of a loop. This no end-of-loop
branches rule also applies to single instruction and two instruction
loops with only one iteration.
There is one exception to the no end-of-loop branches rule. The last three
instructions of a loop may contain an immediate
CALL
, a
CALL
without a
DB
modifier, that is paired with a loop re-entry return, a return (
RTS
) with
loop reentry (
LR
) modifier. The immediate
CALL
may be one of the last
three instructions of a loop, but not in a one instruction loop or a two
instruction, single iteration loop.
Restrictions on Short Loops
The sequencer’s pipeline features (which optimize performance in many
ways) restrict how short loops iterate and terminate. Short loops (one or
two instruction loops) terminate in a special way because they are shorter
than the instruction pipeline. Counter-based loops (
DO
/
UNTIL
LCE
) of one
or two instructions are not long enough for the sequencer to check the ter-
mination condition two instructions from the end of the loop. In these
short loops, the sequencer has already looped back when the termination
condition is tested. The sequencer provides special handling to prevent
overhead (
NOP
) cycles if the loop is iterated a minimum number of times.
show the pipeline execution for counter-based
single instruction loops.
and
execution for counter-based two instruction loops. For no overhead, a
loop of length one must be executed at least three times and a loop of
length two must be executed at least twice. Loops of length one that
Содержание ADSP-21261 SHARC
Страница 30: ...Contents xxx ADSP 2126x SHARC Processor Hardware Reference ...
Страница 40: ...Register Diagram Conventions xl ADSP 2126x SHARC Processor Hardware Reference ...
Страница 58: ...Differences From Previous SHARCs 1 18 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 112: ...Secondary Processing Element PEy 2 54 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 178: ...Summary 3 66 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 204: ...DAG Instruction Summary 4 26 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 322: ...Setting Up DMA 7 32 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 436: ...SPORT Programming Examples 9 86 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 521: ...ADSP 2126x SHARC Processor Hardware Reference 11 31 Input Data Port rts IDP_ISR end ...
Страница 522: ...Input Data Port Programming Example 11 32 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 590: ...Timer Programming Examples 14 20 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 796: ...I O Processor Registers A 174 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 800: ...B 4 ADSP 2126x SHARC Processor Core Manual ...
Страница 846: ...Index I 36 ADSP 2126x SHARC Processor Hardware Reference ...