import SMRep ( fixedHdrSize )
import Literal ( Literal(..), word2IntLit )
import MachOp ( MachOp(..) )
-import PrimRep ( PrimRep(..), getPrimRepSizeInBytes )
+import PrimRep ( PrimRep(..), getPrimRepArrayElemSize )
import UniqSupply ( returnUs, thenUs, getUniqueUs, UniqSM )
-import Constants ( mIN_INTLIKE, mIN_CHARLIKE, uF_UPDATEE, bLOCK_SIZE,
+import Constants ( wORD_SIZE,
+ mIN_INTLIKE, mIN_CHARLIKE, uF_UPDATEE, bLOCK_SIZE,
rESERVED_STACK_WORDS )
import CLabel ( mkIntlikeClosureLabel, mkCharlikeClosureLabel,
mkMAP_FROZEN_infoLabel, mkEMPTY_MVAR_infoLabel,
pk = case getAmodeRep lhs of
FloatRep -> FloatRep
DoubleRep -> DoubleRep
+ Int64Rep -> Int64Rep
+ Word64Rep -> Word64Rep
other -> IntRep
foreignCallCode lhs call rhs
amodeToStix (CVal rr pk) = StInd pk (amodeToStix (CAddr rr))
+amodeToStix CBytesPerWord
+ = StInt (toInteger wORD_SIZE)
+
amodeToStix (CMem pk addr) = StInd pk (amodeToStix addr)
amodeToStix (CAddr (SpRel off))
mutArrPtrsFrozen_info = StCLbl mkMAP_FROZEN_infoLabel
-- these are the sizes of charLike and intLike closures, in _bytes_.
-charLikeSize = (fixedHdrSize + 1) * (sizeOf PtrRep)
-intLikeSize = (fixedHdrSize + 1) * (sizeOf PtrRep)
+charLikeSize = (fixedHdrSize + 1) * (getPrimRepArrayElemSize PtrRep)
+intLikeSize = (fixedHdrSize + 1) * (getPrimRepArrayElemSize PtrRep)
\end{code}
])
: StAssignReg PtrRep
stgHpLim
- (StMachOp MO_Nat_Add
- [StInd PtrRep
- (StMachOp MO_Nat_Add
- [StReg stgCurrentNursery,
- StInt (toInteger (BDESCR_START * BYTES_PER_WORD))]),
- StInt (toInteger (bLOCK_SIZE - (1 * BYTES_PER_WORD)))
- ])
+ (StIndex Word8Rep
+ (StInd PtrRep
+ (StIndex PtrRep (StReg stgCurrentNursery)
+ (StInt (toInteger BDESCR_START))
+ )
+ )
+ (StMachOp MO_Nat_Sub
+ [StMachOp MO_NatU_Mul
+ [StInd WordRep
+ (StIndex PtrRep (StReg stgCurrentNursery)
+ (StInt (toInteger BDESCR_BLOCKS))),
+ StInt (toInteger bLOCK_SIZE{-in bytes-})
+ ],
+ StInt (1 * BYTES_PER_WORD)
+ ]
+ )
+
+ )
+
: xs
)
\end{code}