]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fold negation into subtraction on riscv64
authorJoel Sing <joel@sing.id.au>
Fri, 9 Sep 2022 13:15:46 +0000 (23:15 +1000)
committerJoel Sing <joel@sing.id.au>
Tue, 11 Oct 2022 04:04:13 +0000 (04:04 +0000)
commit4274ffd4b8bcef4e07cfdef9405a2e33f935d079
tree02e5f5e761059f3db2896e12040ec3764dd7c9f0
parentba8c94b5f255bf84d05cf90d3d66621ffd2e0fab
cmd/compile: fold negation into subtraction on riscv64

Fold negation into subtraction and avoid double negation.

This removes around 500 instructions from the Go binary on riscv64.

Change-Id: I4aac6c87baa2a0759b180ba87876d488a23df6d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/431105
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
Reviewed-by: Wayne Zuo <wdvxdr@golangcn.org>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/ssa/_gen/RISCV64.rules
src/cmd/compile/internal/ssa/rewriteRISCV64.go