GNU Radio 3.6.5 C++ API

volk_32fc_deinterleave_real_32f_a.h

Go to the documentation of this file.
00001 #ifndef INCLUDED_volk_32fc_deinterleave_real_32f_a_H
00002 #define INCLUDED_volk_32fc_deinterleave_real_32f_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 vector data
00011   \param complexVector The complex input vector
00012   \param iBuffer The I buffer output data
00013   \param num_points The number of complex data values to be deinterleaved
00014 */
00015 static inline void volk_32fc_deinterleave_real_32f_a_sse(float* iBuffer, const lv_32fc_t* complexVector, unsigned int num_points){
00016   unsigned int number = 0;
00017   const unsigned int quarterPoints = num_points / 4;
00018 
00019   const float* complexVectorPtr = (const float*)complexVector;
00020   float* iBufferPtr = iBuffer;
00021 
00022   __m128 cplxValue1, cplxValue2, iValue;
00023   for(;number < quarterPoints; number++){
00024 
00025     cplxValue1 = _mm_load_ps(complexVectorPtr);
00026     complexVectorPtr += 4;
00027 
00028     cplxValue2 = _mm_load_ps(complexVectorPtr);
00029     complexVectorPtr += 4;
00030 
00031     // Arrange in i1i2i3i4 format
00032     iValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(2,0,2,0));
00033 
00034     _mm_store_ps(iBufferPtr, iValue);
00035 
00036     iBufferPtr += 4;
00037   }
00038 
00039   number = quarterPoints * 4;
00040   for(; number < num_points; number++){
00041     *iBufferPtr++ = *complexVectorPtr++;
00042     complexVectorPtr++;
00043   }
00044 }
00045 #endif /* LV_HAVE_SSE */
00046 
00047 #ifdef LV_HAVE_GENERIC
00048 /*!
00049   \brief Deinterleaves the complex vector into I vector data
00050   \param complexVector The complex input vector
00051   \param iBuffer The I buffer output data
00052   \param num_points The number of complex data values to be deinterleaved
00053 */
00054 static inline void volk_32fc_deinterleave_real_32f_a_generic(float* iBuffer, const lv_32fc_t* complexVector, unsigned int num_points){
00055   unsigned int number = 0;
00056   const float* complexVectorPtr = (float*)complexVector;
00057   float* iBufferPtr = iBuffer;
00058   for(number = 0; number < num_points; number++){
00059     *iBufferPtr++ = *complexVectorPtr++;
00060     complexVectorPtr++;
00061   }
00062 }
00063 #endif /* LV_HAVE_GENERIC */
00064 
00065 
00066 
00067 
00068 #endif /* INCLUDED_volk_32fc_deinterleave_real_32f_a_H */