diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-03-28 09:09:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-28 09:09:35 -0400 |
commit | 40efd2ab56c2296da4524085a133021f7731e67f (patch) | |
tree | a43b51a4056ad7664346a63f145c889da1f59d16 /src/common/x64/native_clock.cpp | |
parent | fbbf532d42f5688533d31f7fe6f75526b4187e5c (diff) | |
parent | cdc846677cfc7f7389d9b89e6bb924a02f6f1c3b (diff) |
Merge pull request #9982 from Morph1984/tpause
x64: Make use of waitpkg instructions for power efficient sleeps
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() { } #else static u64 FencedRDTSC() { - u64 result; + u64 eax; + u64 edx; asm volatile("lfence\n\t" "rdtsc\n\t" - "shl $32, %%rdx\n\t" - "or %%rdx, %0\n\t" - "lfence" - : "=a"(result) - : - : "rdx", "memory", "cc"); - return result; + "lfence\n\t" + : "=a"(eax), "=d"(edx)); + return (edx << 32) | eax; } #endif |