require_extension('C');
require_extension('D');
require_fp;
-MMU.store_uint64(insn.rvc_rs1s(), insn.rvc_ld_imm(), RVC_FRS2S.to_uint64()); // RVC_RS1S
+MMU.store_uint64(insn.rvc_rs1s(), insn.rvc_ld_imm(), to_uint64(RVC_FRS2S)); // RVC_RS1S
require_extension('C');
require_extension('D');
require_fp;
-MMU.store_uint64(rv_add(RVC_SP, insn.rvc_sdsp_imm()), RVC_FRS2.to_uint64());
+MMU.store_uint64(rv_add(RVC_SP, insn.rvc_sdsp_imm()), to_uint64(RVC_FRS2));
if (xlen == 32) {
require_extension('F');
require_fp;
- MMU.store_uint32(insn.rvc_rs1s(), insn.rvc_lw_imm(), RVC_FRS2S.to_uint32()); //RVC_RS1S
+ MMU.store_uint32(insn.rvc_rs1s(), insn.rvc_lw_imm(), to_uint32(RVC_FRS2S)); //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()), RVC_FRS2.to_uint32());
+ MMU.store_uint32(rv_add(RVC_SP, insn.rvc_swsp_imm()), to_uint32(RVC_FRS2));
} 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(FRS1.to_uint64());
+WRITE_RD(to_uint64(FRS1));
require_extension('F');
require_fp;
-WRITE_RD(sext32(sv_reg_t(FRS1.to_uint32())));
+WRITE_RD(sext32(to_uint32(FRS1)));
require_extension('D');
require_fp;
-MMU.store_uint64(insn.rs1(), insn.s_imm(), FRS2.to_uint64()); // RS1
+MMU.store_uint64(insn.rs1(), insn.s_imm(), to_uint64(FRS2)); // RS1
require_extension('F');
require_fp;
-MMU.store_uint32(insn.rs1(), insn.s_imm(), FRS2.to_uint32()); // RS1
+MMU.store_uint32(insn.rs1(), insn.s_imm(), to_uint32(FRS2)); // RS1
}
}
+// ------
+
+sv_reg_t sv_proc_t::to_uint64(sv_freg_t const& reg)
+{
+ return sv_reg_t(reg.to_uint64());
+}
+
+sv_reg_t sv_proc_t::to_uint32(sv_freg_t const& reg)
+{
+ return sv_reg_t(reg.to_uint32());
+}
+
+sv_reg_t sv_proc_t::to_uint32(sv_float32_t const& reg)
+{
+ return sv_reg_t(reg.to_uint32());
+}
+
+// ------
+
uint64_t sv_freg_t::to_uint64() const&
{
return reg.v[0];
size_t width, reg_t val);
+ sv_reg_t to_uint64(sv_freg_t const& reg);
+ sv_reg_t to_uint32(sv_freg_t const& reg);
+ sv_reg_t to_uint32(sv_float32_t const& reg);
+
#include "sv_insn_decl.h"
};