Fix build on arm64ec.

This commit is contained in:
Esme Povirk
2026-07-17 20:15:59 +00:00
committed by Sam Lantinga
parent ee1c942a92
commit 3fc8509b36
2 changed files with 4 additions and 4 deletions

View File

@@ -355,7 +355,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
*/
#define SDL_CPUPauseInstruction() DoACPUPauseInACompilerAndArchitectureSpecificWay
#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) && !defined(__arm64ec__)
#define SDL_CPUPauseInstruction() __asm__ __volatile__("pause\n") /* Some assemblers can't do REP NOP, so go with PAUSE. */
#elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7) || defined(__aarch64__)
#define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory")

View File

@@ -154,7 +154,7 @@ static int CPU_haveCPUID(void)
:
: "%eax", "%ecx"
);
#elif (defined(__GNUC__) || defined(__llvm__)) && defined(__x86_64__)
#elif (defined(__GNUC__) || defined(__llvm__)) && defined(__x86_64__) && !defined(__arm64ec__)
/* Technically, if this is being compiled under __x86_64__ then it has
CPUid by definition. But it's nice to be able to prove it. :) */
__asm__ (
@@ -237,7 +237,7 @@ done:
" popl %%ebx \n" \
: "=a"(a), "=S"(b), "=c"(c), "=d"(d) \
: "a"(func))
#elif (defined(__GNUC__) || defined(__llvm__)) && defined(__x86_64__)
#elif (defined(__GNUC__) || defined(__llvm__)) && defined(__x86_64__) && !defined(__arm64ec__)
#define cpuid(func, a, b, c, d) \
__asm__ __volatile__( \
" pushq %%rbx \n" \
@@ -304,7 +304,7 @@ static void CPU_calcCPUIDFeatures(void)
// Check to make sure we can call xgetbv
if (c & 0x08000000) {
// Call xgetbv to see if YMM (etc) register state is saved
#if (defined(__GNUC__) || defined(__llvm__)) && (defined(__i386__) || defined(__x86_64__))
#if (defined(__GNUC__) || defined(__llvm__)) && (defined(__i386__) || defined(__x86_64__)) && !defined(__arm64ec__)
__asm__(".byte 0x0f, 0x01, 0xd0"
: "=a"(a)
: "c"(0)