From 4e4fcae966ae34ade25b32199a7c101e7abbc98b Mon Sep 17 00:00:00 2001 From: Reality Date: Thu, 5 Feb 2026 17:11:52 +0900 Subject: [PATCH] [CPU] Gate AVX non-fatal warning to macOS (cherry picked from commit 64351bbd07f5d98657e2a825a40bd403a7c78725) (cherry picked from commit 9b6a288fac396a9d4ccd0937c8b9c0995386cf11) --- src/xenia/cpu/backend/x64/x64_backend.cc | 7 +++++++ src/xenia/cpu/backend/x64/x64_emitter.cc | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/src/xenia/cpu/backend/x64/x64_backend.cc b/src/xenia/cpu/backend/x64/x64_backend.cc index 51c967298..a4a163450 100644 --- a/src/xenia/cpu/backend/x64/x64_backend.cc +++ b/src/xenia/cpu/backend/x64/x64_backend.cc @@ -231,11 +231,18 @@ bool X64Backend::Initialize(Processor* processor) { } Xbyak::util::Cpu cpu; +#if XE_PLATFORM_MAC if (!cpu.has(Xbyak::util::Cpu::tAVX)) { XELOGW( "This CPU does not support AVX. Continuing anyway (performance and " "compatibility may be reduced)."); } +#else + if (!cpu.has(Xbyak::util::Cpu::tAVX)) { + XELOGE("This CPU does not support AVX. The emulator will now crash."); + return false; + } +#endif // Need movbe to do advanced LOAD/STORE tricks. if (cvars::x64_extension_mask & kX64EmitMovbe) { diff --git a/src/xenia/cpu/backend/x64/x64_emitter.cc b/src/xenia/cpu/backend/x64/x64_emitter.cc index 4350fdf28..fd1c4ec1c 100644 --- a/src/xenia/cpu/backend/x64/x64_emitter.cc +++ b/src/xenia/cpu/backend/x64/x64_emitter.cc @@ -92,11 +92,19 @@ X64Emitter::X64Emitter(X64Backend* backend, XbyakAllocator* allocator) backend_(backend), code_cache_(backend->code_cache()), allocator_(allocator) { +#if XE_PLATFORM_MAC + if (!cpu_.has(Xbyak::util::Cpu::tAVX)) { + XELOGW( + "This CPU does not support AVX. Continuing anyway (performance and " + "compatibility may be reduced)."); + } +#else if (!cpu_.has(Xbyak::util::Cpu::tAVX)) { XELOGW( "Your CPU does not support AVX, which is required by Xenia. See the " "FAQ for system requirements at https://xenia.jp"); } +#endif feature_flags_ = amd64::GetFeatureFlags();