aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/remw.h
blob: b8f4597c29055ba43a557c32d83a0954f0c19b82 (plain)
1
2
3
4
5
6
7
require_xpr64;
sreg_t lhs = sext32(RS1);
sreg_t rhs = sext32(RS2);
if(rhs == 0)
  WRITE_RD(lhs);
else
  WRITE_RD(sext32(lhs % rhs));