aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
authorXiaolin Zhao <zhaoxiaolin@loongson.cn>2025-09-16 15:27:42 +0800
committerabner chenc <chenguoqi@loongson.cn>2025-09-17 18:05:31 -0700
commit78ef487a6f936a39e9d4ebf66ac421bb1244a7a9 (patch)
tree06dc11a37edc4854fc93e0cb035d5336df8cf2c1 /test/codegen
parent77aac7bb75edc222dd7b350e8b76c20c79da5f43 (diff)
downloadgo-78ef487a6f936a39e9d4ebf66ac421bb1244a7a9.tar.xz
cmd/compile: fix the issue of shift amount exceeding the valid range
Fixes #75479 Change-Id: I362d3e49090e94f91a840dd5a475978b59222a00 Reviewed-on: https://go-review.googlesource.com/c/go/+/704135 Reviewed-by: Mark Freeman <markfreeman@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Meidan Li <limeidan@loongson.cn> Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Diffstat (limited to 'test/codegen')
-rw-r--r--test/codegen/shift.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/codegen/shift.go b/test/codegen/shift.go
index 7385058726..4b0885a4dd 100644
--- a/test/codegen/shift.go
+++ b/test/codegen/shift.go
@@ -148,11 +148,13 @@ func lshConst64x2Add(x int64) int64 {
}
func lshConst32x31Add(x int32) int32 {
+ // loong64:-"SLL\t","MOVV\tR0"
// riscv64:-"SLLI","MOV\t[$]0"
return (x + x) << 31
}
func lshConst64x63Add(x int64) int64 {
+ // loong64:-"SLLV","MOVV\tR0"
// riscv64:-"SLLI","MOV\t[$]0"
return (x + x) << 63
}