From 54540a82a09c0cc512b0e651ba4fa4d41011334e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Mal=C3=A1k?= <[EMAIL REDACTED]>
Date: Thu, 26 Jan 2023 15:00:02 +0100
Subject: [PATCH] SDL_atomic.h: Update SDL_CPUPauseInstruction for Watcom.
(#7157)
Appropriate CPU directive can be used in #pragma aux so that it is not
necessary to hardcode instruction bytes.
(cherry picked from commit 507fc462db1ede9f3ca2c581809a7f1492ac1ff5)
---
include/SDL3/SDL_atomic.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/SDL3/SDL_atomic.h b/include/SDL3/SDL_atomic.h
index 5e507f66adfd..ad7098161dc8 100644
--- a/include/SDL3/SDL_atomic.h
+++ b/include/SDL3/SDL_atomic.h
@@ -251,9 +251,8 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
#define SDL_CPUPauseInstruction() __yield()
#elif defined(__WATCOMC__) && defined(__386__)
- /* watcom assembler rejects PAUSE if CPU < i686, and it refuses REP NOP as an invalid combination. Hardcode the bytes. */
extern __inline void SDL_CPUPauseInstruction(void);
- #pragma aux SDL_CPUPauseInstruction = "db 0f3h,90h"
+ #pragma aux SDL_CPUPauseInstruction = ".686p" ".xmm2" "pause"
#else
#define SDL_CPUPauseInstruction()
#endif