riscv-software-src / riscv-tests

Other
866 stars 449 forks source link

REM mextension issue? #113

Open TharshanThana opened 6 years ago

TharshanThana commented 6 years ago

Can the remainder be negative?

aswaterman commented 6 years ago

Yes, see this test: https://github.com/riscv/riscv-tests/blob/master/isa/rv32um/rem.S

Like the C99 modulus operator, REM takes the sign of the dividend when the signs of the divisor and dividend differ.