mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: use 32x32->64 multiplies on arm64
Gets rid of some sign extensions. Change-Id: Ie67ef36b4ca1cd1a2cd9fa5d84578db553578a22 Reviewed-on: https://go-review.googlesource.com/c/go/+/721241 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> Reviewed-by: Keith Randall <khr@google.com>
This commit is contained in:
parent
6caab99026
commit
e1a12c781f
3 changed files with 61 additions and 0 deletions
|
|
@ -333,6 +333,15 @@ func Fold2NegMul(a, b int) int {
|
|||
return -a * -b
|
||||
}
|
||||
|
||||
func Mul32(a, b int32) int64 {
|
||||
// arm64:"SMULL" -"MOVW"
|
||||
return int64(a) * int64(b)
|
||||
}
|
||||
func Mul32U(a, b uint32) uint64 {
|
||||
// arm64:"UMULL" -"MOVWU"
|
||||
return uint64(a) * uint64(b)
|
||||
}
|
||||
|
||||
// -------------- //
|
||||
// Division //
|
||||
// -------------- //
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue