AnsweredAssumed Answered

Fast loop unrolling techniques

Question asked by jonahky on May 15, 2013
Latest reply on May 20, 2013 by chenghaibo

Hi

 

Was wondering if you may advice on fast loop unrolling techniques for generic BF5xx? E.g I have an array of

 

short sImage[3][1024][4]

 

1.) To reset the buffer array to zero will take 3 loops jump

for(k=0;k<3;k++)

{

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

     {

          for(j=0;j<4;j++)

               sImage[k][i][j] = 0;

     }

}

 

There is a memset but it's limited to char size and performance is not much better when the project has optimisation set to maximum.

 

Alternatively I could do short sImage[3*1024*4] and run it as an unify map and do some unrolling like

 

sImage[k][i][0] = 0;

sImage[k][i][1] = 0;

sImage[k][i][2] = 0;

sImage[k][i][3] = 0;

 

However I'm trying to find the fastest way to set a array to zero before entering it's processing functions. Any advice will be great

Outcomes