]> Cypherpunks repositories - gostls13.git/commit
math/big: make nat.setUint64 vet-friendly
authorJosh Bleecher Snyder <josharian@gmail.com>
Fri, 10 Mar 2017 23:09:05 +0000 (15:09 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Sat, 11 Mar 2017 00:39:23 +0000 (00:39 +0000)
commit2de773d45f202d38c981a433880e867a7b5d0745
tree90296b8a1365c40881e365c4ce807bf077272607
parent95c5227c15da3c0c61eeea70f0a8288088301b98
math/big: make nat.setUint64 vet-friendly

nat.setUint64 is nicely generic.
By assuming 32- or 64-bit words, however,
we can write simpler code,
and eliminate some shifts
in dead code that vet complains about.

Generated code for 64 bit systems is unaltered.
Generated code for 32 bit systems is much better.
For 386, the routine length drops from 325
bytes of code to 271 bytes of code, with fewer loops.

Change-Id: I1bc14c06272dee37a7fcb48d33dd1e621eba945d
Reviewed-on: https://go-review.googlesource.com/38070
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/vet/all/whitelist/64bit.txt
src/math/big/nat.go