diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2023-03-22 21:40:41 +0100 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2023-03-27 23:45:22 +0200 |
commit | 981bc8aa1c924eabc55f63f9671324c548c72d59 (patch) | |
tree | fb41c166e32bf99e2dd0f96ec92e4b59fed8ce9c /src/common | |
parent | core_timing: Make use of MicroSleep for x64 CPUs (diff) | |
download | yuzu-981bc8aa1c924eabc55f63f9671324c548c72d59.tar yuzu-981bc8aa1c924eabc55f63f9671324c548c72d59.tar.gz yuzu-981bc8aa1c924eabc55f63f9671324c548c72d59.tar.bz2 yuzu-981bc8aa1c924eabc55f63f9671324c548c72d59.tar.lz yuzu-981bc8aa1c924eabc55f63f9671324c548c72d59.tar.xz yuzu-981bc8aa1c924eabc55f63f9671324c548c72d59.tar.zst yuzu-981bc8aa1c924eabc55f63f9671324c548c72d59.zip |
Diffstat (limited to '')
-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() { } #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; } 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() { } #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 |