summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorNicky <sl.nicky.ml@googlemail.com>2016-04-22 12:58:51 +0200
committerNicky <sl.nicky.ml@googlemail.com>2016-04-22 12:58:51 +0200
commit056f0983029000041555ca53c61cbe5e8689cae9 (patch)
tree43502725042f4174a4a72ca4b4eabad226bd4855 /indra/llcommon
parentd75a6ecbe533fb115d8130122df710790ba9610b (diff)
Windows x64: Cannot use inline assembly.
(transplanted from ee32840fc591f5529a0b544243e7b4146eb8f531)
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llfasttimer.h10
1 files changed, 10 insertions, 0 deletions
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<U32>(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<U64>( __rdtsc() );
+#endif
return ret_val;
}