summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-10-19 18:59:48 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2021-07-21 22:52:52 +0000
commit024020c38126f3ce326ff56906d53525bc71690c (patch)
treee6c8d48ad0cc0243ca535d092876ec77623794b3 /libraries
parente8f7734d8a052f99b03e1123466dc9f47b48c311 (diff)
downloadhaskell-024020c38126f3ce326ff56906d53525bc71690c.tar.gz
Use fix-sized equality primops for fixed size boxed types
These are the last to be converted.
Diffstat (limited to 'libraries')
-rw-r--r--libraries/base/GHC/Int.hs12
-rw-r--r--libraries/base/GHC/Word.hs12
2 files changed, 12 insertions, 12 deletions
diff --git a/libraries/base/GHC/Int.hs b/libraries/base/GHC/Int.hs
index 64019bc8ac..c52ea6e25d 100644
--- a/libraries/base/GHC/Int.hs
+++ b/libraries/base/GHC/Int.hs
@@ -72,8 +72,8 @@ instance Eq Int8 where
(/=) = neInt8
eqInt8, neInt8 :: Int8 -> Int8 -> Bool
-eqInt8 (I8# x) (I8# y) = isTrue# ((int8ToInt# x) ==# (int8ToInt# y))
-neInt8 (I8# x) (I8# y) = isTrue# ((int8ToInt# x) /=# (int8ToInt# y))
+eqInt8 (I8# x) (I8# y) = isTrue# (x `eqInt8#` y)
+neInt8 (I8# x) (I8# y) = isTrue# (x `neInt8#` y)
{-# INLINE [1] eqInt8 #-}
{-# INLINE [1] neInt8 #-}
@@ -285,8 +285,8 @@ instance Eq Int16 where
(/=) = neInt16
eqInt16, neInt16 :: Int16 -> Int16 -> Bool
-eqInt16 (I16# x) (I16# y) = isTrue# ((int16ToInt# x) ==# (int16ToInt# y))
-neInt16 (I16# x) (I16# y) = isTrue# ((int16ToInt# x) /=# (int16ToInt# y))
+eqInt16 (I16# x) (I16# y) = isTrue# (x `eqInt16#` y)
+neInt16 (I16# x) (I16# y) = isTrue# (x `neInt16#` y)
{-# INLINE [1] eqInt16 #-}
{-# INLINE [1] neInt16 #-}
@@ -497,8 +497,8 @@ instance Eq Int32 where
(/=) = neInt32
eqInt32, neInt32 :: Int32 -> Int32 -> Bool
-eqInt32 (I32# x) (I32# y) = isTrue# ((int32ToInt# x) ==# (int32ToInt# y))
-neInt32 (I32# x) (I32# y) = isTrue# ((int32ToInt# x) /=# (int32ToInt# y))
+eqInt32 (I32# x) (I32# y) = isTrue# (x `eqInt32#` y)
+neInt32 (I32# x) (I32# y) = isTrue# (x `neInt32#` y)
{-# INLINE [1] eqInt32 #-}
{-# INLINE [1] neInt32 #-}
diff --git a/libraries/base/GHC/Word.hs b/libraries/base/GHC/Word.hs
index 8569c875bb..baa878763e 100644
--- a/libraries/base/GHC/Word.hs
+++ b/libraries/base/GHC/Word.hs
@@ -80,8 +80,8 @@ instance Eq Word8 where
(/=) = neWord8
eqWord8, neWord8 :: Word8 -> Word8 -> Bool
-eqWord8 (W8# x) (W8# y) = isTrue# ((word8ToWord# x) `eqWord#` (word8ToWord# y))
-neWord8 (W8# x) (W8# y) = isTrue# ((word8ToWord# x) `neWord#` (word8ToWord# y))
+eqWord8 (W8# x) (W8# y) = isTrue# (x `eqWord8#` y)
+neWord8 (W8# x) (W8# y) = isTrue# (x `neWord8#` y)
{-# INLINE [1] eqWord8 #-}
{-# INLINE [1] neWord8 #-}
@@ -273,8 +273,8 @@ instance Eq Word16 where
(/=) = neWord16
eqWord16, neWord16 :: Word16 -> Word16 -> Bool
-eqWord16 (W16# x) (W16# y) = isTrue# ((word16ToWord# x) `eqWord#` (word16ToWord# y))
-neWord16 (W16# x) (W16# y) = isTrue# ((word16ToWord# x) `neWord#` (word16ToWord# y))
+eqWord16 (W16# x) (W16# y) = isTrue# (x `eqWord16#` y)
+neWord16 (W16# x) (W16# y) = isTrue# (x `neWord16#` y)
{-# INLINE [1] eqWord16 #-}
{-# INLINE [1] neWord16 #-}
@@ -509,8 +509,8 @@ instance Eq Word32 where
(/=) = neWord32
eqWord32, neWord32 :: Word32 -> Word32 -> Bool
-eqWord32 (W32# x) (W32# y) = isTrue# ((word32ToWord# x) `eqWord#` (word32ToWord# y))
-neWord32 (W32# x) (W32# y) = isTrue# ((word32ToWord# x) `neWord#` (word32ToWord# y))
+eqWord32 (W32# x) (W32# y) = isTrue# (x `eqWord32#` y)
+neWord32 (W32# x) (W32# y) = isTrue# (x `neWord32#` y)
{-# INLINE [1] eqWord32 #-}
{-# INLINE [1] neWord32 #-}