Files
MINGW-packages/mingw-w64-opus/001-aarch64-features.patch
2024-03-10 12:10:54 +05:30

36 lines
1.1 KiB
Diff

diff -bur opus-1.5.1-orig/celt/arm/armcpu.c opus-1.5.1/celt/arm/armcpu.c
--- opus-1.5.1-orig/celt/arm/armcpu.c 2024-03-09 21:13:23.646469400 -0700
+++ opus-1.5.1/celt/arm/armcpu.c 2024-03-09 22:51:55.794039700 -0700
@@ -191,6 +191,31 @@
return flags;
}
+#elif !defined(_MSC_VER) && defined(_WIN32)
+# define WIN32_LEAN_AND_MEAN
+# define WIN32_EXTRA_LEAN
+# include <windows.h>
+
+static OPUS_INLINE opus_uint32 opus_cpu_capabilities(void){
+ opus_uint32 flags;
+ flags=0;
+
+# if defined(OPUS_ARM_MAY_HAVE_EDSP) || defined(OPUS_ARM_MAY_HAVE_MEDIA) \
+ || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+
+ flags |= OPUS_CPU_ARM_EDSP_FLAG | OPUS_CPU_ARM_MEDIA_FLAG | OPUS_CPU_ARM_NEON_FLAG;
+
+# if defined(OPUS_ARM_MAY_HAVE_DOTPROD)
+
+ if (IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE))
+ {
+ flags |= OPUS_CPU_ARM_DOTPROD_FLAG;
+ }
+# endif
+# endif
+ return flags;
+}
+
#else
/* The feature registers which can tell us what the processor supports are
* accessible in priveleged modes only, so we can't have a general user-space