ghc-9.12.0.20241128: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.CmmToAsm.Reg.Linear.RV64

Description

Functions to implement the FR (as in "free regs") type class.

For LLVM GHC calling convention (used registers), see https://github.com/llvm/llvm-project/blob/6ab900f8746e7d8e24afafb5886a40801f6799f4/llvm/lib/Target/RISCV/RISCVISelLowering.cpp#L13638-L13685

Synopsis

Documentation

allocateReg :: HasCallStack => RealReg -> FreeRegs -> FreeRegs Source #

Set corresponding register bit to 0

getFreeRegs :: RegClass -> FreeRegs -> [RealReg] Source #

Get all free RealRegs (i.e. those where the corresponding bit is 1)

initFreeRegs :: Platform -> FreeRegs Source #

Set bits of all allocatable registers to 1

releaseReg :: HasCallStack => RealReg -> FreeRegs -> FreeRegs Source #

Set corresponding register bit to 1

data FreeRegs Source #

Bitmaps to indicate which registers are free (currently unused)

The bit index represents the RegNo, in case of floating point registers with an offset of 32. The register is free when the bit is set.

Constructors

FreeRegs 

Fields