mipsy.xml 30 KB
Newer Older
Benoit Perrot's avatar
Benoit Perrot committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!-- This file is part of Mipsy, a tiny MIPS simulator -->
<!-- Copyright (C) 2003 Benoit Perrot (benoit@lrde.epita.fr) -->
<!-- Mipsy is free software; you can redistribute it and/or modify  -->
<!-- it under the terms of the GNU General Public License as published by -->
<!-- the Free Software Foundation; either version 2 of the License, or -->
<!-- (at your option) any later version. -->

<!-- Mipsy is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the -->
<!-- GNU General Public License for more details. -->

<!-- You should have received a copy of the GNU General Public License -->
<!-- along with this program; if not, write to the Free Software -->
<!-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
Benoit Perrot's avatar
Benoit Perrot committed
16

17
18
<instructions>

Benoit Perrot's avatar
Benoit Perrot committed
19
  <!-- Arithmetic instructions  -->
20

Benoit Perrot's avatar
Benoit Perrot committed
21
  <instruction opcode="add" level="native" kind="arithmetic">
Benoit Perrot's avatar
Benoit Perrot committed
22
    <description>To add 32-bit integers. If an overflow occurs, then trap.</description>
23
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
24
25
26
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
27
28
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
29
30
31
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
      <token kind="register" />
32
33
    </syntax>
    <syntax alias="addi">
Benoit Perrot's avatar
Benoit Perrot committed
34
35
36
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
      <token kind="immediate" />
37
38
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
39
40
  <instruction opcode="addu" level="native" kind="arithmetic">
    <description>To add 32-bit integers.</description>
41
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
42
43
44
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
45
46
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
47
48
49
50
51
52
53
54
      <token kind="register" name="dest" />
      <token kind="register" default="@0"/>
      <token kind="register" />
    </syntax>
    <syntax alias="addiu">
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
      <token kind="immediate" />
55
56
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
57
58
59

  <instruction opcode="addi" level="native" kind="arithmetic">
    <description>To add a constant to a 32-bit integer. If overflow occurs, then trap.</description>
60
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
61
62
63
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src" />
      <attribute type="Exp" name="imm" />
64
65
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
66
67
68
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
      <token kind="immediate" />
69
70
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
71
  <instruction opcode="addiu" level="native" kind="arithmetic">
Benoit Perrot's avatar
Benoit Perrot committed
72
    <description>To add a constant to a 32-bit integer.</description>
73
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
74
75
76
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src" />
      <attribute type="Exp" name="imm" />
77
78
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
79
80
81
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
      <token kind="immediate" />
82
83
84
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
85
  <instruction opcode="sub" level="native" kind="arithmetic">
Benoit Perrot's avatar
Benoit Perrot committed
86
    <description>To subtract 32-bit integers. If overflow occurs, then trap.</description>
87
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
88
89
90
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
91
92
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
93
94
95
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
96
97
    </syntax>
    <syntax alias="addi">
Benoit Perrot's avatar
Benoit Perrot committed
98
99
100
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" name="imm" value="*new OpExp(*new IntExp(0), OpExp::sub, @2)" />
101
102
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
103
  <instruction opcode="subu" level="native" kind="arithmetic">
Benoit Perrot's avatar
Benoit Perrot committed
104
    <description>To subtract 32-bit integers.</description>
105
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
106
107
108
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
109
110
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
111
112
113
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
114
115
    </syntax>
    <syntax alias="addiu">
Benoit Perrot's avatar
Benoit Perrot committed
116
117
118
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" name="imm" value="*new OpExp(*new IntExp(0), OpExp::sub, @2)" />
119
120
121
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
122
  <instruction opcode="neg" level="pseudo" kind="arithmetic">
Benoit Perrot's avatar
Benoit Perrot committed
123
    <description>FIXME</description>
124
    <syntax alias="sub">
Benoit Perrot's avatar
Benoit Perrot committed
125
126
127
      <token kind="register" name="dest" />
      <token kind="hidden" value="* new Register(Register::general, Cpu::zero)" />
      <token kind="register" default="@0" />
128
129
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
130
  <instruction opcode="negu" level="pseudo" kind="arithmetic">
Benoit Perrot's avatar
Benoit Perrot committed
131
    <description>FIXME</description>
132
    <syntax alias="subu">
Benoit Perrot's avatar
Benoit Perrot committed
133
134
135
      <token kind="register" name="dest" />
      <token kind="hidden" value="* new Register(Register::general, Cpu::zero)" />
      <token kind="register" default="@0" />
