2 % (c) The AQUA Project, Glasgow University, 1993-1998
6 module StixPrim ( primCode, amodeToStix, amodeToStix' ) where
8 #include "HsVersions.h"
14 import AbsCSyn hiding ( spRel )
15 import AbsCUtils ( getAmodeRep, mixedTypeLocn )
16 import SMRep ( fixedHdrSize )
17 import Literal ( Literal(..), word2IntLit )
18 import PrimOp ( PrimOp(..), CCall(..), CCallTarget(..) )
19 import PrimRep ( PrimRep(..), isFloatingRep )
20 import UniqSupply ( returnUs, thenUs, getUniqueUs, UniqSM )
21 import Constants ( mIN_INTLIKE, uF_UPDATEE, bLOCK_SIZE )
22 import CLabel ( mkIntlikeClosureLabel, mkCharlikeClosureLabel,
23 mkMAP_FROZEN_infoLabel, mkForeignLabel )
26 import Char ( ord, isAlpha, isDigit )
31 The main honcho here is primCode, which handles the guts of COpStmts.
35 :: [CAddrMode] -- results
37 -> [CAddrMode] -- args
38 -> UniqSM StixTreeList
41 First, the dreaded @ccall@. We can't handle @casm@s.
43 Usually, this compiles to an assignment, but when the left-hand side
44 is empty, we just perform the call and ignore the result.
46 btw Why not let programmer use casm to provide assembly code instead
49 The (MP) integer operations are a true nightmare. Since we don't have
50 a convenient abstract way of allocating temporary variables on the (C)
51 stack, we use the space just below HpLim for the @MP_INT@ structures,
52 and modify our heap check accordingly.
55 -- NB: ordering of clauses somewhere driven by
56 -- the desire to getting sane patt-matching behavior
57 primCode res@[sr,dr] IntegerNegOp arg@[sa,da]
58 = gmpNegate (sr,dr) (sa,da)
60 primCode [res] IntegerCmpOp args@[sa1,da1, sa2,da2]
61 = gmpCompare res (sa1,da1, sa2,da2)
63 primCode [res] IntegerCmpIntOp args@[sa1,da1,ai]
64 = gmpCompareInt res (sa1,da1,ai)
66 primCode [res] Integer2IntOp arg@[sa,da]
67 = gmpInteger2Int res (sa,da)
69 primCode [res] Integer2WordOp arg@[sa,da]
70 = gmpInteger2Word res (sa,da)
72 primCode [res] Int2AddrOp [arg]
73 = simpleCoercion AddrRep res arg
75 primCode [res] Addr2IntOp [arg]
76 = simpleCoercion IntRep res arg
78 primCode [res] Int2WordOp [arg]
79 = simpleCoercion IntRep{-WordRep?-} res arg
81 primCode [res] Word2IntOp [arg]
82 = simpleCoercion IntRep res arg
86 primCode [res] SameMutableArrayOp args
88 compare = StPrim AddrEqOp (map amodeToStix args)
89 assign = StAssign IntRep (amodeToStix res) compare
91 returnUs (\xs -> assign : xs)
93 primCode res@[_] SameMutableByteArrayOp args
94 = primCode res SameMutableArrayOp args
96 primCode res@[_] SameMutVarOp args
97 = primCode res SameMutableArrayOp args
99 primCode res@[_] SameMVarOp args
100 = primCode res SameMutableArrayOp args
103 Freezing an array of pointers is a double assignment. We fix the
104 header of the ``new'' closure because the lhs is probably a better
105 addressing mode for the indirection (most likely, it's a VanillaReg).
109 primCode [lhs] UnsafeFreezeArrayOp [rhs]
111 lhs' = amodeToStix lhs
112 rhs' = amodeToStix rhs
113 header = StInd PtrRep lhs'
114 assign = StAssign PtrRep lhs' rhs'
115 freeze = StAssign PtrRep header mutArrPtrsFrozen_info
117 returnUs (\xs -> assign : freeze : xs)
119 primCode [lhs] UnsafeFreezeByteArrayOp [rhs]
120 = simpleCoercion PtrRep lhs rhs
123 Returning the size of (mutable) byte arrays is just
124 an indexing operation.
127 primCode [lhs] SizeofByteArrayOp [rhs]
129 lhs' = amodeToStix lhs
130 rhs' = amodeToStix rhs
131 sz = StIndex IntRep rhs' fixedHS
132 assign = StAssign IntRep lhs' (StInd IntRep sz)
134 returnUs (\xs -> assign : xs)
136 primCode [lhs] SizeofMutableByteArrayOp [rhs]
138 lhs' = amodeToStix lhs
139 rhs' = amodeToStix rhs
140 sz = StIndex IntRep rhs' fixedHS
141 assign = StAssign IntRep lhs' (StInd IntRep sz)
143 returnUs (\xs -> assign : xs)
147 Most other array primitives translate to simple indexing.
150 primCode lhs@[_] IndexArrayOp args
151 = primCode lhs ReadArrayOp args
153 primCode [lhs] ReadArrayOp [obj, ix]
155 lhs' = amodeToStix lhs
156 obj' = amodeToStix obj
158 base = StIndex IntRep obj' arrPtrsHS
159 assign = StAssign PtrRep lhs' (StInd PtrRep (StIndex PtrRep base ix'))
161 returnUs (\xs -> assign : xs)
163 primCode [] WriteArrayOp [obj, ix, v]
165 obj' = amodeToStix obj
168 base = StIndex IntRep obj' arrPtrsHS
169 assign = StAssign PtrRep (StInd PtrRep (StIndex PtrRep base ix')) v'
171 returnUs (\xs -> assign : xs)
173 primCode [] WriteForeignObjOp [obj, v]
175 obj' = amodeToStix obj
177 obj'' = StIndex AddrRep obj' (StInt 4711) -- fixedHS
178 assign = StAssign AddrRep (StInd AddrRep obj'') v'
180 returnUs (\xs -> assign : xs)
182 -- NB: indexing in "pk" units, *not* in bytes (WDP 95/09)
183 primCode ls IndexByteArrayOp_Char rs = primCode_ReadByteArrayOp CharRep ls rs
184 primCode ls IndexByteArrayOp_Int rs = primCode_ReadByteArrayOp IntRep ls rs
185 primCode ls IndexByteArrayOp_Word rs = primCode_ReadByteArrayOp WordRep ls rs
186 primCode ls IndexByteArrayOp_Addr rs = primCode_ReadByteArrayOp AddrRep ls rs
187 primCode ls IndexByteArrayOp_Float rs = primCode_ReadByteArrayOp FloatRep ls rs
188 primCode ls IndexByteArrayOp_Double rs = primCode_ReadByteArrayOp DoubleRep ls rs
189 primCode ls IndexByteArrayOp_StablePtr rs = primCode_ReadByteArrayOp StablePtrRep ls rs
190 primCode ls IndexByteArrayOp_Int64 rs = primCode_ReadByteArrayOp Int64Rep ls rs
191 primCode ls IndexByteArrayOp_Word64 rs = primCode_ReadByteArrayOp Word64Rep ls rs
193 primCode ls ReadByteArrayOp_Char rs = primCode_ReadByteArrayOp CharRep ls rs
194 primCode ls ReadByteArrayOp_Int rs = primCode_ReadByteArrayOp IntRep ls rs
195 primCode ls ReadByteArrayOp_Word rs = primCode_ReadByteArrayOp WordRep ls rs
196 primCode ls ReadByteArrayOp_Addr rs = primCode_ReadByteArrayOp AddrRep ls rs
197 primCode ls ReadByteArrayOp_Float rs = primCode_ReadByteArrayOp FloatRep ls rs
198 primCode ls ReadByteArrayOp_Double rs = primCode_ReadByteArrayOp DoubleRep ls rs
199 primCode ls ReadByteArrayOp_StablePtr rs = primCode_ReadByteArrayOp StablePtrRep ls rs
200 primCode ls ReadByteArrayOp_Int64 rs = primCode_ReadByteArrayOp Int64Rep ls rs
201 primCode ls ReadByteArrayOp_Word64 rs = primCode_ReadByteArrayOp Word64Rep ls rs
203 primCode ls ReadOffAddrOp_Char rs = primCode_IndexOffAddrOp CharRep ls rs
204 primCode ls ReadOffAddrOp_Int rs = primCode_IndexOffAddrOp IntRep ls rs
205 primCode ls ReadOffAddrOp_Word rs = primCode_IndexOffAddrOp WordRep ls rs
206 primCode ls ReadOffAddrOp_Addr rs = primCode_IndexOffAddrOp AddrRep ls rs
207 primCode ls ReadOffAddrOp_Float rs = primCode_IndexOffAddrOp FloatRep ls rs
208 primCode ls ReadOffAddrOp_Double rs = primCode_IndexOffAddrOp DoubleRep ls rs
209 primCode ls ReadOffAddrOp_StablePtr rs = primCode_IndexOffAddrOp StablePtrRep ls rs
210 primCode ls ReadOffAddrOp_Int64 rs = primCode_IndexOffAddrOp Int64Rep ls rs
211 primCode ls ReadOffAddrOp_Word64 rs = primCode_IndexOffAddrOp Word64Rep ls rs
213 primCode ls IndexOffAddrOp_Char rs = primCode_IndexOffAddrOp CharRep ls rs
214 primCode ls IndexOffAddrOp_Int rs = primCode_IndexOffAddrOp IntRep ls rs
215 primCode ls IndexOffAddrOp_Word rs = primCode_IndexOffAddrOp WordRep ls rs
216 primCode ls IndexOffAddrOp_Addr rs = primCode_IndexOffAddrOp AddrRep ls rs
217 primCode ls IndexOffAddrOp_Float rs = primCode_IndexOffAddrOp FloatRep ls rs
218 primCode ls IndexOffAddrOp_Double rs = primCode_IndexOffAddrOp DoubleRep ls rs
219 primCode ls IndexOffAddrOp_StablePtr rs = primCode_IndexOffAddrOp StablePtrRep ls rs
220 primCode ls IndexOffAddrOp_Int64 rs = primCode_IndexOffAddrOp Int64Rep ls rs
221 primCode ls IndexOffAddrOp_Word64 rs = primCode_IndexOffAddrOp Word64Rep ls rs
223 primCode ls IndexOffForeignObjOp_Char rs = primCode_IndexOffForeignObjOp CharRep ls rs
224 primCode ls IndexOffForeignObjOp_Int rs = primCode_IndexOffForeignObjOp IntRep ls rs
225 primCode ls IndexOffForeignObjOp_Word rs = primCode_IndexOffForeignObjOp WordRep ls rs
226 primCode ls IndexOffForeignObjOp_Addr rs = primCode_IndexOffForeignObjOp AddrRep ls rs
227 primCode ls IndexOffForeignObjOp_Float rs = primCode_IndexOffForeignObjOp FloatRep ls rs
228 primCode ls IndexOffForeignObjOp_Double rs = primCode_IndexOffForeignObjOp DoubleRep ls rs
229 primCode ls IndexOffForeignObjOp_StablePtr rs = primCode_IndexOffForeignObjOp StablePtrRep ls rs
230 primCode ls IndexOffForeignObjOp_Int64 rs = primCode_IndexOffForeignObjOp Int64Rep ls rs
231 primCode ls IndexOffForeignObjOp_Word64 rs = primCode_IndexOffForeignObjOp Word64Rep ls rs
233 primCode ls WriteOffAddrOp_Char rs = primCode_WriteOffAddrOp CharRep ls rs
234 primCode ls WriteOffAddrOp_Int rs = primCode_WriteOffAddrOp IntRep ls rs
235 primCode ls WriteOffAddrOp_Word rs = primCode_WriteOffAddrOp WordRep ls rs
236 primCode ls WriteOffAddrOp_Addr rs = primCode_WriteOffAddrOp AddrRep ls rs
237 primCode ls WriteOffAddrOp_Float rs = primCode_WriteOffAddrOp FloatRep ls rs
238 primCode ls WriteOffAddrOp_Double rs = primCode_WriteOffAddrOp DoubleRep ls rs
239 primCode ls WriteOffAddrOp_StablePtr rs = primCode_WriteOffAddrOp StablePtrRep ls rs
240 primCode ls WriteOffAddrOp_Int64 rs = primCode_WriteOffAddrOp Int64Rep ls rs
241 primCode ls WriteOffAddrOp_Word64 rs = primCode_WriteOffAddrOp Word64Rep ls rs
243 primCode ls WriteByteArrayOp_Char rs = primCode_WriteByteArrayOp CharRep ls rs
244 primCode ls WriteByteArrayOp_Int rs = primCode_WriteByteArrayOp IntRep ls rs
245 primCode ls WriteByteArrayOp_Word rs = primCode_WriteByteArrayOp WordRep ls rs
246 primCode ls WriteByteArrayOp_Addr rs = primCode_WriteByteArrayOp AddrRep ls rs
247 primCode ls WriteByteArrayOp_Float rs = primCode_WriteByteArrayOp FloatRep ls rs
248 primCode ls WriteByteArrayOp_Double rs = primCode_WriteByteArrayOp DoubleRep ls rs
249 primCode ls WriteByteArrayOp_StablePtr rs = primCode_WriteByteArrayOp StablePtrRep ls rs
250 primCode ls WriteByteArrayOp_Int64 rs = primCode_WriteByteArrayOp Int64Rep ls rs
251 primCode ls WriteByteArrayOp_Word64 rs = primCode_WriteByteArrayOp Word64Rep ls rs
255 ToDo: saving/restoring of volatile regs around ccalls.
258 primCode lhs (CCallOp (CCall (StaticTarget fn) is_asm may_gc cconv)) rhs
259 | is_asm = error "ERROR: Native code generator can't handle casm"
260 | not may_gc = returnUs (\xs -> ccall : xs)
262 save_thread_state `thenUs` \ save ->
263 load_thread_state `thenUs` \ load ->
264 getUniqueUs `thenUs` \ uniq ->
266 id = StReg (StixTemp uniq IntRep)
268 suspend = StAssign IntRep id
269 (StCall SLIT("suspendThread") cconv IntRep [stgBaseReg])
270 resume = StCall SLIT("resumeThread") cconv VoidRep [id]
272 returnUs (\xs -> save (suspend : ccall : resume : load xs))
275 args = map amodeCodeForCCall rhs
276 amodeCodeForCCall x =
277 let base = amodeToStix' x
279 case getAmodeRep x of
280 ArrayRep -> StIndex PtrRep base arrPtrsHS
281 ByteArrayRep -> StIndex IntRep base arrWordsHS
282 ForeignObjRep -> StIndex PtrRep base fixedHS
286 [] -> StCall fn cconv VoidRep args
288 let lhs' = amodeToStix lhs
289 pk = case getAmodeRep lhs of
291 DoubleRep -> DoubleRep
294 StAssign pk lhs' (StCall fn cconv pk args)
297 DataToTagOp won't work for 64-bit archs, as it is.
300 primCode [lhs] DataToTagOp [arg]
301 = let lhs' = amodeToStix lhs
302 arg' = amodeToStix arg
303 infoptr = StInd PtrRep arg'
304 word_32 = StInd WordRep (StIndex PtrRep infoptr (StInt (-1)))
305 masked_le32 = StPrim SrlOp [word_32, StInt 16]
306 masked_be32 = StPrim AndOp [word_32, StInt 65535]
307 #ifdef WORDS_BIGENDIAN
312 assign = StAssign IntRep lhs' masked
314 returnUs (\xs -> assign : xs)
317 MutVars are pretty simple.
318 #define writeMutVarzh(a,v) (P_)(((StgMutVar *)(a))->var)=(v)
321 primCode [] WriteMutVarOp [aa,vv]
322 = let aa_s = amodeToStix aa
323 vv_s = amodeToStix vv
324 var_field = StIndex PtrRep aa_s fixedHS
325 assign = StAssign PtrRep (StInd PtrRep var_field) vv_s
327 returnUs (\xs -> assign : xs)
329 primCode [rr] ReadMutVarOp [aa]
330 = let aa_s = amodeToStix aa
331 rr_s = amodeToStix rr
332 var_field = StIndex PtrRep aa_s fixedHS
333 assign = StAssign PtrRep rr_s (StInd PtrRep var_field)
335 returnUs (\xs -> assign : xs)
338 Now the more mundane operations.
343 lhs' = map amodeToStix lhs
344 rhs' = map amodeToStix' rhs
345 pk = getAmodeRep (head lhs)
347 returnUs (\ xs -> simplePrim pk lhs' op rhs' : xs)
350 Helper fns for some array ops.
353 primCode_ReadByteArrayOp pk [lhs] [obj, ix]
355 lhs' = amodeToStix lhs
356 obj' = amodeToStix obj
358 base = StIndex IntRep obj' arrWordsHS
359 assign = StAssign pk lhs' (StInd pk (StIndex pk base ix'))
361 returnUs (\xs -> assign : xs)
364 primCode_IndexOffAddrOp pk [lhs] [obj, ix]
366 lhs' = amodeToStix lhs
367 obj' = amodeToStix obj
369 assign = StAssign pk lhs' (StInd pk (StIndex pk obj' ix'))
371 returnUs (\xs -> assign : xs)
374 primCode_IndexOffForeignObjOp pk [lhs] [obj, ix]
376 lhs' = amodeToStix lhs
377 obj' = amodeToStix obj
379 obj'' = StIndex AddrRep obj' fixedHS
380 assign = StAssign pk lhs' (StInd pk (StIndex pk obj'' ix'))
382 returnUs (\xs -> assign : xs)
385 primCode_WriteOffAddrOp pk [] [obj, ix, v]
387 obj' = amodeToStix obj
390 assign = StAssign pk (StInd pk (StIndex pk obj' ix')) v'
392 returnUs (\xs -> assign : xs)
395 primCode_WriteByteArrayOp pk [] [obj, ix, v]
397 obj' = amodeToStix obj
400 base = StIndex IntRep obj' arrWordsHS
401 assign = StAssign pk (StInd pk (StIndex pk base ix')) v'
403 returnUs (\xs -> assign : xs)
412 -> UniqSM StixTreeList
414 simpleCoercion pk lhs rhs
415 = returnUs (\xs -> StAssign pk (amodeToStix lhs) (amodeToStix rhs) : xs)
418 Here we try to rewrite primitives into a form the code generator can
419 understand. Any primitives not handled here must be handled at the
420 level of the specific code generator.
424 :: PrimRep -- Rep of first destination
425 -> [StixTree] -- Destinations
431 Now look for something more conventional.
434 simplePrim pk [lhs] op rest = StAssign pk lhs (StPrim op rest)
435 simplePrim pk as op bs = simplePrim_error op
438 = error ("ERROR: primitive operation `"++show op++"'cannot be handled\nby the native-code generator. Workaround: use -fvia-C.\n(Perhaps you should report it as a GHC bug, also.)\n")
441 %---------------------------------------------------------------------
443 Here we generate the Stix code for CAddrModes.
445 When a character is fetched from a mixed type location, we have to do
446 an extra cast. This is reflected in amodeCode', which is for rhs
447 amodes that might possibly need the extra cast.
450 amodeToStix, amodeToStix' :: CAddrMode -> StixTree
452 amodeToStix'{-'-} am@(CVal rr CharRep)
453 | mixedTypeLocn am = StPrim ChrOp [amodeToStix am]
454 | otherwise = amodeToStix am
456 amodeToStix' am = amodeToStix am
459 amodeToStix am@(CVal rr CharRep)
461 = StInd IntRep (amodeToStix (CAddr rr))
463 amodeToStix (CVal rr pk) = StInd pk (amodeToStix (CAddr rr))
465 amodeToStix (CAddr (SpRel off))
466 = StIndex PtrRep stgSp (StInt (toInteger IBOX(off)))
468 amodeToStix (CAddr (HpRel off))
469 = StIndex IntRep stgHp (StInt (toInteger (- IBOX(off))))
471 amodeToStix (CAddr (NodeRel off))
472 = StIndex IntRep stgNode (StInt (toInteger IBOX(off)))
474 amodeToStix (CAddr (CIndex base off pk))
475 = StIndex pk (amodeToStix base) (amodeToStix off)
477 amodeToStix (CReg magic) = StReg (StixMagicId magic)
478 amodeToStix (CTemp uniq pk) = StReg (StixTemp uniq pk)
480 amodeToStix (CLbl lbl _) = StCLbl lbl
482 -- For CharLike and IntLike, we attempt some trivial constant-folding here.
484 amodeToStix (CCharLike (CLit (MachChar c)))
485 = StIndex CharRep cHARLIKE_closure (StInt (toInteger off))
487 off = charLikeSize * ord c
489 amodeToStix (CCharLike x)
490 = StIndex CharRep cHARLIKE_closure off
492 off = StPrim IntMulOp [amodeToStix x, StInt (toInteger charLikeSize)]
494 amodeToStix (CIntLike (CLit (MachInt i)))
495 = StIndex CharRep{-yes,really-} iNTLIKE_closure (StInt (toInteger off))
497 off = intLikeSize * (fromInteger (i - mIN_INTLIKE))
499 amodeToStix (CIntLike x)
502 amodeToStix (CLit core)
504 MachChar c -> StInt (toInteger (ord c))
505 MachStr s -> StString s
506 MachAddr a -> StInt a
508 MachWord w -> case word2IntLit core of MachInt iw -> StInt iw
509 MachLitLit s _ -> litLitErr
510 MachLabel l -> StCLbl (mkForeignLabel l False{-ToDo: dynamic-})
511 MachFloat d -> StFloat d
512 MachDouble d -> StDouble d
513 _ -> panic "amodeToStix:core literal"
515 amodeToStix (CMacroExpr _ macro [arg])
517 ENTRY_CODE -> amodeToStix arg
518 ARG_TAG -> amodeToStix arg -- just an integer no. of words
520 #ifdef WORDS_BIGENDIAN
522 [StInd WordRep (StIndex PtrRep (amodeToStix arg)
523 (StInt (toInteger (-1)))),
527 [StInd WordRep (StIndex PtrRep (amodeToStix arg)
528 (StInt (toInteger (-1)))),
532 -> StInd PtrRep (StIndex PtrRep (amodeToStix arg)
533 (StInt (toInteger uF_UPDATEE)))
536 panic "native code generator can't compile lit-lits, use -fvia-C"
539 Sizes of the CharLike and IntLike closures that are arranged as arrays
540 in the data segment. (These are in bytes.)
543 -- The INTLIKE base pointer
545 iNTLIKE_closure :: StixTree
546 iNTLIKE_closure = StCLbl mkIntlikeClosureLabel
550 cHARLIKE_closure :: StixTree
551 cHARLIKE_closure = StCLbl mkCharlikeClosureLabel
553 mutArrPtrsFrozen_info = StCLbl mkMAP_FROZEN_infoLabel
555 -- these are the sizes of charLike and intLike closures, in _bytes_.
556 charLikeSize = (fixedHdrSize + 1) * (fromInteger (sizeOf PtrRep))
557 intLikeSize = (fixedHdrSize + 1) * (fromInteger (sizeOf PtrRep))
563 = getUniqueUs `thenUs` \tso_uq ->
564 let tso = StReg (StixTemp tso_uq ThreadIdRep) in
566 StAssign ThreadIdRep tso stgCurrentTSO :
568 (StInd PtrRep (StPrim IntAddOp
569 [tso, StInt (toInteger (TSO_SP*BYTES_PER_WORD))]))
572 (StInd PtrRep (StPrim IntAddOp
573 [tso, StInt (toInteger (TSO_SU*BYTES_PER_WORD))]))
576 (StInd PtrRep (StPrim IntAddOp
577 [tso, StInt (toInteger (TSO_SPLIM*BYTES_PER_WORD))]))
580 (StInd PtrRep (StPrim IntAddOp
582 StInt (toInteger (BDESCR_FREE * BYTES_PER_WORD))]))
583 (StPrim IntAddOp [stgHp, StInt (toInteger (1 * BYTES_PER_WORD))]) :
588 = getUniqueUs `thenUs` \tso_uq ->
589 let tso = StReg (StixTemp tso_uq ThreadIdRep) in
591 StAssign ThreadIdRep tso stgCurrentTSO :
592 StAssign PtrRep stgSp
593 (StInd PtrRep (StPrim IntAddOp
594 [tso, StInt (toInteger (TSO_SP*BYTES_PER_WORD))])) :
595 StAssign PtrRep stgSu
596 (StInd PtrRep (StPrim IntAddOp
597 [tso, StInt (toInteger (TSO_SU*BYTES_PER_WORD))])) :
598 StAssign PtrRep stgSpLim
599 (StInd PtrRep (StPrim IntAddOp
600 [tso, StInt (toInteger (TSO_SPLIM*BYTES_PER_WORD))])) :
601 StAssign PtrRep stgHp
603 StInd PtrRep (StPrim IntAddOp
605 StInt (toInteger (BDESCR_FREE * BYTES_PER_WORD))]),
606 StInt (toInteger (1 * BYTES_PER_WORD))
608 StAssign PtrRep stgHpLim
610 StInd PtrRep (StPrim IntAddOp
612 StInt (toInteger (BDESCR_START * BYTES_PER_WORD))]),
613 StInt (toInteger (bLOCK_SIZE - (1 * BYTES_PER_WORD)))