From 9c5b485d356367b0a1288761cd623f52036e7344 Mon Sep 17 00:00:00 2001 From: Dave Love Date: Fri, 7 Aug 2020 20:11:18 +0000 Subject: [PATCH] Don't override -mcpu with -march on ARM (#353) * Use -mcpu for ARM See the GCC doc about -march, -mtune, and -mpu and maybe https://community.arm.com/developer/tools-software/tools/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu * Fix typo in flags * Fix typo in cortexa9 flags * Modify cortexa53 compilation flags to fix failing BLAS check (#341) --- config/cortexa15/make_defs.mk | 2 +- config/cortexa53/make_defs.mk | 8 +++++--- config/cortexa57/make_defs.mk | 4 ++-- config/cortexa9/make_defs.mk | 2 +- config/thunderx2/make_defs.mk | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/config/cortexa15/make_defs.mk b/config/cortexa15/make_defs.mk index 0cbf304db..fda2b7589 100644 --- a/config/cortexa15/make_defs.mk +++ b/config/cortexa15/make_defs.mk @@ -63,7 +63,7 @@ endif # Flags specific to optimized kernels. CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CKVECFLAGS := -march=armv7-a +CKVECFLAGS := -mcpu=cortex-a15 else $(error gcc is required for this configuration.) endif diff --git a/config/cortexa53/make_defs.mk b/config/cortexa53/make_defs.mk index 3e116cd6e..eb9dae08c 100644 --- a/config/cortexa53/make_defs.mk +++ b/config/cortexa53/make_defs.mk @@ -57,19 +57,21 @@ endif ifeq ($(DEBUG_TYPE),noopt) COPTFLAGS := -O0 else -COPTFLAGS := -O3 -ftree-vectorize -mtune=cortex-a53 +# Use -O2 here to avoid issue #341 -- BLAS check failing, using GCC 8. +# (It's at least -ftree-loop-vectorize which causes the trouble.) +COPTFLAGS := -O2 -mcpu=cortex-a53 endif # Flags specific to optimized kernels. CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CKVECFLAGS := -march=armv8-a+fp+simd -mcpu=cortex-a53 +CKVECFLAGS := -mcpu=cortex-a53 else $(error gcc is required for this configuration.) endif # Flags specific to reference kernels. -CROPTFLAGS := $(CKOPTFLAGS) +CROPTFLAGS := $(CKOPTFLAGS) -O3 ifeq ($(CC_VENDOR),gcc) CRVECFLAGS := $(CKVECFLAGS) -funsafe-math-optimizations -ffp-contract=fast else diff --git a/config/cortexa57/make_defs.mk b/config/cortexa57/make_defs.mk index 864872bc2..831eb5afb 100644 --- a/config/cortexa57/make_defs.mk +++ b/config/cortexa57/make_defs.mk @@ -57,13 +57,13 @@ endif ifeq ($(DEBUG_TYPE),noopt) COPTFLAGS := -O0 else -COPTFLAGS := -O3 -ftree-vectorize -mtune=cortex-a57 +COPTFLAGS := -O3 -mcpu=cortex-a57 endif # Flags specific to optimized kernels. CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CKVECFLAGS := -march=armv8-a+fp+simd -mcpu=cortex-a57 +CKVECFLAGS := -mcpu=cortex-a57 else $(error gcc is required for this configuration.) endif diff --git a/config/cortexa9/make_defs.mk b/config/cortexa9/make_defs.mk index 310b75b95..3f6b95078 100644 --- a/config/cortexa9/make_defs.mk +++ b/config/cortexa9/make_defs.mk @@ -63,7 +63,7 @@ endif # Flags specific to optimized kernels. CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CKVECFLAGS := -march=armv7-a +CKVECFLAGS := -mcpu=cortex-a9 else $(error gcc is required for this configuration.) endif diff --git a/config/thunderx2/make_defs.mk b/config/thunderx2/make_defs.mk index 820919d9c..cfe1d3fd9 100644 --- a/config/thunderx2/make_defs.mk +++ b/config/thunderx2/make_defs.mk @@ -57,13 +57,13 @@ endif ifeq ($(DEBUG_TYPE),noopt) COPTFLAGS := -O0 else -COPTFLAGS := -O3 -ftree-vectorize -mtune=thunderx2t99 +COPTFLAGS := -O3 -mcpu=thunderx2t99 endif # Flags specific to optimized kernels. CKOPTFLAGS := $(COPTFLAGS) ifeq ($(CC_VENDOR),gcc) -CKVECFLAGS := -march=armv8.1-a+fp+simd -mcpu=thunderx2t99 +CKVECFLAGS := -mcpu=thunderx2t99 else $(error gcc is required for this configuration.) endif