diff --git a/common.mk b/common.mk index 0578bd37b..abbbc0963 100644 --- a/common.mk +++ b/common.mk @@ -68,7 +68,9 @@ $(eval $(call store-var-for,CWARNFLAGS, $(1))) $(eval $(call store-var-for,CDBGFLAGS, $(1))) $(eval $(call store-var-for,COPTFLAGS, $(1))) $(eval $(call store-var-for,CKOPTFLAGS, $(1))) -$(eval $(call store-var-for,CVECFLAGS, $(1))) +$(eval $(call store-var-for,CKVECFLAGS, $(1))) +$(eval $(call store-var-for,CROPTFLAGS, $(1))) +$(eval $(call store-var-for,CRVECFLAGS, $(1))) CONFIGS_INCL += $(1) endef @@ -102,8 +104,8 @@ get-refinit-cflags-for = $(call load-var-for,COPTFLAGS,$(1)) \ $(call get-noopt-cflags-for,$(1)) \ -DBLIS_CNAME=$(1) -get-refkern-cflags-for = $(call load-var-for,CKOPTFLAGS,$(1)) \ - $(call load-var-for,CVECFLAGS,$(1)) \ +get-refkern-cflags-for = $(call load-var-for,CROPTFLAGS,$(1)) \ + $(call load-var-for,CRVECFLAGS,$(1)) \ $(call get-noopt-cflags-for,$(1)) \ -DBLIS_CNAME=$(1) @@ -114,7 +116,7 @@ get-frame-cflags-for = $(call load-var-for,COPTFLAGS,$(1)) \ $(call get-noopt-cflags-for,$(1)) get-kernel-cflags-for = $(call load-var-for,CKOPTFLAGS,$(1)) \ - $(call load-var-for,CVECFLAGS,$(1)) \ + $(call load-var-for,CKVECFLAGS,$(1)) \ $(call get-noopt-cflags-for,$(1)) get-noopt-text = "(CFLAGS for no optimization)" diff --git a/config/amd64/make_defs.mk b/config/amd64/make_defs.mk index 08c215511..c2798c15a 100644 --- a/config/amd64/make_defs.mk +++ b/config/amd64/make_defs.mk @@ -68,15 +68,19 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2 +CKVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2 else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2 +CKVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2 else $(error gcc or clang are required for this configuration.) endif endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/arm32/make_defs.mk b/config/arm32/make_defs.mk index 856f5dd19..2e0a85869 100644 --- a/config/arm32/make_defs.mk +++ b/config/arm32/make_defs.mk @@ -68,11 +68,15 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -march=armv7-a +CKVECFLAGS := -march=armv7-a else $(error gcc is required for this configuration.) endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/arm64/make_defs.mk b/config/arm64/make_defs.mk index c1b090dd6..2e46208b4 100644 --- a/config/arm64/make_defs.mk +++ b/config/arm64/make_defs.mk @@ -68,11 +68,15 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -march=armv8-a +CKVECFLAGS := -march=armv8-a else $(error gcc is required for this configuration.) endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/bgq/make_defs.mk b/config/bgq/make_defs.mk index 0278e78f3..f816b56c6 100644 --- a/config/bgq/make_defs.mk +++ b/config/bgq/make_defs.mk @@ -68,11 +68,15 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),ibm) -CVECFLAGS := -qarch=qp -qtune=qp -qsimd=auto -qhot=level=1 -qprefetch -qunroll=yes -qnoipa +CKVECFLAGS := -qarch=qp -qtune=qp -qsimd=auto -qhot=level=1 -qprefetch -qunroll=yes -qnoipa else $(error xlc is required for this configuration.) endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Override the default value for LDFLAGS. LDFLAGS := -L/bgsys/drivers/ppcfloor/spi/lib -lSPI -lSPI_cnk -qthreaded -qsmp=omp diff --git a/config/bulldozer/make_defs.mk b/config/bulldozer/make_defs.mk index 6d7bd9edb..0f0845b0f 100644 --- a/config/bulldozer/make_defs.mk +++ b/config/bulldozer/make_defs.mk @@ -68,15 +68,19 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mfpmath=sse -mavx -mfma4 -march=bdver1 +CKVECFLAGS := -mfpmath=sse -mavx -mfma4 -march=bdver1 else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := -mfpmath=sse -mavx -mfma4 -march=bdver1 +CKVECFLAGS := -mfpmath=sse -mavx -mfma4 -march=bdver1 else $(error gcc or clang are required for this configuration.) endif endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/cortexa15/make_defs.mk b/config/cortexa15/make_defs.mk index ea9c168fa..90dbcf6af 100644 --- a/config/cortexa15/make_defs.mk +++ b/config/cortexa15/make_defs.mk @@ -68,11 +68,15 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -march=armv7-a +CKVECFLAGS := -march=armv7-a else $(error gcc is required for this configuration.) endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/cortexa57/make_defs.mk b/config/cortexa57/make_defs.mk index f3d3a9a8b..67d0aed06 100644 --- a/config/cortexa57/make_defs.mk +++ b/config/cortexa57/make_defs.mk @@ -68,11 +68,15 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -march=armv8-a+fp+simd -mcpu=cortex-a57.cortex-a53 +CKVECFLAGS := -march=armv8-a+fp+simd -mcpu=cortex-a57.cortex-a53 else $(error gcc is required for this configuration.) endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/cortexa9/make_defs.mk b/config/cortexa9/make_defs.mk index 7aa8d0ce6..09951d080 100644 --- a/config/cortexa9/make_defs.mk +++ b/config/cortexa9/make_defs.mk @@ -68,11 +68,15 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -march=armv7-a +CKVECFLAGS := -march=armv7-a else $(error gcc is required for this configuration.) endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/excavator/make_defs.mk b/config/excavator/make_defs.mk index 55645dc83..37d8c6f23 100644 --- a/config/excavator/make_defs.mk +++ b/config/excavator/make_defs.mk @@ -68,15 +68,19 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver4 +CKVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver4 else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver4 +CKVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver4 else $(error gcc or clang are required for this configuration.) endif endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/generic/make_defs.mk b/config/generic/make_defs.mk index 801ffb5a0..d5d039a54 100644 --- a/config/generic/make_defs.mk +++ b/config/generic/make_defs.mk @@ -68,19 +68,23 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := +CKVECFLAGS := else ifeq ($(CC_VENDOR),icc) -CVECFLAGS := +CKVECFLAGS := else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := +CKVECFLAGS := else $(error gcc, icc, or clang is required for this configuration.) endif endif endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/haswell/make_defs.mk b/config/haswell/make_defs.mk index 0bf92294c..2bcf81274 100644 --- a/config/haswell/make_defs.mk +++ b/config/haswell/make_defs.mk @@ -68,19 +68,23 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mavx2 -mfma -mfpmath=sse -march=core-avx2 +CKVECFLAGS := -mavx2 -mfma -mfpmath=sse -march=core-avx2 else ifeq ($(CC_VENDOR),icc) -CVECFLAGS := -xCORE-AVX2 +CKVECFLAGS := -xCORE-AVX2 else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := -mavx2 -mfma -mfpmath=sse -march=core-avx2 +CKVECFLAGS := -mavx2 -mfma -mfpmath=sse -march=core-avx2 else $(error gcc, icc, or clang is required for this configuration.) endif endif endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/intel64/make_defs.mk b/config/intel64/make_defs.mk index 773ea0587..267e3c0c4 100644 --- a/config/intel64/make_defs.mk +++ b/config/intel64/make_defs.mk @@ -68,19 +68,23 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mssse3 -mfpmath=sse -march=core2 +CKVECFLAGS := -mssse3 -mfpmath=sse -march=core2 else ifeq ($(CC_VENDOR),icc) -CVECFLAGS := -xSSSE3 +CKVECFLAGS := -xSSSE3 else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := -mssse3 -mfpmath=sse -march=core2 +CKVECFLAGS := -mssse3 -mfpmath=sse -march=core2 else $(error gcc, icc, or clang is required for this configuration.) endif endif endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/knc/make_defs.mk b/config/knc/make_defs.mk index aed5f1304..af1b7e8ea 100644 --- a/config/knc/make_defs.mk +++ b/config/knc/make_defs.mk @@ -68,11 +68,15 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),icc) -CVECFLAGS := +CKVECFLAGS := else $(error icc is required for this configuration.) endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Override the default value for LDFLAGS. LDFLAGS := -mmic diff --git a/config/knl/make_defs.mk b/config/knl/make_defs.mk index 5fa2f3b52..58a31b934 100644 --- a/config/knl/make_defs.mk +++ b/config/knl/make_defs.mk @@ -70,19 +70,23 @@ ifeq ($(DEBUG_TYPE),sde) # Note: The BLIS_DISABLE_MEMKIND macro definition will override # (undefine) the BLIS_ENABLE_MEMKIND macro definition. CPPROCFLAGS += -DBLIS_DISABLE_MEMKIND +# This value is normally set by configure and communicated to make via +# config.mk, however, the make_defs.mk files (this file) get included +# after config.mk, so this definition will override that earlier +# definition. BLIS_ENABLE_MEMKIND := no endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mavx512f -mavx512pf -mfpmath=sse -march=knl +CKVECFLAGS := -mavx512f -mavx512pf -mfpmath=sse -march=knl else ifeq ($(CC_VENDOR),icc) -CVECFLAGS := -xMIC-AVX512 +CKVECFLAGS := -xMIC-AVX512 else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := -mavx512f -mavx512pf -mfpmath=sse -march=knl +CKVECFLAGS := -mavx512f -mavx512pf -mfpmath=sse -march=knl else $(error gcc, icc, or clang is required for this configuration.) endif @@ -92,10 +96,15 @@ endif # The assembler on OS X won't recognize AVX512 without help. ifneq ($(CC_VENDOR),icc) ifeq ($(OS_NAME),Darwin) -CVECFLAGS += -Wa,-march=knl +CKVECFLAGS += -Wa,-march=knl endif endif +# Flags specific to reference kernels. +# Note: We use AVX2 for reference kernels instead of AVX-512. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := -mavx2 -mfma -mfpmath=sse -march=knl + # Never use libmemkind with Intel SDE. ifneq ($(DEBUG_TYPE),sde) LDFLAGS += -lmemkind diff --git a/config/old/armv7a/make_defs.mk b/config/old/armv7a/make_defs.mk index fd0d8980f..128cb0d3c 100644 --- a/config/old/armv7a/make_defs.mk +++ b/config/old/armv7a/make_defs.mk @@ -67,7 +67,7 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mfpu=vfpv3 -marm -march=armv7-a +CKVECFLAGS := -mfpu=vfpv3 -marm -march=armv7-a else $(error gcc is required for this configuration.) endif diff --git a/config/old/emscripten/make_defs.mk b/config/old/emscripten/make_defs.mk index 2fe526ecb..82f966d2b 100644 --- a/config/old/emscripten/make_defs.mk +++ b/config/old/emscripten/make_defs.mk @@ -54,7 +54,7 @@ CDBGFLAGS := #-g4 CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors COPTFLAGS := -O2 CKOPTFLAGS := -O3 -CVECFLAGS := +CKVECFLAGS := # --- Determine the archiver and related flags --- AR := emar diff --git a/config/old/loongson3a/make_defs.mk b/config/old/loongson3a/make_defs.mk index 195d0ce36..cca01d995 100644 --- a/config/old/loongson3a/make_defs.mk +++ b/config/old/loongson3a/make_defs.mk @@ -67,7 +67,7 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -march=loongson3a +CKVECFLAGS := -march=loongson3a else $(error gcc is required for this configuration.) endif diff --git a/config/old/newarch/make_defs.mk b/config/old/newarch/make_defs.mk index 64d53c49e..58af7001d 100644 --- a/config/old/newarch/make_defs.mk +++ b/config/old/newarch/make_defs.mk @@ -67,13 +67,13 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := +CKVECFLAGS := else ifeq ($(CC_VENDOR),icc) -CVECFLAGS := +CKVECFLAGS := else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := +CKVECFLAGS := else $(error gcc, icc, or clang is required for this configuration.) endif diff --git a/config/old/pnacl/make_defs.mk b/config/old/pnacl/make_defs.mk index b060ba9cb..efc46527f 100644 --- a/config/old/pnacl/make_defs.mk +++ b/config/old/pnacl/make_defs.mk @@ -54,7 +54,7 @@ CDBGFLAGS := -g CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors COPTFLAGS := -O3 CKOPTFLAGS := $(COPTFLAGS) -ffast-math -CVECFLAGS := +CKVECFLAGS := # --- Determine the archiver and related flags --- AR := pnacl-ar diff --git a/config/penryn/make_defs.mk b/config/penryn/make_defs.mk index c1076de95..9313f89dc 100644 --- a/config/penryn/make_defs.mk +++ b/config/penryn/make_defs.mk @@ -68,19 +68,23 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mssse3 -mfpmath=sse -march=core2 +CKVECFLAGS := -mssse3 -mfpmath=sse -march=core2 else ifeq ($(CC_VENDOR),icc) -CVECFLAGS := -xSSSE3 +CKVECFLAGS := -xSSSE3 else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := -mssse3 -mfpmath=sse -march=core2 +CKVECFLAGS := -mssse3 -mfpmath=sse -march=core2 else $(error gcc, icc, or clang is required for this configuration.) endif endif endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/piledriver/make_defs.mk b/config/piledriver/make_defs.mk index e99a8a817..e1c89817f 100644 --- a/config/piledriver/make_defs.mk +++ b/config/piledriver/make_defs.mk @@ -68,15 +68,19 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2 +CKVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2 else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2 +CKVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2 else $(error gcc or clang are required for this configuration.) endif endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/power7/make_defs.mk b/config/power7/make_defs.mk index 645da770a..6007b557f 100644 --- a/config/power7/make_defs.mk +++ b/config/power7/make_defs.mk @@ -68,11 +68,15 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mvsx +CKVECFLAGS := -mvsx else $(error gcc is required for this configuration.) endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/sandybridge/make_defs.mk b/config/sandybridge/make_defs.mk index ec6225c24..0acfa6200 100644 --- a/config/sandybridge/make_defs.mk +++ b/config/sandybridge/make_defs.mk @@ -68,19 +68,23 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mavx -mfpmath=sse -march=corei7-avx +CKVECFLAGS := -mavx -mfpmath=sse -march=corei7-avx else ifeq ($(CC_VENDOR),icc) -CVECFLAGS := -xAVX +CKVECFLAGS := -xAVX else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := -mavx -mfpmath=sse -march=corei7-avx +CKVECFLAGS := -mavx -mfpmath=sse -march=corei7-avx else $(error gcc, icc, or clang is required for this configuration.) endif endif endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/skx/make_defs.mk b/config/skx/make_defs.mk index fe4110d09..0e8fcf596 100644 --- a/config/skx/make_defs.mk +++ b/config/skx/make_defs.mk @@ -68,13 +68,13 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mavx512f -mavx512dq -mavx512bw -mavx512vl -mfpmath=sse -march=skylake-avx512 +CKVECFLAGS := -mavx512f -mavx512dq -mavx512bw -mavx512vl -mfpmath=sse -march=skylake-avx512 else ifeq ($(CC_VENDOR),icc) -CVECFLAGS := -xCORE-AVX512 +CKVECFLAGS := -xCORE-AVX512 else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := -mavx512f -mavx512dq -mavx512bw -mavx512vl -mfpmath=sse -march=skylake-avx512 +CKVECFLAGS := -mavx512f -mavx512dq -mavx512bw -mavx512vl -mfpmath=sse -march=skylake-avx512 else $(error gcc, icc, or clang is required for this configuration.) endif @@ -84,10 +84,17 @@ endif # The assembler on OS X won't recognize AVX512 without help ifneq ($(CC_VENDOR),icc) ifeq ($(OS_NAME),Darwin) -CVECFLAGS += -Wa,-march=skylake-avx512 +CKVECFLAGS += -Wa,-march=skylake-avx512 endif endif +# Flags specific to reference kernels. +# Note: We use AVX2 for reference kernels because, as Jeff Hammond says, +# reference kernel code "is not going to achieve high enough SIMD utilization +# to overcome the AVX-512 frequency drop". (Issue #187) +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := -mavx2 -mfma -mfpmath=sse -march=skylake-avx512 + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/steamroller/make_defs.mk b/config/steamroller/make_defs.mk index dc5ccf47a..2baf7e8a4 100644 --- a/config/steamroller/make_defs.mk +++ b/config/steamroller/make_defs.mk @@ -68,15 +68,19 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2 +CKVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2 else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2 +CKVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2 else $(error gcc or clang are required for this configuration.) endif endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/template/make_defs.mk b/config/template/make_defs.mk index abd934569..db616d0c9 100644 --- a/config/template/make_defs.mk +++ b/config/template/make_defs.mk @@ -67,6 +67,10 @@ endif CKOPTFLAGS := $(COPTFLAGS) +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/x86_64/make_defs.mk b/config/x86_64/make_defs.mk index 2db7a8b87..953c48fe9 100644 --- a/config/x86_64/make_defs.mk +++ b/config/x86_64/make_defs.mk @@ -68,19 +68,23 @@ endif CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CVECFLAGS := -mssse3 -mfpmath=sse -march=core2 +CKVECFLAGS := -mssse3 -mfpmath=sse -march=core2 else ifeq ($(CC_VENDOR),icc) -CVECFLAGS := -xSSE3 +CKVECFLAGS := -xSSE3 else ifeq ($(CC_VENDOR),clang) -CVECFLAGS := -mssse3 -mfpmath=sse -march=core2 +CKVECFLAGS := -mssse3 -mfpmath=sse -march=core2 else $(error gcc, icc, or clang is required for this configuration.) endif endif endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG))) diff --git a/config/zen/make_defs.mk b/config/zen/make_defs.mk index f2a4eb49d..519fab101 100644 --- a/config/zen/make_defs.mk +++ b/config/zen/make_defs.mk @@ -69,18 +69,22 @@ CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) # gcc 6.0 (clang 4.0) or later: -#CVECFLAGS := -mavx2 -mfpmath=sse -mfma -march=znver1 +#CKVECFLAGS := -mavx2 -mfpmath=sse -mfma -march=znver1 # gcc 4.9 (clang 3.5) or later: # possibly add zen-specific instructions: -mclzero -madx -mrdseed -mmwaitx -msha -mxsavec -mxsaves -mclflushopt -mpopcnt -CVECFLAGS := -mavx2 -mfpmath=sse -mfma -march=bdver4 -mno-fma4 -mno-tbm -mno-xop -mno-lwp +CKVECFLAGS := -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 -mno-fma4 -mno-tbm -mno-xop -mno-lwp +CKVECFLAGS := -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 endif +# Flags specific to reference kernels. +CROPTFLAGS := $(CKOPTFLAGS) +CRVECFLAGS := $(CKVECFLAGS) + # Store all of the variables here to new variables containing the # configuration name. $(eval $(call store-make-defs,$(THIS_CONFIG)))