summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-06-24 09:19:02 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-06-24 09:19:02 +0200
commite90d91f0e463e870c49a7558d216fff03a581949 (patch)
treeebfaa523ffaf0545e4bf3c2bf334250f7efa1b9d /lib/system
parent800bc661b674c071e829b8a959c0966a38ae710e (diff)
downloadNim-e90d91f0e463e870c49a7558d216fff03a581949.tar.gz
[refactoring] remove zeroExtend and friends from the compiler builtins. (#11531)
* remove zeroExtend and friends from the compiler builtins.
* fix jssys
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/jssys.nim33
1 files changed, 17 insertions, 16 deletions
diff --git a/lib/system/jssys.nim b/lib/system/jssys.nim
index 27dd9b020..077c81d59 100644
--- a/lib/system/jssys.nim
+++ b/lib/system/jssys.nim
@@ -475,26 +475,27 @@ proc absInt(a: int): int {.compilerproc.} =
 proc absInt64(a: int64): int64 {.compilerproc.} =
   result = if a < 0: a*(-1) else: a
 
-proc ze*(a: int): int {.compilerproc.} =
-  result = a
+when not defined(nimNoZeroExtendMagic):
+  proc ze*(a: int): int {.compilerproc.} =
+    result = a
 
-proc ze64*(a: int64): int64 {.compilerproc.} =
-  result = a
+  proc ze64*(a: int64): int64 {.compilerproc.} =
+    result = a
 
-proc toU8*(a: int): int8 {.asmNoStackFrame, compilerproc.} =
-  asm """
-    return `a`;
-  """
+  proc toU8*(a: int): int8 {.asmNoStackFrame, compilerproc.} =
+    asm """
+      return `a`;
+    """
 
-proc toU16*(a: int): int16 {.asmNoStackFrame, compilerproc.} =
-  asm """
-    return `a`;
-  """
+  proc toU16*(a: int): int16 {.asmNoStackFrame, compilerproc.} =
+    asm """
+      return `a`;
+    """
 
-proc toU32*(a: int64): int32 {.asmNoStackFrame, compilerproc.} =
-  asm """
-    return `a`;
-  """
+  proc toU32*(a: int64): int32 {.asmNoStackFrame, compilerproc.} =
+    asm """
+      return `a`;
+    """
 
 proc nimMin(a, b: int): int {.compilerproc.} = return if a <= b: a else: b
 proc nimMax(a, b: int): int {.compilerproc.} = return if a >= b: a else: b