Add all of the data stream intrinsics and instructions. woo
[oota-llvm.git] / lib / Target / PowerPC / PPCInstrFormats.td
1 //===- PowerPCInstrFormats.td - PowerPC Instruction Formats --*- tablegen -*-=//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9
10 //===----------------------------------------------------------------------===//
11 //
12 // PowerPC instruction formats
13
14 class I<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin>
15         : Instruction {
16   field bits<32> Inst;
17
18   bit PPC64 = 0;  // Default value, override with isPPC64
19   bit VMX = 0;    // Default value, override with isVMX
20
21   let Name = "";
22   let Namespace = "PPC";
23   let Inst{0-5} = opcode;
24   let OperandList = OL;
25   let AsmString = asmstr;
26   let Itinerary = itin;
27   
28   /// These fields correspond to the fields in PPCInstrInfo.h.  Any changes to
29   /// these must be reflected there!  See comments there for what these are.
30   bits<1> PPC970_First = 0;
31   bits<1> PPC970_Single = 0;
32   bits<1> PPC970_Cracked = 0;
33   bits<3> PPC970_Unit = 0;
34 }
35
36 class PPC970_DGroup_First   { bits<1> PPC970_First = 1;  }
37 class PPC970_DGroup_Single  { bits<1> PPC970_Single = 1; }
38 class PPC970_DGroup_Cracked { bits<1> PPC970_Cracked = 1; }
39 class PPC970_MicroCode;
40
41 class PPC970_Unit_Pseudo   { bits<3> PPC970_Unit = 0;   }
42 class PPC970_Unit_FXU      { bits<3> PPC970_Unit = 1;   }
43 class PPC970_Unit_LSU      { bits<3> PPC970_Unit = 2;   }
44 class PPC970_Unit_FPU      { bits<3> PPC970_Unit = 3;   }
45 class PPC970_Unit_CRU      { bits<3> PPC970_Unit = 4;   }
46 class PPC970_Unit_VALU     { bits<3> PPC970_Unit = 5;   }
47 class PPC970_Unit_VPERM    { bits<3> PPC970_Unit = 6;   }
48 class PPC970_Unit_BRU      { bits<3> PPC970_Unit = 7;   }
49
50
51 // 1.7.1 I-Form
52 class IForm<bits<6> opcode, bit aa, bit lk, dag OL, string asmstr,
53             InstrItinClass itin, list<dag> pattern>
54          : I<opcode, OL, asmstr, itin> {
55   let Pattern = pattern;
56   bits<24> LI;
57
58   let Inst{6-29}  = LI;
59   let Inst{30}    = aa;
60   let Inst{31}    = lk;
61 }
62
63 // 1.7.2 B-Form
64 class BForm<bits<6> opcode, bit aa, bit lk, bits<5> bo, bits<2> bicode, dag OL, 
65             string asmstr, InstrItinClass itin>
66   : I<opcode, OL, asmstr, itin> {
67   bits<3>  CR;
68   bits<14> BD;
69
70   let Inst{6-10}  = bo;
71   let Inst{11-13} = CR;
72   let Inst{14-15} = bicode;
73   let Inst{16-29} = BD;
74   let Inst{30}    = aa;
75   let Inst{31}    = lk;
76 }
77
78 // 1.7.4 D-Form
79 class DForm_base<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin,
80                  list<dag> pattern> 
81   : I<opcode, OL, asmstr, itin> {
82   bits<5>  A;
83   bits<5>  B;
84   bits<16> C;
85
86   let Pattern = pattern;
87   
88   let Inst{6-10}  = A;
89   let Inst{11-15} = B;
90   let Inst{16-31} = C;
91 }
92
93 class DForm_1<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin,
94               list<dag> pattern>
95   : I<opcode, OL, asmstr, itin> {
96   bits<5>  A;
97   bits<16> C;
98   bits<5>  B;
99
100   let Pattern = pattern;
101   
102   let Inst{6-10}  = A;
103   let Inst{11-15} = B;
104   let Inst{16-31} = C;
105 }
106
107 class DForm_2<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin,
108               list<dag> pattern>
109   : DForm_base<opcode, OL, asmstr, itin, pattern>;
110
111 class DForm_2_r0<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin,
112                  list<dag> pattern>
113   : I<opcode, OL, asmstr, itin> {
114   bits<5>  A;
115   bits<16> B;
116   
117   let Pattern = pattern;
118   
119   let Inst{6-10}  = A;
120   let Inst{11-15} = 0;
121   let Inst{16-31} = B;
122 }
123
124 // Currently we make the use/def reg distinction in ISel, not tablegen
125 class DForm_3<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin,
126               list<dag> pattern>
127   : DForm_1<opcode, OL, asmstr, itin, pattern>;
128
129 class DForm_4<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin,
130               list<dag> pattern>
131   : I<opcode, OL, asmstr, itin> {
132   bits<5>  B;
133   bits<5>  A;
134   bits<16> C;
135   
136   let Pattern = pattern;
137   
138   let Inst{6-10}  = A;
139   let Inst{11-15} = B;
140   let Inst{16-31} = C;
141 }
142               
143 class DForm_4_zero<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin,
144                    list<dag> pattern>
145   : DForm_1<opcode, OL, asmstr, itin, pattern> {
146   let A = 0;
147   let B = 0;
148   let C = 0;
149 }
150
151 class DForm_5<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin>
152   : I<opcode, OL, asmstr, itin> {
153   bits<3>  BF;
154   bits<1>  L;
155   bits<5>  RA;
156   bits<16> I;
157
158   let Inst{6-8}   = BF;
159   let Inst{9}     = 0;
160   let Inst{10}    = L;
161   let Inst{11-15} = RA;
162   let Inst{16-31} = I;
163 }
164
165 class DForm_5_ext<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin>
166   : DForm_5<opcode, OL, asmstr, itin> {
167   let L = PPC64;
168 }
169
170 class DForm_6<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin> 
171   : DForm_5<opcode, OL, asmstr, itin>;
172
173 class DForm_6_ext<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin>
174   : DForm_6<opcode, OL, asmstr, itin> {
175   let L = PPC64;
176 }
177
178 class DForm_8<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin,
179               list<dag> pattern>
180   : DForm_1<opcode, OL, asmstr, itin, pattern> {
181 }
182
183 class DForm_9<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin,
184               list<dag> pattern>
185   : DForm_1<opcode, OL, asmstr, itin, pattern> {
186 }
187
188 // 1.7.5 DS-Form
189 class DSForm_1<bits<6> opcode, bits<2> xo, dag OL, string asmstr,
190                InstrItinClass itin, list<dag> pattern>
191          : I<opcode, OL, asmstr, itin> {
192   bits<5>  RST;
193   bits<14> DS;
194   bits<5>  RA;
195
196   let Pattern = pattern;
197   
198   let Inst{6-10}  = RST;
199   let Inst{11-15} = RA;
200   let Inst{16-29} = DS;
201   let Inst{30-31} = xo;
202 }
203
204 class DSForm_2<bits<6> opcode, bits<2> xo, dag OL, string asmstr,
205                InstrItinClass itin, list<dag> pattern>
206   : DSForm_1<opcode, xo, OL, asmstr, itin, pattern>;
207
208 // 1.7.6 X-Form
209 class XForm_base_r3xo<bits<6> opcode, bits<10> xo, dag OL, string asmstr, 
210                       InstrItinClass itin, list<dag> pattern>
211   : I<opcode, OL, asmstr, itin> {
212   bits<5> RST;
213   bits<5> A;
214   bits<5> B;
215
216   let Pattern = pattern;
217
218   bit RC = 0;    // set by isDOT
219
220   let Inst{6-10}  = RST;
221   let Inst{11-15} = A;
222   let Inst{16-20} = B;
223   let Inst{21-30} = xo;
224   let Inst{31}    = RC;
225 }
226
227 // This is the same as XForm_base_r3xo, but the first two operands are swapped
228 // when code is emitted.
229 class XForm_base_r3xo_swapped
230         <bits<6> opcode, bits<10> xo, dag OL, string asmstr,
231         InstrItinClass itin> 
232   : I<opcode, OL, asmstr, itin> {
233   bits<5> A;
234   bits<5> RST;
235   bits<5> B;
236
237   bit RC = 0;    // set by isDOT
238
239   let Inst{6-10}  = RST;
240   let Inst{11-15} = A;
241   let Inst{16-20} = B;
242   let Inst{21-30} = xo;
243   let Inst{31}    = RC;
244 }
245
246
247 class XForm_1<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
248               InstrItinClass itin, list<dag> pattern> 
249   : XForm_base_r3xo<opcode, xo, OL, asmstr, itin, pattern>;
250
251 class XForm_6<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
252               InstrItinClass itin, list<dag> pattern> 
253   : XForm_base_r3xo_swapped<opcode, xo, OL, asmstr, itin> {
254   let Pattern = pattern;
255 }
256
257 class XForm_8<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
258               InstrItinClass itin, list<dag> pattern> 
259   : XForm_base_r3xo<opcode, xo, OL, asmstr, itin, pattern>;
260
261 class XForm_10<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
262                InstrItinClass itin, list<dag> pattern> 
263   : XForm_base_r3xo_swapped<opcode, xo, OL, asmstr, itin> {
264     let Pattern = pattern;
265 }
266
267 class XForm_11<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
268                InstrItinClass itin, list<dag> pattern> 
269   : XForm_base_r3xo_swapped<opcode, xo, OL, asmstr, itin> {
270   let B = 0;
271   let Pattern = pattern;
272 }
273
274 class XForm_16<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
275                InstrItinClass itin>
276          : I<opcode, OL, asmstr, itin> {
277   bits<3> BF;
278   bits<1> L; 
279   bits<5> RA;
280   bits<5> RB;
281   
282   let Inst{6-8}   = BF;
283   let Inst{9}     = 0;
284   let Inst{10}    = L;
285   let Inst{11-15} = RA;
286   let Inst{16-20} = RB;
287   let Inst{21-30} = xo;
288   let Inst{31}    = 0;
289 }
290
291 class XForm_16_ext<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
292                    InstrItinClass itin>
293   : XForm_16<opcode, xo, OL, asmstr, itin> {
294   let L = PPC64;
295 }
296
297 class XForm_17<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
298                InstrItinClass itin>
299          : I<opcode, OL, asmstr, itin> {
300   bits<3> BF;
301   bits<5> FRA;
302   bits<5> FRB;
303   
304   let Inst{6-8}   = BF;
305   let Inst{9-10}  = 0;
306   let Inst{11-15} = FRA;
307   let Inst{16-20} = FRB;
308   let Inst{21-30} = xo;
309   let Inst{31}    = 0;
310 }
311
312 class XForm_25<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
313                InstrItinClass itin, list<dag> pattern> 
314   : XForm_base_r3xo<opcode, xo, OL, asmstr, itin, pattern> {
315 }
316
317 class XForm_26<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
318                InstrItinClass itin, list<dag> pattern>
319   : XForm_base_r3xo<opcode, xo, OL, asmstr, itin, pattern> {
320   let A = 0;
321 }
322
323 class XForm_28<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
324                InstrItinClass itin, list<dag> pattern> 
325   : XForm_base_r3xo<opcode, xo, OL, asmstr, itin, pattern> {
326 }
327
328 // DSS_Form - Form X instruction, used for altivec dss* instructions.
329 class DSS_Form<bits<10> xo, dag OL, string asmstr, 
330                       InstrItinClass itin, list<dag> pattern>
331   : I<31, OL, asmstr, itin> {
332   bits<1> T;
333   bits<2> STRM;
334   bits<5> A;
335   bits<5> B;
336
337   let Pattern = pattern;
338
339   let Inst{6}     = T;
340   let Inst{7-8}   = 0;
341   let Inst{9-10}  = STRM;
342   let Inst{11-15} = A;
343   let Inst{16-20} = B;
344   let Inst{21-30} = xo;
345   let Inst{31}    = 0;
346 }
347
348 // 1.7.7 XL-Form
349 class XLForm_1<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
350                InstrItinClass itin>
351     : I<opcode, OL, asmstr, itin> {
352   bits<3> CRD;
353   bits<2> CRDb;
354   bits<3> CRA;
355   bits<2> CRAb;
356   bits<3> CRB;
357   bits<2> CRBb;
358   
359   let Inst{6-8}   = CRD;
360   let Inst{9-10}  = CRDb;
361   let Inst{11-13} = CRA;
362   let Inst{14-15} = CRAb;
363   let Inst{16-18} = CRB;
364   let Inst{19-20} = CRBb;
365   let Inst{21-30} = xo;
366   let Inst{31}    = 0;
367 }
368
369 class XLForm_2<bits<6> opcode, bits<10> xo, bit lk, dag OL, string asmstr, 
370                InstrItinClass itin, list<dag> pattern>
371     : I<opcode, OL, asmstr, itin> {
372   bits<5> BO;
373   bits<5> BI;
374   bits<2> BH;
375   
376   let Pattern = pattern;
377   
378   let Inst{6-10}  = BO;
379   let Inst{11-15} = BI;
380   let Inst{16-18} = 0;
381   let Inst{19-20} = BH;
382   let Inst{21-30} = xo;
383   let Inst{31}    = lk;
384 }
385
386 class XLForm_2_ext<bits<6> opcode, bits<10> xo, bits<5> bo,  bits<5> bi, bit lk,
387                   dag OL, string asmstr, InstrItinClass itin, list<dag> pattern>
388   : XLForm_2<opcode, xo, lk, OL, asmstr, itin, pattern> {
389   let BO = bo;
390   let BI = bi;
391   let BH = 0;
392 }
393
394 class XLForm_3<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
395                InstrItinClass itin>
396          : I<opcode, OL, asmstr, itin> {
397   bits<3> BF;
398   bits<3> BFA;
399   
400   let Inst{6-8}   = BF;
401   let Inst{9-10}  = 0;
402   let Inst{11-13} = BFA;
403   let Inst{14-15} = 0;
404   let Inst{16-20} = 0;
405   let Inst{21-30} = xo;
406   let Inst{31}    = 0;
407 }
408
409 // 1.7.8 XFX-Form
410 class XFXForm_1<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
411                 InstrItinClass itin>
412          : I<opcode, OL, asmstr, itin> {
413   bits<5>  RT;
414   bits<10> SPR;
415
416   let Inst{6-10}  = RT;
417   let Inst{11}    = SPR{4};
418   let Inst{12}    = SPR{3};
419   let Inst{13}    = SPR{2};
420   let Inst{14}    = SPR{1};
421   let Inst{15}    = SPR{0};
422   let Inst{16}    = SPR{9};
423   let Inst{17}    = SPR{8};
424   let Inst{18}    = SPR{7};
425   let Inst{19}    = SPR{6};
426   let Inst{20}    = SPR{5};
427   let Inst{21-30} = xo;
428   let Inst{31}    = 0;
429 }
430
431 class XFXForm_1_ext<bits<6> opcode, bits<10> xo, bits<10> spr, 
432                    dag OL, string asmstr, InstrItinClass itin> 
433   : XFXForm_1<opcode, xo, OL, asmstr, itin> {
434   let SPR = spr;
435 }
436
437 class XFXForm_3<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
438                 InstrItinClass itin>
439          : I<opcode, OL, asmstr, itin> {
440   bits<5>  RT;
441    
442   let Inst{6-10}  = RT;
443   let Inst{11-20} = 0;
444   let Inst{21-30} = xo;
445   let Inst{31}    = 0;
446 }
447
448 class XFXForm_5<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
449                 InstrItinClass itin> 
450   : I<opcode, OL, asmstr, itin> {
451   bits<8>  FXM;
452   bits<5>  ST;
453    
454   let Inst{6-10}  = ST;
455   let Inst{11}    = 0;
456   let Inst{12-19} = FXM;
457   let Inst{20}    = 0;
458   let Inst{21-30} = xo;
459   let Inst{31}    = 0;
460 }
461
462 class XFXForm_5a<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
463                  InstrItinClass itin> 
464   : I<opcode, OL, asmstr, itin> {
465   bits<5>  ST;
466   bits<8>  FXM;
467    
468   let Inst{6-10}  = ST;
469   let Inst{11}    = 1;
470   let Inst{12-19} = FXM;
471   let Inst{20}    = 0;
472   let Inst{21-30} = xo;
473   let Inst{31}    = 0;
474 }
475
476 class XFXForm_7<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
477                 InstrItinClass itin>
478   : XFXForm_1<opcode, xo, OL, asmstr, itin>;
479
480 class XFXForm_7_ext<bits<6> opcode, bits<10> xo, bits<10> spr, 
481                     dag OL, string asmstr, InstrItinClass itin> 
482   : XFXForm_7<opcode, xo, OL, asmstr, itin> {
483   let SPR = spr;
484 }
485
486 // 1.7.10 XS-Form
487 class XSForm_1<bits<6> opcode, bits<9> xo, dag OL, string asmstr,
488                InstrItinClass itin>
489          : I<opcode, OL, asmstr, itin> {
490   bits<5> RS;
491   bits<5> A;
492   bits<6> SH;
493
494   bit RC = 0;    // set by isDOT
495
496   let Inst{6-10}  = RS;
497   let Inst{11-15} = A;
498   let Inst{16-20} = SH{1-5};
499   let Inst{21-29} = xo;
500   let Inst{30}    = SH{0};
501   let Inst{31}    = RC;
502 }
503
504 // 1.7.11 XO-Form
505 class XOForm_1<bits<6> opcode, bits<9> xo, bit oe, dag OL, string asmstr,
506                InstrItinClass itin, list<dag> pattern>
507          : I<opcode, OL, asmstr, itin> {
508   bits<5> RT;
509   bits<5> RA;
510   bits<5> RB;
511
512   let Pattern = pattern;
513
514   bit RC = 0;    // set by isDOT
515
516   let Inst{6-10}  = RT;
517   let Inst{11-15} = RA;
518   let Inst{16-20} = RB;
519   let Inst{21}    = oe;
520   let Inst{22-30} = xo;
521   let Inst{31}    = RC;  
522 }
523
524 class XOForm_3<bits<6> opcode, bits<9> xo, bit oe, 
525                dag OL, string asmstr, InstrItinClass itin, list<dag> pattern>
526   : XOForm_1<opcode, xo, oe, OL, asmstr, itin, pattern> {
527   let RB = 0;
528 }
529
530 // 1.7.12 A-Form
531 class AForm_1<bits<6> opcode, bits<5> xo, dag OL, string asmstr, 
532               InstrItinClass itin, list<dag> pattern>
533          : I<opcode, OL, asmstr, itin> {
534   bits<5> FRT;
535   bits<5> FRA;
536   bits<5> FRC;
537   bits<5> FRB;
538
539   let Pattern = pattern;
540
541   bit RC = 0;    // set by isDOT
542
543   let Inst{6-10}  = FRT;
544   let Inst{11-15} = FRA;
545   let Inst{16-20} = FRB;
546   let Inst{21-25} = FRC;
547   let Inst{26-30} = xo;
548   let Inst{31}    = RC;
549 }
550
551 class AForm_2<bits<6> opcode, bits<5> xo, dag OL, string asmstr,
552               InstrItinClass itin, list<dag> pattern>
553   : AForm_1<opcode, xo, OL, asmstr, itin, pattern> {
554   let FRC = 0;
555 }
556
557 class AForm_3<bits<6> opcode, bits<5> xo, dag OL, string asmstr,
558               InstrItinClass itin, list<dag> pattern> 
559   : AForm_1<opcode, xo, OL, asmstr, itin, pattern> {
560   let FRB = 0;
561 }
562
563 // 1.7.13 M-Form
564 class MForm_1<bits<6> opcode, dag OL, string asmstr,
565               InstrItinClass itin, list<dag> pattern>
566     : I<opcode, OL, asmstr, itin> {
567   bits<5> RA;
568   bits<5> RS;
569   bits<5> RB;
570   bits<5> MB;
571   bits<5> ME;
572
573   let Pattern = pattern;
574
575   bit RC = 0;    // set by isDOT
576
577   let Inst{6-10}  = RS;
578   let Inst{11-15} = RA;
579   let Inst{16-20} = RB;
580   let Inst{21-25} = MB;
581   let Inst{26-30} = ME;
582   let Inst{31}    = RC;
583 }
584
585 class MForm_2<bits<6> opcode, dag OL, string asmstr,
586               InstrItinClass itin, list<dag> pattern>
587   : MForm_1<opcode, OL, asmstr, itin, pattern> {
588 }
589
590 // 1.7.14 MD-Form
591 class MDForm_1<bits<6> opcode, bits<3> xo, dag OL, string asmstr,
592                InstrItinClass itin, list<dag> pattern>
593     : I<opcode, OL, asmstr, itin> {
594   bits<5> RS;
595   bits<5> RA;
596   bits<6> SH;
597   bits<6> MBE;
598
599   let Pattern = pattern;
600
601   bit RC = 0;    // set by isDOT
602
603   let Inst{6-10}  = RS;
604   let Inst{11-15} = RA;
605   let Inst{16-20} = SH{1-5};
606   let Inst{21-26} = MBE;
607   let Inst{27-29} = xo;
608   let Inst{30}    = SH{0};
609   let Inst{31}    = RC;
610 }
611
612
613
614 // E-1 VA-Form
615
616 // VAForm_1 - DACB ordering.
617 class VAForm_1<bits<6> xo, dag OL, string asmstr,
618                InstrItinClass itin, list<dag> pattern>
619     : I<4, OL, asmstr, itin> {
620   bits<5> VD;
621   bits<5> VA;
622   bits<5> VC;
623   bits<5> VB;
624
625   let Pattern = pattern;
626   
627   let Inst{6-10}  = VD;
628   let Inst{11-15} = VA;
629   let Inst{16-20} = VB;
630   let Inst{21-25} = VC;
631   let Inst{26-31} = xo;
632 }
633
634 // VAForm_1a - DABC ordering.
635 class VAForm_1a<bits<6> xo, dag OL, string asmstr,
636                 InstrItinClass itin, list<dag> pattern>
637     : I<4, OL, asmstr, itin> {
638   bits<5> VD;
639   bits<5> VA;
640   bits<5> VB;
641   bits<5> VC;
642
643   let Pattern = pattern;
644   
645   let Inst{6-10}  = VD;
646   let Inst{11-15} = VA;
647   let Inst{16-20} = VB;
648   let Inst{21-25} = VC;
649   let Inst{26-31} = xo;
650 }
651
652 class VAForm_2<bits<6> xo, dag OL, string asmstr,
653                InstrItinClass itin, list<dag> pattern>
654     : I<4, OL, asmstr, itin> {
655   bits<5> VD;
656   bits<5> VA;
657   bits<5> VB;
658   bits<4> SH;
659
660   let Pattern = pattern;
661   
662   let Inst{6-10}  = VD;
663   let Inst{11-15} = VA;
664   let Inst{16-20} = VB;
665   let Inst{21}    = 0;
666   let Inst{22-25} = SH;
667   let Inst{26-31} = xo;
668 }
669
670 // E-2 VX-Form
671 class VXForm_1<bits<11> xo, dag OL, string asmstr,
672                InstrItinClass itin, list<dag> pattern>
673     : I<4, OL, asmstr, itin> {
674   bits<5> VD;
675   bits<5> VA;
676   bits<5> VB;
677   
678   let Pattern = pattern;
679   
680   let Inst{6-10}  = VD;
681   let Inst{11-15} = VA;
682   let Inst{16-20} = VB;
683   let Inst{21-31} = xo;
684 }
685
686 class VXForm_setzero<bits<11> xo, dag OL, string asmstr,
687                InstrItinClass itin, list<dag> pattern>
688     : VXForm_1<xo, OL, asmstr, itin, pattern> {
689   let VA = VD;
690   let VB = VD;
691 }
692
693
694 class VXForm_2<bits<11> xo, dag OL, string asmstr,
695                InstrItinClass itin, list<dag> pattern>
696     : I<4, OL, asmstr, itin> {
697   bits<5> VD;
698   bits<5> VB;
699   
700   let Pattern = pattern;
701   
702   let Inst{6-10}  = VD;
703   let Inst{11-15} = 0;
704   let Inst{16-20} = VB;
705   let Inst{21-31} = xo;
706 }
707
708 class VXForm_3<bits<11> xo, dag OL, string asmstr,
709                InstrItinClass itin, list<dag> pattern>
710     : I<4, OL, asmstr, itin> {
711   bits<5> VD;
712   bits<5> IMM;
713   
714   let Pattern = pattern;
715   
716   let Inst{6-10}  = VD;
717   let Inst{11-15} = IMM;
718   let Inst{16-20} = 0;
719   let Inst{21-31} = xo;
720 }
721
722 /// VXForm_4 - VX instructions with "VD,0,0" register fields, like mfvscr.
723 class VXForm_4<bits<11> xo, dag OL, string asmstr,
724                InstrItinClass itin, list<dag> pattern>
725     : I<4, OL, asmstr, itin> {
726   bits<5> VD;
727   
728   let Pattern = pattern;
729   
730   let Inst{6-10}  = VD;
731   let Inst{11-15} = 0;
732   let Inst{16-20} = 0;
733   let Inst{21-31} = xo;
734 }
735
736 /// VXForm_5 - VX instructions with "0,0,VB" register fields, like mtvscr.
737 class VXForm_5<bits<11> xo, dag OL, string asmstr,
738                InstrItinClass itin, list<dag> pattern>
739     : I<4, OL, asmstr, itin> {
740   bits<5> VB;
741   
742   let Pattern = pattern;
743   
744   let Inst{6-10}  = 0;
745   let Inst{11-15} = 0;
746   let Inst{16-20} = VB;
747   let Inst{21-31} = xo;
748 }
749
750 // E-4 VXR-Form
751 class VXRForm_1<bits<10> xo, dag OL, string asmstr,
752                InstrItinClass itin, list<dag> pattern>
753     : I<4, OL, asmstr, itin> {
754   bits<5> VD;
755   bits<5> VA;
756   bits<5> VB;
757   bit RC = 0;
758   
759   let Pattern = pattern;
760   
761   let Inst{6-10}  = VD;
762   let Inst{11-15} = VA;
763   let Inst{16-20} = VB;
764   let Inst{21}    = RC;
765   let Inst{22-31} = xo;
766 }
767
768 //===----------------------------------------------------------------------===//
769 class Pseudo<dag OL, string asmstr, list<dag> pattern>
770     : I<0, OL, asmstr, NoItinerary> {
771   let PPC64 = 0;
772   let VMX = 0;
773   let Pattern = pattern;
774   let Inst{31-0} = 0;
775 }