summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-03-09 10:52:06 -0500
committerTom Rondeau <trondeau@vt.edu>2012-03-15 17:25:33 -0400
commit313573dbf02749bc48fd48072f04df08374f2a54 (patch)
tree80b62daca23cb9f9b8fc504cf08296171c3ed52d
parentcore: makes sure that the Fourier taps for the FFT filter are aligned. (diff)
downloadgnuradio-313573dbf02749bc48fd48072f04df08374f2a54.tar.xz
gnuradio-313573dbf02749bc48fd48072f04df08374f2a54.zip
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.
-rw-r--r--volk/include/volk/volk_32f_s32f_convert_32i_a.h4
-rw-r--r--volk/include/volk/volk_32f_s32f_convert_32i_u.h6
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 8f2fc791e..15fa282fb 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 d8493454b..d203546c6 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);