sysprog21 / semu

A minimalist RISC-V system emulator capable of running Linux kernel
MIT License
253 stars 47 forks source link

Fix signed division overflow case #29

Closed fourcolor closed 1 year ago

fourcolor commented 1 year ago

Refer to RISC-V ISA spec Chapter 6, signed division overflow occurs only when the most-negative integer, $−2^{XLEN −1}$, is divided by $−1$. The quotient of signed division overflow is equal to the dividend, and the remainder is zero.

jserv commented 1 year ago

Thank @fourcolor for contributing!