From 2218462ff225670991b02eb696a7b222995ba3cf Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Tue, 13 Sep 2022 18:50:19 +0100 Subject: [PATCH] [util] Implement spin on ARM64 --- src/util/sync/sync_spinlock.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/sync/sync_spinlock.h b/src/util/sync/sync_spinlock.h index 27157929f..a04c79258 100644 --- a/src/util/sync/sync_spinlock.h +++ b/src/util/sync/sync_spinlock.h @@ -21,7 +21,13 @@ namespace dxvk::sync { void spin(uint32_t spinCount, const Fn& fn) { while (unlikely(!fn())) { for (uint32_t i = 1; i < spinCount; i++) { + #if defined(DXVK_ARCH_X86) _mm_pause(); + #elif defined(DXVK_ARCH_ARM64) + __asm__ __volatile__ ("yield"); + #else + #error "Pause/Yield not implemented for this architecture." + #endif if (fn()) return; }