From 714556beed6b5b73b94b7568fd179c66c95cec61 Mon Sep 17 00:00:00 2001 From: Nicholas Frechette Date: Wed, 10 Jul 2024 15:41:09 -0400 Subject: [PATCH] fix(core): ensure SSE2 usage with x86 when enabled --- includes/acl/core/impl/interpolation_utils.impl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/acl/core/impl/interpolation_utils.impl.h b/includes/acl/core/impl/interpolation_utils.impl.h index 9352b960..c026852f 100644 --- a/includes/acl/core/impl/interpolation_utils.impl.h +++ b/includes/acl/core/impl/interpolation_utils.impl.h @@ -164,9 +164,9 @@ namespace acl const uint32_t last_sample_index = num_samples - 1; - float sample_index = sample_time * sample_rate; + rtm::scalarf sample_index = rtm::scalar_mul(rtm::scalar_set(sample_time), rtm::scalar_set(sample_rate)); - uint32_t sample_index0 = static_cast(sample_index); + uint32_t sample_index0 = static_cast(rtm::scalar_cast(sample_index)); const uint32_t next_sample_index = sample_index0 + 1; uint32_t sample_index1; @@ -181,7 +181,7 @@ namespace acl { // We are sampling our repeating first sample with full weight ACL_ASSERT(rtm::scalar_near_equal(sample_time, calculate_finite_duration(num_samples + 1, sample_rate), 0.00001F), "Sampling our repeating first sample with full weight"); - sample_index = 0.0F; + sample_index = rtm::scalar_set(0.0F); sample_index0 = 0; sample_index1 = 0; } @@ -192,7 +192,7 @@ namespace acl } } - const float interpolation_alpha = sample_index - float(sample_index0); + const float interpolation_alpha = rtm::scalar_cast(rtm::scalar_sub(sample_index, rtm::scalar_set(float(sample_index0)))); ACL_ASSERT(interpolation_alpha >= 0.0F && interpolation_alpha <= 1.0F, "Invalid interpolation alpha: 0.0 <= %f <= 1.0", interpolation_alpha); out_sample_index0 = sample_index0;