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