Debian Codegraph @

lib/mlrisc-lib/MLRISC/Doc/latex/pseudo-ops.tex

raw
1 \section{Client Defined Pseudo Ops}
2 \subsection{Introduction}
3 \newdef{Pseudo ops}
4 are client defined instruction stream markers. They
5 can be used to represent assembly directives.
6 Pseudo ops should satisfy the following signature:
7 \begin{SML}
8 signature \mlrischref{instructions/pseudoOps.sig}{PSEUDO_OPS} = sig
9 type pseudo_op
10 val toString : pseudo_op -> string
11 val emitValue : {pOp:pseudo_op, loc:int, emit:Word8.word -> unit} -> unit
12 val sizeOf : pseudo_op * int -> int
13 val adjustLabels : pseudo_op * int -> bool
14 end
15 \end{SML}
16
17 The method that is required is:
18 \begin{itemize}
19 \item \sml{toString} -- pretty printing the pseudo in assembly format.
20 \end{itemize}
21
22 When machine code generation is used, we also have to implement
23 the following methods:
24 \begin{itemize}
25 \item \sml{emitValue} --
26 emit value of pseudo op give current location counter and output
27 stream. The value emitted should respect the endianness of the
28 target machine.
29 \item \sml{sizeOf} --
30 Size of the pseudo op in bytes given the current location counter
31 The location counter is provided in case some pseudo ops are
32 dependent on alignment considerations.
33 \item \sml{adjustLabels} --
34 adjust the value of labels in the pseudo op given the current
35 location counter.
36 \end{itemize}
37 These methods are involved during the
38 \href{span-dep.html}{span dependence resolution} phase to determine
39 the size and layout of the pseudo ops.