]> Cypherpunks repositories - gostls13.git/commitdiff
test/codegen: test negation with add/sub on riscv64
authorMeng Zhuo <mengzhuo@iscas.ac.cn>
Thu, 13 Nov 2025 08:13:31 +0000 (16:13 +0800)
committerMeng Zhuo <mengzhuo@iscas.ac.cn>
Sat, 6 Dec 2025 01:31:30 +0000 (17:31 -0800)
Change-Id: Ic0eca86d3c93707ebd7c716e774ebda55af4f196
Reviewed-on: https://go-review.googlesource.com/c/go/+/703755
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Julian Zhu <jz531210@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
test/codegen/arithmetic.go

index 7cc6cf77e1d95c4fa1a081956988b30bb08b1961..93e4aaed03dd8cc3b2140e2ec5903d98f62a8abc 100644 (file)
@@ -172,20 +172,26 @@ func SubAddSimplify2(a, b, c int) (int, int, int, int, int, int) {
        // mips:"SUB" -"ADD"
        // mips64:"SUBV" -"ADDV"
        // loong64:"SUBV" -"ADDV"
+       // riscv64:-"ADD"
        r := (a + b) - (a + c)
        // amd64:-"ADDQ"
+       // riscv64:-"ADD"
        r1 := (a + b) - (c + a)
        // amd64:-"ADDQ"
+       // riscv64:-"ADD"
        r2 := (b + a) - (a + c)
        // amd64:-"ADDQ"
+       // riscv64:-"ADD"
        r3 := (b + a) - (c + a)
        // amd64:-"SUBQ"
        // arm64:-"SUB"
        // mips:"ADD" -"SUB"
        // mips64:"ADDV" -"SUBV"
        // loong64:"ADDV" -"SUBV"
+       // riscv64:-"SUB"
        r4 := (a - c) + (c + b)
        // amd64:-"SUBQ"
+       // riscv64:-"SUB"
        r5 := (a - c) + (b + c)
        return r, r1, r2, r3, r4, r5
 }