summaryrefslogtreecommitdiff
path: root/src/common/x64/native_clock.cpp
diff options
context:
space:
mode:
authorGravatar liamwhite2023-03-28 09:09:35 -0400
committerGravatar GitHub2023-03-28 09:09:35 -0400
commit40efd2ab56c2296da4524085a133021f7731e67f (patch)
treea43b51a4056ad7664346a63f145c889da1f59d16 /src/common/x64/native_clock.cpp
parentMerge pull request #10002 from german77/log (diff)
parenttelemetry: Add waitpkg instruction (diff)
downloadyuzu-40efd2ab56c2296da4524085a133021f7731e67f.tar.gz
yuzu-40efd2ab56c2296da4524085a133021f7731e67f.tar.xz
yuzu-40efd2ab56c2296da4524085a133021f7731e67f.zip
Merge pull request #9982 from Morph1984/tpause
x64: Make use of waitpkg instructions for power efficient sleeps
Diffstat (limited to '')
-rw-r--r--src/common/x64/native_clock.cpp13
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
29static u64 FencedRDTSC() { 29static 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