Skip to content

Commit

Permalink
Always initialize returnValue
Browse files Browse the repository at this point in the history
Signed-off-by: Clayton Smith <[email protected]>
  • Loading branch information
argilo committed Oct 22, 2023
1 parent 470f257 commit 56fba31
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
24 changes: 12 additions & 12 deletions kernels/volk/volk_16i_32fc_dot_prod_32fc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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]);
Expand Down
32 changes: 16 additions & 16 deletions kernels/volk/volk_32fc_32f_dot_prod_32fc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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 };
Expand Down Expand Up @@ -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]);

Expand Down Expand Up @@ -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 };
Expand Down Expand Up @@ -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]);

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 56fba31

Please sign in to comment.