[Build] Revert to AVX only for Windows

MSVC will arbitrarily include BMI2 instructions when AVX2 is enabled
and there is no way to disable this apparently, so go back to AVX
for Windows to allow Sandy/Ivy Bridge CPU support
This commit is contained in:
Herman S.
2025-10-31 23:44:48 +09:00
parent 87e72e4866
commit 4fdb9954ec
+6 -1
View File
@@ -49,7 +49,12 @@ fatalwarnings("All")
-- TODO(DrChat): Find a way to disable this on other architectures.
if ARCH ~= "ppc64" then
filter("architecture:x86_64")
filter({"architecture:x86_64", "platforms:Windows"})
-- Use AVX instead of AVX2 on Windows to prevent MSVC from emitting BMI2 instructions
-- MSVC with /arch:AVX2 generates BMI2 unconditionally, breaking Sandy/Ivy Bridge CPUs
vectorextensions("AVX")
filter({"architecture:x86_64", "platforms:not Windows"})
-- On non-Windows (Linux/Clang), AVX2 is safe as it can be combined with -mno-bmi2
vectorextensions("AVX2")
filter({})
end