#include "sv.h"
#include "decode.h"
//#include "sv_reg.h"
+typedef reg_t sv_reg_t;
+
//#include "processor.h"
#define REG_RD 0x1
prd(p_rd), prs1(p_rs1), prs2(p_rs2), prs3(p_rs3), psp(p_sp),
save_branch_addr(0) {}
- uint64_t rvc_imm() { return (insn_t::rvc_imm()); }
- uint64_t u_imm() { return (insn_t::u_imm()); }
- uint64_t i_imm() { return (insn_t::i_imm()); }
- uint64_t s_imm() { return (insn_t::s_imm()); }
+ sv_reg_t rvc_addi4spn_imm() { return sv_reg_t(insn_t::rvc_addi4spn_imm()); }
+ sv_reg_t rvc_imm() { return sv_reg_t(insn_t::rvc_imm()); }
+ sv_reg_t rvc_zimm() { return sv_reg_t(insn_t::rvc_zimm()); }
+ sv_reg_t rvc_b_imm() { return sv_reg_t(insn_t::rvc_b_imm()); }
+ sv_reg_t u_imm() { return sv_reg_t(insn_t::u_imm()); }
+ sv_reg_t i_imm() { return sv_reg_t(insn_t::i_imm()); }
+ sv_reg_t s_imm() { return sv_reg_t(insn_t::s_imm()); }
uint64_t _rvc_spoffs_imm(uint64_t elwidth, uint64_t baseoffs);
uint64_t rvc_lwsp_imm() { return _rvc_spoffs_imm(4, insn_t::rvc_lwsp_imm()); }
uint64_t rvc_ldsp_imm() { return _rvc_spoffs_imm(8, insn_t::rvc_ldsp_imm()); }
- uint64_t rvc_swsp_imm() { return _rvc_spoffs_imm(4, insn_t::rvc_swsp_imm()); }
+ sv_reg_t rvc_swsp_imm()
+ { return sv_reg_t(_rvc_spoffs_imm(4, insn_t::rvc_swsp_imm())); }
uint64_t rvc_sdsp_imm() { return _rvc_spoffs_imm(8, insn_t::rvc_sdsp_imm()); }
uint64_t rd () { return predicated(_rd (), *offs_rd, prd); }