[mips][microMIPS] MicroMIPS 16-bit unconditional branch instruction B
[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 class 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
241 class 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
250 //===----------------------------------------------------------------------===//
251 // MicroMIPS 32-bit Instruction Formats
252 //===----------------------------------------------------------------------===//
253
254 class MMArch {
255   string Arch = "micromips";
256   list<dag> Pattern = [];
257 }
258
259 class 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
274 class 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
287 class 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;
295   let Inst{25-21} = rt;
296   let Inst{20-16} = rs;
297   let Inst{15-0}  = imm16;
298 }
299
300 class 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
312 class 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 }
324
325 class 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
340 class 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 }
354
355 class 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 }
366
367 class 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 }
379
380 class 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 }
394
395 class 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
407 class 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 }
418
419 class 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
432 class 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
445 class 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 }
460
461 class 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
470 class 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
482 class JALR_FM_MM<bits<10> funct> {
483   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 }
494
495 class 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
508 class 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
520 class 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 }
531
532 class 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
544 class 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
554 class SYS_FM_MM : MMArch {
555   bits<10> code_;
556   bits<32> Inst;
557   let Inst{31-26} = 0x0;
558   let Inst{25-16} = code_;
559   let Inst{15-6}  = 0x22d;
560   let Inst{5-0}   = 0x3c;
561 }
562
563 class WAIT_FM_MM {
564   bits<10> code_;
565   bits<32> Inst;
566
567   let Inst{31-26} = 0x00;
568   let Inst{25-16} = code_;
569   let Inst{15-6}  = 0x24d;
570   let Inst{5-0}   = 0x3c;
571 }
572
573 class 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
582 class 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
593 class 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 }
607
608 class 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 }
619
620 class 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 }
632
633 class 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
651 class 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
666 class 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
681 class 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
698 class 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
710 class 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
725 class 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 }
739
740 class 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
755 class 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
770 class 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
784 class 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 }
799
800 class 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 }
811
812 class 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 }
820
821 class 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
832 class 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 }
844
845 class 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 }
859
860 class 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 }
872
873 class 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 }
884
885 class 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
900 class 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 }