diff options
author | Chris Robinson <[email protected]> | 2023-02-10 02:24:59 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-02-10 02:24:59 -0800 |
commit | ca419e2966f43ccec5a023afc206972ddbf0a137 (patch) | |
tree | 939d9a2502d7c32a32513a141ada46ee518f6493 /core | |
parent | eb5e48f133de94e706f67c7d5388e5c45b43f338 (diff) |
Assume 'frac' is less than 1
Diffstat (limited to 'core')
-rw-r--r-- | core/mixer/mixer_c.cpp | 1 | ||||
-rw-r--r-- | core/mixer/mixer_neon.cpp | 6 | ||||
-rw-r--r-- | core/mixer/mixer_sse.cpp | 4 | ||||
-rw-r--r-- | core/mixer/mixer_sse2.cpp | 2 | ||||
-rw-r--r-- | core/mixer/mixer_sse41.cpp | 2 |
5 files changed, 15 insertions, 0 deletions
diff --git a/core/mixer/mixer_c.cpp b/core/mixer/mixer_c.cpp index dc5045a8..88524368 100644 --- a/core/mixer/mixer_c.cpp +++ b/core/mixer/mixer_c.cpp @@ -91,6 +91,7 @@ float *DoResample(const InterpState *state, float *RESTRICT src, uint frac, uint const al::span<float> dst) { const InterpState istate{*state}; + ASSUME(frac < MixerFracOne); for(float &out : dst) { out = Sampler(istate, src, frac); diff --git a/core/mixer/mixer_neon.cpp b/core/mixer/mixer_neon.cpp index 3519a92f..96cdfb29 100644 --- a/core/mixer/mixer_neon.cpp +++ b/core/mixer/mixer_neon.cpp @@ -141,6 +141,8 @@ template<> float *Resample_<LerpTag,NEONTag>(const InterpState*, float *RESTRICT src, uint frac, uint increment, const al::span<float> dst) { + ASSUME(frac < MixerFracOne); + const int32x4_t increment4 = vdupq_n_s32(static_cast<int>(increment*4)); const float32x4_t fracOne4 = vdupq_n_f32(1.0f/MixerFracOne); const int32x4_t fracMask4 = vdupq_n_s32(MixerFracMask); @@ -194,6 +196,8 @@ template<> float *Resample_<CubicTag,NEONTag>(const InterpState *state, float *RESTRICT src, uint frac, uint increment, const al::span<float> dst) { + ASSUME(frac < MixerFracOne); + const CubicCoefficients *RESTRICT filter = al::assume_aligned<16>(state->cubic.filter); src -= 1; @@ -229,6 +233,7 @@ float *Resample_<BSincTag,NEONTag>(const InterpState *state, float *RESTRICT src const float32x4_t sf4{vdupq_n_f32(state->bsinc.sf)}; const size_t m{state->bsinc.m}; ASSUME(m > 0); + ASSUME(frac < MixerFracOne); src -= state->bsinc.l; for(float &out_sample : dst) @@ -275,6 +280,7 @@ float *Resample_<FastBSincTag,NEONTag>(const InterpState *state, float *RESTRICT const float *const filter{state->bsinc.filter}; const size_t m{state->bsinc.m}; ASSUME(m > 0); + ASSUME(frac < MixerFracOne); src -= state->bsinc.l; for(float &out_sample : dst) diff --git a/core/mixer/mixer_sse.cpp b/core/mixer/mixer_sse.cpp index e011dfcd..6bbb3d3c 100644 --- a/core/mixer/mixer_sse.cpp +++ b/core/mixer/mixer_sse.cpp @@ -157,6 +157,8 @@ template<> float *Resample_<CubicTag,SSETag>(const InterpState *state, float *RESTRICT src, uint frac, uint increment, const al::span<float> dst) { + ASSUME(frac < MixerFracOne); + const CubicCoefficients *RESTRICT filter = al::assume_aligned<16>(state->cubic.filter); src -= 1; @@ -193,6 +195,7 @@ float *Resample_<BSincTag,SSETag>(const InterpState *state, float *RESTRICT src, const __m128 sf4{_mm_set1_ps(state->bsinc.sf)}; const size_t m{state->bsinc.m}; ASSUME(m > 0); + ASSUME(frac < MixerFracOne); src -= state->bsinc.l; for(float &out_sample : dst) @@ -240,6 +243,7 @@ float *Resample_<FastBSincTag,SSETag>(const InterpState *state, float *RESTRICT const float *const filter{state->bsinc.filter}; const size_t m{state->bsinc.m}; ASSUME(m > 0); + ASSUME(frac < MixerFracOne); src -= state->bsinc.l; for(float &out_sample : dst) diff --git a/core/mixer/mixer_sse2.cpp b/core/mixer/mixer_sse2.cpp index 2c0adb8a..923924db 100644 --- a/core/mixer/mixer_sse2.cpp +++ b/core/mixer/mixer_sse2.cpp @@ -38,6 +38,8 @@ template<> float *Resample_<LerpTag,SSE2Tag>(const InterpState*, float *RESTRICT src, uint frac, uint increment, const al::span<float> dst) { + ASSUME(frac < MixerFracOne); + const __m128i increment4{_mm_set1_epi32(static_cast<int>(increment*4))}; const __m128 fracOne4{_mm_set1_ps(1.0f/MixerFracOne)}; const __m128i fracMask4{_mm_set1_epi32(MixerFracMask)}; diff --git a/core/mixer/mixer_sse41.cpp b/core/mixer/mixer_sse41.cpp index cfedfd65..23994735 100644 --- a/core/mixer/mixer_sse41.cpp +++ b/core/mixer/mixer_sse41.cpp @@ -39,6 +39,8 @@ template<> float *Resample_<LerpTag,SSE4Tag>(const InterpState*, float *RESTRICT src, uint frac, uint increment, const al::span<float> dst) { + ASSUME(frac < MixerFracOne); + const __m128i increment4{_mm_set1_epi32(static_cast<int>(increment*4))}; const __m128 fracOne4{_mm_set1_ps(1.0f/MixerFracOne)}; const __m128i fracMask4{_mm_set1_epi32(MixerFracMask)}; |