[Git][ghc/ghc][wip/int64-everywhere] `integerFromInt64#` can be inlined when the word size is >= 64 bits

John Ericson gitlab at gitlab.haskell.org
Sun Aug 30 22:54:05 UTC 2020



John Ericson pushed to branch wip/int64-everywhere at Glasgow Haskell Compiler / GHC


Commits:
4ad18921 by John Ericson at 2020-08-30T18:49:53-04:00
`integerFromInt64#` can be inlined when the word size is >= 64 bits

Maybe this will help with the renaming test failure?

- - - - -


1 changed file:

- libraries/ghc-bignum/src/GHC/Num/Integer.hs


Changes:

=====================================
libraries/ghc-bignum/src/GHC/Num/Integer.hs
=====================================
@@ -972,8 +972,8 @@ integerIsPowerOf2# (IP w) = bigNatIsPowerOf2# w
 
 -- | Convert an Int64# into an Integer
 integerFromInt64# :: Int64# -> Integer
-{-# NOINLINE integerFromInt64# #-}
 integerFromInt64# !i
+#if WORD_SIZE_IN_BITS < 64
   | isTrue# ((i `leInt64#` intToInt64#  INT_MAXBOUND#)
       &&# (i `geInt64#` intToInt64# INT_MINBOUND#))
   = IS (int64ToInt# i)
@@ -983,6 +983,11 @@ integerFromInt64# !i
 
   | True
   = IN (bigNatFromWord64# (int64ToWord64# (negateInt64# i)))
+{-# NOINLINE integerFromInt64# #-}
+#else
+  = IS (int64ToInt# i)
+{-# INLINE integerFromInt64# #-}
+#endif
 
 -- | Convert a Word64# into an Integer
 integerFromWord64# :: Word64# -> Integer



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4ad1892180f714a36707de8a7702fd12cb8f248b

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4ad1892180f714a36707de8a7702fd12cb8f248b
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200830/056c9645/attachment.html>


More information about the ghc-commits mailing list