Commit 78aeabfa authored by David Reid's avatar David Reid

Update ma_yield().

parent 103574f1
...@@ -8254,15 +8254,28 @@ static MA_INLINE void ma_yield() ...@@ -8254,15 +8254,28 @@ static MA_INLINE void ma_yield()
#ifdef MA_POSIX #ifdef MA_POSIX
posix_yield(); posix_yield();
#else #else
#if defined(MA_X86) || defined(MA_X64) #if defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)
#if defined(_MSC_VER) && _MSC_VER >= 1400 /* x86/x64 */
_mm_pause(); #if defined(_MSC_VER) && !defined(__clang__)
#if _MSC_VER >= 1400
_mm_pause();
#else
__asm pause;
#endif
#else
__asm__ __volatile__ ("pause");
#endif
#elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 6) || (defined(_M_ARM) && _M_ARM >= 6)
/* ARM */
#if defined(_MSC_VER)
/* Apparently there is a __yield() intrinsic that's compatible with ARM, but I cannot find documentation for it nor can I find where it's declared. */
__yield();
#else #else
__asm pause; __asm__ __volatile__ ("yield");
#endif #endif
#else
/* Unknown or unsupported architecture. No-op. */
#endif #endif
/* TODO: Implement me. x86 = PAUSE; ARM = YIELD; */
#endif #endif
} }
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment