-
- Downloads
cmd/compile: rewrite 2*x+c into LEAx1 on amd64
Rewrite x<<1+c into x+x+c, which can be expressed as a single LEAQ/LEAL. Bit of a special case, but the single-instruction LEA is both shorter and faster than SHL then ADD. Triggers 293 times during make.bash. Change-Id: I3f09c8e9a8f3859d1eeed336f095fc3ada79c2c1 Reviewed-on: https://go-review.googlesource.com/108938 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:Keith Randall <khr@golang.org>
Showing
- src/cmd/compile/internal/ssa/gen/AMD64.rules 1 addition, 0 deletionssrc/cmd/compile/internal/ssa/gen/AMD64.rules
- src/cmd/compile/internal/ssa/rewriteAMD64.go 42 additions, 1 deletionsrc/cmd/compile/internal/ssa/rewriteAMD64.go
- test/codegen/arithmetic.go 5 additions, 0 deletionstest/codegen/arithmetic.go
Please register or sign in to comment