aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/remw.h
blob: 56221ccd4e742dbe142858d0e7739c182c95818a (plain)
1
2
3
4
5
6
7
8
require_extension('M');
require_rv64;
sreg_t lhs = sext32(RS1);
sreg_t rhs = sext32(RS2);
if(rhs == 0)
  WRITE_RD(lhs);
else
  WRITE_RD(sext32(lhs % rhs));