]> Cypherpunks repositories - gostls13.git/commit
cmd/compile, math/bits: add rotate rules to PPC64.rules
authorLynn Boger <laboger@linux.vnet.ibm.com>
Tue, 29 Aug 2017 15:49:08 +0000 (11:49 -0400)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Mon, 11 Sep 2017 20:44:22 +0000 (20:44 +0000)
commitfa3fe2e3c6b90c66d60fadce59169f7a6360f001
treeaf6159805fffb4890f02d98543b0c4334980bf3a
parent4768408e5f9ef7ec42aba7e850c4727b0f16ddbe
cmd/compile, math/bits: add rotate rules to PPC64.rules

This adds rules to match the code in math/bits RotateLeft,
RotateLeft32, and RotateLef64 to allow them to be inlined.

The rules are complicated because the code in these function
use different types, and the non-const version of these
shifts generate Mask and Carry instructions that become
subexpressions during the match process.

Also adds a testcase to asm_test.go.

Improvement in math/bits:

BenchmarkRotateLeft-16       1.57     1.32      -15.92%
BenchmarkRotateLeft32-16     1.60     1.37      -14.37%
BenchmarkRotateLeft64-16     1.57     1.32      -15.92%

Updates #21390

Change-Id: Ib6f17669ecc9cab54f18d690be27e2225ca654a4
Reviewed-on: https://go-review.googlesource.com/59932
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/asm_test.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ppc64/ssa.go
src/cmd/compile/internal/ssa/config.go
src/cmd/compile/internal/ssa/gen/PPC64.rules
src/cmd/compile/internal/ssa/gen/PPC64Ops.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewritePPC64.go