summary refs log tree commit diff stats
diff options
context:
space:
mode:
authornarimiran <narimiran@disroot.org>2019-06-04 12:29:52 +0200
committernarimiran <narimiran@disroot.org>2019-06-04 12:29:52 +0200
commit1f883f6d789309ca516f70ad2024cbc74889c359 (patch)
treef336c76ea70c411dda3e53ce4fc81ab3578dcf0b
parent5f4e8dc4c9f4a7046b79c247c5b0f0198b74b60b (diff)
downloadNim-1f883f6d789309ca516f70ad2024cbc74889c359.tar.gz
better documentation for the new `shr`
-rw-r--r--lib/system.nim10
-rw-r--r--testament/important_packages.nim4
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/system.nim b/lib/system.nim
index ca8eade71..778ce37ab 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1291,8 +1291,12 @@ when defined(nimNewShiftOps):
       ##
       ## .. code-block:: Nim
       ##   0b0001_0000'i8 shr 2 == 0b0000_0100'i8
-      ##   0b1000_0000'i8 shr 8 == 0b0000_0000'i8
       ##   0b0000_0001'i8 shr 1 == 0b0000_0000'i8
+      ##   0b1000_0000'i8 shr 4 == 0b1111_1000'i8
+      ##   -1 shr 5 == -1
+      ##   1 shr 5 == 0
+      ##   16 shr 2 == 4
+      ##   -16 shr 2 == -4
     proc `shr`*(x: int8, y: SomeInteger): int8 {.magic: "AshrI", noSideEffect.}
     proc `shr`*(x: int16, y: SomeInteger): int16 {.magic: "AshrI", noSideEffect.}
     proc `shr`*(x: int32, y: SomeInteger): int32 {.magic: "AshrI", noSideEffect.}
@@ -3387,8 +3391,8 @@ else:
 
 
 when not defined(JS):
-  proc likelyProc(val: bool): bool {.importc: "NIM_LIKELY", nodecl, nosideeffect.}
-  proc unlikelyProc(val: bool): bool {.importc: "NIM_UNLIKELY", nodecl, nosideeffect.}
+  proc likelyProc(val: bool): bool {.importc: "likely", nodecl, nosideeffect.}
+  proc unlikelyProc(val: bool): bool {.importc: "unlikely", nodecl, nosideeffect.}
 
 template likely*(val: bool): bool =
   ## Hints the optimizer that `val` is likely going to be true.
diff --git a/testament/important_packages.nim b/testament/important_packages.nim
index 5383433c0..fbd97c96d 100644
--- a/testament/important_packages.nim
+++ b/testament/important_packages.nim
@@ -36,7 +36,7 @@ pkg "iterutils"
 pkg "jstin"
 pkg "karax", "nim c -r tests/tester.nim"
 pkg "loopfusion"
-# pkg "msgpack4nim"
+pkg "msgpack4nim"
 pkg "nake", "nim c nakefile.nim"
 pkg "neo", "nim c -d:blas=openblas tests/all.nim", true
 # pkg "nico", "", true
@@ -52,7 +52,7 @@ pkg "nimgen", "nim c -o:nimgenn -r src/nimgen/runcfg.nim", true
 # pkg "nimly", "nim c -r tests/test_nimly", true
 # pkg "nimongo", "nimble test_ci", true
 pkg "nimpy", "nim c -r tests/nimfrompy.nim"
-# pkg "nimquery"
+pkg "nimquery"
 pkg "nimsl", "", true
 pkg "nimsvg"
 pkg "nimx", "nim c --threads:on test/main.nim", true