From 1e2c621af65cd1bde8ad122be4d4a6d4bb578f25 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 19 Jun 2025 17:41:15 +0800 Subject: Alternative to rdtsc, for Windows arm64 Just copying from this: https://forum.juce.com/t/windows-arm64-support/47572/6 This commit is for getting rid of the compile error for now, we don't know yet if this will work correctly or not. --- indra/llcommon/llfasttimer.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/llcommon/llfasttimer.h') diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index a69a03e419..8499655bfa 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -99,7 +99,11 @@ public: #if LL_FASTTIMER_USE_RDTSC static U32 getCPUClockCount32() { +#if _M_ARM64 + unsigned __int64 val = _ReadStatusReg(ARM64_PMCCNTR_EL0); +#else unsigned __int64 val = __rdtsc(); +#endif val = val >> 8; return static_cast(val); } @@ -107,7 +111,11 @@ public: // return full timer value, *not* shifted by 8 bits static U64 getCPUClockCount64() { +#if _M_ARM64 + return static_cast( _ReadStatusReg(ARM64_PMCCNTR_EL0) ); +#else return static_cast( __rdtsc() ); +#endif } #else -- cgit v1.2.3