c3a78e65bf90aefa3e0c3ddbc953ea8375c9b9ce
[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 // 1.7.7 XL-Form
329 class XLForm_1<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
330                InstrItinClass itin>
331     : I<opcode, OL, asmstr, itin> {
332   bits<3> CRD;
333   bits<2> CRDb;
334   bits<3> CRA;
335   bits<2> CRAb;
336   bits<3> CRB;
337   bits<2> CRBb;
338   
339   let Inst{6-8}   = CRD;
340   let Inst{9-10}  = CRDb;
341   let Inst{11-13} = CRA;
342   let Inst{14-15} = CRAb;
343   let Inst{16-18} = CRB;
344   let Inst{19-20} = CRBb;
345   let Inst{21-30} = xo;
346   let Inst{31}    = 0;
347 }
348
349 class XLForm_2<bits<6> opcode, bits<10> xo, bit lk, dag OL, string asmstr, 
350                InstrItinClass itin, list<dag> pattern>
351     : I<opcode, OL, asmstr, itin> {
352   bits<5> BO;
353   bits<5> BI;
354   bits<2> BH;
355   
356   let Pattern = pattern;
357   
358   let Inst{6-10}  = BO;
359   let Inst{11-15} = BI;
360   let Inst{16-18} = 0;
361   let Inst{19-20} = BH;
362   let Inst{21-30} = xo;
363   let Inst{31}    = lk;
364 }
365
366 class XLForm_2_ext<bits<6> opcode, bits<10> xo, bits<5> bo,  bits<5> bi, bit lk,
367                   dag OL, string asmstr, InstrItinClass itin, list<dag> pattern>
368   : XLForm_2<opcode, xo, lk, OL, asmstr, itin, pattern> {
369   let BO = bo;
370   let BI = bi;
371   let BH = 0;
372 }
373
374 class XLForm_3<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
375                InstrItinClass itin>
376          : I<opcode, OL, asmstr, itin> {
377   bits<3> BF;
378   bits<3> BFA;
379   
380   let Inst{6-8}   = BF;
381   let Inst{9-10}  = 0;
382   let Inst{11-13} = BFA;
383   let Inst{14-15} = 0;
384   let Inst{16-20} = 0;
385   let Inst{21-30} = xo;
386   let Inst{31}    = 0;
387 }
388
389 // 1.7.8 XFX-Form
390 class XFXForm_1<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
391                 InstrItinClass itin>
392          : I<opcode, OL, asmstr, itin> {
393   bits<5>  RT;
394   bits<10> SPR;
395
396   let Inst{6-10}  = RT;
397   let Inst{11}    = SPR{4};
398   let Inst{12}    = SPR{3};
399   let Inst{13}    = SPR{2};
400   let Inst{14}    = SPR{1};
401   let Inst{15}    = SPR{0};
402   let Inst{16}    = SPR{9};
403   let Inst{17}    = SPR{8};
404   let Inst{18}    = SPR{7};
405   let Inst{19}    = SPR{6};
406   let Inst{20}    = SPR{5};
407   let Inst{21-30} = xo;
408   let Inst{31}    = 0;
409 }
410
411 class XFXForm_1_ext<bits<6> opcode, bits<10> xo, bits<10> spr, 
412                    dag OL, string asmstr, InstrItinClass itin> 
413   : XFXForm_1<opcode, xo, OL, asmstr, itin> {
414   let SPR = spr;
415 }
416
417 class XFXForm_3<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
418                 InstrItinClass itin>
419          : I<opcode, OL, asmstr, itin> {
420   bits<5>  RT;
421    
422   let Inst{6-10}  = RT;
423   let Inst{11-20} = 0;
424   let Inst{21-30} = xo;
425   let Inst{31}    = 0;
426 }
427
428 class XFXForm_5<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
429                 InstrItinClass itin> 
430   : I<opcode, OL, asmstr, itin> {
431   bits<8>  FXM;
432   bits<5>  ST;
433    
434   let Inst{6-10}  = ST;
435   let Inst{11}    = 0;
436   let Inst{12-19} = FXM;
437   let Inst{20}    = 0;
438   let Inst{21-30} = xo;
439   let Inst{31}    = 0;
440 }
441
442 class XFXForm_5a<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
443                  InstrItinClass itin> 
444   : I<opcode, OL, asmstr, itin> {
445   bits<5>  ST;
446   bits<8>  FXM;
447    
448   let Inst{6-10}  = ST;
449   let Inst{11}    = 1;
450   let Inst{12-19} = FXM;
451   let Inst{20}    = 0;
452   let Inst{21-30} = xo;
453   let Inst{31}    = 0;
454 }
455
456 class XFXForm_7<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
457                 InstrItinClass itin>
458   : XFXForm_1<opcode, xo, OL, asmstr, itin>;
459
460 class XFXForm_7_ext<bits<6> opcode, bits<10> xo, bits<10> spr, 
461                     dag OL, string asmstr, InstrItinClass itin> 
462   : XFXForm_7<opcode, xo, OL, asmstr, itin> {
463   let SPR = spr;
464 }
465
466 // 1.7.10 XS-Form
467 class XSForm_1<bits<6> opcode, bits<9> xo, dag OL, string asmstr,
468                InstrItinClass itin>
469          : I<opcode, OL, asmstr, itin> {
470   bits<5> RS;
471   bits<5> A;
472   bits<6> SH;
473
474   bit RC = 0;    // set by isDOT
475
476   let Inst{6-10}  = RS;
477   let Inst{11-15} = A;
478   let Inst{16-20} = SH{1-5};
479   let Inst{21-29} = xo;
480   let Inst{30}    = SH{0};
481   let Inst{31}    = RC;
482 }
483
484 // 1.7.11 XO-Form
485 class XOForm_1<bits<6> opcode, bits<9> xo, bit oe, dag OL, string asmstr,
486                InstrItinClass itin, list<dag> pattern>
487          : I<opcode, OL, asmstr, itin> {
488   bits<5> RT;
489   bits<5> RA;
490   bits<5> RB;
491
492   let Pattern = pattern;
493
494   bit RC = 0;    // set by isDOT
495
496   let Inst{6-10}  = RT;
497   let Inst{11-15} = RA;
498   let Inst{16-20} = RB;
499   let Inst{21}    = oe;
500   let Inst{22-30} = xo;
501   let Inst{31}    = RC;  
502 }
503
504 class XOForm_3<bits<6> opcode, bits<9> xo, bit oe, 
505                dag OL, string asmstr, InstrItinClass itin, list<dag> pattern>
506   : XOForm_1<opcode, xo, oe, OL, asmstr, itin, pattern> {
507   let RB = 0;
508 }
509
510 // 1.7.12 A-Form
511 class AForm_1<bits<6> opcode, bits<5> xo, dag OL, string asmstr, 
512               InstrItinClass itin, list<dag> pattern>
513          : I<opcode, OL, asmstr, itin> {
514   bits<5> FRT;
515   bits<5> FRA;
516   bits<5> FRC;
517   bits<5> FRB;
518
519   let Pattern = pattern;
520
521   bit RC = 0;    // set by isDOT
522
523   let Inst{6-10}  = FRT;
524   let Inst{11-15} = FRA;
525   let Inst{16-20} = FRB;
526   let Inst{21-25} = FRC;
527   let Inst{26-30} = xo;
528   let Inst{31}    = RC;
529 }
530
531 class AForm_2<bits<6> opcode, bits<5> xo, dag OL, string asmstr,
532               InstrItinClass itin, list<dag> pattern>
533   : AForm_1<opcode, xo, OL, asmstr, itin, pattern> {
534   let FRC = 0;
535 }
536
537 class AForm_3<bits<6> opcode, bits<5> xo, dag OL, string asmstr,
538               InstrItinClass itin, list<dag> pattern> 
539   : AForm_1<opcode, xo, OL, asmstr, itin, pattern> {
540   let FRB = 0;
541 }
542
543 // 1.7.13 M-Form
544 class MForm_1<bits<6> opcode, dag OL, string asmstr,
545               InstrItinClass itin, list<dag> pattern>
546     : I<opcode, OL, asmstr, itin> {
547   bits<5> RA;
548   bits<5> RS;
549   bits<5> RB;
550   bits<5> MB;
551   bits<5> ME;
552
553   let Pattern = pattern;
554
555   bit RC = 0;    // set by isDOT
556
557   let Inst{6-10}  = RS;
558   let Inst{11-15} = RA;
559   let Inst{16-20} = RB;
560   let Inst{21-25} = MB;
561   let Inst{26-30} = ME;
562   let Inst{31}    = RC;
563 }
564
565 class MForm_2<bits<6> opcode, dag OL, string asmstr,
566               InstrItinClass itin, list<dag> pattern>
567   : MForm_1<opcode, OL, asmstr, itin, pattern> {
568 }
569
570 // 1.7.14 MD-Form
571 class MDForm_1<bits<6> opcode, bits<3> xo, dag OL, string asmstr,
572                InstrItinClass itin, list<dag> pattern>
573     : I<opcode, OL, asmstr, itin> {
574   bits<5> RS;
575   bits<5> RA;
576   bits<6> SH;
577   bits<6> MBE;
578
579   let Pattern = pattern;
580
581   bit RC = 0;    // set by isDOT
582
583   let Inst{6-10}  = RS;
584   let Inst{11-15} = RA;
585   let Inst{16-20} = SH{1-5};
586   let Inst{21-26} = MBE;
587   let Inst{27-29} = xo;
588   let Inst{30}    = SH{0};
589   let Inst{31}    = RC;
590 }
591
592 // E-1 VA-Form
593
594 // VAForm_1 - DACB ordering.
595 class VAForm_1<bits<6> xo, dag OL, string asmstr,
596                InstrItinClass itin, list<dag> pattern>
597     : I<4, OL, asmstr, itin> {
598   bits<5> VD;
599   bits<5> VA;
600   bits<5> VC;
601   bits<5> VB;
602
603   let Pattern = pattern;
604   
605   let Inst{6-10}  = VD;
606   let Inst{11-15} = VA;
607   let Inst{16-20} = VB;
608   let Inst{21-25} = VC;
609   let Inst{26-31} = xo;
610 }
611
612 // VAForm_1a - DABC ordering.
613 class VAForm_1a<bits<6> xo, dag OL, string asmstr,
614                 InstrItinClass itin, list<dag> pattern>
615     : I<4, OL, asmstr, itin> {
616   bits<5> VD;
617   bits<5> VA;
618   bits<5> VB;
619   bits<5> VC;
620
621   let Pattern = pattern;
622   
623   let Inst{6-10}  = VD;
624   let Inst{11-15} = VA;
625   let Inst{16-20} = VB;
626   let Inst{21-25} = VC;
627   let Inst{26-31} = xo;
628 }
629
630 class VAForm_2<bits<6> xo, dag OL, string asmstr,
631                InstrItinClass itin, list<dag> pattern>
632     : I<4, OL, asmstr, itin> {
633   bits<5> VD;
634   bits<5> VA;
635   bits<5> VB;
636   bits<4> SH;
637
638   let Pattern = pattern;
639   
640   let Inst{6-10}  = VD;
641   let Inst{11-15} = VA;
642   let Inst{16-20} = VB;
643   let Inst{21}    = 0;
644   let Inst{22-25} = SH;
645   let Inst{26-31} = xo;
646 }
647
648 // E-2 VX-Form
649 class VXForm_1<bits<11> xo, dag OL, string asmstr,
650                InstrItinClass itin, list<dag> pattern>
651     : I<4, OL, asmstr, itin> {
652   bits<5> VD;
653   bits<5> VA;
654   bits<5> VB;
655   
656   let Pattern = pattern;
657   
658   let Inst{6-10}  = VD;
659   let Inst{11-15} = VA;
660   let Inst{16-20} = VB;
661   let Inst{21-31} = xo;
662 }
663
664 class VXForm_setzero<bits<11> xo, dag OL, string asmstr,
665                InstrItinClass itin, list<dag> pattern>
666     : VXForm_1<xo, OL, asmstr, itin, pattern> {
667   let VA = VD;
668   let VB = VD;
669 }
670
671
672 class VXForm_2<bits<11> xo, dag OL, string asmstr,
673                InstrItinClass itin, list<dag> pattern>
674     : I<4, OL, asmstr, itin> {
675   bits<5> VD;
676   bits<5> VB;
677   
678   let Pattern = pattern;
679   
680   let Inst{6-10}  = VD;
681   let Inst{11-15} = 0;
682   let Inst{16-20} = VB;
683   let Inst{21-31} = xo;
684 }
685
686 class VXForm_3<bits<11> xo, dag OL, string asmstr,
687                InstrItinClass itin, list<dag> pattern>
688     : I<4, OL, asmstr, itin> {
689   bits<5> VD;
690   bits<5> IMM;
691   
692   let Pattern = pattern;
693   
694   let Inst{6-10}  = VD;
695   let Inst{11-15} = IMM;
696   let Inst{16-20} = 0;
697   let Inst{21-31} = xo;
698 }
699
700 /// VXForm_4 - VX instructions with "VD,0,0" register fields, like mfvscr.
701 class VXForm_4<bits<11> xo, dag OL, string asmstr,
702                InstrItinClass itin, list<dag> pattern>
703     : I<4, OL, asmstr, itin> {
704   bits<5> VD;
705   
706   let Pattern = pattern;
707   
708   let Inst{6-10}  = VD;
709   let Inst{11-15} = 0;
710   let Inst{16-20} = 0;
711   let Inst{21-31} = xo;
712 }
713
714 /// VXForm_5 - VX instructions with "0,0,VB" register fields, like mtvscr.
715 class VXForm_5<bits<11> xo, dag OL, string asmstr,
716                InstrItinClass itin, list<dag> pattern>
717     : I<4, OL, asmstr, itin> {
718   bits<5> VB;
719   
720   let Pattern = pattern;
721   
722   let Inst{6-10}  = 0;
723   let Inst{11-15} = 0;
724   let Inst{16-20} = VB;
725   let Inst{21-31} = xo;
726 }
727
728 // E-4 VXR-Form
729 class VXRForm_1<bits<10> xo, dag OL, string asmstr,
730                InstrItinClass itin, list<dag> pattern>
731     : I<4, OL, asmstr, itin> {
732   bits<5> VD;
733   bits<5> VA;
734   bits<5> VB;
735   bit RC = 0;
736   
737   let Pattern = pattern;
738   
739   let Inst{6-10}  = VD;
740   let Inst{11-15} = VA;
741   let Inst{16-20} = VB;
742   let Inst{21}    = RC;
743   let Inst{22-31} = xo;
744 }
745
746 //===----------------------------------------------------------------------===//
747 class Pseudo<dag OL, string asmstr, list<dag> pattern>
748     : I<0, OL, asmstr, NoItinerary> {
749   let PPC64 = 0;
750   let VMX = 0;
751   let Pattern = pattern;
752   let Inst{31-0} = 0;
753 }