Technical information

10 Porting and Optimizing DSP56800 Applications to DSP56800E
Two new address registers, R4 and R5
A second offset register, N3
New loop address and counter registers, LA2 and LC2
FISR and FIRA registers
Shadow registers for R0, R1, N, and M01
LA2 and LC2 are discussed in Section 3.8. The second offset register, N3, can be used for the second
memory read in a dual parallel memory read, but it was not used in this project. FISR, FIRA, and the
shadow registers support faster interrupt processing, but this subject is beyond the scope of this note.
Generally, using the new DSP56800E registers reduces the register pressure in some parts of the program,
thus eliminating additional memory loads and stores (spill code).
The new accumulators can also be used to eliminate some moves from an accumulator to another register
that are required on the DSP56800. These moves are required on that platform because the results of
certain instructions are always obtained in an accumulator, and the value in that accumulator must be saved
first.
Using the new registers in these ways is not usually automatic. Data flow and control flow must be
inspected to see which registers are used and how, and so forth.
These methods of optimization apply to both control and DSP code. In the sample code, new registers were
used on almost all of the functions that were optimized.
Code Example 6 shows how to replace spill in memory with spill in the new accumulators. Both this
example and Code Example 7 are taken from the function RXBPF from the file rx_bpf.asm.
Code Example 6. Avoiding Saving Variables in Memory
do #12,END_RX_BPF
...
move a,x:TEMP1 ; 2 cycles, 2 words
move b,x:TEMP2 ; 2 cycles, 2 words
...
move x:TEMP1,y0 ; 2 cycles, 2 words
...use y0
move x:TEMP2,y0 ; 2 cycles, 2 words
...use y0
END_RX_BPF
; DSP56800 original code: 12*8 cycles / 8 words
do #12,END_RX_BPF
...
move.w a,c1 ; 1 cycle, 1 word
move.w b,d1 ; 1 cycle, 1 word
... calculations
...use c1
...use d1
END_RX_BPF
; DSP56800E optimized code: 12*2 cycles / 2 words
Code Example 7 presents one of the ways that new address registers can be used. R3 is not loaded with an
immediate value inside the loop; instead, the immediate value is preloaded in R4 before the loop starts, and
R4 is used inside the loop.
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...