cmd/compile: use 32x32->64 multiplies on loong64

Gets rid of some sign extensions, like arm64.

Change-Id: I9fc37e15a82718bfcf53db8cab0c4e7baaa0a747
Reviewed-on: https://go-review.googlesource.com/c/go/+/721522
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Xiaolin Zhao 2025-11-18 13:00:15 +08:00 committed by abner chenc
parent e88be8a128
commit feae743bdb
6 changed files with 89 additions and 0 deletions

View file

@ -335,11 +335,13 @@ func Fold2NegMul(a, b int) int {
func Mul32(a, b int32) int64 {
// arm64:"SMULL" -"MOVW"
// loong64:"MULWVW" -"MOVW"
return int64(a) * int64(b)
}
func Mul32U(a, b uint32) uint64 {
// arm64:"UMULL" -"MOVWU"
// loong64:"MULWVWU" -"MOVWU"
return uint64(a) * uint64(b)
}