Skip to contentSkip to conversation

CodeSamples: Add arm64 support

PATCH Applied Akira Yokosawa 2 participants 4 messages Jul 11, 2017

lore
Share & tools
lore
#0 lore raw

cover CodeSamples: Add arm64 support

From 1908602500df34619ec496c787546d5584d01221 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Wed, 12 Jul 2017 00:01:30 +0900
Subject: [PATCH 0/2] CodeSamples: Add arm64 support

Hi Paul,

So, this patch set adds arm64 support for CodeSamples.

Patch 1 is a followup of the previous patch set. I missed the dependency to the custom header file.
Patch 2 is the addition of arm64 support. It is based on arm support files. I appended an "ish" operand to "dmb" in the definition of smp_mp(). Looks like the same change is necessary in arch-arm/arch-arm.h, but this patch doesn't touch it.
Also, I rewrote the definition of get_timestamp() by using clock_gettime() instead of gettimeofday(). For arm64 host, we can expect clock_gettime() is supported.
In Makefile.arch, I chose the flags -mcpu=native and -mtune=native, since this Makefile is intended for native build.
This is compile tested on an ARMv8 host. I didn't have enough time to run all the programs. I tested a few under count/ and defer/ sub-directories.

Thanks. Akira
--
Akira Yokosawa (2):
advsync: Add dependency to $(CUSTOM_HEADER)
CodeSamples: Add arm64 support

 CodeSamples/advsync/herd/Makefile    |  2 +-
 CodeSamples/arch-arm64/Makefile.arch |  2 ++
 CodeSamples/arch-arm64/arch-arm64.h  | 61 ++++++++++++++++++++++++++++++++++++
 CodeSamples/depends.mk               |  5 +++
 4 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 CodeSamples/arch-arm64/Makefile.arch
 create mode 100644 CodeSamples/arch-arm64/arch-arm64.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 advsync: Add dependency to $(CUSTOM_HEADER)

From 69493e126b70589656c3331d34865d2a57b5cf36 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 9 Jul 2017 12:18:19 +0900
Subject: [PATCH 1/2] advsync: Add dependency to $(CUSTOM_HEADER)

---
 CodeSamples/advsync/herd/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
CodeSamples/advsync/herd/Makefile +1 -1
index 056f5f9..96c4495 100644
@@ -8,7 +8,7 @@ CUSTOM_HEADER := $(wildcard *.h)
 
 all: $(LITMUS_OUT)
 
-%.litmus.out: %.litmus
+%.litmus.out: %.litmus $(CUSTOM_HEADER)
 	litmus7 -r 1000 -carch X86 -ccopts "$(CCOPTS)" $< > $@ 2>&1
 
 cross-x86: TARGET = X86
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 CodeSamples: Add arm64 support

In reply to Akira Yokosawa

From 1908602500df34619ec496c787546d5584d01221 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 10 Jul 2017 23:46:32 +0900
Subject: [PATCH 2/2] CodeSamples: Add arm64 support

---
 CodeSamples/arch-arm64/Makefile.arch |  2 ++
 CodeSamples/arch-arm64/arch-arm64.h  | 61 ++++++++++++++++++++++++++++++++++++
 CodeSamples/depends.mk               |  5 +++
 3 files changed, 68 insertions(+)
 create mode 100644 CodeSamples/arch-arm64/Makefile.arch
 create mode 100644 CodeSamples/arch-arm64/arch-arm64.h
CodeSamples/arch-arm64/Makefile.arch new file +2 -0
new file mode 100644
index 0000000..b886373
@@ -0,0 +1,2 @@
+# http://www.ibm.com/developerworks/wikis/display/hpccentral/Tuning+options+to+consider+with+gcc#Tuningoptionstoconsiderwithgcc-mcpuandmtune
+GCC_ARGS=-g -O3 -Wall -mcpu=native -mtune=native
CodeSamples/arch-arm64/arch-arm64.h new file +61 -0

61 lines not on this page · raw message

CodeSamples/depends.mk +5 -0
index 8eb45b4..77a76bf 100644
@@ -10,6 +10,8 @@ else ifeq ($(arch),ppc64)
 target := ppc64
 else ifeq ($(arch),ppc64le)
 target := ppc64
+else ifeq ($(arch),aarch64)
+target := arm64
 else ifneq (,$(findstring arm,$(arch)))
 target := arm
 else
@@ -27,6 +29,9 @@ arch_depend := $(top)/arch-ppc64/Makefile.arch
 else ifeq ($(target),arm)
 api_depend := $(top)/arch-arm/arch-arm.h
 arch_depend := $(top)/arch-arm/Makefile.arch
+else ifeq ($(target),arm64)
+api_depend := $(top)/arch-arm64/arch-arm64.h
+arch_depend := $(top)/arch-arm64/Makefile.arch
 else
 api_depend :=
 arch_depend :=
Signature · 1 line
2.7.4
#3 lore raw
In reply to Akira Yokosawa
Quoted 9 lines · Akira Yokosawa
Quoted 1 line

From 1908602500df34619ec496c787546d5584d01221 Mon Sep 17 00:00:00 2001

From: Akira Yokosawa <[email protected]>
Date: Wed, 12 Jul 2017 00:01:30 +0900
Subject: [PATCH 0/2] CodeSamples: Add arm64 support

Hi Paul,

So, this patch set adds arm64 support for CodeSamples.

Quoted 13 lines

Patch 1 is a followup of the previous patch set. I missed the dependency to the custom header file.
Patch 2 is the addition of arm64 support. It is based on arm support files. I appended an "ish" operand to "dmb" in the definition of smp_mp(). Looks like the same change is necessary in arch-arm/arch-arm.h, but this patch doesn't touch it.
Also, I rewrote the definition of get_timestamp() by using clock_gettime() instead of gettimeofday(). For arm64 host, we can expect clock_gettime() is supported.
In Makefile.arch, I chose the flags -mcpu=native and -mtune=native, since this Makefile is intended for native build.
This is compile tested on an ARMv8 host. I didn't have enough time to run all the programs. I tested a few under count/ and defer/ sub-directories.

I queued and pushed these, thank you! If bugs appear, we will fix them.

Thanx, Paul

Quoted 17 lines

Thanks. Akira
--
Akira Yokosawa (2):
advsync: Add dependency to $(CUSTOM_HEADER)
CodeSamples: Add arm64 support

 CodeSamples/advsync/herd/Makefile    |  2 +-
 CodeSamples/arch-arm64/Makefile.arch |  2 ++
 CodeSamples/arch-arm64/arch-arm64.h  | 61 ++++++++++++++++++++++++++++++++++++
 CodeSamples/depends.mk               |  5 +++
 4 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 CodeSamples/arch-arm64/Makefile.arch
 create mode 100644 CodeSamples/arch-arm64/arch-arm64.h
Signature · 1 line
2.7.4