1 //===- PowerPCInstrFormats.td - PowerPC Instruction Formats --*- tablegen -*-=//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 //===----------------------------------------------------------------------===//
11 // PowerPC instruction formats
13 class I<bits<6> opcode, dag OOL, dag IOL, string asmstr, InstrItinClass itin>
16 field bits<32> SoftFail = 0;
19 bit PPC64 = 0; // Default value, override with isPPC64
21 let Namespace = "PPC";
22 let Inst{0-5} = opcode;
23 let OutOperandList = OOL;
24 let InOperandList = IOL;
25 let AsmString = asmstr;
28 bits<1> PPC970_First = 0;
29 bits<1> PPC970_Single = 0;
30 bits<1> PPC970_Cracked = 0;
31 bits<3> PPC970_Unit = 0;
33 /// These fields correspond to the fields in PPCInstrInfo.h. Any changes to
34 /// these must be reflected there! See comments there for what these are.
35 let TSFlags{0} = PPC970_First;
36 let TSFlags{1} = PPC970_Single;
37 let TSFlags{2} = PPC970_Cracked;
38 let TSFlags{5-3} = PPC970_Unit;
40 // Indicate that this instruction is of type X-Form Load or Store
41 bits<1> XFormMemOp = 0;
42 let TSFlags{6} = XFormMemOp;
44 // Indicate that this instruction is prefixed.
46 let TSFlags{7} = Prefixed;
48 // Indicate that this instruction produces a result that is sign extended from
49 // 32 bits to 64 bits.
50 bits<1> SExt32To64 = 0;
51 let TSFlags{8} = SExt32To64;
53 // Indicate that this instruction produces a result that is zero extended from
54 // 32 bits to 64 bits.
55 bits<1> ZExt32To64 = 0;
56 let TSFlags{9} = ZExt32To64;
58 // Fields used for relation models.
61 // For cases where multiple instruction definitions really represent the
62 // same underlying instruction but with one definition for 64-bit arguments
63 // and one for 32-bit arguments, this bit breaks the degeneracy between
64 // the two forms and allows TableGen to generate mapping tables.
65 bit Interpretation64Bit = 0;
68 class PPC970_DGroup_First { bits<1> PPC970_First = 1; }
69 class PPC970_DGroup_Single { bits<1> PPC970_Single = 1; }
70 class PPC970_DGroup_Cracked { bits<1> PPC970_Cracked = 1; }
71 class PPC970_MicroCode;
73 class PPC970_Unit_Pseudo { bits<3> PPC970_Unit = 0; }
74 class PPC970_Unit_FXU { bits<3> PPC970_Unit = 1; }
75 class PPC970_Unit_LSU { bits<3> PPC970_Unit = 2; }
76 class PPC970_Unit_FPU { bits<3> PPC970_Unit = 3; }
77 class PPC970_Unit_CRU { bits<3> PPC970_Unit = 4; }
78 class PPC970_Unit_VALU { bits<3> PPC970_Unit = 5; }
79 class PPC970_Unit_VPERM { bits<3> PPC970_Unit = 6; }
80 class PPC970_Unit_BRU { bits<3> PPC970_Unit = 7; }
82 class XFormMemOp { bits<1> XFormMemOp = 1; }
83 class SExt32To64 { bits<1> SExt32To64 = 1; }
84 class ZExt32To64 { bits<1> ZExt32To64 = 1; }
86 // Two joined instructions; used to emit two adjacent instructions as one.
87 // The itinerary from the first instruction is used for scheduling and
89 class I2<bits<6> opcode1, bits<6> opcode2, dag OOL, dag IOL, string asmstr,
93 field bits<64> SoftFail = 0;
96 bit PPC64 = 0; // Default value, override with isPPC64
98 let Namespace = "PPC";
99 let Inst{0-5} = opcode1;
100 let Inst{32-37} = opcode2;
101 let OutOperandList = OOL;
102 let InOperandList = IOL;
103 let AsmString = asmstr;
104 let Itinerary = itin;
106 bits<1> PPC970_First = 0;
107 bits<1> PPC970_Single = 0;
108 bits<1> PPC970_Cracked = 0;
109 bits<3> PPC970_Unit = 0;
111 /// These fields correspond to the fields in PPCInstrInfo.h. Any changes to
112 /// these must be reflected there! See comments there for what these are.
113 let TSFlags{0} = PPC970_First;
114 let TSFlags{1} = PPC970_Single;
115 let TSFlags{2} = PPC970_Cracked;
116 let TSFlags{5-3} = PPC970_Unit;
118 // Fields used for relation models.
119 string BaseName = "";
120 bit Interpretation64Bit = 0;
123 // Base class for all X-Form memory instructions
124 class IXFormMemOp<bits<6> opcode, dag OOL, dag IOL, string asmstr,
126 :I<opcode, OOL, IOL, asmstr, itin>, XFormMemOp;
129 class IForm<bits<6> opcode, bit aa, bit lk, dag OOL, dag IOL, string asmstr,
130 InstrItinClass itin, list<dag> pattern>
131 : I<opcode, OOL, IOL, asmstr, itin> {
132 let Pattern = pattern;
141 class BForm<bits<6> opcode, bit aa, bit lk, dag OOL, dag IOL, string asmstr>
142 : I<opcode, OOL, IOL, asmstr, IIC_BrB> {
143 bits<7> BIBO; // 2 bits of BI and 5 bits of BO.
148 let BI{0-1} = BIBO{5-6};
149 let BI{2-4} = CR{0-2};
151 let Inst{6-10} = BIBO{4-0};
152 let Inst{11-15} = BI;
153 let Inst{16-29} = BD;
158 class BForm_1<bits<6> opcode, bits<5> bo, bit aa, bit lk, dag OOL, dag IOL,
160 : BForm<opcode, aa, lk, OOL, IOL, asmstr> {
166 class BForm_2<bits<6> opcode, bits<5> bo, bits<5> bi, bit aa, bit lk,
167 dag OOL, dag IOL, string asmstr>
168 : I<opcode, OOL, IOL, asmstr, IIC_BrB> {
172 let Inst{11-15} = bi;
173 let Inst{16-29} = BD;
178 class BForm_3<bits<6> opcode, bit aa, bit lk,
179 dag OOL, dag IOL, string asmstr>
180 : I<opcode, OOL, IOL, asmstr, IIC_BrB> {
186 let Inst{11-15} = BI;
187 let Inst{16-29} = BD;
192 class BForm_3_at<bits<6> opcode, bit aa, bit lk,
193 dag OOL, dag IOL, string asmstr>
194 : I<opcode, OOL, IOL, asmstr, IIC_BrB> {
200 let Inst{6-8} = BO{4-2};
202 let Inst{11-15} = BI;
203 let Inst{16-29} = BD;
209 BForm_4<bits<6> opcode, bits<5> bo, bit aa, bit lk,
210 dag OOL, dag IOL, string asmstr>
211 : I<opcode, OOL, IOL, asmstr, IIC_BrB> {
216 let Inst{11-15} = BI;
217 let Inst{16-29} = BD;
223 class SCForm<bits<6> opcode, bits<1> xo1, bits<1> xo2,
224 dag OOL, dag IOL, string asmstr, InstrItinClass itin,
226 : I<opcode, OOL, IOL, asmstr, itin> {
229 let Pattern = pattern;
231 let Inst{20-26} = LEV;
237 class DForm_base<bits<6> opcode, dag OOL, dag IOL, string asmstr,
238 InstrItinClass itin, list<dag> pattern>
239 : I<opcode, OOL, IOL, asmstr, itin> {
244 let Pattern = pattern;
246 let Inst{6-10} = RST;
247 let Inst{11-15} = RA;
251 class DForm_1<bits<6> opcode, dag OOL, dag IOL, string asmstr,
252 InstrItinClass itin, list<dag> pattern>
253 : DForm_base<opcode, OOL, IOL, asmstr, itin, pattern> {
256 class DForm_2<bits<6> opcode, dag OOL, dag IOL, string asmstr,
257 InstrItinClass itin, list<dag> pattern>
258 : DForm_base<opcode, OOL, IOL, asmstr, itin, pattern> {
260 // Even though ADDIC_rec does not really have an RC bit, provide
261 // the declaration of one here so that isRecordForm has something to set.
265 class DForm_2_r0<bits<6> opcode, dag OOL, dag IOL, string asmstr,
266 InstrItinClass itin, list<dag> pattern>
267 : I<opcode, OOL, IOL, asmstr, itin> {
271 let Pattern = pattern;
273 let Inst{6-10} = RST;
278 class DForm_4<bits<6> opcode, dag OOL, dag IOL, string asmstr,
279 InstrItinClass itin, list<dag> pattern>
280 : I<opcode, OOL, IOL, asmstr, itin> {
285 let Pattern = pattern;
287 let Inst{6-10} = RST;
288 let Inst{11-15} = RA;
292 class DForm_4_zero<bits<6> opcode, dag OOL, dag IOL, string asmstr,
293 InstrItinClass itin, list<dag> pattern>
294 : DForm_1<opcode, OOL, IOL, asmstr, itin, pattern> {
300 class DForm_4_fixedreg_zero<bits<6> opcode, bits<5> R, dag OOL, dag IOL,
301 string asmstr, InstrItinClass itin,
303 : DForm_4<opcode, OOL, IOL, asmstr, itin, pattern> {
309 class IForm_and_DForm_1<bits<6> opcode1, bit aa, bit lk, bits<6> opcode2,
310 dag OOL, dag IOL, string asmstr,
311 InstrItinClass itin, list<dag> pattern>
312 : I2<opcode1, opcode2, OOL, IOL, asmstr, itin> {
317 let Pattern = pattern;
324 let Inst{38-42} = RST;
325 let Inst{43-47} = RA;
329 // This is used to emit BL8+NOP.
330 class IForm_and_DForm_4_zero<bits<6> opcode1, bit aa, bit lk, bits<6> opcode2,
331 dag OOL, dag IOL, string asmstr,
332 InstrItinClass itin, list<dag> pattern>
333 : IForm_and_DForm_1<opcode1, aa, lk, opcode2,
334 OOL, IOL, asmstr, itin, pattern> {
340 class DForm_5<bits<6> opcode, dag OOL, dag IOL, string asmstr,
342 : I<opcode, OOL, IOL, asmstr, itin> {
351 let Inst{11-15} = RA;
355 class DForm_5_ext<bits<6> opcode, dag OOL, dag IOL, string asmstr,
357 : DForm_5<opcode, OOL, IOL, asmstr, itin> {
361 class DForm_6<bits<6> opcode, dag OOL, dag IOL, string asmstr,
363 : DForm_5<opcode, OOL, IOL, asmstr, itin>;
365 class DForm_6_ext<bits<6> opcode, dag OOL, dag IOL, string asmstr,
367 : DForm_6<opcode, OOL, IOL, asmstr, itin> {
373 class DSForm_1<bits<6> opcode, bits<2> xo, dag OOL, dag IOL, string asmstr,
374 InstrItinClass itin, list<dag> pattern>
375 : I<opcode, OOL, IOL, asmstr, itin> {
380 let Pattern = pattern;
382 let Inst{6-10} = RST;
383 let Inst{11-15} = RA;
385 let Inst{30-31} = xo;
388 // ISA V3.0B 1.6.6 DX-Form
389 class DXForm<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
390 InstrItinClass itin, list<dag> pattern>
391 : I<opcode, OOL, IOL, asmstr, itin> {
395 let Pattern = pattern;
398 let Inst{11-15} = D{5-1}; // d1
399 let Inst{16-25} = D{15-6}; // d0
400 let Inst{26-30} = xo;
401 let Inst{31} = D{0}; // d2
404 // DQ-Form: [PO T RA DQ TX XO] or [PO S RA DQ SX XO]
405 class DQ_RD6_RS5_DQ12<bits<6> opcode, bits<3> xo, dag OOL, dag IOL,
406 string asmstr, InstrItinClass itin, list<dag> pattern>
407 : I<opcode, OOL, IOL, asmstr, itin> {
412 let Pattern = pattern;
414 let Inst{6-10} = XT{4-0};
415 let Inst{11-15} = RA;
416 let Inst{16-27} = DQ;
417 let Inst{28} = XT{5};
418 let Inst{29-31} = xo;
421 class DQForm_RTp5_RA17_MEM<bits<6> opcode, bits<4> xo, dag OOL, dag IOL,
422 string asmstr, InstrItinClass itin,
424 : I<opcode, OOL, IOL, asmstr, itin> {
428 let Pattern = pattern;
430 let Inst{6-10} = RTp{4-0};
431 let Inst{11-15} = RA;
432 let Inst{16-27} = DQ;
433 let Inst{28-31} = xo;
437 class XForm_base_r3xo<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
438 InstrItinClass itin, list<dag> pattern>
439 : I<opcode, OOL, IOL, asmstr, itin> {
444 let Pattern = pattern;
446 bit RC = 0; // set by isRecordForm
448 let Inst{6-10} = RST;
449 let Inst{11-15} = RA;
450 let Inst{16-20} = RB;
451 let Inst{21-30} = xo;
455 class XForm_base_r3xo_memOp<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
456 string asmstr, InstrItinClass itin,
458 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern>, XFormMemOp;
460 class XForm_tlb<bits<10> xo, dag OOL, dag IOL, string asmstr,
461 InstrItinClass itin> : XForm_base_r3xo<31, xo, OOL, IOL, asmstr, itin, []> {
465 class XForm_tlbilx<bits<10> xo, dag OOL, dag IOL, string asmstr,
466 InstrItinClass itin> : XForm_base_r3xo<31, xo, OOL, IOL, asmstr, itin, []> {
471 class XForm_attn<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
473 : I<opcode, OOL, IOL, asmstr, itin> {
474 let Inst{21-30} = xo;
477 // This is the same as XForm_base_r3xo, but the first two operands are swapped
478 // when code is emitted.
479 class XForm_base_r3xo_swapped
480 <bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
482 : I<opcode, OOL, IOL, asmstr, itin> {
487 bit RC = 0; // set by isRecordForm
489 let Inst{6-10} = RST;
490 let Inst{11-15} = RA;
491 let Inst{16-20} = RB;
492 let Inst{21-30} = xo;
497 class XForm_1<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
498 InstrItinClass itin, list<dag> pattern>
499 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern>;
501 class XForm_1_memOp<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
502 InstrItinClass itin, list<dag> pattern>
503 : XForm_base_r3xo_memOp<opcode, xo, OOL, IOL, asmstr, itin, pattern>;
505 class XForm_1a<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
506 InstrItinClass itin, list<dag> pattern>
507 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
511 class XForm_rs<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
512 InstrItinClass itin, list<dag> pattern>
513 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
518 class XForm_tlbws<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
519 InstrItinClass itin, list<dag> pattern>
520 : I<opcode, OOL, IOL, asmstr, itin> {
525 let Pattern = pattern;
527 let Inst{6-10} = RST;
528 let Inst{11-15} = RA;
530 let Inst{21-30} = xo;
534 class XForm_6<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
535 InstrItinClass itin, list<dag> pattern>
536 : XForm_base_r3xo_swapped<opcode, xo, OOL, IOL, asmstr, itin> {
537 let Pattern = pattern;
540 class XForm_8<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
541 InstrItinClass itin, list<dag> pattern>
542 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern>;
544 class XForm_8_memOp<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
545 InstrItinClass itin, list<dag> pattern>
546 : XForm_base_r3xo_memOp<opcode, xo, OOL, IOL, asmstr, itin, pattern>;
548 class XForm_10<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
549 InstrItinClass itin, list<dag> pattern>
550 : XForm_base_r3xo_swapped<opcode, xo, OOL, IOL, asmstr, itin> {
551 let Pattern = pattern;
554 class XForm_11<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
555 InstrItinClass itin, list<dag> pattern>
556 : XForm_base_r3xo_swapped<opcode, xo, OOL, IOL, asmstr, itin> {
558 let Pattern = pattern;
561 class XForm_16<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
563 : I<opcode, OOL, IOL, asmstr, itin> {
572 let Inst{11-15} = RA;
573 let Inst{16-20} = RB;
574 let Inst{21-30} = xo;
578 class XForm_icbt<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
580 : I<opcode, OOL, IOL, asmstr, itin> {
587 let Inst{11-15} = RA;
588 let Inst{16-20} = RB;
589 let Inst{21-30} = xo;
593 class XForm_sr<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
595 : I<opcode, OOL, IOL, asmstr, itin> {
600 let Inst{12-15} = SR;
601 let Inst{21-30} = xo;
604 class XForm_mbar<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
606 : I<opcode, OOL, IOL, asmstr, itin> {
610 let Inst{21-30} = xo;
613 class XForm_srin<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
615 : I<opcode, OOL, IOL, asmstr, itin> {
620 let Inst{16-20} = RB;
621 let Inst{21-30} = xo;
624 class XForm_mtmsr<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
626 : I<opcode, OOL, IOL, asmstr, itin> {
632 let Inst{21-30} = xo;
635 class XForm_16_ext<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
637 : XForm_16<opcode, xo, OOL, IOL, asmstr, itin> {
641 class XForm_17<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
643 : I<opcode, OOL, IOL, asmstr, itin> {
650 let Inst{11-15} = RA;
651 let Inst{16-20} = RB;
652 let Inst{21-30} = xo;
656 class XForm_17a<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
657 InstrItinClass itin, list<dag> pattern>
658 : XForm_17<opcode, xo, OOL, IOL, asmstr, itin > {
660 let Pattern = pattern;
663 class XForm_18<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
664 InstrItinClass itin, list<dag> pattern>
665 : I<opcode, OOL, IOL, asmstr, itin> {
670 let Pattern = pattern;
672 let Inst{6-10} = FRT;
673 let Inst{11-15} = FRA;
674 let Inst{16-20} = FRB;
675 let Inst{21-30} = xo;
679 class XForm_19<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
680 InstrItinClass itin, list<dag> pattern>
681 : XForm_18<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
685 class XForm_20<bits<6> opcode, bits<6> xo, dag OOL, dag IOL, string asmstr,
686 InstrItinClass itin, list<dag> pattern>
687 : I<opcode, OOL, IOL, asmstr, itin> {
693 let Pattern = pattern;
695 let Inst{6-10} = FRT;
696 let Inst{11-15} = FRA;
697 let Inst{16-20} = FRB;
698 let Inst{21-24} = tttt;
699 let Inst{25-30} = xo;
703 class XForm_24<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
704 InstrItinClass itin, list<dag> pattern>
705 : I<opcode, OOL, IOL, asmstr, itin> {
706 let Pattern = pattern;
710 let Inst{21-30} = xo;
714 class XForm_24_sync<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
715 string asmstr, InstrItinClass itin, list<dag> pattern>
716 : I<opcode, OOL, IOL, asmstr, itin> {
719 let Pattern = pattern;
724 let Inst{21-30} = xo;
728 class XForm_IMM2_IMM2<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
729 string asmstr, InstrItinClass itin, list<dag> pattern>
730 : I<opcode, OOL, IOL, asmstr, itin> {
734 let Pattern = pattern;
738 let Inst{14-15} = PL;
740 let Inst{21-30} = xo;
744 class XForm_IMM3_IMM2<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
745 string asmstr, InstrItinClass itin, list<dag> pattern>
746 : I<opcode, OOL, IOL, asmstr, itin> {
750 let Pattern = pattern;
754 let Inst{14-15} = SC;
756 let Inst{21-30} = xo;
760 class XForm_24_eieio<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
761 string asmstr, InstrItinClass itin, list<dag> pattern>
762 : XForm_24_sync<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
766 class XForm_25<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
767 InstrItinClass itin, list<dag> pattern>
768 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
771 class XForm_25_memOp<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
772 string asmstr, InstrItinClass itin, list<dag> pattern>
773 : XForm_base_r3xo_memOp<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
776 // [PO RT /// RB XO RC]
777 class XForm_26<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
778 InstrItinClass itin, list<dag> pattern>
779 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
783 class XForm_28_memOp<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
784 string asmstr, InstrItinClass itin, list<dag> pattern>
785 : XForm_base_r3xo_memOp<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
788 class XForm_28<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
789 InstrItinClass itin, list<dag> pattern>
790 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
793 // This is used for MFFS, MTFSB0, MTFSB1. 42 is arbitrary; this series of
794 // numbers presumably relates to some document, but I haven't found it.
795 class XForm_42<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
796 InstrItinClass itin, list<dag> pattern>
797 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
798 let Pattern = pattern;
800 bit RC = 0; // set by isRecordForm
802 let Inst{6-10} = RST;
804 let Inst{21-30} = xo;
807 class XForm_43<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
808 InstrItinClass itin, list<dag> pattern>
809 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
810 let Pattern = pattern;
813 bit RC = 0; // set by isRecordForm
817 let Inst{21-30} = xo;
821 class XForm_44<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
823 : I<opcode, OOL, IOL, asmstr, itin> {
828 let Inst{11-13} = BFA;
831 let Inst{21-30} = xo;
835 class XForm_45<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
837 : I<opcode, OOL, IOL, asmstr, itin> {
845 let Inst{21-30} = xo;
849 class X_FRT5_XO2_XO3_XO10<bits<6> opcode, bits<2> xo1, bits<3> xo2, bits<10> xo,
850 dag OOL, dag IOL, string asmstr, InstrItinClass itin,
852 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
853 let Pattern = pattern;
855 let Inst{6-10} = RST;
856 let Inst{11-12} = xo1;
857 let Inst{13-15} = xo2;
859 let Inst{21-30} = xo;
863 class X_FRT5_XO2_XO3_FRB5_XO10<bits<6> opcode, bits<2> xo1, bits<3> xo2,
864 bits<10> xo, dag OOL, dag IOL, string asmstr,
865 InstrItinClass itin, list<dag> pattern>
866 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
867 let Pattern = pattern;
870 let Inst{6-10} = RST;
871 let Inst{11-12} = xo1;
872 let Inst{13-15} = xo2;
873 let Inst{16-20} = FRB;
874 let Inst{21-30} = xo;
878 class X_FRT5_XO2_XO3_DRM3_XO10<bits<6> opcode, bits<2> xo1, bits<3> xo2,
879 bits<10> xo, dag OOL, dag IOL, string asmstr,
880 InstrItinClass itin, list<dag> pattern>
881 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
882 let Pattern = pattern;
885 let Inst{6-10} = RST;
886 let Inst{11-12} = xo1;
887 let Inst{13-15} = xo2;
889 let Inst{18-20} = DRM;
890 let Inst{21-30} = xo;
894 class X_FRT5_XO2_XO3_RM2_X10<bits<6> opcode, bits<2> xo1, bits<3> xo2,
895 bits<10> xo, dag OOL, dag IOL, string asmstr,
896 InstrItinClass itin, list<dag> pattern>
897 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
898 let Pattern = pattern;
901 let Inst{6-10} = RST;
902 let Inst{11-12} = xo1;
903 let Inst{13-15} = xo2;
905 let Inst{19-20} = RM;
906 let Inst{21-30} = xo;
911 class XForm_0<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
912 InstrItinClass itin, list<dag> pattern>
913 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
919 class XForm_16b<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
920 InstrItinClass itin, list<dag> pattern>
921 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
926 class XForm_htm0<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
927 string asmstr, InstrItinClass itin>
928 : I<opcode, OOL, IOL, asmstr, itin> {
936 let Inst{21-30} = xo;
940 class XForm_htm1<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
941 string asmstr, InstrItinClass itin>
942 : I<opcode, OOL, IOL, asmstr, itin> {
949 let Inst{21-30} = xo;
953 class XForm_htm2<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
955 : I<opcode, OOL, IOL, asmstr, itin> {
958 bit RC = 0; // set by isRecordForm
963 let Inst{21-30} = xo;
967 class XForm_htm3<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
969 : I<opcode, OOL, IOL, asmstr, itin> {
976 let Inst{21-30} = xo;
980 // [PO RT RA RB XO /]
981 class X_BF3_L1_RS5_RS5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
982 string asmstr, InstrItinClass itin, list<dag> pattern>
983 : I<opcode, OOL, IOL, asmstr, itin> {
989 let Pattern = pattern;
994 let Inst{11-15} = RA;
995 let Inst{16-20} = RB;
996 let Inst{21-30} = xo;
1000 // Same as XForm_17 but with GPR's and new naming convention
1001 class X_BF3_RS5_RS5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1002 string asmstr, InstrItinClass itin, list<dag> pattern>
1003 : I<opcode, OOL, IOL, asmstr, itin> {
1008 let Pattern = pattern;
1012 let Inst{11-15} = RA;
1013 let Inst{16-20} = RB;
1014 let Inst{21-30} = xo;
1018 // e.g. [PO VRT XO VRB XO /] or [PO VRT XO VRB XO RO]
1019 class X_RD5_XO5_RS5<bits<6> opcode, bits<5> xo2, bits<10> xo, dag OOL, dag IOL,
1020 string asmstr, InstrItinClass itin, list<dag> pattern>
1021 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1025 class X_BF3_DCMX7_RS5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1026 string asmstr, InstrItinClass itin, list<dag> pattern>
1027 : I<opcode, OOL, IOL, asmstr, itin> {
1032 let Pattern = pattern;
1035 let Inst{9-15} = DCMX;
1036 let Inst{16-20} = VB;
1037 let Inst{21-30} = xo;
1041 class X_RD6_IMM8<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1042 string asmstr, InstrItinClass itin, list<dag> pattern>
1043 : I<opcode, OOL, IOL, asmstr, itin> {
1047 let Pattern = pattern;
1049 let Inst{6-10} = XT{4-0};
1050 let Inst{11-12} = 0;
1051 let Inst{13-20} = IMM8;
1052 let Inst{21-30} = xo;
1053 let Inst{31} = XT{5};
1056 // XForm_base_r3xo for instructions such as P9 atomics where we don't want
1057 // to specify an SDAG pattern for matching.
1058 class X_RD5_RS5_IM5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1059 string asmstr, InstrItinClass itin>
1060 : XForm_base_r3xo_memOp<opcode, xo, OOL, IOL, asmstr, itin, []> {
1063 class X_BF3<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1064 InstrItinClass itin>
1065 : XForm_17<opcode, xo, OOL, IOL, asmstr, itin> {
1070 // [PO /// L RA RB XO /]
1071 class X_L1_RS5_RS5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1072 string asmstr, InstrItinClass itin, list<dag> pattern>
1073 : XForm_16<opcode, xo, OOL, IOL, asmstr, itin> {
1075 let Pattern = pattern;
1082 class XX1Form<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1083 InstrItinClass itin, list<dag> pattern>
1084 : I<opcode, OOL, IOL, asmstr, itin> {
1089 let Pattern = pattern;
1091 let Inst{6-10} = XT{4-0};
1092 let Inst{11-15} = RA;
1093 let Inst{16-20} = RB;
1094 let Inst{21-30} = xo;
1095 let Inst{31} = XT{5};
1098 class XX1Form_memOp<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1099 string asmstr, InstrItinClass itin, list<dag> pattern>
1100 : XX1Form<opcode, xo, OOL, IOL, asmstr, itin, pattern>, XFormMemOp;
1102 class XX1_RS6_RD5_XO<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1103 string asmstr, InstrItinClass itin, list<dag> pattern>
1104 : XX1Form<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1108 class XX2Form<bits<6> opcode, bits<9> xo, dag OOL, dag IOL, string asmstr,
1109 InstrItinClass itin, list<dag> pattern>
1110 : I<opcode, OOL, IOL, asmstr, itin> {
1114 let Pattern = pattern;
1116 let Inst{6-10} = XT{4-0};
1117 let Inst{11-15} = 0;
1118 let Inst{16-20} = XB{4-0};
1119 let Inst{21-29} = xo;
1120 let Inst{30} = XB{5};
1121 let Inst{31} = XT{5};
1124 class XX2Form_1<bits<6> opcode, bits<9> xo, dag OOL, dag IOL, string asmstr,
1125 InstrItinClass itin, list<dag> pattern>
1126 : I<opcode, OOL, IOL, asmstr, itin> {
1130 let Pattern = pattern;
1134 let Inst{16-20} = XB{4-0};
1135 let Inst{21-29} = xo;
1136 let Inst{30} = XB{5};
1140 class XX2Form_2<bits<6> opcode, bits<9> xo, dag OOL, dag IOL, string asmstr,
1141 InstrItinClass itin, list<dag> pattern>
1142 : I<opcode, OOL, IOL, asmstr, itin> {
1147 let Pattern = pattern;
1149 let Inst{6-10} = XT{4-0};
1150 let Inst{11-13} = 0;
1151 let Inst{14-15} = D;
1152 let Inst{16-20} = XB{4-0};
1153 let Inst{21-29} = xo;
1154 let Inst{30} = XB{5};
1155 let Inst{31} = XT{5};
1158 class XX2_RD6_UIM5_RS6<bits<6> opcode, bits<9> xo, dag OOL, dag IOL,
1159 string asmstr, InstrItinClass itin, list<dag> pattern>
1160 : I<opcode, OOL, IOL, asmstr, itin> {
1165 let Pattern = pattern;
1167 let Inst{6-10} = XT{4-0};
1168 let Inst{11-15} = UIM5;
1169 let Inst{16-20} = XB{4-0};
1170 let Inst{21-29} = xo;
1171 let Inst{30} = XB{5};
1172 let Inst{31} = XT{5};
1175 // [PO T XO B XO BX /]
1176 class XX2_RD5_XO5_RS6<bits<6> opcode, bits<5> xo2, bits<9> xo, dag OOL, dag IOL,
1177 string asmstr, InstrItinClass itin, list<dag> pattern>
1178 : I<opcode, OOL, IOL, asmstr, itin> {
1182 let Pattern = pattern;
1184 let Inst{6-10} = RT;
1185 let Inst{11-15} = xo2;
1186 let Inst{16-20} = XB{4-0};
1187 let Inst{21-29} = xo;
1188 let Inst{30} = XB{5};
1192 // [PO T XO B XO BX TX]
1193 class XX2_RD6_XO5_RS6<bits<6> opcode, bits<5> xo2, bits<9> xo, dag OOL, dag IOL,
1194 string asmstr, InstrItinClass itin, list<dag> pattern>
1195 : I<opcode, OOL, IOL, asmstr, itin> {
1199 let Pattern = pattern;
1201 let Inst{6-10} = XT{4-0};
1202 let Inst{11-15} = xo2;
1203 let Inst{16-20} = XB{4-0};
1204 let Inst{21-29} = xo;
1205 let Inst{30} = XB{5};
1206 let Inst{31} = XT{5};
1209 class XX2_BF3_DCMX7_RS6<bits<6> opcode, bits<9> xo, dag OOL, dag IOL,
1210 string asmstr, InstrItinClass itin, list<dag> pattern>
1211 : I<opcode, OOL, IOL, asmstr, itin> {
1216 let Pattern = pattern;
1219 let Inst{9-15} = DCMX;
1220 let Inst{16-20} = XB{4-0};
1221 let Inst{21-29} = xo;
1222 let Inst{30} = XB{5};
1226 class XX2_RD6_DCMX7_RS6<bits<6> opcode, bits<4> xo1, bits<3> xo2,
1227 dag OOL, dag IOL, string asmstr, InstrItinClass itin,
1229 : I<opcode, OOL, IOL, asmstr, itin> {
1234 let Pattern = pattern;
1236 let Inst{6-10} = XT{4-0};
1237 let Inst{11-15} = DCMX{4-0};
1238 let Inst{16-20} = XB{4-0};
1239 let Inst{21-24} = xo1;
1240 let Inst{25} = DCMX{6};
1241 let Inst{26-28} = xo2;
1242 let Inst{29} = DCMX{5};
1243 let Inst{30} = XB{5};
1244 let Inst{31} = XT{5};
1247 class XForm_XD6_RA5_RB5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1248 string asmstr, InstrItinClass itin, list<dag> pattern>
1249 : I<opcode, OOL, IOL, asmstr, itin> {
1254 let Pattern = pattern;
1256 let Inst{6-10} = D{4-0}; // D
1257 let Inst{11-15} = RA;
1258 let Inst{16-20} = RB;
1259 let Inst{21-30} = xo;
1260 let Inst{31} = D{5}; // DX
1263 class XForm_BF3_UIM6_FRB5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1264 string asmstr, InstrItinClass itin, list<dag> pattern>
1265 : I<opcode, OOL, IOL, asmstr, itin> {
1270 let Pattern = pattern;
1274 let Inst{10-15} = UIM;
1275 let Inst{16-20} = FRB;
1276 let Inst{21-30} = xo;
1280 class XForm_SP2_FRTB5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1281 list<dag> pattern, InstrItinClass itin>
1282 : I<opcode, OOL, IOL, asmstr, itin> {
1287 let Pattern = pattern;
1289 bit RC = 0; // set by isRecordForm
1291 let Inst{6 - 10} = FRT;
1292 let Inst{11 - 12} = SP;
1293 let Inst{13 - 15} = 0;
1294 let Inst{16 - 20} = FRB;
1295 let Inst{21 - 30} = xo;
1299 class XForm_S1_FRTB5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1300 string asmstr, list<dag> pattern, InstrItinClass itin>
1301 : I<opcode, OOL, IOL, asmstr, itin> {
1306 let Pattern = pattern;
1308 bit RC = 0; // set by isRecordForm
1310 let Inst{6 - 10} = FRT;
1312 let Inst{12 - 15} = 0;
1313 let Inst{16 - 20} = FRB;
1314 let Inst{21 - 30} = xo;
1318 class XX3Form<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
1319 InstrItinClass itin, list<dag> pattern>
1320 : I<opcode, OOL, IOL, asmstr, itin> {
1325 let Pattern = pattern;
1327 let Inst{6-10} = XT{4-0};
1328 let Inst{11-15} = XA{4-0};
1329 let Inst{16-20} = XB{4-0};
1330 let Inst{21-28} = xo;
1331 let Inst{29} = XA{5};
1332 let Inst{30} = XB{5};
1333 let Inst{31} = XT{5};
1336 class XX3Form_SameOp<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
1337 InstrItinClass itin, list<dag> pattern>
1338 : XX3Form<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1343 class XX3Form_1<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
1344 InstrItinClass itin, list<dag> pattern>
1345 : I<opcode, OOL, IOL, asmstr, itin> {
1350 let Pattern = pattern;
1354 let Inst{11-15} = XA{4-0};
1355 let Inst{16-20} = XB{4-0};
1356 let Inst{21-28} = xo;
1357 let Inst{29} = XA{5};
1358 let Inst{30} = XB{5};
1362 class XX3Form_2<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
1363 InstrItinClass itin, list<dag> pattern>
1364 : I<opcode, OOL, IOL, asmstr, itin> {
1370 let Pattern = pattern;
1372 let Inst{6-10} = XT{4-0};
1373 let Inst{11-15} = XA{4-0};
1374 let Inst{16-20} = XB{4-0};
1376 let Inst{22-23} = D;
1377 let Inst{24-28} = xo;
1378 let Inst{29} = XA{5};
1379 let Inst{30} = XB{5};
1380 let Inst{31} = XT{5};
1383 class XX3Form_Rc<bits<6> opcode, bits<7> xo, dag OOL, dag IOL, string asmstr,
1384 InstrItinClass itin, list<dag> pattern>
1385 : I<opcode, OOL, IOL, asmstr, itin> {
1390 let Pattern = pattern;
1392 bit RC = 0; // set by isRecordForm
1394 let Inst{6-10} = XT{4-0};
1395 let Inst{11-15} = XA{4-0};
1396 let Inst{16-20} = XB{4-0};
1398 let Inst{22-28} = xo;
1399 let Inst{29} = XA{5};
1400 let Inst{30} = XB{5};
1401 let Inst{31} = XT{5};
1404 class XX4Form<bits<6> opcode, bits<2> xo, dag OOL, dag IOL, string asmstr,
1405 InstrItinClass itin, list<dag> pattern>
1406 : I<opcode, OOL, IOL, asmstr, itin> {
1412 let Pattern = pattern;
1414 let Inst{6-10} = XT{4-0};
1415 let Inst{11-15} = XA{4-0};
1416 let Inst{16-20} = XB{4-0};
1417 let Inst{21-25} = XC{4-0};
1418 let Inst{26-27} = xo;
1419 let Inst{28} = XC{5};
1420 let Inst{29} = XA{5};
1421 let Inst{30} = XB{5};
1422 let Inst{31} = XT{5};
1425 // DCB_Form - Form X instruction, used for dcb* instructions.
1426 class DCB_Form<bits<10> xo, bits<5> immfield, dag OOL, dag IOL, string asmstr,
1427 InstrItinClass itin, list<dag> pattern>
1428 : I<31, OOL, IOL, asmstr, itin> {
1432 let Pattern = pattern;
1434 let Inst{6-10} = immfield;
1435 let Inst{11-15} = RA;
1436 let Inst{16-20} = RB;
1437 let Inst{21-30} = xo;
1441 class DCB_Form_hint<bits<10> xo, dag OOL, dag IOL, string asmstr,
1442 InstrItinClass itin, list<dag> pattern>
1443 : I<31, OOL, IOL, asmstr, itin> {
1448 let Pattern = pattern;
1450 let Inst{6-10} = TH;
1451 let Inst{11-15} = RA;
1452 let Inst{16-20} = RB;
1453 let Inst{21-30} = xo;
1457 // DSS_Form - Form X instruction, used for altivec dss* instructions.
1458 class DSS_Form<bits<1> T, bits<10> xo, dag OOL, dag IOL, string asmstr,
1459 InstrItinClass itin, list<dag> pattern>
1460 : I<31, OOL, IOL, asmstr, itin> {
1465 let Pattern = pattern;
1469 let Inst{9-10} = STRM;
1470 let Inst{11-15} = RA;
1471 let Inst{16-20} = RB;
1472 let Inst{21-30} = xo;
1477 class XLForm_1<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1478 InstrItinClass itin, list<dag> pattern>
1479 : I<opcode, OOL, IOL, asmstr, itin> {
1484 let Pattern = pattern;
1486 let Inst{6-10} = CRD;
1487 let Inst{11-15} = CRA;
1488 let Inst{16-20} = CRB;
1489 let Inst{21-30} = xo;
1493 // XL-Form for unary alias for CRNOR (CRNOT)
1494 class XLForm_1s<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1495 InstrItinClass itin, list<dag> pattern>
1496 : XLForm_1<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1500 class XLForm_1_np<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1501 InstrItinClass itin, list<dag> pattern>
1502 : XLForm_1<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1508 class XLForm_1_gen<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1509 InstrItinClass itin, list<dag> pattern>
1510 : XLForm_1<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1519 class XLForm_1_ext<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1520 InstrItinClass itin, list<dag> pattern>
1521 : I<opcode, OOL, IOL, asmstr, itin> {
1524 let Pattern = pattern;
1526 let Inst{6-10} = CRD;
1527 let Inst{11-15} = CRD;
1528 let Inst{16-20} = CRD;
1529 let Inst{21-30} = xo;
1533 class XLForm_2<bits<6> opcode, bits<10> xo, bit lk, dag OOL, dag IOL, string asmstr,
1534 InstrItinClass itin, list<dag> pattern>
1535 : I<opcode, OOL, IOL, asmstr, itin> {
1540 let Pattern = pattern;
1542 let Inst{6-10} = BO;
1543 let Inst{11-15} = BI;
1544 let Inst{16-18} = 0;
1545 let Inst{19-20} = BH;
1546 let Inst{21-30} = xo;
1550 class XLForm_2_br<bits<6> opcode, bits<10> xo, bit lk,
1551 dag OOL, dag IOL, string asmstr, InstrItinClass itin, list<dag> pattern>
1552 : XLForm_2<opcode, xo, lk, OOL, IOL, asmstr, itin, pattern> {
1553 bits<7> BIBO; // 2 bits of BI and 5 bits of BO.
1557 let BI{0-1} = BIBO{5-6};
1558 let BI{2-4} = CR{0-2};
1562 class XLForm_2_br2<bits<6> opcode, bits<10> xo, bits<5> bo, bit lk,
1563 dag OOL, dag IOL, string asmstr, InstrItinClass itin, list<dag> pattern>
1564 : XLForm_2<opcode, xo, lk, OOL, IOL, asmstr, itin, pattern> {
1569 class XLForm_2_ext<bits<6> opcode, bits<10> xo, bits<5> bo, bits<5> bi, bit lk,
1570 dag OOL, dag IOL, string asmstr, InstrItinClass itin, list<dag> pattern>
1571 : XLForm_2<opcode, xo, lk, OOL, IOL, asmstr, itin, pattern> {
1577 class XLForm_3<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1578 InstrItinClass itin>
1579 : I<opcode, OOL, IOL, asmstr, itin> {
1585 let Inst{11-13} = BFA;
1586 let Inst{14-15} = 0;
1587 let Inst{16-20} = 0;
1588 let Inst{21-30} = xo;
1592 class XLForm_4<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1593 InstrItinClass itin>
1594 : I<opcode, OOL, IOL, asmstr, itin> {
1603 let Inst{11-14} = 0;
1605 let Inst{16-19} = U;
1607 let Inst{21-30} = xo;
1611 class XLForm_S<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1612 InstrItinClass itin, list<dag> pattern>
1613 : I<opcode, OOL, IOL, asmstr, itin> {
1616 let Pattern = pattern;
1620 let Inst{21-30} = xo;
1624 class XLForm_2_and_DSForm_1<bits<6> opcode1, bits<10> xo1, bit lk,
1625 bits<6> opcode2, bits<2> xo2,
1626 dag OOL, dag IOL, string asmstr,
1627 InstrItinClass itin, list<dag> pattern>
1628 : I2<opcode1, opcode2, OOL, IOL, asmstr, itin> {
1637 let Pattern = pattern;
1639 let Inst{6-10} = BO;
1640 let Inst{11-15} = BI;
1641 let Inst{16-18} = 0;
1642 let Inst{19-20} = BH;
1643 let Inst{21-30} = xo1;
1646 let Inst{38-42} = RST;
1647 let Inst{43-47} = RA;
1648 let Inst{48-61} = D;
1649 let Inst{62-63} = xo2;
1652 class XLForm_2_ext_and_DSForm_1<bits<6> opcode1, bits<10> xo1,
1653 bits<5> bo, bits<5> bi, bit lk,
1654 bits<6> opcode2, bits<2> xo2,
1655 dag OOL, dag IOL, string asmstr,
1656 InstrItinClass itin, list<dag> pattern>
1657 : XLForm_2_and_DSForm_1<opcode1, xo1, lk, opcode2, xo2,
1658 OOL, IOL, asmstr, itin, pattern> {
1664 class XLForm_2_ext_and_DForm_1<bits<6> opcode1, bits<10> xo1, bits<5> bo,
1665 bits<5> bi, bit lk, bits<6> opcode2, dag OOL,
1666 dag IOL, string asmstr, InstrItinClass itin,
1668 : I2<opcode1, opcode2, OOL, IOL, asmstr, itin> {
1674 let Pattern = pattern;
1676 let Inst{6-10} = bo;
1677 let Inst{11-15} = bi;
1678 let Inst{16-18} = 0;
1679 let Inst{19-20} = 0; // Unused (BH)
1680 let Inst{21-30} = xo1;
1683 let Inst{38-42} = RST;
1684 let Inst{43-47} = RA;
1685 let Inst{48-63} = D;
1689 class XFXForm_1<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1690 InstrItinClass itin>
1691 : I<opcode, OOL, IOL, asmstr, itin> {
1695 let Inst{6-10} = RST;
1696 let Inst{11} = SPR{4};
1697 let Inst{12} = SPR{3};
1698 let Inst{13} = SPR{2};
1699 let Inst{14} = SPR{1};
1700 let Inst{15} = SPR{0};
1701 let Inst{16} = SPR{9};
1702 let Inst{17} = SPR{8};
1703 let Inst{18} = SPR{7};
1704 let Inst{19} = SPR{6};
1705 let Inst{20} = SPR{5};
1706 let Inst{21-30} = xo;
1710 class XFXForm_1_ext<bits<6> opcode, bits<10> xo, bits<10> spr,
1711 dag OOL, dag IOL, string asmstr, InstrItinClass itin>
1712 : XFXForm_1<opcode, xo, OOL, IOL, asmstr, itin> {
1716 class XFXForm_3<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1717 InstrItinClass itin>
1718 : I<opcode, OOL, IOL, asmstr, itin> {
1721 let Inst{6-10} = RT;
1722 let Inst{11-20} = 0;
1723 let Inst{21-30} = xo;
1727 class XFXForm_3p<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1728 InstrItinClass itin, list<dag> pattern>
1729 : I<opcode, OOL, IOL, asmstr, itin> {
1732 let Pattern = pattern;
1734 let Inst{6-10} = RT;
1735 let Inst{11-20} = imm;
1736 let Inst{21-30} = xo;
1740 class XFXForm_5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1741 InstrItinClass itin>
1742 : I<opcode, OOL, IOL, asmstr, itin> {
1746 let Inst{6-10} = RST;
1748 let Inst{12-19} = FXM;
1750 let Inst{21-30} = xo;
1754 class XFXForm_5a<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1755 InstrItinClass itin>
1756 : I<opcode, OOL, IOL, asmstr, itin> {
1760 let Inst{6-10} = RST;
1762 let Inst{12-19} = FXM;
1764 let Inst{21-30} = xo;
1769 // This is probably 1.7.9, but I don't have the reference that uses this
1770 // numbering scheme...
1771 class XFLForm<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1772 InstrItinClass itin, list<dag>pattern>
1773 : I<opcode, OOL, IOL, asmstr, itin> {
1777 bit RC = 0; // set by isRecordForm
1778 let Pattern = pattern;
1781 let Inst{7-14} = FM;
1783 let Inst{16-20} = RT;
1784 let Inst{21-30} = xo;
1788 class XFLForm_1<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1789 InstrItinClass itin, list<dag>pattern>
1790 : I<opcode, OOL, IOL, asmstr, itin> {
1796 bit RC = 0; // set by isRecordForm
1797 let Pattern = pattern;
1800 let Inst{7-14} = FLM;
1802 let Inst{16-20} = FRB;
1803 let Inst{21-30} = xo;
1807 // 1.7.10 XS-Form - SRADI.
1808 class XSForm_1<bits<6> opcode, bits<9> xo, dag OOL, dag IOL, string asmstr,
1809 InstrItinClass itin, list<dag> pattern>
1810 : I<opcode, OOL, IOL, asmstr, itin> {
1815 bit RC = 0; // set by isRecordForm
1816 let Pattern = pattern;
1818 let Inst{6-10} = RS;
1819 let Inst{11-15} = RA;
1820 let Inst{16-20} = SH{4,3,2,1,0};
1821 let Inst{21-29} = xo;
1822 let Inst{30} = SH{5};
1827 class XOForm_1<bits<6> opcode, bits<9> xo, bit oe, dag OOL, dag IOL, string asmstr,
1828 InstrItinClass itin, list<dag> pattern>
1829 : I<opcode, OOL, IOL, asmstr, itin> {
1834 let Pattern = pattern;
1836 bit RC = 0; // set by isRecordForm
1838 let Inst{6-10} = RT;
1839 let Inst{11-15} = RA;
1840 let Inst{16-20} = RB;
1842 let Inst{22-30} = xo;
1846 class XOForm_3<bits<6> opcode, bits<9> xo, bit oe,
1847 dag OOL, dag IOL, string asmstr, InstrItinClass itin, list<dag> pattern>
1848 : XOForm_1<opcode, xo, oe, OOL, IOL, asmstr, itin, pattern> {
1853 class AForm_1<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
1854 InstrItinClass itin, list<dag> pattern>
1855 : I<opcode, OOL, IOL, asmstr, itin> {
1861 let Pattern = pattern;
1863 bit RC = 0; // set by isRecordForm
1865 let Inst{6-10} = FRT;
1866 let Inst{11-15} = FRA;
1867 let Inst{16-20} = FRB;
1868 let Inst{21-25} = FRC;
1869 let Inst{26-30} = xo;
1873 class AForm_2<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
1874 InstrItinClass itin, list<dag> pattern>
1875 : AForm_1<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1879 class AForm_3<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
1880 InstrItinClass itin, list<dag> pattern>
1881 : AForm_1<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1885 class AForm_4<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
1886 InstrItinClass itin, list<dag> pattern>
1887 : I<opcode, OOL, IOL, asmstr, itin> {
1893 let Pattern = pattern;
1895 let Inst{6-10} = RT;
1896 let Inst{11-15} = RA;
1897 let Inst{16-20} = RB;
1898 let Inst{21-25} = COND;
1899 let Inst{26-30} = xo;
1904 class MForm_1<bits<6> opcode, dag OOL, dag IOL, string asmstr,
1905 InstrItinClass itin, list<dag> pattern>
1906 : I<opcode, OOL, IOL, asmstr, itin> {
1913 let Pattern = pattern;
1915 bit RC = 0; // set by isRecordForm
1917 let Inst{6-10} = RS;
1918 let Inst{11-15} = RA;
1919 let Inst{16-20} = RB;
1920 let Inst{21-25} = MB;
1921 let Inst{26-30} = ME;
1925 class MForm_2<bits<6> opcode, dag OOL, dag IOL, string asmstr,
1926 InstrItinClass itin, list<dag> pattern>
1927 : I<opcode, OOL, IOL, asmstr, itin> {
1934 let Pattern = pattern;
1936 bit RC = 0; // set by isRecordForm
1938 let Inst{6-10} = RS;
1939 let Inst{11-15} = RA;
1940 let Inst{16-20} = SH;
1941 let Inst{21-25} = MB;
1942 let Inst{26-30} = ME;
1947 class MDForm_1<bits<6> opcode, bits<3> xo, dag OOL, dag IOL, string asmstr,
1948 InstrItinClass itin, list<dag> pattern>
1949 : I<opcode, OOL, IOL, asmstr, itin> {
1955 let Pattern = pattern;
1957 bit RC = 0; // set by isRecordForm
1959 let Inst{6-10} = RS;
1960 let Inst{11-15} = RA;
1961 let Inst{16-20} = SH{4,3,2,1,0};
1962 let Inst{21-26} = MBE{4,3,2,1,0,5};
1963 let Inst{27-29} = xo;
1964 let Inst{30} = SH{5};
1968 class MDSForm_1<bits<6> opcode, bits<4> xo, dag OOL, dag IOL, string asmstr,
1969 InstrItinClass itin, list<dag> pattern>
1970 : I<opcode, OOL, IOL, asmstr, itin> {
1976 let Pattern = pattern;
1978 bit RC = 0; // set by isRecordForm
1980 let Inst{6-10} = RS;
1981 let Inst{11-15} = RA;
1982 let Inst{16-20} = RB;
1983 let Inst{21-26} = MBE{4,3,2,1,0,5};
1984 let Inst{27-30} = xo;
1991 // VAForm_1 - DACB ordering.
1992 class VAForm_1<bits<6> xo, dag OOL, dag IOL, string asmstr,
1993 InstrItinClass itin, list<dag> pattern>
1994 : I<4, OOL, IOL, asmstr, itin> {
2000 let Pattern = pattern;
2002 let Inst{6-10} = RT;
2003 let Inst{11-15} = RA;
2004 let Inst{16-20} = RB;
2005 let Inst{21-25} = RC;
2006 let Inst{26-31} = xo;
2009 // VAForm_1a - DABC ordering.
2010 class VAForm_1a<bits<6> xo, dag OOL, dag IOL, string asmstr,
2011 InstrItinClass itin, list<dag> pattern>
2012 : I<4, OOL, IOL, asmstr, itin> {
2018 let Pattern = pattern;
2020 let Inst{6-10} = RT;
2021 let Inst{11-15} = RA;
2022 let Inst{16-20} = RB;
2023 let Inst{21-25} = RC;
2024 let Inst{26-31} = xo;
2027 class VAForm_2<bits<6> xo, dag OOL, dag IOL, string asmstr,
2028 InstrItinClass itin, list<dag> pattern>
2029 : I<4, OOL, IOL, asmstr, itin> {
2035 let Pattern = pattern;
2037 let Inst{6-10} = RT;
2038 let Inst{11-15} = RA;
2039 let Inst{16-20} = RB;
2041 let Inst{22-25} = SH;
2042 let Inst{26-31} = xo;
2046 class VXForm_1<bits<11> xo, dag OOL, dag IOL, string asmstr,
2047 InstrItinClass itin, list<dag> pattern>
2048 : I<4, OOL, IOL, asmstr, itin> {
2053 let Pattern = pattern;
2055 let Inst{6-10} = VD;
2056 let Inst{11-15} = VA;
2057 let Inst{16-20} = VB;
2058 let Inst{21-31} = xo;
2061 class VXForm_setzero<bits<11> xo, dag OOL, dag IOL, string asmstr,
2062 InstrItinClass itin, list<dag> pattern>
2063 : VXForm_1<xo, OOL, IOL, asmstr, itin, pattern> {
2069 class VXForm_2<bits<11> xo, dag OOL, dag IOL, string asmstr,
2070 InstrItinClass itin, list<dag> pattern>
2071 : I<4, OOL, IOL, asmstr, itin> {
2075 let Pattern = pattern;
2077 let Inst{6-10} = VD;
2078 let Inst{11-15} = 0;
2079 let Inst{16-20} = VB;
2080 let Inst{21-31} = xo;
2083 class VXForm_3<bits<11> xo, dag OOL, dag IOL, string asmstr,
2084 InstrItinClass itin, list<dag> pattern>
2085 : I<4, OOL, IOL, asmstr, itin> {
2089 let Pattern = pattern;
2091 let Inst{6-10} = VD;
2092 let Inst{11-15} = IMM;
2093 let Inst{16-20} = 0;
2094 let Inst{21-31} = xo;
2097 /// VXForm_4 - VX instructions with "VD,0,0" register fields, like mfvscr.
2098 class VXForm_4<bits<11> xo, dag OOL, dag IOL, string asmstr,
2099 InstrItinClass itin, list<dag> pattern>
2100 : I<4, OOL, IOL, asmstr, itin> {
2103 let Pattern = pattern;
2105 let Inst{6-10} = VD;
2106 let Inst{11-15} = 0;
2107 let Inst{16-20} = 0;
2108 let Inst{21-31} = xo;
2111 /// VXForm_5 - VX instructions with "0,0,VB" register fields, like mtvscr.
2112 class VXForm_5<bits<11> xo, dag OOL, dag IOL, string asmstr,
2113 InstrItinClass itin, list<dag> pattern>
2114 : I<4, OOL, IOL, asmstr, itin> {
2117 let Pattern = pattern;
2120 let Inst{11-15} = 0;
2121 let Inst{16-20} = VB;
2122 let Inst{21-31} = xo;
2125 // e.g. [PO VRT EO VRB XO]
2126 class VXForm_RD5_XO5_RS5<bits<11> xo, bits<5> eo, dag OOL, dag IOL,
2127 string asmstr, InstrItinClass itin, list<dag> pattern>
2128 : I<4, OOL, IOL, asmstr, itin> {
2132 let Pattern = pattern;
2134 let Inst{6-10} = VD;
2135 let Inst{11-15} = eo;
2136 let Inst{16-20} = VB;
2137 let Inst{21-31} = xo;
2140 /// VXForm_CR - VX crypto instructions with "VRT, VRA, ST, SIX"
2141 class VXForm_CR<bits<11> xo, dag OOL, dag IOL, string asmstr,
2142 InstrItinClass itin, list<dag> pattern>
2143 : I<4, OOL, IOL, asmstr, itin> {
2149 let Pattern = pattern;
2151 let Inst{6-10} = VD;
2152 let Inst{11-15} = VA;
2154 let Inst{17-20} = SIX;
2155 let Inst{21-31} = xo;
2158 /// VXForm_BX - VX crypto instructions with "VRT, VRA, 0 - like vsbox"
2159 class VXForm_BX<bits<11> xo, dag OOL, dag IOL, string asmstr,
2160 InstrItinClass itin, list<dag> pattern>
2161 : I<4, OOL, IOL, asmstr, itin> {
2165 let Pattern = pattern;
2167 let Inst{6-10} = VD;
2168 let Inst{11-15} = VA;
2169 let Inst{16-20} = 0;
2170 let Inst{21-31} = xo;
2174 class VXRForm_1<bits<10> xo, dag OOL, dag IOL, string asmstr,
2175 InstrItinClass itin, list<dag> pattern>
2176 : I<4, OOL, IOL, asmstr, itin> {
2182 let Pattern = pattern;
2184 let Inst{6-10} = VD;
2185 let Inst{11-15} = VA;
2186 let Inst{16-20} = VB;
2188 let Inst{22-31} = xo;
2191 // VX-Form: [PO VRT EO VRB 1 PS XO]
2192 class VX_RD5_EO5_RS5_PS1_XO9<bits<5> eo, bits<9> xo,
2193 dag OOL, dag IOL, string asmstr,
2194 InstrItinClass itin, list<dag> pattern>
2195 : I<4, OOL, IOL, asmstr, itin> {
2200 let Pattern = pattern;
2202 let Inst{6-10} = VD;
2203 let Inst{11-15} = eo;
2204 let Inst{16-20} = VB;
2207 let Inst{23-31} = xo;
2210 // VX-Form: [PO VRT VRA VRB 1 PS XO] or [PO VRT VRA VRB 1 / XO]
2211 class VX_RD5_RSp5_PS1_XO9<bits<9> xo, dag OOL, dag IOL, string asmstr,
2212 InstrItinClass itin, list<dag> pattern>
2213 : I<4, OOL, IOL, asmstr, itin> {
2219 let Pattern = pattern;
2221 let Inst{6-10} = VD;
2222 let Inst{11-15} = VA;
2223 let Inst{16-20} = VB;
2226 let Inst{23-31} = xo;
2229 class Z22Form_BF3_FRA5_DCM6<bits<6> opcode, bits<9> xo, dag OOL, dag IOL,
2230 string asmstr, InstrItinClass itin,
2232 : I<opcode, OOL, IOL, asmstr, itin> {
2237 let Pattern = pattern;
2241 let Inst{11-15} = FRA;
2242 let Inst{16-21} = DCM;
2243 let Inst{22-30} = xo;
2247 class Z22Form_FRTA5_SH6<bits<6> opcode, bits<9> xo, dag OOL, dag IOL,
2248 string asmstr, list<dag> pattern, InstrItinClass itin>
2249 : I<opcode, OOL, IOL, asmstr, itin> {
2255 let Pattern = pattern;
2257 bit RC = 0; // set by isRecordForm
2259 let Inst{6 - 10} = FRT;
2260 let Inst{11 - 15} = FRA;
2261 let Inst{16 - 21} = SH;
2262 let Inst{22 - 30} = xo;
2266 class Z23Form_8<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
2267 InstrItinClass itin, list<dag> pattern>
2268 : I<opcode, OOL, IOL, asmstr, itin> {
2274 let Pattern = pattern;
2276 bit RC = 0; // set by isRecordForm
2278 let Inst{6-10} = VRT;
2279 let Inst{11-14} = 0;
2281 let Inst{16-20} = VRB;
2282 let Inst{21-22} = idx;
2283 let Inst{23-30} = xo;
2287 class Z23Form_RTAB5_CY2<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
2288 string asmstr, InstrItinClass itin, list<dag> pattern>
2289 : I<opcode, OOL, IOL, asmstr, itin> {
2295 let Pattern = pattern;
2297 let Inst{6-10} = RT;
2298 let Inst{11-15} = RA;
2299 let Inst{16-20} = RB;
2300 let Inst{21-22} = CY;
2301 let Inst{23-30} = xo;
2305 class Z23Form_FRTAB5_RMC2<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
2306 string asmstr, list<dag> pattern>
2307 : I<opcode, OOL, IOL, asmstr, NoItinerary> {
2313 let Pattern = pattern;
2315 bit RC = 0; // set by isRecordForm
2317 let Inst{6 - 10} = FRT;
2318 let Inst{11 - 15} = FRA;
2319 let Inst{16 - 20} = FRB;
2320 let Inst{21 - 22} = RMC;
2321 let Inst{23 - 30} = xo;
2325 class Z23Form_TE5_FRTB5_RMC2<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
2326 string asmstr, list<dag> pattern>
2327 : Z23Form_FRTAB5_RMC2<opcode, xo, OOL, IOL, asmstr, pattern> {
2332 class Z23Form_FRTB5_R1_RMC2<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
2333 string asmstr, list<dag> pattern>
2334 : I<opcode, OOL, IOL, asmstr, NoItinerary> {
2340 let Pattern = pattern;
2342 bit RC = 0; // set by isRecordForm
2344 let Inst{6 - 10} = FRT;
2345 let Inst{11 - 14} = 0;
2347 let Inst{16 - 20} = FRB;
2348 let Inst{21 - 22} = RMC;
2349 let Inst{23 - 30} = xo;
2353 //===----------------------------------------------------------------------===//
2354 // EmitTimePseudo won't have encoding information for the [MC]CodeEmitter
2356 class PPCEmitTimePseudo<dag OOL, dag IOL, string asmstr, list<dag> pattern>
2357 : I<0, OOL, IOL, asmstr, NoItinerary> {
2358 let isCodeGenOnly = 1;
2360 let Pattern = pattern;
2362 let hasNoSchedulingInfo = 1;
2365 // Instruction that require custom insertion support
2366 // a.k.a. ISelPseudos, however, these won't have isPseudo set
2367 class PPCCustomInserterPseudo<dag OOL, dag IOL, string asmstr,
2369 : PPCEmitTimePseudo<OOL, IOL, asmstr, pattern> {
2370 let usesCustomInserter = 1;
2373 // PostRAPseudo will be expanded in expandPostRAPseudo, isPseudo flag in td
2374 // files is set only for PostRAPseudo
2375 class PPCPostRAExpPseudo<dag OOL, dag IOL, string asmstr, list<dag> pattern>
2376 : PPCEmitTimePseudo<OOL, IOL, asmstr, pattern> {
2380 class PseudoXFormMemOp<dag OOL, dag IOL, string asmstr, list<dag> pattern>
2381 : PPCPostRAExpPseudo<OOL, IOL, asmstr, pattern>, XFormMemOp;