]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: optimize shift when counter has different type.
authorAlexandru Moșoi <brtzsnr@gmail.com>
Thu, 23 Mar 2017 21:29:59 +0000 (22:29 +0100)
committerAlexandru Moșoi <alexandru@mosoi.ro>
Fri, 24 Mar 2017 06:59:33 +0000 (06:59 +0000)
commit3e63cdf8507709ebfb0906a3dbdc14c402cc0cd6
tree6733b75140108f4e1b10dd21c7be815b6fc5cb4d
parentd039d01fe9786a35ba4f6beea79ff2e964990c97
cmd/compile: optimize shift when counter has different type.

We already handle n << (uint64(c)&63).
This change also handles n << (uint8(c)&63)
where the SSA compiler promotes the counter to 32 bits.

Fixes #19681

Change-Id: I9327d64a994286aa0dbf76eb995578880be6923a
Reviewed-on: https://go-review.googlesource.com/38550
Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/rewriteAMD64.go