diff options
-rw-r--r-- | src/cpu.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cpu.cpp b/src/cpu.cpp index bafa0f735..b93f0fa5e 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -16,11 +16,18 @@ /* rdtsc for MSC_VER, uses simple inline assembly, or _rdtsc * from external win64.asm because VS2005 does not support inline assembly */ -#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) && !defined(RDTSC_AVAILABLE) +#if defined(_MSC_VER) && !defined(RDTSC_AVAILABLE) #include <intrin.h> +#include <windows.h> uint64 ottd_rdtsc() { +#if defined(_M_ARM) + return __rdpmccntr64(); +#elif defined(_M_ARM64) + return _ReadStatusReg(ARM64_PMCCNTR_EL0); +#else return __rdtsc(); +#endif } #define RDTSC_AVAILABLE #endif |