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_real_32f.h
Go to the documentation of this file.
1 #ifndef INCLUDED_volk_32fc_deinterleave_real_32f_a_H
2 #define INCLUDED_volk_32fc_deinterleave_real_32f_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 vector data
11  \param complexVector The complex input vector
12  \param iBuffer The I buffer output data
13  \param num_points The number of complex data values to be deinterleaved
14 */
15 static inline void volk_32fc_deinterleave_real_32f_a_sse(float* iBuffer, const lv_32fc_t* complexVector, unsigned int num_points){
16  unsigned int number = 0;
17  const unsigned int quarterPoints = num_points / 4;
18 
19  const float* complexVectorPtr = (const float*)complexVector;
20  float* iBufferPtr = iBuffer;
21 
22  __m128 cplxValue1, cplxValue2, iValue;
23  for(;number < quarterPoints; number++){
24 
25  cplxValue1 = _mm_load_ps(complexVectorPtr);
26  complexVectorPtr += 4;
27 
28  cplxValue2 = _mm_load_ps(complexVectorPtr);
29  complexVectorPtr += 4;
30 
31  // Arrange in i1i2i3i4 format
32  iValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(2,0,2,0));
33 
34  _mm_store_ps(iBufferPtr, iValue);
35 
36  iBufferPtr += 4;
37  }
38 
39  number = quarterPoints * 4;
40  for(; number < num_points; number++){
41  *iBufferPtr++ = *complexVectorPtr++;
42  complexVectorPtr++;
43  }
44 }
45 #endif /* LV_HAVE_SSE */
46 
47 #ifdef LV_HAVE_GENERIC
48 /*!
49  \brief Deinterleaves the complex vector into I vector data
50  \param complexVector The complex input vector
51  \param iBuffer The I buffer output data
52  \param num_points The number of complex data values to be deinterleaved
53 */
54 static inline void volk_32fc_deinterleave_real_32f_generic(float* iBuffer, const lv_32fc_t* complexVector, unsigned int num_points){
55  unsigned int number = 0;
56  const float* complexVectorPtr = (float*)complexVector;
57  float* iBufferPtr = iBuffer;
58  for(number = 0; number < num_points; number++){
59  *iBufferPtr++ = *complexVectorPtr++;
60  complexVectorPtr++;
61  }
62 }
63 #endif /* LV_HAVE_GENERIC */
64 
65 
66 
67 
68 #endif /* INCLUDED_volk_32fc_deinterleave_real_32f_a_H */
float complex lv_32fc_t
Definition: volk_complex.h:56