ghc-lib-parser-9.10.1.20250103: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Cmm.Reg

Contents

- Cmm Registers
- Local registers
- Global registers

Synopsis

- data CmmReg
  - = CmmLocal !LocalReg
  - | CmmGlobal GlobalRegUse
- cmmRegType :: CmmReg -> CmmType
- cmmRegWidth :: CmmReg -> Width
- data LocalReg = LocalReg !Unique !CmmType
- localRegType :: LocalReg -> CmmType
- data GlobalReg
  - = VanillaReg !Int
  - | FloatReg !Int
  - | DoubleReg !Int
  - | LongReg !Int
  - | XmmReg !Int
  - | YmmReg !Int
  - | ZmmReg !Int
  - | Sp
  - | SpLim
  - | Hp
  - | HpLim
  - | CCCS
  - | CurrentTSO
  - | CurrentNursery
  - | HpAlloc
  - | EagerBlackholeInfo
  - | GCEnter1
  - | GCFun
  - | BaseReg
  - | MachSp
  - | UnwindReturnReg
  - | PicBaseReg
- isArgReg :: GlobalReg -> Bool
- globalRegSpillType :: Platform -> GlobalReg -> CmmType
- pprGlobalReg :: IsLine doc => GlobalReg -> doc
- spReg :: Platform -> CmmReg
- hpReg :: Platform -> CmmReg
- spLimReg :: Platform -> CmmReg
- hpLimReg :: Platform -> CmmReg
- nodeReg :: Platform -> CmmReg
- currentTSOReg :: Platform -> CmmReg
- currentNurseryReg :: Platform -> CmmReg
- hpAllocReg :: Platform -> CmmReg
- cccsReg :: Platform -> CmmReg
- node :: GlobalReg
- baseReg :: Platform -> CmmReg
- data GlobalRegUse = GlobalRegUse {
  - globalRegUseGlobalReg :: !GlobalReg
  - globalRegUseType :: !CmmType
  }
- pprGlobalRegUse :: IsLine doc => GlobalRegUse -> doc

# Cmm Registers

data CmmReg #

Constructors

CmmLocal !LocalReg |
CmmGlobal GlobalRegUse |

#### Instances

Instances details

Show CmmReg # |
Instance details Defined in GHC.Cmm.Reg Methods showsPrec :: Int -> CmmReg -> ShowS # show :: CmmReg -> String # showList :: [CmmReg] -> ShowS #
Outputable CmmReg # |
Instance details Defined in GHC.Cmm.Reg Methods ppr :: CmmReg -> SDoc #
Eq CmmReg # |
Instance details Defined in GHC.Cmm.Reg Methods (==) :: CmmReg -> CmmReg -> Bool # (/=) :: CmmReg -> CmmReg -> Bool #
Ord CmmReg # |
Instance details Defined in GHC.Cmm.Reg Methods compare :: CmmReg -> CmmReg -> Ordering # (<) :: CmmReg -> CmmReg -> Bool # (<=) :: CmmReg -> CmmReg -> Bool # (>) :: CmmReg -> CmmReg -> Bool # (>=) :: CmmReg -> CmmReg -> Bool # max :: CmmReg -> CmmReg -> CmmReg # min :: CmmReg -> CmmReg -> CmmReg #
DefinerOfRegs GlobalReg CmmReg # |
Instance details Defined in GHC.Cmm.Expr Methods foldRegsDefd :: Platform -> (b -> GlobalReg -> b) -> b -> CmmReg -> b #
DefinerOfRegs GlobalRegUse CmmReg # |
Instance details Defined in GHC.Cmm.Expr Methods foldRegsDefd :: Platform -> (b -> GlobalRegUse -> b) -> b -> CmmReg -> b #
DefinerOfRegs LocalReg CmmReg # |
Instance details Defined in GHC.Cmm.Expr Methods foldRegsDefd :: Platform -> (b -> LocalReg -> b) -> b -> CmmReg -> b #
UserOfRegs GlobalReg CmmReg # |
Instance details Defined in GHC.Cmm.Expr Methods foldRegsUsed :: Platform -> (b -> GlobalReg -> b) -> b -> CmmReg -> b #
UserOfRegs GlobalRegUse CmmReg # |
Instance details Defined in GHC.Cmm.Expr Methods foldRegsUsed :: Platform -> (b -> GlobalRegUse -> b) -> b -> CmmReg -> b #
UserOfRegs LocalReg CmmReg # |
Instance details Defined in GHC.Cmm.Expr Methods foldRegsUsed :: Platform -> (b -> LocalReg -> b) -> b -> CmmReg -> b #

