From 056f0983029000041555ca53c61cbe5e8689cae9 Mon Sep 17 00:00:00 2001
From: Nicky <sl.nicky.ml@googlemail.com>
Date: Fri, 22 Apr 2016 12:58:51 +0200
Subject: [PATCH] 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 f56e5596f54..0336f9d0e9d 100644
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -91,6 +91,7 @@ class BlockTimer
 	static U32 getCPUClockCount32()
 	{
 		U32 ret_val;
+#if !defined(_M_AMD64)
 		__asm
 		{
 			_emit   0x0f
@@ -100,6 +101,11 @@ class BlockTimer
 				or eax, edx
 				mov dword ptr [ret_val], eax
 		}
+#else
+		unsigned __int64 val = __rdtsc();
+		val = val >> 8;
+		ret_val = static_cast<U32>(val);
+#endif
 		return ret_val;
 	}
 
@@ -107,6 +113,7 @@ class BlockTimer
 	static U64 getCPUClockCount64()
 	{
 		U64 ret_val;
+#if !defined(_M_AMD64)
 		__asm
 		{
 			_emit   0x0f
@@ -116,6 +123,9 @@ class BlockTimer
 				mov dword ptr [ret_val+4], edx
 				mov dword ptr [ret_val], eax
 		}
+#else
+		ret_val = static_cast<U64>( __rdtsc() );
+#endif
 		return ret_val;
 	}
 
-- 
GitLab