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