Safe Haskell | Safe-Infered |
---|
- data MachOp
- = MO_Add Width
- | MO_Sub Width
- | MO_Eq Width
- | MO_Ne Width
- | MO_Mul Width
- | MO_S_MulMayOflo Width
- | MO_S_Quot Width
- | MO_S_Rem Width
- | MO_S_Neg Width
- | MO_U_MulMayOflo Width
- | MO_U_Quot Width
- | MO_U_Rem Width
- | MO_S_Ge Width
- | MO_S_Le Width
- | MO_S_Gt Width
- | MO_S_Lt Width
- | MO_U_Ge Width
- | MO_U_Le Width
- | MO_U_Gt Width
- | MO_U_Lt Width
- | MO_F_Add Width
- | MO_F_Sub Width
- | MO_F_Neg Width
- | MO_F_Mul Width
- | MO_F_Quot Width
- | MO_F_Eq Width
- | MO_F_Ne Width
- | MO_F_Ge Width
- | MO_F_Le Width
- | MO_F_Gt Width
- | MO_F_Lt Width
- | MO_And Width
- | MO_Or Width
- | MO_Xor Width
- | MO_Not Width
- | MO_Shl Width
- | MO_U_Shr Width
- | MO_S_Shr Width
- | MO_SF_Conv Width Width
- | MO_FS_Conv Width Width
- | MO_SS_Conv Width Width
- | MO_UU_Conv Width Width
- | MO_FF_Conv Width Width
- pprMachOp :: MachOp -> SDoc
- isCommutableMachOp :: MachOp -> Bool
- isAssociativeMachOp :: MachOp -> Bool
- isComparisonMachOp :: MachOp -> Bool
- machOpResultType :: MachOp -> [CmmType] -> CmmType
- machOpArgReps :: MachOp -> [Width]
- maybeInvertComparison :: MachOp -> Maybe MachOp
- mo_wordAdd, mo_WordTo32, mo_WordTo16, mo_WordTo8, mo_32To16, mo_32To8, mo_s_32ToWord, mo_u_32ToWord, mo_s_16ToWord, mo_u_16ToWord, mo_s_8ToWord, mo_u_8ToWord, mo_s_16To32, mo_u_16To32, mo_s_8To32, mo_u_8To32, mo_wordUShr, mo_wordSShr, mo_wordShl, mo_wordNot, mo_wordXor, mo_wordOr, mo_wordAnd, mo_wordULt, mo_wordUGt, mo_wordULe, mo_wordUGe, mo_wordSLt, mo_wordSGt, mo_wordSLe, mo_wordSGe, mo_wordURem, mo_wordUQuot, mo_wordSNeg, mo_wordSRem, mo_wordSQuot, mo_wordMul, mo_wordNe, mo_wordEq, mo_wordSub :: MachOp
- data CallishMachOp
- = MO_F64_Pwr
- | MO_F64_Sin
- | MO_F64_Cos
- | MO_F64_Tan
- | MO_F64_Sinh
- | MO_F64_Cosh
- | MO_F64_Tanh
- | MO_F64_Asin
- | MO_F64_Acos
- | MO_F64_Atan
- | MO_F64_Log
- | MO_F64_Exp
- | MO_F64_Sqrt
- | MO_F32_Pwr
- | MO_F32_Sin
- | MO_F32_Cos
- | MO_F32_Tan
- | MO_F32_Sinh
- | MO_F32_Cosh
- | MO_F32_Tanh
- | MO_F32_Asin
- | MO_F32_Acos
- | MO_F32_Atan
- | MO_F32_Log
- | MO_F32_Exp
- | MO_F32_Sqrt
- | MO_WriteBarrier
- | MO_Touch
- | MO_Memcpy
- | MO_Memset
- | MO_Memmove
- | MO_PopCnt Width
- pprCallishMachOp :: CallishMachOp -> SDoc
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.
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.
mo_wordAdd, mo_WordTo32, mo_WordTo16, mo_WordTo8, mo_32To16, mo_32To8, mo_s_32ToWord, mo_u_32ToWord, mo_s_16ToWord, mo_u_16ToWord, mo_s_8ToWord, mo_u_8ToWord, mo_s_16To32, mo_u_16To32, mo_s_8To32, mo_u_8To32, mo_wordUShr, mo_wordSShr, mo_wordShl, mo_wordNot, mo_wordXor, mo_wordOr, mo_wordAnd, mo_wordULt, mo_wordUGt, mo_wordULe, mo_wordUGe, mo_wordSLt, mo_wordSGt, mo_wordSLe, mo_wordSGe, mo_wordURem, mo_wordUQuot, mo_wordSNeg, mo_wordSRem, mo_wordSQuot, mo_wordMul, mo_wordNe, mo_wordEq, mo_wordSub :: MachOpSource
data CallishMachOp Source