aboutsummaryrefslogtreecommitdiff
path: root/test/codegen/arithmetic.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2024-11-11 12:21:14 -0800
committerKeith Randall <khr@google.com>2025-05-01 09:33:31 -0700
commit12110c3f7ed378cd1819abf72ffadcb18502c127 (patch)
tree7c17fc207c8ead3e724f82557c35cedd659ba022 /test/codegen/arithmetic.go
parent4d10d4ad849467f12a1a16a5ade26cc03d8f1a1f (diff)
downloadgo-12110c3f7ed378cd1819abf72ffadcb18502c127.tar.xz
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>
Diffstat (limited to 'test/codegen/arithmetic.go')
-rw-r--r--test/codegen/arithmetic.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/codegen/arithmetic.go b/test/codegen/arithmetic.go
index 530891293e..7bac85eb6c 100644
--- a/test/codegen/arithmetic.go
+++ b/test/codegen/arithmetic.go
@@ -649,7 +649,7 @@ func constantFold2(i0, j0, i1, j1 int) (int, int) {
}
func constantFold3(i, j int) int {
- // arm64: "MOVD\t[$]30","MUL",-"ADD",-"LSL"
+ // arm64: "LSL\t[$]5,","SUB\tR[0-9]+<<1,",-"ADD"
// ppc64x:"MULLD\t[$]30","MULLD"
r := (5 * i) * (6 * j)
return r