diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2022-10-01 16:46:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-01 16:46:51 +0200 |
commit | 8d47bf1822f7d7886ff62f6d14abe405f9f68ed7 (patch) | |
tree | 15f0c680c6bfcaeb47c17f21548c1dcb74507980 /compiler/int128.nim | |
parent | cfff454cf9852be9df2020c3a2d192caaa2f418a (diff) | |
download | Nim-8d47bf1822f7d7886ff62f6d14abe405f9f68ed7.tar.gz |
new move analyser2 (#20471)
* produce better code for closure environment creation * new 'first write' analysis; * scope based move analyser * code cleanup Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
Diffstat (limited to 'compiler/int128.nim')
-rw-r--r-- | compiler/int128.nim | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/compiler/int128.nim b/compiler/int128.nim index afa07094b..d85f96084 100644 --- a/compiler/int128.nim +++ b/compiler/int128.nim @@ -57,15 +57,9 @@ proc toInt128*[T: SomeInteger | bool](arg: T): Int128 = template isNegative(arg: Int128): bool = arg.sdata(3) < 0 -template isNegative(arg: int32): bool = - arg < 0 - proc bitconcat(a, b: uint32): uint64 = (uint64(a) shl 32) or uint64(b) -proc bitsplit(a: uint64): (uint32, uint32) = - (cast[uint32](a shr 32), cast[uint32](a)) - proc toInt64*(arg: Int128): int64 = if isNegative(arg): assert(arg.sdata(3) == -1, "out of range") @@ -211,12 +205,6 @@ proc `==`*(a, b: Int128): bool = if a.udata[3] != b.udata[3]: return false return true -proc inplaceBitnot(a: var Int128) = - a.udata[0] = not a.udata[0] - a.udata[1] = not a.udata[1] - a.udata[2] = not a.udata[2] - a.udata[3] = not a.udata[3] - proc bitnot*(a: Int128): Int128 = result.udata[0] = not a.udata[0] result.udata[1] = not a.udata[1] @@ -357,18 +345,6 @@ proc low64(a: Int128): uint64 = bitconcat(a.udata[1], a.udata[0]) proc `*`*(lhs, rhs: Int128): Int128 = - let - a = cast[uint64](lhs.udata[0]) - b = cast[uint64](lhs.udata[1]) - c = cast[uint64](lhs.udata[2]) - d = cast[uint64](lhs.udata[3]) - - e = cast[uint64](rhs.udata[0]) - f = cast[uint64](rhs.udata[1]) - g = cast[uint64](rhs.udata[2]) - h = cast[uint64](rhs.udata[3]) - - let a32 = cast[uint64](lhs.udata[1]) let a00 = cast[uint64](lhs.udata[0]) let b32 = cast[uint64](rhs.udata[1]) @@ -444,11 +420,11 @@ proc divMod*(dividend, divisor: Int128): tuple[quotient, remainder: Int128] = result.remainder = dividend proc `div`*(a, b: Int128): Int128 = - let (a, b) = divMod(a, b) + let (a, _) = divMod(a, b) return a proc `mod`*(a, b: Int128): Int128 = - let (a, b) = divMod(a, b) + let (_, b) = divMod(a, b) return b proc addInt128*(result: var string; value: Int128) = |