diff --git a/src/common/engine/stats.h b/src/common/engine/stats.h index 563fc9529f..92456ffb0d 100644 --- a/src/common/engine/stats.h +++ b/src/common/engine/stats.h @@ -97,11 +97,13 @@ private: #else // Windows and macOS +#ifndef _M_ARM #include "x86.h" +#endif extern double PerfToSec, PerfToMillisec; -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(_M_ARM64) // Trying to include intrin.h here results in some bizarre errors, so I'm just // going to duplicate the function prototype instead. //#include @@ -111,6 +113,12 @@ inline unsigned __int64 rdtsc() { return __rdtsc(); } +#elif defined(_MSC_VER) && defined(_M_ARM64) +#include +inline unsigned __int64 rdtsc() +{ + return _ReadStatusReg(ARM64_SYSREG(3, 3, 13, 0, 2)); //_ReadStatusReg(PMCCNTR_EL0); +} #elif defined __APPLE__ && (defined __i386__ || defined __x86_64__) inline uint64_t rdtsc() {