atomic: Use acquire/release InterlockedExchange intrinsics on ARM64EC

This commit is contained in:
Cameron Gutman
2026-04-24 19:07:17 -05:00
parent 157ca95985
commit 15275898f0

View File

@@ -84,7 +84,7 @@ SDL_bool SDL_AtomicTryLock(SDL_SpinLock *lock)
#elif defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET)
return __sync_lock_test_and_set(lock, 1) == 0;
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC))
return _InterlockedExchange_acq(lock, 1) == 0;
#elif defined(_MSC_VER)
@@ -189,7 +189,7 @@ void SDL_AtomicUnlock(SDL_SpinLock *lock)
#if defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET)
__sync_lock_release(lock);
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC))
_InterlockedExchange_rel(lock, 0);
#elif defined(_MSC_VER)