Merge pull request #5 from status-im/arm64

Add Apple M1 and generic ARM64+Neon support
This commit is contained in:
Csaba Kiraly 2022-05-19 10:50:02 +02:00 committed by GitHub
commit 2a6a63923e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 7 deletions

View File

@ -38,7 +38,7 @@ When nim-leopard is installed with `nimble install leopard`, or as a dependency
In a standalone `git clone` of nim-leopard, it's necessary to init the submodule before running `nimble develop` or `nimble install` in the root of the clone
```text
$ git submodule update --init
$ git submodule update --init --recursive
```
#### Build

View File

@ -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

View File

@ -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

2
vendor/leopard vendored

@ -1 +1 @@
Subproject commit b58d1eaf59e263d25e473a3460437e19386956eb
Subproject commit 20eb7c8bc5ba41349091addd4e374d4b74e9fb07