diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-04-07 20:02:54 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-04-29 17:26:43 -0400 |
commit | c308c9af2e1345f6a2adece971cf7ffed78a31a9 (patch) | |
tree | a150568e990690f8201c2e53c3bc95cf10bc7175 /libraries/base/GHC/Base.hs | |
parent | e50d06752e2113615814d2c9cf8965cca394302b (diff) | |
download | haskell-c308c9af2e1345f6a2adece971cf7ffed78a31a9.tar.gz |
Make divModInt# branchless
Diffstat (limited to 'libraries/base/GHC/Base.hs')
-rw-r--r-- | libraries/base/GHC/Base.hs | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs index 205fee906b..c32bfbceca 100644 --- a/libraries/base/GHC/Base.hs +++ b/libraries/base/GHC/Base.hs @@ -1629,17 +1629,6 @@ divModInt :: Int -> Int -> (Int, Int) (I# x) `divModInt` (I# y) = case x `divModInt#` y of (# q, r #) -> (I# q, I# r) -divModInt# :: Int# -> Int# -> (# Int#, Int# #) -x# `divModInt#` y# - | isTrue# (x# ># 0#) && isTrue# (y# <# 0#) = - case (x# -# 1#) `quotRemInt#` y# of - (# q, r #) -> (# q -# 1#, r +# y# +# 1# #) - | isTrue# (x# <# 0#) && isTrue# (y# ># 0#) = - case (x# +# 1#) `quotRemInt#` y# of - (# q, r #) -> (# q -# 1#, r +# y# -# 1# #) - | otherwise = - x# `quotRemInt#` y# - {- Note [INLINE division wrappers] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The Int division functions such as 'quotRemInt' and 'divModInt' have |