summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBrent Pedersen <bpederse@gmail.com>2019-09-11 08:35:44 -0600
committerBrent Pedersen <bpederse@gmail.com>2019-09-11 08:35:44 -0600
commit5a520a845481658c4be5ce6386ea2814db4fe330 (patch)
treec26812588dc543752359383c3573392818ecbe3c
parent81c23bba7bc724519e812202742d4df2325d11d0 (diff)
downloadNim-5a520a845481658c4be5ce6386ea2814db4fe330.tar.gz
only do 64bts on x86
-rw-r--r--lib/system/sets.nim7
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])))