Skip to content

Commit b714341

Browse files
BtbNbluca
authored andcommitted
Fix reading cycle count on non-msvc win-on-aarch64
1 parent 6aaafe0 commit b714341

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/clock.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ uint64_t zmq::clock_t::rdtsc ()
223223
((13 & 15) << 3) | // crm
224224
((0 & 7) << 0)); // op2
225225
return _ReadStatusReg (pmccntr_el0);
226+
#elif (defined(_WIN32) && defined(__GNUC__) && defined(__aarch64__))
227+
uint64_t val;
228+
__asm__ volatile("mrs %0, pmccntr_el0" : "=r"(val));
229+
return val;
226230
#elif (defined __GNUC__ && (defined __i386__ || defined __x86_64__))
227231
uint32_t low, high;
228232
__asm__ volatile("rdtsc" : "=a"(low), "=d"(high));

0 commit comments

Comments
 (0)