Commit 9eef5c0b authored by simonmar's avatar simonmar
Browse files

[project @ 2004-05-25 09:27:16 by simonmar]

Small performance hack in maxBound::Word.
parent 5c0be5d0
......@@ -132,12 +132,15 @@ instance Integral Word where
instance Bounded Word where
minBound = 0
-- use unboxed literals for maxBound, because GHC doesn't optimise
-- (fromInteger 0xffffffff :: Word).
#if WORD_SIZE_IN_BITS == 31
maxBound = 0x7FFFFFFF
maxBound = W# (int2Word# 0x7FFFFFFF#)
#elif WORD_SIZE_IN_BITS == 32
maxBound = 0xFFFFFFFF
maxBound = W# (int2Word# 0xFFFFFFFF#)
#else
maxBound = 0xFFFFFFFFFFFFFFFF
maxBound = W# (int2Word# 0xFFFFFFFFFFFFFFFF#)
#endif
instance Ix Word where
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment