From 04e953c4ec468b57e0caf71df36c5d8c01da961c Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Thu, 3 Dec 2020 13:29:45 +0800 Subject: [PATCH] OpenAL-soft: Fix NEON mixer compile error under MSVC Based on kcat/openal-soft@88cb398a836bb8b2d4038edcedff5167886e2d51, backported to 1.19.1 Ideally, updating OpenAL-soft to latest version should fix this issue. --- libs/openal-soft/Alc/mixer/mixer_neon.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libs/openal-soft/Alc/mixer/mixer_neon.c b/libs/openal-soft/Alc/mixer/mixer_neon.c index 9bf5521a..55281511 100644 --- a/libs/openal-soft/Alc/mixer/mixer_neon.c +++ b/libs/openal-soft/Alc/mixer/mixer_neon.c @@ -9,6 +9,15 @@ #include "hrtf.h" #include "defs.h" +inline float32x4_t set_f4(float l0, float l1, float l2, float l3) +{ + float32x4_t ret; + ret = vsetq_lane_f32(l0, ret, 0); + ret = vsetq_lane_f32(l1, ret, 1); + ret = vsetq_lane_f32(l2, ret, 2); + ret = vsetq_lane_f32(l3, ret, 3); + return ret; +} const ALfloat *Resample_lerp_Neon(const InterpState* UNUSED(state), const ALfloat *restrict src, ALsizei frac, ALint increment, @@ -34,8 +43,8 @@ const ALfloat *Resample_lerp_Neon(const InterpState* UNUSED(state), const int pos1 = vgetq_lane_s32(pos4, 1); const int pos2 = vgetq_lane_s32(pos4, 2); const int pos3 = vgetq_lane_s32(pos4, 3); - const float32x4_t val1 = (float32x4_t){src[pos0], src[pos1], src[pos2], src[pos3]}; - const float32x4_t val2 = (float32x4_t){src[pos0+1], src[pos1+1], src[pos2+1], src[pos3+1]}; + const float32x4_t val1 = set_f4(src[pos0], src[pos1], src[pos2], src[pos3]); + const float32x4_t val2 = set_f4(src[pos0+1], src[pos1+1], src[pos2+1], src[pos3+1]); /* val1 + (val2-val1)*mu */ const float32x4_t r0 = vsubq_f32(val2, val1);