aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer_sse41.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/mixer_sse41.c')
-rw-r--r--Alc/mixer_sse41.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/Alc/mixer_sse41.c b/Alc/mixer_sse41.c
index 958fecec..db89abfa 100644
--- a/Alc/mixer_sse41.c
+++ b/Alc/mixer_sse41.c
@@ -28,27 +28,6 @@
#include "mixer_defs.h"
-static inline void InitiatePositionArrays(ALuint frac, ALuint increment,
- ALuint *frac_arr, ALuint *pos_arr)
-{
- ALuint frac_tmp;
-
- pos_arr[0] = 0;
- frac_arr[0] = frac;
-
- frac_tmp = frac_arr[0] + increment;
- pos_arr[1] = pos_arr[0] + (frac_tmp>>FRACTIONBITS);
- frac_arr[1] = frac_tmp & FRACTIONMASK;
-
- frac_tmp = frac_arr[1] + increment;
- pos_arr[2] = pos_arr[1] + (frac_tmp>>FRACTIONBITS);
- frac_arr[2] = frac_tmp & FRACTIONMASK;
-
- frac_tmp = frac_arr[2] + increment;
- pos_arr[3] = pos_arr[2] + (frac_tmp>>FRACTIONBITS);
- frac_arr[3] = frac_tmp & FRACTIONMASK;
-}
-
const ALfloat *Resample_lerp32_SSE41(const ALfloat *src, ALuint frac, ALuint increment,
ALfloat *restrict dst, ALuint numsamples)
{
@@ -61,12 +40,12 @@ const ALfloat *Resample_lerp32_SSE41(const ALfloat *src, ALuint frac, ALuint inc
ALuint pos;
ALuint i;
- InitiatePositionArrays(frac, increment, frac_.i, pos_.i);
+ InitiatePositionArrays(frac, increment, frac_.i, pos_.i, 4);
frac4 = _mm_castps_si128(_mm_load_ps(frac_.f));
pos4 = _mm_castps_si128(_mm_load_ps(pos_.f));
- for(i = 0;i < numsamples-3;i += 4)
+ for(i = 0;numsamples-i > 3;i += 4)
{
const __m128 val1 = _mm_setr_ps(src[pos_.i[0]], src[pos_.i[1]], src[pos_.i[2]], src[pos_.i[3]]);
const __m128 val2 = _mm_setr_ps(src[pos_.i[0]+1], src[pos_.i[1]+1], src[pos_.i[2]+1], src[pos_.i[3]+1]);