ghc-9.2.3: The GHC API
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.CmmToAsm.SPARC.Instr

Synopsis

Documentation

data Instr Source #

SPARC instruction set. Not complete. This is only the ones we need.

data RI Source #

Register or immediate

Constructors

RIReg Reg 
RIImm Imm 

riZero :: RI -> Bool Source #

Check if a RI represents a zero value. - a literal zero - register %g0, which is always zero.

fpRelEA :: Int -> Reg -> Instr Source #

Calculate the effective address which would be used by the corresponding fpRel sequence.

moveSp :: Int -> Instr Source #

Code to shift the stack pointer by n words.

isUnconditionalJump :: Instr -> Bool Source #

An instruction that will cause the one after it never to be exectuted

maxSpillSlots :: NCGConfig -> Int Source #

The maximum number of spill slots available on the C stack. If we use up all of the slots, then we're screwed.

Why do we reserve 64 bytes, instead of using the whole thing?? -- BL 20090215

patchRegsOfInstr :: Instr -> (Reg -> Reg) -> Instr Source #

Apply a given mapping to tall the register references in this instruction.

mkRegRegMoveInstr :: Platform -> Reg -> Reg -> Instr Source #

Make a reg-reg move instruction. On SPARC v8 there are no instructions to move directly between floating point and integer regs. If we need to do that then we have to go via memory.

mkLoadInstr Source #

Arguments

:: NCGConfig 
-> Reg

register to load into

-> Int

current stack delta

-> Int

spill slot to use

-> [Instr] 

Make a spill reload instruction.

mkSpillInstr Source #

Arguments

:: NCGConfig 
-> Reg

register to spill

-> Int

current stack delta

-> Int

spill slot to use

-> [Instr] 

Make a spill instruction. On SPARC we spill below frame pointer leaving 2 words/spill

mkJumpInstr :: BlockId -> [Instr] Source #

Make an unconditional branch instruction.

takeDeltaInstr :: Instr -> Maybe Int Source #

See if this instruction is telling us the current C stack delta

takeRegRegMoveInstr :: Instr -> Maybe (Reg, Reg) Source #

Check whether an instruction represents a reg-reg move. The register allocator attempts to eliminate reg->reg moves whenever it can, by assigning the src and dest temporaries to the same real register.

regUsageOfInstr :: Platform -> Instr -> RegUsage Source #

regUsage returns the sets of src and destination registers used by a particular instruction. Machine registers that are pre-allocated to stgRegs are filtered out, because they are uninteresting from a register allocation standpoint. (We wouldn't want them to end up on the free list!) As far as we are concerned, the fixed registers simply don't exist (for allocation purposes, anyway).