From c1f7a81663ae9e172d82b91c7ffbd482d71ceeac Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 10 Mar 2024 23:19:56 +0100 Subject: [PATCH 1/2] fix mtune for CortexX1, add mtune for X2 and A710 --- Makefile.arm64 | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Makefile.arm64 b/Makefile.arm64 index ca053b03d..a85ee7dfd 100644 --- a/Makefile.arm64 +++ b/Makefile.arm64 @@ -270,9 +270,17 @@ endif ifeq (1, $(filter 1,$(GCCVERSIONGTEQ11) $(ISCLANG))) ifeq ($(CORE), CORTEXX1) -CCOMMON_OPT += -march=armv8.2-a -mtune=cortexa72 +CCOMMON_OPT += -march=armv8.2-a +ifeq (1, $(filter 1,$(GCCMINORVERSIONGTEQ4) $(GCCVERSIONGTEQ12) $(ISCLANG))) +CCOMMON_OPT += -mtune=cortex-x1 ifneq ($(F_COMPILER), NAG) -FCOMMON_OPT += -march=armv8.2-a -mtune=cortexa72 +FCOMMON_OPT += -march=armv8.2-a -mtune=cortex-x1 +endif +else +CCOMMON_OPT += -mtune=cortex-a72 +ifneq ($(F_COMPILER), NAG) +FCOMMON_OPT += -march=armv8.2-a -mtune=cortex-a72 +endif endif endif endif @@ -283,6 +291,12 @@ CCOMMON_OPT += -march=armv8.4-a+sve ifneq ($(F_COMPILER), NAG) FCOMMON_OPT += -march=armv8.4-a+sve endif +ifeq (1, $(filter 1,$(GCCVERSIONGTEQ12) $(ISCLANG))) +CCOMMON_OPT += -mtune=cortex-x2 +ifneq ($(F_COMPILER), NAG) +FCOMMON_OPT += -mtune=cortex-x2 +endif +endif endif endif @@ -302,6 +316,12 @@ CCOMMON_OPT += -march=armv8.4-a+sve ifneq ($(F_COMPILER), NAG) FCOMMON_OPT += -march=armv8.4-a+sve endif +ifeq (1, $(filter 1,$(GCCVERSIONGTEQ12) $(ISCLANG))) +CCOMMON_OPT += -mtune=cortex-a710 +ifneq ($(F_COMPILER), NAG) +FCOMMON_OPT += -mtune=cortex-a710 +endif +endif endif endif From a14176440aeec391b9a21108bb4df8c3a61f50f8 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 10 Mar 2024 23:22:05 +0100 Subject: [PATCH 2/2] Add version macro for GCC12 --- Makefile.system | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.system b/Makefile.system index e8feac9e4..2ea407349 100644 --- a/Makefile.system +++ b/Makefile.system @@ -365,8 +365,9 @@ GCCVERSIONGT5 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \> 5) GCCVERSIONGTEQ7 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 7) GCCVERSIONGTEQ8 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 8) GCCVERSIONGTEQ9 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 9) -GCCVERSIONGTEQ11 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 11) GCCVERSIONGTEQ10 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 10) +GCCVERSIONGTEQ11 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 11) +GCCVERSIONGTEQ12 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 12) # Note that the behavior of -dumpversion is compile-time-configurable for # gcc-7.x and newer. Use -dumpfullversion there ifeq ($(GCCVERSIONGTEQ7),1)