Skip to content

Commit

Permalink
Don't override -mcpu with -march on ARM (#353)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
loveshack authored Aug 7, 2020
1 parent 5d653a1 commit 9c5b485
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/cortexa15/make_defs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions config/cortexa53/make_defs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions config/cortexa57/make_defs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/cortexa9/make_defs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions config/thunderx2/make_defs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c5b485

Please sign in to comment.