GNU Radio Manual and C++ API Reference  3.7.4
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
volk_32fc_deinterleave_real_64f.h
Go to the documentation of this file.
1 #ifndef INCLUDED_volk_32fc_deinterleave_real_64f_a_H
2 #define INCLUDED_volk_32fc_deinterleave_real_64f_a_H
3 
4 #include <inttypes.h>
5 #include <stdio.h>
6 
7 #ifdef LV_HAVE_SSE2
8 #include <emmintrin.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_64f_a_sse2(double* iBuffer, const lv_32fc_t* complexVector, unsigned int num_points){
16  unsigned int number = 0;
17 
18  const float* complexVectorPtr = (float*)complexVector;
19  double* iBufferPtr = iBuffer;
20 
21  const unsigned int halfPoints = num_points / 2;
22  __m128 cplxValue, fVal;
23  __m128d dVal;
24  for(;number < halfPoints; number++){
25 
26  cplxValue = _mm_load_ps(complexVectorPtr);
27  complexVectorPtr += 4;
28 
29  // Arrange in i1i2i1i2 format
30  fVal = _mm_shuffle_ps(cplxValue, cplxValue, _MM_SHUFFLE(2,0,2,0));
31  dVal = _mm_cvtps_pd(fVal);
32  _mm_store_pd(iBufferPtr, dVal);
33 
34  iBufferPtr += 2;
35  }
36 
37  number = halfPoints * 2;
38  for(; number < num_points; number++){
39  *iBufferPtr++ = (double)*complexVectorPtr++;
40  complexVectorPtr++;
41  }
42 }
43 #endif /* LV_HAVE_SSE */
44 
45 #ifdef LV_HAVE_GENERIC
46 /*!
47  \brief Deinterleaves the complex vector into I vector data
48  \param complexVector The complex input vector
49  \param iBuffer The I buffer output data
50  \param num_points The number of complex data values to be deinterleaved
51 */
52 static inline void volk_32fc_deinterleave_real_64f_generic(double* iBuffer, const lv_32fc_t* complexVector, unsigned int num_points){
53  unsigned int number = 0;
54  const float* complexVectorPtr = (float*)complexVector;
55  double* iBufferPtr = iBuffer;
56  for(number = 0; number < num_points; number++){
57  *iBufferPtr++ = (double)*complexVectorPtr++;
58  complexVectorPtr++;
59  }
60 }
61 #endif /* LV_HAVE_GENERIC */
62 
63 
64 
65 
66 #endif /* INCLUDED_volk_32fc_deinterleave_real_64f_a_H */
float complex lv_32fc_t
Definition: volk_complex.h:56