From 8160f42b8dad33e47b4c73ed3f9bf889462e7bfe Mon Sep 17 00:00:00 2001 From: Nikita Karetnikov Date: Sat, 31 Oct 2015 12:27:54 +0100 Subject: 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 --- libraries/base/GHC/Natural.hs | 7 ------- 1 file changed, 7 deletions(-) (limited to 'libraries/base') 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 -- cgit v1.2.1