ghc-9.14.0.20251128: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.Platform.Reg

Description

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

Documentation

type RegNo = Int #

An identifier for a primitive real machine register.

data Reg #

A register, either virtual or real

Instances

Instances details
Uniquable Reg # 
Instance details

Defined in GHC.Platform.Reg

Methods

getUnique :: Reg -> Unique #

Outputable Reg #

Print a reg in a generic manner If you want the architecture specific names, then use the pprReg function from the appropriate Ppr module.

Instance details

Defined in GHC.Platform.Reg

Methods

ppr :: Reg -> SDoc #

Eq Reg # 
Instance details

Defined in GHC.Platform.Reg

Methods

(==) :: Reg -> Reg -> Bool Source #

(/=) :: Reg -> Reg -> Bool Source #

Ord Reg # 
Instance details

Defined in GHC.Platform.Reg

Methods

compare :: Reg -> Reg -> Ordering Source #

(<) :: Reg -> Reg -> Bool Source #

(<=) :: Reg -> Reg -> Bool Source #

(>) :: Reg -> Reg -> Bool Source #

(>=) :: Reg -> Reg -> Bool Source #

max :: Reg -> Reg -> Reg Source #

min :: Reg -> Reg -> Reg Source #

Show Reg # 
Instance details

Defined in GHC.Platform.Reg

data VirtualReg #

Constructors

VirtualRegI

Integer virtual register

VirtualRegHi

High part of 2-word virtual register

VirtualRegD

Double virtual register

VirtualRegV128

128-bit wide vector virtual register

newtype RealReg #

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.

Constructors

RealRegSingle RegNo 

Instances

Instances details
Uniquable RealReg # 
Instance details

Defined in GHC.Platform.Reg

Methods

getUnique :: RealReg -> Unique #

Outputable RealReg # 
Instance details

Defined in GHC.Platform.Reg

Methods

ppr :: RealReg -> SDoc #

Eq RealReg # 
Instance details

Defined in GHC.Platform.Reg

Ord RealReg # 
Instance details

Defined in GHC.Platform.Reg

Show RealReg # 
Instance details

Defined in GHC.Platform.Reg

liftPatchFnToRegReg :: (VirtualReg -> RealReg) -> Reg -> Reg #

The patch function supplied by the allocator maps VirtualReg to RealReg regs, but sometimes we want to apply it to plain old Reg.