using intrinsics

Started by stertinek May 27, 2003

I have a C6711 DSK and want to use intrinsics in my code. I tried to
use a simple _mpy in the audio.c file of the audio.pjt (the example
in the dsk6711\bios\audio folder).


static Void process(Uns *src, Int size, Uns *dst)
Int i;
Uns scale = 2; // added code

for (i = size - 1; i >= 0; i--)
dst[i] = _mpyu(src[i],scale); // changed code

/* if hostPipe is non-NULL write data to this pipe */
if (hostPipe != NULL) {
writeBuf(hostPipe, dst, size);


If I use a sine wave as input, the amplitude of the output sine is
varing sinusoidal. I tried to change the data types for scale and
src[]. Using a different _mpy intrinsic yields the same result.
How should I use the intrinsics to get the correct result? Do I have
to use or change certain compiler options?

Thanks in advance!

Stefan Tertinek