]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/riscv: improve handling of float point moves
authorJoel Sing <joel@sing.id.au>
Fri, 12 Sep 2025 10:54:49 +0000 (20:54 +1000)
committerJoel Sing <joel@sing.id.au>
Tue, 16 Sep 2025 15:43:10 +0000 (08:43 -0700)
commite2cfc1eb3affe8bcdfeca4a9f0a2d7902dbb940f
tree81de0c326310136913139790ec9f144c6288e6bd
parent281c632e6e3df290d4b0f92440cba10903a0295f
cmd/internal/obj/riscv: improve handling of float point moves

Translate moves from an integer register to a floating point register, or
from a floating point register to an integer register, to the appropriate
move instruction (i.e. FMVXW/FMVWX/FMVXD/FMVDX).

Add support for MOVF with a constant - we previously added support for MOVD
but not for MOVF. Add special handling for 0.0, which we can translate to
a move from the zero register to a floating point register (leveraging the
above mentioned change).

Change-Id: If8df2f5610e69b4ec0af85efb884951024685f5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/703216
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
src/cmd/asm/internal/asm/testdata/riscv64.s
src/cmd/internal/obj/riscv/obj.go