module GHC.CmmToAsm.Config
( NCGConfig(..)
, ncgWordWidth
, platformWordWidth
)
where
import GHC.Prelude
import GHC.Platform
import GHC.Cmm.Type (Width(..))
data NCGConfig = NCGConfig
{ ncgPlatform :: !Platform
, ncgProcAlignment :: !(Maybe Int)
, ncgDebugLevel :: !Int
, ncgExternalDynamicRefs :: !Bool
, ncgPIC :: !Bool
, ncgInlineThresholdMemcpy :: !Word
, ncgInlineThresholdMemset :: !Word
, ncgSplitSections :: !Bool
, ncgSpillPreallocSize :: !Int
, ncgRegsIterative :: !Bool
, ncgAsmLinting :: !Bool
, ncgDoConstantFolding :: !Bool
, ncgSseVersion :: Maybe SseVersion
, ncgBmiVersion :: Maybe BmiVersion
, ncgDumpRegAllocStages :: !Bool
, ncgDumpAsmStats :: !Bool
, ncgDumpAsmConflicts :: !Bool
}
ncgWordWidth :: NCGConfig -> Width
ncgWordWidth config = platformWordWidth (ncgPlatform config)
platformWordWidth :: Platform -> Width
platformWordWidth platform = case platformWordSize platform of
PW4 -> W32
PW8 -> W64