From: simonmar Date: Tue, 25 May 2004 09:27:16 +0000 (+0000) Subject: [project @ 2004-05-25 09:27:16 by simonmar] X-Git-Tag: nhc98-1-18-release~319 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=8e905585c46e3bd2682996fad63509272c3a8ff6;p=ghc-base.git [project @ 2004-05-25 09:27:16 by simonmar] Small performance hack in maxBound::Word. --- diff --git a/GHC/Word.hs b/GHC/Word.hs index 5a13fd0..b703782 100644 --- a/GHC/Word.hs +++ b/GHC/Word.hs @@ -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