GNU Radio Manual and C++ API Reference  3.7.4.1
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
volk_32fc_deinterleave_32f_x2.h
Go to the documentation of this file.
1 #ifndef INCLUDED_volk_32fc_deinterleave_32f_x2_a_H
2 #define INCLUDED_volk_32fc_deinterleave_32f_x2_a_H
3 
4 #include <inttypes.h>
5 #include <stdio.h>
6 
7 #ifdef LV_HAVE_SSE
8 #include <xmmintrin.h>
9 /*!
10  \brief Deinterleaves the complex vector into I & Q vector data
11  \param complexVector The complex input vector
12  \param iBuffer The I buffer output data
13  \param qBuffer The Q buffer output data
14  \param num_points The number of complex data values to be deinterleaved
15 */
16 static inline void volk_32fc_deinterleave_32f_x2_a_sse(float* iBuffer, float* qBuffer, const lv_32fc_t* complexVector, unsigned int num_points){
17  const float* complexVectorPtr = (float*)complexVector;
18  float* iBufferPtr = iBuffer;
19  float* qBufferPtr = qBuffer;
20 
21  unsigned int number = 0;
22  const unsigned int quarterPoints = num_points / 4;
23  __m128 cplxValue1, cplxValue2, iValue, qValue;
24  for(;number < quarterPoints; number++){
25 
26  cplxValue1 = _mm_load_ps(complexVectorPtr);
27  complexVectorPtr += 4;
28 
29  cplxValue2 = _mm_load_ps(complexVectorPtr);
30  complexVectorPtr += 4;
31 
32  // Arrange in i1i2i3i4 format
33  iValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(2,0,2,0));
34  // Arrange in q1q2q3q4 format
35  qValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(3,1,3,1));
36 
37  _mm_store_ps(iBufferPtr, iValue);
38  _mm_store_ps(qBufferPtr, qValue);
39 
40  iBufferPtr += 4;
41  qBufferPtr += 4;
42  }
43 
44  number = quarterPoints * 4;
45  for(; number < num_points; number++){
46  *iBufferPtr++ = *complexVectorPtr++;
47  *qBufferPtr++ = *complexVectorPtr++;
48  }
49 }
50 #endif /* LV_HAVE_SSE */
51 
52 #ifdef LV_HAVE_GENERIC
53 /*!
54  \brief Deinterleaves the complex vector into I & Q vector data
55  \param complexVector The complex input vector
56  \param iBuffer The I buffer output data
57  \param qBuffer The Q buffer output data
58  \param num_points The number of complex data values to be deinterleaved
59 */
60 static inline void volk_32fc_deinterleave_32f_x2_generic(float* iBuffer, float* qBuffer, const lv_32fc_t* complexVector, unsigned int num_points){
61  const float* complexVectorPtr = (float*)complexVector;
62  float* iBufferPtr = iBuffer;
63  float* qBufferPtr = qBuffer;
64  unsigned int number;
65  for(number = 0; number < num_points; number++){
66  *iBufferPtr++ = *complexVectorPtr++;
67  *qBufferPtr++ = *complexVectorPtr++;
68  }
69 }
70 #endif /* LV_HAVE_GENERIC */
71 
72 
73 
74 
75 #endif /* INCLUDED_volk_32fc_deinterleave_32f_x2_a_H */
float complex lv_32fc_t
Definition: volk_complex.h:56