GNU Radio 3.7.3 C++ API
volk_32fc_deinterleave_imag_32f.h
Go to the documentation of this file.
1 #ifndef INCLUDED_volk_32fc_deinterleave_imag_32f_a_H
2 #define INCLUDED_volk_32fc_deinterleave_imag_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 Q vector data
11  \param complexVector The complex input vector
12  \param qBuffer The Q buffer output data
13  \param num_points The number of complex data values to be deinterleaved
14 */
15 static inline void volk_32fc_deinterleave_imag_32f_a_sse(float* qBuffer, 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* qBufferPtr = qBuffer;
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 q1q2q3q4 format
32  iValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(3,1,3,1));
33 
34  _mm_store_ps(qBufferPtr, iValue);
35 
36  qBufferPtr += 4;
37  }
38 
39  number = quarterPoints * 4;
40  for(; number < num_points; number++){
41  complexVectorPtr++;
42  *qBufferPtr++ = *complexVectorPtr++;
43  }
44 }
45 #endif /* LV_HAVE_SSE */
46 
47 #ifdef LV_HAVE_GENERIC
48 /*!
49  \brief Deinterleaves the complex vector into Q vector data
50  \param complexVector The complex input vector
51  \param qBuffer 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_imag_32f_generic(float* qBuffer, const lv_32fc_t* complexVector, unsigned int num_points){
55  unsigned int number = 0;
56  const float* complexVectorPtr = (float*)complexVector;
57  float* qBufferPtr = qBuffer;
58  for(number = 0; number < num_points; number++){
59  complexVectorPtr++;
60  *qBufferPtr++ = *complexVectorPtr++;
61  }
62 }
63 #endif /* LV_HAVE_GENERIC */
64 
65 
66 
67 
68 #endif /* INCLUDED_volk_32fc_deinterleave_imag_32f_a_H */
float complex lv_32fc_t
Definition: volk_complex.h:56