diff options
author | Tom Rondeau <trondeau@vt.edu> | 2012-03-09 10:52:06 -0500 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2012-03-15 17:25:33 -0400 |
commit | 313573dbf02749bc48fd48072f04df08374f2a54 (patch) | |
tree | 80b62daca23cb9f9b8fc504cf08296171c3ed52d /volk | |
parent | 17adb7016fd6618b729e344964b20a09e6c633b5 (diff) |
volk: makes the float-to-int conversion consistent and fixes an overflow bug on 32-bit machines.
Not currently used in GNU Radio, so no change in behavior there.
Diffstat (limited to 'volk')
-rw-r--r-- | volk/include/volk/volk_32f_s32f_convert_32i_a.h | 4 | ||||
-rw-r--r-- | volk/include/volk/volk_32f_s32f_convert_32i_u.h | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/volk/include/volk/volk_32f_s32f_convert_32i_a.h b/volk/include/volk/volk_32f_s32f_convert_32i_a.h index 8f2fc791e4..15fa282fba 100644 --- a/volk/include/volk/volk_32f_s32f_convert_32i_a.h +++ b/volk/include/volk/volk_32f_s32f_convert_32i_a.h @@ -22,7 +22,7 @@ static inline void volk_32f_s32f_convert_32i_a_avx(int32_t* outputVector, const const float* inputVectorPtr = (const float*)inputVector; int32_t* outputVectorPtr = outputVector; - float min_val = -2147483648; + float min_val = -2147483647; float max_val = 2147483647; float r; @@ -71,7 +71,7 @@ static inline void volk_32f_s32f_convert_32i_a_sse2(int32_t* outputVector, const const float* inputVectorPtr = (const float*)inputVector; int32_t* outputVectorPtr = outputVector; - float min_val = -2147483648; + float min_val = -2147483647; float max_val = 2147483647; float r; diff --git a/volk/include/volk/volk_32f_s32f_convert_32i_u.h b/volk/include/volk/volk_32f_s32f_convert_32i_u.h index d8493454bd..d203546c62 100644 --- a/volk/include/volk/volk_32f_s32f_convert_32i_u.h +++ b/volk/include/volk/volk_32f_s32f_convert_32i_u.h @@ -22,10 +22,8 @@ static inline void volk_32f_s32f_convert_32i_u_sse2(int32_t* outputVector, const const float* inputVectorPtr = (const float*)inputVector; int32_t* outputVectorPtr = outputVector; - //float min_val = -2147483647; - //float max_val = 2147483647; - float min_val = -2146400000; - float max_val = 2146400000; + float min_val = -2147483647; + float max_val = 2147483647; float r; __m128 vScalar = _mm_set_ps1(scalar); |