cmmRegType :: CmmReg -> CmmType #

cmmRegWidth :: CmmReg -> Width #

# Local registers

data LocalReg #

Constructors

LocalReg !Unique !CmmType | Parameters: 1. Identifier 2. Type

#### Instances

Instances details

Show LocalReg # |
Instance details Defined in GHC.Cmm.Reg Methods showsPrec :: Int -> LocalReg -> ShowS # show :: LocalReg -> String # showList :: [LocalReg] -> ShowS #
Uniquable LocalReg # |
Instance details Defined in GHC.Cmm.Reg Methods getUnique :: LocalReg -> Unique #
Outputable LocalReg # |
Instance details Defined in GHC.Cmm.Reg Methods ppr :: LocalReg -> SDoc #
Eq LocalReg # |
Instance details Defined in GHC.Cmm.Reg Methods (==) :: LocalReg -> LocalReg -> Bool # (/=) :: LocalReg -> LocalReg -> Bool #
Ord LocalReg # |
Instance details Defined in GHC.Cmm.Reg Methods compare :: LocalReg -> LocalReg -> Ordering # (<) :: LocalReg -> LocalReg -> Bool # (<=) :: LocalReg -> LocalReg -> Bool # (>) :: LocalReg -> LocalReg -> Bool # (>=) :: LocalReg -> LocalReg -> Bool # max :: LocalReg -> LocalReg -> LocalReg # min :: LocalReg -> LocalReg -> LocalReg #
DefinerOfRegs LocalReg CmmReg # |
Instance details Defined in GHC.Cmm.Expr Methods foldRegsDefd :: Platform -> (b -> LocalReg -> b) -> b -> CmmReg -> b #
UserOfRegs LocalReg CmmReg # |
Instance details Defined in GHC.Cmm.Expr Methods foldRegsUsed :: Platform -> (b -> LocalReg -> b) -> b -> CmmReg -> b #
DefinerOfRegs LocalReg (CmmNode e x) # |
Instance details Defined in GHC.Cmm.Node Methods foldRegsDefd :: Platform -> (b -> LocalReg -> b) -> b -> CmmNode e x -> b #
UserOfRegs LocalReg (CmmNode e x) # |
Instance details Defined in GHC.Cmm.Node Methods foldRegsUsed :: Platform -> (b -> LocalReg -> b) -> b -> CmmNode e x -> b #

localRegType :: LocalReg -> CmmType #

# Global registers

data GlobalReg #

An abstract global register for the STG machine.

See also `GlobalRegUse`, which denotes a usage of a register at a particular type (e.g. using a 32-bit wide register to store an 8-bit wide value), as per Note [GlobalReg vs GlobalRegUse].

Constructors

VanillaReg !Int |
FloatReg !Int |
DoubleReg !Int |
LongReg !Int |
XmmReg !Int |
YmmReg !Int |
ZmmReg !Int |
Sp |
SpLim |
Hp |
HpLim |
CCCS |
CurrentTSO |
CurrentNursery |
HpAlloc |
EagerBlackholeInfo |
GCEnter1 |
GCFun |
BaseReg |
MachSp |
UnwindReturnReg |
PicBaseReg |

#### Instances

Instances details

