3 #ifdef HAVE_XMMINTRIN_H
13 static __inline
void ApplyCoeffsStep(ALuint Offset
, ALfloat (*RESTRICT Values
)[2],
14 ALfloat (*RESTRICT Coeffs
)[2],
15 ALfloat (*RESTRICT CoeffStep
)[2],
16 ALfloat left
, ALfloat right
)
18 const __m128 lrlr
= { left
, right
, left
, right
};
19 __m128 vals
= { 0.0f
, 0.0f
, 0.0f
, 0.0f
};
20 __m128 coeffs
, coeffstep
;
22 for(c
= 0;c
< HRIR_LENGTH
;c
+= 2)
24 const ALuint o0
= (Offset
++)&HRIR_MASK
;
25 const ALuint o1
= (Offset
++)&HRIR_MASK
;
27 coeffs
= _mm_load_ps(&Coeffs
[c
][0]);
28 vals
= _mm_loadl_pi(vals
, (__m64
*)&Values
[o0
][0]);
29 vals
= _mm_loadh_pi(vals
, (__m64
*)&Values
[o1
][0]);
31 vals
= _mm_add_ps(vals
, _mm_mul_ps(coeffs
, lrlr
));
32 _mm_storel_pi((__m64
*)&Values
[o0
][0], vals
);
33 _mm_storeh_pi((__m64
*)&Values
[o1
][0], vals
);
35 coeffstep
= _mm_load_ps(&CoeffStep
[c
][0]);
36 coeffs
= _mm_add_ps(coeffs
, coeffstep
);
37 _mm_store_ps(&Coeffs
[c
][0], coeffs
);
41 static __inline
void ApplyCoeffs(ALuint Offset
, ALfloat (*RESTRICT Values
)[2],
42 ALfloat (*RESTRICT Coeffs
)[2],
43 ALfloat left
, ALfloat right
)
45 const __m128 lrlr
= { left
, right
, left
, right
};
46 __m128 vals
= { 0.0f
, 0.0f
, 0.0f
, 0.0f
};
49 for(c
= 0;c
< HRIR_LENGTH
;c
+= 2)
51 const ALuint o0
= (Offset
++)&HRIR_MASK
;
52 const ALuint o1
= (Offset
++)&HRIR_MASK
;
54 coeffs
= _mm_load_ps(&Coeffs
[c
][0]);
55 vals
= _mm_loadl_pi(vals
, (__m64
*)&Values
[o0
][0]);
56 vals
= _mm_loadh_pi(vals
, (__m64
*)&Values
[o1
][0]);
58 vals
= _mm_add_ps(vals
, _mm_mul_ps(coeffs
, lrlr
));
59 _mm_storel_pi((__m64
*)&Values
[o0
][0], vals
);
60 _mm_storeh_pi((__m64
*)&Values
[o1
][0], vals
);
65 #define SAMPLER point32
66 #include "mixer_inc.c"
68 #define SAMPLER lerp32
69 #include "mixer_inc.c"
71 #define SAMPLER cubic32
72 #include "mixer_inc.c"