aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/codegen/arithmetic.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/codegen/arithmetic.go b/test/codegen/arithmetic.go
index 42d5d2ef65..6b2c5529e1 100644
--- a/test/codegen/arithmetic.go
+++ b/test/codegen/arithmetic.go
@@ -318,13 +318,19 @@ func MergeMuls5(a, n int) int {
// Multiplications folded negation
func FoldNegMul(a int) int {
- // loong64:"SUBVU" "ALSLV [$]2" "ALSLV [$]1"
- return (-a) * 11
+ // amd64:"IMUL3Q [$]-11" -"NEGQ"
+ // arm64:"MOVD [$]-11" "MUL" -"NEG"
+ // loong64:"ALSLV [$]2" "SUBVU" "ALSLV [$]4"
+ // riscv64:"MOV [$]-11" "MUL" -"NEG"
+ return -a * 11
}
func Fold2NegMul(a, b int) int {
+ // amd64:"IMULQ" -"NEGQ"
+ // arm64:"MUL" -"NEG"
// loong64:"MULV" -"SUBVU R[0-9], R0,"
- return (-a) * (-b)
+ // riscv64:"MUL" -"NEG"
+ return -a * -b
}
// -------------- //