From b86eb3c83e359bafb2a3b9607a945f72fbeca6d0 Mon Sep 17 00:00:00 2001 From: Johannes Schriewer Date: Mon, 4 Mar 2024 01:21:43 +0100 Subject: [PATCH] Rework config.h for speex resampler --- audio/deps/resampler/config.h | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/audio/deps/resampler/config.h b/audio/deps/resampler/config.h index 3d28b91..1d25f5d 100644 --- a/audio/deps/resampler/config.h +++ b/audio/deps/resampler/config.h @@ -1,11 +1,25 @@ -/* Make use of ARM4 assembly optimizations */ -#undef ARM4_ASM - -/* Make use of ARM5E assembly optimizations */ -#undef ARM5E_ASM - -/* Enable NEON support */ -#define USE_NEON /**/ +#if defined(__x86_64__) +# undef ARM4_ASM +# undef ARM5E_ASM +# undef USE_NEON +#elif defined(__arm__) +# if defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(__ARM_FEATURE_SIMD32) + /* Enable NEON support */ +# undef ARM4_ASM +# undef ARM5E_ASM +# define USE_NEON /**/ +# elif defined(__ARM_ARCH_4__) + /* Make use of ARM4 assembly optimizations */ +# define ARM4_ASM /**/ +# undef ARM5E_ASM +# undef USE_NEON +# elif defined(__ARM_ARCH_5E__) + /* Make use of ARM5E assembly optimizations */ +# undef ARM4_ASM +# define ARM5E_ASM /**/ +# undef USE_NEON +# endif +#endif /* Symbol visibility prefix */ #define EXPORT __attribute__((visibility("default")))