blob: 8a924e9050931c438c672ec3614bde46cdc792d6 [file] [log] [blame]
Zoran Jovanovic87d13e52014-03-20 10:18:24 +00001//===----------------------------------------------------------------------===//
2// MicroMIPS Base Classes
3//===----------------------------------------------------------------------===//
4
5//
6// Base class for MicroMips instructions.
7// This class does not depend on the instruction size.
8//
9class MicroMipsInstBase<dag outs, dag ins, string asmstr, list<dag> pattern,
10 InstrItinClass itin, Format f> : Instruction
11{
12 let Namespace = "Mips";
13 let DecoderNamespace = "MicroMips";
14
15 let OutOperandList = outs;
16 let InOperandList = ins;
17
18 let AsmString = asmstr;
19 let Pattern = pattern;
20 let Itinerary = itin;
21
22 let Predicates = [InMicroMips];
23
24 Format Form = f;
25}
26
27//
28// Base class for MicroMIPS 16-bit instructions.
29//
30class MicroMipsInst16<dag outs, dag ins, string asmstr, list<dag> pattern,
31 InstrItinClass itin, Format f> :
32 MicroMipsInstBase<outs, ins, asmstr, pattern, itin, f>
33{
34 let Size = 2;
35 field bits<16> Inst;
36 field bits<16> SoftFail = 0;
37 bits<6> Opcode = 0x0;
38}
39
40//===----------------------------------------------------------------------===//
41// MicroMIPS 16-bit Instruction Formats
42//===----------------------------------------------------------------------===//
43
Zoran Jovanovic592239d2014-10-21 08:44:58 +000044class ARITH_FM_MM16<bit funct> {
45 bits<3> rd;
46 bits<3> rt;
47 bits<3> rs;
48
49 bits<16> Inst;
50
51 let Inst{15-10} = 0x01;
52 let Inst{9-7} = rd;
53 let Inst{6-4} = rt;
54 let Inst{3-1} = rs;
55 let Inst{0} = funct;
56}
57
Zoran Jovanovic88531712014-11-05 17:31:00 +000058class ANDI_FM_MM16<bits<6> funct> {
59 bits<3> rd;
60 bits<3> rs;
61 bits<4> imm;
62
63 bits<16> Inst;
64
65 let Inst{15-10} = funct;
66 let Inst{9-7} = rd;
67 let Inst{6-4} = rs;
68 let Inst{3-0} = imm;
69}
70
Zoran Jovanovic81ceebc2014-10-21 08:32:40 +000071class LOGIC_FM_MM16<bits<4> funct> {
72 bits<3> rt;
73 bits<3> rs;
74
75 bits<16> Inst;
76
77 let Inst{15-10} = 0x11;
78 let Inst{9-6} = funct;
79 let Inst{5-3} = rt;
80 let Inst{2-0} = rs;
81}
82
Zoran Jovanovic4a00fdc2014-10-23 10:42:01 +000083class SHIFT_FM_MM16<bits<1> funct> {
84 bits<3> rd;
85 bits<3> rt;
86 bits<3> shamt;
87
88 bits<16> Inst;
89
90 let Inst{15-10} = 0x09;
91 let Inst{9-7} = rd;
92 let Inst{6-4} = rt;
93 let Inst{3-1} = shamt;
94 let Inst{0} = funct;
95}
96
Zoran Jovanovicbac36192014-10-23 11:06:34 +000097class ADDIUR2_FM_MM16 {
98 bits<3> rd;
99 bits<3> rs;
100 bits<3> imm;
101
102 bits<16> Inst;
103
104 let Inst{15-10} = 0x1b;
105 let Inst{9-7} = rd;
106 let Inst{6-4} = rs;
107 let Inst{3-1} = imm;
108 let Inst{0} = 0;
109}
110
Jozef Koleke8c9d1e2014-11-24 14:39:13 +0000111class LOAD_STORE_FM_MM16<bits<6> op> {
112 bits<3> rt;
113 bits<7> addr;
114
115 bits<16> Inst;
116
117 let Inst{15-10} = op;
118 let Inst{9-7} = rt;
119 let Inst{6-4} = addr{6-4};
120 let Inst{3-0} = addr{3-0};
121}
122
Zoran Jovanovicb26f8892014-10-10 13:45:34 +0000123class ADDIUS5_FM_MM16 {
124 bits<5> rd;
125 bits<4> imm;
126
127 bits<16> Inst;
128
129 let Inst{15-10} = 0x13;
130 let Inst{9-5} = rd;
131 let Inst{4-1} = imm;
132 let Inst{0} = 0;
133}
134
Zoran Jovanovic98bd58c2014-10-10 14:37:30 +0000135class ADDIUSP_FM_MM16 {
136 bits<9> imm;
137
138 bits<16> Inst;
139
140 let Inst{15-10} = 0x13;
141 let Inst{9-1} = imm;
142 let Inst{0} = 1;
143}
144
Zoran Jovanovic87d13e52014-03-20 10:18:24 +0000145class MOVE_FM_MM16<bits<6> funct> {
146 bits<5> rs;
147 bits<5> rd;
148
149 bits<16> Inst;
150
151 let Inst{15-10} = funct;
152 let Inst{9-5} = rd;
153 let Inst{4-0} = rs;
154}
155
Zoran Jovanovic9bda2f12014-10-23 10:59:24 +0000156class LI_FM_MM16 {
157 bits<3> rd;
158 bits<7> imm;
159
160 bits<16> Inst;
161
162 let Inst{15-10} = 0x3b;
163 let Inst{9-7} = rd;
164 let Inst{6-0} = imm;
165}
166
Zoran Jovanovic87d13e52014-03-20 10:18:24 +0000167class JALR_FM_MM16<bits<5> op> {
168 bits<5> rs;
169
170 bits<16> Inst;
171
172 let Inst{15-10} = 0x11;
173 let Inst{9-5} = op;
174 let Inst{4-0} = rs;
175}
176
Zoran Jovanoviccabf0f42014-04-03 12:47:34 +0000177class MFHILO_FM_MM16<bits<5> funct> {
178 bits<5> rd;
179
180 bits<16> Inst;
181
182 let Inst{15-10} = 0x11;
183 let Inst{9-5} = funct;
184 let Inst{4-0} = rd;
185}
186
Zoran Jovanovicc74e3eb92014-09-12 14:29:54 +0000187class JRADDIUSP_FM_MM16<bits<5> op> {
188 bits<5> rs;
189 bits<5> imm;
190
191 bits<16> Inst;
192
193 let Inst{15-10} = 0x11;
194 let Inst{9-5} = op;
195 let Inst{4-0} = imm;
196}
197
Zoran Jovanovic42b84442014-10-23 11:13:59 +0000198class ADDIUR1SP_FM_MM16 {
199 bits<3> rd;
200 bits<6> imm;
201
202 bits<16> Inst;
203
204 let Inst{15-10} = 0x1b;
205 let Inst{9-7} = rd;
206 let Inst{6-1} = imm;
207 let Inst{0} = 1;
208}
209
Zoran Jovanovic87d13e52014-03-20 10:18:24 +0000210//===----------------------------------------------------------------------===//
211// MicroMIPS 32-bit Instruction Formats
212//===----------------------------------------------------------------------===//
213
Akira Hatanakabe6a8182013-04-19 19:03:11 +0000214class MMArch {
215 string Arch = "micromips";
216 list<dag> Pattern = [];
217}
218
219class ADD_FM_MM<bits<6> op, bits<10> funct> : MMArch {
220 bits<5> rt;
221 bits<5> rs;
222 bits<5> rd;
223
224 bits<32> Inst;
225
226 let Inst{31-26} = op;
227 let Inst{25-21} = rt;
228 let Inst{20-16} = rs;
229 let Inst{15-11} = rd;
230 let Inst{10} = 0;
231 let Inst{9-0} = funct;
232}
233
234class ADDI_FM_MM<bits<6> op> : MMArch {
235 bits<5> rs;
236 bits<5> rt;
237 bits<16> imm16;
238
239 bits<32> Inst;
240
241 let Inst{31-26} = op;
242 let Inst{25-21} = rt;
243 let Inst{20-16} = rs;
244 let Inst{15-0} = imm16;
245}
246
247class SLTI_FM_MM<bits<6> op> : MMArch {
248 bits<5> rt;
249 bits<5> rs;
250 bits<16> imm16;
251
252 bits<32> Inst;
253
254 let Inst{31-26} = op;
Zoran Jovanovicf4d4d782013-11-15 08:07:34 +0000255 let Inst{25-21} = rt;
256 let Inst{20-16} = rs;
Akira Hatanakabe6a8182013-04-19 19:03:11 +0000257 let Inst{15-0} = imm16;
258}
259
260class LUI_FM_MM : MMArch {
261 bits<5> rt;
262 bits<16> imm16;
263
264 bits<32> Inst;
265
266 let Inst{31-26} = 0x10;
267 let Inst{25-21} = 0xd;
268 let Inst{20-16} = rt;
269 let Inst{15-0} = imm16;
270}
271
272class MULT_FM_MM<bits<10> funct> : MMArch {
273 bits<5> rs;
274 bits<5> rt;
275
276 bits<32> Inst;
277
278 let Inst{31-26} = 0x00;
279 let Inst{25-21} = rt;
280 let Inst{20-16} = rs;
281 let Inst{15-6} = funct;
282 let Inst{5-0} = 0x3c;
283}
Akira Hatanakacd9b74a2013-04-25 01:11:15 +0000284
285class SRA_FM_MM<bits<10> funct, bit rotate> : MMArch {
286 bits<5> rd;
287 bits<5> rt;
288 bits<5> shamt;
289
290 bits<32> Inst;
291
292 let Inst{31-26} = 0;
293 let Inst{25-21} = rd;
294 let Inst{20-16} = rt;
295 let Inst{15-11} = shamt;
296 let Inst{10} = rotate;
297 let Inst{9-0} = funct;
298}
299
300class SRLV_FM_MM<bits<10> funct, bit rotate> : MMArch {
301 bits<5> rd;
302 bits<5> rt;
303 bits<5> rs;
304
305 bits<32> Inst;
306
307 let Inst{31-26} = 0;
308 let Inst{25-21} = rt;
309 let Inst{20-16} = rs;
310 let Inst{15-11} = rd;
311 let Inst{10} = rotate;
312 let Inst{9-0} = funct;
313}
Akira Hatanakaf0aa6c92013-04-25 01:21:25 +0000314
315class LW_FM_MM<bits<6> op> : MMArch {
316 bits<5> rt;
317 bits<21> addr;
318
319 bits<32> Inst;
320
321 let Inst{31-26} = op;
322 let Inst{25-21} = rt;
323 let Inst{20-16} = addr{20-16};
324 let Inst{15-0} = addr{15-0};
325}
Jack Carter97700972013-08-13 20:19:16 +0000326
327class LWL_FM_MM<bits<4> funct> {
328 bits<5> rt;
329 bits<21> addr;
330
331 bits<32> Inst;
332
333 let Inst{31-26} = 0x18;
334 let Inst{25-21} = rt;
335 let Inst{20-16} = addr{20-16};
336 let Inst{15-12} = funct;
337 let Inst{11-0} = addr{11-0};
338}
Vladimir Medice0fbb442013-09-06 12:41:17 +0000339
340class CMov_F_I_FM_MM<bits<7> func> : MMArch {
341 bits<5> rd;
342 bits<5> rs;
343 bits<3> fcc;
344
345 bits<32> Inst;
346
347 let Inst{31-26} = 0x15;
348 let Inst{25-21} = rd;
349 let Inst{20-16} = rs;
350 let Inst{15-13} = fcc;
351 let Inst{12-6} = func;
352 let Inst{5-0} = 0x3b;
353}
Vladimir Medic457ba562013-09-06 12:53:21 +0000354
355class MTLO_FM_MM<bits<10> funct> : MMArch {
356 bits<5> rs;
357
358 bits<32> Inst;
359
360 let Inst{31-26} = 0x00;
361 let Inst{25-21} = 0x00;
362 let Inst{20-16} = rs;
363 let Inst{15-6} = funct;
364 let Inst{5-0} = 0x3c;
365}
366
367class MFLO_FM_MM<bits<10> funct> : MMArch {
368 bits<5> rd;
369
370 bits<32> Inst;
371
372 let Inst{31-26} = 0x00;
373 let Inst{25-21} = 0x00;
374 let Inst{20-16} = rd;
375 let Inst{15-6} = funct;
376 let Inst{5-0} = 0x3c;
377}
Zoran Jovanovicab852782013-09-14 06:49:25 +0000378
379class CLO_FM_MM<bits<10> funct> : MMArch {
380 bits<5> rd;
381 bits<5> rs;
382
383 bits<32> Inst;
384
385 let Inst{31-26} = 0x00;
386 let Inst{25-21} = rd;
387 let Inst{20-16} = rs;
388 let Inst{15-6} = funct;
389 let Inst{5-0} = 0x3c;
390}
391
392class SEB_FM_MM<bits<10> funct> : MMArch {
393 bits<5> rd;
394 bits<5> rt;
395
396 bits<32> Inst;
397
398 let Inst{31-26} = 0x00;
399 let Inst{25-21} = rd;
400 let Inst{20-16} = rt;
401 let Inst{15-6} = funct;
402 let Inst{5-0} = 0x3c;
403}
404
405class EXT_FM_MM<bits<6> funct> : MMArch {
406 bits<5> rt;
407 bits<5> rs;
408 bits<5> pos;
409 bits<5> size;
410
411 bits<32> Inst;
412
413 let Inst{31-26} = 0x00;
414 let Inst{25-21} = rt;
415 let Inst{20-16} = rs;
416 let Inst{15-11} = size;
417 let Inst{10-6} = pos;
418 let Inst{5-0} = funct;
419}
Zoran Jovanovic507e0842013-10-29 16:38:59 +0000420
421class J_FM_MM<bits<6> op> : MMArch {
422 bits<26> target;
423
424 bits<32> Inst;
425
426 let Inst{31-26} = op;
427 let Inst{25-0} = target;
428}
429
430class JR_FM_MM<bits<8> funct> : MMArch {
431 bits<5> rs;
432
433 bits<32> Inst;
434
435 let Inst{31-21} = 0x00;
436 let Inst{20-16} = rs;
437 let Inst{15-14} = 0x0;
438 let Inst{13-6} = funct;
439 let Inst{5-0} = 0x3c;
440}
441
Zoran Jovanovic87d13e52014-03-20 10:18:24 +0000442class JALR_FM_MM<bits<10> funct> {
Zoran Jovanovic507e0842013-10-29 16:38:59 +0000443 bits<5> rs;
444 bits<5> rd;
445
446 bits<32> Inst;
447
448 let Inst{31-26} = 0x00;
449 let Inst{25-21} = rd;
450 let Inst{20-16} = rs;
451 let Inst{15-6} = funct;
452 let Inst{5-0} = 0x3c;
453}
Zoran Jovanovic8a80aa72013-11-04 14:53:22 +0000454
455class BEQ_FM_MM<bits<6> op> : MMArch {
456 bits<5> rs;
457 bits<5> rt;
458 bits<16> offset;
459
460 bits<32> Inst;
461
462 let Inst{31-26} = op;
463 let Inst{25-21} = rt;
464 let Inst{20-16} = rs;
465 let Inst{15-0} = offset;
466}
467
468class BGEZ_FM_MM<bits<5> funct> : MMArch {
469 bits<5> rs;
470 bits<16> offset;
471
472 bits<32> Inst;
473
474 let Inst{31-26} = 0x10;
475 let Inst{25-21} = funct;
476 let Inst{20-16} = rs;
477 let Inst{15-0} = offset;
478}
479
480class BGEZAL_FM_MM<bits<5> funct> : MMArch {
481 bits<5> rs;
482 bits<16> offset;
483
484 bits<32> Inst;
485
486 let Inst{31-26} = 0x10;
487 let Inst{25-21} = funct;
488 let Inst{20-16} = rs;
489 let Inst{15-0} = offset;
490}
Zoran Jovanovicc18b6d12013-11-07 14:35:24 +0000491
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000492class SYNC_FM_MM : MMArch {
493 bits<5> stype;
494
495 bits<32> Inst;
496
497 let Inst{31-26} = 0x00;
498 let Inst{25-21} = 0x0;
499 let Inst{20-16} = stype;
500 let Inst{15-6} = 0x1ad;
501 let Inst{5-0} = 0x3c;
502}
503
504class BRK_FM_MM : MMArch {
505 bits<10> code_1;
506 bits<10> code_2;
507 bits<32> Inst;
508 let Inst{31-26} = 0x0;
509 let Inst{25-16} = code_1;
510 let Inst{15-6} = code_2;
511 let Inst{5-0} = 0x07;
512}
513
514class SYS_FM_MM : MMArch {
515 bits<10> code_;
516 bits<32> Inst;
517 let Inst{31-26} = 0x0;
518 let Inst{25-16} = code_;
Zoran Jovanovic7c6c36d2014-02-28 18:17:08 +0000519 let Inst{15-6} = 0x22d;
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000520 let Inst{5-0} = 0x3c;
521}
522
Zoran Jovanovica0f53282014-03-20 10:41:37 +0000523class WAIT_FM_MM {
524 bits<10> code_;
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000525 bits<32> Inst;
526
527 let Inst{31-26} = 0x00;
Zoran Jovanovica0f53282014-03-20 10:41:37 +0000528 let Inst{25-16} = code_;
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000529 let Inst{15-6} = 0x24d;
530 let Inst{5-0} = 0x3c;
531}
532
533class ER_FM_MM<bits<10> funct> : MMArch {
534 bits<32> Inst;
535
536 let Inst{31-26} = 0x00;
537 let Inst{25-16} = 0x00;
538 let Inst{15-6} = funct;
539 let Inst{5-0} = 0x3c;
540}
541
542class EI_FM_MM<bits<10> funct> : MMArch {
543 bits<32> Inst;
544 bits<5> rt;
545
546 let Inst{31-26} = 0x00;
547 let Inst{25-21} = 0x00;
548 let Inst{20-16} = rt;
549 let Inst{15-6} = funct;
550 let Inst{5-0} = 0x3c;
551}
552
Zoran Jovanovicc18b6d12013-11-07 14:35:24 +0000553class TEQ_FM_MM<bits<6> funct> : MMArch {
554 bits<5> rs;
555 bits<5> rt;
556 bits<4> code_;
557
558 bits<32> Inst;
559
560 let Inst{31-26} = 0x00;
561 let Inst{25-21} = rt;
562 let Inst{20-16} = rs;
563 let Inst{15-12} = code_;
564 let Inst{11-6} = funct;
565 let Inst{5-0} = 0x3c;
566}
Zoran Jovanovicccb70ca2013-11-13 13:15:03 +0000567
568class TEQI_FM_MM<bits<5> funct> : MMArch {
569 bits<5> rs;
570 bits<16> imm16;
571
572 bits<32> Inst;
573
574 let Inst{31-26} = 0x10;
575 let Inst{25-21} = funct;
576 let Inst{20-16} = rs;
577 let Inst{15-0} = imm16;
578}
Zoran Jovanovicff9d5f32013-12-19 16:12:56 +0000579
580class LL_FM_MM<bits<4> funct> {
581 bits<5> rt;
582 bits<21> addr;
583
584 bits<32> Inst;
585
586 let Inst{31-26} = 0x18;
587 let Inst{25-21} = rt;
588 let Inst{20-16} = addr{20-16};
589 let Inst{15-12} = funct;
590 let Inst{11-0} = addr{11-0};
591}
Zoran Jovanovicce024862013-12-20 15:44:08 +0000592
593class ADDS_FM_MM<bits<2> fmt, bits<8> funct> : MMArch {
594 bits<5> ft;
595 bits<5> fs;
596 bits<5> fd;
597
598 bits<32> Inst;
599
600 let Inst{31-26} = 0x15;
601 let Inst{25-21} = ft;
602 let Inst{20-16} = fs;
603 let Inst{15-11} = fd;
604 let Inst{10} = 0;
605 let Inst{9-8} = fmt;
606 let Inst{7-0} = funct;
607
608 list<dag> Pattern = [];
609}
610
611class LWXC1_FM_MM<bits<9> funct> : MMArch {
612 bits<5> fd;
613 bits<5> base;
614 bits<5> index;
615
616 bits<32> Inst;
617
618 let Inst{31-26} = 0x15;
619 let Inst{25-21} = index;
620 let Inst{20-16} = base;
621 let Inst{15-11} = fd;
622 let Inst{10-9} = 0x0;
623 let Inst{8-0} = funct;
624}
625
626class SWXC1_FM_MM<bits<9> funct> : MMArch {
627 bits<5> fs;
628 bits<5> base;
629 bits<5> index;
630
631 bits<32> Inst;
632
633 let Inst{31-26} = 0x15;
634 let Inst{25-21} = index;
635 let Inst{20-16} = base;
636 let Inst{15-11} = fs;
637 let Inst{10-9} = 0x0;
638 let Inst{8-0} = funct;
639}
640
641class CEQS_FM_MM<bits<2> fmt> : MMArch {
642 bits<5> fs;
643 bits<5> ft;
644 bits<4> cond;
645
646 bits<32> Inst;
647
648 let Inst{31-26} = 0x15;
649 let Inst{25-21} = ft;
650 let Inst{20-16} = fs;
651 let Inst{15-13} = 0x0; // cc
652 let Inst{12} = 0;
653 let Inst{11-10} = fmt;
654 let Inst{9-6} = cond;
655 let Inst{5-0} = 0x3c;
656}
657
658class BC1F_FM_MM<bits<5> tf> : MMArch {
659 bits<16> offset;
660
661 bits<32> Inst;
662
663 let Inst{31-26} = 0x10;
664 let Inst{25-21} = tf;
665 let Inst{20-18} = 0x0; // cc
666 let Inst{17-16} = 0x0;
667 let Inst{15-0} = offset;
668}
669
670class ROUND_W_FM_MM<bits<1> fmt, bits<8> funct> : MMArch {
671 bits<5> fd;
672 bits<5> fs;
673
674 bits<32> Inst;
675
676 let Inst{31-26} = 0x15;
677 let Inst{25-21} = fd;
678 let Inst{20-16} = fs;
679 let Inst{15} = 0;
680 let Inst{14} = fmt;
681 let Inst{13-6} = funct;
682 let Inst{5-0} = 0x3b;
683}
684
685class ABS_FM_MM<bits<2> fmt, bits<7> funct> : MMArch {
686 bits<5> fd;
687 bits<5> fs;
688
689 bits<32> Inst;
690
691 let Inst{31-26} = 0x15;
692 let Inst{25-21} = fd;
693 let Inst{20-16} = fs;
694 let Inst{15} = 0;
695 let Inst{14-13} = fmt;
696 let Inst{12-6} = funct;
697 let Inst{5-0} = 0x3b;
698}
Zoran Jovanovic8876be32013-12-25 10:09:27 +0000699
700class CMov_F_F_FM_MM<bits<9> func, bits<2> fmt> : MMArch {
701 bits<5> fd;
702 bits<5> fs;
703
704 bits<32> Inst;
705
706 let Inst{31-26} = 0x15;
707 let Inst{25-21} = fd;
708 let Inst{20-16} = fs;
709 let Inst{15-13} = 0x0; //cc
710 let Inst{12-11} = 0x0;
711 let Inst{10-9} = fmt;
712 let Inst{8-0} = func;
713}
714
715class CMov_I_F_FM_MM<bits<8> funct, bits<2> fmt> : MMArch {
716 bits<5> fd;
717 bits<5> fs;
718 bits<5> rt;
719
720 bits<32> Inst;
721
722 let Inst{31-26} = 0x15;
723 let Inst{25-21} = rt;
724 let Inst{20-16} = fs;
725 let Inst{15-11} = fd;
726 let Inst{9-8} = fmt;
727 let Inst{7-0} = funct;
728}
729
730class MFC1_FM_MM<bits<8> funct> : MMArch {
731 bits<5> rt;
732 bits<5> fs;
733
734 bits<32> Inst;
735
736 let Inst{31-26} = 0x15;
737 let Inst{25-21} = rt;
738 let Inst{20-16} = fs;
739 let Inst{15-14} = 0x0;
740 let Inst{13-6} = funct;
741 let Inst{5-0} = 0x3b;
742}
743
744class MADDS_FM_MM<bits<6> funct>: MMArch {
745 bits<5> ft;
746 bits<5> fs;
747 bits<5> fd;
748 bits<5> fr;
749
750 bits<32> Inst;
751
752 let Inst{31-26} = 0x15;
753 let Inst{25-21} = ft;
754 let Inst{20-16} = fs;
755 let Inst{15-11} = fd;
756 let Inst{10-6} = fr;
757 let Inst{5-0} = funct;
758}
Zoran Jovanovic73ff9482014-08-14 12:09:10 +0000759
760class COMPACT_BRANCH_FM_MM<bits<5> funct> {
761 bits<5> rs;
762 bits<16> offset;
763
764 bits<32> Inst;
765
766 let Inst{31-26} = 0x10;
767 let Inst{25-21} = funct;
768 let Inst{20-16} = rs;
769 let Inst{15-0} = offset;
770}
Zoran Jovanovic4e7ac4a2014-09-12 13:33:33 +0000771
772class COP0_TLB_FM_MM<bits<10> op> : MMArch {
773 bits<32> Inst;
774
775 let Inst{31-26} = 0x0;
776 let Inst{25-16} = 0x0;
777 let Inst{15-6} = op;
778 let Inst{5-0} = 0x3c;
779}
Jozef Kolekdc62fc42014-11-19 11:25:50 +0000780
781class SDBBP_FM_MM : MMArch {
782 bits<10> code_;
783
784 bits<32> Inst;
785
786 let Inst{31-26} = 0x0;
787 let Inst{25-16} = code_;
788 let Inst{15-6} = 0x36d;
789 let Inst{5-0} = 0x3c;
790}
791
792class RDHWR_FM_MM : MMArch {
793 bits<5> rt;
794 bits<5> rd;
795
796 bits<32> Inst;
797
798 let Inst{31-26} = 0x0;
799 let Inst{25-21} = rt;
800 let Inst{20-16} = rd;
801 let Inst{15-6} = 0x1ac;
802 let Inst{5-0} = 0x3c;
803}
Jozef Kolek5f95dd22014-11-19 11:39:12 +0000804
805class LWXS_FM_MM<bits<10> funct> {
806 bits<5> rd;
807 bits<5> base;
808 bits<5> index;
809
810 bits<32> Inst;
811
812 let Inst{31-26} = 0x0;
813 let Inst{25-21} = index;
814 let Inst{20-16} = base;
815 let Inst{15-11} = rd;
816 let Inst{10} = 0;
817 let Inst{9-0} = funct;
818}
Zoran Jovanovica4c4b5f2014-11-19 16:44:02 +0000819
820class LWM_FM_MM<bits<4> funct> : MMArch {
821 bits<5> rt;
822 bits<21> addr;
823
824 bits<32> Inst;
825
826 let Inst{31-26} = 0x8;
827 let Inst{25-21} = rt;
828 let Inst{20-16} = addr{20-16};
829 let Inst{15-12} = funct;
830 let Inst{11-0} = addr{11-0};
831}