]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: combine negation and word sign extension on riscv64
authorJoel Sing <joel@sing.id.au>
Wed, 12 Oct 2022 06:37:23 +0000 (17:37 +1100)
committerJoel Sing <joel@sing.id.au>
Sat, 15 Mar 2025 13:05:16 +0000 (06:05 -0700)
commit21417518a9e826973c316d3328e069b7535bb23c
treef723fcf66d32e337b91725577e19a3555d3fa7e7
parent10d070668c24a3f1b3982c323ba1334437941dff
cmd/compile: combine negation and word sign extension on riscv64

Use NEGW to produce a negated and sign extended word, rather than doing
the same via two instructions:

   neg     t0, t0
   sext.w  a0, t0

Becomes:

   negw    t0, t0

Change-Id: I824ab25001bd3304bdbd435e7b244fcc036ef212
Reviewed-on: https://go-review.googlesource.com/c/go/+/652319
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/ssa/_gen/RISCV64.rules
src/cmd/compile/internal/ssa/rewriteRISCV64.go
test/codegen/arithmetic.go