136
137
    </syntax>
  </instruction>
138

Benoit Perrot's avatar
Benoit Perrot committed
139
  <instruction opcode="abs" level="complex" kind="arithmetic">
Benoit Perrot's avatar
Benoit Perrot committed
140
    <description>FIXME</description>
141
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
142
143
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
144
145
146
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
147
  <instruction opcode="mul" level="native" kind="arithmetic">
Benoit Perrot's avatar
Benoit Perrot committed
148
    <description>To multiply two words and write the result to a GPR.</description>
149
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
150
151
152
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
153
154
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
155
156
157
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
158
    </syntax>
159
    <syntax level="complex">
Benoit Perrot's avatar
Benoit Perrot committed
160
161
162
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
163
    </syntax>
164
  </instruction>
165

Benoit Perrot's avatar
Benoit Perrot committed
166
  <instruction opcode="div" level="native" kind="arithmetic">
Benoit Perrot's avatar
Benoit Perrot committed
167
    <description>To divide a 32-bit signed integers.</description>
168
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
169
170
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
171
172
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
173
174
      <token kind="register" />
      <token kind="register" />
175
176
    </syntax>
    <syntax level="complex">
Benoit Perrot's avatar
Benoit Perrot committed
177
178
179
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
180
181
    </syntax>
    <syntax level="complex">
Benoit Perrot's avatar
Benoit Perrot committed
182
183
184
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
185
186
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
187
  <instruction opcode="divu" level="native" kind="arithmetic">
Benoit Perrot's avatar
Benoit Perrot committed
188
    <description>To divide a 32-bit unsigned integers.</description>
189
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
190
191
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
192
193
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
194
195
      <token kind="register" />
      <token kind="register" />
196
197
    </syntax>
    <syntax level="complex">
Benoit Perrot's avatar
Benoit Perrot committed
198
199
200
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
Benoit Perrot's avatar
Benoit Perrot committed
201
    </syntax>
202
    <syntax level="complex">
Benoit Perrot's avatar
Benoit Perrot committed
203
204
205
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
206
    </syntax>
Benoit Perrot's avatar
Benoit Perrot committed
207
  </instruction>
208

Benoit Perrot's avatar
Benoit Perrot committed
209
  <instruction opcode="rem" level="complex" kind="arithmetic">
Benoit Perrot's avatar
Benoit Perrot committed
210
    <description>FIXME</description>
211
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
212
213
214
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
215
216
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
217
  <instruction opcode="remu" level="complex" kind="arithmetic">
Benoit Perrot's avatar
Benoit Perrot committed
218
    <description>FIXME</description>
219
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
220
221
222
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
223
224
225
    </syntax>
  </instruction>

226

Benoit Perrot's avatar
Benoit Perrot committed
227
  <!-- Binary instructions -->
Benoit Perrot's avatar
Benoit Perrot committed
228
  <instruction opcode="sll" level="native" kind="bitwise">
Benoit Perrot's avatar
Benoit Perrot committed
229
    <description>To left-shift a word by a fixed number of bits.</description>
230
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
231
232
233
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src" />
      <attribute type="Exp" name="imm" />
234
    </format>
235
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
236
237
238
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
239
240
    </syntax>
    <syntax alias="sllv">
Benoit Perrot's avatar
Benoit Perrot committed
241
242
243
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
244
245
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
246

Benoit Perrot's avatar
Benoit Perrot committed
247
  <instruction opcode="sllv" level="native" kind="bitwise">
Benoit Perrot's avatar
Benoit Perrot committed
248
    <description>To left-shift a word by a variable number of bits.</description>
249
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
250
251
252
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
253
254
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
255
256
257
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
258
259
260
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
261
  <instruction opcode="sra" level="native" kind="bitwise">
Benoit Perrot's avatar
Benoit Perrot committed
262
    <description>To execute an arithmetic right-shift of a word by a fixed number of bits.</description>
263
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
264
265
266
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src" />
      <attribute type="Exp" name="imm" />
267
268
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
269
270
271
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
272
273
    </syntax>
    <syntax alias="srav">
Benoit Perrot's avatar
Benoit Perrot committed
274
275
276
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
277
278
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
279

Benoit Perrot's avatar
Benoit Perrot committed
280
  <instruction opcode="srav" level="native" kind="bitwise">
Benoit Perrot's avatar
Benoit Perrot committed
281
    <description>To execute an arithmetic right-shift of a word by a variable number of bits.</description>
