blob: 8954fa539e3d0cc97221ed31fed53b47a8840306 [file] [log] [blame]
Misha Brukmancd4f51b2004-08-02 16:54:54 +00001//===- PowerPCInstrFormats.td - PowerPC Instruction Formats --*- tablegen -*-=//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by the LLVM research group and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10//
11//===----------------------------------------------------------------------===//
12
13class Format<bits<5> val> {
14 bits<5> Value = val;
15}
16
17def Pseudo: Format<0>;
18def Gpr : Format<1>;
19def Gpr0 : Format<2>;
20def Simm16 : Format<3>;
21def Zimm16 : Format<4>;
22def PCRelimm24 : Format<5>;
23def Imm24 : Format<6>;
24def Imm5 : Format<7>;
25def PCRelimm14 : Format<8>;
26def Imm14 : Format<9>;
27def Imm2 : Format<10>;
28def Crf : Format<11>;
29def Imm3 : Format<12>;
30def Imm1 : Format<13>;
31def Fpr : Format<14>;
32def Imm4 : Format<15>;
33def Imm8 : Format<16>;
34def Disimm16 : Format<17>;
35def Disimm14 : Format<18>;
36def Spr : Format<19>;
37def Sgr : Format<20>;
38def Imm15 : Format<21>;
39def Vpr : Format<22>;
40
41class PPC32Inst : Instruction {
42 field bits<32> Inst;
43 bits<3> ArgCount;
44 bits<5> Arg0Type;
45 bits<5> Arg1Type;
46 bits<5> Arg2Type;
47 bits<5> Arg3Type;
48 bits<5> Arg4Type;
49 bit PPC64;
50 bit VMX;
51
52 let Namespace = "PPC32";
53}
54
Misha Brukman6b21bde2004-08-02 21:56:35 +000055//===----------------------------------------------------------------------===//
56//
57// PowerPC instruction formats
Misha Brukmancd4f51b2004-08-02 16:54:54 +000058
Misha Brukman6b21bde2004-08-02 21:56:35 +000059class PPC32I<string name, bits<6> opcode, bit ppc64, bit vmx> : Instruction {
60 field bits<32> Inst;
61 field bits<6> Opcode = opcode;
Misha Brukmancd4f51b2004-08-02 16:54:54 +000062
Misha Brukman6b21bde2004-08-02 21:56:35 +000063 bits<3> ArgCount;
64 bits<5> Arg0Type;
65 bits<5> Arg1Type;
66 bits<5> Arg2Type;
67 bits<5> Arg3Type;
68 bits<5> Arg4Type;
69 bit PPC64 = ppc64;
70 bit VMX = vmx;
Misha Brukmancd4f51b2004-08-02 16:54:54 +000071
Misha Brukman6b21bde2004-08-02 21:56:35 +000072 let Name = name;
73 let Inst{0-5} = Opcode;
Misha Brukmancd4f51b2004-08-02 16:54:54 +000074}
75
Misha Brukman6b21bde2004-08-02 21:56:35 +000076class XForm_base_r3xo<string name, bits<6> opcode, bits<10> xo, bit ppc64,
77 bit vmx> : PPC32I<name, opcode, ppc64, vmx> {
78 let ArgCount = 3;
79 field bits<5> A;
80 field bits<5> B;
81 field bits<5> C;
82 field bits<10> D = xo;
83 field bit Rc = 0;
84
85 let ArgCount = 3;
86 let Arg0Type = Gpr.Value;
87 let Arg1Type = Gpr.Value;
88 let Arg2Type = Gpr.Value;
89 let Arg3Type = 0;
90 let Arg4Type = 0;
91
92 let Inst{6-10} = A;
93 let Inst{11-15} = B;
94 let Inst{16-20} = C;
95 let Inst{21-30} = D;
96 let Inst{31} = Rc;
97}
98
99class XForm_6<string name, bits<6> opcode, bits<10> xo, bit rc, bit ppc64,
100 bit vmx> : XForm_base_r3xo<name, opcode, xo, ppc64, vmx> {
101 let Rc = rc;
102}
103
104class XForm_7<string name, bits<6> opcode, bits<10> xo, bit ppc64, bit vmx>
105 : XForm_6<name, opcode, xo, 1, ppc64, vmx>;
106
107class XForm_10<string name, bits<6> opcode, bits<10> xo, bit rc, bit ppc64,
108 bit vmx> : XForm_base_r3xo<name, opcode, xo, ppc64, vmx> {
109 let Rc = rc;
110 let Arg2Type = Imm5.Value;
111}
112
113class DForm_base<string name, bits<6> opcode, bit ppc64, bit vmx>
114 : PPC32I<name, opcode, ppc64, vmx> {
115 field bits<5> A;
116 field bits<5> B;
117 field bits<16> C;
118
119 let ArgCount = 3;
120 let Arg0Type = Gpr.Value;
121 let Arg1Type = Gpr.Value;
122 let Arg2Type = Simm16.Value;
123 let Arg3Type = 0;
124 let Arg4Type = 0;
125
126 let Inst{6-10} = A;
127 let Inst{11-15} = B;
128 let Inst{16-31} = C;
129}
130
131class DForm_1<string name, bits<6> opcode, bit ppc64, bit vmx>
132 : DForm_base<name, opcode, ppc64, vmx> {
133 let Arg2Type = Zimm16.Value;
134}
135
136class DForm_2<string name, bits<6> opcode, bit ppc64, bit vmx>
137 : DForm_base<name, opcode, ppc64, vmx>;
138
139class DForm_2_r0<string name, bits<6> opcode, bit ppc64, bit vmx>
140 : DForm_base<name, opcode, ppc64, vmx> {
141 let Arg1Type = Gpr0.Value;
142}
143
144// Currently we make the use/def reg distinction in ISel, not tablegen
145class DForm_3<string name, bits<6> opcode, bit ppc64, bit vmx>
146 : DForm_1<name, opcode, ppc64, vmx>;
147
148class DForm_4<string name, bits<6> opcode, bit ppc64, bit vmx>
149 : DForm_1<name, opcode, ppc64, vmx>;
150
151class DForm_7<string name, bits<6> opcode, bit ppc64, bit vmx>
152 : DForm_base<name, opcode, ppc64, vmx> {
153 let Arg1Type = Imm5.Value;
154}
155
156//===----------------------------------------------------------------------===//
157
Misha Brukmancd4f51b2004-08-02 16:54:54 +0000158class PPC32InstPattern1 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<5> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
159 let Name = name;
160 let ArgCount = 2;
161 let PPC64 = ppc64;
162 let VMX =vmx;
163
164 let Arg0Type = OperandType0.Value;
165 let Arg1Type = OperandType1.Value;
166 let Arg2Type = 0;
167 let Arg3Type = 0;
168 let Arg4Type = 0;
169 let PPC64 = 0;
170 let VMX = 0;
171 bits<5> operand0;
172 bits<16> operand1;
173
174
175 let Inst {31-26} = opconstant0;
176 let Inst {20-16} = opconstant1;
177 let Inst {25-21} = operand0;
178 let Inst {15-0} = operand1;
179}
180
181class PPC32InstPattern2 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<11> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
182 let Name = name;
183 let ArgCount = 3;
184 let PPC64 = ppc64;
185 let VMX =vmx;
186
187 let Arg0Type = OperandType0.Value;
188 let Arg1Type = OperandType1.Value;
189 let Arg2Type = OperandType2.Value;
190 let Arg3Type = 0;
191 let Arg4Type = 0;
192 let PPC64 = 0;
193 let VMX = 0;
194 bits<5> operand0;
195 bits<5> operand1;
196 bits<5> operand2;
197
198
199 let Inst {31-26} = opconstant0;
200 let Inst {10-0} = opconstant1;
201 let Inst {25-21} = operand0;
202 let Inst {20-16} = operand1;
203 let Inst {15-11} = operand2;
204}
205
206class PPC32InstPattern3 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<16> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
207 let Name = name;
208 let ArgCount = 2;
209 let PPC64 = ppc64;
210 let VMX =vmx;
211
212 let Arg0Type = OperandType0.Value;
213 let Arg1Type = OperandType1.Value;
214 let Arg2Type = 0;
215 let Arg3Type = 0;
216 let Arg4Type = 0;
217 let PPC64 = 0;
218 let VMX = 0;
219 bits<5> operand0;
220 bits<5> operand1;
221
222
223 let Inst {31-26} = opconstant0;
224 let Inst {15-0} = opconstant1;
225 let Inst {25-21} = operand0;
226 let Inst {20-16} = operand1;
227}
228
Misha Brukmancd4f51b2004-08-02 16:54:54 +0000229class PPC32InstPattern6 <string name, Format OperandType0, bits<6> opconstant0, bits<2> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
230 let Name = name;
231 let ArgCount = 1;
232 let PPC64 = ppc64;
233 let VMX =vmx;
234
235 let Arg0Type = OperandType0.Value;
236 let Arg1Type = 0;
237 let Arg2Type = 0;
238 let Arg3Type = 0;
239 let Arg4Type = 0;
240 let PPC64 = 0;
241 let VMX = 0;
242 bits<24> operand0;
243
244
245 let Inst {31-26} = opconstant0;
246 let Inst {1-0} = opconstant1;
247 let Inst {25-2} = operand0;
248}
249
250class PPC32InstPattern7 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<2> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
251 let Name = name;
252 let ArgCount = 3;
253 let PPC64 = ppc64;
254 let VMX =vmx;
255
256 let Arg0Type = OperandType0.Value;
257 let Arg1Type = OperandType1.Value;
258 let Arg2Type = OperandType2.Value;
259 let Arg3Type = 0;
260 let Arg4Type = 0;
261 let PPC64 = 0;
262 let VMX = 0;
263 bits<5> operand0;
264 bits<5> operand1;
265 bits<14> operand2;
266
267
268 let Inst {31-26} = opconstant0;
269 let Inst {1-0} = opconstant1;
270 let Inst {25-21} = operand0;
271 let Inst {20-16} = operand1;
272 let Inst {15-2} = operand2;
273}
274
275class PPC32InstPattern8 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<3> opconstant1, bits<11> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
276 let Name = name;
277 let ArgCount = 3;
278 let PPC64 = ppc64;
279 let VMX =vmx;
280
281 let Arg0Type = OperandType0.Value;
282 let Arg1Type = OperandType1.Value;
283 let Arg2Type = OperandType2.Value;
284 let Arg3Type = 0;
285 let Arg4Type = 0;
286 let PPC64 = 0;
287 let VMX = 0;
288 bits<5> operand0;
289 bits<5> operand1;
290 bits<2> operand2;
291
292
293 let Inst {31-26} = opconstant0;
294 let Inst {15-13} = opconstant1;
295 let Inst {10-0} = opconstant2;
296 let Inst {25-21} = operand0;
297 let Inst {20-16} = operand1;
298 let Inst {12-11} = operand2;
299}
300
301class PPC32InstPattern9 <string name, Format OperandType0, Format OperandType1, bits<11> opconstant0, bits<2> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
302 let Name = name;
303 let ArgCount = 2;
304 let PPC64 = ppc64;
305 let VMX =vmx;
306
307 let Arg0Type = OperandType0.Value;
308 let Arg1Type = OperandType1.Value;
309 let Arg2Type = 0;
310 let Arg3Type = 0;
311 let Arg4Type = 0;
312 let PPC64 = 0;
313 let VMX = 0;
314 bits<5> operand0;
315 bits<14> operand1;
316
317
318 let Inst {31-21} = opconstant0;
319 let Inst {1-0} = opconstant1;
320 let Inst {20-16} = operand0;
321 let Inst {15-2} = operand1;
322}
323
324class PPC32InstPattern10 <string name, Format OperandType0, bits<16> opconstant0, bits<2> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
325 let Name = name;
326 let ArgCount = 1;
327 let PPC64 = ppc64;
328 let VMX =vmx;
329
330 let Arg0Type = OperandType0.Value;
331 let Arg1Type = 0;
332 let Arg2Type = 0;
333 let Arg3Type = 0;
334 let Arg4Type = 0;
335 let PPC64 = 0;
336 let VMX = 0;
337 bits<14> operand0;
338
339
340 let Inst {31-16} = opconstant0;
341 let Inst {1-0} = opconstant1;
342 let Inst {15-2} = operand0;
343}
344
345class PPC32InstPattern11 <string name, Format OperandType0, bits<19> opconstant0, bits<11> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
346 let Name = name;
347 let ArgCount = 1;
348 let PPC64 = ppc64;
349 let VMX =vmx;
350
351 let Arg0Type = OperandType0.Value;
352 let Arg1Type = 0;
353 let Arg2Type = 0;
354 let Arg3Type = 0;
355 let Arg4Type = 0;
356 let PPC64 = 0;
357 let VMX = 0;
358 bits<2> operand0;
359
360
361 let Inst {31-13} = opconstant0;
362 let Inst {10-0} = opconstant1;
363 let Inst {12-11} = operand0;
364}
365
366class PPC32InstPattern12 <string name, Format OperandType0, Format OperandType1, bits<11> opconstant0, bits<3> opconstant1, bits<11> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
367 let Name = name;
368 let ArgCount = 2;
369 let PPC64 = ppc64;
370 let VMX =vmx;
371
372 let Arg0Type = OperandType0.Value;
373 let Arg1Type = OperandType1.Value;
374 let Arg2Type = 0;
375 let Arg3Type = 0;
376 let Arg4Type = 0;
377 let PPC64 = 0;
378 let VMX = 0;
379 bits<5> operand0;
380 bits<2> operand1;
381
382
383 let Inst {31-21} = opconstant0;
384 let Inst {15-13} = opconstant1;
385 let Inst {10-0} = opconstant2;
386 let Inst {20-16} = operand0;
387 let Inst {12-11} = operand1;
388}
389
390class PPC32InstPattern13 <string name, Format OperandType0, Format OperandType1, Format OperandType2, Format OperandType3, bits<6> opconstant0, bits<1> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
391 let Name = name;
392 let ArgCount = 4;
393 let PPC64 = ppc64;
394 let VMX =vmx;
395
396 let Arg0Type = OperandType0.Value;
397 let Arg1Type = OperandType1.Value;
398 let Arg2Type = OperandType2.Value;
399 let Arg3Type = OperandType3.Value;
400 let Arg4Type = 0;
401 let PPC64 = 0;
402 let VMX = 0;
403 bits<3> operand0;
404 bits<1> operand1;
405 bits<5> operand2;
406 bits<16> operand3;
407
408
409 let Inst {31-26} = opconstant0;
410 let Inst {22} = opconstant1;
411 let Inst {25-23} = operand0;
412 let Inst {21} = operand1;
413 let Inst {20-16} = operand2;
414 let Inst {15-0} = operand3;
415}
416
417class PPC32InstPattern14 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<2> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
418 let Name = name;
419 let ArgCount = 3;
420 let PPC64 = ppc64;
421 let VMX =vmx;
422
423 let Arg0Type = OperandType0.Value;
424 let Arg1Type = OperandType1.Value;
425 let Arg2Type = OperandType2.Value;
426 let Arg3Type = 0;
427 let Arg4Type = 0;
428 let PPC64 = 0;
429 let VMX = 0;
430 bits<3> operand0;
431 bits<5> operand1;
432 bits<16> operand2;
433
434
435 let Inst {31-26} = opconstant0;
436 let Inst {22-21} = opconstant1;
437 let Inst {25-23} = operand0;
438 let Inst {20-16} = operand1;
439 let Inst {15-0} = operand2;
440}
441
442class PPC32InstPattern15 <string name, Format OperandType0, Format OperandType1, Format OperandType2, Format OperandType3, bits<6> opconstant0, bits<1> opconstant1, bits<11> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
443 let Name = name;
444 let ArgCount = 4;
445 let PPC64 = ppc64;
446 let VMX =vmx;
447
448 let Arg0Type = OperandType0.Value;
449 let Arg1Type = OperandType1.Value;
450 let Arg2Type = OperandType2.Value;
451 let Arg3Type = OperandType3.Value;
452 let Arg4Type = 0;
453 let PPC64 = 0;
454 let VMX = 0;
455 bits<3> operand0;
456 bits<1> operand1;
457 bits<5> operand2;
458 bits<5> operand3;
459
460
461 let Inst {31-26} = opconstant0;
462 let Inst {22} = opconstant1;
463 let Inst {10-0} = opconstant2;
464 let Inst {25-23} = operand0;
465 let Inst {21} = operand1;
466 let Inst {20-16} = operand2;
467 let Inst {15-11} = operand3;
468}
469
470class PPC32InstPattern16 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<2> opconstant1, bits<11> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
471 let Name = name;
472 let ArgCount = 3;
473 let PPC64 = ppc64;
474 let VMX =vmx;
475
476 let Arg0Type = OperandType0.Value;
477 let Arg1Type = OperandType1.Value;
478 let Arg2Type = OperandType2.Value;
479 let Arg3Type = 0;
480 let Arg4Type = 0;
481 let PPC64 = 0;
482 let VMX = 0;
483 bits<3> operand0;
484 bits<5> operand1;
485 bits<5> operand2;
486
487
488 let Inst {31-26} = opconstant0;
489 let Inst {22-21} = opconstant1;
490 let Inst {10-0} = opconstant2;
491 let Inst {25-23} = operand0;
492 let Inst {20-16} = operand1;
493 let Inst {15-11} = operand2;
494}
495
496class PPC32InstPattern17 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<16> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
497 let Name = name;
498 let ArgCount = 2;
499 let PPC64 = ppc64;
500 let VMX =vmx;
501
502 let Arg0Type = OperandType0.Value;
503 let Arg1Type = OperandType1.Value;
504 let Arg2Type = 0;
505 let Arg3Type = 0;
506 let Arg4Type = 0;
507 let PPC64 = 0;
508 let VMX = 0;
509 bits<5> operand0;
510 bits<5> operand1;
511
512
513 let Inst {31-26} = opconstant0;
514 let Inst {15-0} = opconstant1;
515 let Inst {20-16} = operand0;
516 let Inst {25-21} = operand1;
517}
518
519class PPC32InstPattern18 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<5> opconstant1, bits<6> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
520 let Name = name;
521 let ArgCount = 3;
522 let PPC64 = ppc64;
523 let VMX =vmx;
524
525 let Arg0Type = OperandType0.Value;
526 let Arg1Type = OperandType1.Value;
527 let Arg2Type = OperandType2.Value;
528 let Arg3Type = 0;
529 let Arg4Type = 0;
530 let PPC64 = 0;
531 let VMX = 0;
532 bits<5> operand0;
533 bits<5> operand1;
534 bits<5> operand2;
535
536
537 let Inst {31-26} = opconstant0;
538 let Inst {15-11} = opconstant1;
539 let Inst {5-0} = opconstant2;
540 let Inst {25-21} = operand0;
541 let Inst {20-16} = operand1;
542 let Inst {10-6} = operand2;
543}
544
545class PPC32InstPattern19 <string name, Format OperandType0, Format OperandType1, Format OperandType2, Format OperandType3, bits<6> opconstant0, bits<6> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
546 let Name = name;
547 let ArgCount = 4;
548 let PPC64 = ppc64;
549 let VMX =vmx;
550
551 let Arg0Type = OperandType0.Value;
552 let Arg1Type = OperandType1.Value;
553 let Arg2Type = OperandType2.Value;
554 let Arg3Type = OperandType3.Value;
555 let Arg4Type = 0;
556 let PPC64 = 0;
557 let VMX = 0;
558 bits<5> operand0;
559 bits<5> operand1;
560 bits<5> operand2;
561 bits<5> operand3;
562
563
564 let Inst {31-26} = opconstant0;
565 let Inst {5-0} = opconstant1;
566 let Inst {25-21} = operand0;
567 let Inst {20-16} = operand1;
568 let Inst {10-6} = operand2;
569 let Inst {15-11} = operand3;
570}
571
572class PPC32InstPattern20 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<5> opconstant1, bits<11> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
573 let Name = name;
574 let ArgCount = 2;
575 let PPC64 = ppc64;
576 let VMX =vmx;
577
578 let Arg0Type = OperandType0.Value;
579 let Arg1Type = OperandType1.Value;
580 let Arg2Type = 0;
581 let Arg3Type = 0;
582 let Arg4Type = 0;
583 let PPC64 = 0;
584 let VMX = 0;
585 bits<5> operand0;
586 bits<5> operand1;
587
588
589 let Inst {31-26} = opconstant0;
590 let Inst {20-16} = opconstant1;
591 let Inst {10-0} = opconstant2;
592 let Inst {25-21} = operand0;
593 let Inst {15-11} = operand1;
594}
595
596class PPC32InstPattern21 <string name, Format OperandType0, bits<6> opconstant0, bits<21> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
597 let Name = name;
598 let ArgCount = 1;
599 let PPC64 = ppc64;
600 let VMX =vmx;
601
602 let Arg0Type = OperandType0.Value;
603 let Arg1Type = 0;
604 let Arg2Type = 0;
605 let Arg3Type = 0;
606 let Arg4Type = 0;
607 let PPC64 = 0;
608 let VMX = 0;
609 bits<5> operand0;
610
611
612 let Inst {31-26} = opconstant0;
613 let Inst {20-0} = opconstant1;
614 let Inst {25-21} = operand0;
615}
616
617class PPC32InstPattern22 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<18> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
618 let Name = name;
619 let ArgCount = 2;
620 let PPC64 = ppc64;
621 let VMX =vmx;
622
623 let Arg0Type = OperandType0.Value;
624 let Arg1Type = OperandType1.Value;
625 let Arg2Type = 0;
626 let Arg3Type = 0;
627 let Arg4Type = 0;
628 let PPC64 = 0;
629 let VMX = 0;
630 bits<3> operand0;
631 bits<5> operand1;
632
633
634 let Inst {31-26} = opconstant0;
635 let Inst {17-0} = opconstant1;
636 let Inst {25-23} = operand0;
637 let Inst {22-18} = operand1;
638}
639
640class PPC32InstPattern23 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<7> opconstant1, bits<12> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
641 let Name = name;
642 let ArgCount = 2;
643 let PPC64 = ppc64;
644 let VMX =vmx;
645
646 let Arg0Type = OperandType0.Value;
647 let Arg1Type = OperandType1.Value;
648 let Arg2Type = 0;
649 let Arg3Type = 0;
650 let Arg4Type = 0;
651 let PPC64 = 0;
652 let VMX = 0;
653 bits<3> operand0;
654 bits<4> operand1;
655
656
657 let Inst {31-26} = opconstant0;
658 let Inst {22-16} = opconstant1;
659 let Inst {11-0} = opconstant2;
660 let Inst {25-23} = operand0;
661 let Inst {15-12} = operand1;
662}
663
664class PPC32InstPattern24 <string name, Format OperandType0, Format OperandType1, bits<7> opconstant0, bits<1> opconstant1, bits<11> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
665 let Name = name;
666 let ArgCount = 2;
667 let PPC64 = ppc64;
668 let VMX =vmx;
669
670 let Arg0Type = OperandType0.Value;
671 let Arg1Type = OperandType1.Value;
672 let Arg2Type = 0;
673 let Arg3Type = 0;
674 let Arg4Type = 0;
675 let PPC64 = 0;
676 let VMX = 0;
677 bits<8> operand0;
678 bits<5> operand1;
679
680
681 let Inst {31-25} = opconstant0;
682 let Inst {16} = opconstant1;
683 let Inst {10-0} = opconstant2;
684 let Inst {24-17} = operand0;
685 let Inst {15-11} = operand1;
686}
687
688class PPC32InstPattern25 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bit ppc64, bit vmx> : PPC32Inst {
689 let Name = name;
690 let ArgCount = 3;
691 let PPC64 = ppc64;
692 let VMX =vmx;
693
694 let Arg0Type = OperandType0.Value;
695 let Arg1Type = OperandType1.Value;
696 let Arg2Type = OperandType2.Value;
697 let Arg3Type = 0;
698 let Arg4Type = 0;
699 let PPC64 = 0;
700 let VMX = 0;
701 bits<5> operand0;
702 bits<16> operand1;
703 bits<5> operand2;
704
705
706 let Inst {31-26} = opconstant0;
707 let Inst {25-21} = operand0;
708 let Inst {15-0} = operand1;
709 let Inst {20-16} = operand2;
710}
711
712class PPC32InstPattern26 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<2> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
713 let Name = name;
714 let ArgCount = 3;
715 let PPC64 = ppc64;
716 let VMX =vmx;
717
718 let Arg0Type = OperandType0.Value;
719 let Arg1Type = OperandType1.Value;
720 let Arg2Type = OperandType2.Value;
721 let Arg3Type = 0;
722 let Arg4Type = 0;
723 let PPC64 = 0;
724 let VMX = 0;
725 bits<5> operand0;
726 bits<14> operand1;
727 bits<5> operand2;
728
729
730 let Inst {31-26} = opconstant0;
731 let Inst {1-0} = opconstant1;
732 let Inst {25-21} = operand0;
733 let Inst {15-2} = operand1;
734 let Inst {20-16} = operand2;
735}
736
737class PPC32InstPattern27 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<2> opconstant1, bits<18> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
738 let Name = name;
739 let ArgCount = 2;
740 let PPC64 = ppc64;
741 let VMX =vmx;
742
743 let Arg0Type = OperandType0.Value;
744 let Arg1Type = OperandType1.Value;
745 let Arg2Type = 0;
746 let Arg3Type = 0;
747 let Arg4Type = 0;
748 let PPC64 = 0;
749 let VMX = 0;
750 bits<3> operand0;
751 bits<3> operand1;
752
753
754 let Inst {31-26} = opconstant0;
755 let Inst {22-21} = opconstant1;
756 let Inst {17-0} = opconstant2;
757 let Inst {25-23} = operand0;
758 let Inst {20-18} = operand1;
759}
760
761class PPC32InstPattern28 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<11> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
762 let Name = name;
763 let ArgCount = 2;
764 let PPC64 = ppc64;
765 let VMX =vmx;
766
767 let Arg0Type = OperandType0.Value;
768 let Arg1Type = OperandType1.Value;
769 let Arg2Type = 0;
770 let Arg3Type = 0;
771 let Arg4Type = 0;
772 let PPC64 = 0;
773 let VMX = 0;
774 bits<5> operand0;
775 bits<10> operand1;
776
777
778 let Inst {31-26} = opconstant0;
779 let Inst {10-0} = opconstant1;
780 let Inst {25-21} = operand0;
781 let Inst {20-11} = operand1;
782}
783
784class PPC32InstPattern29 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<11> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
785 let Name = name;
786 let ArgCount = 2;
787 let PPC64 = ppc64;
788 let VMX =vmx;
789
790 let Arg0Type = OperandType0.Value;
791 let Arg1Type = OperandType1.Value;
792 let Arg2Type = 0;
793 let Arg3Type = 0;
794 let Arg4Type = 0;
795 let PPC64 = 0;
796 let VMX = 0;
797 bits<10> operand0;
798 bits<5> operand1;
799
800
801 let Inst {31-26} = opconstant0;
802 let Inst {10-0} = opconstant1;
803 let Inst {20-11} = operand0;
804 let Inst {25-21} = operand1;
805}
806
807class PPC32InstPattern30 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<1> opconstant1, bits<12> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
808 let Name = name;
809 let ArgCount = 2;
810 let PPC64 = ppc64;
811 let VMX =vmx;
812
813 let Arg0Type = OperandType0.Value;
814 let Arg1Type = OperandType1.Value;
815 let Arg2Type = 0;
816 let Arg3Type = 0;
817 let Arg4Type = 0;
818 let PPC64 = 0;
819 let VMX = 0;
820 bits<8> operand0;
821 bits<5> operand1;
822
823
824 let Inst {31-26} = opconstant0;
825 let Inst {20} = opconstant1;
826 let Inst {11-0} = opconstant2;
827 let Inst {19-12} = operand0;
828 let Inst {25-21} = operand1;
829}
830
831class PPC32InstPattern31 <string name, Format OperandType0, bits<6> opconstant0, bits<23> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
832 let Name = name;
833 let ArgCount = 1;
834 let PPC64 = ppc64;
835 let VMX =vmx;
836
837 let Arg0Type = OperandType0.Value;
838 let Arg1Type = 0;
839 let Arg2Type = 0;
840 let Arg3Type = 0;
841 let Arg4Type = 0;
842 let PPC64 = 0;
843 let VMX = 0;
844 bits<3> operand0;
845
846
847 let Inst {31-26} = opconstant0;
848 let Inst {22-0} = opconstant1;
849 let Inst {25-23} = operand0;
850}
851
852class PPC32InstPattern32 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<1> opconstant1, bits<12> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
853 let Name = name;
854 let ArgCount = 2;
855 let PPC64 = ppc64;
856 let VMX =vmx;
857
858 let Arg0Type = OperandType0.Value;
859 let Arg1Type = OperandType1.Value;
860 let Arg2Type = 0;
861 let Arg3Type = 0;
862 let Arg4Type = 0;
863 let PPC64 = 0;
864 let VMX = 0;
865 bits<5> operand0;
866 bits<8> operand1;
867
868
869 let Inst {31-26} = opconstant0;
870 let Inst {20} = opconstant1;
871 let Inst {11-0} = opconstant2;
872 let Inst {25-21} = operand0;
873 let Inst {19-12} = operand1;
874}
875
876class PPC32InstPattern33 <string name, bits<32> opconstant0, bit ppc64, bit vmx> : PPC32Inst {
877 let Name = name;
878 let ArgCount = 0;
879 let PPC64 = ppc64;
880 let VMX =vmx;
881
882 let Arg0Type = 0;
883 let Arg1Type = 0;
884 let Arg2Type = 0;
885 let Arg3Type = 0;
886 let Arg4Type = 0;
887 let PPC64 = 0;
888 let VMX = 0;
889
890
891 let Inst {31-0} = opconstant0;
892}
893
894class PPC32InstPattern34 <string name, Format OperandType0, Format OperandType1, Format OperandType2, Format OperandType3, Format OperandType4, bits<6> opconstant0, bits<1> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
895 let Name = name;
896 let ArgCount = 5;
897 let PPC64 = ppc64;
898 let VMX =vmx;
899
900 let Arg0Type = OperandType0.Value;
901 let Arg1Type = OperandType1.Value;
902 let Arg2Type = OperandType2.Value;
903 let Arg3Type = OperandType3.Value;
904 let Arg4Type = OperandType4.Value;
905 let PPC64 = 0;
906 let VMX = 0;
907 bits<5> operand0;
908 bits<5> operand1;
909 bits<5> operand2;
910 bits<5> operand3;
911 bits<5> operand4;
912
913
914 let Inst {31-26} = opconstant0;
915 let Inst {0} = opconstant1;
916 let Inst {20-16} = operand0;
917 let Inst {25-21} = operand1;
918 let Inst {15-11} = operand2;
919 let Inst {10-6} = operand3;
920 let Inst {5-1} = operand4;
921}
922
923class PPC32InstPattern35 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<6> opconstant0, bits<11> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
924 let Name = name;
925 let ArgCount = 3;
926 let PPC64 = ppc64;
927 let VMX =vmx;
928
929 let Arg0Type = OperandType0.Value;
930 let Arg1Type = OperandType1.Value;
931 let Arg2Type = OperandType2.Value;
932 let Arg3Type = 0;
933 let Arg4Type = 0;
934 let PPC64 = 0;
935 let VMX = 0;
936 bits<5> operand0;
937 bits<5> operand1;
938 bits<5> operand2;
939
940
941 let Inst {31-26} = opconstant0;
942 let Inst {10-0} = opconstant1;
943 let Inst {25-21} = operand0;
944 let Inst {15-11} = operand1;
945 let Inst {20-16} = operand2;
946}
947
948class PPC32InstPattern36 <string name, Format OperandType0, bits<9> opconstant0, bits<21> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
949 let Name = name;
950 let ArgCount = 1;
951 let PPC64 = ppc64;
952 let VMX =vmx;
953
954 let Arg0Type = OperandType0.Value;
955 let Arg1Type = 0;
956 let Arg2Type = 0;
957 let Arg3Type = 0;
958 let Arg4Type = 0;
959 let PPC64 = 0;
960 let VMX = 0;
961 bits<2> operand0;
962
963
964 let Inst {31-23} = opconstant0;
965 let Inst {20-0} = opconstant1;
966 let Inst {22-21} = operand0;
967}
968
969class PPC32InstPattern37 <string name, Format OperandType0, Format OperandType1, bits<11> opconstant0, bit ppc64, bit vmx> : PPC32Inst {
970 let Name = name;
971 let ArgCount = 2;
972 let PPC64 = ppc64;
973 let VMX =vmx;
974
975 let Arg0Type = OperandType0.Value;
976 let Arg1Type = OperandType1.Value;
977 let Arg2Type = 0;
978 let Arg3Type = 0;
979 let Arg4Type = 0;
980 let PPC64 = 0;
981 let VMX = 0;
982 bits<5> operand0;
983 bits<16> operand1;
984
985
986 let Inst {31-21} = opconstant0;
987 let Inst {20-16} = operand0;
988 let Inst {15-0} = operand1;
989}
990
991class PPC32InstPattern38 <string name, Format OperandType0, Format OperandType1, bits<11> opconstant0, bits<11> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
992 let Name = name;
993 let ArgCount = 2;
994 let PPC64 = ppc64;
995 let VMX =vmx;
996
997 let Arg0Type = OperandType0.Value;
998 let Arg1Type = OperandType1.Value;
999 let Arg2Type = 0;
1000 let Arg3Type = 0;
1001 let Arg4Type = 0;
1002 let PPC64 = 0;
1003 let VMX = 0;
1004 bits<5> operand0;
1005 bits<5> operand1;
1006
1007
1008 let Inst {31-21} = opconstant0;
1009 let Inst {10-0} = opconstant1;
1010 let Inst {20-16} = operand0;
1011 let Inst {15-11} = operand1;
1012}
1013
1014class PPC32InstPattern39 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<7> opconstant0, bits<11> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
1015 let Name = name;
1016 let ArgCount = 3;
1017 let PPC64 = ppc64;
1018 let VMX =vmx;
1019
1020 let Arg0Type = OperandType0.Value;
1021 let Arg1Type = OperandType1.Value;
1022 let Arg2Type = OperandType2.Value;
1023 let Arg3Type = 0;
1024 let Arg4Type = 0;
1025 let PPC64 = 0;
1026 let VMX = 0;
1027 bits<5> operand0;
1028 bits<5> operand1;
1029 bits<4> operand2;
1030
1031
1032 let Inst {31-25} = opconstant0;
1033 let Inst {10-0} = opconstant1;
1034 let Inst {20-16} = operand0;
1035 let Inst {15-11} = operand1;
1036 let Inst {24-21} = operand2;
1037}
1038
1039class PPC32InstPattern40 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<4> opconstant1, bits<16> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
1040 let Name = name;
1041 let ArgCount = 2;
1042 let PPC64 = ppc64;
1043 let VMX =vmx;
1044
1045 let Arg0Type = OperandType0.Value;
1046 let Arg1Type = OperandType1.Value;
1047 let Arg2Type = 0;
1048 let Arg3Type = 0;
1049 let Arg4Type = 0;
1050 let PPC64 = 0;
1051 let VMX = 0;
1052 bits<5> operand0;
1053 bits<1> operand1;
1054
1055
1056 let Inst {31-26} = opconstant0;
1057 let Inst {20-17} = opconstant1;
1058 let Inst {15-0} = opconstant2;
1059 let Inst {25-21} = operand0;
1060 let Inst {16} = operand1;
1061}
1062
1063class PPC32InstPattern41 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<1> opconstant1, bits<16> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
1064 let Name = name;
1065 let ArgCount = 2;
1066 let PPC64 = ppc64;
1067 let VMX =vmx;
1068
1069 let Arg0Type = OperandType0.Value;
1070 let Arg1Type = OperandType1.Value;
1071 let Arg2Type = 0;
1072 let Arg3Type = 0;
1073 let Arg4Type = 0;
1074 let PPC64 = 0;
1075 let VMX = 0;
1076 bits<4> operand0;
1077 bits<5> operand1;
1078
1079
1080 let Inst {31-26} = opconstant0;
1081 let Inst {20} = opconstant1;
1082 let Inst {15-0} = opconstant2;
1083 let Inst {19-16} = operand0;
1084 let Inst {25-21} = operand1;
1085}
1086
1087class PPC32InstPattern42 <string name, Format OperandType0, Format OperandType1, bits<6> opconstant0, bits<1> opconstant1, bits<16> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
1088 let Name = name;
1089 let ArgCount = 2;
1090 let PPC64 = ppc64;
1091 let VMX =vmx;
1092
1093 let Arg0Type = OperandType0.Value;
1094 let Arg1Type = OperandType1.Value;
1095 let Arg2Type = 0;
1096 let Arg3Type = 0;
1097 let Arg4Type = 0;
1098 let PPC64 = 0;
1099 let VMX = 0;
1100 bits<5> operand0;
1101 bits<4> operand1;
1102
1103
1104 let Inst {31-26} = opconstant0;
1105 let Inst {20} = opconstant1;
1106 let Inst {15-0} = opconstant2;
1107 let Inst {25-21} = operand0;
1108 let Inst {19-16} = operand1;
1109}
1110
1111class PPC32InstPattern43 <string name, Format OperandType0, bits<16> opconstant0, bits<11> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
1112 let Name = name;
1113 let ArgCount = 1;
1114 let PPC64 = ppc64;
1115 let VMX =vmx;
1116
1117 let Arg0Type = OperandType0.Value;
1118 let Arg1Type = 0;
1119 let Arg2Type = 0;
1120 let Arg3Type = 0;
1121 let Arg4Type = 0;
1122 let PPC64 = 0;
1123 let VMX = 0;
1124 bits<5> operand0;
1125
1126
1127 let Inst {31-16} = opconstant0;
1128 let Inst {10-0} = opconstant1;
1129 let Inst {15-11} = operand0;
1130}
1131
1132class PPC32InstPattern44 <string name, Format OperandType0, Format OperandType1, bits<10> opconstant0, bits<5> opconstant1, bits<11> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
1133 let Name = name;
1134 let ArgCount = 2;
1135 let PPC64 = ppc64;
1136 let VMX =vmx;
1137
1138 let Arg0Type = OperandType0.Value;
1139 let Arg1Type = OperandType1.Value;
1140 let Arg2Type = 0;
1141 let Arg3Type = 0;
1142 let Arg4Type = 0;
1143 let PPC64 = 0;
1144 let VMX = 0;
1145 bits<5> operand0;
1146 bits<1> operand1;
1147
1148
1149 let Inst {31-22} = opconstant0;
1150 let Inst {20-16} = opconstant1;
1151 let Inst {10-0} = opconstant2;
1152 let Inst {15-11} = operand0;
1153 let Inst {21} = operand1;
1154}
1155
1156class PPC32InstPattern45 <string name, Format OperandType0, bits<6> opconstant0, bits<11> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
1157 let Name = name;
1158 let ArgCount = 1;
1159 let PPC64 = ppc64;
1160 let VMX =vmx;
1161
1162 let Arg0Type = OperandType0.Value;
1163 let Arg1Type = 0;
1164 let Arg2Type = 0;
1165 let Arg3Type = 0;
1166 let Arg4Type = 0;
1167 let PPC64 = 0;
1168 let VMX = 0;
1169 bits<15> operand0;
1170
1171
1172 let Inst {31-26} = opconstant0;
1173 let Inst {10-0} = opconstant1;
1174 let Inst {25-11} = operand0;
1175}
1176
1177class PPC32InstPattern46 <string name, Format OperandType0, Format OperandType1, Format OperandType2, bits<9> opconstant0, bits<11> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
1178 let Name = name;
1179 let ArgCount = 3;
1180 let PPC64 = ppc64;
1181 let VMX =vmx;
1182
1183 let Arg0Type = OperandType0.Value;
1184 let Arg1Type = OperandType1.Value;
1185 let Arg2Type = OperandType2.Value;
1186 let Arg3Type = 0;
1187 let Arg4Type = 0;
1188 let PPC64 = 0;
1189 let VMX = 0;
1190 bits<5> operand0;
1191 bits<5> operand1;
1192 bits<2> operand2;
1193
1194
1195 let Inst {31-23} = opconstant0;
1196 let Inst {10-0} = opconstant1;
1197 let Inst {20-16} = operand0;
1198 let Inst {15-11} = operand1;
1199 let Inst {22-21} = operand2;
1200}
1201
1202class PPC32InstPattern47 <string name, Format OperandType0, Format OperandType1, Format OperandType2, Format OperandType3, bits<6> opconstant0, bits<6> opconstant1, bit ppc64, bit vmx> : PPC32Inst {
1203 let Name = name;
1204 let ArgCount = 4;
1205 let PPC64 = ppc64;
1206 let VMX =vmx;
1207
1208 let Arg0Type = OperandType0.Value;
1209 let Arg1Type = OperandType1.Value;
1210 let Arg2Type = OperandType2.Value;
1211 let Arg3Type = OperandType3.Value;
1212 let Arg4Type = 0;
1213 let PPC64 = 0;
1214 let VMX = 0;
1215 bits<5> operand0;
1216 bits<5> operand1;
1217 bits<5> operand2;
1218 bits<5> operand3;
1219
1220
1221 let Inst {31-26} = opconstant0;
1222 let Inst {5-0} = opconstant1;
1223 let Inst {25-21} = operand0;
1224 let Inst {20-16} = operand1;
1225 let Inst {15-11} = operand2;
1226 let Inst {10-6} = operand3;
1227}
1228
1229class PPC32InstPattern48 <string name, Format OperandType0, Format OperandType1, Format OperandType2, Format OperandType3, bits<6> opconstant0, bits<1> opconstant1, bits<6> opconstant2, bit ppc64, bit vmx> : PPC32Inst {
1230 let Name = name;
1231 let ArgCount = 4;
1232 let PPC64 = ppc64;
1233 let VMX =vmx;
1234
1235 let Arg0Type = OperandType0.Value;
1236 let Arg1Type = OperandType1.Value;
1237 let Arg2Type = OperandType2.Value;
1238 let Arg3Type = OperandType3.Value;
1239 let Arg4Type = 0;
1240 let PPC64 = 0;
1241 let VMX = 0;
1242 bits<5> operand0;
1243 bits<5> operand1;
1244 bits<5> operand2;
1245 bits<4> operand3;
1246
1247
1248 let Inst {31-26} = opconstant0;
1249 let Inst {10} = opconstant1;
1250 let Inst {5-0} = opconstant2;
1251 let Inst {25-21} = operand0;
1252 let Inst {20-16} = operand1;
1253 let Inst {15-11} = operand2;
1254 let Inst {9-6} = operand3;
1255}
1256
1257class PPC32InstPatternPseudo <string name, Format OperandType0> : PPC32Inst {
1258 let Name = name;
1259 let ArgCount = 0;
1260 let PPC64 = 0;
1261 let VMX = 0;
1262
1263 let Arg0Type = OperandType0.Value;
1264 let Arg1Type = OperandType0.Value;
1265 let Arg2Type = OperandType0.Value;
1266 let Arg3Type = OperandType0.Value;
1267 let Arg4Type = 0;
1268 let PPC64 = 0;
1269 let VMX = 0;
1270 bits<5> operand0;
1271 bits<5> operand1;
1272 bits<5> operand2;
1273 bits<4> operand3;
1274
1275
1276 let Inst {31-0} = 0;
1277}