Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Translation of ImpCode Exp and Code to C.
Synopsis
- compilePrimExp :: Monad m => (v -> m Exp) -> PrimExp v -> m Exp
- compileExp :: Exp -> CompilerM op s Exp
- compileCode :: Code op -> CompilerM op s ()
- compileDest :: VName -> CompilerM op s (VName, [Stm])
- compileArg :: Arg -> CompilerM op s Exp
- compileCopy :: PrimType -> [Count Elements (TExp Int64)] -> (VName, Space) -> (Count Elements (TExp Int64), [Count Elements (TExp Int64)]) -> (VName, Space) -> (Count Elements (TExp Int64), [Count Elements (TExp Int64)]) -> CompilerM op s ()
- compileCopyWith :: [Count Elements (TExp Int64)] -> (Exp -> Exp -> CompilerM op s ()) -> (Count Elements (TExp Int64), [Count Elements (TExp Int64)]) -> (Exp -> CompilerM op s Exp) -> (Count Elements (TExp Int64), [Count Elements (TExp Int64)]) -> CompilerM op s ()
- errorMsgString :: ErrorMsg Exp -> CompilerM op s (String, [Exp])
- linearCode :: Code op -> [Code op]
Documentation
compilePrimExp :: Monad m => (v -> m Exp) -> PrimExp v -> m Exp Source #
Tell me how to compile a v
, and I'll Compile any PrimExp v
for you.
compileCode :: Code op -> CompilerM op s () Source #
compileDest :: VName -> CompilerM op s (VName, [Stm]) Source #
Prepare a destination for function application.
compileCopy :: PrimType -> [Count Elements (TExp Int64)] -> (VName, Space) -> (Count Elements (TExp Int64), [Count Elements (TExp Int64)]) -> (VName, Space) -> (Count Elements (TExp Int64), [Count Elements (TExp Int64)]) -> CompilerM op s () Source #
compileCopyWith :: [Count Elements (TExp Int64)] -> (Exp -> Exp -> CompilerM op s ()) -> (Count Elements (TExp Int64), [Count Elements (TExp Int64)]) -> (Exp -> CompilerM op s Exp) -> (Count Elements (TExp Int64), [Count Elements (TExp Int64)]) -> CompilerM op s () Source #
Compile an Copy
using sequential nested loops, but
parameterised over how to do the reads and writes.
linearCode :: Code op -> [Code op] Source #