282
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
283
284
285
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
286
287
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
288
289
290
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
291
292
293
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
294
  <instruction opcode="srl" level="native" kind="bitwise">
Benoit Perrot's avatar
Benoit Perrot committed
295
    <description>To execute a logical right-shift of a word by a fixed number of bits.</description>
296
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
297
298
299
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src" />
      <attribute type="Exp" name="imm" />
300
301
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
302
303
304
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
305
306
    </syntax>
    <syntax alias="srlv">
Benoit Perrot's avatar
Benoit Perrot committed
307
308
309
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
310
311
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
312

Benoit Perrot's avatar
Benoit Perrot committed
313
  <instruction opcode="srlv" level="native" kind="bitwise">
Benoit Perrot's avatar
Benoit Perrot committed
314
    <description>To execute a logical right-shift of a word by a variable number of bits.</description>
315
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
316
317
318
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
319
320
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
321
322
323
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
324
325
326
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
327
  <instruction opcode="rol" level="complex" kind="bitwise">
328
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
329
330
331
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
332
333
    </syntax>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
334
335
336
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
337
338
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
339

Benoit Perrot's avatar
Benoit Perrot committed
340
  <instruction opcode="ror" level="complex" kind="bitwise">
341
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
342
343
344
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
345
346
    </syntax>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
347
348
349
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
350
351
352
    </syntax>
  </instruction>

353

Benoit Perrot's avatar
Benoit Perrot committed
354
  <instruction opcode="and" level="native" kind="bitwise">
355
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
356
357
358
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
359
360
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
361
362
363
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
      <token kind="register" />
364
365
    </syntax>
    <syntax alias="andi">
Benoit Perrot's avatar
Benoit Perrot committed
366
367
368
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
      <token kind="immediate" />
369
370
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
371

Benoit Perrot's avatar
Benoit Perrot committed
372
  <instruction opcode="andi" level="native" kind="bitwise">
373
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
374
375
376
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src" />
      <attribute type="Exp" name="imm" />
377
378
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
379
380
381
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
382
383
384
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
385

Benoit Perrot's avatar
Benoit Perrot committed
386
  <instruction opcode="or" level="native" kind="bitwise">
387
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
388
389
390
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
391
392
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
393
394
395
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
      <token kind="register" />
396
397
    </syntax>
    <syntax alias="ori">
Benoit Perrot's avatar
Benoit Perrot committed
398
399
400
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
      <token kind="immediate" />
401
402
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
403

Benoit Perrot's avatar
Benoit Perrot committed
404
  <instruction opcode="ori" level="native" kind="bitwise">
405
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
406
407
408
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src" />
      <attribute type="Exp" name="imm" />
409
410
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
411
412
413
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
414
415
416
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
417
418

  <instruction opcode="xor" level="native" kind="bitwise">
419
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
420
421
422
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
423
424
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
425
426
427
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
      <token kind="register" />
428
    </syntax>
Benoit Perrot's avatar
Benoit Perrot committed
429
430
431
432
    <syntax alias="xori">
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
      <token kind="immediate" />
433
    </syntax>
434
435
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
436
  <instruction opcode="xori" level="native" kind="bitwise">
437
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
438
439
440
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src" />
      <attribute type="Exp" name="imm" />
441
442
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
443
444
445
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
446
447
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
448
449
450


  <instruction opcode="nor" level="native" kind="bitwise">
451
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
452
453
454
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
455
456
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
457
458
459
460
461
462
463
464
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
      <token kind="register" />
    </syntax>
    <syntax level="complex">
      <token kind="register" name="dest" />
      <token kind="register" default="@0" />
      <token kind="immediate" />
465
466
467
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
468

Benoit Perrot's avatar
Benoit Perrot committed
469
  <instruction opcode="not" level="pseudo" kind="bitwise">
470
    <syntax alias="nor">
Benoit Perrot's avatar
Benoit Perrot committed
471
472
473
      <token kind="register" name="dest" />
      <token kind="register" default="@0"/>
      <token kind="hidden" value="* new Register(Register::general, Cpu::zero)" />
474
475
476
477
    </syntax>
  </instruction>


Benoit Perrot's avatar
Benoit Perrot committed
478
  <!-- Comparison instructions -->
Benoit Perrot's avatar
Benoit Perrot committed
479
  <instruction opcode="seq" level="complex" kind="comparison">
