optimized sdot.c for increments != 1

This commit is contained in:
Werner Saar 2015-04-24 13:13:20 +02:00
parent dee100d0e4
commit c22068c406
1 changed files with 13 additions and 1 deletions

View File

@ -80,7 +80,7 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
if ( (inc_x == 1) && (inc_y == 1) )
{
int n1 = n & -32;
BLASLONG n1 = n & -32;
if ( n1 )
sdot_kernel_16(n1, x, y , &dot );
@ -99,6 +99,18 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
}
BLASLONG n1 = n & -2;
while(i < n1)
{
dot += y[iy] * x[ix] + y[iy+inc_y] * x[ix+inc_x];
ix += inc_x*2 ;
iy += inc_y*2 ;
i+=2 ;
}
while(i < n)
{