From 7c4cbbf8d9b0deb06f67cd402a22136014abba45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 5 Aug 2020 13:24:14 +0300 Subject: checkasm: Use mach_absolute_time() as timer on darwin on ARM The cycle counter instructions aren't accessible on iOS/macOS on ARM. The mach_absolute_time() function has much coarser precision, but is the least bad option available. --- tests/checkasm/checkasm.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index 27c28d7..2a3391b 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -127,6 +127,9 @@ static inline uint64_t readtime(void) { } #define readtime readtime #endif +#elif (ARCH_AARCH64 || ARCH_ARM) && defined(__APPLE__) +#include +#define readtime() mach_absolute_time() #elif ARCH_AARCH64 #ifdef _MSC_VER #include -- cgit v1.2.3