Enable profiling build for ARM64.

This commit is contained in:
David CARLIER 2021-04-16 10:29:23 +01:00
parent e53e48b88c
commit c3353c0a47

View file

@ -50,9 +50,15 @@ static FORCE_INLINE uint64_t ReadTSC()
#ifdef _MSC_VER
return __rdtsc();
#else
#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__)
uint32_t hi, lo;
__asm__ __volatile__("rdtsc" : "=a"(lo), "=d"(hi));
return (((uint64_t)hi) << 32) | lo;
#elif defined(__aarch64__)
uint64_t cur;
__asm__ __volatile__("mrs %0, cntvct_el0" : "=r"(cur) :: "memory");
return cur;
#endif
#endif
}