diff options
author | Brent Pedersen <bpederse@gmail.com> | 2019-09-11 08:35:44 -0600 |
---|---|---|
committer | Brent Pedersen <bpederse@gmail.com> | 2019-09-11 08:35:44 -0600 |
commit | 5a520a845481658c4be5ce6386ea2814db4fe330 (patch) | |
tree | c26812588dc543752359383c3573392818ecbe3c | |
parent | 81c23bba7bc724519e812202742d4df2325d11d0 (diff) | |
download | Nim-5a520a845481658c4be5ce6386ea2814db4fe330.tar.gz |
only do 64bts on x86
-rw-r--r-- | lib/system/sets.nim | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/system/sets.nim b/lib/system/sets.nim index ea92c3ca3..4835bef1e 100644 --- a/lib/system/sets.nim +++ b/lib/system/sets.nim @@ -31,9 +31,10 @@ proc countBits64(n: uint64): int {.compilerproc, inline.} = proc cardSet(s: NimSet, len: int): int {.compilerproc, inline.} = var j = -1 - for i in countup(0, len - 8, 8): - inc(result, countBits64((cast[ptr uint64](s[i].unsafeAddr))[])) - j = i + 7 + when defined(x86): + for i in countup(0, len - 8, 8): + inc(result, countBits64((cast[ptr uint64](s[i].unsafeAddr))[])) + j = i + 7 for i in (j + 1) ..< len: inc(result, countBits32(uint32(s[i]))) |