GNU Radio 3.6.5 C++ API
|
00001 #ifndef INCLUDED_volk_32fc_deinterleave_32f_x2_a_H 00002 #define INCLUDED_volk_32fc_deinterleave_32f_x2_a_H 00003 00004 #include <inttypes.h> 00005 #include <stdio.h> 00006 00007 #ifdef LV_HAVE_SSE 00008 #include <xmmintrin.h> 00009 /*! 00010 \brief Deinterleaves the complex vector into I & Q vector data 00011 \param complexVector The complex input vector 00012 \param iBuffer The I buffer output data 00013 \param qBuffer The Q buffer output data 00014 \param num_points The number of complex data values to be deinterleaved 00015 */ 00016 static inline void volk_32fc_deinterleave_32f_x2_a_sse(float* iBuffer, float* qBuffer, const lv_32fc_t* complexVector, unsigned int num_points){ 00017 const float* complexVectorPtr = (float*)complexVector; 00018 float* iBufferPtr = iBuffer; 00019 float* qBufferPtr = qBuffer; 00020 00021 unsigned int number = 0; 00022 const unsigned int quarterPoints = num_points / 4; 00023 __m128 cplxValue1, cplxValue2, iValue, qValue; 00024 for(;number < quarterPoints; number++){ 00025 00026 cplxValue1 = _mm_load_ps(complexVectorPtr); 00027 complexVectorPtr += 4; 00028 00029 cplxValue2 = _mm_load_ps(complexVectorPtr); 00030 complexVectorPtr += 4; 00031 00032 // Arrange in i1i2i3i4 format 00033 iValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(2,0,2,0)); 00034 // Arrange in q1q2q3q4 format 00035 qValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(3,1,3,1)); 00036 00037 _mm_store_ps(iBufferPtr, iValue); 00038 _mm_store_ps(qBufferPtr, qValue); 00039 00040 iBufferPtr += 4; 00041 qBufferPtr += 4; 00042 } 00043 00044 number = quarterPoints * 4; 00045 for(; number < num_points; number++){ 00046 *iBufferPtr++ = *complexVectorPtr++; 00047 *qBufferPtr++ = *complexVectorPtr++; 00048 } 00049 } 00050 #endif /* LV_HAVE_SSE */ 00051 00052 #ifdef LV_HAVE_GENERIC 00053 /*! 00054 \brief Deinterleaves the complex vector into I & Q vector data 00055 \param complexVector The complex input vector 00056 \param iBuffer The I buffer output data 00057 \param qBuffer The Q buffer output data 00058 \param num_points The number of complex data values to be deinterleaved 00059 */ 00060 static inline void volk_32fc_deinterleave_32f_x2_a_generic(float* iBuffer, float* qBuffer, const lv_32fc_t* complexVector, unsigned int num_points){ 00061 const float* complexVectorPtr = (float*)complexVector; 00062 float* iBufferPtr = iBuffer; 00063 float* qBufferPtr = qBuffer; 00064 unsigned int number; 00065 for(number = 0; number < num_points; number++){ 00066 *iBufferPtr++ = *complexVectorPtr++; 00067 *qBufferPtr++ = *complexVectorPtr++; 00068 } 00069 } 00070 #endif /* LV_HAVE_GENERIC */ 00071 00072 00073 00074 00075 #endif /* INCLUDED_volk_32fc_deinterleave_32f_x2_a_H */