diff options
author | Ian Lance Taylor <iant@golang.org> | 2017-01-14 00:05:42 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-01-14 00:05:42 +0000 |
commit | c2047754c300b68c05d65faa8dc2925fe67b71b4 (patch) | |
tree | e183ae81a1f48a02945cb6de463a70c5be1b06f6 /libgo/go/math/big/decimal.go | |
parent | 829afb8f05602bb31c9c597b24df7377fed4f059 (diff) | |
download | gcc-c2047754c300b68c05d65faa8dc2925fe67b71b4.zip gcc-c2047754c300b68c05d65faa8dc2925fe67b71b4.tar.gz gcc-c2047754c300b68c05d65faa8dc2925fe67b71b4.tar.bz2 |
libgo: update to Go 1.8 release candidate 1
Compiler changes:
* Change map assignment to use mapassign and assign value directly.
* Change string iteration to use decoderune, faster for ASCII strings.
* Change makeslice to take int, and use makeslice64 for larger values.
* Add new noverflow field to hmap struct used for maps.
Unresolved problems, to be fixed later:
* Commented out test in go/types/sizes_test.go that doesn't compile.
* Commented out reflect.TestStructOf test for padding after zero-sized field.
Reviewed-on: https://go-review.googlesource.com/35231
gotools/:
Updates for Go 1.8rc1.
* Makefile.am (go_cmd_go_files): Add bug.go.
(s-zdefaultcc): Write defaultPkgConfig.
* Makefile.in: Rebuild.
From-SVN: r244456
Diffstat (limited to 'libgo/go/math/big/decimal.go')
-rw-r--r-- | libgo/go/math/big/decimal.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libgo/go/math/big/decimal.go b/libgo/go/math/big/decimal.go index 2c0c9da..2dfa032 100644 --- a/libgo/go/math/big/decimal.go +++ b/libgo/go/math/big/decimal.go @@ -125,11 +125,12 @@ func shr(x *decimal, s uint) { // read a digit, write a digit w := 0 // write index + mask := Word(1)<<s - 1 for r < len(x.mant) { ch := Word(x.mant[r]) r++ d := n >> s - n -= d << s + n &= mask // n -= d << s x.mant[w] = byte(d + '0') w++ n = n*10 + ch - '0' @@ -138,7 +139,7 @@ func shr(x *decimal, s uint) { // write extra digits that still fit for n > 0 && w < len(x.mant) { d := n >> s - n -= d << s + n &= mask x.mant[w] = byte(d + '0') w++ n = n * 10 @@ -148,7 +149,7 @@ func shr(x *decimal, s uint) { // append additional digits that didn't fit for n > 0 { d := n >> s - n -= d << s + n &= mask x.mant = append(x.mant, byte(d+'0')) n = n * 10 } |