ghc-7.7.20130829: The GHC API

Safe HaskellNone

CmmMachOp

Synopsis

Documentation

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 :: DynFlags -> MachOp -> [CmmType] -> CmmTypeSource

Returns the MachRep of the result of a MachOp.

machOpArgReps :: DynFlags -> 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.