| 1 |
\section{Instructions} |
| 2 |
|
| 3 |
Instructions in MLRISC are implemented as abstract datatypes and |
| 4 |
must satisfy the signature |
| 5 |
\mlrischref{instructions/instructions.sig}{INSTRUCTIONS}, defined as follows: |
| 6 |
|
| 7 |
\begin{SML} |
| 8 |
signature INSTRUCTIONS = |
| 9 |
sig |
| 10 |
structure C : \href{cells.html}{CELLS} |
| 11 |
structure Constant : \href{constants.html}{CONSTANT} |
| 12 |
structure LabelExp : \href{labelexp.html}{LABELEXP} |
| 13 |
sharing LabelExp.Constant = Constant |
| 14 |
|
| 15 |
type operand |
| 16 |
type ea |
| 17 |
type addressing_mode |
| 18 |
type instruction |
| 19 |
end |
| 20 |
\end{SML} |
| 21 |
|
| 22 |
Type \sml{operand} is used to represent ioperands, |
| 23 |
\sml{ea} is used to represent effective addresses, type |
| 24 |
\sml{addressing_mode} is used to represent the internal addressing mode |
| 25 |
used by the architecture. Note that these are all abstract according to |
| 26 |
the signature, so the client has complete freedom in choosing the most |
| 27 |
convenient representation for these things. |
| 28 |
|
| 29 |
\subsection{Predication} |
| 30 |
For architectures that have full \newdef{predication} |
| 31 |
built-in, such as the C6xx or IA-64, the instruction set should be |
| 32 |
extended to satisfy the signature: |
| 33 |
\begin{SML} |
| 34 |
signature \mlrischref{instructions/pred-instructions.sig}{PREDICATED_INSTRUCTIONS} = |
| 35 |
sig |
| 36 |
include INSTRUCTIONS |
| 37 |
|
| 38 |
type predicate |
| 39 |
end |
| 40 |
\end{SML} |
| 41 |
This basically says that the type that is used to represent a predicate |
| 42 |
can be implemented however the client wants. This flexibility |
| 43 |
is quite important since the predication model may differ substantially |
| 44 |
from architecture to architecture. |
| 45 |
|
| 46 |
For example, in the TI C6, there are no seperate predicate register files |
| 47 |
and integer registers double as predicate registers, and the predicate |
| 48 |
true is any non-zero value. Each instruction can be predicated under a |
| 49 |
predicate register or its negation. In contrasts, architectures such as |
| 50 |
IA-64 and HP's Playdoh incorporate separate predicate registers into their |
| 51 |
architectures. In Playdoh, \newdef{predicate defining} instructions |
| 52 |
actually set a pair of complementary predicate registers, |
| 53 |
and instructions can only |
| 54 |
be predicated under the value of a predicate register, not its negation. |
| 55 |
|
| 56 |
\subsection{VLIW} |
| 57 |
VLIW architectures differ from superscalars in that |
| 58 |
resource assignments are statically determined at compile time. |
| 59 |
We distinguish between two different types of resources, namely |
| 60 |
\newdef{functional units} and \newdef{data paths}. |
| 61 |
The latter type is particularly |
| 62 |
important for clustered architectures. |
| 63 |
The following signature |
| 64 |
is used to describe VLIW instructions: |
| 65 |
\begin{SML} |
| 66 |
signature \mlrischref{instructions/vliw-instructions.sig}{VLIW\_INSTRUCTIONS} = |
| 67 |
sig |
| 68 |
|
| 69 |
include INSTRUCTIONS |
| 70 |
structure FU : \mlrischref{instructions/funits.sig}{FUNITS} |
| 71 |
structure DP : \mlrischref{instructions/datapaths.sig}{DATAPATHS} |
| 72 |
end |
| 73 |
\end{SML} |
| 74 |
The signature \sml{FUNITS} is used to describe functional unit |
| 75 |
resources, while the signature \sml{DATAPATHS} is used to describe |
| 76 |
data paths. |
| 77 |
|
| 78 |
\subsection{Predicated VLIW} |
| 79 |
|
| 80 |
Finally, instructions sets for predicated VLIW/EPIC machines should match |
| 81 |
the signature |
| 82 |
\begin{SML} |
| 83 |
signature \mlrischref{instructions/pred-vliw-instructions.sig}{PREDICATED_VLIW_INSTRUCTIONS} = |
| 84 |
sig |
| 85 |
include VLIW_INSTRUCTIONS |
| 86 |
type predicate |
| 87 |
end |
| 88 |
\end{SML} |