fix bugs found by nim-devel

This commit is contained in:
jangko 2023-06-14 13:53:42 +07:00
parent 1ce276db1e
commit ddcb2111e4
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
2 changed files with 6 additions and 8 deletions

View File

@ -44,14 +44,12 @@ func div2n1n_128*(q, r: var uint64, n_hi, n_lo, d: uint64) {.inline.}=
when defined(cpp):
asm """
divq %[divisor]
: "=a" (`q`), "=d" (`r`)
: "d" (`n_hi`), "a" (`n_lo`), [divisor] "rm" (`d`)
:
:"=a" (`q`), "=d" (`r`)
:"d" (`n_hi`), "a" (`n_lo`), [divisor] "rm" (`d`)
"""
else:
asm """
divq %[divisor]
: "=a" (`*q`), "=d" (`*r`)
: "d" (`n_hi`), "a" (`n_lo`), [divisor] "rm" (`d`)
:
:"=a" (*`q`), "=d" (*`r`)
:"d" (`n_hi`), "a" (`n_lo`), [divisor] "rm" (`d`)
"""

View File

@ -40,7 +40,7 @@ func setOne*(a: var StUint) =
func zero*[bits: static[int]](T: typedesc[StUint[bits]]): T {.inline.} =
## Returns the zero of the input type
discard
result.setZero
func one*[bits: static[int]](T: typedesc[StUint[bits]]): T {.inline.} =
## Returns the one of the input type
@ -51,7 +51,7 @@ func high*[bits](_: typedesc[StUint[bits]]): StUint[bits] {.inline.} =
result[i] = high(Word)
func low*[bits](_: typedesc[StUint[bits]]): StUint[bits] {.inline.} =
discard
result.setZero
{.pop.}
# Comparisons