From 011992e774fcb58966f567099f03943c57e66c2b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 8 May 2020 22:12:24 +0200 Subject: [PATCH] meson: try to compile a little NEON program to be sure Fixes #235 --- meson.build | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 17864da0c..5a49c124c 100644 --- a/meson.build +++ b/meson.build @@ -100,11 +100,37 @@ have_avx2 = cc.has_argument(avx2_args) have_neon = false if host_machine.cpu_family() == 'aarch64' - neon_args = [] - have_neon = true + if cc.compiles(''' + #include + 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') - neon_args = ['-mfpu=neon'] - have_neon = true + if cc.compiles(''' + #include + 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 + endif endif