From e0e642e97830ab9786fdbb4cc32e5bc4707fe028 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Tue, 17 May 2022 15:15:01 +0200 Subject: [PATCH 1/3] avoid X86 specific code on ARM Signed-off-by: Csaba Kiraly --- leopard/utils.nim | 7 +++++-- leopard/utils/allocs.nim | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/leopard/utils.nim b/leopard/utils.nim index ab63788..d175d2b 100644 --- a/leopard/utils.nim +++ b/leopard/utils.nim @@ -1,4 +1,7 @@ import ./utils/allocs -import ./utils/cpuinfo_x86 -export cpuinfo_x86, allocs +when defined(amd64) or defined(i386): + import ./utils/cpuinfo_x86 + export cpuinfo_x86 + +export allocs diff --git a/leopard/utils/allocs.nim b/leopard/utils/allocs.nim index 4992655..671ffb6 100644 --- a/leopard/utils/allocs.nim +++ b/leopard/utils/allocs.nim @@ -14,12 +14,15 @@ push: {.upraises: [].} import system/ansi_c -import ./cpuinfo_x86 +when defined(amd64) or defined(i386): + import ./cpuinfo_x86 ## inspired by https://github.com/mratsim/weave/blob/master/weave/memory/allocs.nim -let - LeoAlignBytes* = if hasAvx2(): 32'u else: 16'u +when defined(amd64) or defined(i386): + let LeoAlignBytes* = if hasAvx2(): 32'u else: 16'u +else: + let LeoAlignBytes* = 16'u when defined(windows): proc alignedAllocWindows(size, alignment: csize_t): pointer From e07e7c90d83213fea7ac1b7cc3b44a1b636dc006 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Tue, 17 May 2022 15:15:26 +0200 Subject: [PATCH 2/3] add ARM support in underlying leopard library Signed-off-by: Csaba Kiraly --- vendor/leopard | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/leopard b/vendor/leopard index b58d1ea..20eb7c8 160000 --- a/vendor/leopard +++ b/vendor/leopard @@ -1 +1 @@ -Subproject commit b58d1eaf59e263d25e473a3460437e19386956eb +Subproject commit 20eb7c8bc5ba41349091addd4e374d4b74e9fb07 From 7d922ca9a0f6d4f2ac1fa64268a2294d07496922 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Tue, 17 May 2022 19:29:38 +0200 Subject: [PATCH 3/3] change README: recursive git submodule update now that leopard uses sse2neon as a submodule, we need recursive clone. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 24e4446..a777ac5 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ When nim-leopard is installed with `nimble install leopard`, or as a dependency If the nim-leopard repo is cloned directly, then before running `nimble develop` or `nimble install` in the root of the clone, it's necessary to init the submodule ```text -$ git submodule update --init +$ git submodule update --init --recursive ``` #### Build