ghc-9.12.0.20241114: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.CmmToAsm.RV64.Regs

Synopsis

Registers

x0RegNo :: RegNo Source #

First integer register number. zero register.

x1RegNo :: RegNo Source #

return address register

raRegNo :: RegNo Source #

return address register

x31RegNo :: RegNo Source #

Last integer register number. Used as TMP (IP) register.

t6RegNo :: RegNo Source #

Last integer register number. Used as TMP (IP) register.

tmpRegNo :: RegNo Source #

Last integer register number. Used as TMP (IP) register.

d0RegNo :: RegNo Source #

First floating point register.

ft0RegNo :: RegNo Source #

First floating point register.

d31RegNo :: RegNo Source #

Last floating point register.

spMachReg :: Reg Source #

Not to be confused with the CmmReg spReg

allMachRegNos :: [RegNo] Source #

All machine register numbers.

allocatableRegs :: Platform -> [RealReg] Source #

Registers available to the register allocator.

These are all registers minus those with a fixed role in RISCV ABI (zero, lr, sp, gp, tp, fp, tmp) and GHC RTS (Base, Sp, Hp, HpLim, R1..R8, F1..F6, D1..D6.)

allGpArgRegs :: [Reg] Source #

Integer argument registers according to the calling convention

allFpArgRegs :: [Reg] Source #

Floating point argument registers according to the calling convention

Addressing modes

data AddrMode Source #

Addressing modes

Constructors

AddrRegImm Reg Imm

A register plus some immediate integer, e.g. 8(sp) or -16(sp). The offset needs to fit into 12bits.

AddrReg Reg

A register

Instances

Instances details
Show AddrMode Source # 
Instance details

Defined in GHC.CmmToAsm.RV64.Regs

Eq AddrMode Source # 
Instance details

Defined in GHC.CmmToAsm.RV64.Regs

Immediates

data Imm Source #

Instances

Instances details
Show Imm Source # 
Instance details

Defined in GHC.CmmToAsm.RV64.Regs

Methods

showsPrec :: Int -> Imm -> ShowS #

show :: Imm -> String #

showList :: [Imm] -> ShowS #

Eq Imm Source # 
Instance details

Defined in GHC.CmmToAsm.RV64.Regs

Methods

(==) :: Imm -> Imm -> Bool #

(/=) :: Imm -> Imm -> Bool #

litToImm :: CmmLit -> Imm Source #

Map CmmLit to Imm

N.B. this is a partial function, because not all CmmLits have an immediate representation.

virtualRegSqueeze :: RegClass -> VirtualReg -> Int Source #

regSqueeze_class reg Calculate the maximum number of register colors that could be denied to a node of this class due to having this reg as a neighbour.