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{7} = XFormMemOp;
44 // Fields used for relation models.
47 // For cases where multiple instruction definitions really represent the
48 // same underlying instruction but with one definition for 64-bit arguments
49 // and one for 32-bit arguments, this bit breaks the degeneracy between
50 // the two forms and allows TableGen to generate mapping tables.
51 bit Interpretation64Bit = 0;
54 class PPC970_DGroup_First { bits<1> PPC970_First = 1; }
55 class PPC970_DGroup_Single { bits<1> PPC970_Single = 1; }
56 class PPC970_DGroup_Cracked { bits<1> PPC970_Cracked = 1; }
57 class PPC970_MicroCode;
59 class PPC970_Unit_Pseudo { bits<3> PPC970_Unit = 0; }
60 class PPC970_Unit_FXU { bits<3> PPC970_Unit = 1; }
61 class PPC970_Unit_LSU { bits<3> PPC970_Unit = 2; }
62 class PPC970_Unit_FPU { bits<3> PPC970_Unit = 3; }
63 class PPC970_Unit_CRU { bits<3> PPC970_Unit = 4; }
64 class PPC970_Unit_VALU { bits<3> PPC970_Unit = 5; }
65 class PPC970_Unit_VPERM { bits<3> PPC970_Unit = 6; }
66 class PPC970_Unit_BRU { bits<3> PPC970_Unit = 7; }
68 class XFormMemOp { bits<1> XFormMemOp = 1; }
70 // Two joined instructions; used to emit two adjacent instructions as one.
71 // The itinerary from the first instruction is used for scheduling and
73 class I2<bits<6> opcode1, bits<6> opcode2, dag OOL, dag IOL, string asmstr,
77 field bits<64> SoftFail = 0;
80 bit PPC64 = 0; // Default value, override with isPPC64
82 let Namespace = "PPC";
83 let Inst{0-5} = opcode1;
84 let Inst{32-37} = opcode2;
85 let OutOperandList = OOL;
86 let InOperandList = IOL;
87 let AsmString = asmstr;
90 bits<1> PPC970_First = 0;
91 bits<1> PPC970_Single = 0;
92 bits<1> PPC970_Cracked = 0;
93 bits<3> PPC970_Unit = 0;
95 /// These fields correspond to the fields in PPCInstrInfo.h. Any changes to
96 /// these must be reflected there! See comments there for what these are.
97 let TSFlags{0} = PPC970_First;
98 let TSFlags{1} = PPC970_Single;
99 let TSFlags{2} = PPC970_Cracked;
100 let TSFlags{5-3} = PPC970_Unit;
102 // Fields used for relation models.
103 string BaseName = "";
104 bit Interpretation64Bit = 0;
107 // Base class for all X-Form memory instructions
108 class IXFormMemOp<bits<6> opcode, dag OOL, dag IOL, string asmstr,
110 :I<opcode, OOL, IOL, asmstr, itin>, XFormMemOp;
113 class IForm<bits<6> opcode, bit aa, bit lk, dag OOL, dag IOL, string asmstr,
114 InstrItinClass itin, list<dag> pattern>
115 : I<opcode, OOL, IOL, asmstr, itin> {
116 let Pattern = pattern;
125 class BForm<bits<6> opcode, bit aa, bit lk, dag OOL, dag IOL, string asmstr>
126 : I<opcode, OOL, IOL, asmstr, IIC_BrB> {
127 bits<7> BIBO; // 2 bits of BI and 5 bits of BO.
132 let BI{0-1} = BIBO{5-6};
133 let BI{2-4} = CR{0-2};
135 let Inst{6-10} = BIBO{4-0};
136 let Inst{11-15} = BI;
137 let Inst{16-29} = BD;
142 class BForm_1<bits<6> opcode, bits<5> bo, bit aa, bit lk, dag OOL, dag IOL,
144 : BForm<opcode, aa, lk, OOL, IOL, asmstr> {
150 class BForm_2<bits<6> opcode, bits<5> bo, bits<5> bi, bit aa, bit lk,
151 dag OOL, dag IOL, string asmstr>
152 : I<opcode, OOL, IOL, asmstr, IIC_BrB> {
156 let Inst{11-15} = bi;
157 let Inst{16-29} = BD;
162 class BForm_3<bits<6> opcode, bit aa, bit lk,
163 dag OOL, dag IOL, string asmstr>
164 : I<opcode, OOL, IOL, asmstr, IIC_BrB> {
170 let Inst{11-15} = BI;
171 let Inst{16-29} = BD;
176 class BForm_3_at<bits<6> opcode, bit aa, bit lk,
177 dag OOL, dag IOL, string asmstr>
178 : I<opcode, OOL, IOL, asmstr, IIC_BrB> {
184 let Inst{6-8} = BO{4-2};
186 let Inst{11-15} = BI;
187 let Inst{16-29} = BD;
192 class BForm_4<bits<6> opcode, bits<5> bo, bit aa, bit lk,
193 dag OOL, dag IOL, string asmstr>
194 : I<opcode, OOL, IOL, asmstr, IIC_BrB> {
199 let Inst{11-15} = BI;
200 let Inst{16-29} = BD;
206 class SCForm<bits<6> opcode, bits<1> xo,
207 dag OOL, dag IOL, string asmstr, InstrItinClass itin,
209 : I<opcode, OOL, IOL, asmstr, itin> {
212 let Pattern = pattern;
214 let Inst{20-26} = LEV;
219 class DForm_base<bits<6> opcode, dag OOL, dag IOL, string asmstr,
220 InstrItinClass itin, list<dag> pattern>
221 : I<opcode, OOL, IOL, asmstr, itin> {
226 let Pattern = pattern;
233 class DForm_1<bits<6> opcode, dag OOL, dag IOL, string asmstr,
234 InstrItinClass itin, list<dag> pattern>
235 : I<opcode, OOL, IOL, asmstr, itin> {
239 let Pattern = pattern;
242 let Inst{11-15} = Addr{20-16}; // Base Reg
243 let Inst{16-31} = Addr{15-0}; // Displacement
246 class DForm_1a<bits<6> opcode, dag OOL, dag IOL, string asmstr,
247 InstrItinClass itin, list<dag> pattern>
248 : I<opcode, OOL, IOL, asmstr, itin> {
253 let Pattern = pattern;
261 class DForm_2<bits<6> opcode, dag OOL, dag IOL, string asmstr,
262 InstrItinClass itin, list<dag> pattern>
263 : DForm_base<opcode, OOL, IOL, asmstr, itin, pattern> {
265 // Even though ADDICo does not really have an RC bit, provide
266 // the declaration of one here so that isDOT has something to set.
270 class DForm_2_r0<bits<6> opcode, dag OOL, dag IOL, string asmstr,
271 InstrItinClass itin, list<dag> pattern>
272 : I<opcode, OOL, IOL, asmstr, itin> {
276 let Pattern = pattern;
283 class DForm_4<bits<6> opcode, dag OOL, dag IOL, string asmstr,
284 InstrItinClass itin, list<dag> pattern>
285 : I<opcode, OOL, IOL, asmstr, itin> {
290 let Pattern = pattern;
297 class DForm_4_zero<bits<6> opcode, dag OOL, dag IOL, string asmstr,
298 InstrItinClass itin, list<dag> pattern>
299 : DForm_1<opcode, OOL, IOL, asmstr, itin, pattern> {
304 class DForm_4_fixedreg_zero<bits<6> opcode, bits<5> R, dag OOL, dag IOL,
305 string asmstr, InstrItinClass itin,
307 : DForm_4<opcode, OOL, IOL, asmstr, itin, pattern> {
313 class IForm_and_DForm_1<bits<6> opcode1, bit aa, bit lk, bits<6> opcode2,
314 dag OOL, dag IOL, string asmstr,
315 InstrItinClass itin, list<dag> pattern>
316 : I2<opcode1, opcode2, OOL, IOL, asmstr, itin> {
320 let Pattern = pattern;
328 let Inst{43-47} = Addr{20-16}; // Base Reg
329 let Inst{48-63} = Addr{15-0}; // Displacement
332 // This is used to emit BL8+NOP.
333 class IForm_and_DForm_4_zero<bits<6> opcode1, bit aa, bit lk, bits<6> opcode2,
334 dag OOL, dag IOL, string asmstr,
335 InstrItinClass itin, list<dag> pattern>
336 : IForm_and_DForm_1<opcode1, aa, lk, opcode2,
337 OOL, IOL, asmstr, itin, pattern> {
342 class DForm_5<bits<6> opcode, dag OOL, dag IOL, string asmstr,
344 : I<opcode, OOL, IOL, asmstr, itin> {
353 let Inst{11-15} = RA;
357 class DForm_5_ext<bits<6> opcode, dag OOL, dag IOL, string asmstr,
359 : DForm_5<opcode, OOL, IOL, asmstr, itin> {
363 class DForm_6<bits<6> opcode, dag OOL, dag IOL, string asmstr,
365 : DForm_5<opcode, OOL, IOL, asmstr, itin>;
367 class DForm_6_ext<bits<6> opcode, dag OOL, dag IOL, string asmstr,
369 : DForm_6<opcode, OOL, IOL, asmstr, itin> {
375 class DSForm_1<bits<6> opcode, bits<2> xo, dag OOL, dag IOL, string asmstr,
376 InstrItinClass itin, list<dag> pattern>
377 : I<opcode, OOL, IOL, asmstr, itin> {
381 let Pattern = pattern;
383 let Inst{6-10} = RST;
384 let Inst{11-15} = DS_RA{18-14}; // Register #
385 let Inst{16-29} = DS_RA{13-0}; // Displacement.
386 let Inst{30-31} = xo;
389 // ISA V3.0B 1.6.6 DX-Form
390 class DXForm<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
391 InstrItinClass itin, list<dag> pattern>
392 : I<opcode, OOL, IOL, asmstr, itin> {
396 let Pattern = pattern;
399 let Inst{11-15} = D{5-1}; // d1
400 let Inst{16-25} = D{15-6}; // d0
401 let Inst{26-30} = xo;
402 let Inst{31} = D{0}; // d2
405 // DQ-Form: [PO T RA DQ TX XO] or [PO S RA DQ SX XO]
406 class DQ_RD6_RS5_DQ12<bits<6> opcode, bits<3> xo, dag OOL, dag IOL,
407 string asmstr, InstrItinClass itin, list<dag> pattern>
408 : I<opcode, OOL, IOL, asmstr, itin> {
412 let Pattern = pattern;
414 let Inst{6-10} = XT{4-0};
415 let Inst{11-15} = DS_RA{16-12}; // Register #
416 let Inst{16-27} = DS_RA{11-0}; // Displacement.
417 let Inst{28} = XT{5};
418 let Inst{29-31} = xo;
422 class XForm_base_r3xo<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
423 InstrItinClass itin, list<dag> pattern>
424 : I<opcode, OOL, IOL, asmstr, itin> {
429 let Pattern = pattern;
431 bit RC = 0; // set by isDOT
433 let Inst{6-10} = RST;
436 let Inst{21-30} = xo;
440 class XForm_base_r3xo_memOp<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
441 string asmstr, InstrItinClass itin,
443 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern>, XFormMemOp;
445 class XForm_tlb<bits<10> xo, dag OOL, dag IOL, string asmstr,
446 InstrItinClass itin> : XForm_base_r3xo<31, xo, OOL, IOL, asmstr, itin, []> {
450 class XForm_attn<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
452 : I<opcode, OOL, IOL, asmstr, itin> {
453 let Inst{21-30} = xo;
456 // This is the same as XForm_base_r3xo, but the first two operands are swapped
457 // when code is emitted.
458 class XForm_base_r3xo_swapped
459 <bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
461 : I<opcode, OOL, IOL, asmstr, itin> {
466 bit RC = 0; // set by isDOT
468 let Inst{6-10} = RST;
471 let Inst{21-30} = xo;
476 class XForm_1<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
477 InstrItinClass itin, list<dag> pattern>
478 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern>;
480 class XForm_1_memOp<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
481 InstrItinClass itin, list<dag> pattern>
482 : XForm_base_r3xo_memOp<opcode, xo, OOL, IOL, asmstr, itin, pattern>;
484 class XForm_1a<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
485 InstrItinClass itin, list<dag> pattern>
486 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
490 class XForm_rs<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
491 InstrItinClass itin, list<dag> pattern>
492 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
497 class XForm_tlbws<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
498 InstrItinClass itin, list<dag> pattern>
499 : I<opcode, OOL, IOL, asmstr, itin> {
504 let Pattern = pattern;
506 let Inst{6-10} = RST;
509 let Inst{21-30} = xo;
513 class XForm_6<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
514 InstrItinClass itin, list<dag> pattern>
515 : XForm_base_r3xo_swapped<opcode, xo, OOL, IOL, asmstr, itin> {
516 let Pattern = pattern;
519 class XForm_8<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
520 InstrItinClass itin, list<dag> pattern>
521 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern>;
523 class XForm_8_memOp<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
524 InstrItinClass itin, list<dag> pattern>
525 : XForm_base_r3xo_memOp<opcode, xo, OOL, IOL, asmstr, itin, pattern>;
527 class XForm_10<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
528 InstrItinClass itin, list<dag> pattern>
529 : XForm_base_r3xo_swapped<opcode, xo, OOL, IOL, asmstr, itin> {
530 let Pattern = pattern;
533 class XForm_11<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
534 InstrItinClass itin, list<dag> pattern>
535 : XForm_base_r3xo_swapped<opcode, xo, OOL, IOL, asmstr, itin> {
537 let Pattern = pattern;
540 class XForm_16<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
542 : I<opcode, OOL, IOL, asmstr, itin> {
551 let Inst{11-15} = RA;
552 let Inst{16-20} = RB;
553 let Inst{21-30} = xo;
557 class XForm_icbt<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
559 : I<opcode, OOL, IOL, asmstr, itin> {
566 let Inst{11-15} = RA;
567 let Inst{16-20} = RB;
568 let Inst{21-30} = xo;
572 class XForm_sr<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
574 : I<opcode, OOL, IOL, asmstr, itin> {
579 let Inst{12-15} = SR;
580 let Inst{21-30} = xo;
583 class XForm_mbar<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
585 : I<opcode, OOL, IOL, asmstr, itin> {
589 let Inst{21-30} = xo;
592 class XForm_srin<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
594 : I<opcode, OOL, IOL, asmstr, itin> {
599 let Inst{16-20} = RB;
600 let Inst{21-30} = xo;
603 class XForm_mtmsr<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
605 : I<opcode, OOL, IOL, asmstr, itin> {
611 let Inst{21-30} = xo;
614 class XForm_16_ext<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
616 : XForm_16<opcode, xo, OOL, IOL, asmstr, itin> {
620 class XForm_17<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
622 : I<opcode, OOL, IOL, asmstr, itin> {
629 let Inst{11-15} = FRA;
630 let Inst{16-20} = FRB;
631 let Inst{21-30} = xo;
635 class XForm_17a<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
637 : XForm_17<opcode, xo, OOL, IOL, asmstr, itin > {
642 class XForm_18<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
643 InstrItinClass itin, list<dag> pattern>
644 : I<opcode, OOL, IOL, asmstr, itin> {
649 let Pattern = pattern;
651 let Inst{6-10} = FRT;
652 let Inst{11-15} = FRA;
653 let Inst{16-20} = FRB;
654 let Inst{21-30} = xo;
658 class XForm_19<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
659 InstrItinClass itin, list<dag> pattern>
660 : XForm_18<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
664 class XForm_20<bits<6> opcode, bits<6> xo, dag OOL, dag IOL, string asmstr,
665 InstrItinClass itin, list<dag> pattern>
666 : I<opcode, OOL, IOL, asmstr, itin> {
672 let Pattern = pattern;
674 let Inst{6-10} = FRT;
675 let Inst{11-15} = FRA;
676 let Inst{16-20} = FRB;
677 let Inst{21-24} = tttt;
678 let Inst{25-30} = xo;
682 class XForm_24<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
683 InstrItinClass itin, list<dag> pattern>
684 : I<opcode, OOL, IOL, asmstr, itin> {
685 let Pattern = pattern;
689 let Inst{21-30} = xo;
693 class XForm_24_sync<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
694 string asmstr, InstrItinClass itin, list<dag> pattern>
695 : I<opcode, OOL, IOL, asmstr, itin> {
698 let Pattern = pattern;
703 let Inst{21-30} = xo;
707 class XForm_24_eieio<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
708 string asmstr, InstrItinClass itin, list<dag> pattern>
709 : XForm_24_sync<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
713 class XForm_25<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
714 InstrItinClass itin, list<dag> pattern>
715 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
718 class XForm_25_memOp<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
719 string asmstr, InstrItinClass itin, list<dag> pattern>
720 : XForm_base_r3xo_memOp<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
723 // [PO RT /// RB XO RC]
724 class XForm_26<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
725 InstrItinClass itin, list<dag> pattern>
726 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
730 class XForm_28_memOp<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
731 string asmstr, InstrItinClass itin, list<dag> pattern>
732 : XForm_base_r3xo_memOp<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
735 class XForm_28<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
736 InstrItinClass itin, list<dag> pattern>
737 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
740 // This is used for MFFS, MTFSB0, MTFSB1. 42 is arbitrary; this series of
741 // numbers presumably relates to some document, but I haven't found it.
742 class XForm_42<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
743 InstrItinClass itin, list<dag> pattern>
744 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
745 let Pattern = pattern;
747 bit RC = 0; // set by isDOT
749 let Inst{6-10} = RST;
751 let Inst{21-30} = xo;
754 class XForm_43<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
755 InstrItinClass itin, list<dag> pattern>
756 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
757 let Pattern = pattern;
760 bit RC = 0; // set by isDOT
764 let Inst{21-30} = xo;
768 class XForm_44<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
770 : I<opcode, OOL, IOL, asmstr, itin> {
775 let Inst{11-13} = BFA;
778 let Inst{21-30} = xo;
782 class XForm_45<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
784 : I<opcode, OOL, IOL, asmstr, itin> {
792 let Inst{21-30} = xo;
796 class X_FRT5_XO2_XO3_XO10<bits<6> opcode, bits<2> xo1, bits<3> xo2, bits<10> xo,
797 dag OOL, dag IOL, string asmstr, InstrItinClass itin,
799 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
800 let Pattern = pattern;
802 let Inst{6-10} = RST;
803 let Inst{11-12} = xo1;
804 let Inst{13-15} = xo2;
806 let Inst{21-30} = xo;
810 class X_FRT5_XO2_XO3_FRB5_XO10<bits<6> opcode, bits<2> xo1, bits<3> xo2,
811 bits<10> xo, dag OOL, dag IOL, string asmstr,
812 InstrItinClass itin, list<dag> pattern>
813 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
814 let Pattern = pattern;
817 let Inst{6-10} = RST;
818 let Inst{11-12} = xo1;
819 let Inst{13-15} = xo2;
820 let Inst{16-20} = FRB;
821 let Inst{21-30} = xo;
825 class X_FRT5_XO2_XO3_DRM3_XO10<bits<6> opcode, bits<2> xo1, bits<3> xo2,
826 bits<10> xo, dag OOL, dag IOL, string asmstr,
827 InstrItinClass itin, list<dag> pattern>
828 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
829 let Pattern = pattern;
832 let Inst{6-10} = RST;
833 let Inst{11-12} = xo1;
834 let Inst{13-15} = xo2;
836 let Inst{18-20} = DRM;
837 let Inst{21-30} = xo;
841 class X_FRT5_XO2_XO3_RM2_X10<bits<6> opcode, bits<2> xo1, bits<3> xo2,
842 bits<10> xo, dag OOL, dag IOL, string asmstr,
843 InstrItinClass itin, list<dag> pattern>
844 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
845 let Pattern = pattern;
848 let Inst{6-10} = RST;
849 let Inst{11-12} = xo1;
850 let Inst{13-15} = xo2;
852 let Inst{19-20} = RM;
853 let Inst{21-30} = xo;
858 class XForm_0<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
859 InstrItinClass itin, list<dag> pattern>
860 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
866 class XForm_16b<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
867 InstrItinClass itin, list<dag> pattern>
868 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
873 class XForm_htm0<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
874 string asmstr, InstrItinClass itin, list<dag> pattern>
875 : I<opcode, OOL, IOL, asmstr, itin> {
883 let Inst{21-30} = xo;
887 class XForm_htm1<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
888 string asmstr, InstrItinClass itin, list<dag> pattern>
889 : I<opcode, OOL, IOL, asmstr, itin> {
896 let Inst{21-30} = xo;
900 class XForm_htm2<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
901 InstrItinClass itin, list<dag> pattern>
902 : I<opcode, OOL, IOL, asmstr, itin> {
905 bit RC = 0; // set by isDOT
910 let Inst{21-30} = xo;
914 class XForm_htm3<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
915 InstrItinClass itin, list<dag> pattern>
916 : I<opcode, OOL, IOL, asmstr, itin> {
923 let Inst{21-30} = xo;
927 // [PO RT RA RB XO /]
928 class X_BF3_L1_RS5_RS5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
929 string asmstr, InstrItinClass itin, list<dag> pattern>
930 : I<opcode, OOL, IOL, asmstr, itin> {
936 let Pattern = pattern;
941 let Inst{11-15} = RA;
942 let Inst{16-20} = RB;
943 let Inst{21-30} = xo;
947 // Same as XForm_17 but with GPR's and new naming convention
948 class X_BF3_RS5_RS5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
949 string asmstr, InstrItinClass itin, list<dag> pattern>
950 : I<opcode, OOL, IOL, asmstr, itin> {
955 let Pattern = pattern;
959 let Inst{11-15} = RA;
960 let Inst{16-20} = RB;
961 let Inst{21-30} = xo;
965 // e.g. [PO VRT XO VRB XO /] or [PO VRT XO VRB XO RO]
966 class X_RD5_XO5_RS5<bits<6> opcode, bits<5> xo2, bits<10> xo, dag OOL, dag IOL,
967 string asmstr, InstrItinClass itin, list<dag> pattern>
968 : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
972 class X_BF3_DCMX7_RS5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
973 string asmstr, InstrItinClass itin, list<dag> pattern>
974 : I<opcode, OOL, IOL, asmstr, itin> {
979 let Pattern = pattern;
982 let Inst{9-15} = DCMX;
983 let Inst{16-20} = VB;
984 let Inst{21-30} = xo;
988 class X_RD6_IMM8<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
989 string asmstr, InstrItinClass itin, list<dag> pattern>
990 : I<opcode, OOL, IOL, asmstr, itin> {
994 let Pattern = pattern;
996 let Inst{6-10} = XT{4-0};
998 let Inst{13-20} = IMM8;
999 let Inst{21-30} = xo;
1000 let Inst{31} = XT{5};
1003 // XForm_base_r3xo for instructions such as P9 atomics where we don't want
1004 // to specify an SDAG pattern for matching.
1005 class X_RD5_RS5_IM5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1006 string asmstr, InstrItinClass itin>
1007 : XForm_base_r3xo_memOp<opcode, xo, OOL, IOL, asmstr, itin, []> {
1010 class X_BF3<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1011 InstrItinClass itin>
1012 : XForm_17<opcode, xo, OOL, IOL, asmstr, itin> {
1017 // [PO /// L RA RB XO /]
1018 class X_L1_RS5_RS5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1019 string asmstr, InstrItinClass itin, list<dag> pattern>
1020 : XForm_16<opcode, xo, OOL, IOL, asmstr, itin> {
1022 let Pattern = pattern;
1029 class XX1Form<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1030 InstrItinClass itin, list<dag> pattern>
1031 : I<opcode, OOL, IOL, asmstr, itin> {
1036 let Pattern = pattern;
1038 let Inst{6-10} = XT{4-0};
1039 let Inst{11-15} = A;
1040 let Inst{16-20} = B;
1041 let Inst{21-30} = xo;
1042 let Inst{31} = XT{5};
1045 class XX1Form_memOp<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1046 string asmstr, InstrItinClass itin, list<dag> pattern>
1047 : XX1Form<opcode, xo, OOL, IOL, asmstr, itin, pattern>, XFormMemOp;
1049 class XX1_RS6_RD5_XO<bits<6> opcode, bits<10> xo, dag OOL, dag IOL,
1050 string asmstr, InstrItinClass itin, list<dag> pattern>
1051 : XX1Form<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1055 class XX2Form<bits<6> opcode, bits<9> xo, dag OOL, dag IOL, string asmstr,
1056 InstrItinClass itin, list<dag> pattern>
1057 : I<opcode, OOL, IOL, asmstr, itin> {
1061 let Pattern = pattern;
1063 let Inst{6-10} = XT{4-0};
1064 let Inst{11-15} = 0;
1065 let Inst{16-20} = XB{4-0};
1066 let Inst{21-29} = xo;
1067 let Inst{30} = XB{5};
1068 let Inst{31} = XT{5};
1071 class XX2Form_1<bits<6> opcode, bits<9> xo, dag OOL, dag IOL, string asmstr,
1072 InstrItinClass itin, list<dag> pattern>
1073 : I<opcode, OOL, IOL, asmstr, itin> {
1077 let Pattern = pattern;
1081 let Inst{16-20} = XB{4-0};
1082 let Inst{21-29} = xo;
1083 let Inst{30} = XB{5};
1087 class XX2Form_2<bits<6> opcode, bits<9> xo, dag OOL, dag IOL, string asmstr,
1088 InstrItinClass itin, list<dag> pattern>
1089 : I<opcode, OOL, IOL, asmstr, itin> {
1094 let Pattern = pattern;
1096 let Inst{6-10} = XT{4-0};
1097 let Inst{11-13} = 0;
1098 let Inst{14-15} = D;
1099 let Inst{16-20} = XB{4-0};
1100 let Inst{21-29} = xo;
1101 let Inst{30} = XB{5};
1102 let Inst{31} = XT{5};
1105 class XX2_RD6_UIM5_RS6<bits<6> opcode, bits<9> xo, dag OOL, dag IOL,
1106 string asmstr, InstrItinClass itin, list<dag> pattern>
1107 : I<opcode, OOL, IOL, asmstr, itin> {
1112 let Pattern = pattern;
1114 let Inst{6-10} = XT{4-0};
1115 let Inst{11-15} = UIM5;
1116 let Inst{16-20} = XB{4-0};
1117 let Inst{21-29} = xo;
1118 let Inst{30} = XB{5};
1119 let Inst{31} = XT{5};
1122 // [PO T XO B XO BX /]
1123 class XX2_RD5_XO5_RS6<bits<6> opcode, bits<5> xo2, bits<9> xo, dag OOL, dag IOL,
1124 string asmstr, InstrItinClass itin, list<dag> pattern>
1125 : I<opcode, OOL, IOL, asmstr, itin> {
1129 let Pattern = pattern;
1131 let Inst{6-10} = RT;
1132 let Inst{11-15} = xo2;
1133 let Inst{16-20} = XB{4-0};
1134 let Inst{21-29} = xo;
1135 let Inst{30} = XB{5};
1139 // [PO T XO B XO BX TX]
1140 class XX2_RD6_XO5_RS6<bits<6> opcode, bits<5> xo2, bits<9> xo, dag OOL, dag IOL,
1141 string asmstr, InstrItinClass itin, list<dag> pattern>
1142 : I<opcode, OOL, IOL, asmstr, itin> {
1146 let Pattern = pattern;
1148 let Inst{6-10} = XT{4-0};
1149 let Inst{11-15} = xo2;
1150 let Inst{16-20} = XB{4-0};
1151 let Inst{21-29} = xo;
1152 let Inst{30} = XB{5};
1153 let Inst{31} = XT{5};
1156 class XX2_BF3_DCMX7_RS6<bits<6> opcode, bits<9> xo, dag OOL, dag IOL,
1157 string asmstr, InstrItinClass itin, list<dag> pattern>
1158 : I<opcode, OOL, IOL, asmstr, itin> {
1163 let Pattern = pattern;
1166 let Inst{9-15} = DCMX;
1167 let Inst{16-20} = XB{4-0};
1168 let Inst{21-29} = xo;
1169 let Inst{30} = XB{5};
1173 class XX2_RD6_DCMX7_RS6<bits<6> opcode, bits<4> xo1, bits<3> xo2,
1174 dag OOL, dag IOL, string asmstr, InstrItinClass itin,
1176 : I<opcode, OOL, IOL, asmstr, itin> {
1181 let Pattern = pattern;
1183 let Inst{6-10} = XT{4-0};
1184 let Inst{11-15} = DCMX{4-0};
1185 let Inst{16-20} = XB{4-0};
1186 let Inst{21-24} = xo1;
1187 let Inst{25} = DCMX{6};
1188 let Inst{26-28} = xo2;
1189 let Inst{29} = DCMX{5};
1190 let Inst{30} = XB{5};
1191 let Inst{31} = XT{5};
1194 class XX3Form<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
1195 InstrItinClass itin, list<dag> pattern>
1196 : I<opcode, OOL, IOL, asmstr, itin> {
1201 let Pattern = pattern;
1203 let Inst{6-10} = XT{4-0};
1204 let Inst{11-15} = XA{4-0};
1205 let Inst{16-20} = XB{4-0};
1206 let Inst{21-28} = xo;
1207 let Inst{29} = XA{5};
1208 let Inst{30} = XB{5};
1209 let Inst{31} = XT{5};
1212 class XX3Form_Zero<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
1213 InstrItinClass itin, list<dag> pattern>
1214 : XX3Form<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1219 class XX3Form_SetZero<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
1220 InstrItinClass itin, list<dag> pattern>
1221 : XX3Form<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1226 class XX3Form_1<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
1227 InstrItinClass itin, list<dag> pattern>
1228 : I<opcode, OOL, IOL, asmstr, itin> {
1233 let Pattern = pattern;
1237 let Inst{11-15} = XA{4-0};
1238 let Inst{16-20} = XB{4-0};
1239 let Inst{21-28} = xo;
1240 let Inst{29} = XA{5};
1241 let Inst{30} = XB{5};
1245 class XX3Form_2<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
1246 InstrItinClass itin, list<dag> pattern>
1247 : I<opcode, OOL, IOL, asmstr, itin> {
1253 let Pattern = pattern;
1255 let Inst{6-10} = XT{4-0};
1256 let Inst{11-15} = XA{4-0};
1257 let Inst{16-20} = XB{4-0};
1259 let Inst{22-23} = D;
1260 let Inst{24-28} = xo;
1261 let Inst{29} = XA{5};
1262 let Inst{30} = XB{5};
1263 let Inst{31} = XT{5};
1266 class XX3Form_Rc<bits<6> opcode, bits<7> xo, dag OOL, dag IOL, string asmstr,
1267 InstrItinClass itin, list<dag> pattern>
1268 : I<opcode, OOL, IOL, asmstr, itin> {
1273 let Pattern = pattern;
1275 bit RC = 0; // set by isDOT
1277 let Inst{6-10} = XT{4-0};
1278 let Inst{11-15} = XA{4-0};
1279 let Inst{16-20} = XB{4-0};
1281 let Inst{22-28} = xo;
1282 let Inst{29} = XA{5};
1283 let Inst{30} = XB{5};
1284 let Inst{31} = XT{5};
1287 class XX4Form<bits<6> opcode, bits<2> xo, dag OOL, dag IOL, string asmstr,
1288 InstrItinClass itin, list<dag> pattern>
1289 : I<opcode, OOL, IOL, asmstr, itin> {
1295 let Pattern = pattern;
1297 let Inst{6-10} = XT{4-0};
1298 let Inst{11-15} = XA{4-0};
1299 let Inst{16-20} = XB{4-0};
1300 let Inst{21-25} = XC{4-0};
1301 let Inst{26-27} = xo;
1302 let Inst{28} = XC{5};
1303 let Inst{29} = XA{5};
1304 let Inst{30} = XB{5};
1305 let Inst{31} = XT{5};
1308 // DCB_Form - Form X instruction, used for dcb* instructions.
1309 class DCB_Form<bits<10> xo, bits<5> immfield, dag OOL, dag IOL, string asmstr,
1310 InstrItinClass itin, list<dag> pattern>
1311 : I<31, OOL, IOL, asmstr, itin> {
1315 let Pattern = pattern;
1317 let Inst{6-10} = immfield;
1318 let Inst{11-15} = A;
1319 let Inst{16-20} = B;
1320 let Inst{21-30} = xo;
1324 class DCB_Form_hint<bits<10> xo, dag OOL, dag IOL, string asmstr,
1325 InstrItinClass itin, list<dag> pattern>
1326 : I<31, OOL, IOL, asmstr, itin> {
1331 let Pattern = pattern;
1333 let Inst{6-10} = TH;
1334 let Inst{11-15} = A;
1335 let Inst{16-20} = B;
1336 let Inst{21-30} = xo;
1340 // DSS_Form - Form X instruction, used for altivec dss* instructions.
1341 class DSS_Form<bits<1> T, bits<10> xo, dag OOL, dag IOL, string asmstr,
1342 InstrItinClass itin, list<dag> pattern>
1343 : I<31, OOL, IOL, asmstr, itin> {
1348 let Pattern = pattern;
1352 let Inst{9-10} = STRM;
1353 let Inst{11-15} = A;
1354 let Inst{16-20} = B;
1355 let Inst{21-30} = xo;
1360 class XLForm_1<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1361 InstrItinClass itin, list<dag> pattern>
1362 : I<opcode, OOL, IOL, asmstr, itin> {
1367 let Pattern = pattern;
1369 let Inst{6-10} = CRD;
1370 let Inst{11-15} = CRA;
1371 let Inst{16-20} = CRB;
1372 let Inst{21-30} = xo;
1376 class XLForm_1_np<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1377 InstrItinClass itin, list<dag> pattern>
1378 : XLForm_1<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1384 class XLForm_1_gen<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1385 InstrItinClass itin, list<dag> pattern>
1386 : XLForm_1<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1395 class XLForm_1_ext<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1396 InstrItinClass itin, list<dag> pattern>
1397 : I<opcode, OOL, IOL, asmstr, itin> {
1400 let Pattern = pattern;
1402 let Inst{6-10} = CRD;
1403 let Inst{11-15} = CRD;
1404 let Inst{16-20} = CRD;
1405 let Inst{21-30} = xo;
1409 class XLForm_2<bits<6> opcode, bits<10> xo, bit lk, dag OOL, dag IOL, string asmstr,
1410 InstrItinClass itin, list<dag> pattern>
1411 : I<opcode, OOL, IOL, asmstr, itin> {
1416 let Pattern = pattern;
1418 let Inst{6-10} = BO;
1419 let Inst{11-15} = BI;
1420 let Inst{16-18} = 0;
1421 let Inst{19-20} = BH;
1422 let Inst{21-30} = xo;
1426 class XLForm_2_br<bits<6> opcode, bits<10> xo, bit lk,
1427 dag OOL, dag IOL, string asmstr, InstrItinClass itin, list<dag> pattern>
1428 : XLForm_2<opcode, xo, lk, OOL, IOL, asmstr, itin, pattern> {
1429 bits<7> BIBO; // 2 bits of BI and 5 bits of BO.
1433 let BI{0-1} = BIBO{5-6};
1434 let BI{2-4} = CR{0-2};
1438 class XLForm_2_br2<bits<6> opcode, bits<10> xo, bits<5> bo, bit lk,
1439 dag OOL, dag IOL, string asmstr, InstrItinClass itin, list<dag> pattern>
1440 : XLForm_2<opcode, xo, lk, OOL, IOL, asmstr, itin, pattern> {
1445 class XLForm_2_ext<bits<6> opcode, bits<10> xo, bits<5> bo, bits<5> bi, bit lk,
1446 dag OOL, dag IOL, string asmstr, InstrItinClass itin, list<dag> pattern>
1447 : XLForm_2<opcode, xo, lk, OOL, IOL, asmstr, itin, pattern> {
1453 class XLForm_3<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1454 InstrItinClass itin>
1455 : I<opcode, OOL, IOL, asmstr, itin> {
1461 let Inst{11-13} = BFA;
1462 let Inst{14-15} = 0;
1463 let Inst{16-20} = 0;
1464 let Inst{21-30} = xo;
1468 class XLForm_4<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1469 InstrItinClass itin>
1470 : I<opcode, OOL, IOL, asmstr, itin> {
1479 let Inst{11-14} = 0;
1481 let Inst{16-19} = U;
1483 let Inst{21-30} = xo;
1487 class XLForm_S<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1488 InstrItinClass itin, list<dag> pattern>
1489 : I<opcode, OOL, IOL, asmstr, itin> {
1492 let Pattern = pattern;
1496 let Inst{21-30} = xo;
1500 class XLForm_2_and_DSForm_1<bits<6> opcode1, bits<10> xo1, bit lk,
1501 bits<6> opcode2, bits<2> xo2,
1502 dag OOL, dag IOL, string asmstr,
1503 InstrItinClass itin, list<dag> pattern>
1504 : I2<opcode1, opcode2, OOL, IOL, asmstr, itin> {
1512 let Pattern = pattern;
1514 let Inst{6-10} = BO;
1515 let Inst{11-15} = BI;
1516 let Inst{16-18} = 0;
1517 let Inst{19-20} = BH;
1518 let Inst{21-30} = xo1;
1521 let Inst{38-42} = RST;
1522 let Inst{43-47} = DS_RA{18-14}; // Register #
1523 let Inst{48-61} = DS_RA{13-0}; // Displacement.
1524 let Inst{62-63} = xo2;
1527 class XLForm_2_ext_and_DSForm_1<bits<6> opcode1, bits<10> xo1,
1528 bits<5> bo, bits<5> bi, bit lk,
1529 bits<6> opcode2, bits<2> xo2,
1530 dag OOL, dag IOL, string asmstr,
1531 InstrItinClass itin, list<dag> pattern>
1532 : XLForm_2_and_DSForm_1<opcode1, xo1, lk, opcode2, xo2,
1533 OOL, IOL, asmstr, itin, pattern> {
1540 class XFXForm_1<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1541 InstrItinClass itin>
1542 : I<opcode, OOL, IOL, asmstr, itin> {
1546 let Inst{6-10} = RT;
1547 let Inst{11} = SPR{4};
1548 let Inst{12} = SPR{3};
1549 let Inst{13} = SPR{2};
1550 let Inst{14} = SPR{1};
1551 let Inst{15} = SPR{0};
1552 let Inst{16} = SPR{9};
1553 let Inst{17} = SPR{8};
1554 let Inst{18} = SPR{7};
1555 let Inst{19} = SPR{6};
1556 let Inst{20} = SPR{5};
1557 let Inst{21-30} = xo;
1561 class XFXForm_1_ext<bits<6> opcode, bits<10> xo, bits<10> spr,
1562 dag OOL, dag IOL, string asmstr, InstrItinClass itin>
1563 : XFXForm_1<opcode, xo, OOL, IOL, asmstr, itin> {
1567 class XFXForm_3<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1568 InstrItinClass itin>
1569 : I<opcode, OOL, IOL, asmstr, itin> {
1572 let Inst{6-10} = RT;
1573 let Inst{11-20} = 0;
1574 let Inst{21-30} = xo;
1578 class XFXForm_3p<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1579 InstrItinClass itin, list<dag> pattern>
1580 : I<opcode, OOL, IOL, asmstr, itin> {
1583 let Pattern = pattern;
1585 let Inst{6-10} = RT;
1586 let Inst{11-20} = Entry;
1587 let Inst{21-30} = xo;
1591 class XFXForm_5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1592 InstrItinClass itin>
1593 : I<opcode, OOL, IOL, asmstr, itin> {
1597 let Inst{6-10} = rS;
1599 let Inst{12-19} = FXM;
1601 let Inst{21-30} = xo;
1605 class XFXForm_5a<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1606 InstrItinClass itin>
1607 : I<opcode, OOL, IOL, asmstr, itin> {
1611 let Inst{6-10} = ST;
1613 let Inst{12-19} = FXM;
1615 let Inst{21-30} = xo;
1619 class XFXForm_7<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1620 InstrItinClass itin>
1621 : XFXForm_1<opcode, xo, OOL, IOL, asmstr, itin>;
1623 class XFXForm_7_ext<bits<6> opcode, bits<10> xo, bits<10> spr,
1624 dag OOL, dag IOL, string asmstr, InstrItinClass itin>
1625 : XFXForm_7<opcode, xo, OOL, IOL, asmstr, itin> {
1630 // This is probably 1.7.9, but I don't have the reference that uses this
1631 // numbering scheme...
1632 class XFLForm<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1633 InstrItinClass itin, list<dag>pattern>
1634 : I<opcode, OOL, IOL, asmstr, itin> {
1638 bit RC = 0; // set by isDOT
1639 let Pattern = pattern;
1642 let Inst{7-14} = FM;
1644 let Inst{16-20} = rT;
1645 let Inst{21-30} = xo;
1649 class XFLForm_1<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
1650 InstrItinClass itin, list<dag>pattern>
1651 : I<opcode, OOL, IOL, asmstr, itin> {
1657 bit RC = 0; // set by isDOT
1658 let Pattern = pattern;
1661 let Inst{7-14} = FLM;
1663 let Inst{16-20} = FRB;
1664 let Inst{21-30} = xo;
1668 // 1.7.10 XS-Form - SRADI.
1669 class XSForm_1<bits<6> opcode, bits<9> xo, dag OOL, dag IOL, string asmstr,
1670 InstrItinClass itin, list<dag> pattern>
1671 : I<opcode, OOL, IOL, asmstr, itin> {
1676 bit RC = 0; // set by isDOT
1677 let Pattern = pattern;
1679 let Inst{6-10} = RS;
1680 let Inst{11-15} = A;
1681 let Inst{16-20} = SH{4,3,2,1,0};
1682 let Inst{21-29} = xo;
1683 let Inst{30} = SH{5};
1688 class XOForm_1<bits<6> opcode, bits<9> xo, bit oe, dag OOL, dag IOL, string asmstr,
1689 InstrItinClass itin, list<dag> pattern>
1690 : I<opcode, OOL, IOL, asmstr, itin> {
1695 let Pattern = pattern;
1697 bit RC = 0; // set by isDOT
1699 let Inst{6-10} = RT;
1700 let Inst{11-15} = RA;
1701 let Inst{16-20} = RB;
1703 let Inst{22-30} = xo;
1707 class XOForm_3<bits<6> opcode, bits<9> xo, bit oe,
1708 dag OOL, dag IOL, string asmstr, InstrItinClass itin, list<dag> pattern>
1709 : XOForm_1<opcode, xo, oe, OOL, IOL, asmstr, itin, pattern> {
1714 class AForm_1<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
1715 InstrItinClass itin, list<dag> pattern>
1716 : I<opcode, OOL, IOL, asmstr, itin> {
1722 let Pattern = pattern;
1724 bit RC = 0; // set by isDOT
1726 let Inst{6-10} = FRT;
1727 let Inst{11-15} = FRA;
1728 let Inst{16-20} = FRB;
1729 let Inst{21-25} = FRC;
1730 let Inst{26-30} = xo;
1734 class AForm_2<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
1735 InstrItinClass itin, list<dag> pattern>
1736 : AForm_1<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1740 class AForm_3<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
1741 InstrItinClass itin, list<dag> pattern>
1742 : AForm_1<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1746 class AForm_4<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
1747 InstrItinClass itin, list<dag> pattern>
1748 : I<opcode, OOL, IOL, asmstr, itin> {
1754 let Pattern = pattern;
1756 let Inst{6-10} = RT;
1757 let Inst{11-15} = RA;
1758 let Inst{16-20} = RB;
1759 let Inst{21-25} = COND;
1760 let Inst{26-30} = xo;
1765 class AForm_4a<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
1766 InstrItinClass itin, list<dag> pattern>
1767 : AForm_1<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
1773 class MForm_1<bits<6> opcode, dag OOL, dag IOL, string asmstr,
1774 InstrItinClass itin, list<dag> pattern>
1775 : I<opcode, OOL, IOL, asmstr, itin> {
1782 let Pattern = pattern;
1784 bit RC = 0; // set by isDOT
1786 let Inst{6-10} = RS;
1787 let Inst{11-15} = RA;
1788 let Inst{16-20} = RB;
1789 let Inst{21-25} = MB;
1790 let Inst{26-30} = ME;
1794 class MForm_2<bits<6> opcode, dag OOL, dag IOL, string asmstr,
1795 InstrItinClass itin, list<dag> pattern>
1796 : MForm_1<opcode, OOL, IOL, asmstr, itin, pattern> {
1800 class MDForm_1<bits<6> opcode, bits<3> xo, dag OOL, dag IOL, string asmstr,
1801 InstrItinClass itin, list<dag> pattern>
1802 : I<opcode, OOL, IOL, asmstr, itin> {
1808 let Pattern = pattern;
1810 bit RC = 0; // set by isDOT
1812 let Inst{6-10} = RS;
1813 let Inst{11-15} = RA;
1814 let Inst{16-20} = SH{4,3,2,1,0};
1815 let Inst{21-26} = MBE{4,3,2,1,0,5};
1816 let Inst{27-29} = xo;
1817 let Inst{30} = SH{5};
1821 class MDSForm_1<bits<6> opcode, bits<4> xo, dag OOL, dag IOL, string asmstr,
1822 InstrItinClass itin, list<dag> pattern>
1823 : I<opcode, OOL, IOL, asmstr, itin> {
1829 let Pattern = pattern;
1831 bit RC = 0; // set by isDOT
1833 let Inst{6-10} = RS;
1834 let Inst{11-15} = RA;
1835 let Inst{16-20} = RB;
1836 let Inst{21-26} = MBE{4,3,2,1,0,5};
1837 let Inst{27-30} = xo;
1844 // VAForm_1 - DACB ordering.
1845 class VAForm_1<bits<6> xo, dag OOL, dag IOL, string asmstr,
1846 InstrItinClass itin, list<dag> pattern>
1847 : I<4, OOL, IOL, asmstr, itin> {
1853 let Pattern = pattern;
1855 let Inst{6-10} = VD;
1856 let Inst{11-15} = VA;
1857 let Inst{16-20} = VB;
1858 let Inst{21-25} = VC;
1859 let Inst{26-31} = xo;
1862 // VAForm_1a - DABC ordering.
1863 class VAForm_1a<bits<6> xo, dag OOL, dag IOL, string asmstr,
1864 InstrItinClass itin, list<dag> pattern>
1865 : I<4, OOL, IOL, asmstr, itin> {
1871 let Pattern = pattern;
1873 let Inst{6-10} = VD;
1874 let Inst{11-15} = VA;
1875 let Inst{16-20} = VB;
1876 let Inst{21-25} = VC;
1877 let Inst{26-31} = xo;
1880 class VAForm_2<bits<6> xo, dag OOL, dag IOL, string asmstr,
1881 InstrItinClass itin, list<dag> pattern>
1882 : I<4, OOL, IOL, asmstr, itin> {
1888 let Pattern = pattern;
1890 let Inst{6-10} = VD;
1891 let Inst{11-15} = VA;
1892 let Inst{16-20} = VB;
1894 let Inst{22-25} = SH;
1895 let Inst{26-31} = xo;
1899 class VXForm_1<bits<11> xo, dag OOL, dag IOL, string asmstr,
1900 InstrItinClass itin, list<dag> pattern>
1901 : I<4, OOL, IOL, asmstr, itin> {
1906 let Pattern = pattern;
1908 let Inst{6-10} = VD;
1909 let Inst{11-15} = VA;
1910 let Inst{16-20} = VB;
1911 let Inst{21-31} = xo;
1914 class VXForm_setzero<bits<11> xo, dag OOL, dag IOL, string asmstr,
1915 InstrItinClass itin, list<dag> pattern>
1916 : VXForm_1<xo, OOL, IOL, asmstr, itin, pattern> {
1922 class VXForm_2<bits<11> xo, dag OOL, dag IOL, string asmstr,
1923 InstrItinClass itin, list<dag> pattern>
1924 : I<4, OOL, IOL, asmstr, itin> {
1928 let Pattern = pattern;
1930 let Inst{6-10} = VD;
1931 let Inst{11-15} = 0;
1932 let Inst{16-20} = VB;
1933 let Inst{21-31} = xo;
1936 class VXForm_3<bits<11> xo, dag OOL, dag IOL, string asmstr,
1937 InstrItinClass itin, list<dag> pattern>
1938 : I<4, OOL, IOL, asmstr, itin> {
1942 let Pattern = pattern;
1944 let Inst{6-10} = VD;
1945 let Inst{11-15} = IMM;
1946 let Inst{16-20} = 0;
1947 let Inst{21-31} = xo;
1950 /// VXForm_4 - VX instructions with "VD,0,0" register fields, like mfvscr.
1951 class VXForm_4<bits<11> xo, dag OOL, dag IOL, string asmstr,
1952 InstrItinClass itin, list<dag> pattern>
1953 : I<4, OOL, IOL, asmstr, itin> {
1956 let Pattern = pattern;
1958 let Inst{6-10} = VD;
1959 let Inst{11-15} = 0;
1960 let Inst{16-20} = 0;
1961 let Inst{21-31} = xo;
1964 /// VXForm_5 - VX instructions with "0,0,VB" register fields, like mtvscr.
1965 class VXForm_5<bits<11> xo, dag OOL, dag IOL, string asmstr,
1966 InstrItinClass itin, list<dag> pattern>
1967 : I<4, OOL, IOL, asmstr, itin> {
1970 let Pattern = pattern;
1973 let Inst{11-15} = 0;
1974 let Inst{16-20} = VB;
1975 let Inst{21-31} = xo;
1978 // e.g. [PO VRT EO VRB XO]
1979 class VXForm_RD5_XO5_RS5<bits<11> xo, bits<5> eo, dag OOL, dag IOL,
1980 string asmstr, InstrItinClass itin, list<dag> pattern>
1981 : I<4, OOL, IOL, asmstr, itin> {
1985 let Pattern = pattern;
1987 let Inst{6-10} = RD;
1988 let Inst{11-15} = eo;
1989 let Inst{16-20} = VB;
1990 let Inst{21-31} = xo;
1993 /// VXForm_CR - VX crypto instructions with "VRT, VRA, ST, SIX"
1994 class VXForm_CR<bits<11> xo, dag OOL, dag IOL, string asmstr,
1995 InstrItinClass itin, list<dag> pattern>
1996 : I<4, OOL, IOL, asmstr, itin> {
2002 let Pattern = pattern;
2004 let Inst{6-10} = VD;
2005 let Inst{11-15} = VA;
2007 let Inst{17-20} = SIX;
2008 let Inst{21-31} = xo;
2011 /// VXForm_BX - VX crypto instructions with "VRT, VRA, 0 - like vsbox"
2012 class VXForm_BX<bits<11> xo, dag OOL, dag IOL, string asmstr,
2013 InstrItinClass itin, list<dag> pattern>
2014 : I<4, OOL, IOL, asmstr, itin> {
2018 let Pattern = pattern;
2020 let Inst{6-10} = VD;
2021 let Inst{11-15} = VA;
2022 let Inst{16-20} = 0;
2023 let Inst{21-31} = xo;
2027 class VXRForm_1<bits<10> 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} = VD;
2038 let Inst{11-15} = VA;
2039 let Inst{16-20} = VB;
2041 let Inst{22-31} = xo;
2044 // VX-Form: [PO VRT EO VRB 1 PS XO]
2045 class VX_RD5_EO5_RS5_PS1_XO9<bits<5> eo, bits<9> xo,
2046 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} = eo;
2057 let Inst{16-20} = VB;
2060 let Inst{23-31} = xo;
2063 // VX-Form: [PO VRT VRA VRB 1 PS XO] or [PO VRT VRA VRB 1 / XO]
2064 class VX_RD5_RSp5_PS1_XO9<bits<9> xo, dag OOL, dag IOL, string asmstr,
2065 InstrItinClass itin, list<dag> pattern>
2066 : I<4, OOL, IOL, asmstr, itin> {
2072 let Pattern = pattern;
2074 let Inst{6-10} = VD;
2075 let Inst{11-15} = VA;
2076 let Inst{16-20} = VB;
2079 let Inst{23-31} = xo;
2082 // Z23-Form (used by QPX)
2083 class Z23Form_1<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
2084 InstrItinClass itin, list<dag> pattern>
2085 : I<opcode, OOL, IOL, asmstr, itin> {
2091 let Pattern = pattern;
2093 bit RC = 0; // set by isDOT
2095 let Inst{6-10} = FRT;
2096 let Inst{11-15} = FRA;
2097 let Inst{16-20} = FRB;
2098 let Inst{21-22} = idx;
2099 let Inst{23-30} = xo;
2103 class Z23Form_2<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
2104 InstrItinClass itin, list<dag> pattern>
2105 : Z23Form_1<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
2109 class Z23Form_3<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
2110 InstrItinClass itin, list<dag> pattern>
2111 : I<opcode, OOL, IOL, asmstr, itin> {
2115 let Pattern = pattern;
2117 bit RC = 0; // set by isDOT
2119 let Inst{6-10} = FRT;
2120 let Inst{11-22} = idx;
2121 let Inst{23-30} = xo;
2125 class Z23Form_8<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
2126 InstrItinClass itin, list<dag> pattern>
2127 : I<opcode, OOL, IOL, asmstr, itin> {
2133 let Pattern = pattern;
2135 bit RC = 0; // set by isDOT
2137 let Inst{6-10} = VRT;
2138 let Inst{11-14} = 0;
2140 let Inst{16-20} = VRB;
2141 let Inst{21-22} = idx;
2142 let Inst{23-30} = xo;
2146 //===----------------------------------------------------------------------===//
2147 // EmitTimePseudo won't have encoding information for the [MC]CodeEmitter
2149 class PPCEmitTimePseudo<dag OOL, dag IOL, string asmstr, list<dag> pattern>
2150 : I<0, OOL, IOL, asmstr, NoItinerary> {
2151 let isCodeGenOnly = 1;
2153 let Pattern = pattern;
2155 let hasNoSchedulingInfo = 1;
2158 // Instruction that require custom insertion support
2159 // a.k.a. ISelPseudos, however, these won't have isPseudo set
2160 class PPCCustomInserterPseudo<dag OOL, dag IOL, string asmstr,
2162 : PPCEmitTimePseudo<OOL, IOL, asmstr, pattern> {
2163 let usesCustomInserter = 1;
2166 // PostRAPseudo will be expanded in expandPostRAPseudo, isPseudo flag in td
2167 // files is set only for PostRAPseudo
2168 class PPCPostRAExpPseudo<dag OOL, dag IOL, string asmstr, list<dag> pattern>
2169 : PPCEmitTimePseudo<OOL, IOL, asmstr, pattern> {
2173 class PseudoXFormMemOp<dag OOL, dag IOL, string asmstr, list<dag> pattern>
2174 : PPCPostRAExpPseudo<OOL, IOL, asmstr, pattern>, XFormMemOp;