aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/divw.h
blob: 11be17e4c33d450244c42d98c99d2c31c8a35bd9 (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(UINT64_MAX);
else
  WRITE_RD(sext32(lhs / rhs));