#define MASK_SW 0x707f
#define MATCH_SD 0x3023
#define MASK_SD 0x707f
+#define MATCH_SVSETVL 0x4023
+#define MASK_SVSETVL 0x707f
#define MATCH_FENCE 0xf
#define MASK_FENCE 0x707f
#define MATCH_FENCE_I 0x100f
DECLARE_INSN(sh, MATCH_SH, MASK_SH)
DECLARE_INSN(sw, MATCH_SW, MASK_SW)
DECLARE_INSN(sd, MATCH_SD, MASK_SD)
+DECLARE_INSN(svsetvl, MATCH_SVSETVL, MASK_SVSETVL)
DECLARE_INSN(fence, MATCH_FENCE, MASK_FENCE)
DECLARE_INSN(fence_i, MATCH_FENCE_I, MASK_FENCE_I)
DECLARE_INSN(mul, MATCH_MUL, MASK_MUL)
--- /dev/null
+p->get_state()->vl = std::min((uint64_t)63,
+ std::min((uint64_t)insn.i_imm(),
+ RS1));
+WRITE_RD(p->get_state()->vl);