on master help sign in
Fix fixed-width integer to Integer conversions
commit91f47335406c3143cf19e355cf03141d72748f3a authorBenjamin Saunders <besaunde@sfu.ca> dateWed 26 Jun 2013, 22:47 (13 years ago) parent6d776dd
1 file changed+2−2
src/IRTS/CodegenLLVM.hs+2−2
src/IRTS/CodegenLLVM.hs+2−2
@@ -739,7 +739,7 @@ cgOp (LZExt from ITBig) [x] = do
739739 nx <- unbox (FInt from) x
740740 nx' <- case from of
741741 IT64 -> return nx
742− _ -> inst $ Trunc nx (IntegerType $ itWidth from) []
742+ _ -> inst $ ZExt nx (IntegerType 64) []
743743 mpz <- alloc mpzTy
744744 inst' $ simpleCall "mpz_init_set_ull" [mpz, nx']
745745 box (FInt ITBig) mpz
@@ -747,7 +747,7 @@ cgOp (LSExt from ITBig) [x] = do
747747 nx <- unbox (FInt from) x
748748 nx' <- case from of
749749 IT64 -> return nx
750− _ -> inst $ Trunc nx (IntegerType $ itWidth from) []
750+ _ -> inst $ SExt nx (IntegerType 64) []
751751 mpz <- alloc mpzTy
752752 inst' $ simpleCall "mpz_init_set_sll" [mpz, nx']
753753 box (FInt ITBig) mpz