diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/x64/cpu_wait.cpp | 13 | ||||
| -rw-r--r-- | src/common/x64/native_clock.cpp | 13 |
2 files changed, 10 insertions, 16 deletions
diff --git a/src/common/x64/cpu_wait.cpp b/src/common/x64/cpu_wait.cpp index 1fab0bfe8..cfeef6a3d 100644 --- a/src/common/x64/cpu_wait.cpp +++ b/src/common/x64/cpu_wait.cpp | |||
| @@ -33,16 +33,13 @@ __forceinline static void TPAUSE() { | |||
| 33 | } | 33 | } |
| 34 | #else | 34 | #else |
| 35 | static u64 FencedRDTSC() { | 35 | static u64 FencedRDTSC() { |
| 36 | u64 result; | 36 | u64 eax; |
| 37 | u64 edx; | ||
| 37 | asm volatile("lfence\n\t" | 38 | asm volatile("lfence\n\t" |
| 38 | "rdtsc\n\t" | 39 | "rdtsc\n\t" |
| 39 | "shl $32, %%rdx\n\t" | 40 | "lfence\n\t" |
| 40 | "or %%rdx, %0\n\t" | 41 | : "=a"(eax), "=d"(edx)); |
| 41 | "lfence" | 42 | return (edx << 32) | eax; |
| 42 | : "=a"(result) | ||
| 43 | : | ||
| 44 | : "rdx", "memory", "cc"); | ||
| 45 | return result; | ||
| 46 | } | 43 | } |
| 47 | 44 | ||
| 48 | static void TPAUSE() { | 45 | static void TPAUSE() { |
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 | ||