diff options
author | Nikita Karetnikov <nikita@karetnikov.org> | 2015-10-31 12:27:54 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-10-31 16:40:38 +0100 |
commit | 8160f42b8dad33e47b4c73ed3f9bf889462e7bfe (patch) | |
tree | 0752990875cffaac175c28b3a761b1509862af4b /libraries/base | |
parent | 62f0fbc943307d8522e6c8333caf37c6569ee873 (diff) | |
download | haskell-8160f42b8dad33e47b4c73ed3f9bf889462e7bfe.tar.gz |
Add subWordC# on x86ish
This adds a subWordC# primop which implements subtraction with overflow
reporting.
Reviewers: tibbe, goldfire, rwbarton, bgamari, austin, hvr
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1334
GHC Trac Issues: #10962
Diffstat (limited to 'libraries/base')
-rw-r--r-- | libraries/base/GHC/Natural.hs | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/libraries/base/GHC/Natural.hs b/libraries/base/GHC/Natural.hs index 23296604c6..dedf4f8790 100644 --- a/libraries/base/GHC/Natural.hs +++ b/libraries/base/GHC/Natural.hs @@ -396,13 +396,6 @@ minusNaturalMaybe (NatJ# x) (NatJ# y) where res = minusBigNat x y --- | Helper for 'minusNatural' and 'minusNaturalMaybe' -subWordC# :: Word# -> Word# -> (# Word#, Int# #) -subWordC# x# y# = (# d#, c# #) - where - d# = x# `minusWord#` y# - c# = d# `gtWord#` x# - -- | Convert 'BigNat' to 'Natural'. -- Throws 'Underflow' if passed a 'nullBigNat'. bigNatToNatural :: BigNat -> Natural |