module DDC.Core.Salt.Platform
( Platform (..)
, platform32
, platform64)
where
import DDC.Base.Pretty
data Platform
= Platform
{
platformAddrBytes :: Integer
, platformTagBytes :: Integer
, platformNatBytes :: Integer
, platformAlignBytes :: Integer
, platformObjBytes :: Integer }
deriving Show
instance Pretty Platform where
ppr pp
= vcat
[ text "Address Width (bytes) : "
<> text (show $ platformAddrBytes pp)
, text "Tag Word Width (bytes) : "
<> text (show $ platformTagBytes pp)
, text "Nat Word Width (bytes) : "
<> text (show $ platformNatBytes pp)
, text "Function Alignment (bytes) : "
<> text (show $ platformAlignBytes pp)
, text "Minimum Object Size (bytes) : "
<> text (show $ platformObjBytes pp) ]
platform32 :: Platform
platform32
= Platform
{ platformAddrBytes = 4
, platformTagBytes = 4
, platformNatBytes = 4
, platformAlignBytes = 4
, platformObjBytes = 8 }
platform64 :: Platform
platform64
= Platform
{ platformAddrBytes = 8
, platformTagBytes = 4
, platformNatBytes = 8
, platformAlignBytes = 8
, platformObjBytes = 8 }