diff options
author | John Ericson <git@JohnEricson.me> | 2019-10-19 18:59:48 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-05-13 16:44:23 -0400 |
commit | c6de580547728ddfc20a3a0914bc767a282c24ec (patch) | |
tree | 0f02ee8e15250609775e8e5e728e1c652b57b1f3 | |
parent | e0ded198e9ec1c8bb7253506569e7ae47818e791 (diff) | |
download | haskell-c6de580547728ddfc20a3a0914bc767a282c24ec.tar.gz |
Use fix-sized order primops for fixed size boxed types
Progress towards #19026
-rw-r--r-- | libraries/base/GHC/Int.hs | 24 | ||||
-rw-r--r-- | libraries/base/GHC/Word.hs | 24 |
2 files changed, 24 insertions, 24 deletions
diff --git a/libraries/base/GHC/Int.hs b/libraries/base/GHC/Int.hs index fa5aa3f8e5..e25205d064 100644 --- a/libraries/base/GHC/Int.hs +++ b/libraries/base/GHC/Int.hs @@ -89,10 +89,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 @@ -302,10 +302,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 @@ -520,10 +520,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 b75d24359b..acac8acceb 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 @@ -287,10 +287,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 @@ -520,10 +520,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 |