GNU Radio 3.6.5 C++ API

volk_32f_convert_64f_u.h

Go to the documentation of this file.
00001 #ifndef INCLUDED_volk_32f_convert_64f_u_H
00002 #define INCLUDED_volk_32f_convert_64f_u_H
00003 
00004 #include <inttypes.h>
00005 #include <stdio.h>
00006 
00007 #ifdef LV_HAVE_SSE2
00008 #include <emmintrin.h>
00009   /*!
00010     \brief Converts the float values into double values
00011     \param dVector The converted double vector values
00012     \param fVector The float vector values to be converted
00013     \param num_points The number of points in the two vectors to be converted
00014   */
00015 static inline void volk_32f_convert_64f_u_sse2(double* outputVector, const float* inputVector, unsigned int num_points){
00016   unsigned int number = 0;
00017 
00018   const unsigned int quarterPoints = num_points / 4;
00019 
00020   const float* inputVectorPtr = (const float*)inputVector;
00021   double* outputVectorPtr = outputVector;
00022   __m128d ret;
00023   __m128 inputVal;
00024 
00025   for(;number < quarterPoints; number++){
00026     inputVal = _mm_loadu_ps(inputVectorPtr); inputVectorPtr += 4;
00027 
00028     ret = _mm_cvtps_pd(inputVal);
00029 
00030     _mm_storeu_pd(outputVectorPtr, ret);
00031     outputVectorPtr += 2;
00032 
00033     inputVal = _mm_movehl_ps(inputVal, inputVal);
00034 
00035     ret = _mm_cvtps_pd(inputVal);
00036 
00037     _mm_storeu_pd(outputVectorPtr, ret);
00038     outputVectorPtr += 2;
00039   }
00040 
00041   number = quarterPoints * 4;
00042   for(; number < num_points; number++){
00043     outputVector[number] = (double)(inputVector[number]);
00044   }
00045 }
00046 #endif /* LV_HAVE_SSE2 */
00047 
00048 
00049 #ifdef LV_HAVE_GENERIC
00050 /*!
00051   \brief Converts the float values into double values
00052   \param dVector The converted double vector values
00053   \param fVector The float vector values to be converted
00054   \param num_points The number of points in the two vectors to be converted
00055 */
00056 static inline void volk_32f_convert_64f_u_generic(double* outputVector, const float* inputVector, unsigned int num_points){
00057   double* outputVectorPtr = outputVector;
00058   const float* inputVectorPtr = inputVector;
00059   unsigned int number = 0;
00060 
00061   for(number = 0; number < num_points; number++){
00062     *outputVectorPtr++ = ((double)(*inputVectorPtr++));
00063   }
00064 }
00065 #endif /* LV_HAVE_GENERIC */
00066 
00067 
00068 
00069 
00070 #endif /* INCLUDED_volk_32f_convert_64f_u_H */