Skip to content

Commit 0e44c69

Browse files
committed
cmd/compile: use NOT pseudo-instruction for riscv64 Slicemask
Change-Id: Idefb6669d54929065f57e3bd767c91451dc3a375 Reviewed-on: https://go-review.googlesource.com/c/go/+/223562 Reviewed-by: Cherry Zhang <[email protected]> Run-TryBot: Cherry Zhang <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 2f54081 commit 0e44c69

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/cmd/compile/internal/ssa/gen/RISCV64.rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
// For positive x, bit 63 of x-1 is always 0, so the result is -1.
144144
// For zero x, bit 63 of x-1 is 1, so the result is 0.
145145
//
146-
(Slicemask <t> x) -> (XORI [-1] (SRAI <t> [63] (ADDI <t> [-1] x)))
146+
(Slicemask <t> x) -> (NOT (SRAI <t> [63] (ADDI <t> [-1] x)))
147147

148148
// Truncations
149149
// We ignore the unused high parts of registers, so truncates are just copies.

src/cmd/compile/internal/ssa/rewriteRISCV64.go

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)