ghc-7.0.2: The GHC API

CmmExpr

Synopsis

Documentation

data Width Source

Constructors

W8 
W16 
W32 
W64 
W80 
W128 

data VGcPtr Source

Constructors

VGcPtr 
VNonGcPtr 

Instances

class DefinerOfSlots a whereSource

Methods

foldSlotsDefd :: (b -> SubArea -> b) -> b -> a -> bSource

type RegSet = UniqSet LocalRegSource

Sets of local registers

data Area Source

A stack area is either the stack slot where a variable is spilled or the stack space where function arguments and results are passed.

Instances

data AreaId Source

Constructors

Old 
Young BlockId 

Instances

data MachOp Source

Machine-level primops; ones which we can reasonably delegate to the native code generators to handle. Basically contains C's primops and no others.

Nomenclature: all ops indicate width and signedness, where appropriate. Widths: 8/16/32/64 means the given size, obviously. Nat means the operation works on STG word sized objects. Signedness: S means signed, U means unsigned. For operations where signedness is irrelevant or makes no difference (for example integer add), the signedness component is omitted.

An exception: NatP is a ptr-typed native word. From the point of view of the native code generators this distinction is irrelevant, but the C code generator sometimes needs this info to emit the right casts.

Instances

isCommutableMachOp :: MachOp -> BoolSource

Returns True if the MachOp has commutable arguments. This is used in the platform-independent Cmm optimisations.

If in doubt, return False. This generates worse code on the native routes, but is otherwise harmless.

isAssociativeMachOp :: MachOp -> BoolSource

Returns True if the MachOp is associative (i.e. (x+y)+z == x+(y+z)) This is used in the platform-independent Cmm optimisations.

If in doubt, return False. This generates worse code on the native routes, but is otherwise harmless.

isComparisonMachOp :: MachOp -> BoolSource

Returns True if the MachOp is a comparison.

If in doubt, return False. This generates worse code on the native routes, but is otherwise harmless.

machOpResultType :: MachOp -> [CmmType] -> CmmTypeSource

Returns the MachRep of the result of a MachOp.

machOpArgReps :: MachOp -> [Width]Source

This function is used for debugging only: we can check whether an application of a MachOp is type-correct by checking that the MachReps of its arguments are the same as the MachOp expects. This is used when linting a CmmExpr.