]> Cypherpunks repositories - gostls13.git/commit
cmd/asm, cmd/internal/obj: enable rounding mode suffix for riscv64
authorMeng Zhuo <mzh@golangcn.org>
Tue, 20 Jun 2023 03:16:56 +0000 (11:16 +0800)
committerM Zhuo <mzh@golangcn.org>
Wed, 21 Feb 2024 14:34:57 +0000 (14:34 +0000)
commit3580c212c2e3276077540afdab3478a7336d698b
tree1a9e09ef35893fbb9f356b5b97b00fdd79e479bb
parentd4112310a4d3b1981d77226a3d52a8b566b0c0bc
cmd/asm, cmd/internal/obj: enable rounding mode suffix for riscv64

This CL adds rounding modes for riscv64 floating point conversion
instructions by suffix with 5 modes: RNE, RTZ, RDN, RUP and RMM.

For example, for round to nearest (RNE), we can use `FCVTLD.RNE`
According to RISCV manual 8.7 and 9.5, we changed these
conversion instructions:

FCVTWS
FCVTLS
FCVTWUS
FCVTLUS
FCVTWD
FCVTLD
FCVTWUD
FCVTLUD

Note: Round towards zero (RTZ) by default for all these instructions above.

Change-Id: I491e522e14d721e24aa7f528ee0c4640c54c5808
Reviewed-on: https://go-review.googlesource.com/c/go/+/504736
Reviewed-by: Joel Sing <joel@sing.id.au>
Run-TryBot: M Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/asm/internal/asm/asm.go
src/cmd/asm/internal/asm/parse.go
src/cmd/asm/internal/asm/testdata/riscv64.s
src/cmd/internal/obj/link.go
src/cmd/internal/obj/riscv/cpu.go
src/cmd/internal/obj/riscv/list.go
src/cmd/internal/obj/riscv/obj.go