summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2022-02-24 16:45:01 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-03-03 07:37:12 -0500
commitc48a7c3a6165d8ffa9ff052db908083817cf6021 (patch)
tree3d997b574513efc85023495e45697c1ffc478228
parent9579bf357cabca4dd311a88eb16f2325a438fadc (diff)
downloadhaskell-c48a7c3a6165d8ffa9ff052db908083817cf6021.tar.gz
Use Word64# primops in Word64 Num instance
Taken froĆ¹!3658
-rw-r--r--libraries/base/GHC/Word.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/libraries/base/GHC/Word.hs b/libraries/base/GHC/Word.hs
index 512597aac5..c82657e058 100644
--- a/libraries/base/GHC/Word.hs
+++ b/libraries/base/GHC/Word.hs
@@ -706,9 +706,9 @@ gtWord64, geWord64, ltWord64, leWord64 :: Word64 -> Word64 -> Bool
-- | @since 2.01
instance Num Word64 where
- (W64# x#) + (W64# y#) = W64# (int64ToWord64# (word64ToInt64# x# `plusInt64#` word64ToInt64# y#))
- (W64# x#) - (W64# y#) = W64# (int64ToWord64# (word64ToInt64# x# `subInt64#` word64ToInt64# y#))
- (W64# x#) * (W64# y#) = W64# (int64ToWord64# (word64ToInt64# x# `timesInt64#` word64ToInt64# y#))
+ (W64# x#) + (W64# y#) = W64# (x# `plusWord64#` y#)
+ (W64# x#) - (W64# y#) = W64# (x# `subWord64#` y#)
+ (W64# x#) * (W64# y#) = W64# (x# `timesWord64#` y#)
negate (W64# x#) = W64# (int64ToWord64# (negateInt64# (word64ToInt64# x#)))
abs x = x
signum 0 = 0