Branches and Sequencing
3-14
ADSP-2126x SHARC Processor Hardware Reference
In delayed branch,
JUMP
and
CALL
/
RETURN
instructions that use the delayed
branches
(DB)
modifier, no instruction cycles are lost in the pipeline. This
is because the DSP executes the two instructions after the branch while
the pipeline fills with instructions from the new location. This is shown in
the sample code below.
call fft1024 (DB);
...
...
jump (pc,10) (DB);
As shown in
and
, the DSP executes the two instruc-
tions after the branch, while the instruction at the branch address is
fetched and decoded. In the case of a
CALL
, the return address is the third
address after the branch instruction. While delayed branches use the
instruction pipeline more efficiently than immediate branches, delayed
branch code can be harder to understand because of the instructions
between the branch instruction and the actual branch.
Table 3-4. Pipelined Execution Cycles for Delayed Branch
(JUMP or CALL)
Cycles
1
2
3
4
Execute
N
N + 1
N + 2
J
Decode
N + 1
N + 2
J
J + 1
Fetch
N + 2
J
1
J + 1
J + 2
N is the branching instruction, and J is the instruction branch address.
1. For a delayed branch call, N + 3 is pushed on PC stack, not N + 1
Table 3-5. Pipelined Execution Cycles for Delayed Branch (Return)
Cycles
1
2
3
4
Execute
N
1
N + 1
N + 2
R
Decode
N + 1
N + 2
R
R + 1
Fetch
N + 2
R
R + 1
R + 2
N is the branching instruction, and R is the instruction at the return address.
1. R (N + 3 pushed in figure...) popped from PC stack
Summary of Contents for ADSP-21261 SHARC
Page 30: ...Contents xxx ADSP 2126x SHARC Processor Hardware Reference ...
Page 40: ...Register Diagram Conventions xl ADSP 2126x SHARC Processor Hardware Reference ...
Page 58: ...Differences From Previous SHARCs 1 18 ADSP 2126x SHARC Processor Hardware Reference ...
Page 112: ...Secondary Processing Element PEy 2 54 ADSP 2126x SHARC Processor Hardware Reference ...
Page 178: ...Summary 3 66 ADSP 2126x SHARC Processor Hardware Reference ...
Page 204: ...DAG Instruction Summary 4 26 ADSP 2126x SHARC Processor Hardware Reference ...
Page 322: ...Setting Up DMA 7 32 ADSP 2126x SHARC Processor Hardware Reference ...
Page 436: ...SPORT Programming Examples 9 86 ADSP 2126x SHARC Processor Hardware Reference ...
Page 521: ...ADSP 2126x SHARC Processor Hardware Reference 11 31 Input Data Port rts IDP_ISR end ...
Page 522: ...Input Data Port Programming Example 11 32 ADSP 2126x SHARC Processor Hardware Reference ...
Page 590: ...Timer Programming Examples 14 20 ADSP 2126x SHARC Processor Hardware Reference ...
Page 796: ...I O Processor Registers A 174 ADSP 2126x SHARC Processor Hardware Reference ...
Page 800: ...B 4 ADSP 2126x SHARC Processor Core Manual ...
Page 846: ...Index I 36 ADSP 2126x SHARC Processor Hardware Reference ...