From 29c17fcb22933c17f4cd375fdf49ecd8f5a4f924 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 27 Apr 2025 21:01:59 +1000 Subject: [PATCH] Try improving compatibility of ma_yield(). My understanding is that "pause" was introduced with the Pentium 4 and assembles to opcode F390 which is the same as "rep; nop". I believe this should be backwards compatible. Using "pause" here introduces an compilation error when targeting architectures older than Pentium 4. --- miniaudio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniaudio.h b/miniaudio.h index b3c41fe2..5ecad034 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -12001,7 +12001,7 @@ static MA_INLINE void ma_yield(void) #endif #endif #else - __asm__ __volatile__ ("pause"); + __asm__ __volatile__ ("rep; nop"); #endif #elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7) || defined(_M_ARM64) || (defined(_M_ARM) && _M_ARM >= 7) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) /* ARM */