From: wangyang <[email protected]>

Under Zfinx/Zhinx, trans_fsgnjn_h() and trans_fsgnjx_h() compute their
results into a temporary but return without calling gen_set_fpr_hs().
The instructions consequently retire without updating the corresponding
integer register. Add the missing writeback calls, matching
trans_fsgnj_h().

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4407
Signed-off-by: wangyang <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-ID: 
<ebb7f8a1c374783dd585ee838e1d30f4d2bfbccc.20260904092608.git.wangyang25.otcaix.iscas.ac.cn>
Signed-off-by: Alistair Francis <[email protected]>
---
 target/riscv/tcg/insn_trans/trans_rvzfh.c.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/riscv/tcg/insn_trans/trans_rvzfh.c.inc 
b/target/riscv/tcg/insn_trans/trans_rvzfh.c.inc
index b17ef9541c..4af717ce54 100644
--- a/target/riscv/tcg/insn_trans/trans_rvzfh.c.inc
+++ b/target/riscv/tcg/insn_trans/trans_rvzfh.c.inc
@@ -319,6 +319,7 @@ static bool trans_fsgnjn_h(DisasContext *ctx, arg_fsgnjn_h 
*a)
     if (ctx->cfg_ptr->ext_zfinx) {
         tcg_gen_ext16s_i64(dest, dest);
     }
+    gen_set_fpr_hs(ctx, a->rd, dest);
     mark_fs_dirty(ctx);
     return true;
 }
@@ -363,6 +364,7 @@ static bool trans_fsgnjx_h(DisasContext *ctx, arg_fsgnjx_h 
*a)
     if (ctx->cfg_ptr->ext_zfinx) {
         tcg_gen_ext16s_i64(dest, dest);
     }
+    gen_set_fpr_hs(ctx, a->rd, dest);
     mark_fs_dirty(ctx);
     return true;
 }
-- 
2.55.0


Reply via email to