Skip to content

Commit

Permalink
only compile assembly modules on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
arnetheduck committed Apr 2, 2024
1 parent a300d24 commit cb1fad1
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions hashtree_abi.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ const srcDir = currentSourcePath.parentDir.replace('\\', '/') & "/src/"

{.compile: srcDir & "hashtree.c".}

when defined(arm64):
{.compile: srcDir & "sha256_armv8_neon_x1.S".}
{.compile: srcDir & "sha256_armv8_neon_x4.S".}

elif defined(amd64):
{.compile: srcDir & "sha256_avx_x1.S".}
{.compile: srcDir & "sha256_avx_x4.S".}
{.compile: srcDir & "sha256_avx_x8.S".}
{.compile: srcDir & "sha256_avx_x16.S".}
{.compile: srcDir & "sha256_shani.S".}
{.compile: srcDir & "sha256_sse_x1.S".}
# The assembly syntax used doesn't work on other platforms for the time being
when defined(linux):
when defined(arm64):
{.compile: srcDir & "sha256_armv8_neon_x1.S".}
{.compile: srcDir & "sha256_armv8_neon_x4.S".}

elif defined(amd64):
{.compile: srcDir & "sha256_avx_x1.S".}
{.compile: srcDir & "sha256_avx_x4.S".}
{.compile: srcDir & "sha256_avx_x8.S".}
{.compile: srcDir & "sha256_avx_x16.S".}
{.compile: srcDir & "sha256_shani.S".}
{.compile: srcDir & "sha256_sse_x1.S".}

type HashFcn* = proc(output: pointer, input: pointer, count: uint64) {.
cdecl, noSideEffect, gcsafe, raises: [].}
Expand Down

0 comments on commit cb1fad1

Please sign in to comment.