require_extension('C');
require_extension('D');
require_fp;
-MMU.store_uint64(insn.rvc_rs1s(), insn.rvc_ld_imm(), ((freg_t)RVC_FRS2S).v[0]); // RVC_RS1S
+MMU.store_uint64(insn.rvc_rs1s(), insn.rvc_ld_imm(), RVC_FRS2S.to_uint64()); // RVC_RS1S
require_extension('C');
require_extension('D');
require_fp;
-MMU.store_uint64(rv_add(RVC_SP, insn.rvc_sdsp_imm()), ((freg_t)RVC_FRS2).v[0]);
+MMU.store_uint64(rv_add(RVC_SP, insn.rvc_sdsp_imm()), RVC_FRS2.to_uint64());
if (xlen == 32) {
require_extension('F');
require_fp;
- MMU.store_uint32(insn.rvc_rs1s(), insn.rvc_lw_imm(), ((freg_t)RVC_FRS2S).v[0]); //RVC_RS1S
+ MMU.store_uint32(insn.rvc_rs1s(), insn.rvc_lw_imm(), RVC_FRS2S.to_uint32()); //RVC_RS1S
} else { // c.sd
MMU.store_uint64(insn.rvc_rs1s(), insn.rvc_ld_imm(), RVC_RS2S); //RVC_RS1S,
}
if (xlen == 32) {
require_extension('F');
require_fp;
- MMU.store_uint32(rv_add(RVC_SP, insn.rvc_swsp_imm()), ((freg_t)RVC_FRS2).v[0]);
+ MMU.store_uint32(rv_add(RVC_SP, insn.rvc_swsp_imm()), RVC_FRS2.to_uint32());
} else { // c.sdsp
MMU.store_uint64(rv_add(RVC_SP, insn.rvc_sdsp_imm()), RVC_RS2);
}
require_extension('D');
require_rv64;
require_fp;
-WRITE_RD(((freg_t)FRS1).v[0]);
+WRITE_RD(FRS1.to_uint64());
require_extension('F');
require_fp;
-WRITE_RD(sext32(sv_reg_t(((freg_t)FRS1).v[0])));
+WRITE_RD(sext32(sv_reg_t(FRS1.to_uint32())));
require_extension('F');
require_fp;
softfloat_roundingMode = RM;
-WRITE_FRD(f32_mulAdd(f32(((float32_t)f32(FRS1)).v ^ F32_SIGN), f32(FRS2), f32(((float32_t)f32(FRS3)).v ^ F32_SIGN)));
+WRITE_FRD(f32_mulAdd(f32(f32(FRS1).to_uint32() ^ F32_SIGN), f32(FRS2), f32(f32(FRS3).to_uint32() ^ F32_SIGN)));
set_fp_exceptions;
require_extension('D');
require_fp;
-MMU.store_uint64(insn.rs1(), insn.s_imm(), ((freg_t)FRS2).v[0]); // RS1
+MMU.store_uint64(insn.rs1(), insn.s_imm(), FRS2.to_uint64()); // RS1
return reg.v[0];
}
+uint32_t sv_float32_t::to_uint32() const&
+{
+ return reg.v;
+}
+
public:
operator float32_t() const& { return reg; }
+ uint32_t to_uint32() const&;
};
class sv_float64_t : public sv_regbase_t {