diff --git a/config/amd64/make_defs.mk b/config/amd64/make_defs.mk index afea69558..668c7275e 100644 --- a/config/amd64/make_defs.mk +++ b/config/amd64/make_defs.mk @@ -57,7 +57,7 @@ endif ifeq ($(DEBUG_TYPE),noopt) COPTFLAGS := -O0 else -COPTFLAGS := -O2 -fomit-frame-pointer +COPTFLAGS := -O3 endif # Flags specific to optimized kernels. @@ -74,7 +74,11 @@ endif # Flags specific to reference kernels. CROPTFLAGS := $(CKOPTFLAGS) +ifeq ($(CC_VENDOR),gcc) +CRVECFLAGS := $(CKVECFLAGS) -funsafe-loop-optimizations +else CRVECFLAGS := $(CKVECFLAGS) +endif # Store all of the variables here to new variables containing the # configuration name. diff --git a/config/bulldozer/make_defs.mk b/config/bulldozer/make_defs.mk index 15870c4cb..28328e4b7 100644 --- a/config/bulldozer/make_defs.mk +++ b/config/bulldozer/make_defs.mk @@ -57,7 +57,7 @@ endif ifeq ($(DEBUG_TYPE),noopt) COPTFLAGS := -O0 else -COPTFLAGS := -O2 -funroll-all-loops +COPTFLAGS := -O3 endif # Flags specific to optimized kernels. @@ -74,7 +74,11 @@ endif # Flags specific to reference kernels. CROPTFLAGS := $(CKOPTFLAGS) +ifeq ($(CC_VENDOR),gcc) +CRVECFLAGS := $(CKVECFLAGS) -funsafe-loop-optimizations +else CRVECFLAGS := $(CKVECFLAGS) +endif # Store all of the variables here to new variables containing the # configuration name. diff --git a/config/excavator/make_defs.mk b/config/excavator/make_defs.mk index 45fff9690..82dcd8233 100644 --- a/config/excavator/make_defs.mk +++ b/config/excavator/make_defs.mk @@ -57,7 +57,7 @@ endif ifeq ($(DEBUG_TYPE),noopt) COPTFLAGS := -O0 else -COPTFLAGS := -O2 -fomit-frame-pointer +COPTFLAGS := -O3 endif # Flags specific to optimized kernels. @@ -74,7 +74,11 @@ endif # Flags specific to reference kernels. CROPTFLAGS := $(CKOPTFLAGS) +ifeq ($(CC_VENDOR),gcc) +CRVECFLAGS := $(CKVECFLAGS) -funsafe-loop-optimizations +else CRVECFLAGS := $(CKVECFLAGS) +endif # Store all of the variables here to new variables containing the # configuration name. diff --git a/config/generic/make_defs.mk b/config/generic/make_defs.mk index d491d072e..93e4d5212 100644 --- a/config/generic/make_defs.mk +++ b/config/generic/make_defs.mk @@ -78,7 +78,11 @@ endif # Flags specific to reference kernels. CROPTFLAGS := $(CKOPTFLAGS) +ifeq ($(CC_VENDOR),gcc) +CRVECFLAGS := $(CKVECFLAGS) -funsafe-loop-optimizations +else CRVECFLAGS := $(CKVECFLAGS) +endif # Store all of the variables here to new variables containing the # configuration name. diff --git a/config/haswell/make_defs.mk b/config/haswell/make_defs.mk index 5d2f0a73b..41b61540a 100644 --- a/config/haswell/make_defs.mk +++ b/config/haswell/make_defs.mk @@ -78,7 +78,11 @@ endif # Flags specific to reference kernels. CROPTFLAGS := $(CKOPTFLAGS) +ifeq ($(CC_VENDOR),gcc) +CRVECFLAGS := $(CKVECFLAGS) -funsafe-loop-optimizations +else CRVECFLAGS := $(CKVECFLAGS) +endif # Store all of the variables here to new variables containing the # configuration name. diff --git a/config/intel64/make_defs.mk b/config/intel64/make_defs.mk index 442b81e3a..3a9cb8895 100644 --- a/config/intel64/make_defs.mk +++ b/config/intel64/make_defs.mk @@ -78,7 +78,11 @@ endif # Flags specific to reference kernels. CROPTFLAGS := $(CKOPTFLAGS) +ifeq ($(CC_VENDOR),gcc) +CRVECFLAGS := $(CKVECFLAGS) -funsafe-loop-optimizations +else CRVECFLAGS := $(CKVECFLAGS) +endif # Store all of the variables here to new variables containing the # configuration name. diff --git a/config/knc/make_defs.mk b/config/knc/make_defs.mk index 367b64b27..48b89159f 100644 --- a/config/knc/make_defs.mk +++ b/config/knc/make_defs.mk @@ -70,7 +70,11 @@ endif # Flags specific to reference kernels. CROPTFLAGS := $(CKOPTFLAGS) +ifeq ($(CC_VENDOR),gcc) +CRVECFLAGS := $(CKVECFLAGS) -funsafe-loop-optimizations +else CRVECFLAGS := $(CKVECFLAGS) +endif # Override the default value for LDFLAGS. LDFLAGS := -mmic diff --git a/config/knl/make_defs.mk b/config/knl/make_defs.mk index f4165f788..e239a2fdf 100644 --- a/config/knl/make_defs.mk +++ b/config/knl/make_defs.mk @@ -99,7 +99,7 @@ endif # Note: We use AVX2 for reference kernels instead of AVX-512. CROPTFLAGS := $(CKOPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CRVECFLAGS := -march=knl -mno-avx512f -mno-avx512pf -mno-avx512er -mno-avx512cd +CRVECFLAGS := -march=knl -mno-avx512f -mno-avx512pf -mno-avx512er -mno-avx512cd -funsafe-loop-optimizations else ifeq ($(CC_VENDOR),icc) CRVECFLAGS := -xMIC-AVX512 diff --git a/config/penryn/make_defs.mk b/config/penryn/make_defs.mk index 294dd616a..175c8d5bf 100644 --- a/config/penryn/make_defs.mk +++ b/config/penryn/make_defs.mk @@ -57,7 +57,7 @@ endif ifeq ($(DEBUG_TYPE),noopt) COPTFLAGS := -O0 else -COPTFLAGS := -O2 -fomit-frame-pointer +COPTFLAGS := -O3 endif # Flags specific to optimized kernels. @@ -78,7 +78,11 @@ endif # Flags specific to reference kernels. CROPTFLAGS := $(CKOPTFLAGS) +ifeq ($(CC_VENDOR),gcc) +CRVECFLAGS := $(CKVECFLAGS) -funsafe-loop-optimizations +else CRVECFLAGS := $(CKVECFLAGS) +endif # Store all of the variables here to new variables containing the # configuration name. diff --git a/config/piledriver/make_defs.mk b/config/piledriver/make_defs.mk index 155b0c002..d5ebc1f14 100644 --- a/config/piledriver/make_defs.mk +++ b/config/piledriver/make_defs.mk @@ -57,7 +57,7 @@ endif ifeq ($(DEBUG_TYPE),noopt) COPTFLAGS := -O0 else -COPTFLAGS := -O2 -fomit-frame-pointer +COPTFLAGS := -O3 endif # Flags specific to optimized kernels. @@ -74,7 +74,11 @@ endif # Flags specific to reference kernels. CROPTFLAGS := $(CKOPTFLAGS) +ifeq ($(CC_VENDOR),gcc) +CRVECFLAGS := $(CKVECFLAGS) -funsafe-loop-optimizations +else CRVECFLAGS := $(CKVECFLAGS) +endif # Store all of the variables here to new variables containing the # configuration name. diff --git a/config/sandybridge/make_defs.mk b/config/sandybridge/make_defs.mk index f0d694f8c..02fb4d641 100644 --- a/config/sandybridge/make_defs.mk +++ b/config/sandybridge/make_defs.mk @@ -78,7 +78,11 @@ endif # Flags specific to reference kernels. CROPTFLAGS := $(CKOPTFLAGS) +ifeq ($(CC_VENDOR),gcc) +CRVECFLAGS := $(CKVECFLAGS) -funsafe-loop-optimizations +else CRVECFLAGS := $(CKVECFLAGS) +endif # Store all of the variables here to new variables containing the # configuration name. diff --git a/config/skx/make_defs.mk b/config/skx/make_defs.mk index e9319e476..98c5ebd6f 100644 --- a/config/skx/make_defs.mk +++ b/config/skx/make_defs.mk @@ -89,7 +89,7 @@ endif # to overcome the AVX-512 frequency drop". (Issue #187) CROPTFLAGS := $(CKOPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CRVECFLAGS := -march=skylake-avx512 -mno-avx512f -mno-avx512vl -mno-avx512bw -mno-avx512dq -mno-avx512cd +CRVECFLAGS := -march=skylake-avx512 -mno-avx512f -mno-avx512vl -mno-avx512bw -mno-avx512dq -mno-avx512cd -funsafe-loop-optimizations else ifeq ($(CC_VENDOR),icc) CRVECFLAGS := -xCORE-AVX2 diff --git a/config/steamroller/make_defs.mk b/config/steamroller/make_defs.mk index 6c093d244..18c5c6461 100644 --- a/config/steamroller/make_defs.mk +++ b/config/steamroller/make_defs.mk @@ -57,7 +57,7 @@ endif ifeq ($(DEBUG_TYPE),noopt) COPTFLAGS := -O0 else -COPTFLAGS := -O2 -fomit-frame-pointer +COPTFLAGS := -O3 endif # Flags specific to optimized kernels. @@ -74,7 +74,11 @@ endif # Flags specific to reference kernels. CROPTFLAGS := $(CKOPTFLAGS) +ifeq ($(CC_VENDOR),gcc) +CRVECFLAGS := $(CKVECFLAGS) -funsafe-loop-optimizations +else CRVECFLAGS := $(CKVECFLAGS) +endif # Store all of the variables here to new variables containing the # configuration name. diff --git a/config/template/make_defs.mk b/config/template/make_defs.mk index ff89757c7..35edf71a1 100644 --- a/config/template/make_defs.mk +++ b/config/template/make_defs.mk @@ -57,7 +57,7 @@ endif ifeq ($(DEBUG_TYPE),noopt) COPTFLAGS := -O0 else -COPTFLAGS := -O2 +COPTFLAGS := -O3 endif # Flags specific to optimized kernels. diff --git a/config/x86_64/make_defs.mk b/config/x86_64/make_defs.mk index 375ea7dec..0c6c521bd 100644 --- a/config/x86_64/make_defs.mk +++ b/config/x86_64/make_defs.mk @@ -78,7 +78,11 @@ endif # Flags specific to reference kernels. CROPTFLAGS := $(CKOPTFLAGS) +ifeq ($(CC_VENDOR),gcc) +CRVECFLAGS := $(CKVECFLAGS) -funsafe-loop-optimizations +else CRVECFLAGS := $(CKVECFLAGS) +endif # Store all of the variables here to new variables containing the # configuration name. diff --git a/config/zen/make_defs.mk b/config/zen/make_defs.mk index 40b07661b..5fdb7539f 100644 --- a/config/zen/make_defs.mk +++ b/config/zen/make_defs.mk @@ -57,7 +57,7 @@ endif ifeq ($(DEBUG_TYPE),noopt) COPTFLAGS := -O0 else -COPTFLAGS := -O3 -fomit-frame-pointer +COPTFLAGS := -O3 endif # Flags specific to optimized kernels. @@ -78,7 +78,11 @@ endif # Flags specific to reference kernels. CROPTFLAGS := $(CKOPTFLAGS) +ifeq ($(CC_VENDOR),gcc) +CRVECFLAGS := $(CKVECFLAGS) -funsafe-loop-optimizations +else CRVECFLAGS := $(CKVECFLAGS) +endif # Store all of the variables here to new variables containing the # configuration name.