1 //===- LoongArchLSXInstrInfo.td - LoongArch LSX instructions -*- tablegen -*-=//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file describes the SIMD extension instructions.
11 //===----------------------------------------------------------------------===//
13 def SDT_LoongArchVreplve : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisVec<0>,
14 SDTCisInt<1>, SDTCisVec<1>,
15 SDTCisSameAs<0, 1>, SDTCisInt<2>]>;
16 def SDT_LoongArchVecCond : SDTypeProfile<1, 1, [SDTCisInt<0>, SDTCisVec<1>]>;
19 def loongarch_vreplve : SDNode<"LoongArchISD::VREPLVE", SDT_LoongArchVreplve>;
20 def loongarch_vall_nonzero : SDNode<"LoongArchISD::VALL_NONZERO",
21 SDT_LoongArchVecCond>;
22 def loongarch_vany_nonzero : SDNode<"LoongArchISD::VANY_NONZERO",
23 SDT_LoongArchVecCond>;
24 def loongarch_vall_zero : SDNode<"LoongArchISD::VALL_ZERO",
25 SDT_LoongArchVecCond>;
26 def loongarch_vany_zero : SDNode<"LoongArchISD::VANY_ZERO",
27 SDT_LoongArchVecCond>;
29 def loongarch_vpick_sext_elt : SDNode<"LoongArchISD::VPICK_SEXT_ELT",
30 SDTypeProfile<1, 3, [SDTCisPtrTy<2>]>>;
31 def loongarch_vpick_zext_elt : SDNode<"LoongArchISD::VPICK_ZEXT_ELT",
32 SDTypeProfile<1, 3, [SDTCisPtrTy<2>]>>;
34 class VecCond<SDPatternOperator OpNode, ValueType TyNode,
35 RegisterClass RC = LSX128>
36 : Pseudo<(outs GPR:$rd), (ins RC:$vj),
37 [(set GPR:$rd, (OpNode (TyNode RC:$vj)))]> {
38 let hasSideEffects = 0;
41 let usesCustomInserter = 1;
44 def vsplat_imm_eq_1 : PatFrags<(ops), [(build_vector),
45 (bitconvert (v4i32 (build_vector)))], [{
47 EVT EltTy = N->getValueType(0).getVectorElementType();
49 if (N->getOpcode() == ISD::BITCAST)
50 N = N->getOperand(0).getNode();
52 return selectVSplat(N, Imm, EltTy.getSizeInBits()) &&
53 Imm.getBitWidth() == EltTy.getSizeInBits() && Imm == 1;
56 def vsplati8_imm_eq_7 : PatFrags<(ops), [(build_vector)], [{
58 EVT EltTy = N->getValueType(0).getVectorElementType();
60 if (N->getOpcode() == ISD::BITCAST)
61 N = N->getOperand(0).getNode();
63 return selectVSplat(N, Imm, EltTy.getSizeInBits()) &&
64 Imm.getBitWidth() == EltTy.getSizeInBits() && Imm == 7;
66 def vsplati16_imm_eq_15 : PatFrags<(ops), [(build_vector)], [{
68 EVT EltTy = N->getValueType(0).getVectorElementType();
70 if (N->getOpcode() == ISD::BITCAST)
71 N = N->getOperand(0).getNode();
73 return selectVSplat(N, Imm, EltTy.getSizeInBits()) &&
74 Imm.getBitWidth() == EltTy.getSizeInBits() && Imm == 15;
76 def vsplati32_imm_eq_31 : PatFrags<(ops), [(build_vector)], [{
78 EVT EltTy = N->getValueType(0).getVectorElementType();
80 if (N->getOpcode() == ISD::BITCAST)
81 N = N->getOperand(0).getNode();
83 return selectVSplat(N, Imm, EltTy.getSizeInBits()) &&
84 Imm.getBitWidth() == EltTy.getSizeInBits() && Imm == 31;
86 def vsplati64_imm_eq_63 : PatFrags<(ops), [(build_vector),
87 (bitconvert (v4i32 (build_vector)))], [{
89 EVT EltTy = N->getValueType(0).getVectorElementType();
91 if (N->getOpcode() == ISD::BITCAST)
92 N = N->getOperand(0).getNode();
94 return selectVSplat(N, Imm, EltTy.getSizeInBits()) &&
95 Imm.getBitWidth() == EltTy.getSizeInBits() && Imm == 63;
98 def vsplati8imm7 : PatFrag<(ops node:$reg),
99 (and node:$reg, vsplati8_imm_eq_7)>;
100 def vsplati16imm15 : PatFrag<(ops node:$reg),
101 (and node:$reg, vsplati16_imm_eq_15)>;
102 def vsplati32imm31 : PatFrag<(ops node:$reg),
103 (and node:$reg, vsplati32_imm_eq_31)>;
104 def vsplati64imm63 : PatFrag<(ops node:$reg),
105 (and node:$reg, vsplati64_imm_eq_63)>;
107 foreach N = [3, 4, 5, 6, 8] in
108 def SplatPat_uimm#N : ComplexPattern<vAny, 1, "selectVSplatImm<"#N#">",
109 [build_vector, bitconvert], [], 2>;
112 def SplatPat_simm#N : ComplexPattern<vAny, 1, "selectVSplatImm<"#N#", true>",
113 [build_vector, bitconvert]>;
115 def vsplat_uimm_inv_pow2 : ComplexPattern<vAny, 1, "selectVSplatUimmInvPow2",
116 [build_vector, bitconvert]>;
118 def vsplat_uimm_pow2 : ComplexPattern<vAny, 1, "selectVSplatUimmPow2",
119 [build_vector, bitconvert]>;
121 def muladd : PatFrag<(ops node:$vd, node:$vj, node:$vk),
122 (add node:$vd, (mul node:$vj, node:$vk))>;
124 def mulsub : PatFrag<(ops node:$vd, node:$vj, node:$vk),
125 (sub node:$vd, (mul node:$vj, node:$vk))>;
127 def lsxsplati8 : PatFrag<(ops node:$e0),
128 (v16i8 (build_vector node:$e0, node:$e0,
135 node:$e0, node:$e0))>;
136 def lsxsplati16 : PatFrag<(ops node:$e0),
137 (v8i16 (build_vector node:$e0, node:$e0,
140 node:$e0, node:$e0))>;
141 def lsxsplati32 : PatFrag<(ops node:$e0),
142 (v4i32 (build_vector node:$e0, node:$e0,
143 node:$e0, node:$e0))>;
145 def lsxsplati64 : PatFrag<(ops node:$e0),
146 (v2i64 (build_vector node:$e0, node:$e0))>;
148 def to_valid_timm : SDNodeXForm<timm, [{
149 auto CN = cast<ConstantSDNode>(N);
150 return CurDAG->getTargetConstant(CN->getSExtValue(), SDLoc(N), Subtarget->getGRLenVT());
153 //===----------------------------------------------------------------------===//
154 // Instruction class templates
155 //===----------------------------------------------------------------------===//
157 class LSX1RI13_VI<bits<32> op, Operand ImmOpnd = simm13>
158 : Fmt1RI13_VI<op, (outs LSX128:$vd), (ins ImmOpnd:$imm13), "$vd, $imm13">;
160 class LSX2R_VV<bits<32> op>
161 : Fmt2R_VV<op, (outs LSX128:$vd), (ins LSX128:$vj), "$vd, $vj">;
163 class LSX2R_VR<bits<32> op>
164 : Fmt2R_VR<op, (outs LSX128:$vd), (ins GPR:$rj), "$vd, $rj">;
166 class LSX2R_CV<bits<32> op>
167 : Fmt2R_CV<op, (outs CFR:$cd), (ins LSX128:$vj), "$cd, $vj">;
169 class LSX2RI1_VVI<bits<32> op, Operand ImmOpnd = uimm1>
170 : Fmt2RI1_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm1),
173 class LSX2RI1_RVI<bits<32> op, Operand ImmOpnd = uimm1>
174 : Fmt2RI1_RVI<op, (outs GPR:$rd), (ins LSX128:$vj, ImmOpnd:$imm1),
177 class LSX2RI2_VVI<bits<32> op, Operand ImmOpnd = uimm2>
178 : Fmt2RI2_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm2),
181 class LSX2RI2_RVI<bits<32> op, Operand ImmOpnd = uimm2>
182 : Fmt2RI2_RVI<op, (outs GPR:$rd), (ins LSX128:$vj, ImmOpnd:$imm2),
185 class LSX2RI3_VVI<bits<32> op, Operand ImmOpnd = uimm3>
186 : Fmt2RI3_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm3),
189 class LSX2RI3_RVI<bits<32> op, Operand ImmOpnd = uimm3>
190 : Fmt2RI3_RVI<op, (outs GPR:$rd), (ins LSX128:$vj, ImmOpnd:$imm3),
193 class LSX2RI4_VVI<bits<32> op, Operand ImmOpnd = uimm4>
194 : Fmt2RI4_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm4),
197 class LSX2RI4_RVI<bits<32> op, Operand ImmOpnd = uimm4>
198 : Fmt2RI4_RVI<op, (outs GPR:$rd), (ins LSX128:$vj, ImmOpnd:$imm4),
201 class LSX2RI5_VVI<bits<32> op, Operand ImmOpnd = uimm5>
202 : Fmt2RI5_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm5),
205 class LSX2RI6_VVI<bits<32> op, Operand ImmOpnd = uimm6>
206 : Fmt2RI6_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm6),
209 class LSX2RI8_VVI<bits<32> op, Operand ImmOpnd = uimm8>
210 : Fmt2RI8_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm8),
213 class LSX2RI8I1_VRII<bits<32> op, Operand ImmOpnd = simm8,
214 Operand IdxOpnd = uimm1>
215 : Fmt2RI8I1_VRII<op, (outs),
216 (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm8, IdxOpnd:$imm1),
217 "$vd, $rj, $imm8, $imm1">;
218 class LSX2RI8I2_VRII<bits<32> op, Operand ImmOpnd = simm8,
219 Operand IdxOpnd = uimm2>
220 : Fmt2RI8I2_VRII<op, (outs),
221 (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm8, IdxOpnd:$imm2),
222 "$vd, $rj, $imm8, $imm2">;
223 class LSX2RI8I3_VRII<bits<32> op, Operand ImmOpnd = simm8,
224 Operand IdxOpnd = uimm3>
225 : Fmt2RI8I3_VRII<op, (outs),
226 (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm8, IdxOpnd:$imm3),
227 "$vd, $rj, $imm8, $imm3">;
228 class LSX2RI8I4_VRII<bits<32> op, Operand ImmOpnd = simm8,
229 Operand IdxOpnd = uimm4>
230 : Fmt2RI8I4_VRII<op, (outs),
231 (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm8, IdxOpnd:$imm4),
232 "$vd, $rj, $imm8, $imm4">;
234 class LSX3R_VVV<bits<32> op>
235 : Fmt3R_VVV<op, (outs LSX128:$vd), (ins LSX128:$vj, LSX128:$vk),
238 class LSX3R_VVR<bits<32> op>
239 : Fmt3R_VVR<op, (outs LSX128:$vd), (ins LSX128:$vj, GPR:$rk),
242 class LSX4R_VVVV<bits<32> op>
243 : Fmt4R_VVVV<op, (outs LSX128:$vd),
244 (ins LSX128:$vj, LSX128:$vk, LSX128:$va),
245 "$vd, $vj, $vk, $va">;
247 let Constraints = "$vd = $dst" in {
249 class LSX2RI1_VVRI<bits<32> op, Operand ImmOpnd = uimm1>
250 : Fmt2RI1_VRI<op, (outs LSX128:$dst), (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm1),
252 class LSX2RI2_VVRI<bits<32> op, Operand ImmOpnd = uimm2>
253 : Fmt2RI2_VRI<op, (outs LSX128:$dst), (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm2),
255 class LSX2RI3_VVRI<bits<32> op, Operand ImmOpnd = uimm3>
256 : Fmt2RI3_VRI<op, (outs LSX128:$dst), (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm3),
258 class LSX2RI4_VVRI<bits<32> op, Operand ImmOpnd = uimm4>
259 : Fmt2RI4_VRI<op, (outs LSX128:$dst), (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm4),
262 class LSX2RI4_VVVI<bits<32> op, Operand ImmOpnd = uimm4>
263 : Fmt2RI4_VVI<op, (outs LSX128:$dst), (ins LSX128:$vd, LSX128:$vj, ImmOpnd:$imm4),
265 class LSX2RI5_VVVI<bits<32> op, Operand ImmOpnd = uimm5>
266 : Fmt2RI5_VVI<op, (outs LSX128:$dst), (ins LSX128:$vd, LSX128:$vj, ImmOpnd:$imm5),
268 class LSX2RI6_VVVI<bits<32> op, Operand ImmOpnd = uimm6>
269 : Fmt2RI6_VVI<op, (outs LSX128:$dst), (ins LSX128:$vd, LSX128:$vj, ImmOpnd:$imm6),
271 class LSX2RI7_VVVI<bits<32> op, Operand ImmOpnd = uimm7>
272 : Fmt2RI7_VVI<op, (outs LSX128:$dst), (ins LSX128:$vd, LSX128:$vj, ImmOpnd:$imm7),
275 class LSX2RI8_VVVI<bits<32> op, Operand ImmOpnd = uimm8>
276 : Fmt2RI8_VVI<op, (outs LSX128:$dst), (ins LSX128:$vd, LSX128:$vj, ImmOpnd:$imm8),
279 class LSX3R_VVVV<bits<32> op>
280 : Fmt3R_VVV<op, (outs LSX128:$dst), (ins LSX128:$vd, LSX128:$vj, LSX128:$vk),
283 } // Constraints = "$vd = $dst"
285 class LSX2RI9_Load<bits<32> op, Operand ImmOpnd = simm9_lsl3>
286 : Fmt2RI9_VRI<op, (outs LSX128:$vd), (ins GPR:$rj, ImmOpnd:$imm9),
288 class LSX2RI10_Load<bits<32> op, Operand ImmOpnd = simm10_lsl2>
289 : Fmt2RI10_VRI<op, (outs LSX128:$vd), (ins GPR:$rj, ImmOpnd:$imm10),
291 class LSX2RI11_Load<bits<32> op, Operand ImmOpnd = simm11_lsl1>
292 : Fmt2RI11_VRI<op, (outs LSX128:$vd), (ins GPR:$rj, ImmOpnd:$imm11),
294 class LSX2RI12_Load<bits<32> op, Operand ImmOpnd = simm12>
295 : Fmt2RI12_VRI<op, (outs LSX128:$vd), (ins GPR:$rj, ImmOpnd:$imm12),
297 class LSX2RI12_Store<bits<32> op, Operand ImmOpnd = simm12>
298 : Fmt2RI12_VRI<op, (outs), (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm12),
301 class LSX3R_Load<bits<32> op>
302 : Fmt3R_VRR<op, (outs LSX128:$vd), (ins GPR:$rj, GPR:$rk),
304 class LSX3R_Store<bits<32> op>
305 : Fmt3R_VRR<op, (outs), (ins LSX128:$vd, GPR:$rj, GPR:$rk),
308 //===----------------------------------------------------------------------===//
310 //===----------------------------------------------------------------------===//
312 let hasSideEffects = 0, Predicates = [HasExtLSX] in {
314 let mayLoad = 0, mayStore = 0 in {
316 def VADD_B : LSX3R_VVV<0x700a0000>;
317 def VADD_H : LSX3R_VVV<0x700a8000>;
318 def VADD_W : LSX3R_VVV<0x700b0000>;
319 def VADD_D : LSX3R_VVV<0x700b8000>;
320 def VADD_Q : LSX3R_VVV<0x712d0000>;
322 def VSUB_B : LSX3R_VVV<0x700c0000>;
323 def VSUB_H : LSX3R_VVV<0x700c8000>;
324 def VSUB_W : LSX3R_VVV<0x700d0000>;
325 def VSUB_D : LSX3R_VVV<0x700d8000>;
326 def VSUB_Q : LSX3R_VVV<0x712d8000>;
328 def VADDI_BU : LSX2RI5_VVI<0x728a0000>;
329 def VADDI_HU : LSX2RI5_VVI<0x728a8000>;
330 def VADDI_WU : LSX2RI5_VVI<0x728b0000>;
331 def VADDI_DU : LSX2RI5_VVI<0x728b8000>;
333 def VSUBI_BU : LSX2RI5_VVI<0x728c0000>;
334 def VSUBI_HU : LSX2RI5_VVI<0x728c8000>;
335 def VSUBI_WU : LSX2RI5_VVI<0x728d0000>;
336 def VSUBI_DU : LSX2RI5_VVI<0x728d8000>;
338 def VNEG_B : LSX2R_VV<0x729c3000>;
339 def VNEG_H : LSX2R_VV<0x729c3400>;
340 def VNEG_W : LSX2R_VV<0x729c3800>;
341 def VNEG_D : LSX2R_VV<0x729c3c00>;
343 def VSADD_B : LSX3R_VVV<0x70460000>;
344 def VSADD_H : LSX3R_VVV<0x70468000>;
345 def VSADD_W : LSX3R_VVV<0x70470000>;
346 def VSADD_D : LSX3R_VVV<0x70478000>;
347 def VSADD_BU : LSX3R_VVV<0x704a0000>;
348 def VSADD_HU : LSX3R_VVV<0x704a8000>;
349 def VSADD_WU : LSX3R_VVV<0x704b0000>;
350 def VSADD_DU : LSX3R_VVV<0x704b8000>;
352 def VSSUB_B : LSX3R_VVV<0x70480000>;
353 def VSSUB_H : LSX3R_VVV<0x70488000>;
354 def VSSUB_W : LSX3R_VVV<0x70490000>;
355 def VSSUB_D : LSX3R_VVV<0x70498000>;
356 def VSSUB_BU : LSX3R_VVV<0x704c0000>;
357 def VSSUB_HU : LSX3R_VVV<0x704c8000>;
358 def VSSUB_WU : LSX3R_VVV<0x704d0000>;
359 def VSSUB_DU : LSX3R_VVV<0x704d8000>;
361 def VHADDW_H_B : LSX3R_VVV<0x70540000>;
362 def VHADDW_W_H : LSX3R_VVV<0x70548000>;
363 def VHADDW_D_W : LSX3R_VVV<0x70550000>;
364 def VHADDW_Q_D : LSX3R_VVV<0x70558000>;
365 def VHADDW_HU_BU : LSX3R_VVV<0x70580000>;
366 def VHADDW_WU_HU : LSX3R_VVV<0x70588000>;
367 def VHADDW_DU_WU : LSX3R_VVV<0x70590000>;
368 def VHADDW_QU_DU : LSX3R_VVV<0x70598000>;
370 def VHSUBW_H_B : LSX3R_VVV<0x70560000>;
371 def VHSUBW_W_H : LSX3R_VVV<0x70568000>;
372 def VHSUBW_D_W : LSX3R_VVV<0x70570000>;
373 def VHSUBW_Q_D : LSX3R_VVV<0x70578000>;
374 def VHSUBW_HU_BU : LSX3R_VVV<0x705a0000>;
375 def VHSUBW_WU_HU : LSX3R_VVV<0x705a8000>;
376 def VHSUBW_DU_WU : LSX3R_VVV<0x705b0000>;
377 def VHSUBW_QU_DU : LSX3R_VVV<0x705b8000>;
379 def VADDWEV_H_B : LSX3R_VVV<0x701e0000>;
380 def VADDWEV_W_H : LSX3R_VVV<0x701e8000>;
381 def VADDWEV_D_W : LSX3R_VVV<0x701f0000>;
382 def VADDWEV_Q_D : LSX3R_VVV<0x701f8000>;
383 def VADDWOD_H_B : LSX3R_VVV<0x70220000>;
384 def VADDWOD_W_H : LSX3R_VVV<0x70228000>;
385 def VADDWOD_D_W : LSX3R_VVV<0x70230000>;
386 def VADDWOD_Q_D : LSX3R_VVV<0x70238000>;
388 def VSUBWEV_H_B : LSX3R_VVV<0x70200000>;
389 def VSUBWEV_W_H : LSX3R_VVV<0x70208000>;
390 def VSUBWEV_D_W : LSX3R_VVV<0x70210000>;
391 def VSUBWEV_Q_D : LSX3R_VVV<0x70218000>;
392 def VSUBWOD_H_B : LSX3R_VVV<0x70240000>;
393 def VSUBWOD_W_H : LSX3R_VVV<0x70248000>;
394 def VSUBWOD_D_W : LSX3R_VVV<0x70250000>;
395 def VSUBWOD_Q_D : LSX3R_VVV<0x70258000>;
397 def VADDWEV_H_BU : LSX3R_VVV<0x702e0000>;
398 def VADDWEV_W_HU : LSX3R_VVV<0x702e8000>;
399 def VADDWEV_D_WU : LSX3R_VVV<0x702f0000>;
400 def VADDWEV_Q_DU : LSX3R_VVV<0x702f8000>;
401 def VADDWOD_H_BU : LSX3R_VVV<0x70320000>;
402 def VADDWOD_W_HU : LSX3R_VVV<0x70328000>;
403 def VADDWOD_D_WU : LSX3R_VVV<0x70330000>;
404 def VADDWOD_Q_DU : LSX3R_VVV<0x70338000>;
406 def VSUBWEV_H_BU : LSX3R_VVV<0x70300000>;
407 def VSUBWEV_W_HU : LSX3R_VVV<0x70308000>;
408 def VSUBWEV_D_WU : LSX3R_VVV<0x70310000>;
409 def VSUBWEV_Q_DU : LSX3R_VVV<0x70318000>;
410 def VSUBWOD_H_BU : LSX3R_VVV<0x70340000>;
411 def VSUBWOD_W_HU : LSX3R_VVV<0x70348000>;
412 def VSUBWOD_D_WU : LSX3R_VVV<0x70350000>;
413 def VSUBWOD_Q_DU : LSX3R_VVV<0x70358000>;
415 def VADDWEV_H_BU_B : LSX3R_VVV<0x703e0000>;
416 def VADDWEV_W_HU_H : LSX3R_VVV<0x703e8000>;
417 def VADDWEV_D_WU_W : LSX3R_VVV<0x703f0000>;
418 def VADDWEV_Q_DU_D : LSX3R_VVV<0x703f8000>;
419 def VADDWOD_H_BU_B : LSX3R_VVV<0x70400000>;
420 def VADDWOD_W_HU_H : LSX3R_VVV<0x70408000>;
421 def VADDWOD_D_WU_W : LSX3R_VVV<0x70410000>;
422 def VADDWOD_Q_DU_D : LSX3R_VVV<0x70418000>;
424 def VAVG_B : LSX3R_VVV<0x70640000>;
425 def VAVG_H : LSX3R_VVV<0x70648000>;
426 def VAVG_W : LSX3R_VVV<0x70650000>;
427 def VAVG_D : LSX3R_VVV<0x70658000>;
428 def VAVG_BU : LSX3R_VVV<0x70660000>;
429 def VAVG_HU : LSX3R_VVV<0x70668000>;
430 def VAVG_WU : LSX3R_VVV<0x70670000>;
431 def VAVG_DU : LSX3R_VVV<0x70678000>;
432 def VAVGR_B : LSX3R_VVV<0x70680000>;
433 def VAVGR_H : LSX3R_VVV<0x70688000>;
434 def VAVGR_W : LSX3R_VVV<0x70690000>;
435 def VAVGR_D : LSX3R_VVV<0x70698000>;
436 def VAVGR_BU : LSX3R_VVV<0x706a0000>;
437 def VAVGR_HU : LSX3R_VVV<0x706a8000>;
438 def VAVGR_WU : LSX3R_VVV<0x706b0000>;
439 def VAVGR_DU : LSX3R_VVV<0x706b8000>;
441 def VABSD_B : LSX3R_VVV<0x70600000>;
442 def VABSD_H : LSX3R_VVV<0x70608000>;
443 def VABSD_W : LSX3R_VVV<0x70610000>;
444 def VABSD_D : LSX3R_VVV<0x70618000>;
445 def VABSD_BU : LSX3R_VVV<0x70620000>;
446 def VABSD_HU : LSX3R_VVV<0x70628000>;
447 def VABSD_WU : LSX3R_VVV<0x70630000>;
448 def VABSD_DU : LSX3R_VVV<0x70638000>;
450 def VADDA_B : LSX3R_VVV<0x705c0000>;
451 def VADDA_H : LSX3R_VVV<0x705c8000>;
452 def VADDA_W : LSX3R_VVV<0x705d0000>;
453 def VADDA_D : LSX3R_VVV<0x705d8000>;
455 def VMAX_B : LSX3R_VVV<0x70700000>;
456 def VMAX_H : LSX3R_VVV<0x70708000>;
457 def VMAX_W : LSX3R_VVV<0x70710000>;
458 def VMAX_D : LSX3R_VVV<0x70718000>;
459 def VMAXI_B : LSX2RI5_VVI<0x72900000, simm5>;
460 def VMAXI_H : LSX2RI5_VVI<0x72908000, simm5>;
461 def VMAXI_W : LSX2RI5_VVI<0x72910000, simm5>;
462 def VMAXI_D : LSX2RI5_VVI<0x72918000, simm5>;
463 def VMAX_BU : LSX3R_VVV<0x70740000>;
464 def VMAX_HU : LSX3R_VVV<0x70748000>;
465 def VMAX_WU : LSX3R_VVV<0x70750000>;
466 def VMAX_DU : LSX3R_VVV<0x70758000>;
467 def VMAXI_BU : LSX2RI5_VVI<0x72940000>;
468 def VMAXI_HU : LSX2RI5_VVI<0x72948000>;
469 def VMAXI_WU : LSX2RI5_VVI<0x72950000>;
470 def VMAXI_DU : LSX2RI5_VVI<0x72958000>;
472 def VMIN_B : LSX3R_VVV<0x70720000>;
473 def VMIN_H : LSX3R_VVV<0x70728000>;
474 def VMIN_W : LSX3R_VVV<0x70730000>;
475 def VMIN_D : LSX3R_VVV<0x70738000>;
476 def VMINI_B : LSX2RI5_VVI<0x72920000, simm5>;
477 def VMINI_H : LSX2RI5_VVI<0x72928000, simm5>;
478 def VMINI_W : LSX2RI5_VVI<0x72930000, simm5>;
479 def VMINI_D : LSX2RI5_VVI<0x72938000, simm5>;
480 def VMIN_BU : LSX3R_VVV<0x70760000>;
481 def VMIN_HU : LSX3R_VVV<0x70768000>;
482 def VMIN_WU : LSX3R_VVV<0x70770000>;
483 def VMIN_DU : LSX3R_VVV<0x70778000>;
484 def VMINI_BU : LSX2RI5_VVI<0x72960000>;
485 def VMINI_HU : LSX2RI5_VVI<0x72968000>;
486 def VMINI_WU : LSX2RI5_VVI<0x72970000>;
487 def VMINI_DU : LSX2RI5_VVI<0x72978000>;
489 def VMUL_B : LSX3R_VVV<0x70840000>;
490 def VMUL_H : LSX3R_VVV<0x70848000>;
491 def VMUL_W : LSX3R_VVV<0x70850000>;
492 def VMUL_D : LSX3R_VVV<0x70858000>;
494 def VMUH_B : LSX3R_VVV<0x70860000>;
495 def VMUH_H : LSX3R_VVV<0x70868000>;
496 def VMUH_W : LSX3R_VVV<0x70870000>;
497 def VMUH_D : LSX3R_VVV<0x70878000>;
498 def VMUH_BU : LSX3R_VVV<0x70880000>;
499 def VMUH_HU : LSX3R_VVV<0x70888000>;
500 def VMUH_WU : LSX3R_VVV<0x70890000>;
501 def VMUH_DU : LSX3R_VVV<0x70898000>;
503 def VMULWEV_H_B : LSX3R_VVV<0x70900000>;
504 def VMULWEV_W_H : LSX3R_VVV<0x70908000>;
505 def VMULWEV_D_W : LSX3R_VVV<0x70910000>;
506 def VMULWEV_Q_D : LSX3R_VVV<0x70918000>;
507 def VMULWOD_H_B : LSX3R_VVV<0x70920000>;
508 def VMULWOD_W_H : LSX3R_VVV<0x70928000>;
509 def VMULWOD_D_W : LSX3R_VVV<0x70930000>;
510 def VMULWOD_Q_D : LSX3R_VVV<0x70938000>;
511 def VMULWEV_H_BU : LSX3R_VVV<0x70980000>;
512 def VMULWEV_W_HU : LSX3R_VVV<0x70988000>;
513 def VMULWEV_D_WU : LSX3R_VVV<0x70990000>;
514 def VMULWEV_Q_DU : LSX3R_VVV<0x70998000>;
515 def VMULWOD_H_BU : LSX3R_VVV<0x709a0000>;
516 def VMULWOD_W_HU : LSX3R_VVV<0x709a8000>;
517 def VMULWOD_D_WU : LSX3R_VVV<0x709b0000>;
518 def VMULWOD_Q_DU : LSX3R_VVV<0x709b8000>;
519 def VMULWEV_H_BU_B : LSX3R_VVV<0x70a00000>;
520 def VMULWEV_W_HU_H : LSX3R_VVV<0x70a08000>;
521 def VMULWEV_D_WU_W : LSX3R_VVV<0x70a10000>;
522 def VMULWEV_Q_DU_D : LSX3R_VVV<0x70a18000>;
523 def VMULWOD_H_BU_B : LSX3R_VVV<0x70a20000>;
524 def VMULWOD_W_HU_H : LSX3R_VVV<0x70a28000>;
525 def VMULWOD_D_WU_W : LSX3R_VVV<0x70a30000>;
526 def VMULWOD_Q_DU_D : LSX3R_VVV<0x70a38000>;
528 def VMADD_B : LSX3R_VVVV<0x70a80000>;
529 def VMADD_H : LSX3R_VVVV<0x70a88000>;
530 def VMADD_W : LSX3R_VVVV<0x70a90000>;
531 def VMADD_D : LSX3R_VVVV<0x70a98000>;
533 def VMSUB_B : LSX3R_VVVV<0x70aa0000>;
534 def VMSUB_H : LSX3R_VVVV<0x70aa8000>;
535 def VMSUB_W : LSX3R_VVVV<0x70ab0000>;
536 def VMSUB_D : LSX3R_VVVV<0x70ab8000>;
538 def VMADDWEV_H_B : LSX3R_VVVV<0x70ac0000>;
539 def VMADDWEV_W_H : LSX3R_VVVV<0x70ac8000>;
540 def VMADDWEV_D_W : LSX3R_VVVV<0x70ad0000>;
541 def VMADDWEV_Q_D : LSX3R_VVVV<0x70ad8000>;
542 def VMADDWOD_H_B : LSX3R_VVVV<0x70ae0000>;
543 def VMADDWOD_W_H : LSX3R_VVVV<0x70ae8000>;
544 def VMADDWOD_D_W : LSX3R_VVVV<0x70af0000>;
545 def VMADDWOD_Q_D : LSX3R_VVVV<0x70af8000>;
546 def VMADDWEV_H_BU : LSX3R_VVVV<0x70b40000>;
547 def VMADDWEV_W_HU : LSX3R_VVVV<0x70b48000>;
548 def VMADDWEV_D_WU : LSX3R_VVVV<0x70b50000>;
549 def VMADDWEV_Q_DU : LSX3R_VVVV<0x70b58000>;
550 def VMADDWOD_H_BU : LSX3R_VVVV<0x70b60000>;
551 def VMADDWOD_W_HU : LSX3R_VVVV<0x70b68000>;
552 def VMADDWOD_D_WU : LSX3R_VVVV<0x70b70000>;
553 def VMADDWOD_Q_DU : LSX3R_VVVV<0x70b78000>;
554 def VMADDWEV_H_BU_B : LSX3R_VVVV<0x70bc0000>;
555 def VMADDWEV_W_HU_H : LSX3R_VVVV<0x70bc8000>;
556 def VMADDWEV_D_WU_W : LSX3R_VVVV<0x70bd0000>;
557 def VMADDWEV_Q_DU_D : LSX3R_VVVV<0x70bd8000>;
558 def VMADDWOD_H_BU_B : LSX3R_VVVV<0x70be0000>;
559 def VMADDWOD_W_HU_H : LSX3R_VVVV<0x70be8000>;
560 def VMADDWOD_D_WU_W : LSX3R_VVVV<0x70bf0000>;
561 def VMADDWOD_Q_DU_D : LSX3R_VVVV<0x70bf8000>;
563 def VDIV_B : LSX3R_VVV<0x70e00000>;
564 def VDIV_H : LSX3R_VVV<0x70e08000>;
565 def VDIV_W : LSX3R_VVV<0x70e10000>;
566 def VDIV_D : LSX3R_VVV<0x70e18000>;
567 def VDIV_BU : LSX3R_VVV<0x70e40000>;
568 def VDIV_HU : LSX3R_VVV<0x70e48000>;
569 def VDIV_WU : LSX3R_VVV<0x70e50000>;
570 def VDIV_DU : LSX3R_VVV<0x70e58000>;
572 def VMOD_B : LSX3R_VVV<0x70e20000>;
573 def VMOD_H : LSX3R_VVV<0x70e28000>;
574 def VMOD_W : LSX3R_VVV<0x70e30000>;
575 def VMOD_D : LSX3R_VVV<0x70e38000>;
576 def VMOD_BU : LSX3R_VVV<0x70e60000>;
577 def VMOD_HU : LSX3R_VVV<0x70e68000>;
578 def VMOD_WU : LSX3R_VVV<0x70e70000>;
579 def VMOD_DU : LSX3R_VVV<0x70e78000>;
581 def VSAT_B : LSX2RI3_VVI<0x73242000>;
582 def VSAT_H : LSX2RI4_VVI<0x73244000>;
583 def VSAT_W : LSX2RI5_VVI<0x73248000>;
584 def VSAT_D : LSX2RI6_VVI<0x73250000>;
585 def VSAT_BU : LSX2RI3_VVI<0x73282000>;
586 def VSAT_HU : LSX2RI4_VVI<0x73284000>;
587 def VSAT_WU : LSX2RI5_VVI<0x73288000>;
588 def VSAT_DU : LSX2RI6_VVI<0x73290000>;
590 def VEXTH_H_B : LSX2R_VV<0x729ee000>;
591 def VEXTH_W_H : LSX2R_VV<0x729ee400>;
592 def VEXTH_D_W : LSX2R_VV<0x729ee800>;
593 def VEXTH_Q_D : LSX2R_VV<0x729eec00>;
594 def VEXTH_HU_BU : LSX2R_VV<0x729ef000>;
595 def VEXTH_WU_HU : LSX2R_VV<0x729ef400>;
596 def VEXTH_DU_WU : LSX2R_VV<0x729ef800>;
597 def VEXTH_QU_DU : LSX2R_VV<0x729efc00>;
599 def VSIGNCOV_B : LSX3R_VVV<0x712e0000>;
600 def VSIGNCOV_H : LSX3R_VVV<0x712e8000>;
601 def VSIGNCOV_W : LSX3R_VVV<0x712f0000>;
602 def VSIGNCOV_D : LSX3R_VVV<0x712f8000>;
604 def VMSKLTZ_B : LSX2R_VV<0x729c4000>;
605 def VMSKLTZ_H : LSX2R_VV<0x729c4400>;
606 def VMSKLTZ_W : LSX2R_VV<0x729c4800>;
607 def VMSKLTZ_D : LSX2R_VV<0x729c4c00>;
609 def VMSKGEZ_B : LSX2R_VV<0x729c5000>;
611 def VMSKNZ_B : LSX2R_VV<0x729c6000>;
613 def VLDI : LSX1RI13_VI<0x73e00000>;
615 def VAND_V : LSX3R_VVV<0x71260000>;
616 def VOR_V : LSX3R_VVV<0x71268000>;
617 def VXOR_V : LSX3R_VVV<0x71270000>;
618 def VNOR_V : LSX3R_VVV<0x71278000>;
619 def VANDN_V : LSX3R_VVV<0x71280000>;
620 def VORN_V : LSX3R_VVV<0x71288000>;
622 def VANDI_B : LSX2RI8_VVI<0x73d00000>;
623 def VORI_B : LSX2RI8_VVI<0x73d40000>;
624 def VXORI_B : LSX2RI8_VVI<0x73d80000>;
625 def VNORI_B : LSX2RI8_VVI<0x73dc0000>;
627 def VSLL_B : LSX3R_VVV<0x70e80000>;
628 def VSLL_H : LSX3R_VVV<0x70e88000>;
629 def VSLL_W : LSX3R_VVV<0x70e90000>;
630 def VSLL_D : LSX3R_VVV<0x70e98000>;
631 def VSLLI_B : LSX2RI3_VVI<0x732c2000>;
632 def VSLLI_H : LSX2RI4_VVI<0x732c4000>;
633 def VSLLI_W : LSX2RI5_VVI<0x732c8000>;
634 def VSLLI_D : LSX2RI6_VVI<0x732d0000>;
636 def VSRL_B : LSX3R_VVV<0x70ea0000>;
637 def VSRL_H : LSX3R_VVV<0x70ea8000>;
638 def VSRL_W : LSX3R_VVV<0x70eb0000>;
639 def VSRL_D : LSX3R_VVV<0x70eb8000>;
640 def VSRLI_B : LSX2RI3_VVI<0x73302000>;
641 def VSRLI_H : LSX2RI4_VVI<0x73304000>;
642 def VSRLI_W : LSX2RI5_VVI<0x73308000>;
643 def VSRLI_D : LSX2RI6_VVI<0x73310000>;
645 def VSRA_B : LSX3R_VVV<0x70ec0000>;
646 def VSRA_H : LSX3R_VVV<0x70ec8000>;
647 def VSRA_W : LSX3R_VVV<0x70ed0000>;
648 def VSRA_D : LSX3R_VVV<0x70ed8000>;
649 def VSRAI_B : LSX2RI3_VVI<0x73342000>;
650 def VSRAI_H : LSX2RI4_VVI<0x73344000>;
651 def VSRAI_W : LSX2RI5_VVI<0x73348000>;
652 def VSRAI_D : LSX2RI6_VVI<0x73350000>;
654 def VROTR_B : LSX3R_VVV<0x70ee0000>;
655 def VROTR_H : LSX3R_VVV<0x70ee8000>;
656 def VROTR_W : LSX3R_VVV<0x70ef0000>;
657 def VROTR_D : LSX3R_VVV<0x70ef8000>;
658 def VROTRI_B : LSX2RI3_VVI<0x72a02000>;
659 def VROTRI_H : LSX2RI4_VVI<0x72a04000>;
660 def VROTRI_W : LSX2RI5_VVI<0x72a08000>;
661 def VROTRI_D : LSX2RI6_VVI<0x72a10000>;
663 def VSLLWIL_H_B : LSX2RI3_VVI<0x73082000>;
664 def VSLLWIL_W_H : LSX2RI4_VVI<0x73084000>;
665 def VSLLWIL_D_W : LSX2RI5_VVI<0x73088000>;
666 def VEXTL_Q_D : LSX2R_VV<0x73090000>;
667 def VSLLWIL_HU_BU : LSX2RI3_VVI<0x730c2000>;
668 def VSLLWIL_WU_HU : LSX2RI4_VVI<0x730c4000>;
669 def VSLLWIL_DU_WU : LSX2RI5_VVI<0x730c8000>;
670 def VEXTL_QU_DU : LSX2R_VV<0x730d0000>;
672 def VSRLR_B : LSX3R_VVV<0x70f00000>;
673 def VSRLR_H : LSX3R_VVV<0x70f08000>;
674 def VSRLR_W : LSX3R_VVV<0x70f10000>;
675 def VSRLR_D : LSX3R_VVV<0x70f18000>;
676 def VSRLRI_B : LSX2RI3_VVI<0x72a42000>;
677 def VSRLRI_H : LSX2RI4_VVI<0x72a44000>;
678 def VSRLRI_W : LSX2RI5_VVI<0x72a48000>;
679 def VSRLRI_D : LSX2RI6_VVI<0x72a50000>;
681 def VSRAR_B : LSX3R_VVV<0x70f20000>;
682 def VSRAR_H : LSX3R_VVV<0x70f28000>;
683 def VSRAR_W : LSX3R_VVV<0x70f30000>;
684 def VSRAR_D : LSX3R_VVV<0x70f38000>;
685 def VSRARI_B : LSX2RI3_VVI<0x72a82000>;
686 def VSRARI_H : LSX2RI4_VVI<0x72a84000>;
687 def VSRARI_W : LSX2RI5_VVI<0x72a88000>;
688 def VSRARI_D : LSX2RI6_VVI<0x72a90000>;
690 def VSRLN_B_H : LSX3R_VVV<0x70f48000>;
691 def VSRLN_H_W : LSX3R_VVV<0x70f50000>;
692 def VSRLN_W_D : LSX3R_VVV<0x70f58000>;
693 def VSRAN_B_H : LSX3R_VVV<0x70f68000>;
694 def VSRAN_H_W : LSX3R_VVV<0x70f70000>;
695 def VSRAN_W_D : LSX3R_VVV<0x70f78000>;
697 def VSRLNI_B_H : LSX2RI4_VVVI<0x73404000>;
698 def VSRLNI_H_W : LSX2RI5_VVVI<0x73408000>;
699 def VSRLNI_W_D : LSX2RI6_VVVI<0x73410000>;
700 def VSRLNI_D_Q : LSX2RI7_VVVI<0x73420000>;
701 def VSRANI_B_H : LSX2RI4_VVVI<0x73584000>;
702 def VSRANI_H_W : LSX2RI5_VVVI<0x73588000>;
703 def VSRANI_W_D : LSX2RI6_VVVI<0x73590000>;
704 def VSRANI_D_Q : LSX2RI7_VVVI<0x735a0000>;
706 def VSRLRN_B_H : LSX3R_VVV<0x70f88000>;
707 def VSRLRN_H_W : LSX3R_VVV<0x70f90000>;
708 def VSRLRN_W_D : LSX3R_VVV<0x70f98000>;
709 def VSRARN_B_H : LSX3R_VVV<0x70fa8000>;
710 def VSRARN_H_W : LSX3R_VVV<0x70fb0000>;
711 def VSRARN_W_D : LSX3R_VVV<0x70fb8000>;
713 def VSRLRNI_B_H : LSX2RI4_VVVI<0x73444000>;
714 def VSRLRNI_H_W : LSX2RI5_VVVI<0x73448000>;
715 def VSRLRNI_W_D : LSX2RI6_VVVI<0x73450000>;
716 def VSRLRNI_D_Q : LSX2RI7_VVVI<0x73460000>;
717 def VSRARNI_B_H : LSX2RI4_VVVI<0x735c4000>;
718 def VSRARNI_H_W : LSX2RI5_VVVI<0x735c8000>;
719 def VSRARNI_W_D : LSX2RI6_VVVI<0x735d0000>;
720 def VSRARNI_D_Q : LSX2RI7_VVVI<0x735e0000>;
722 def VSSRLN_B_H : LSX3R_VVV<0x70fc8000>;
723 def VSSRLN_H_W : LSX3R_VVV<0x70fd0000>;
724 def VSSRLN_W_D : LSX3R_VVV<0x70fd8000>;
725 def VSSRAN_B_H : LSX3R_VVV<0x70fe8000>;
726 def VSSRAN_H_W : LSX3R_VVV<0x70ff0000>;
727 def VSSRAN_W_D : LSX3R_VVV<0x70ff8000>;
728 def VSSRLN_BU_H : LSX3R_VVV<0x71048000>;
729 def VSSRLN_HU_W : LSX3R_VVV<0x71050000>;
730 def VSSRLN_WU_D : LSX3R_VVV<0x71058000>;
731 def VSSRAN_BU_H : LSX3R_VVV<0x71068000>;
732 def VSSRAN_HU_W : LSX3R_VVV<0x71070000>;
733 def VSSRAN_WU_D : LSX3R_VVV<0x71078000>;
735 def VSSRLNI_B_H : LSX2RI4_VVVI<0x73484000>;
736 def VSSRLNI_H_W : LSX2RI5_VVVI<0x73488000>;
737 def VSSRLNI_W_D : LSX2RI6_VVVI<0x73490000>;
738 def VSSRLNI_D_Q : LSX2RI7_VVVI<0x734a0000>;
739 def VSSRANI_B_H : LSX2RI4_VVVI<0x73604000>;
740 def VSSRANI_H_W : LSX2RI5_VVVI<0x73608000>;
741 def VSSRANI_W_D : LSX2RI6_VVVI<0x73610000>;
742 def VSSRANI_D_Q : LSX2RI7_VVVI<0x73620000>;
743 def VSSRLNI_BU_H : LSX2RI4_VVVI<0x734c4000>;
744 def VSSRLNI_HU_W : LSX2RI5_VVVI<0x734c8000>;
745 def VSSRLNI_WU_D : LSX2RI6_VVVI<0x734d0000>;
746 def VSSRLNI_DU_Q : LSX2RI7_VVVI<0x734e0000>;
747 def VSSRANI_BU_H : LSX2RI4_VVVI<0x73644000>;
748 def VSSRANI_HU_W : LSX2RI5_VVVI<0x73648000>;
749 def VSSRANI_WU_D : LSX2RI6_VVVI<0x73650000>;
750 def VSSRANI_DU_Q : LSX2RI7_VVVI<0x73660000>;
752 def VSSRLRN_B_H : LSX3R_VVV<0x71008000>;
753 def VSSRLRN_H_W : LSX3R_VVV<0x71010000>;
754 def VSSRLRN_W_D : LSX3R_VVV<0x71018000>;
755 def VSSRARN_B_H : LSX3R_VVV<0x71028000>;
756 def VSSRARN_H_W : LSX3R_VVV<0x71030000>;
757 def VSSRARN_W_D : LSX3R_VVV<0x71038000>;
758 def VSSRLRN_BU_H : LSX3R_VVV<0x71088000>;
759 def VSSRLRN_HU_W : LSX3R_VVV<0x71090000>;
760 def VSSRLRN_WU_D : LSX3R_VVV<0x71098000>;
761 def VSSRARN_BU_H : LSX3R_VVV<0x710a8000>;
762 def VSSRARN_HU_W : LSX3R_VVV<0x710b0000>;
763 def VSSRARN_WU_D : LSX3R_VVV<0x710b8000>;
765 def VSSRLRNI_B_H : LSX2RI4_VVVI<0x73504000>;
766 def VSSRLRNI_H_W : LSX2RI5_VVVI<0x73508000>;
767 def VSSRLRNI_W_D : LSX2RI6_VVVI<0x73510000>;
768 def VSSRLRNI_D_Q : LSX2RI7_VVVI<0x73520000>;
769 def VSSRARNI_B_H : LSX2RI4_VVVI<0x73684000>;
770 def VSSRARNI_H_W : LSX2RI5_VVVI<0x73688000>;
771 def VSSRARNI_W_D : LSX2RI6_VVVI<0x73690000>;
772 def VSSRARNI_D_Q : LSX2RI7_VVVI<0x736a0000>;
773 def VSSRLRNI_BU_H : LSX2RI4_VVVI<0x73544000>;
774 def VSSRLRNI_HU_W : LSX2RI5_VVVI<0x73548000>;
775 def VSSRLRNI_WU_D : LSX2RI6_VVVI<0x73550000>;
776 def VSSRLRNI_DU_Q : LSX2RI7_VVVI<0x73560000>;
777 def VSSRARNI_BU_H : LSX2RI4_VVVI<0x736c4000>;
778 def VSSRARNI_HU_W : LSX2RI5_VVVI<0x736c8000>;
779 def VSSRARNI_WU_D : LSX2RI6_VVVI<0x736d0000>;
780 def VSSRARNI_DU_Q : LSX2RI7_VVVI<0x736e0000>;
782 def VCLO_B : LSX2R_VV<0x729c0000>;
783 def VCLO_H : LSX2R_VV<0x729c0400>;
784 def VCLO_W : LSX2R_VV<0x729c0800>;
785 def VCLO_D : LSX2R_VV<0x729c0c00>;
786 def VCLZ_B : LSX2R_VV<0x729c1000>;
787 def VCLZ_H : LSX2R_VV<0x729c1400>;
788 def VCLZ_W : LSX2R_VV<0x729c1800>;
789 def VCLZ_D : LSX2R_VV<0x729c1c00>;
791 def VPCNT_B : LSX2R_VV<0x729c2000>;
792 def VPCNT_H : LSX2R_VV<0x729c2400>;
793 def VPCNT_W : LSX2R_VV<0x729c2800>;
794 def VPCNT_D : LSX2R_VV<0x729c2c00>;
796 def VBITCLR_B : LSX3R_VVV<0x710c0000>;
797 def VBITCLR_H : LSX3R_VVV<0x710c8000>;
798 def VBITCLR_W : LSX3R_VVV<0x710d0000>;
799 def VBITCLR_D : LSX3R_VVV<0x710d8000>;
800 def VBITCLRI_B : LSX2RI3_VVI<0x73102000>;
801 def VBITCLRI_H : LSX2RI4_VVI<0x73104000>;
802 def VBITCLRI_W : LSX2RI5_VVI<0x73108000>;
803 def VBITCLRI_D : LSX2RI6_VVI<0x73110000>;
805 def VBITSET_B : LSX3R_VVV<0x710e0000>;
806 def VBITSET_H : LSX3R_VVV<0x710e8000>;
807 def VBITSET_W : LSX3R_VVV<0x710f0000>;
808 def VBITSET_D : LSX3R_VVV<0x710f8000>;
809 def VBITSETI_B : LSX2RI3_VVI<0x73142000>;
810 def VBITSETI_H : LSX2RI4_VVI<0x73144000>;
811 def VBITSETI_W : LSX2RI5_VVI<0x73148000>;
812 def VBITSETI_D : LSX2RI6_VVI<0x73150000>;
814 def VBITREV_B : LSX3R_VVV<0x71100000>;
815 def VBITREV_H : LSX3R_VVV<0x71108000>;
816 def VBITREV_W : LSX3R_VVV<0x71110000>;
817 def VBITREV_D : LSX3R_VVV<0x71118000>;
818 def VBITREVI_B : LSX2RI3_VVI<0x73182000>;
819 def VBITREVI_H : LSX2RI4_VVI<0x73184000>;
820 def VBITREVI_W : LSX2RI5_VVI<0x73188000>;
821 def VBITREVI_D : LSX2RI6_VVI<0x73190000>;
823 def VFRSTP_B : LSX3R_VVVV<0x712b0000>;
824 def VFRSTP_H : LSX3R_VVVV<0x712b8000>;
825 def VFRSTPI_B : LSX2RI5_VVVI<0x729a0000>;
826 def VFRSTPI_H : LSX2RI5_VVVI<0x729a8000>;
828 def VFADD_S : LSX3R_VVV<0x71308000>;
829 def VFADD_D : LSX3R_VVV<0x71310000>;
830 def VFSUB_S : LSX3R_VVV<0x71328000>;
831 def VFSUB_D : LSX3R_VVV<0x71330000>;
832 def VFMUL_S : LSX3R_VVV<0x71388000>;
833 def VFMUL_D : LSX3R_VVV<0x71390000>;
834 def VFDIV_S : LSX3R_VVV<0x713a8000>;
835 def VFDIV_D : LSX3R_VVV<0x713b0000>;
837 def VFMADD_S : LSX4R_VVVV<0x09100000>;
838 def VFMADD_D : LSX4R_VVVV<0x09200000>;
839 def VFMSUB_S : LSX4R_VVVV<0x09500000>;
840 def VFMSUB_D : LSX4R_VVVV<0x09600000>;
841 def VFNMADD_S : LSX4R_VVVV<0x09900000>;
842 def VFNMADD_D : LSX4R_VVVV<0x09a00000>;
843 def VFNMSUB_S : LSX4R_VVVV<0x09d00000>;
844 def VFNMSUB_D : LSX4R_VVVV<0x09e00000>;
846 def VFMAX_S : LSX3R_VVV<0x713c8000>;
847 def VFMAX_D : LSX3R_VVV<0x713d0000>;
848 def VFMIN_S : LSX3R_VVV<0x713e8000>;
849 def VFMIN_D : LSX3R_VVV<0x713f0000>;
851 def VFMAXA_S : LSX3R_VVV<0x71408000>;
852 def VFMAXA_D : LSX3R_VVV<0x71410000>;
853 def VFMINA_S : LSX3R_VVV<0x71428000>;
854 def VFMINA_D : LSX3R_VVV<0x71430000>;
856 def VFLOGB_S : LSX2R_VV<0x729cc400>;
857 def VFLOGB_D : LSX2R_VV<0x729cc800>;
859 def VFCLASS_S : LSX2R_VV<0x729cd400>;
860 def VFCLASS_D : LSX2R_VV<0x729cd800>;
862 def VFSQRT_S : LSX2R_VV<0x729ce400>;
863 def VFSQRT_D : LSX2R_VV<0x729ce800>;
864 def VFRECIP_S : LSX2R_VV<0x729cf400>;
865 def VFRECIP_D : LSX2R_VV<0x729cf800>;
866 def VFRSQRT_S : LSX2R_VV<0x729d0400>;
867 def VFRSQRT_D : LSX2R_VV<0x729d0800>;
869 def VFCVTL_S_H : LSX2R_VV<0x729de800>;
870 def VFCVTH_S_H : LSX2R_VV<0x729dec00>;
871 def VFCVTL_D_S : LSX2R_VV<0x729df000>;
872 def VFCVTH_D_S : LSX2R_VV<0x729df400>;
873 def VFCVT_H_S : LSX3R_VVV<0x71460000>;
874 def VFCVT_S_D : LSX3R_VVV<0x71468000>;
876 def VFRINTRNE_S : LSX2R_VV<0x729d7400>;
877 def VFRINTRNE_D : LSX2R_VV<0x729d7800>;
878 def VFRINTRZ_S : LSX2R_VV<0x729d6400>;
879 def VFRINTRZ_D : LSX2R_VV<0x729d6800>;
880 def VFRINTRP_S : LSX2R_VV<0x729d5400>;
881 def VFRINTRP_D : LSX2R_VV<0x729d5800>;
882 def VFRINTRM_S : LSX2R_VV<0x729d4400>;
883 def VFRINTRM_D : LSX2R_VV<0x729d4800>;
884 def VFRINT_S : LSX2R_VV<0x729d3400>;
885 def VFRINT_D : LSX2R_VV<0x729d3800>;
887 def VFTINTRNE_W_S : LSX2R_VV<0x729e5000>;
888 def VFTINTRNE_L_D : LSX2R_VV<0x729e5400>;
889 def VFTINTRZ_W_S : LSX2R_VV<0x729e4800>;
890 def VFTINTRZ_L_D : LSX2R_VV<0x729e4c00>;
891 def VFTINTRP_W_S : LSX2R_VV<0x729e4000>;
892 def VFTINTRP_L_D : LSX2R_VV<0x729e4400>;
893 def VFTINTRM_W_S : LSX2R_VV<0x729e3800>;
894 def VFTINTRM_L_D : LSX2R_VV<0x729e3c00>;
895 def VFTINT_W_S : LSX2R_VV<0x729e3000>;
896 def VFTINT_L_D : LSX2R_VV<0x729e3400>;
897 def VFTINTRZ_WU_S : LSX2R_VV<0x729e7000>;
898 def VFTINTRZ_LU_D : LSX2R_VV<0x729e7400>;
899 def VFTINT_WU_S : LSX2R_VV<0x729e5800>;
900 def VFTINT_LU_D : LSX2R_VV<0x729e5c00>;
902 def VFTINTRNE_W_D : LSX3R_VVV<0x714b8000>;
903 def VFTINTRZ_W_D : LSX3R_VVV<0x714b0000>;
904 def VFTINTRP_W_D : LSX3R_VVV<0x714a8000>;
905 def VFTINTRM_W_D : LSX3R_VVV<0x714a0000>;
906 def VFTINT_W_D : LSX3R_VVV<0x71498000>;
908 def VFTINTRNEL_L_S : LSX2R_VV<0x729ea000>;
909 def VFTINTRNEH_L_S : LSX2R_VV<0x729ea400>;
910 def VFTINTRZL_L_S : LSX2R_VV<0x729e9800>;
911 def VFTINTRZH_L_S : LSX2R_VV<0x729e9c00>;
912 def VFTINTRPL_L_S : LSX2R_VV<0x729e9000>;
913 def VFTINTRPH_L_S : LSX2R_VV<0x729e9400>;
914 def VFTINTRML_L_S : LSX2R_VV<0x729e8800>;
915 def VFTINTRMH_L_S : LSX2R_VV<0x729e8c00>;
916 def VFTINTL_L_S : LSX2R_VV<0x729e8000>;
917 def VFTINTH_L_S : LSX2R_VV<0x729e8400>;
919 def VFFINT_S_W : LSX2R_VV<0x729e0000>;
920 def VFFINT_D_L : LSX2R_VV<0x729e0800>;
921 def VFFINT_S_WU : LSX2R_VV<0x729e0400>;
922 def VFFINT_D_LU : LSX2R_VV<0x729e0c00>;
923 def VFFINTL_D_W : LSX2R_VV<0x729e1000>;
924 def VFFINTH_D_W : LSX2R_VV<0x729e1400>;
925 def VFFINT_S_L : LSX3R_VVV<0x71480000>;
927 def VSEQ_B : LSX3R_VVV<0x70000000>;
928 def VSEQ_H : LSX3R_VVV<0x70008000>;
929 def VSEQ_W : LSX3R_VVV<0x70010000>;
930 def VSEQ_D : LSX3R_VVV<0x70018000>;
931 def VSEQI_B : LSX2RI5_VVI<0x72800000, simm5>;
932 def VSEQI_H : LSX2RI5_VVI<0x72808000, simm5>;
933 def VSEQI_W : LSX2RI5_VVI<0x72810000, simm5>;
934 def VSEQI_D : LSX2RI5_VVI<0x72818000, simm5>;
936 def VSLE_B : LSX3R_VVV<0x70020000>;
937 def VSLE_H : LSX3R_VVV<0x70028000>;
938 def VSLE_W : LSX3R_VVV<0x70030000>;
939 def VSLE_D : LSX3R_VVV<0x70038000>;
940 def VSLEI_B : LSX2RI5_VVI<0x72820000, simm5>;
941 def VSLEI_H : LSX2RI5_VVI<0x72828000, simm5>;
942 def VSLEI_W : LSX2RI5_VVI<0x72830000, simm5>;
943 def VSLEI_D : LSX2RI5_VVI<0x72838000, simm5>;
945 def VSLE_BU : LSX3R_VVV<0x70040000>;
946 def VSLE_HU : LSX3R_VVV<0x70048000>;
947 def VSLE_WU : LSX3R_VVV<0x70050000>;
948 def VSLE_DU : LSX3R_VVV<0x70058000>;
949 def VSLEI_BU : LSX2RI5_VVI<0x72840000>;
950 def VSLEI_HU : LSX2RI5_VVI<0x72848000>;
951 def VSLEI_WU : LSX2RI5_VVI<0x72850000>;
952 def VSLEI_DU : LSX2RI5_VVI<0x72858000>;
954 def VSLT_B : LSX3R_VVV<0x70060000>;
955 def VSLT_H : LSX3R_VVV<0x70068000>;
956 def VSLT_W : LSX3R_VVV<0x70070000>;
957 def VSLT_D : LSX3R_VVV<0x70078000>;
958 def VSLTI_B : LSX2RI5_VVI<0x72860000, simm5>;
959 def VSLTI_H : LSX2RI5_VVI<0x72868000, simm5>;
960 def VSLTI_W : LSX2RI5_VVI<0x72870000, simm5>;
961 def VSLTI_D : LSX2RI5_VVI<0x72878000, simm5>;
963 def VSLT_BU : LSX3R_VVV<0x70080000>;
964 def VSLT_HU : LSX3R_VVV<0x70088000>;
965 def VSLT_WU : LSX3R_VVV<0x70090000>;
966 def VSLT_DU : LSX3R_VVV<0x70098000>;
967 def VSLTI_BU : LSX2RI5_VVI<0x72880000>;
968 def VSLTI_HU : LSX2RI5_VVI<0x72888000>;
969 def VSLTI_WU : LSX2RI5_VVI<0x72890000>;
970 def VSLTI_DU : LSX2RI5_VVI<0x72898000>;
972 def VFCMP_CAF_S : LSX3R_VVV<0x0c500000>;
973 def VFCMP_SAF_S : LSX3R_VVV<0x0c508000>;
974 def VFCMP_CLT_S : LSX3R_VVV<0x0c510000>;
975 def VFCMP_SLT_S : LSX3R_VVV<0x0c518000>;
976 def VFCMP_CEQ_S : LSX3R_VVV<0x0c520000>;
977 def VFCMP_SEQ_S : LSX3R_VVV<0x0c528000>;
978 def VFCMP_CLE_S : LSX3R_VVV<0x0c530000>;
979 def VFCMP_SLE_S : LSX3R_VVV<0x0c538000>;
980 def VFCMP_CUN_S : LSX3R_VVV<0x0c540000>;
981 def VFCMP_SUN_S : LSX3R_VVV<0x0c548000>;
982 def VFCMP_CULT_S : LSX3R_VVV<0x0c550000>;
983 def VFCMP_SULT_S : LSX3R_VVV<0x0c558000>;
984 def VFCMP_CUEQ_S : LSX3R_VVV<0x0c560000>;
985 def VFCMP_SUEQ_S : LSX3R_VVV<0x0c568000>;
986 def VFCMP_CULE_S : LSX3R_VVV<0x0c570000>;
987 def VFCMP_SULE_S : LSX3R_VVV<0x0c578000>;
988 def VFCMP_CNE_S : LSX3R_VVV<0x0c580000>;
989 def VFCMP_SNE_S : LSX3R_VVV<0x0c588000>;
990 def VFCMP_COR_S : LSX3R_VVV<0x0c5a0000>;
991 def VFCMP_SOR_S : LSX3R_VVV<0x0c5a8000>;
992 def VFCMP_CUNE_S : LSX3R_VVV<0x0c5c0000>;
993 def VFCMP_SUNE_S : LSX3R_VVV<0x0c5c8000>;
995 def VFCMP_CAF_D : LSX3R_VVV<0x0c600000>;
996 def VFCMP_SAF_D : LSX3R_VVV<0x0c608000>;
997 def VFCMP_CLT_D : LSX3R_VVV<0x0c610000>;
998 def VFCMP_SLT_D : LSX3R_VVV<0x0c618000>;
999 def VFCMP_CEQ_D : LSX3R_VVV<0x0c620000>;
1000 def VFCMP_SEQ_D : LSX3R_VVV<0x0c628000>;
1001 def VFCMP_CLE_D : LSX3R_VVV<0x0c630000>;
1002 def VFCMP_SLE_D : LSX3R_VVV<0x0c638000>;
1003 def VFCMP_CUN_D : LSX3R_VVV<0x0c640000>;
1004 def VFCMP_SUN_D : LSX3R_VVV<0x0c648000>;
1005 def VFCMP_CULT_D : LSX3R_VVV<0x0c650000>;
1006 def VFCMP_SULT_D : LSX3R_VVV<0x0c658000>;
1007 def VFCMP_CUEQ_D : LSX3R_VVV<0x0c660000>;
1008 def VFCMP_SUEQ_D : LSX3R_VVV<0x0c668000>;
1009 def VFCMP_CULE_D : LSX3R_VVV<0x0c670000>;
1010 def VFCMP_SULE_D : LSX3R_VVV<0x0c678000>;
1011 def VFCMP_CNE_D : LSX3R_VVV<0x0c680000>;
1012 def VFCMP_SNE_D : LSX3R_VVV<0x0c688000>;
1013 def VFCMP_COR_D : LSX3R_VVV<0x0c6a0000>;
1014 def VFCMP_SOR_D : LSX3R_VVV<0x0c6a8000>;
1015 def VFCMP_CUNE_D : LSX3R_VVV<0x0c6c0000>;
1016 def VFCMP_SUNE_D : LSX3R_VVV<0x0c6c8000>;
1018 def VBITSEL_V : LSX4R_VVVV<0x0d100000>;
1020 def VBITSELI_B : LSX2RI8_VVVI<0x73c40000>;
1022 def VSETEQZ_V : LSX2R_CV<0x729c9800>;
1023 def VSETNEZ_V : LSX2R_CV<0x729c9c00>;
1024 def VSETANYEQZ_B : LSX2R_CV<0x729ca000>;
1025 def VSETANYEQZ_H : LSX2R_CV<0x729ca400>;
1026 def VSETANYEQZ_W : LSX2R_CV<0x729ca800>;
1027 def VSETANYEQZ_D : LSX2R_CV<0x729cac00>;
1028 def VSETALLNEZ_B : LSX2R_CV<0x729cb000>;
1029 def VSETALLNEZ_H : LSX2R_CV<0x729cb400>;
1030 def VSETALLNEZ_W : LSX2R_CV<0x729cb800>;
1031 def VSETALLNEZ_D : LSX2R_CV<0x729cbc00>;
1033 def VINSGR2VR_B : LSX2RI4_VVRI<0x72eb8000>;
1034 def VINSGR2VR_H : LSX2RI3_VVRI<0x72ebc000>;
1035 def VINSGR2VR_W : LSX2RI2_VVRI<0x72ebe000>;
1036 def VINSGR2VR_D : LSX2RI1_VVRI<0x72ebf000>;
1037 def VPICKVE2GR_B : LSX2RI4_RVI<0x72ef8000>;
1038 def VPICKVE2GR_H : LSX2RI3_RVI<0x72efc000>;
1039 def VPICKVE2GR_W : LSX2RI2_RVI<0x72efe000>;
1040 def VPICKVE2GR_D : LSX2RI1_RVI<0x72eff000>;
1041 def VPICKVE2GR_BU : LSX2RI4_RVI<0x72f38000>;
1042 def VPICKVE2GR_HU : LSX2RI3_RVI<0x72f3c000>;
1043 def VPICKVE2GR_WU : LSX2RI2_RVI<0x72f3e000>;
1044 def VPICKVE2GR_DU : LSX2RI1_RVI<0x72f3f000>;
1046 def VREPLGR2VR_B : LSX2R_VR<0x729f0000>;
1047 def VREPLGR2VR_H : LSX2R_VR<0x729f0400>;
1048 def VREPLGR2VR_W : LSX2R_VR<0x729f0800>;
1049 def VREPLGR2VR_D : LSX2R_VR<0x729f0c00>;
1051 def VREPLVE_B : LSX3R_VVR<0x71220000>;
1052 def VREPLVE_H : LSX3R_VVR<0x71228000>;
1053 def VREPLVE_W : LSX3R_VVR<0x71230000>;
1054 def VREPLVE_D : LSX3R_VVR<0x71238000>;
1055 def VREPLVEI_B : LSX2RI4_VVI<0x72f78000>;
1056 def VREPLVEI_H : LSX2RI3_VVI<0x72f7c000>;
1057 def VREPLVEI_W : LSX2RI2_VVI<0x72f7e000>;
1058 def VREPLVEI_D : LSX2RI1_VVI<0x72f7f000>;
1060 def VBSLL_V : LSX2RI5_VVI<0x728e0000>;
1061 def VBSRL_V : LSX2RI5_VVI<0x728e8000>;
1063 def VPACKEV_B : LSX3R_VVV<0x71160000>;
1064 def VPACKEV_H : LSX3R_VVV<0x71168000>;
1065 def VPACKEV_W : LSX3R_VVV<0x71170000>;
1066 def VPACKEV_D : LSX3R_VVV<0x71178000>;
1067 def VPACKOD_B : LSX3R_VVV<0x71180000>;
1068 def VPACKOD_H : LSX3R_VVV<0x71188000>;
1069 def VPACKOD_W : LSX3R_VVV<0x71190000>;
1070 def VPACKOD_D : LSX3R_VVV<0x71198000>;
1072 def VPICKEV_B : LSX3R_VVV<0x711e0000>;
1073 def VPICKEV_H : LSX3R_VVV<0x711e8000>;
1074 def VPICKEV_W : LSX3R_VVV<0x711f0000>;
1075 def VPICKEV_D : LSX3R_VVV<0x711f8000>;
1076 def VPICKOD_B : LSX3R_VVV<0x71200000>;
1077 def VPICKOD_H : LSX3R_VVV<0x71208000>;
1078 def VPICKOD_W : LSX3R_VVV<0x71210000>;
1079 def VPICKOD_D : LSX3R_VVV<0x71218000>;
1081 def VILVL_B : LSX3R_VVV<0x711a0000>;
1082 def VILVL_H : LSX3R_VVV<0x711a8000>;
1083 def VILVL_W : LSX3R_VVV<0x711b0000>;
1084 def VILVL_D : LSX3R_VVV<0x711b8000>;
1085 def VILVH_B : LSX3R_VVV<0x711c0000>;
1086 def VILVH_H : LSX3R_VVV<0x711c8000>;
1087 def VILVH_W : LSX3R_VVV<0x711d0000>;
1088 def VILVH_D : LSX3R_VVV<0x711d8000>;
1090 def VSHUF_B : LSX4R_VVVV<0x0d500000>;
1092 def VSHUF_H : LSX3R_VVVV<0x717a8000>;
1093 def VSHUF_W : LSX3R_VVVV<0x717b0000>;
1094 def VSHUF_D : LSX3R_VVVV<0x717b8000>;
1096 def VSHUF4I_B : LSX2RI8_VVI<0x73900000>;
1097 def VSHUF4I_H : LSX2RI8_VVI<0x73940000>;
1098 def VSHUF4I_W : LSX2RI8_VVI<0x73980000>;
1099 def VSHUF4I_D : LSX2RI8_VVVI<0x739c0000>;
1101 def VPERMI_W : LSX2RI8_VVVI<0x73e40000>;
1103 def VEXTRINS_D : LSX2RI8_VVVI<0x73800000>;
1104 def VEXTRINS_W : LSX2RI8_VVVI<0x73840000>;
1105 def VEXTRINS_H : LSX2RI8_VVVI<0x73880000>;
1106 def VEXTRINS_B : LSX2RI8_VVVI<0x738c0000>;
1107 } // mayLoad = 0, mayStore = 0
1109 let mayLoad = 1, mayStore = 0 in {
1110 def VLD : LSX2RI12_Load<0x2c000000>;
1111 def VLDX : LSX3R_Load<0x38400000>;
1113 def VLDREPL_B : LSX2RI12_Load<0x30800000>;
1114 def VLDREPL_H : LSX2RI11_Load<0x30400000>;
1115 def VLDREPL_W : LSX2RI10_Load<0x30200000>;
1116 def VLDREPL_D : LSX2RI9_Load<0x30100000>;
1117 } // mayLoad = 1, mayStore = 0
1119 let mayLoad = 0, mayStore = 1 in {
1120 def VST : LSX2RI12_Store<0x2c400000>;
1121 def VSTX : LSX3R_Store<0x38440000>;
1123 def VSTELM_B : LSX2RI8I4_VRII<0x31800000>;
1124 def VSTELM_H : LSX2RI8I3_VRII<0x31400000, simm8_lsl1>;
1125 def VSTELM_W : LSX2RI8I2_VRII<0x31200000, simm8_lsl2>;
1126 def VSTELM_D : LSX2RI8I1_VRII<0x31100000, simm8_lsl3>;
1127 } // mayLoad = 0, mayStore = 1
1129 } // hasSideEffects = 0, Predicates = [HasExtLSX]
1131 /// Pseudo-instructions
1133 let Predicates = [HasExtLSX] in {
1135 let hasSideEffects = 0, mayLoad = 0, mayStore = 0, isCodeGenOnly = 0,
1136 isAsmParserOnly = 1 in {
1137 def PseudoVREPLI_B : Pseudo<(outs LSX128:$vd), (ins simm10:$imm), [],
1138 "vrepli.b", "$vd, $imm">;
1139 def PseudoVREPLI_H : Pseudo<(outs LSX128:$vd), (ins simm10:$imm), [],
1140 "vrepli.h", "$vd, $imm">;
1141 def PseudoVREPLI_W : Pseudo<(outs LSX128:$vd), (ins simm10:$imm), [],
1142 "vrepli.w", "$vd, $imm">;
1143 def PseudoVREPLI_D : Pseudo<(outs LSX128:$vd), (ins simm10:$imm), [],
1144 "vrepli.d", "$vd, $imm">;
1147 def PseudoVBNZ_B : VecCond<loongarch_vall_nonzero, v16i8>;
1148 def PseudoVBNZ_H : VecCond<loongarch_vall_nonzero, v8i16>;
1149 def PseudoVBNZ_W : VecCond<loongarch_vall_nonzero, v4i32>;
1150 def PseudoVBNZ_D : VecCond<loongarch_vall_nonzero, v2i64>;
1151 def PseudoVBNZ : VecCond<loongarch_vany_nonzero, v16i8>;
1153 def PseudoVBZ_B : VecCond<loongarch_vall_zero, v16i8>;
1154 def PseudoVBZ_H : VecCond<loongarch_vall_zero, v8i16>;
1155 def PseudoVBZ_W : VecCond<loongarch_vall_zero, v4i32>;
1156 def PseudoVBZ_D : VecCond<loongarch_vall_zero, v2i64>;
1157 def PseudoVBZ : VecCond<loongarch_vany_zero, v16i8>;
1159 } // Predicates = [HasExtLSX]
1161 multiclass PatVr<SDPatternOperator OpNode, string Inst> {
1162 def : Pat<(v16i8 (OpNode (v16i8 LSX128:$vj))),
1163 (!cast<LAInst>(Inst#"_B") LSX128:$vj)>;
1164 def : Pat<(v8i16 (OpNode (v8i16 LSX128:$vj))),
1165 (!cast<LAInst>(Inst#"_H") LSX128:$vj)>;
1166 def : Pat<(v4i32 (OpNode (v4i32 LSX128:$vj))),
1167 (!cast<LAInst>(Inst#"_W") LSX128:$vj)>;
1168 def : Pat<(v2i64 (OpNode (v2i64 LSX128:$vj))),
1169 (!cast<LAInst>(Inst#"_D") LSX128:$vj)>;
1172 multiclass PatVrVr<SDPatternOperator OpNode, string Inst> {
1173 def : Pat<(OpNode (v16i8 LSX128:$vj), (v16i8 LSX128:$vk)),
1174 (!cast<LAInst>(Inst#"_B") LSX128:$vj, LSX128:$vk)>;
1175 def : Pat<(OpNode (v8i16 LSX128:$vj), (v8i16 LSX128:$vk)),
1176 (!cast<LAInst>(Inst#"_H") LSX128:$vj, LSX128:$vk)>;
1177 def : Pat<(OpNode (v4i32 LSX128:$vj), (v4i32 LSX128:$vk)),
1178 (!cast<LAInst>(Inst#"_W") LSX128:$vj, LSX128:$vk)>;
1179 def : Pat<(OpNode (v2i64 LSX128:$vj), (v2i64 LSX128:$vk)),
1180 (!cast<LAInst>(Inst#"_D") LSX128:$vj, LSX128:$vk)>;
1183 multiclass PatVrVrF<SDPatternOperator OpNode, string Inst> {
1184 def : Pat<(OpNode (v4f32 LSX128:$vj), (v4f32 LSX128:$vk)),
1185 (!cast<LAInst>(Inst#"_S") LSX128:$vj, LSX128:$vk)>;
1186 def : Pat<(OpNode (v2f64 LSX128:$vj), (v2f64 LSX128:$vk)),
1187 (!cast<LAInst>(Inst#"_D") LSX128:$vj, LSX128:$vk)>;
1190 multiclass PatVrVrU<SDPatternOperator OpNode, string Inst> {
1191 def : Pat<(OpNode (v16i8 LSX128:$vj), (v16i8 LSX128:$vk)),
1192 (!cast<LAInst>(Inst#"_BU") LSX128:$vj, LSX128:$vk)>;
1193 def : Pat<(OpNode (v8i16 LSX128:$vj), (v8i16 LSX128:$vk)),
1194 (!cast<LAInst>(Inst#"_HU") LSX128:$vj, LSX128:$vk)>;
1195 def : Pat<(OpNode (v4i32 LSX128:$vj), (v4i32 LSX128:$vk)),
1196 (!cast<LAInst>(Inst#"_WU") LSX128:$vj, LSX128:$vk)>;
1197 def : Pat<(OpNode (v2i64 LSX128:$vj), (v2i64 LSX128:$vk)),
1198 (!cast<LAInst>(Inst#"_DU") LSX128:$vj, LSX128:$vk)>;
1201 multiclass PatVrSimm5<SDPatternOperator OpNode, string Inst> {
1202 def : Pat<(OpNode (v16i8 LSX128:$vj), (v16i8 (SplatPat_simm5 simm5:$imm))),
1203 (!cast<LAInst>(Inst#"_B") LSX128:$vj, simm5:$imm)>;
1204 def : Pat<(OpNode (v8i16 LSX128:$vj), (v8i16 (SplatPat_simm5 simm5:$imm))),
1205 (!cast<LAInst>(Inst#"_H") LSX128:$vj, simm5:$imm)>;
1206 def : Pat<(OpNode (v4i32 LSX128:$vj), (v4i32 (SplatPat_simm5 simm5:$imm))),
1207 (!cast<LAInst>(Inst#"_W") LSX128:$vj, simm5:$imm)>;
1208 def : Pat<(OpNode (v2i64 LSX128:$vj), (v2i64 (SplatPat_simm5 simm5:$imm))),
1209 (!cast<LAInst>(Inst#"_D") LSX128:$vj, simm5:$imm)>;
1212 multiclass PatVrUimm5<SDPatternOperator OpNode, string Inst> {
1213 def : Pat<(OpNode (v16i8 LSX128:$vj), (v16i8 (SplatPat_uimm5 uimm5:$imm))),
1214 (!cast<LAInst>(Inst#"_BU") LSX128:$vj, uimm5:$imm)>;
1215 def : Pat<(OpNode (v8i16 LSX128:$vj), (v8i16 (SplatPat_uimm5 uimm5:$imm))),
1216 (!cast<LAInst>(Inst#"_HU") LSX128:$vj, uimm5:$imm)>;
1217 def : Pat<(OpNode (v4i32 LSX128:$vj), (v4i32 (SplatPat_uimm5 uimm5:$imm))),
1218 (!cast<LAInst>(Inst#"_WU") LSX128:$vj, uimm5:$imm)>;
1219 def : Pat<(OpNode (v2i64 LSX128:$vj), (v2i64 (SplatPat_uimm5 uimm5:$imm))),
1220 (!cast<LAInst>(Inst#"_DU") LSX128:$vj, uimm5:$imm)>;
1223 multiclass PatVrVrVr<SDPatternOperator OpNode, string Inst> {
1224 def : Pat<(OpNode (v16i8 LSX128:$vd), (v16i8 LSX128:$vj), (v16i8 LSX128:$vk)),
1225 (!cast<LAInst>(Inst#"_B") LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1226 def : Pat<(OpNode (v8i16 LSX128:$vd), (v8i16 LSX128:$vj), (v8i16 LSX128:$vk)),
1227 (!cast<LAInst>(Inst#"_H") LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1228 def : Pat<(OpNode (v4i32 LSX128:$vd), (v4i32 LSX128:$vj), (v4i32 LSX128:$vk)),
1229 (!cast<LAInst>(Inst#"_W") LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1230 def : Pat<(OpNode (v2i64 LSX128:$vd), (v2i64 LSX128:$vj), (v2i64 LSX128:$vk)),
1231 (!cast<LAInst>(Inst#"_D") LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1234 multiclass PatShiftVrVr<SDPatternOperator OpNode, string Inst> {
1235 def : Pat<(OpNode (v16i8 LSX128:$vj), (and vsplati8_imm_eq_7,
1236 (v16i8 LSX128:$vk))),
1237 (!cast<LAInst>(Inst#"_B") LSX128:$vj, LSX128:$vk)>;
1238 def : Pat<(OpNode (v8i16 LSX128:$vj), (and vsplati16_imm_eq_15,
1239 (v8i16 LSX128:$vk))),
1240 (!cast<LAInst>(Inst#"_H") LSX128:$vj, LSX128:$vk)>;
1241 def : Pat<(OpNode (v4i32 LSX128:$vj), (and vsplati32_imm_eq_31,
1242 (v4i32 LSX128:$vk))),
1243 (!cast<LAInst>(Inst#"_W") LSX128:$vj, LSX128:$vk)>;
1244 def : Pat<(OpNode (v2i64 LSX128:$vj), (and vsplati64_imm_eq_63,
1245 (v2i64 LSX128:$vk))),
1246 (!cast<LAInst>(Inst#"_D") LSX128:$vj, LSX128:$vk)>;
1249 multiclass PatShiftVrUimm<SDPatternOperator OpNode, string Inst> {
1250 def : Pat<(OpNode (v16i8 LSX128:$vj), (v16i8 (SplatPat_uimm3 uimm3:$imm))),
1251 (!cast<LAInst>(Inst#"_B") LSX128:$vj, uimm3:$imm)>;
1252 def : Pat<(OpNode (v8i16 LSX128:$vj), (v8i16 (SplatPat_uimm4 uimm4:$imm))),
1253 (!cast<LAInst>(Inst#"_H") LSX128:$vj, uimm4:$imm)>;
1254 def : Pat<(OpNode (v4i32 LSX128:$vj), (v4i32 (SplatPat_uimm5 uimm5:$imm))),
1255 (!cast<LAInst>(Inst#"_W") LSX128:$vj, uimm5:$imm)>;
1256 def : Pat<(OpNode (v2i64 LSX128:$vj), (v2i64 (SplatPat_uimm6 uimm6:$imm))),
1257 (!cast<LAInst>(Inst#"_D") LSX128:$vj, uimm6:$imm)>;
1260 class PatVrVrB<SDPatternOperator OpNode, LAInst Inst>
1261 : Pat<(OpNode (v16i8 LSX128:$vj), (v16i8 LSX128:$vk)),
1262 (Inst LSX128:$vj, LSX128:$vk)>;
1264 let Predicates = [HasExtLSX] in {
1267 defm : PatVrVr<add, "VADD">;
1269 defm : PatVrVr<sub, "VSUB">;
1272 defm : PatVrUimm5<add, "VADDI">;
1274 defm : PatVrUimm5<sub, "VSUBI">;
1277 def : Pat<(sub immAllZerosV, (v16i8 LSX128:$vj)), (VNEG_B LSX128:$vj)>;
1278 def : Pat<(sub immAllZerosV, (v8i16 LSX128:$vj)), (VNEG_H LSX128:$vj)>;
1279 def : Pat<(sub immAllZerosV, (v4i32 LSX128:$vj)), (VNEG_W LSX128:$vj)>;
1280 def : Pat<(sub immAllZerosV, (v2i64 LSX128:$vj)), (VNEG_D LSX128:$vj)>;
1282 // VMAX[I]_{B/H/W/D}[U]
1283 defm : PatVrVr<smax, "VMAX">;
1284 defm : PatVrVrU<umax, "VMAX">;
1285 defm : PatVrSimm5<smax, "VMAXI">;
1286 defm : PatVrUimm5<umax, "VMAXI">;
1288 // VMIN[I]_{B/H/W/D}[U]
1289 defm : PatVrVr<smin, "VMIN">;
1290 defm : PatVrVrU<umin, "VMIN">;
1291 defm : PatVrSimm5<smin, "VMINI">;
1292 defm : PatVrUimm5<umin, "VMINI">;
1295 defm : PatVrVr<mul, "VMUL">;
1298 defm : PatVrVrVr<muladd, "VMADD">;
1300 defm : PatVrVrVr<mulsub, "VMSUB">;
1302 // VDIV_{B/H/W/D}[U]
1303 defm : PatVrVr<sdiv, "VDIV">;
1304 defm : PatVrVrU<udiv, "VDIV">;
1306 // VMOD_{B/H/W/D}[U]
1307 defm : PatVrVr<srem, "VMOD">;
1308 defm : PatVrVrU<urem, "VMOD">;
1311 def : PatVrVrB<and, VAND_V>;
1313 def : PatVrVrB<or, VOR_V>;
1315 def : PatVrVrB<xor, VXOR_V>;
1317 def : Pat<(vnot (or (v16i8 LSX128:$vj), (v16i8 LSX128:$vk))),
1318 (VNOR_V LSX128:$vj, LSX128:$vk)>;
1321 def : Pat<(and (v16i8 LSX128:$vj), (v16i8 (SplatPat_uimm8 uimm8:$imm))),
1322 (VANDI_B LSX128:$vj, uimm8:$imm)>;
1324 def : Pat<(or (v16i8 LSX128:$vj), (v16i8 (SplatPat_uimm8 uimm8:$imm))),
1325 (VORI_B LSX128:$vj, uimm8:$imm)>;
1328 def : Pat<(xor (v16i8 LSX128:$vj), (v16i8 (SplatPat_uimm8 uimm8:$imm))),
1329 (VXORI_B LSX128:$vj, uimm8:$imm)>;
1331 // VSLL[I]_{B/H/W/D}
1332 defm : PatVrVr<shl, "VSLL">;
1333 defm : PatShiftVrVr<shl, "VSLL">;
1334 defm : PatShiftVrUimm<shl, "VSLLI">;
1336 // VSRL[I]_{B/H/W/D}
1337 defm : PatVrVr<srl, "VSRL">;
1338 defm : PatShiftVrVr<srl, "VSRL">;
1339 defm : PatShiftVrUimm<srl, "VSRLI">;
1341 // VSRA[I]_{B/H/W/D}
1342 defm : PatVrVr<sra, "VSRA">;
1343 defm : PatShiftVrVr<sra, "VSRA">;
1344 defm : PatShiftVrUimm<sra, "VSRAI">;
1347 defm : PatVr<ctpop, "VPCNT">;
1349 // VBITCLR_{B/H/W/D}
1350 def : Pat<(and v16i8:$vj, (vnot (shl vsplat_imm_eq_1, v16i8:$vk))),
1351 (v16i8 (VBITCLR_B v16i8:$vj, v16i8:$vk))>;
1352 def : Pat<(and v8i16:$vj, (vnot (shl vsplat_imm_eq_1, v8i16:$vk))),
1353 (v8i16 (VBITCLR_H v8i16:$vj, v8i16:$vk))>;
1354 def : Pat<(and v4i32:$vj, (vnot (shl vsplat_imm_eq_1, v4i32:$vk))),
1355 (v4i32 (VBITCLR_W v4i32:$vj, v4i32:$vk))>;
1356 def : Pat<(and v2i64:$vj, (vnot (shl vsplat_imm_eq_1, v2i64:$vk))),
1357 (v2i64 (VBITCLR_D v2i64:$vj, v2i64:$vk))>;
1358 def : Pat<(and v16i8:$vj, (vnot (shl vsplat_imm_eq_1,
1359 (vsplati8imm7 v16i8:$vk)))),
1360 (v16i8 (VBITCLR_B v16i8:$vj, v16i8:$vk))>;
1361 def : Pat<(and v8i16:$vj, (vnot (shl vsplat_imm_eq_1,
1362 (vsplati16imm15 v8i16:$vk)))),
1363 (v8i16 (VBITCLR_H v8i16:$vj, v8i16:$vk))>;
1364 def : Pat<(and v4i32:$vj, (vnot (shl vsplat_imm_eq_1,
1365 (vsplati32imm31 v4i32:$vk)))),
1366 (v4i32 (VBITCLR_W v4i32:$vj, v4i32:$vk))>;
1367 def : Pat<(and v2i64:$vj, (vnot (shl vsplat_imm_eq_1,
1368 (vsplati64imm63 v2i64:$vk)))),
1369 (v2i64 (VBITCLR_D v2i64:$vj, v2i64:$vk))>;
1371 // VBITCLRI_{B/H/W/D}
1372 def : Pat<(and (v16i8 LSX128:$vj), (v16i8 (vsplat_uimm_inv_pow2 uimm3:$imm))),
1373 (VBITCLRI_B LSX128:$vj, uimm3:$imm)>;
1374 def : Pat<(and (v8i16 LSX128:$vj), (v8i16 (vsplat_uimm_inv_pow2 uimm4:$imm))),
1375 (VBITCLRI_H LSX128:$vj, uimm4:$imm)>;
1376 def : Pat<(and (v4i32 LSX128:$vj), (v4i32 (vsplat_uimm_inv_pow2 uimm5:$imm))),
1377 (VBITCLRI_W LSX128:$vj, uimm5:$imm)>;
1378 def : Pat<(and (v2i64 LSX128:$vj), (v2i64 (vsplat_uimm_inv_pow2 uimm6:$imm))),
1379 (VBITCLRI_D LSX128:$vj, uimm6:$imm)>;
1381 // VBITSET_{B/H/W/D}
1382 def : Pat<(or v16i8:$vj, (shl vsplat_imm_eq_1, v16i8:$vk)),
1383 (v16i8 (VBITSET_B v16i8:$vj, v16i8:$vk))>;
1384 def : Pat<(or v8i16:$vj, (shl vsplat_imm_eq_1, v8i16:$vk)),
1385 (v8i16 (VBITSET_H v8i16:$vj, v8i16:$vk))>;
1386 def : Pat<(or v4i32:$vj, (shl vsplat_imm_eq_1, v4i32:$vk)),
1387 (v4i32 (VBITSET_W v4i32:$vj, v4i32:$vk))>;
1388 def : Pat<(or v2i64:$vj, (shl vsplat_imm_eq_1, v2i64:$vk)),
1389 (v2i64 (VBITSET_D v2i64:$vj, v2i64:$vk))>;
1390 def : Pat<(or v16i8:$vj, (shl vsplat_imm_eq_1, (vsplati8imm7 v16i8:$vk))),
1391 (v16i8 (VBITSET_B v16i8:$vj, v16i8:$vk))>;
1392 def : Pat<(or v8i16:$vj, (shl vsplat_imm_eq_1, (vsplati16imm15 v8i16:$vk))),
1393 (v8i16 (VBITSET_H v8i16:$vj, v8i16:$vk))>;
1394 def : Pat<(or v4i32:$vj, (shl vsplat_imm_eq_1, (vsplati32imm31 v4i32:$vk))),
1395 (v4i32 (VBITSET_W v4i32:$vj, v4i32:$vk))>;
1396 def : Pat<(or v2i64:$vj, (shl vsplat_imm_eq_1, (vsplati64imm63 v2i64:$vk))),
1397 (v2i64 (VBITSET_D v2i64:$vj, v2i64:$vk))>;
1399 // VBITSETI_{B/H/W/D}
1400 def : Pat<(or (v16i8 LSX128:$vj), (v16i8 (vsplat_uimm_pow2 uimm3:$imm))),
1401 (VBITSETI_B LSX128:$vj, uimm3:$imm)>;
1402 def : Pat<(or (v8i16 LSX128:$vj), (v8i16 (vsplat_uimm_pow2 uimm4:$imm))),
1403 (VBITSETI_H LSX128:$vj, uimm4:$imm)>;
1404 def : Pat<(or (v4i32 LSX128:$vj), (v4i32 (vsplat_uimm_pow2 uimm5:$imm))),
1405 (VBITSETI_W LSX128:$vj, uimm5:$imm)>;
1406 def : Pat<(or (v2i64 LSX128:$vj), (v2i64 (vsplat_uimm_pow2 uimm6:$imm))),
1407 (VBITSETI_D LSX128:$vj, uimm6:$imm)>;
1409 // VBITREV_{B/H/W/D}
1410 def : Pat<(xor v16i8:$vj, (shl vsplat_imm_eq_1, v16i8:$vk)),
1411 (v16i8 (VBITREV_B v16i8:$vj, v16i8:$vk))>;
1412 def : Pat<(xor v8i16:$vj, (shl vsplat_imm_eq_1, v8i16:$vk)),
1413 (v8i16 (VBITREV_H v8i16:$vj, v8i16:$vk))>;
1414 def : Pat<(xor v4i32:$vj, (shl vsplat_imm_eq_1, v4i32:$vk)),
1415 (v4i32 (VBITREV_W v4i32:$vj, v4i32:$vk))>;
1416 def : Pat<(xor v2i64:$vj, (shl vsplat_imm_eq_1, v2i64:$vk)),
1417 (v2i64 (VBITREV_D v2i64:$vj, v2i64:$vk))>;
1418 def : Pat<(xor v16i8:$vj, (shl vsplat_imm_eq_1, (vsplati8imm7 v16i8:$vk))),
1419 (v16i8 (VBITREV_B v16i8:$vj, v16i8:$vk))>;
1420 def : Pat<(xor v8i16:$vj, (shl vsplat_imm_eq_1, (vsplati16imm15 v8i16:$vk))),
1421 (v8i16 (VBITREV_H v8i16:$vj, v8i16:$vk))>;
1422 def : Pat<(xor v4i32:$vj, (shl vsplat_imm_eq_1, (vsplati32imm31 v4i32:$vk))),
1423 (v4i32 (VBITREV_W v4i32:$vj, v4i32:$vk))>;
1424 def : Pat<(xor v2i64:$vj, (shl vsplat_imm_eq_1, (vsplati64imm63 v2i64:$vk))),
1425 (v2i64 (VBITREV_D v2i64:$vj, v2i64:$vk))>;
1427 // VBITREVI_{B/H/W/D}
1428 def : Pat<(xor (v16i8 LSX128:$vj), (v16i8 (vsplat_uimm_pow2 uimm3:$imm))),
1429 (VBITREVI_B LSX128:$vj, uimm3:$imm)>;
1430 def : Pat<(xor (v8i16 LSX128:$vj), (v8i16 (vsplat_uimm_pow2 uimm4:$imm))),
1431 (VBITREVI_H LSX128:$vj, uimm4:$imm)>;
1432 def : Pat<(xor (v4i32 LSX128:$vj), (v4i32 (vsplat_uimm_pow2 uimm5:$imm))),
1433 (VBITREVI_W LSX128:$vj, uimm5:$imm)>;
1434 def : Pat<(xor (v2i64 LSX128:$vj), (v2i64 (vsplat_uimm_pow2 uimm6:$imm))),
1435 (VBITREVI_D LSX128:$vj, uimm6:$imm)>;
1438 defm : PatVrVrF<fadd, "VFADD">;
1441 defm : PatVrVrF<fsub, "VFSUB">;
1444 defm : PatVrVrF<fmul, "VFMUL">;
1447 defm : PatVrVrF<fdiv, "VFDIV">;
1450 def : Pat<(fma v4f32:$vj, v4f32:$vk, v4f32:$va),
1451 (VFMADD_S v4f32:$vj, v4f32:$vk, v4f32:$va)>;
1452 def : Pat<(fma v2f64:$vj, v2f64:$vk, v2f64:$va),
1453 (VFMADD_D v2f64:$vj, v2f64:$vk, v2f64:$va)>;
1455 // VINSGR2VR_{B/H/W/D}
1456 def : Pat<(vector_insert v16i8:$vd, GRLenVT:$rj, uimm4:$imm),
1457 (VINSGR2VR_B v16i8:$vd, GRLenVT:$rj, uimm4:$imm)>;
1458 def : Pat<(vector_insert v8i16:$vd, GRLenVT:$rj, uimm3:$imm),
1459 (VINSGR2VR_H v8i16:$vd, GRLenVT:$rj, uimm3:$imm)>;
1460 def : Pat<(vector_insert v4i32:$vd, GRLenVT:$rj, uimm2:$imm),
1461 (VINSGR2VR_W v4i32:$vd, GRLenVT:$rj, uimm2:$imm)>;
1462 def : Pat<(vector_insert v2i64:$vd, GRLenVT:$rj, uimm1:$imm),
1463 (VINSGR2VR_D v2i64:$vd, GRLenVT:$rj, uimm1:$imm)>;
1465 // VPICKVE2GR_{B/H/W}[U]
1466 def : Pat<(loongarch_vpick_sext_elt v16i8:$vd, uimm4:$imm, i8),
1467 (VPICKVE2GR_B v16i8:$vd, uimm4:$imm)>;
1468 def : Pat<(loongarch_vpick_sext_elt v8i16:$vd, uimm3:$imm, i16),
1469 (VPICKVE2GR_H v8i16:$vd, uimm3:$imm)>;
1470 def : Pat<(loongarch_vpick_sext_elt v4i32:$vd, uimm2:$imm, i32),
1471 (VPICKVE2GR_W v4i32:$vd, uimm2:$imm)>;
1473 def : Pat<(loongarch_vpick_zext_elt v16i8:$vd, uimm4:$imm, i8),
1474 (VPICKVE2GR_BU v16i8:$vd, uimm4:$imm)>;
1475 def : Pat<(loongarch_vpick_zext_elt v8i16:$vd, uimm3:$imm, i16),
1476 (VPICKVE2GR_HU v8i16:$vd, uimm3:$imm)>;
1477 def : Pat<(loongarch_vpick_zext_elt v4i32:$vd, uimm2:$imm, i32),
1478 (VPICKVE2GR_WU v4i32:$vd, uimm2:$imm)>;
1480 // VREPLGR2VR_{B/H/W/D}
1481 def : Pat<(lsxsplati8 GPR:$rj), (VREPLGR2VR_B GPR:$rj)>;
1482 def : Pat<(lsxsplati16 GPR:$rj), (VREPLGR2VR_H GPR:$rj)>;
1483 def : Pat<(lsxsplati32 GPR:$rj), (VREPLGR2VR_W GPR:$rj)>;
1484 def : Pat<(lsxsplati64 GPR:$rj), (VREPLGR2VR_D GPR:$rj)>;
1486 // VREPLVE_{B/H/W/D}
1487 def : Pat<(loongarch_vreplve v16i8:$vj, GRLenVT:$rk),
1488 (VREPLVE_B v16i8:$vj, GRLenVT:$rk)>;
1489 def : Pat<(loongarch_vreplve v8i16:$vj, GRLenVT:$rk),
1490 (VREPLVE_H v8i16:$vj, GRLenVT:$rk)>;
1491 def : Pat<(loongarch_vreplve v4i32:$vj, GRLenVT:$rk),
1492 (VREPLVE_W v4i32:$vj, GRLenVT:$rk)>;
1493 def : Pat<(loongarch_vreplve v2i64:$vj, GRLenVT:$rk),
1494 (VREPLVE_D v2i64:$vj, GRLenVT:$rk)>;
1497 foreach vt = [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64] in {
1498 defm : LdPat<load, VLD, vt>;
1499 def : RegRegLdPat<load, VLDX, vt>;
1500 defm : StPat<store, VST, LSX128, vt>;
1501 def : RegRegStPat<store, VSTX, LSX128, vt>;
1504 } // Predicates = [HasExtLSX]
1506 /// Intrinsic pattern
1508 class deriveLSXIntrinsic<string Inst> {
1509 Intrinsic ret = !cast<Intrinsic>(!tolower("int_loongarch_lsx_"#Inst));
1512 let Predicates = [HasExtLSX] in {
1514 // vty: v16i8/v8i16/v4i32/v2i64
1515 // Pat<(Intrinsic vty:$vj, vty:$vk),
1516 // (LAInst vty:$vj, vty:$vk)>;
1517 foreach Inst = ["VSADD_B", "VSADD_BU", "VSSUB_B", "VSSUB_BU",
1518 "VHADDW_H_B", "VHADDW_HU_BU", "VHSUBW_H_B", "VHSUBW_HU_BU",
1519 "VADDWEV_H_B", "VADDWOD_H_B", "VSUBWEV_H_B", "VSUBWOD_H_B",
1520 "VADDWEV_H_BU", "VADDWOD_H_BU", "VSUBWEV_H_BU", "VSUBWOD_H_BU",
1521 "VADDWEV_H_BU_B", "VADDWOD_H_BU_B",
1522 "VAVG_B", "VAVG_BU", "VAVGR_B", "VAVGR_BU",
1523 "VABSD_B", "VABSD_BU", "VADDA_B", "VMUH_B", "VMUH_BU",
1524 "VMULWEV_H_B", "VMULWOD_H_B", "VMULWEV_H_BU", "VMULWOD_H_BU",
1525 "VMULWEV_H_BU_B", "VMULWOD_H_BU_B", "VSIGNCOV_B",
1526 "VANDN_V", "VORN_V", "VROTR_B", "VSRLR_B", "VSRAR_B",
1527 "VSEQ_B", "VSLE_B", "VSLE_BU", "VSLT_B", "VSLT_BU",
1528 "VPACKEV_B", "VPACKOD_B", "VPICKEV_B", "VPICKOD_B",
1529 "VILVL_B", "VILVH_B"] in
1530 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1531 (v16i8 LSX128:$vj), (v16i8 LSX128:$vk)),
1532 (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk)>;
1533 foreach Inst = ["VSADD_H", "VSADD_HU", "VSSUB_H", "VSSUB_HU",
1534 "VHADDW_W_H", "VHADDW_WU_HU", "VHSUBW_W_H", "VHSUBW_WU_HU",
1535 "VADDWEV_W_H", "VADDWOD_W_H", "VSUBWEV_W_H", "VSUBWOD_W_H",
1536 "VADDWEV_W_HU", "VADDWOD_W_HU", "VSUBWEV_W_HU", "VSUBWOD_W_HU",
1537 "VADDWEV_W_HU_H", "VADDWOD_W_HU_H",
1538 "VAVG_H", "VAVG_HU", "VAVGR_H", "VAVGR_HU",
1539 "VABSD_H", "VABSD_HU", "VADDA_H", "VMUH_H", "VMUH_HU",
1540 "VMULWEV_W_H", "VMULWOD_W_H", "VMULWEV_W_HU", "VMULWOD_W_HU",
1541 "VMULWEV_W_HU_H", "VMULWOD_W_HU_H", "VSIGNCOV_H", "VROTR_H",
1542 "VSRLR_H", "VSRAR_H", "VSRLN_B_H", "VSRAN_B_H", "VSRLRN_B_H",
1543 "VSRARN_B_H", "VSSRLN_B_H", "VSSRAN_B_H", "VSSRLN_BU_H",
1544 "VSSRAN_BU_H", "VSSRLRN_B_H", "VSSRARN_B_H", "VSSRLRN_BU_H",
1546 "VSEQ_H", "VSLE_H", "VSLE_HU", "VSLT_H", "VSLT_HU",
1547 "VPACKEV_H", "VPACKOD_H", "VPICKEV_H", "VPICKOD_H",
1548 "VILVL_H", "VILVH_H"] in
1549 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1550 (v8i16 LSX128:$vj), (v8i16 LSX128:$vk)),
1551 (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk)>;
1552 foreach Inst = ["VSADD_W", "VSADD_WU", "VSSUB_W", "VSSUB_WU",
1553 "VHADDW_D_W", "VHADDW_DU_WU", "VHSUBW_D_W", "VHSUBW_DU_WU",
1554 "VADDWEV_D_W", "VADDWOD_D_W", "VSUBWEV_D_W", "VSUBWOD_D_W",
1555 "VADDWEV_D_WU", "VADDWOD_D_WU", "VSUBWEV_D_WU", "VSUBWOD_D_WU",
1556 "VADDWEV_D_WU_W", "VADDWOD_D_WU_W",
1557 "VAVG_W", "VAVG_WU", "VAVGR_W", "VAVGR_WU",
1558 "VABSD_W", "VABSD_WU", "VADDA_W", "VMUH_W", "VMUH_WU",
1559 "VMULWEV_D_W", "VMULWOD_D_W", "VMULWEV_D_WU", "VMULWOD_D_WU",
1560 "VMULWEV_D_WU_W", "VMULWOD_D_WU_W", "VSIGNCOV_W", "VROTR_W",
1561 "VSRLR_W", "VSRAR_W", "VSRLN_H_W", "VSRAN_H_W", "VSRLRN_H_W",
1562 "VSRARN_H_W", "VSSRLN_H_W", "VSSRAN_H_W", "VSSRLN_HU_W",
1563 "VSSRAN_HU_W", "VSSRLRN_H_W", "VSSRARN_H_W", "VSSRLRN_HU_W",
1565 "VSEQ_W", "VSLE_W", "VSLE_WU", "VSLT_W", "VSLT_WU",
1566 "VPACKEV_W", "VPACKOD_W", "VPICKEV_W", "VPICKOD_W",
1567 "VILVL_W", "VILVH_W"] in
1568 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1569 (v4i32 LSX128:$vj), (v4i32 LSX128:$vk)),
1570 (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk)>;
1571 foreach Inst = ["VADD_Q", "VSUB_Q",
1572 "VSADD_D", "VSADD_DU", "VSSUB_D", "VSSUB_DU",
1573 "VHADDW_Q_D", "VHADDW_QU_DU", "VHSUBW_Q_D", "VHSUBW_QU_DU",
1574 "VADDWEV_Q_D", "VADDWOD_Q_D", "VSUBWEV_Q_D", "VSUBWOD_Q_D",
1575 "VADDWEV_Q_DU", "VADDWOD_Q_DU", "VSUBWEV_Q_DU", "VSUBWOD_Q_DU",
1576 "VADDWEV_Q_DU_D", "VADDWOD_Q_DU_D",
1577 "VAVG_D", "VAVG_DU", "VAVGR_D", "VAVGR_DU",
1578 "VABSD_D", "VABSD_DU", "VADDA_D", "VMUH_D", "VMUH_DU",
1579 "VMULWEV_Q_D", "VMULWOD_Q_D", "VMULWEV_Q_DU", "VMULWOD_Q_DU",
1580 "VMULWEV_Q_DU_D", "VMULWOD_Q_DU_D", "VSIGNCOV_D", "VROTR_D",
1581 "VSRLR_D", "VSRAR_D", "VSRLN_W_D", "VSRAN_W_D", "VSRLRN_W_D",
1582 "VSRARN_W_D", "VSSRLN_W_D", "VSSRAN_W_D", "VSSRLN_WU_D",
1583 "VSSRAN_WU_D", "VSSRLRN_W_D", "VSSRARN_W_D", "VSSRLRN_WU_D",
1584 "VSSRARN_WU_D", "VFFINT_S_L",
1585 "VSEQ_D", "VSLE_D", "VSLE_DU", "VSLT_D", "VSLT_DU",
1586 "VPACKEV_D", "VPACKOD_D", "VPICKEV_D", "VPICKOD_D",
1587 "VILVL_D", "VILVH_D"] in
1588 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1589 (v2i64 LSX128:$vj), (v2i64 LSX128:$vk)),
1590 (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk)>;
1592 // vty: v16i8/v8i16/v4i32/v2i64
1593 // Pat<(Intrinsic vty:$vd, vty:$vj, vty:$vk),
1594 // (LAInst vty:$vd, vty:$vj, vty:$vk)>;
1595 foreach Inst = ["VMADDWEV_H_B", "VMADDWOD_H_B", "VMADDWEV_H_BU",
1596 "VMADDWOD_H_BU", "VMADDWEV_H_BU_B", "VMADDWOD_H_BU_B"] in
1597 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1598 (v8i16 LSX128:$vd), (v16i8 LSX128:$vj), (v16i8 LSX128:$vk)),
1599 (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1600 foreach Inst = ["VMADDWEV_W_H", "VMADDWOD_W_H", "VMADDWEV_W_HU",
1601 "VMADDWOD_W_HU", "VMADDWEV_W_HU_H", "VMADDWOD_W_HU_H"] in
1602 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1603 (v4i32 LSX128:$vd), (v8i16 LSX128:$vj), (v8i16 LSX128:$vk)),
1604 (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1605 foreach Inst = ["VMADDWEV_D_W", "VMADDWOD_D_W", "VMADDWEV_D_WU",
1606 "VMADDWOD_D_WU", "VMADDWEV_D_WU_W", "VMADDWOD_D_WU_W"] in
1607 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1608 (v2i64 LSX128:$vd), (v4i32 LSX128:$vj), (v4i32 LSX128:$vk)),
1609 (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1610 foreach Inst = ["VMADDWEV_Q_D", "VMADDWOD_Q_D", "VMADDWEV_Q_DU",
1611 "VMADDWOD_Q_DU", "VMADDWEV_Q_DU_D", "VMADDWOD_Q_DU_D"] in
1612 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1613 (v2i64 LSX128:$vd), (v2i64 LSX128:$vj), (v2i64 LSX128:$vk)),
1614 (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1616 // vty: v16i8/v8i16/v4i32/v2i64
1617 // Pat<(Intrinsic vty:$vj),
1618 // (LAInst vty:$vj)>;
1619 foreach Inst = ["VEXTH_H_B", "VEXTH_HU_BU",
1620 "VMSKLTZ_B", "VMSKGEZ_B", "VMSKNZ_B",
1621 "VCLO_B", "VCLZ_B"] in
1622 def : Pat<(deriveLSXIntrinsic<Inst>.ret (v16i8 LSX128:$vj)),
1623 (!cast<LAInst>(Inst) LSX128:$vj)>;
1624 foreach Inst = ["VEXTH_W_H", "VEXTH_WU_HU", "VMSKLTZ_H",
1625 "VCLO_H", "VCLZ_H", "VFCVTL_S_H", "VFCVTH_S_H"] in
1626 def : Pat<(deriveLSXIntrinsic<Inst>.ret (v8i16 LSX128:$vj)),
1627 (!cast<LAInst>(Inst) LSX128:$vj)>;
1628 foreach Inst = ["VEXTH_D_W", "VEXTH_DU_WU", "VMSKLTZ_W",
1629 "VCLO_W", "VCLZ_W", "VFFINT_S_W", "VFFINT_S_WU",
1630 "VFFINTL_D_W", "VFFINTH_D_W"] in
1631 def : Pat<(deriveLSXIntrinsic<Inst>.ret (v4i32 LSX128:$vj)),
1632 (!cast<LAInst>(Inst) LSX128:$vj)>;
1633 foreach Inst = ["VEXTH_Q_D", "VEXTH_QU_DU", "VMSKLTZ_D",
1634 "VEXTL_Q_D", "VEXTL_QU_DU",
1635 "VCLO_D", "VCLZ_D", "VFFINT_D_L", "VFFINT_D_LU"] in
1636 def : Pat<(deriveLSXIntrinsic<Inst>.ret (v2i64 LSX128:$vj)),
1637 (!cast<LAInst>(Inst) LSX128:$vj)>;
1639 // Pat<(Intrinsic timm:$imm)
1640 // (LAInst timm:$imm)>;
1641 def : Pat<(int_loongarch_lsx_vldi timm:$imm),
1642 (VLDI (to_valid_timm timm:$imm))>;
1643 foreach Inst = ["VREPLI_B", "VREPLI_H", "VREPLI_W", "VREPLI_D"] in
1644 def : Pat<(deriveLSXIntrinsic<Inst>.ret timm:$imm),
1645 (!cast<LAInst>("Pseudo"#Inst) (to_valid_timm timm:$imm))>;
1647 // vty: v16i8/v8i16/v4i32/v2i64
1648 // Pat<(Intrinsic vty:$vj, timm:$imm)
1649 // (LAInst vty:$vj, timm:$imm)>;
1650 foreach Inst = ["VSAT_B", "VSAT_BU", "VNORI_B", "VROTRI_B", "VSLLWIL_H_B",
1651 "VSLLWIL_HU_BU", "VSRLRI_B", "VSRARI_B",
1652 "VSEQI_B", "VSLEI_B", "VSLEI_BU", "VSLTI_B", "VSLTI_BU",
1653 "VREPLVEI_B", "VBSLL_V", "VBSRL_V", "VSHUF4I_B"] in
1654 def : Pat<(deriveLSXIntrinsic<Inst>.ret (v16i8 LSX128:$vj), timm:$imm),
1655 (!cast<LAInst>(Inst) LSX128:$vj, (to_valid_timm timm:$imm))>;
1656 foreach Inst = ["VSAT_H", "VSAT_HU", "VROTRI_H", "VSLLWIL_W_H",
1657 "VSLLWIL_WU_HU", "VSRLRI_H", "VSRARI_H",
1658 "VSEQI_H", "VSLEI_H", "VSLEI_HU", "VSLTI_H", "VSLTI_HU",
1659 "VREPLVEI_H", "VSHUF4I_H"] in
1660 def : Pat<(deriveLSXIntrinsic<Inst>.ret (v8i16 LSX128:$vj), timm:$imm),
1661 (!cast<LAInst>(Inst) LSX128:$vj, (to_valid_timm timm:$imm))>;
1662 foreach Inst = ["VSAT_W", "VSAT_WU", "VROTRI_W", "VSLLWIL_D_W",
1663 "VSLLWIL_DU_WU", "VSRLRI_W", "VSRARI_W",
1664 "VSEQI_W", "VSLEI_W", "VSLEI_WU", "VSLTI_W", "VSLTI_WU",
1665 "VREPLVEI_W", "VSHUF4I_W"] in
1666 def : Pat<(deriveLSXIntrinsic<Inst>.ret (v4i32 LSX128:$vj), timm:$imm),
1667 (!cast<LAInst>(Inst) LSX128:$vj, (to_valid_timm timm:$imm))>;
1668 foreach Inst = ["VSAT_D", "VSAT_DU", "VROTRI_D", "VSRLRI_D", "VSRARI_D",
1669 "VSEQI_D", "VSLEI_D", "VSLEI_DU", "VSLTI_D", "VSLTI_DU",
1670 "VPICKVE2GR_D", "VPICKVE2GR_DU",
1672 def : Pat<(deriveLSXIntrinsic<Inst>.ret (v2i64 LSX128:$vj), timm:$imm),
1673 (!cast<LAInst>(Inst) LSX128:$vj, (to_valid_timm timm:$imm))>;
1675 // vty: v16i8/v8i16/v4i32/v2i64
1676 // Pat<(Intrinsic vty:$vd, vty:$vj, timm:$imm)
1677 // (LAInst vty:$vd, vty:$vj, timm:$imm)>;
1678 foreach Inst = ["VSRLNI_B_H", "VSRANI_B_H", "VSRLRNI_B_H", "VSRARNI_B_H",
1679 "VSSRLNI_B_H", "VSSRANI_B_H", "VSSRLNI_BU_H", "VSSRANI_BU_H",
1680 "VSSRLRNI_B_H", "VSSRARNI_B_H", "VSSRLRNI_BU_H", "VSSRARNI_BU_H",
1681 "VFRSTPI_B", "VBITSELI_B", "VEXTRINS_B"] in
1682 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1683 (v16i8 LSX128:$vd), (v16i8 LSX128:$vj), timm:$imm),
1684 (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj,
1685 (to_valid_timm timm:$imm))>;
1686 foreach Inst = ["VSRLNI_H_W", "VSRANI_H_W", "VSRLRNI_H_W", "VSRARNI_H_W",
1687 "VSSRLNI_H_W", "VSSRANI_H_W", "VSSRLNI_HU_W", "VSSRANI_HU_W",
1688 "VSSRLRNI_H_W", "VSSRARNI_H_W", "VSSRLRNI_HU_W", "VSSRARNI_HU_W",
1689 "VFRSTPI_H", "VEXTRINS_H"] in
1690 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1691 (v8i16 LSX128:$vd), (v8i16 LSX128:$vj), timm:$imm),
1692 (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj,
1693 (to_valid_timm timm:$imm))>;
1694 foreach Inst = ["VSRLNI_W_D", "VSRANI_W_D", "VSRLRNI_W_D", "VSRARNI_W_D",
1695 "VSSRLNI_W_D", "VSSRANI_W_D", "VSSRLNI_WU_D", "VSSRANI_WU_D",
1696 "VSSRLRNI_W_D", "VSSRARNI_W_D", "VSSRLRNI_WU_D", "VSSRARNI_WU_D",
1697 "VPERMI_W", "VEXTRINS_W"] in
1698 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1699 (v4i32 LSX128:$vd), (v4i32 LSX128:$vj), timm:$imm),
1700 (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj,
1701 (to_valid_timm timm:$imm))>;
1702 foreach Inst = ["VSRLNI_D_Q", "VSRANI_D_Q", "VSRLRNI_D_Q", "VSRARNI_D_Q",
1703 "VSSRLNI_D_Q", "VSSRANI_D_Q", "VSSRLNI_DU_Q", "VSSRANI_DU_Q",
1704 "VSSRLRNI_D_Q", "VSSRARNI_D_Q", "VSSRLRNI_DU_Q", "VSSRARNI_DU_Q",
1705 "VSHUF4I_D", "VEXTRINS_D"] in
1706 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1707 (v2i64 LSX128:$vd), (v2i64 LSX128:$vj), timm:$imm),
1708 (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj,
1709 (to_valid_timm timm:$imm))>;
1711 // vty: v16i8/v8i16/v4i32/v2i64
1712 // Pat<(Intrinsic vty:$vd, vty:$vj, vty:$vk),
1713 // (LAInst vty:$vd, vty:$vj, vty:$vk)>;
1714 foreach Inst = ["VFRSTP_B", "VBITSEL_V", "VSHUF_B"] in
1715 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1716 (v16i8 LSX128:$vd), (v16i8 LSX128:$vj), (v16i8 LSX128:$vk)),
1717 (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1718 foreach Inst = ["VFRSTP_H", "VSHUF_H"] in
1719 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1720 (v8i16 LSX128:$vd), (v8i16 LSX128:$vj), (v8i16 LSX128:$vk)),
1721 (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1722 def : Pat<(int_loongarch_lsx_vshuf_w (v4i32 LSX128:$vd), (v4i32 LSX128:$vj),
1723 (v4i32 LSX128:$vk)),
1724 (VSHUF_W LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1725 def : Pat<(int_loongarch_lsx_vshuf_d (v2i64 LSX128:$vd), (v2i64 LSX128:$vj),
1726 (v2i64 LSX128:$vk)),
1727 (VSHUF_D LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1730 // Pat<(Intrinsic vty:$vj, vty:$vk, vty:$va),
1731 // (LAInst vty:$vj, vty:$vk, vty:$va)>;
1732 foreach Inst = ["VFMSUB_S", "VFNMADD_S", "VFNMSUB_S"] in
1733 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1734 (v4f32 LSX128:$vj), (v4f32 LSX128:$vk), (v4f32 LSX128:$va)),
1735 (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk, LSX128:$va)>;
1736 foreach Inst = ["VFMSUB_D", "VFNMADD_D", "VFNMSUB_D"] in
1737 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1738 (v2f64 LSX128:$vj), (v2f64 LSX128:$vk), (v2f64 LSX128:$va)),
1739 (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk, LSX128:$va)>;
1742 // Pat<(Intrinsic vty:$vj, vty:$vk),
1743 // (LAInst vty:$vj, vty:$vk)>;
1744 foreach Inst = ["VFMAX_S", "VFMIN_S", "VFMAXA_S", "VFMINA_S", "VFCVT_H_S",
1745 "VFCMP_CAF_S", "VFCMP_CUN_S", "VFCMP_CEQ_S", "VFCMP_CUEQ_S",
1746 "VFCMP_CLT_S", "VFCMP_CULT_S", "VFCMP_CLE_S", "VFCMP_CULE_S",
1747 "VFCMP_CNE_S", "VFCMP_COR_S", "VFCMP_CUNE_S",
1748 "VFCMP_SAF_S", "VFCMP_SUN_S", "VFCMP_SEQ_S", "VFCMP_SUEQ_S",
1749 "VFCMP_SLT_S", "VFCMP_SULT_S", "VFCMP_SLE_S", "VFCMP_SULE_S",
1750 "VFCMP_SNE_S", "VFCMP_SOR_S", "VFCMP_SUNE_S"] in
1751 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1752 (v4f32 LSX128:$vj), (v4f32 LSX128:$vk)),
1753 (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk)>;
1754 foreach Inst = ["VFMAX_D", "VFMIN_D", "VFMAXA_D", "VFMINA_D", "VFCVT_S_D",
1755 "VFTINTRNE_W_D", "VFTINTRZ_W_D", "VFTINTRP_W_D", "VFTINTRM_W_D",
1757 "VFCMP_CAF_D", "VFCMP_CUN_D", "VFCMP_CEQ_D", "VFCMP_CUEQ_D",
1758 "VFCMP_CLT_D", "VFCMP_CULT_D", "VFCMP_CLE_D", "VFCMP_CULE_D",
1759 "VFCMP_CNE_D", "VFCMP_COR_D", "VFCMP_CUNE_D",
1760 "VFCMP_SAF_D", "VFCMP_SUN_D", "VFCMP_SEQ_D", "VFCMP_SUEQ_D",
1761 "VFCMP_SLT_D", "VFCMP_SULT_D", "VFCMP_SLE_D", "VFCMP_SULE_D",
1762 "VFCMP_SNE_D", "VFCMP_SOR_D", "VFCMP_SUNE_D"] in
1763 def : Pat<(deriveLSXIntrinsic<Inst>.ret
1764 (v2f64 LSX128:$vj), (v2f64 LSX128:$vk)),
1765 (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk)>;
1768 // Pat<(Intrinsic vty:$vj),
1769 // (LAInst vty:$vj)>;
1770 foreach Inst = ["VFLOGB_S", "VFCLASS_S", "VFSQRT_S", "VFRECIP_S", "VFRSQRT_S",
1771 "VFRINT_S", "VFCVTL_D_S", "VFCVTH_D_S",
1772 "VFRINTRNE_S", "VFRINTRZ_S", "VFRINTRP_S", "VFRINTRM_S",
1773 "VFTINTRNE_W_S", "VFTINTRZ_W_S", "VFTINTRP_W_S", "VFTINTRM_W_S",
1774 "VFTINT_W_S", "VFTINTRZ_WU_S", "VFTINT_WU_S",
1775 "VFTINTRNEL_L_S", "VFTINTRNEH_L_S", "VFTINTRZL_L_S",
1776 "VFTINTRZH_L_S", "VFTINTRPL_L_S", "VFTINTRPH_L_S",
1777 "VFTINTRML_L_S", "VFTINTRMH_L_S", "VFTINTL_L_S",
1779 def : Pat<(deriveLSXIntrinsic<Inst>.ret (v4f32 LSX128:$vj)),
1780 (!cast<LAInst>(Inst) LSX128:$vj)>;
1781 foreach Inst = ["VFLOGB_D", "VFCLASS_D", "VFSQRT_D", "VFRECIP_D", "VFRSQRT_D",
1783 "VFRINTRNE_D", "VFRINTRZ_D", "VFRINTRP_D", "VFRINTRM_D",
1784 "VFTINTRNE_L_D", "VFTINTRZ_L_D", "VFTINTRP_L_D", "VFTINTRM_L_D",
1785 "VFTINT_L_D", "VFTINTRZ_LU_D", "VFTINT_LU_D"] in
1786 def : Pat<(deriveLSXIntrinsic<Inst>.ret (v2f64 LSX128:$vj)),
1787 (!cast<LAInst>(Inst) LSX128:$vj)>;
1790 def : Pat<(int_loongarch_lsx_vld GPR:$rj, timm:$imm),
1791 (VLD GPR:$rj, (to_valid_timm timm:$imm))>;
1792 def : Pat<(int_loongarch_lsx_vldx GPR:$rj, GPR:$rk),
1793 (VLDX GPR:$rj, GPR:$rk)>;
1795 def : Pat<(int_loongarch_lsx_vldrepl_b GPR:$rj, timm:$imm),
1796 (VLDREPL_B GPR:$rj, (to_valid_timm timm:$imm))>;
1797 def : Pat<(int_loongarch_lsx_vldrepl_h GPR:$rj, timm:$imm),
1798 (VLDREPL_H GPR:$rj, (to_valid_timm timm:$imm))>;
1799 def : Pat<(int_loongarch_lsx_vldrepl_w GPR:$rj, timm:$imm),
1800 (VLDREPL_W GPR:$rj, (to_valid_timm timm:$imm))>;
1801 def : Pat<(int_loongarch_lsx_vldrepl_d GPR:$rj, timm:$imm),
1802 (VLDREPL_D GPR:$rj, (to_valid_timm timm:$imm))>;
1805 def : Pat<(int_loongarch_lsx_vst LSX128:$vd, GPR:$rj, timm:$imm),
1806 (VST LSX128:$vd, GPR:$rj, (to_valid_timm timm:$imm))>;
1807 def : Pat<(int_loongarch_lsx_vstx LSX128:$vd, GPR:$rj, GPR:$rk),
1808 (VSTX LSX128:$vd, GPR:$rj, GPR:$rk)>;
1810 def : Pat<(int_loongarch_lsx_vstelm_b v16i8:$vd, GPR:$rj, timm:$imm, timm:$idx),
1811 (VSTELM_B v16i8:$vd, GPR:$rj, (to_valid_timm timm:$imm),
1812 (to_valid_timm timm:$idx))>;
1813 def : Pat<(int_loongarch_lsx_vstelm_h v8i16:$vd, GPR:$rj, timm:$imm, timm:$idx),
1814 (VSTELM_H v8i16:$vd, GPR:$rj, (to_valid_timm timm:$imm),
1815 (to_valid_timm timm:$idx))>;
1816 def : Pat<(int_loongarch_lsx_vstelm_w v4i32:$vd, GPR:$rj, timm:$imm, timm:$idx),
1817 (VSTELM_W v4i32:$vd, GPR:$rj, (to_valid_timm timm:$imm),
1818 (to_valid_timm timm:$idx))>;
1819 def : Pat<(int_loongarch_lsx_vstelm_d v2i64:$vd, GPR:$rj, timm:$imm, timm:$idx),
1820 (VSTELM_D v2i64:$vd, GPR:$rj, (to_valid_timm timm:$imm),
1821 (to_valid_timm timm:$idx))>;
1823 } // Predicates = [HasExtLSX]