-WRITE_RD(sext_xlen(sext_xlen(RS1) >> (RS2 & (xlen-1))));
+WRITE_RD(sext_xlen(rv_sr(sext_xlen(RS1), (RS2 & (xlen-1)))));
require(SHAMT < xlen);
-WRITE_RD(sext_xlen(sext_xlen(RS1) >> SHAMT));
+WRITE_RD(sext_xlen(rv_sr(sext_xlen(RS1), SHAMT)));
require_rv64;
-WRITE_RD(sext32(int32_t(RS1) >> SHAMT));
+WRITE_RD(sext32(rv_sr(int32_t(RS1), SHAMT)));
require_rv64;
-WRITE_RD(sext32(int32_t(RS1) >> (RS2 & 0x1F)));
+WRITE_RD(sext32(rv_sr(int32_t(RS1), (RS2 & 0x1F))));
-WRITE_RD(sext_xlen(zext_xlen(RS1) >> (RS2 & (xlen-1))));
+WRITE_RD(sext_xlen(rv_sr(zext_xlen(RS1), (RS2 & (xlen-1)))));
require(SHAMT < xlen);
-WRITE_RD(sext_xlen(zext_xlen(RS1) >> SHAMT));
+WRITE_RD(sext_xlen(rv_sr(zext_xlen(RS1), SHAMT)));
require_rv64;
-WRITE_RD(sext32((uint32_t)RS1 >> SHAMT));
+WRITE_RD(sext32(rv_sr((uint32_t)RS1, SHAMT)));
require_rv64;
-WRITE_RD(sext32((uint32_t)RS1 >> (RS2 & 0x1F)));
+WRITE_RD(sext32(rv_sr((uint32_t)RS1, (RS2 & 0x1F))));
return lhs << rhs;
}
+reg_t sv_proc_t::rv_sr(reg_t lhs, reg_t rhs)
+{
+ return lhs >> rhs;
+}
+
reg_t sv_proc_t::rv_lt(reg_t lhs, reg_t rhs)
{
return lhs < rhs;
reg_t rv_or(reg_t lhs, reg_t rhs);
reg_t rv_xor(reg_t lhs, reg_t rhs);
reg_t rv_sl(reg_t lhs, reg_t rhs);
+ reg_t rv_sr(reg_t lhs, reg_t rhs);
reg_t rv_lt(reg_t lhs, reg_t rhs);
sreg_t rv_lt(sreg_t lhs, sreg_t rhs);