GHC.Cmm.MachOp
Documentation
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.
Note that there are variety of places in the native code generator where we assume that the code produced for a MachOp does not introduce new blocks.
Constructors
Instances
isCommutableMachOp :: MachOp -> Bool Source #
isAssociativeMachOp :: MachOp -> Bool Source #
isComparisonMachOp :: MachOp -> Bool Source #
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.
maybeIntComparison :: MachOp -> Maybe Width Source #
Returns Just w
if the operation is an integer comparison with width
w
, or Nothing
otherwise.
machOpResultType :: Platform -> MachOp -> [CmmType] -> CmmType Source #
Returns the MachRep of the result of a MachOp.
machOpArgReps :: Platform -> 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.
isFloatComparison :: MachOp -> Bool Source #
mo_wordAdd :: Platform -> MachOp Source #
mo_wordSub :: Platform -> MachOp Source #
mo_wordMul :: Platform -> MachOp Source #
mo_wordSQuot :: Platform -> MachOp Source #
mo_wordSRem :: Platform -> MachOp Source #
mo_wordSNeg :: Platform -> MachOp Source #
mo_wordUQuot :: Platform -> MachOp Source #
mo_wordURem :: Platform -> MachOp Source #
mo_wordSGe :: Platform -> MachOp Source #
mo_wordSLe :: Platform -> MachOp Source #
mo_wordSGt :: Platform -> MachOp Source #
mo_wordSLt :: Platform -> MachOp Source #
mo_wordUGe :: Platform -> MachOp Source #
mo_wordULe :: Platform -> MachOp Source #
mo_wordUGt :: Platform -> MachOp Source #
mo_wordULt :: Platform -> MachOp Source #
mo_wordAnd :: Platform -> MachOp Source #
mo_wordXor :: Platform -> MachOp Source #
mo_wordNot :: Platform -> MachOp Source #
mo_wordShl :: Platform -> MachOp Source #
mo_wordSShr :: Platform -> MachOp Source #
mo_wordUShr :: Platform -> MachOp Source #
mo_u_8To32 :: MachOp Source #
mo_s_8To32 :: MachOp Source #
mo_u_16To32 :: MachOp Source #
mo_s_16To32 :: MachOp Source #
mo_u_8ToWord :: Platform -> MachOp Source #
mo_s_8ToWord :: Platform -> MachOp Source #
mo_u_16ToWord :: Platform -> MachOp Source #
mo_s_16ToWord :: Platform -> MachOp Source #
mo_u_32ToWord :: Platform -> MachOp Source #
mo_s_32ToWord :: Platform -> MachOp Source #
mo_WordTo8 :: Platform -> MachOp Source #
mo_WordTo16 :: Platform -> MachOp Source #
mo_WordTo32 :: Platform -> MachOp Source #
mo_WordTo64 :: Platform -> MachOp Source #
data CallishMachOp Source #
Constructors
Instances
Show CallishMachOp Source # | |
Defined in GHC.Cmm.MachOp | |
Eq CallishMachOp Source # | |
Defined in GHC.Cmm.MachOp Methods (==) :: CallishMachOp -> CallishMachOp -> Bool # (/=) :: CallishMachOp -> CallishMachOp -> Bool # |
callishMachOpHints :: CallishMachOp -> ([ForeignHint], [ForeignHint]) Source #
Return (results_hints,args_hints)
pprCallishMachOp :: CallishMachOp -> SDoc Source #
machOpMemcpyishAlign :: CallishMachOp -> Maybe Int Source #
The alignment of a memcpy
-ish operation.
data MemoryOrdering Source #
C11 memory ordering semantics.
Constructors
MemOrderRelaxed | relaxed ordering |
MemOrderAcquire | acquire ordering |
MemOrderRelease | release ordering |
MemOrderSeqCst | sequentially consistent |
Instances
Show MemoryOrdering Source # | |
Defined in GHC.Cmm.MachOp | |
Eq MemoryOrdering Source # | |
Defined in GHC.Cmm.MachOp Methods (==) :: MemoryOrdering -> MemoryOrdering -> Bool # (/=) :: MemoryOrdering -> MemoryOrdering -> Bool # | |
Ord MemoryOrdering Source # | |
Defined in GHC.Cmm.MachOp Methods compare :: MemoryOrdering -> MemoryOrdering -> Ordering # (<) :: MemoryOrdering -> MemoryOrdering -> Bool # (<=) :: MemoryOrdering -> MemoryOrdering -> Bool # (>) :: MemoryOrdering -> MemoryOrdering -> Bool # (>=) :: MemoryOrdering -> MemoryOrdering -> Bool # max :: MemoryOrdering -> MemoryOrdering -> MemoryOrdering # min :: MemoryOrdering -> MemoryOrdering -> MemoryOrdering # |
data AtomicMachOp Source #
The operation to perform atomically.
Instances
Show AtomicMachOp Source # | |
Defined in GHC.Cmm.MachOp | |
Eq AtomicMachOp Source # | |
Defined in GHC.Cmm.MachOp |