keep macOS CPU targeting consistent with EOL/supported macOS versions (#6558)

This commit is contained in:
tersec 2024-09-18 05:10:20 +00:00 committed by GitHub
parent 3f0d58492e
commit 6ab3568c16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 8 deletions

View File

@ -100,14 +100,11 @@ if defined(windows):
if defined(disableMarchNative):
if defined(i386) or defined(amd64):
if defined(macosx):
# macOS Big Sur is EOL as of 2023-11
# https://support.apple.com/en-us/HT212551
# "macOS Monterey is compatible with these computers" of which the
# oldest is "Mac Pro (Late 2013)". All have Haswell or newer CPUs.
#
# This ensures AVX2, AES-NI, PCLMUL, BMI1, and BMI2 instruction set support.
switch("passC", "-march=haswell -mtune=generic")
switch("passL", "-march=haswell -mtune=generic")
# https://support.apple.com/en-us/102861
# "macOS Ventura is compatible with these computers" lists current oldest
# supported x86 models, all of which have Kaby Lake or newer CPUs.
switch("passC", "-march=skylake -mtune=generic")
switch("passL", "-march=skylake -mtune=generic")
else:
if defined(marchOptimized):
# https://github.com/status-im/nimbus-eth2/blob/stable/docs/cpu_features.md#bmi2--adx