From: simonmar Date: Wed, 12 Dec 2001 12:20:10 +0000 (+0000) Subject: [project @ 2001-12-12 12:19:11 by simonmar] X-Git-Tag: Approximately_9120_patches~406 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=23d366594eec3e60a86ea90e4edc42fd5f1d88ee;p=ghc-hetmet.git [project @ 2001-12-12 12:19:11 by simonmar] shiftery #ifdefs --- diff --git a/ghc/compiler/codeGen/CgHeapery.lhs b/ghc/compiler/codeGen/CgHeapery.lhs index 4049930..f270795 100644 --- a/ghc/compiler/codeGen/CgHeapery.lhs +++ b/ghc/compiler/codeGen/CgHeapery.lhs @@ -1,7 +1,7 @@ % % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 % -% $Id: CgHeapery.lhs,v 1.28 2001/11/23 11:58:00 simonmar Exp $ +% $Id: CgHeapery.lhs,v 1.29 2001/12/12 12:19:11 simonmar Exp $ % \section[CgHeapery]{Heap management functions} @@ -377,10 +377,16 @@ altHeapCheck is_fun regs [] AbsCNop Nothing code -- build up a bitmap of the live pointer registers +#if __GLASGOW_HASKELL__ >= 503 +shiftL = uncheckedShiftL# +#else +shiftL = shiftL# +#endif + mkRegLiveness :: [MagicId] -> Word# mkRegLiveness [] = int2Word# 0# mkRegLiveness (VanillaReg rep i : regs) | isFollowableRep rep - = ((int2Word# 1#) `shiftL#` (i -# 1#)) `or#` mkRegLiveness regs + = ((int2Word# 1#) `shiftL` (i -# 1#)) `or#` mkRegLiveness regs mkRegLiveness (_ : regs) = mkRegLiveness regs -- The two functions below are only used in a GranSim setup diff --git a/ghc/compiler/nativeGen/MachMisc.lhs b/ghc/compiler/nativeGen/MachMisc.lhs index 4aa230b..6c5e317 100644 --- a/ghc/compiler/nativeGen/MachMisc.lhs +++ b/ghc/compiler/nativeGen/MachMisc.lhs @@ -53,7 +53,7 @@ import PrimRep ( PrimRep(..) ) import Stix ( StixStmt(..), StixExpr(..), StixReg(..), CodeSegment, DestInfo(..) ) import Panic ( panic ) -import GlaExts ( word2Int#, int2Word#, shiftRL#, and#, (/=#) ) +import GlaExts import Outputable ( pprPanic, ppr, showSDoc ) import IOExts ( trace ) import Config ( cLeadingUnderscore ) @@ -176,7 +176,11 @@ exactLog2 x Just (toInteger (iBox (pow2 x#))) } where +#if __GLASGOW_HASKELL__ >= 503 + shiftr x y = uncheckedShiftRL# x y +#else shiftr x y = shiftRL# x y +#endif pow2 x# | x# ==# 1# = 0# | otherwise = 1# +# pow2 (w2i (i2w x# `shiftr` 1#))