mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
math/big: disable some tests on 32bit platforms (fix build)
TBR: adonovan Change-Id: I59757b5b46a2c533fc5f888423c99d550d3c7648 Reviewed-on: https://go-review.googlesource.com/3264 Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
bd275b2381
commit
3acb9fd98e
2 changed files with 30 additions and 4 deletions
|
|
@ -357,12 +357,18 @@ func nlz(x Word) uint {
|
|||
return _W - uint(bitLen(x))
|
||||
}
|
||||
|
||||
// TODO(gri) this assumes a Word is 64 bits
|
||||
func nlz64(x uint64) uint {
|
||||
if _W != 64 {
|
||||
panic("size mismatch")
|
||||
// TODO(gri) this can be done more nicely
|
||||
if _W == 32 {
|
||||
if x>>32 == 0 {
|
||||
return 32 + nlz(Word(x))
|
||||
}
|
||||
return nlz(Word(x >> 32))
|
||||
}
|
||||
return nlz(Word(x))
|
||||
if _W == 64 {
|
||||
return nlz(Word(x))
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
// SetUint64 sets z to x and returns z.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue