Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert 32f->32i: fix compiler warnings about loss of int precision #665

Merged
merged 1 commit into from
Oct 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions kernels/volk/volk_32f_s32f_convert_32i.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static inline void volk_32f_s32f_convert_32i_u_avx(int32_t* outputVector,
int32_t* outputVectorPtr = outputVector;

float min_val = INT_MIN;
float max_val = INT_MAX;
float max_val = (uint32_t)INT_MAX + 1;
float r;

__m256 vScalar = _mm256_set1_ps(scalar);
Expand Down Expand Up @@ -127,7 +127,7 @@ static inline void volk_32f_s32f_convert_32i_u_sse2(int32_t* outputVector,
int32_t* outputVectorPtr = outputVector;

float min_val = INT_MIN;
float max_val = INT_MAX;
float max_val = (uint32_t)INT_MAX + 1;
float r;

__m128 vScalar = _mm_set_ps1(scalar);
Expand Down Expand Up @@ -178,7 +178,7 @@ static inline void volk_32f_s32f_convert_32i_u_sse(int32_t* outputVector,
int32_t* outputVectorPtr = outputVector;

float min_val = INT_MIN;
float max_val = INT_MAX;
float max_val = (uint32_t)INT_MAX + 1;
float r;

__m128 vScalar = _mm_set_ps1(scalar);
Expand Down Expand Up @@ -225,7 +225,7 @@ static inline void volk_32f_s32f_convert_32i_generic(int32_t* outputVector,
int32_t* outputVectorPtr = outputVector;
const float* inputVectorPtr = inputVector;
const float min_val = (float)INT_MIN;
const float max_val = (float)INT_MAX;
const float max_val = (float)((uint32_t)INT_MAX + 1);

for (unsigned int number = 0; number < num_points; number++) {
const float r = *inputVectorPtr++ * scalar;
Expand Down Expand Up @@ -267,7 +267,7 @@ static inline void volk_32f_s32f_convert_32i_a_avx(int32_t* outputVector,
int32_t* outputVectorPtr = outputVector;

float min_val = INT_MIN;
float max_val = INT_MAX;
float max_val = (uint32_t)INT_MAX + 1;
float r;

__m256 vScalar = _mm256_set1_ps(scalar);
Expand Down Expand Up @@ -318,7 +318,7 @@ static inline void volk_32f_s32f_convert_32i_a_sse2(int32_t* outputVector,
int32_t* outputVectorPtr = outputVector;

float min_val = INT_MIN;
float max_val = INT_MAX;
float max_val = (uint32_t)INT_MAX + 1;
float r;

__m128 vScalar = _mm_set_ps1(scalar);
Expand Down Expand Up @@ -369,7 +369,7 @@ static inline void volk_32f_s32f_convert_32i_a_sse(int32_t* outputVector,
int32_t* outputVectorPtr = outputVector;

float min_val = INT_MIN;
float max_val = INT_MAX;
float max_val = (uint32_t)INT_MAX + 1;
float r;

__m128 vScalar = _mm_set_ps1(scalar);
Expand Down
Loading