[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCHv5 08/46] arch/arm64: Add processor optimization GCC flags for arm64


  • To: <minios-devel@xxxxxxxxxxxxxxxxxxxx>, <simon.kuenzer@xxxxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Fri, 10 Aug 2018 07:07:58 +0000
  • Authentication-results: spf=fail (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=arm.com;
  • Cc: Kaly.Xin@xxxxxxx, nd@xxxxxxx, wei.chen@xxxxxxx
  • Delivery-date: Fri, 10 Aug 2018 07:09:22 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Nodisclaimer: True
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

From: Wei Chen <Wei.Chen@xxxxxxx>

We added several Arm64 CPU models in support list. In this patch,
we check the GCC version and add optimization GCC flags for
selected processor.

Current supported Arm64 CPU models:
native, generic, cortex-a53, cortex-a57, cortex-a72, cortex-a73,
cortex-a55 and cortex-a75.

Signed-off-by: Wei Chen <Wei.Chen@xxxxxxx>
---
 arch/arm/arm64/Compiler.uk |  6 ++++
 arch/arm/arm64/Makefile.uk | 59 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+)
 create mode 100644 arch/arm/arm64/Compiler.uk
 create mode 100644 arch/arm/arm64/Makefile.uk

diff --git a/arch/arm/arm64/Compiler.uk b/arch/arm/arm64/Compiler.uk
new file mode 100644
index 0000000..4572013
--- /dev/null
+++ b/arch/arm/arm64/Compiler.uk
@@ -0,0 +1,6 @@
+# set cross compile
+ifeq ($(CONFIG_CROSS_COMPILE),)
+ifneq ($(CONFIG_UK_ARCH),$(HOSTARCH))
+       CONFIG_CROSS_COMPILE := aarch64-linux-gnu-
+endif
+endif
diff --git a/arch/arm/arm64/Makefile.uk b/arch/arm/arm64/Makefile.uk
new file mode 100644
index 0000000..d4ba7e3
--- /dev/null
+++ b/arch/arm/arm64/Makefile.uk
@@ -0,0 +1,59 @@
+ASFLAGS  += -D__ARM_64__
+CFLAGS   += -D__ARM_64__ -fms-extensions
+CXXFLAGS += -D__ARM_64__ -fms-extensions
+
+# GCC support -mcpu=native for arm64 from 6.0
+ifeq ($(CONFIG_MARCH_ARM64_NATIVE),y)
+$(call error_if_gcc_version_lt,6,0)
+CFLAGS-$(call gcc_version_ge,6,0)      += -mcpu=native
+CXXFLAGS-$(call gcc_version_ge,6,0)    += -mcpu=native
+endif
+
+# GCC support -mcpu=generic for arm64 from 4.8
+ifeq ($(CONFIG_MARCH_ARM64_GENERIC),y)
+$(call error_if_gcc_version_lt,4,8)
+CFLAGS-$(call gcc_version_ge,4,8)      += -march=armv8-a -mcpu=generic 
-mtune=generic
+CXXFLAGS-$(call gcc_version_ge,4,8)    += -march=armv8-a -mcpu=generic 
-mtune=generic
+endif
+
+# GCC support -mcpu=cortex-a53 for arm64 from 4.9
+ifeq ($(CONFIG_MARCH_ARM64_CORTEXA53),y)
+$(call error_if_gcc_version_lt,4,9)
+CFLAGS-$(call gcc_version_ge,4,9)      += -march=armv8-a -mcpu=cortex-a53 
-mtune=cortex-a53
+CXXFLAGS-$(call gcc_version_ge,4,9)    += -march=armv8-a -mcpu=cortex-a53 
-mtune=cortex-a53
+endif
+
+# GCC support -mcpu=cortex-a57 for arm64 from 4.9
+ifeq ($(CONFIG_MARCH_ARM64_CORTEXA57),y)
+$(call error_if_gcc_version_lt,4,9)
+CFLAGS-$(call gcc_version_ge,4,9)      += -march=armv8-a -mcpu=cortex-a57 
-mtune=cortex-a57
+CXXFLAGS-$(call gcc_version_ge,4,9)    += -march=armv8-a -mcpu=cortex-a57 
-mtune=cortex-a57
+endif
+
+# GCC support -mcpu=cortex-a72 for arm64 from 5.0
+ifeq ($(CONFIG_MARCH_ARM64_CORTEXA72),y)
+$(call error_if_gcc_version_lt,5,0)
+CFLAGS-$(call gcc_version_ge,5,0)      += -march=armv8-a -mcpu=cortex-a72 
-mtune=cortex-a72
+CXXFLAGS-$(call gcc_version_ge,5,0)    += -march=armv8-a -mcpu=cortex-a72 
-mtune=cortex-a72
+endif
+
+# GCC support -mcpu=cortex-a73 for arm64 from 7.0
+ifeq ($(CONFIG_MARCH_ARM64_CORTEXA73),y)
+$(call error_if_gcc_version_lt,7,0)
+CFLAGS-$(call gcc_version_ge,7,0)      += -march=armv8-a -mcpu=cortex-a73 
-mtune=cortex-a73
+CXXFLAGS-$(call gcc_version_ge,7,0)    += -march=armv8-a -mcpu=cortex-a73 
-mtune=cortex-a73
+endif
+
+# GCC support -mcpu=cortex-a55 for arm64 from 8.0
+ifeq ($(CONFIG_MARCH_ARM64_CORTEXA55),y)
+$(call error_if_gcc_version_lt,8,0)
+CFLAGS-$(call gcc_version_ge,8,0)      += -march=armv8.2-a -mcpu=cortex-a55 
-mtune=cortex-a55
+CXXFLAGS-$(call gcc_version_ge,8,0)    += -march=armv8.2-a -mcpu=cortex-a55 
-mtune=cortex-a55
+endif
+
+# GCC support -mcpu=cortex-a75 for arm64 from 8.0
+ifeq ($(CONFIG_MARCH_ARM64_CORTEXA75),y)
+$(call error_if_gcc_version_lt,8,0)
+CFLAGS-$(call gcc_version_ge,8,0)      += -march=armv8.2-a -mcpu=cortex-a75 
-mtune=cortex-a75
+CXXFLAGS-$(call gcc_version_ge,8,0)    += -march=armv8.2-a -mcpu=cortex-a75 
-mtune=cortex-a75
+endif
-- 
2.17.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.