diff options
Diffstat (limited to 'lib/system.nim')
-rw-r--r-- | lib/system.nim | 10 |
1 files changed, 7 insertions, 3 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. |