ghc-9.10.3: The GHC API

Safe Haskell | None
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 Source #

Constructors

CmmLocal !LocalReg |
CmmGlobal GlobalRegUse |

#### Instances

Instances details

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

cmmRegType :: CmmReg -> CmmType Source #

cmmRegWidth :: CmmReg -> Width Source #

# Local registers

data LocalReg Source #

Constructors

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

#### Instances

Instances details

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

localRegType :: LocalReg -> CmmType Source #

# Global registers

data GlobalReg Source #

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

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

isArgReg :: GlobalReg -> Bool Source #

globalRegSpillType :: Platform -> GlobalReg -> CmmType Source #

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

spReg :: Platform -> CmmReg Source #

hpReg :: Platform -> CmmReg Source #

spLimReg :: Platform -> CmmReg Source #

hpLimReg :: Platform -> CmmReg Source #

nodeReg :: Platform -> CmmReg Source #

currentTSOReg :: Platform -> CmmReg Source #

currentNurseryReg :: Platform -> CmmReg Source #

hpAllocReg :: Platform -> CmmReg Source #

cccsReg :: Platform -> CmmReg Source #

node :: GlobalReg Source #

baseReg :: Platform -> CmmReg Source #

data GlobalRegUse Source #

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

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

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