From 44d7b259d26ff96ec62e155974678f445720b0f8 Mon Sep 17 00:00:00 2001 From: panne Date: Tue, 11 Dec 2001 19:01:17 +0000 Subject: [PATCH] [project @ 2001-12-11 19:01:17 by panne] More shifting #ifdef-ery... :-P --- ghc/compiler/basicTypes/Unique.lhs | 8 ++++++++ ghc/compiler/utils/UniqFM.lhs | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/ghc/compiler/basicTypes/Unique.lhs b/ghc/compiler/basicTypes/Unique.lhs index 86e6d60..510e728 100644 --- a/ghc/compiler/basicTypes/Unique.lhs +++ b/ghc/compiler/basicTypes/Unique.lhs @@ -120,7 +120,11 @@ i2w_s x = (x::Int#) mkUnique (C# c) (I# i) = MkUnique (w2i (tag `or#` bits)) where +#if __GLASGOW_HASKELL__ >= 503 + tag = i2w (ord# c) `uncheckedShiftL#` i2w_s 24# +#else tag = i2w (ord# c) `shiftL#` i2w_s 24# +#endif bits = i2w i `and#` (i2w 16777215#){-``0x00ffffff''-} unpkUnique (MkUnique u) @@ -130,7 +134,11 @@ unpkUnique (MkUnique u) in (tag, i) where +#if __GLASGOW_HASKELL__ >= 503 + shiftr x y = uncheckedShiftRL# x y +#else shiftr x y = shiftRL# x y +#endif \end{code} diff --git a/ghc/compiler/utils/UniqFM.lhs b/ghc/compiler/utils/UniqFM.lhs index 7e46e47..475d418 100644 --- a/ghc/compiler/utils/UniqFM.lhs +++ b/ghc/compiler/utils/UniqFM.lhs @@ -800,10 +800,18 @@ shiftR_ :: FastInt -> FastInt -> FastInt #if __GLASGOW_HASKELL__ {-# INLINE shiftL_ #-} {-# INLINE shiftR_ #-} +#if __GLASGOW_HASKELL__ >= 503 +shiftL_ n p = word2Int#((int2Word# n) `uncheckedShiftL#` p) +#else shiftL_ n p = word2Int#((int2Word# n) `shiftL#` p) +#endif shiftR_ n p = word2Int#((int2Word# n) `shiftr` p) where +#if __GLASGOW_HASKELL__ >= 503 + shiftr x y = uncheckedShiftRL# x y +#else shiftr x y = shiftRL# x y +#endif #else {- not GHC -} shiftL_ n p = n * (2 ^ p) -- 1.7.10.4