aboutsummaryrefslogtreecommitdiff
path: root/test/codegen/arithmetic.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/codegen/arithmetic.go')
-rw-r--r--test/codegen/arithmetic.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/codegen/arithmetic.go b/test/codegen/arithmetic.go
index c0539256d5..05a28695d4 100644
--- a/test/codegen/arithmetic.go
+++ b/test/codegen/arithmetic.go
@@ -206,8 +206,15 @@ func AddMul(x int) int {
return 2*x + 1
}
-func MULA(a, b, c uint32) uint32 {
- // arm:`MULA`
- // arm64:`MADDW`
- return a*b + c
+func MULA(a, b, c uint32) (uint32, uint32, uint32) {
+ // arm:`MULA`,-`MUL\s`
+ // arm64:`MADDW`,-`MULW`
+ r0 := a*b + c
+ // arm:`MULA`-`MUL\s`
+ // arm64:`MADDW`,-`MULW`
+ r1 := c*79 + a
+ // arm:`ADD`,-`MULA`-`MUL\s`
+ // arm64:`ADD`,-`MADD`,-`MULW`
+ r2 := b*64 + c
+ return r0, r1, r2
}