diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2023-04-23 04:55:03 +0200 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2023-06-08 03:44:42 +0200 |
commit | dd12dd4c67dd4bc6e7a7d071b925afc38e687f8b (patch) | |
tree | 82538e7a48fa6fb6a9a5d51aef925586195c21ed /src/common/x64/cpu_wait.cpp | |
parent | Merge pull request #10650 from qurious-pixel/android_tv (diff) | |
download | yuzu-dd12dd4c67dd4bc6e7a7d071b925afc38e687f8b.tar yuzu-dd12dd4c67dd4bc6e7a7d071b925afc38e687f8b.tar.gz yuzu-dd12dd4c67dd4bc6e7a7d071b925afc38e687f8b.tar.bz2 yuzu-dd12dd4c67dd4bc6e7a7d071b925afc38e687f8b.tar.lz yuzu-dd12dd4c67dd4bc6e7a7d071b925afc38e687f8b.tar.xz yuzu-dd12dd4c67dd4bc6e7a7d071b925afc38e687f8b.tar.zst yuzu-dd12dd4c67dd4bc6e7a7d071b925afc38e687f8b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/x64/cpu_wait.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/common/x64/cpu_wait.cpp b/src/common/x64/cpu_wait.cpp index cfeef6a3d..c53dd4945 100644 --- a/src/common/x64/cpu_wait.cpp +++ b/src/common/x64/cpu_wait.cpp @@ -9,19 +9,11 @@ #include "common/x64/cpu_detect.h" #include "common/x64/cpu_wait.h" +#include "common/x64/rdtsc.h" namespace Common::X64 { #ifdef _MSC_VER -__forceinline static u64 FencedRDTSC() { - _mm_lfence(); - _ReadWriteBarrier(); - const u64 result = __rdtsc(); - _mm_lfence(); - _ReadWriteBarrier(); - return result; -} - __forceinline static void TPAUSE() { // 100,000 cycles is a reasonable amount of time to wait to save on CPU resources. // For reference: @@ -32,16 +24,6 @@ __forceinline static void TPAUSE() { _tpause(0, FencedRDTSC() + PauseCycles); } #else -static u64 FencedRDTSC() { - u64 eax; - u64 edx; - asm volatile("lfence\n\t" - "rdtsc\n\t" - "lfence\n\t" - : "=a"(eax), "=d"(edx)); - return (edx << 32) | eax; -} - static void TPAUSE() { // 100,000 cycles is a reasonable amount of time to wait to save on CPU resources. // For reference: |