aboutsummaryrefslogtreecommitdiff
path: root/test/codegen/arithmetic.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2025-11-17 12:47:04 -0800
committerKeith Randall <khr@google.com>2025-11-17 13:45:54 -0800
commite1a12c781f55da85a30fd63471f8adcba908acd2 (patch)
tree6056b5eaf267ce0432b16e0234811ce40a38bf61 /test/codegen/arithmetic.go
parent6caab99026a496107e903469d8c906be66a71896 (diff)
downloadgo-e1a12c781f55da85a30fd63471f8adcba908acd2.tar.xz
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>
Diffstat (limited to 'test/codegen/arithmetic.go')
-rw-r--r--test/codegen/arithmetic.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/codegen/arithmetic.go b/test/codegen/arithmetic.go
index 6b2c5529e1..9443d812dc 100644
--- a/test/codegen/arithmetic.go
+++ b/test/codegen/arithmetic.go
@@ -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 //
// -------------- //