From 37e6a9c68dd5e61988efb0bd74528aa0bf86ba82 Mon Sep 17 00:00:00 2001 From: jatin Date: Fri, 17 May 2024 16:46:41 -0700 Subject: [PATCH] Fixing up2 processing on Intel --- src/processors/other/poly_octave/PolyOctave.cpp | 4 ++-- .../other/poly_octave/PolyOctaveV2FilterBankImpl.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/processors/other/poly_octave/PolyOctave.cpp b/src/processors/other/poly_octave/PolyOctave.cpp index 57f8062f..9afa0ee2 100644 --- a/src/processors/other/poly_octave/PolyOctave.cpp +++ b/src/processors/other/poly_octave/PolyOctave.cpp @@ -134,7 +134,7 @@ void PolyOctave::processAudio (AudioBuffer& 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) @@ -157,7 +157,7 @@ void PolyOctave::processAudio (AudioBuffer& 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) diff --git a/src/processors/other/poly_octave/PolyOctaveV2FilterBankImpl.cpp b/src/processors/other/poly_octave/PolyOctaveV2FilterBankImpl.cpp index 05c4715d..b54a136d 100644 --- a/src/processors/other/poly_octave/PolyOctaveV2FilterBankImpl.cpp +++ b/src/processors/other/poly_octave/PolyOctaveV2FilterBankImpl.cpp @@ -424,7 +424,7 @@ void process (ComplexERBFilterBank& 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))); } } @@ -576,7 +576,7 @@ void process_avx ([[maybe_unused]] ComplexERBFilterBank& 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))); } }