provide sv_reg_t overrides of more functions so that sv_reg_t can be a class
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 19 Oct 2018 08:33:27 +0000 (09:33 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 19 Oct 2018 08:33:27 +0000 (09:33 +0100)
riscv/insns/c_slli.h
riscv/insns/c_srai.h
riscv/insns/c_srli.h
riscv/sv_decode.h

index 56f5df9f0536fd9a1beed067b9e8154afd871515..6c52f85343fcbf607e96158d24b976dc868b3b62 100644 (file)
@@ -1,3 +1,3 @@
 require_extension('C');
-require(rv_lt(insn.rvc_zimm(), sv_sreg_t(xlen)));
+require(rv_lt(insn.rvc_zimm(), sv_reg_t(xlen)));
 WRITE_RD(sext_xlen(rv_sl(RVC_RS1, insn.rvc_zimm())));
index beabdb6a829cc9781f2551a1eefb016f0ecea22e..9d67625119c3d7bd44747cb3613a71d3a11a86c2 100644 (file)
@@ -1,3 +1,3 @@
 require_extension('C');
-require(rv_lt(insn.rvc_zimm(), sv_sreg_t(xlen)));
+require(rv_lt(insn.rvc_zimm(), sv_reg_t(xlen)));
 WRITE_RVC_RS1S(sext_xlen(rv_sr(sext_xlen(RVC_RS1S), insn.rvc_zimm())));
index 419ee308e025e059224a880218154a0cb2a41b4a..7cb790f6bb85232eb769ff27412c46c0db2fd8f5 100644 (file)
@@ -1,3 +1,3 @@
 require_extension('C');
-require(rv_lt(insn.rvc_zimm(), sv_sreg_t(xlen)));
+require(rv_lt(insn.rvc_zimm(), sv_reg_t(xlen)));
 WRITE_RVC_RS1S(sext_xlen(rv_sr(zext_xlen(RVC_RS1S), insn.rvc_zimm())));
index c6b01dc177b7d63ba938ce9e34009017624479ce..deab21757039a49efe5c64bc6766c8a903e0e855 100644 (file)
@@ -6,6 +6,8 @@
 #include "sv.h"
 #include "decode.h"
 //#include "sv_reg.h"
+typedef reg_t sv_reg_t;
+
 //#include "processor.h"
 
 #define REG_RD 0x1
@@ -36,14 +38,18 @@ public:
             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); }