void-packages/srcpkgs/pipewire/patches/fix-neon-detection.patch

56 lines
1.4 KiB
Diff

Workaround for NEON detection for armv6l/armv7l
https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/235
diff --git meson.build meson.build
index 29b4b892..0d048a1f 100644
--- meson.build
+++ meson.build
@@ -99,36 +99,16 @@ have_avx = cc.has_argument(avx_args)
have_avx2 = cc.has_argument(avx2_args)
have_neon = false
-if host_machine.cpu_family() == 'aarch64'
- if cc.compiles('''
- #include <arm_neon.h>
- int main () {
- float *s;
- asm volatile(
- " ld1 { v0.4s }, [%[s]], #16\n"
- " fcvtzs v0.4s, v0.4s, #31\n"
- : [s] "+r" (s) : :);
- }
- ''',
- name : 'aarch64 Neon Support')
- neon_args = []
- have_neon = true
-
- endif
-elif cc.has_argument('-mfpu=neon')
- if cc.compiles('''
- #include <arm_neon.h>
- int main () {
- float *s;
- asm volatile(
- " vld1.32 { q0 }, [%[s]]!\n"
- " vcvt.s32.f32 q0, q0, #31\n"
- : [s] "+r" (s) : :);
- }
- ''',
- args: '-mfpu=neon',
- name : 'arm Neon Support')
- neon_args = ['-mfpu=neon']
- have_neon = true
+neon_args = []
+if host_machine.cpu_family() == 'arm' or host_machine.cpu_family() == 'aarch64'
+ if cc.compiles(
+'''
+#include <arm_neon.h>
+int32x4_t testfunc(int16_t *a, int16_t *b) {
+return vmull_s16(vld1_s16(a), vld1_s16(b));
+}
+''',
+ name : 'NEON support')
+ have_neon = true
endif
endif