[mips][msa] Added support for matching bsel and bseli from normal IR (i.e. not intrin...
[oota-llvm.git] / lib / Target / Mips / MipsMSAInstrInfo.td
1 //===- MipsMSAInstrInfo.td - MSA ASE instructions -*- tablegen ------------*-=//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file describes Mips MSA ASE instructions.
11 //
12 //===----------------------------------------------------------------------===//
13
14 def SDT_MipsSplat : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisInt<1>]>;
15 def SDT_MipsVecCond : SDTypeProfile<1, 1, [SDTCisInt<0>, SDTCisVec<1>]>;
16 def SDT_VSetCC : SDTypeProfile<1, 3, [SDTCisInt<0>,
17                                       SDTCisInt<1>,
18                                       SDTCisSameAs<1, 2>,
19                                       SDTCisVT<3, OtherVT>]>;
20 def SDT_VFSetCC : SDTypeProfile<1, 3, [SDTCisInt<0>,
21                                        SDTCisFP<1>,
22                                        SDTCisSameAs<1, 2>,
23                                        SDTCisVT<3, OtherVT>]>;
24
25 def MipsVAllNonZero : SDNode<"MipsISD::VALL_NONZERO", SDT_MipsVecCond>;
26 def MipsVAnyNonZero : SDNode<"MipsISD::VANY_NONZERO", SDT_MipsVecCond>;
27 def MipsVAllZero : SDNode<"MipsISD::VALL_ZERO", SDT_MipsVecCond>;
28 def MipsVAnyZero : SDNode<"MipsISD::VANY_ZERO", SDT_MipsVecCond>;
29 def MipsVSplat  : SDNode<"MipsISD::VSPLAT", SDT_MipsSplat>;
30 def MipsVSplatD : SDNode<"MipsISD::VSPLATD", SDT_MipsSplat>;
31 def MipsVNOR : SDNode<"MipsISD::VNOR", SDTIntBinOp,
32                       [SDNPCommutative, SDNPAssociative]>;
33
34 def vsetcc : SDNode<"ISD::SETCC", SDT_VSetCC>;
35 def vfsetcc : SDNode<"ISD::SETCC", SDT_VFSetCC>;
36
37 def MipsVExtractSExt : SDNode<"MipsISD::VEXTRACT_SEXT_ELT",
38     SDTypeProfile<1, 3, [SDTCisPtrTy<2>]>, []>;
39 def MipsVExtractZExt : SDNode<"MipsISD::VEXTRACT_ZEXT_ELT",
40     SDTypeProfile<1, 3, [SDTCisPtrTy<2>]>, []>;
41
42 // Pattern fragments
43 def vextract_sext_i8  : PatFrag<(ops node:$vec, node:$idx),
44                                 (MipsVExtractSExt node:$vec, node:$idx, i8)>;
45 def vextract_sext_i16 : PatFrag<(ops node:$vec, node:$idx),
46                                 (MipsVExtractSExt node:$vec, node:$idx, i16)>;
47 def vextract_sext_i32 : PatFrag<(ops node:$vec, node:$idx),
48                                 (MipsVExtractSExt node:$vec, node:$idx, i32)>;
49
50 def vextract_zext_i8  : PatFrag<(ops node:$vec, node:$idx),
51                                 (MipsVExtractZExt node:$vec, node:$idx, i8)>;
52 def vextract_zext_i16 : PatFrag<(ops node:$vec, node:$idx),
53                                 (MipsVExtractZExt node:$vec, node:$idx, i16)>;
54 def vextract_zext_i32 : PatFrag<(ops node:$vec, node:$idx),
55                                 (MipsVExtractZExt node:$vec, node:$idx, i32)>;
56
57 def vinsert_v16i8 : PatFrag<(ops node:$vec, node:$val, node:$idx),
58     (v16i8 (vector_insert node:$vec, node:$val, node:$idx))>;
59 def vinsert_v8i16 : PatFrag<(ops node:$vec, node:$val, node:$idx),
60     (v8i16 (vector_insert node:$vec, node:$val, node:$idx))>;
61 def vinsert_v4i32 : PatFrag<(ops node:$vec, node:$val, node:$idx),
62     (v4i32 (vector_insert node:$vec, node:$val, node:$idx))>;
63
64 class vfsetcc_type<ValueType ResTy, ValueType OpTy, CondCode CC> :
65   PatFrag<(ops node:$lhs, node:$rhs),
66           (ResTy (vfsetcc (OpTy node:$lhs), (OpTy node:$rhs), CC))>;
67
68 // ISD::SETFALSE cannot occur
69 def vfsetoeq_v4f32 : vfsetcc_type<v4i32, v4f32, SETOEQ>;
70 def vfsetoeq_v2f64 : vfsetcc_type<v2i64, v2f64, SETOEQ>;
71 def vfsetoge_v4f32 : vfsetcc_type<v4i32, v4f32, SETOGE>;
72 def vfsetoge_v2f64 : vfsetcc_type<v2i64, v2f64, SETOGE>;
73 def vfsetogt_v4f32 : vfsetcc_type<v4i32, v4f32, SETOGT>;
74 def vfsetogt_v2f64 : vfsetcc_type<v2i64, v2f64, SETOGT>;
75 def vfsetole_v4f32 : vfsetcc_type<v4i32, v4f32, SETOLE>;
76 def vfsetole_v2f64 : vfsetcc_type<v2i64, v2f64, SETOLE>;
77 def vfsetolt_v4f32 : vfsetcc_type<v4i32, v4f32, SETOLT>;
78 def vfsetolt_v2f64 : vfsetcc_type<v2i64, v2f64, SETOLT>;
79 def vfsetone_v4f32 : vfsetcc_type<v4i32, v4f32, SETONE>;
80 def vfsetone_v2f64 : vfsetcc_type<v2i64, v2f64, SETONE>;
81 def vfsetord_v4f32 : vfsetcc_type<v4i32, v4f32, SETO>;
82 def vfsetord_v2f64 : vfsetcc_type<v2i64, v2f64, SETO>;
83 def vfsetun_v4f32  : vfsetcc_type<v4i32, v4f32, SETUO>;
84 def vfsetun_v2f64  : vfsetcc_type<v2i64, v2f64, SETUO>;
85 def vfsetueq_v4f32 : vfsetcc_type<v4i32, v4f32, SETUEQ>;
86 def vfsetueq_v2f64 : vfsetcc_type<v2i64, v2f64, SETUEQ>;
87 def vfsetuge_v4f32 : vfsetcc_type<v4i32, v4f32, SETUGE>;
88 def vfsetuge_v2f64 : vfsetcc_type<v2i64, v2f64, SETUGE>;
89 def vfsetugt_v4f32 : vfsetcc_type<v4i32, v4f32, SETUGT>;
90 def vfsetugt_v2f64 : vfsetcc_type<v2i64, v2f64, SETUGT>;
91 def vfsetule_v4f32 : vfsetcc_type<v4i32, v4f32, SETULE>;
92 def vfsetule_v2f64 : vfsetcc_type<v2i64, v2f64, SETULE>;
93 def vfsetult_v4f32 : vfsetcc_type<v4i32, v4f32, SETULT>;
94 def vfsetult_v2f64 : vfsetcc_type<v2i64, v2f64, SETULT>;
95 def vfsetune_v4f32 : vfsetcc_type<v4i32, v4f32, SETUNE>;
96 def vfsetune_v2f64 : vfsetcc_type<v2i64, v2f64, SETUNE>;
97 // ISD::SETTRUE cannot occur
98 // ISD::SETFALSE2 cannot occur
99 // ISD::SETTRUE2 cannot occur
100
101 class vsetcc_type<ValueType ResTy, CondCode CC> :
102   PatFrag<(ops node:$lhs, node:$rhs),
103           (ResTy (vsetcc node:$lhs, node:$rhs, CC))>;
104
105 def vseteq_v16i8  : vsetcc_type<v16i8, SETEQ>;
106 def vseteq_v8i16  : vsetcc_type<v8i16, SETEQ>;
107 def vseteq_v4i32  : vsetcc_type<v4i32, SETEQ>;
108 def vseteq_v2i64  : vsetcc_type<v2i64, SETEQ>;
109 def vsetle_v16i8  : vsetcc_type<v16i8, SETLE>;
110 def vsetle_v8i16  : vsetcc_type<v8i16, SETLE>;
111 def vsetle_v4i32  : vsetcc_type<v4i32, SETLE>;
112 def vsetle_v2i64  : vsetcc_type<v2i64, SETLE>;
113 def vsetlt_v16i8  : vsetcc_type<v16i8, SETLT>;
114 def vsetlt_v8i16  : vsetcc_type<v8i16, SETLT>;
115 def vsetlt_v4i32  : vsetcc_type<v4i32, SETLT>;
116 def vsetlt_v2i64  : vsetcc_type<v2i64, SETLT>;
117 def vsetule_v16i8 : vsetcc_type<v16i8, SETULE>;
118 def vsetule_v8i16 : vsetcc_type<v8i16, SETULE>;
119 def vsetule_v4i32 : vsetcc_type<v4i32, SETULE>;
120 def vsetule_v2i64 : vsetcc_type<v2i64, SETULE>;
121 def vsetult_v16i8 : vsetcc_type<v16i8, SETULT>;
122 def vsetult_v8i16 : vsetcc_type<v8i16, SETULT>;
123 def vsetult_v4i32 : vsetcc_type<v4i32, SETULT>;
124 def vsetult_v2i64 : vsetcc_type<v2i64, SETULT>;
125
126 def vsplati8  : PatFrag<(ops node:$in), (v16i8 (MipsVSplat (i32 node:$in)))>;
127 def vsplati16 : PatFrag<(ops node:$in), (v8i16 (MipsVSplat (i32 node:$in)))>;
128 def vsplati32 : PatFrag<(ops node:$in), (v4i32 (MipsVSplat (i32 node:$in)))>;
129 def vsplati64 : PatFrag<(ops node:$in), (v2i64 (MipsVSplatD (i32 node:$in)))>;
130
131 // Immediates
132 def immSExt5 : ImmLeaf<i32, [{return isInt<5>(Imm);}]>;
133 def immSExt10: ImmLeaf<i32, [{return isInt<10>(Imm);}]>;
134
135 def uimm3 : Operand<i32> {
136   let PrintMethod = "printUnsignedImm";
137 }
138
139 def uimm4 : Operand<i32> {
140   let PrintMethod = "printUnsignedImm";
141 }
142
143 def uimm8 : Operand<i32> {
144   let PrintMethod = "printUnsignedImm";
145 }
146
147 def simm5 : Operand<i32>;
148
149 def simm10 : Operand<i32>;
150
151 // Instruction encoding.
152 class ADD_A_B_ENC : MSA_3R_FMT<0b000, 0b00, 0b010000>;
153 class ADD_A_H_ENC : MSA_3R_FMT<0b000, 0b01, 0b010000>;
154 class ADD_A_W_ENC : MSA_3R_FMT<0b000, 0b10, 0b010000>;
155 class ADD_A_D_ENC : MSA_3R_FMT<0b000, 0b11, 0b010000>;
156
157 class ADDS_A_B_ENC : MSA_3R_FMT<0b001, 0b00, 0b010000>;
158 class ADDS_A_H_ENC : MSA_3R_FMT<0b001, 0b01, 0b010000>;
159 class ADDS_A_W_ENC : MSA_3R_FMT<0b001, 0b10, 0b010000>;
160 class ADDS_A_D_ENC : MSA_3R_FMT<0b001, 0b11, 0b010000>;
161
162 class ADDS_S_B_ENC : MSA_3R_FMT<0b010, 0b00, 0b010000>;
163 class ADDS_S_H_ENC : MSA_3R_FMT<0b010, 0b01, 0b010000>;
164 class ADDS_S_W_ENC : MSA_3R_FMT<0b010, 0b10, 0b010000>;
165 class ADDS_S_D_ENC : MSA_3R_FMT<0b010, 0b11, 0b010000>;
166
167 class ADDS_U_B_ENC : MSA_3R_FMT<0b011, 0b00, 0b010000>;
168 class ADDS_U_H_ENC : MSA_3R_FMT<0b011, 0b01, 0b010000>;
169 class ADDS_U_W_ENC : MSA_3R_FMT<0b011, 0b10, 0b010000>;
170 class ADDS_U_D_ENC : MSA_3R_FMT<0b011, 0b11, 0b010000>;
171
172 class ADDV_B_ENC : MSA_3R_FMT<0b000, 0b00, 0b001110>;
173 class ADDV_H_ENC : MSA_3R_FMT<0b000, 0b01, 0b001110>;
174 class ADDV_W_ENC : MSA_3R_FMT<0b000, 0b10, 0b001110>;
175 class ADDV_D_ENC : MSA_3R_FMT<0b000, 0b11, 0b001110>;
176
177 class ADDVI_B_ENC : MSA_I5_FMT<0b000, 0b00, 0b000110>;
178 class ADDVI_H_ENC : MSA_I5_FMT<0b000, 0b01, 0b000110>;
179 class ADDVI_W_ENC : MSA_I5_FMT<0b000, 0b10, 0b000110>;
180 class ADDVI_D_ENC : MSA_I5_FMT<0b000, 0b11, 0b000110>;
181
182 class AND_V_ENC : MSA_VEC_FMT<0b00000, 0b011110>;
183
184 class ANDI_B_ENC : MSA_I8_FMT<0b00, 0b000000>;
185
186 class ASUB_S_B_ENC : MSA_3R_FMT<0b100, 0b00, 0b010001>;
187 class ASUB_S_H_ENC : MSA_3R_FMT<0b100, 0b01, 0b010001>;
188 class ASUB_S_W_ENC : MSA_3R_FMT<0b100, 0b10, 0b010001>;
189 class ASUB_S_D_ENC : MSA_3R_FMT<0b100, 0b11, 0b010001>;
190
191 class ASUB_U_B_ENC : MSA_3R_FMT<0b101, 0b00, 0b010001>;
192 class ASUB_U_H_ENC : MSA_3R_FMT<0b101, 0b01, 0b010001>;
193 class ASUB_U_W_ENC : MSA_3R_FMT<0b101, 0b10, 0b010001>;
194 class ASUB_U_D_ENC : MSA_3R_FMT<0b101, 0b11, 0b010001>;
195
196 class AVE_S_B_ENC : MSA_3R_FMT<0b100, 0b00, 0b010000>;
197 class AVE_S_H_ENC : MSA_3R_FMT<0b100, 0b01, 0b010000>;
198 class AVE_S_W_ENC : MSA_3R_FMT<0b100, 0b10, 0b010000>;
199 class AVE_S_D_ENC : MSA_3R_FMT<0b100, 0b11, 0b010000>;
200
201 class AVE_U_B_ENC : MSA_3R_FMT<0b101, 0b00, 0b010000>;
202 class AVE_U_H_ENC : MSA_3R_FMT<0b101, 0b01, 0b010000>;
203 class AVE_U_W_ENC : MSA_3R_FMT<0b101, 0b10, 0b010000>;
204 class AVE_U_D_ENC : MSA_3R_FMT<0b101, 0b11, 0b010000>;
205
206 class AVER_S_B_ENC : MSA_3R_FMT<0b110, 0b00, 0b010000>;
207 class AVER_S_H_ENC : MSA_3R_FMT<0b110, 0b01, 0b010000>;
208 class AVER_S_W_ENC : MSA_3R_FMT<0b110, 0b10, 0b010000>;
209 class AVER_S_D_ENC : MSA_3R_FMT<0b110, 0b11, 0b010000>;
210
211 class AVER_U_B_ENC : MSA_3R_FMT<0b111, 0b00, 0b010000>;
212 class AVER_U_H_ENC : MSA_3R_FMT<0b111, 0b01, 0b010000>;
213 class AVER_U_W_ENC : MSA_3R_FMT<0b111, 0b10, 0b010000>;
214 class AVER_U_D_ENC : MSA_3R_FMT<0b111, 0b11, 0b010000>;
215
216 class BCLR_B_ENC : MSA_3R_FMT<0b011, 0b00, 0b001101>;
217 class BCLR_H_ENC : MSA_3R_FMT<0b011, 0b01, 0b001101>;
218 class BCLR_W_ENC : MSA_3R_FMT<0b011, 0b10, 0b001101>;
219 class BCLR_D_ENC : MSA_3R_FMT<0b011, 0b11, 0b001101>;
220
221 class BCLRI_B_ENC : MSA_BIT_B_FMT<0b011, 0b001001>;
222 class BCLRI_H_ENC : MSA_BIT_H_FMT<0b011, 0b001001>;
223 class BCLRI_W_ENC : MSA_BIT_W_FMT<0b011, 0b001001>;
224 class BCLRI_D_ENC : MSA_BIT_D_FMT<0b011, 0b001001>;
225
226 class BINSL_B_ENC : MSA_3R_FMT<0b110, 0b00, 0b001101>;
227 class BINSL_H_ENC : MSA_3R_FMT<0b110, 0b01, 0b001101>;
228 class BINSL_W_ENC : MSA_3R_FMT<0b110, 0b10, 0b001101>;
229 class BINSL_D_ENC : MSA_3R_FMT<0b110, 0b11, 0b001101>;
230
231 class BINSLI_B_ENC : MSA_BIT_B_FMT<0b110, 0b001001>;
232 class BINSLI_H_ENC : MSA_BIT_H_FMT<0b110, 0b001001>;
233 class BINSLI_W_ENC : MSA_BIT_W_FMT<0b110, 0b001001>;
234 class BINSLI_D_ENC : MSA_BIT_D_FMT<0b110, 0b001001>;
235
236 class BINSR_B_ENC : MSA_3R_FMT<0b111, 0b00, 0b001101>;
237 class BINSR_H_ENC : MSA_3R_FMT<0b111, 0b01, 0b001101>;
238 class BINSR_W_ENC : MSA_3R_FMT<0b111, 0b10, 0b001101>;
239 class BINSR_D_ENC : MSA_3R_FMT<0b111, 0b11, 0b001101>;
240
241 class BINSRI_B_ENC : MSA_BIT_B_FMT<0b111, 0b001001>;
242 class BINSRI_H_ENC : MSA_BIT_H_FMT<0b111, 0b001001>;
243 class BINSRI_W_ENC : MSA_BIT_W_FMT<0b111, 0b001001>;
244 class BINSRI_D_ENC : MSA_BIT_D_FMT<0b111, 0b001001>;
245
246 class BMNZ_V_ENC : MSA_VEC_FMT<0b00100, 0b011110>;
247
248 class BMNZI_B_ENC : MSA_I8_FMT<0b00, 0b000001>;
249
250 class BMZ_V_ENC : MSA_VEC_FMT<0b00101, 0b011110>;
251
252 class BMZI_B_ENC : MSA_I8_FMT<0b01, 0b000001>;
253
254 class BNEG_B_ENC : MSA_3R_FMT<0b101, 0b00, 0b001101>;
255 class BNEG_H_ENC : MSA_3R_FMT<0b101, 0b01, 0b001101>;
256 class BNEG_W_ENC : MSA_3R_FMT<0b101, 0b10, 0b001101>;
257 class BNEG_D_ENC : MSA_3R_FMT<0b101, 0b11, 0b001101>;
258
259 class BNEGI_B_ENC : MSA_BIT_B_FMT<0b101, 0b001001>;
260 class BNEGI_H_ENC : MSA_BIT_H_FMT<0b101, 0b001001>;
261 class BNEGI_W_ENC : MSA_BIT_W_FMT<0b101, 0b001001>;
262 class BNEGI_D_ENC : MSA_BIT_D_FMT<0b101, 0b001001>;
263
264 class BNZ_B_ENC : MSA_I10_FMT<0b000, 0b00, 0b001100>;
265 class BNZ_H_ENC : MSA_I10_FMT<0b000, 0b01, 0b001100>;
266 class BNZ_W_ENC : MSA_I10_FMT<0b000, 0b10, 0b001100>;
267 class BNZ_D_ENC : MSA_I10_FMT<0b000, 0b11, 0b001100>;
268
269 class BNZ_V_ENC : MSA_VEC_FMT<0b01000, 0b011110>;
270
271 class BSEL_V_ENC : MSA_VECS10_FMT<0b00110, 0b011110>;
272
273 class BSELI_B_ENC : MSA_I8_FMT<0b10, 0b000001>;
274
275 class BSET_B_ENC : MSA_3R_FMT<0b100, 0b00, 0b001101>;
276 class BSET_H_ENC : MSA_3R_FMT<0b100, 0b01, 0b001101>;
277 class BSET_W_ENC : MSA_3R_FMT<0b100, 0b10, 0b001101>;
278 class BSET_D_ENC : MSA_3R_FMT<0b100, 0b11, 0b001101>;
279
280 class BSETI_B_ENC : MSA_BIT_B_FMT<0b100, 0b001001>;
281 class BSETI_H_ENC : MSA_BIT_H_FMT<0b100, 0b001001>;
282 class BSETI_W_ENC : MSA_BIT_W_FMT<0b100, 0b001001>;
283 class BSETI_D_ENC : MSA_BIT_D_FMT<0b100, 0b001001>;
284
285 class BZ_B_ENC : MSA_I10_FMT<0b001, 0b00, 0b001100>;
286 class BZ_H_ENC : MSA_I10_FMT<0b001, 0b01, 0b001100>;
287 class BZ_W_ENC : MSA_I10_FMT<0b001, 0b10, 0b001100>;
288 class BZ_D_ENC : MSA_I10_FMT<0b001, 0b11, 0b001100>;
289
290 class BZ_V_ENC : MSA_VECS10_FMT<0b01001, 0b011110>;
291
292 class CEQ_B_ENC : MSA_3R_FMT<0b000, 0b00, 0b001111>;
293 class CEQ_H_ENC : MSA_3R_FMT<0b000, 0b01, 0b001111>;
294 class CEQ_W_ENC : MSA_3R_FMT<0b000, 0b10, 0b001111>;
295 class CEQ_D_ENC : MSA_3R_FMT<0b000, 0b11, 0b001111>;
296
297 class CEQI_B_ENC : MSA_I5_FMT<0b000, 0b00, 0b000111>;
298 class CEQI_H_ENC : MSA_I5_FMT<0b000, 0b01, 0b000111>;
299 class CEQI_W_ENC : MSA_I5_FMT<0b000, 0b10, 0b000111>;
300 class CEQI_D_ENC : MSA_I5_FMT<0b000, 0b11, 0b000111>;
301
302 class CFCMSA_ENC : MSA_ELM_FMT<0b0001111110, 0b011001>;
303
304 class CLE_S_B_ENC : MSA_3R_FMT<0b100, 0b00, 0b001111>;
305 class CLE_S_H_ENC : MSA_3R_FMT<0b100, 0b01, 0b001111>;
306 class CLE_S_W_ENC : MSA_3R_FMT<0b100, 0b10, 0b001111>;
307 class CLE_S_D_ENC : MSA_3R_FMT<0b100, 0b11, 0b001111>;
308
309 class CLE_U_B_ENC : MSA_3R_FMT<0b101, 0b00, 0b001111>;
310 class CLE_U_H_ENC : MSA_3R_FMT<0b101, 0b01, 0b001111>;
311 class CLE_U_W_ENC : MSA_3R_FMT<0b101, 0b10, 0b001111>;
312 class CLE_U_D_ENC : MSA_3R_FMT<0b101, 0b11, 0b001111>;
313
314 class CLEI_S_B_ENC : MSA_I5_FMT<0b100, 0b00, 0b000111>;
315 class CLEI_S_H_ENC : MSA_I5_FMT<0b100, 0b01, 0b000111>;
316 class CLEI_S_W_ENC : MSA_I5_FMT<0b100, 0b10, 0b000111>;
317 class CLEI_S_D_ENC : MSA_I5_FMT<0b100, 0b11, 0b000111>;
318
319 class CLEI_U_B_ENC : MSA_I5_FMT<0b101, 0b00, 0b000111>;
320 class CLEI_U_H_ENC : MSA_I5_FMT<0b101, 0b01, 0b000111>;
321 class CLEI_U_W_ENC : MSA_I5_FMT<0b101, 0b10, 0b000111>;
322 class CLEI_U_D_ENC : MSA_I5_FMT<0b101, 0b11, 0b000111>;
323
324 class CLT_S_B_ENC : MSA_3R_FMT<0b010, 0b00, 0b001111>;
325 class CLT_S_H_ENC : MSA_3R_FMT<0b010, 0b01, 0b001111>;
326 class CLT_S_W_ENC : MSA_3R_FMT<0b010, 0b10, 0b001111>;
327 class CLT_S_D_ENC : MSA_3R_FMT<0b010, 0b11, 0b001111>;
328
329 class CLT_U_B_ENC : MSA_3R_FMT<0b011, 0b00, 0b001111>;
330 class CLT_U_H_ENC : MSA_3R_FMT<0b011, 0b01, 0b001111>;
331 class CLT_U_W_ENC : MSA_3R_FMT<0b011, 0b10, 0b001111>;
332 class CLT_U_D_ENC : MSA_3R_FMT<0b011, 0b11, 0b001111>;
333
334 class CLTI_S_B_ENC : MSA_I5_FMT<0b010, 0b00, 0b000111>;
335 class CLTI_S_H_ENC : MSA_I5_FMT<0b010, 0b01, 0b000111>;
336 class CLTI_S_W_ENC : MSA_I5_FMT<0b010, 0b10, 0b000111>;
337 class CLTI_S_D_ENC : MSA_I5_FMT<0b010, 0b11, 0b000111>;
338
339 class CLTI_U_B_ENC : MSA_I5_FMT<0b011, 0b00, 0b000111>;
340 class CLTI_U_H_ENC : MSA_I5_FMT<0b011, 0b01, 0b000111>;
341 class CLTI_U_W_ENC : MSA_I5_FMT<0b011, 0b10, 0b000111>;
342 class CLTI_U_D_ENC : MSA_I5_FMT<0b011, 0b11, 0b000111>;
343
344 class COPY_S_B_ENC : MSA_ELM_B_FMT<0b0010, 0b011001>;
345 class COPY_S_H_ENC : MSA_ELM_H_FMT<0b0010, 0b011001>;
346 class COPY_S_W_ENC : MSA_ELM_W_FMT<0b0010, 0b011001>;
347
348 class COPY_U_B_ENC : MSA_ELM_B_FMT<0b0011, 0b011001>;
349 class COPY_U_H_ENC : MSA_ELM_H_FMT<0b0011, 0b011001>;
350 class COPY_U_W_ENC : MSA_ELM_W_FMT<0b0011, 0b011001>;
351
352 class CTCMSA_ENC : MSA_ELM_FMT<0b0000111110, 0b011001>;
353
354 class DIV_S_B_ENC : MSA_3R_FMT<0b100, 0b00, 0b010010>;
355 class DIV_S_H_ENC : MSA_3R_FMT<0b100, 0b01, 0b010010>;
356 class DIV_S_W_ENC : MSA_3R_FMT<0b100, 0b10, 0b010010>;
357 class DIV_S_D_ENC : MSA_3R_FMT<0b100, 0b11, 0b010010>;
358
359 class DIV_U_B_ENC : MSA_3R_FMT<0b101, 0b00, 0b010010>;
360 class DIV_U_H_ENC : MSA_3R_FMT<0b101, 0b01, 0b010010>;
361 class DIV_U_W_ENC : MSA_3R_FMT<0b101, 0b10, 0b010010>;
362 class DIV_U_D_ENC : MSA_3R_FMT<0b101, 0b11, 0b010010>;
363
364 class DOTP_S_H_ENC : MSA_3R_FMT<0b000, 0b01, 0b010011>;
365 class DOTP_S_W_ENC : MSA_3R_FMT<0b000, 0b10, 0b010011>;
366 class DOTP_S_D_ENC : MSA_3R_FMT<0b000, 0b11, 0b010011>;
367
368 class DOTP_U_H_ENC : MSA_3R_FMT<0b001, 0b01, 0b010011>;
369 class DOTP_U_W_ENC : MSA_3R_FMT<0b001, 0b10, 0b010011>;
370 class DOTP_U_D_ENC : MSA_3R_FMT<0b001, 0b11, 0b010011>;
371
372 class DPADD_S_H_ENC : MSA_3R_FMT<0b010, 0b01, 0b010011>;
373 class DPADD_S_W_ENC : MSA_3R_FMT<0b010, 0b10, 0b010011>;
374 class DPADD_S_D_ENC : MSA_3R_FMT<0b010, 0b11, 0b010011>;
375
376 class DPADD_U_H_ENC : MSA_3R_FMT<0b011, 0b01, 0b010011>;
377 class DPADD_U_W_ENC : MSA_3R_FMT<0b011, 0b10, 0b010011>;
378 class DPADD_U_D_ENC : MSA_3R_FMT<0b011, 0b11, 0b010011>;
379
380 class DPSUB_S_H_ENC : MSA_3R_FMT<0b100, 0b01, 0b010011>;
381 class DPSUB_S_W_ENC : MSA_3R_FMT<0b100, 0b10, 0b010011>;
382 class DPSUB_S_D_ENC : MSA_3R_FMT<0b100, 0b11, 0b010011>;
383
384 class DPSUB_U_H_ENC : MSA_3R_FMT<0b101, 0b01, 0b010011>;
385 class DPSUB_U_W_ENC : MSA_3R_FMT<0b101, 0b10, 0b010011>;
386 class DPSUB_U_D_ENC : MSA_3R_FMT<0b101, 0b11, 0b010011>;
387
388 class FADD_W_ENC : MSA_3RF_FMT<0b0000, 0b0, 0b011011>;
389 class FADD_D_ENC : MSA_3RF_FMT<0b0000, 0b1, 0b011011>;
390
391 class FCAF_W_ENC : MSA_3RF_FMT<0b0000, 0b0, 0b011010>;
392 class FCAF_D_ENC : MSA_3RF_FMT<0b0000, 0b1, 0b011010>;
393
394 class FCEQ_W_ENC : MSA_3RF_FMT<0b0010, 0b0, 0b011010>;
395 class FCEQ_D_ENC : MSA_3RF_FMT<0b0010, 0b1, 0b011010>;
396
397 class FCLASS_W_ENC : MSA_2RF_FMT<0b110010000, 0b0, 0b011110>;
398 class FCLASS_D_ENC : MSA_2RF_FMT<0b110010000, 0b1, 0b011110>;
399
400 class FCLE_W_ENC : MSA_3RF_FMT<0b0110, 0b0, 0b011010>;
401 class FCLE_D_ENC : MSA_3RF_FMT<0b0110, 0b1, 0b011010>;
402
403 class FCLT_W_ENC : MSA_3RF_FMT<0b0100, 0b0, 0b011010>;
404 class FCLT_D_ENC : MSA_3RF_FMT<0b0100, 0b1, 0b011010>;
405
406 class FCNE_W_ENC : MSA_3RF_FMT<0b0011, 0b0, 0b011100>;
407 class FCNE_D_ENC : MSA_3RF_FMT<0b0011, 0b1, 0b011100>;
408
409 class FCOR_W_ENC : MSA_3RF_FMT<0b0001, 0b0, 0b011100>;
410 class FCOR_D_ENC : MSA_3RF_FMT<0b0001, 0b1, 0b011100>;
411
412 class FCUEQ_W_ENC : MSA_3RF_FMT<0b0011, 0b0, 0b011010>;
413 class FCUEQ_D_ENC : MSA_3RF_FMT<0b0011, 0b1, 0b011010>;
414
415 class FCULE_W_ENC : MSA_3RF_FMT<0b0111, 0b0, 0b011010>;
416 class FCULE_D_ENC : MSA_3RF_FMT<0b0111, 0b1, 0b011010>;
417
418 class FCULT_W_ENC : MSA_3RF_FMT<0b0101, 0b0, 0b011010>;
419 class FCULT_D_ENC : MSA_3RF_FMT<0b0101, 0b1, 0b011010>;
420
421 class FCUN_W_ENC : MSA_3RF_FMT<0b0001, 0b0, 0b011010>;
422 class FCUN_D_ENC : MSA_3RF_FMT<0b0001, 0b1, 0b011010>;
423
424 class FCUNE_W_ENC : MSA_3RF_FMT<0b0010, 0b0, 0b011100>;
425 class FCUNE_D_ENC : MSA_3RF_FMT<0b0010, 0b1, 0b011100>;
426
427 class FDIV_W_ENC : MSA_3RF_FMT<0b0011, 0b0, 0b011011>;
428 class FDIV_D_ENC : MSA_3RF_FMT<0b0011, 0b1, 0b011011>;
429
430 class FEXDO_H_ENC : MSA_3RF_FMT<0b1000, 0b0, 0b011011>;
431 class FEXDO_W_ENC : MSA_3RF_FMT<0b1000, 0b1, 0b011011>;
432
433 class FEXP2_W_ENC : MSA_3RF_FMT<0b0111, 0b0, 0b011011>;
434 class FEXP2_D_ENC : MSA_3RF_FMT<0b0111, 0b1, 0b011011>;
435
436 class FEXUPL_W_ENC : MSA_2RF_FMT<0b110011000, 0b0, 0b011110>;
437 class FEXUPL_D_ENC : MSA_2RF_FMT<0b110011000, 0b1, 0b011110>;
438
439 class FEXUPR_W_ENC : MSA_2RF_FMT<0b110011001, 0b0, 0b011110>;
440 class FEXUPR_D_ENC : MSA_2RF_FMT<0b110011001, 0b1, 0b011110>;
441
442 class FFINT_S_W_ENC : MSA_2RF_FMT<0b110011110, 0b0, 0b011110>;
443 class FFINT_S_D_ENC : MSA_2RF_FMT<0b110011110, 0b1, 0b011110>;
444
445 class FFINT_U_W_ENC : MSA_2RF_FMT<0b110011111, 0b0, 0b011110>;
446 class FFINT_U_D_ENC : MSA_2RF_FMT<0b110011111, 0b1, 0b011110>;
447
448 class FFQL_W_ENC : MSA_2RF_FMT<0b110011010, 0b0, 0b011110>;
449 class FFQL_D_ENC : MSA_2RF_FMT<0b110011010, 0b1, 0b011110>;
450
451 class FFQR_W_ENC : MSA_2RF_FMT<0b110011011, 0b0, 0b011110>;
452 class FFQR_D_ENC : MSA_2RF_FMT<0b110011011, 0b1, 0b011110>;
453
454 class FILL_B_ENC : MSA_2R_FMT<0b11000000, 0b00, 0b011110>;
455 class FILL_H_ENC : MSA_2R_FMT<0b11000000, 0b01, 0b011110>;
456 class FILL_W_ENC : MSA_2R_FMT<0b11000000, 0b10, 0b011110>;
457
458 class FLOG2_W_ENC : MSA_2RF_FMT<0b110010111, 0b0, 0b011110>;
459 class FLOG2_D_ENC : MSA_2RF_FMT<0b110010111, 0b1, 0b011110>;
460
461 class FMADD_W_ENC : MSA_3RF_FMT<0b0100, 0b0, 0b011011>;
462 class FMADD_D_ENC : MSA_3RF_FMT<0b0100, 0b1, 0b011011>;
463
464 class FMAX_W_ENC : MSA_3RF_FMT<0b1110, 0b0, 0b011011>;
465 class FMAX_D_ENC : MSA_3RF_FMT<0b1110, 0b1, 0b011011>;
466
467 class FMAX_A_W_ENC : MSA_3RF_FMT<0b1111, 0b0, 0b011011>;
468 class FMAX_A_D_ENC : MSA_3RF_FMT<0b1111, 0b1, 0b011011>;
469
470 class FMIN_W_ENC : MSA_3RF_FMT<0b1100, 0b0, 0b011011>;
471 class FMIN_D_ENC : MSA_3RF_FMT<0b1100, 0b1, 0b011011>;
472
473 class FMIN_A_W_ENC : MSA_3RF_FMT<0b1101, 0b0, 0b011011>;
474 class FMIN_A_D_ENC : MSA_3RF_FMT<0b1101, 0b1, 0b011011>;
475
476 class FMSUB_W_ENC : MSA_3RF_FMT<0b0101, 0b0, 0b011011>;
477 class FMSUB_D_ENC : MSA_3RF_FMT<0b0101, 0b1, 0b011011>;
478
479 class FMUL_W_ENC : MSA_3RF_FMT<0b0010, 0b0, 0b011011>;
480 class FMUL_D_ENC : MSA_3RF_FMT<0b0010, 0b1, 0b011011>;
481
482 class FRINT_W_ENC : MSA_2RF_FMT<0b110010110, 0b0, 0b011110>;
483 class FRINT_D_ENC : MSA_2RF_FMT<0b110010110, 0b1, 0b011110>;
484
485 class FRCP_W_ENC : MSA_2RF_FMT<0b110010101, 0b0, 0b011110>;
486 class FRCP_D_ENC : MSA_2RF_FMT<0b110010101, 0b1, 0b011110>;
487
488 class FRSQRT_W_ENC : MSA_2RF_FMT<0b110010100, 0b0, 0b011110>;
489 class FRSQRT_D_ENC : MSA_2RF_FMT<0b110010100, 0b1, 0b011110>;
490
491 class FSAF_W_ENC : MSA_3RF_FMT<0b1000, 0b0, 0b011010>;
492 class FSAF_D_ENC : MSA_3RF_FMT<0b1000, 0b1, 0b011010>;
493
494 class FSEQ_W_ENC : MSA_3RF_FMT<0b1010, 0b0, 0b011010>;
495 class FSEQ_D_ENC : MSA_3RF_FMT<0b1010, 0b1, 0b011010>;
496
497 class FSLE_W_ENC : MSA_3RF_FMT<0b1110, 0b0, 0b011010>;
498 class FSLE_D_ENC : MSA_3RF_FMT<0b1110, 0b1, 0b011010>;
499
500 class FSLT_W_ENC : MSA_3RF_FMT<0b1100, 0b0, 0b011010>;
501 class FSLT_D_ENC : MSA_3RF_FMT<0b1100, 0b1, 0b011010>;
502
503 class FSNE_W_ENC : MSA_3RF_FMT<0b1011, 0b0, 0b011100>;
504 class FSNE_D_ENC : MSA_3RF_FMT<0b1011, 0b1, 0b011100>;
505
506 class FSOR_W_ENC : MSA_3RF_FMT<0b1001, 0b0, 0b011100>;
507 class FSOR_D_ENC : MSA_3RF_FMT<0b1001, 0b1, 0b011100>;
508
509 class FSQRT_W_ENC : MSA_2RF_FMT<0b110010011, 0b0, 0b011110>;
510 class FSQRT_D_ENC : MSA_2RF_FMT<0b110010011, 0b1, 0b011110>;
511
512 class FSUB_W_ENC : MSA_3RF_FMT<0b0001, 0b0, 0b011011>;
513 class FSUB_D_ENC : MSA_3RF_FMT<0b0001, 0b1, 0b011011>;
514
515 class FSUEQ_W_ENC : MSA_3RF_FMT<0b1011, 0b0, 0b011010>;
516 class FSUEQ_D_ENC : MSA_3RF_FMT<0b1011, 0b1, 0b011010>;
517
518 class FSULE_W_ENC : MSA_3RF_FMT<0b1111, 0b0, 0b011010>;
519 class FSULE_D_ENC : MSA_3RF_FMT<0b1111, 0b1, 0b011010>;
520
521 class FSULT_W_ENC : MSA_3RF_FMT<0b1101, 0b0, 0b011010>;
522 class FSULT_D_ENC : MSA_3RF_FMT<0b1101, 0b1, 0b011010>;
523
524 class FSUN_W_ENC : MSA_3RF_FMT<0b1001, 0b0, 0b011010>;
525 class FSUN_D_ENC : MSA_3RF_FMT<0b1001, 0b1, 0b011010>;
526
527 class FSUNE_W_ENC : MSA_3RF_FMT<0b1010, 0b0, 0b011100>;
528 class FSUNE_D_ENC : MSA_3RF_FMT<0b1010, 0b1, 0b011100>;
529
530 class FTRUNC_S_W_ENC : MSA_2RF_FMT<0b110100000, 0b0, 0b011110>;
531 class FTRUNC_S_D_ENC : MSA_2RF_FMT<0b110100000, 0b1, 0b011110>;
532
533 class FTRUNC_U_W_ENC : MSA_2RF_FMT<0b110100001, 0b0, 0b011110>;
534 class FTRUNC_U_D_ENC : MSA_2RF_FMT<0b110100001, 0b1, 0b011110>;
535
536 class FTINT_S_W_ENC : MSA_2RF_FMT<0b110011100, 0b0, 0b011110>;
537 class FTINT_S_D_ENC : MSA_2RF_FMT<0b110011100, 0b1, 0b011110>;
538
539 class FTINT_U_W_ENC : MSA_2RF_FMT<0b110011101, 0b0, 0b011110>;
540 class FTINT_U_D_ENC : MSA_2RF_FMT<0b110011101, 0b1, 0b011110>;
541
542 class FTQ_H_ENC : MSA_3RF_FMT<0b1010, 0b0, 0b011011>;
543 class FTQ_W_ENC : MSA_3RF_FMT<0b1010, 0b1, 0b011011>;
544
545 class HADD_S_H_ENC : MSA_3R_FMT<0b100, 0b01, 0b010101>;
546 class HADD_S_W_ENC : MSA_3R_FMT<0b100, 0b10, 0b010101>;
547 class HADD_S_D_ENC : MSA_3R_FMT<0b100, 0b11, 0b010101>;
548
549 class HADD_U_H_ENC : MSA_3R_FMT<0b101, 0b01, 0b010101>;
550 class HADD_U_W_ENC : MSA_3R_FMT<0b101, 0b10, 0b010101>;
551 class HADD_U_D_ENC : MSA_3R_FMT<0b101, 0b11, 0b010101>;
552
553 class HSUB_S_H_ENC : MSA_3R_FMT<0b110, 0b01, 0b010101>;
554 class HSUB_S_W_ENC : MSA_3R_FMT<0b110, 0b10, 0b010101>;
555 class HSUB_S_D_ENC : MSA_3R_FMT<0b110, 0b11, 0b010101>;
556
557 class HSUB_U_H_ENC : MSA_3R_FMT<0b111, 0b01, 0b010101>;
558 class HSUB_U_W_ENC : MSA_3R_FMT<0b111, 0b10, 0b010101>;
559 class HSUB_U_D_ENC : MSA_3R_FMT<0b111, 0b11, 0b010101>;
560
561 class ILVEV_B_ENC : MSA_3R_FMT<0b110, 0b00, 0b010100>;
562 class ILVEV_H_ENC : MSA_3R_FMT<0b110, 0b01, 0b010100>;
563 class ILVEV_W_ENC : MSA_3R_FMT<0b110, 0b10, 0b010100>;
564 class ILVEV_D_ENC : MSA_3R_FMT<0b110, 0b11, 0b010100>;
565
566 class ILVL_B_ENC : MSA_3R_FMT<0b100, 0b00, 0b010100>;
567 class ILVL_H_ENC : MSA_3R_FMT<0b100, 0b01, 0b010100>;
568 class ILVL_W_ENC : MSA_3R_FMT<0b100, 0b10, 0b010100>;
569 class ILVL_D_ENC : MSA_3R_FMT<0b100, 0b11, 0b010100>;
570
571 class ILVOD_B_ENC : MSA_3R_FMT<0b111, 0b00, 0b010100>;
572 class ILVOD_H_ENC : MSA_3R_FMT<0b111, 0b01, 0b010100>;
573 class ILVOD_W_ENC : MSA_3R_FMT<0b111, 0b10, 0b010100>;
574 class ILVOD_D_ENC : MSA_3R_FMT<0b111, 0b11, 0b010100>;
575
576 class ILVR_B_ENC : MSA_3R_FMT<0b101, 0b00, 0b010100>;
577 class ILVR_H_ENC : MSA_3R_FMT<0b101, 0b01, 0b010100>;
578 class ILVR_W_ENC : MSA_3R_FMT<0b101, 0b10, 0b010100>;
579 class ILVR_D_ENC : MSA_3R_FMT<0b101, 0b11, 0b010100>;
580
581 class INSERT_B_ENC : MSA_ELM_B_FMT<0b0100, 0b011001>;
582 class INSERT_H_ENC : MSA_ELM_H_FMT<0b0100, 0b011001>;
583 class INSERT_W_ENC : MSA_ELM_W_FMT<0b0100, 0b011001>;
584
585 class INSVE_B_ENC : MSA_ELM_B_FMT<0b0101, 0b011001>;
586 class INSVE_H_ENC : MSA_ELM_H_FMT<0b0101, 0b011001>;
587 class INSVE_W_ENC : MSA_ELM_W_FMT<0b0101, 0b011001>;
588 class INSVE_D_ENC : MSA_ELM_D_FMT<0b0101, 0b011001>;
589
590 class LD_B_ENC   : MSA_I5_FMT<0b110, 0b00, 0b000111>;
591 class LD_H_ENC   : MSA_I5_FMT<0b110, 0b01, 0b000111>;
592 class LD_W_ENC   : MSA_I5_FMT<0b110, 0b10, 0b000111>;
593 class LD_D_ENC   : MSA_I5_FMT<0b110, 0b11, 0b000111>;
594
595 class LDI_B_ENC  : MSA_I10_FMT<0b010, 0b00, 0b001100>;
596 class LDI_H_ENC  : MSA_I10_FMT<0b010, 0b01, 0b001100>;
597 class LDI_W_ENC  : MSA_I10_FMT<0b010, 0b10, 0b001100>;
598 class LDI_D_ENC  : MSA_I10_FMT<0b010, 0b11, 0b001100>;
599
600 class LDX_B_ENC  : MSA_3R_FMT<0b110, 0b00, 0b001111>;
601 class LDX_H_ENC  : MSA_3R_FMT<0b110, 0b01, 0b001111>;
602 class LDX_W_ENC  : MSA_3R_FMT<0b110, 0b10, 0b001111>;
603 class LDX_D_ENC  : MSA_3R_FMT<0b110, 0b11, 0b001111>;
604
605 class MADD_Q_H_ENC : MSA_3RF_FMT<0b0101, 0b0, 0b011100>;
606 class MADD_Q_W_ENC : MSA_3RF_FMT<0b0101, 0b1, 0b011100>;
607
608 class MADDR_Q_H_ENC : MSA_3RF_FMT<0b1101, 0b0, 0b011100>;
609 class MADDR_Q_W_ENC : MSA_3RF_FMT<0b1101, 0b1, 0b011100>;
610
611 class MADDV_B_ENC : MSA_3R_FMT<0b001, 0b00, 0b010010>;
612 class MADDV_H_ENC : MSA_3R_FMT<0b001, 0b01, 0b010010>;
613 class MADDV_W_ENC : MSA_3R_FMT<0b001, 0b10, 0b010010>;
614 class MADDV_D_ENC : MSA_3R_FMT<0b001, 0b11, 0b010010>;
615
616 class MAX_A_B_ENC : MSA_3R_FMT<0b110, 0b00, 0b001110>;
617 class MAX_A_H_ENC : MSA_3R_FMT<0b110, 0b01, 0b001110>;
618 class MAX_A_W_ENC : MSA_3R_FMT<0b110, 0b10, 0b001110>;
619 class MAX_A_D_ENC : MSA_3R_FMT<0b110, 0b11, 0b001110>;
620
621 class MAX_S_B_ENC : MSA_3R_FMT<0b010, 0b00, 0b001110>;
622 class MAX_S_H_ENC : MSA_3R_FMT<0b010, 0b01, 0b001110>;
623 class MAX_S_W_ENC : MSA_3R_FMT<0b010, 0b10, 0b001110>;
624 class MAX_S_D_ENC : MSA_3R_FMT<0b010, 0b11, 0b001110>;
625
626 class MAX_U_B_ENC : MSA_3R_FMT<0b011, 0b00, 0b001110>;
627 class MAX_U_H_ENC : MSA_3R_FMT<0b011, 0b01, 0b001110>;
628 class MAX_U_W_ENC : MSA_3R_FMT<0b011, 0b10, 0b001110>;
629 class MAX_U_D_ENC : MSA_3R_FMT<0b011, 0b11, 0b001110>;
630
631 class MAXI_S_B_ENC : MSA_I5_FMT<0b010, 0b00, 0b000110>;
632 class MAXI_S_H_ENC : MSA_I5_FMT<0b010, 0b01, 0b000110>;
633 class MAXI_S_W_ENC : MSA_I5_FMT<0b010, 0b10, 0b000110>;
634 class MAXI_S_D_ENC : MSA_I5_FMT<0b010, 0b11, 0b000110>;
635
636 class MAXI_U_B_ENC : MSA_I5_FMT<0b011, 0b00, 0b000110>;
637 class MAXI_U_H_ENC : MSA_I5_FMT<0b011, 0b01, 0b000110>;
638 class MAXI_U_W_ENC : MSA_I5_FMT<0b011, 0b10, 0b000110>;
639 class MAXI_U_D_ENC : MSA_I5_FMT<0b011, 0b11, 0b000110>;
640
641 class MIN_A_B_ENC : MSA_3R_FMT<0b111, 0b00, 0b001110>;
642 class MIN_A_H_ENC : MSA_3R_FMT<0b111, 0b01, 0b001110>;
643 class MIN_A_W_ENC : MSA_3R_FMT<0b111, 0b10, 0b001110>;
644 class MIN_A_D_ENC : MSA_3R_FMT<0b111, 0b11, 0b001110>;
645
646 class MIN_S_B_ENC : MSA_3R_FMT<0b100, 0b00, 0b001110>;
647 class MIN_S_H_ENC : MSA_3R_FMT<0b100, 0b01, 0b001110>;
648 class MIN_S_W_ENC : MSA_3R_FMT<0b100, 0b10, 0b001110>;
649 class MIN_S_D_ENC : MSA_3R_FMT<0b100, 0b11, 0b001110>;
650
651 class MIN_U_B_ENC : MSA_3R_FMT<0b101, 0b00, 0b001110>;
652 class MIN_U_H_ENC : MSA_3R_FMT<0b101, 0b01, 0b001110>;
653 class MIN_U_W_ENC : MSA_3R_FMT<0b101, 0b10, 0b001110>;
654 class MIN_U_D_ENC : MSA_3R_FMT<0b101, 0b11, 0b001110>;
655
656 class MINI_S_B_ENC : MSA_I5_FMT<0b100, 0b00, 0b000110>;
657 class MINI_S_H_ENC : MSA_I5_FMT<0b100, 0b01, 0b000110>;
658 class MINI_S_W_ENC : MSA_I5_FMT<0b100, 0b10, 0b000110>;
659 class MINI_S_D_ENC : MSA_I5_FMT<0b100, 0b11, 0b000110>;
660
661 class MINI_U_B_ENC : MSA_I5_FMT<0b101, 0b00, 0b000110>;
662 class MINI_U_H_ENC : MSA_I5_FMT<0b101, 0b01, 0b000110>;
663 class MINI_U_W_ENC : MSA_I5_FMT<0b101, 0b10, 0b000110>;
664 class MINI_U_D_ENC : MSA_I5_FMT<0b101, 0b11, 0b000110>;
665
666 class MOD_S_B_ENC : MSA_3R_FMT<0b110, 0b00, 0b010010>;
667 class MOD_S_H_ENC : MSA_3R_FMT<0b110, 0b01, 0b010010>;
668 class MOD_S_W_ENC : MSA_3R_FMT<0b110, 0b10, 0b010010>;
669 class MOD_S_D_ENC : MSA_3R_FMT<0b110, 0b11, 0b010010>;
670
671 class MOD_U_B_ENC : MSA_3R_FMT<0b111, 0b00, 0b010010>;
672 class MOD_U_H_ENC : MSA_3R_FMT<0b111, 0b01, 0b010010>;
673 class MOD_U_W_ENC : MSA_3R_FMT<0b111, 0b10, 0b010010>;
674 class MOD_U_D_ENC : MSA_3R_FMT<0b111, 0b11, 0b010010>;
675
676 class MOVE_V_ENC : MSA_ELM_FMT<0b0010111110, 0b011001>;
677
678 class MSUB_Q_H_ENC : MSA_3RF_FMT<0b0110, 0b0, 0b011100>;
679 class MSUB_Q_W_ENC : MSA_3RF_FMT<0b0110, 0b1, 0b011100>;
680
681 class MSUBR_Q_H_ENC : MSA_3RF_FMT<0b1110, 0b0, 0b011100>;
682 class MSUBR_Q_W_ENC : MSA_3RF_FMT<0b1110, 0b1, 0b011100>;
683
684 class MSUBV_B_ENC : MSA_3R_FMT<0b010, 0b00, 0b010010>;
685 class MSUBV_H_ENC : MSA_3R_FMT<0b010, 0b01, 0b010010>;
686 class MSUBV_W_ENC : MSA_3R_FMT<0b010, 0b10, 0b010010>;
687 class MSUBV_D_ENC : MSA_3R_FMT<0b010, 0b11, 0b010010>;
688
689 class MUL_Q_H_ENC : MSA_3RF_FMT<0b0000, 0b0, 0b011100>;
690 class MUL_Q_W_ENC : MSA_3RF_FMT<0b0000, 0b1, 0b011100>;
691
692 class MULR_Q_H_ENC : MSA_3RF_FMT<0b1100, 0b0, 0b011100>;
693 class MULR_Q_W_ENC : MSA_3RF_FMT<0b1100, 0b1, 0b011100>;
694
695 class MULV_B_ENC : MSA_3R_FMT<0b000, 0b00, 0b010010>;
696 class MULV_H_ENC : MSA_3R_FMT<0b000, 0b01, 0b010010>;
697 class MULV_W_ENC : MSA_3R_FMT<0b000, 0b10, 0b010010>;
698 class MULV_D_ENC : MSA_3R_FMT<0b000, 0b11, 0b010010>;
699
700 class NLOC_B_ENC : MSA_2R_FMT<0b11000010, 0b00, 0b011110>;
701 class NLOC_H_ENC : MSA_2R_FMT<0b11000010, 0b01, 0b011110>;
702 class NLOC_W_ENC : MSA_2R_FMT<0b11000010, 0b10, 0b011110>;
703 class NLOC_D_ENC : MSA_2R_FMT<0b11000010, 0b11, 0b011110>;
704
705 class NLZC_B_ENC : MSA_2R_FMT<0b11000011, 0b00, 0b011110>;
706 class NLZC_H_ENC : MSA_2R_FMT<0b11000011, 0b01, 0b011110>;
707 class NLZC_W_ENC : MSA_2R_FMT<0b11000011, 0b10, 0b011110>;
708 class NLZC_D_ENC : MSA_2R_FMT<0b11000011, 0b11, 0b011110>;
709
710 class NOR_V_ENC : MSA_VEC_FMT<0b00010, 0b011110>;
711
712 class NORI_B_ENC : MSA_I8_FMT<0b10, 0b000000>;
713
714 class OR_V_ENC : MSA_VEC_FMT<0b00001, 0b011110>;
715
716 class ORI_B_ENC  : MSA_I8_FMT<0b01, 0b000000>;
717
718 class PCKEV_B_ENC : MSA_3R_FMT<0b010, 0b00, 0b010100>;
719 class PCKEV_H_ENC : MSA_3R_FMT<0b010, 0b01, 0b010100>;
720 class PCKEV_W_ENC : MSA_3R_FMT<0b010, 0b10, 0b010100>;
721 class PCKEV_D_ENC : MSA_3R_FMT<0b010, 0b11, 0b010100>;
722
723 class PCKOD_B_ENC : MSA_3R_FMT<0b011, 0b00, 0b010100>;
724 class PCKOD_H_ENC : MSA_3R_FMT<0b011, 0b01, 0b010100>;
725 class PCKOD_W_ENC : MSA_3R_FMT<0b011, 0b10, 0b010100>;
726 class PCKOD_D_ENC : MSA_3R_FMT<0b011, 0b11, 0b010100>;
727
728 class PCNT_B_ENC : MSA_2R_FMT<0b11000001, 0b00, 0b011110>;
729 class PCNT_H_ENC : MSA_2R_FMT<0b11000001, 0b01, 0b011110>;
730 class PCNT_W_ENC : MSA_2R_FMT<0b11000001, 0b10, 0b011110>;
731 class PCNT_D_ENC : MSA_2R_FMT<0b11000001, 0b11, 0b011110>;
732
733 class SAT_S_B_ENC : MSA_BIT_B_FMT<0b000, 0b001010>;
734 class SAT_S_H_ENC : MSA_BIT_H_FMT<0b000, 0b001010>;
735 class SAT_S_W_ENC : MSA_BIT_W_FMT<0b000, 0b001010>;
736 class SAT_S_D_ENC : MSA_BIT_D_FMT<0b000, 0b001010>;
737
738 class SAT_U_B_ENC : MSA_BIT_B_FMT<0b001, 0b001010>;
739 class SAT_U_H_ENC : MSA_BIT_H_FMT<0b001, 0b001010>;
740 class SAT_U_W_ENC : MSA_BIT_W_FMT<0b001, 0b001010>;
741 class SAT_U_D_ENC : MSA_BIT_D_FMT<0b001, 0b001010>;
742
743 class SHF_B_ENC  : MSA_I8_FMT<0b00, 0b000010>;
744 class SHF_H_ENC  : MSA_I8_FMT<0b01, 0b000010>;
745 class SHF_W_ENC  : MSA_I8_FMT<0b10, 0b000010>;
746
747 class SLD_B_ENC : MSA_3R_FMT<0b000, 0b00, 0b010100>;
748 class SLD_H_ENC : MSA_3R_FMT<0b000, 0b01, 0b010100>;
749 class SLD_W_ENC : MSA_3R_FMT<0b000, 0b10, 0b010100>;
750 class SLD_D_ENC : MSA_3R_FMT<0b000, 0b11, 0b010100>;
751
752 class SLDI_B_ENC : MSA_ELM_B_FMT<0b0000, 0b011001>;
753 class SLDI_H_ENC : MSA_ELM_H_FMT<0b0000, 0b011001>;
754 class SLDI_W_ENC : MSA_ELM_W_FMT<0b0000, 0b011001>;
755 class SLDI_D_ENC : MSA_ELM_D_FMT<0b0000, 0b011001>;
756
757 class SLL_B_ENC : MSA_3R_FMT<0b000, 0b00, 0b001101>;
758 class SLL_H_ENC : MSA_3R_FMT<0b000, 0b01, 0b001101>;
759 class SLL_W_ENC : MSA_3R_FMT<0b000, 0b10, 0b001101>;
760 class SLL_D_ENC : MSA_3R_FMT<0b000, 0b11, 0b001101>;
761
762 class SLLI_B_ENC : MSA_BIT_B_FMT<0b000, 0b001001>;
763 class SLLI_H_ENC : MSA_BIT_H_FMT<0b000, 0b001001>;
764 class SLLI_W_ENC : MSA_BIT_W_FMT<0b000, 0b001001>;
765 class SLLI_D_ENC : MSA_BIT_D_FMT<0b000, 0b001001>;
766
767 class SPLAT_B_ENC : MSA_3R_FMT<0b001, 0b00, 0b010100>;
768 class SPLAT_H_ENC : MSA_3R_FMT<0b001, 0b01, 0b010100>;
769 class SPLAT_W_ENC : MSA_3R_FMT<0b001, 0b10, 0b010100>;
770 class SPLAT_D_ENC : MSA_3R_FMT<0b001, 0b11, 0b010100>;
771
772 class SPLATI_B_ENC : MSA_ELM_B_FMT<0b0001, 0b011001>;
773 class SPLATI_H_ENC : MSA_ELM_H_FMT<0b0001, 0b011001>;
774 class SPLATI_W_ENC : MSA_ELM_W_FMT<0b0001, 0b011001>;
775 class SPLATI_D_ENC : MSA_ELM_D_FMT<0b0001, 0b011001>;
776
777 class SRA_B_ENC : MSA_3R_FMT<0b001, 0b00, 0b001101>;
778 class SRA_H_ENC : MSA_3R_FMT<0b001, 0b01, 0b001101>;
779 class SRA_W_ENC : MSA_3R_FMT<0b001, 0b10, 0b001101>;
780 class SRA_D_ENC : MSA_3R_FMT<0b001, 0b11, 0b001101>;
781
782 class SRAI_B_ENC : MSA_BIT_B_FMT<0b001, 0b001001>;
783 class SRAI_H_ENC : MSA_BIT_H_FMT<0b001, 0b001001>;
784 class SRAI_W_ENC : MSA_BIT_W_FMT<0b001, 0b001001>;
785 class SRAI_D_ENC : MSA_BIT_D_FMT<0b001, 0b001001>;
786
787 class SRAR_B_ENC : MSA_3R_FMT<0b001, 0b00, 0b010101>;
788 class SRAR_H_ENC : MSA_3R_FMT<0b001, 0b01, 0b010101>;
789 class SRAR_W_ENC : MSA_3R_FMT<0b001, 0b10, 0b010101>;
790 class SRAR_D_ENC : MSA_3R_FMT<0b001, 0b11, 0b010101>;
791
792 class SRARI_B_ENC : MSA_BIT_B_FMT<0b010, 0b001010>;
793 class SRARI_H_ENC : MSA_BIT_H_FMT<0b010, 0b001010>;
794 class SRARI_W_ENC : MSA_BIT_W_FMT<0b010, 0b001010>;
795 class SRARI_D_ENC : MSA_BIT_D_FMT<0b010, 0b001010>;
796
797 class SRL_B_ENC : MSA_3R_FMT<0b010, 0b00, 0b001101>;
798 class SRL_H_ENC : MSA_3R_FMT<0b010, 0b01, 0b001101>;
799 class SRL_W_ENC : MSA_3R_FMT<0b010, 0b10, 0b001101>;
800 class SRL_D_ENC : MSA_3R_FMT<0b010, 0b11, 0b001101>;
801
802 class SRLI_B_ENC : MSA_BIT_B_FMT<0b010, 0b001001>;
803 class SRLI_H_ENC : MSA_BIT_H_FMT<0b010, 0b001001>;
804 class SRLI_W_ENC : MSA_BIT_W_FMT<0b010, 0b001001>;
805 class SRLI_D_ENC : MSA_BIT_D_FMT<0b010, 0b001001>;
806
807 class SRLR_B_ENC : MSA_3R_FMT<0b010, 0b00, 0b010101>;
808 class SRLR_H_ENC : MSA_3R_FMT<0b010, 0b01, 0b010101>;
809 class SRLR_W_ENC : MSA_3R_FMT<0b010, 0b10, 0b010101>;
810 class SRLR_D_ENC : MSA_3R_FMT<0b010, 0b11, 0b010101>;
811
812 class SRLRI_B_ENC : MSA_BIT_B_FMT<0b011, 0b001010>;
813 class SRLRI_H_ENC : MSA_BIT_H_FMT<0b011, 0b001010>;
814 class SRLRI_W_ENC : MSA_BIT_W_FMT<0b011, 0b001010>;
815 class SRLRI_D_ENC : MSA_BIT_D_FMT<0b011, 0b001010>;
816
817 class ST_B_ENC   : MSA_I5_FMT<0b111, 0b00, 0b000111>;
818 class ST_H_ENC   : MSA_I5_FMT<0b111, 0b01, 0b000111>;
819 class ST_W_ENC   : MSA_I5_FMT<0b111, 0b10, 0b000111>;
820 class ST_D_ENC   : MSA_I5_FMT<0b111, 0b11, 0b000111>;
821
822 class STX_B_ENC  : MSA_3R_FMT<0b111, 0b00, 0b001111>;
823 class STX_H_ENC  : MSA_3R_FMT<0b111, 0b01, 0b001111>;
824 class STX_W_ENC  : MSA_3R_FMT<0b111, 0b10, 0b001111>;
825 class STX_D_ENC  : MSA_3R_FMT<0b111, 0b11, 0b001111>;
826
827 class SUBS_S_B_ENC : MSA_3R_FMT<0b000, 0b00, 0b010001>;
828 class SUBS_S_H_ENC : MSA_3R_FMT<0b000, 0b01, 0b010001>;
829 class SUBS_S_W_ENC : MSA_3R_FMT<0b000, 0b10, 0b010001>;
830 class SUBS_S_D_ENC : MSA_3R_FMT<0b000, 0b11, 0b010001>;
831
832 class SUBS_U_B_ENC : MSA_3R_FMT<0b001, 0b00, 0b010001>;
833 class SUBS_U_H_ENC : MSA_3R_FMT<0b001, 0b01, 0b010001>;
834 class SUBS_U_W_ENC : MSA_3R_FMT<0b001, 0b10, 0b010001>;
835 class SUBS_U_D_ENC : MSA_3R_FMT<0b001, 0b11, 0b010001>;
836
837 class SUBSUS_U_B_ENC : MSA_3R_FMT<0b011, 0b00, 0b010001>;
838 class SUBSUS_U_H_ENC : MSA_3R_FMT<0b011, 0b01, 0b010001>;
839 class SUBSUS_U_W_ENC : MSA_3R_FMT<0b011, 0b10, 0b010001>;
840 class SUBSUS_U_D_ENC : MSA_3R_FMT<0b011, 0b11, 0b010001>;
841
842 class SUBSUU_S_B_ENC : MSA_3R_FMT<0b010, 0b00, 0b010001>;
843 class SUBSUU_S_H_ENC : MSA_3R_FMT<0b010, 0b01, 0b010001>;
844 class SUBSUU_S_W_ENC : MSA_3R_FMT<0b010, 0b10, 0b010001>;
845 class SUBSUU_S_D_ENC : MSA_3R_FMT<0b010, 0b11, 0b010001>;
846
847 class SUBV_B_ENC : MSA_3R_FMT<0b001, 0b00, 0b001110>;
848 class SUBV_H_ENC : MSA_3R_FMT<0b001, 0b01, 0b001110>;
849 class SUBV_W_ENC : MSA_3R_FMT<0b001, 0b10, 0b001110>;
850 class SUBV_D_ENC : MSA_3R_FMT<0b001, 0b11, 0b001110>;
851
852 class SUBVI_B_ENC : MSA_I5_FMT<0b001, 0b00, 0b000110>;
853 class SUBVI_H_ENC : MSA_I5_FMT<0b001, 0b01, 0b000110>;
854 class SUBVI_W_ENC : MSA_I5_FMT<0b001, 0b10, 0b000110>;
855 class SUBVI_D_ENC : MSA_I5_FMT<0b001, 0b11, 0b000110>;
856
857 class VSHF_B_ENC : MSA_3R_FMT<0b000, 0b00, 0b010101>;
858 class VSHF_H_ENC : MSA_3R_FMT<0b000, 0b01, 0b010101>;
859 class VSHF_W_ENC : MSA_3R_FMT<0b000, 0b10, 0b010101>;
860 class VSHF_D_ENC : MSA_3R_FMT<0b000, 0b11, 0b010101>;
861
862 class XOR_V_ENC : MSA_VEC_FMT<0b00011, 0b011110>;
863
864 class XORI_B_ENC : MSA_I8_FMT<0b11, 0b000000>;
865
866 // Instruction desc.
867 class MSA_BIT_B_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
868                           RegisterClass RCWD, RegisterClass RCWS = RCWD,
869                           InstrItinClass itin = NoItinerary> {
870   dag OutOperandList = (outs RCWD:$wd);
871   dag InOperandList = (ins RCWS:$ws, uimm3:$u3);
872   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $u3");
873   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws, immZExt3:$u3))];
874   InstrItinClass Itinerary = itin;
875 }
876
877 class MSA_BIT_H_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
878                           RegisterClass RCWD, RegisterClass RCWS = RCWD,
879                           InstrItinClass itin = NoItinerary> {
880   dag OutOperandList = (outs RCWD:$wd);
881   dag InOperandList = (ins RCWS:$ws, uimm4:$u4);
882   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $u4");
883   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws, immZExt4:$u4))];
884   InstrItinClass Itinerary = itin;
885 }
886
887 class MSA_BIT_W_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
888                           RegisterClass RCWD, RegisterClass RCWS = RCWD,
889                           InstrItinClass itin = NoItinerary> {
890   dag OutOperandList = (outs RCWD:$wd);
891   dag InOperandList = (ins RCWS:$ws, uimm5:$u5);
892   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $u5");
893   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws, immZExt5:$u5))];
894   InstrItinClass Itinerary = itin;
895 }
896
897 class MSA_BIT_D_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
898                           RegisterClass RCWD, RegisterClass RCWS = RCWD,
899                           InstrItinClass itin = NoItinerary> {
900   dag OutOperandList = (outs RCWD:$wd);
901   dag InOperandList = (ins RCWS:$ws, uimm6:$u6);
902   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $u6");
903   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws, immZExt6:$u6))];
904   InstrItinClass Itinerary = itin;
905 }
906
907 class MSA_BIT_SPLATB_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
908                                RegisterClass RCWD, RegisterClass RCWS = RCWD,
909                                InstrItinClass itin = NoItinerary> {
910   dag OutOperandList = (outs RCWD:$wd);
911   dag InOperandList = (ins RCWS:$ws, uimm3:$u3);
912   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $u3");
913   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws,
914                                               (vsplati8 immZExt3:$u3)))];
915   InstrItinClass Itinerary = itin;
916 }
917
918 class MSA_BIT_SPLATH_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
919                                RegisterClass RCWD, RegisterClass RCWS = RCWD,
920                                InstrItinClass itin = NoItinerary> {
921   dag OutOperandList = (outs RCWD:$wd);
922   dag InOperandList = (ins RCWS:$ws, uimm4:$u4);
923   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $u4");
924   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws,
925                                               (vsplati16 immZExt4:$u4)))];
926   InstrItinClass Itinerary = itin;
927 }
928
929 class MSA_BIT_SPLATW_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
930                                RegisterClass RCWD, RegisterClass RCWS = RCWD,
931                                InstrItinClass itin = NoItinerary> {
932   dag OutOperandList = (outs RCWD:$wd);
933   dag InOperandList = (ins RCWS:$ws, uimm5:$u5);
934   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $u5");
935   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws,
936                                               (vsplati32 immZExt5:$u5)))];
937   InstrItinClass Itinerary = itin;
938 }
939
940 class MSA_BIT_SPLATD_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
941                                RegisterClass RCWD, RegisterClass RCWS = RCWD,
942                                InstrItinClass itin = NoItinerary> {
943   dag OutOperandList = (outs RCWD:$wd);
944   dag InOperandList = (ins RCWS:$ws, uimm6:$u6);
945   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $u6");
946   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws,
947                                               (vsplati64 immZExt6:$u6)))];
948   InstrItinClass Itinerary = itin;
949 }
950
951 class MSA_COPY_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
952                          ValueType VecTy, RegisterClass RCD, RegisterClass RCWS,
953                          InstrItinClass itin = NoItinerary> {
954   dag OutOperandList = (outs RCD:$rd);
955   dag InOperandList = (ins RCWS:$ws, uimm4:$n);
956   string AsmString = !strconcat(instr_asm, "\t$rd, $ws[$n]");
957   list<dag> Pattern = [(set RCD:$rd, (OpNode (VecTy RCWS:$ws), immZExt4:$n))];
958   InstrItinClass Itinerary = itin;
959 }
960
961 class MSA_I5_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
962                        SDPatternOperator SplatNode, RegisterClass RCWD,
963                        RegisterClass RCWS = RCWD,
964                        InstrItinClass itin = NoItinerary> {
965   dag OutOperandList = (outs RCWD:$wd);
966   dag InOperandList = (ins RCWS:$ws, uimm5:$u5);
967   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $u5");
968   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws,
969                                               (SplatNode immZExt5:$u5)))];
970   InstrItinClass Itinerary = itin;
971 }
972
973 // This class is deprecated and will be removed in the next few changes
974 class MSA_I5_X_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
975                          RegisterClass RCWD, RegisterClass RCWS = RCWD,
976                          InstrItinClass itin = NoItinerary> {
977   dag OutOperandList = (outs RCWD:$wd);
978   dag InOperandList = (ins RCWS:$ws, uimm5:$u5);
979   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $u5");
980   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws, immZExt5:$u5))];
981   InstrItinClass Itinerary = itin;
982 }
983
984 class MSA_SI5_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
985                        SDPatternOperator SplatNode, RegisterClass RCWD,
986                        RegisterClass RCWS = RCWD,
987                        InstrItinClass itin = NoItinerary> {
988   dag OutOperandList = (outs RCWD:$wd);
989   dag InOperandList = (ins RCWS:$ws, simm5:$s5);
990   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $s5");
991   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws,
992                                               (SplatNode immSExt5:$s5)))];
993   InstrItinClass Itinerary = itin;
994 }
995
996 class MSA_I8_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
997                        RegisterClass RCWD, RegisterClass RCWS = RCWD,
998                        InstrItinClass itin = NoItinerary> {
999   dag OutOperandList = (outs RCWD:$wd);
1000   dag InOperandList = (ins RCWS:$ws, uimm8:$u8);
1001   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $u8");
1002   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws, immZExt8:$u8))];
1003   InstrItinClass Itinerary = itin;
1004 }
1005
1006 class MSA_I10_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
1007                         RegisterClass RCWD,
1008                         InstrItinClass itin = NoItinerary> {
1009   dag OutOperandList = (outs RCWD:$wd);
1010   dag InOperandList = (ins simm10:$i10);
1011   string AsmString = !strconcat(instr_asm, "\t$wd, $i10");
1012   list<dag> Pattern = [(set RCWD:$wd, (OpNode immSExt10:$i10))];
1013   InstrItinClass Itinerary = itin;
1014 }
1015
1016 class MSA_2R_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
1017                        RegisterClass RCWD, RegisterClass RCWS = RCWD,
1018                        InstrItinClass itin = NoItinerary> {
1019   dag OutOperandList = (outs RCWD:$wd);
1020   dag InOperandList = (ins RCWS:$ws);
1021   string AsmString = !strconcat(instr_asm, "\t$wd, $ws");
1022   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws))];
1023   InstrItinClass Itinerary = itin;
1024 }
1025
1026 class MSA_2RF_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
1027                         RegisterClass RCWD, RegisterClass RCWS = RCWD,
1028                         InstrItinClass itin = NoItinerary> :
1029   MSA_2R_DESC_BASE<instr_asm, OpNode, RCWD, RCWS, itin>;
1030
1031
1032 class MSA_3R_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
1033                        RegisterClass RCWD, RegisterClass RCWS = RCWD,
1034                        RegisterClass RCWT = RCWD,
1035                        InstrItinClass itin = NoItinerary> {
1036   dag OutOperandList = (outs RCWD:$wd);
1037   dag InOperandList = (ins RCWS:$ws, RCWT:$wt);
1038   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $wt");
1039   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws, RCWT:$wt))];
1040   InstrItinClass Itinerary = itin;
1041 }
1042
1043 class MSA_3R_4R_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
1044                           RegisterClass RCWD, RegisterClass RCWS = RCWD,
1045                           RegisterClass RCWT = RCWD,
1046                           InstrItinClass itin = NoItinerary> {
1047   dag OutOperandList = (outs RCWD:$wd);
1048   dag InOperandList = (ins RCWD:$wd_in, RCWS:$ws, RCWT:$wt);
1049   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $wt");
1050   list<dag> Pattern = [(set RCWD:$wd,
1051                        (OpNode RCWD:$wd_in, RCWS:$ws, RCWT:$wt))];
1052   InstrItinClass Itinerary = itin;
1053   string Constraints = "$wd = $wd_in";
1054 }
1055
1056 class MSA_3RF_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
1057                         RegisterClass RCWD, RegisterClass RCWS = RCWD,
1058                         RegisterClass RCWT = RCWD,
1059                         InstrItinClass itin = NoItinerary> :
1060   MSA_3R_DESC_BASE<instr_asm, OpNode, RCWD, RCWS, RCWT, itin>;
1061
1062 class MSA_3RF_4RF_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
1063                             RegisterClass RCWD, RegisterClass RCWS = RCWD,
1064                             RegisterClass RCWT = RCWD,
1065                             InstrItinClass itin = NoItinerary> :
1066   MSA_3R_4R_DESC_BASE<instr_asm, OpNode, RCWD, RCWS, RCWT, itin>;
1067
1068 class MSA_CBRANCH_DESC_BASE<string instr_asm, RegisterClass RCWD> {
1069   dag OutOperandList = (outs);
1070   dag InOperandList = (ins RCWD:$wd, brtarget:$offset);
1071   string AsmString = !strconcat(instr_asm, "\t$wd, $offset");
1072   list<dag> Pattern = [];
1073   InstrItinClass Itinerary = IIBranch;
1074   bit isBranch = 1;
1075   bit isTerminator = 1;
1076   bit hasDelaySlot = 1;
1077   list<Register> Defs = [AT];
1078 }
1079
1080 class MSA_INSERT_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
1081                            RegisterClass RCD, RegisterClass RCWS,
1082                            InstrItinClass itin = NoItinerary> {
1083   dag OutOperandList = (outs RCD:$wd);
1084   dag InOperandList = (ins RCD:$wd_in, RCWS:$rs, uimm6:$n);
1085   string AsmString = !strconcat(instr_asm, "\t$wd[$n], $rs");
1086   list<dag> Pattern = [(set RCD:$wd, (OpNode RCD:$wd_in,
1087                                              RCWS:$rs,
1088                                              immZExt6:$n))];
1089   InstrItinClass Itinerary = itin;
1090   string Constraints = "$wd = $wd_in";
1091 }
1092
1093 class MSA_INSVE_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
1094                           RegisterClass RCWD, RegisterClass RCWS = RCWD,
1095                           InstrItinClass itin = NoItinerary> {
1096   dag OutOperandList = (outs RCWD:$wd);
1097   dag InOperandList = (ins RCWD:$wd_in, uimm6:$n, RCWS:$ws);
1098   string AsmString = !strconcat(instr_asm, "\t$wd[$n], $ws[0]");
1099   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWD:$wd_in,
1100                                               immZExt6:$n,
1101                                               RCWS:$ws))];
1102   InstrItinClass Itinerary = itin;
1103   string Constraints = "$wd = $wd_in";
1104 }
1105
1106 class MSA_VEC_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
1107                         RegisterClass RCWD, RegisterClass RCWS = RCWD,
1108                         RegisterClass RCWT = RCWD,
1109                         InstrItinClass itin = NoItinerary> {
1110   dag OutOperandList = (outs RCWD:$wd);
1111   dag InOperandList = (ins RCWS:$ws, RCWT:$wt);
1112   string AsmString = !strconcat(instr_asm, "\t$wd, $ws, $wt");
1113   list<dag> Pattern = [(set RCWD:$wd, (OpNode RCWS:$ws, RCWT:$wt))];
1114   InstrItinClass Itinerary = itin;
1115 }
1116
1117 class MSA_VEC_PSEUDO_BASE<SDPatternOperator OpNode, RegisterClass RCWD,
1118                           RegisterClass RCWS = RCWD,
1119                           RegisterClass RCWT = RCWD> :
1120       MipsPseudo<(outs RCWD:$wd), (ins RCWS:$ws, RCWT:$wt),
1121                  [(set RCWD:$wd, (OpNode RCWS:$ws, RCWT:$wt))]>;
1122
1123 class ADD_A_B_DESC : MSA_3R_DESC_BASE<"add_a.b", int_mips_add_a_b, MSA128B>,
1124                      IsCommutable;
1125 class ADD_A_H_DESC : MSA_3R_DESC_BASE<"add_a.h", int_mips_add_a_h, MSA128H>,
1126                      IsCommutable;
1127 class ADD_A_W_DESC : MSA_3R_DESC_BASE<"add_a.w", int_mips_add_a_w, MSA128W>,
1128                      IsCommutable;
1129 class ADD_A_D_DESC : MSA_3R_DESC_BASE<"add_a.d", int_mips_add_a_d, MSA128D>,
1130                      IsCommutable;
1131
1132 class ADDS_A_B_DESC : MSA_3R_DESC_BASE<"adds_a.b", int_mips_adds_a_b, MSA128B>,
1133                       IsCommutable;
1134 class ADDS_A_H_DESC : MSA_3R_DESC_BASE<"adds_a.h", int_mips_adds_a_h, MSA128H>,
1135                       IsCommutable;
1136 class ADDS_A_W_DESC : MSA_3R_DESC_BASE<"adds_a.w", int_mips_adds_a_w, MSA128W>,
1137                       IsCommutable;
1138 class ADDS_A_D_DESC : MSA_3R_DESC_BASE<"adds_a.d", int_mips_adds_a_d, MSA128D>,
1139                       IsCommutable;
1140
1141 class ADDS_S_B_DESC : MSA_3R_DESC_BASE<"adds_s.b", int_mips_adds_s_b, MSA128B>,
1142                       IsCommutable;
1143 class ADDS_S_H_DESC : MSA_3R_DESC_BASE<"adds_s.h", int_mips_adds_s_h, MSA128H>,
1144                       IsCommutable;
1145 class ADDS_S_W_DESC : MSA_3R_DESC_BASE<"adds_s.w", int_mips_adds_s_w, MSA128W>,
1146                       IsCommutable;
1147 class ADDS_S_D_DESC : MSA_3R_DESC_BASE<"adds_s.d", int_mips_adds_s_d, MSA128D>,
1148                       IsCommutable;
1149
1150 class ADDS_U_B_DESC : MSA_3R_DESC_BASE<"adds_u.b", int_mips_adds_u_b, MSA128B>,
1151                       IsCommutable;
1152 class ADDS_U_H_DESC : MSA_3R_DESC_BASE<"adds_u.h", int_mips_adds_u_h, MSA128H>,
1153                       IsCommutable;
1154 class ADDS_U_W_DESC : MSA_3R_DESC_BASE<"adds_u.w", int_mips_adds_u_w, MSA128W>,
1155                       IsCommutable;
1156 class ADDS_U_D_DESC : MSA_3R_DESC_BASE<"adds_u.d", int_mips_adds_u_d, MSA128D>,
1157                       IsCommutable;
1158
1159 class ADDV_B_DESC : MSA_3R_DESC_BASE<"addv.b", add, MSA128B>, IsCommutable;
1160 class ADDV_H_DESC : MSA_3R_DESC_BASE<"addv.h", add, MSA128H>, IsCommutable;
1161 class ADDV_W_DESC : MSA_3R_DESC_BASE<"addv.w", add, MSA128W>, IsCommutable;
1162 class ADDV_D_DESC : MSA_3R_DESC_BASE<"addv.d", add, MSA128D>, IsCommutable;
1163
1164 class ADDVI_B_DESC : MSA_I5_DESC_BASE<"addvi.b", add, vsplati8,  MSA128B>;
1165 class ADDVI_H_DESC : MSA_I5_DESC_BASE<"addvi.h", add, vsplati16, MSA128H>;
1166 class ADDVI_W_DESC : MSA_I5_DESC_BASE<"addvi.w", add, vsplati32, MSA128W>;
1167 class ADDVI_D_DESC : MSA_I5_DESC_BASE<"addvi.d", add, vsplati64, MSA128D>;
1168
1169 class AND_V_DESC : MSA_VEC_DESC_BASE<"and.v", and, MSA128B>;
1170 class AND_V_H_PSEUDO_DESC : MSA_VEC_PSEUDO_BASE<and, MSA128H>;
1171 class AND_V_W_PSEUDO_DESC : MSA_VEC_PSEUDO_BASE<and, MSA128W>;
1172 class AND_V_D_PSEUDO_DESC : MSA_VEC_PSEUDO_BASE<and, MSA128D>;
1173
1174 class ANDI_B_DESC : MSA_I8_DESC_BASE<"andi.b", int_mips_andi_b, MSA128B>;
1175
1176 class ASUB_S_B_DESC : MSA_3R_DESC_BASE<"asub_s.b", int_mips_asub_s_b, MSA128B>;
1177 class ASUB_S_H_DESC : MSA_3R_DESC_BASE<"asub_s.h", int_mips_asub_s_h, MSA128H>;
1178 class ASUB_S_W_DESC : MSA_3R_DESC_BASE<"asub_s.w", int_mips_asub_s_w, MSA128W>;
1179 class ASUB_S_D_DESC : MSA_3R_DESC_BASE<"asub_s.d", int_mips_asub_s_d, MSA128D>;
1180
1181 class ASUB_U_B_DESC : MSA_3R_DESC_BASE<"asub_u.b", int_mips_asub_u_b, MSA128B>;
1182 class ASUB_U_H_DESC : MSA_3R_DESC_BASE<"asub_u.h", int_mips_asub_u_h, MSA128H>;
1183 class ASUB_U_W_DESC : MSA_3R_DESC_BASE<"asub_u.w", int_mips_asub_u_w, MSA128W>;
1184 class ASUB_U_D_DESC : MSA_3R_DESC_BASE<"asub_u.d", int_mips_asub_u_d, MSA128D>;
1185
1186 class AVE_S_B_DESC : MSA_3R_DESC_BASE<"ave_s.b", int_mips_ave_s_b, MSA128B>,
1187                      IsCommutable;
1188 class AVE_S_H_DESC : MSA_3R_DESC_BASE<"ave_s.h", int_mips_ave_s_h, MSA128H>,
1189                      IsCommutable;
1190 class AVE_S_W_DESC : MSA_3R_DESC_BASE<"ave_s.w", int_mips_ave_s_w, MSA128W>,
1191                      IsCommutable;
1192 class AVE_S_D_DESC : MSA_3R_DESC_BASE<"ave_s.d", int_mips_ave_s_d, MSA128D>,
1193                      IsCommutable;
1194
1195 class AVE_U_B_DESC : MSA_3R_DESC_BASE<"ave_u.b", int_mips_ave_u_b, MSA128B>,
1196                      IsCommutable;
1197 class AVE_U_H_DESC : MSA_3R_DESC_BASE<"ave_u.h", int_mips_ave_u_h, MSA128H>,
1198                      IsCommutable;
1199 class AVE_U_W_DESC : MSA_3R_DESC_BASE<"ave_u.w", int_mips_ave_u_w, MSA128W>,
1200                      IsCommutable;
1201 class AVE_U_D_DESC : MSA_3R_DESC_BASE<"ave_u.d", int_mips_ave_u_d, MSA128D>,
1202                      IsCommutable;
1203
1204 class AVER_S_B_DESC : MSA_3R_DESC_BASE<"aver_s.b", int_mips_aver_s_b, MSA128B>,
1205                       IsCommutable;
1206 class AVER_S_H_DESC : MSA_3R_DESC_BASE<"aver_s.h", int_mips_aver_s_h, MSA128H>,
1207                       IsCommutable;
1208 class AVER_S_W_DESC : MSA_3R_DESC_BASE<"aver_s.w", int_mips_aver_s_w, MSA128W>,
1209                       IsCommutable;
1210 class AVER_S_D_DESC : MSA_3R_DESC_BASE<"aver_s.d", int_mips_aver_s_d, MSA128D>,
1211                       IsCommutable;
1212
1213 class AVER_U_B_DESC : MSA_3R_DESC_BASE<"aver_u.b", int_mips_aver_u_b, MSA128B>,
1214                       IsCommutable;
1215 class AVER_U_H_DESC : MSA_3R_DESC_BASE<"aver_u.h", int_mips_aver_u_h, MSA128H>,
1216                       IsCommutable;
1217 class AVER_U_W_DESC : MSA_3R_DESC_BASE<"aver_u.w", int_mips_aver_u_w, MSA128W>,
1218                       IsCommutable;
1219 class AVER_U_D_DESC : MSA_3R_DESC_BASE<"aver_u.d", int_mips_aver_u_d, MSA128D>,
1220                       IsCommutable;
1221
1222 class BCLR_B_DESC : MSA_3R_DESC_BASE<"bclr.b", int_mips_bclr_b, MSA128B>;
1223 class BCLR_H_DESC : MSA_3R_DESC_BASE<"bclr.h", int_mips_bclr_h, MSA128H>;
1224 class BCLR_W_DESC : MSA_3R_DESC_BASE<"bclr.w", int_mips_bclr_w, MSA128W>;
1225 class BCLR_D_DESC : MSA_3R_DESC_BASE<"bclr.d", int_mips_bclr_d, MSA128D>;
1226
1227 class BCLRI_B_DESC : MSA_BIT_B_DESC_BASE<"bclri.b", int_mips_bclri_b, MSA128B>;
1228 class BCLRI_H_DESC : MSA_BIT_H_DESC_BASE<"bclri.h", int_mips_bclri_h, MSA128H>;
1229 class BCLRI_W_DESC : MSA_BIT_W_DESC_BASE<"bclri.w", int_mips_bclri_w, MSA128W>;
1230 class BCLRI_D_DESC : MSA_BIT_D_DESC_BASE<"bclri.d", int_mips_bclri_d, MSA128D>;
1231
1232 class BINSL_B_DESC : MSA_3R_DESC_BASE<"binsl.b", int_mips_binsl_b, MSA128B>;
1233 class BINSL_H_DESC : MSA_3R_DESC_BASE<"binsl.h", int_mips_binsl_h, MSA128H>;
1234 class BINSL_W_DESC : MSA_3R_DESC_BASE<"binsl.w", int_mips_binsl_w, MSA128W>;
1235 class BINSL_D_DESC : MSA_3R_DESC_BASE<"binsl.d", int_mips_binsl_d, MSA128D>;
1236
1237 class BINSLI_B_DESC : MSA_BIT_B_DESC_BASE<"binsli.b", int_mips_binsli_b,
1238                                           MSA128B>;
1239 class BINSLI_H_DESC : MSA_BIT_H_DESC_BASE<"binsli.h", int_mips_binsli_h,
1240                                           MSA128H>;
1241 class BINSLI_W_DESC : MSA_BIT_W_DESC_BASE<"binsli.w", int_mips_binsli_w,
1242                                           MSA128W>;
1243 class BINSLI_D_DESC : MSA_BIT_D_DESC_BASE<"binsli.d", int_mips_binsli_d,
1244                                           MSA128D>;
1245
1246 class BINSR_B_DESC : MSA_3R_DESC_BASE<"binsr.b", int_mips_binsr_b, MSA128B>;
1247 class BINSR_H_DESC : MSA_3R_DESC_BASE<"binsr.h", int_mips_binsr_h, MSA128H>;
1248 class BINSR_W_DESC : MSA_3R_DESC_BASE<"binsr.w", int_mips_binsr_w, MSA128W>;
1249 class BINSR_D_DESC : MSA_3R_DESC_BASE<"binsr.d", int_mips_binsr_d, MSA128D>;
1250
1251 class BINSRI_B_DESC : MSA_BIT_B_DESC_BASE<"binsri.b", int_mips_binsri_b,
1252                                           MSA128B>;
1253 class BINSRI_H_DESC : MSA_BIT_H_DESC_BASE<"binsri.h", int_mips_binsri_h,
1254                                           MSA128H>;
1255 class BINSRI_W_DESC : MSA_BIT_W_DESC_BASE<"binsri.w", int_mips_binsri_w,
1256                                           MSA128W>;
1257 class BINSRI_D_DESC : MSA_BIT_D_DESC_BASE<"binsri.d", int_mips_binsri_d,
1258                                           MSA128D>;
1259
1260 class BMNZ_V_DESC : MSA_VEC_DESC_BASE<"bmnz.v", int_mips_bmnz_v, MSA128B>;
1261
1262 class BMNZI_B_DESC : MSA_I8_DESC_BASE<"bmnzi.b", int_mips_bmnzi_b, MSA128B>;
1263
1264 class BMZ_V_DESC : MSA_VEC_DESC_BASE<"bmz.v", int_mips_bmz_v, MSA128B>;
1265
1266 class BMZI_B_DESC : MSA_I8_DESC_BASE<"bmzi.b", int_mips_bmzi_b, MSA128B>;
1267
1268 class BNEG_B_DESC : MSA_3R_DESC_BASE<"bneg.b", int_mips_bneg_b, MSA128B>;
1269 class BNEG_H_DESC : MSA_3R_DESC_BASE<"bneg.h", int_mips_bneg_h, MSA128H>;
1270 class BNEG_W_DESC : MSA_3R_DESC_BASE<"bneg.w", int_mips_bneg_w, MSA128W>;
1271 class BNEG_D_DESC : MSA_3R_DESC_BASE<"bneg.d", int_mips_bneg_d, MSA128D>;
1272
1273 class BNEGI_B_DESC : MSA_BIT_B_DESC_BASE<"bnegi.b", int_mips_bnegi_b, MSA128B>;
1274 class BNEGI_H_DESC : MSA_BIT_H_DESC_BASE<"bnegi.h", int_mips_bnegi_h, MSA128H>;
1275 class BNEGI_W_DESC : MSA_BIT_W_DESC_BASE<"bnegi.w", int_mips_bnegi_w, MSA128W>;
1276 class BNEGI_D_DESC : MSA_BIT_D_DESC_BASE<"bnegi.d", int_mips_bnegi_d, MSA128D>;
1277
1278 class BNZ_B_DESC : MSA_CBRANCH_DESC_BASE<"bnz.b", MSA128B>;
1279 class BNZ_H_DESC : MSA_CBRANCH_DESC_BASE<"bnz.h", MSA128H>;
1280 class BNZ_W_DESC : MSA_CBRANCH_DESC_BASE<"bnz.w", MSA128W>;
1281 class BNZ_D_DESC : MSA_CBRANCH_DESC_BASE<"bnz.d", MSA128D>;
1282
1283 class BNZ_V_DESC : MSA_CBRANCH_DESC_BASE<"bnz.v", MSA128B>;
1284
1285 class BSEL_V_DESC {
1286   dag OutOperandList = (outs MSA128B:$wd);
1287   dag InOperandList = (ins MSA128B:$wd_in, MSA128B:$ws, MSA128B:$wt);
1288   string AsmString = "bsel.v\t$wd, $ws, $wt";
1289   list<dag> Pattern = [(set MSA128B:$wd, (vselect MSA128B:$wd_in, MSA128B:$ws,
1290                                                   MSA128B:$wt))];
1291   InstrItinClass Itinerary = NoItinerary;
1292   string Constraints = "$wd = $wd_in";
1293 }
1294
1295 class BSELI_B_DESC {
1296   dag OutOperandList = (outs MSA128B:$wd);
1297   dag InOperandList = (ins MSA128B:$wd_in, MSA128B:$ws, uimm8:$u8);
1298   string AsmString = "bseli.b\t$wd, $ws, $u8";
1299   list<dag> Pattern = [(set MSA128B:$wd, (vselect MSA128B:$wd_in,
1300                                                   MSA128B:$ws,
1301                                                   (vsplati8 immZExt8:$u8)))];
1302   InstrItinClass Itinerary = NoItinerary;
1303   string Constraints = "$wd = $wd_in";
1304 }
1305
1306 class BSET_B_DESC : MSA_3R_DESC_BASE<"bset.b", int_mips_bset_b, MSA128B>;
1307 class BSET_H_DESC : MSA_3R_DESC_BASE<"bset.h", int_mips_bset_h, MSA128H>;
1308 class BSET_W_DESC : MSA_3R_DESC_BASE<"bset.w", int_mips_bset_w, MSA128W>;
1309 class BSET_D_DESC : MSA_3R_DESC_BASE<"bset.d", int_mips_bset_d, MSA128D>;
1310
1311 class BSETI_B_DESC : MSA_BIT_B_DESC_BASE<"bseti.b", int_mips_bseti_b, MSA128B>;
1312 class BSETI_H_DESC : MSA_BIT_H_DESC_BASE<"bseti.h", int_mips_bseti_h, MSA128H>;
1313 class BSETI_W_DESC : MSA_BIT_W_DESC_BASE<"bseti.w", int_mips_bseti_w, MSA128W>;
1314 class BSETI_D_DESC : MSA_BIT_D_DESC_BASE<"bseti.d", int_mips_bseti_d, MSA128D>;
1315
1316 class BZ_B_DESC : MSA_CBRANCH_DESC_BASE<"bz.b", MSA128B>;
1317 class BZ_H_DESC : MSA_CBRANCH_DESC_BASE<"bz.h", MSA128H>;
1318 class BZ_W_DESC : MSA_CBRANCH_DESC_BASE<"bz.w", MSA128W>;
1319 class BZ_D_DESC : MSA_CBRANCH_DESC_BASE<"bz.d", MSA128D>;
1320
1321 class BZ_V_DESC : MSA_CBRANCH_DESC_BASE<"bz.v", MSA128B>;
1322
1323 class CEQ_B_DESC : MSA_3R_DESC_BASE<"ceq.b", vseteq_v16i8, MSA128B>,
1324                    IsCommutable;
1325 class CEQ_H_DESC : MSA_3R_DESC_BASE<"ceq.h", vseteq_v8i16, MSA128H>,
1326                    IsCommutable;
1327 class CEQ_W_DESC : MSA_3R_DESC_BASE<"ceq.w", vseteq_v4i32, MSA128W>,
1328                    IsCommutable;
1329 class CEQ_D_DESC : MSA_3R_DESC_BASE<"ceq.d", vseteq_v2i64, MSA128D>,
1330                    IsCommutable;
1331
1332 class CEQI_B_DESC : MSA_SI5_DESC_BASE<"ceqi.b", vseteq_v16i8, vsplati8,
1333                                       MSA128B>;
1334 class CEQI_H_DESC : MSA_SI5_DESC_BASE<"ceqi.h", vseteq_v8i16, vsplati16,
1335                                       MSA128H>;
1336 class CEQI_W_DESC : MSA_SI5_DESC_BASE<"ceqi.w", vseteq_v4i32, vsplati32,
1337                                       MSA128W>;
1338 class CEQI_D_DESC : MSA_SI5_DESC_BASE<"ceqi.d", vseteq_v2i64, vsplati64,
1339                                       MSA128D>;
1340
1341 class CFCMSA_DESC {
1342   dag OutOperandList = (outs GPR32:$rd);
1343   dag InOperandList = (ins MSACtrl:$cs);
1344   string AsmString = "cfcmsa\t$rd, $cs";
1345   InstrItinClass Itinerary = NoItinerary;
1346   bit hasSideEffects = 1;
1347 }
1348
1349 class CLE_S_B_DESC : MSA_3R_DESC_BASE<"cle_s.b", vsetle_v16i8, MSA128B>;
1350 class CLE_S_H_DESC : MSA_3R_DESC_BASE<"cle_s.h", vsetle_v8i16, MSA128H>;
1351 class CLE_S_W_DESC : MSA_3R_DESC_BASE<"cle_s.w", vsetle_v4i32, MSA128W>;
1352 class CLE_S_D_DESC : MSA_3R_DESC_BASE<"cle_s.d", vsetle_v2i64, MSA128D>;
1353
1354 class CLE_U_B_DESC : MSA_3R_DESC_BASE<"cle_u.b", vsetule_v16i8, MSA128B>;
1355 class CLE_U_H_DESC : MSA_3R_DESC_BASE<"cle_u.h", vsetule_v8i16, MSA128H>;
1356 class CLE_U_W_DESC : MSA_3R_DESC_BASE<"cle_u.w", vsetule_v4i32, MSA128W>;
1357 class CLE_U_D_DESC : MSA_3R_DESC_BASE<"cle_u.d", vsetule_v2i64, MSA128D>;
1358
1359 class CLEI_S_B_DESC : MSA_SI5_DESC_BASE<"clei_s.b", vsetle_v16i8, vsplati8,
1360                                         MSA128B>;
1361 class CLEI_S_H_DESC : MSA_SI5_DESC_BASE<"clei_s.h", vsetle_v8i16, vsplati16,
1362                                         MSA128H>;
1363 class CLEI_S_W_DESC : MSA_SI5_DESC_BASE<"clei_s.w", vsetle_v4i32, vsplati32,
1364                                         MSA128W>;
1365 class CLEI_S_D_DESC : MSA_SI5_DESC_BASE<"clei_s.d", vsetle_v2i64, vsplati64,
1366                                         MSA128D>;
1367
1368 class CLEI_U_B_DESC : MSA_I5_DESC_BASE<"clei_u.b", vsetule_v16i8, vsplati8,
1369                                        MSA128B>;
1370 class CLEI_U_H_DESC : MSA_I5_DESC_BASE<"clei_u.h", vsetule_v8i16, vsplati16,
1371                                        MSA128H>;
1372 class CLEI_U_W_DESC : MSA_I5_DESC_BASE<"clei_u.w", vsetule_v4i32, vsplati32,
1373                                        MSA128W>;
1374 class CLEI_U_D_DESC : MSA_I5_DESC_BASE<"clei_u.d", vsetule_v2i64, vsplati64,
1375                                        MSA128D>;
1376
1377 class CLT_S_B_DESC : MSA_3R_DESC_BASE<"clt_s.b", vsetlt_v16i8, MSA128B>;
1378 class CLT_S_H_DESC : MSA_3R_DESC_BASE<"clt_s.h", vsetlt_v8i16, MSA128H>;
1379 class CLT_S_W_DESC : MSA_3R_DESC_BASE<"clt_s.w", vsetlt_v4i32, MSA128W>;
1380 class CLT_S_D_DESC : MSA_3R_DESC_BASE<"clt_s.d", vsetlt_v2i64, MSA128D>;
1381
1382 class CLT_U_B_DESC : MSA_3R_DESC_BASE<"clt_u.b", vsetult_v16i8, MSA128B>;
1383 class CLT_U_H_DESC : MSA_3R_DESC_BASE<"clt_u.h", vsetult_v8i16, MSA128H>;
1384 class CLT_U_W_DESC : MSA_3R_DESC_BASE<"clt_u.w", vsetult_v4i32, MSA128W>;
1385 class CLT_U_D_DESC : MSA_3R_DESC_BASE<"clt_u.d", vsetult_v2i64, MSA128D>;
1386
1387 class CLTI_S_B_DESC : MSA_SI5_DESC_BASE<"clti_s.b", vsetlt_v16i8, vsplati8,
1388                                         MSA128B>;
1389 class CLTI_S_H_DESC : MSA_SI5_DESC_BASE<"clti_s.h", vsetlt_v8i16, vsplati16,
1390                                         MSA128H>;
1391 class CLTI_S_W_DESC : MSA_SI5_DESC_BASE<"clti_s.w", vsetlt_v4i32, vsplati32,
1392                                         MSA128W>;
1393 class CLTI_S_D_DESC : MSA_SI5_DESC_BASE<"clti_s.d", vsetlt_v2i64, vsplati64,
1394                                         MSA128D>;
1395
1396 class CLTI_U_B_DESC : MSA_I5_DESC_BASE<"clti_u.b", vsetult_v16i8, vsplati8,
1397                                        MSA128B>;
1398 class CLTI_U_H_DESC : MSA_I5_DESC_BASE<"clti_u.h", vsetult_v8i16, vsplati16,
1399                                        MSA128H>;
1400 class CLTI_U_W_DESC : MSA_I5_DESC_BASE<"clti_u.w", vsetult_v4i32, vsplati32,
1401                                        MSA128W>;
1402 class CLTI_U_D_DESC : MSA_I5_DESC_BASE<"clti_u.d", vsetult_v2i64, vsplati64,
1403                                        MSA128D>;
1404
1405 class COPY_S_B_DESC : MSA_COPY_DESC_BASE<"copy_s.b", vextract_sext_i8,  v16i8,
1406                                          GPR32, MSA128B>;
1407 class COPY_S_H_DESC : MSA_COPY_DESC_BASE<"copy_s.h", vextract_sext_i16, v8i16,
1408                                          GPR32, MSA128H>;
1409 class COPY_S_W_DESC : MSA_COPY_DESC_BASE<"copy_s.w", vextract_sext_i32, v4i32,
1410                                          GPR32, MSA128W>;
1411
1412 class COPY_U_B_DESC : MSA_COPY_DESC_BASE<"copy_u.b", vextract_zext_i8,  v16i8,
1413                                          GPR32, MSA128B>;
1414 class COPY_U_H_DESC : MSA_COPY_DESC_BASE<"copy_u.h", vextract_zext_i16, v8i16,
1415                                          GPR32, MSA128H>;
1416 class COPY_U_W_DESC : MSA_COPY_DESC_BASE<"copy_u.w", vextract_zext_i32, v4i32,
1417                                          GPR32, MSA128W>;
1418
1419 class CTCMSA_DESC {
1420   dag OutOperandList = (outs);
1421   dag InOperandList = (ins MSACtrl:$cd, GPR32:$rs);
1422   string AsmString = "ctcmsa\t$cd, $rs";
1423   InstrItinClass Itinerary = NoItinerary;
1424   bit hasSideEffects = 1;
1425 }
1426
1427 class DIV_S_B_DESC : MSA_3R_DESC_BASE<"div_s.b", sdiv, MSA128B>;
1428 class DIV_S_H_DESC : MSA_3R_DESC_BASE<"div_s.h", sdiv, MSA128H>;
1429 class DIV_S_W_DESC : MSA_3R_DESC_BASE<"div_s.w", sdiv, MSA128W>;
1430 class DIV_S_D_DESC : MSA_3R_DESC_BASE<"div_s.d", sdiv, MSA128D>;
1431
1432 class DIV_U_B_DESC : MSA_3R_DESC_BASE<"div_u.b", udiv, MSA128B>;
1433 class DIV_U_H_DESC : MSA_3R_DESC_BASE<"div_u.h", udiv, MSA128H>;
1434 class DIV_U_W_DESC : MSA_3R_DESC_BASE<"div_u.w", udiv, MSA128W>;
1435 class DIV_U_D_DESC : MSA_3R_DESC_BASE<"div_u.d", udiv, MSA128D>;
1436
1437 class DOTP_S_H_DESC : MSA_3R_DESC_BASE<"dotp_s.h", int_mips_dotp_s_h, MSA128H,
1438                                        MSA128B, MSA128B>, IsCommutable;
1439 class DOTP_S_W_DESC : MSA_3R_DESC_BASE<"dotp_s.w", int_mips_dotp_s_w, MSA128W,
1440                                        MSA128H, MSA128H>, IsCommutable;
1441 class DOTP_S_D_DESC : MSA_3R_DESC_BASE<"dotp_s.d", int_mips_dotp_s_d, MSA128D,
1442                                        MSA128W, MSA128W>, IsCommutable;
1443
1444 class DOTP_U_H_DESC : MSA_3R_DESC_BASE<"dotp_u.h", int_mips_dotp_u_h, MSA128H,
1445                                        MSA128B, MSA128B>, IsCommutable;
1446 class DOTP_U_W_DESC : MSA_3R_DESC_BASE<"dotp_u.w", int_mips_dotp_u_w, MSA128W,
1447                                        MSA128H, MSA128H>, IsCommutable;
1448 class DOTP_U_D_DESC : MSA_3R_DESC_BASE<"dotp_u.d", int_mips_dotp_u_d, MSA128D,
1449                                        MSA128W, MSA128W>, IsCommutable;
1450
1451 class DPADD_S_H_DESC : MSA_3R_4R_DESC_BASE<"dpadd_s.h", int_mips_dpadd_s_h,
1452                                            MSA128H, MSA128B, MSA128B>,
1453                        IsCommutable;
1454 class DPADD_S_W_DESC : MSA_3R_4R_DESC_BASE<"dpadd_s.w", int_mips_dpadd_s_w,
1455                                            MSA128W, MSA128H, MSA128H>,
1456                        IsCommutable;
1457 class DPADD_S_D_DESC : MSA_3R_4R_DESC_BASE<"dpadd_s.d", int_mips_dpadd_s_d,
1458                                            MSA128D, MSA128W, MSA128W>,
1459                        IsCommutable;
1460
1461 class DPADD_U_H_DESC : MSA_3R_4R_DESC_BASE<"dpadd_u.h", int_mips_dpadd_u_h,
1462                                            MSA128H, MSA128B, MSA128B>,
1463                        IsCommutable;
1464 class DPADD_U_W_DESC : MSA_3R_4R_DESC_BASE<"dpadd_u.w", int_mips_dpadd_u_w,
1465                                            MSA128W, MSA128H, MSA128H>,
1466                        IsCommutable;
1467 class DPADD_U_D_DESC : MSA_3R_4R_DESC_BASE<"dpadd_u.d", int_mips_dpadd_u_d,
1468                                            MSA128D, MSA128W, MSA128W>,
1469                        IsCommutable;
1470
1471 class DPSUB_S_H_DESC : MSA_3R_4R_DESC_BASE<"dpsub_s.h", int_mips_dpsub_s_h,
1472                                            MSA128H, MSA128B, MSA128B>;
1473 class DPSUB_S_W_DESC : MSA_3R_4R_DESC_BASE<"dpsub_s.w", int_mips_dpsub_s_w,
1474                                            MSA128W, MSA128H, MSA128H>;
1475 class DPSUB_S_D_DESC : MSA_3R_4R_DESC_BASE<"dpsub_s.d", int_mips_dpsub_s_d,
1476                                            MSA128D, MSA128W, MSA128W>;
1477
1478 class DPSUB_U_H_DESC : MSA_3R_4R_DESC_BASE<"dpsub_u.h", int_mips_dpsub_u_h,
1479                                            MSA128H, MSA128B, MSA128B>;
1480 class DPSUB_U_W_DESC : MSA_3R_4R_DESC_BASE<"dpsub_u.w", int_mips_dpsub_u_w,
1481                                            MSA128W, MSA128H, MSA128H>;
1482 class DPSUB_U_D_DESC : MSA_3R_4R_DESC_BASE<"dpsub_u.d", int_mips_dpsub_u_d,
1483                                            MSA128D, MSA128W, MSA128W>;
1484
1485 class FADD_W_DESC : MSA_3RF_DESC_BASE<"fadd.w", fadd, MSA128W>, IsCommutable;
1486 class FADD_D_DESC : MSA_3RF_DESC_BASE<"fadd.d", fadd, MSA128D>, IsCommutable;
1487
1488 class FCAF_W_DESC : MSA_3RF_DESC_BASE<"fcaf.w", int_mips_fcaf_w, MSA128W>,
1489                     IsCommutable;
1490 class FCAF_D_DESC : MSA_3RF_DESC_BASE<"fcaf.d", int_mips_fcaf_d, MSA128D>,
1491                     IsCommutable;
1492
1493 class FCEQ_W_DESC : MSA_3RF_DESC_BASE<"fceq.w", vfsetoeq_v4f32, MSA128W>,
1494                     IsCommutable;
1495 class FCEQ_D_DESC : MSA_3RF_DESC_BASE<"fceq.d", vfsetoeq_v2f64, MSA128D>,
1496                     IsCommutable;
1497
1498 class FCLASS_W_DESC : MSA_2RF_DESC_BASE<"fclass.w", int_mips_fclass_w,
1499                                         MSA128W>;
1500 class FCLASS_D_DESC : MSA_2RF_DESC_BASE<"fclass.d", int_mips_fclass_d,
1501                                         MSA128D>;
1502
1503 class FCLE_W_DESC : MSA_3RF_DESC_BASE<"fcle.w", vfsetole_v4f32, MSA128W>;
1504 class FCLE_D_DESC : MSA_3RF_DESC_BASE<"fcle.d", vfsetole_v2f64, MSA128D>;
1505
1506 class FCLT_W_DESC : MSA_3RF_DESC_BASE<"fclt.w", vfsetolt_v4f32, MSA128W>;
1507 class FCLT_D_DESC : MSA_3RF_DESC_BASE<"fclt.d", vfsetolt_v2f64, MSA128D>;
1508
1509 class FCNE_W_DESC : MSA_3RF_DESC_BASE<"fcne.w", vfsetone_v4f32, MSA128W>,
1510                     IsCommutable;
1511 class FCNE_D_DESC : MSA_3RF_DESC_BASE<"fcne.d", vfsetone_v2f64, MSA128D>,
1512                     IsCommutable;
1513
1514 class FCOR_W_DESC : MSA_3RF_DESC_BASE<"fcor.w", vfsetord_v4f32, MSA128W>,
1515                     IsCommutable;
1516 class FCOR_D_DESC : MSA_3RF_DESC_BASE<"fcor.d", vfsetord_v2f64, MSA128D>,
1517                     IsCommutable;
1518
1519 class FCUEQ_W_DESC : MSA_3RF_DESC_BASE<"fcueq.w", vfsetueq_v4f32, MSA128W>,
1520                      IsCommutable;
1521 class FCUEQ_D_DESC : MSA_3RF_DESC_BASE<"fcueq.d", vfsetueq_v2f64, MSA128D>,
1522                      IsCommutable;
1523
1524 class FCULE_W_DESC : MSA_3RF_DESC_BASE<"fcule.w", vfsetule_v4f32, MSA128W>,
1525                      IsCommutable;
1526 class FCULE_D_DESC : MSA_3RF_DESC_BASE<"fcule.d", vfsetule_v2f64, MSA128D>,
1527                      IsCommutable;
1528
1529 class FCULT_W_DESC : MSA_3RF_DESC_BASE<"fcult.w", vfsetult_v4f32, MSA128W>,
1530                      IsCommutable;
1531 class FCULT_D_DESC : MSA_3RF_DESC_BASE<"fcult.d", vfsetult_v2f64, MSA128D>,
1532                      IsCommutable;
1533
1534 class FCUN_W_DESC : MSA_3RF_DESC_BASE<"fcun.w", vfsetun_v4f32, MSA128W>,
1535                     IsCommutable;
1536 class FCUN_D_DESC : MSA_3RF_DESC_BASE<"fcun.d", vfsetun_v2f64, MSA128D>,
1537                     IsCommutable;
1538
1539 class FCUNE_W_DESC : MSA_3RF_DESC_BASE<"fcune.w", vfsetune_v4f32, MSA128W>,
1540                      IsCommutable;
1541 class FCUNE_D_DESC : MSA_3RF_DESC_BASE<"fcune.d", vfsetune_v2f64, MSA128D>,
1542                      IsCommutable;
1543
1544 class FDIV_W_DESC : MSA_3RF_DESC_BASE<"fdiv.w", fdiv, MSA128W>;
1545 class FDIV_D_DESC : MSA_3RF_DESC_BASE<"fdiv.d", fdiv, MSA128D>;
1546
1547 class FEXDO_H_DESC : MSA_3RF_DESC_BASE<"fexdo.h", int_mips_fexdo_h,
1548                                        MSA128H, MSA128W, MSA128W>;
1549 class FEXDO_W_DESC : MSA_3RF_DESC_BASE<"fexdo.w", int_mips_fexdo_w,
1550                                        MSA128W, MSA128D, MSA128D>;
1551
1552 class FEXP2_W_DESC : MSA_3RF_DESC_BASE<"fexp2.w", int_mips_fexp2_w, MSA128W>;
1553 class FEXP2_D_DESC : MSA_3RF_DESC_BASE<"fexp2.d", int_mips_fexp2_d, MSA128D>;
1554
1555 class FEXUPL_W_DESC : MSA_2RF_DESC_BASE<"fexupl.w", int_mips_fexupl_w,
1556                                         MSA128W, MSA128H>;
1557 class FEXUPL_D_DESC : MSA_2RF_DESC_BASE<"fexupl.d", int_mips_fexupl_d,
1558                                         MSA128D, MSA128W>;
1559
1560 class FEXUPR_W_DESC : MSA_2RF_DESC_BASE<"fexupr.w", int_mips_fexupr_w,
1561                                         MSA128W, MSA128H>;
1562 class FEXUPR_D_DESC : MSA_2RF_DESC_BASE<"fexupr.d", int_mips_fexupr_d,
1563                                         MSA128D, MSA128W>;
1564
1565 class FFINT_S_W_DESC : MSA_2RF_DESC_BASE<"ffint_s.w", int_mips_ffint_s_w,
1566                                          MSA128W>;
1567 class FFINT_S_D_DESC : MSA_2RF_DESC_BASE<"ffint_s.d", int_mips_ffint_s_d,
1568                                          MSA128D>;
1569
1570 class FFINT_U_W_DESC : MSA_2RF_DESC_BASE<"ffint_u.w", int_mips_ffint_u_w,
1571                                          MSA128W>;
1572 class FFINT_U_D_DESC : MSA_2RF_DESC_BASE<"ffint_u.d", int_mips_ffint_u_d,
1573                                          MSA128D>;
1574
1575 class FFQL_W_DESC : MSA_2RF_DESC_BASE<"ffql.w", int_mips_ffql_w,
1576                                       MSA128W, MSA128H>;
1577 class FFQL_D_DESC : MSA_2RF_DESC_BASE<"ffql.d", int_mips_ffql_d,
1578                                       MSA128D, MSA128W>;
1579
1580 class FFQR_W_DESC : MSA_2RF_DESC_BASE<"ffqr.w", int_mips_ffqr_w,
1581                                       MSA128W, MSA128H>;
1582 class FFQR_D_DESC : MSA_2RF_DESC_BASE<"ffqr.d", int_mips_ffqr_d,
1583                                       MSA128D, MSA128W>;
1584
1585 class FILL_B_DESC : MSA_2R_DESC_BASE<"fill.b", vsplati8,  MSA128B, GPR32>;
1586 class FILL_H_DESC : MSA_2R_DESC_BASE<"fill.h", vsplati16, MSA128H, GPR32>;
1587 class FILL_W_DESC : MSA_2R_DESC_BASE<"fill.w", vsplati32, MSA128W, GPR32>;
1588
1589 class FLOG2_W_DESC : MSA_2RF_DESC_BASE<"flog2.w", flog2, MSA128W>;
1590 class FLOG2_D_DESC : MSA_2RF_DESC_BASE<"flog2.d", flog2, MSA128D>;
1591
1592 class FMADD_W_DESC : MSA_3RF_4RF_DESC_BASE<"fmadd.w", int_mips_fmadd_w,
1593                                            MSA128W>;
1594 class FMADD_D_DESC : MSA_3RF_4RF_DESC_BASE<"fmadd.d", int_mips_fmadd_d,
1595                                            MSA128D>;
1596
1597 class FMAX_W_DESC : MSA_3RF_DESC_BASE<"fmax.w", int_mips_fmax_w, MSA128W>;
1598 class FMAX_D_DESC : MSA_3RF_DESC_BASE<"fmax.d", int_mips_fmax_d, MSA128D>;
1599
1600 class FMAX_A_W_DESC : MSA_3RF_DESC_BASE<"fmax_a.w", int_mips_fmax_a_w,
1601                                         MSA128W>;
1602 class FMAX_A_D_DESC : MSA_3RF_DESC_BASE<"fmax_a.d", int_mips_fmax_a_d,
1603                                         MSA128D>;
1604
1605 class FMIN_W_DESC : MSA_3RF_DESC_BASE<"fmin.w", int_mips_fmin_w, MSA128W>;
1606 class FMIN_D_DESC : MSA_3RF_DESC_BASE<"fmin.d", int_mips_fmin_d, MSA128D>;
1607
1608 class FMIN_A_W_DESC : MSA_3RF_DESC_BASE<"fmin_a.w", int_mips_fmin_a_w,
1609                                         MSA128W>;
1610 class FMIN_A_D_DESC : MSA_3RF_DESC_BASE<"fmin_a.d", int_mips_fmin_a_d,
1611                                         MSA128D>;
1612
1613 class FMSUB_W_DESC : MSA_3RF_4RF_DESC_BASE<"fmsub.w", int_mips_fmsub_w,
1614                                            MSA128W>;
1615 class FMSUB_D_DESC : MSA_3RF_4RF_DESC_BASE<"fmsub.d", int_mips_fmsub_d,
1616                                            MSA128D>;
1617
1618 class FMUL_W_DESC : MSA_3RF_DESC_BASE<"fmul.w", fmul, MSA128W>;
1619 class FMUL_D_DESC : MSA_3RF_DESC_BASE<"fmul.d", fmul, MSA128D>;
1620
1621 class FRINT_W_DESC : MSA_2RF_DESC_BASE<"frint.w", frint, MSA128W>;
1622 class FRINT_D_DESC : MSA_2RF_DESC_BASE<"frint.d", frint, MSA128D>;
1623
1624 class FRCP_W_DESC : MSA_2RF_DESC_BASE<"frcp.w", int_mips_frcp_w, MSA128W>;
1625 class FRCP_D_DESC : MSA_2RF_DESC_BASE<"frcp.d", int_mips_frcp_d, MSA128D>;
1626
1627 class FRSQRT_W_DESC : MSA_2RF_DESC_BASE<"frsqrt.w", int_mips_frsqrt_w,
1628                                         MSA128W>;
1629 class FRSQRT_D_DESC : MSA_2RF_DESC_BASE<"frsqrt.d", int_mips_frsqrt_d,
1630                                         MSA128D>;
1631
1632 class FSAF_W_DESC : MSA_3RF_DESC_BASE<"fsaf.w", int_mips_fsaf_w, MSA128W>;
1633 class FSAF_D_DESC : MSA_3RF_DESC_BASE<"fsaf.d", int_mips_fsaf_d, MSA128D>;
1634
1635 class FSEQ_W_DESC : MSA_3RF_DESC_BASE<"fseq.w", int_mips_fseq_w, MSA128W>;
1636 class FSEQ_D_DESC : MSA_3RF_DESC_BASE<"fseq.d", int_mips_fseq_d, MSA128D>;
1637
1638 class FSLE_W_DESC : MSA_3RF_DESC_BASE<"fsle.w", int_mips_fsle_w, MSA128W>;
1639 class FSLE_D_DESC : MSA_3RF_DESC_BASE<"fsle.d", int_mips_fsle_d, MSA128D>;
1640
1641 class FSLT_W_DESC : MSA_3RF_DESC_BASE<"fslt.w", int_mips_fslt_w, MSA128W>;
1642 class FSLT_D_DESC : MSA_3RF_DESC_BASE<"fslt.d", int_mips_fslt_d, MSA128D>;
1643
1644 class FSNE_W_DESC : MSA_3RF_DESC_BASE<"fsne.w", int_mips_fsne_w, MSA128W>;
1645 class FSNE_D_DESC : MSA_3RF_DESC_BASE<"fsne.d", int_mips_fsne_d, MSA128D>;
1646
1647 class FSOR_W_DESC : MSA_3RF_DESC_BASE<"fsor.w", int_mips_fsor_w, MSA128W>;
1648 class FSOR_D_DESC : MSA_3RF_DESC_BASE<"fsor.d", int_mips_fsor_d, MSA128D>;
1649
1650 class FSQRT_W_DESC : MSA_2RF_DESC_BASE<"fsqrt.w", fsqrt, MSA128W>;
1651 class FSQRT_D_DESC : MSA_2RF_DESC_BASE<"fsqrt.d", fsqrt, MSA128D>;
1652
1653 class FSUB_W_DESC : MSA_3RF_DESC_BASE<"fsub.w", fsub, MSA128W>;
1654 class FSUB_D_DESC : MSA_3RF_DESC_BASE<"fsub.d", fsub, MSA128D>;
1655
1656 class FSUEQ_W_DESC : MSA_3RF_DESC_BASE<"fsueq.w", int_mips_fsueq_w, MSA128W>;
1657 class FSUEQ_D_DESC : MSA_3RF_DESC_BASE<"fsueq.d", int_mips_fsueq_d, MSA128D>;
1658
1659 class FSULE_W_DESC : MSA_3RF_DESC_BASE<"fsule.w", int_mips_fsule_w, MSA128W>;
1660 class FSULE_D_DESC : MSA_3RF_DESC_BASE<"fsule.d", int_mips_fsule_d, MSA128D>;
1661
1662 class FSULT_W_DESC : MSA_3RF_DESC_BASE<"fsult.w", int_mips_fsult_w, MSA128W>;
1663 class FSULT_D_DESC : MSA_3RF_DESC_BASE<"fsult.d", int_mips_fsult_d, MSA128D>;
1664
1665 class FSUN_W_DESC : MSA_3RF_DESC_BASE<"fsun.w", int_mips_fsun_w, MSA128W>;
1666 class FSUN_D_DESC : MSA_3RF_DESC_BASE<"fsun.d", int_mips_fsun_d, MSA128D>;
1667
1668 class FSUNE_W_DESC : MSA_3RF_DESC_BASE<"fsune.w", int_mips_fsune_w, MSA128W>;
1669 class FSUNE_D_DESC : MSA_3RF_DESC_BASE<"fsune.d", int_mips_fsune_d, MSA128D>;
1670
1671 class FTRUNC_S_W_DESC : MSA_2RF_DESC_BASE<"ftrunc_s.w", int_mips_ftrunc_s_w,
1672                                           MSA128W>;
1673 class FTRUNC_S_D_DESC : MSA_2RF_DESC_BASE<"ftrunc_s.d", int_mips_ftrunc_s_d,
1674                                           MSA128D>;
1675
1676 class FTRUNC_U_W_DESC : MSA_2RF_DESC_BASE<"ftrunc_u.w", int_mips_ftrunc_u_w,
1677                                           MSA128W>;
1678 class FTRUNC_U_D_DESC : MSA_2RF_DESC_BASE<"ftrunc_u.d", int_mips_ftrunc_u_d,
1679                                           MSA128D>;
1680
1681 class FTINT_S_W_DESC : MSA_2RF_DESC_BASE<"ftint_s.w", int_mips_ftint_s_w,
1682                                          MSA128W>;
1683 class FTINT_S_D_DESC : MSA_2RF_DESC_BASE<"ftint_s.d", int_mips_ftint_s_d,
1684                                          MSA128D>;
1685
1686 class FTINT_U_W_DESC : MSA_2RF_DESC_BASE<"ftint_u.w", int_mips_ftint_u_w,
1687                                          MSA128W>;
1688 class FTINT_U_D_DESC : MSA_2RF_DESC_BASE<"ftint_u.d", int_mips_ftint_u_d,
1689                                          MSA128D>;
1690
1691 class FTQ_H_DESC : MSA_3RF_DESC_BASE<"ftq.h", int_mips_ftq_h,
1692                                      MSA128H, MSA128W, MSA128W>;
1693 class FTQ_W_DESC : MSA_3RF_DESC_BASE<"ftq.w", int_mips_ftq_w,
1694                                      MSA128W, MSA128D, MSA128D>;
1695
1696 class HADD_S_H_DESC : MSA_3R_DESC_BASE<"hadd_s.h", int_mips_hadd_s_h, MSA128H,
1697                                        MSA128B, MSA128B>;
1698 class HADD_S_W_DESC : MSA_3R_DESC_BASE<"hadd_s.w", int_mips_hadd_s_w, MSA128W,
1699                                        MSA128H, MSA128H>;
1700 class HADD_S_D_DESC : MSA_3R_DESC_BASE<"hadd_s.d", int_mips_hadd_s_d, MSA128D,
1701                                        MSA128W, MSA128W>;
1702
1703 class HADD_U_H_DESC : MSA_3R_DESC_BASE<"hadd_u.h", int_mips_hadd_u_h, MSA128H,
1704                                        MSA128B, MSA128B>;
1705 class HADD_U_W_DESC : MSA_3R_DESC_BASE<"hadd_u.w", int_mips_hadd_u_w, MSA128W,
1706                                        MSA128H, MSA128H>;
1707 class HADD_U_D_DESC : MSA_3R_DESC_BASE<"hadd_u.d", int_mips_hadd_u_d, MSA128D,
1708                                        MSA128W, MSA128W>;
1709
1710 class HSUB_S_H_DESC : MSA_3R_DESC_BASE<"hsub_s.h", int_mips_hsub_s_h, MSA128H,
1711                                        MSA128B, MSA128B>;
1712 class HSUB_S_W_DESC : MSA_3R_DESC_BASE<"hsub_s.w", int_mips_hsub_s_w, MSA128W,
1713                                        MSA128H, MSA128H>;
1714 class HSUB_S_D_DESC : MSA_3R_DESC_BASE<"hsub_s.d", int_mips_hsub_s_d, MSA128D,
1715                                        MSA128W, MSA128W>;
1716
1717 class HSUB_U_H_DESC : MSA_3R_DESC_BASE<"hsub_u.h", int_mips_hsub_u_h, MSA128H,
1718                                        MSA128B, MSA128B>;
1719 class HSUB_U_W_DESC : MSA_3R_DESC_BASE<"hsub_u.w", int_mips_hsub_u_w, MSA128W,
1720                                        MSA128H, MSA128H>;
1721 class HSUB_U_D_DESC : MSA_3R_DESC_BASE<"hsub_u.d", int_mips_hsub_u_d, MSA128D,
1722                                        MSA128W, MSA128W>;
1723
1724 class ILVEV_B_DESC : MSA_3R_DESC_BASE<"ilvev.b", int_mips_ilvev_b, MSA128B>;
1725 class ILVEV_H_DESC : MSA_3R_DESC_BASE<"ilvev.h", int_mips_ilvev_h, MSA128H>;
1726 class ILVEV_W_DESC : MSA_3R_DESC_BASE<"ilvev.w", int_mips_ilvev_w, MSA128W>;
1727 class ILVEV_D_DESC : MSA_3R_DESC_BASE<"ilvev.d", int_mips_ilvev_d, MSA128D>;
1728
1729 class ILVL_B_DESC : MSA_3R_DESC_BASE<"ilvl.b", int_mips_ilvl_b, MSA128B>;
1730 class ILVL_H_DESC : MSA_3R_DESC_BASE<"ilvl.h", int_mips_ilvl_h, MSA128H>;
1731 class ILVL_W_DESC : MSA_3R_DESC_BASE<"ilvl.w", int_mips_ilvl_w, MSA128W>;
1732 class ILVL_D_DESC : MSA_3R_DESC_BASE<"ilvl.d", int_mips_ilvl_d, MSA128D>;
1733
1734 class ILVOD_B_DESC : MSA_3R_DESC_BASE<"ilvod.b", int_mips_ilvod_b, MSA128B>;
1735 class ILVOD_H_DESC : MSA_3R_DESC_BASE<"ilvod.h", int_mips_ilvod_h, MSA128H>;
1736 class ILVOD_W_DESC : MSA_3R_DESC_BASE<"ilvod.w", int_mips_ilvod_w, MSA128W>;
1737 class ILVOD_D_DESC : MSA_3R_DESC_BASE<"ilvod.d", int_mips_ilvod_d, MSA128D>;
1738
1739 class ILVR_B_DESC : MSA_3R_DESC_BASE<"ilvr.b", int_mips_ilvr_b, MSA128B>;
1740 class ILVR_H_DESC : MSA_3R_DESC_BASE<"ilvr.h", int_mips_ilvr_h, MSA128H>;
1741 class ILVR_W_DESC : MSA_3R_DESC_BASE<"ilvr.w", int_mips_ilvr_w, MSA128W>;
1742 class ILVR_D_DESC : MSA_3R_DESC_BASE<"ilvr.d", int_mips_ilvr_d, MSA128D>;
1743
1744 class INSERT_B_DESC : MSA_INSERT_DESC_BASE<"insert.b", vinsert_v16i8, MSA128B,
1745                                            GPR32>;
1746 class INSERT_H_DESC : MSA_INSERT_DESC_BASE<"insert.h", vinsert_v8i16, MSA128H,
1747                                            GPR32>;
1748 class INSERT_W_DESC : MSA_INSERT_DESC_BASE<"insert.w", vinsert_v4i32, MSA128W,
1749                                            GPR32>;
1750
1751 class INSVE_B_DESC : MSA_INSVE_DESC_BASE<"insve.b", int_mips_insve_b, MSA128B>;
1752 class INSVE_H_DESC : MSA_INSVE_DESC_BASE<"insve.h", int_mips_insve_h, MSA128H>;
1753 class INSVE_W_DESC : MSA_INSVE_DESC_BASE<"insve.w", int_mips_insve_w, MSA128W>;
1754 class INSVE_D_DESC : MSA_INSVE_DESC_BASE<"insve.d", int_mips_insve_d, MSA128D>;
1755
1756 class LD_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
1757                    ValueType TyNode, RegisterClass RCWD,
1758                    Operand MemOpnd = mem, ComplexPattern Addr = addrRegImm,
1759                    InstrItinClass itin = NoItinerary> {
1760   dag OutOperandList = (outs RCWD:$wd);
1761   dag InOperandList = (ins MemOpnd:$addr);
1762   string AsmString = !strconcat(instr_asm, "\t$wd, $addr");
1763   list<dag> Pattern = [(set RCWD:$wd, (TyNode (OpNode Addr:$addr)))];
1764   InstrItinClass Itinerary = itin;
1765 }
1766
1767 class LD_B_DESC : LD_DESC_BASE<"ld.b", load, v16i8, MSA128B>;
1768 class LD_H_DESC : LD_DESC_BASE<"ld.h", load, v8i16, MSA128H>;
1769 class LD_W_DESC : LD_DESC_BASE<"ld.w", load, v4i32, MSA128W>;
1770 class LD_D_DESC : LD_DESC_BASE<"ld.d", load, v2i64, MSA128D>;
1771
1772 class LDI_B_DESC : MSA_I10_DESC_BASE<"ldi.b", vsplati8,  MSA128B>;
1773 class LDI_H_DESC : MSA_I10_DESC_BASE<"ldi.h", vsplati16, MSA128H>;
1774 class LDI_W_DESC : MSA_I10_DESC_BASE<"ldi.w", vsplati32, MSA128W>;
1775 class LDI_D_DESC : MSA_I10_DESC_BASE<"ldi.d", vsplati64, MSA128D>;
1776
1777 class LDX_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
1778                     ValueType TyNode, RegisterClass RCWD,
1779                     Operand MemOpnd = mem, ComplexPattern Addr = addrRegReg,
1780                     InstrItinClass itin = NoItinerary> {
1781   dag OutOperandList = (outs RCWD:$wd);
1782   dag InOperandList = (ins MemOpnd:$addr);
1783   string AsmString = !strconcat(instr_asm, "\t$wd, $addr");
1784   list<dag> Pattern = [(set RCWD:$wd, (TyNode (OpNode Addr:$addr)))];
1785   InstrItinClass Itinerary = itin;
1786 }
1787
1788 class LDX_B_DESC : LDX_DESC_BASE<"ldx.b", load, v16i8, MSA128B>;
1789 class LDX_H_DESC : LDX_DESC_BASE<"ldx.h", load, v8i16, MSA128H>;
1790 class LDX_W_DESC : LDX_DESC_BASE<"ldx.w", load, v4i32, MSA128W>;
1791 class LDX_D_DESC : LDX_DESC_BASE<"ldx.d", load, v2i64, MSA128D>;
1792
1793 class MADD_Q_H_DESC : MSA_3RF_4RF_DESC_BASE<"madd_q.h", int_mips_madd_q_h,
1794                                             MSA128H>;
1795 class MADD_Q_W_DESC : MSA_3RF_4RF_DESC_BASE<"madd_q.w", int_mips_madd_q_w,
1796                                             MSA128W>;
1797
1798 class MADDR_Q_H_DESC : MSA_3RF_4RF_DESC_BASE<"maddr_q.h", int_mips_maddr_q_h,
1799                                              MSA128H>;
1800 class MADDR_Q_W_DESC : MSA_3RF_4RF_DESC_BASE<"maddr_q.w", int_mips_maddr_q_w,
1801                                              MSA128W>;
1802
1803 class MADDV_B_DESC : MSA_3R_4R_DESC_BASE<"maddv.b", int_mips_maddv_b, MSA128B>;
1804 class MADDV_H_DESC : MSA_3R_4R_DESC_BASE<"maddv.h", int_mips_maddv_h, MSA128H>;
1805 class MADDV_W_DESC : MSA_3R_4R_DESC_BASE<"maddv.w", int_mips_maddv_w, MSA128W>;
1806 class MADDV_D_DESC : MSA_3R_4R_DESC_BASE<"maddv.d", int_mips_maddv_d, MSA128D>;
1807
1808 class MAX_A_B_DESC : MSA_3R_DESC_BASE<"max_a.b", int_mips_max_a_b, MSA128B>;
1809 class MAX_A_H_DESC : MSA_3R_DESC_BASE<"max_a.h", int_mips_max_a_h, MSA128H>;
1810 class MAX_A_W_DESC : MSA_3R_DESC_BASE<"max_a.w", int_mips_max_a_w, MSA128W>;
1811 class MAX_A_D_DESC : MSA_3R_DESC_BASE<"max_a.d", int_mips_max_a_d, MSA128D>;
1812
1813 class MAX_S_B_DESC : MSA_3R_DESC_BASE<"max_s.b", int_mips_max_s_b, MSA128B>;
1814 class MAX_S_H_DESC : MSA_3R_DESC_BASE<"max_s.h", int_mips_max_s_h, MSA128H>;
1815 class MAX_S_W_DESC : MSA_3R_DESC_BASE<"max_s.w", int_mips_max_s_w, MSA128W>;
1816 class MAX_S_D_DESC : MSA_3R_DESC_BASE<"max_s.d", int_mips_max_s_d, MSA128D>;
1817
1818 class MAX_U_B_DESC : MSA_3R_DESC_BASE<"max_u.b", int_mips_max_u_b, MSA128B>;
1819 class MAX_U_H_DESC : MSA_3R_DESC_BASE<"max_u.h", int_mips_max_u_h, MSA128H>;
1820 class MAX_U_W_DESC : MSA_3R_DESC_BASE<"max_u.w", int_mips_max_u_w, MSA128W>;
1821 class MAX_U_D_DESC : MSA_3R_DESC_BASE<"max_u.d", int_mips_max_u_d, MSA128D>;
1822
1823 class MAXI_S_B_DESC : MSA_I5_X_DESC_BASE<"maxi_s.b", int_mips_maxi_s_b,
1824                                          MSA128B>;
1825 class MAXI_S_H_DESC : MSA_I5_X_DESC_BASE<"maxi_s.h", int_mips_maxi_s_h,
1826                                          MSA128H>;
1827 class MAXI_S_W_DESC : MSA_I5_X_DESC_BASE<"maxi_s.w", int_mips_maxi_s_w,
1828                                          MSA128W>;
1829 class MAXI_S_D_DESC : MSA_I5_X_DESC_BASE<"maxi_s.d", int_mips_maxi_s_d,
1830                                          MSA128D>;
1831
1832 class MAXI_U_B_DESC : MSA_I5_X_DESC_BASE<"maxi_u.b", int_mips_maxi_u_b,
1833                                          MSA128B>;
1834 class MAXI_U_H_DESC : MSA_I5_X_DESC_BASE<"maxi_u.h", int_mips_maxi_u_h,
1835                                          MSA128H>;
1836 class MAXI_U_W_DESC : MSA_I5_X_DESC_BASE<"maxi_u.w", int_mips_maxi_u_w,
1837                                          MSA128W>;
1838 class MAXI_U_D_DESC : MSA_I5_X_DESC_BASE<"maxi_u.d", int_mips_maxi_u_d,
1839                                          MSA128D>;
1840
1841 class MIN_A_B_DESC : MSA_3R_DESC_BASE<"min_a.b", int_mips_min_a_b, MSA128B>;
1842 class MIN_A_H_DESC : MSA_3R_DESC_BASE<"min_a.h", int_mips_min_a_h, MSA128H>;
1843 class MIN_A_W_DESC : MSA_3R_DESC_BASE<"min_a.w", int_mips_min_a_w, MSA128W>;
1844 class MIN_A_D_DESC : MSA_3R_DESC_BASE<"min_a.d", int_mips_min_a_d, MSA128D>;
1845
1846 class MIN_S_B_DESC : MSA_3R_DESC_BASE<"min_s.b", int_mips_min_s_b, MSA128B>;
1847 class MIN_S_H_DESC : MSA_3R_DESC_BASE<"min_s.h", int_mips_min_s_h, MSA128H>;
1848 class MIN_S_W_DESC : MSA_3R_DESC_BASE<"min_s.w", int_mips_min_s_w, MSA128W>;
1849 class MIN_S_D_DESC : MSA_3R_DESC_BASE<"min_s.d", int_mips_min_s_d, MSA128D>;
1850
1851 class MIN_U_B_DESC : MSA_3R_DESC_BASE<"min_u.b", int_mips_min_u_b, MSA128B>;
1852 class MIN_U_H_DESC : MSA_3R_DESC_BASE<"min_u.h", int_mips_min_u_h, MSA128H>;
1853 class MIN_U_W_DESC : MSA_3R_DESC_BASE<"min_u.w", int_mips_min_u_w, MSA128W>;
1854 class MIN_U_D_DESC : MSA_3R_DESC_BASE<"min_u.d", int_mips_min_u_d, MSA128D>;
1855
1856 class MINI_S_B_DESC : MSA_I5_X_DESC_BASE<"mini_s.b", int_mips_mini_s_b,
1857                                          MSA128B>;
1858 class MINI_S_H_DESC : MSA_I5_X_DESC_BASE<"mini_s.h", int_mips_mini_s_h,
1859                                          MSA128H>;
1860 class MINI_S_W_DESC : MSA_I5_X_DESC_BASE<"mini_s.w", int_mips_mini_s_w,
1861                                          MSA128W>;
1862 class MINI_S_D_DESC : MSA_I5_X_DESC_BASE<"mini_s.d", int_mips_mini_s_d,
1863                                          MSA128D>;
1864
1865 class MINI_U_B_DESC : MSA_I5_X_DESC_BASE<"mini_u.b", int_mips_mini_u_b,
1866                                          MSA128B>;
1867 class MINI_U_H_DESC : MSA_I5_X_DESC_BASE<"mini_u.h", int_mips_mini_u_h,
1868                                          MSA128H>;
1869 class MINI_U_W_DESC : MSA_I5_X_DESC_BASE<"mini_u.w", int_mips_mini_u_w,
1870                                          MSA128W>;
1871 class MINI_U_D_DESC : MSA_I5_X_DESC_BASE<"mini_u.d", int_mips_mini_u_d,
1872                                          MSA128D>;
1873
1874 class MOD_S_B_DESC : MSA_3R_DESC_BASE<"mod_s.b", int_mips_mod_s_b, MSA128B>;
1875 class MOD_S_H_DESC : MSA_3R_DESC_BASE<"mod_s.h", int_mips_mod_s_h, MSA128H>;
1876 class MOD_S_W_DESC : MSA_3R_DESC_BASE<"mod_s.w", int_mips_mod_s_w, MSA128W>;
1877 class MOD_S_D_DESC : MSA_3R_DESC_BASE<"mod_s.d", int_mips_mod_s_d, MSA128D>;
1878
1879 class MOD_U_B_DESC : MSA_3R_DESC_BASE<"mod_u.b", int_mips_mod_u_b, MSA128B>;
1880 class MOD_U_H_DESC : MSA_3R_DESC_BASE<"mod_u.h", int_mips_mod_u_h, MSA128H>;
1881 class MOD_U_W_DESC : MSA_3R_DESC_BASE<"mod_u.w", int_mips_mod_u_w, MSA128W>;
1882 class MOD_U_D_DESC : MSA_3R_DESC_BASE<"mod_u.d", int_mips_mod_u_d, MSA128D>;
1883
1884 class MOVE_V_DESC {
1885   dag OutOperandList = (outs MSA128B:$wd);
1886   dag InOperandList = (ins MSA128B:$ws);
1887   string AsmString = "move.v\t$wd, $ws";
1888   list<dag> Pattern = [];
1889   InstrItinClass Itinerary = NoItinerary;
1890 }
1891
1892 class MSUB_Q_H_DESC : MSA_3RF_4RF_DESC_BASE<"msub_q.h", int_mips_msub_q_h,
1893                                             MSA128H>;
1894 class MSUB_Q_W_DESC : MSA_3RF_4RF_DESC_BASE<"msub_q.w", int_mips_msub_q_w,
1895                                             MSA128W>;
1896
1897 class MSUBR_Q_H_DESC : MSA_3RF_4RF_DESC_BASE<"msubr_q.h", int_mips_msubr_q_h,
1898                                              MSA128H>;
1899 class MSUBR_Q_W_DESC : MSA_3RF_4RF_DESC_BASE<"msubr_q.w", int_mips_msubr_q_w,
1900                                              MSA128W>;
1901
1902 class MSUBV_B_DESC : MSA_3R_4R_DESC_BASE<"msubv.b", int_mips_msubv_b, MSA128B>;
1903 class MSUBV_H_DESC : MSA_3R_4R_DESC_BASE<"msubv.h", int_mips_msubv_h, MSA128H>;
1904 class MSUBV_W_DESC : MSA_3R_4R_DESC_BASE<"msubv.w", int_mips_msubv_w, MSA128W>;
1905 class MSUBV_D_DESC : MSA_3R_4R_DESC_BASE<"msubv.d", int_mips_msubv_d, MSA128D>;
1906
1907 class MUL_Q_H_DESC : MSA_3RF_DESC_BASE<"mul_q.h", int_mips_mul_q_h, MSA128H>;
1908 class MUL_Q_W_DESC : MSA_3RF_DESC_BASE<"mul_q.w", int_mips_mul_q_w, MSA128W>;
1909
1910 class MULR_Q_H_DESC : MSA_3RF_DESC_BASE<"mulr_q.h", int_mips_mulr_q_h,
1911                                         MSA128H>;
1912 class MULR_Q_W_DESC : MSA_3RF_DESC_BASE<"mulr_q.w", int_mips_mulr_q_w,
1913                                         MSA128W>;
1914
1915 class MULV_B_DESC : MSA_3R_DESC_BASE<"mulv.b", mul, MSA128B>;
1916 class MULV_H_DESC : MSA_3R_DESC_BASE<"mulv.h", mul, MSA128H>;
1917 class MULV_W_DESC : MSA_3R_DESC_BASE<"mulv.w", mul, MSA128W>;
1918 class MULV_D_DESC : MSA_3R_DESC_BASE<"mulv.d", mul, MSA128D>;
1919
1920 class NLOC_B_DESC : MSA_2R_DESC_BASE<"nloc.b", int_mips_nloc_b, MSA128B>;
1921 class NLOC_H_DESC : MSA_2R_DESC_BASE<"nloc.h", int_mips_nloc_h, MSA128H>;
1922 class NLOC_W_DESC : MSA_2R_DESC_BASE<"nloc.w", int_mips_nloc_w, MSA128W>;
1923 class NLOC_D_DESC : MSA_2R_DESC_BASE<"nloc.d", int_mips_nloc_d, MSA128D>;
1924
1925 class NLZC_B_DESC : MSA_2R_DESC_BASE<"nlzc.b", ctlz, MSA128B>;
1926 class NLZC_H_DESC : MSA_2R_DESC_BASE<"nlzc.h", ctlz, MSA128H>;
1927 class NLZC_W_DESC : MSA_2R_DESC_BASE<"nlzc.w", ctlz, MSA128W>;
1928 class NLZC_D_DESC : MSA_2R_DESC_BASE<"nlzc.d", ctlz, MSA128D>;
1929
1930 class NOR_V_DESC : MSA_VEC_DESC_BASE<"nor.v", MipsVNOR, MSA128B>;
1931 class NOR_V_H_PSEUDO_DESC : MSA_VEC_PSEUDO_BASE<MipsVNOR, MSA128H>;
1932 class NOR_V_W_PSEUDO_DESC : MSA_VEC_PSEUDO_BASE<MipsVNOR, MSA128W>;
1933 class NOR_V_D_PSEUDO_DESC : MSA_VEC_PSEUDO_BASE<MipsVNOR, MSA128D>;
1934
1935 class NORI_B_DESC : MSA_I8_DESC_BASE<"nori.b", int_mips_nori_b, MSA128B>;
1936
1937 class OR_V_DESC : MSA_VEC_DESC_BASE<"or.v", or, MSA128B>;
1938 class OR_V_H_PSEUDO_DESC : MSA_VEC_PSEUDO_BASE<or, MSA128H>;
1939 class OR_V_W_PSEUDO_DESC : MSA_VEC_PSEUDO_BASE<or, MSA128W>;
1940 class OR_V_D_PSEUDO_DESC : MSA_VEC_PSEUDO_BASE<or, MSA128D>;
1941
1942 class ORI_B_DESC : MSA_I8_DESC_BASE<"ori.b", int_mips_ori_b, MSA128B>;
1943
1944 class PCKEV_B_DESC : MSA_3R_DESC_BASE<"pckev.b", int_mips_pckev_b, MSA128B>;
1945 class PCKEV_H_DESC : MSA_3R_DESC_BASE<"pckev.h", int_mips_pckev_h, MSA128H>;
1946 class PCKEV_W_DESC : MSA_3R_DESC_BASE<"pckev.w", int_mips_pckev_w, MSA128W>;
1947 class PCKEV_D_DESC : MSA_3R_DESC_BASE<"pckev.d", int_mips_pckev_d, MSA128D>;
1948
1949 class PCKOD_B_DESC : MSA_3R_DESC_BASE<"pckod.b", int_mips_pckod_b, MSA128B>;
1950 class PCKOD_H_DESC : MSA_3R_DESC_BASE<"pckod.h", int_mips_pckod_h, MSA128H>;
1951 class PCKOD_W_DESC : MSA_3R_DESC_BASE<"pckod.w", int_mips_pckod_w, MSA128W>;
1952 class PCKOD_D_DESC : MSA_3R_DESC_BASE<"pckod.d", int_mips_pckod_d, MSA128D>;
1953
1954 class PCNT_B_DESC : MSA_2R_DESC_BASE<"pcnt.b", ctpop, MSA128B>;
1955 class PCNT_H_DESC : MSA_2R_DESC_BASE<"pcnt.h", ctpop, MSA128H>;
1956 class PCNT_W_DESC : MSA_2R_DESC_BASE<"pcnt.w", ctpop, MSA128W>;
1957 class PCNT_D_DESC : MSA_2R_DESC_BASE<"pcnt.d", ctpop, MSA128D>;
1958
1959 class SAT_S_B_DESC : MSA_BIT_B_DESC_BASE<"sat_s.b", int_mips_sat_s_b, MSA128B>;
1960 class SAT_S_H_DESC : MSA_BIT_H_DESC_BASE<"sat_s.h", int_mips_sat_s_h, MSA128H>;
1961 class SAT_S_W_DESC : MSA_BIT_W_DESC_BASE<"sat_s.w", int_mips_sat_s_w, MSA128W>;
1962 class SAT_S_D_DESC : MSA_BIT_D_DESC_BASE<"sat_s.d", int_mips_sat_s_d, MSA128D>;
1963
1964 class SAT_U_B_DESC : MSA_BIT_B_DESC_BASE<"sat_u.b", int_mips_sat_u_b, MSA128B>;
1965 class SAT_U_H_DESC : MSA_BIT_H_DESC_BASE<"sat_u.h", int_mips_sat_u_h, MSA128H>;
1966 class SAT_U_W_DESC : MSA_BIT_W_DESC_BASE<"sat_u.w", int_mips_sat_u_w, MSA128W>;
1967 class SAT_U_D_DESC : MSA_BIT_D_DESC_BASE<"sat_u.d", int_mips_sat_u_d, MSA128D>;
1968
1969 class SHF_B_DESC : MSA_I8_DESC_BASE<"shf.b", int_mips_shf_b, MSA128B>;
1970 class SHF_H_DESC : MSA_I8_DESC_BASE<"shf.h", int_mips_shf_h, MSA128H>;
1971 class SHF_W_DESC : MSA_I8_DESC_BASE<"shf.w", int_mips_shf_w, MSA128W>;
1972
1973 class SLD_B_DESC : MSA_3R_DESC_BASE<"sld.b", int_mips_sld_b, MSA128B>;
1974 class SLD_H_DESC : MSA_3R_DESC_BASE<"sld.h", int_mips_sld_h, MSA128H>;
1975 class SLD_W_DESC : MSA_3R_DESC_BASE<"sld.w", int_mips_sld_w, MSA128W>;
1976 class SLD_D_DESC : MSA_3R_DESC_BASE<"sld.d", int_mips_sld_d, MSA128D>;
1977
1978 class SLDI_B_DESC : MSA_BIT_B_DESC_BASE<"sldi.b", int_mips_sldi_b, MSA128B>;
1979 class SLDI_H_DESC : MSA_BIT_H_DESC_BASE<"sldi.h", int_mips_sldi_h, MSA128H>;
1980 class SLDI_W_DESC : MSA_BIT_W_DESC_BASE<"sldi.w", int_mips_sldi_w, MSA128W>;
1981 class SLDI_D_DESC : MSA_BIT_D_DESC_BASE<"sldi.d", int_mips_sldi_d, MSA128D>;
1982
1983 class SLL_B_DESC : MSA_3R_DESC_BASE<"sll.b", shl, MSA128B>;
1984 class SLL_H_DESC : MSA_3R_DESC_BASE<"sll.h", shl, MSA128H>;
1985 class SLL_W_DESC : MSA_3R_DESC_BASE<"sll.w", shl, MSA128W>;
1986 class SLL_D_DESC : MSA_3R_DESC_BASE<"sll.d", shl, MSA128D>;
1987
1988 class SLLI_B_DESC : MSA_BIT_SPLATB_DESC_BASE<"slli.b", shl, MSA128B>;
1989 class SLLI_H_DESC : MSA_BIT_SPLATH_DESC_BASE<"slli.h", shl, MSA128H>;
1990 class SLLI_W_DESC : MSA_BIT_SPLATW_DESC_BASE<"slli.w", shl, MSA128W>;
1991 class SLLI_D_DESC : MSA_BIT_SPLATD_DESC_BASE<"slli.d", shl, MSA128D>;
1992
1993 class SPLAT_B_DESC : MSA_3R_DESC_BASE<"splat.b", int_mips_splat_b, MSA128B,
1994                                       MSA128B, GPR32>;
1995 class SPLAT_H_DESC : MSA_3R_DESC_BASE<"splat.h", int_mips_splat_h, MSA128H,
1996                                       MSA128H, GPR32>;
1997 class SPLAT_W_DESC : MSA_3R_DESC_BASE<"splat.w", int_mips_splat_w, MSA128W,
1998                                       MSA128W, GPR32>;
1999 class SPLAT_D_DESC : MSA_3R_DESC_BASE<"splat.d", int_mips_splat_d, MSA128D,
2000                                       MSA128D, GPR32>;
2001
2002 class SPLATI_B_DESC : MSA_BIT_B_DESC_BASE<"splati.b", int_mips_splati_b,
2003                                           MSA128B>;
2004 class SPLATI_H_DESC : MSA_BIT_H_DESC_BASE<"splati.h", int_mips_splati_h,
2005                                           MSA128H>;
2006 class SPLATI_W_DESC : MSA_BIT_W_DESC_BASE<"splati.w", int_mips_splati_w,
2007                                           MSA128W>;
2008 class SPLATI_D_DESC : MSA_BIT_D_DESC_BASE<"splati.d", int_mips_splati_d,
2009                                           MSA128D>;
2010
2011 class SRA_B_DESC : MSA_3R_DESC_BASE<"sra.b", sra, MSA128B>;
2012 class SRA_H_DESC : MSA_3R_DESC_BASE<"sra.h", sra, MSA128H>;
2013 class SRA_W_DESC : MSA_3R_DESC_BASE<"sra.w", sra, MSA128W>;
2014 class SRA_D_DESC : MSA_3R_DESC_BASE<"sra.d", sra, MSA128D>;
2015
2016 class SRAI_B_DESC : MSA_BIT_SPLATB_DESC_BASE<"srai.b", sra, MSA128B>;
2017 class SRAI_H_DESC : MSA_BIT_SPLATH_DESC_BASE<"srai.h", sra, MSA128H>;
2018 class SRAI_W_DESC : MSA_BIT_SPLATW_DESC_BASE<"srai.w", sra, MSA128W>;
2019 class SRAI_D_DESC : MSA_BIT_SPLATD_DESC_BASE<"srai.d", sra, MSA128D>;
2020
2021 class SRAR_B_DESC : MSA_3R_DESC_BASE<"srar.b", int_mips_srar_b, MSA128B>;
2022 class SRAR_H_DESC : MSA_3R_DESC_BASE<"srar.h", int_mips_srar_h, MSA128H>;
2023 class SRAR_W_DESC : MSA_3R_DESC_BASE<"srar.w", int_mips_srar_w, MSA128W>;
2024 class SRAR_D_DESC : MSA_3R_DESC_BASE<"srar.d", int_mips_srar_d, MSA128D>;
2025
2026 class SRARI_B_DESC : MSA_BIT_B_DESC_BASE<"srari.b", int_mips_srari_b, MSA128B>;
2027 class SRARI_H_DESC : MSA_BIT_H_DESC_BASE<"srari.h", int_mips_srari_h, MSA128H>;
2028 class SRARI_W_DESC : MSA_BIT_W_DESC_BASE<"srari.w", int_mips_srari_w, MSA128W>;
2029 class SRARI_D_DESC : MSA_BIT_D_DESC_BASE<"srari.d", int_mips_srari_d, MSA128D>;
2030
2031 class SRL_B_DESC : MSA_3R_DESC_BASE<"srl.b", srl, MSA128B>;
2032 class SRL_H_DESC : MSA_3R_DESC_BASE<"srl.h", srl, MSA128H>;
2033 class SRL_W_DESC : MSA_3R_DESC_BASE<"srl.w", srl, MSA128W>;
2034 class SRL_D_DESC : MSA_3R_DESC_BASE<"srl.d", srl, MSA128D>;
2035
2036 class SRLI_B_DESC : MSA_BIT_SPLATB_DESC_BASE<"srli.b", srl, MSA128B>;
2037 class SRLI_H_DESC : MSA_BIT_SPLATH_DESC_BASE<"srli.h", srl, MSA128H>;
2038 class SRLI_W_DESC : MSA_BIT_SPLATW_DESC_BASE<"srli.w", srl, MSA128W>;
2039 class SRLI_D_DESC : MSA_BIT_SPLATD_DESC_BASE<"srli.d", srl, MSA128D>;
2040
2041 class SRLR_B_DESC : MSA_3R_DESC_BASE<"srlr.b", int_mips_srlr_b, MSA128B>;
2042 class SRLR_H_DESC : MSA_3R_DESC_BASE<"srlr.h", int_mips_srlr_h, MSA128H>;
2043 class SRLR_W_DESC : MSA_3R_DESC_BASE<"srlr.w", int_mips_srlr_w, MSA128W>;
2044 class SRLR_D_DESC : MSA_3R_DESC_BASE<"srlr.d", int_mips_srlr_d, MSA128D>;
2045
2046 class SRLRI_B_DESC : MSA_BIT_B_DESC_BASE<"srlri.b", int_mips_srlri_b, MSA128B>;
2047 class SRLRI_H_DESC : MSA_BIT_H_DESC_BASE<"srlri.h", int_mips_srlri_h, MSA128H>;
2048 class SRLRI_W_DESC : MSA_BIT_W_DESC_BASE<"srlri.w", int_mips_srlri_w, MSA128W>;
2049 class SRLRI_D_DESC : MSA_BIT_D_DESC_BASE<"srlri.d", int_mips_srlri_d, MSA128D>;
2050
2051 class ST_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
2052                    ValueType TyNode, RegisterClass RCWD,
2053                    Operand MemOpnd = mem, ComplexPattern Addr = addrRegImm,
2054                    InstrItinClass itin = NoItinerary> {
2055   dag OutOperandList = (outs);
2056   dag InOperandList = (ins RCWD:$wd, MemOpnd:$addr);
2057   string AsmString = !strconcat(instr_asm, "\t$wd, $addr");
2058   list<dag> Pattern = [(OpNode (TyNode RCWD:$wd), Addr:$addr)];
2059   InstrItinClass Itinerary = itin;
2060 }
2061
2062 class ST_B_DESC : ST_DESC_BASE<"st.b", store, v16i8, MSA128B>;
2063 class ST_H_DESC : ST_DESC_BASE<"st.h", store, v8i16, MSA128H>;
2064 class ST_W_DESC : ST_DESC_BASE<"st.w", store, v4i32, MSA128W>;
2065 class ST_D_DESC : ST_DESC_BASE<"st.d", store, v2i64, MSA128D>;
2066
2067 class STX_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
2068                     ValueType TyNode, RegisterClass RCWD,
2069                     Operand MemOpnd = mem, ComplexPattern Addr = addrRegReg,
2070                     InstrItinClass itin = NoItinerary> {
2071   dag OutOperandList = (outs);
2072   dag InOperandList = (ins RCWD:$wd, MemOpnd:$addr);
2073   string AsmString = !strconcat(instr_asm, "\t$wd, $addr");
2074   list<dag> Pattern = [(OpNode (TyNode RCWD:$wd), Addr:$addr)];
2075   InstrItinClass Itinerary = itin;
2076 }
2077
2078 class STX_B_DESC : STX_DESC_BASE<"stx.b", store, v16i8, MSA128B>;
2079 class STX_H_DESC : STX_DESC_BASE<"stx.h", store, v8i16, MSA128H>;
2080 class STX_W_DESC : STX_DESC_BASE<"stx.w", store, v4i32, MSA128W>;
2081 class STX_D_DESC : STX_DESC_BASE<"stx.d", store, v2i64, MSA128D>;
2082
2083 class SUBS_S_B_DESC : MSA_3R_DESC_BASE<"subs_s.b", int_mips_subs_s_b, MSA128B>;
2084 class SUBS_S_H_DESC : MSA_3R_DESC_BASE<"subs_s.h", int_mips_subs_s_h, MSA128H>;
2085 class SUBS_S_W_DESC : MSA_3R_DESC_BASE<"subs_s.w", int_mips_subs_s_w, MSA128W>;
2086 class SUBS_S_D_DESC : MSA_3R_DESC_BASE<"subs_s.d", int_mips_subs_s_d, MSA128D>;
2087
2088 class SUBS_U_B_DESC : MSA_3R_DESC_BASE<"subs_u.b", int_mips_subs_u_b, MSA128B>;
2089 class SUBS_U_H_DESC : MSA_3R_DESC_BASE<"subs_u.h", int_mips_subs_u_h, MSA128H>;
2090 class SUBS_U_W_DESC : MSA_3R_DESC_BASE<"subs_u.w", int_mips_subs_u_w, MSA128W>;
2091 class SUBS_U_D_DESC : MSA_3R_DESC_BASE<"subs_u.d", int_mips_subs_u_d, MSA128D>;
2092
2093 class SUBSUS_U_B_DESC : MSA_3R_DESC_BASE<"subsus_u.b", int_mips_subsus_u_b,
2094                                          MSA128B>;
2095 class SUBSUS_U_H_DESC : MSA_3R_DESC_BASE<"subsus_u.h", int_mips_subsus_u_h,
2096                                          MSA128H>;
2097 class SUBSUS_U_W_DESC : MSA_3R_DESC_BASE<"subsus_u.w", int_mips_subsus_u_w,
2098                                          MSA128W>;
2099 class SUBSUS_U_D_DESC : MSA_3R_DESC_BASE<"subsus_u.d", int_mips_subsus_u_d,
2100                                          MSA128D>;
2101
2102 class SUBSUU_S_B_DESC : MSA_3R_DESC_BASE<"subsuu_s.b", int_mips_subsuu_s_b,
2103                                          MSA128B>;
2104 class SUBSUU_S_H_DESC : MSA_3R_DESC_BASE<"subsuu_s.h", int_mips_subsuu_s_h,
2105                                          MSA128H>;
2106 class SUBSUU_S_W_DESC : MSA_3R_DESC_BASE<"subsuu_s.w", int_mips_subsuu_s_w,
2107                                          MSA128W>;
2108 class SUBSUU_S_D_DESC : MSA_3R_DESC_BASE<"subsuu_s.d", int_mips_subsuu_s_d,
2109                                          MSA128D>;
2110
2111 class SUBV_B_DESC : MSA_3R_DESC_BASE<"subv.b", sub, MSA128B>;
2112 class SUBV_H_DESC : MSA_3R_DESC_BASE<"subv.h", sub, MSA128H>;
2113 class SUBV_W_DESC : MSA_3R_DESC_BASE<"subv.w", sub, MSA128W>;
2114 class SUBV_D_DESC : MSA_3R_DESC_BASE<"subv.d", sub, MSA128D>;
2115
2116 class SUBVI_B_DESC : MSA_I5_DESC_BASE<"subvi.b", sub, vsplati8,  MSA128B>;
2117 class SUBVI_H_DESC : MSA_I5_DESC_BASE<"subvi.h", sub, vsplati16, MSA128H>;
2118 class SUBVI_W_DESC : MSA_I5_DESC_BASE<"subvi.w", sub, vsplati32, MSA128W>;
2119 class SUBVI_D_DESC : MSA_I5_DESC_BASE<"subvi.d", sub, vsplati64, MSA128D>;
2120
2121 class VSHF_B_DESC : MSA_3R_DESC_BASE<"vshf.b", int_mips_vshf_b, MSA128B>;
2122 class VSHF_H_DESC : MSA_3R_DESC_BASE<"vshf.h", int_mips_vshf_h, MSA128H>;
2123 class VSHF_W_DESC : MSA_3R_DESC_BASE<"vshf.w", int_mips_vshf_w, MSA128W>;
2124 class VSHF_D_DESC : MSA_3R_DESC_BASE<"vshf.d", int_mips_vshf_d, MSA128D>;
2125
2126 class XOR_V_DESC : MSA_VEC_DESC_BASE<"xor.v", xor, MSA128B>;
2127 class XOR_V_H_PSEUDO_DESC : MSA_VEC_PSEUDO_BASE<xor, MSA128H>;
2128 class XOR_V_W_PSEUDO_DESC : MSA_VEC_PSEUDO_BASE<xor, MSA128W>;
2129 class XOR_V_D_PSEUDO_DESC : MSA_VEC_PSEUDO_BASE<xor, MSA128D>;
2130
2131 class XORI_B_DESC : MSA_I8_DESC_BASE<"xori.b", int_mips_xori_b, MSA128B>;
2132
2133 // Instruction defs.
2134 def ADD_A_B : ADD_A_B_ENC, ADD_A_B_DESC;
2135 def ADD_A_H : ADD_A_H_ENC, ADD_A_H_DESC;
2136 def ADD_A_W : ADD_A_W_ENC, ADD_A_W_DESC;
2137 def ADD_A_D : ADD_A_D_ENC, ADD_A_D_DESC;
2138
2139 def ADDS_A_B : ADDS_A_B_ENC, ADDS_A_B_DESC;
2140 def ADDS_A_H : ADDS_A_H_ENC, ADDS_A_H_DESC;
2141 def ADDS_A_W : ADDS_A_W_ENC, ADDS_A_W_DESC;
2142 def ADDS_A_D : ADDS_A_D_ENC, ADDS_A_D_DESC;
2143
2144 def ADDS_S_B : ADDS_S_B_ENC, ADDS_S_B_DESC;
2145 def ADDS_S_H : ADDS_S_H_ENC, ADDS_S_H_DESC;
2146 def ADDS_S_W : ADDS_S_W_ENC, ADDS_S_W_DESC;
2147 def ADDS_S_D : ADDS_S_D_ENC, ADDS_S_D_DESC;
2148
2149 def ADDS_U_B : ADDS_U_B_ENC, ADDS_U_B_DESC;
2150 def ADDS_U_H : ADDS_U_H_ENC, ADDS_U_H_DESC;
2151 def ADDS_U_W : ADDS_U_W_ENC, ADDS_U_W_DESC;
2152 def ADDS_U_D : ADDS_U_D_ENC, ADDS_U_D_DESC;
2153
2154 def ADDV_B : ADDV_B_ENC, ADDV_B_DESC;
2155 def ADDV_H : ADDV_H_ENC, ADDV_H_DESC;
2156 def ADDV_W : ADDV_W_ENC, ADDV_W_DESC;
2157 def ADDV_D : ADDV_D_ENC, ADDV_D_DESC;
2158
2159 def ADDVI_B : ADDVI_B_ENC, ADDVI_B_DESC;
2160 def ADDVI_H : ADDVI_H_ENC, ADDVI_H_DESC;
2161 def ADDVI_W : ADDVI_W_ENC, ADDVI_W_DESC;
2162 def ADDVI_D : ADDVI_D_ENC, ADDVI_D_DESC;
2163
2164 def AND_V : AND_V_ENC, AND_V_DESC;
2165 def AND_V_H_PSEUDO : AND_V_H_PSEUDO_DESC,
2166                      PseudoInstExpansion<(AND_V MSA128B:$wd,
2167                                                 MSA128B:$ws, MSA128B:$wt)>;
2168 def AND_V_W_PSEUDO : AND_V_W_PSEUDO_DESC,
2169                      PseudoInstExpansion<(AND_V MSA128B:$wd,
2170                                                 MSA128B:$ws, MSA128B:$wt)>;
2171 def AND_V_D_PSEUDO : AND_V_D_PSEUDO_DESC,
2172                      PseudoInstExpansion<(AND_V MSA128B:$wd,
2173                                                 MSA128B:$ws, MSA128B:$wt)>;
2174
2175 def ANDI_B : ANDI_B_ENC, ANDI_B_DESC;
2176
2177 def ASUB_S_B : ASUB_S_B_ENC, ASUB_S_B_DESC;
2178 def ASUB_S_H : ASUB_S_H_ENC, ASUB_S_H_DESC;
2179 def ASUB_S_W : ASUB_S_W_ENC, ASUB_S_W_DESC;
2180 def ASUB_S_D : ASUB_S_D_ENC, ASUB_S_D_DESC;
2181
2182 def ASUB_U_B : ASUB_U_B_ENC, ASUB_U_B_DESC;
2183 def ASUB_U_H : ASUB_U_H_ENC, ASUB_U_H_DESC;
2184 def ASUB_U_W : ASUB_U_W_ENC, ASUB_U_W_DESC;
2185 def ASUB_U_D : ASUB_U_D_ENC, ASUB_U_D_DESC;
2186
2187 def AVE_S_B : AVE_S_B_ENC, AVE_S_B_DESC;
2188 def AVE_S_H : AVE_S_H_ENC, AVE_S_H_DESC;
2189 def AVE_S_W : AVE_S_W_ENC, AVE_S_W_DESC;
2190 def AVE_S_D : AVE_S_D_ENC, AVE_S_D_DESC;
2191
2192 def AVE_U_B : AVE_U_B_ENC, AVE_U_B_DESC;
2193 def AVE_U_H : AVE_U_H_ENC, AVE_U_H_DESC;
2194 def AVE_U_W : AVE_U_W_ENC, AVE_U_W_DESC;
2195 def AVE_U_D : AVE_U_D_ENC, AVE_U_D_DESC;
2196
2197 def AVER_S_B : AVER_S_B_ENC, AVER_S_B_DESC;
2198 def AVER_S_H : AVER_S_H_ENC, AVER_S_H_DESC;
2199 def AVER_S_W : AVER_S_W_ENC, AVER_S_W_DESC;
2200 def AVER_S_D : AVER_S_D_ENC, AVER_S_D_DESC;
2201
2202 def AVER_U_B : AVER_U_B_ENC, AVER_U_B_DESC;
2203 def AVER_U_H : AVER_U_H_ENC, AVER_U_H_DESC;
2204 def AVER_U_W : AVER_U_W_ENC, AVER_U_W_DESC;
2205 def AVER_U_D : AVER_U_D_ENC, AVER_U_D_DESC;
2206
2207 def BCLR_B : BCLR_B_ENC, BCLR_B_DESC;
2208 def BCLR_H : BCLR_H_ENC, BCLR_H_DESC;
2209 def BCLR_W : BCLR_W_ENC, BCLR_W_DESC;
2210 def BCLR_D : BCLR_D_ENC, BCLR_D_DESC;
2211
2212 def BCLRI_B : BCLRI_B_ENC, BCLRI_B_DESC;
2213 def BCLRI_H : BCLRI_H_ENC, BCLRI_H_DESC;
2214 def BCLRI_W : BCLRI_W_ENC, BCLRI_W_DESC;
2215 def BCLRI_D : BCLRI_D_ENC, BCLRI_D_DESC;
2216
2217 def BINSL_B : BINSL_B_ENC, BINSL_B_DESC;
2218 def BINSL_H : BINSL_H_ENC, BINSL_H_DESC;
2219 def BINSL_W : BINSL_W_ENC, BINSL_W_DESC;
2220 def BINSL_D : BINSL_D_ENC, BINSL_D_DESC;
2221
2222 def BINSLI_B : BINSLI_B_ENC, BINSLI_B_DESC;
2223 def BINSLI_H : BINSLI_H_ENC, BINSLI_H_DESC;
2224 def BINSLI_W : BINSLI_W_ENC, BINSLI_W_DESC;
2225 def BINSLI_D : BINSLI_D_ENC, BINSLI_D_DESC;
2226
2227 def BINSR_B : BINSR_B_ENC, BINSR_B_DESC;
2228 def BINSR_H : BINSR_H_ENC, BINSR_H_DESC;
2229 def BINSR_W : BINSR_W_ENC, BINSR_W_DESC;
2230 def BINSR_D : BINSR_D_ENC, BINSR_D_DESC;
2231
2232 def BINSRI_B : BINSRI_B_ENC, BINSRI_B_DESC;
2233 def BINSRI_H : BINSRI_H_ENC, BINSRI_H_DESC;
2234 def BINSRI_W : BINSRI_W_ENC, BINSRI_W_DESC;
2235 def BINSRI_D : BINSRI_D_ENC, BINSRI_D_DESC;
2236
2237 def BMNZ_V : BMNZ_V_ENC, BMNZ_V_DESC;
2238
2239 def BMNZI_B : BMNZI_B_ENC, BMNZI_B_DESC;
2240
2241 def BMZ_V : BMZ_V_ENC, BMZ_V_DESC;
2242
2243 def BMZI_B : BMZI_B_ENC, BMZI_B_DESC;
2244
2245 def BNEG_B : BNEG_B_ENC, BNEG_B_DESC;
2246 def BNEG_H : BNEG_H_ENC, BNEG_H_DESC;
2247 def BNEG_W : BNEG_W_ENC, BNEG_W_DESC;
2248 def BNEG_D : BNEG_D_ENC, BNEG_D_DESC;
2249
2250 def BNEGI_B : BNEGI_B_ENC, BNEGI_B_DESC;
2251 def BNEGI_H : BNEGI_H_ENC, BNEGI_H_DESC;
2252 def BNEGI_W : BNEGI_W_ENC, BNEGI_W_DESC;
2253 def BNEGI_D : BNEGI_D_ENC, BNEGI_D_DESC;
2254
2255 def BNZ_B : BNZ_B_ENC, BNZ_B_DESC;
2256 def BNZ_H : BNZ_H_ENC, BNZ_H_DESC;
2257 def BNZ_W : BNZ_W_ENC, BNZ_W_DESC;
2258 def BNZ_D : BNZ_D_ENC, BNZ_D_DESC;
2259
2260 def BNZ_V : BNZ_V_ENC, BNZ_V_DESC;
2261
2262 def BSEL_V : BSEL_V_ENC, BSEL_V_DESC;
2263
2264 class MSA_BSEL_PSEUDO_BASE<RegisterClass RC, ValueType Ty> :
2265   MipsPseudo<(outs RC:$wd), (ins RC:$wd_in, RC:$ws, RC:$wt),
2266              [(set RC:$wd, (Ty (vselect RC:$wd_in, RC:$ws, RC:$wt)))]>,
2267   PseudoInstExpansion<(BSEL_V MSA128B:$wd, MSA128B:$wd_in, MSA128B:$ws,
2268                               MSA128B:$wt)> {
2269   let Constraints = "$wd_in = $wd";
2270 }
2271
2272 def BSEL_H_PSEUDO : MSA_BSEL_PSEUDO_BASE<MSA128H, v8i16>;
2273 def BSEL_W_PSEUDO : MSA_BSEL_PSEUDO_BASE<MSA128W, v4i32>;
2274 def BSEL_D_PSEUDO : MSA_BSEL_PSEUDO_BASE<MSA128D, v2i64>;
2275 def BSEL_FW_PSEUDO : MSA_BSEL_PSEUDO_BASE<MSA128W, v4f32>;
2276 def BSEL_FD_PSEUDO : MSA_BSEL_PSEUDO_BASE<MSA128D, v2f64>;
2277
2278 def BSELI_B : BSELI_B_ENC, BSELI_B_DESC;
2279
2280 def BSET_B : BSET_B_ENC, BSET_B_DESC;
2281 def BSET_H : BSET_H_ENC, BSET_H_DESC;
2282 def BSET_W : BSET_W_ENC, BSET_W_DESC;
2283 def BSET_D : BSET_D_ENC, BSET_D_DESC;
2284
2285 def BSETI_B : BSETI_B_ENC, BSETI_B_DESC;
2286 def BSETI_H : BSETI_H_ENC, BSETI_H_DESC;
2287 def BSETI_W : BSETI_W_ENC, BSETI_W_DESC;
2288 def BSETI_D : BSETI_D_ENC, BSETI_D_DESC;
2289
2290 def BZ_B : BZ_B_ENC, BZ_B_DESC;
2291 def BZ_H : BZ_H_ENC, BZ_H_DESC;
2292 def BZ_W : BZ_W_ENC, BZ_W_DESC;
2293 def BZ_D : BZ_D_ENC, BZ_D_DESC;
2294
2295 def BZ_V : BZ_V_ENC, BZ_V_DESC;
2296
2297 def CEQ_B : CEQ_B_ENC, CEQ_B_DESC;
2298 def CEQ_H : CEQ_H_ENC, CEQ_H_DESC;
2299 def CEQ_W : CEQ_W_ENC, CEQ_W_DESC;
2300 def CEQ_D : CEQ_D_ENC, CEQ_D_DESC;
2301
2302 def CEQI_B : CEQI_B_ENC, CEQI_B_DESC;
2303 def CEQI_H : CEQI_H_ENC, CEQI_H_DESC;
2304 def CEQI_W : CEQI_W_ENC, CEQI_W_DESC;
2305 def CEQI_D : CEQI_D_ENC, CEQI_D_DESC;
2306
2307 def CFCMSA : CFCMSA_ENC, CFCMSA_DESC;
2308
2309 def CLE_S_B : CLE_S_B_ENC, CLE_S_B_DESC;
2310 def CLE_S_H : CLE_S_H_ENC, CLE_S_H_DESC;
2311 def CLE_S_W : CLE_S_W_ENC, CLE_S_W_DESC;
2312 def CLE_S_D : CLE_S_D_ENC, CLE_S_D_DESC;
2313
2314 def CLE_U_B : CLE_U_B_ENC, CLE_U_B_DESC;
2315 def CLE_U_H : CLE_U_H_ENC, CLE_U_H_DESC;
2316 def CLE_U_W : CLE_U_W_ENC, CLE_U_W_DESC;
2317 def CLE_U_D : CLE_U_D_ENC, CLE_U_D_DESC;
2318
2319 def CLEI_S_B : CLEI_S_B_ENC, CLEI_S_B_DESC;
2320 def CLEI_S_H : CLEI_S_H_ENC, CLEI_S_H_DESC;
2321 def CLEI_S_W : CLEI_S_W_ENC, CLEI_S_W_DESC;
2322 def CLEI_S_D : CLEI_S_D_ENC, CLEI_S_D_DESC;
2323
2324 def CLEI_U_B : CLEI_U_B_ENC, CLEI_U_B_DESC;
2325 def CLEI_U_H : CLEI_U_H_ENC, CLEI_U_H_DESC;
2326 def CLEI_U_W : CLEI_U_W_ENC, CLEI_U_W_DESC;
2327 def CLEI_U_D : CLEI_U_D_ENC, CLEI_U_D_DESC;
2328
2329 def CLT_S_B : CLT_S_B_ENC, CLT_S_B_DESC;
2330 def CLT_S_H : CLT_S_H_ENC, CLT_S_H_DESC;
2331 def CLT_S_W : CLT_S_W_ENC, CLT_S_W_DESC;
2332 def CLT_S_D : CLT_S_D_ENC, CLT_S_D_DESC;
2333
2334 def CLT_U_B : CLT_U_B_ENC, CLT_U_B_DESC;
2335 def CLT_U_H : CLT_U_H_ENC, CLT_U_H_DESC;
2336 def CLT_U_W : CLT_U_W_ENC, CLT_U_W_DESC;
2337 def CLT_U_D : CLT_U_D_ENC, CLT_U_D_DESC;
2338
2339 def CLTI_S_B : CLTI_S_B_ENC, CLTI_S_B_DESC;
2340 def CLTI_S_H : CLTI_S_H_ENC, CLTI_S_H_DESC;
2341 def CLTI_S_W : CLTI_S_W_ENC, CLTI_S_W_DESC;
2342 def CLTI_S_D : CLTI_S_D_ENC, CLTI_S_D_DESC;
2343
2344 def CLTI_U_B : CLTI_U_B_ENC, CLTI_U_B_DESC;
2345 def CLTI_U_H : CLTI_U_H_ENC, CLTI_U_H_DESC;
2346 def CLTI_U_W : CLTI_U_W_ENC, CLTI_U_W_DESC;
2347 def CLTI_U_D : CLTI_U_D_ENC, CLTI_U_D_DESC;
2348
2349 def COPY_S_B : COPY_S_B_ENC, COPY_S_B_DESC;
2350 def COPY_S_H : COPY_S_H_ENC, COPY_S_H_DESC;
2351 def COPY_S_W : COPY_S_W_ENC, COPY_S_W_DESC;
2352
2353 def COPY_U_B : COPY_U_B_ENC, COPY_U_B_DESC;
2354 def COPY_U_H : COPY_U_H_ENC, COPY_U_H_DESC;
2355 def COPY_U_W : COPY_U_W_ENC, COPY_U_W_DESC;
2356
2357 def CTCMSA : CTCMSA_ENC, CTCMSA_DESC;
2358
2359 def DIV_S_B : DIV_S_B_ENC, DIV_S_B_DESC;
2360 def DIV_S_H : DIV_S_H_ENC, DIV_S_H_DESC;
2361 def DIV_S_W : DIV_S_W_ENC, DIV_S_W_DESC;
2362 def DIV_S_D : DIV_S_D_ENC, DIV_S_D_DESC;
2363
2364 def DIV_U_B : DIV_U_B_ENC, DIV_U_B_DESC;
2365 def DIV_U_H : DIV_U_H_ENC, DIV_U_H_DESC;
2366 def DIV_U_W : DIV_U_W_ENC, DIV_U_W_DESC;
2367 def DIV_U_D : DIV_U_D_ENC, DIV_U_D_DESC;
2368
2369 def DOTP_S_H : DOTP_S_H_ENC, DOTP_S_H_DESC;
2370 def DOTP_S_W : DOTP_S_W_ENC, DOTP_S_W_DESC;
2371 def DOTP_S_D : DOTP_S_D_ENC, DOTP_S_D_DESC;
2372
2373 def DOTP_U_H : DOTP_U_H_ENC, DOTP_U_H_DESC;
2374 def DOTP_U_W : DOTP_U_W_ENC, DOTP_U_W_DESC;
2375 def DOTP_U_D : DOTP_U_D_ENC, DOTP_U_D_DESC;
2376
2377 def DPADD_S_H : DPADD_S_H_ENC, DPADD_S_H_DESC;
2378 def DPADD_S_W : DPADD_S_W_ENC, DPADD_S_W_DESC;
2379 def DPADD_S_D : DPADD_S_D_ENC, DPADD_S_D_DESC;
2380
2381 def DPADD_U_H : DPADD_U_H_ENC, DPADD_U_H_DESC;
2382 def DPADD_U_W : DPADD_U_W_ENC, DPADD_U_W_DESC;
2383 def DPADD_U_D : DPADD_U_D_ENC, DPADD_U_D_DESC;
2384
2385 def DPSUB_S_H : DPSUB_S_H_ENC, DPSUB_S_H_DESC;
2386 def DPSUB_S_W : DPSUB_S_W_ENC, DPSUB_S_W_DESC;
2387 def DPSUB_S_D : DPSUB_S_D_ENC, DPSUB_S_D_DESC;
2388
2389 def DPSUB_U_H : DPSUB_U_H_ENC, DPSUB_U_H_DESC;
2390 def DPSUB_U_W : DPSUB_U_W_ENC, DPSUB_U_W_DESC;
2391 def DPSUB_U_D : DPSUB_U_D_ENC, DPSUB_U_D_DESC;
2392
2393 def FADD_W : FADD_W_ENC, FADD_W_DESC;
2394 def FADD_D : FADD_D_ENC, FADD_D_DESC;
2395
2396 def FCAF_W : FCAF_W_ENC, FCAF_W_DESC;
2397 def FCAF_D : FCAF_D_ENC, FCAF_D_DESC;
2398
2399 def FCEQ_W : FCEQ_W_ENC, FCEQ_W_DESC;
2400 def FCEQ_D : FCEQ_D_ENC, FCEQ_D_DESC;
2401
2402 def FCLE_W : FCLE_W_ENC, FCLE_W_DESC;
2403 def FCLE_D : FCLE_D_ENC, FCLE_D_DESC;
2404
2405 def FCLT_W : FCLT_W_ENC, FCLT_W_DESC;
2406 def FCLT_D : FCLT_D_ENC, FCLT_D_DESC;
2407
2408 def FCLASS_W : FCLASS_W_ENC, FCLASS_W_DESC;
2409 def FCLASS_D : FCLASS_D_ENC, FCLASS_D_DESC;
2410
2411 def FCNE_W : FCNE_W_ENC, FCNE_W_DESC;
2412 def FCNE_D : FCNE_D_ENC, FCNE_D_DESC;
2413
2414 def FCOR_W : FCOR_W_ENC, FCOR_W_DESC;
2415 def FCOR_D : FCOR_D_ENC, FCOR_D_DESC;
2416
2417 def FCUEQ_W : FCUEQ_W_ENC, FCUEQ_W_DESC;
2418 def FCUEQ_D : FCUEQ_D_ENC, FCUEQ_D_DESC;
2419
2420 def FCULE_W : FCULE_W_ENC, FCULE_W_DESC;
2421 def FCULE_D : FCULE_D_ENC, FCULE_D_DESC;
2422
2423 def FCULT_W : FCULT_W_ENC, FCULT_W_DESC;
2424 def FCULT_D : FCULT_D_ENC, FCULT_D_DESC;
2425
2426 def FCUN_W : FCUN_W_ENC, FCUN_W_DESC;
2427 def FCUN_D : FCUN_D_ENC, FCUN_D_DESC;
2428
2429 def FCUNE_W : FCUNE_W_ENC, FCUNE_W_DESC;
2430 def FCUNE_D : FCUNE_D_ENC, FCUNE_D_DESC;
2431
2432 def FDIV_W : FDIV_W_ENC, FDIV_W_DESC;
2433 def FDIV_D : FDIV_D_ENC, FDIV_D_DESC;
2434
2435 def FEXDO_H : FEXDO_H_ENC, FEXDO_H_DESC;
2436 def FEXDO_W : FEXDO_W_ENC, FEXDO_W_DESC;
2437
2438 def FEXP2_W : FEXP2_W_ENC, FEXP2_W_DESC;
2439 def FEXP2_D : FEXP2_D_ENC, FEXP2_D_DESC;
2440
2441 def FEXUPL_W : FEXUPL_W_ENC, FEXUPL_W_DESC;
2442 def FEXUPL_D : FEXUPL_D_ENC, FEXUPL_D_DESC;
2443
2444 def FEXUPR_W : FEXUPR_W_ENC, FEXUPR_W_DESC;
2445 def FEXUPR_D : FEXUPR_D_ENC, FEXUPR_D_DESC;
2446
2447 def FFINT_S_W : FFINT_S_W_ENC, FFINT_S_W_DESC;
2448 def FFINT_S_D : FFINT_S_D_ENC, FFINT_S_D_DESC;
2449
2450 def FFINT_U_W : FFINT_U_W_ENC, FFINT_U_W_DESC;
2451 def FFINT_U_D : FFINT_U_D_ENC, FFINT_U_D_DESC;
2452
2453 def FFQL_W : FFQL_W_ENC, FFQL_W_DESC;
2454 def FFQL_D : FFQL_D_ENC, FFQL_D_DESC;
2455
2456 def FFQR_W : FFQR_W_ENC, FFQR_W_DESC;
2457 def FFQR_D : FFQR_D_ENC, FFQR_D_DESC;
2458
2459 def FILL_B : FILL_B_ENC, FILL_B_DESC;
2460 def FILL_H : FILL_H_ENC, FILL_H_DESC;
2461 def FILL_W : FILL_W_ENC, FILL_W_DESC;
2462
2463 def FLOG2_W : FLOG2_W_ENC, FLOG2_W_DESC;
2464 def FLOG2_D : FLOG2_D_ENC, FLOG2_D_DESC;
2465
2466 def FMADD_W : FMADD_W_ENC, FMADD_W_DESC;
2467 def FMADD_D : FMADD_D_ENC, FMADD_D_DESC;
2468
2469 def FMAX_W : FMAX_W_ENC, FMAX_W_DESC;
2470 def FMAX_D : FMAX_D_ENC, FMAX_D_DESC;
2471
2472 def FMAX_A_W : FMAX_A_W_ENC, FMAX_A_W_DESC;
2473 def FMAX_A_D : FMAX_A_D_ENC, FMAX_A_D_DESC;
2474
2475 def FMIN_W : FMIN_W_ENC, FMIN_W_DESC;
2476 def FMIN_D : FMIN_D_ENC, FMIN_D_DESC;
2477
2478 def FMIN_A_W : FMIN_A_W_ENC, FMIN_A_W_DESC;
2479 def FMIN_A_D : FMIN_A_D_ENC, FMIN_A_D_DESC;
2480
2481 def FMSUB_W : FMSUB_W_ENC, FMSUB_W_DESC;
2482 def FMSUB_D : FMSUB_D_ENC, FMSUB_D_DESC;
2483
2484 def FMUL_W : FMUL_W_ENC, FMUL_W_DESC;
2485 def FMUL_D : FMUL_D_ENC, FMUL_D_DESC;
2486
2487 def FRINT_W : FRINT_W_ENC, FRINT_W_DESC;
2488 def FRINT_D : FRINT_D_ENC, FRINT_D_DESC;
2489
2490 def FRCP_W : FRCP_W_ENC, FRCP_W_DESC;
2491 def FRCP_D : FRCP_D_ENC, FRCP_D_DESC;
2492
2493 def FRSQRT_W : FRSQRT_W_ENC, FRSQRT_W_DESC;
2494 def FRSQRT_D : FRSQRT_D_ENC, FRSQRT_D_DESC;
2495
2496 def FSAF_W : FSAF_W_ENC, FSAF_W_DESC;
2497 def FSAF_D : FSAF_D_ENC, FSAF_D_DESC;
2498
2499 def FSEQ_W : FSEQ_W_ENC, FSEQ_W_DESC;
2500 def FSEQ_D : FSEQ_D_ENC, FSEQ_D_DESC;
2501
2502 def FSLE_W : FSLE_W_ENC, FSLE_W_DESC;
2503 def FSLE_D : FSLE_D_ENC, FSLE_D_DESC;
2504
2505 def FSLT_W : FSLT_W_ENC, FSLT_W_DESC;
2506 def FSLT_D : FSLT_D_ENC, FSLT_D_DESC;
2507
2508 def FSNE_W : FSNE_W_ENC, FSNE_W_DESC;
2509 def FSNE_D : FSNE_D_ENC, FSNE_D_DESC;
2510
2511 def FSOR_W : FSOR_W_ENC, FSOR_W_DESC;
2512 def FSOR_D : FSOR_D_ENC, FSOR_D_DESC;
2513
2514 def FSQRT_W : FSQRT_W_ENC, FSQRT_W_DESC;
2515 def FSQRT_D : FSQRT_D_ENC, FSQRT_D_DESC;
2516
2517 def FSUB_W : FSUB_W_ENC, FSUB_W_DESC;
2518 def FSUB_D : FSUB_D_ENC, FSUB_D_DESC;
2519
2520 def FSUEQ_W : FSUEQ_W_ENC, FSUEQ_W_DESC;
2521 def FSUEQ_D : FSUEQ_D_ENC, FSUEQ_D_DESC;
2522
2523 def FSULE_W : FSULE_W_ENC, FSULE_W_DESC;
2524 def FSULE_D : FSULE_D_ENC, FSULE_D_DESC;
2525
2526 def FSULT_W : FSULT_W_ENC, FSULT_W_DESC;
2527 def FSULT_D : FSULT_D_ENC, FSULT_D_DESC;
2528
2529 def FSUN_W : FSUN_W_ENC, FSUN_W_DESC;
2530 def FSUN_D : FSUN_D_ENC, FSUN_D_DESC;
2531
2532 def FSUNE_W : FSUNE_W_ENC, FSUNE_W_DESC;
2533 def FSUNE_D : FSUNE_D_ENC, FSUNE_D_DESC;
2534
2535 def FTRUNC_S_W : FTRUNC_S_W_ENC, FTRUNC_S_W_DESC;
2536 def FTRUNC_S_D : FTRUNC_S_D_ENC, FTRUNC_S_D_DESC;
2537
2538 def FTRUNC_U_W : FTRUNC_U_W_ENC, FTRUNC_U_W_DESC;
2539 def FTRUNC_U_D : FTRUNC_U_D_ENC, FTRUNC_U_D_DESC;
2540
2541 def FTINT_S_W : FTINT_S_W_ENC, FTINT_S_W_DESC;
2542 def FTINT_S_D : FTINT_S_D_ENC, FTINT_S_D_DESC;
2543
2544 def FTINT_U_W : FTINT_U_W_ENC, FTINT_U_W_DESC;
2545 def FTINT_U_D : FTINT_U_D_ENC, FTINT_U_D_DESC;
2546
2547 def FTQ_H : FTQ_H_ENC, FTQ_H_DESC;
2548 def FTQ_W : FTQ_W_ENC, FTQ_W_DESC;
2549
2550 def HADD_S_H : HADD_S_H_ENC, HADD_S_H_DESC;
2551 def HADD_S_W : HADD_S_W_ENC, HADD_S_W_DESC;
2552 def HADD_S_D : HADD_S_D_ENC, HADD_S_D_DESC;
2553
2554 def HADD_U_H : HADD_U_H_ENC, HADD_U_H_DESC;
2555 def HADD_U_W : HADD_U_W_ENC, HADD_U_W_DESC;
2556 def HADD_U_D : HADD_U_D_ENC, HADD_U_D_DESC;
2557
2558 def HSUB_S_H : HSUB_S_H_ENC, HSUB_S_H_DESC;
2559 def HSUB_S_W : HSUB_S_W_ENC, HSUB_S_W_DESC;
2560 def HSUB_S_D : HSUB_S_D_ENC, HSUB_S_D_DESC;
2561
2562 def HSUB_U_H : HSUB_U_H_ENC, HSUB_U_H_DESC;
2563 def HSUB_U_W : HSUB_U_W_ENC, HSUB_U_W_DESC;
2564 def HSUB_U_D : HSUB_U_D_ENC, HSUB_U_D_DESC;
2565
2566 def ILVEV_B : ILVEV_B_ENC, ILVEV_B_DESC;
2567 def ILVEV_H : ILVEV_H_ENC, ILVEV_H_DESC;
2568 def ILVEV_W : ILVEV_W_ENC, ILVEV_W_DESC;
2569 def ILVEV_D : ILVEV_D_ENC, ILVEV_D_DESC;
2570
2571 def ILVL_B : ILVL_B_ENC, ILVL_B_DESC;
2572 def ILVL_H : ILVL_H_ENC, ILVL_H_DESC;
2573 def ILVL_W : ILVL_W_ENC, ILVL_W_DESC;
2574 def ILVL_D : ILVL_D_ENC, ILVL_D_DESC;
2575
2576 def ILVOD_B : ILVOD_B_ENC, ILVOD_B_DESC;
2577 def ILVOD_H : ILVOD_H_ENC, ILVOD_H_DESC;
2578 def ILVOD_W : ILVOD_W_ENC, ILVOD_W_DESC;
2579 def ILVOD_D : ILVOD_D_ENC, ILVOD_D_DESC;
2580
2581 def ILVR_B : ILVR_B_ENC, ILVR_B_DESC;
2582 def ILVR_H : ILVR_H_ENC, ILVR_H_DESC;
2583 def ILVR_W : ILVR_W_ENC, ILVR_W_DESC;
2584 def ILVR_D : ILVR_D_ENC, ILVR_D_DESC;
2585
2586 def INSERT_B : INSERT_B_ENC, INSERT_B_DESC;
2587 def INSERT_H : INSERT_H_ENC, INSERT_H_DESC;
2588 def INSERT_W : INSERT_W_ENC, INSERT_W_DESC;
2589
2590 def INSVE_B : INSVE_B_ENC, INSVE_B_DESC;
2591 def INSVE_H : INSVE_H_ENC, INSVE_H_DESC;
2592 def INSVE_W : INSVE_W_ENC, INSVE_W_DESC;
2593 def INSVE_D : INSVE_D_ENC, INSVE_D_DESC;
2594
2595 def LD_B: LD_B_ENC, LD_B_DESC;
2596 def LD_H: LD_H_ENC, LD_H_DESC;
2597 def LD_W: LD_W_ENC, LD_W_DESC;
2598 def LD_D: LD_D_ENC, LD_D_DESC;
2599
2600 def LDI_B : LDI_B_ENC, LDI_B_DESC;
2601 def LDI_H : LDI_H_ENC, LDI_H_DESC;
2602 def LDI_W : LDI_W_ENC, LDI_W_DESC;
2603 def LDI_D : LDI_D_ENC, LDI_D_DESC;
2604
2605 def LDX_B: LDX_B_ENC, LDX_B_DESC;
2606 def LDX_H: LDX_H_ENC, LDX_H_DESC;
2607 def LDX_W: LDX_W_ENC, LDX_W_DESC;
2608 def LDX_D: LDX_D_ENC, LDX_D_DESC;
2609
2610 def MADD_Q_H : MADD_Q_H_ENC, MADD_Q_H_DESC;
2611 def MADD_Q_W : MADD_Q_W_ENC, MADD_Q_W_DESC;
2612
2613 def MADDR_Q_H : MADDR_Q_H_ENC, MADDR_Q_H_DESC;
2614 def MADDR_Q_W : MADDR_Q_W_ENC, MADDR_Q_W_DESC;
2615
2616 def MADDV_B : MADDV_B_ENC, MADDV_B_DESC;
2617 def MADDV_H : MADDV_H_ENC, MADDV_H_DESC;
2618 def MADDV_W : MADDV_W_ENC, MADDV_W_DESC;
2619 def MADDV_D : MADDV_D_ENC, MADDV_D_DESC;
2620
2621 def MAX_A_B : MAX_A_B_ENC, MAX_A_B_DESC;
2622 def MAX_A_H : MAX_A_H_ENC, MAX_A_H_DESC;
2623 def MAX_A_W : MAX_A_W_ENC, MAX_A_W_DESC;
2624 def MAX_A_D : MAX_A_D_ENC, MAX_A_D_DESC;
2625
2626 def MAX_S_B : MAX_S_B_ENC, MAX_S_B_DESC;
2627 def MAX_S_H : MAX_S_H_ENC, MAX_S_H_DESC;
2628 def MAX_S_W : MAX_S_W_ENC, MAX_S_W_DESC;
2629 def MAX_S_D : MAX_S_D_ENC, MAX_S_D_DESC;
2630
2631 def MAX_U_B : MAX_U_B_ENC, MAX_U_B_DESC;
2632 def MAX_U_H : MAX_U_H_ENC, MAX_U_H_DESC;
2633 def MAX_U_W : MAX_U_W_ENC, MAX_U_W_DESC;
2634 def MAX_U_D : MAX_U_D_ENC, MAX_U_D_DESC;
2635
2636 def MAXI_S_B : MAXI_S_B_ENC, MAXI_S_B_DESC;
2637 def MAXI_S_H : MAXI_S_H_ENC, MAXI_S_H_DESC;
2638 def MAXI_S_W : MAXI_S_W_ENC, MAXI_S_W_DESC;
2639 def MAXI_S_D : MAXI_S_D_ENC, MAXI_S_D_DESC;
2640
2641 def MAXI_U_B : MAXI_U_B_ENC, MAXI_U_B_DESC;
2642 def MAXI_U_H : MAXI_U_H_ENC, MAXI_U_H_DESC;
2643 def MAXI_U_W : MAXI_U_W_ENC, MAXI_U_W_DESC;
2644 def MAXI_U_D : MAXI_U_D_ENC, MAXI_U_D_DESC;
2645
2646 def MIN_A_B : MIN_A_B_ENC, MIN_A_B_DESC;
2647 def MIN_A_H : MIN_A_H_ENC, MIN_A_H_DESC;
2648 def MIN_A_W : MIN_A_W_ENC, MIN_A_W_DESC;
2649 def MIN_A_D : MIN_A_D_ENC, MIN_A_D_DESC;
2650
2651 def MIN_S_B : MIN_S_B_ENC, MIN_S_B_DESC;
2652 def MIN_S_H : MIN_S_H_ENC, MIN_S_H_DESC;
2653 def MIN_S_W : MIN_S_W_ENC, MIN_S_W_DESC;
2654 def MIN_S_D : MIN_S_D_ENC, MIN_S_D_DESC;
2655
2656 def MIN_U_B : MIN_U_B_ENC, MIN_U_B_DESC;
2657 def MIN_U_H : MIN_U_H_ENC, MIN_U_H_DESC;
2658 def MIN_U_W : MIN_U_W_ENC, MIN_U_W_DESC;
2659 def MIN_U_D : MIN_U_D_ENC, MIN_U_D_DESC;
2660
2661 def MINI_S_B : MINI_S_B_ENC, MINI_S_B_DESC;
2662 def MINI_S_H : MINI_S_H_ENC, MINI_S_H_DESC;
2663 def MINI_S_W : MINI_S_W_ENC, MINI_S_W_DESC;
2664 def MINI_S_D : MINI_S_D_ENC, MINI_S_D_DESC;
2665
2666 def MINI_U_B : MINI_U_B_ENC, MINI_U_B_DESC;
2667 def MINI_U_H : MINI_U_H_ENC, MINI_U_H_DESC;
2668 def MINI_U_W : MINI_U_W_ENC, MINI_U_W_DESC;
2669 def MINI_U_D : MINI_U_D_ENC, MINI_U_D_DESC;
2670
2671 def MOD_S_B : MOD_S_B_ENC, MOD_S_B_DESC;
2672 def MOD_S_H : MOD_S_H_ENC, MOD_S_H_DESC;
2673 def MOD_S_W : MOD_S_W_ENC, MOD_S_W_DESC;
2674 def MOD_S_D : MOD_S_D_ENC, MOD_S_D_DESC;
2675
2676 def MOD_U_B : MOD_U_B_ENC, MOD_U_B_DESC;
2677 def MOD_U_H : MOD_U_H_ENC, MOD_U_H_DESC;
2678 def MOD_U_W : MOD_U_W_ENC, MOD_U_W_DESC;
2679 def MOD_U_D : MOD_U_D_ENC, MOD_U_D_DESC;
2680
2681 def MOVE_V : MOVE_V_ENC, MOVE_V_DESC;
2682
2683 def MSUB_Q_H : MSUB_Q_H_ENC, MSUB_Q_H_DESC;
2684 def MSUB_Q_W : MSUB_Q_W_ENC, MSUB_Q_W_DESC;
2685
2686 def MSUBR_Q_H : MSUBR_Q_H_ENC, MSUBR_Q_H_DESC;
2687 def MSUBR_Q_W : MSUBR_Q_W_ENC, MSUBR_Q_W_DESC;
2688
2689 def MSUBV_B : MSUBV_B_ENC, MSUBV_B_DESC;
2690 def MSUBV_H : MSUBV_H_ENC, MSUBV_H_DESC;
2691 def MSUBV_W : MSUBV_W_ENC, MSUBV_W_DESC;
2692 def MSUBV_D : MSUBV_D_ENC, MSUBV_D_DESC;
2693
2694 def MUL_Q_H : MUL_Q_H_ENC, MUL_Q_H_DESC;
2695 def MUL_Q_W : MUL_Q_W_ENC, MUL_Q_W_DESC;
2696
2697 def MULR_Q_H : MULR_Q_H_ENC, MULR_Q_H_DESC;
2698 def MULR_Q_W : MULR_Q_W_ENC, MULR_Q_W_DESC;
2699
2700 def MULV_B : MULV_B_ENC, MULV_B_DESC;
2701 def MULV_H : MULV_H_ENC, MULV_H_DESC;
2702 def MULV_W : MULV_W_ENC, MULV_W_DESC;
2703 def MULV_D : MULV_D_ENC, MULV_D_DESC;
2704
2705 def NLOC_B : NLOC_B_ENC, NLOC_B_DESC;
2706 def NLOC_H : NLOC_H_ENC, NLOC_H_DESC;
2707 def NLOC_W : NLOC_W_ENC, NLOC_W_DESC;
2708 def NLOC_D : NLOC_D_ENC, NLOC_D_DESC;
2709
2710 def NLZC_B : NLZC_B_ENC, NLZC_B_DESC;
2711 def NLZC_H : NLZC_H_ENC, NLZC_H_DESC;
2712 def NLZC_W : NLZC_W_ENC, NLZC_W_DESC;
2713 def NLZC_D : NLZC_D_ENC, NLZC_D_DESC;
2714
2715 def NOR_V : NOR_V_ENC, NOR_V_DESC;
2716 def NOR_V_H_PSEUDO : NOR_V_H_PSEUDO_DESC,
2717                      PseudoInstExpansion<(NOR_V MSA128B:$wd,
2718                                                 MSA128B:$ws, MSA128B:$wt)>;
2719 def NOR_V_W_PSEUDO : NOR_V_W_PSEUDO_DESC,
2720                      PseudoInstExpansion<(NOR_V MSA128B:$wd,
2721                                                 MSA128B:$ws, MSA128B:$wt)>;
2722 def NOR_V_D_PSEUDO : NOR_V_D_PSEUDO_DESC,
2723                      PseudoInstExpansion<(NOR_V MSA128B:$wd,
2724                                                 MSA128B:$ws, MSA128B:$wt)>;
2725
2726 def NORI_B : NORI_B_ENC, NORI_B_DESC;
2727
2728 def OR_V : OR_V_ENC, OR_V_DESC;
2729 def OR_V_H_PSEUDO : OR_V_H_PSEUDO_DESC,
2730                     PseudoInstExpansion<(OR_V MSA128B:$wd,
2731                                               MSA128B:$ws, MSA128B:$wt)>;
2732 def OR_V_W_PSEUDO : OR_V_W_PSEUDO_DESC,
2733                     PseudoInstExpansion<(OR_V MSA128B:$wd,
2734                                               MSA128B:$ws, MSA128B:$wt)>;
2735 def OR_V_D_PSEUDO : OR_V_D_PSEUDO_DESC,
2736                     PseudoInstExpansion<(OR_V MSA128B:$wd,
2737                                               MSA128B:$ws, MSA128B:$wt)>;
2738
2739 def ORI_B : ORI_B_ENC, ORI_B_DESC;
2740
2741 def PCKEV_B : PCKEV_B_ENC, PCKEV_B_DESC;
2742 def PCKEV_H : PCKEV_H_ENC, PCKEV_H_DESC;
2743 def PCKEV_W : PCKEV_W_ENC, PCKEV_W_DESC;
2744 def PCKEV_D : PCKEV_D_ENC, PCKEV_D_DESC;
2745
2746 def PCKOD_B : PCKOD_B_ENC, PCKOD_B_DESC;
2747 def PCKOD_H : PCKOD_H_ENC, PCKOD_H_DESC;
2748 def PCKOD_W : PCKOD_W_ENC, PCKOD_W_DESC;
2749 def PCKOD_D : PCKOD_D_ENC, PCKOD_D_DESC;
2750
2751 def PCNT_B : PCNT_B_ENC, PCNT_B_DESC;
2752 def PCNT_H : PCNT_H_ENC, PCNT_H_DESC;
2753 def PCNT_W : PCNT_W_ENC, PCNT_W_DESC;
2754 def PCNT_D : PCNT_D_ENC, PCNT_D_DESC;
2755
2756 def SAT_S_B : SAT_S_B_ENC, SAT_S_B_DESC;
2757 def SAT_S_H : SAT_S_H_ENC, SAT_S_H_DESC;
2758 def SAT_S_W : SAT_S_W_ENC, SAT_S_W_DESC;
2759 def SAT_S_D : SAT_S_D_ENC, SAT_S_D_DESC;
2760
2761 def SAT_U_B : SAT_U_B_ENC, SAT_U_B_DESC;
2762 def SAT_U_H : SAT_U_H_ENC, SAT_U_H_DESC;
2763 def SAT_U_W : SAT_U_W_ENC, SAT_U_W_DESC;
2764 def SAT_U_D : SAT_U_D_ENC, SAT_U_D_DESC;
2765
2766 def SHF_B : SHF_B_ENC, SHF_B_DESC;
2767 def SHF_H : SHF_H_ENC, SHF_H_DESC;
2768 def SHF_W : SHF_W_ENC, SHF_W_DESC;
2769
2770 def SLD_B : SLD_B_ENC, SLD_B_DESC;
2771 def SLD_H : SLD_H_ENC, SLD_H_DESC;
2772 def SLD_W : SLD_W_ENC, SLD_W_DESC;
2773 def SLD_D : SLD_D_ENC, SLD_D_DESC;
2774
2775 def SLDI_B : SLDI_B_ENC, SLDI_B_DESC;
2776 def SLDI_H : SLDI_H_ENC, SLDI_H_DESC;
2777 def SLDI_W : SLDI_W_ENC, SLDI_W_DESC;
2778 def SLDI_D : SLDI_D_ENC, SLDI_D_DESC;
2779
2780 def SLL_B : SLL_B_ENC, SLL_B_DESC;
2781 def SLL_H : SLL_H_ENC, SLL_H_DESC;
2782 def SLL_W : SLL_W_ENC, SLL_W_DESC;
2783 def SLL_D : SLL_D_ENC, SLL_D_DESC;
2784
2785 def SLLI_B : SLLI_B_ENC, SLLI_B_DESC;
2786 def SLLI_H : SLLI_H_ENC, SLLI_H_DESC;
2787 def SLLI_W : SLLI_W_ENC, SLLI_W_DESC;
2788 def SLLI_D : SLLI_D_ENC, SLLI_D_DESC;
2789
2790 def SPLAT_B : SPLAT_B_ENC, SPLAT_B_DESC;
2791 def SPLAT_H : SPLAT_H_ENC, SPLAT_H_DESC;
2792 def SPLAT_W : SPLAT_W_ENC, SPLAT_W_DESC;
2793 def SPLAT_D : SPLAT_D_ENC, SPLAT_D_DESC;
2794
2795 def SPLATI_B : SPLATI_B_ENC, SPLATI_B_DESC;
2796 def SPLATI_H : SPLATI_H_ENC, SPLATI_H_DESC;
2797 def SPLATI_W : SPLATI_W_ENC, SPLATI_W_DESC;
2798 def SPLATI_D : SPLATI_D_ENC, SPLATI_D_DESC;
2799
2800 def SRA_B : SRA_B_ENC, SRA_B_DESC;
2801 def SRA_H : SRA_H_ENC, SRA_H_DESC;
2802 def SRA_W : SRA_W_ENC, SRA_W_DESC;
2803 def SRA_D : SRA_D_ENC, SRA_D_DESC;
2804
2805 def SRAI_B : SRAI_B_ENC, SRAI_B_DESC;
2806 def SRAI_H : SRAI_H_ENC, SRAI_H_DESC;
2807 def SRAI_W : SRAI_W_ENC, SRAI_W_DESC;
2808 def SRAI_D : SRAI_D_ENC, SRAI_D_DESC;
2809
2810 def SRAR_B : SRAR_B_ENC, SRAR_B_DESC;
2811 def SRAR_H : SRAR_H_ENC, SRAR_H_DESC;
2812 def SRAR_W : SRAR_W_ENC, SRAR_W_DESC;
2813 def SRAR_D : SRAR_D_ENC, SRAR_D_DESC;
2814
2815 def SRARI_B : SRARI_B_ENC, SRARI_B_DESC;
2816 def SRARI_H : SRARI_H_ENC, SRARI_H_DESC;
2817 def SRARI_W : SRARI_W_ENC, SRARI_W_DESC;
2818 def SRARI_D : SRARI_D_ENC, SRARI_D_DESC;
2819
2820 def SRL_B : SRL_B_ENC, SRL_B_DESC;
2821 def SRL_H : SRL_H_ENC, SRL_H_DESC;
2822 def SRL_W : SRL_W_ENC, SRL_W_DESC;
2823 def SRL_D : SRL_D_ENC, SRL_D_DESC;
2824
2825 def SRLI_B : SRLI_B_ENC, SRLI_B_DESC;
2826 def SRLI_H : SRLI_H_ENC, SRLI_H_DESC;
2827 def SRLI_W : SRLI_W_ENC, SRLI_W_DESC;
2828 def SRLI_D : SRLI_D_ENC, SRLI_D_DESC;
2829
2830 def SRLR_B : SRLR_B_ENC, SRLR_B_DESC;
2831 def SRLR_H : SRLR_H_ENC, SRLR_H_DESC;
2832 def SRLR_W : SRLR_W_ENC, SRLR_W_DESC;
2833 def SRLR_D : SRLR_D_ENC, SRLR_D_DESC;
2834
2835 def SRLRI_B : SRLRI_B_ENC, SRLRI_B_DESC;
2836 def SRLRI_H : SRLRI_H_ENC, SRLRI_H_DESC;
2837 def SRLRI_W : SRLRI_W_ENC, SRLRI_W_DESC;
2838 def SRLRI_D : SRLRI_D_ENC, SRLRI_D_DESC;
2839
2840 def ST_B: ST_B_ENC, ST_B_DESC;
2841 def ST_H: ST_H_ENC, ST_H_DESC;
2842 def ST_W: ST_W_ENC, ST_W_DESC;
2843 def ST_D: ST_D_ENC, ST_D_DESC;
2844
2845 def STX_B: STX_B_ENC, STX_B_DESC;
2846 def STX_H: STX_H_ENC, STX_H_DESC;
2847 def STX_W: STX_W_ENC, STX_W_DESC;
2848 def STX_D: STX_D_ENC, STX_D_DESC;
2849
2850 def SUBS_S_B : SUBS_S_B_ENC, SUBS_S_B_DESC;
2851 def SUBS_S_H : SUBS_S_H_ENC, SUBS_S_H_DESC;
2852 def SUBS_S_W : SUBS_S_W_ENC, SUBS_S_W_DESC;
2853 def SUBS_S_D : SUBS_S_D_ENC, SUBS_S_D_DESC;
2854
2855 def SUBS_U_B : SUBS_U_B_ENC, SUBS_U_B_DESC;
2856 def SUBS_U_H : SUBS_U_H_ENC, SUBS_U_H_DESC;
2857 def SUBS_U_W : SUBS_U_W_ENC, SUBS_U_W_DESC;
2858 def SUBS_U_D : SUBS_U_D_ENC, SUBS_U_D_DESC;
2859
2860 def SUBSUS_U_B : SUBSUS_U_B_ENC, SUBSUS_U_B_DESC;
2861 def SUBSUS_U_H : SUBSUS_U_H_ENC, SUBSUS_U_H_DESC;
2862 def SUBSUS_U_W : SUBSUS_U_W_ENC, SUBSUS_U_W_DESC;
2863 def SUBSUS_U_D : SUBSUS_U_D_ENC, SUBSUS_U_D_DESC;
2864
2865 def SUBSUU_S_B : SUBSUU_S_B_ENC, SUBSUU_S_B_DESC;
2866 def SUBSUU_S_H : SUBSUU_S_H_ENC, SUBSUU_S_H_DESC;
2867 def SUBSUU_S_W : SUBSUU_S_W_ENC, SUBSUU_S_W_DESC;
2868 def SUBSUU_S_D : SUBSUU_S_D_ENC, SUBSUU_S_D_DESC;
2869
2870 def SUBV_B : SUBV_B_ENC, SUBV_B_DESC;
2871 def SUBV_H : SUBV_H_ENC, SUBV_H_DESC;
2872 def SUBV_W : SUBV_W_ENC, SUBV_W_DESC;
2873 def SUBV_D : SUBV_D_ENC, SUBV_D_DESC;
2874
2875 def SUBVI_B : SUBVI_B_ENC, SUBVI_B_DESC;
2876 def SUBVI_H : SUBVI_H_ENC, SUBVI_H_DESC;
2877 def SUBVI_W : SUBVI_W_ENC, SUBVI_W_DESC;
2878 def SUBVI_D : SUBVI_D_ENC, SUBVI_D_DESC;
2879
2880 def VSHF_B : VSHF_B_ENC, VSHF_B_DESC;
2881 def VSHF_H : VSHF_H_ENC, VSHF_H_DESC;
2882 def VSHF_W : VSHF_W_ENC, VSHF_W_DESC;
2883 def VSHF_D : VSHF_D_ENC, VSHF_D_DESC;
2884
2885 def XOR_V : XOR_V_ENC, XOR_V_DESC;
2886 def XOR_V_H_PSEUDO : XOR_V_H_PSEUDO_DESC,
2887                      PseudoInstExpansion<(XOR_V MSA128B:$wd,
2888                                                 MSA128B:$ws, MSA128B:$wt)>;
2889 def XOR_V_W_PSEUDO : XOR_V_W_PSEUDO_DESC,
2890                      PseudoInstExpansion<(XOR_V MSA128B:$wd,
2891                                                 MSA128B:$ws, MSA128B:$wt)>;
2892 def XOR_V_D_PSEUDO : XOR_V_D_PSEUDO_DESC,
2893                      PseudoInstExpansion<(XOR_V MSA128B:$wd,
2894                                                 MSA128B:$ws, MSA128B:$wt)>;
2895
2896 def XORI_B : XORI_B_ENC, XORI_B_DESC;
2897
2898 // Patterns.
2899 class MSAPat<dag pattern, dag result, list<Predicate> pred = [HasMSA]> :
2900   Pat<pattern, result>, Requires<pred>;
2901
2902 def : MSAPat<(extractelt (v4i32 MSA128W:$ws), immZExt4:$idx),
2903              (COPY_S_W MSA128W:$ws, immZExt4:$idx)>;
2904
2905 def : MSAPat<(v16i8 (load addr:$addr)), (LD_B addr:$addr)>;
2906 def : MSAPat<(v8i16 (load addr:$addr)), (LD_H addr:$addr)>;
2907 def : MSAPat<(v4i32 (load addr:$addr)), (LD_W addr:$addr)>;
2908 def : MSAPat<(v2i64 (load addr:$addr)), (LD_D addr:$addr)>;
2909 def : MSAPat<(v8f16 (load addr:$addr)), (LD_H addr:$addr)>;
2910 def : MSAPat<(v4f32 (load addr:$addr)), (LD_W addr:$addr)>;
2911 def : MSAPat<(v2f64 (load addr:$addr)), (LD_D addr:$addr)>;
2912
2913 def : MSAPat<(v8f16 (load addrRegImm:$addr)), (LD_H addrRegImm:$addr)>;
2914 def : MSAPat<(v4f32 (load addrRegImm:$addr)), (LD_W addrRegImm:$addr)>;
2915 def : MSAPat<(v2f64 (load addrRegImm:$addr)), (LD_D addrRegImm:$addr)>;
2916
2917 def : MSAPat<(store (v16i8 MSA128B:$ws), addr:$addr),
2918              (ST_B MSA128B:$ws, addr:$addr)>;
2919 def : MSAPat<(store (v8i16 MSA128H:$ws), addr:$addr),
2920              (ST_H MSA128H:$ws, addr:$addr)>;
2921 def : MSAPat<(store (v4i32 MSA128W:$ws), addr:$addr),
2922              (ST_W MSA128W:$ws, addr:$addr)>;
2923 def : MSAPat<(store (v2i64 MSA128D:$ws), addr:$addr),
2924              (ST_D MSA128D:$ws, addr:$addr)>;
2925 def : MSAPat<(store (v8f16 MSA128H:$ws), addr:$addr),
2926              (ST_H MSA128H:$ws, addr:$addr)>;
2927 def : MSAPat<(store (v4f32 MSA128W:$ws), addr:$addr),
2928              (ST_W MSA128W:$ws, addr:$addr)>;
2929 def : MSAPat<(store (v2f64 MSA128D:$ws), addr:$addr),
2930              (ST_D MSA128D:$ws, addr:$addr)>;
2931
2932 def ST_FH : MSAPat<(store (v8f16 MSA128H:$ws), addrRegImm:$addr),
2933                    (ST_H MSA128H:$ws, addrRegImm:$addr)>;
2934 def ST_FW : MSAPat<(store (v4f32 MSA128W:$ws), addrRegImm:$addr),
2935                    (ST_W MSA128W:$ws, addrRegImm:$addr)>;
2936 def ST_FD : MSAPat<(store (v2f64 MSA128D:$ws), addrRegImm:$addr),
2937                    (ST_D MSA128D:$ws, addrRegImm:$addr)>;
2938
2939 class MSABitconvertPat<ValueType DstVT, ValueType SrcVT,
2940                        RegisterClass DstRC, list<Predicate> preds = [HasMSA]> :
2941    MSAPat<(DstVT (bitconvert SrcVT:$src)),
2942           (COPY_TO_REGCLASS SrcVT:$src, DstRC), preds>;
2943
2944 // These are endian-independant because the element size doesnt change
2945 def : MSABitconvertPat<v8i16, v8f16, MSA128H>;
2946 def : MSABitconvertPat<v4i32, v4f32, MSA128W>;
2947 def : MSABitconvertPat<v2i64, v2f64, MSA128D>;
2948 def : MSABitconvertPat<v8f16, v8i16, MSA128H>;
2949 def : MSABitconvertPat<v4f32, v4i32, MSA128W>;
2950 def : MSABitconvertPat<v2f64, v2i64, MSA128D>;
2951
2952 // Little endian bitcasts are always no-ops
2953 def : MSABitconvertPat<v16i8, v8i16, MSA128B, [HasMSA, IsLE]>;
2954 def : MSABitconvertPat<v16i8, v4i32, MSA128B, [HasMSA, IsLE]>;
2955 def : MSABitconvertPat<v16i8, v2i64, MSA128B, [HasMSA, IsLE]>;
2956 def : MSABitconvertPat<v16i8, v8f16, MSA128B, [HasMSA, IsLE]>;
2957 def : MSABitconvertPat<v16i8, v4f32, MSA128B, [HasMSA, IsLE]>;
2958 def : MSABitconvertPat<v16i8, v2f64, MSA128B, [HasMSA, IsLE]>;
2959
2960 def : MSABitconvertPat<v8i16, v16i8, MSA128H, [HasMSA, IsLE]>;
2961 def : MSABitconvertPat<v8i16, v4i32, MSA128H, [HasMSA, IsLE]>;
2962 def : MSABitconvertPat<v8i16, v2i64, MSA128H, [HasMSA, IsLE]>;
2963 def : MSABitconvertPat<v8i16, v4f32, MSA128H, [HasMSA, IsLE]>;
2964 def : MSABitconvertPat<v8i16, v2f64, MSA128H, [HasMSA, IsLE]>;
2965
2966 def : MSABitconvertPat<v4i32, v16i8, MSA128W, [HasMSA, IsLE]>;
2967 def : MSABitconvertPat<v4i32, v8i16, MSA128W, [HasMSA, IsLE]>;
2968 def : MSABitconvertPat<v4i32, v2i64, MSA128W, [HasMSA, IsLE]>;
2969 def : MSABitconvertPat<v4i32, v8f16, MSA128W, [HasMSA, IsLE]>;
2970 def : MSABitconvertPat<v4i32, v2f64, MSA128W, [HasMSA, IsLE]>;
2971
2972 def : MSABitconvertPat<v2i64, v16i8, MSA128D, [HasMSA, IsLE]>;
2973 def : MSABitconvertPat<v2i64, v8i16, MSA128D, [HasMSA, IsLE]>;
2974 def : MSABitconvertPat<v2i64, v4i32, MSA128D, [HasMSA, IsLE]>;
2975 def : MSABitconvertPat<v2i64, v8f16, MSA128D, [HasMSA, IsLE]>;
2976 def : MSABitconvertPat<v2i64, v4f32, MSA128D, [HasMSA, IsLE]>;
2977
2978 def : MSABitconvertPat<v4f32, v16i8, MSA128W, [HasMSA, IsLE]>;
2979 def : MSABitconvertPat<v4f32, v8i16, MSA128W, [HasMSA, IsLE]>;
2980 def : MSABitconvertPat<v4f32, v2i64, MSA128W, [HasMSA, IsLE]>;
2981 def : MSABitconvertPat<v4f32, v8f16, MSA128W, [HasMSA, IsLE]>;
2982 def : MSABitconvertPat<v4f32, v2f64, MSA128W, [HasMSA, IsLE]>;
2983
2984 def : MSABitconvertPat<v2f64, v16i8, MSA128D, [HasMSA, IsLE]>;
2985 def : MSABitconvertPat<v2f64, v8i16, MSA128D, [HasMSA, IsLE]>;
2986 def : MSABitconvertPat<v2f64, v4i32, MSA128D, [HasMSA, IsLE]>;
2987 def : MSABitconvertPat<v2f64, v8f16, MSA128D, [HasMSA, IsLE]>;
2988 def : MSABitconvertPat<v2f64, v4f32, MSA128D, [HasMSA, IsLE]>;
2989
2990 // Big endian bitcasts expand to shuffle instructions.
2991 // This is because bitcast is defined to be a store/load sequence and the
2992 // vector store/load instructions are mixed-endian with respect to the vector
2993 // as a whole (little endian with respect to element order, but big endian
2994 // elements).
2995
2996 class MSABitconvertReverseQuartersPat<ValueType DstVT, ValueType SrcVT,
2997                                       RegisterClass DstRC, MSAInst Insn,
2998                                       RegisterClass ViaRC> :
2999   MSAPat<(DstVT (bitconvert SrcVT:$src)),
3000          (COPY_TO_REGCLASS (Insn (COPY_TO_REGCLASS SrcVT:$src, ViaRC), 27),
3001                            DstRC),
3002          [HasMSA, IsBE]>;
3003
3004 class MSABitconvertReverseHalvesPat<ValueType DstVT, ValueType SrcVT,
3005                                     RegisterClass DstRC, MSAInst Insn,
3006                                     RegisterClass ViaRC> :
3007   MSAPat<(DstVT (bitconvert SrcVT:$src)),
3008          (COPY_TO_REGCLASS (Insn (COPY_TO_REGCLASS SrcVT:$src, ViaRC), 177),
3009                            DstRC),
3010          [HasMSA, IsBE]>;
3011
3012 class MSABitconvertReverseBInHPat<ValueType DstVT, ValueType SrcVT,
3013                                   RegisterClass DstRC> :
3014   MSABitconvertReverseHalvesPat<DstVT, SrcVT, DstRC, SHF_B, MSA128B>;
3015
3016 class MSABitconvertReverseBInWPat<ValueType DstVT, ValueType SrcVT,
3017                                   RegisterClass DstRC> :
3018   MSABitconvertReverseQuartersPat<DstVT, SrcVT, DstRC, SHF_B, MSA128B>;
3019
3020 class MSABitconvertReverseBInDPat<ValueType DstVT, ValueType SrcVT,
3021                                   RegisterClass DstRC> :
3022   MSAPat<(DstVT (bitconvert SrcVT:$src)),
3023          (COPY_TO_REGCLASS
3024            (SHF_W
3025              (COPY_TO_REGCLASS
3026                (SHF_B (COPY_TO_REGCLASS SrcVT:$src, MSA128B), 27),
3027                MSA128W), 177),
3028            DstRC),
3029          [HasMSA, IsBE]>;
3030
3031 class MSABitconvertReverseHInWPat<ValueType DstVT, ValueType SrcVT,
3032                                   RegisterClass DstRC> :
3033   MSABitconvertReverseHalvesPat<DstVT, SrcVT, DstRC, SHF_H, MSA128H>;
3034
3035 class MSABitconvertReverseHInDPat<ValueType DstVT, ValueType SrcVT,
3036                                   RegisterClass DstRC> :
3037   MSABitconvertReverseQuartersPat<DstVT, SrcVT, DstRC, SHF_H, MSA128H>;
3038
3039 class MSABitconvertReverseWInDPat<ValueType DstVT, ValueType SrcVT,
3040                                   RegisterClass DstRC> :
3041   MSABitconvertReverseHalvesPat<DstVT, SrcVT, DstRC, SHF_W, MSA128W>;
3042
3043 def : MSABitconvertReverseBInHPat<v8i16, v16i8, MSA128H>;
3044 def : MSABitconvertReverseBInHPat<v8f16, v16i8, MSA128H>;
3045 def : MSABitconvertReverseBInWPat<v4i32, v16i8, MSA128W>;
3046 def : MSABitconvertReverseBInWPat<v4f32, v16i8, MSA128W>;
3047 def : MSABitconvertReverseBInDPat<v2i64, v16i8, MSA128D>;
3048 def : MSABitconvertReverseBInDPat<v2f64, v16i8, MSA128D>;
3049
3050 def : MSABitconvertReverseBInHPat<v16i8, v8i16, MSA128B>;
3051 def : MSABitconvertReverseHInWPat<v4i32, v8i16, MSA128W>;
3052 def : MSABitconvertReverseHInWPat<v4f32, v8i16, MSA128W>;
3053 def : MSABitconvertReverseHInDPat<v2i64, v8i16, MSA128D>;
3054 def : MSABitconvertReverseHInDPat<v2f64, v8i16, MSA128D>;
3055
3056 def : MSABitconvertReverseBInHPat<v16i8, v8f16, MSA128B>;
3057 def : MSABitconvertReverseHInWPat<v4i32, v8f16, MSA128W>;
3058 def : MSABitconvertReverseHInWPat<v4f32, v8f16, MSA128W>;
3059 def : MSABitconvertReverseHInDPat<v2i64, v8f16, MSA128D>;
3060 def : MSABitconvertReverseHInDPat<v2f64, v8f16, MSA128D>;
3061
3062 def : MSABitconvertReverseBInWPat<v16i8, v4i32, MSA128B>;
3063 def : MSABitconvertReverseHInWPat<v8i16, v4i32, MSA128H>;
3064 def : MSABitconvertReverseHInWPat<v8f16, v4i32, MSA128H>;
3065 def : MSABitconvertReverseWInDPat<v2i64, v4i32, MSA128D>;
3066 def : MSABitconvertReverseWInDPat<v2f64, v4i32, MSA128D>;
3067
3068 def : MSABitconvertReverseBInWPat<v16i8, v4f32, MSA128B>;
3069 def : MSABitconvertReverseHInWPat<v8i16, v4f32, MSA128H>;
3070 def : MSABitconvertReverseHInWPat<v8f16, v4f32, MSA128H>;
3071 def : MSABitconvertReverseWInDPat<v2i64, v4f32, MSA128D>;
3072 def : MSABitconvertReverseWInDPat<v2f64, v4f32, MSA128D>;
3073
3074 def : MSABitconvertReverseBInDPat<v16i8, v2i64, MSA128B>;
3075 def : MSABitconvertReverseHInDPat<v8i16, v2i64, MSA128H>;
3076 def : MSABitconvertReverseHInDPat<v8f16, v2i64, MSA128H>;
3077 def : MSABitconvertReverseWInDPat<v4i32, v2i64, MSA128W>;
3078 def : MSABitconvertReverseWInDPat<v4f32, v2i64, MSA128W>;
3079
3080 def : MSABitconvertReverseBInDPat<v16i8, v2f64, MSA128B>;
3081 def : MSABitconvertReverseHInDPat<v8i16, v2f64, MSA128H>;
3082 def : MSABitconvertReverseHInDPat<v8f16, v2f64, MSA128H>;
3083 def : MSABitconvertReverseWInDPat<v4i32, v2f64, MSA128W>;
3084 def : MSABitconvertReverseWInDPat<v4f32, v2f64, MSA128W>;
3085
3086 // Pseudos used to implement BNZ.df, and BZ.df
3087
3088 class MSA_CBRANCH_PSEUDO_DESC_BASE<SDPatternOperator OpNode, ValueType TyNode,
3089                                    RegisterClass RCWS,
3090                                    InstrItinClass itin = NoItinerary> :
3091   MipsPseudo<(outs GPR32:$dst),
3092              (ins RCWS:$ws),
3093              [(set GPR32:$dst, (OpNode (TyNode RCWS:$ws)))]> {
3094   bit usesCustomInserter = 1;
3095 }
3096
3097 def SNZ_B_PSEUDO : MSA_CBRANCH_PSEUDO_DESC_BASE<MipsVAllNonZero, v16i8,
3098                                                 MSA128B, NoItinerary>;
3099 def SNZ_H_PSEUDO : MSA_CBRANCH_PSEUDO_DESC_BASE<MipsVAllNonZero, v8i16,
3100                                                 MSA128H, NoItinerary>;
3101 def SNZ_W_PSEUDO : MSA_CBRANCH_PSEUDO_DESC_BASE<MipsVAllNonZero, v4i32,
3102                                                 MSA128W, NoItinerary>;
3103 def SNZ_D_PSEUDO : MSA_CBRANCH_PSEUDO_DESC_BASE<MipsVAllNonZero, v2i64,
3104                                                 MSA128D, NoItinerary>;
3105 def SNZ_V_PSEUDO : MSA_CBRANCH_PSEUDO_DESC_BASE<MipsVAnyNonZero, v16i8,
3106                                                 MSA128B, NoItinerary>;
3107
3108 def SZ_B_PSEUDO : MSA_CBRANCH_PSEUDO_DESC_BASE<MipsVAllZero, v16i8,
3109                                                MSA128B, NoItinerary>;
3110 def SZ_H_PSEUDO : MSA_CBRANCH_PSEUDO_DESC_BASE<MipsVAllZero, v8i16,
3111                                                MSA128H, NoItinerary>;
3112 def SZ_W_PSEUDO : MSA_CBRANCH_PSEUDO_DESC_BASE<MipsVAllZero, v4i32,
3113                                                MSA128W, NoItinerary>;
3114 def SZ_D_PSEUDO : MSA_CBRANCH_PSEUDO_DESC_BASE<MipsVAllZero, v2i64,
3115                                                MSA128D, NoItinerary>;
3116 def SZ_V_PSEUDO : MSA_CBRANCH_PSEUDO_DESC_BASE<MipsVAnyZero, v16i8,
3117                                                MSA128B, NoItinerary>;