aboutsummaryrefslogtreecommitdiffstats
path: root/alc/mixer/mixer_neon.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-05-02 20:27:05 -0700
committerChris Robinson <[email protected]>2020-05-02 20:27:05 -0700
commitb52fde7c0e57b4965e3b87d9cc2d98611064b7e5 (patch)
tree9824a0c08eec955b2dcc1d3475dd0a42399b345e /alc/mixer/mixer_neon.cpp
parentb051f2e33d0146df60332fdea04ed1c6138c9a70 (diff)
Simplify SIMD linear resampler loop count
Diffstat (limited to 'alc/mixer/mixer_neon.cpp')
-rw-r--r--alc/mixer/mixer_neon.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/alc/mixer/mixer_neon.cpp b/alc/mixer/mixer_neon.cpp
index 83388b68..2cf7e2e8 100644
--- a/alc/mixer/mixer_neon.cpp
+++ b/alc/mixer/mixer_neon.cpp
@@ -64,8 +64,7 @@ const float *Resample_<LerpTag,NEONTag>(const InterpState*, const float *RESTRIC
pos4 = vld1q_s32(reinterpret_cast<int*>(pos_));
auto dst_iter = dst.begin();
- const auto aligned_end = (dst.size()&~3u) + dst_iter;
- while(dst_iter != aligned_end)
+ for(size_t todo{dst.size()>>2};todo;--todo)
{
const int pos0{vgetq_lane_s32(pos4, 0)};
const int pos1{vgetq_lane_s32(pos4, 1)};
@@ -87,7 +86,7 @@ const float *Resample_<LerpTag,NEONTag>(const InterpState*, const float *RESTRIC
frac4 = vandq_s32(frac4, fracMask4);
}
- if(dst_iter != dst.end())
+ if(size_t todo{dst.size()&3})
{
src += static_cast<ALuint>(vgetq_lane_s32(pos4, 0));
frac = static_cast<ALuint>(vgetq_lane_s32(frac4, 0));
@@ -98,7 +97,7 @@ const float *Resample_<LerpTag,NEONTag>(const InterpState*, const float *RESTRIC
frac += increment;
src += frac>>FRACTIONBITS;
frac &= FRACTIONMASK;
- } while(dst_iter != dst.end());
+ } while(--todo);
}
return dst.data();
}