1 #ifndef INCLUDED_volk_32i_s32f_convert_32f_u_H
2 #define INCLUDED_volk_32i_s32f_convert_32f_u_H
18 static inline void volk_32i_s32f_convert_32f_u_sse2(
float* outputVector,
const int32_t* inputVector,
const float scalar,
unsigned int num_points){
19 unsigned int number = 0;
20 const unsigned int quarterPoints = num_points / 4;
22 float* outputVectorPtr = outputVector;
23 const float iScalar = 1.0 / scalar;
24 __m128 invScalar = _mm_set_ps1(iScalar);
29 for(;number < quarterPoints; number++){
32 inputVal = _mm_loadu_si128((__m128i*)inputPtr);
34 ret = _mm_cvtepi32_ps(inputVal);
35 ret = _mm_mul_ps(ret, invScalar);
37 _mm_storeu_ps(outputVectorPtr, ret);
43 number = quarterPoints * 4;
44 for(; number < num_points; number++){
45 outputVector[number] =((float)(inputVector[number])) * iScalar;
51 #ifdef LV_HAVE_GENERIC
60 static inline void volk_32i_s32f_convert_32f_generic(
float* outputVector,
const int32_t* inputVector,
const float scalar,
unsigned int num_points){
61 float* outputVectorPtr = outputVector;
62 const int32_t* inputVectorPtr = inputVector;
63 unsigned int number = 0;
64 const float iScalar = 1.0 / scalar;
66 for(number = 0; number < num_points; number++){
67 *outputVectorPtr++ = ((float)(*inputVectorPtr++)) * iScalar;
76 #ifndef INCLUDED_volk_32i_s32f_convert_32f_a_H
77 #define INCLUDED_volk_32i_s32f_convert_32f_a_H
83 #include <emmintrin.h>
92 static inline void volk_32i_s32f_convert_32f_a_sse2(
float* outputVector,
const int32_t* inputVector,
const float scalar,
unsigned int num_points){
93 unsigned int number = 0;
94 const unsigned int quarterPoints = num_points / 4;
96 float* outputVectorPtr = outputVector;
97 const float iScalar = 1.0 / scalar;
98 __m128 invScalar = _mm_set_ps1(iScalar);
103 for(;number < quarterPoints; number++){
106 inputVal = _mm_load_si128((__m128i*)inputPtr);
108 ret = _mm_cvtepi32_ps(inputVal);
109 ret = _mm_mul_ps(ret, invScalar);
111 _mm_store_ps(outputVectorPtr, ret);
113 outputVectorPtr += 4;
117 number = quarterPoints * 4;
118 for(; number < num_points; number++){
119 outputVector[number] =((float)(inputVector[number])) * iScalar;
125 #ifdef LV_HAVE_GENERIC
133 static inline void volk_32i_s32f_convert_32f_a_generic(
float* outputVector,
const int32_t* inputVector,
const float scalar,
unsigned int num_points){
134 float* outputVectorPtr = outputVector;
135 const int32_t* inputVectorPtr = inputVector;
136 unsigned int number = 0;
137 const float iScalar = 1.0 / scalar;
139 for(number = 0; number < num_points; number++){
140 *outputVectorPtr++ = ((float)(*inputVectorPtr++)) * iScalar;
signed int int32_t
Definition: stdint.h:77