]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/gc: use 512 bits (rather than 464) for multi-precision arithmetic
authorRobert Griesemer <gri@golang.org>
Thu, 2 Apr 2015 23:34:48 +0000 (16:34 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 3 Apr 2015 17:13:07 +0000 (17:13 +0000)
commita51d5f27e8a6fd97b27fb864cd284589c850836e
tree956de681f6418e128c2b9729060350e31f65e59b
parent14bbab47584844d2c32534564f0f3f51b76df05a
cmd/internal/gc: use 512 bits (rather than 464) for multi-precision arithmetic

The original implementation used 16 int "words" but only 29 bits per word
for a total of 16*29 = 464 bits, with a space consumption of 16*64 = 1024
bits on a 64 bit machine. Switching to 512 bits increases precision while
still using (in the worst case) half the amount of memory per mp value on
a 64 bit machine.

Also: Decreased permitted number of least-significant mantissa bits which
may be incorrect when considering if a precise floating-point constant is
an integer from 29 to 16 bits.

Change-Id: Iee9287056f0e9aa4f06ceac0724ff4674f710c53
Reviewed-on: https://go-review.googlesource.com/8429
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/internal/gc/go.go
src/cmd/internal/gc/mparith2.go
src/cmd/internal/gc/mparith3.go
test/fixedbugs/issue6889.go
test/fixedbugs/issue7740.go