1
#ifndef INCLUDED_volk_64f_convert_32f_u_H
2
#define INCLUDED_volk_64f_convert_32f_u_H
10
\brief Converts the double values into float values
11
\param dVector The converted float vector values
12
\param fVector The double vector values to be converted
13
\param num_points The number of points in the two vectors to be converted
15
static inline void volk_64f_convert_32f_u_sse2(float* outputVector, const double* inputVector, unsigned int num_points){
16
unsigned int number = 0;
18
const unsigned int quarterPoints = num_points / 4;
20
const double* inputVectorPtr = (const double*)inputVector;
21
float* outputVectorPtr = outputVector;
23
__m128d inputVal1, inputVal2;
25
for(;number < quarterPoints; number++){
26
inputVal1 = _mm_loadu_pd(inputVectorPtr); inputVectorPtr += 2;
27
inputVal2 = _mm_loadu_pd(inputVectorPtr); inputVectorPtr += 2;
29
ret = _mm_cvtpd_ps(inputVal1);
30
ret2 = _mm_cvtpd_ps(inputVal2);
32
ret = _mm_movelh_ps(ret, ret2);
34
_mm_storeu_ps(outputVectorPtr, ret);
38
number = quarterPoints * 4;
39
for(; number < num_points; number++){
40
outputVector[number] = (float)(inputVector[number]);
43
#endif /* LV_HAVE_SSE2 */
46
#ifdef LV_HAVE_GENERIC
48
\brief Converts the double values into float values
49
\param dVector The converted float vector values
50
\param fVector The double vector values to be converted
51
\param num_points The number of points in the two vectors to be converted
53
static inline void volk_64f_convert_32f_u_generic(float* outputVector, const double* inputVector, unsigned int num_points){
54
float* outputVectorPtr = outputVector;
55
const double* inputVectorPtr = inputVector;
56
unsigned int number = 0;
58
for(number = 0; number < num_points; number++){
59
*outputVectorPtr++ = ((float)(*inputVectorPtr++));
62
#endif /* LV_HAVE_GENERIC */
67
#endif /* INCLUDED_volk_64f_convert_32f_u_H */