Augment zen CFLAGS to prevent illegal instruction.

Details:
- Added various compiler flags (-mno-fma4 -mno-tbm -mno-xop -mno-lwp) so
  that compiling with -march=bdver4 on zen-based architectures does not
  result in an illegal instruction error at runtime. Note: This fix is
  only needed for gcc 5.4; gcc 6.3 or later supports the use of
  -march=znver1, which can be used in lieu of the augmented set of flags
  based on bdver4. Thanks to Nisanth Padinharepatt for reporting this
  error.
This commit is contained in:
Field G. Van Zee
2018-01-18 12:03:51 -06:00
parent 5cdea756c7
commit 1e4365b21b

View File

@@ -68,10 +68,13 @@ endif
CKOPTFLAGS := $(COPTFLAGS)
ifeq ($(CC_VENDOR),gcc)
CVECFLAGS := -mavx2 -mfpmath=sse -mfma -march=bdver4
# gcc 6.3 or later:
#CVECFLAGS := -mavx2 -mfpmath=sse -mfma -march=bdver4
# gcc 5.4:
CVECFLAGS := -mavx2 -mfpmath=sse -mfma -march=bdver4 -mno-fma4 -mno-tbm -mno-xop -mno-lwp
else
ifeq ($(CC_VENDOR),clang)
CVECFLAGS := -mavx2 -mfpmath=sse -mfma -march=bdver4
CVECFLAGS := -mavx2 -mfpmath=sse -mfma -march=bdver4 -mno-fma4 -mno-tbm -mno-xop -mno-lwp
else
$(error gcc or clang are required for this configuration.)
endif