xref: /freebsd/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrSPE.td (revision 833a452e9f082a7982a31c21f0da437dbbe0a39d)
1//=======-- PPCInstrSPE.td - The PowerPC SPE Extension -*- tablegen -*-=======//
2//
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
6//
7//===----------------------------------------------------------------------===//
8//
9// This file describes the Signal Processing Engine extension to
10// the PowerPC instruction set.
11//
12//===----------------------------------------------------------------------===//
13
14class EFXForm_1<bits<11> xo, dag OOL, dag IOL, string asmstr,
15               InstrItinClass itin, list<dag> pattern> :
16               I<4, OOL, IOL, asmstr, itin> {
17  bits<5> RT;
18  bits<5> RA;
19  bits<5> RB;
20
21  let Pattern = pattern;
22
23  let Inst{6-10}  = RT;
24  let Inst{11-15} = RA;
25  let Inst{16-20} = RB;
26  let Inst{21-31} = xo;
27}
28
29class EFXForm_2<bits<11> xo, dag OOL, dag IOL, string asmstr,
30               InstrItinClass itin, list<dag> pattern> :
31               EFXForm_1<xo, OOL, IOL, asmstr, itin, pattern> {
32  let RB = 0;
33}
34
35class EFXForm_2a<bits<11> xo, dag OOL, dag IOL, string asmstr,
36               InstrItinClass itin, list<dag> pattern> :
37               EFXForm_1<xo, OOL, IOL, asmstr, itin, pattern> {
38  let RA = 0;
39}
40
41class EFXForm_3<bits<11> xo, dag OOL, dag IOL, string asmstr,
42              InstrItinClass itin> :
43              I<4, OOL, IOL, asmstr, itin> {
44  bits<3> crD;
45  bits<5> RA;
46  bits<5> RB;
47
48  let Inst{6-8}  = crD;
49  let Inst{9-10}  = 0;
50  let Inst{11-15} = RA;
51  let Inst{16-20} = RB;
52  let Inst{21-31} = xo;
53}
54
55class EVXForm_1<bits<11> xo, dag OOL, dag IOL, string asmstr,
56               InstrItinClass itin, list<dag> pattern> :
57               I<4, OOL, IOL, asmstr, itin> {
58  bits<5> RT;
59  bits<5> RA;
60  bits<5> RB;
61
62  let Pattern = pattern;
63
64  let Inst{6-10}  = RT;
65  let Inst{11-15} = RA;
66  let Inst{16-20} = RB;
67  let Inst{21-31} = xo;
68}
69
70class EVXForm_2<bits<11> xo, dag OOL, dag IOL, string asmstr,
71               InstrItinClass itin, list<dag> pattern> :
72               EVXForm_1<xo, OOL, IOL, asmstr, itin, pattern> {
73  let RB = 0;
74}
75
76class EVXForm_2a<bits<11> xo, dag OOL, dag IOL, string asmstr,
77               InstrItinClass itin, list<dag> pattern> :
78               EVXForm_1<xo, OOL, IOL, asmstr, itin, pattern> {
79  let RA = 0;
80}
81
82class EVXForm_3<bits<11> xo, dag OOL, dag IOL, string asmstr,
83              InstrItinClass itin, list<dag> pattern> :
84              I<4, OOL, IOL, asmstr, itin> {
85  bits<3> crD;
86  bits<5> RA;
87  bits<5> RB;
88
89  let Pattern = pattern;
90
91  let Inst{6-8}  = crD;
92  let Inst{9-10}  = 0;
93  let Inst{11-15} = RA;
94  let Inst{16-20} = RB;
95  let Inst{21-31} = xo;
96}
97
98class EVXForm_4<bits<8> xo, dag OOL, dag IOL, string asmstr,
99               InstrItinClass itin, list<dag> pattern> :
100               I<4, OOL, IOL, asmstr, itin> {
101  bits<3> crD;
102  bits<5> RA;
103  bits<5> RB;
104  bits<5> RT;
105
106  let Pattern = pattern;
107
108  let Inst{6-10}  = RT;
109  let Inst{11-15} = RA;
110  let Inst{16-20} = RB;
111  let Inst{21-28} = xo;
112  let Inst{29-31} = crD;
113}
114
115class EVXForm_D<bits<11> xo, dag OOL, dag IOL, string asmstr,
116               InstrItinClass itin, list<dag> pattern> :
117               I<4, OOL, IOL, asmstr, itin> {
118  bits<5> RT;
119  bits<21> D;
120
121  let Pattern = pattern;
122
123  let Inst{6-10}  = RT;
124  let Inst{20} = D{0};
125  let Inst{19} = D{1};
126  let Inst{18} = D{2};
127  let Inst{17} = D{3};
128  let Inst{16} = D{4};
129  let Inst{15} = D{5};
130  let Inst{14} = D{6};
131  let Inst{13} = D{7};
132  let Inst{12} = D{8};
133  let Inst{11} = D{9};
134  let Inst{11-20} = D{0-9};
135  let Inst{21-31} = xo;
136}
137
138let DecoderNamespace = "SPE", Predicates = [HasSPE] in {
139
140def BRINC          : EVXForm_1<527, (outs gprc:$RT), (ins gprc:$RA, gprc:$RB),
141                               "brinc $RT, $RA, $RB", IIC_IntSimple, []>;
142
143// Double-precision floating point
144def EFDABS         : EFXForm_2<740, (outs sperc:$RT), (ins sperc:$RA),
145                                "efdabs $RT, $RA", IIC_FPDGeneral,
146                                [(set f64:$RT, (fabs f64:$RA))]>;
147
148def EFDADD         : EFXForm_1<736, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
149                                "efdadd $RT, $RA, $RB", IIC_FPAddSub,
150                                [(set f64:$RT, (any_fadd f64:$RA, f64:$RB))]>;
151
152def EFDCFS         : EFXForm_2a<751, (outs sperc:$RT), (ins spe4rc:$RB),
153                                "efdcfs $RT, $RB", IIC_FPDGeneral,
154                                [(set f64:$RT, (any_fpextend f32:$RB))]>;
155
156def EFDCFSF        : EFXForm_2a<755, (outs sperc:$RT), (ins spe4rc:$RB),
157                                "efdcfsf $RT, $RB", IIC_FPDGeneral, []>;
158
159def EFDCFSI        : EFXForm_2a<753, (outs sperc:$RT), (ins gprc:$RB),
160                                "efdcfsi $RT, $RB", IIC_FPDGeneral,
161                                [(set f64:$RT, (any_sint_to_fp i32:$RB))]>;
162
163def EFDCFSID       : EFXForm_2a<739, (outs sperc:$RT), (ins gprc:$RB),
164                                "efdcfsid $RT, $RB", IIC_FPDGeneral,
165                                []>;
166
167def EFDCFUF        : EFXForm_2a<754, (outs sperc:$RT), (ins spe4rc:$RB),
168                                "efdcfuf $RT, $RB", IIC_FPDGeneral, []>;
169
170def EFDCFUI        : EFXForm_2a<752, (outs sperc:$RT), (ins gprc:$RB),
171                                "efdcfui $RT, $RB", IIC_FPDGeneral,
172                                [(set f64:$RT, (any_uint_to_fp i32:$RB))]>;
173
174def EFDCFUID       : EFXForm_2a<738, (outs sperc:$RT), (ins gprc:$RB),
175                                "efdcfuid $RT, $RB", IIC_FPDGeneral,
176                                []>;
177
178let isCompare = 1 in {
179def EFDCMPEQ       : EFXForm_3<750, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
180                               "efdcmpeq $crD, $RA, $RB", IIC_FPDGeneral>;
181def EFDCMPGT       : EFXForm_3<748, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
182                               "efdcmpgt $crD, $RA, $RB", IIC_FPDGeneral>;
183def EFDCMPLT       : EFXForm_3<749, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
184                               "efdcmplt $crD, $RA, $RB", IIC_FPDGeneral>;
185}
186
187def EFDCTSF        : EFXForm_2a<759, (outs sperc:$RT), (ins spe4rc:$RB),
188                                "efdctsf $RT, $RB", IIC_FPDGeneral, []>;
189
190def EFDCTSI        : EFXForm_2a<757, (outs gprc:$RT), (ins sperc:$RB),
191                                "efdctsi $RT, $RB", IIC_FPDGeneral,
192                                []>;
193
194def EFDCTSIDZ      : EFXForm_2a<747, (outs gprc:$RT), (ins sperc:$RB),
195                                "efdctsidz $RT, $RB", IIC_FPDGeneral,
196                                []>;
197
198def EFDCTSIZ       : EFXForm_2a<762, (outs gprc:$RT), (ins sperc:$RB),
199                                "efdctsiz $RT, $RB", IIC_FPDGeneral,
200                                [(set i32:$RT, (any_fp_to_sint f64:$RB))]>;
201
202def EFDCTUF        : EFXForm_2a<758, (outs sperc:$RT), (ins spe4rc:$RB),
203                                "efdctuf $RT, $RB", IIC_FPDGeneral, []>;
204
205def EFDCTUI        : EFXForm_2a<756, (outs gprc:$RT), (ins sperc:$RB),
206                                "efdctui $RT, $RB", IIC_FPDGeneral,
207                                []>;
208
209def EFDCTUIDZ      : EFXForm_2a<746, (outs gprc:$RT), (ins sperc:$RB),
210                                "efdctuidz $RT, $RB", IIC_FPDGeneral,
211                                []>;
212
213def EFDCTUIZ       : EFXForm_2a<760, (outs gprc:$RT), (ins sperc:$RB),
214                                "efdctuiz $RT, $RB", IIC_FPDGeneral,
215                                [(set i32:$RT, (any_fp_to_uint f64:$RB))]>;
216
217def EFDDIV         : EFXForm_1<745, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
218                               "efddiv $RT, $RA, $RB", IIC_FPDivD,
219                               [(set f64:$RT, (any_fdiv f64:$RA, f64:$RB))]>;
220
221def EFDMUL         : EFXForm_1<744, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
222                               "efdmul $RT, $RA, $RB", IIC_FPDGeneral,
223                               [(set f64:$RT, (any_fmul f64:$RA, f64:$RB))]>;
224
225def EFDNABS        : EFXForm_2<741, (outs sperc:$RT), (ins sperc:$RA),
226                               "efdnabs $RT, $RA", IIC_FPDGeneral,
227                               [(set f64:$RT, (fneg (fabs f64:$RA)))]>;
228
229def EFDNEG         : EFXForm_2<742, (outs sperc:$RT), (ins sperc:$RA),
230                               "efdneg $RT, $RA", IIC_FPDGeneral,
231                               [(set f64:$RT, (fneg f64:$RA))]>;
232
233def EFDSUB         : EFXForm_1<737, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
234                               "efdsub $RT, $RA, $RB", IIC_FPDGeneral,
235                               [(set f64:$RT, (any_fsub f64:$RA, f64:$RB))]>;
236
237let isCompare = 1 in {
238def EFDTSTEQ       : EFXForm_3<766, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
239                               "efdtsteq $crD, $RA, $RB", IIC_FPDGeneral>;
240def EFDTSTGT       : EFXForm_3<764, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
241                               "efdtstgt $crD, $RA, $RB", IIC_FPDGeneral>;
242def EFDTSTLT       : EFXForm_3<765, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
243                               "efdtstlt $crD, $RA, $RB", IIC_FPDGeneral>;
244}
245
246// Single-precision floating point
247def EFSABS         : EFXForm_2<708, (outs spe4rc:$RT), (ins spe4rc:$RA),
248                                "efsabs $RT, $RA", IIC_FPSGeneral,
249                                [(set f32:$RT, (fabs f32:$RA))]>;
250
251def EFSADD         : EFXForm_1<704, (outs spe4rc:$RT), (ins spe4rc:$RA, spe4rc:$RB),
252                                "efsadd $RT, $RA, $RB", IIC_FPAddSub,
253                                [(set f32:$RT, (any_fadd f32:$RA, f32:$RB))]>;
254
255def EFSCFD         : EFXForm_2a<719, (outs spe4rc:$RT), (ins sperc:$RB),
256                                "efscfd $RT, $RB", IIC_FPSGeneral,
257                                [(set f32:$RT, (any_fpround f64:$RB))]>;
258
259def EFSCFSF        : EFXForm_2a<723, (outs spe4rc:$RT), (ins spe4rc:$RB),
260                                "efscfsf $RT, $RB", IIC_FPSGeneral, []>;
261
262def EFSCFSI        : EFXForm_2a<721, (outs spe4rc:$RT), (ins gprc:$RB),
263                                "efscfsi $RT, $RB", IIC_FPSGeneral,
264                                [(set f32:$RT, (any_sint_to_fp i32:$RB))]>;
265
266def EFSCFUF        : EFXForm_2a<722, (outs spe4rc:$RT), (ins spe4rc:$RB),
267                                "efscfuf $RT, $RB", IIC_FPSGeneral, []>;
268
269def EFSCFUI        : EFXForm_2a<720, (outs spe4rc:$RT), (ins gprc:$RB),
270                                "efscfui $RT, $RB", IIC_FPSGeneral,
271                                [(set f32:$RT, (any_uint_to_fp i32:$RB))]>;
272
273let isCompare = 1 in {
274def EFSCMPEQ       : EFXForm_3<718, (outs crrc:$crD), (ins spe4rc:$RA, spe4rc:$RB),
275                               "efscmpeq $crD, $RA, $RB", IIC_FPCompare>;
276def EFSCMPGT       : EFXForm_3<716, (outs crrc:$crD), (ins spe4rc:$RA, spe4rc:$RB),
277                               "efscmpgt $crD, $RA, $RB", IIC_FPCompare>;
278def EFSCMPLT       : EFXForm_3<717, (outs crrc:$crD), (ins spe4rc:$RA, spe4rc:$RB),
279                               "efscmplt $crD, $RA, $RB", IIC_FPCompare>;
280}
281
282def EFSCTSF        : EFXForm_2a<727, (outs spe4rc:$RT), (ins spe4rc:$RB),
283                                "efsctsf $RT, $RB", IIC_FPSGeneral, []>;
284
285def EFSCTSI        : EFXForm_2a<725, (outs gprc:$RT), (ins spe4rc:$RB),
286                                "efsctsi $RT, $RB", IIC_FPSGeneral,
287                                []>;
288
289def EFSCTSIZ       : EFXForm_2a<730, (outs gprc:$RT), (ins spe4rc:$RB),
290                                "efsctsiz $RT, $RB", IIC_FPSGeneral,
291                                [(set i32:$RT, (any_fp_to_sint f32:$RB))]>;
292
293def EFSCTUF        : EFXForm_2a<726, (outs sperc:$RT), (ins spe4rc:$RB),
294                                "efsctuf $RT, $RB", IIC_FPSGeneral, []>;
295
296def EFSCTUI        : EFXForm_2a<724, (outs gprc:$RT), (ins spe4rc:$RB),
297                                "efsctui $RT, $RB", IIC_FPSGeneral,
298                                []>;
299
300def EFSCTUIZ       : EFXForm_2a<728, (outs gprc:$RT), (ins spe4rc:$RB),
301                                "efsctuiz $RT, $RB", IIC_FPSGeneral,
302                                [(set i32:$RT, (any_fp_to_uint f32:$RB))]>;
303
304def EFSDIV         : EFXForm_1<713, (outs spe4rc:$RT), (ins spe4rc:$RA, spe4rc:$RB),
305                               "efsdiv $RT, $RA, $RB", IIC_FPDivD,
306                               [(set f32:$RT, (any_fdiv f32:$RA, f32:$RB))]>;
307
308def EFSMUL         : EFXForm_1<712, (outs spe4rc:$RT), (ins spe4rc:$RA, spe4rc:$RB),
309                               "efsmul $RT, $RA, $RB", IIC_FPGeneral,
310                               [(set f32:$RT, (any_fmul f32:$RA, f32:$RB))]>;
311
312def EFSNABS        : EFXForm_2<709, (outs spe4rc:$RT), (ins spe4rc:$RA),
313                               "efsnabs $RT, $RA", IIC_FPGeneral,
314                               [(set f32:$RT, (fneg (fabs f32:$RA)))]>;
315
316def EFSNEG         : EFXForm_2<710, (outs spe4rc:$RT), (ins spe4rc:$RA),
317                               "efsneg $RT, $RA", IIC_FPGeneral,
318                               [(set f32:$RT, (fneg f32:$RA))]>;
319
320def EFSSUB         : EFXForm_1<705, (outs spe4rc:$RT), (ins spe4rc:$RA, spe4rc:$RB),
321                               "efssub $RT, $RA, $RB", IIC_FPSGeneral,
322                               [(set f32:$RT, (any_fsub f32:$RA, f32:$RB))]>;
323
324let isCompare = 1 in {
325def EFSTSTEQ       : EFXForm_3<734, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
326                               "efststeq $crD, $RA, $RB", IIC_FPCompare>;
327def EFSTSTGT       : EFXForm_3<732, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
328                               "efststgt $crD, $RA, $RB", IIC_FPCompare>;
329def EFSTSTLT       : EFXForm_3<733, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
330                               "efststlt $crD, $RA, $RB", IIC_FPCompare>;
331}
332
333// SPE Vector operations
334
335def EVABS          : EVXForm_2<520, (outs sperc:$RT), (ins sperc:$RA),
336                               "evabs $RT, $RA", IIC_VecGeneral,
337                               []>;
338
339def EVADDIW        : EVXForm_1<514, (outs sperc:$RT), (ins sperc:$RA, u5imm:$RB),
340                               "evaddiw $RT, $RB, $RA", IIC_VecGeneral, []>;
341def EVADDSMIAAW    : EVXForm_2<1225, (outs sperc:$RT), (ins sperc:$RA),
342                               "evaddsmiaaw $RT, $RA", IIC_VecComplex, []>;
343def EVADDSSIAAW    : EVXForm_2<1217, (outs sperc:$RT), (ins sperc:$RA),
344                               "evaddssiaaw $RT, $RA", IIC_VecComplex, []>;
345def EVADDUSIAAW    : EVXForm_2<1216, (outs sperc:$RT), (ins sperc:$RA),
346                               "evaddusiaaw $RT, $RA", IIC_VecComplex, []>;
347def EVADDUMIAAW    : EVXForm_2<1224, (outs sperc:$RT), (ins sperc:$RA),
348                               "evaddumiaaw $RT, $RA", IIC_VecComplex, []>;
349def EVADDW         : EVXForm_1<512, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
350                               "evaddw $RT, $RA, $RB", IIC_VecGeneral,
351                               []>;
352
353def EVAND          : EVXForm_1<529, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
354                               "evand $RT, $RA, $RB", IIC_VecGeneral,
355                               []>;
356def EVANDC         : EVXForm_1<530, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
357                               "evandc $RT, $RA, $RB", IIC_VecGeneral,
358                               []>;
359
360let isCompare = 1 in {
361def EVCMPEQ        : EVXForm_3<564, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
362                               "evcmpeq $crD, $RA, $RB", IIC_VecGeneral, []>;
363def EVCMPGTS       : EVXForm_3<561, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
364                               "evcmpgts $crD, $RA, $RB", IIC_VecGeneral, []>;
365def EVCMPGTU       : EVXForm_3<560, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
366                               "evcmpgtu $crD, $RA, $RB", IIC_VecGeneral, []>;
367def EVCMPLTS       : EVXForm_3<563, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
368                               "evcmplts $crD, $RA, $RB", IIC_VecGeneral, []>;
369def EVCMPLTU       : EVXForm_3<562, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
370                               "evcmpltu $crD, $RA, $RB", IIC_VecGeneral, []>;
371}
372
373def EVCNTLSW       : EVXForm_2<526, (outs sperc:$RT), (ins sperc:$RA),
374                               "evcntlsw $RT, $RA", IIC_VecGeneral, []>;
375def EVCNTLZW       : EVXForm_2<525, (outs sperc:$RT), (ins sperc:$RA),
376                               "evcntlzw $RT, $RA", IIC_VecGeneral,
377                               []>;
378
379def EVDIVWS        : EVXForm_1<1222, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
380                               "evdivws $RT, $RA, $RB", IIC_VecComplex,
381                               []>;
382def EVDIVWU        : EVXForm_1<1223, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
383                               "evdivwu $RT, $RA, $RB", IIC_VecComplex,
384                               []>;
385
386def EVEQV          : EVXForm_1<537, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
387                               "eveqv $RT, $RA, $RB", IIC_VecGeneral,
388                               []>;
389
390def EVEXTSB        : EVXForm_2<522, (outs sperc:$RT), (ins sperc:$RA),
391                               "evextsb $RT, $RA", IIC_VecGeneral,
392                               []>;
393def EVEXTSH        : EVXForm_2<523, (outs sperc:$RT), (ins sperc:$RA),
394                               "evextsh $RT, $RA", IIC_VecGeneral,
395                               []>;
396
397def EVFSABS        : EVXForm_2<644, (outs sperc:$RT), (ins sperc:$RA),
398                               "evfsabs $RT, $RA", IIC_VecGeneral,
399                               []>;
400def EVFSADD        : EVXForm_1<640, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
401                               "evfsadd $RT, $RA, $RB", IIC_VecComplex,
402                               []>;
403def EVFSCFSF       : EVXForm_2a<659, (outs sperc:$RT), (ins sperc:$RB),
404                                "evfscfsf $RT, $RB", IIC_VecComplex, []>;
405def EVFSCFSI       : EVXForm_2a<657, (outs sperc:$RT), (ins sperc:$RB),
406                                "evfscfsi $RT, $RB", IIC_VecComplex,
407                                []>;
408def EVFSCFUF       : EVXForm_2a<658, (outs sperc:$RT), (ins sperc:$RB),
409                                "evfscfuf $RT, $RB", IIC_VecComplex, []>;
410def EVFSCFUI       : EVXForm_2a<650, (outs sperc:$RT), (ins sperc:$RB),
411                                "evfscfui $RT, $RB", IIC_VecComplex,
412                                []>;
413let isCompare = 1 in {
414def EVFSCMPEQ      : EVXForm_3<654, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
415                               "evfscmpeq $crD, $RA, $RB", IIC_FPSGeneral, []>;
416def EVFSCMPGT      : EVXForm_3<652, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
417                               "evfscmpgt $crD, $RA, $RB", IIC_FPSGeneral, []>;
418def EVFSCMPLT      : EVXForm_3<653, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
419                               "evfscmplt $crD, $RA, $RB", IIC_FPSGeneral, []>;
420}
421
422def EVFSCTSF        : EVXForm_2a<663, (outs sperc:$RT), (ins sperc:$RB),
423                                "evfsctsf $RT, $RB", IIC_VecComplex, []>;
424def EVFSCTSI        : EVXForm_2a<661, (outs sperc:$RT), (ins sperc:$RB),
425                                "evfsctsi $RT, $RB", IIC_VecComplex,
426                                []>;
427def EVFSCTSIZ       : EVXForm_2a<666, (outs sperc:$RT), (ins sperc:$RB),
428                                "evfsctsiz $RT, $RB", IIC_VecComplex,
429                                []>;
430def EVFSCTUF        : EVXForm_2a<662, (outs sperc:$RT), (ins sperc:$RB),
431                                "evfsctsf $RT, $RB", IIC_VecComplex, []>;
432def EVFSCTUI        : EVXForm_2a<660, (outs sperc:$RT), (ins sperc:$RB),
433                                "evfsctui $RT, $RB", IIC_VecComplex,
434                                []>;
435def EVFSCTUIZ       : EVXForm_2a<664, (outs sperc:$RT), (ins sperc:$RB),
436                                "evfsctsiz $RT, $RB", IIC_VecComplex,
437                                []>;
438def EVFSDIV         : EVXForm_1<649, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
439                               "evfsdiv $RT, $RA, $RB", IIC_FPDivD,
440                               []>;
441def EVFSMUL         : EVXForm_1<648, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
442                               "evfsmul $RT, $RA, $RB", IIC_VecComplex,
443                               []>;
444def EVFSNABS        : EVXForm_2<645, (outs sperc:$RT), (ins sperc:$RA),
445                               "evfsnabs $RT, $RA", IIC_VecGeneral,
446                               []>;
447def EVFSNEG         : EVXForm_2<646, (outs sperc:$RT), (ins sperc:$RA),
448                               "evfsneg $RT, $RA", IIC_VecGeneral,
449                               []>;
450def EVFSSUB         : EVXForm_1<641, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
451                               "evfssub $RT, $RA, $RB", IIC_VecComplex,
452                               []>;
453
454let isCompare = 1 in {
455def EVFSTSTEQ       : EVXForm_3<670, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
456                               "evfststeq $crD, $RA, $RB", IIC_VecGeneral, []>;
457def EVFSTSTGT       : EVXForm_3<668, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
458                               "evfststgt $crD, $RA, $RB", IIC_VecGeneral, []>;
459def EVFSTSTLT       : EVXForm_3<669, (outs crrc:$crD), (ins sperc:$RA, sperc:$RB),
460                               "evfststlt $crD, $RA, $RB", IIC_VecGeneral, []>;
461}
462
463def EVLDD          : EVXForm_D<769, (outs sperc:$RT), (ins spe8dis:$dst),
464                               "evldd $RT, $dst", IIC_LdStLoad,
465                               [(set f64:$RT, (load iaddr:$dst))]>;
466def EVLDDX         : EVXForm_1<768, (outs sperc:$RT), (ins memrr:$src),
467                               "evlddx $RT, $src", IIC_LdStLoad,
468                               [(set f64:$RT, (load xaddr:$src))]>;
469def EVLDH          : EVXForm_D<773, (outs sperc:$RT), (ins spe8dis:$dst),
470                               "evldh $RT, $dst", IIC_LdStLoad, []>;
471def EVLDHX         : EVXForm_1<772, (outs sperc:$RT), (ins memrr:$src),
472                               "evldhx $RT, $src", IIC_LdStLoad, []>;
473def EVLDW          : EVXForm_D<771, (outs sperc:$RT), (ins spe8dis:$dst),
474                               "evldw $RT, $dst", IIC_LdStLoad,
475                               []>;
476def EVLDWX         : EVXForm_1<770, (outs sperc:$RT), (ins memrr:$src),
477                               "evldwx $RT, $src", IIC_LdStLoad,
478                               []>;
479def EVLHHESPLAT    : EVXForm_D<777, (outs sperc:$RT), (ins spe2dis:$dst),
480                               "evlhhesplat $RT, $dst", IIC_LdStLoad, []>;
481def EVLHHESPLATX   : EVXForm_1<776, (outs sperc:$RT), (ins memrr:$src),
482                               "evlhhesplatx $RT, $src", IIC_LdStLoad, []>;
483def EVLHHOUSPLAT   : EVXForm_D<781, (outs sperc:$RT), (ins spe2dis:$dst),
484                               "evlhhousplat $RT, $dst", IIC_LdStLoad, []>;
485def EVLHHOUSPLATX  : EVXForm_1<780, (outs sperc:$RT), (ins memrr:$src),
486                               "evlhhousplatx $RT, $src", IIC_LdStLoad, []>;
487def EVLHHOSSPLAT   : EVXForm_D<783, (outs sperc:$RT), (ins spe2dis:$dst),
488                               "evlhhossplat $RT, $dst", IIC_LdStLoad, []>;
489def EVLHHOSSPLATX  : EVXForm_1<782, (outs sperc:$RT), (ins memrr:$src),
490                               "evlhhossplatx $RT, $src", IIC_LdStLoad, []>;
491def EVLWHE         : EVXForm_D<785, (outs sperc:$RT), (ins spe4dis:$dst),
492                               "evlwhe $RT, $dst", IIC_LdStLoad, []>;
493def EVLWHEX        : EVXForm_1<784, (outs sperc:$RT), (ins memrr:$src),
494                               "evlwhex $RT, $src", IIC_LdStLoad, []>;
495def EVLWHOS        : EVXForm_D<791, (outs sperc:$RT), (ins spe4dis:$dst),
496                               "evlwhos $RT, $dst", IIC_LdStLoad, []>;
497def EVLWHOSX       : EVXForm_1<790, (outs sperc:$RT), (ins memrr:$src),
498                               "evlwhosx $RT, $src", IIC_LdStLoad, []>;
499def EVLWHOU        : EVXForm_D<789, (outs sperc:$RT), (ins spe4dis:$dst),
500                               "evlwhou $RT, $dst", IIC_LdStLoad, []>;
501def EVLWHOUX       : EVXForm_1<788, (outs sperc:$RT), (ins memrr:$src),
502                               "evlwhoux $RT, $src", IIC_LdStLoad, []>;
503def EVLWHSPLAT     : EVXForm_D<797, (outs sperc:$RT), (ins spe4dis:$dst),
504                               "evlwhsplat $RT, $dst", IIC_LdStLoad, []>;
505def EVLWHSPLATX    : EVXForm_1<796, (outs sperc:$RT), (ins memrr:$src),
506                               "evlwhsplatx $RT, $src", IIC_LdStLoad, []>;
507def EVLWWSPLAT     : EVXForm_D<793, (outs sperc:$RT), (ins spe4dis:$dst),
508                               "evlwwsplat $RT, $dst", IIC_LdStLoad, []>;
509def EVLWWSPLATX    : EVXForm_1<792, (outs sperc:$RT), (ins memrr:$src),
510                               "evlwwsplatx $RT, $src", IIC_LdStLoad, []>;
511
512def EVMERGEHI      : EVXForm_1<556, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
513                               "evmergehi $RT, $RA, $RB", IIC_VecGeneral, []>;
514def EVMERGELO      : EVXForm_1<557, (outs sperc:$RT), (ins gprc:$RA, gprc:$RB),
515                               "evmergelo $RT, $RA, $RB", IIC_VecGeneral, []>;
516def EVMERGEHILO    : EVXForm_1<558, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
517                               "evmergehilo $RT, $RA, $RB", IIC_VecGeneral, []>;
518def EVMERGELOHI    : EVXForm_1<559, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
519                               "evmergelohi $RT, $RA, $RB", IIC_VecGeneral, []>;
520
521def EVMHEGSMFAA    : EVXForm_1<1323, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
522                               "evmhegsmfaa $RT, $RA, $RB", IIC_VecComplex, []>;
523def EVMHEGSMFAN    : EVXForm_1<1451, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
524                               "evmhegsmfan $RT, $RA, $RB", IIC_VecComplex, []>;
525def EVMHEGSMIAA    : EVXForm_1<1321, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
526                               "evmhegsmiaa $RT, $RA, $RB", IIC_VecComplex, []>;
527def EVMHEGSMIAN    : EVXForm_1<1449, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
528                               "evmhegsmian $RT, $RA, $RB", IIC_VecComplex, []>;
529def EVMHEGUMIAA    : EVXForm_1<1320, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
530                               "evmhegumiaa $RT, $RA, $RB", IIC_VecComplex, []>;
531def EVMHEGUMIAN    : EVXForm_1<1448, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
532                               "evmhegumian $RT, $RA, $RB", IIC_VecComplex, []>;
533
534def EVMHESMF       : EVXForm_1<1035, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
535                               "evmhesmf $RT, $RA, $RB", IIC_VecComplex, []>;
536def EVMHESMFA      : EVXForm_1<1067, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
537                               "evmhesmfa $RT, $RA, $RB", IIC_VecComplex, []>;
538def EVMHESMFAAW    : EVXForm_1<1291, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
539                               "evmhesmfaaw $RT, $RA, $RB", IIC_VecComplex, []>;
540def EVMHESMFANW    : EVXForm_1<1419, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
541                               "evmhesmfanw $RT, $RA, $RB", IIC_VecComplex, []>;
542def EVMHESMI       : EVXForm_1<1033, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
543                               "evmhesmi $RT, $RA, $RB", IIC_VecComplex, []>;
544def EVMHESMIA      : EVXForm_1<1065, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
545                               "evmhesmia $RT, $RA, $RB", IIC_VecComplex, []>;
546def EVMHESMIAAW    : EVXForm_1<1289, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
547                               "evmhesmiaaw $RT, $RA, $RB", IIC_VecComplex, []>;
548def EVMHESMIANW    : EVXForm_1<1417, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
549                               "evmhesmianw $RT, $RA, $RB", IIC_VecComplex, []>;
550def EVMHESSF       : EVXForm_1<1027, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
551                               "evmhessf $RT, $RA, $RB", IIC_VecComplex, []>;
552def EVMHESSFA      : EVXForm_1<1059, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
553                               "evmhessfa $RT, $RA, $RB", IIC_VecComplex, []>;
554def EVMHESSFAAW    : EVXForm_1<1283, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
555                               "evmhessfaaw $RT, $RA, $RB", IIC_VecComplex, []>;
556def EVMHESSFANW    : EVXForm_1<1411, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
557                               "evmhessfanw $RT, $RA, $RB", IIC_VecComplex, []>;
558def EVMHESSIAAW    : EVXForm_1<1281, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
559                               "evmhessiaaw $RT, $RA, $RB", IIC_VecComplex, []>;
560def EVMHESSIANW    : EVXForm_1<1409, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
561                               "evmhessianw $RT, $RA, $RB", IIC_VecComplex, []>;
562def EVMHEUMI       : EVXForm_1<1032, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
563                               "evmheumi $RT, $RA, $RB", IIC_VecComplex, []>;
564def EVMHEUMIA      : EVXForm_1<1064, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
565                               "evmheumia $RT, $RA, $RB", IIC_VecComplex, []>;
566def EVMHEUMIAAW    : EVXForm_1<1288, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
567                               "evmheumiaaw $RT, $RA, $RB", IIC_VecComplex, []>;
568def EVMHEUMIANW    : EVXForm_1<1416, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
569                               "evmheumianw $RT, $RA, $RB", IIC_VecComplex, []>;
570def EVMHEUSIAAW    : EVXForm_1<1280, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
571                               "evmheusiaaw $RT, $RA, $RB", IIC_VecComplex, []>;
572def EVMHEUSIANW    : EVXForm_1<1408, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
573                               "evmheusianw $RT, $RA, $RB", IIC_VecComplex, []>;
574def EVMHOGSMFAA    : EVXForm_1<1327, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
575                               "evmhogsmfaa $RT, $RA, $RB", IIC_VecComplex, []>;
576def EVMHOGSMFAN    : EVXForm_1<1455, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
577                               "evmhogsmfan $RT, $RA, $RB", IIC_VecComplex, []>;
578def EVMHOGSMIAA    : EVXForm_1<1325, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
579                               "evmhogsmiaa $RT, $RA, $RB", IIC_VecComplex, []>;
580def EVMHOGSMIAN    : EVXForm_1<1453, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
581                               "evmhogsmian $RT, $RA, $RB", IIC_VecComplex, []>;
582def EVMHOGUMIAA    : EVXForm_1<1324, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
583                               "evmhogumiaa $RT, $RA, $RB", IIC_VecComplex, []>;
584def EVMHOGUMIAN    : EVXForm_1<1452, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
585                               "evmhogumian $RT, $RA, $RB", IIC_VecComplex, []>;
586def EVMHOSMF       : EVXForm_1<1039, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
587                               "evmhosmf $RT, $RA, $RB", IIC_VecComplex, []>;
588def EVMHOSMFA      : EVXForm_1<1071, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
589                               "evmhosmfa $RT, $RA, $RB", IIC_VecComplex, []>;
590def EVMHOSMFAAW    : EVXForm_1<1295, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
591                               "evmhosmfaaw $RT, $RA, $RB", IIC_VecComplex, []>;
592def EVMHOSMFANW    : EVXForm_1<1423, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
593                               "evmhosmfanw $RT, $RA, $RB", IIC_VecComplex, []>;
594def EVMHOSMI       : EVXForm_1<1037, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
595                               "evmhosmi $RT, $RA, $RB", IIC_VecComplex, []>;
596def EVMHOSMIA      : EVXForm_1<1069, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
597                               "evmhosmia $RT, $RA, $RB", IIC_VecComplex, []>;
598def EVMHOSMIAAW    : EVXForm_1<1293, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
599                               "evmhosmiaaw $RT, $RA, $RB", IIC_VecComplex, []>;
600def EVMHOSMIANW    : EVXForm_1<1421, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
601                               "evmhosmianw $RT, $RA, $RB", IIC_VecComplex, []>;
602def EVMHOSSF       : EVXForm_1<1031, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
603                               "evmhossf $RT, $RA, $RB", IIC_VecComplex, []>;
604def EVMHOSSFA      : EVXForm_1<1063, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
605                               "evmhossfa $RT, $RA, $RB", IIC_VecComplex, []>;
606def EVMHOSSFAAW    : EVXForm_1<1287, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
607                               "evmhossfaaw $RT, $RA, $RB", IIC_VecComplex, []>;
608def EVMHOSSFANW    : EVXForm_1<1415, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
609                               "evmhossfanw $RT, $RA, $RB", IIC_VecComplex, []>;
610def EVMHOSSIAAW    : EVXForm_1<1285, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
611                               "evmhossiaaw $RT, $RA, $RB", IIC_VecComplex, []>;
612def EVMHOSSIANW    : EVXForm_1<1413, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
613                               "evmhossianw $RT, $RA, $RB", IIC_VecComplex, []>;
614def EVMHOUMI       : EVXForm_1<1036, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
615                               "evmhoumi $RT, $RA, $RB", IIC_VecComplex, []>;
616def EVMHOUMIA      : EVXForm_1<1068, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
617                               "evmhoumia $RT, $RA, $RB", IIC_VecComplex, []>;
618def EVMHOUMIAAW    : EVXForm_1<1292, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
619                               "evmhoumiaaw $RT, $RA, $RB", IIC_VecComplex, []>;
620def EVMHOUMIANW    : EVXForm_1<1420, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
621                               "evmhoumianw $RT, $RA, $RB", IIC_VecComplex, []>;
622def EVMHOUSIAAW    : EVXForm_1<1284, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
623                               "evmhousiaaw $RT, $RA, $RB", IIC_VecComplex, []>;
624def EVMHOUSIANW    : EVXForm_1<1412, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
625                               "evmhousianw $RT, $RA, $RB", IIC_VecComplex, []>;
626
627def EVMRA          : EVXForm_2<1220, (outs sperc:$RT), (ins sperc:$RA),
628                               "evmra $RT, $RA", IIC_VecComplex, []>;
629
630def EVMWHSMF       : EVXForm_1<1103, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
631                               "evmwhsmf $RT, $RA, $RB", IIC_VecComplex, []>;
632def EVMWHSMFA      : EVXForm_1<1135, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
633                               "evmwhsmfa $RT, $RA, $RB", IIC_VecComplex, []>;
634def EVMWHSMI       : EVXForm_1<1101, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
635                               "evmwhsmi $RT, $RA, $RB", IIC_VecComplex, []>;
636def EVMWHSMIA      : EVXForm_1<1133, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
637                               "evmwhsmia $RT, $RA, $RB", IIC_VecComplex, []>;
638def EVMWHSSF       : EVXForm_1<1095, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
639                               "evmwhssf $RT, $RA, $RB", IIC_VecComplex, []>;
640def EVMWHSSFA      : EVXForm_1<1127, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
641                               "evmwhssfa $RT, $RA, $RB", IIC_VecComplex, []>;
642def EVMWHUMI       : EVXForm_1<1100, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
643                               "evmwhumi $RT, $RA, $RB", IIC_VecComplex, []>;
644def EVMWHUMIA      : EVXForm_1<1132, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
645                               "evmwhumia $RT, $RA, $RB", IIC_VecComplex, []>;
646def EVMWLSMIAAW    : EVXForm_1<1353, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
647                               "evmwlsmiaaw $RT, $RA, $RB", IIC_VecComplex, []>;
648def EVMWLSMIANW    : EVXForm_1<1481, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
649                               "evmwlsmianw $RT, $RA, $RB", IIC_VecComplex, []>;
650def EVMWLSSIAAW    : EVXForm_1<1345, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
651                               "evmwlssiaaw $RT, $RA, $RB", IIC_VecComplex, []>;
652def EVMWLSSIANW    : EVXForm_1<1473, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
653                               "evmwlssianw $RT, $RA, $RB", IIC_VecComplex, []>;
654def EVMWLUMI       : EVXForm_1<1096, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
655                               "evmwlumi $RT, $RA, $RB", IIC_VecComplex,
656                               []>;
657def EVMWLUMIA      : EVXForm_1<1128, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
658                               "evmwlumia $RT, $RA, $RB", IIC_VecComplex, []>;
659def EVMWLUMIAAW    : EVXForm_1<1352, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
660                               "evmwlumiaaw $RT, $RA, $RB", IIC_VecComplex, []>;
661def EVMWLUMIANW    : EVXForm_1<1480, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
662                               "evmwlumianw $RT, $RA, $RB", IIC_VecComplex, []>;
663def EVMWLUSIAAW    : EVXForm_1<1344, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
664                               "evmwlusiaaw $RT, $RA, $RB", IIC_VecComplex, []>;
665def EVMWLUSIANW    : EVXForm_1<1472, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
666                               "evmwlusianw $RT, $RA, $RB", IIC_VecComplex, []>;
667def EVMWSMF        : EVXForm_1<1115, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
668                               "evmwsmf $RT, $RA, $RB", IIC_VecComplex, []>;
669def EVMWSMFA       : EVXForm_1<1147, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
670                               "evmwsmfa $RT, $RA, $RB", IIC_VecComplex, []>;
671def EVMWSMFAA      : EVXForm_1<1371, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
672                               "evmwsmfaa $RT, $RA, $RB", IIC_VecComplex, []>;
673def EVMWSMFAN      : EVXForm_1<1499, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
674                               "evmwsmfan $RT, $RA, $RB", IIC_VecComplex, []>;
675def EVMWSMI        : EVXForm_1<1113, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
676                               "evmwsmi $RT, $RA, $RB", IIC_VecComplex, []>;
677def EVMWSMIA       : EVXForm_1<1145, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
678                               "evmwsmia $RT, $RA, $RB", IIC_VecComplex, []>;
679def EVMWSMIAA      : EVXForm_1<1369, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
680                               "evmwsmiaa $RT, $RA, $RB", IIC_VecComplex, []>;
681def EVMWSMIAN      : EVXForm_1<1497, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
682                               "evmwsmian $RT, $RA, $RB", IIC_VecComplex, []>;
683def EVMWSSF        : EVXForm_1<1107, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
684                               "evmwssf $RT, $RA, $RB", IIC_VecComplex, []>;
685def EVMWSSFA       : EVXForm_1<1139, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
686                               "evmwssfa $RT, $RA, $RB", IIC_VecComplex, []>;
687def EVMWSSFAA      : EVXForm_1<1363, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
688                               "evmwssfaa $RT, $RA, $RB", IIC_VecComplex, []>;
689def EVMWSSFAN      : EVXForm_1<1491, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
690                               "evmwssfan $RT, $RA, $RB", IIC_VecComplex, []>;
691def EVMWUMI        : EVXForm_1<1112, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
692                               "evmwumi $RT, $RA, $RB", IIC_VecComplex, []>;
693def EVMWUMIA       : EVXForm_1<1144, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
694                               "evmwumia $RT, $RA, $RB", IIC_VecComplex, []>;
695def EVMWUMIAA      : EVXForm_1<1368, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
696                               "evmwumiaa $RT, $RA, $RB", IIC_VecComplex, []>;
697def EVMWUMIAN      : EVXForm_1<1496, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
698                               "evmwumian $RT, $RA, $RB", IIC_VecComplex, []>;
699
700
701def EVNAND         : EVXForm_1<542, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
702                               "evnand $RT, $RA, $RB", IIC_VecGeneral,
703                               []>;
704
705def EVNEG          : EVXForm_2<521, (outs sperc:$RT), (ins sperc:$RA),
706                               "evneg $RT, $RA", IIC_VecGeneral,
707                               []>;
708
709def EVNOR          : EVXForm_1<536, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
710                               "evnor $RT, $RA, $RB", IIC_VecGeneral,
711                               []>;
712def EVOR           : EVXForm_1<535, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
713                               "evor $RT, $RA, $RB", IIC_VecGeneral,
714                               []>;
715def EVORC          : EVXForm_1<539, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
716                               "evorc $RT, $RA, $RB", IIC_VecGeneral,
717                               []>;
718
719def EVRLWI         : EVXForm_1<554, (outs sperc:$RT), (ins sperc:$RA, u5imm:$RB),
720                               "evrlwi $RT, $RA, $RB", IIC_VecGeneral, []>;
721def EVRLW          : EVXForm_1<552, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
722                               "evrlw $RT, $RA, $RB", IIC_VecGeneral,
723                               []>;
724
725def EVRNDW         : EVXForm_2<524, (outs sperc:$RT), (ins sperc:$RA),
726                               "evrndw $RT, $RA", IIC_VecGeneral, []>;
727
728def EVSEL          : EVXForm_4<79, (outs sperc:$RT),
729                               (ins sperc:$RA, sperc:$RB, crrc:$crD),
730                               "evsel crD,$RT,$RA,$RB", IIC_VecGeneral, []>;
731
732def EVSLWI         : EVXForm_1<550, (outs sperc:$RT), (ins sperc:$RA, u5imm:$RB),
733                               "evslwi $RT, $RA, $RB", IIC_VecGeneral, []>;
734def EVSLW          : EVXForm_1<548, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
735                               "evslw $RT, $RA, $RB", IIC_VecGeneral,
736                               []>;
737
738def EVSPLATFI      : EVXForm_2<555, (outs sperc:$RT), (ins s5imm:$RA),
739                               "evsplatfi $RT, $RA", IIC_VecGeneral, []>;
740def EVSPLATI       : EVXForm_2<553, (outs sperc:$RT), (ins s5imm:$RA),
741                               "evsplati $RT, $RA", IIC_VecGeneral, []>;
742
743def EVSRWIS        : EVXForm_1<547, (outs sperc:$RT), (ins sperc:$RA, u5imm:$RB),
744                               "evsrwis $RT, $RA, $RB", IIC_VecGeneral, []>;
745def EVSRWIU        : EVXForm_1<546, (outs sperc:$RT), (ins sperc:$RA, u5imm:$RB),
746                               "evsrwiu $RT, $RA, $RB", IIC_VecGeneral, []>;
747def EVSRWS         : EVXForm_1<545, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
748                               "evsrws $RT, $RA, $RB", IIC_VecGeneral,
749                               []>;
750def EVSRWU         : EVXForm_1<544, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
751                               "evsrwu $RT, $RA, $RB", IIC_VecGeneral,
752                               []>;
753
754def EVSTDD         : EVXForm_D<801, (outs), (ins sperc:$RT, spe8dis:$dst),
755                               "evstdd $RT, $dst", IIC_LdStStore,
756                               [(store f64:$RT, iaddr:$dst)]>;
757def EVSTDDX        : EVXForm_1<800, (outs), (ins sperc:$RT, memrr:$dst),
758                               "evstddx $RT, $dst", IIC_LdStStore,
759                               [(store f64:$RT, xaddr:$dst)]>;
760def EVSTDH         : EVXForm_D<805, (outs), (ins sperc:$RT, spe8dis:$dst),
761                               "evstdh $RT, $dst", IIC_LdStStore, []>;
762def EVSTDHX        : EVXForm_1<804, (outs), (ins sperc:$RT, memrr:$dst),
763                               "evstdhx $RT, $dst", IIC_LdStStore, []>;
764def EVSTDW         : EVXForm_D<803, (outs), (ins sperc:$RT, spe8dis:$dst),
765                               "evstdw $RT, $dst", IIC_LdStStore,
766                               []>;
767def EVSTDWX        : EVXForm_1<802, (outs), (ins sperc:$RT, memrr:$dst),
768                               "evstdwx $RT, $dst", IIC_LdStStore,
769                               []>;
770def EVSTWHE        : EVXForm_D<817, (outs), (ins sperc:$RT, spe4dis:$dst),
771                               "evstwhe $RT, $dst", IIC_LdStStore, []>;
772def EVSTWHEX       : EVXForm_1<816, (outs), (ins sperc:$RT, memrr:$dst),
773                               "evstwhex $RT, $dst", IIC_LdStStore, []>;
774def EVSTWHO        : EVXForm_D<821, (outs), (ins sperc:$RT, spe4dis:$dst),
775                               "evstwho $RT, $dst", IIC_LdStStore, []>;
776def EVSTWHOX       : EVXForm_1<820, (outs), (ins sperc:$RT, memrr:$dst),
777                               "evstwhox $RT, $dst", IIC_LdStStore, []>;
778def EVSTWWE        : EVXForm_D<825, (outs), (ins sperc:$RT, spe4dis:$dst),
779                               "evstwwe $RT, $dst", IIC_LdStStore, []>;
780def EVSTWWEX       : EVXForm_1<824, (outs), (ins sperc:$RT, memrr:$dst),
781                               "evstwwex $RT, $dst", IIC_LdStStore, []>;
782def EVSTWWO        : EVXForm_D<829, (outs), (ins sperc:$RT, spe4dis:$dst),
783                               "evstwwo $RT, $dst", IIC_LdStStore, []>;
784def EVSTWWOX       : EVXForm_1<828, (outs), (ins sperc:$RT, memrr:$dst),
785                               "evstwwox $RT, $dst", IIC_LdStStore, []>;
786
787def EVSUBFSSIAAW   : EVXForm_2<1219, (outs sperc:$RT), (ins sperc:$RA),
788                               "evsubfssiaaw $RT, $RA", IIC_VecComplex, []>;
789def EVSUBFSMIAAW   : EVXForm_2<1227, (outs sperc:$RT), (ins sperc:$RA),
790                               "evsubfsmiaaw $RT, $RA", IIC_VecComplex, []>;
791def EVSUBFUMIAAW   : EVXForm_2<1226, (outs sperc:$RT), (ins sperc:$RA),
792                               "evsubfumiaaw $RT, $RA", IIC_VecComplex, []>;
793def EVSUBFUSIAAW   : EVXForm_2<1218, (outs sperc:$RT), (ins sperc:$RA),
794                               "evsubfusiaaw $RT, $RA", IIC_VecComplex, []>;
795def EVSUBFW        : EVXForm_1<516, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
796                               "evsubfw $RT, $RA, $RB", IIC_VecGeneral,
797                               []>;
798def EVSUBIFW       : EVXForm_1<518, (outs sperc:$RT), (ins u5imm:$RA, sperc:$RB),
799                               "evsubifw $RT, $RA, $RB", IIC_VecGeneral, []>;
800def EVXOR          : EVXForm_1<534, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
801                               "evxor $RT, $RA, $RB", IIC_VecGeneral,
802                               []>;
803
804let isAsmParserOnly = 1 in {
805// Identical to the integer Load/Stores, but to handle floats
806def SPELWZ        : DForm_1<32, (outs spe4rc:$rD), (ins memri:$src),
807                            "lwz $rD, $src", IIC_LdStLoad,
808                            [(set f32:$rD, (load iaddr:$src))]>;
809def SPELWZX       : XForm_1<31,  23, (outs spe4rc:$rD), (ins memrr:$src),
810                            "lwzx $rD, $src", IIC_LdStLoad,
811                            [(set f32:$rD, (load xaddr:$src))]>;
812def SPESTW        : DForm_1<36, (outs), (ins spe4rc:$rS, memri:$src),
813                            "stw $rS, $src", IIC_LdStStore,
814                            [(store f32:$rS, iaddr:$src)]>;
815def SPESTWX       : XForm_8<31, 151, (outs), (ins spe4rc:$rS, memrr:$dst),
816                           "stwx $rS, $dst", IIC_LdStStore,
817                           [(store f32:$rS, xaddr:$dst)]>;
818}
819
820} // HasSPE
821
822let Predicates = [HasSPE] in {
823def SELECT_CC_SPE4 : PPCCustomInserterPseudo<(outs spe4rc:$dst),
824                            (ins crrc:$cond, spe4rc:$T, spe4rc:$F,
825                            i32imm:$BROPC), "#SELECT_CC_SPE4",
826                            []>;
827def SELECT_CC_SPE  : PPCCustomInserterPseudo<(outs sperc:$dst),
828                            (ins crrc:$cond, sperc:$T, sperc:$F, i32imm:$BROPC),
829                            "#SELECT_CC_SPE",
830                            []>;
831def SELECT_SPE4  : PPCCustomInserterPseudo<(outs spe4rc:$dst), (ins crbitrc:$cond,
832                          spe4rc:$T, spe4rc:$F), "#SELECT_SPE4",
833                          [(set f32:$dst, (select i1:$cond, f32:$T, f32:$F))]>;
834def SELECT_SPE   : PPCCustomInserterPseudo<(outs sperc:$dst), (ins crbitrc:$cond,
835                          sperc:$T, sperc:$F), "#SELECT_SPE",
836                          [(set f64:$dst, (select i1:$cond, f64:$T, f64:$F))]>;
837
838def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETLT)),
839          (SELECT_SPE4 (CRANDC $lhs, $rhs), $tval, $fval)>;
840def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETULT)),
841          (SELECT_SPE4 (CRANDC $rhs, $lhs), $tval, $fval)>;
842def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETLE)),
843          (SELECT_SPE4 (CRORC  $lhs, $rhs), $tval, $fval)>;
844def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETULE)),
845          (SELECT_SPE4 (CRORC  $rhs, $lhs), $tval, $fval)>;
846def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETEQ)),
847          (SELECT_SPE4 (CREQV $lhs, $rhs), $tval, $fval)>;
848def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETGE)),
849          (SELECT_SPE4 (CRORC  $rhs, $lhs), $tval, $fval)>;
850def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETUGE)),
851          (SELECT_SPE4 (CRORC  $lhs, $rhs), $tval, $fval)>;
852def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETGT)),
853          (SELECT_SPE4 (CRANDC $rhs, $lhs), $tval, $fval)>;
854def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETUGT)),
855          (SELECT_SPE4 (CRANDC $lhs, $rhs), $tval, $fval)>;
856def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETNE)),
857          (SELECT_SPE4 (CRXOR $lhs, $rhs), $tval, $fval)>;
858
859def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETLT)),
860          (SELECT_SPE (CRANDC $lhs, $rhs), $tval, $fval)>;
861def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETULT)),
862          (SELECT_SPE (CRANDC $rhs, $lhs), $tval, $fval)>;
863def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETLE)),
864          (SELECT_SPE (CRORC  $lhs, $rhs), $tval, $fval)>;
865def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETULE)),
866          (SELECT_SPE (CRORC  $rhs, $lhs), $tval, $fval)>;
867def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETEQ)),
868          (SELECT_SPE (CREQV $lhs, $rhs), $tval, $fval)>;
869def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETGE)),
870          (SELECT_SPE (CRORC  $rhs, $lhs), $tval, $fval)>;
871def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETUGE)),
872          (SELECT_SPE (CRORC  $lhs, $rhs), $tval, $fval)>;
873def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETGT)),
874          (SELECT_SPE (CRANDC $rhs, $lhs), $tval, $fval)>;
875def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETUGT)),
876          (SELECT_SPE (CRANDC $lhs, $rhs), $tval, $fval)>;
877def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETNE)),
878          (SELECT_SPE (CRXOR $lhs, $rhs), $tval, $fval)>;
879
880
881def : Pat<(f64 (PPCbuild_spe64 i32:$rB, i32:$rA)),
882          (f64 (COPY_TO_REGCLASS (EVMERGELO $rA, $rB), SPERC))>;
883
884def : Pat<(i32 (PPCextract_spe f64:$rA, 1)),
885          (i32 (EXTRACT_SUBREG (EVMERGEHI $rA, $rA), sub_32))>;
886def : Pat<(i32 (PPCextract_spe f64:$rA, 0)),
887          (i32 (EXTRACT_SUBREG $rA, sub_32))>;
888
889}
890