]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: int64(uint64 >> x) >= 0 if x > 0
authorJosh Bleecher Snyder <josharian@gmail.com>
Wed, 13 Mar 2019 21:36:34 +0000 (14:36 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 14 Mar 2019 00:03:38 +0000 (00:03 +0000)
commit66f5d4e03500bf5085d10eb5ffd89bf33b7d2b9f
tree131a2f21aac3351877dc18ce012c3b14d8685bc3
parent61945fc5022e36ae88758f2c4e8f7c29f0824ae0
cmd/compile: int64(uint64 >> x) >= 0 if x > 0

This rewrite rule triggers only once, in math/big.quotToFloat64,
as part of converting a uint64 to a float64.

Nevertheless, it is cheap; let's add it.

Change-Id: I3ed4a197a559110fec1bc04b3a8abb4c7fcc2c89
Reviewed-on: https://go-review.googlesource.com/c/go/+/167500
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/gen/generic.rules
src/cmd/compile/internal/ssa/rewritegeneric.go