blob: 0ad16dda85b65836bc7b3a56aa784ded9ab851b9 [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
Jozef Kolek5cfebdd2015-01-21 12:39:30 +0000241class B16_FM {
242 bits<10> offset;
243
244 bits<16> Inst;
245
246 let Inst{15-10} = 0x33;
247 let Inst{9-0} = offset;
248}
249
Zoran Jovanovic87d13e52014-03-20 10:18:24 +0000250//===----------------------------------------------------------------------===//
251// MicroMIPS 32-bit Instruction Formats
252//===----------------------------------------------------------------------===//
253
Akira Hatanakabe6a8182013-04-19 19:03:11 +0000254class MMArch {
255 string Arch = "micromips";
256 list<dag> Pattern = [];
257}
258
259class ADD_FM_MM<bits<6> op, bits<10> funct> : MMArch {
260 bits<5> rt;
261 bits<5> rs;
262 bits<5> rd;
263
264 bits<32> Inst;
265
266 let Inst{31-26} = op;
267 let Inst{25-21} = rt;
268 let Inst{20-16} = rs;
269 let Inst{15-11} = rd;
270 let Inst{10} = 0;
271 let Inst{9-0} = funct;
272}
273
274class ADDI_FM_MM<bits<6> op> : MMArch {
275 bits<5> rs;
276 bits<5> rt;
277 bits<16> imm16;
278
279 bits<32> Inst;
280
281 let Inst{31-26} = op;
282 let Inst{25-21} = rt;
283 let Inst{20-16} = rs;
284 let Inst{15-0} = imm16;
285}
286
287class SLTI_FM_MM<bits<6> op> : MMArch {
288 bits<5> rt;
289 bits<5> rs;
290 bits<16> imm16;
291
292 bits<32> Inst;
293
294 let Inst{31-26} = op;
Zoran Jovanovicf4d4d782013-11-15 08:07:34 +0000295 let Inst{25-21} = rt;
296 let Inst{20-16} = rs;
Akira Hatanakabe6a8182013-04-19 19:03:11 +0000297 let Inst{15-0} = imm16;
298}
299
300class LUI_FM_MM : MMArch {
301 bits<5> rt;
302 bits<16> imm16;
303
304 bits<32> Inst;
305
306 let Inst{31-26} = 0x10;
307 let Inst{25-21} = 0xd;
308 let Inst{20-16} = rt;
309 let Inst{15-0} = imm16;
310}
311
312class MULT_FM_MM<bits<10> funct> : MMArch {
313 bits<5> rs;
314 bits<5> rt;
315
316 bits<32> Inst;
317
318 let Inst{31-26} = 0x00;
319 let Inst{25-21} = rt;
320 let Inst{20-16} = rs;
321 let Inst{15-6} = funct;
322 let Inst{5-0} = 0x3c;
323}
Akira Hatanakacd9b74a2013-04-25 01:11:15 +0000324
325class SRA_FM_MM<bits<10> funct, bit rotate> : MMArch {
326 bits<5> rd;
327 bits<5> rt;
328 bits<5> shamt;
329
330 bits<32> Inst;
331
332 let Inst{31-26} = 0;
333 let Inst{25-21} = rd;
334 let Inst{20-16} = rt;
335 let Inst{15-11} = shamt;
336 let Inst{10} = rotate;
337 let Inst{9-0} = funct;
338}
339
340class SRLV_FM_MM<bits<10> funct, bit rotate> : MMArch {
341 bits<5> rd;
342 bits<5> rt;
343 bits<5> rs;
344
345 bits<32> Inst;
346
347 let Inst{31-26} = 0;
348 let Inst{25-21} = rt;
349 let Inst{20-16} = rs;
350 let Inst{15-11} = rd;
351 let Inst{10} = rotate;
352 let Inst{9-0} = funct;
353}
Akira Hatanakaf0aa6c92013-04-25 01:21:25 +0000354
355class LW_FM_MM<bits<6> op> : MMArch {
356 bits<5> rt;
357 bits<21> addr;
358
359 bits<32> Inst;
360
361 let Inst{31-26} = op;
362 let Inst{25-21} = rt;
363 let Inst{20-16} = addr{20-16};
364 let Inst{15-0} = addr{15-0};
365}
Jack Carter97700972013-08-13 20:19:16 +0000366
367class LWL_FM_MM<bits<4> funct> {
368 bits<5> rt;
369 bits<21> addr;
370
371 bits<32> Inst;
372
373 let Inst{31-26} = 0x18;
374 let Inst{25-21} = rt;
375 let Inst{20-16} = addr{20-16};
376 let Inst{15-12} = funct;
377 let Inst{11-0} = addr{11-0};
378}
Vladimir Medice0fbb442013-09-06 12:41:17 +0000379
380class CMov_F_I_FM_MM<bits<7> func> : MMArch {
381 bits<5> rd;
382 bits<5> rs;
383 bits<3> fcc;
384
385 bits<32> Inst;
386
387 let Inst{31-26} = 0x15;
388 let Inst{25-21} = rd;
389 let Inst{20-16} = rs;
390 let Inst{15-13} = fcc;
391 let Inst{12-6} = func;
392 let Inst{5-0} = 0x3b;
393}
Vladimir Medic457ba562013-09-06 12:53:21 +0000394
395class MTLO_FM_MM<bits<10> funct> : MMArch {
396 bits<5> rs;
397
398 bits<32> Inst;
399
400 let Inst{31-26} = 0x00;
401 let Inst{25-21} = 0x00;
402 let Inst{20-16} = rs;
403 let Inst{15-6} = funct;
404 let Inst{5-0} = 0x3c;
405}
406
407class MFLO_FM_MM<bits<10> funct> : MMArch {
408 bits<5> rd;
409
410 bits<32> Inst;
411
412 let Inst{31-26} = 0x00;
413 let Inst{25-21} = 0x00;
414 let Inst{20-16} = rd;
415 let Inst{15-6} = funct;
416 let Inst{5-0} = 0x3c;
417}
Zoran Jovanovicab852782013-09-14 06:49:25 +0000418
419class CLO_FM_MM<bits<10> funct> : MMArch {
420 bits<5> rd;
421 bits<5> rs;
422
423 bits<32> Inst;
424
425 let Inst{31-26} = 0x00;
426 let Inst{25-21} = rd;
427 let Inst{20-16} = rs;
428 let Inst{15-6} = funct;
429 let Inst{5-0} = 0x3c;
430}
431
432class SEB_FM_MM<bits<10> funct> : MMArch {
433 bits<5> rd;
434 bits<5> rt;
435
436 bits<32> Inst;
437
438 let Inst{31-26} = 0x00;
439 let Inst{25-21} = rd;
440 let Inst{20-16} = rt;
441 let Inst{15-6} = funct;
442 let Inst{5-0} = 0x3c;
443}
444
445class EXT_FM_MM<bits<6> funct> : MMArch {
446 bits<5> rt;
447 bits<5> rs;
448 bits<5> pos;
449 bits<5> size;
450
451 bits<32> Inst;
452
453 let Inst{31-26} = 0x00;
454 let Inst{25-21} = rt;
455 let Inst{20-16} = rs;
456 let Inst{15-11} = size;
457 let Inst{10-6} = pos;
458 let Inst{5-0} = funct;
459}
Zoran Jovanovic507e0842013-10-29 16:38:59 +0000460
461class J_FM_MM<bits<6> op> : MMArch {
462 bits<26> target;
463
464 bits<32> Inst;
465
466 let Inst{31-26} = op;
467 let Inst{25-0} = target;
468}
469
470class JR_FM_MM<bits<8> funct> : MMArch {
471 bits<5> rs;
472
473 bits<32> Inst;
474
475 let Inst{31-21} = 0x00;
476 let Inst{20-16} = rs;
477 let Inst{15-14} = 0x0;
478 let Inst{13-6} = funct;
479 let Inst{5-0} = 0x3c;
480}
481
Zoran Jovanovic87d13e52014-03-20 10:18:24 +0000482class JALR_FM_MM<bits<10> funct> {
Zoran Jovanovic507e0842013-10-29 16:38:59 +0000483 bits<5> rs;
484 bits<5> rd;
485
486 bits<32> Inst;
487
488 let Inst{31-26} = 0x00;
489 let Inst{25-21} = rd;
490 let Inst{20-16} = rs;
491 let Inst{15-6} = funct;
492 let Inst{5-0} = 0x3c;
493}
Zoran Jovanovic8a80aa72013-11-04 14:53:22 +0000494
495class BEQ_FM_MM<bits<6> op> : MMArch {
496 bits<5> rs;
497 bits<5> rt;
498 bits<16> offset;
499
500 bits<32> Inst;
501
502 let Inst{31-26} = op;
503 let Inst{25-21} = rt;
504 let Inst{20-16} = rs;
505 let Inst{15-0} = offset;
506}
507
508class BGEZ_FM_MM<bits<5> funct> : MMArch {
509 bits<5> rs;
510 bits<16> offset;
511
512 bits<32> Inst;
513
514 let Inst{31-26} = 0x10;
515 let Inst{25-21} = funct;
516 let Inst{20-16} = rs;
517 let Inst{15-0} = offset;
518}
519
520class BGEZAL_FM_MM<bits<5> funct> : MMArch {
521 bits<5> rs;
522 bits<16> offset;
523
524 bits<32> Inst;
525
526 let Inst{31-26} = 0x10;
527 let Inst{25-21} = funct;
528 let Inst{20-16} = rs;
529 let Inst{15-0} = offset;
530}
Zoran Jovanovicc18b6d12013-11-07 14:35:24 +0000531
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000532class SYNC_FM_MM : MMArch {
533 bits<5> stype;
534
535 bits<32> Inst;
536
537 let Inst{31-26} = 0x00;
538 let Inst{25-21} = 0x0;
539 let Inst{20-16} = stype;
540 let Inst{15-6} = 0x1ad;
541 let Inst{5-0} = 0x3c;
542}
543
544class BRK_FM_MM : MMArch {
545 bits<10> code_1;
546 bits<10> code_2;
547 bits<32> Inst;
548 let Inst{31-26} = 0x0;
549 let Inst{25-16} = code_1;
550 let Inst{15-6} = code_2;
551 let Inst{5-0} = 0x07;
552}
553
554class SYS_FM_MM : MMArch {
555 bits<10> code_;
556 bits<32> Inst;
557 let Inst{31-26} = 0x0;
558 let Inst{25-16} = code_;
Zoran Jovanovic7c6c36d2014-02-28 18:17:08 +0000559 let Inst{15-6} = 0x22d;
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000560 let Inst{5-0} = 0x3c;
561}
562
Zoran Jovanovica0f53282014-03-20 10:41:37 +0000563class WAIT_FM_MM {
564 bits<10> code_;
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000565 bits<32> Inst;
566
567 let Inst{31-26} = 0x00;
Zoran Jovanovica0f53282014-03-20 10:41:37 +0000568 let Inst{25-16} = code_;
Zoran Jovanovic8e918c32013-12-19 16:25:00 +0000569 let Inst{15-6} = 0x24d;
570 let Inst{5-0} = 0x3c;
571}
572
573class ER_FM_MM<bits<10> funct> : MMArch {
574 bits<32> Inst;
575
576 let Inst{31-26} = 0x00;
577 let Inst{25-16} = 0x00;
578 let Inst{15-6} = funct;
579 let Inst{5-0} = 0x3c;
580}
581
582class EI_FM_MM<bits<10> funct> : MMArch {
583 bits<32> Inst;
584 bits<5> rt;
585
586 let Inst{31-26} = 0x00;
587 let Inst{25-21} = 0x00;
588 let Inst{20-16} = rt;
589 let Inst{15-6} = funct;
590 let Inst{5-0} = 0x3c;
591}
592
Zoran Jovanovicc18b6d12013-11-07 14:35:24 +0000593class TEQ_FM_MM<bits<6> funct> : MMArch {
594 bits<5> rs;
595 bits<5> rt;
596 bits<4> code_;
597
598 bits<32> Inst;
599
600 let Inst{31-26} = 0x00;
601 let Inst{25-21} = rt;
602 let Inst{20-16} = rs;
603 let Inst{15-12} = code_;
604 let Inst{11-6} = funct;
605 let Inst{5-0} = 0x3c;
606}
Zoran Jovanovicccb70ca2013-11-13 13:15:03 +0000607
608class TEQI_FM_MM<bits<5> funct> : MMArch {
609 bits<5> rs;
610 bits<16> imm16;
611
612 bits<32> Inst;
613
614 let Inst{31-26} = 0x10;
615 let Inst{25-21} = funct;
616 let Inst{20-16} = rs;
617 let Inst{15-0} = imm16;
618}
Zoran Jovanovicff9d5f32013-12-19 16:12:56 +0000619
620class LL_FM_MM<bits<4> funct> {
621 bits<5> rt;
622 bits<21> addr;
623
624 bits<32> Inst;
625
626 let Inst{31-26} = 0x18;
627 let Inst{25-21} = rt;
628 let Inst{20-16} = addr{20-16};
629 let Inst{15-12} = funct;
630 let Inst{11-0} = addr{11-0};
631}
Zoran Jovanovicce024862013-12-20 15:44:08 +0000632
633class ADDS_FM_MM<bits<2> fmt, bits<8> funct> : MMArch {
634 bits<5> ft;
635 bits<5> fs;
636 bits<5> fd;
637
638 bits<32> Inst;
639
640 let Inst{31-26} = 0x15;
641 let Inst{25-21} = ft;
642 let Inst{20-16} = fs;
643 let Inst{15-11} = fd;
644 let Inst{10} = 0;
645 let Inst{9-8} = fmt;
646 let Inst{7-0} = funct;
647
648 list<dag> Pattern = [];
649}
650
651class LWXC1_FM_MM<bits<9> funct> : MMArch {
652 bits<5> fd;
653 bits<5> base;
654 bits<5> index;
655
656 bits<32> Inst;
657
658 let Inst{31-26} = 0x15;
659 let Inst{25-21} = index;
660 let Inst{20-16} = base;
661 let Inst{15-11} = fd;
662 let Inst{10-9} = 0x0;
663 let Inst{8-0} = funct;
664}
665
666class SWXC1_FM_MM<bits<9> funct> : MMArch {
667 bits<5> fs;
668 bits<5> base;
669 bits<5> index;
670
671 bits<32> Inst;
672
673 let Inst{31-26} = 0x15;
674 let Inst{25-21} = index;
675 let Inst{20-16} = base;
676 let Inst{15-11} = fs;
677 let Inst{10-9} = 0x0;
678 let Inst{8-0} = funct;
679}
680
681class CEQS_FM_MM<bits<2> fmt> : MMArch {
682 bits<5> fs;
683 bits<5> ft;
684 bits<4> cond;
685
686 bits<32> Inst;
687
688 let Inst{31-26} = 0x15;
689 let Inst{25-21} = ft;
690 let Inst{20-16} = fs;
691 let Inst{15-13} = 0x0; // cc
692 let Inst{12} = 0;
693 let Inst{11-10} = fmt;
694 let Inst{9-6} = cond;
695 let Inst{5-0} = 0x3c;
696}
697
698class BC1F_FM_MM<bits<5> tf> : MMArch {
699 bits<16> offset;
700
701 bits<32> Inst;
702
703 let Inst{31-26} = 0x10;
704 let Inst{25-21} = tf;
705 let Inst{20-18} = 0x0; // cc
706 let Inst{17-16} = 0x0;
707 let Inst{15-0} = offset;
708}
709
710class ROUND_W_FM_MM<bits<1> fmt, bits<8> funct> : MMArch {
711 bits<5> fd;
712 bits<5> fs;
713
714 bits<32> Inst;
715
716 let Inst{31-26} = 0x15;
717 let Inst{25-21} = fd;
718 let Inst{20-16} = fs;
719 let Inst{15} = 0;
720 let Inst{14} = fmt;
721 let Inst{13-6} = funct;
722 let Inst{5-0} = 0x3b;
723}
724
725class ABS_FM_MM<bits<2> fmt, bits<7> funct> : MMArch {
726 bits<5> fd;
727 bits<5> fs;
728
729 bits<32> Inst;
730
731 let Inst{31-26} = 0x15;
732 let Inst{25-21} = fd;
733 let Inst{20-16} = fs;
734 let Inst{15} = 0;
735 let Inst{14-13} = fmt;
736 let Inst{12-6} = funct;
737 let Inst{5-0} = 0x3b;
738}
Zoran Jovanovic8876be32013-12-25 10:09:27 +0000739
740class CMov_F_F_FM_MM<bits<9> func, bits<2> fmt> : MMArch {
741 bits<5> fd;
742 bits<5> fs;
743
744 bits<32> Inst;
745
746 let Inst{31-26} = 0x15;
747 let Inst{25-21} = fd;
748 let Inst{20-16} = fs;
749 let Inst{15-13} = 0x0; //cc
750 let Inst{12-11} = 0x0;
751 let Inst{10-9} = fmt;
752 let Inst{8-0} = func;
753}
754
755class CMov_I_F_FM_MM<bits<8> funct, bits<2> fmt> : MMArch {
756 bits<5> fd;
757 bits<5> fs;
758 bits<5> rt;
759
760 bits<32> Inst;
761
762 let Inst{31-26} = 0x15;
763 let Inst{25-21} = rt;
764 let Inst{20-16} = fs;
765 let Inst{15-11} = fd;
766 let Inst{9-8} = fmt;
767 let Inst{7-0} = funct;
768}
769
770class MFC1_FM_MM<bits<8> funct> : MMArch {
771 bits<5> rt;
772 bits<5> fs;
773
774 bits<32> Inst;
775
776 let Inst{31-26} = 0x15;
777 let Inst{25-21} = rt;
778 let Inst{20-16} = fs;
779 let Inst{15-14} = 0x0;
780 let Inst{13-6} = funct;
781 let Inst{5-0} = 0x3b;
782}
783
784class MADDS_FM_MM<bits<6> funct>: MMArch {
785 bits<5> ft;
786 bits<5> fs;
787 bits<5> fd;
788 bits<5> fr;
789
790 bits<32> Inst;
791
792 let Inst{31-26} = 0x15;
793 let Inst{25-21} = ft;
794 let Inst{20-16} = fs;
795 let Inst{15-11} = fd;
796 let Inst{10-6} = fr;
797 let Inst{5-0} = funct;
798}
Zoran Jovanovic73ff9482014-08-14 12:09:10 +0000799
800class COMPACT_BRANCH_FM_MM<bits<5> funct> {
801 bits<5> rs;
802 bits<16> offset;
803
804 bits<32> Inst;
805
806 let Inst{31-26} = 0x10;
807 let Inst{25-21} = funct;
808 let Inst{20-16} = rs;
809 let Inst{15-0} = offset;
810}
Zoran Jovanovic4e7ac4a2014-09-12 13:33:33 +0000811
812class COP0_TLB_FM_MM<bits<10> op> : MMArch {
813 bits<32> Inst;
814
815 let Inst{31-26} = 0x0;
816 let Inst{25-16} = 0x0;
817 let Inst{15-6} = op;
818 let Inst{5-0} = 0x3c;
819}
Jozef Kolekdc62fc42014-11-19 11:25:50 +0000820
821class SDBBP_FM_MM : MMArch {
822 bits<10> code_;
823
824 bits<32> Inst;
825
826 let Inst{31-26} = 0x0;
827 let Inst{25-16} = code_;
828 let Inst{15-6} = 0x36d;
829 let Inst{5-0} = 0x3c;
830}
831
832class RDHWR_FM_MM : MMArch {
833 bits<5> rt;
834 bits<5> rd;
835
836 bits<32> Inst;
837
838 let Inst{31-26} = 0x0;
839 let Inst{25-21} = rt;
840 let Inst{20-16} = rd;
841 let Inst{15-6} = 0x1ac;
842 let Inst{5-0} = 0x3c;
843}
Jozef Kolek5f95dd22014-11-19 11:39:12 +0000844
845class LWXS_FM_MM<bits<10> funct> {
846 bits<5> rd;
847 bits<5> base;
848 bits<5> index;
849
850 bits<32> Inst;
851
852 let Inst{31-26} = 0x0;
853 let Inst{25-21} = index;
854 let Inst{20-16} = base;
855 let Inst{15-11} = rd;
856 let Inst{10} = 0;
857 let Inst{9-0} = funct;
858}
Zoran Jovanovica4c4b5f2014-11-19 16:44:02 +0000859
860class LWM_FM_MM<bits<4> funct> : MMArch {
861 bits<5> rt;
862 bits<21> addr;
863
864 bits<32> Inst;
865
866 let Inst{31-26} = 0x8;
867 let Inst{25-21} = rt;
868 let Inst{20-16} = addr{20-16};
869 let Inst{15-12} = funct;
870 let Inst{11-0} = addr{11-0};
871}
Zoran Jovanovicf9a02502014-11-27 18:28:59 +0000872
873class LWM_FM_MM16<bits<4> funct> : MMArch {
874 bits<2> rt;
875 bits<4> addr;
876
877 bits<16> Inst;
878
879 let Inst{15-10} = 0x11;
880 let Inst{9-6} = funct;
881 let Inst{5-4} = rt;
882 let Inst{3-0} = addr;
883}
Jozef Kolekab6d1cc2014-12-23 19:55:34 +0000884
885class CACHE_PREF_FM_MM<bits<6> op, bits<4> funct> : MMArch {
886 bits<21> addr;
887 bits<5> hint;
888 bits<5> base = addr{20-16};
889 bits<12> offset = addr{11-0};
890
891 bits<32> Inst;
892
893 let Inst{31-26} = op;
894 let Inst{25-21} = hint;
895 let Inst{20-16} = base;
896 let Inst{15-12} = funct;
897 let Inst{11-0} = offset;
898}
899
900class BARRIER_FM_MM<bits<5> op> : MMArch {
901 bits<32> Inst;
902
903 let Inst{31-26} = 0x0;
904 let Inst{25-21} = 0x0;
905 let Inst{20-16} = 0x0;
906 let Inst{15-11} = op;
907 let Inst{10-6} = 0x0;
908 let Inst{5-0} = 0x0;
909}
Jozef Kolek2c6d7322015-01-21 12:10:11 +0000910
911class ADDIUPC_FM_MM {
912 bits<3> rs;
913 bits<23> imm;
914
915 bits<32> Inst;
916
917 let Inst{31-26} = 0x1e;
918 let Inst{25-23} = rs;
919 let Inst{22-0} = imm;
920}