Skip to content

Commit bc15070

Browse files
committed
Fix using vcopyq_laneq_f32() on older ARM toolchains
1 parent 4ed91da commit bc15070

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/SDL_mixer_spatialization.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,15 @@ static void SDL_TARGETING("sse") calculate_distance_attenuation_and_angle_sse(co
314314
}
315315
#endif
316316

317-
// FIXME: neon intrinsics "vcopyq_laneq_f32" is undeclared.
318-
// It is defined in <arm_neon.h>, but not activated because of __ARM_FP value.
319-
#if defined(SDL_PLATFORM_ANDROID) && defined(SDL_NEON_INTRINSICS) && !defined(__aarch64__)
320-
#undef SDL_NEON_INTRINSICS
317+
#if defined(SDL_NEON_INTRINSICS)
318+
// Some versions of arm_neon.h don't have vcopyq_laneq_f32() available
319+
#ifndef vcopyq_laneq_f32
320+
#define vcopyq_laneq_f32(a1, __b1, c1, __d1) __extension__ ({ \
321+
float32x4_t __a1 = (a1); float32x4_t __c1 = (c1); \
322+
float32_t __c2 = vgetq_lane_f32(__c1, __d1); \
323+
vsetq_lane_f32(__c2, __a1, __b1); })
321324
#endif
322325

323-
#if defined(SDL_NEON_INTRINSICS)
324326
static float32x4_t xyzzy_neon(const float32x4_t a, const float32x4_t b)
325327
{
326328
const float32x4_t a_yzx = vcopyq_laneq_f32(vextq_f32(a, a, 1), 2, a, 0);

0 commit comments

Comments
 (0)