From 88cb398a836bb8b2d4038edcedff5167886e2d51 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 16 Nov 2020 13:42:20 -0800 Subject: Avoid direct initialization of float32x4_t --- alc/mixer/mixer_neon.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'alc/mixer/mixer_neon.cpp') diff --git a/alc/mixer/mixer_neon.cpp b/alc/mixer/mixer_neon.cpp index 1b6e7b54..fa7c142a 100644 --- a/alc/mixer/mixer_neon.cpp +++ b/alc/mixer/mixer_neon.cpp @@ -21,6 +21,16 @@ struct FastBSincTag; namespace { +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; +} + constexpr ALuint FracPhaseBitDiff{MixerFracBits - BSincPhaseBits}; constexpr ALuint FracPhaseDiffOne{1 << FracPhaseBitDiff}; @@ -70,8 +80,8 @@ const float *Resample_(const InterpState*, const float *RESTRIC 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{src[pos0], src[pos1], src[pos2], src[pos3]}; - const float32x4_t val2{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)}; -- cgit v1.2.3