Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
GHC.CmmToAsm.SPARC.Instr
Synopsis
- data Instr
- = COMMENT FastString
- | LDATA Section RawCmmStatics
- | NEWBLOCK BlockId
- | DELTA Int
- | LD Format AddrMode Reg
- | ST Format Reg AddrMode
- | ADD Bool Bool Reg RI Reg
- | SUB Bool Bool Reg RI Reg
- | UMUL Bool Reg RI Reg
- | SMUL Bool Reg RI Reg
- | UDIV Bool Reg RI Reg
- | SDIV Bool Reg RI Reg
- | RDY Reg
- | WRY Reg Reg
- | AND Bool Reg RI Reg
- | ANDN Bool Reg RI Reg
- | OR Bool Reg RI Reg
- | ORN Bool Reg RI Reg
- | XOR Bool Reg RI Reg
- | XNOR Bool Reg RI Reg
- | SLL Reg RI Reg
- | SRL Reg RI Reg
- | SRA Reg RI Reg
- | SETHI Imm Reg
- | NOP
- | FABS Format Reg Reg
- | FADD Format Reg Reg Reg
- | FCMP Bool Format Reg Reg
- | FDIV Format Reg Reg Reg
- | FMOV Format Reg Reg
- | FMUL Format Reg Reg Reg
- | FNEG Format Reg Reg
- | FSQRT Format Reg Reg
- | FSUB Format Reg Reg Reg
- | FxTOy Format Format Reg Reg
- | BI Cond Bool BlockId
- | BF Cond Bool BlockId
- | JMP AddrMode
- | JMP_TBL AddrMode [Maybe BlockId] CLabel
- | CALL (Either Imm Reg) Int Bool
- data RI
- riZero :: RI -> Bool
- fpRelEA :: Int -> Reg -> Instr
- moveSp :: Int -> Instr
- isUnconditionalJump :: Instr -> Bool
- maxSpillSlots :: NCGConfig -> Int
- patchRegsOfInstr :: Instr -> (Reg -> Reg) -> Instr
- patchJumpInstr :: Instr -> (BlockId -> BlockId) -> Instr
- mkRegRegMoveInstr :: Platform -> Reg -> Reg -> Instr
- mkLoadInstr :: NCGConfig -> Reg -> Int -> Int -> [Instr]
- mkSpillInstr :: NCGConfig -> Reg -> Int -> Int -> [Instr]
- mkJumpInstr :: BlockId -> [Instr]
- takeDeltaInstr :: Instr -> Maybe Int
- isMetaInstr :: Instr -> Bool
- isJumpishInstr :: Instr -> Bool
- jumpDestsOfInstr :: Instr -> [BlockId]
- takeRegRegMoveInstr :: Instr -> Maybe (Reg, Reg)
- regUsageOfInstr :: Platform -> Instr -> RegUsage
Documentation
SPARC instruction set. Not complete. This is only the ones we need.
Constructors
COMMENT FastString | |
LDATA Section RawCmmStatics | |
NEWBLOCK BlockId | |
DELTA Int | |
LD Format AddrMode Reg | |
ST Format Reg AddrMode | |
ADD Bool Bool Reg RI Reg | |
SUB Bool Bool Reg RI Reg | |
UMUL Bool Reg RI Reg | |
SMUL Bool Reg RI Reg | |
UDIV Bool Reg RI Reg | |
SDIV Bool Reg RI Reg | |
RDY Reg | |
WRY Reg Reg | |
AND Bool Reg RI Reg | |
ANDN Bool Reg RI Reg | |
OR Bool Reg RI Reg | |
ORN Bool Reg RI Reg | |
XOR Bool Reg RI Reg | |
XNOR Bool Reg RI Reg | |
SLL Reg RI Reg | |
SRL Reg RI Reg | |
SRA Reg RI Reg | |
SETHI Imm Reg | |
NOP | |
FABS Format Reg Reg | |
FADD Format Reg Reg Reg | |
FCMP Bool Format Reg Reg | |
FDIV Format Reg Reg Reg | |
FMOV Format Reg Reg | |
FMUL Format Reg Reg Reg | |
FNEG Format Reg Reg | |
FSQRT Format Reg Reg | |
FSUB Format Reg Reg Reg | |
FxTOy Format Format Reg Reg | |
BI Cond Bool BlockId | |
BF Cond Bool BlockId | |
JMP AddrMode | |
JMP_TBL AddrMode [Maybe BlockId] CLabel | |
CALL (Either Imm Reg) Int Bool |
Instances
Instruction Instr # | instance for sparc instruction set |
Defined in GHC.CmmToAsm.SPARC Methods regUsageOfInstr :: Platform -> Instr -> RegUsage # patchRegsOfInstr :: Instr -> (Reg -> Reg) -> Instr # isJumpishInstr :: Instr -> Bool # jumpDestsOfInstr :: Instr -> [BlockId] # patchJumpInstr :: Instr -> (BlockId -> BlockId) -> Instr # mkSpillInstr :: NCGConfig -> Reg -> Int -> Int -> [Instr] # mkLoadInstr :: NCGConfig -> Reg -> Int -> Int -> [Instr] # takeDeltaInstr :: Instr -> Maybe Int # isMetaInstr :: Instr -> Bool # mkRegRegMoveInstr :: Platform -> Reg -> Reg -> Instr # takeRegRegMoveInstr :: Instr -> Maybe (Reg, Reg) # mkJumpInstr :: BlockId -> [Instr] # mkStackAllocInstr :: Platform -> Int -> [Instr] # mkStackDeallocInstr :: Platform -> Int -> [Instr] # | |
OutputableP Platform Instr # | |
Check if a RI represents a zero value. - a literal zero - register %g0, which is always zero.
fpRelEA :: Int -> Reg -> Instr #
Calculate the effective address which would be used by the corresponding fpRel sequence.
isUnconditionalJump :: Instr -> Bool #
An instruction that will cause the one after it never to be exectuted
maxSpillSlots :: NCGConfig -> Int #
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 #
Apply a given mapping to tall the register references in this instruction.
mkRegRegMoveInstr :: Platform -> Reg -> Reg -> Instr #
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.
Arguments
:: NCGConfig | |
-> Reg | register to load into |
-> Int | current stack delta |
-> Int | spill slot to use |
-> [Instr] |
Make a spill reload instruction.
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] #
Make an unconditional branch instruction.
takeDeltaInstr :: Instr -> Maybe Int #
See if this instruction is telling us the current C stack delta
isMetaInstr :: Instr -> Bool #
isJumpishInstr :: Instr -> Bool #
jumpDestsOfInstr :: Instr -> [BlockId] #
takeRegRegMoveInstr :: Instr -> Maybe (Reg, Reg) #
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 #
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).