GNU Radio 3.7.2 C++ API
volk_32fc_32f_multiply_32fc.h
Go to the documentation of this file.
1 #ifndef INCLUDED_volk_32fc_32f_multiply_32fc_a_H
2 #define INCLUDED_volk_32fc_32f_multiply_32fc_a_H
3 
4 #include <inttypes.h>
5 #include <stdio.h>
6 
7 #ifdef LV_HAVE_SSE
8 #include <xmmintrin.h>
9  /*!
10  \brief Multiplies the input complex vector with the input float vector and store their results in the third vector
11  \param cVector The vector where the results will be stored
12  \param aVector The complex vector to be multiplied
13  \param bVector The vectors containing the float values to be multiplied against each complex value in aVector
14  \param num_points The number of values in aVector and bVector to be multiplied together and stored into cVector
15  */
16 static inline void volk_32fc_32f_multiply_32fc_a_sse(lv_32fc_t* cVector, const lv_32fc_t* aVector, const float* bVector, unsigned int num_points){
17  unsigned int number = 0;
18  const unsigned int quarterPoints = num_points / 4;
19 
20  lv_32fc_t* cPtr = cVector;
21  const lv_32fc_t* aPtr = aVector;
22  const float* bPtr= bVector;
23 
24  __m128 aVal1, aVal2, bVal, bVal1, bVal2, cVal;
25  for(;number < quarterPoints; number++){
26 
27  aVal1 = _mm_load_ps((const float*)aPtr);
28  aPtr += 2;
29 
30  aVal2 = _mm_load_ps((const float*)aPtr);
31  aPtr += 2;
32 
33  bVal = _mm_load_ps(bPtr);
34  bPtr += 4;
35 
36  bVal1 = _mm_shuffle_ps(bVal, bVal, _MM_SHUFFLE(1,1,0,0));
37  bVal2 = _mm_shuffle_ps(bVal, bVal, _MM_SHUFFLE(3,3,2,2));
38 
39  cVal = _mm_mul_ps(aVal1, bVal1);
40 
41  _mm_store_ps((float*)cPtr,cVal); // Store the results back into the C container
42  cPtr += 2;
43 
44  cVal = _mm_mul_ps(aVal2, bVal2);
45 
46  _mm_store_ps((float*)cPtr,cVal); // Store the results back into the C container
47 
48  cPtr += 2;
49  }
50 
51  number = quarterPoints * 4;
52  for(;number < num_points; number++){
53  *cPtr++ = (*aPtr++) * (*bPtr);
54  bPtr++;
55  }
56 }
57 #endif /* LV_HAVE_SSE */
58 
59 #ifdef LV_HAVE_GENERIC
60  /*!
61  \brief Multiplies the input complex vector with the input lv_32fc_t vector and store their results in the third vector
62  \param cVector The vector where the results will be stored
63  \param aVector The complex vector to be multiplied
64  \param bVector The vectors containing the lv_32fc_t values to be multiplied against each complex value in aVector
65  \param num_points The number of values in aVector and bVector to be multiplied together and stored into cVector
66  */
67 static inline void volk_32fc_32f_multiply_32fc_generic(lv_32fc_t* cVector, const lv_32fc_t* aVector, const float* bVector, unsigned int num_points){
68  lv_32fc_t* cPtr = cVector;
69  const lv_32fc_t* aPtr = aVector;
70  const float* bPtr= bVector;
71  unsigned int number = 0;
72 
73  for(number = 0; number < num_points; number++){
74  *cPtr++ = (*aPtr++) * (*bPtr++);
75  }
76 }
77 #endif /* LV_HAVE_GENERIC */
78 
79 #ifdef LV_HAVE_ORC
80  /*!
81  \brief Multiplies the input complex vector with the input lv_32fc_t vector and store their results in the third vector
82  \param cVector The vector where the results will be stored
83  \param aVector The complex vector to be multiplied
84  \param bVector The vectors containing the lv_32fc_t values to be multiplied against each complex value in aVector
85  \param num_points The number of values in aVector and bVector to be multiplied together and stored into cVector
86  */
87 extern void volk_32fc_32f_multiply_32fc_a_orc_impl(lv_32fc_t* cVector, const lv_32fc_t* aVector, const float* bVector, unsigned int num_points);
88 static inline void volk_32fc_32f_multiply_32fc_u_orc(lv_32fc_t* cVector, const lv_32fc_t* aVector, const float* bVector, unsigned int num_points){
89  volk_32fc_32f_multiply_32fc_a_orc_impl(cVector, aVector, bVector, num_points);
90 }
91 #endif /* LV_HAVE_GENERIC */
92 
93 
94 
95 #endif /* INCLUDED_volk_32fc_32f_multiply_32fc_a_H */
float complex lv_32fc_t
Definition: volk_complex.h:56