aboutsummaryrefslogtreecommitdiff
path: root/test/codegen/shift.go
diff options
context:
space:
mode:
authorXiaolin Zhao <zhaoxiaolin@loongson.cn>2025-08-21 16:52:02 +0800
committerGopher Robot <gobot@golang.org>2025-08-21 11:16:49 -0700
commitfa706ea50fd0b9bf36d642d3bb8eeb732caafc7f (patch)
tree90116ccf17cc900044a65d837b6c236c28608bc8 /test/codegen/shift.go
parentffc85ee1f1c865c953920f966a8401d963b102ca (diff)
downloadgo-fa706ea50fd0b9bf36d642d3bb8eeb732caafc7f.tar.xz
cmd/compile: optimize rule (x + x) << c to x << c+1 on loong64
Change-Id: I782f93510bba92ba60b298c1c1cde456c8bcec38 Reviewed-on: https://go-review.googlesource.com/c/go/+/697956 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org>
Diffstat (limited to 'test/codegen/shift.go')
-rw-r--r--test/codegen/shift.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/codegen/shift.go b/test/codegen/shift.go
index 0e4cf1ed8d..3ab0fcfabc 100644
--- a/test/codegen/shift.go
+++ b/test/codegen/shift.go
@@ -121,21 +121,25 @@ func rshConst64x32(v int64) int64 {
func lshConst32x1Add(x int32) int32 {
// amd64:"SHLL\t[$]2"
+ // loong64:"SLL\t[$]2"
return (x + x) << 1
}
func lshConst64x1Add(x int64) int64 {
// amd64:"SHLQ\t[$]2"
+ // loong64:"SLLV\t[$]2"
return (x + x) << 1
}
func lshConst32x2Add(x int32) int32 {
// amd64:"SHLL\t[$]3"
+ // loong64:"SLL\t[$]3"
return (x + x) << 2
}
func lshConst64x2Add(x int64) int64 {
// amd64:"SHLQ\t[$]3"
+ // loong64:"SLLV\t[$]3"
return (x + x) << 2
}