Partially handle the irom sub-chunk
[openal-soft.git] / Alc / mixer_neon.c
blob571221be45973c495c870ed89d0bb4425a7fed46
1 #include "config.h"
3 #ifdef HAVE_ARM_NEON_H
4 #include <arm_neon.h>
5 #endif
7 #include "AL/al.h"
8 #include "AL/alc.h"
9 #include "alMain.h"
10 #include "alu.h"
13 static inline void ApplyCoeffsStep(const ALuint IrSize,
14 ALfloat (*restrict Coeffs)[2],
15 const ALfloat (*restrict CoeffStep)[2])
17 ALuint c;
18 for(c = 0;c < IrSize;c++)
20 Coeffs[c][0] += CoeffStep[c][0];
21 Coeffs[c][1] += CoeffStep[c][1];
25 static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
26 const ALuint IrSize,
27 ALfloat (*restrict Coeffs)[2],
28 ALfloat left, ALfloat right)
30 ALuint c;
31 float32x4_t leftright4;
33 float32x2_t leftright2 = vdup_n_f32(0.0);
34 leftright2 = vset_lane_f32(left, leftright2, 0);
35 leftright2 = vset_lane_f32(right, leftright2, 1);
36 leftright4 = vcombine_f32(leftright2, leftright2);
38 for(c = 0;c < IrSize;c += 2)
40 const ALuint o0 = (Offset+c)&HRIR_MASK;
41 const ALuint o1 = (o0+1)&HRIR_MASK;
42 float32x4_t vals = vcombine_f32(vld1_f32((float32_t*)&Values[o0][0]),
43 vld1_f32((float32_t*)&Values[o1][0]));
44 float32x4_t coefs = vld1q_f32((float32_t*)&Coeffs[c][0]);
46 vals = vmlaq_f32(vals, coefs, leftright4);
48 vst1_f32((float32_t*)&Values[o0][0], vget_low_f32(vals));
49 vst1_f32((float32_t*)&Values[o1][0], vget_high_f32(vals));
54 #define SUFFIX Neon
55 #include "mixer_inc.c"
56 #undef SUFFIX