blob: dcd0e59717875d6737d75da5eb3a3116c5c92e86 [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
Jozef Kolek56a6a7d2014-11-27 18:18:42 +0000210class BRKSDBBP16_FM_MM<bits<6> op> {
211 bits<4> code_;
212 bits<16> Inst;
213
214 let Inst{15-10} = 0x11;
215 let Inst{9-4} = op;
216 let Inst{3-0} = code_;
217}
218
Zoran Jovanovic87d13e52014-03-20 10:18:24 +0000219//===----------------------------------------------------------------------===//
220// MicroMIPS 32-bit Instruction Formats
221//===----------------------------------------------------------------------===//
222
Akira Hatanakabe6a8182013-04-19 19:03:11 +0000223class MMArch {
224 string Arch = "micromips";
225 list<dag> Pattern = [];
226}
227
228class ADD_FM_MM<bits<6> op, bits<10> funct> : MMArch {
229 bits<5> rt;
230 bits<5> rs;
231 bits<5> rd;
232
233 bits<32> Inst;
234
235 let Inst{31-26} = op;
236 let Inst{25-21} = rt;
237 let Inst{20-16} = rs;
238 let Inst{15-11} = rd;
239 let Inst{10} = 0;
240 let Inst{9-0} = funct;
241}
242
243class ADDI_FM_MM<bits<6> op> : MMArch {
244 bits<5> rs;
245 bits<5> rt;
246 bits<16> imm16;
247
248 bits<32> Inst;
249
250 let Inst{31-26} = op;
251 let Inst{25-21} = rt;
252 let Inst{20-16} = rs;
253 let Inst{15-0} = imm16;
254}
255
256class SLTI_FM_MM<bits<6> op> : MMArch {
257 bits<5> rt;
258 bits<5> rs;
259 bits<16> imm16;
260
261 bits<32> Inst;
262
263 let Inst{31-26} = op;
Zoran Jovanovicf4d4d782013-11-15 08:07:34 +0000264 let Inst{25-21} = rt;
265 let Inst{20-16} = rs;
Akira Hatanakabe6a8182013-04-19 19:03:11 +0000266 let Inst{15-0} = imm16;
267}
268
269class LUI_FM_MM : MMArch {
270 bits<5> rt;
271 bits<16> imm16;
272
273 bits<32> Inst;
274
275 let Inst{31-26} = 0x10;
276 let Inst{25-21} = 0xd;
277 let Inst{20-16} = rt;
278 let Inst{15-0} = imm16;
279}
280
281class MULT_FM_MM<bits<10> funct> : MMArch {
282 bits<5> rs;
283 bits<5> rt;
284
285 bits<32> Inst;
286
287 let Inst{31-26} = 0x00;
288 let Inst{25-21} = rt;
289 let Inst{20-16} = rs;
290 let Inst{15-6} = funct;
291 let Inst{5-0} = 0x3c;
292}
Akira Hatanakacd9b74a2013-04-25 01:11:15 +0000293
294class SRA_FM_MM<bits<10> funct, bit rotate> : MMArch {
295 bits<5> rd;
296 bits<5> rt;
297 bits<5> shamt;
298
299 bits<32> Inst;
300
301 let Inst{31-26} = 0;
302 let Inst{25-21} = rd;
303 let Inst{20-16} = rt;
304 let Inst{15-11} = shamt;
305 let Inst{10} = rotate;
306 let Inst{9-0} = funct;
307}
308
309class SRLV_FM_MM<bits<10> funct, bit rotate> : MMArch {
310 bits<5> rd;
311 bits<5> rt;
312 bits<5> rs;
313
314 bits<32> Inst;
315
316 let Inst{31-26} = 0;
317 let Inst{25-21} = rt;
318 let Inst{20-16} = rs;
319 let Inst{15-11} = rd;
320 let Inst{10} = rotate;
321 let Inst{9-0} = funct;
322}
Akira Hatanakaf0aa6c92013-04-25 01:21:25 +0000323
324class LW_FM_MM<bits<6> op> : MMArch {
325 bits<5> rt;
326 bits<21> addr;
327
328 bits<32> Inst;
329
330 let Inst{31-26} = op;
331 let Inst{25-21} = rt;
332 let Inst{20-16} = addr{20-16};
333 let Inst{15-0} = addr{15-0};
334}
Jack Carter97700972013-08-13 20:19:16 +0000335
336class LWL_FM_MM<bits<4> funct> {
337 bits<5> rt;
338 bits<21> addr;
339
340 bits<32> Inst;
341
342 let Inst{31-26} = 0x18;
343 let Inst{25-21} = rt;
344 let Inst{20-16} = addr{20-16};
345 let Inst{15-12} = funct;
346 let Inst{11-0} = addr{11-0};
347}
Vladimir Medice0fbb442013-09-06 12:41:17 +0000348
349class CMov_F_I_FM_MM<bits<7> func> : MMArch {
350 bits<5> rd;
351 bits<5> rs;
352 bits<3> fcc;
353
354 bits<32> Inst;
355
356 let Inst{31-26} = 0x15;
357 let Inst{25-21} = rd;
358 let Inst{20-16} = rs;
359 let Inst{15-13} = fcc;
360 let Inst{12-6} = func;
361 let Inst{5-0} = 0x3b;
362}
Vladimir Medic457ba562013-09-06 12:53:21 +0000363
364class MTLO_FM_MM<bits<10> funct> : MMArch {
365 bits<5> rs;
366
367 bits<32> Inst;
368
369 let Inst{31-26} = 0x00;
370 let Inst{25-21} = 0x00;
371 let Inst{20-16} = rs;
372 let Inst{15-6} = funct;
373 let Inst{5-0} = 0x3c;
374}
375
376class MFLO_FM_MM<bits<10> funct> : MMArch {
377 bits<5> rd;
378
379 bits<32> Inst;
380
381 let Inst{31-26} = 0x00;
382 let Inst{25-21} = 0x00;
383 let Inst{20-16} = rd;
384 let Inst{15-6} = funct;
385 let Inst{5-0} = 0x3c;
386}
Zoran Jovanovicab852782013-09-14 06:49:25 +0000387
388class CLO_FM_MM<bits<10> funct> : MMArch {
389 bits<5> rd;
390 bits<5> rs;
391
392 bits<32> Inst;
393
394 let Inst{31-26} = 0x00;
395 let Inst{25-21} = rd;
396 let Inst{20-16} = rs;
397 let Inst{15-6} = funct;
398 let Inst{5-0} = 0x3c;
399}
400
401class SEB_FM_MM<bits<10> funct> : MMArch {
402 bits<5> rd;
403 bits<5> rt;
404
405 bits<32> Inst;
406
407 let Inst{31-26} = 0x00;
408 let Inst{25-21} = rd;
409 let Inst{20-16} = rt;
410 let Inst{15-6} = funct;
411 let Inst{5-0} = 0x3c;
412}
413
414class EXT_FM_MM<bits<6> funct> : MMArch {
415 bits<5> rt;
416 bits<5> rs;
417 bits<5> pos;
418 bits<5> size;
419
420 bits<32> Inst;
421
422 let Inst{31-26} = 0x00;
423 let Inst{25-21} = rt;
424 let Inst{20-16} = rs;
425 let Inst{15-11} = size;
426 let Inst{10-6} = pos;
427 let Inst{5-0} = funct;
428}
Zoran Jovanovic507e0842013-10-29 16:38:59 +0000429
430class J_FM_MM<bits<6> op> : MMArch {
431 bits<26> target;
432
433 bits<32> Inst;
434
435 let Inst{31-26} = op;
436 let Inst{25-0} = target;
437}
438
439class JR_FM_MM<bits<8> funct> : MMArch {
440 bits<5> rs;
441
442 bits<32> Inst;
443
444 let Inst{31-21} = 0x00;
445 let Inst{20-16} = rs;
446 let Inst{15-14} = 0x0;
447 let Inst{13-6} = funct;
448 let Inst{5-0} = 0x3c;
449}
450
Zoran Jovanovic87d13e52014-03-20 10:18:24 +0000451class JALR_FM_MM<bits<10> funct> {
Zoran Jovanovic507e0842013-10-29 16:38:59 +0000452 bits<5> rs;
453 bits<5> rd;
454
455 bits<32> Inst;
456
457 let Inst{31-26} = 0x00;
458 let Inst{25-21} = rd;
459 let Inst{20-16} = rs;
460 let Inst{15-6} = funct;
461 let Inst{5-0} = 0x3c;
462}
Zoran Jovanovic8a80aa72013-11-04 14:53:22 +0000463
464class BEQ_FM_MM<bits<6> op> : MMArch {
465 bits<5> rs;
466 bits<5> rt;
467 bits<16> offset;
468
469 bits<32> Inst;
470
471 let Inst{31-26} = op;
472 let Inst{25-21} = rt;
473 let Inst{20-16} = rs;
474 let Inst{15-0} = offset;
475}
476
477class BGEZ_FM_MM<bits<5> funct> : MMArch {
478 bits<5> rs;
479 bits<16> offset;
480
481 bits<32> Inst;
482
483 let Inst{31-26} = 0x10;
484 let Inst{25-21} = funct;
485 let Inst{20-16} = rs;
486 let Inst{15-0} = offset;
487}
488
489class BGEZAL_FM_MM<bits<5> funct> : MMArch {
490 bits<5> rs;
491 bits<16> offset;
492
493 bits<32> Inst;
494
495 let Inst{31-26} = 0x10;
496 let Inst{25-21} = funct;
497 let Inst{20-16} = rs;
498 let Inst{15-0} = offset;
499}
Zoran Jovanovicc18b6d12013-11-07 14:35:24 +0000500
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000501class SYNC_FM_MM : MMArch {
502 bits<5> stype;
503
504 bits<32> Inst;
505
506 let Inst{31-26} = 0x00;
507 let Inst{25-21} = 0x0;
508 let Inst{20-16} = stype;
509 let Inst{15-6} = 0x1ad;
510 let Inst{5-0} = 0x3c;
511}
512
513class BRK_FM_MM : MMArch {
514 bits<10> code_1;
515 bits<10> code_2;
516 bits<32> Inst;
517 let Inst{31-26} = 0x0;
518 let Inst{25-16} = code_1;
519 let Inst{15-6} = code_2;
520 let Inst{5-0} = 0x07;
521}
522
523class SYS_FM_MM : MMArch {
524 bits<10> code_;
525 bits<32> Inst;
526 let Inst{31-26} = 0x0;
527 let Inst{25-16} = code_;
Zoran Jovanovic7c6c36d2014-02-28 18:17:08 +0000528 let Inst{15-6} = 0x22d;
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000529 let Inst{5-0} = 0x3c;
530}
531
Zoran Jovanovica0f53282014-03-20 10:41:37 +0000532class WAIT_FM_MM {
533 bits<10> code_;
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000534 bits<32> Inst;
535
536 let Inst{31-26} = 0x00;
Zoran Jovanovica0f53282014-03-20 10:41:37 +0000537 let Inst{25-16} = code_;
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000538 let Inst{15-6} = 0x24d;
539 let Inst{5-0} = 0x3c;
540}
541
542class ER_FM_MM<bits<10> funct> : MMArch {
543 bits<32> Inst;
544
545 let Inst{31-26} = 0x00;
546 let Inst{25-16} = 0x00;
547 let Inst{15-6} = funct;
548 let Inst{5-0} = 0x3c;
549}
550
551class EI_FM_MM<bits<10> funct> : MMArch {
552 bits<32> Inst;
553 bits<5> rt;
554
555 let Inst{31-26} = 0x00;
556 let Inst{25-21} = 0x00;
557 let Inst{20-16} = rt;
558 let Inst{15-6} = funct;
559 let Inst{5-0} = 0x3c;
560}
561
Zoran Jovanovicc18b6d12013-11-07 14:35:24 +0000562class TEQ_FM_MM<bits<6> funct> : MMArch {
563 bits<5> rs;
564 bits<5> rt;
565 bits<4> code_;
566
567 bits<32> Inst;
568
569 let Inst{31-26} = 0x00;
570 let Inst{25-21} = rt;
571 let Inst{20-16} = rs;
572 let Inst{15-12} = code_;
573 let Inst{11-6} = funct;
574 let Inst{5-0} = 0x3c;
575}
Zoran Jovanovicccb70ca2013-11-13 13:15:03 +0000576
577class TEQI_FM_MM<bits<5> funct> : MMArch {
578 bits<5> rs;
579 bits<16> imm16;
580
581 bits<32> Inst;
582
583 let Inst{31-26} = 0x10;
584 let Inst{25-21} = funct;
585 let Inst{20-16} = rs;
586 let Inst{15-0} = imm16;
587}
Zoran Jovanovicff9d5f32013-12-19 16:12:56 +0000588
589class LL_FM_MM<bits<4> funct> {
590 bits<5> rt;
591 bits<21> addr;
592
593 bits<32> Inst;
594
595 let Inst{31-26} = 0x18;
596 let Inst{25-21} = rt;
597 let Inst{20-16} = addr{20-16};
598 let Inst{15-12} = funct;
599 let Inst{11-0} = addr{11-0};
600}
Zoran Jovanovicce024862013-12-20 15:44:08 +0000601
602class ADDS_FM_MM<bits<2> fmt, bits<8> funct> : MMArch {
603 bits<5> ft;
604 bits<5> fs;
605 bits<5> fd;
606
607 bits<32> Inst;
608
609 let Inst{31-26} = 0x15;
610 let Inst{25-21} = ft;
611 let Inst{20-16} = fs;
612 let Inst{15-11} = fd;
613 let Inst{10} = 0;
614 let Inst{9-8} = fmt;
615 let Inst{7-0} = funct;
616
617 list<dag> Pattern = [];
618}
619
620class LWXC1_FM_MM<bits<9> funct> : MMArch {
621 bits<5> fd;
622 bits<5> base;
623 bits<5> index;
624
625 bits<32> Inst;
626
627 let Inst{31-26} = 0x15;
628 let Inst{25-21} = index;
629 let Inst{20-16} = base;
630 let Inst{15-11} = fd;
631 let Inst{10-9} = 0x0;
632 let Inst{8-0} = funct;
633}
634
635class SWXC1_FM_MM<bits<9> funct> : MMArch {
636 bits<5> fs;
637 bits<5> base;
638 bits<5> index;
639
640 bits<32> Inst;
641
642 let Inst{31-26} = 0x15;
643 let Inst{25-21} = index;
644 let Inst{20-16} = base;
645 let Inst{15-11} = fs;
646 let Inst{10-9} = 0x0;
647 let Inst{8-0} = funct;
648}
649
650class CEQS_FM_MM<bits<2> fmt> : MMArch {
651 bits<5> fs;
652 bits<5> ft;
653 bits<4> cond;
654
655 bits<32> Inst;
656
657 let Inst{31-26} = 0x15;
658 let Inst{25-21} = ft;
659 let Inst{20-16} = fs;
660 let Inst{15-13} = 0x0; // cc
661 let Inst{12} = 0;
662 let Inst{11-10} = fmt;
663 let Inst{9-6} = cond;
664 let Inst{5-0} = 0x3c;
665}
666
667class BC1F_FM_MM<bits<5> tf> : MMArch {
668 bits<16> offset;
669
670 bits<32> Inst;
671
672 let Inst{31-26} = 0x10;
673 let Inst{25-21} = tf;
674 let Inst{20-18} = 0x0; // cc
675 let Inst{17-16} = 0x0;
676 let Inst{15-0} = offset;
677}
678
679class ROUND_W_FM_MM<bits<1> fmt, bits<8> funct> : MMArch {
680 bits<5> fd;
681 bits<5> fs;
682
683 bits<32> Inst;
684
685 let Inst{31-26} = 0x15;
686 let Inst{25-21} = fd;
687 let Inst{20-16} = fs;
688 let Inst{15} = 0;
689 let Inst{14} = fmt;
690 let Inst{13-6} = funct;
691 let Inst{5-0} = 0x3b;
692}
693
694class ABS_FM_MM<bits<2> fmt, bits<7> funct> : MMArch {
695 bits<5> fd;
696 bits<5> fs;
697
698 bits<32> Inst;
699
700 let Inst{31-26} = 0x15;
701 let Inst{25-21} = fd;
702 let Inst{20-16} = fs;
703 let Inst{15} = 0;
704 let Inst{14-13} = fmt;
705 let Inst{12-6} = funct;
706 let Inst{5-0} = 0x3b;
707}
Zoran Jovanovic8876be32013-12-25 10:09:27 +0000708
709class CMov_F_F_FM_MM<bits<9> func, bits<2> fmt> : MMArch {
710 bits<5> fd;
711 bits<5> fs;
712
713 bits<32> Inst;
714
715 let Inst{31-26} = 0x15;
716 let Inst{25-21} = fd;
717 let Inst{20-16} = fs;
718 let Inst{15-13} = 0x0; //cc
719 let Inst{12-11} = 0x0;
720 let Inst{10-9} = fmt;
721 let Inst{8-0} = func;
722}
723
724class CMov_I_F_FM_MM<bits<8> funct, bits<2> fmt> : MMArch {
725 bits<5> fd;
726 bits<5> fs;
727 bits<5> rt;
728
729 bits<32> Inst;
730
731 let Inst{31-26} = 0x15;
732 let Inst{25-21} = rt;
733 let Inst{20-16} = fs;
734 let Inst{15-11} = fd;
735 let Inst{9-8} = fmt;
736 let Inst{7-0} = funct;
737}
738
739class MFC1_FM_MM<bits<8> funct> : MMArch {
740 bits<5> rt;
741 bits<5> fs;
742
743 bits<32> Inst;
744
745 let Inst{31-26} = 0x15;
746 let Inst{25-21} = rt;
747 let Inst{20-16} = fs;
748 let Inst{15-14} = 0x0;
749 let Inst{13-6} = funct;
750 let Inst{5-0} = 0x3b;
751}
752
753class MADDS_FM_MM<bits<6> funct>: MMArch {
754 bits<5> ft;
755 bits<5> fs;
756 bits<5> fd;
757 bits<5> fr;
758
759 bits<32> Inst;
760
761 let Inst{31-26} = 0x15;
762 let Inst{25-21} = ft;
763 let Inst{20-16} = fs;
764 let Inst{15-11} = fd;
765 let Inst{10-6} = fr;
766 let Inst{5-0} = funct;
767}
Zoran Jovanovic73ff9482014-08-14 12:09:10 +0000768
769class COMPACT_BRANCH_FM_MM<bits<5> funct> {
770 bits<5> rs;
771 bits<16> offset;
772
773 bits<32> Inst;
774
775 let Inst{31-26} = 0x10;
776 let Inst{25-21} = funct;
777 let Inst{20-16} = rs;
778 let Inst{15-0} = offset;
779}
Zoran Jovanovic4e7ac4a2014-09-12 13:33:33 +0000780
781class COP0_TLB_FM_MM<bits<10> op> : MMArch {
782 bits<32> Inst;
783
784 let Inst{31-26} = 0x0;
785 let Inst{25-16} = 0x0;
786 let Inst{15-6} = op;
787 let Inst{5-0} = 0x3c;
788}
Jozef Kolekdc62fc42014-11-19 11:25:50 +0000789
790class SDBBP_FM_MM : MMArch {
791 bits<10> code_;
792
793 bits<32> Inst;
794
795 let Inst{31-26} = 0x0;
796 let Inst{25-16} = code_;
797 let Inst{15-6} = 0x36d;
798 let Inst{5-0} = 0x3c;
799}
800
801class RDHWR_FM_MM : MMArch {
802 bits<5> rt;
803 bits<5> rd;
804
805 bits<32> Inst;
806
807 let Inst{31-26} = 0x0;
808 let Inst{25-21} = rt;
809 let Inst{20-16} = rd;
810 let Inst{15-6} = 0x1ac;
811 let Inst{5-0} = 0x3c;
812}
Jozef Kolek5f95dd22014-11-19 11:39:12 +0000813
814class LWXS_FM_MM<bits<10> funct> {
815 bits<5> rd;
816 bits<5> base;
817 bits<5> index;
818
819 bits<32> Inst;
820
821 let Inst{31-26} = 0x0;
822 let Inst{25-21} = index;
823 let Inst{20-16} = base;
824 let Inst{15-11} = rd;
825 let Inst{10} = 0;
826 let Inst{9-0} = funct;
827}
Zoran Jovanovica4c4b5f2014-11-19 16:44:02 +0000828
829class LWM_FM_MM<bits<4> funct> : MMArch {
830 bits<5> rt;
831 bits<21> addr;
832
833 bits<32> Inst;
834
835 let Inst{31-26} = 0x8;
836 let Inst{25-21} = rt;
837 let Inst{20-16} = addr{20-16};
838 let Inst{15-12} = funct;
839 let Inst{11-0} = addr{11-0};
840}