1 #ifndef INCLUDED_volk_32f_x2_dot_prod_16i_a_H
2 #define INCLUDED_volk_32f_x2_dot_prod_16i_a_H
11 static inline void volk_32f_x2_dot_prod_16i_generic(
int16_t* result,
const float* input,
const float*
taps,
unsigned int num_points) {
14 const float* aPtr = input;
15 const float* bPtr=
taps;
16 unsigned int number = 0;
18 for(number = 0; number < num_points; number++){
19 dotProduct += ((*aPtr++) * (*bPtr++));
31 static inline void volk_32f_x2_dot_prod_16i_a_sse(
int16_t* result,
const float* input,
const float* taps,
unsigned int num_points) {
33 unsigned int number = 0;
34 const unsigned int sixteenthPoints = num_points / 16;
37 const float* aPtr = input;
38 const float* bPtr =
taps;
40 __m128 a0Val, a1Val, a2Val, a3Val;
41 __m128 b0Val, b1Val, b2Val, b3Val;
42 __m128 c0Val, c1Val, c2Val, c3Val;
44 __m128 dotProdVal0 = _mm_setzero_ps();
45 __m128 dotProdVal1 = _mm_setzero_ps();
46 __m128 dotProdVal2 = _mm_setzero_ps();
47 __m128 dotProdVal3 = _mm_setzero_ps();
49 for(;number < sixteenthPoints; number++){
51 a0Val = _mm_load_ps(aPtr);
52 a1Val = _mm_load_ps(aPtr+4);
53 a2Val = _mm_load_ps(aPtr+8);
54 a3Val = _mm_load_ps(aPtr+12);
55 b0Val = _mm_load_ps(bPtr);
56 b1Val = _mm_load_ps(bPtr+4);
57 b2Val = _mm_load_ps(bPtr+8);
58 b3Val = _mm_load_ps(bPtr+12);
60 c0Val = _mm_mul_ps(a0Val, b0Val);
61 c1Val = _mm_mul_ps(a1Val, b1Val);
62 c2Val = _mm_mul_ps(a2Val, b2Val);
63 c3Val = _mm_mul_ps(a3Val, b3Val);
65 dotProdVal0 = _mm_add_ps(c0Val, dotProdVal0);
66 dotProdVal1 = _mm_add_ps(c1Val, dotProdVal1);
67 dotProdVal2 = _mm_add_ps(c2Val, dotProdVal2);
68 dotProdVal3 = _mm_add_ps(c3Val, dotProdVal3);
74 dotProdVal0 = _mm_add_ps(dotProdVal0, dotProdVal1);
75 dotProdVal0 = _mm_add_ps(dotProdVal0, dotProdVal2);
76 dotProdVal0 = _mm_add_ps(dotProdVal0, dotProdVal3);
80 _mm_store_ps(dotProductVector,dotProdVal0);
82 dotProduct = dotProductVector[0];
83 dotProduct += dotProductVector[1];
84 dotProduct += dotProductVector[2];
85 dotProduct += dotProductVector[3];
87 number = sixteenthPoints*16;
88 for(;number < num_points; number++){
89 dotProduct += ((*aPtr++) * (*bPtr++));
92 *result = (short)dotProduct;
signed short int16_t
Definition: stdint.h:76
#define __VOLK_ATTR_ALIGNED(x)
Definition: volk_common.h:27
static const float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9