require_extension('C');
require(insn.rvc_rs1() != 0);
-set_pc(RVC_RS1 & ~reg_t(1));
+set_pc(rv_and(RVC_RS1, sv_reg_t(~reg_t(1))));
require_extension('C');
if (insn.insn_t::rvc_rd() == 2) { // c.addi16sp
require(insn.rvc_addi16sp_imm() != 0);
- WRITE_REG(X_SP, sext_xlen(RVC_SP + insn.rvc_addi16sp_imm()));
+ WRITE_REG(X_SP, sext_xlen(rv_add(RVC_SP, insn.rvc_addi16sp_imm())));
} else {
- require(insn.rvc_imm() != 0);
- WRITE_RD(insn.rvc_imm() << 12);
+ require(rv_ne(insn.rvc_imm(), sv_reg_t(0L)));
+ WRITE_RD(rv_sl(insn.rvc_imm(), sv_reg_t(12UL)));
}