aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer_sse.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-02-13 07:36:49 -0800
committerChris Robinson <[email protected]>2017-02-13 07:36:49 -0800
commit841d0bb893e19dbe6f95bd80a3ac50997f9e8f0d (patch)
treef8c1f073a3597c5e7dd2586260263892b99f5904 /Alc/mixer_sse.c
parent65f9b2792c50ae730a9f16680f931a9884e2b02c (diff)
Porperly check for and use __builtin_assume_aligned
Diffstat (limited to 'Alc/mixer_sse.c')
-rw-r--r--Alc/mixer_sse.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/Alc/mixer_sse.c b/Alc/mixer_sse.c
index 25daf00b..8aeb8211 100644
--- a/Alc/mixer_sse.c
+++ b/Alc/mixer_sse.c
@@ -12,12 +12,6 @@
#include "mixer_defs.h"
-#ifdef __GNUC__
-#define ASSUME_ALIGNED(ptr, ...) __builtin_assume_aligned((ptr), __VA_ARGS__)
-#else
-#define ASSUME_ALIGNED(ptr, ...) (ptr)
-#endif
-
const ALfloat *Resample_bsinc32_SSE(const BsincState *state, const ALfloat *restrict src,
ALuint frac, ALint increment, ALfloat *restrict dst,
ALsizei dstlen)
@@ -52,9 +46,11 @@ const ALfloat *Resample_bsinc32_SSE(const BsincState *state, const ALfloat *rest
#define MLA4(x, y, z) _mm_add_ps(x, _mm_mul_ps(y, z))
for(j = 0;j < m;j+=4)
{
+ /* f = ((fil + sf*scd) + pf*(phd + sf*spd)) */
const __m128 f4 = MLA4(MLA4(LD4(&fil[j]), sf4, LD4(&scd[j])),
pf4, MLA4(LD4(&phd[j]), sf4, LD4(&spd[j]))
);
+ /* r += f*src */
r4 = MLA4(r4, f4, ULD4(&src[j]));
}
#undef MLA4
@@ -84,6 +80,9 @@ static inline void ApplyCoeffsStep(ALsizei Offset, ALfloat (*restrict Values)[2]
__m128 vals = _mm_setzero_ps();
ALsizei i;
+ Values = ASSUME_ALIGNED(Values, 16);
+ Coeffs = ASSUME_ALIGNED(Coeffs, 16);
+ CoeffStep = ASSUME_ALIGNED(CoeffStep, 16);
if((Offset&1))
{
const ALsizei o0 = Offset&HRIR_MASK;
@@ -145,6 +144,8 @@ static inline void ApplyCoeffs(ALsizei Offset, ALfloat (*restrict Values)[2],
__m128 coeffs;
ALsizei i;
+ Values = ASSUME_ALIGNED(Values, 16);
+ Coeffs = ASSUME_ALIGNED(Coeffs, 16);
if((Offset&1))
{
const ALsizei o0 = Offset&HRIR_MASK;