mini-ml-0.1.0.0: MiniML compiler
Safe HaskellSafe-Inferred
LanguageHaskell2010

CodeGen.RiscV.Lib

Synopsis

Documentation

compileT :: Monad m => AsmBuilderT m a -> m [CodeLine] Source #

Compile the code

compile :: AsmBuilder a -> [CodeLine] Source #

Compile the code

mainFunction :: MonadAsmBuilder m => (() -> m ()) -> m () Source #

Emit main function (entry point routine)

function :: MonadAsmBuilder m => Text -> Int64 -> ([Operand] -> m Operand) -> m Operand Source #

Emit main function (entry point routine)

globalVar :: MonadAsmBuilder m => Text -> m Operand Source #

Emit uninitialized global variable

externFunction :: MonadAsmBuilder m => Text -> m Operand Source #

Get external function operand

data AsmBuilderT m a Source #

Instances

Instances details
MonadTrans AsmBuilderT Source # 
Instance details

Defined in CodeGen.RiscV.Lib.Monad

Methods

lift :: Monad m => m a -> AsmBuilderT m a #

MonadState s m => MonadState s (AsmBuilderT m) Source # 
Instance details

Defined in CodeGen.RiscV.Lib.Monad

Methods

get :: AsmBuilderT m s #

put :: s -> AsmBuilderT m () #

state :: (s -> (a, s)) -> AsmBuilderT m a #

MonadFix m => MonadFix (AsmBuilderT m) Source # 
Instance details

Defined in CodeGen.RiscV.Lib.Monad

Methods

mfix :: (a -> AsmBuilderT m a) -> AsmBuilderT m a #

Monad m => Applicative (AsmBuilderT m) Source # 
Instance details

Defined in CodeGen.RiscV.Lib.Monad

Methods

pure :: a -> AsmBuilderT m a #

(<*>) :: AsmBuilderT m (a -> b) -> AsmBuilderT m a -> AsmBuilderT m b #

liftA2 :: (a -> b -> c) -> AsmBuilderT m a -> AsmBuilderT m b -> AsmBuilderT m c #

(*>) :: AsmBuilderT m a -> AsmBuilderT m b -> AsmBuilderT m b #

(<*) :: AsmBuilderT m a -> AsmBuilderT m b -> AsmBuilderT m a #

Functor m => Functor (AsmBuilderT m) Source # 
Instance details

Defined in CodeGen.RiscV.Lib.Monad

Methods

fmap :: (a -> b) -> AsmBuilderT m a -> AsmBuilderT m b #

(<$) :: a -> AsmBuilderT m b -> AsmBuilderT m a #

Monad m => Monad (AsmBuilderT m) Source # 
Instance details

Defined in CodeGen.RiscV.Lib.Monad

Methods

(>>=) :: AsmBuilderT m a -> (a -> AsmBuilderT m b) -> AsmBuilderT m b #

(>>) :: AsmBuilderT m a -> AsmBuilderT m b -> AsmBuilderT m b #

return :: a -> AsmBuilderT m a #

Monad m => MonadAsmBuilder (AsmBuilderT m) Source # 
Instance details

Defined in CodeGen.RiscV.Lib.Monad

data Operand Source #

Instances

Instances details
Eq Operand Source # 
Instance details

Defined in CodeGen.RiscV.Lib.Types

Methods

(==) :: Operand -> Operand -> Bool #

(/=) :: Operand -> Operand -> Bool #

Ord Operand Source # 
Instance details

Defined in CodeGen.RiscV.Lib.Types

Pretty Operand Source # 
Instance details

Defined in CodeGen.RiscV.Lib.Types

Methods

pretty :: Operand -> Doc ann #

prettyList :: [Operand] -> Doc ann #

data CodeLine Source #

Instances

Instances details
Pretty CodeLine Source # 
Instance details

Defined in CodeGen.RiscV.Lib.Types

Methods

pretty :: CodeLine -> Doc ann #

prettyList :: [CodeLine] -> Doc ann #

ite :: MonadAsmBuilder m => Operand -> (() -> m Operand) -> (() -> m Operand) -> m Operand Source #