diff options
| author | Joel Sing <joel@sing.id.au> | 2024-07-02 00:31:53 +1000 |
|---|---|---|
| committer | Joel Sing <joel@sing.id.au> | 2025-02-14 19:41:30 -0800 |
| commit | d7c242a19ae0fd9adae1c6d6222df2f1d93646da (patch) | |
| tree | 70e0bf8a11dbebcac50a841eafe456482f90e2be /src/cmd/asm | |
| parent | 77343fa646c5d2a01fb3cbeabda1b3ff008c3b03 (diff) | |
| download | go-d7c242a19ae0fd9adae1c6d6222df2f1d93646da.tar.xz | |
cmd/internal/obj/riscv: support MOVD with floating point constants
Currently, we only support loading of values from memory (or other
registers). Add floating point constant support to MOVD. This is
implemented by storing the floating point constant to a symbol,
which is then loaded into the floating point register.
Change-Id: I6db242d27f606f0d5d084a3ab93538698d3a4f8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/631876
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/asm')
| -rw-r--r-- | src/cmd/asm/internal/asm/testdata/riscv64.s | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/riscv64.s b/src/cmd/asm/internal/asm/testdata/riscv64.s index cbe99ba348..fc44f561f2 100644 --- a/src/cmd/asm/internal/asm/testdata/riscv64.s +++ b/src/cmd/asm/internal/asm/testdata/riscv64.s @@ -510,6 +510,9 @@ start: MOVD F0, 4(X5) // 27b20200 MOVD F0, F1 // d3000022 + // Convert to load of symbol (AUIPC + FLD) + MOVD $(709.78271289338397), F3 // 970f000087b10f00 + // TLS load with local-exec (LUI + ADDIW + ADD of TP + load) MOV tls(SB), X5 // b70f00009b8f0f00b38f4f0083b20f00 MOVB tls(SB), X5 // b70f00009b8f0f00b38f4f0083820f00 |
