summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-10-19 18:59:48 -0400
committerBen Gamari <ben@smart-cactus.org>2021-05-19 22:12:21 -0400
commitac23d75b5327f3cef9f6f1582c841839fdcb8313 (patch)
treec876f4da44ec83c7045e05704a02df53925489e9
parent2bfea309619f6af377a166ea932a8e4d335ae1bf (diff)
downloadhaskell-ac23d75b5327f3cef9f6f1582c841839fdcb8313.tar.gz
Use fix-sized order primops for fixed size boxed types
Progress towards #19026 (cherry picked from commit c6de580547728ddfc20a3a0914bc767a282c24ec)
-rw-r--r--libraries/base/GHC/Int.hs24
-rw-r--r--libraries/base/GHC/Word.hs24
2 files changed, 24 insertions, 24 deletions
diff --git a/libraries/base/GHC/Int.hs b/libraries/base/GHC/Int.hs
index 6713130c14..b92f334721 100644
--- a/libraries/base/GHC/Int.hs
+++ b/libraries/base/GHC/Int.hs
@@ -86,10 +86,10 @@ instance Ord Int8 where
{-# INLINE [1] ltInt8 #-}
{-# INLINE [1] leInt8 #-}
gtInt8, geInt8, ltInt8, leInt8 :: Int8 -> Int8 -> Bool
-(I8# x) `gtInt8` (I8# y) = isTrue# ((int8ToInt# x) ># (int8ToInt# y))
-(I8# x) `geInt8` (I8# y) = isTrue# ((int8ToInt# x) >=# (int8ToInt# y))
-(I8# x) `ltInt8` (I8# y) = isTrue# ((int8ToInt# x) <# (int8ToInt# y))
-(I8# x) `leInt8` (I8# y) = isTrue# ((int8ToInt# x) <=# (int8ToInt# y))
+(I8# x) `gtInt8` (I8# y) = isTrue# (x `gtInt8#` y)
+(I8# x) `geInt8` (I8# y) = isTrue# (x `geInt8#` y)
+(I8# x) `ltInt8` (I8# y) = isTrue# (x `ltInt8#` y)
+(I8# x) `leInt8` (I8# y) = isTrue# (x `leInt8#` y)
-- | @since 2.01
instance Show Int8 where
@@ -303,10 +303,10 @@ instance Ord Int16 where
{-# INLINE [1] ltInt16 #-}
{-# INLINE [1] leInt16 #-}
gtInt16, geInt16, ltInt16, leInt16 :: Int16 -> Int16 -> Bool
-(I16# x) `gtInt16` (I16# y) = isTrue# ((int16ToInt# x) ># (int16ToInt# y))
-(I16# x) `geInt16` (I16# y) = isTrue# ((int16ToInt# x) >=# (int16ToInt# y))
-(I16# x) `ltInt16` (I16# y) = isTrue# ((int16ToInt# x) <# (int16ToInt# y))
-(I16# x) `leInt16` (I16# y) = isTrue# ((int16ToInt# x) <=# (int16ToInt# y))
+(I16# x) `gtInt16` (I16# y) = isTrue# (x `gtInt16#` y)
+(I16# x) `geInt16` (I16# y) = isTrue# (x `geInt16#` y)
+(I16# x) `ltInt16` (I16# y) = isTrue# (x `ltInt16#` y)
+(I16# x) `leInt16` (I16# y) = isTrue# (x `leInt16#` y)
-- | @since 2.01
instance Show Int16 where
@@ -525,10 +525,10 @@ instance Ord Int32 where
{-# INLINE [1] ltInt32 #-}
{-# INLINE [1] leInt32 #-}
gtInt32, geInt32, ltInt32, leInt32 :: Int32 -> Int32 -> Bool
-(I32# x) `gtInt32` (I32# y) = isTrue# ((int32ToInt# x) ># (int32ToInt# y))
-(I32# x) `geInt32` (I32# y) = isTrue# ((int32ToInt# x) >=# (int32ToInt# y))
-(I32# x) `ltInt32` (I32# y) = isTrue# ((int32ToInt# x) <# (int32ToInt# y))
-(I32# x) `leInt32` (I32# y) = isTrue# ((int32ToInt# x) <=# (int32ToInt# y))
+(I32# x) `gtInt32` (I32# y) = isTrue# (x `gtInt32#` y)
+(I32# x) `geInt32` (I32# y) = isTrue# (x `geInt32#` y)
+(I32# x) `ltInt32` (I32# y) = isTrue# (x `ltInt32#` y)
+(I32# x) `leInt32` (I32# y) = isTrue# (x `leInt32#` y)
-- | @since 2.01
instance Show Int32 where
diff --git a/libraries/base/GHC/Word.hs b/libraries/base/GHC/Word.hs
index 77d63cc9d7..c7a21be8ce 100644
--- a/libraries/base/GHC/Word.hs
+++ b/libraries/base/GHC/Word.hs
@@ -97,10 +97,10 @@ instance Ord Word8 where
{-# INLINE [1] ltWord8 #-}
{-# INLINE [1] leWord8 #-}
gtWord8, geWord8, ltWord8, leWord8 :: Word8 -> Word8 -> Bool
-(W8# x) `gtWord8` (W8# y) = isTrue# ((word8ToWord# x) `gtWord#` (word8ToWord# y))
-(W8# x) `geWord8` (W8# y) = isTrue# ((word8ToWord# x) `geWord#` (word8ToWord# y))
-(W8# x) `ltWord8` (W8# y) = isTrue# ((word8ToWord# x) `ltWord#` (word8ToWord# y))
-(W8# x) `leWord8` (W8# y) = isTrue# ((word8ToWord# x) `leWord#` (word8ToWord# y))
+(W8# x) `gtWord8` (W8# y) = isTrue# (x `gtWord8#` y)
+(W8# x) `geWord8` (W8# y) = isTrue# (x `geWord8#` y)
+(W8# x) `ltWord8` (W8# y) = isTrue# (x `ltWord8#` y)
+(W8# x) `leWord8` (W8# y) = isTrue# (x `leWord8#` y)
-- | @since 2.01
instance Show Word8 where
@@ -288,10 +288,10 @@ instance Ord Word16 where
{-# INLINE [1] ltWord16 #-}
{-# INLINE [1] leWord16 #-}
gtWord16, geWord16, ltWord16, leWord16 :: Word16 -> Word16 -> Bool
-(W16# x) `gtWord16` (W16# y) = isTrue# ((word16ToWord# x) `gtWord#` (word16ToWord# y))
-(W16# x) `geWord16` (W16# y) = isTrue# ((word16ToWord# x) `geWord#` (word16ToWord# y))
-(W16# x) `ltWord16` (W16# y) = isTrue# ((word16ToWord# x) `ltWord#` (word16ToWord# y))
-(W16# x) `leWord16` (W16# y) = isTrue# ((word16ToWord# x) `leWord#` (word16ToWord# y))
+(W16# x) `gtWord16` (W16# y) = isTrue# (x `gtWord16#` y)
+(W16# x) `geWord16` (W16# y) = isTrue# (x `geWord16#` y)
+(W16# x) `ltWord16` (W16# y) = isTrue# (x `ltWord16#` y)
+(W16# x) `leWord16` (W16# y) = isTrue# (x `leWord16#` y)
-- | @since 2.01
instance Show Word16 where
@@ -522,10 +522,10 @@ instance Ord Word32 where
{-# INLINE [1] ltWord32 #-}
{-# INLINE [1] leWord32 #-}
gtWord32, geWord32, ltWord32, leWord32 :: Word32 -> Word32 -> Bool
-(W32# x) `gtWord32` (W32# y) = isTrue# ((word32ToWord# x) `gtWord#` (word32ToWord# y))
-(W32# x) `geWord32` (W32# y) = isTrue# ((word32ToWord# x) `geWord#` (word32ToWord# y))
-(W32# x) `ltWord32` (W32# y) = isTrue# ((word32ToWord# x) `ltWord#` (word32ToWord# y))
-(W32# x) `leWord32` (W32# y) = isTrue# ((word32ToWord# x) `leWord#` (word32ToWord# y))
+(W32# x) `gtWord32` (W32# y) = isTrue# (x `gtWord32#` y)
+(W32# x) `geWord32` (W32# y) = isTrue# (x `geWord32#` y)
+(W32# x) `ltWord32` (W32# y) = isTrue# (x `ltWord32#` y)
+(W32# x) `leWord32` (W32# y) = isTrue# (x `leWord32#` y)
-- | @since 2.01
instance Num Word32 where