480
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
481
482
483
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
484
    </syntax>
485
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
486
487
488
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
489
    </syntax>
490
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
491
  <instruction opcode="sne" level="complex" kind="comparison">
492
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
493
494
495
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
496
    </syntax>
497
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
498
499
500
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
501
502
    </syntax>
  </instruction>
503

Benoit Perrot's avatar
Benoit Perrot committed
504
  <instruction opcode="sge" level="complex" kind="comparison">
505
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
506
507
508
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
509
510
    </syntax>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
511
512
513
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
514
515
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
516
  <instruction opcode="sgeu" level="complex" kind="comparison">
517
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
518
519
520
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
521
522
    </syntax>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
523
524
525
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
526
527
528
    </syntax>
  </instruction>  

Benoit Perrot's avatar
Benoit Perrot committed
529
  <instruction opcode="sgt" level="complex" kind="comparison">
530
    <syntax alias="slt">
Benoit Perrot's avatar
Benoit Perrot committed
531
532
533
      <token kind="register" />
      <token kind="register" name="src1" value="@2"/>
      <token kind="register" name="src2" value="@1"/>
534
535
    </syntax>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
536
537
538
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
539
540
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
541
  <instruction opcode="sgtu" level="complex" kind="comparison">
542
    <syntax alias="sltu">
Benoit Perrot's avatar
Benoit Perrot committed
543
544
545
      <token kind="register" />
      <token kind="register" name="src1" value="@2"/>
      <token kind="register" name="src2" value="@1"/>
546
547
    </syntax>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
548
549
550
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
551
552
553
    </syntax>
  </instruction>  

Benoit Perrot's avatar
Benoit Perrot committed
554
  <instruction opcode="sle" level="complex" kind="comparison">
555
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
556
557
558
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
559
560
    </syntax>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
561
562
563
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
564
565
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
566
  <instruction opcode="sleu" level="complex" kind="comparison">
567
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
568
569
570
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
571
572
    </syntax>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
573
574
575
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
576
577
578
    </syntax>
  </instruction>  

Benoit Perrot's avatar
Benoit Perrot committed
579
  <instruction opcode="slt" level="native" kind="comparison">
580
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
581
582
583
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
584
585
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
586
587
588
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
589
    </syntax>
590
    <syntax alias="slti">
Benoit Perrot's avatar
Benoit Perrot committed
591
592
593
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
594
    </syntax>
595
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
596
  <instruction opcode="slti" level="native" kind="comparison">
597
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
598
599
600
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src" />
      <attribute type="Exp" name="imm" />
601
602
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
603
604
605
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
606
607
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
608
  <instruction opcode="sltu" level="native" kind="comparison">
609
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
610
611
612
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src1" />
      <attribute type="Register" name="src2" />
613
    </format>
614
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
615
616
617
      <token kind="register" />
      <token kind="register" />
      <token kind="register" />
618
    </syntax>
619
    <syntax alias="sltiu">
Benoit Perrot's avatar
Benoit Perrot committed
620
621
622
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
623
624
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
625
  <instruction opcode="sltiu" level="native" kind="comparison">
626
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
627
628
629
      <attribute type="Register" name="dest" />
      <attribute type="Register" name="src" />
      <attribute type="Exp" name="imm" />
630
    </format>
631
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
632
633
634
      <token kind="register" />
      <token kind="register" />
      <token kind="immediate" />
635
636
637
638
    </syntax>
  </instruction>


Benoit Perrot's avatar
Benoit Perrot committed
639
  <!-- Branch instructions -->
Benoit Perrot's avatar
Benoit Perrot committed
640
  <instruction opcode="beq" level="native" kind="branch">
641
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
642
643
644
      <attribute type="Register" name="src1"/>
      <attribute type="Register" name="src2"/>
      <attribute type="Exp" name="label"/>
645
646
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
647
648
649
      <token kind="register" />
      <token kind="register" />
      <token kind="label" />
650
    </syntax>
651
    <syntax level="complex">
Benoit Perrot's avatar
Benoit Perrot committed
652
653
654
      <token kind="register" />
      <token kind="immediate" />
      <token kind="label" />
655
    </syntax>
656
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
657
  <instruction opcode="beqz" level="pseudo" kind="branch">
658
    <syntax alias="beq">
Benoit Perrot's avatar
Benoit Perrot committed
659
660
661
      <token kind="register" />
      <token kind="hidden" value="* new Register(Register::general, Cpu::zero)"/>
      <token kind="label" />
