| 1 |
\section{The MLRISC Machine Description Language} |
| 2 |
|
| 3 |
\subsection{ Overview } |
| 4 |
|
| 5 |
\newdef{MDGen} is a machine description language |
| 6 |
is designed to automate |
| 7 |
various mundane and error prone tasks in developing a back-end for |
| 8 |
MLRISC. Currently, to target a new |
| 9 |
architecture the programmer must provide the following set of modules |
| 10 |
written in Standard ML: |
| 11 |
|
| 12 |
\begin{itemize} |
| 13 |
\item \codehref{instructions/cells.sig}{CELLS} -- |
| 14 |
the properties of the register set and (some part of) memory hierarchy. |
| 15 |
\item \codehref{instructions/instructions.sig}{INSTRUCTIONS} -- |
| 16 |
the concrete instruction set representation. |
| 17 |
\item \codehref{instructions/insnProps.sig}{INSNS_PROPERTIES} -- |
| 18 |
properties of the instructions. |
| 19 |
\item \codehref{instructions/shuffle.sig}{SHUFFLE} -- |
| 20 |
methods to emit linearized code from parallel copies. |
| 21 |
\item \codehref{emit/instruction-emitter.sig}{ASSEMBLER} -- |
| 22 |
the assembler |
| 23 |
\item \codehref{emit/instruction-emitter.sig}{MC} -- |
| 24 |
the machine code emitter |
| 25 |
\item \codehref{../backpatch/sdi-jumps.sig}{ SDI_JUMPS } -- |
| 26 |
methods for resolving span-dependent instructions. |
| 27 |
\item <a href="../backpatch/delaySlotProps.sig" target=code> DELAY_SLOTS_PROPERTIES |
| 28 |
</a> -- machine properties for delay slot filling, if a machine |
| 29 |
architecture contains branch delay slots or load delay slots. |
| 30 |
\item \codehref{../SSA/ssaProps.sig}{ SSA_PROPERTIES } -- |
| 31 |
semantics properties for performing optimizations in Static Single |
| 32 |
Assignment form. |
| 33 |
\end{itemize} |
| 34 |
|
| 35 |
In general, writing a backend is tedious even with |
| 36 |
SML's abstraction capabilities. |
| 37 |
Furthermore, the machine description is procedural in natural |
| 38 |
and must be checked by hand. |
| 39 |
|
| 40 |
\subsection{ What is in MDGen? } |
| 41 |
The MDGen tool simplifies the process of developing a new MLRISC backend. |
| 42 |
MDGen provides the following: |
| 43 |
\begin{itemize} |
| 44 |
\item A representation description language for specifying the |
| 45 |
machine encoding of the instruction set, |
| 46 |
using an extension of ML's algebraic datatype facility. |
| 47 |
\item A semantics description language for specifying the abstract semantics |
| 48 |
of the instructions. |
| 49 |
\end{itemize} |
| 50 |
|
| 51 |
Both sub-languages are based on ML's syntax and semantics, so |
| 52 |
they should be readily familiar to all MLRISC users. |
| 53 |
|
| 54 |
A backend developer can specify a new machine architecture using the MDGen |
| 55 |
language, and in turn, the MDGen tool generates ML modules that are |
| 56 |
required by the MLRISC system. |
| 57 |
|
| 58 |
The basic concepts of MDGen are inspired largely from |
| 59 |
Norman Ramsey's <a href="www.cs.virginia.edu/~nr/toolkit"> |
| 60 |
New Jersey Machine Code Tool Kit </a> and |
| 61 |
Ramsey and Davidson's |
| 62 |
<a href="http://www.cs.virginia.edu/zephyr/csdl/lrtlindex.html"> |
| 63 |
Lambda RTL </a> |
| 64 |
|
| 65 |
\subsection{A Sample Description} |
| 66 |
|
| 67 |
Here we present a sample MDGen description, using the Alpha as an example. |
| 68 |
We highlight all keywords in the MDGen language |
| 69 |
in. A typical machine description |
| 70 |
is structured as follows: |
| 71 |
|
| 72 |
\begin{SML} |
| 73 |
architecture Alpha = |
| 74 |
struct |
| 75 |
|
| 76 |
name "Alpha" |
| 77 |
|
| 78 |
superscalar |
| 79 |
|
| 80 |
little endian |
| 81 |
|
| 82 |
<font color=#FF0000>lowercase assembly</font> |
| 83 |
|
| 84 |
\href{#cells}{Storage cells and locations} |
| 85 |
\href{#encoding}{Instruction encoding formats specification} |
| 86 |
\href{#instruction}{Instruction definition} |
| 87 |
<font color=#FF0000>end</font> |
| 88 |
\end{SML} |
| 89 |
|
| 90 |
Here, we declare that the Alpha is a superscalar machine using |
| 91 |
little endian encoding. Furthermore, assembly output should be displayed |
| 92 |
in lowercase-- this is for personal esthetic reasons only; most assemblers |
| 93 |
are case insensitive. |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
\subsubsection{ <a name="cells">Specifying Storage Cells and Locations </a>} |
| 98 |
|
| 99 |
A <font color="#ff0000">cell</font> is an abstract resource location |
| 100 |
for holding data values. On typical machines, the types of |
| 101 |
cells include general purpose registers, floating point registers, |
| 102 |
and condition code registers. |
| 103 |
|
| 104 |
The \sml{storage} declaration defines different |
| 105 |
<font color="#ff0000">cellkinds</font>. MLRISC requires the |
| 106 |
cellkinds \sml{GP}, \sml{FP}, \sml{CC} to be defined. |
| 107 |
These are the cellkinds for general purpose registers, floating point |
| 108 |
registers and condition code registers. |
| 109 |
|
| 110 |
In the following sequence of declarations, a few things are defined: |
| 111 |
\begin{itemize} |
| 112 |
\item The cellkinds \sml{GP, FP, CC} are defined. |
| 113 |
Furthermore, the cellkinds \sml{MEM, CTRL}, which stand |
| 114 |
for memory and control (dependence), are also implicitly defined. |
| 115 |
\item The \sml{assembly as} clauses specify how a specific cell type is |
| 116 |
to be displayed. Here, we specify that register 30, the |
| 117 |
stack pointer, should be displayed specially as \sml{$sp}. |
| 118 |
\item The \sml{in cellset} clause, when attached, tells MDGen that |
| 119 |
the associated cellkind should be part of the |
| 120 |
\href{cellset.html}{ cellset }. The clause \sml{in cellset GP} |
| 121 |
tells MDGen that the a cell of type \sml{CC} should be treated |
| 122 |
the same as a \sml{GP} |
| 123 |
\item The \sml{locations} declarations define a few abbreviations: |
| 124 |
\sml{stackptrR} is the stack pointer, \sml{asmTmpR} is |
| 125 |
the assembly temporary, \sml{fasmTmp} is the floating point |
| 126 |
assembly temporary etc. |
| 127 |
\end{itemize} |
| 128 |
|
| 129 |
<tt> |
| 130 |
\begin{SML} |
| 131 |
<font color=#FF0000>storage</font> |
| 132 |
GP = 32 <font color=#FF0000>cells <font color=#FF0000>of</font> 64 bits in cellset called</font> "register" |
| 133 |
<font color=#FF0000>assembly as</font> (fn 30 => "$sp" |
| 134 |
| r => "$"^Int.toString r) |
| 135 |
| FP = 32 <font color=#FF0000>cells <font color=#FF0000>of</font> 64 bits in cellset called</font> "floating point register" |
| 136 |
<font color=#FF0000>assembly as</font> (fn f => "f"^Int.toString f) |
| 137 |
| CC = <font color=#FF0000>cells <font color=#FF0000>of</font> 64 bits in cellset GP called</font> "condition code register" |
| 138 |
<font color=#FF0000>assembly as</font> "cc" |
| 139 |
<font color=#FF0000>locations</font> |
| 140 |
stackptrR = <font color=#008800>$</font>GP[30] |
| 141 |
<font color=#FF0000>and</font> asmTmpR = <font color=#008800>$</font>GP[28] |
| 142 |
<font color=#FF0000>and</font> fasmTmp = <font color=#008800>$</font>FP[30] |
| 143 |
<font color=#FF0000>and</font> GPReg r = <font color=#008800>$</font>GP[r] |
| 144 |
<font color=#FF0000>and</font> FPReg f = <font color=#008800>$</font>GP[f] |
| 145 |
\end{SML} |
| 146 |
|
| 147 |
<h3> <a name="instruction"> |
| 148 |
Specifying the Representation of Instructions</a></h3> |
| 149 |
\begin{SML} |
| 150 |
<font color=#FF0000>structure</font> Instruction = |
| 151 |
<font color=#FF0000>struct</font> |
| 152 |
<font color=#FF0000>datatype</font> ea = |
| 153 |
Direct <font color=#FF0000>of</font> <font color=#008800>$</font>GP |
| 154 |
| FDirect <font color=#FF0000>of</font> <font color=#008800>$</font>FP |
| 155 |
| Displace <font color=#FF0000>of</font> {base: <font color=#008800>$</font>GP, disp:int} |
| 156 |
|
| 157 |
<font color=#FF0000>datatype</font> operand = |
| 158 |
REGop <font color=#FF0000>of</font> <font color=#008800>$</font>GP ``<GP>'' (GP) |
| 159 |
| IMMop <font color=#FF0000>of</font> int ``<int>'' |
| 160 |
| HILABop <font color=#FF0000>of</font> LabelExp.labexp ``hi(<emit_labexp labexp>)'' |
| 161 |
| LOLABop <font color=#FF0000>of</font> LabelExp.labexp ``lo(<emit_labexp labexp>)'' |
| 162 |
| LABop <font color=#FF0000>of</font> LabelExp.labexp ``<emit_labexp labexp>'' |
| 163 |
| CONSTop <font color=#FF0000>of</font> Constant.const ``<emit_const const>'' |
| 164 |
|
| 165 |
(* |
| 166 |
* When I say ! after the datatype</font> name XXX, it means generate a |
| 167 |
* function emit_XXX that converts the constructors into the corresponding |
| 168 |
* assembly text. By default, it uses the same name as the constructor, |
| 169 |
* but may be modified by the lowercase/uppercase assembly directive. |
| 170 |
* |
| 171 |
*) |
| 172 |
<font color=#FF0000>datatype</font> branch! = |
| 173 |
BR 0x30 |
| 174 |
| BSR 0x34 |
| 175 |
| BLBC 0x3 |
| 176 |
| BEQ 0x39 | BLT 0x3a | BLE 0x3b |
| 177 |
| BLBS 0x3c | BNE 0x3d | BGE 0x3e |
| 178 |
| BGT 0x3f |
| 179 |
|
| 180 |
<font color=#FF0000>datatype</font> fbranch! = |
| 181 |
FBEQ 0x31 | FBLT 0x32 |
| 182 |
| FBLE 0x33 | FBNE 0x35 |
| 183 |
| FBGE 0x36 | FBGT 0x37 |
| 184 |
|
| 185 |
<font color=#FF0000>datatype</font> load! = LDL 0x28 | LDL_L 0x2A | LDQ 0x29 | LDQ_L 0x2B | LDQ_U 0x0B |
| 186 |
<font color=#FF0000>datatype</font> store! = STL 0x2C | STQ 0x2D | STQ_U 0x0F |
| 187 |
<font color=#FF0000>datatype</font> fload[0x20..0x23]! = LDF | LDG | LDS | LDT |
| 188 |
<font color=#FF0000>datatype</font> fstore[0x24..0x27]! = STF | STG | STS | STT |
| 189 |
|
| 190 |
(* non-trapping opcodes *) |
| 191 |
<font color=#FF0000>datatype</font> operate! = (* table C-5 *) |
| 192 |
ADDL (0wx10,0wx00) | ADDQ (0wx10,0wx20) |
| 193 |
| CMPBGE(0wx10,0wx0f) | CMPEQ (0wx10,0wx2d) |
| 194 |
| CMPLE (0wx10,0wx6d) | CMPLT (0wx10,0wx4d) | CMPULE (0wx10,0wx3d) |
| 195 |
| CMPULT(0wx10,0wx1d) | SUBL (0wx10,0wx09) |
| 196 |
| SUBQ (0wx10,0wx29) |
| 197 |
| S4ADDL(0wx10,0wx02) | S4ADDQ (0wx10,0wx22) | S4SUBL (0wx10,0wx0b) |
| 198 |
| S4SUBQ(0wx10,0wx2b) | S8ADDL (0wx10,0wx12) | S8ADDQ (0wx10,0wx32) |
| 199 |
| S8SUBL(0wx10,0wx1b) | S8SUBQ (0wx10,0wx3b) |
| 200 |
|
| 201 |
| AND (0wx11,0wx00) | BIC (0wx11,0wx08) | BIS (0wx11,0wx20) |
| 202 |
| CMOVEQ(0wx11,0wx24) | CMOVLBC(0wx11,0wx16) | CMOVLBS(0wx11,0wx14) |
| 203 |
| CMOVGE(0wx11,0wx46) | CMOVGT (0wx11,0wx66) | CMOVLE (0wx11,0wx64) |
| 204 |
| CMOVLT(0wx11,0wx44) | CMOVNE (0wx11,0wx26) | EQV (0wx11,0wx48) |
| 205 |
| ORNOT (0wx11,0wx28) | XOR (0wx11,0wx40) |
| 206 |
|
| 207 |
| EXTBL (0wx12,0wx06) | EXTLH (0wx12,0wx6a) | EXTLL(0wx12,0wx26) |
| 208 |
| EXTQH (0wx12,0wx7a) | EXTQL (0wx12,0wx36) | EXTWH(0wx12,0wx5a) |
| 209 |
| EXTWL (0wx12,0wx16) | INSBL (0wx12,0wx0b) | INSLH(0wx12,0wx67) |
| 210 |
| INSLL (0wx12,0wx2b) | INSQH (0wx12,0wx77) | INSQL(0wx12,0wx3b) |
| 211 |
| INSWH (0wx12,0wx57) | INSWL (0wx12,0wx1b) | MSKBL(0wx12,0wx02) |
| 212 |
| MSKLH (0wx12,0wx62) | MSKLL (0wx12,0wx22) | MSKQH(0wx12,0wx72) |
| 213 |
| MSKQL (0wx12,0wx32) | MSKWH (0wx12,0wx52) | MSKWL(0wx12,0wx12) |
| 214 |
| SLL (0wx12,0wx39) | SRA (0wx12,0wx3c) | SRL (0wx12,0wx34) |
| 215 |
| ZAP (0wx12,0wx30) | ZAPNOT (0wx12,0wx31) |
| 216 |
| MULL (0wx13,0wx00) | MULQ (0wx13,0wx20) |
| 217 |
| UMULH (0wx13,0wx30) |
| 218 |
| SGNXL "addl" (0wx10,0wx00) (* same as ADDL *) |
| 219 |
|
| 220 |
(* conditional moves *) |
| 221 |
|
| 222 |
<font color=#FF0000>datatype</font> pseudo_op! = DIVL | DIVLU |
| 223 |
|
| 224 |
<font color=#FF0000>datatype</font> operateV! = (* table C-5 opc/func *) |
| 225 |
ADDLV (0wx10,0wx40) | ADDQV (0wx10,0wx60) |
| 226 |
| SUBLV (0wx10,0wx49) | SUBQV (0wx10,0wx69) |
| 227 |
| MULLV (0wx13,0wx00) | MULQV (0wx13,0wx60) |
| 228 |
|
| 229 |
<font color=#FF0000>datatype</font> foperate! = (* table C-6 *) |
| 230 |
CPYS (0wx17,0wx20) | CPYSE (0wx17,0wx022) | CPYSN (0wx17,0wx021) |
| 231 |
| CVTLQ (0wx17,0wx010) | CVTQL (0wx17,0wx030) | CVTQLSV (0wx17,0wx530) |
| 232 |
| CVTQLV (0wx17,0wx130) |
| 233 |
| FCMOVEQ (0wx17,0wx02a) | FCMOVEGE (0wx17,0wx02d) | FCMOVEGT (0wx17,0wx02f) |
| 234 |
| FCMOVLE (0wx17,0wx02e) | FCMOVELT (0wx17,0wx02c) | FCMOVENE (0wx17,0wx02b) |
| 235 |
| MF_FPCR (0wx17,0wx025) | MT_FPCR (0wx17,0wx024) |
| 236 |
|
| 237 |
(* table C-7 *) |
| 238 |
| CMPTEQ (0wx16,0wx0a5) | CMPTLT (0wx16,0wx0a6) | CMPTLE (0wx16,0wx0a7) |
| 239 |
| CMPTUN (0wx16,0wx0a4) |
| 240 |
|
| 241 |
<font color=#FF0000>datatype</font> foperateV! = |
| 242 |
ADDSSUD 0wx5c0 |
| 243 |
| ADDTSUD 0wx5e0 |
| 244 |
| CVTQSC 0wx3c |
| 245 |
| CVTQTC 0wx3e |
| 246 |
| CVTTSC 0wx2c |
| 247 |
| CVTTQC 0wx2f |
| 248 |
| DIVSSUD 0wx5ec |
| 249 |
| DIVTSUD 0wx5c3 |
| 250 |
| MULSSUD 0wx5c2 |
| 251 |
| MULTSUD 0wx5e2 |
| 252 |
| SUBSSUD 0wx5c1 |
| 253 |
| SUBTSUD 0wx5e1 |
| 254 |
|
| 255 |
<font color=#FF0000>datatype</font> osf_user_palcode! = |
| 256 |
BPT 0x80 | BUGCHK 0x81 | CALLSYS 0x83 |
| 257 |
| GENTRAP 0xaa | IMB 0x86 | RDUNIQUE 0x9e | WRUNIQUE 0x9f |
| 258 |
|
| 259 |
end (* Instruction *) |
| 260 |
\end{SML} |
| 261 |
|
| 262 |
<h3> <a name="encoding"> |
| 263 |
Specifying the Instruction Encoding Formats </a></h3> |
| 264 |
|
| 265 |
The Alpha has very simple instruction encoding formats. |
| 266 |
|
| 267 |
<tt> |
| 268 |
\begin{SML} |
| 269 |
<font color=#FF0000>instruction formats 32 bits</font> |
| 270 |
Memory{opc:6, ra:5, rb:GP 5, disp: signed 16} (* p3-9 *) |
| 271 |
(* derived from Memory *) |
| 272 |
| LoadStore{opc,ra,rb,disp} = |
| 273 |
<font color=#FF00000>let val</font> disp = |
| 274 |
<font color=#FF00000>case</font> disp <font color=#FF0000>of</font> |
| 275 |
I.REGop rb => emit_GP rb |
| 276 |
| I.IMMop i => itow i |
| 277 |
| I.HILABop le => itow(LabelExp.valueOf le) |
| 278 |
| I.LOLABop le => itow(LabelExp.valueOf le) |
| 279 |
| I.LABop le => itow(LabelExp.valueOf le) |
| 280 |
| I.CONSTop c => itow(Constant.valueOf c) |
| 281 |
in Memory{opc,ra,rb,disp} |
| 282 |
end |
| 283 |
| ILoadStore{opc,r:GP,b,d} = LoadStore{opc,ra=r,rb=b,disp=d} |
| 284 |
| FLoadStore{opc,r:FP,b,d} = LoadStore{opc,ra=r,rb=b,disp=d} |
| 285 |
|
| 286 |
| Jump{opc:6,ra:GP 5,rb:GP 5,h:2,disp:int signed 14} (* table C-3 *) |
| 287 |
| Memory_fun{opc:6, ra:GP 5, rb:GP 5, func:16} (* p3-9 *) |
| 288 |
| Branch{opc:branch 6, ra:GP 5, disp:signed 21} (* p3-10 *) |
| 289 |
| Fbranch{opc:fbranch 6, ra:FP 5, disp:signed 21} (* p3-10 *) |
| 290 |
(* p3-11 *) |
| 291 |
| Operate0{opc:6,ra:GP 5,rb:GP 5,sbz:13..15,_:1=0,func:5..11,rc:GP 5} |
| 292 |
(* p3-11 *) |
| 293 |
| Operate1{opc:6,ra:GP 5,lit:signed 13..20,_:1=1,func:5..11,rc:GP 5} |
| 294 |
| Operate{opc,ra,rb,func,rc} = |
| 295 |
(<font color=#FF00000>case</font> rb <font color=#FF0000>of</font> |
| 296 |
I.REGop rb => Operate0{opc,ra,rb,func,rc,sbz=0w0} |
| 297 |
| I.IMMop i => Operate1{opc,ra,lit=itow i,func,rc} |
| 298 |
| I.HILABop le => Operate1{opc,ra,lit=itow(LabelExp.valueOf le),func,rc} |
| 299 |
| I.LOLABop le => Operate1{opc,ra,lit=itow(LabelExp.valueOf le),func,rc} |
| 300 |
| I.LABop le => Operate1{opc,ra,lit=itow(LabelExp.valueOf le),func,rc} |
| 301 |
| I.CONSTop c => Operate1{opc,ra,lit=itow(Constant.valueOf c),func,rc} |
| 302 |
) |
| 303 |
| Foperate{opc:6,fa:FP 5,fb:FP 5,func:5..15,fc:FP 5} |
| 304 |
| Pal{opc:6=0,func:26} |
| 305 |
\end{SML} |
| 306 |
</tt> |
| 307 |
|
| 308 |
\subsubsection{ Specifying the instruction set } |
| 309 |
<tt> |
| 310 |
\begin{SML} |
| 311 |
<font color=#FF0000>structure</font> MC = |
| 312 |
<font color=#FF0000>struct</font> |
| 313 |
(* compute displacement address *) |
| 314 |
<font color=#FF0000>fun</font> disp lab = itow(Label.addrOf lab - !loc - 4) ~>> 0w2 |
| 315 |
<font color=#FF0000>end</font> |
| 316 |
|
| 317 |
(* |
| 318 |
* The main instruction set definition consists <font color=#FF0000>of</font> the following: |
| 319 |
* 1) constructor-like declaration defines the view <font color=#FF0000>of</font> the instruction, |
| 320 |
* 2) assembly directive in funny quotes `` '', |
| 321 |
* 3) machine encoding expression, |
| 322 |
* 4) semantics expression in [[ ]], |
| 323 |
* 5) delay slot directives etc (not necessary in this architecture!) |
| 324 |
*) |
| 325 |
<font color=#FF0000>instruction</font> |
| 326 |
DEFFREG <font color=#FF0000>of</font> <font color=#008800>$</font>FP (* define a floating point register *) |
| 327 |
``deffreg <FP>'' |
| 328 |
(* Pseudo instruction for the register allocator *) |
| 329 |
|
| 330 |
(* Load/Store *) |
| 331 |
| LDA <font color=#FF0000>of</font> {r: <font color=#008800>$</font>GP, b: <font color=#008800>$</font>GP, d:operand} (* use of REGop is illegal *) |
| 332 |
``lda\t<r>, <d>()'' |
| 333 |
ILoadStore{opc=0w08,r,b,d} |
| 334 |
|
| 335 |
| LDAH <font color=#FF0000>of</font> {r: <font color=#008800>$</font>GP, b: <font color=#008800>$</font>GP, d:operand} (* use of REGop is illegal *) |
| 336 |
``ldah\t<r>, <d>()'' |
| 337 |
ILoadStore{opc=0w09,r,b,d} |
| 338 |
|
| 339 |
| LOAD <font color=#FF0000>of</font> {ldOp:load, r: <font color=#008800>$</font>GP, b: <font color=#008800>$</font>GP, d:operand, mem:Region.region} |
| 340 |
``<ldOp>\t<r>, <d>()'' |
| 341 |
ILoadStore{opc=emit_load ldOp,r,b,d} |
| 342 |
|
| 343 |
| STORE <font color=#FF0000>of</font> {stOp:store, r: <font color=#008800>$</font>GP, b: <font color=#008800>$</font>GP, d:operand, mem:Region.region} |
| 344 |
``<stOp>\t<r>, <d>()'' |
| 345 |
ILoadStore{opc=emit_store stOp,r,b,d} |
| 346 |
|
| 347 |
| FLOAD <font color=#FF0000>of</font> {ldOp:fload, r: <font color=#008800>$</font>FP, b: <font color=#008800>$</font>GP, d:operand, mem:Region.region} |
| 348 |
``<ldOp>\t<r>, <d>()'' |
| 349 |
FLoadStore{opc=emit_fload ldOp,r,b,d} |
| 350 |
|
| 351 |
| FSTORE <font color=#FF0000>of</font> {stOp:fstore, r: <font color=#008800>$</font>FP, b: <font color=#008800>$</font>GP, d:operand, mem:Region.region} |
| 352 |
``<stOp>\t<r>, <d>()'' |
| 353 |
FLoadStore{opc=emit_fstore stOp,r,b,d} |
| 354 |
|
| 355 |
(* Control Instructions *) |
| 356 |
| JMPL <font color=#FF0000>of</font> {r: <font color=#008800>$</font>GP, b: <font color=#008800>$</font>GP, d:int} * Label.label list |
| 357 |
``jmpl\t<r>, <d>()'' |
| 358 |
Jump{opc=0wx1a,h=0w0,ra=r,rb=b,disp=d} (* table C-3 *) |
| 359 |
|
| 360 |
| JSR <font color=#FF0000>of</font> {r: <font color=#008800>$</font>GP, b: <font color=#008800>$</font>GP, d:int} * C.cellset * C.cellset |
| 361 |
``jsr\t<r>, <d>()'' |
| 362 |
Jump{opc=0wx1a,h=0w1,ra=r,rb=b,disp=d} |
| 363 |
|
| 364 |
| RET <font color=#FF0000>of</font> {r: <font color=#008800>$</font>GP, b: <font color=#008800>$</font>GP, d:int} |
| 365 |
``ret\t<r>, <d>()'' |
| 366 |
Jump{opc=0wx1a,h=0w2,ra=r,rb=b,disp=d} |
| 367 |
|
| 368 |
| BRANCH <font color=#FF0000>of</font> branch * <font color=#008800>$</font>GP * Label.label |
| 369 |
``<branch> <GP>, <label>'' |
| 370 |
Branch{opc=branch,ra=GP,disp=disp label} |
| 371 |
|
| 372 |
| FBRANCH <font color=#FF0000>of</font> fbranch * <font color=#008800>$</font>FP * Label.label |
| 373 |
``<fbranch> <FP>, <label>'' |
| 374 |
Fbranch{opc=fbranch,ra=FP,disp=disp label} |
| 375 |
|
| 376 |
(* Integer Operate *) |
| 377 |
| OPERATE <font color=#FF0000>of</font> {oper:operate, ra: <font color=#008800>$</font>GP, rb:operand, rc: <font color=#008800>$</font>GP} |
| 378 |
``<oper>\t<ra>, <rb>, <rc>'' |
| 379 |
(let val (opc,func) = emit_operate oper |
| 380 |
in Operate{opc,func,ra,rb,rc} |
| 381 |
end) |
| 382 |
|
| 383 |
| OPERATEV <font color=#FF0000>of</font> {oper:operateV, ra: <font color=#008800>$</font>GP, rb:operand, rc: <font color=#008800>$</font>GP} |
| 384 |
``<oper>\t<ra>, <rb>, <rc>'' |
| 385 |
(let val (opc,func) = emit_operateV oper |
| 386 |
in Operate{opc,func,ra,rb,rc} |
| 387 |
end) |
| 388 |
|
| 389 |
| PSEUDOARITH <font color=#FF0000>of</font> {oper: pseudo_op, ra: <font color=#008800>$</font>GP, rb:operand, rc: <font color=#008800>$</font>GP, |
| 390 |
tmps: C.cellset} |
| 391 |
``<oper>\t<ra>, <rb>, <rc>'' |
| 392 |
|
| 393 |
(* Copy instructions *) |
| 394 |
| COPY <font color=#FF0000>of</font> {dst: <font color=#008800>$</font>GP list, src: <font color=#008800>$</font>GP list, |
| 395 |
impl:instruction list option ref, tmp: ea option} |
| 396 |
``<app emitInstr (Shuffle.shuffle{regmap,tmp,dst,src})>'' |
| 397 |
| FCOPY <font color=#FF0000>of</font> {dst: <font color=#008800>$</font>FP list, src: <font color=#008800>$</font>FP list, |
| 398 |
impl:instruction list option ref, tmp: ea option} |
| 399 |
``<app emitInstr (Shuffle.shufflefp{regmap,tmp,dst,src})>'' |
| 400 |
|
| 401 |
(* Floating Point Operate *) |
| 402 |
| FOPERATE <font color=#FF0000>of</font> {oper:foperate, fa: <font color=#008800>$</font>FP, fb: <font color=#008800>$</font>FP, fc: <font color=#008800>$</font>FP} |
| 403 |
``<oper>\t<fa>, <fb>, <fc>'' |
| 404 |
(let val (opc,func) = emit_foperate oper |
| 405 |
in Foperate{opc,func,fa,fb,fc} |
| 406 |
end) |
| 407 |
|
| 408 |
(* Trapping versions <font color=#FF0000>of</font> the above *) |
| 409 |
| FOPERATEV <font color=#FF0000>of</font> {oper:foperateV, fa: <font color=#008800>$</font>FP, fb: <font color=#008800>$</font>FP, fc: <font color=#008800>$</font>FP} |
| 410 |
``<oper>\t<fa>, <fb>, <fc>'' |
| 411 |
Foperate{opc=0wx16,func=emit_foperateV oper,fa,fb,fc} |
| 412 |
|
| 413 |
(* Misc *) |
| 414 |
| TRAPB (* Trap barrier *) |
| 415 |
``trapb'' |
| 416 |
Memory_fun{opc=0wx18,ra=31,rb=31,func=0wx0} |
| 417 |
|
| 418 |
| CALL_PAL <font color=#FF0000>of</font> {code:osf_user_palcode, def: <font color=#008800>$</font>GP list, use: <font color=#008800>$</font>GP list} |
| 419 |
``call_pal <code>'' |
| 420 |
Pal{func=emit_osf_user_palcode code} |
| 421 |
end |
| 422 |
\end{SML} |
| 423 |
</tt> |
| 424 |
|
| 425 |
|
| 426 |
\subsection{ 4 Machine Descriptions } |
| 427 |
Here are some machine descriptions in varing degree of completion. |
| 428 |
|
| 429 |
\begin{itemize} |
| 430 |
\item \codehref{../sparc/sparc.mdl}{ Sparc } |
| 431 |
\item \codehref{../hppa/hppa.mdl}{ Hppa } |
| 432 |
\item \codehref{../alpha/alpha.mdl}{ Alpha } |
| 433 |
\item \codehref{../ppc/ppc.mdl}{ PowerPC } |
| 434 |
\item \codehref{../x86/x86.mdl}{ X86 } |
| 435 |
\end{itemize} |
| 436 |
|
| 437 |
\subsection{ Syntax Highlighting Macros } |
| 438 |
|
| 439 |
\begin{itemize} |
| 440 |
\item \href{md.vim}{ For vim 5.3 } |
| 441 |
\end{itemize} |
| 442 |
|
| 443 |
</body> |
| 444 |
</html> |