AnsweredAssumed Answered

blackfin assembler code optimization

Question asked by pfeifferc on Jul 20, 2011
Latest reply on Jul 21, 2011 by Yaniv.Sapir

hi !

i use code to implement a lms algo

i want to optimize the most critical time consuming part of my code

the runtime is not fast enough so i need a speed up of this routine because this is done for each sample

and for a tapSize>=256

 

in c:  (taps is a ptr to an short-array)

int factor;

int exp;

int n;

n=NofTaps;

 

for (i = 0; i < n;  i++)

{ exp=*pHist++ *factor

   taps[i]  +=  ((exp+(1<<14)) >> 15);
}

 

so my asm-code looks like that
[FFA0BF5A] CC = R2 <= 0 ;
[FFA0BF5E] IF CC JUMP __END__.P37L5L ;
    {
       exp = *phist++ * factor;
[FFA0BF60] NOP ;
[FFA0BF62] I0 = P1 ;
[FFA0BF64] LSETUP ( __BEGIN__.P37L5L , 22 /*0xFFA0BF7A*/ ) LC0 = P4 ;
[FFA0BF68] MNOP  || R0 = W [ P0 ++ ] ( X )  || R2.L = W [ I0 ] ;
[FFA0BF70] R0 *= R1 ;
       taps[i]  +=  ((exp+(1<<14)) >> 15);
[FFA0BF72] R0 <<= 0x1 ;
[FFA0BF74] R0.L = R0 ( RND ) ;
[FFA0BF78] R0 = R0 + R2 ;
[FFA0BF7A] W [ I0 ++ ] = R0.L ;

    }

 

is there any potential to speed up the hardware-loop ???

 

best regards chris

Outcomes