[mips][microMIPS] Implement CACHE, PREF, SSNOP, EHB and PAUSE instructions
[oota-llvm.git] / lib / Target / Mips / MicroMipsInstrFormats.td
1 //===----------------------------------------------------------------------===//
2 // MicroMIPS Base Classes
3 //===----------------------------------------------------------------------===//
4
5 //
6 // Base class for MicroMips instructions.
7 // This class does not depend on the instruction size.
8 //
9 class 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 //
30 class 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
44 class 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
58 class 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
71 class 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
83 class 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
97 class 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
111 class 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
123 class 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
134 class 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
146 class 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
156 class 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
167 class 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
178 class 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
188 class 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
198 class 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
209 class 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
221 class 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
230 //===----------------------------------------------------------------------===//
231 // MicroMIPS 32-bit Instruction Formats
232 //===----------------------------------------------------------------------===//
233
234 class MMArch {
235   string Arch = "micromips";
236   list<dag> Pattern = [];
237 }
238
239 class ADD_FM_MM<bits<6> op, bits<10> funct> : MMArch {
240   bits<5> rt;
241   bits<5> rs;
242   bits<5> rd;
243
244   bits<32> Inst;
245
246   let Inst{31-26} = op;
247   let Inst{25-21} = rt;
248   let Inst{20-16} = rs;
249   let Inst{15-11} = rd;
250   let Inst{10}    = 0;
251   let Inst{9-0}   = funct;
252 }
253
254 class ADDI_FM_MM<bits<6> op> : MMArch {
255   bits<5>  rs;
256   bits<5>  rt;
257   bits<16> imm16;
258
259   bits<32> Inst;
260
261   let Inst{31-26} = op;
262   let Inst{25-21} = rt;
263   let Inst{20-16} = rs;
264   let Inst{15-0}  = imm16;
265 }
266
267 class SLTI_FM_MM<bits<6> op> : MMArch {
268   bits<5> rt;
269   bits<5> rs;
270   bits<16> imm16;
271
272   bits<32> Inst;
273
274   let Inst{31-26} = op;
275   let Inst{25-21} = rt;
276   let Inst{20-16} = rs;
277   let Inst{15-0}  = imm16;
278 }
279
280 class LUI_FM_MM : MMArch {
281   bits<5> rt;
282   bits<16> imm16;
283
284   bits<32> Inst;
285
286   let Inst{31-26} = 0x10;
287   let Inst{25-21} = 0xd;
288   let Inst{20-16} = rt;
289   let Inst{15-0}  = imm16;
290 }
291
292 class MULT_FM_MM<bits<10> funct> : MMArch {
293   bits<5>  rs;
294   bits<5>  rt;
295
296   bits<32> Inst;
297
298   let Inst{31-26} = 0x00;
299   let Inst{25-21} = rt;
300   let Inst{20-16} = rs;
301   let Inst{15-6}  = funct;
302   let Inst{5-0}   = 0x3c;
303 }
304
305 class SRA_FM_MM<bits<10> funct, bit rotate> : MMArch {
306   bits<5> rd;
307   bits<5> rt;
308   bits<5> shamt;
309
310   bits<32> Inst;
311
312   let Inst{31-26} = 0;
313   let Inst{25-21} = rd;
314   let Inst{20-16} = rt;
315   let Inst{15-11} = shamt;
316   let Inst{10}    = rotate;
317   let Inst{9-0}   = funct;
318 }
319
320 class SRLV_FM_MM<bits<10> funct, bit rotate> : MMArch {
321   bits<5> rd;
322   bits<5> rt;
323   bits<5> rs;
324
325   bits<32> Inst;
326
327   let Inst{31-26} = 0;
328   let Inst{25-21} = rt;
329   let Inst{20-16} = rs;
330   let Inst{15-11} = rd;
331   let Inst{10}    = rotate;
332   let Inst{9-0}   = funct;
333 }
334
335 class LW_FM_MM<bits<6> op> : MMArch {
336   bits<5> rt;
337   bits<21> addr;
338
339   bits<32> Inst;
340
341   let Inst{31-26} = op;
342   let Inst{25-21} = rt;
343   let Inst{20-16} = addr{20-16};
344   let Inst{15-0}  = addr{15-0};
345 }
346
347 class LWL_FM_MM<bits<4> funct> {
348   bits<5> rt;
349   bits<21> addr;
350
351   bits<32> Inst;
352
353   let Inst{31-26} = 0x18;
354   let Inst{25-21} = rt;
355   let Inst{20-16} = addr{20-16};
356   let Inst{15-12} = funct;
357   let Inst{11-0}  = addr{11-0};
358 }
359
360 class CMov_F_I_FM_MM<bits<7> func> : MMArch {
361   bits<5> rd;
362   bits<5> rs;
363   bits<3> fcc;
364
365   bits<32> Inst;
366
367   let Inst{31-26} = 0x15;
368   let Inst{25-21} = rd;
369   let Inst{20-16} = rs;
370   let Inst{15-13} = fcc;
371   let Inst{12-6}  = func;
372   let Inst{5-0}   = 0x3b;
373 }
374
375 class MTLO_FM_MM<bits<10> funct> : MMArch {
376   bits<5> rs;
377
378   bits<32> Inst;
379
380   let Inst{31-26} = 0x00;
381   let Inst{25-21} = 0x00;
382   let Inst{20-16} = rs;
383   let Inst{15-6}  = funct;
384   let Inst{5-0}   = 0x3c;
385 }
386
387 class MFLO_FM_MM<bits<10> funct> : MMArch {
388   bits<5> rd;
389
390   bits<32> Inst;
391
392   let Inst{31-26} = 0x00;
393   let Inst{25-21} = 0x00;
394   let Inst{20-16} = rd;
395   let Inst{15-6}  = funct;
396   let Inst{5-0}   = 0x3c;
397 }
398
399 class CLO_FM_MM<bits<10> funct> : MMArch {
400   bits<5> rd;
401   bits<5> rs;
402
403   bits<32> Inst;
404
405   let Inst{31-26} = 0x00;
406   let Inst{25-21} = rd;
407   let Inst{20-16} = rs;
408   let Inst{15-6}  = funct;
409   let Inst{5-0}   = 0x3c;
410 }
411
412 class SEB_FM_MM<bits<10> funct> : MMArch {
413   bits<5> rd;
414   bits<5> rt;
415
416   bits<32> Inst;
417
418   let Inst{31-26} = 0x00;
419   let Inst{25-21} = rd;
420   let Inst{20-16} = rt;
421   let Inst{15-6}  = funct;
422   let Inst{5-0}   = 0x3c;
423 }
424
425 class EXT_FM_MM<bits<6> funct> : MMArch {
426   bits<5> rt;
427   bits<5> rs;
428   bits<5> pos;
429   bits<5> size;
430
431   bits<32> Inst;
432
433   let Inst{31-26} = 0x00;
434   let Inst{25-21} = rt;
435   let Inst{20-16} = rs;
436   let Inst{15-11} = size;
437   let Inst{10-6}  = pos;
438   let Inst{5-0}   = funct;
439 }
440
441 class J_FM_MM<bits<6> op> : MMArch {
442   bits<26> target;
443
444   bits<32> Inst;
445
446   let Inst{31-26} = op;
447   let Inst{25-0}  = target;
448 }
449
450 class JR_FM_MM<bits<8> funct> : MMArch {
451   bits<5> rs;
452
453   bits<32> Inst;
454
455   let Inst{31-21} = 0x00;
456   let Inst{20-16} = rs;
457   let Inst{15-14} = 0x0;
458   let Inst{13-6}  = funct;
459   let Inst{5-0}   = 0x3c;
460 }
461
462 class JALR_FM_MM<bits<10> funct> {
463   bits<5> rs;
464   bits<5> rd;
465
466   bits<32> Inst;
467
468   let Inst{31-26} = 0x00;
469   let Inst{25-21} = rd;
470   let Inst{20-16} = rs;
471   let Inst{15-6}  = funct;
472   let Inst{5-0}   = 0x3c;
473 }
474
475 class BEQ_FM_MM<bits<6> op> : MMArch {
476   bits<5>  rs;
477   bits<5>  rt;
478   bits<16> offset;
479
480   bits<32> Inst;
481
482   let Inst{31-26} = op;
483   let Inst{25-21} = rt;
484   let Inst{20-16} = rs;
485   let Inst{15-0}  = offset;
486 }
487
488 class BGEZ_FM_MM<bits<5> funct> : MMArch {
489   bits<5>  rs;
490   bits<16> offset;
491
492   bits<32> Inst;
493
494   let Inst{31-26} = 0x10;
495   let Inst{25-21} = funct;
496   let Inst{20-16} = rs;
497   let Inst{15-0}  = offset;
498 }
499
500 class BGEZAL_FM_MM<bits<5> funct> : MMArch {
501   bits<5>  rs;
502   bits<16> offset;
503
504   bits<32> Inst;
505
506   let Inst{31-26} = 0x10;
507   let Inst{25-21} = funct;
508   let Inst{20-16} = rs;
509   let Inst{15-0}  = offset;
510 }
511
512 class SYNC_FM_MM : MMArch {
513   bits<5> stype;
514
515   bits<32> Inst;
516
517   let Inst{31-26} = 0x00;
518   let Inst{25-21} = 0x0;
519   let Inst{20-16} = stype;
520   let Inst{15-6}  = 0x1ad;
521   let Inst{5-0}   = 0x3c;
522 }
523
524 class BRK_FM_MM : MMArch {
525   bits<10> code_1;
526   bits<10> code_2;
527   bits<32> Inst;
528   let Inst{31-26} = 0x0;
529   let Inst{25-16} = code_1;
530   let Inst{15-6}  = code_2;
531   let Inst{5-0}   = 0x07;
532 }
533
534 class SYS_FM_MM : MMArch {
535   bits<10> code_;
536   bits<32> Inst;
537   let Inst{31-26} = 0x0;
538   let Inst{25-16} = code_;
539   let Inst{15-6}  = 0x22d;
540   let Inst{5-0}   = 0x3c;
541 }
542
543 class WAIT_FM_MM {
544   bits<10> code_;
545   bits<32> Inst;
546
547   let Inst{31-26} = 0x00;
548   let Inst{25-16} = code_;
549   let Inst{15-6}  = 0x24d;
550   let Inst{5-0}   = 0x3c;
551 }
552
553 class ER_FM_MM<bits<10> funct> : MMArch {
554   bits<32> Inst;
555
556   let Inst{31-26} = 0x00;
557   let Inst{25-16} = 0x00;
558   let Inst{15-6}  = funct;
559   let Inst{5-0}   = 0x3c;
560 }
561
562 class EI_FM_MM<bits<10> funct> : MMArch {
563   bits<32> Inst;
564   bits<5> rt;
565
566   let Inst{31-26} = 0x00;
567   let Inst{25-21} = 0x00;
568   let Inst{20-16} = rt;
569   let Inst{15-6}  = funct;
570   let Inst{5-0}   = 0x3c;
571 }
572
573 class TEQ_FM_MM<bits<6> funct> : MMArch {
574   bits<5> rs;
575   bits<5> rt;
576   bits<4> code_;
577
578   bits<32> Inst;
579
580   let Inst{31-26} = 0x00;
581   let Inst{25-21} = rt;
582   let Inst{20-16} = rs;
583   let Inst{15-12} = code_;
584   let Inst{11-6}  = funct;
585   let Inst{5-0}   = 0x3c;
586 }
587
588 class TEQI_FM_MM<bits<5> funct> : MMArch {
589   bits<5> rs;
590   bits<16> imm16;
591
592   bits<32> Inst;
593
594   let Inst{31-26} = 0x10;
595   let Inst{25-21} = funct;
596   let Inst{20-16} = rs;
597   let Inst{15-0}  = imm16;
598 }
599
600 class LL_FM_MM<bits<4> funct> {
601   bits<5> rt;
602   bits<21> addr;
603
604   bits<32> Inst;
605
606   let Inst{31-26} = 0x18;
607   let Inst{25-21} = rt;
608   let Inst{20-16} = addr{20-16};
609   let Inst{15-12} = funct;
610   let Inst{11-0}  = addr{11-0};
611 }
612
613 class ADDS_FM_MM<bits<2> fmt, bits<8> funct> : MMArch {
614   bits<5> ft;
615   bits<5> fs;
616   bits<5> fd;
617
618   bits<32> Inst;
619
620   let Inst{31-26} = 0x15;
621   let Inst{25-21} = ft;
622   let Inst{20-16} = fs;
623   let Inst{15-11} = fd;
624   let Inst{10}    = 0;
625   let Inst{9-8}   = fmt;
626   let Inst{7-0}   = funct;
627
628   list<dag> Pattern = [];
629 }
630
631 class LWXC1_FM_MM<bits<9> funct> : MMArch {
632   bits<5> fd;
633   bits<5> base;
634   bits<5> index;
635
636   bits<32> Inst;
637
638   let Inst{31-26} = 0x15;
639   let Inst{25-21} = index;
640   let Inst{20-16} = base;
641   let Inst{15-11} = fd;
642   let Inst{10-9}  = 0x0;
643   let Inst{8-0}   = funct;
644 }
645
646 class SWXC1_FM_MM<bits<9> funct> : MMArch {
647   bits<5> fs;
648   bits<5> base;
649   bits<5> index;
650
651   bits<32> Inst;
652
653   let Inst{31-26} = 0x15;
654   let Inst{25-21} = index;
655   let Inst{20-16} = base;
656   let Inst{15-11} = fs;
657   let Inst{10-9}  = 0x0;
658   let Inst{8-0}   = funct;
659 }
660
661 class CEQS_FM_MM<bits<2> fmt> : MMArch {
662   bits<5> fs;
663   bits<5> ft;
664   bits<4> cond;
665
666   bits<32> Inst;
667
668   let Inst{31-26} = 0x15;
669   let Inst{25-21} = ft;
670   let Inst{20-16} = fs;
671   let Inst{15-13} = 0x0;  // cc
672   let Inst{12}    = 0;
673   let Inst{11-10} = fmt;
674   let Inst{9-6}   = cond;
675   let Inst{5-0}   = 0x3c;
676 }
677
678 class BC1F_FM_MM<bits<5> tf> : MMArch {
679   bits<16> offset;
680
681   bits<32> Inst;
682
683   let Inst{31-26} = 0x10;
684   let Inst{25-21} = tf;
685   let Inst{20-18} = 0x0; // cc
686   let Inst{17-16} = 0x0;
687   let Inst{15-0}  = offset;
688 }
689
690 class ROUND_W_FM_MM<bits<1> fmt, bits<8> funct> : MMArch {
691   bits<5> fd;
692   bits<5> fs;
693
694   bits<32> Inst;
695
696   let Inst{31-26} = 0x15;
697   let Inst{25-21} = fd;
698   let Inst{20-16} = fs;
699   let Inst{15}    = 0;
700   let Inst{14}    = fmt;
701   let Inst{13-6}  = funct;
702   let Inst{5-0}   = 0x3b;
703 }
704
705 class ABS_FM_MM<bits<2> fmt, bits<7> funct> : MMArch {
706   bits<5> fd;
707   bits<5> fs;
708
709   bits<32> Inst;
710
711   let Inst{31-26} = 0x15;
712   let Inst{25-21} = fd;
713   let Inst{20-16} = fs;
714   let Inst{15}    = 0;
715   let Inst{14-13} = fmt;
716   let Inst{12-6}  = funct;
717   let Inst{5-0}   = 0x3b;
718 }
719
720 class CMov_F_F_FM_MM<bits<9> func, bits<2> fmt> : MMArch {
721   bits<5> fd;
722   bits<5> fs;
723
724   bits<32> Inst;
725
726   let Inst{31-26} = 0x15;
727   let Inst{25-21} = fd;
728   let Inst{20-16} = fs;
729   let Inst{15-13} = 0x0; //cc
730   let Inst{12-11} = 0x0;
731   let Inst{10-9}  = fmt;
732   let Inst{8-0}   = func;
733 }
734
735 class CMov_I_F_FM_MM<bits<8> funct, bits<2> fmt> : MMArch {
736   bits<5> fd;
737   bits<5> fs;
738   bits<5> rt;
739
740   bits<32> Inst;
741
742   let Inst{31-26} = 0x15;
743   let Inst{25-21} = rt;
744   let Inst{20-16} = fs;
745   let Inst{15-11} = fd;
746   let Inst{9-8}   = fmt;
747   let Inst{7-0}   = funct;
748 }
749
750 class MFC1_FM_MM<bits<8> funct> : MMArch {
751   bits<5> rt;
752   bits<5> fs;
753
754   bits<32> Inst;
755
756   let Inst{31-26} = 0x15;
757   let Inst{25-21} = rt;
758   let Inst{20-16} = fs;
759   let Inst{15-14} = 0x0;
760   let Inst{13-6}  = funct;
761   let Inst{5-0}   = 0x3b;
762 }
763
764 class MADDS_FM_MM<bits<6> funct>: MMArch {
765   bits<5> ft;
766   bits<5> fs;
767   bits<5> fd;
768   bits<5> fr;
769
770   bits<32> Inst;
771
772   let Inst{31-26} = 0x15;
773   let Inst{25-21} = ft;
774   let Inst{20-16} = fs;
775   let Inst{15-11} = fd;
776   let Inst{10-6}  = fr;
777   let Inst{5-0}   = funct;
778 }
779
780 class COMPACT_BRANCH_FM_MM<bits<5> funct> {
781   bits<5>  rs;
782   bits<16> offset;
783
784   bits<32> Inst;
785
786   let Inst{31-26} = 0x10;
787   let Inst{25-21} = funct;
788   let Inst{20-16} = rs;
789   let Inst{15-0}  = offset;
790 }
791
792 class COP0_TLB_FM_MM<bits<10> op> : MMArch {
793   bits<32> Inst;
794
795   let Inst{31-26} = 0x0;
796   let Inst{25-16} = 0x0;
797   let Inst{15-6}  = op;
798   let Inst{5-0}   = 0x3c;
799 }
800
801 class SDBBP_FM_MM : MMArch {
802   bits<10> code_;
803
804   bits<32> Inst;
805
806   let Inst{31-26} = 0x0;
807   let Inst{25-16} = code_;
808   let Inst{15-6}  = 0x36d;
809   let Inst{5-0}   = 0x3c;
810 }
811
812 class RDHWR_FM_MM : MMArch {
813   bits<5> rt;
814   bits<5> rd;
815
816   bits<32> Inst;
817
818   let Inst{31-26} = 0x0;
819   let Inst{25-21} = rt;
820   let Inst{20-16} = rd;
821   let Inst{15-6}  = 0x1ac;
822   let Inst{5-0}   = 0x3c;
823 }
824
825 class LWXS_FM_MM<bits<10> funct> {
826   bits<5> rd;
827   bits<5> base;
828   bits<5> index;
829
830   bits<32> Inst;
831
832   let Inst{31-26} = 0x0;
833   let Inst{25-21} = index;
834   let Inst{20-16} = base;
835   let Inst{15-11} = rd;
836   let Inst{10}    = 0;
837   let Inst{9-0}   = funct;
838 }
839
840 class LWM_FM_MM<bits<4> funct> : MMArch {
841   bits<5> rt;
842   bits<21> addr;
843
844   bits<32> Inst;
845
846   let Inst{31-26} = 0x8;
847   let Inst{25-21} = rt;
848   let Inst{20-16} = addr{20-16};
849   let Inst{15-12} = funct;
850   let Inst{11-0}  = addr{11-0};
851 }
852
853 class LWM_FM_MM16<bits<4> funct> : MMArch {
854   bits<2> rt;
855   bits<4> addr;
856
857   bits<16> Inst;
858
859   let Inst{15-10} = 0x11;
860   let Inst{9-6}   = funct;
861   let Inst{5-4}   = rt;
862   let Inst{3-0}   = addr;
863 }
864
865 class CACHE_PREF_FM_MM<bits<6> op, bits<4> funct> : MMArch {
866   bits<21> addr;
867   bits<5> hint;
868   bits<5> base = addr{20-16};
869   bits<12> offset = addr{11-0};
870
871   bits<32> Inst;
872
873   let Inst{31-26} = op;
874   let Inst{25-21} = hint;
875   let Inst{20-16} = base;
876   let Inst{15-12} = funct;
877   let Inst{11-0}  = offset;
878 }
879
880 class BARRIER_FM_MM<bits<5> op> : MMArch {
881   bits<32> Inst;
882
883   let Inst{31-26} = 0x0;
884   let Inst{25-21} = 0x0;
885   let Inst{20-16} = 0x0;
886   let Inst{15-11} = op;
887   let Inst{10-6}  = 0x0;
888   let Inst{5-0}   = 0x0;
889 }