LR and FP (8 byte each) are the prologue of each stack frame
Moduleghc-10.0.0.20260917GHC2024
GHC.CmmToAsm.AArch64.Instr
Synopsis
- value stackFrameHeaderSize
- value spillSlotSize
- value stackAlign
- value maxSpillSlots
- value spillSlotToOffset
- value regUsageOfInstr
- value callerSavedRegisters
- value patchRegsOfInstr
- value isJumpishInstr
- value jumpDestsOfInstr
- value canFallthroughTo
- value patchJumpInstr
- value mkSpillInstr
- value mkLoadInstr
- value takeDeltaInstr
- value isMetaInstr
- value mkRegRegMoveInstr
- value takeRegRegMoveInstr
- value mkJumpInstr
- value mkStackAllocInstr
- value mkStackDeallocInstr
- value allocMoreStack
- data Instr
- data DMBISHFlags
- value instrCon
- data Target
- data ExtMode
- data ShiftMode
- type ExtShift
- type RegShift
- data Operand
- value opReg
- value sp
- value ip0
- value _x
- value x0
- value x1
- value x2
- value x3
- value x4
- value x5
- value x6
- value x7
- value x8
- value x9
- value x10
- value x11
- value x12
- value x13
- value x14
- value x15
- value x16
- value x17
- value x18
- value x19
- value x20
- value x21
- value x22
- value x23
- value x24
- value x25
- value x26
- value x27
- value x28
- value x29
- value x30
- value x31
- value _d
- value d0
- value d1
- value d2
- value d3
- value d4
- value d5
- value d6
- value d7
- value d8
- value d9
- value d10
- value d11
- value d12
- value d13
- value d14
- value d15
- value d16
- value d17
- value d18
- value d19
- value d20
- value d21
- value d22
- value d23
- value d24
- value d25
- value d26
- value d27
- value d28
- value d29
- value d30
- value d31
- value opRegUExt
- value opRegSExt
- Packageghc-10.0.0.20260917
- Exports102
- LanguageGHC2024
- LicenceBSD-3-Clause
- SourceInstr.hs
All non-vector registers are 8 byte wide.
128-bit vector registers use two slots; see GHC.CmmToAsm.Reg.Linear.StackMap.getStackSlotFor.
The number of bytes that the stack pointer should be aligned to.
The number of spill slots available without allocating more.
Convert a spill slot number to a *byte* offset, with no sign.
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 42 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
|== General Purpose registers ==================================================================================================================================|
| argument passing ------------- | IR | tmp registers -------- | IP0| IP1| PL | callee saved ------------ | FP | LR | SP |
| free registers -------------------------------------------------------------------- | BR | Sp | Hp | R1 | R2 | R3 | R4 | R5 | R6 | SL | -- | -- | -- |
|== SIMD/FP Registers ==========================================================================================================================================|
| argument passing ------------- | callee saved (lower 64 bits) --- | caller saved ---------------------- |
| free registers |XMM1|XMM2|------- | F1 | F2 | F3 | F4 | D1 | D2 | D3 | D4 | free registers ----------------------------------------------------- |
---------------------------------------------------------------------------------------------------------------------------------------------------------------
IR: Indirect result location register, IP: Intra-procedure register, PL: Platform register (See Note [Aarch64 Register x18 at Darwin and Windows]), FP: Frame pointer, LR: Link register, SP: Stack pointer
BR: Base, SL: SpLim
TODO: The zero register is currently mapped to -1 but should get it's own separate number.
Apply a given mapping to all the register references in this instruction.
Checks whether this instruction is a jump/branch instruction. One that can change the flow of control in a way that the register allocator needs to worry about.
Checks whether this instruction is a jump/branch instruction. One that can change the flow of control in a way that the register allocator needs to worry about.
Change the destination of this jump instruction. Used in the linear allocator when adding fixup blocks for join points.
An instruction to spill a register into a spill slot.
See if this instruction is telling us the current C stack delta
Copy the value in a register to another one. Must work for all register classes.
Take the source and destination registers from a move instruction of same register class (RegClass).
The idea is to identify moves that can be eliminated by the register allocator: If the source register serves no special purpose, one could continue using it; saving one move instruction. For this, the register kinds (classes) must be the same (no conversion involved.)
Make an unconditional jump instruction.
Constructors
COMMENT SDocMULTILINE_COMMENT SDocANN SDoc InstrLOCATION Int Int Int StringLDATA Section RawCmmStaticsNEWBLOCK BlockIdDELTA IntSXTB Operand OperandUXTB Operand OperandSXTH Operand OperandUXTH Operand OperandSXTW Operand OperandPUSH_STACK_FRAMEPOP_STACK_FRAMEADD Format Operand Operand OperandADC Operand Operand Operand -- rd = rn + rm + C | ADCS ...
CMP Operand OperandADDS Operand Operand Operand -- rd = rn + rm | ADR ... | ADRP ...
CMN Operand OperandMSUB Operand Operand Operand OperandMADD ... | MNEG ...
MUL Format Operand Operand OperandNEG Format Operand OperandSDIV Format Operand Operand OperandNEGS ... | NGC ... | NGCS ... | SBC ... | SBCS ...
SMULH Operand Operand OperandSMADDL ... | SMNEGL ... | SMSUBL ...
SMULL Operand Operand OperandSUB Format Operand Operand OperandUDIV Operand Operand OperandSUBS ...
UMULH Operand Operand OperandUMADDL ... -- Xd = Xa + Wn × Wm | UMNEGL ... -- Xd = - Wn × Wm | UMSUBL ... -- Xd = Xa - Wn × Wm
UMULL Operand Operand OperandSBFM Operand Operand Operand OperandUBFM Operand Operand Operand OperandSBFX Operand Operand Operand OperandUBFX Operand Operand Operand OperandCLZ Operand OperandRBIT Operand OperandREV Operand OperandREV16 Format Operand OperandREV32 Format Operand OperandREV64 Format Operand OperandAND Format Operand Operand OperandASR Operand Operand OperandEOR Format Operand Operand OperandLSL Operand Operand OperandLSR Operand Operand OperandMOV Operand OperandMOVK Operand OperandMOVZ Operand OperandMOVN Operand Operand
MVN Operand OperandORR Format Operand Operand OperandSTR Format Operand OperandSTLR Format Operand OperandLDR Format Operand OperandLDAR Format Operand OperandCSET Operand CondCBZ Operand TargetCBNZ Operand TargetJ TargetJ_TBL [Maybe BlockId] (Maybe CLabel) RegB TargetBL Target [Reg]BCOND Cond TargetDMBISH DMBISHFlagsFMOV Format Operand OperandFCVT Operand OperandSCVTF Operand OperandFCVTZS Operand OperandFABS Format Operand OperandFMIN Format Operand Operand OperandFMAX Format Operand Operand OperandFSQRT Format Operand OperandFMA FMASign Operand Operand Operand OperandFloating-point fused multiply-add instructions (scalar only)
fmadd : d = r1 * r2 + r3
fnmsub: d = r1 * r2 - r3
fmsub : d = - r1 * r2 + r3
fnmadd: d = - r1 * r2 - r3
UMOV Operand OperandDUP Format Operand OperandINS Format Operand OperandABS Format Operand OperandSMIN Format Operand Operand OperandSMAX Format Operand Operand OperandUMIN Format Operand Operand OperandUMAX Format Operand Operand OperandCMGT Format Operand Operand OperandCMHI Format Operand Operand OperandBSL Operand Operand OperandFMLA Format Operand Operand OperandFMLS Format Operand Operand OperandEXT Operand Operand Operand IntZIP1 Format Operand Operand OperandZIP2 Format Operand Operand OperandUZP1 Format Operand Operand OperandUZP2 Format Operand Operand OperandTRN1 Format Operand Operand OperandTRN2 Format Operand Operand OperandMOVI Format Operand OperandMVNI Format Operand Operand
Instances1Instruction
Instruction InstrDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64 · orphanInstruction instance for aarch64
Instances2Eq, Show
Eq DMBISHFlagsDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.InstrShow DMBISHFlagsDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.Instr
Orphan instances
1 instanceOutputable RegUsageGet the registers that are being used by this instruction. regUsage doesn't need to do any trickery for jumps and such. Just state precisely the regs read and written by that insn. The consequences of control flow transfers, as far as register allocation goes, are taken care of by the register allocator.