GNU Radio 3.7.2 C++ API
volk_32fc_x2_dot_prod_32fc.h
Go to the documentation of this file.
1 #ifndef INCLUDED_volk_32fc_x2_dot_prod_32fc_u_H
2 #define INCLUDED_volk_32fc_x2_dot_prod_32fc_u_H
3 
4 #include <volk/volk_common.h>
5 #include <volk/volk_complex.h>
6 #include <stdio.h>
7 #include <string.h>
8 
9 
10 #ifdef LV_HAVE_GENERIC
11 
12 
13 static inline void volk_32fc_x2_dot_prod_32fc_generic(lv_32fc_t* result, const lv_32fc_t* input, const lv_32fc_t* taps, unsigned int num_points) {
14 
15  float * res = (float*) result;
16  float * in = (float*) input;
17  float * tp = (float*) taps;
18  unsigned int n_2_ccomplex_blocks = num_points/2;
19  unsigned int isodd = num_points &1;
20 
21 
22 
23  float sum0[2] = {0,0};
24  float sum1[2] = {0,0};
25  unsigned int i = 0;
26 
27 
28  for(i = 0; i < n_2_ccomplex_blocks; ++i) {
29 
30 
31  sum0[0] += in[0] * tp[0] - in[1] * tp[1];
32  sum0[1] += in[0] * tp[1] + in[1] * tp[0];
33  sum1[0] += in[2] * tp[2] - in[3] * tp[3];
34  sum1[1] += in[2] * tp[3] + in[3] * tp[2];
35 
36 
37  in += 4;
38  tp += 4;
39 
40  }
41 
42 
43  res[0] = sum0[0] + sum1[0];
44  res[1] = sum0[1] + sum1[1];
45 
46 
47 
48  for(i = 0; i < isodd; ++i) {
49 
50 
51  *result += input[num_points - 1] * taps[num_points - 1];
52 
53  }
54 
55 }
56 
57 #endif /*LV_HAVE_GENERIC*/
58 
59 #ifdef LV_HAVE_SSE3
60 
61 #include <pmmintrin.h>
62 
63 static inline void volk_32fc_x2_dot_prod_32fc_u_sse3(lv_32fc_t* result, const lv_32fc_t* input, const lv_32fc_t* taps, unsigned int num_points) {
64 
65 
66  lv_32fc_t dotProduct;
67  memset(&dotProduct, 0x0, 2*sizeof(float));
68 
69  unsigned int number = 0;
70  const unsigned int halfPoints = num_points/2;
71 
72  __m128 x, y, yl, yh, z, tmp1, tmp2, dotProdVal;
73 
74  const lv_32fc_t* a = input;
75  const lv_32fc_t* b = taps;
76 
77  dotProdVal = _mm_setzero_ps();
78 
79  for(;number < halfPoints; number++){
80 
81  x = _mm_loadu_ps((float*)a); // Load the ar + ai, br + bi as ar,ai,br,bi
82  y = _mm_loadu_ps((float*)b); // Load the cr + ci, dr + di as cr,ci,dr,di
83 
84  yl = _mm_moveldup_ps(y); // Load yl with cr,cr,dr,dr
85  yh = _mm_movehdup_ps(y); // Load yh with ci,ci,di,di
86 
87  tmp1 = _mm_mul_ps(x,yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
88 
89  x = _mm_shuffle_ps(x,x,0xB1); // Re-arrange x to be ai,ar,bi,br
90 
91  tmp2 = _mm_mul_ps(x,yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
92 
93  z = _mm_addsub_ps(tmp1,tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
94 
95  dotProdVal = _mm_add_ps(dotProdVal, z); // Add the complex multiplication results together
96 
97  a += 2;
98  b += 2;
99  }
100 
101  __VOLK_ATTR_ALIGNED(16) lv_32fc_t dotProductVector[2];
102 
103  _mm_storeu_ps((float*)dotProductVector,dotProdVal); // Store the results back into the dot product vector
104 
105  dotProduct += ( dotProductVector[0] + dotProductVector[1] );
106 
107  if(num_points % 1 != 0) {
108  dotProduct += (*a) * (*b);
109  }
110 
111  *result = dotProduct;
112 }
113 
114 #endif /*LV_HAVE_SSE3*/
115 
116 #endif /*INCLUDED_volk_32fc_x2_dot_prod_32fc_u_H*/
117 #ifndef INCLUDED_volk_32fc_x2_dot_prod_32fc_a_H
118 #define INCLUDED_volk_32fc_x2_dot_prod_32fc_a_H
119 
120 #include <volk/volk_common.h>
121 #include <volk/volk_complex.h>
122 #include <stdio.h>
123 #include <string.h>
124 
125 
126 #ifdef LV_HAVE_GENERIC
127 
128 
129 static inline void volk_32fc_x2_dot_prod_32fc_a_generic(lv_32fc_t* result, const lv_32fc_t* input, const lv_32fc_t* taps, unsigned int num_points) {
130 
131  const unsigned int num_bytes = num_points*8;
132 
133  float * res = (float*) result;
134  float * in = (float*) input;
135  float * tp = (float*) taps;
136  unsigned int n_2_ccomplex_blocks = num_bytes >> 4;
137  unsigned int isodd = (num_bytes >> 3) &1;
138 
139  float sum0[2] = {0,0};
140  float sum1[2] = {0,0};
141  unsigned int i = 0;
142 
143  for(i = 0; i < n_2_ccomplex_blocks; ++i) {
144  sum0[0] += in[0] * tp[0] - in[1] * tp[1];
145  sum0[1] += in[0] * tp[1] + in[1] * tp[0];
146  sum1[0] += in[2] * tp[2] - in[3] * tp[3];
147  sum1[1] += in[2] * tp[3] + in[3] * tp[2];
148 
149  in += 4;
150  tp += 4;
151  }
152 
153  res[0] = sum0[0] + sum1[0];
154  res[1] = sum0[1] + sum1[1];
155 
156  for(i = 0; i < isodd; ++i) {
157  *result += input[(num_bytes >> 3) - 1] * taps[(num_bytes >> 3) - 1];
158  }
159 }
160 
161 #endif /*LV_HAVE_GENERIC*/
162 
163 
164 #if LV_HAVE_SSE && LV_HAVE_64
165 
166 
167 static inline void volk_32fc_x2_dot_prod_32fc_a_sse_64(lv_32fc_t* result, const lv_32fc_t* input, const lv_32fc_t* taps, unsigned int num_points) {
168 
169  const unsigned int num_bytes = num_points*8;
170 
171  asm
172  (
173  "# ccomplex_dotprod_generic (float* result, const float *input,\n\t"
174  "# const float *taps, unsigned num_bytes)\n\t"
175  "# float sum0 = 0;\n\t"
176  "# float sum1 = 0;\n\t"
177  "# float sum2 = 0;\n\t"
178  "# float sum3 = 0;\n\t"
179  "# do {\n\t"
180  "# sum0 += input[0] * taps[0] - input[1] * taps[1];\n\t"
181  "# sum1 += input[0] * taps[1] + input[1] * taps[0];\n\t"
182  "# sum2 += input[2] * taps[2] - input[3] * taps[3];\n\t"
183  "# sum3 += input[2] * taps[3] + input[3] * taps[2];\n\t"
184  "# input += 4;\n\t"
185  "# taps += 4; \n\t"
186  "# } while (--n_2_ccomplex_blocks != 0);\n\t"
187  "# result[0] = sum0 + sum2;\n\t"
188  "# result[1] = sum1 + sum3;\n\t"
189  "# TODO: prefetch and better scheduling\n\t"
190  " xor %%r9, %%r9\n\t"
191  " xor %%r10, %%r10\n\t"
192  " movq %%rcx, %%rax\n\t"
193  " movq %%rcx, %%r8\n\t"
194  " movq %[rsi], %%r9\n\t"
195  " movq %[rdx], %%r10\n\t"
196  " xorps %%xmm6, %%xmm6 # zero accumulators\n\t"
197  " movaps 0(%%r9), %%xmm0\n\t"
198  " xorps %%xmm7, %%xmm7 # zero accumulators\n\t"
199  " movaps 0(%%r10), %%xmm2\n\t"
200  " shr $5, %%rax # rax = n_2_ccomplex_blocks / 2\n\t"
201  " shr $4, %%r8\n\t"
202  " jmp .%=L1_test\n\t"
203  " # 4 taps / loop\n\t"
204  " # something like ?? cycles / loop\n\t"
205  ".%=Loop1: \n\t"
206  "# complex prod: C += A * B, w/ temp Z & Y (or B), xmmPN=$0x8000000080000000\n\t"
207  "# movaps (%%r9), %%xmmA\n\t"
208  "# movaps (%%r10), %%xmmB\n\t"
209  "# movaps %%xmmA, %%xmmZ\n\t"
210  "# shufps $0xb1, %%xmmZ, %%xmmZ # swap internals\n\t"
211  "# mulps %%xmmB, %%xmmA\n\t"
212  "# mulps %%xmmZ, %%xmmB\n\t"
213  "# # SSE replacement for: pfpnacc %%xmmB, %%xmmA\n\t"
214  "# xorps %%xmmPN, %%xmmA\n\t"
215  "# movaps %%xmmA, %%xmmZ\n\t"
216  "# unpcklps %%xmmB, %%xmmA\n\t"
217  "# unpckhps %%xmmB, %%xmmZ\n\t"
218  "# movaps %%xmmZ, %%xmmY\n\t"
219  "# shufps $0x44, %%xmmA, %%xmmZ # b01000100\n\t"
220  "# shufps $0xee, %%xmmY, %%xmmA # b11101110\n\t"
221  "# addps %%xmmZ, %%xmmA\n\t"
222  "# addps %%xmmA, %%xmmC\n\t"
223  "# A=xmm0, B=xmm2, Z=xmm4\n\t"
224  "# A'=xmm1, B'=xmm3, Z'=xmm5\n\t"
225  " movaps 16(%%r9), %%xmm1\n\t"
226  " movaps %%xmm0, %%xmm4\n\t"
227  " mulps %%xmm2, %%xmm0\n\t"
228  " shufps $0xb1, %%xmm4, %%xmm4 # swap internals\n\t"
229  " movaps 16(%%r10), %%xmm3\n\t"
230  " movaps %%xmm1, %%xmm5\n\t"
231  " addps %%xmm0, %%xmm6\n\t"
232  " mulps %%xmm3, %%xmm1\n\t"
233  " shufps $0xb1, %%xmm5, %%xmm5 # swap internals\n\t"
234  " addps %%xmm1, %%xmm6\n\t"
235  " mulps %%xmm4, %%xmm2\n\t"
236  " movaps 32(%%r9), %%xmm0\n\t"
237  " addps %%xmm2, %%xmm7\n\t"
238  " mulps %%xmm5, %%xmm3\n\t"
239  " add $32, %%r9\n\t"
240  " movaps 32(%%r10), %%xmm2\n\t"
241  " addps %%xmm3, %%xmm7\n\t"
242  " add $32, %%r10\n\t"
243  ".%=L1_test:\n\t"
244  " dec %%rax\n\t"
245  " jge .%=Loop1\n\t"
246  " # We've handled the bulk of multiplies up to here.\n\t"
247  " # Let's sse if original n_2_ccomplex_blocks was odd.\n\t"
248  " # If so, we've got 2 more taps to do.\n\t"
249  " and $1, %%r8\n\t"
250  " je .%=Leven\n\t"
251  " # The count was odd, do 2 more taps.\n\t"
252  " # Note that we've already got mm0/mm2 preloaded\n\t"
253  " # from the main loop.\n\t"
254  " movaps %%xmm0, %%xmm4\n\t"
255  " mulps %%xmm2, %%xmm0\n\t"
256  " shufps $0xb1, %%xmm4, %%xmm4 # swap internals\n\t"
257  " addps %%xmm0, %%xmm6\n\t"
258  " mulps %%xmm4, %%xmm2\n\t"
259  " addps %%xmm2, %%xmm7\n\t"
260  ".%=Leven:\n\t"
261  " # neg inversor\n\t"
262  " xorps %%xmm1, %%xmm1\n\t"
263  " mov $0x80000000, %%r9\n\t"
264  " movd %%r9, %%xmm1\n\t"
265  " shufps $0x11, %%xmm1, %%xmm1 # b00010001 # 0 -0 0 -0\n\t"
266  " # pfpnacc\n\t"
267  " xorps %%xmm1, %%xmm6\n\t"
268  " movaps %%xmm6, %%xmm2\n\t"
269  " unpcklps %%xmm7, %%xmm6\n\t"
270  " unpckhps %%xmm7, %%xmm2\n\t"
271  " movaps %%xmm2, %%xmm3\n\t"
272  " shufps $0x44, %%xmm6, %%xmm2 # b01000100\n\t"
273  " shufps $0xee, %%xmm3, %%xmm6 # b11101110\n\t"
274  " addps %%xmm2, %%xmm6\n\t"
275  " # xmm6 = r1 i2 r3 i4\n\t"
276  " movhlps %%xmm6, %%xmm4 # xmm4 = r3 i4 ?? ??\n\t"
277  " addps %%xmm4, %%xmm6 # xmm6 = r1+r3 i2+i4 ?? ??\n\t"
278  " movlps %%xmm6, (%[rdi]) # store low 2x32 bits (complex) to memory\n\t"
279  :
280  :[rsi] "r" (input), [rdx] "r" (taps), "c" (num_bytes), [rdi] "r" (result)
281  :"rax", "r8", "r9", "r10"
282  );
283 
284 
285  if(((num_bytes >> 3) & 1)) {
286  *result += (input[(num_bytes >> 3) - 1] * taps[(num_bytes >> 3) - 1]);
287  }
288 
289  return;
290 
291 }
292 
293 #endif
294 
295 #if LV_HAVE_SSE && LV_HAVE_32
296 
297 static inline void volk_32fc_x2_dot_prod_32fc_a_sse_32(lv_32fc_t* result, const lv_32fc_t* input, const lv_32fc_t* taps, unsigned int num_points) {
298  volk_32fc_x2_dot_prod_32fc_a_generic(result, input, taps, num_points);
299 
300 #if 0
301  const unsigned int num_bytes = num_points*8;
302  asm volatile
303  (
304  " #pushl %%ebp\n\t"
305  " #movl %%esp, %%ebp\n\t"
306  " movl 12(%%ebp), %%eax # input\n\t"
307  " movl 16(%%ebp), %%edx # taps\n\t"
308  " movl 20(%%ebp), %%ecx # n_bytes\n\t"
309  " xorps %%xmm6, %%xmm6 # zero accumulators\n\t"
310  " movaps 0(%%eax), %%xmm0\n\t"
311  " xorps %%xmm7, %%xmm7 # zero accumulators\n\t"
312  " movaps 0(%%edx), %%xmm2\n\t"
313  " shrl $5, %%ecx # ecx = n_2_ccomplex_blocks / 2\n\t"
314  " jmp .%=L1_test\n\t"
315  " # 4 taps / loop\n\t"
316  " # something like ?? cycles / loop\n\t"
317  ".%=Loop1: \n\t"
318  "# complex prod: C += A * B, w/ temp Z & Y (or B), xmmPN=$0x8000000080000000\n\t"
319  "# movaps (%%eax), %%xmmA\n\t"
320  "# movaps (%%edx), %%xmmB\n\t"
321  "# movaps %%xmmA, %%xmmZ\n\t"
322  "# shufps $0xb1, %%xmmZ, %%xmmZ # swap internals\n\t"
323  "# mulps %%xmmB, %%xmmA\n\t"
324  "# mulps %%xmmZ, %%xmmB\n\t"
325  "# # SSE replacement for: pfpnacc %%xmmB, %%xmmA\n\t"
326  "# xorps %%xmmPN, %%xmmA\n\t"
327  "# movaps %%xmmA, %%xmmZ\n\t"
328  "# unpcklps %%xmmB, %%xmmA\n\t"
329  "# unpckhps %%xmmB, %%xmmZ\n\t"
330  "# movaps %%xmmZ, %%xmmY\n\t"
331  "# shufps $0x44, %%xmmA, %%xmmZ # b01000100\n\t"
332  "# shufps $0xee, %%xmmY, %%xmmA # b11101110\n\t"
333  "# addps %%xmmZ, %%xmmA\n\t"
334  "# addps %%xmmA, %%xmmC\n\t"
335  "# A=xmm0, B=xmm2, Z=xmm4\n\t"
336  "# A'=xmm1, B'=xmm3, Z'=xmm5\n\t"
337  " movaps 16(%%eax), %%xmm1\n\t"
338  " movaps %%xmm0, %%xmm4\n\t"
339  " mulps %%xmm2, %%xmm0\n\t"
340  " shufps $0xb1, %%xmm4, %%xmm4 # swap internals\n\t"
341  " movaps 16(%%edx), %%xmm3\n\t"
342  " movaps %%xmm1, %%xmm5\n\t"
343  " addps %%xmm0, %%xmm6\n\t"
344  " mulps %%xmm3, %%xmm1\n\t"
345  " shufps $0xb1, %%xmm5, %%xmm5 # swap internals\n\t"
346  " addps %%xmm1, %%xmm6\n\t"
347  " mulps %%xmm4, %%xmm2\n\t"
348  " movaps 32(%%eax), %%xmm0\n\t"
349  " addps %%xmm2, %%xmm7\n\t"
350  " mulps %%xmm5, %%xmm3\n\t"
351  " addl $32, %%eax\n\t"
352  " movaps 32(%%edx), %%xmm2\n\t"
353  " addps %%xmm3, %%xmm7\n\t"
354  " addl $32, %%edx\n\t"
355  ".%=L1_test:\n\t"
356  " decl %%ecx\n\t"
357  " jge .%=Loop1\n\t"
358  " # We've handled the bulk of multiplies up to here.\n\t"
359  " # Let's sse if original n_2_ccomplex_blocks was odd.\n\t"
360  " # If so, we've got 2 more taps to do.\n\t"
361  " movl 20(%%ebp), %%ecx # n_2_ccomplex_blocks\n\t"
362  " shrl $4, %%ecx\n\t"
363  " andl $1, %%ecx\n\t"
364  " je .%=Leven\n\t"
365  " # The count was odd, do 2 more taps.\n\t"
366  " # Note that we've already got mm0/mm2 preloaded\n\t"
367  " # from the main loop.\n\t"
368  " movaps %%xmm0, %%xmm4\n\t"
369  " mulps %%xmm2, %%xmm0\n\t"
370  " shufps $0xb1, %%xmm4, %%xmm4 # swap internals\n\t"
371  " addps %%xmm0, %%xmm6\n\t"
372  " mulps %%xmm4, %%xmm2\n\t"
373  " addps %%xmm2, %%xmm7\n\t"
374  ".%=Leven:\n\t"
375  " # neg inversor\n\t"
376  " movl 8(%%ebp), %%eax \n\t"
377  " xorps %%xmm1, %%xmm1\n\t"
378  " movl $0x80000000, (%%eax)\n\t"
379  " movss (%%eax), %%xmm1\n\t"
380  " shufps $0x11, %%xmm1, %%xmm1 # b00010001 # 0 -0 0 -0\n\t"
381  " # pfpnacc\n\t"
382  " xorps %%xmm1, %%xmm6\n\t"
383  " movaps %%xmm6, %%xmm2\n\t"
384  " unpcklps %%xmm7, %%xmm6\n\t"
385  " unpckhps %%xmm7, %%xmm2\n\t"
386  " movaps %%xmm2, %%xmm3\n\t"
387  " shufps $0x44, %%xmm6, %%xmm2 # b01000100\n\t"
388  " shufps $0xee, %%xmm3, %%xmm6 # b11101110\n\t"
389  " addps %%xmm2, %%xmm6\n\t"
390  " # xmm6 = r1 i2 r3 i4\n\t"
391  " #movl 8(%%ebp), %%eax # @result\n\t"
392  " movhlps %%xmm6, %%xmm4 # xmm4 = r3 i4 ?? ??\n\t"
393  " addps %%xmm4, %%xmm6 # xmm6 = r1+r3 i2+i4 ?? ??\n\t"
394  " movlps %%xmm6, (%%eax) # store low 2x32 bits (complex) to memory\n\t"
395  " #popl %%ebp\n\t"
396  :
397  :
398  : "eax", "ecx", "edx"
399  );
400 
401 
402  int getem = num_bytes % 16;
403 
404  for(; getem > 0; getem -= 8) {
405 
406 
407  *result += (input[(num_bytes >> 3) - 1] * taps[(num_bytes >> 3) - 1]);
408 
409  }
410 
411  return;
412 #endif
413 }
414 
415 #endif /*LV_HAVE_SSE*/
416 
417 #ifdef LV_HAVE_SSE3
418 
419 #include <pmmintrin.h>
420 
421 static inline void volk_32fc_x2_dot_prod_32fc_a_sse3(lv_32fc_t* result, const lv_32fc_t* input, const lv_32fc_t* taps, unsigned int num_points) {
422 
423  const unsigned int num_bytes = num_points*8;
424 
425  lv_32fc_t dotProduct;
426  memset(&dotProduct, 0x0, 2*sizeof(float));
427 
428  unsigned int number = 0;
429  const unsigned int halfPoints = num_bytes >> 4;
430 
431  __m128 x, y, yl, yh, z, tmp1, tmp2, dotProdVal;
432 
433  const lv_32fc_t* a = input;
434  const lv_32fc_t* b = taps;
435 
436  dotProdVal = _mm_setzero_ps();
437 
438  for(;number < halfPoints; number++){
439 
440  x = _mm_load_ps((float*)a); // Load the ar + ai, br + bi as ar,ai,br,bi
441  y = _mm_load_ps((float*)b); // Load the cr + ci, dr + di as cr,ci,dr,di
442 
443  yl = _mm_moveldup_ps(y); // Load yl with cr,cr,dr,dr
444  yh = _mm_movehdup_ps(y); // Load yh with ci,ci,di,di
445 
446  tmp1 = _mm_mul_ps(x,yl); // tmp1 = ar*cr,ai*cr,br*dr,bi*dr
447 
448  x = _mm_shuffle_ps(x,x,0xB1); // Re-arrange x to be ai,ar,bi,br
449 
450  tmp2 = _mm_mul_ps(x,yh); // tmp2 = ai*ci,ar*ci,bi*di,br*di
451 
452  z = _mm_addsub_ps(tmp1,tmp2); // ar*cr-ai*ci, ai*cr+ar*ci, br*dr-bi*di, bi*dr+br*di
453 
454  dotProdVal = _mm_add_ps(dotProdVal, z); // Add the complex multiplication results together
455 
456  a += 2;
457  b += 2;
458  }
459 
460  __VOLK_ATTR_ALIGNED(16) lv_32fc_t dotProductVector[2];
461 
462  _mm_store_ps((float*)dotProductVector,dotProdVal); // Store the results back into the dot product vector
463 
464  dotProduct += ( dotProductVector[0] + dotProductVector[1] );
465 
466  if(((num_bytes >> 3) & 1) != 0) {
467  dotProduct += (*a) * (*b);
468  }
469 
470  *result = dotProduct;
471 }
472 
473 #endif /*LV_HAVE_SSE3*/
474 
475 #ifdef LV_HAVE_SSE4_1
476 
477 #include <smmintrin.h>
478 
479 static inline void volk_32fc_x2_dot_prod_32fc_a_sse4_1(lv_32fc_t* result, const lv_32fc_t* input, const lv_32fc_t* taps, unsigned int num_points) {
480 
481  const unsigned int num_bytes = num_points*8;
482 
483  __m128 xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, real0, real1, im0, im1;
484  float *p_input, *p_taps;
485  __m64 *p_result;
486 
487  p_result = (__m64*)result;
488  p_input = (float*)input;
489  p_taps = (float*)taps;
490 
491  static const __m128i neg = {0x000000000000000080000000};
492 
493  int i = 0;
494 
495  int bound = (num_bytes >> 5);
496  int leftovers = (num_bytes & 24) >> 3;
497 
498  real0 = _mm_sub_ps(real0, real0);
499  real1 = _mm_sub_ps(real1, real1);
500  im0 = _mm_sub_ps(im0, im0);
501  im1 = _mm_sub_ps(im1, im1);
502 
503  for(; i < bound; ++i) {
504 
505 
506  xmm0 = _mm_load_ps(p_input);
507  xmm1 = _mm_load_ps(p_taps);
508 
509  p_input += 4;
510  p_taps += 4;
511 
512  xmm2 = _mm_load_ps(p_input);
513  xmm3 = _mm_load_ps(p_taps);
514 
515  p_input += 4;
516  p_taps += 4;
517 
518  xmm4 = _mm_unpackhi_ps(xmm0, xmm2);
519  xmm5 = _mm_unpackhi_ps(xmm1, xmm3);
520  xmm0 = _mm_unpacklo_ps(xmm0, xmm2);
521  xmm2 = _mm_unpacklo_ps(xmm1, xmm3);
522 
523  //imaginary vector from input
524  xmm1 = _mm_unpackhi_ps(xmm0, xmm4);
525  //real vector from input
526  xmm3 = _mm_unpacklo_ps(xmm0, xmm4);
527  //imaginary vector from taps
528  xmm0 = _mm_unpackhi_ps(xmm2, xmm5);
529  //real vector from taps
530  xmm2 = _mm_unpacklo_ps(xmm2, xmm5);
531 
532  xmm4 = _mm_dp_ps(xmm3, xmm2, 0xf1);
533  xmm5 = _mm_dp_ps(xmm1, xmm0, 0xf1);
534 
535  xmm6 = _mm_dp_ps(xmm3, xmm0, 0xf2);
536  xmm7 = _mm_dp_ps(xmm1, xmm2, 0xf2);
537 
538  real0 = _mm_add_ps(xmm4, real0);
539  real1 = _mm_add_ps(xmm5, real1);
540  im0 = _mm_add_ps(xmm6, im0);
541  im1 = _mm_add_ps(xmm7, im1);
542 
543  }
544 
545  real1 = _mm_xor_ps(real1, bit128_p(&neg)->float_vec);
546 
547  im0 = _mm_add_ps(im0, im1);
548  real0 = _mm_add_ps(real0, real1);
549 
550  im0 = _mm_add_ps(im0, real0);
551 
552  _mm_storel_pi(p_result, im0);
553 
554  for(i = bound * 4; i < (bound * 4) + leftovers; ++i) {
555 
556  *result += input[i] * taps[i];
557  }
558 }
559 
560 #endif /*LV_HAVE_SSE4_1*/
561 
562 #endif /*INCLUDED_volk_32fc_x2_dot_prod_32fc_a_H*/
#define bit128_p(x)
Definition: volk_common.h:94
#define __VOLK_ATTR_ALIGNED(x)
Definition: volk_common.h:27
static const float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
float complex lv_32fc_t
Definition: volk_complex.h:56