aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/remw.h
blob: 93c38588efb48cbd0411030e7c1ac93a5b2f2dd2 (plain)
1
2
3
4
5
6
7
require_xpr64;
if(RS2 == 0)
  RD = RS1;
else if(int32_t(RS1) == INT32_MIN && int32_t(RS2) == -1)
  RD = 0;
else
  RD = sext32(int32_t(RS1) % int32_t(RS2));