Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Win64 AVX512 bug. #522

Merged
merged 1 commit into from
Jul 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions config/skx/make_defs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ ifeq ($(CC_VENDOR),icc)
CKVECFLAGS := -xCORE-AVX512
else
ifeq ($(CC_VENDOR),clang)
# NOTE: We have to use -march=haswell on Windows because apparently AVX512
# uses an alternate calling convention where xmm registers are not callee-saved
# on the stack. When this is mixed with framework code compiled for general
# x86_64 mode then chaos ensues (e.g. #514).
ifeq ($(IS_WIN),yes)
CKVECFLAGS := -mavx512f -mavx512dq -mavx512bw -mavx512vl -mfpmath=sse -march=haswell
else
CKVECFLAGS := -mavx512f -mavx512dq -mavx512bw -mavx512vl -mfpmath=sse -march=skylake-avx512
endif
else
$(error gcc, icc, or clang is required for this configuration.)
endif
Expand All @@ -97,7 +105,15 @@ ifeq ($(CC_VENDOR),icc)
CRVECFLAGS := -xCORE-AVX2
else
ifeq ($(CC_VENDOR),clang)
# NOTE: We have to use -march=haswell on Windows because apparently AVX512
# uses an alternate calling convention where xmm registers are not callee-saved
# on the stack. When this is mixed with framework code compiled for general
# x86_64 mode then chaos ensues (e.g. #514).
ifeq ($(IS_WIN),yes)
CRVECFLAGS := -march=haswell -funsafe-math-optimizations -ffp-contract=fast
else
CRVECFLAGS := -march=skylake-avx512 -mno-avx512f -mno-avx512vl -mno-avx512bw -mno-avx512dq -mno-avx512cd -funsafe-math-optimizations -ffp-contract=fast
endif
else
$(error gcc, icc, or clang is required for this configuration.)
endif
Expand Down