diff options
author | Joel Sing <joel@sing.id.au> | 2020-02-26 04:00:10 +1100 |
---|---|---|
committer | Joel Sing <joel@sing.id.au> | 2020-02-28 14:33:28 +0000 |
commit | 8955a56da015890f317d5f6919391503b854d93a (patch) | |
tree | 59483143777c46d5d25fe01103dd9f3c1b1ffd0f /src/cmd/compile/internal/ssa/gen/RISCV64.rules | |
parent | 44286d09c5fcdb703624fad6ce24306294cab1fe (diff) | |
download | go-8955a56da015890f317d5f6919391503b854d93a.tar.gz go-8955a56da015890f317d5f6919391503b854d93a.zip |
cmd/compile: improve SignExt32to64 on riscv64
SignExt32to64 can be implemented with a single ADDIW instruction, rather than
the two shifts that are in use currently.
Change-Id: Ie1bbaef4018f1ba5162773fc64fa5a887457cfc9
Reviewed-on: https://go-review.googlesource.com/c/go/+/220922
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/gen/RISCV64.rules')
-rw-r--r-- | src/cmd/compile/internal/ssa/gen/RISCV64.rules | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/gen/RISCV64.rules b/src/cmd/compile/internal/ssa/gen/RISCV64.rules index e2ac4ea5e6..720724647e 100644 --- a/src/cmd/compile/internal/ssa/gen/RISCV64.rules +++ b/src/cmd/compile/internal/ssa/gen/RISCV64.rules @@ -109,7 +109,7 @@ (SignExt8to64 <t> x) -> (SRAI [56] (SLLI <t> [56] x)) (SignExt16to32 <t> x) -> (SRAI [48] (SLLI <t> [48] x)) (SignExt16to64 <t> x) -> (SRAI [48] (SLLI <t> [48] x)) -(SignExt32to64 <t> x) -> (SRAI [32] (SLLI <t> [32] x)) +(SignExt32to64 <t> x) -> (ADDIW [0] x) (ZeroExt8to16 <t> x) -> (SRLI [56] (SLLI <t> [56] x)) (ZeroExt8to32 <t> x) -> (SRLI [56] (SLLI <t> [56] x)) |