diff options
author | Chris Robinson <[email protected]> | 2015-10-11 05:31:14 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2015-10-11 05:31:14 -0700 |
commit | 75d8e5989f737326b216b46e0a5184501fc8315f (patch) | |
tree | be50eda4ead899aea6dbae8d5ae0ba66b13bb5c9 | |
parent | 0149dded3484633e4c7afe9e136ef1c232cbd623 (diff) |
Slightly improve the FIR4 SSE resamplers
-rw-r--r-- | Alc/mixer_sse2.c | 6 | ||||
-rw-r--r-- | Alc/mixer_sse41.c | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/Alc/mixer_sse2.c b/Alc/mixer_sse2.c index a6f2bb4e..1321f5f2 100644 --- a/Alc/mixer_sse2.c +++ b/Alc/mixer_sse2.c @@ -111,9 +111,9 @@ const ALfloat *Resample_fir4_32_SSE2(const ALfloat *src, ALuint frac, ALuint inc k2 = _mm_mul_ps(k2, val2); k3 = _mm_mul_ps(k3, val3); _MM_TRANSPOSE4_PS(k0, k1, k2, k3); - out = _mm_add_ps(k0, k1); - out = _mm_add_ps(out, k2); - out = _mm_add_ps(out, k3); + k0 = _mm_add_ps(k0, k1); + k2 = _mm_add_ps(k2, k3); + out = _mm_add_ps(k0, k2); _mm_store_ps(&dst[i], out); diff --git a/Alc/mixer_sse41.c b/Alc/mixer_sse41.c index b9ef608a..90438e13 100644 --- a/Alc/mixer_sse41.c +++ b/Alc/mixer_sse41.c @@ -114,10 +114,9 @@ const ALfloat *Resample_fir4_32_SSE41(const ALfloat *src, ALuint frac, ALuint in k1 = _mm_mul_ps(k1, val1); k2 = _mm_mul_ps(k2, val2); k3 = _mm_mul_ps(k3, val3); - _MM_TRANSPOSE4_PS(k0, k1, k2, k3); - out = _mm_add_ps(k0, k1); - out = _mm_add_ps(out, k2); - out = _mm_add_ps(out, k3); + k0 = _mm_hadd_ps(k0, k1); + k2 = _mm_hadd_ps(k2, k3); + out = _mm_hadd_ps(k0, k2); _mm_store_ps(&dst[i], out); |