From 221138a342a078881ace282de43910940b9e09e8 Mon Sep 17 00:00:00 2001 From: Clayton Smith Date: Sun, 22 Oct 2023 08:59:50 -0400 Subject: [PATCH] Always initialize returnValue Signed-off-by: Clayton Smith --- kernels/volk/volk_16i_32fc_dot_prod_32fc.h | 24 ++++++++-------- kernels/volk/volk_32fc_32f_dot_prod_32fc.h | 32 +++++++++++----------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/kernels/volk/volk_16i_32fc_dot_prod_32fc.h b/kernels/volk/volk_16i_32fc_dot_prod_32fc.h index 6dc672bc..8949785f 100644 --- a/kernels/volk/volk_16i_32fc_dot_prod_32fc.h +++ b/kernels/volk/volk_16i_32fc_dot_prod_32fc.h @@ -147,7 +147,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_u_sse(lv_32fc_t* result, unsigned int number = 0; const unsigned int eighthPoints = num_points / 8; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const short* aPtr = input; const float* bPtr = (float*)taps; @@ -206,7 +206,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_u_sse(lv_32fc_t* result, _mm_store_ps(dotProductVector, dotProdVal0); // Store the results back into the dot product vector - returnValue = lv_cmake(dotProductVector[0], dotProductVector[1]); + returnValue += lv_cmake(dotProductVector[0], dotProductVector[1]); returnValue += lv_cmake(dotProductVector[2], dotProductVector[3]); number = eighthPoints * 8; @@ -233,7 +233,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_u_avx2_fma(lv_32fc_t* result, unsigned int number = 0; const unsigned int sixteenthPoints = num_points / 16; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const short* aPtr = input; const float* bPtr = (float*)taps; @@ -291,7 +291,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_u_avx2_fma(lv_32fc_t* result, _mm256_store_ps(dotProductVector, dotProdVal0); // Store the results back into the dot product vector - returnValue = lv_cmake(dotProductVector[0], dotProductVector[1]); + returnValue += lv_cmake(dotProductVector[0], dotProductVector[1]); returnValue += lv_cmake(dotProductVector[2], dotProductVector[3]); returnValue += lv_cmake(dotProductVector[4], dotProductVector[5]); returnValue += lv_cmake(dotProductVector[6], dotProductVector[7]); @@ -320,7 +320,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_u_avx2(lv_32fc_t* result, unsigned int number = 0; const unsigned int sixteenthPoints = num_points / 16; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const short* aPtr = input; const float* bPtr = (float*)taps; @@ -384,7 +384,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_u_avx2(lv_32fc_t* result, _mm256_store_ps(dotProductVector, dotProdVal0); // Store the results back into the dot product vector - returnValue = lv_cmake(dotProductVector[0], dotProductVector[1]); + returnValue += lv_cmake(dotProductVector[0], dotProductVector[1]); returnValue += lv_cmake(dotProductVector[2], dotProductVector[3]); returnValue += lv_cmake(dotProductVector[4], dotProductVector[5]); returnValue += lv_cmake(dotProductVector[6], dotProductVector[7]); @@ -414,7 +414,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_a_sse(lv_32fc_t* result, unsigned int number = 0; const unsigned int eighthPoints = num_points / 8; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const short* aPtr = input; const float* bPtr = (float*)taps; @@ -473,7 +473,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_a_sse(lv_32fc_t* result, _mm_store_ps(dotProductVector, dotProdVal0); // Store the results back into the dot product vector - returnValue = lv_cmake(dotProductVector[0], dotProductVector[1]); + returnValue += lv_cmake(dotProductVector[0], dotProductVector[1]); returnValue += lv_cmake(dotProductVector[2], dotProductVector[3]); number = eighthPoints * 8; @@ -499,7 +499,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_a_avx2(lv_32fc_t* result, unsigned int number = 0; const unsigned int sixteenthPoints = num_points / 16; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const short* aPtr = input; const float* bPtr = (float*)taps; @@ -563,7 +563,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_a_avx2(lv_32fc_t* result, _mm256_store_ps(dotProductVector, dotProdVal0); // Store the results back into the dot product vector - returnValue = lv_cmake(dotProductVector[0], dotProductVector[1]); + returnValue += lv_cmake(dotProductVector[0], dotProductVector[1]); returnValue += lv_cmake(dotProductVector[2], dotProductVector[3]); returnValue += lv_cmake(dotProductVector[4], dotProductVector[5]); returnValue += lv_cmake(dotProductVector[6], dotProductVector[7]); @@ -592,7 +592,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_a_avx2_fma(lv_32fc_t* result, unsigned int number = 0; const unsigned int sixteenthPoints = num_points / 16; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const short* aPtr = input; const float* bPtr = (float*)taps; @@ -650,7 +650,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_a_avx2_fma(lv_32fc_t* result, _mm256_store_ps(dotProductVector, dotProdVal0); // Store the results back into the dot product vector - returnValue = lv_cmake(dotProductVector[0], dotProductVector[1]); + returnValue += lv_cmake(dotProductVector[0], dotProductVector[1]); returnValue += lv_cmake(dotProductVector[2], dotProductVector[3]); returnValue += lv_cmake(dotProductVector[4], dotProductVector[5]); returnValue += lv_cmake(dotProductVector[6], dotProductVector[7]); diff --git a/kernels/volk/volk_32fc_32f_dot_prod_32fc.h b/kernels/volk/volk_32fc_32f_dot_prod_32fc.h index a59a92c8..363bf657 100644 --- a/kernels/volk/volk_32fc_32f_dot_prod_32fc.h +++ b/kernels/volk/volk_32fc_32f_dot_prod_32fc.h @@ -90,7 +90,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_a_avx2_fma(lv_32fc_t* result, unsigned int number = 0; const unsigned int sixteenthPoints = num_points / 16; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const float* aPtr = (float*)input; const float* bPtr = taps; @@ -141,7 +141,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_a_avx2_fma(lv_32fc_t* result, _mm256_store_ps(dotProductVector, dotProdVal0); // Store the results back into the dot product vector - returnValue = lv_cmake(dotProductVector[0], dotProductVector[1]); + returnValue += lv_cmake(dotProductVector[0], dotProductVector[1]); returnValue += lv_cmake(dotProductVector[2], dotProductVector[3]); returnValue += lv_cmake(dotProductVector[4], dotProductVector[5]); returnValue += lv_cmake(dotProductVector[6], dotProductVector[7]); @@ -171,7 +171,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_a_avx(lv_32fc_t* result, unsigned int number = 0; const unsigned int sixteenthPoints = num_points / 16; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const float* aPtr = (float*)input; const float* bPtr = taps; @@ -228,7 +228,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_a_avx(lv_32fc_t* result, _mm256_store_ps(dotProductVector, dotProdVal0); // Store the results back into the dot product vector - returnValue = lv_cmake(dotProductVector[0], dotProductVector[1]); + returnValue += lv_cmake(dotProductVector[0], dotProductVector[1]); returnValue += lv_cmake(dotProductVector[2], dotProductVector[3]); returnValue += lv_cmake(dotProductVector[4], dotProductVector[5]); returnValue += lv_cmake(dotProductVector[6], dotProductVector[7]); @@ -258,7 +258,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_a_sse(lv_32fc_t* result, unsigned int number = 0; const unsigned int eighthPoints = num_points / 8; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const float* aPtr = (float*)input; const float* bPtr = taps; @@ -311,7 +311,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_a_sse(lv_32fc_t* result, _mm_store_ps(dotProductVector, dotProdVal0); // Store the results back into the dot product vector - returnValue = lv_cmake(dotProductVector[0], dotProductVector[1]); + returnValue += lv_cmake(dotProductVector[0], dotProductVector[1]); returnValue += lv_cmake(dotProductVector[2], dotProductVector[3]); number = eighthPoints * 8; @@ -339,7 +339,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_u_avx2_fma(lv_32fc_t* result, unsigned int number = 0; const unsigned int sixteenthPoints = num_points / 16; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const float* aPtr = (float*)input; const float* bPtr = taps; @@ -390,7 +390,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_u_avx2_fma(lv_32fc_t* result, _mm256_store_ps(dotProductVector, dotProdVal0); // Store the results back into the dot product vector - returnValue = lv_cmake(dotProductVector[0], dotProductVector[1]); + returnValue += lv_cmake(dotProductVector[0], dotProductVector[1]); returnValue += lv_cmake(dotProductVector[2], dotProductVector[3]); returnValue += lv_cmake(dotProductVector[4], dotProductVector[5]); returnValue += lv_cmake(dotProductVector[6], dotProductVector[7]); @@ -420,7 +420,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_u_avx(lv_32fc_t* result, unsigned int number = 0; const unsigned int sixteenthPoints = num_points / 16; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const float* aPtr = (float*)input; const float* bPtr = taps; @@ -477,7 +477,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_u_avx(lv_32fc_t* result, _mm256_store_ps(dotProductVector, dotProdVal0); // Store the results back into the dot product vector - returnValue = lv_cmake(dotProductVector[0], dotProductVector[1]); + returnValue += lv_cmake(dotProductVector[0], dotProductVector[1]); returnValue += lv_cmake(dotProductVector[2], dotProductVector[3]); returnValue += lv_cmake(dotProductVector[4], dotProductVector[5]); returnValue += lv_cmake(dotProductVector[6], dotProductVector[7]); @@ -506,7 +506,7 @@ volk_32fc_32f_dot_prod_32fc_neon_unroll(lv_32fc_t* __restrict result, unsigned int number; const unsigned int quarterPoints = num_points / 8; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const float* inputPtr = (float*)input; const float* tapsPtr = taps; float zero[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; @@ -559,7 +559,7 @@ volk_32fc_32f_dot_prod_32fc_neon_unroll(lv_32fc_t* __restrict result, // store results back to a complex (array of 2 floats) vst1q_f32(accVector_real, real_accumulator0); vst1q_f32(accVector_imag, imag_accumulator0); - returnValue = lv_cmake( + returnValue += lv_cmake( accVector_real[0] + accVector_real[1] + accVector_real[2] + accVector_real[3], accVector_imag[0] + accVector_imag[1] + accVector_imag[2] + accVector_imag[3]); @@ -587,7 +587,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_a_neon(lv_32fc_t* __restrict resu unsigned int number; const unsigned int quarterPoints = num_points / 4; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const float* inputPtr = (float*)input; const float* tapsPtr = taps; float zero[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; @@ -627,7 +627,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_a_neon(lv_32fc_t* __restrict resu // store results back to a complex (array of 2 floats) vst1q_f32(accVector_real, real_accumulator); vst1q_f32(accVector_imag, imag_accumulator); - returnValue = lv_cmake( + returnValue += lv_cmake( accVector_real[0] + accVector_real[1] + accVector_real[2] + accVector_real[3], accVector_imag[0] + accVector_imag[1] + accVector_imag[2] + accVector_imag[3]); @@ -675,7 +675,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_u_sse(lv_32fc_t* result, unsigned int number = 0; const unsigned int eighthPoints = num_points / 8; - lv_32fc_t returnValue; + lv_32fc_t returnValue = lv_cmake(0.0f, 0.0f); const float* aPtr = (float*)input; const float* bPtr = taps; @@ -728,7 +728,7 @@ static inline void volk_32fc_32f_dot_prod_32fc_u_sse(lv_32fc_t* result, _mm_store_ps(dotProductVector, dotProdVal0); // Store the results back into the dot product vector - returnValue = lv_cmake(dotProductVector[0], dotProductVector[1]); + returnValue += lv_cmake(dotProductVector[0], dotProductVector[1]); returnValue += lv_cmake(dotProductVector[2], dotProductVector[3]); number = eighthPoints * 8;