ghc-8.0.2: The GHC API

CmmMachOp

Synopsis

# Documentation

data MachOp Source #

Machine-level primops; ones which we can reasonably delegate to the native code generators to handle.

Most operations are parameterised by the Width that they operate on. Some operations have separate signed and unsigned versions, and float and integer versions.

Instances

 # Methods(==) :: MachOp -> MachOp -> Bool #(/=) :: MachOp -> MachOp -> Bool # # MethodsshowList :: [MachOp] -> ShowS Source #

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.

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.

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.

Returns Just w if the operation is an integer comparison with width w, or Nothing otherwise.

Returns the MachRep of the result of a MachOp.

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.

The alignment of a memcpy-ish operation.

The operation to perform atomically.

Constructors

 AMO_Add AMO_Sub AMO_And AMO_Nand AMO_Or AMO_Xor

Instances

 # Methods # MethodsshowList :: [AtomicMachOp] -> ShowS Source #