From 056f0983029000041555ca53c61cbe5e8689cae9 Mon Sep 17 00:00:00 2001 From: Nicky Date: Fri, 22 Apr 2016 12:58:51 +0200 Subject: Windows x64: Cannot use inline assembly. (transplanted from ee32840fc591f5529a0b544243e7b4146eb8f531) --- indra/llcommon/llfasttimer.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index f56e5596f5..0336f9d0e9 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -91,6 +91,7 @@ public: static U32 getCPUClockCount32() { U32 ret_val; +#if !defined(_M_AMD64) __asm { _emit 0x0f @@ -100,6 +101,11 @@ public: or eax, edx mov dword ptr [ret_val], eax } +#else + unsigned __int64 val = __rdtsc(); + val = val >> 8; + ret_val = static_cast(val); +#endif return ret_val; } @@ -107,6 +113,7 @@ public: static U64 getCPUClockCount64() { U64 ret_val; +#if !defined(_M_AMD64) __asm { _emit 0x0f @@ -116,6 +123,9 @@ public: mov dword ptr [ret_val+4], edx mov dword ptr [ret_val], eax } +#else + ret_val = static_cast( __rdtsc() ); +#endif return ret_val; } -- cgit v1.2.3