require_rv64;
-WRITE_RD(sext32(rv_sl(RS1, (RS2 & 0x1F))));
+WRITE_RD(sext32(rv_sl(RS1, rv_and(RS2, sv_reg_t(0x1FU)))));
-WRITE_RD(rv_lt(sreg_t(RS1), sreg_t(RS2)));
+WRITE_RD(rv_lt(sv_reg_to_sreg(RS1), sv_reg_to_sreg(RS2)));
-WRITE_RD(rv_lt(sreg_t(RS1), sreg_t(insn.i_imm())));
+WRITE_RD(rv_lt(sv_reg_to_sreg(RS1), sv_reg_to_sreg(insn.i_imm())));
-WRITE_RD(rv_lt(RS1, reg_t(insn.i_imm())));
+WRITE_RD(rv_lt(RS1, (insn.i_imm())));
-WRITE_RD(sext_xlen(rv_sr(sext_xlen(RS1), (RS2 & (xlen-1)))));
+WRITE_RD(sext_xlen(rv_sr(sext_xlen(RS1),
+ rv_and(RS2, sv_reg_t(xlen-1)))));
-require(SHAMT < xlen);
+require(rv_lt(SHAMT, sv_reg_t(xlen)));
WRITE_RD(sext_xlen(rv_sr(sext_xlen(RS1), SHAMT)));
require_rv64;
-WRITE_RD(sext32(rv_sr(int32_t(RS1), SHAMT)));
+WRITE_RD(sext32(rv_sr(sv_reg_int32(RS1), SHAMT)));
require_rv64;
-WRITE_RD(sext32(rv_sr(int32_t(RS1), (RS2 & 0x1F))));
+WRITE_RD(sext32(rv_sr(sv_reg_int32(RS1), rv_and(RS2, sv_reg_t(0x1FU)))));
-WRITE_RD(sext_xlen(rv_sr(zext_xlen(RS1), (RS2 & (xlen-1)))));
+WRITE_RD(sext_xlen(rv_sr(zext_xlen(RS1),
+ rv_and(RS2, sv_reg_t(xlen-1)))));
-require(SHAMT < xlen);
+require(rv_lt(SHAMT, sv_reg_t(xlen)));
WRITE_RD(sext_xlen(rv_sr(zext_xlen(RS1), SHAMT)));
require_rv64;
-WRITE_RD(sext32(rv_sr((uint32_t)RS1, SHAMT)));
+WRITE_RD(sext32(rv_sr(sv_reg_uint32(RS1), SHAMT)));
require_rv64;
-WRITE_RD(sext32(rv_sr((uint32_t)RS1, (RS2 & 0x1F))));
+WRITE_RD(sext32(rv_sr(sv_reg_uint32(RS1),
+ rv_and(RS2, sv_reg_t(0x1FU)))));