SDL_CPUPauseInstruction RISCV-64 version proposal.

This commit is contained in:
David Carlier 2023-01-22 21:01:22 +00:00 committed by Sam Lantinga
parent 38697e832a
commit b379c910d4
1 changed files with 2 additions and 0 deletions

View File

@ -244,6 +244,8 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
#define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory")
#elif (defined(__powerpc__) || defined(__powerpc64__))
#define SDL_CPUPauseInstruction() __asm__ __volatile__("or 27,27,27");
#elif (defined(__riscv) && __riscv_xlen == 64)
#define SDL_CPUPauseInstruction() __asm__ __volatile__(".insn i 0x0F, 0, x0, x0, 0x010");
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
#define SDL_CPUPauseInstruction() _mm_pause() /* this is actually "rep nop" and not a SIMD instruction. No inline asm in MSVC x86-64! */
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))