summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Raghavan <arun@arunraghavan.net>2019-08-15 13:08:14 +0530
committerArun Raghavan <arun@arunraghavan.net>2019-08-15 18:57:13 +0530
commitc90fa7f8576cf47e329098d77e4b377faa7e13f5 (patch)
tree643f5a1a7845439ac0ffbad57a2e61a2a52d2152
parent1e996445f75f0984126572fb1548a6f5afac6c2f (diff)
build-sys: meson: Add ARMv6 instruction check
-rw-r--r--meson.build24
1 files changed, 24 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 4d5fc58b3..ae3d81ae2 100644
--- a/meson.build
+++ b/meson.build
@@ -439,6 +439,30 @@ else
libatomic_ops_dep = dependency('', required: false)
endif
+# ARM checks
+# ARMV6 instructions we need
+if host_machine.cpu_family() == 'arm'
+ armv6test = '''void func() {
+ volatile int a = -60000, b = 0xaaaabbbb, c = 0xccccdddd;
+ asm volatile ("ldr r0, %2 \n"
+ "ldr r2, %3 \n"
+ "ldr r3, %4 \n"
+ "ssat r1, #8, r0 \n"
+ "str r1, %0 \n"
+ "pkhbt r1, r3, r2, LSL #8 \n"
+ "str r1, %1 \n"
+ : "=m" (a), "=m" (b)
+ : "m" (a), "m" (b), "m" (c)
+ : "r0", "r1", "r2", "r3", "cc");
+ return (a == -128 && b == 0xaabbdddd) ? 0 : -1;
+ '''
+
+ if cc.compiles(armv6test)
+ cdata.set('HAVE_ARMV6', 1)
+ endif
+endif
+# NEON checks are automatically done by the unstable-simd module
+
# FIXME: make sure it's >= 2.2
ltdl_dep = cc.find_library('ltdl', required : true)
# FIXME: can meson support libtool -dlopen/-dlpreopen things?