Debian Codegraph @

arch/TriCore/TriCoreInstrFormats.td

raw
1 //==-- TriCoreInstrFormats.td - TriCore Instruction Formats -*- tablegen -*-==//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 //===----------------------------------------------------------------------===//
11 // Describe TriCore instructions format
12 //
13 // CPU INSTRUCTION FORMATS
14 //
15 // op1 - primary operation code
16 // op2 - secondary operation code
17 // s1 - source register 1
18 // s2 - source register 2
19 // s3 - source register 3
20 // d - destination register
21 // b - bit value
22 // n -
23 // - multiplication result shift value (0b00 or 0b01)
24 // - address shift value in add scale
25 // - default to zero in all other operations using the RR format
26 // - coprocessor number for coprocessor instructions
27 // const[b=(4|9|16)] - b bits immediate value
28 // disp[b=(4|8|15|24)] - b bits displacement value
29 // off[b=(4|10|16)] - b bits offset value
30 //
31 //===----------------------------------------------------------------------===//
32
33 class InstTriCore<dag outs, dag ins, string asmstr, list<dag> pattern>
34 : Instruction {
35
36 let Namespace = "TriCore";
37 /// outs and ins are inherited from the instruction class.
38 dag OutOperandList = outs;
39 dag InOperandList = ins;
40 let AsmString = asmstr;
41 let Pattern = pattern;
42 }
43
44 // TriCore pseudo instructions format
45 class Pseudo<dag outs, dag ins, string asmstr, list<dag> pattern>
46 : InstTriCore<outs, ins, asmstr, pattern> {
47 let isPseudo = 1;
48 }
49
50 //===----------------------------------------------------------------------===//
51 // Generic 16-bit Instruction Format
52 //===----------------------------------------------------------------------===//
53 class T16<dag outs, dag ins, string asmstr, list<dag> pattern>
54 : InstTriCore<outs, ins, asmstr, pattern> {
55 field bits<16> Inst;
56 let Size = 2;
57 field bits<16> SoftFail = 0;
58 }
59
60 //===----------------------------------------------------------------------===//
61 // Generic 32-bit Instruction Format
62 //===----------------------------------------------------------------------===//
63 class T32<dag outs, dag ins, string asmstr, list<dag> pattern>
64 : InstTriCore<outs, ins, asmstr, pattern> {
65 field bits<32> Inst;
66 let Size = 4;
67 field bits<32> SoftFail = 0;
68 }
69
70 //===----------------------------------------------------------------------===//
71 // 16-bit SB Instruction Format: <disp8|op1>
72 //===----------------------------------------------------------------------===//
73 class SB<bits<8> op1, dag outs, dag ins, string asmstr, list<dag> pattern>
74 : T16<outs, ins, asmstr, pattern> {
75
76 bits<8> disp8;
77 let Inst{15-8} = disp8;
78 let Inst{7-0} = op1;
79 let DecoderMethod = "DecodeSBInstruction";
80 }
81
82 //===----------------------------------------------------------------------===//
83 // 16-bit SBC Instruction Format: <const4|disp4|op1>
84 //===----------------------------------------------------------------------===//
85 class SBC<bits<8> op1, dag outs, dag ins, string asmstr, list<dag> pattern>
86 : T16<outs, ins, asmstr, pattern> {
87
88 bits<4> const4;
89 bits<4> disp4;
90
91 let Inst{15-12} = const4;
92 let Inst{11-8} = disp4;
93 let Inst{7-0} = op1;
94 let DecoderMethod = "DecodeSBCInstruction";
95 }
96
97 //===----------------------------------------------------------------------===//
98 // 16-bit SBR Instruction Format: <s2|disp4|op1>
99 //===----------------------------------------------------------------------===//
100 class SBR<bits<8> op1, dag outs, dag ins, string asmstr, list<dag> pattern>
101 : T16<outs, ins, asmstr, pattern> {
102
103 bits<4> s2;
104 bits<4> disp4;
105
106 let Inst{15-12} = s2;
107 let Inst{11-8} = disp4;
108 let Inst{7-0} = op1;
109 let DecoderMethod = "DecodeSBRInstruction";
110 }
111
112 //===----------------------------------------------------------------------===//
113 // 16-bit SBRN Instruction Format: <n|disp4|op1>
114 //===----------------------------------------------------------------------===//
115 class SBRN<bits<8> op1, dag outs, dag ins, string asmstr, list<dag> pattern>
116 : T16<outs, ins, asmstr, pattern> {
117
118 bits<4> n;
119 bits<4> disp4;
120
121 let Inst{15-12} = n;
122 let Inst{11-8} = disp4;
123 let Inst{7-0} = op1;
124 let DecoderMethod = "DecodeSBRNInstruction";
125 }
126
127 //===----------------------------------------------------------------------===//
128 // 16-bit SC Instruction Format: <const8|op1>
129 //===----------------------------------------------------------------------===//
130 class SC<bits<8> op1, dag outs, dag ins, string asmstr, list<dag> pattern>
131 : T16<outs, ins, asmstr, pattern> {
132
133 bits<8> const8;
134
135 let Inst{15-8} = const8;
136 let Inst{7-0} = op1;
137 let DecoderMethod = "DecodeSCInstruction";
138 }
139
140 //===----------------------------------------------------------------------===//
141 // 16-bit SLR Instruction Format: <s2|d|op1>
142 //===----------------------------------------------------------------------===//
143 class SLR<bits<8> op1, dag outs, dag ins, string asmstr, list<dag> pattern>
144 : T16<outs, ins, asmstr, pattern> {
145
146 bits<4> s2;
147 bits<4> d;
148
149 let Inst{15-12} = s2;
150 let Inst{11-8} = d;
151 let Inst{7-0} = op1;
152 let DecoderMethod = "DecodeSLRInstruction";
153 }
154
155 //===----------------------------------------------------------------------===//
156 // 16-bit SLRO Instruction Format: <off4|d|op1>
157 //===----------------------------------------------------------------------===//
158 class SLRO<bits<8> op1, dag outs, dag ins, string asmstr, list<dag> pattern>
159 : T16<outs, ins, asmstr, pattern> {
160
161 bits<4> off4;
162 bits<4> d;
163
164 let Inst{15-12} = off4;
165 let Inst{11-8} = d;
166 let Inst{7-0} = op1;
167 let DecoderMethod = "DecodeSLROInstruction";
168 }
169
170 //===----------------------------------------------------------------------===//
171 // 16-bit SR Instruction Format: <op2|s1/d|op1>
172 //===----------------------------------------------------------------------===//
173 class SR<bits<8> op1, bits<4> op2, dag outs, dag ins, string asmstr,
174 list<dag> pattern> : T16<outs, ins, asmstr, pattern> {
175
176 bits<4> s1_d;
177
178 let Inst{15-12} = op2;
179 let Inst{11-8} = s1_d;
180 let Inst{7-0} = op1;
181 let DecoderMethod = "DecodeSRInstruction";
182 }
183
184 //===----------------------------------------------------------------------===//
185 // 16-bit SRC Instruction Format: <const4|s1/d|op1>
186 //===----------------------------------------------------------------------===//
187 class SRC<bits<8> op1, dag outs, dag ins, string asmstr, list<dag> pattern>
188 : T16<outs, ins, asmstr, pattern> {
189
190 bits<4> const4;
191 bits<4> s1_d;
192
193 let Inst{15-12} = const4;
194 let Inst{11-8} = s1_d;
195 let Inst{7-0} = op1;
196 let DecoderMethod = "DecodeSRCInstruction";
197 }
198
199 //===----------------------------------------------------------------------===//
200 // 16-bit SRO Instruction Format: <s2|off4|op1>
201 //===----------------------------------------------------------------------===//
202 class SRO<bits<8> op1, dag outs, dag ins, string asmstr, list<dag> pattern>
203 : T16<outs, ins, asmstr, pattern> {
204
205 bits<4> s2;
206 bits<4> off4;
207
208 let Inst{15-12} = s2;
209 let Inst{11-8} = off4;
210 let Inst{7-0} = op1;
211 let DecoderMethod = "DecodeSROInstruction";
212 }
213
214 //===----------------------------------------------------------------------===//
215 // 16-bit SRR Instruction Format: <s2|s1/d|op1>
216 //===----------------------------------------------------------------------===//
217 class SRR<bits<8> op1, dag outs, dag ins, string asmstr, list<dag> pattern>
218 : T16<outs, ins, asmstr, pattern> {
219
220 bits<4> s2;
221 bits<4> s1_d;
222
223 let Inst{15-12} = s2;
224 let Inst{11-8} = s1_d;
225 let Inst{7-0} = op1;
226 let DecoderMethod = "DecodeSRRInstruction";
227 }
228
229 //===----------------------------------------------------------------------===//
230 // 16-bit SRRS Instruction Format: <s2|s1/d|n|op1>
231 //===----------------------------------------------------------------------===//
232 class SRRS<bits<6> op1, dag outs, dag ins, string asmstr, list<dag> pattern>
233 : T16<outs, ins, asmstr, pattern> {
234
235 bits<4> s2;
236 bits<4> s1_d;
237 bits<2> n;
238
239 let Inst{15-12} = s2;
240 let Inst{11-8} = s1_d;
241 let Inst{7-6} = n;
242 let Inst{5-0} = op1;
243 let DecoderMethod = "DecodeSRRSInstruction";
244 }
245
246 //===----------------------------------------------------------------------===//
247 // 16-bit SSR Instruction Format: <s2|s1/d|op1>
248 //===----------------------------------------------------------------------===//
249 class SSR<bits<8> op1, dag outs, dag ins, string asmstr, list<dag> pattern>
250 : T16<outs, ins, asmstr, pattern> {
251
252 bits<4> s2;
253 bits<4> s1;
254
255 let Inst{15-12} = s2;
256 let Inst{11-8} = s1;
257 let Inst{7-0} = op1;
258 let DecoderMethod = "DecodeSSRInstruction";
259 }
260
261 //===----------------------------------------------------------------------===//
262 // 16-bit SSRO Instruction Format: <s2|s1/d|op1>
263 //===----------------------------------------------------------------------===//
264 class SSRO<bits<8> op1, dag outs, dag ins, string asmstr, list<dag> pattern>
265 : T16<outs, ins, asmstr, pattern> {
266
267 bits<4> off4;
268 bits<4> s1;
269
270 let Inst{15-12} = off4;
271 let Inst{11-8} = s1;
272 let Inst{7-0} = op1;
273 let DecoderMethod = "DecodeSSROInstruction";
274 }
275
276 //===----------------------------------------------------------------------===//
277 // 32-bit ABS Instruction Format:
278 // <off18[9:6]|op2|off18[13:10]|off18[5:0]|off18[17:14]|s1/d|op1>
279 //===----------------------------------------------------------------------===//
280 class ABS<bits<8> op1, bits<2> op2, dag outs, dag ins, string asmstr,
281 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
282
283 bits<18> off18;
284 bits<4> s1_d;
285
286 let Inst{31-28} = off18{9-6};
287 let Inst{27-26} = op2;
288 let Inst{25-22} = off18{13-10};
289 let Inst{21-16} = off18{5-0};
290 let Inst{15-12} = off18{17-14};
291 let Inst{11-8} = s1_d;
292 let Inst{7-0} = op1;
293 let DecoderMethod = "DecodeABSInstruction";
294 }
295
296 //===----------------------------------------------------------------------===//
297 // 32-bit ABSB Instruction Format:
298 // <off18[9:6]|op2|off18[13:10]|off18[5:0]|off18[17:14]|b|bpos3|op1>
299 //===----------------------------------------------------------------------===//
300 class ABSB<bits<8> op1, bits<2> op2, dag outs, dag ins, string asmstr,
301 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
302
303 bits<18> off18;
304 bits<1> b;
305 bits<3> bpos3;
306
307 let Inst{31-28} = off18{9-6};
308 let Inst{27-26} = op2;
309 let Inst{25-22} = off18{13-10};
310 let Inst{21-16} = off18{5-0};
311 let Inst{15-12} = off18{17-14};
312 let Inst{11} = b;
313 let Inst{10-8} = bpos3;
314 let Inst{7-0} = op1;
315 let DecoderMethod = "DecodeABSBInstruction";
316 }
317
318 //===----------------------------------------------------------------------===//
319 // 32-bit B Instruction Format:
320 // <disp24[15:0]|disp24[23:16]|op1>
321 //===----------------------------------------------------------------------===//
322 class B<bits<8> op1, dag outs, dag ins, string asmstr,
323 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
324
325 bits<24> disp24;
326
327 let Inst{31-16} = disp24{15-0};
328 let Inst{15-8} = disp24{23-16};
329 let Inst{7-0} = op1;
330 let DecoderMethod = "DecodeBInstruction";
331 }
332
333 //===----------------------------------------------------------------------===//
334 // 32-bit BIT Instruction Format: <d|pos2|op2|pos1|s2|s1|op1>
335 //===----------------------------------------------------------------------===//
336 class BIT<bits<8> op1, bits<2> op2, dag outs, dag ins, string asmstr,
337 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
338
339 bits<4> d;
340 bits<5> pos2;
341 bits<5> pos1;
342 bits<4> s2;
343 bits<4> s1;
344
345 let Inst{31-28} = d;
346 let Inst{27-23} = pos2;
347 let Inst{22-21} = op2;
348 let Inst{20-16} = pos1;
349 let Inst{15-12} = s2;
350 let Inst{11-8} = s1;
351 let Inst{7-0} = op1;
352 let DecoderMethod = "DecodeBITInstruction";
353 }
354
355 //===----------------------------------------------------------------------===//
356 // 32-bit BO Instruction Format: <off10[9:6]|op2|off10[5:0]|s2|s1/d|op1>
357 //===----------------------------------------------------------------------===//
358 class BO<bits<8> op1, bits<6> op2, dag outs, dag ins, string asmstr,
359 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
360
361 bits<10> off10;
362 bits<4> s2;
363 bits<4> s1_d;
364
365 let Inst{31-28} = off10{9-6};
366 let Inst{27-22} = op2;
367 let Inst{21-16} = off10{5-0};
368 let Inst{15-12} = s2;
369 let Inst{11-8} = s1_d;
370 let Inst{7-0} = op1;
371 let DecoderMethod = "DecodeBOInstruction";
372 }
373
374 //===----------------------------------------------------------------------===//
375 // 32-bit BOL Instruction Format:
376 // <off16[9:6]|off16[15:10]|off16[5:0]|s2|s1/d|op1>
377 //===----------------------------------------------------------------------===//
378 class BOL<bits<8> op1, dag outs, dag ins, string asmstr,
379 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
380
381 bits<16> off16;
382 bits<4> s2;
383 bits<4> s1_d;
384
385 let Inst{31-28} = off16{9-6};
386 let Inst{27-22} = off16{15-10};
387 let Inst{21-16} = off16{5-0};
388 let Inst{15-12} = s2;
389 let Inst{11-8} = s1_d;
390 let Inst{7-0} = op1;
391 let DecoderMethod = "DecodeBOLInstruction";
392 }
393
394 //===----------------------------------------------------------------------===//
395 // 32-bit BRC Instruction Format: <op2|disp15|const4|s1|op1>
396 //===----------------------------------------------------------------------===//
397 class BRC<bits<8> op1, bits<1> op2, dag outs, dag ins, string asmstr,
398 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
399
400 bits<15> disp15;
401 bits<4> const4;
402 bits<4> s1;
403
404 let Inst{31} = op2;
405 let Inst{30-16} = disp15;
406 let Inst{15-12} = const4;
407 let Inst{11-8} = s1;
408 let Inst{7-0} = op1;
409 let DecoderMethod = "DecodeBRCInstruction";
410 }
411
412 //===----------------------------------------------------------------------===//
413 // 32-bit BRN Instruction Format: <op2|disp15|n[3:0]|s1|n[4]|op1>
414 //===----------------------------------------------------------------------===//
415 class BRN<bits<7> op1, bits<1> op2, dag outs, dag ins, string asmstr,
416 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
417
418 bits<15> disp15;
419 bits<5> n;
420 bits<4> s1;
421
422 let Inst{31} = op2;
423 let Inst{30-16} = disp15;
424 let Inst{15-12} = n{3-0};
425 let Inst{11-8} = s1;
426 let Inst{7} = n{4};
427 let Inst{6-0} = op1;
428 let DecoderMethod = "DecodeBRNInstruction";
429 }
430
431 //===----------------------------------------------------------------------===//
432 // 32-bit BRR Instruction Format: <op2|disp15|const4|s1|op1>
433 //===----------------------------------------------------------------------===//
434 class BRR<bits<8> op1, bits<1> op2, dag outs, dag ins, string asmstr,
435 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
436
437 bits<15> disp15;
438 bits<4> s2;
439 bits<4> s1;
440
441 let Inst{31} = op2;
442 let Inst{30-16} = disp15;
443 let Inst{15-12} = s2;
444 let Inst{11-8} = s1;
445 let Inst{7-0} = op1;
446 let DecoderMethod = "DecodeBRRInstruction";
447 }
448
449 //===----------------------------------------------------------------------===//
450 // 32-bit RC Instruction Format: <d|op2|const9|s1|op1>
451 //===----------------------------------------------------------------------===//
452 class RC<bits<8> op1, bits<7> op2, dag outs, dag ins, string asmstr,
453 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
454
455 bits<4> d;
456 bits<9> const9;
457 bits<4> s1;
458
459 let Inst{31-28} = d;
460 let Inst{27-21} = op2;
461 let Inst{20-12} = const9;
462 let Inst{11-8} = s1;
463 let Inst{7-0} = op1;
464 let DecoderMethod = "DecodeRCInstruction";
465 }
466
467 //===----------------------------------------------------------------------===//
468 // 32-bit RCPW Instruction Format: <d|pos|op2|width|const4|s1|op1>
469 //===----------------------------------------------------------------------===//
470 class RCPW<bits<8> op1, bits<2> op2 , dag outs, dag ins, string asmstr,
471 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
472
473 bits<4> d;
474 bits<5> pos;
475 bits<5> width;
476 bits<4> const4;
477 bits<4> s1;
478
479 let Inst{31-28} = d;
480 let Inst{27-23} = pos;
481 let Inst{22-21} = op2;
482 let Inst{20-16} = width;
483 let Inst{15-12} = const4;
484 let Inst{11-8} = s1;
485 let Inst{7-0} = op1;
486 let DecoderMethod = "DecodeRCPWInstruction";
487 }
488
489 //===----------------------------------------------------------------------===//
490 // 32-bit RCR Instruction Format: <d|s3|op2|const9|s1|op1>
491 //===----------------------------------------------------------------------===//
492 class RCR<bits<8> op1, bits<3> op2, dag outs, dag ins, string asmstr,
493 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
494
495 bits<4> d;
496 bits<4> s3;
497 bits<9> const9;
498 bits<4> s1;
499
500 let Inst{31-28} = d;
501 let Inst{27-24} = s3;
502 let Inst{23-21} = op2;
503 let Inst{20-12} = const9;
504 let Inst{11-8} = s1;
505 let Inst{7-0} = op1;
506 let DecoderMethod = "DecodeRCRInstruction";
507 }
508
509 //===----------------------------------------------------------------------===//
510 // 32-bit RCRR Instruction Format: <d|s3|op2|-|const4|s1|op1>
511 //===----------------------------------------------------------------------===//
512 class RCRR<bits<8> op1, bits<3> op2, dag outs, dag ins, string asmstr,
513 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
514
515 bits<4> d;
516 bits<4> s3;
517 bits<4> const4;
518 bits<4> s1;
519
520 let Inst{31-28} = d;
521 let Inst{27-24} = s3;
522 let Inst{23-21} = op2;
523 let Inst{20-16} = 0;
524 let Inst{15-12} = const4;
525 let Inst{11-8} = s1;
526 let Inst{7-0} = op1;
527 let DecoderMethod = "DecodeRCRRInstruction";
528 }
529
530 //===----------------------------------------------------------------------===//
531 // 32-bit RCRW Instruction Format: <d|s3|op2|width|const4|s1|op1>
532 //===----------------------------------------------------------------------===//
533 class RCRW<bits<8> op1, bits<3> op2, dag outs, dag ins, string asmstr,
534 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
535
536 bits<4> d;
537 bits<4> s3;
538 bits<5> width;
539 bits<4> const4;
540 bits<4> s1;
541
542 let Inst{31-28} = d;
543 let Inst{27-24} = s3;
544 let Inst{23-21} = op2;
545 let Inst{20-16} = width;
546 let Inst{15-12} = const4;
547 let Inst{11-8} = s1;
548 let Inst{7-0} = op1;
549 let DecoderMethod = "DecodeRCRWInstruction";
550 }
551
552 //===----------------------------------------------------------------------===//
553 // 32-bit RLC Instruction Format: <d|const16|s1|op1>
554 //===----------------------------------------------------------------------===//
555 class RLC<bits<8> op1, dag outs, dag ins, string asmstr,
556 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
557
558 bits<4> d;
559 bits<16> const16;
560 bits<4> s1;
561
562 let Inst{31-28} = d;
563 let Inst{27-12} = const16;
564 let Inst{11-8} = s1;
565 let Inst{7-0} = op1;
566 let DecoderMethod = "DecodeRLCInstruction";
567 }
568
569 //===----------------------------------------------------------------------===//
570 // 32-bit RR Instruction Format: <d|op2|-|n|s2|s1|op1>
571 //===----------------------------------------------------------------------===//
572 class RR<bits<8> op1, bits<8> op2, dag outs, dag ins, string asmstr,
573 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
574
575 bits<4> d;
576 bits<2> n;
577 bits<4> s2;
578 bits<4> s1;
579
580 let Inst{31-28} = d;
581 let Inst{27-20} = op2;
582 let Inst{19-18} = 0;
583 let Inst{17-16} = n;
584 let Inst{15-12} = s2;
585 let Inst{11-8} = s1;
586 let Inst{7-0} = op1;
587 let DecoderMethod = "DecodeRRInstruction";
588 }
589
590 //===----------------------------------------------------------------------===//
591 // 32-bit RR1 Instruction Format: <d|op2|n|s2|s1|op1>
592 //===----------------------------------------------------------------------===//
593 class RR1<bits<8> op1, bits<10> op2, dag outs, dag ins, string asmstr,
594 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
595
596 bits<4> d;
597 bits<2> n;
598 bits<4> s2;
599 bits<4> s1;
600
601
602 let Inst{31-28} = d;
603 let Inst{27-18} = op2;
604 let Inst{17-16} = n;
605 let Inst{15-12} = s2;
606 let Inst{11-8} = s1;
607 let Inst{7-0} = op1;
608 let DecoderMethod = "DecodeRR1Instruction";
609 }
610
611 //===----------------------------------------------------------------------===//
612 // 32-bit RR2 Instruction Format: <d|op2|s2|s1|op1>
613 //===----------------------------------------------------------------------===//
614 class RR2<bits<8> op1, bits<12> op2, dag outs, dag ins, string asmstr,
615 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
616
617 bits<4> d;
618 bits<4> s2;
619 bits<4> s1;
620
621 let Inst{31-28} = d;
622 let Inst{27-16} = op2;
623 let Inst{15-12} = s2;
624 let Inst{11-8} = s1;
625 let Inst{7-0} = op1;
626 let DecoderMethod = "DecodeRR2Instruction";
627 }
628
629 //===----------------------------------------------------------------------===//
630 // 32-bit RRPW Instruction Format: <d|pos|op2|width|s2|s1|op1>
631 //===----------------------------------------------------------------------===//
632 class RRPW<bits<8> op1, bits<2> op2, dag outs, dag ins, string asmstr,
633 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
634
635 bits<4> d;
636 bits<5> pos;
637 bits<5> width;
638 bits<4> s2;
639 bits<4> s1;
640
641 let Inst{31-28} = d;
642 let Inst{27-23} = pos;
643 let Inst{22-21} = op2;
644 let Inst{20-16} = width;
645 let Inst{15-12} = s2;
646 let Inst{11-8} = s1;
647 let Inst{7-0} = op1;
648 let DecoderMethod = "DecodeRRPWInstruction";
649 }
650
651 //===----------------------------------------------------------------------===//
652 // 32-bit RRR Instruction Format: <d|s3|op2|-|n|s2|s1|op1>
653 //===----------------------------------------------------------------------===//
654 class RRR<bits<8> op1, bits<4> op2, dag outs, dag ins, string asmstr,
655 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
656
657 bits<4> d;
658 bits<4> s3;
659 bits<2> n;
660 bits<4> s2;
661 bits<4> s1;
662
663 let Inst{31-28} = d;
664 let Inst{27-24} = s3;
665 let Inst{23-20} = op2;
666 let Inst{19-18} = 0;
667 let Inst{17-16} = n;
668 let Inst{15-12} = s2;
669 let Inst{11-8} = s1;
670 let Inst{7-0} = op1;
671 let DecoderMethod = "DecodeRRRInstruction";
672 }
673
674 //===----------------------------------------------------------------------===//
675 // 32-bit RRR1 Instruction Format: <d|s3|op2|n|s2|s1|op1>
676 //===----------------------------------------------------------------------===//
677 class RRR1<bits<8> op1, bits<6> op2, dag outs, dag ins, string asmstr,
678 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
679
680 bits<4> d;
681 bits<4> s3;
682 bits<2> n;
683 bits<4> s2;
684 bits<4> s1;
685
686 let Inst{31-28} = d;
687 let Inst{27-24} = s3;
688 let Inst{23-18} = op2;
689 let Inst{17-16} = n;
690 let Inst{15-12} = s2;
691 let Inst{11-8} = s1;
692 let Inst{7-0} = op1;
693 let DecoderMethod = "DecodeRRR1Instruction";
694 }
695
696 //===----------------------------------------------------------------------===//
697 // 32-bit RRR2 Instruction Format: <d|s3|op2|s2|s1|op1>
698 //===----------------------------------------------------------------------===//
699 class RRR2<bits<8> op1, bits<8> op2, dag outs, dag ins, string asmstr,
700 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
701
702 bits<4> s1;
703 bits<4> s2;
704 bits<4> s3;
705 bits<4> d;
706
707 let Inst{31-28} = d;
708 let Inst{27-24} = s3;
709 let Inst{23-16} = op2;
710 let Inst{15-12} = s2;
711 let Inst{11-8} = s1;
712 let Inst{7-0} = op1;
713 let DecoderMethod = "DecodeRRR2Instruction";
714 }
715
716 //===----------------------------------------------------------------------===//
717 // 32-bit RRRR Instruction Format: <d|s3|op2|-|s2|s1|op1>
718 //===----------------------------------------------------------------------===//
719 class RRRR<bits<8> op1, bits<3> op2, dag outs, dag ins, string asmstr,
720 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
721
722 bits<4> d;
723 bits<4> s3;
724 bits<4> s2;
725 bits<4> s1;
726
727 let Inst{31-28} = d;
728 let Inst{27-24} = s3;
729 let Inst{23-21} = op2;
730 let Inst{20-16} = 0;
731 let Inst{15-12} = s2;
732 let Inst{11-8} = s1;
733 let Inst{7-0} = op1;
734 let DecoderMethod = "DecodeRRRRInstruction";
735 }
736
737 //===----------------------------------------------------------------------===//
738 // 32-bit RRRW Instruction Format: <d|s3|op2|width|s2|s1|op1>
739 //===----------------------------------------------------------------------===//
740 class RRRW<bits<8> op1, bits<3> op2, dag outs, dag ins, string asmstr,
741 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
742
743 bits<4> d;
744 bits<4> s3;
745 bits<5> width;
746 bits<4> s2;
747 bits<4> s1;
748
749 let Inst{31-28} = d;
750 let Inst{27-24} = s3;
751 let Inst{23-21} = op2;
752 let Inst{20-16} = width;
753 let Inst{15-12} = s2;
754 let Inst{11-8} = s1;
755 let Inst{7-0} = op1;
756 let DecoderMethod = "DecodeRRRWInstruction";
757 }
758
759 //===----------------------------------------------------------------------===//
760 // 32-bit SYS Instruction Format: <-|op2|-|s1/d|op1>
761 //===----------------------------------------------------------------------===//
762 class SYS<bits<8> op1, bits<6> op2, dag outs, dag ins, string asmstr,
763 list<dag> pattern> : T32<outs, ins, asmstr, pattern> {
764
765 bits<4> s1_d;
766
767 let Inst{31-28} = 0;
768 let Inst{27-22} = op2;
769 let Inst{21-12} = 0;
770 let Inst{11-8} = s1_d;
771 let Inst{7-0} = op1;
772 let DecoderMethod = "DecodeSYSInstruction";
773 }