Commit d3b5c93b authored by Committed by Roland Levillain
Arithmetic overflow should wrap around.
Tiger specifications do not define the expected behavior of an integer overflow. Yet, to be consistent with Nolimips, Spim, and most current architectures, we ensure that arithmetic operations in HAVM wrap around. * src/StdBinop.hs (modulo32): New function. Use it... (binop): ...here. * tests/overflow.lir, * tests/overflow.out, * tests/overflow.test: New test. * tests/Makefile.am (TESTS): Add overflow.test. (EXTRA_DIST): Add overflow.lir and overflow.out. Signed-off-by: Roland Levillain <firstname.lastname@example.org>
Showing with 60 additions and 7 deletions