aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
authorMeng Zhuo <mengzhuo@iscas.ac.cn>2025-09-12 17:45:56 +0800
committerMeng Zhuo <mengzhuo@iscas.ac.cn>2025-10-26 18:35:09 -0700
commitd7a52f93696477a9858dc09a784b4945d3045983 (patch)
tree5fc5ed30f243dc9151dd53dabcb55f4b6a2aa326 /test/codegen
parent6f04a92be3afa24560dd6149eefb991450746d72 (diff)
downloadgo-d7a52f93696477a9858dc09a784b4945d3045983.tar.xz
cmd/compile: use MOV(D|F) with const for Const(64|32)F on riscv64
The original Const64F using: AUIPC + LD + FMVDX to load float64 const, we can use AUIPC + FLD instead, same as Const32F. Change-Id: I8ca0a0e90d820a26e69b74cd25df3cc662132bf7 Reviewed-on: https://go-review.googlesource.com/c/go/+/703215 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'test/codegen')
-rw-r--r--test/codegen/floats.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/codegen/floats.go b/test/codegen/floats.go
index 666c983b56..b453cabf3b 100644
--- a/test/codegen/floats.go
+++ b/test/codegen/floats.go
@@ -268,10 +268,12 @@ func Float64DenormalFloat32Constant() float64 {
func Float32ConstantStore(p *float32) {
// amd64:"MOVL\t[$]1085133554"
+ // riscv64: "MOVF\t[$]f32.40add2f2"
*p = 5.432
}
func Float64ConstantStore(p *float64) {
- // amd64:"MOVQ\t[$]4617801906721357038"
+ // amd64: "MOVQ\t[$]4617801906721357038"
+ // riscv64: "MOVD\t[$]f64.4015ba5e353f7cee"
*p = 5.432
}