blob: fdc365959c93e7fe70179b183c44ce705c572fb9 [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
Jozef Kolek12c69822014-12-23 16:16:33 +0000123class LOAD_STORE_SP_FM_MM16<bits<6> op> {
124 bits<5> rt;
125 bits<5> offset;
126
127 bits<16> Inst;
128
129 let Inst{15-10} = op;
130 let Inst{9-5} = rt;
131 let Inst{4-0} = offset;
132}
133
Zoran Jovanovicb26f8892014-10-10 13:45:34 +0000134class ADDIUS5_FM_MM16 {
135 bits<5> rd;
136 bits<4> imm;
137
138 bits<16> Inst;
139
140 let Inst{15-10} = 0x13;
141 let Inst{9-5} = rd;
142 let Inst{4-1} = imm;
143 let Inst{0} = 0;
144}
145
Zoran Jovanovic98bd58c2014-10-10 14:37:30 +0000146class ADDIUSP_FM_MM16 {
147 bits<9> imm;
148
149 bits<16> Inst;
150
151 let Inst{15-10} = 0x13;
152 let Inst{9-1} = imm;
153 let Inst{0} = 1;
154}
155
Zoran Jovanovic87d13e52014-03-20 10:18:24 +0000156class MOVE_FM_MM16<bits<6> funct> {
157 bits<5> rs;
158 bits<5> rd;
159
160 bits<16> Inst;
161
162 let Inst{15-10} = funct;
163 let Inst{9-5} = rd;
164 let Inst{4-0} = rs;
165}
166
Zoran Jovanovic9bda2f12014-10-23 10:59:24 +0000167class LI_FM_MM16 {
168 bits<3> rd;
169 bits<7> imm;
170
171 bits<16> Inst;
172
173 let Inst{15-10} = 0x3b;
174 let Inst{9-7} = rd;
175 let Inst{6-0} = imm;
176}
177
Zoran Jovanovic87d13e52014-03-20 10:18:24 +0000178class JALR_FM_MM16<bits<5> op> {
179 bits<5> rs;
180
181 bits<16> Inst;
182
183 let Inst{15-10} = 0x11;
184 let Inst{9-5} = op;
185 let Inst{4-0} = rs;
186}
187
Zoran Jovanoviccabf0f42014-04-03 12:47:34 +0000188class MFHILO_FM_MM16<bits<5> funct> {
189 bits<5> rd;
190
191 bits<16> Inst;
192
193 let Inst{15-10} = 0x11;
194 let Inst{9-5} = funct;
195 let Inst{4-0} = rd;
196}
197
Zoran Jovanovicc74e3eb92014-09-12 14:29:54 +0000198class JRADDIUSP_FM_MM16<bits<5> op> {
199 bits<5> rs;
200 bits<5> imm;
201
202 bits<16> Inst;
203
204 let Inst{15-10} = 0x11;
205 let Inst{9-5} = op;
206 let Inst{4-0} = imm;
207}
208
Zoran Jovanovic42b84442014-10-23 11:13:59 +0000209class ADDIUR1SP_FM_MM16 {
210 bits<3> rd;
211 bits<6> imm;
212
213 bits<16> Inst;
214
215 let Inst{15-10} = 0x1b;
216 let Inst{9-7} = rd;
217 let Inst{6-1} = imm;
218 let Inst{0} = 1;
219}
220
Jozef Kolek56a6a7d2014-11-27 18:18:42 +0000221class BRKSDBBP16_FM_MM<bits<6> op> {
222 bits<4> code_;
223 bits<16> Inst;
224
225 let Inst{15-10} = 0x11;
226 let Inst{9-4} = op;
227 let Inst{3-0} = code_;
228}
229
Jozef Kolek9761e962015-01-12 12:03:34 +0000230class BEQNEZ_FM_MM16<bits<6> op> {
231 bits<3> rs;
232 bits<7> offset;
233
234 bits<16> Inst;
235
236 let Inst{15-10} = op;
237 let Inst{9-7} = rs;
238 let Inst{6-0} = offset;
239}
240
Zoran Jovanovic87d13e52014-03-20 10:18:24 +0000241//===----------------------------------------------------------------------===//
242// MicroMIPS 32-bit Instruction Formats
243//===----------------------------------------------------------------------===//
244
Akira Hatanakabe6a8182013-04-19 19:03:11 +0000245class MMArch {
246 string Arch = "micromips";
247 list<dag> Pattern = [];
248}
249
250class ADD_FM_MM<bits<6> op, bits<10> funct> : MMArch {
251 bits<5> rt;
252 bits<5> rs;
253 bits<5> rd;
254
255 bits<32> Inst;
256
257 let Inst{31-26} = op;
258 let Inst{25-21} = rt;
259 let Inst{20-16} = rs;
260 let Inst{15-11} = rd;
261 let Inst{10} = 0;
262 let Inst{9-0} = funct;
263}
264
265class ADDI_FM_MM<bits<6> op> : MMArch {
266 bits<5> rs;
267 bits<5> rt;
268 bits<16> imm16;
269
270 bits<32> Inst;
271
272 let Inst{31-26} = op;
273 let Inst{25-21} = rt;
274 let Inst{20-16} = rs;
275 let Inst{15-0} = imm16;
276}
277
278class SLTI_FM_MM<bits<6> op> : MMArch {
279 bits<5> rt;
280 bits<5> rs;
281 bits<16> imm16;
282
283 bits<32> Inst;
284
285 let Inst{31-26} = op;
Zoran Jovanovicf4d4d782013-11-15 08:07:34 +0000286 let Inst{25-21} = rt;
287 let Inst{20-16} = rs;
Akira Hatanakabe6a8182013-04-19 19:03:11 +0000288 let Inst{15-0} = imm16;
289}
290
291class LUI_FM_MM : MMArch {
292 bits<5> rt;
293 bits<16> imm16;
294
295 bits<32> Inst;
296
297 let Inst{31-26} = 0x10;
298 let Inst{25-21} = 0xd;
299 let Inst{20-16} = rt;
300 let Inst{15-0} = imm16;
301}
302
303class MULT_FM_MM<bits<10> funct> : MMArch {
304 bits<5> rs;
305 bits<5> rt;
306
307 bits<32> Inst;
308
309 let Inst{31-26} = 0x00;
310 let Inst{25-21} = rt;
311 let Inst{20-16} = rs;
312 let Inst{15-6} = funct;
313 let Inst{5-0} = 0x3c;
314}
Akira Hatanakacd9b74a2013-04-25 01:11:15 +0000315
316class SRA_FM_MM<bits<10> funct, bit rotate> : MMArch {
317 bits<5> rd;
318 bits<5> rt;
319 bits<5> shamt;
320
321 bits<32> Inst;
322
323 let Inst{31-26} = 0;
324 let Inst{25-21} = rd;
325 let Inst{20-16} = rt;
326 let Inst{15-11} = shamt;
327 let Inst{10} = rotate;
328 let Inst{9-0} = funct;
329}
330
331class SRLV_FM_MM<bits<10> funct, bit rotate> : MMArch {
332 bits<5> rd;
333 bits<5> rt;
334 bits<5> rs;
335
336 bits<32> Inst;
337
338 let Inst{31-26} = 0;
339 let Inst{25-21} = rt;
340 let Inst{20-16} = rs;
341 let Inst{15-11} = rd;
342 let Inst{10} = rotate;
343 let Inst{9-0} = funct;
344}
Akira Hatanakaf0aa6c92013-04-25 01:21:25 +0000345
346class LW_FM_MM<bits<6> op> : MMArch {
347 bits<5> rt;
348 bits<21> addr;
349
350 bits<32> Inst;
351
352 let Inst{31-26} = op;
353 let Inst{25-21} = rt;
354 let Inst{20-16} = addr{20-16};
355 let Inst{15-0} = addr{15-0};
356}
Jack Carter97700972013-08-13 20:19:16 +0000357
358class LWL_FM_MM<bits<4> funct> {
359 bits<5> rt;
360 bits<21> addr;
361
362 bits<32> Inst;
363
364 let Inst{31-26} = 0x18;
365 let Inst{25-21} = rt;
366 let Inst{20-16} = addr{20-16};
367 let Inst{15-12} = funct;
368 let Inst{11-0} = addr{11-0};
369}
Vladimir Medice0fbb442013-09-06 12:41:17 +0000370
371class CMov_F_I_FM_MM<bits<7> func> : MMArch {
372 bits<5> rd;
373 bits<5> rs;
374 bits<3> fcc;
375
376 bits<32> Inst;
377
378 let Inst{31-26} = 0x15;
379 let Inst{25-21} = rd;
380 let Inst{20-16} = rs;
381 let Inst{15-13} = fcc;
382 let Inst{12-6} = func;
383 let Inst{5-0} = 0x3b;
384}
Vladimir Medic457ba562013-09-06 12:53:21 +0000385
386class MTLO_FM_MM<bits<10> funct> : MMArch {
387 bits<5> rs;
388
389 bits<32> Inst;
390
391 let Inst{31-26} = 0x00;
392 let Inst{25-21} = 0x00;
393 let Inst{20-16} = rs;
394 let Inst{15-6} = funct;
395 let Inst{5-0} = 0x3c;
396}
397
398class MFLO_FM_MM<bits<10> funct> : MMArch {
399 bits<5> rd;
400
401 bits<32> Inst;
402
403 let Inst{31-26} = 0x00;
404 let Inst{25-21} = 0x00;
405 let Inst{20-16} = rd;
406 let Inst{15-6} = funct;
407 let Inst{5-0} = 0x3c;
408}
Zoran Jovanovicab852782013-09-14 06:49:25 +0000409
410class CLO_FM_MM<bits<10> funct> : MMArch {
411 bits<5> rd;
412 bits<5> rs;
413
414 bits<32> Inst;
415
416 let Inst{31-26} = 0x00;
417 let Inst{25-21} = rd;
418 let Inst{20-16} = rs;
419 let Inst{15-6} = funct;
420 let Inst{5-0} = 0x3c;
421}
422
423class SEB_FM_MM<bits<10> funct> : MMArch {
424 bits<5> rd;
425 bits<5> rt;
426
427 bits<32> Inst;
428
429 let Inst{31-26} = 0x00;
430 let Inst{25-21} = rd;
431 let Inst{20-16} = rt;
432 let Inst{15-6} = funct;
433 let Inst{5-0} = 0x3c;
434}
435
436class EXT_FM_MM<bits<6> funct> : MMArch {
437 bits<5> rt;
438 bits<5> rs;
439 bits<5> pos;
440 bits<5> size;
441
442 bits<32> Inst;
443
444 let Inst{31-26} = 0x00;
445 let Inst{25-21} = rt;
446 let Inst{20-16} = rs;
447 let Inst{15-11} = size;
448 let Inst{10-6} = pos;
449 let Inst{5-0} = funct;
450}
Zoran Jovanovic507e0842013-10-29 16:38:59 +0000451
452class J_FM_MM<bits<6> op> : MMArch {
453 bits<26> target;
454
455 bits<32> Inst;
456
457 let Inst{31-26} = op;
458 let Inst{25-0} = target;
459}
460
461class JR_FM_MM<bits<8> funct> : MMArch {
462 bits<5> rs;
463
464 bits<32> Inst;
465
466 let Inst{31-21} = 0x00;
467 let Inst{20-16} = rs;
468 let Inst{15-14} = 0x0;
469 let Inst{13-6} = funct;
470 let Inst{5-0} = 0x3c;
471}
472
Zoran Jovanovic87d13e52014-03-20 10:18:24 +0000473class JALR_FM_MM<bits<10> funct> {
Zoran Jovanovic507e0842013-10-29 16:38:59 +0000474 bits<5> rs;
475 bits<5> rd;
476
477 bits<32> Inst;
478
479 let Inst{31-26} = 0x00;
480 let Inst{25-21} = rd;
481 let Inst{20-16} = rs;
482 let Inst{15-6} = funct;
483 let Inst{5-0} = 0x3c;
484}
Zoran Jovanovic8a80aa72013-11-04 14:53:22 +0000485
486class BEQ_FM_MM<bits<6> op> : MMArch {
487 bits<5> rs;
488 bits<5> rt;
489 bits<16> offset;
490
491 bits<32> Inst;
492
493 let Inst{31-26} = op;
494 let Inst{25-21} = rt;
495 let Inst{20-16} = rs;
496 let Inst{15-0} = offset;
497}
498
499class BGEZ_FM_MM<bits<5> funct> : MMArch {
500 bits<5> rs;
501 bits<16> offset;
502
503 bits<32> Inst;
504
505 let Inst{31-26} = 0x10;
506 let Inst{25-21} = funct;
507 let Inst{20-16} = rs;
508 let Inst{15-0} = offset;
509}
510
511class BGEZAL_FM_MM<bits<5> funct> : MMArch {
512 bits<5> rs;
513 bits<16> offset;
514
515 bits<32> Inst;
516
517 let Inst{31-26} = 0x10;
518 let Inst{25-21} = funct;
519 let Inst{20-16} = rs;
520 let Inst{15-0} = offset;
521}
Zoran Jovanovicc18b6d12013-11-07 14:35:24 +0000522
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000523class SYNC_FM_MM : MMArch {
524 bits<5> stype;
525
526 bits<32> Inst;
527
528 let Inst{31-26} = 0x00;
529 let Inst{25-21} = 0x0;
530 let Inst{20-16} = stype;
531 let Inst{15-6} = 0x1ad;
532 let Inst{5-0} = 0x3c;
533}
534
535class BRK_FM_MM : MMArch {
536 bits<10> code_1;
537 bits<10> code_2;
538 bits<32> Inst;
539 let Inst{31-26} = 0x0;
540 let Inst{25-16} = code_1;
541 let Inst{15-6} = code_2;
542 let Inst{5-0} = 0x07;
543}
544
545class SYS_FM_MM : MMArch {
546 bits<10> code_;
547 bits<32> Inst;
548 let Inst{31-26} = 0x0;
549 let Inst{25-16} = code_;
Zoran Jovanovic7c6c36d2014-02-28 18:17:08 +0000550 let Inst{15-6} = 0x22d;
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000551 let Inst{5-0} = 0x3c;
552}
553
Zoran Jovanovica0f53282014-03-20 10:41:37 +0000554class WAIT_FM_MM {
555 bits<10> code_;
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000556 bits<32> Inst;
557
558 let Inst{31-26} = 0x00;
Zoran Jovanovica0f53282014-03-20 10:41:37 +0000559 let Inst{25-16} = code_;
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000560 let Inst{15-6} = 0x24d;
561 let Inst{5-0} = 0x3c;
562}
563
564class ER_FM_MM<bits<10> funct> : MMArch {
565 bits<32> Inst;
566
567 let Inst{31-26} = 0x00;
568 let Inst{25-16} = 0x00;
569 let Inst{15-6} = funct;
570 let Inst{5-0} = 0x3c;
571}
572
573class EI_FM_MM<bits<10> funct> : MMArch {
574 bits<32> Inst;
575 bits<5> rt;
576
577 let Inst{31-26} = 0x00;
578 let Inst{25-21} = 0x00;
579 let Inst{20-16} = rt;
580 let Inst{15-6} = funct;
581 let Inst{5-0} = 0x3c;
582}
583
Zoran Jovanovicc18b6d12013-11-07 14:35:24 +0000584class TEQ_FM_MM<bits<6> funct> : MMArch {
585 bits<5> rs;
586 bits<5> rt;
587 bits<4> code_;
588
589 bits<32> Inst;
590
591 let Inst{31-26} = 0x00;
592 let Inst{25-21} = rt;
593 let Inst{20-16} = rs;
594 let Inst{15-12} = code_;
595 let Inst{11-6} = funct;
596 let Inst{5-0} = 0x3c;
597}
Zoran Jovanovicccb70ca2013-11-13 13:15:03 +0000598
599class TEQI_FM_MM<bits<5> funct> : MMArch {
600 bits<5> rs;
601 bits<16> imm16;
602
603 bits<32> Inst;
604
605 let Inst{31-26} = 0x10;
606 let Inst{25-21} = funct;
607 let Inst{20-16} = rs;
608 let Inst{15-0} = imm16;
609}
Zoran Jovanovicff9d5f32013-12-19 16:12:56 +0000610
611class LL_FM_MM<bits<4> funct> {
612 bits<5> rt;
613 bits<21> addr;
614
615 bits<32> Inst;
616
617 let Inst{31-26} = 0x18;
618 let Inst{25-21} = rt;
619 let Inst{20-16} = addr{20-16};
620 let Inst{15-12} = funct;
621 let Inst{11-0} = addr{11-0};
622}
Zoran Jovanovicce024862013-12-20 15:44:08 +0000623
624class ADDS_FM_MM<bits<2> fmt, bits<8> funct> : MMArch {
625 bits<5> ft;
626 bits<5> fs;
627 bits<5> fd;
628
629 bits<32> Inst;
630
631 let Inst{31-26} = 0x15;
632 let Inst{25-21} = ft;
633 let Inst{20-16} = fs;
634 let Inst{15-11} = fd;
635 let Inst{10} = 0;
636 let Inst{9-8} = fmt;
637 let Inst{7-0} = funct;
638
639 list<dag> Pattern = [];
640}
641
642class LWXC1_FM_MM<bits<9> funct> : MMArch {
643 bits<5> fd;
644 bits<5> base;
645 bits<5> index;
646
647 bits<32> Inst;
648
649 let Inst{31-26} = 0x15;
650 let Inst{25-21} = index;
651 let Inst{20-16} = base;
652 let Inst{15-11} = fd;
653 let Inst{10-9} = 0x0;
654 let Inst{8-0} = funct;
655}
656
657class SWXC1_FM_MM<bits<9> funct> : MMArch {
658 bits<5> fs;
659 bits<5> base;
660 bits<5> index;
661
662 bits<32> Inst;
663
664 let Inst{31-26} = 0x15;
665 let Inst{25-21} = index;
666 let Inst{20-16} = base;
667 let Inst{15-11} = fs;
668 let Inst{10-9} = 0x0;
669 let Inst{8-0} = funct;
670}
671
672class CEQS_FM_MM<bits<2> fmt> : MMArch {
673 bits<5> fs;
674 bits<5> ft;
675 bits<4> cond;
676
677 bits<32> Inst;
678
679 let Inst{31-26} = 0x15;
680 let Inst{25-21} = ft;
681 let Inst{20-16} = fs;
682 let Inst{15-13} = 0x0; // cc
683 let Inst{12} = 0;
684 let Inst{11-10} = fmt;
685 let Inst{9-6} = cond;
686 let Inst{5-0} = 0x3c;
687}
688
689class BC1F_FM_MM<bits<5> tf> : MMArch {
690 bits<16> offset;
691
692 bits<32> Inst;
693
694 let Inst{31-26} = 0x10;
695 let Inst{25-21} = tf;
696 let Inst{20-18} = 0x0; // cc
697 let Inst{17-16} = 0x0;
698 let Inst{15-0} = offset;
699}
700
701class ROUND_W_FM_MM<bits<1> fmt, bits<8> funct> : MMArch {
702 bits<5> fd;
703 bits<5> fs;
704
705 bits<32> Inst;
706
707 let Inst{31-26} = 0x15;
708 let Inst{25-21} = fd;
709 let Inst{20-16} = fs;
710 let Inst{15} = 0;
711 let Inst{14} = fmt;
712 let Inst{13-6} = funct;
713 let Inst{5-0} = 0x3b;
714}
715
716class ABS_FM_MM<bits<2> fmt, bits<7> funct> : MMArch {
717 bits<5> fd;
718 bits<5> fs;
719
720 bits<32> Inst;
721
722 let Inst{31-26} = 0x15;
723 let Inst{25-21} = fd;
724 let Inst{20-16} = fs;
725 let Inst{15} = 0;
726 let Inst{14-13} = fmt;
727 let Inst{12-6} = funct;
728 let Inst{5-0} = 0x3b;
729}
Zoran Jovanovic8876be32013-12-25 10:09:27 +0000730
731class CMov_F_F_FM_MM<bits<9> func, bits<2> fmt> : MMArch {
732 bits<5> fd;
733 bits<5> fs;
734
735 bits<32> Inst;
736
737 let Inst{31-26} = 0x15;
738 let Inst{25-21} = fd;
739 let Inst{20-16} = fs;
740 let Inst{15-13} = 0x0; //cc
741 let Inst{12-11} = 0x0;
742 let Inst{10-9} = fmt;
743 let Inst{8-0} = func;
744}
745
746class CMov_I_F_FM_MM<bits<8> funct, bits<2> fmt> : MMArch {
747 bits<5> fd;
748 bits<5> fs;
749 bits<5> rt;
750
751 bits<32> Inst;
752
753 let Inst{31-26} = 0x15;
754 let Inst{25-21} = rt;
755 let Inst{20-16} = fs;
756 let Inst{15-11} = fd;
757 let Inst{9-8} = fmt;
758 let Inst{7-0} = funct;
759}
760
761class MFC1_FM_MM<bits<8> funct> : MMArch {
762 bits<5> rt;
763 bits<5> fs;
764
765 bits<32> Inst;
766
767 let Inst{31-26} = 0x15;
768 let Inst{25-21} = rt;
769 let Inst{20-16} = fs;
770 let Inst{15-14} = 0x0;
771 let Inst{13-6} = funct;
772 let Inst{5-0} = 0x3b;
773}
774
775class MADDS_FM_MM<bits<6> funct>: MMArch {
776 bits<5> ft;
777 bits<5> fs;
778 bits<5> fd;
779 bits<5> fr;
780
781 bits<32> Inst;
782
783 let Inst{31-26} = 0x15;
784 let Inst{25-21} = ft;
785 let Inst{20-16} = fs;
786 let Inst{15-11} = fd;
787 let Inst{10-6} = fr;
788 let Inst{5-0} = funct;
789}
Zoran Jovanovic73ff9482014-08-14 12:09:10 +0000790
791class COMPACT_BRANCH_FM_MM<bits<5> funct> {
792 bits<5> rs;
793 bits<16> offset;
794
795 bits<32> Inst;
796
797 let Inst{31-26} = 0x10;
798 let Inst{25-21} = funct;
799 let Inst{20-16} = rs;
800 let Inst{15-0} = offset;
801}
Zoran Jovanovic4e7ac4a2014-09-12 13:33:33 +0000802
803class COP0_TLB_FM_MM<bits<10> op> : MMArch {
804 bits<32> Inst;
805
806 let Inst{31-26} = 0x0;
807 let Inst{25-16} = 0x0;
808 let Inst{15-6} = op;
809 let Inst{5-0} = 0x3c;
810}
Jozef Kolekdc62fc42014-11-19 11:25:50 +0000811
812class SDBBP_FM_MM : MMArch {
813 bits<10> code_;
814
815 bits<32> Inst;
816
817 let Inst{31-26} = 0x0;
818 let Inst{25-16} = code_;
819 let Inst{15-6} = 0x36d;
820 let Inst{5-0} = 0x3c;
821}
822
823class RDHWR_FM_MM : MMArch {
824 bits<5> rt;
825 bits<5> rd;
826
827 bits<32> Inst;
828
829 let Inst{31-26} = 0x0;
830 let Inst{25-21} = rt;
831 let Inst{20-16} = rd;
832 let Inst{15-6} = 0x1ac;
833 let Inst{5-0} = 0x3c;
834}
Jozef Kolek5f95dd22014-11-19 11:39:12 +0000835
836class LWXS_FM_MM<bits<10> funct> {
837 bits<5> rd;
838 bits<5> base;
839 bits<5> index;
840
841 bits<32> Inst;
842
843 let Inst{31-26} = 0x0;
844 let Inst{25-21} = index;
845 let Inst{20-16} = base;
846 let Inst{15-11} = rd;
847 let Inst{10} = 0;
848 let Inst{9-0} = funct;
849}
Zoran Jovanovica4c4b5f2014-11-19 16:44:02 +0000850
851class LWM_FM_MM<bits<4> funct> : MMArch {
852 bits<5> rt;
853 bits<21> addr;
854
855 bits<32> Inst;
856
857 let Inst{31-26} = 0x8;
858 let Inst{25-21} = rt;
859 let Inst{20-16} = addr{20-16};
860 let Inst{15-12} = funct;
861 let Inst{11-0} = addr{11-0};
862}
Zoran Jovanovicf9a02502014-11-27 18:28:59 +0000863
864class LWM_FM_MM16<bits<4> funct> : MMArch {
865 bits<2> rt;
866 bits<4> addr;
867
868 bits<16> Inst;
869
870 let Inst{15-10} = 0x11;
871 let Inst{9-6} = funct;
872 let Inst{5-4} = rt;
873 let Inst{3-0} = addr;
874}
Jozef Kolekab6d1cc2014-12-23 19:55:34 +0000875
876class CACHE_PREF_FM_MM<bits<6> op, bits<4> funct> : MMArch {
877 bits<21> addr;
878 bits<5> hint;
879 bits<5> base = addr{20-16};
880 bits<12> offset = addr{11-0};
881
882 bits<32> Inst;
883
884 let Inst{31-26} = op;
885 let Inst{25-21} = hint;
886 let Inst{20-16} = base;
887 let Inst{15-12} = funct;
888 let Inst{11-0} = offset;
889}
890
891class BARRIER_FM_MM<bits<5> op> : MMArch {
892 bits<32> Inst;
893
894 let Inst{31-26} = 0x0;
895 let Inst{25-21} = 0x0;
896 let Inst{20-16} = 0x0;
897 let Inst{15-11} = op;
898 let Inst{10-6} = 0x0;
899 let Inst{5-0} = 0x0;
900}
Jozef Kolek2c6d7322015-01-21 12:10:11 +0000901
902class ADDIUPC_FM_MM {
903 bits<3> rs;
904 bits<23> imm;
905
906 bits<32> Inst;
907
908 let Inst{31-26} = 0x1e;
909 let Inst{25-23} = rs;
910 let Inst{22-0} = imm;
911}