Fix encoding of rlwinm?
[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
13 class Format<bits<5> val> {
14   bits<5> Value = val;
15 }
16
17 def Pseudo: Format<0>;
18 def Gpr : Format<1>;
19 def Gpr0 : Format<2>;
20 def Simm16 : Format<3>;
21 def PCRelimm24 : Format<5>;
22 def Imm24 : Format<6>;
23 def Imm5 : Format<7>;
24 def PCRelimm14 : Format<8>;
25 def Imm14 : Format<9>;
26 def Imm2 : Format<10>;
27 def Crf : Format<11>;
28 def Imm3 : Format<12>;
29 def Imm1 : Format<13>;
30 def Fpr : Format<14>;
31 def Imm4 : Format<15>;
32 def Imm8 : Format<16>;
33 def Disimm16 : Format<17>;
34 def Disimm14 : Format<18>;
35 def Spr : Format<19>;
36 def Sgr : Format<20>;
37 def Imm15 : Format<21>;
38 def Vpr : Format<22>;
39 def Imm6 : Format<23>;
40
41 //===----------------------------------------------------------------------===//
42 //
43 // PowerPC instruction formats
44
45 class I<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr> 
46   : Instruction {
47   field bits<32> Inst;
48
49   bits<3> ArgCount;
50   bits<5> Arg0Type;
51   bits<5> Arg1Type;
52   bits<5> Arg2Type;
53   bits<5> Arg3Type;
54   bits<5> Arg4Type;
55   bit PPC64 = ppc64;
56   bit VMX = vmx;
57
58   let Name = "";
59   let Namespace = "PPC";
60   let Inst{0-5} = opcode;
61   let OperandList = OL;
62   let AsmString = asmstr;
63 }
64
65 // 1.7.1 I-Form
66 class IForm<bits<6> opcode, bit aa, bit lk, bit ppc64, bit vmx,
67             dag OL, string asmstr> : I<opcode, ppc64, vmx, OL, asmstr> {
68   bits<24> LI;
69
70   let ArgCount = 1;
71   let Arg0Type = Imm24.Value;
72   let Arg1Type = 0;
73   let Arg2Type = 0;
74   let Arg3Type = 0;
75   let Arg4Type = 0;
76
77   let Inst{6-29}  = LI;
78   let Inst{30}    = aa;
79   let Inst{31}    = lk;
80 }
81
82 // 1.7.2 B-Form
83 class BForm<bits<6> opcode, bit aa, bit lk, bit ppc64, bit vmx,
84             dag OL, string asmstr> : I<opcode, ppc64, vmx, OL, asmstr> {
85   bits<5>  BO;
86   bits<5>  BI;
87   bits<14> BD;
88
89   let ArgCount = 3;
90   let Arg0Type = Imm5.Value;
91   let Arg1Type = Imm5.Value;
92   let Arg2Type = PCRelimm14.Value;
93   let Arg3Type = 0;
94   let Arg4Type = 0;
95
96   let Inst{6-10}  = BO;
97   let Inst{11-15} = BI;
98   let Inst{16-29} = BD;
99   let Inst{30}    = aa;
100   let Inst{31}    = lk;
101 }
102
103 class BForm_ext<bits<6> opcode, bit aa, bit lk, bits<5> bo, bits<5> bi, 
104                 bit ppc64, bit vmx, dag OL, string asmstr>
105   : BForm<opcode, aa, lk, ppc64, vmx, OL, asmstr> {
106   let ArgCount = 2;
107   let Arg2Type = Imm5.Value;
108   let Arg1Type = PCRelimm14.Value;
109   let Arg2Type = 0;
110   let BO = bo;
111   let BI = bi;
112 }
113
114 // 1.7.4 D-Form
115 class DForm_base<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr>
116   : I<opcode, ppc64, vmx, OL, asmstr> {
117   bits<5>  A;
118   bits<5>  B;
119   bits<16> C;
120   
121   let ArgCount = 3;
122   let Arg0Type = Gpr.Value;
123   let Arg1Type = Gpr.Value;
124   let Arg2Type = Simm16.Value;
125   let Arg3Type = 0;
126   let Arg4Type = 0;
127  
128   let Inst{6-10}  = A;
129   let Inst{11-15} = B;
130   let Inst{16-31} = C;
131 }
132
133 class DForm_1<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr>
134   : I<opcode, ppc64, vmx, OL, asmstr> {
135   bits<5>  A;
136   bits<16> C;
137   bits<5>  B;
138   
139   let ArgCount = 3;
140   let Arg0Type = Gpr.Value;
141   let Arg1Type = Disimm16.Value;
142   let Arg2Type = Gpr.Value;
143   let Arg3Type = 0;
144   let Arg4Type = 0;
145  
146   let Inst{6-10}  = A;
147   let Inst{11-15} = B;
148   let Inst{16-31} = C;
149 }
150
151 class DForm_2<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr>
152   : DForm_base<opcode, ppc64, vmx, OL, asmstr>;
153
154 class DForm_2_r0<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr>
155   : I<opcode, ppc64, vmx, OL, asmstr> {
156   bits<5>  A;
157   bits<16> B;
158   
159   let ArgCount = 2;
160   let Arg0Type = Gpr.Value;
161   let Arg1Type = Simm16.Value;
162   let Arg2Type = 0;
163   let Arg3Type = 0;
164   let Arg4Type = 0;
165  
166   let Inst{6-10}  = A;
167   let Inst{11-15} = 0;
168   let Inst{16-31} = B;
169 }
170
171 // Currently we make the use/def reg distinction in ISel, not tablegen
172 class DForm_3<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr>
173   : DForm_1<opcode, ppc64, vmx, OL, asmstr>;
174
175 class DForm_4<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr> 
176   : DForm_base<opcode, ppc64, vmx, OL, asmstr>;
177               
178 class DForm_4_zero<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr>
179   : DForm_1<opcode, ppc64, vmx, OL, asmstr> {
180   let ArgCount = 0;
181   let Arg0Type = 0;
182   let Arg1Type = 0;
183   let Arg2Type = 0;
184   let A = 0;
185   let B = 0;
186   let C = 0;
187 }
188
189 class DForm_5<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr>
190   : I<opcode, ppc64, vmx, OL, asmstr> {
191   bits<3>  BF;
192   bits<1>  L;
193   bits<5>  RA;
194   bits<16> I;
195
196   let ArgCount = 4;
197   let Arg0Type = Imm3.Value;
198   let Arg1Type = Imm1.Value;
199   let Arg2Type = Gpr.Value;
200   let Arg3Type = Simm16.Value;
201   let Arg4Type = 0;
202
203   let Inst{6-8}   = BF;
204   let Inst{9}     = 0;
205   let Inst{10}    = L;
206   let Inst{11-15} = RA;
207   let Inst{16-31} = I;
208 }
209
210 class DForm_5_ext<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr>
211   : DForm_5<opcode, ppc64, vmx, OL, asmstr> {
212   let L = ppc64;
213   let ArgCount = 3;
214   let Arg0Type = Imm3.Value;
215   let Arg1Type = Gpr.Value;
216   let Arg2Type = Simm16.Value;
217   let Arg3Type = 0;
218 }
219
220 class DForm_6<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr> 
221   : DForm_5<opcode, ppc64, vmx, OL, asmstr>;
222
223 class DForm_6_ext<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr>
224   : DForm_6<opcode, ppc64, vmx, OL, asmstr> {
225   let L = ppc64;
226   let ArgCount = 3;
227   let Arg0Type = Imm3.Value;
228   let Arg1Type = Gpr.Value;
229   let Arg2Type = Simm16.Value;
230   let Arg3Type = 0;
231 }
232
233 class DForm_8<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr>
234   : DForm_1<opcode, ppc64, vmx, OL, asmstr> {
235   let Arg0Type = Fpr.Value;
236 }
237
238 class DForm_9<bits<6> opcode, bit ppc64, bit vmx, dag OL, string asmstr>
239   : DForm_1<opcode, ppc64, vmx, OL, asmstr> {
240   let Arg0Type = Fpr.Value;
241 }
242
243 // 1.7.5 DS-Form
244 class DSForm_1<bits<6> opcode, bits<2> xo, bit ppc64, bit vmx,
245                dag OL, string asmstr> : I<opcode, ppc64, vmx, OL, asmstr> {
246   bits<5>  RST;
247   bits<14> DS;
248   bits<5>  RA;
249
250   let ArgCount = 3;
251   let Arg0Type = Gpr.Value;
252   let Arg1Type = Disimm14.Value;
253   let Arg2Type = Gpr.Value;
254   let Arg3Type = 0;
255   let Arg4Type = 0;
256
257   let Inst{6-10}  = RST;
258   let Inst{11-15} = RA;
259   let Inst{16-29} = DS;
260   let Inst{30-31} = xo;
261 }
262
263 class DSForm_2<bits<6> opcode, bits<2> xo, bit ppc64, bit vmx, 
264                dag OL, string asmstr>
265   : DSForm_1<opcode, xo, ppc64, vmx, OL, asmstr>;
266
267 // 1.7.6 X-Form
268 class XForm_base_r3xo<bits<6> opcode, bits<10> xo, bit rc, bit ppc64, bit vmx,
269                       dag OL, string asmstr> 
270   : I<opcode, ppc64, vmx, OL, asmstr> {
271   bits<5> RST;
272   bits<5> A;
273   bits<5> B;
274
275   let ArgCount = 3;
276   let Arg0Type = Gpr.Value;
277   let Arg1Type = Gpr.Value;
278   let Arg2Type = Gpr.Value;
279   let Arg3Type = 0;
280   let Arg4Type = 0;
281
282   let Inst{6-10}  = RST;
283   let Inst{11-15} = A;
284   let Inst{16-20} = B;
285   let Inst{21-30} = xo;
286   let Inst{31}    = rc;
287 }
288
289
290 class XForm_1<bits<6> opcode, bits<10> xo, bit ppc64, bit vmx,
291               dag OL, string asmstr> 
292   : XForm_base_r3xo<opcode, xo, 0, ppc64, vmx, OL, asmstr>;
293
294 class XForm_5<bits<6> opcode, bits<10> xo, bit ppc64, bit vmx,
295               dag OL, string asmstr>
296   : XForm_base_r3xo<opcode, xo, 0, ppc64, vmx, OL, asmstr> {
297   let ArgCount = 1;
298   let Arg1Type = 0;
299   let Arg2Type = 0;
300   let A = 0;
301   let B = 0;
302 }
303
304 class XForm_6<bits<6> opcode, bits<10> xo, bit rc, bit ppc64, bit vmx,
305               dag OL, string asmstr> 
306   : XForm_base_r3xo<opcode, xo, rc, ppc64, vmx, OL, asmstr>;
307
308 class XForm_8<bits<6> opcode, bits<10> xo, bit ppc64, bit vmx,
309               dag OL, string asmstr> 
310   : XForm_base_r3xo<opcode, xo, 0, ppc64, vmx, OL, asmstr>;
311
312 class XForm_10<bits<6> opcode, bits<10> xo, bit rc, bit ppc64, bit vmx,
313                dag OL, string asmstr> 
314   : XForm_base_r3xo<opcode, xo, rc, ppc64, vmx, OL, asmstr> {
315   let Arg2Type = Imm5.Value;
316 }
317
318 class XForm_11<bits<6> opcode, bits<10> xo, bit rc, bit ppc64, bit vmx,
319                dag OL, string asmstr> 
320   : XForm_base_r3xo<opcode, xo, rc, ppc64, vmx, OL, asmstr> {
321   let ArgCount = 2;
322   let Arg2Type = 0;
323   let B = 0;
324 }
325
326 class XForm_16<bits<6> opcode, bits<10> xo, bit ppc64, bit vmx,
327                dag OL, string asmstr> : I<opcode, ppc64, vmx, OL, asmstr> {
328   bits<3> BF;
329   bits<1> L; 
330   bits<5> RA;
331   bits<5> RB;
332   
333   let ArgCount = 4;
334   let Arg0Type = Imm3.Value;
335   let Arg1Type = Imm1.Value;
336   let Arg2Type = Gpr.Value;
337   let Arg3Type = Gpr.Value;
338   let Arg4Type = 0;
339   
340   let Inst{6-8}   = BF;
341   let Inst{9}     = 0;
342   let Inst{10}    = L;
343   let Inst{11-15} = RA;
344   let Inst{16-20} = RB;
345   let Inst{21-30} = xo;
346   let Inst{31}    = 0;
347 }
348
349 class XForm_16_ext<bits<6> opcode, bits<10> xo, bit ppc64, bit vmx,
350                    dag OL, string asmstr>
351   : XForm_16<opcode, xo, ppc64, vmx, OL, asmstr> {
352   let ArgCount = 3;
353   let Arg1Type = Gpr.Value;
354   let Arg2Type = Gpr.Value;
355   let Arg3Type = 0;
356   let L = ppc64;
357 }
358
359 class XForm_17<bits<6> opcode, bits<10> xo, bit ppc64, bit vmx,
360                dag OL, string asmstr> : I<opcode, ppc64, vmx, OL, asmstr> {
361   bits<3> BF;
362   bits<5> FRA;
363   bits<5> FRB;
364   
365   let ArgCount = 3;
366   let Arg0Type = Imm3.Value;
367   let Arg1Type = Fpr.Value;
368   let Arg2Type = Fpr.Value;
369   let Arg3Type = 0;
370   let Arg4Type = 0;
371
372   let Inst{6-8}   = BF;
373   let Inst{9-10}  = 0;
374   let Inst{11-15} = FRA;
375   let Inst{16-20} = FRB;
376   let Inst{21-30} = xo;
377   let Inst{31}    = 0;
378 }
379
380 class XForm_25<bits<6> opcode, bits<10> xo, bit ppc64, bit vmx,
381                dag OL, string asmstr> 
382   : XForm_base_r3xo<opcode, xo, 0, ppc64, vmx, OL, asmstr> {
383   let Arg0Type = Fpr.Value;
384   let Arg1Type = Gpr0.Value;
385 }
386
387 class XForm_26<bits<6> opcode, bits<10> xo, bit rc, bit ppc64, bit vmx,
388                dag OL, string asmstr> 
389   : XForm_base_r3xo<opcode, xo, rc, ppc64, vmx, OL, asmstr> {
390   let ArgCount = 2;
391   let Arg0Type = Fpr.Value;
392   let Arg1Type = Fpr.Value;
393   let Arg2Type = 0;
394   let A = 0;
395 }
396
397 class XForm_28<bits<6> opcode, bits<10> xo, bit ppc64, bit vmx,
398                dag OL, string asmstr> 
399   : XForm_base_r3xo<opcode, xo, 0, ppc64, vmx, OL, asmstr> {
400   let Arg0Type = Fpr.Value;
401   let Arg1Type = Gpr0.Value;
402 }
403
404 // 1.7.7 XL-Form
405 class XLForm_1<bits<6> opcode, bits<10> xo, bit ppc64, bit vmx,
406                dag OL, string asmstr> 
407   : XForm_base_r3xo<opcode, xo, 0, ppc64, vmx, OL, asmstr> {
408   let Arg0Type = Imm5.Value;
409   let Arg1Type = Imm5.Value;
410   let Arg2Type = Imm5.Value;
411 }
412
413 class XLForm_2<bits<6> opcode, bits<10> xo, bit lk, bit ppc64, bit vmx, 
414                dag OL, string asmstr> : I<opcode, ppc64, vmx, OL, asmstr> {
415   bits<5> BO;
416   bits<5> BI;
417   bits<2> BH;
418   
419   let ArgCount = 3;
420   let Arg0Type = Imm5.Value;
421   let Arg1Type = Imm5.Value;
422   let Arg2Type = Imm2.Value;
423   let Arg3Type = 0;
424   let Arg4Type = 0;
425
426   let Inst{6-10}  = BO;
427   let Inst{11-15} = BI;
428   let Inst{16-18} = 0;
429   let Inst{19-20} = BH;
430   let Inst{21-30} = xo;
431   let Inst{31}    = lk;
432 }
433
434 class XLForm_2_ext<bits<6> opcode, bits<10> xo, bits<5> bo, 
435                    bits<5> bi, bit lk, bit ppc64, bit vmx, 
436                    dag OL, string asmstr>
437   : XLForm_2<opcode, xo, lk, ppc64, vmx, OL, asmstr> {
438   let ArgCount = 0;
439   let Arg0Type = 0;
440   let Arg1Type = 0;
441   let Arg2Type = 0;
442   let BO = bo;
443   let BI = bi;
444   let BH = 0;
445 }
446
447 // 1.7.8 XFX-Form
448 class XFXForm_1<bits<6> opcode, bits<10> xo, bit ppc64, bit vmx, 
449                 dag OL, string asmstr> : I<opcode, ppc64, vmx, OL, asmstr> {
450   bits<5>  ST;
451   bits<10> SPR;
452
453   let ArgCount = 2;
454   let Arg0Type = Imm5.Value;
455   let Arg1Type = Gpr.Value;
456   let Arg2Type = 0;
457   let Arg3Type = 0;
458   let Arg4Type = 0;
459
460   let Inst{6-10}  = ST;
461   let Inst{11-20} = SPR;
462   let Inst{21-30} = xo;
463   let Inst{31}    = 0;
464 }
465
466 class XFXForm_1_ext<bits<6> opcode, bits<10> xo, bits<10> spr, bit ppc64, 
467                     bit vmx, dag OL, string asmstr> 
468   : XFXForm_1<opcode, xo, ppc64, vmx, OL, asmstr> {
469   let ArgCount = 1;
470   let Arg0Type = Gpr.Value;
471   let Arg1Type = 0;
472   let SPR = spr;
473 }
474
475 class XFXForm_7<bits<6> opcode, bits<10> xo, bit ppc64, bit vmx,
476                 dag OL, string asmstr>
477   : XFXForm_1<opcode, xo, ppc64, vmx, OL, asmstr>;
478
479 class XFXForm_7_ext<bits<6> opcode, bits<10> xo, bits<10> spr, 
480                     bit ppc64, bit vmx, dag OL, string asmstr> 
481   : XFXForm_7<opcode, xo, ppc64, vmx, OL, asmstr> {
482   let ArgCount = 1;
483   let Arg0Type = Gpr.Value;
484   let Arg1Type = 0;
485   let SPR = spr;
486 }
487
488 // 1.7.10 XS-Form
489 class XSForm_1<bits<6> opcode, bits<9> xo, bit rc, bit ppc64, bit vmx,
490                dag OL, string asmstr> : I<opcode, ppc64, vmx, OL, asmstr> {
491   bits<5> RS;
492   bits<5> A;
493   bits<6> SH;
494
495   let ArgCount = 3;
496   let Arg0Type = Gpr.Value;
497   let Arg1Type = Gpr.Value;
498   let Arg2Type = Imm6.Value;
499   let Arg3Type = 0;
500   let Arg4Type = 0;
501
502   let Inst{6-10}  = RS;
503   let Inst{11-15} = A;
504   let Inst{16-20} = SH{1-5};
505   let Inst{21-29} = xo;
506   let Inst{30}    = SH{0};
507   let Inst{31}    = rc;
508 }
509
510 // 1.7.11 XO-Form
511 class XOForm_1<bits<6> opcode, bits<9> xo, bit oe, bit rc, bit ppc64, bit vmx,
512                dag OL, string asmstr> : I<opcode, ppc64, vmx, OL, asmstr> {
513   bits<5> RT;
514   bits<5> RA;
515   bits<5> RB;
516
517   let ArgCount = 3;
518   let Arg0Type = Gpr.Value;
519   let Arg1Type = Gpr.Value;
520   let Arg2Type = Gpr.Value;
521   let Arg3Type = 0;
522   let Arg4Type = 0;
523
524   let Inst{6-10}  = RT;
525   let Inst{11-15} = RA;
526   let Inst{16-20} = RB;
527   let Inst{21}    = oe;
528   let Inst{22-30} = xo;
529   let Inst{31}    = rc;  
530 }
531
532 class XOForm_1r<bits<6> opcode, bits<9> xo, bit oe, bit rc, bit ppc64, bit vmx,
533                dag OL, string asmstr>
534   : XOForm_1<opcode, xo, oe, rc, ppc64, vmx, OL, asmstr> {
535   let Inst{11-15} = RB;
536   let Inst{16-20} = RA;
537 }
538
539 class XOForm_3<bits<6> opcode, bits<9> xo, bit oe, bit rc, bit ppc64, bit vmx,
540                dag OL, string asmstr>
541   : XOForm_1<opcode, xo, oe, rc, ppc64, vmx, OL, asmstr> {
542   let ArgCount = 2;
543   let RB = 0;
544 }
545
546 // 1.7.12 A-Form
547 class AForm_1<bits<6> opcode, bits<5> xo, bit rc, bit ppc64, bit vmx, 
548               dag OL, string asmstr> : I<opcode, ppc64, vmx, OL, asmstr> {
549   let ArgCount = 4;
550   bits<5> FRT;
551   bits<5> FRA;
552   bits<5> FRB;
553   bits<5> FRC;
554
555   let Arg0Type = Fpr.Value;
556   let Arg1Type = Fpr.Value;
557   let Arg2Type = Fpr.Value;
558   let Arg3Type = Fpr.Value;
559   let Arg4Type = 0;
560
561   let Inst{6-10}  = FRT;
562   let Inst{11-15} = FRA;
563   let Inst{16-20} = FRB;
564   let Inst{21-25} = FRC;
565   let Inst{26-30} = xo;
566   let Inst{31}    = rc;
567 }
568
569 class AForm_2<bits<6> opcode, bits<5> xo, bit rc, bit ppc64, bit vmx, dag OL,
570               string asmstr> 
571   : AForm_1<opcode, xo, rc, ppc64, vmx, OL, asmstr> {
572   let ArgCount = 3;
573   let Arg3Type = 0;
574   let FRC = 0;
575 }
576
577 class AForm_3<bits<6> opcode, bits<5> xo, bit rc, bit ppc64, bit vmx, dag OL,
578               string asmstr> 
579   : AForm_1<opcode, xo, rc, ppc64, vmx, OL, asmstr> {
580   let ArgCount = 3;
581   let Arg3Type = 0;
582   let FRB = 0;
583 }
584
585 // 1.7.13 M-Form
586 class MForm_1<bits<6> opcode, bit rc, bit ppc64, bit vmx,
587               dag OL, string asmstr> : I<opcode, ppc64, vmx, OL, asmstr> {
588   let ArgCount = 5;
589   bits<5> RA;
590   bits<5> RS;
591   bits<5> RB;
592   bits<5> MB;
593   bits<5> ME;
594
595   let Arg0Type = Gpr.Value;
596   let Arg1Type = Gpr.Value;
597   let Arg2Type = Gpr.Value;
598   let Arg3Type = Imm5.Value;
599   let Arg4Type = Imm5.Value;
600
601   let Inst{6-10}  = RS;
602   let Inst{11-15} = RA;
603   let Inst{16-20} = RB;
604   let Inst{21-25} = MB;
605   let Inst{26-30} = ME;
606   let Inst{31}    = rc;
607 }
608
609 class MForm_2<bits<6> opcode, bit rc, bit ppc64, bit vmx, 
610               dag OL, string asmstr>
611   : MForm_1<opcode, rc, ppc64, vmx, OL, asmstr> {
612   let Arg2Type = Imm5.Value;
613 }
614
615 // 1.7.14 MD-Form
616 class MDForm_1<bits<6> opcode, bits<3> xo, bit rc, bit ppc64, bit vmx,
617                dag OL, string asmstr> : I<opcode, ppc64, vmx, OL, asmstr> {
618   let ArgCount = 4;
619   bits<5> RS;
620   bits<5> RA;
621   bits<6> SH;
622   bits<6> MBE;
623
624   let Arg0Type = Gpr.Value;
625   let Arg1Type = Gpr.Value;
626   let Arg2Type = Imm6.Value;
627   let Arg3Type = Imm6.Value;
628   let Arg4Type = 0;
629
630   let Inst{6-10}  = RS;
631   let Inst{11-15} = RA;
632   let Inst{16-20} = SH{1-5};
633   let Inst{21-26} = MBE;
634   let Inst{27-29} = xo;
635   let Inst{30}    = SH{0};
636   let Inst{31}    = rc;
637 }
638
639 //===----------------------------------------------------------------------===//
640
641 class Pseudo<dag OL, string asmstr> : I<0, 0, 0, OL, asmstr> {
642   let ArgCount = 0;
643   let PPC64 = 0;
644   let VMX = 0;
645
646   let Arg0Type = Pseudo.Value;
647   let Arg1Type = Pseudo.Value;
648   let Arg2Type = Pseudo.Value;
649   let Arg3Type = Pseudo.Value;
650   let Arg4Type = 0;
651
652   let Inst{31-0} = 0;
653 }