GNU Radio 3.6.5 C++ API

volk_32fc_deinterleave_real_64f_a.h

Go to the documentation of this file.
00001 #ifndef INCLUDED_volk_32fc_deinterleave_real_64f_a_H
00002 #define INCLUDED_volk_32fc_deinterleave_real_64f_a_H
00003 
00004 #include <inttypes.h>
00005 #include <stdio.h>
00006 
00007 #ifdef LV_HAVE_SSE2
00008 #include <emmintrin.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_64f_a_sse2(double* iBuffer, const lv_32fc_t* complexVector, unsigned int num_points){
00016   unsigned int number = 0;
00017 
00018   const float* complexVectorPtr = (float*)complexVector;
00019   double* iBufferPtr = iBuffer;
00020 
00021   const unsigned int halfPoints = num_points / 2;
00022   __m128 cplxValue, fVal;
00023   __m128d dVal;
00024   for(;number < halfPoints; number++){
00025 
00026     cplxValue = _mm_load_ps(complexVectorPtr);
00027     complexVectorPtr += 4;
00028 
00029     // Arrange in i1i2i1i2 format
00030     fVal = _mm_shuffle_ps(cplxValue, cplxValue, _MM_SHUFFLE(2,0,2,0));
00031     dVal = _mm_cvtps_pd(fVal);
00032     _mm_store_pd(iBufferPtr, dVal);
00033 
00034     iBufferPtr += 2;
00035   }
00036 
00037   number = halfPoints * 2;
00038   for(; number < num_points; number++){
00039     *iBufferPtr++ = (double)*complexVectorPtr++;
00040     complexVectorPtr++;
00041   }
00042 }
00043 #endif /* LV_HAVE_SSE */
00044 
00045 #ifdef LV_HAVE_GENERIC
00046 /*!
00047   \brief Deinterleaves the complex vector into I vector data
00048   \param complexVector The complex input vector
00049   \param iBuffer The I buffer output data
00050   \param num_points The number of complex data values to be deinterleaved
00051 */
00052 static inline void volk_32fc_deinterleave_real_64f_a_generic(double* iBuffer, const lv_32fc_t* complexVector, unsigned int num_points){
00053   unsigned int number = 0;
00054   const float* complexVectorPtr = (float*)complexVector;
00055   double* iBufferPtr = iBuffer;
00056   for(number = 0; number < num_points; number++){
00057     *iBufferPtr++ = (double)*complexVectorPtr++;
00058     complexVectorPtr++;
00059   }
00060 }
00061 #endif /* LV_HAVE_GENERIC */
00062 
00063 
00064 
00065 
00066 #endif /* INCLUDED_volk_32fc_deinterleave_real_64f_a_H */