Commit 507fc462db1ede9f3ca2c581809a7f1492ac1ff5

Jiří Malák 2023-01-26T15:00:02

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/include/SDL_atomic.h b/include/SDL_atomic.h
index 22ea019..8273287 100644
--- a/include/SDL_atomic.h
+++ b/include/SDL_atomic.h
@@ -249,9 +249,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