1 2 3 4 5 6 7 8
require_extension('M'); require_rv64; reg_t lhs = zext32(RS1); reg_t rhs = zext32(RS2); if(rhs == 0) WRITE_RD(sext32(lhs)); else WRITE_RD(sext32(lhs % rhs));