fix bugs found by nim-devel
This commit is contained in:
parent
1ce276db1e
commit
ddcb2111e4
|
@ -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`)
|
||||
"""
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue