readsPrec p s = [(fromInteger x, r) | (x, r) <- readsPrec p s]
instance Bits Word where
+ {-# INLINE shift #-}
+
(W# x#) .&. (W# y#) = W# (x# `and#` y#)
(W# x#) .|. (W# y#) = W# (x# `or#` y#)
(W# x#) `xor` (W# y#) = W# (x# `xor#` y#)
readsPrec p s = [(fromIntegral (x::Int), r) | (x, r) <- readsPrec p s]
instance Bits Word8 where
+ {-# INLINE shift #-}
+
(W8# x#) .&. (W8# y#) = W8# (x# `and#` y#)
(W8# x#) .|. (W8# y#) = W8# (x# `or#` y#)
(W8# x#) `xor` (W8# y#) = W8# (x# `xor#` y#)
readsPrec p s = [(fromIntegral (x::Int), r) | (x, r) <- readsPrec p s]
instance Bits Word16 where
+ {-# INLINE shift #-}
+
(W16# x#) .&. (W16# y#) = W16# (x# `and#` y#)
(W16# x#) .|. (W16# y#) = W16# (x# `or#` y#)
(W16# x#) `xor` (W16# y#) = W16# (x# `xor#` y#)
| otherwise = case word32ToInteger# x# of (# s, d #) -> J# s d
instance Bits Word32 where
+ {-# INLINE shift #-}
+
(W32# x#) .&. (W32# y#) = W32# (x# `and32#` y#)
(W32# x#) .|. (W32# y#) = W32# (x# `or32#` y#)
(W32# x#) `xor` (W32# y#) = W32# (x# `xor32#` y#)
#endif
instance Bits Word32 where
+ {-# INLINE shift #-}
+
(W32# x#) .&. (W32# y#) = W32# (x# `and#` y#)
(W32# x#) .|. (W32# y#) = W32# (x# `or#` y#)
(W32# x#) `xor` (W32# y#) = W32# (x# `xor#` y#)
| otherwise = case word64ToInteger# x# of (# s, d #) -> J# s d
instance Bits Word64 where
+ {-# INLINE shift #-}
+
(W64# x#) .&. (W64# y#) = W64# (x# `and64#` y#)
(W64# x#) .|. (W64# y#) = W64# (x# `or64#` y#)
(W64# x#) `xor` (W64# y#) = W64# (x# `xor64#` y#)
i# = word2Int# x#
instance Bits Word64 where
+ {-# INLINE shift #-}
+
(W64# x#) .&. (W64# y#) = W64# (x# `and#` y#)
(W64# x#) .|. (W64# y#) = W64# (x# `or#` y#)
(W64# x#) `xor` (W64# y#) = W64# (x# `xor#` y#)