Technical information
Application Performance Comparison
Application Porting 5
To avoid this problem, scan the code for ADC, SBC, or DIV instructions that are run with the SA bit set. If
the operands are not always 32-bit and sign extended or if the result of the operation having 32-bit
sign-extended operands is larger than 32 bits, the solution is the SAT instruction. This instruction,
available only on the DSP56800E, forces the saturation (see Code Example 3). It is safe to place a SAT
instruction after ADC, SBC, or DIV, explicitly saturating the result.
Code Example 3. Using ADC with Non-Signed Operands (with Correction)
; example of the effect of the SA bit from OMR
bfset #$10,omr ; setting SA bit
move #$1000,y1
move #$F000,a1 ; no sign extension in A register
adc y,a
sat a,a ; this instruction manually forces saturation
; y1= $1000 y0= $0000
; a2= $f a1= $f000 a0= $0000 <= prior execution
; y1= $1000 y0= $0000
; a2= $0 a1= $7fff a0= $ffff <= execution on DSP56800E: limitation caused by SAT instruction
The code used as the main example in this application note did not face this type of limiting problem.
2.2 Application Performance Comparison
Test vectors were generated and coding requirements were verified, and the main test application ran
correctly on both DSPs. Immediately afterward, all DSP56800 code optimization methods were
implemented. The correctness of the results was preserved on both platforms. The code obtained after this
step was considered the reference code for all subsequent optimization allowed by the new features of the
DSP56800E.
The reference application’s different speeds on the two platforms indicate the improvement was achieved
only by porting. The speeds were measured with the function testLoopback (representing the entire
application, including not only the V.22 bis library but also the main function, which realizes the digital
loopback). On the DSP56800, this function took 61,918,898 cycles (the code was run using the
CodeWarrior simulator). The ported code on the DSP56800E was expected to run about two times faster.
Indeed, the function testLoopback on the DSP56800E took 31,694,501 cycles.
The DSP56800E measurement is slightly more than half the number of cycles on the DSP56800. The
difference can be explained in that some instructions that take more than half the cycles to execute unlike
similar instructions on the DSP56800 (such as those for change of flow: Bcc, BRA, Jcc, JMP). Also, the
new pipeline effects on the DSP56800E (not present on the DSP56800) slightly increase on the number of
cycles.
More interesting is the study of performance for the V.22 bis library alone. For this reason, in the
remainder of this document, size measurements refer only to the size of the library, and speed
measurements refer to the worst case for a symbol transmitting and receiving (these two tasks are
performed by the functions TXBAUD and RXBAUDPROC, respectively).
Table 1 presents a comparison between the size of the V.22 bis library built and run on both the DSP56800
and DSP56800E (the same source code, after minor modifications required for porting).
Table 1. Size Comparison Between DSP56800 and DSP56800E Ported Code
Platform
Program Memory
(Words)
Data Memory (Words)
Constants/Tables Variables
DSP56800 4735 1092 909
DSP56800E 4973 1092 909
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...