disableMarchNative: also disable ADX in BLST (#2175)

This commit is contained in:
Ștefan Talpalaru 2020-12-11 08:16:17 +01:00 committed by GitHub
parent bc977799f6
commit 6cfe7de6b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -40,9 +40,13 @@ if defined(windows):
# and larger arithmetic use cases, along with register starvation issues. When
# engineering a more portable binary release, this should be tweaked but still
# use at least -msse2 or -msse3.
#
# Since ADX is only available on new CPUs, we want to disable it for generic
# binaries (BLST autodetects it with no other way to opt-out than at the C
# compiler level).
if defined(disableMarchNative):
switch("passC", "-msse3")
switch("passL", "-msse3")
switch("passC", "-msse3 -mno-adx")
switch("passL", "-msse3 -mno-adx")
else:
switch("passC", "-march=native")
switch("passL", "-march=native")