AnsweredAssumed Answered

SIMD and aligned

Question asked by bookevg on Nov 18, 2011
Latest reply on Nov 25, 2011 by bookevg

I'm using ADSP21489.

As I understand ADSP21489 support SIMD and the start adress of memory could be odd, but the quantity of elements must be even.

In chapter "Implications of Using SIMD Mode" of Run-Time Library Manual for SHARC Processors mention that the start adress of memory must be even:

"If the variable ptr is initialized using ptr=&a[i] and the value of the scalar i is odd,
then you cannot use ptr to pass an array to a DSP library function."

My code:


#include "stats.h"

volatile float X[255];

volatile  float  K[255];

volatile  float  Y[255];


void main(void)


     for (;;)


          int pm *pk = (int pm *)&K[1];

          int dm *px = (int dm *)&X[1];

          int *py =  &Y[1];

          for (int i = 0; i < 254; i++)


                *py++ = (*pk++)*(*px++);


          rmsf(  &Y[1], 254  );



I can't understand about (What Prevents the Compiler From Automatically Exploiting
SIMD Mode of VisualDSP++ 5.0 C/C++ Compiler Manual for SHARC Processors, p.  1-273)

"The code accesses memory locations that are not double-word aligned"

Is it mean that the first address must be even or the quantity of elements must be even?