Technical information
RXEQERR
Writing DSP56800E Code from Scratch 19
The original code contains 10 register-to-register moves that compensate for the lack of accumulators and
the reduced number of register combinations for MACs. The optimized ported code eliminates five of
these moves, leading to an improvement of 60 (12
× 5) cycles on the entire function. The written from
scratch version eliminates all of these transfers, leading to an improvement of 60 additional cycles, or a
total improvement of 120 cycles.
4.2 RXEQERR
The written from scratch RXEQERR function has a new design. By arranging values in registers without
considering the initial DSP56800 design, it performs more parallel moves, and by choosing other variables
to be stored in registers, the new code avoids a few memory transfers. This redesign leads to a gain of 7–12
cycles, depending on the function flow.
Note that the original DSP56800 code does not use parallel moves, but the optimized version rearranges
the values in memory so that parallel moves can be performed. The gain of 7–12 cycles is relative to the
optimized version.
Comparative results for the initial code, optimized ported code, and written from scratch code are
presented in Table 8.
Much of the improvement results from better coding rather than from using new DSP56800E features. For
example, in the original code, there is a check at one point whether two variables (A and B) have different
signs. If they do, then the value in A is negated. The optimized ported code is presented in
Code Example 28.
Table 8. Results Obtained for RXEQERR
RXEQERR
Speed Size
Minimum
(Cycles)
Maximum
(Cycles)
Average
(Cycles)
Gain
(%)
Value
(Words)
Gain
(%)
Initial 52 126 99.50 N/A 108 N/A
Optimized 50 124 97.50 2.01 108 0.00
Written from scratch 44 95 77.66 21.94 81 25.00
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...