ghc-7.0.3: The GHC API

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

isRealReg :: Reg -> Bool

isVirtualReg :: Reg -> Bool

data 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.

RealRegPairs are pairs of real registers that are allocated together to hold a larger value, such as with Double regs on SPARC.

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.