ghc-7.4.1: The GHC API

Safe Haskell | Safe-Infered

X86.Regs

Synopsis

- virtualRegSqueeze :: RegClass -> VirtualReg -> FastInt
- realRegSqueeze :: RegClass -> RealReg -> FastInt
- data Imm
  - = ImmInt Int
  - | ImmInteger Integer
  - | ImmCLbl CLabel
  - | ImmLit Doc
  - | ImmIndex CLabel Int
  - | ImmFloat Rational
  - | ImmDouble Rational
  - | ImmConstantSum Imm Imm
  - | ImmConstantDiff Imm Imm
- strImmLit :: String -> Imm
- litToImm :: CmmLit -> Imm
- data AddrMode
  - = AddrBaseIndex EABase EAIndex Displacement
  - | ImmAddr Imm Int
- addrOffset :: AddrMode -> Int -> Maybe AddrMode
- spRel :: Platform -> Int -> AddrMode
- argRegs :: RegNo -> [Reg]
- allArgRegs :: [Reg]
- callClobberedRegs :: [Reg]
- allMachRegNos :: [RegNo]
- classOfRealReg :: RealReg -> RegClass
- showReg :: Platform -> RegNo -> String
- data EABase
  - = EABaseNone
  - | EABaseReg Reg
  - | EABaseRip
- data EAIndex
  - = EAIndexNone
  - | EAIndex Reg Int
- addrModeRegs :: AddrMode -> [Reg]
- fake0, edi, esi, ebp, esp, edx, ecx, ebx, eax, fake5, fake4, fake3, fake2, fake1 :: Reg
- firstfake :: RegNo
- rax, xmm15, xmm14, xmm13, xmm12, xmm11, xmm10, xmm9, xmm8, xmm7, xmm6, xmm5, xmm4, xmm3, xmm2, xmm1, xmm0, r15, r14, r13, r12, r11, r10, r9, r8, rdi, rsi, rbp, rsp, rdx, rcx, rbx :: Reg
- xmm :: RegNo -> Reg
- ripRel :: Displacement -> AddrMode
- allFPArgRegs :: [Reg]
- freeReg :: RegNo -> FastBool
- globalRegMaybe :: GlobalReg -> Maybe RealReg
- allocatableRegs :: [RealReg]

# Documentation

virtualRegSqueeze :: RegClass -> VirtualReg -> FastInt

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

realRegSqueeze :: RegClass -> RealReg -> FastInt

data Imm

Constructors

ImmInt Int |
ImmInteger Integer |
ImmCLbl CLabel |
ImmLit Doc |
ImmIndex CLabel Int |
ImmFloat Rational |
ImmDouble Rational |
ImmConstantSum Imm Imm |
ImmConstantDiff Imm Imm |

strImmLit :: String -> Imm

litToImm :: CmmLit -> Imm

data AddrMode

Constructors

AddrBaseIndex EABase EAIndex Displacement |
ImmAddr Imm Int |

addrOffset :: AddrMode -> Int -> Maybe AddrMode

spRel

Arguments

:: Platform |
-> Int | desired stack offset in words, positive or negative
-> AddrMode |

argRegs :: RegNo -> [Reg]

allArgRegs :: [Reg]

callClobberedRegs :: [Reg]

these are the regs which we cannot assume stay alive over a C call.

allMachRegNos :: [RegNo]

The complete set of machine registers.

classOfRealReg :: RealReg -> RegClass

Take the class of a register.

showReg :: Platform -> RegNo -> String

Get the name of the register with this number.

data EABase

Constructors

EABaseNone |
EABaseReg Reg |
EABaseRip |

data EAIndex

Constructors

EAIndexNone |
EAIndex Reg Int |

addrModeRegs :: AddrMode -> [Reg]

fake0, edi, esi, ebp, esp, edx, ecx, ebx, eax, fake5, fake4, fake3, fake2, fake1 :: Reg

firstfake :: RegNo

rax, xmm15, xmm14, xmm13, xmm12, xmm11, xmm10, xmm9, xmm8, xmm7, xmm6, xmm5, xmm4, xmm3, xmm2, xmm1, xmm0, r15, r14, r13, r12, r11, r10, r9, r8, rdi, rsi, rbp, rsp, rdx, rcx, rbx :: Reg

xmm :: RegNo -> Reg

ripRel :: Displacement -> AddrMode

allFPArgRegs :: [Reg]

freeReg :: RegNo -> FastBool

globalRegMaybe :: GlobalReg -> Maybe RealReg

allocatableRegs :: [RealReg]