]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: convert SLT/SLTU with constant into immediate form on riscv64
authorJoel Sing <joel@sing.id.au>
Sun, 4 Sep 2022 17:03:35 +0000 (03:03 +1000)
committerJoel Sing <joel@sing.id.au>
Tue, 11 Oct 2022 04:03:17 +0000 (04:03 +0000)
commitba8c94b5f255bf84d05cf90d3d66621ffd2e0fab
treea9c8f53d50f377d425426e2b641a0b38a4f63130
parent0ca355318f6c407edb4a82a0bb0c249ffd31840b
cmd/compile: convert SLT/SLTU with constant into immediate form on riscv64

Convert SLT/SLTU with a suitably valued constant into a SLTI/SLTIU instruction.
This can reduce instructions and avoid register loads. Now that we generate
more SLTI/SLTIU instructions, absorb these into branches when it makes sense
to do so.

Removes more than 800 instructions from the Go binary on linux/riscv64.

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