aboutsummaryrefslogtreecommitdiff
path: root/src/bytes/buffer.go
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2017-08-18 08:37:58 -0400
committerCherry Zhang <cherryyz@google.com>2017-08-18 17:12:14 +0000
commit99fe3f8c63c20d675b0237665a535a8ad9783de4 (patch)
treed85092714c2390c3c235123394b0cdeed36bfb1c /src/bytes/buffer.go
parent839b28246f7ec04b6d5a8d747a84d6c8bb1c33ef (diff)
downloadgo-99fe3f8c63c20d675b0237665a535a8ad9783de4.tar.xz
cmd/compile: add rules handling unsigned div/mod by constant 1<<63
Normally 64-bit div/mod is turned into runtime calls on 32-bit arch, but the front end leaves power-of-two constant division and hopes the SSA backend turns into a shift or AND. The SSA rule is (Mod64u <t> n (Const64 [c])) && isPowerOfTwo(c) -> (And64 n (Const64 <t> [c-1])) But isPowerOfTwo returns true only for positive int64, which leaves out 1<<63 unhandled. Add a special case for 1<<63. Fixes #21517. Change-Id: I02d27dc7177d4af0ee8d7f5533714edecddf8c95 Reviewed-on: https://go-review.googlesource.com/56890 Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/bytes/buffer.go')
0 files changed, 0 insertions, 0 deletions