blob: 852e43255a3ad67a5d56b4764eb583654675016d [file] [log] [blame]
Misha Brukmancd4f51b2004-08-02 16:54:54 +00001//===- 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
13class Format<bits<5> val> {
14 bits<5> Value = val;
15}
16
17def Pseudo: Format<0>;
18def Gpr : Format<1>;
19def Gpr0 : Format<2>;
20def Simm16 : Format<3>;
21def Zimm16 : Format<4>;
22def PCRelimm24 : Format<5>;
23def Imm24 : Format<6>;
24def Imm5 : Format<7>;
25def PCRelimm14 : Format<8>;
26def Imm14 : Format<9>;
27def Imm2 : Format<10>;
28def Crf : Format<11>;
29def Imm3 : Format<12>;
30def Imm1 : Format<13>;
31def Fpr : Format<14>;
32def Imm4 : Format<15>;
33def Imm8 : Format<16>;
34def Disimm16 : Format<17>;
35def Disimm14 : Format<18>;
36def Spr : Format<19>;
37def Sgr : Format<20>;
38def Imm15 : Format<21>;
39def Vpr : Format<22>;
40
Misha Brukman6b21bde2004-08-02 21:56:35 +000041//===----------------------------------------------------------------------===//
42//
43// PowerPC instruction formats
Misha Brukmancd4f51b2004-08-02 16:54:54 +000044
Misha Brukmandad438b2004-08-10 22:47:03 +000045class I<string name, bits<6> opcode, bit ppc64, bit vmx> : Instruction {
Misha Brukman6b21bde2004-08-02 21:56:35 +000046 field bits<32> Inst;
Misha Brukmancd4f51b2004-08-02 16:54:54 +000047
Misha Brukman6b21bde2004-08-02 21:56:35 +000048 bits<3> ArgCount;
49 bits<5> Arg0Type;
50 bits<5> Arg1Type;
51 bits<5> Arg2Type;
52 bits<5> Arg3Type;
53 bits<5> Arg4Type;
54 bit PPC64 = ppc64;
55 bit VMX = vmx;
Misha Brukmancd4f51b2004-08-02 16:54:54 +000056
Misha Brukman6b21bde2004-08-02 21:56:35 +000057 let Name = name;
Misha Brukmandad438b2004-08-10 22:47:03 +000058 let Namespace = "PPC";
Misha Brukman5295e1d2004-08-09 17:24:04 +000059 let Inst{0-5} = opcode;
Misha Brukmancd4f51b2004-08-02 16:54:54 +000060}
61
Misha Brukman5295e1d2004-08-09 17:24:04 +000062// 1.7.1 I-Form
63class IForm<string name, bits<6> opcode, bit aa, bit lk, bit ppc64, bit vmx>
Misha Brukmandad438b2004-08-10 22:47:03 +000064 : I<name, opcode, ppc64, vmx> {
Misha Brukman5295e1d2004-08-09 17:24:04 +000065 field bits<24> LI;
Misha Brukman6b21bde2004-08-02 21:56:35 +000066
Misha Brukman5295e1d2004-08-09 17:24:04 +000067 let ArgCount = 1;
68 let Arg0Type = Imm24.Value;
69 let Arg1Type = 0;
70 let Arg2Type = 0;
Misha Brukman6b21bde2004-08-02 21:56:35 +000071 let Arg3Type = 0;
72 let Arg4Type = 0;
73
Misha Brukman5295e1d2004-08-09 17:24:04 +000074 let Inst{6-29} = LI;
75 let Inst{30} = aa;
76 let Inst{31} = lk;
Misha Brukman6b21bde2004-08-02 21:56:35 +000077}
78
Misha Brukman5295e1d2004-08-09 17:24:04 +000079// 1.7.2 B-Form
80class BForm<string name, bits<6> opcode, bit aa, bit lk, bit ppc64, bit vmx>
Misha Brukmandad438b2004-08-10 22:47:03 +000081 : I<name, opcode, ppc64, vmx> {
Misha Brukman5295e1d2004-08-09 17:24:04 +000082 field bits<5> BO;
83 field bits<5> BI;
84 field bits<14> BD;
85
86 let ArgCount = 3;
87 let Arg0Type = Imm5.Value;
88 let Arg1Type = Imm5.Value;
89 let Arg2Type = PCRelimm14.Value;
90 let Arg3Type = 0;
91 let Arg4Type = 0;
92
93 let Inst{6-10} = BO;
94 let Inst{11-15} = BI;
95 let Inst{16-29} = BD;
96 let Inst{30} = aa;
97 let Inst{31} = lk;
Misha Brukman6b21bde2004-08-02 21:56:35 +000098}
99
Misha Brukman5295e1d2004-08-09 17:24:04 +0000100class BForm_ext<string name, bits<6> opcode, bit aa, bit lk, bits<5> bo,
101 bits<5> bi, bit ppc64, bit vmx>
102 : BForm<name, opcode, aa, lk, ppc64, vmx> {
103 let ArgCount = 2;
Misha Brukman6b21bde2004-08-02 21:56:35 +0000104 let Arg2Type = Imm5.Value;
Misha Brukman5295e1d2004-08-09 17:24:04 +0000105 let Arg1Type = PCRelimm14.Value;
106 let Arg2Type = 0;
107 let BO = bo;
108 let BI = bi;
Misha Brukman6b21bde2004-08-02 21:56:35 +0000109}
110
Misha Brukman5295e1d2004-08-09 17:24:04 +0000111// 1.7.4 D-Form
Misha Brukman6b21bde2004-08-02 21:56:35 +0000112class DForm_base<string name, bits<6> opcode, bit ppc64, bit vmx>
Misha Brukmandad438b2004-08-10 22:47:03 +0000113 : I<name, opcode, ppc64, vmx> {
Misha Brukman6b21bde2004-08-02 21:56:35 +0000114 field bits<5> A;
115 field bits<5> B;
116 field bits<16> C;
117
118 let ArgCount = 3;
119 let Arg0Type = Gpr.Value;
120 let Arg1Type = Gpr.Value;
121 let Arg2Type = Simm16.Value;
122 let Arg3Type = 0;
123 let Arg4Type = 0;
124
125 let Inst{6-10} = A;
126 let Inst{11-15} = B;
127 let Inst{16-31} = C;
128}
129
130class DForm_1<string name, bits<6> opcode, bit ppc64, bit vmx>
131 : DForm_base<name, opcode, ppc64, vmx> {
Misha Brukman5295e1d2004-08-09 17:24:04 +0000132 let Arg1Type = Disimm16.Value;
133 let Arg2Type = Gpr0.Value;
Misha Brukman6b21bde2004-08-02 21:56:35 +0000134}
135
136class DForm_2<string name, bits<6> opcode, bit ppc64, bit vmx>
137 : DForm_base<name, opcode, ppc64, vmx>;
138
139class DForm_2_r0<string name, bits<6> opcode, bit ppc64, bit vmx>
140 : DForm_base<name, opcode, ppc64, vmx> {
141 let Arg1Type = Gpr0.Value;
142}
143
144// Currently we make the use/def reg distinction in ISel, not tablegen
145class DForm_3<string name, bits<6> opcode, bit ppc64, bit vmx>
146 : DForm_1<name, opcode, ppc64, vmx>;
147
148class DForm_4<string name, bits<6> opcode, bit ppc64, bit vmx>
Misha Brukman09d87b42004-08-10 18:07:55 +0000149 : DForm_base<name, opcode, ppc64, vmx> {
150 let Arg2Type = Zimm16.Value;
151}
Misha Brukman6b21bde2004-08-02 21:56:35 +0000152
Misha Brukman5295e1d2004-08-09 17:24:04 +0000153class DForm_4_zero<string name, bits<6> opcode, bit ppc64, bit vmx>
154 : DForm_1<name, opcode, ppc64, vmx> {
155 let ArgCount = 0;
156 let Arg0Type = 0;
157 let Arg1Type = 0;
158 let Arg2Type = 0;
159 let A = 0;
160 let B = 0;
161 let C = 0;
162}
163
164class DForm_5<string name, bits<6> opcode, bit ppc64, bit vmx>
Misha Brukmandad438b2004-08-10 22:47:03 +0000165 : I<name, opcode, ppc64, vmx> {
Misha Brukman5295e1d2004-08-09 17:24:04 +0000166 field bits<3> BF;
167 field bits<1> L;
168 field bits<5> RA;
169 field bits<16> I;
170
171 let ArgCount = 4;
172 let Arg0Type = Imm3.Value;
173 let Arg1Type = Imm1.Value;
174 let Arg2Type = Gpr.Value;
175 let Arg3Type = Simm16.Value;
176 let Arg4Type = 0;
177
178 let Inst{6-8} = BF;
179 let Inst{9} = 0;
180 let Inst{10} = L;
181 let Inst{11-15} = RA;
182 let Inst{16-31} = I;
183}
184
185class DForm_5_ext<string name, bits<6> opcode, bit ppc64, bit vmx>
186 : DForm_5<name, opcode, ppc64, vmx> {
187 let L = 0;
Misha Brukmanc6b114f2004-08-10 19:03:31 +0000188 let ArgCount = 3;
189 let Arg0Type = Imm3.Value;
190 let Arg1Type = Gpr.Value;
191 let Arg2Type = Simm16.Value;
192 let Arg3Type = 0;
Misha Brukman5295e1d2004-08-09 17:24:04 +0000193}
194
195class DForm_6<string name, bits<6> opcode, bit ppc64, bit vmx>
196 : DForm_5<name, opcode, ppc64, vmx> {
197 let Arg3Type = Zimm16.Value;
198}
199
200class DForm_6_ext<string name, bits<6> opcode, bit ppc64, bit vmx>
201 : DForm_6<name, opcode, ppc64, vmx> {
202 let L = 0;
Misha Brukmanc6b114f2004-08-10 19:03:31 +0000203 let ArgCount = 3;
204 let Arg0Type = Imm3.Value;
205 let Arg1Type = Gpr.Value;
206 let Arg2Type = Simm16.Value;
207 let Arg3Type = 0;
Misha Brukman5295e1d2004-08-09 17:24:04 +0000208}
209
Misha Brukman6b21bde2004-08-02 21:56:35 +0000210class DForm_7<string name, bits<6> opcode, bit ppc64, bit vmx>
211 : DForm_base<name, opcode, ppc64, vmx> {
212 let Arg1Type = Imm5.Value;
213}
214
Misha Brukman5295e1d2004-08-09 17:24:04 +0000215class DForm_8<string name, bits<6> opcode, bit ppc64, bit vmx>
216 : DForm_1<name, opcode, ppc64, vmx> {
217 let Arg0Type = Fpr.Value;
218}
219
220class DForm_9<string name, bits<6> opcode, bit ppc64, bit vmx>
221 : DForm_1<name, opcode, ppc64, vmx> {
222 let Arg0Type = Fpr.Value;
223}
224
Misha Brukman28beda92004-08-11 15:54:36 +0000225// 1.7.5 DS-Form
226class DSForm_1<string name, bits<6> opcode, bits<2> xo, bit ppc64, bit vmx>
227 : I<name, opcode, ppc64, vmx> {
228 field bits<5> RST;
229 field bits<14> DS;
230 field bits<5> RA;
231
232 let ArgCount = 3;
233 let Arg0Type = Gpr.Value;
234 let Arg1Type = Disimm14.Value;
235 let Arg2Type = Gpr.Value;
236 let Arg3Type = 0;
237 let Arg4Type = 0;
238
239 let Inst{6-10} = RST;
240 let Inst{11-15} = RA;
241 let Inst{16-29} = DS;
242 let Inst{30-31} = xo;
243}
244
245class DSForm_2<string name, bits<6> opcode, bits<2> xo, bit ppc64, bit vmx>
246 : DSForm_1<name, opcode, xo, ppc64, vmx>;
247
Misha Brukman5295e1d2004-08-09 17:24:04 +0000248// 1.7.6 X-Form
249class XForm_base_r3xo<string name, bits<6> opcode, bits<10> xo, bit rc,
Misha Brukmandad438b2004-08-10 22:47:03 +0000250 bit ppc64, bit vmx> : I<name, opcode, ppc64, vmx> {
Misha Brukman28beda92004-08-11 15:54:36 +0000251 field bits<5> RST;
252 field bits<5> A;
253 field bits<5> B;
Misha Brukman5295e1d2004-08-09 17:24:04 +0000254
255 let ArgCount = 3;
256 let Arg0Type = Gpr.Value;
257 let Arg1Type = Gpr.Value;
258 let Arg2Type = Gpr.Value;
259 let Arg3Type = 0;
260 let Arg4Type = 0;
261
Misha Brukman28beda92004-08-11 15:54:36 +0000262 let Inst{6-10} = RST;
Misha Brukman5295e1d2004-08-09 17:24:04 +0000263 let Inst{11-15} = A;
264 let Inst{16-20} = B;
265 let Inst{21-30} = xo;
266 let Inst{31} = rc;
267}
268
269class XForm_1<string name, bits<6> opcode, bits<10> xo, bit ppc64,
270 bit vmx> : XForm_base_r3xo<name, opcode, xo, 0, ppc64, vmx>;
271
272class XForm_5<string name, bits<6> opcode, bits<10> xo, bit ppc64,
273 bit vmx> : XForm_base_r3xo<name, opcode, xo, 0, ppc64, vmx> {
274 let ArgCount = 1;
275 let Arg1Type = 0;
276 let Arg2Type = 0;
277 let A = 0;
278 let B = 0;
279}
280
281class XForm_6<string name, bits<6> opcode, bits<10> xo, bit rc, bit ppc64,
282 bit vmx> : XForm_base_r3xo<name, opcode, xo, rc, ppc64, vmx>;
283
284class XForm_7<string name, bits<6> opcode, bits<10> xo, bit ppc64, bit vmx>
285 : XForm_base_r3xo<name, opcode, xo, 1, ppc64, vmx>;
286
287class XForm_8<string name, bits<6> opcode, bits<10> xo, bit ppc64, bit vmx>
288 : XForm_base_r3xo<name, opcode, xo, 0, ppc64, vmx>;
289
290class XForm_10<string name, bits<6> opcode, bits<10> xo, bit rc, bit ppc64,
291 bit vmx> : XForm_base_r3xo<name, opcode, xo, rc, ppc64, vmx> {
292 let Arg2Type = Imm5.Value;
293}
294
295class XForm_11<string name, bits<6> opcode, bits<10> xo, bit rc, bit ppc64,
296 bit vmx> : XForm_base_r3xo<name, opcode, xo, rc, ppc64, vmx> {
297 let ArgCount = 2;
298 let Arg2Type = 0;
299 let B = 0;
300}
301
302class XForm_16<string name, bits<6> opcode, bits<10> xo, bit ppc64, bit vmx>
Misha Brukmandad438b2004-08-10 22:47:03 +0000303 : I<name, opcode, ppc64, vmx> {
Misha Brukman5295e1d2004-08-09 17:24:04 +0000304 field bits<3> BF;
305 field bits<1> L;
306 field bits<5> RA;
307 field bits<5> RB;
308
309 let ArgCount = 4;
310 let Arg0Type = Imm3.Value;
311 let Arg1Type = Imm1.Value;
312 let Arg2Type = Gpr.Value;
313 let Arg3Type = Gpr.Value;
314 let Arg4Type = 0;
315
316 let Inst{6-8} = BF;
317 let Inst{9} = 0;
318 let Inst{10} = L;
319 let Inst{11-15} = RA;
320 let Inst{16-20} = RB;
321 let Inst{21-30} = xo;
322 let Inst{31} = 0;
323}
324
325class XForm_16_ext<string name, bits<6> opcode, bits<10> xo, bit ppc64, bit vmx>
326 : XForm_16<name, opcode, xo, ppc64, vmx> {
327 let L = 0;
328}
329
330class XForm_17<string name, bits<6> opcode, bits<10> xo, bit ppc64, bit vmx>
Misha Brukmandad438b2004-08-10 22:47:03 +0000331 : I<name, opcode, ppc64, vmx> {
Misha Brukman5295e1d2004-08-09 17:24:04 +0000332 field bits<3> BF;
333 field bits<5> FRA;
334 field bits<5> FRB;
335
336 let ArgCount = 3;
337 let Arg0Type = Imm3.Value;
338 let Arg1Type = Fpr.Value;
339 let Arg2Type = Fpr.Value;
340 let Arg3Type = 0;
341 let Arg4Type = 0;
342
343 let Inst{6-8} = BF;
344 let Inst{9-10} = 0;
345 let Inst{11-15} = FRA;
346 let Inst{16-20} = FRB;
347 let Inst{21-30} = xo;
348 let Inst{31} = 0;
349}
350
351class XForm_25<string name, bits<6> opcode, bits<10> xo, bit ppc64,
352 bit vmx> : XForm_base_r3xo<name, opcode, xo, 0, ppc64, vmx> {
353 let Arg0Type = Fpr.Value;
354 let Arg1Type = Gpr0.Value;
355}
356
357class XForm_26<string name, bits<6> opcode, bits<10> xo, bit rc, bit ppc64,
358 bit vmx> : XForm_base_r3xo<name, opcode, xo, rc, ppc64, vmx> {
359 let ArgCount = 2;
360 let Arg0Type = Fpr.Value;
361 let Arg1Type = Fpr.Value;
362 let Arg2Type = 0;
363 let A = 0;
364}
365
366class XForm_28<string name, bits<6> opcode, bits<10> xo, bit ppc64,
367 bit vmx> : XForm_base_r3xo<name, opcode, xo, 0, ppc64, vmx> {
368 let Arg0Type = Fpr.Value;
369 let Arg1Type = Gpr0.Value;
370}
371
372// 1.7.7 XL-Form
373class XLForm_1<string name, bits<6> opcode, bits<10> xo, bit ppc64, bit vmx>
374 : XForm_base_r3xo<name, opcode, xo, 0, ppc64, vmx> {
375 let Arg0Type = Imm5.Value;
376 let Arg1Type = Imm5.Value;
377 let Arg2Type = Imm5.Value;
378}
379
380class XLForm_2<string name, bits<6> opcode, bits<10> xo, bit lk, bit ppc64,
Misha Brukmandad438b2004-08-10 22:47:03 +0000381 bit vmx> : I<name, opcode, ppc64, vmx> {
Misha Brukman5295e1d2004-08-09 17:24:04 +0000382 field bits<5> BO;
383 field bits<5> BI;
384 field bits<2> BH;
385
386 let ArgCount = 3;
387 let Arg0Type = Imm5.Value;
388 let Arg1Type = Imm5.Value;
389 let Arg2Type = Imm2.Value;
390 let Arg3Type = 0;
391 let Arg4Type = 0;
392
393 let Inst{6-10} = BO;
394 let Inst{11-15} = BI;
395 let Inst{16-18} = 0;
396 let Inst{19-20} = BH;
397 let Inst{21-30} = xo;
398 let Inst{31} = lk;
399}
400
401class XLForm_2_ext<string name, bits<6> opcode, bits<10> xo, bits<5> bo,
402 bits<5> bi, bit lk, bit ppc64, bit vmx>
403 : XLForm_2<name, opcode, xo, lk, ppc64, vmx> {
404 let ArgCount = 0;
405 let Arg0Type = 0;
406 let Arg1Type = 0;
407 let Arg2Type = 0;
408 let BO = bo;
409 let BI = bi;
410 let BH = 0;
411}
412
413// 1.7.8 XFX-Form
414class XFXForm_1<string name, bits<6> opcode, bits<10> xo, bit ppc64, bit vmx>
Misha Brukmandad438b2004-08-10 22:47:03 +0000415 : I<name, opcode, ppc64, vmx> {
Misha Brukman5295e1d2004-08-09 17:24:04 +0000416 field bits<5> ST;
417 field bits<10> SPR;
418
419 let ArgCount = 2;
420 let Arg0Type = Imm5.Value;
421 let Arg1Type = Gpr.Value;
422 let Arg2Type = 0;
423 let Arg3Type = 0;
424 let Arg4Type = 0;
425
426 let Inst{6-10} = ST;
427 let Inst{11-20} = SPR;
428 let Inst{21-30} = xo;
429 let Inst{31} = 0;
430}
431
432class XFXForm_1_ext<string name, bits<6> opcode, bits<10> xo, bits<10> spr,
433 bit ppc64, bit vmx> : XFXForm_1<name,opcode,xo,ppc64,vmx> {
434 let ArgCount = 1;
435 let Arg0Type = Gpr.Value;
436 let Arg1Type = 0;
437 let SPR = spr;
438}
439
440class XFXForm_7<string name, bits<6> opcode, bits<10> xo, bit ppc64, bit vmx>
441 : XFXForm_1<name, opcode, xo, ppc64, vmx>;
442
443class XFXForm_7_ext<string name, bits<6> opcode, bits<10> xo, bits<10> spr,
444 bit ppc64, bit vmx> : XFXForm_7<name,opcode,xo,ppc64,vmx> {
445 let ArgCount = 1;
446 let Arg0Type = Gpr.Value;
447 let Arg1Type = 0;
448 let SPR = spr;
449}
450
451// 1.7.11 XO-Form
452class XOForm_1<string name, bits<6> opcode, bits<9> xo, bit oe, bit rc,
Misha Brukmandad438b2004-08-10 22:47:03 +0000453 bit ppc64, bit vmx> : I<name, opcode, ppc64, vmx> {
Misha Brukman5295e1d2004-08-09 17:24:04 +0000454 field bits<5> RT;
455 field bits<5> RA;
456 field bits<5> RB;
457
458 let ArgCount = 3;
459 let Arg0Type = Gpr.Value;
460 let Arg1Type = Gpr.Value;
461 let Arg2Type = Gpr.Value;
462 let Arg3Type = 0;
463 let Arg4Type = 0;
464
465 let Inst{6-10} = RT;
466 let Inst{11-15} = RA;
467 let Inst{16-20} = RB;
468 let Inst{21} = oe;
469 let Inst{22-30} = xo;
470 let Inst{31} = rc;
471}
472
473// This is a reversal of the two operands, used notably by extended ops SUB*:
474// sub x, y, z == subf x, z, y
475// subc x, y, z == subfc x, z, y
476class XOForm_1_rev<string name, bits<6> opcode, bits<9> xo, bit oe, bit rc,
477 bit ppc64, bit vmx>
478 : XOForm_1<name, opcode, xo, oe, rc, ppc64, vmx> {
479 let Inst{11-15} = RB;
480 let Inst{16-20} = RA;
481}
482
483class XOForm_2<string name, bits<6> opcode, bits<9> xo, bit rc, bit ppc64,
484 bit vmx> : XOForm_1<name, opcode, xo, 0, rc, ppc64, vmx>;
485
486class XOForm_3<string name, bits<6> opcode, bits<9> xo, bit oe, bit rc,
487 bit ppc64, bit vmx> : XOForm_1<name,opcode,xo,oe,rc,ppc64,vmx> {
488 let RB = 0;
489}
490
491// 1.7.12 A-Form
492class AForm_1<string name, bits<6> opcode, bits<5> xo, bit rc, bit ppc64,
Misha Brukmandad438b2004-08-10 22:47:03 +0000493 bit vmx> : I<name, opcode, ppc64, vmx> {
Misha Brukman5295e1d2004-08-09 17:24:04 +0000494 let ArgCount = 4;
495 field bits<5> FRT;
496 field bits<5> FRA;
497 field bits<5> FRB;
498 field bits<5> FRC;
499
500 let Arg0Type = Fpr.Value;
501 let Arg1Type = Fpr.Value;
502 let Arg2Type = Fpr.Value;
503 let Arg3Type = Fpr.Value;
504 let Arg4Type = 0;
505
506 let Inst{6-10} = FRT;
507 let Inst{11-15} = FRA;
508 let Inst{16-20} = FRB;
509 let Inst{21-25} = FRC;
510 let Inst{26-30} = xo;
511 let Inst{31} = rc;
512}
513
514class AForm_2<string name, bits<6> opcode, bits<5> xo, bit rc, bit ppc64,
515 bit vmx> : AForm_1<name, opcode, xo, rc, ppc64, vmx> {
516 let ArgCount = 3;
517 let Arg3Type = 0;
518 let FRC = 0;
519}
520
521class AForm_3<string name, bits<6> opcode, bits<5> xo, bit rc, bit ppc64,
522 bit vmx> : AForm_1<name, opcode, xo, rc, ppc64, vmx> {
523 let ArgCount = 3;
524 let Arg3Type = 0;
525 let FRB = 0;
526}
527
528class AForm_4<string name, bits<6> opcode, bits<5> xo, bit rc, bit ppc64,
529 bit vmx> : AForm_1<name, opcode, xo, rc, ppc64, vmx> {
530 let ArgCount = 2;
531 let Arg2Type = 0;
532 let Arg3Type = 0;
533 let FRA = 0;
534 let FRC = 0;
535}
536
537// 1.7.13 M-Form
538class MForm_1<string name, bits<6> opcode, bit rc, bit ppc64, bit vmx>
Misha Brukmandad438b2004-08-10 22:47:03 +0000539 : I<name, opcode, ppc64, vmx> {
Misha Brukman5295e1d2004-08-09 17:24:04 +0000540 let ArgCount = 5;
541 field bits<5> RS;
542 field bits<5> RA;
543 field bits<5> RB;
544 field bits<5> MB;
545 field bits<5> ME;
546
547 let Arg0Type = Gpr.Value;
548 let Arg1Type = Gpr.Value;
549 let Arg2Type = Gpr.Value;
550 let Arg3Type = Imm5.Value;
551 let Arg4Type = Imm5.Value;
552
553 let Inst{6-10} = RS;
554 let Inst{11-15} = RA;
555 let Inst{16-20} = RB;
556 let Inst{21-25} = MB;
557 let Inst{26-30} = ME;
558 let Inst{31} = rc;
559}
560
561class MForm_2<string name, bits<6> opcode, bit rc, bit ppc64, bit vmx>
562 : MForm_1<name, opcode, rc, ppc64, vmx> {
563 let Arg2Type = Imm5.Value;
564}
565
Misha Brukman6b21bde2004-08-02 21:56:35 +0000566//===----------------------------------------------------------------------===//
567
Misha Brukmandad438b2004-08-10 22:47:03 +0000568class Pseudo<string name> : I<name, 0, 0, 0> {
Misha Brukmancd4f51b2004-08-02 16:54:54 +0000569 let Name = name;
570 let ArgCount = 0;
571 let PPC64 = 0;
572 let VMX = 0;
573
Misha Brukman5295e1d2004-08-09 17:24:04 +0000574 let Arg0Type = Pseudo.Value;
575 let Arg1Type = Pseudo.Value;
576 let Arg2Type = Pseudo.Value;
577 let Arg3Type = Pseudo.Value;
Misha Brukmancd4f51b2004-08-02 16:54:54 +0000578 let Arg4Type = 0;
Misha Brukmancd4f51b2004-08-02 16:54:54 +0000579
Misha Brukmandad438b2004-08-10 22:47:03 +0000580 let Inst{31-0} = 0;
Misha Brukmancd4f51b2004-08-02 16:54:54 +0000581}