]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: improve multiplication strength reduction
authorKeith Randall <khr@golang.org>
Mon, 11 Nov 2024 20:21:14 +0000 (12:21 -0800)
committerKeith Randall <khr@google.com>
Thu, 1 May 2025 16:33:31 +0000 (09:33 -0700)
commit12110c3f7ed378cd1819abf72ffadcb18502c127
tree7c17fc207c8ead3e724f82557c35cedd659ba022
parent4d10d4ad849467f12a1a16a5ade26cc03d8f1a1f
cmd/compile: improve multiplication strength reduction

Use an automatic algorithm to generate strength reduction code.
You give it all the linear combination (a*x+b*y) instructions in your
architecture, it figures out the rest.

Just amd64 and arm64 for now.

Fixes #67575

Change-Id: I35c69382bebb1d2abf4bb4e7c43fd8548c6c59a1
Reviewed-on: https://go-review.googlesource.com/c/go/+/626998
Reviewed-by: Jakub Ciolek <jakub@ciolek.dev>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
12 files changed:
src/cmd/compile/internal/ssa/_gen/AMD64.rules
src/cmd/compile/internal/ssa/_gen/ARM64.rules
src/cmd/compile/internal/ssa/_gen/ARM64latelower.rules
src/cmd/compile/internal/ssa/_gen/rulegen.go
src/cmd/compile/internal/ssa/config.go
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssa/rewriteARM64.go
src/cmd/compile/internal/ssa/rewriteARM64latelower.go
src/cmd/compile/internal/test/mulconst_test.go
test/codegen/arithmetic.go
test/codegen/multiply.go [new file with mode: 0644]