Safe Haskell | None |
---|---|
Language | GHC2021 |
An architecture independent description of a register. This needs to stay architecture independent because it is used by NCGMonad and the register allocators, which are shared by all architectures.
Synopsis
- type RegNo = Int
- data Reg
- regSingle :: RegNo -> Reg
- realRegSingle :: RegNo -> RealReg
- isRealReg :: Reg -> Bool
- takeRealReg :: Reg -> Maybe RealReg
- isVirtualReg :: Reg -> Bool
- takeVirtualReg :: Reg -> Maybe VirtualReg
- data VirtualReg
- = VirtualRegI { }
- | VirtualRegHi { }
- | VirtualRegD { }
- | VirtualRegV128 { }
- renameVirtualReg :: Unique -> VirtualReg -> VirtualReg
- classOfVirtualReg :: Arch -> VirtualReg -> RegClass
- getHiVirtualRegFromLo :: VirtualReg -> VirtualReg
- getHiVRegFromLo :: Reg -> Reg
- newtype RealReg = RealRegSingle RegNo
- regNosOfRealReg :: RealReg -> [RegNo]
- realRegsAlias :: RealReg -> RealReg -> Bool
- liftPatchFnToRegReg :: (VirtualReg -> RealReg) -> Reg -> Reg
Documentation
A register, either virtual or real
realRegSingle :: RegNo -> RealReg Source #
isVirtualReg :: Reg -> Bool Source #
takeVirtualReg :: Reg -> Maybe VirtualReg Source #
data VirtualReg Source #
VirtualRegI | Integer virtual register |
VirtualRegHi | High part of 2-word virtual register |
VirtualRegD | Double virtual register |
VirtualRegV128 | 128-bit wide vector virtual register |
Instances
Uniquable VirtualReg Source # | |
Defined in GHC.Platform.Reg getUnique :: VirtualReg -> Unique Source # | |
Outputable VirtualReg Source # | |
Defined in GHC.Platform.Reg ppr :: VirtualReg -> SDoc Source # | |
Show VirtualReg Source # | |
Defined in GHC.Platform.Reg showsPrec :: Int -> VirtualReg -> ShowS # show :: VirtualReg -> String # showList :: [VirtualReg] -> ShowS # | |
Eq VirtualReg Source # | |
Defined in GHC.Platform.Reg (==) :: VirtualReg -> VirtualReg -> Bool # (/=) :: VirtualReg -> VirtualReg -> Bool # | |
Ord VirtualReg Source # | |
Defined in GHC.Platform.Reg compare :: VirtualReg -> VirtualReg -> Ordering # (<) :: VirtualReg -> VirtualReg -> Bool # (<=) :: VirtualReg -> VirtualReg -> Bool # (>) :: VirtualReg -> VirtualReg -> Bool # (>=) :: VirtualReg -> VirtualReg -> Bool # max :: VirtualReg -> VirtualReg -> VirtualReg # min :: VirtualReg -> VirtualReg -> VirtualReg # |
renameVirtualReg :: Unique -> VirtualReg -> VirtualReg Source #
classOfVirtualReg :: Arch -> VirtualReg -> RegClass Source #
getHiVRegFromLo :: Reg -> Reg Source #
RealRegs are machine regs which are available for allocation, in the usual way. We know what class they are, because that's part of the processor's architecture.
regNosOfRealReg :: RealReg -> [RegNo] Source #
liftPatchFnToRegReg :: (VirtualReg -> RealReg) -> Reg -> Reg Source #
The patch function supplied by the allocator maps VirtualReg to RealReg regs, but sometimes we want to apply it to plain old Reg.