shithub: opus

Download patch

ref: c1f0f54018bf1f6f86710be1517313fb7b49556c
parent: ab4e83598e7fc8b2ce82dc633a0fc0c452b629aa
author: Martin Storsjo <martin@martin.st>
date: Tue Mar 5 04:11:30 EST 2024

dnn: vec_neon: avoid redefinition of vcvtnq_s32_f32

clang exposes this intrinsic even in 32-bit mode, if targeting >= armv8,
whereas gcc does not, see:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95399
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>

--- a/dnn/vec_neon.h
+++ b/dnn/vec_neon.h
@@ -34,7 +34,7 @@
 #include <arm_neon.h>
 #include "os_support.h"
 
-#if defined(__arm__) && !defined(__aarch64__)
+#if defined(__arm__) && !defined(__aarch64__) && (__ARM_ARCH < 8 || !defined(__clang__))
 /* Emulate vcvtnq_s32_f32() for ARMv7 Neon. */
 static OPUS_INLINE int32x4_t vcvtnq_s32_f32(float32x4_t x) {
   return vrshrq_n_s32(vcvtq_n_s32_f32(x, 8), 8);
--