662
663
    </syntax>
  </instruction>
664

Benoit Perrot's avatar
Benoit Perrot committed
665
  <instruction opcode="bne" level="native" kind="branch">
666
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
667
668
669
      <attribute type="Register" name="src1"/>
      <attribute type="Register" name="src2"/>
      <attribute type="Exp" name="label"/>
670
671
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
672
673
674
      <token kind="register" />
      <token kind="register" />
      <token kind="label" />
675
    </syntax>
676
    <syntax level="complex">
Benoit Perrot's avatar
Benoit Perrot committed
677
678
679
      <token kind="register" />
      <token kind="immediate" />
      <token kind="label" />
680
681
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
682
  <instruction opcode="bnez" level="pseudo" kind="branch">
683
    <syntax alias="bne">
Benoit Perrot's avatar
Benoit Perrot committed
684
685
686
      <token kind="register" />
      <token kind="hidden" value="* new Register(Register::general, Cpu::zero)"/>
      <token kind="label" />
687
    </syntax>
688
689
  </instruction>

690

Benoit Perrot's avatar
Benoit Perrot committed
691
  <instruction opcode="bge" level="complex" kind="branch">
692
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
693
694
695
      <token kind="register" />
      <token kind="register" />
      <token kind="label" />
696
    </syntax>
Benoit Perrot's avatar
Benoit Perrot committed
697
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
698
699
700
      <token kind="register" />
      <token kind="immediate" />
      <token kind="label" />
Benoit Perrot's avatar
Benoit Perrot committed
701
    </syntax>
702
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
703
  <instruction opcode="bgeu" level="complex" kind="branch">
704
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
705
706
707
      <token kind="register" />
      <token kind="register" />
      <token kind="label" />
708
    </syntax>
Benoit Perrot's avatar
Benoit Perrot committed
709
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
710
711
712
      <token kind="register" />
      <token kind="immediate" />
      <token kind="label" />
Benoit Perrot's avatar
Benoit Perrot committed
713
    </syntax>
714
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
715
  <instruction opcode="bgez" level="native" kind="branch">
716
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
717
718
      <attribute type="Register" name="src"/>
      <attribute type="Exp" name="label"/>
719
720
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
721
722
      <token kind="register" />
      <token kind="label" />
723
724
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
725
  <instruction opcode="bgezal" level="native" kind="branch">
726
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
727
728
      <attribute type="Register" name="src"/>
      <attribute type="Exp" name="label"/>
729
730
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
731
732
      <token kind="register" />
      <token kind="label" />
733
734
735
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
736
  <instruction opcode="bgt" level="complex" kind="branch">
737
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
738
739
740
      <token kind="register" />
      <token kind="register" />
      <token kind="label" />
741
    </syntax>
Benoit Perrot's avatar
Benoit Perrot committed
742
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
743
744
745
      <token kind="register" />
      <token kind="immediate" />
      <token kind="label" />
Benoit Perrot's avatar
Benoit Perrot committed
746
    </syntax>
747
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
748
  <instruction opcode="bgtu" level="complex" kind="branch">
749
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
750
751
752
      <token kind="register" />
      <token kind="register" />
      <token kind="label" />
753
    </syntax>
Benoit Perrot's avatar
Benoit Perrot committed
754
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
755
756
757
      <token kind="register" />
      <token kind="immediate" />
      <token kind="label" />
Benoit Perrot's avatar
Benoit Perrot committed
758
    </syntax>
759
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
760
  <instruction opcode="bgtz" level="native" kind="branch">
761
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
762
763
      <attribute type="Register" name="src"/>
      <attribute type="Exp" name="label"/>
764
765
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
766
767
      <token kind="register" />
      <token kind="label" />
768
769
770
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
771
  <instruction opcode="ble" level="complex" kind="branch">
772
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
773
774
775
      <token kind="register" />
      <token kind="register" />
      <token kind="label" />
776
    </syntax>
Benoit Perrot's avatar
Benoit Perrot committed
777
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
778
779
780
      <token kind="register" />
      <token kind="immediate" />
      <token kind="label" />
Benoit Perrot's avatar
Benoit Perrot committed
781
    </syntax>
782
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
783
  <instruction opcode="bleu" level="complex" kind="branch">
784
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
785
786
787
      <token kind="register" />
      <token kind="register" />
      <token kind="label" />
788
    </syntax>
Benoit Perrot's avatar
Benoit Perrot committed
789
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
790
791
792
      <token kind="register" />
      <token kind="immediate" />
      <token kind="label" />
