From bbfb934e808c6602d3a059adf270e997b71b900c Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sun, 6 Dec 2020 23:50:15 -0500 Subject: [PATCH] - and now it builds! but ... does it run? --- src/common/engine/stats.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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() {