ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.CmmToAsm.X86.Regs

Synopsis

- virtualRegSqueeze :: RegClass -> VirtualReg -> Int
- realRegSqueeze :: RegClass -> RealReg -> Int
- data Imm
  - = ImmInt Int
  - | ImmInteger Integer
  - | ImmCLbl CLabel
  - | ImmLit FastString
  - | ImmIndex CLabel Int
  - | ImmFloat Rational
  - | ImmDouble Rational
  - | ImmConstantSum Imm Imm
  - | ImmConstantDiff Imm Imm
- strImmLit :: FastString -> 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 :: 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
- 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
- lastint :: Platform -> RegNo
- 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
- firstxmm :: RegNo
- lastxmm :: Platform -> RegNo
- ripRel :: Displacement -> AddrMode
- allFPArgRegs :: Platform -> [Reg]
- allocatableRegs :: Platform -> [RealReg]

# Documentation

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.

realRegSqueeze :: RegClass -> RealReg -> Int Source #

data Imm Source #

Constructors

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

strImmLit :: FastString -> Imm Source #

litToImm :: CmmLit -> Imm Source #

data AddrMode Source #

Constructors

AddrBaseIndex EABase EAIndex Displacement |
ImmAddr Imm Int |

addrOffset :: AddrMode -> Int -> Maybe AddrMode Source #

spRel Source #

Arguments

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

argRegs :: RegNo -> [Reg] Source #

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

allIntArgRegs :: Platform -> [Reg] Source #

callClobberedRegs :: Platform -> [Reg] Source #

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

instrClobberedRegs :: Platform -> [Reg] Source #

allMachRegNos :: Platform -> [RegNo] Source #

The complete set of machine registers.

classOfRealReg :: Platform -> RealReg -> RegClass Source #

Take the class of a register.

showReg :: Platform -> RegNo -> String Source #

Get the name of the register with this number. NOTE: fixme, we dont track which "way" the XMM registers are used

data EABase Source #

Constructors

EABaseNone |
EABaseReg Reg |
EABaseRip |

data EAIndex Source #

Constructors

EAIndexNone |
EAIndex Reg Int |

addrModeRegs :: AddrMode -> [Reg] Source #

eax :: Reg Source #

ebx :: Reg Source #

ecx :: Reg Source #

edx :: Reg Source #

esi :: Reg Source #

edi :: Reg Source #

ebp :: Reg Source #

esp :: Reg Source #

rax :: Reg Source #

rbx :: Reg Source #

rcx :: Reg Source #

rdx :: Reg Source #

rsi :: Reg Source #

rdi :: Reg Source #

rbp :: Reg Source #

rsp :: Reg Source #

r8 :: Reg Source #

r9 :: Reg Source #

r10 :: Reg Source #

r11 :: Reg Source #

r12 :: Reg Source #

r13 :: Reg Source #

r14 :: Reg Source #

r15 :: Reg Source #

lastint :: Platform -> RegNo Source #

xmm0 :: Reg Source #

xmm1 :: Reg Source #

xmm2 :: Reg Source #

xmm3 :: Reg Source #

xmm4 :: Reg Source #

xmm5 :: Reg Source #

xmm6 :: Reg Source #

xmm7 :: Reg Source #

xmm8 :: Reg Source #

xmm9 :: Reg Source #

xmm10 :: Reg Source #

xmm11 :: Reg Source #

xmm12 :: Reg Source #

xmm13 :: Reg Source #

xmm14 :: Reg Source #

xmm15 :: Reg Source #

xmm :: RegNo -> Reg Source #

firstxmm :: RegNo Source #

lastxmm :: Platform -> RegNo Source #

ripRel :: Displacement -> AddrMode Source #

allFPArgRegs :: Platform -> [Reg] Source #

on 64bit platforms we pass the first 8 float/double arguments in the xmm registers.

allocatableRegs :: Platform -> [RealReg] Source #