]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/ssa: combine shift and addition for riscv64 rva22u64
authorJoel Sing <joel@sing.id.au>
Mon, 19 Aug 2024 13:54:17 +0000 (23:54 +1000)
committerJoel Sing <joel@sing.id.au>
Wed, 28 Aug 2024 13:46:24 +0000 (13:46 +0000)
commite126129d7612349874828685c2bcd49de498a1a0
tree28a045d64afb4b0b1392179757b9614d24e30780
parentaeac0b6cbfb42bc9c9301913a191bb09454d316a
cmd/compile/internal/ssa: combine shift and addition for riscv64 rva22u64

When GORISCV64 enables rva22u64, combined shift and addition using the
SH1ADD, SH2ADD and SH3ADD instructions that are available via the Zba
extension. This results in more than 2000 instructions being removed
from the Go binary on riscv64.

Change-Id: Ia62ae7dda3d8083cff315113421bee73f518eea8
Reviewed-on: https://go-review.googlesource.com/c/go/+/606636
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
src/cmd/compile/internal/riscv64/ssa.go
src/cmd/compile/internal/ssa/_gen/RISCV64.rules
src/cmd/compile/internal/ssa/_gen/RISCV64Ops.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteRISCV64.go
test/codegen/shift.go