Skip to content

Commit

Permalink
Fixing up2 processing on Intel
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed May 17, 2024
1 parent 74c1bf7 commit 37e6a9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/processors/other/poly_octave/PolyOctave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void PolyOctave::processAudio (AudioBuffer<float>& buffer)
chowdsp::BufferMath::applyGainSmoothedBuffer (down1OutBuffer, downOctaveGain);

// "up1" processing
for (auto [ch, data_in, data_out] : chowdsp::buffer_iters::zip_channels (std::as_const (buffer), up1OutBuffer))
for (const auto& [ch, data_in, data_out] : chowdsp::buffer_iters::zip_channels (std::as_const (buffer), up1OutBuffer))
{
#if JUCE_INTEL
if (use_avx)
Expand All @@ -157,7 +157,7 @@ void PolyOctave::processAudio (AudioBuffer<float>& buffer)
chowdsp::BufferMath::applyGainSmoothedBuffer (up1OutBuffer, upOctaveGain);

// "up2" processing
for (auto [ch, data_in, data_out] : chowdsp::buffer_iters::zip_channels (std::as_const (buffer), up2OutBuffer))
for (const auto& [ch, data_in, data_out] : chowdsp::buffer_iters::zip_channels (std::as_const (buffer), up2OutBuffer))
{
#if JUCE_INTEL
if (use_avx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ void process (ComplexERBFilterBank<N>& filter_bank,
const auto greater_than_eps = _mm_cmpgt_ps (x_abs_sq, eps_sse);
const auto x_abs_sq_r = _mm_and_ps (greater_than_eps, _mm_rcp_ps (x_abs_sq));
const auto x_im_sq_x3 = _mm_add_ps (x_im_sq, _mm_add_ps (x_im_sq, x_im_sq));
buffer_out_simd[n] = _mm_add_ps (buffer_out_simd[n], _mm_mul_ps (_mm_sub_ps (x_re_sq, x_im_sq_x3), x_abs_sq_r));
buffer_out_simd[n] = _mm_add_ps (buffer_out_simd[n], _mm_mul_ps (_mm_sub_ps (x_re_sq, x_im_sq_x3), _mm_mul_ps (x_re, x_abs_sq_r)));
}
}

Expand Down Expand Up @@ -576,7 +576,7 @@ void process_avx ([[maybe_unused]] ComplexERBFilterBank<N>& filter_bank,
const auto greater_than_eps = _mm256_cmp_ps (x_abs_sq, eps_avx, _CMP_GT_OQ);
const auto x_abs_sq_r = _mm256_and_ps (greater_than_eps, _mm256_rcp_ps (x_abs_sq));
const auto x_im_sq_x3 = _mm256_add_ps (x_im_sq, _mm256_add_ps (x_im_sq, x_im_sq));
buffer_out_simd[n] = _mm256_add_ps (buffer_out_simd[n], _mm256_mul_ps (_mm256_sub_ps (x_re_sq, x_im_sq_x3), x_abs_sq_r));
buffer_out_simd[n] = _mm256_add_ps (buffer_out_simd[n], _mm256_mul_ps (_mm256_sub_ps (x_re_sq, x_im_sq_x3), _mm256_mul_ps (x_re, x_abs_sq_r)));
}
}

Expand Down

0 comments on commit 37e6a9c

Please sign in to comment.