Improvement: LTPF give hints on vector size multiple

This commit is contained in:
Antoine SOULIER
2022-04-20 16:05:04 +02:00
parent 62a5fab601
commit 96a27ee556

View File

@@ -203,15 +203,16 @@ static void resample_6k4(const float *x, float *y, int n)
/** /**
* Return dot product of 2 vectors * Return dot product of 2 vectors
* a, b, n The 2 vectors of size `n` * a, b, n The 2 vectors of size `n` (multiple of 16)
* return sum( a[i] * b[i] ), i = [0..n-1] * return sum( a[i] * b[i] ), i = [0..n-1]
*/ */
static inline float dot(const float *a, const float *b, int n) static inline float dot(const float *a, const float *b, int n)
{ {
float v = 0; float v = 0;
while (n--) for (int i = 0; i < (n >> 4); i++)
v += *(a++) * *(b++); for (int j = 0; j < 16; j++)
v += *(a++) * *(b++);
return v; return v;
} }