non-march=native builds should use SSSE3 instead of SSE3 (#3162)

This commit is contained in:
tersec 2021-12-05 18:02:58 +00:00 committed by GitHub
parent e6921f808f
commit 07e15a26fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -69,11 +69,16 @@ if defined(windows):
# engineering a more portable binary release, this should be tweaked but still
# use at least -msse2 or -msse3.
#
# https://github.com/status-im/nimbus-eth2/blob/stable/docs/cpu_features.md#ssse3-supplemental-sse3
# suggests that SHA256 hashing with SSSE3 is 20% faster than without SSSE3, so
# given its near-ubiquity in the x86 installed base, it renders a distribution
# build more viable on an overall broader range of hardware.
#
# Apple's Clang can't handle "-march=native" on M1: https://github.com/status-im/nimbus-eth2/issues/2758
if defined(disableMarchNative) or (defined(macosx) and defined(arm64)):
if defined(i386) or defined(amd64):
switch("passC", "-msse3")
switch("passL", "-msse3")
switch("passC", "-mssse3")
switch("passL", "-mssse3")
else:
switch("passC", "-march=native")
switch("passL", "-march=native")