]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: improve Slicemask on riscv64
authorJoel Sing <joel@sing.id.au>
Mon, 29 Aug 2022 10:36:51 +0000 (20:36 +1000)
committerJoel Sing <joel@sing.id.au>
Wed, 7 Sep 2022 05:37:53 +0000 (05:37 +0000)
commitc011270fa56303c0f16a8cfa9b37f37f470a45bb
tree04367c3cfe971affe239c51c791023e6a926773c
parentba1ef54c1ee0e5ed8fd572dbb4ec67548cd5a55e
cmd/compile: improve Slicemask on riscv64

Implement Slicemask the same way every other architecture does - negate
then arithmetic right shift. This sets or clears the sign bit, before
extending it to the entire register.

Removes around 2,500 instructions from the Go binary on linux/riscv64.

Change-Id: I4d675b826e7eb23fe2b1e6e46b95dcd49ab49733
Reviewed-on: https://go-review.googlesource.com/c/go/+/426354
Reviewed-by: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Wayne Zuo <wdvxdr@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/ssa/gen/RISCV64.rules
src/cmd/compile/internal/ssa/rewriteRISCV64.go