Skip to content
  • Pablo de Oliveira's avatar
    Arithmetic overflow should wrap around. · d3b5c93b
    Pablo de Oliveira authored and Roland Levillain's avatar Roland Levillain committed
    
    
    	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: default avatarRoland Levillain <roland@lrde.epita.fr>
    d3b5c93b