Benoit Perrot's avatar
Benoit Perrot committed
793
    </syntax>
794
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
795
  <instruction opcode="blez" level="native" kind="branch">
796
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
797
798
      <attribute type="Register" name="src"/>
      <attribute type="Exp" name="label"/>
799
800
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
801
802
      <token kind="register" />
      <token kind="label" />
803
804
805
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
806
  <instruction opcode="blt" level="complex" kind="branch">
807
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
808
809
810
      <token kind="register" />
      <token kind="register" />
      <token kind="label" />
811
    </syntax>
Benoit Perrot's avatar
Benoit Perrot committed
812
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
813
814
815
      <token kind="register" />
      <token kind="immediate" />
      <token kind="label" />
Benoit Perrot's avatar
Benoit Perrot committed
816
    </syntax>
817
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
818
  <instruction opcode="bltu" level="complex" kind="branch">
819
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
820
821
822
      <token kind="register" />
      <token kind="register" />
      <token kind="label" />
823
    </syntax>
Benoit Perrot's avatar
Benoit Perrot committed
824
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
825
826
827
      <token kind="register" />
      <token kind="immediate" />
      <token kind="label" />
Benoit Perrot's avatar
Benoit Perrot committed
828
    </syntax>
829
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
830
  <instruction opcode="bltz" level="native" kind="branch">
831
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
832
833
      <attribute type="Register" name="src"/>
      <attribute type="Exp" name="label"/>
834
835
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
836
837
      <token kind="register" />
      <token kind="label" />
838
839
    </syntax>
  </instruction>
Benoit Perrot's avatar
Benoit Perrot committed
840
  <instruction opcode="bltzal" level="native" kind="branch">
841
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
842
843
      <attribute type="Register" name="src"/>
      <attribute type="Exp" name="label"/>
844
845
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
846
847
      <token kind="register" />
      <token kind="label" />
848
849
850
851
852
    </syntax>
  </instruction>



Benoit Perrot's avatar
Benoit Perrot committed
853
  <instruction opcode="j" level="native" kind="branch">
854
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
855
      <attribute type="Exp" name="label" />
856
857
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
858
      <token kind="label" />
859
860
861
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
862
  <instruction opcode="jr" level="native" kind="branch">
863
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
864
      <attribute type="Register" name="dest" />
865
866
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
867
      <token kind="register" />
868
869
870
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
871
  <instruction opcode="jal" level="native" kind="branch">
872
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
873
      <attribute type="Exp" name="label" />
874
875
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
876
      <token kind="label" />
877
878
879
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
880
  <instruction opcode="jalr" level="native" kind="branch">
881
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
882
      <attribute type="Register" name="dest" />
883
884
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
885
      <token kind="register" />
886
887
888
889
    </syntax>
  </instruction>


Benoit Perrot's avatar
Benoit Perrot committed
890
  <!-- Load instructions -->
Benoit Perrot's avatar
Benoit Perrot committed
891
  <instruction opcode="lw" level="native" kind="load">
892
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
893
894
895
      <attribute type="Register" name="dest" />
      <attribute type="Exp" name="offset" />
      <attribute type="Register" name="base" />
896
897
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
898
899
900
      <token kind="register" />
      <token kind="immediate" default="* new IntExp(0)" />
      <token kind="address" />
901
902
903
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
904
  <instruction opcode="lb" level="native" kind="load">
905
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
906
907
908
      <attribute type="Register" name="dest" />
      <attribute type="Exp" name="offset" />
      <attribute type="Register" name="base" />
909
910
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
911
912
913
      <token kind="register" />
      <token kind="immediate" default="* new IntExp(0)" />
      <token kind="address" />
914
915
916
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
917
  <instruction opcode="lbu" level="native" kind="load">
918
    <format>
Benoit Perrot's avatar
Benoit Perrot committed
919
920
921
      <attribute type="Register" name="dest" />
      <attribute type="Exp" name="offset" />
      <attribute type="Register" name="base" />
922
923
    </format>
    <syntax>
Benoit Perrot's avatar
Benoit Perrot committed
924
925
926
      <token kind="register" />
      <token kind="immediate" default="* new IntExp(0)" />
      <token kind="address" />
927
928
929
    </syntax>
  </instruction>

Benoit Perrot's avatar
Benoit Perrot committed
930
  <instruction opcode="li" level="native" kind="load">
931
    <format>