Show GlobalReg # |
Instance details Defined in GHC.Cmm.Reg Methods showsPrec :: Int -> GlobalReg -> ShowS # show :: GlobalReg -> String # showList :: [GlobalReg] -> ShowS #
Outputable GlobalReg # |
Instance details Defined in GHC.Cmm.Reg Methods ppr :: GlobalReg -> SDoc #
Eq GlobalReg # |
Instance details Defined in GHC.Cmm.Reg Methods (==) :: GlobalReg -> GlobalReg -> Bool # (/=) :: GlobalReg -> GlobalReg -> Bool #
Ord GlobalReg # |
Instance details Defined in GHC.Cmm.Reg Methods compare :: GlobalReg -> GlobalReg -> Ordering # (<) :: GlobalReg -> GlobalReg -> Bool # (<=) :: GlobalReg -> GlobalReg -> Bool # (>) :: GlobalReg -> GlobalReg -> Bool # (>=) :: GlobalReg -> GlobalReg -> Bool # max :: GlobalReg -> GlobalReg -> GlobalReg # min :: GlobalReg -> GlobalReg -> GlobalReg #
DefinerOfRegs GlobalReg CmmReg # |
Instance details Defined in GHC.Cmm.Expr Methods foldRegsDefd :: Platform -> (b -> GlobalReg -> b) -> b -> CmmReg -> b #
UserOfRegs GlobalReg CmmReg # |
Instance details Defined in GHC.Cmm.Expr Methods foldRegsUsed :: Platform -> (b -> GlobalReg -> b) -> b -> CmmReg -> b #
OutputableP env GlobalReg # |
Instance details Defined in GHC.Cmm.Reg Methods pdoc :: env -> GlobalReg -> SDoc #
DefinerOfRegs GlobalReg (CmmNode e x) # |
Instance details Defined in GHC.Cmm.Node Methods foldRegsDefd :: Platform -> (b -> GlobalReg -> b) -> b -> CmmNode e x -> b #
UserOfRegs GlobalReg (CmmNode e x) # |
Instance details Defined in GHC.Cmm.Node Methods foldRegsUsed :: Platform -> (b -> GlobalReg -> b) -> b -> CmmNode e x -> b #

isArgReg :: GlobalReg -> Bool #

globalRegSpillType :: Platform -> GlobalReg -> CmmType #

pprGlobalReg :: IsLine doc => GlobalReg -> doc #

spReg :: Platform -> CmmReg #

hpReg :: Platform -> CmmReg #

spLimReg :: Platform -> CmmReg #

hpLimReg :: Platform -> CmmReg #

nodeReg :: Platform -> CmmReg #

currentTSOReg :: Platform -> CmmReg #

currentNurseryReg :: Platform -> CmmReg #

hpAllocReg :: Platform -> CmmReg #

cccsReg :: Platform -> CmmReg #

node :: GlobalReg #

baseReg :: Platform -> CmmReg #

data GlobalRegUse #

A use of a global register at a particular type.

While a `GlobalReg` identifies a global register in the STG machine, a `GlobalRegUse` also contains information about the type we are storing in the register.

See Note [GlobalReg vs GlobalRegUse] for more information.

Constructors

GlobalRegUse |
- Fields globalRegUseGlobalReg :: !GlobalReg The underlying `GlobalReg` globalRegUseType :: !CmmType The `CmmType` at which we are using the `GlobalReg`. Its width must be less than the width of the `GlobalReg`:
      typeWidth ty <= typeWidth (globalRegSpillType reg)

#### Instances

Instances details

Show GlobalRegUse # |
Instance details Defined in GHC.Cmm.Reg Methods showsPrec :: Int -> GlobalRegUse -> ShowS # show :: GlobalRegUse -> String # showList :: [GlobalRegUse] -> ShowS #
Outputable GlobalRegUse # |
Instance details Defined in GHC.Cmm.Reg Methods ppr :: GlobalRegUse -> SDoc #
Eq GlobalRegUse # |
Instance details Defined in GHC.Cmm.Reg Methods (==) :: GlobalRegUse -> GlobalRegUse -> Bool # (/=) :: GlobalRegUse -> GlobalRegUse -> Bool #
Ord GlobalRegUse # |
Instance details Defined in GHC.Cmm.Reg Methods compare :: GlobalRegUse -> GlobalRegUse -> Ordering # (<) :: GlobalRegUse -> GlobalRegUse -> Bool # (<=) :: GlobalRegUse -> GlobalRegUse -> Bool # (>) :: GlobalRegUse -> GlobalRegUse -> Bool # (>=) :: GlobalRegUse -> GlobalRegUse -> Bool # max :: GlobalRegUse -> GlobalRegUse -> GlobalRegUse # min :: GlobalRegUse -> GlobalRegUse -> GlobalRegUse #
DefinerOfRegs GlobalRegUse CmmReg # |
Instance details Defined in GHC.Cmm.Expr Methods foldRegsDefd :: Platform -> (b -> GlobalRegUse -> b) -> b -> CmmReg -> b #
UserOfRegs GlobalRegUse CmmReg # |
Instance details Defined in GHC.Cmm.Expr Methods foldRegsUsed :: Platform -> (b -> GlobalRegUse -> b) -> b -> CmmReg -> b #

pprGlobalRegUse :: IsLine doc => GlobalRegUse -> doc #