aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-10-24 17:37:53 -0700
committerChris Robinson <[email protected]>2015-10-24 17:37:53 -0700
commitfc03a955e9dd58e11cb3f165423e1629d5f07935 (patch)
tree6a97432ed3ca2d2a04aa359e117bb9e7fa7c5aeb
parent8d89c8be9e91f87425f329fa046f13658db52b94 (diff)
Fix the SSE4.1 resamplers
Apparently the given _mm_extract_epi32 index obeys memory order, rather than component order.
-rw-r--r--Alc/mixer_sse41.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/Alc/mixer_sse41.c b/Alc/mixer_sse41.c
index 85ec8705..4b347d32 100644
--- a/Alc/mixer_sse41.c
+++ b/Alc/mixer_sse41.c
@@ -61,10 +61,10 @@ const ALfloat *Resample_lerp32_SSE41(const ALfloat *src, ALuint frac, ALuint inc
pos4 = _mm_add_epi32(pos4, _mm_srli_epi32(frac4, FRACTIONBITS));
frac4 = _mm_and_si128(frac4, fracMask4);
- pos_.i[0] = _mm_extract_epi32(pos4, 3);
- pos_.i[1] = _mm_extract_epi32(pos4, 2);
- pos_.i[2] = _mm_extract_epi32(pos4, 1);
- pos_.i[3] = _mm_extract_epi32(pos4, 0);
+ pos_.i[0] = _mm_extract_epi32(pos4, 0);
+ pos_.i[1] = _mm_extract_epi32(pos4, 1);
+ pos_.i[2] = _mm_extract_epi32(pos4, 2);
+ pos_.i[3] = _mm_extract_epi32(pos4, 3);
}
pos = pos_.i[3];
@@ -124,14 +124,14 @@ const ALfloat *Resample_fir4_32_SSE41(const ALfloat *src, ALuint frac, ALuint in
pos4 = _mm_add_epi32(pos4, _mm_srli_epi32(frac4, FRACTIONBITS));
frac4 = _mm_and_si128(frac4, fracMask4);
- pos_.i[0] = _mm_extract_epi32(pos4, 3);
- pos_.i[1] = _mm_extract_epi32(pos4, 2);
- pos_.i[2] = _mm_extract_epi32(pos4, 1);
- pos_.i[3] = _mm_extract_epi32(pos4, 0);
- frac_.i[0] = _mm_extract_epi32(frac4, 3);
- frac_.i[1] = _mm_extract_epi32(frac4, 2);
- frac_.i[2] = _mm_extract_epi32(frac4, 1);
- frac_.i[3] = _mm_extract_epi32(frac4, 0);
+ pos_.i[0] = _mm_extract_epi32(pos4, 0);
+ pos_.i[1] = _mm_extract_epi32(pos4, 1);
+ pos_.i[2] = _mm_extract_epi32(pos4, 2);
+ pos_.i[3] = _mm_extract_epi32(pos4, 3);
+ frac_.i[0] = _mm_extract_epi32(frac4, 0);
+ frac_.i[1] = _mm_extract_epi32(frac4, 1);
+ frac_.i[2] = _mm_extract_epi32(frac4, 2);
+ frac_.i[3] = _mm_extract_epi32(frac4, 3);
}
pos = pos_.i[3];
@@ -195,14 +195,14 @@ const ALfloat *Resample_fir8_32_SSE41(const ALfloat *src, ALuint frac, ALuint in
pos4 = _mm_add_epi32(pos4, _mm_srli_epi32(frac4, FRACTIONBITS));
frac4 = _mm_and_si128(frac4, fracMask4);
- pos_.i[0] = _mm_extract_epi32(pos4, 3);
- pos_.i[1] = _mm_extract_epi32(pos4, 2);
- pos_.i[2] = _mm_extract_epi32(pos4, 1);
- pos_.i[3] = _mm_extract_epi32(pos4, 0);
- frac_.i[0] = _mm_extract_epi32(frac4, 3);
- frac_.i[1] = _mm_extract_epi32(frac4, 2);
- frac_.i[2] = _mm_extract_epi32(frac4, 1);
- frac_.i[3] = _mm_extract_epi32(frac4, 0);
+ pos_.i[0] = _mm_extract_epi32(pos4, 0);
+ pos_.i[1] = _mm_extract_epi32(pos4, 1);
+ pos_.i[2] = _mm_extract_epi32(pos4, 2);
+ pos_.i[3] = _mm_extract_epi32(pos4, 3);
+ frac_.i[0] = _mm_extract_epi32(frac4, 0);
+ frac_.i[1] = _mm_extract_epi32(frac4, 1);
+ frac_.i[2] = _mm_extract_epi32(frac4, 2);
+ frac_.i[3] = _mm_extract_epi32(frac4, 3);
}
pos = pos_.i[3];