Help with the example of the scalar product of two vectors specified by double arrays, using SSE instructions. All the examples I found are for some reason written for the type float .
For example, this is the function
float inner(int n, float* x, float* y) { __m128 *xx = (__m128*)x; __m128 *yy = (__m128*)y; __m128 s = _mm_setzero_ps(); for(int i=0; i<n/4; ++i) { __m128 p = _mm_mul_ps(xx[i],yy[i]); s = _mm_add_ps(s,p); } __m128 p = _mm_movehl_ps(p,s); s = _mm_add_ps(s,p); p = _mm_shuffle_ps(s,s,1); s = _mm_add_ss(s,p); float sum; _mm_store_ss(&sum,s); return sum; }