User`s guide
Inline Assembly Language and Intrinsics
Intrinsic Functions
178
Targeting MC56F83xx/DSP5685x Controllers
Figure 7.1 Example of a Modulo Buffer
The CodeWarrior C compiler for DSP56800E uses intrinsic functions to create and
manipulate modulo buffers. Normally, a modulo operation, such as the % operator,
requires a runtime function call to the arithmetic library. For normally timed critical
DSP loops, this binary operation imposes a large execution-time overhead.
The CodeWarrior implementation, however, replaces the runtime call with an efficient
implementation of circular-address modification, either by using hardware resources
or by manipulating the address mathematically.
Processors such as the DSP56800E have on-chip hardware support for modulo
buffers. Modulo control registers work with the DSP pointer update addressing modes
to access a range of addresses instead of a continuous, linear address space. But
hardware support imposes strict requirements on buffer address alignment, pointer
register resources, and limited modulo addressing instructions. For example, R0 and
R1 are the only registers available for modulo buffers.
Accordingly, the CodeWarrior C compiler uses a well-defined set of instrinsic APIs to
implement modulo buffers.
Modulo Addressing Intrinsic Functions
The intrinsic functions for modulo addressing are:
• __mod_init
• __mod_initint16
• __mod_start
• __mod_access
• __mod_update
• __mod_stop
• __mod_getint16
Address Data
0x100 0.68
0x101 0.73
0x105 0.95
0x102 0.81
0x103 0.86
0x104 0.90