From 7d0cf9b166aba715e4b5b0de18f26e21cc043ac1 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Tue, 3 Nov 2026 09:24:27 -0800 Subject: [PATCH 1/4] Windows/CPUFeatures: Fixes disabled cache instruct operations on wine This check was inverted. We were accidentally disabling cache operations on Wine, but enabling on Windows when it should be the opposite. --- Source/Windows/Common/CPUFeatures.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Windows/Common/CPUFeatures.cpp b/Source/Windows/Common/CPUFeatures.cpp index 3d51d1406..e7b8e2d77 100644 --- a/Source/Windows/Common/CPUFeatures.cpp +++ b/Source/Windows/Common/CPUFeatures.cpp @@ -76,7 +76,7 @@ FEXCore::HostFeatures CPUFeatures::FetchHostFeatures(bool IsWine, FEXCore::HostF RegCloseKey(Key); } - FEX::FetchHostFeatures(Features, HostFeatures, !IsWine, CTR, MIDR); + FEX::FetchHostFeatures(Features, HostFeatures, IsWine, CTR, MIDR); // Force-disable SVE until wine/windows gain support for SVE context save/restore HostFeatures.SupportsSVE128 = false; From c69f2bf0420a39d633bf342314b16c731df045ef Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Tue, 3 Nov 2026 09:43:26 -0800 Subject: [PATCH 2/4] arm64ec: Fixes copy-paste failure Accidentally changed the host type from arm64ec to wow64 which disabled AVX. --- Source/Windows/ARM64EC/Module.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Windows/ARM64EC/Module.cpp b/Source/Windows/ARM64EC/Module.cpp index 250beed9e..3be7e465a 100644 --- a/Source/Windows/ARM64EC/Module.cpp +++ b/Source/Windows/ARM64EC/Module.cpp @@ -789,7 +789,7 @@ NTSTATUS ProcessInit() { { auto HostFeatures = - FEX::Windows::CPUFeatures::FetchHostFeatures(IsWine, FEXCore::HostFeatures::HostTypeEnum::Wow64, FEX::Windows::UnixLib::GetPID()); + FEX::Windows::CPUFeatures::FetchHostFeatures(IsWine, FEXCore::HostFeatures::HostTypeEnum::Arm64ec, FEX::Windows::UnixLib::GetPID()); CTX = FEXCore::Context::Context::CreateNewContext(HostFeatures); } From c76fccf256a185a2a20008de2578fa5c8dab217f Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Tue, 3 Nov 2026 10:00:54 -0800 Subject: [PATCH 3/4] CMake: Add an llvm-mingw clang version check to preserve_all llvm has supported preserve_all abi on Windows ABI since https://github.com/llvm/llvm-project/pull/166436. This has been in a clang release since 22.1. Do a clang version check to ensure the compiler is >= 22.1 to enabled preserve_all under wow64/arm64ec. This will give a performance boost to applications that require x87 full precision and a couple other minor things. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8aac4f3c..437fa7c56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -254,7 +254,9 @@ check_cxx_source_compiles( HAS_CLANG_PRESERVE_ALL) unset(CMAKE_REQUIRED_FLAGS) if (HAS_CLANG_PRESERVE_ALL) - if (MINGW) + message(STATUS "Clang version ${CMAKE_CXX_COMPILER_VERSION}") + set(CLANG_MINIMUM_VERSION 22.1) + if (MINGW AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${CLANG_MINIMUM_VERSION}) message(STATUS "Ignoring broken clang::preserve_all support") set(HAS_CLANG_PRESERVE_ALL FALSE) else() From 61086cc81a79bd14821147c9bddca0b7b6ba942a Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Tue, 3 Nov 2026 10:03:09 -0800 Subject: [PATCH 4/4] HostFeatures: Tag the bit positions of each flag There's enough of them now that it's kind of annoying to track by counting. --- FEXCore/include/FEXCore/Core/HostFeatures.h | 74 ++++++++++----------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/FEXCore/include/FEXCore/Core/HostFeatures.h b/FEXCore/include/FEXCore/Core/HostFeatures.h index 80897b5a3..03654a449 100644 --- a/FEXCore/include/FEXCore/Core/HostFeatures.h +++ b/FEXCore/include/FEXCore/Core/HostFeatures.h @@ -67,44 +67,44 @@ struct HostFeatures { } // Affects codegen and is basically machine description. - uint32_t DCacheLineLog2 : 4 {}; - uint32_t SupportsCacheMaintenanceOps : 1 {}; - uint32_t SupportsAES : 1 {}; - uint32_t SupportsCRC : 1 {}; - uint32_t SupportsCLZERO : 1 {}; - uint32_t SupportsAtomics : 1 {}; - uint32_t SupportsRCPC : 1 {}; - uint32_t SupportsTSOImm9 : 1 {}; - uint32_t SupportsRAND : 1 {}; - uint32_t SupportsAVX : 1 {}; - uint32_t SupportsSVE128 : 1 {}; - uint32_t SupportsSVE256 : 1 {}; - uint32_t SupportsSHA : 1 {}; - uint32_t SupportsPMULL_128Bit : 1 {}; - uint32_t SupportsCSSC : 1 {}; - uint32_t SupportsFCMA : 1 {}; - uint32_t SupportsFlagM : 1 {}; - uint32_t SupportsFlagM2 : 1 {}; - uint32_t SupportsRPRES : 1 {}; - uint32_t SupportsPreserveAllABI : 1 {}; - uint32_t SupportsAES256 : 1 {}; - uint32_t SupportsSVEBitPerm : 1 {}; - uint32_t SupportsCPUIndexInTPIDRRO : 1 {}; - uint32_t SupportsFRINTTS : 1 {}; - uint32_t SupportsECV : 1 {}; - uint32_t SupportsWFXT : 1 {}; - uint32_t Supports3DNow : 1 {}; - uint32_t SupportsSSE4a : 1 {}; - uint32_t SupportsMOPS : 1 {}; - uint32_t SupportsI8MM : 1 {}; - uint32_t SupportsDotProd : 1 {}; - uint32_t PreferZVAForVZero : 1 {}; - uint32_t SupportsAFP : 1 {}; - uint32_t SupportsFloatExceptions : 1 {}; - uint32_t SupportsBF16 : 1 {}; + uint32_t DCacheLineLog2 : 4 {}; // [3:0] + uint32_t SupportsCacheMaintenanceOps : 1 {}; // [4] + uint32_t SupportsAES : 1 {}; // [5] + uint32_t SupportsCRC : 1 {}; // [6] + uint32_t SupportsCLZERO : 1 {}; // [7] + uint32_t SupportsAtomics : 1 {}; // [8] + uint32_t SupportsRCPC : 1 {}; // [9] + uint32_t SupportsTSOImm9 : 1 {}; // [10] + uint32_t SupportsRAND : 1 {}; // [11] + uint32_t SupportsAVX : 1 {}; // [12] // Not enabled on wine? + uint32_t SupportsSVE128 : 1 {}; // [13] + uint32_t SupportsSVE256 : 1 {}; // [14] + uint32_t SupportsSHA : 1 {}; // [15] + uint32_t SupportsPMULL_128Bit : 1 {}; // [16] + uint32_t SupportsCSSC : 1 {}; // [17] + uint32_t SupportsFCMA : 1 {}; // [18] + uint32_t SupportsFlagM : 1 {}; // [19] + uint32_t SupportsFlagM2 : 1 {}; // [20] + uint32_t SupportsRPRES : 1 {}; // [21] + uint32_t SupportsPreserveAllABI : 1 {}; // [22] // Not enabled on wine + uint32_t SupportsAES256 : 1 {}; // [23] + uint32_t SupportsSVEBitPerm : 1 {}; // [24] + uint32_t SupportsCPUIndexInTPIDRRO : 1 {}; // [25] + uint32_t SupportsFRINTTS : 1 {}; // [26] + uint32_t SupportsECV : 1 {}; // [27] + uint32_t SupportsWFXT : 1 {}; // [28] + uint32_t Supports3DNow : 1 {}; // [29] + uint32_t SupportsSSE4a : 1 {}; // [30] + uint32_t SupportsMOPS : 1 {}; // [31] + uint32_t SupportsI8MM : 1 {}; // [32] + uint32_t SupportsDotProd : 1 {}; // [33] + uint32_t PreferZVAForVZero : 1 {}; // [34] + uint32_t SupportsAFP : 1 {}; // [35] + uint32_t SupportsFloatExceptions : 1 {}; // [36] + uint32_t SupportsBF16 : 1 {}; // [37] // Flag if this is InstCountCI - uint32_t IsInstCountCI : 1 {}; - uint32_t pad : 25 {}; + uint32_t IsInstCountCI : 1 {}; // [38] + uint32_t pad : 25 {}; // [63:39] // This affects codegen, but it isn't machine state ProcessFeaturesHash ProcessFeatures {};