diff options
Diffstat (limited to 'src/common/x64/native_clock.cpp')
| -rw-r--r-- | src/common/x64/native_clock.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp index 76c66e7ee..277b00662 100644 --- a/src/common/x64/native_clock.cpp +++ b/src/common/x64/native_clock.cpp | |||
| @@ -27,16 +27,13 @@ __forceinline static u64 FencedRDTSC() { | |||
| 27 | } | 27 | } |
| 28 | #else | 28 | #else |
| 29 | static u64 FencedRDTSC() { | 29 | static u64 FencedRDTSC() { |
| 30 | u64 result; | 30 | u64 eax; |
| 31 | u64 edx; | ||
| 31 | asm volatile("lfence\n\t" | 32 | asm volatile("lfence\n\t" |
| 32 | "rdtsc\n\t" | 33 | "rdtsc\n\t" |
| 33 | "shl $32, %%rdx\n\t" | 34 | "lfence\n\t" |
| 34 | "or %%rdx, %0\n\t" | 35 | : "=a"(eax), "=d"(edx)); |
| 35 | "lfence" | 36 | return (edx << 32) | eax; |
| 36 | : "=a"(result) | ||
| 37 | : | ||
| 38 | : "rdx", "memory", "cc"); | ||
| 39 | return result; | ||
| 40 | } | 37 | } |
| 41 | #endif | 38 | #endif |
| 42 | 39 | ||