Skip to content

Commit ef24712

Browse files
authored
Move a conditionally used variable
1 parent 20581bf commit ef24712

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kernel/generic/dot.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
4747

4848
if ( (inc_x == 1) && (inc_y == 1) )
4949
{
50-
int n1 = n & -4;
5150
#if V_SIMD && !defined(DSDOT)
5251
const int vstep = v_nlanes_f32;
5352
const int unrollx4 = n & (-vstep * 4);
@@ -84,6 +83,7 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
8483
}
8584
dot = v_sum_f32(vsum0);
8685
#elif defined(DSDOT)
86+
int n1 = n & -4;
8787
for (; i < n1; i += 4)
8888
{
8989
dot += (double) y[i] * (double) x[i]
@@ -92,6 +92,7 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
9292
+ (double) y[i+3] * (double) x[i+3] ;
9393
}
9494
#else
95+
int n1 = n & -4;
9596
for (; i < n1; i += 4)
9697
{
9798
dot += y[i] * x[i]

0 commit comments

Comments
 (0)