]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.ssa] cmd/compile/internal/ssa: fix shift operations
authorKeith Randall <khr@golang.org>
Thu, 30 Jul 2015 00:07:09 +0000 (17:07 -0700)
committerKeith Randall <khr@golang.org>
Thu, 30 Jul 2015 17:57:12 +0000 (17:57 +0000)
commit4b803151ce02aa8372488dd6e50f26f5bc0b2120
treeda22048f4e714abf1baba4117fa836fcf4fc67ac
parentbdb2d2810de66864cd77fbe95a602d53c851d889
[dev.ssa] cmd/compile/internal/ssa: fix shift operations

Convert shift ops to also encode the size of the shift amount.

Change signed right shift from using CMOV to using bit twiddles.
It is a little bit better (5 instructions instead of 4, but fewer
bytes and slightly faster code).  It's also a bit faster than
the 4-instruction branch version, even with a very predictable
branch.  As tested on my machine, YMMV.

Implement OCOM while we are here.

Change-Id: I8ca12dd62fae5d626dc0e6da5d4bbd34fd9640d2
Reviewed-on: https://go-review.googlesource.com/12867
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/gen/genericOps.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssa/shift_test.go