ghc-7.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

X86.Regs

Synopsis

- virtualRegSqueeze :: RegClass -> VirtualReg -> FastInt
- realRegSqueeze :: RegClass -> RealReg -> FastInt
- data Imm
  - = ImmInt Int
  - | ImmInteger Integer
  - | ImmCLbl CLabel
  - | ImmLit SDoc
  - | 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 :: DynFlags -> Int -> AddrMode
- argRegs :: RegNo -> [Reg]
- allArgRegs :: Platform -> [(Reg, Reg)]
- allIntArgRegs :: Platform -> [Reg]
- callClobberedRegs :: Platform -> [Reg]
- instrClobberedRegs :: Platform -> [Reg]
- allMachRegNos :: Platform -> [RegNo]
- classOfRealReg :: Platform -> RealReg -> RegClass
- showReg :: Platform -> RegNo -> String
- data EABase
  - = EABaseNone
  - | EABaseReg Reg
  - | EABaseRip
- data EAIndex
  - = EAIndexNone
  - | EAIndex Reg Int
- addrModeRegs :: AddrMode -> [Reg]
- eax :: Reg
- ebx :: Reg
- ecx :: Reg
- edx :: Reg
- esi :: Reg
- edi :: Reg
- ebp :: Reg
- esp :: Reg
- fake0 :: Reg
- fake1 :: Reg
- fake2 :: Reg
- fake3 :: Reg
- fake4 :: Reg
- fake5 :: Reg
- firstfake :: RegNo
- rax :: Reg
- rbx :: Reg
- rcx :: Reg
- rdx :: Reg
- rsi :: Reg
- rdi :: Reg
- rbp :: Reg
- rsp :: Reg
- r8 :: Reg
- r9 :: Reg
- r10 :: Reg
- r11 :: Reg
- r12 :: Reg
- r13 :: Reg
- r14 :: Reg
- r15 :: Reg
- xmm0 :: Reg
- xmm1 :: Reg
- xmm2 :: Reg
- xmm3 :: Reg
- xmm4 :: Reg
- xmm5 :: Reg
- xmm6 :: Reg
- xmm7 :: Reg
- xmm8 :: Reg
- xmm9 :: Reg
- xmm10 :: Reg
- xmm11 :: Reg
- xmm12 :: Reg
- xmm13 :: Reg
- xmm14 :: Reg
- xmm15 :: Reg
- xmm :: RegNo -> Reg
- ripRel :: Displacement -> AddrMode
- allFPArgRegs :: Platform -> [Reg]
- allocatableRegs :: Platform -> [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 SDoc |
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

:: DynFlags |
-> Int | desired stack offset in bytes, positive or negative
-> AddrMode |

argRegs :: RegNo -> [Reg]

allArgRegs :: Platform -> [(Reg, Reg)]

allIntArgRegs :: Platform -> [Reg]

callClobberedRegs :: Platform -> [Reg]

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

instrClobberedRegs :: Platform -> [Reg]

allMachRegNos :: Platform -> [RegNo]

The complete set of machine registers.

classOfRealReg :: Platform -> 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]

eax :: Reg

ebx :: Reg

ecx :: Reg

edx :: Reg

esi :: Reg

edi :: Reg

ebp :: Reg

esp :: Reg

fake0 :: Reg

fake1 :: Reg

fake2 :: Reg

fake3 :: Reg

fake4 :: Reg

fake5 :: Reg

firstfake :: RegNo

rax :: Reg

rbx :: Reg

rcx :: Reg

rdx :: Reg

rsi :: Reg

rdi :: Reg

rbp :: Reg

rsp :: Reg

r8 :: Reg

r9 :: Reg

r10 :: Reg

r11 :: Reg

r12 :: Reg

r13 :: Reg

r14 :: Reg

r15 :: Reg

xmm0 :: Reg

xmm1 :: Reg

xmm2 :: Reg

xmm3 :: Reg

xmm4 :: Reg

xmm5 :: Reg

xmm6 :: Reg

xmm7 :: Reg

xmm8 :: Reg

xmm9 :: Reg

xmm10 :: Reg

xmm11 :: Reg

xmm12 :: Reg

xmm13 :: Reg

xmm14 :: Reg

xmm15 :: Reg

xmm :: RegNo -> Reg

ripRel :: Displacement -> AddrMode

allFPArgRegs :: Platform -> [Reg]

allocatableRegs :: Platform -> [RealReg]