]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: improve Eq32/Neq32 on riscv64
authorJoel Sing <joel@sing.id.au>
Tue, 25 Feb 2020 16:58:59 +0000 (03:58 +1100)
committerJoel Sing <joel@sing.id.au>
Wed, 26 Feb 2020 17:59:57 +0000 (17:59 +0000)
commitc27dd0c9e581edb71c834e161db6a920ca239997
tree8aec1a1484bf4c31e853a7c2db9f5a3b80c4f8f9
parenta1103dcc27b9c85800624367ebb89ef46d4307af
cmd/compile: improve Eq32/Neq32 on riscv64

Use SUBW to perform a 32-bit subtraction, rather than zero extending from
32 to 64 bits. This reduces Eq32 and Neq32 to two instructions, rather than
the four instructions required previously.

Change-Id: Ib2798324881e9db842c864e91a0c1b1e48c4b67b
Reviewed-on: https://go-review.googlesource.com/c/go/+/220921
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/gc/plive.go
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