From b71434140e8ed40b1840a5704370bfc8dfdbf627 Mon Sep 17 00:00:00 2001 From: BtbN Date: Sat, 10 Aug 2024 20:07:57 +0200 Subject: [PATCH] Fix reading cycle count on non-msvc win-on-aarch64 --- src/clock.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/clock.cpp b/src/clock.cpp index fc2151f6..eeb7a681 100644 --- a/src/clock.cpp +++ b/src/clock.cpp @@ -223,6 +223,10 @@ uint64_t zmq::clock_t::rdtsc () ((13 & 15) << 3) | // crm ((0 & 7) << 0)); // op2 return _ReadStatusReg (pmccntr_el0); +#elif (defined(_WIN32) && defined(__GNUC__) && defined(__aarch64__)) + uint64_t val; + __asm__ volatile("mrs %0, pmccntr_el0" : "=r"(val)); + return val; #elif (defined __GNUC__ && (defined __i386__ || defined __x86_64__)) uint32_t low, high; __asm__ volatile("rdtsc" : "=a"(low), "=d"(high));