xref: /freebsd/contrib/llvm-project/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
106c3fb27SDimitry Andric//===- LoongArchLSXInstrInfo.td - LoongArch LSX instructions -*- tablegen -*-=//
206c3fb27SDimitry Andric//
306c3fb27SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
406c3fb27SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
506c3fb27SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
606c3fb27SDimitry Andric//
706c3fb27SDimitry Andric//===----------------------------------------------------------------------===//
806c3fb27SDimitry Andric//
906c3fb27SDimitry Andric// This file describes the SIMD extension instructions.
1006c3fb27SDimitry Andric//
1106c3fb27SDimitry Andric//===----------------------------------------------------------------------===//
1206c3fb27SDimitry Andric
13*5f757f3fSDimitry Andricdef SDT_LoongArchVreplve : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisVec<0>,
14*5f757f3fSDimitry Andric                                         SDTCisInt<1>, SDTCisVec<1>,
15*5f757f3fSDimitry Andric                                         SDTCisSameAs<0, 1>, SDTCisInt<2>]>;
16*5f757f3fSDimitry Andricdef SDT_LoongArchVecCond : SDTypeProfile<1, 1, [SDTCisInt<0>, SDTCisVec<1>]>;
17*5f757f3fSDimitry Andric
18*5f757f3fSDimitry Andric// Target nodes.
19*5f757f3fSDimitry Andricdef loongarch_vreplve : SDNode<"LoongArchISD::VREPLVE", SDT_LoongArchVreplve>;
20*5f757f3fSDimitry Andricdef loongarch_vall_nonzero : SDNode<"LoongArchISD::VALL_NONZERO",
21*5f757f3fSDimitry Andric                                    SDT_LoongArchVecCond>;
22*5f757f3fSDimitry Andricdef loongarch_vany_nonzero : SDNode<"LoongArchISD::VANY_NONZERO",
23*5f757f3fSDimitry Andric                                    SDT_LoongArchVecCond>;
24*5f757f3fSDimitry Andricdef loongarch_vall_zero : SDNode<"LoongArchISD::VALL_ZERO",
25*5f757f3fSDimitry Andric                                SDT_LoongArchVecCond>;
26*5f757f3fSDimitry Andricdef loongarch_vany_zero : SDNode<"LoongArchISD::VANY_ZERO",
27*5f757f3fSDimitry Andric                                SDT_LoongArchVecCond>;
28*5f757f3fSDimitry Andric
29*5f757f3fSDimitry Andricdef loongarch_vpick_sext_elt : SDNode<"LoongArchISD::VPICK_SEXT_ELT",
30*5f757f3fSDimitry Andric                                      SDTypeProfile<1, 3, [SDTCisPtrTy<2>]>>;
31*5f757f3fSDimitry Andricdef loongarch_vpick_zext_elt : SDNode<"LoongArchISD::VPICK_ZEXT_ELT",
32*5f757f3fSDimitry Andric                                      SDTypeProfile<1, 3, [SDTCisPtrTy<2>]>>;
33*5f757f3fSDimitry Andric
34*5f757f3fSDimitry Andricclass VecCond<SDPatternOperator OpNode, ValueType TyNode,
35*5f757f3fSDimitry Andric              RegisterClass RC = LSX128>
36*5f757f3fSDimitry Andric    : Pseudo<(outs GPR:$rd), (ins RC:$vj),
37*5f757f3fSDimitry Andric             [(set GPR:$rd, (OpNode (TyNode RC:$vj)))]> {
38*5f757f3fSDimitry Andric  let hasSideEffects = 0;
39*5f757f3fSDimitry Andric  let mayLoad = 0;
40*5f757f3fSDimitry Andric  let mayStore = 0;
41*5f757f3fSDimitry Andric  let usesCustomInserter = 1;
42*5f757f3fSDimitry Andric}
43*5f757f3fSDimitry Andric
44*5f757f3fSDimitry Andricdef vsplat_imm_eq_1 : PatFrags<(ops), [(build_vector),
45*5f757f3fSDimitry Andric                                       (bitconvert (v4i32 (build_vector)))], [{
46*5f757f3fSDimitry Andric  APInt Imm;
47*5f757f3fSDimitry Andric  EVT EltTy = N->getValueType(0).getVectorElementType();
48*5f757f3fSDimitry Andric
49*5f757f3fSDimitry Andric  if (N->getOpcode() == ISD::BITCAST)
50*5f757f3fSDimitry Andric    N = N->getOperand(0).getNode();
51*5f757f3fSDimitry Andric
52*5f757f3fSDimitry Andric  return selectVSplat(N, Imm, EltTy.getSizeInBits()) &&
53*5f757f3fSDimitry Andric         Imm.getBitWidth() == EltTy.getSizeInBits() && Imm == 1;
54*5f757f3fSDimitry Andric}]>;
55*5f757f3fSDimitry Andric
56*5f757f3fSDimitry Andricdef vsplati8_imm_eq_7 : PatFrags<(ops), [(build_vector)], [{
57*5f757f3fSDimitry Andric  APInt Imm;
58*5f757f3fSDimitry Andric  EVT EltTy = N->getValueType(0).getVectorElementType();
59*5f757f3fSDimitry Andric
60*5f757f3fSDimitry Andric  if (N->getOpcode() == ISD::BITCAST)
61*5f757f3fSDimitry Andric    N = N->getOperand(0).getNode();
62*5f757f3fSDimitry Andric
63*5f757f3fSDimitry Andric  return selectVSplat(N, Imm, EltTy.getSizeInBits()) &&
64*5f757f3fSDimitry Andric         Imm.getBitWidth() == EltTy.getSizeInBits() && Imm == 7;
65*5f757f3fSDimitry Andric}]>;
66*5f757f3fSDimitry Andricdef vsplati16_imm_eq_15 : PatFrags<(ops), [(build_vector)], [{
67*5f757f3fSDimitry Andric  APInt Imm;
68*5f757f3fSDimitry Andric  EVT EltTy = N->getValueType(0).getVectorElementType();
69*5f757f3fSDimitry Andric
70*5f757f3fSDimitry Andric  if (N->getOpcode() == ISD::BITCAST)
71*5f757f3fSDimitry Andric    N = N->getOperand(0).getNode();
72*5f757f3fSDimitry Andric
73*5f757f3fSDimitry Andric  return selectVSplat(N, Imm, EltTy.getSizeInBits()) &&
74*5f757f3fSDimitry Andric         Imm.getBitWidth() == EltTy.getSizeInBits() && Imm == 15;
75*5f757f3fSDimitry Andric}]>;
76*5f757f3fSDimitry Andricdef vsplati32_imm_eq_31 : PatFrags<(ops), [(build_vector)], [{
77*5f757f3fSDimitry Andric  APInt Imm;
78*5f757f3fSDimitry Andric  EVT EltTy = N->getValueType(0).getVectorElementType();
79*5f757f3fSDimitry Andric
80*5f757f3fSDimitry Andric  if (N->getOpcode() == ISD::BITCAST)
81*5f757f3fSDimitry Andric    N = N->getOperand(0).getNode();
82*5f757f3fSDimitry Andric
83*5f757f3fSDimitry Andric  return selectVSplat(N, Imm, EltTy.getSizeInBits()) &&
84*5f757f3fSDimitry Andric         Imm.getBitWidth() == EltTy.getSizeInBits() && Imm == 31;
85*5f757f3fSDimitry Andric}]>;
86*5f757f3fSDimitry Andricdef vsplati64_imm_eq_63 : PatFrags<(ops), [(build_vector),
87*5f757f3fSDimitry Andric                                           (bitconvert (v4i32 (build_vector)))], [{
88*5f757f3fSDimitry Andric  APInt Imm;
89*5f757f3fSDimitry Andric  EVT EltTy = N->getValueType(0).getVectorElementType();
90*5f757f3fSDimitry Andric
91*5f757f3fSDimitry Andric  if (N->getOpcode() == ISD::BITCAST)
92*5f757f3fSDimitry Andric    N = N->getOperand(0).getNode();
93*5f757f3fSDimitry Andric
94*5f757f3fSDimitry Andric  return selectVSplat(N, Imm, EltTy.getSizeInBits()) &&
95*5f757f3fSDimitry Andric         Imm.getBitWidth() == EltTy.getSizeInBits() && Imm == 63;
96*5f757f3fSDimitry Andric}]>;
97*5f757f3fSDimitry Andric
98*5f757f3fSDimitry Andricdef vsplatf32_fpimm_eq_1
99*5f757f3fSDimitry Andric  : PatFrags<(ops), [(bitconvert (v4i32 (build_vector))),
100*5f757f3fSDimitry Andric                     (bitconvert (v8i32 (build_vector)))], [{
101*5f757f3fSDimitry Andric  APInt Imm;
102*5f757f3fSDimitry Andric  EVT EltTy = N->getValueType(0).getVectorElementType();
103*5f757f3fSDimitry Andric  N = N->getOperand(0).getNode();
104*5f757f3fSDimitry Andric
105*5f757f3fSDimitry Andric  return selectVSplat(N, Imm, EltTy.getSizeInBits()) &&
106*5f757f3fSDimitry Andric         Imm.getBitWidth() == EltTy.getSizeInBits() &&
107*5f757f3fSDimitry Andric         Imm == APFloat(+1.0f).bitcastToAPInt();
108*5f757f3fSDimitry Andric}]>;
109*5f757f3fSDimitry Andricdef vsplatf64_fpimm_eq_1
110*5f757f3fSDimitry Andric  : PatFrags<(ops), [(bitconvert (v2i64 (build_vector))),
111*5f757f3fSDimitry Andric                     (bitconvert (v4i64 (build_vector)))], [{
112*5f757f3fSDimitry Andric  APInt Imm;
113*5f757f3fSDimitry Andric  EVT EltTy = N->getValueType(0).getVectorElementType();
114*5f757f3fSDimitry Andric  N = N->getOperand(0).getNode();
115*5f757f3fSDimitry Andric
116*5f757f3fSDimitry Andric  return selectVSplat(N, Imm, EltTy.getSizeInBits()) &&
117*5f757f3fSDimitry Andric         Imm.getBitWidth() == EltTy.getSizeInBits() &&
118*5f757f3fSDimitry Andric         Imm == APFloat(+1.0).bitcastToAPInt();
119*5f757f3fSDimitry Andric}]>;
120*5f757f3fSDimitry Andric
121*5f757f3fSDimitry Andricdef vsplati8imm7   : PatFrag<(ops node:$reg),
122*5f757f3fSDimitry Andric                             (and node:$reg, vsplati8_imm_eq_7)>;
123*5f757f3fSDimitry Andricdef vsplati16imm15 : PatFrag<(ops node:$reg),
124*5f757f3fSDimitry Andric                             (and node:$reg, vsplati16_imm_eq_15)>;
125*5f757f3fSDimitry Andricdef vsplati32imm31 : PatFrag<(ops node:$reg),
126*5f757f3fSDimitry Andric                             (and node:$reg, vsplati32_imm_eq_31)>;
127*5f757f3fSDimitry Andricdef vsplati64imm63 : PatFrag<(ops node:$reg),
128*5f757f3fSDimitry Andric                             (and node:$reg, vsplati64_imm_eq_63)>;
129*5f757f3fSDimitry Andric
130*5f757f3fSDimitry Andricforeach N = [3, 4, 5, 6, 8] in
131*5f757f3fSDimitry Andric  def SplatPat_uimm#N : ComplexPattern<vAny, 1, "selectVSplatImm<"#N#">",
132*5f757f3fSDimitry Andric                                       [build_vector, bitconvert], [], 2>;
133*5f757f3fSDimitry Andric
134*5f757f3fSDimitry Andricforeach N = [5] in
135*5f757f3fSDimitry Andric  def SplatPat_simm#N : ComplexPattern<vAny, 1, "selectVSplatImm<"#N#", true>",
136*5f757f3fSDimitry Andric                                       [build_vector, bitconvert]>;
137*5f757f3fSDimitry Andric
138*5f757f3fSDimitry Andricdef vsplat_uimm_inv_pow2 : ComplexPattern<vAny, 1, "selectVSplatUimmInvPow2",
139*5f757f3fSDimitry Andric                                          [build_vector, bitconvert]>;
140*5f757f3fSDimitry Andric
141*5f757f3fSDimitry Andricdef vsplat_uimm_pow2 : ComplexPattern<vAny, 1, "selectVSplatUimmPow2",
142*5f757f3fSDimitry Andric                                      [build_vector, bitconvert]>;
143*5f757f3fSDimitry Andric
144*5f757f3fSDimitry Andricdef muladd : PatFrag<(ops node:$vd, node:$vj, node:$vk),
145*5f757f3fSDimitry Andric                     (add node:$vd, (mul node:$vj, node:$vk))>;
146*5f757f3fSDimitry Andric
147*5f757f3fSDimitry Andricdef mulsub : PatFrag<(ops node:$vd, node:$vj, node:$vk),
148*5f757f3fSDimitry Andric                     (sub node:$vd, (mul node:$vj, node:$vk))>;
149*5f757f3fSDimitry Andric
150*5f757f3fSDimitry Andricdef lsxsplati8  : PatFrag<(ops node:$e0),
151*5f757f3fSDimitry Andric                          (v16i8 (build_vector node:$e0, node:$e0,
152*5f757f3fSDimitry Andric                                               node:$e0, node:$e0,
153*5f757f3fSDimitry Andric                                               node:$e0, node:$e0,
154*5f757f3fSDimitry Andric                                               node:$e0, node:$e0,
155*5f757f3fSDimitry Andric                                               node:$e0, node:$e0,
156*5f757f3fSDimitry Andric                                               node:$e0, node:$e0,
157*5f757f3fSDimitry Andric                                               node:$e0, node:$e0,
158*5f757f3fSDimitry Andric                                               node:$e0, node:$e0))>;
159*5f757f3fSDimitry Andricdef lsxsplati16 : PatFrag<(ops node:$e0),
160*5f757f3fSDimitry Andric                          (v8i16 (build_vector node:$e0, node:$e0,
161*5f757f3fSDimitry Andric                                               node:$e0, node:$e0,
162*5f757f3fSDimitry Andric                                               node:$e0, node:$e0,
163*5f757f3fSDimitry Andric                                               node:$e0, node:$e0))>;
164*5f757f3fSDimitry Andricdef lsxsplati32 : PatFrag<(ops node:$e0),
165*5f757f3fSDimitry Andric                          (v4i32 (build_vector node:$e0, node:$e0,
166*5f757f3fSDimitry Andric                                               node:$e0, node:$e0))>;
167*5f757f3fSDimitry Andricdef lsxsplati64 : PatFrag<(ops node:$e0),
168*5f757f3fSDimitry Andric                          (v2i64 (build_vector node:$e0, node:$e0))>;
169*5f757f3fSDimitry Andricdef lsxsplatf32 : PatFrag<(ops node:$e0),
170*5f757f3fSDimitry Andric                          (v4f32 (build_vector node:$e0, node:$e0,
171*5f757f3fSDimitry Andric                                               node:$e0, node:$e0))>;
172*5f757f3fSDimitry Andricdef lsxsplatf64 : PatFrag<(ops node:$e0),
173*5f757f3fSDimitry Andric                          (v2f64 (build_vector node:$e0, node:$e0))>;
174*5f757f3fSDimitry Andric
175*5f757f3fSDimitry Andricdef to_valid_timm : SDNodeXForm<timm, [{
176*5f757f3fSDimitry Andric  auto CN = cast<ConstantSDNode>(N);
177*5f757f3fSDimitry Andric  return CurDAG->getTargetConstant(CN->getSExtValue(), SDLoc(N), Subtarget->getGRLenVT());
178*5f757f3fSDimitry Andric}]>;
179*5f757f3fSDimitry Andric
18006c3fb27SDimitry Andric//===----------------------------------------------------------------------===//
18106c3fb27SDimitry Andric// Instruction class templates
18206c3fb27SDimitry Andric//===----------------------------------------------------------------------===//
18306c3fb27SDimitry Andric
18406c3fb27SDimitry Andricclass LSX1RI13_VI<bits<32> op, Operand ImmOpnd = simm13>
18506c3fb27SDimitry Andric    : Fmt1RI13_VI<op, (outs LSX128:$vd), (ins ImmOpnd:$imm13), "$vd, $imm13">;
18606c3fb27SDimitry Andric
18706c3fb27SDimitry Andricclass LSX2R_VV<bits<32> op>
18806c3fb27SDimitry Andric    : Fmt2R_VV<op, (outs LSX128:$vd), (ins LSX128:$vj), "$vd, $vj">;
18906c3fb27SDimitry Andric
19006c3fb27SDimitry Andricclass LSX2R_VR<bits<32> op>
19106c3fb27SDimitry Andric    : Fmt2R_VR<op, (outs LSX128:$vd), (ins GPR:$rj), "$vd, $rj">;
19206c3fb27SDimitry Andric
19306c3fb27SDimitry Andricclass LSX2R_CV<bits<32> op>
19406c3fb27SDimitry Andric    : Fmt2R_CV<op, (outs CFR:$cd), (ins LSX128:$vj), "$cd, $vj">;
19506c3fb27SDimitry Andric
19606c3fb27SDimitry Andricclass LSX2RI1_VVI<bits<32> op, Operand ImmOpnd = uimm1>
19706c3fb27SDimitry Andric    : Fmt2RI1_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm1),
19806c3fb27SDimitry Andric                  "$vd, $vj, $imm1">;
19906c3fb27SDimitry Andric
20006c3fb27SDimitry Andricclass LSX2RI1_RVI<bits<32> op, Operand ImmOpnd = uimm1>
20106c3fb27SDimitry Andric    : Fmt2RI1_RVI<op, (outs GPR:$rd), (ins LSX128:$vj, ImmOpnd:$imm1),
20206c3fb27SDimitry Andric                  "$rd, $vj, $imm1">;
20306c3fb27SDimitry Andric
20406c3fb27SDimitry Andricclass LSX2RI2_VVI<bits<32> op, Operand ImmOpnd = uimm2>
20506c3fb27SDimitry Andric    : Fmt2RI2_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm2),
20606c3fb27SDimitry Andric                  "$vd, $vj, $imm2">;
20706c3fb27SDimitry Andric
20806c3fb27SDimitry Andricclass LSX2RI2_RVI<bits<32> op, Operand ImmOpnd = uimm2>
20906c3fb27SDimitry Andric    : Fmt2RI2_RVI<op, (outs GPR:$rd), (ins LSX128:$vj, ImmOpnd:$imm2),
21006c3fb27SDimitry Andric                  "$rd, $vj, $imm2">;
21106c3fb27SDimitry Andric
21206c3fb27SDimitry Andricclass LSX2RI3_VVI<bits<32> op, Operand ImmOpnd = uimm3>
21306c3fb27SDimitry Andric    : Fmt2RI3_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm3),
21406c3fb27SDimitry Andric                  "$vd, $vj, $imm3">;
21506c3fb27SDimitry Andric
21606c3fb27SDimitry Andricclass LSX2RI3_RVI<bits<32> op, Operand ImmOpnd = uimm3>
21706c3fb27SDimitry Andric    : Fmt2RI3_RVI<op, (outs GPR:$rd), (ins LSX128:$vj, ImmOpnd:$imm3),
21806c3fb27SDimitry Andric                  "$rd, $vj, $imm3">;
21906c3fb27SDimitry Andric
22006c3fb27SDimitry Andricclass LSX2RI4_VVI<bits<32> op, Operand ImmOpnd = uimm4>
22106c3fb27SDimitry Andric    : Fmt2RI4_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm4),
22206c3fb27SDimitry Andric                  "$vd, $vj, $imm4">;
22306c3fb27SDimitry Andric
22406c3fb27SDimitry Andricclass LSX2RI4_RVI<bits<32> op, Operand ImmOpnd = uimm4>
22506c3fb27SDimitry Andric    : Fmt2RI4_RVI<op, (outs GPR:$rd), (ins LSX128:$vj, ImmOpnd:$imm4),
22606c3fb27SDimitry Andric                  "$rd, $vj, $imm4">;
22706c3fb27SDimitry Andric
22806c3fb27SDimitry Andricclass LSX2RI5_VVI<bits<32> op, Operand ImmOpnd = uimm5>
22906c3fb27SDimitry Andric    : Fmt2RI5_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm5),
23006c3fb27SDimitry Andric                  "$vd, $vj, $imm5">;
23106c3fb27SDimitry Andric
23206c3fb27SDimitry Andricclass LSX2RI6_VVI<bits<32> op, Operand ImmOpnd = uimm6>
23306c3fb27SDimitry Andric    : Fmt2RI6_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm6),
23406c3fb27SDimitry Andric                  "$vd, $vj, $imm6">;
23506c3fb27SDimitry Andric
23606c3fb27SDimitry Andricclass LSX2RI8_VVI<bits<32> op, Operand ImmOpnd = uimm8>
23706c3fb27SDimitry Andric    : Fmt2RI8_VVI<op, (outs LSX128:$vd), (ins LSX128:$vj, ImmOpnd:$imm8),
23806c3fb27SDimitry Andric                  "$vd, $vj, $imm8">;
23906c3fb27SDimitry Andric
24006c3fb27SDimitry Andricclass LSX2RI8I1_VRII<bits<32> op, Operand ImmOpnd = simm8,
24106c3fb27SDimitry Andric                     Operand IdxOpnd = uimm1>
24206c3fb27SDimitry Andric    : Fmt2RI8I1_VRII<op, (outs),
24306c3fb27SDimitry Andric                     (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm8, IdxOpnd:$imm1),
24406c3fb27SDimitry Andric                     "$vd, $rj, $imm8, $imm1">;
24506c3fb27SDimitry Andricclass LSX2RI8I2_VRII<bits<32> op, Operand ImmOpnd = simm8,
24606c3fb27SDimitry Andric                     Operand IdxOpnd = uimm2>
24706c3fb27SDimitry Andric    : Fmt2RI8I2_VRII<op, (outs),
24806c3fb27SDimitry Andric                     (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm8, IdxOpnd:$imm2),
24906c3fb27SDimitry Andric                     "$vd, $rj, $imm8, $imm2">;
25006c3fb27SDimitry Andricclass LSX2RI8I3_VRII<bits<32> op, Operand ImmOpnd = simm8,
25106c3fb27SDimitry Andric                     Operand IdxOpnd = uimm3>
25206c3fb27SDimitry Andric    : Fmt2RI8I3_VRII<op, (outs),
25306c3fb27SDimitry Andric                     (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm8, IdxOpnd:$imm3),
25406c3fb27SDimitry Andric                     "$vd, $rj, $imm8, $imm3">;
25506c3fb27SDimitry Andricclass LSX2RI8I4_VRII<bits<32> op, Operand ImmOpnd = simm8,
25606c3fb27SDimitry Andric                     Operand IdxOpnd = uimm4>
25706c3fb27SDimitry Andric    : Fmt2RI8I4_VRII<op, (outs),
25806c3fb27SDimitry Andric                     (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm8, IdxOpnd:$imm4),
25906c3fb27SDimitry Andric                     "$vd, $rj, $imm8, $imm4">;
26006c3fb27SDimitry Andric
26106c3fb27SDimitry Andricclass LSX3R_VVV<bits<32> op>
26206c3fb27SDimitry Andric    : Fmt3R_VVV<op, (outs LSX128:$vd), (ins LSX128:$vj, LSX128:$vk),
26306c3fb27SDimitry Andric                "$vd, $vj, $vk">;
26406c3fb27SDimitry Andric
26506c3fb27SDimitry Andricclass LSX3R_VVR<bits<32> op>
26606c3fb27SDimitry Andric    : Fmt3R_VVR<op, (outs LSX128:$vd), (ins LSX128:$vj, GPR:$rk),
26706c3fb27SDimitry Andric                "$vd, $vj, $rk">;
26806c3fb27SDimitry Andric
26906c3fb27SDimitry Andricclass LSX4R_VVVV<bits<32> op>
27006c3fb27SDimitry Andric    : Fmt4R_VVVV<op, (outs LSX128:$vd),
27106c3fb27SDimitry Andric                 (ins LSX128:$vj, LSX128:$vk, LSX128:$va),
27206c3fb27SDimitry Andric                 "$vd, $vj, $vk, $va">;
27306c3fb27SDimitry Andric
27406c3fb27SDimitry Andriclet Constraints = "$vd = $dst" in {
27506c3fb27SDimitry Andric
27606c3fb27SDimitry Andricclass LSX2RI1_VVRI<bits<32> op, Operand ImmOpnd = uimm1>
27706c3fb27SDimitry Andric    : Fmt2RI1_VRI<op, (outs LSX128:$dst), (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm1),
27806c3fb27SDimitry Andric                  "$vd, $rj, $imm1">;
27906c3fb27SDimitry Andricclass LSX2RI2_VVRI<bits<32> op, Operand ImmOpnd = uimm2>
28006c3fb27SDimitry Andric    : Fmt2RI2_VRI<op, (outs LSX128:$dst), (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm2),
28106c3fb27SDimitry Andric                  "$vd, $rj, $imm2">;
28206c3fb27SDimitry Andricclass LSX2RI3_VVRI<bits<32> op, Operand ImmOpnd = uimm3>
28306c3fb27SDimitry Andric    : Fmt2RI3_VRI<op, (outs LSX128:$dst), (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm3),
28406c3fb27SDimitry Andric                  "$vd, $rj, $imm3">;
28506c3fb27SDimitry Andricclass LSX2RI4_VVRI<bits<32> op, Operand ImmOpnd = uimm4>
28606c3fb27SDimitry Andric    : Fmt2RI4_VRI<op, (outs LSX128:$dst), (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm4),
28706c3fb27SDimitry Andric                  "$vd, $rj, $imm4">;
28806c3fb27SDimitry Andric
28906c3fb27SDimitry Andricclass LSX2RI4_VVVI<bits<32> op, Operand ImmOpnd = uimm4>
29006c3fb27SDimitry Andric    : Fmt2RI4_VVI<op, (outs LSX128:$dst), (ins LSX128:$vd, LSX128:$vj, ImmOpnd:$imm4),
29106c3fb27SDimitry Andric                  "$vd, $vj, $imm4">;
29206c3fb27SDimitry Andricclass LSX2RI5_VVVI<bits<32> op, Operand ImmOpnd = uimm5>
29306c3fb27SDimitry Andric    : Fmt2RI5_VVI<op, (outs LSX128:$dst), (ins LSX128:$vd, LSX128:$vj, ImmOpnd:$imm5),
29406c3fb27SDimitry Andric                  "$vd, $vj, $imm5">;
29506c3fb27SDimitry Andricclass LSX2RI6_VVVI<bits<32> op, Operand ImmOpnd = uimm6>
29606c3fb27SDimitry Andric    : Fmt2RI6_VVI<op, (outs LSX128:$dst), (ins LSX128:$vd, LSX128:$vj, ImmOpnd:$imm6),
29706c3fb27SDimitry Andric                  "$vd, $vj, $imm6">;
29806c3fb27SDimitry Andricclass LSX2RI7_VVVI<bits<32> op, Operand ImmOpnd = uimm7>
29906c3fb27SDimitry Andric    : Fmt2RI7_VVI<op, (outs LSX128:$dst), (ins LSX128:$vd, LSX128:$vj, ImmOpnd:$imm7),
30006c3fb27SDimitry Andric                  "$vd, $vj, $imm7">;
30106c3fb27SDimitry Andric
30206c3fb27SDimitry Andricclass LSX2RI8_VVVI<bits<32> op, Operand ImmOpnd = uimm8>
30306c3fb27SDimitry Andric    : Fmt2RI8_VVI<op, (outs LSX128:$dst), (ins LSX128:$vd, LSX128:$vj, ImmOpnd:$imm8),
30406c3fb27SDimitry Andric                  "$vd, $vj, $imm8">;
30506c3fb27SDimitry Andric
30606c3fb27SDimitry Andricclass LSX3R_VVVV<bits<32> op>
30706c3fb27SDimitry Andric    : Fmt3R_VVV<op, (outs LSX128:$dst), (ins LSX128:$vd, LSX128:$vj, LSX128:$vk),
30806c3fb27SDimitry Andric                "$vd, $vj, $vk">;
30906c3fb27SDimitry Andric
31006c3fb27SDimitry Andric} // Constraints = "$vd = $dst"
31106c3fb27SDimitry Andric
31206c3fb27SDimitry Andricclass LSX2RI9_Load<bits<32> op, Operand ImmOpnd = simm9_lsl3>
31306c3fb27SDimitry Andric    : Fmt2RI9_VRI<op, (outs LSX128:$vd), (ins GPR:$rj, ImmOpnd:$imm9),
31406c3fb27SDimitry Andric                  "$vd, $rj, $imm9">;
31506c3fb27SDimitry Andricclass LSX2RI10_Load<bits<32> op, Operand ImmOpnd = simm10_lsl2>
31606c3fb27SDimitry Andric    : Fmt2RI10_VRI<op, (outs LSX128:$vd), (ins GPR:$rj, ImmOpnd:$imm10),
31706c3fb27SDimitry Andric                  "$vd, $rj, $imm10">;
31806c3fb27SDimitry Andricclass LSX2RI11_Load<bits<32> op, Operand ImmOpnd = simm11_lsl1>
31906c3fb27SDimitry Andric    : Fmt2RI11_VRI<op, (outs LSX128:$vd), (ins GPR:$rj, ImmOpnd:$imm11),
32006c3fb27SDimitry Andric                  "$vd, $rj, $imm11">;
32106c3fb27SDimitry Andricclass LSX2RI12_Load<bits<32> op, Operand ImmOpnd = simm12>
32206c3fb27SDimitry Andric    : Fmt2RI12_VRI<op, (outs LSX128:$vd), (ins GPR:$rj, ImmOpnd:$imm12),
32306c3fb27SDimitry Andric                  "$vd, $rj, $imm12">;
32406c3fb27SDimitry Andricclass LSX2RI12_Store<bits<32> op, Operand ImmOpnd = simm12>
32506c3fb27SDimitry Andric    : Fmt2RI12_VRI<op, (outs), (ins LSX128:$vd, GPR:$rj, ImmOpnd:$imm12),
32606c3fb27SDimitry Andric                  "$vd, $rj, $imm12">;
32706c3fb27SDimitry Andric
32806c3fb27SDimitry Andricclass LSX3R_Load<bits<32> op>
32906c3fb27SDimitry Andric    : Fmt3R_VRR<op, (outs LSX128:$vd), (ins GPR:$rj, GPR:$rk),
33006c3fb27SDimitry Andric                "$vd, $rj, $rk">;
33106c3fb27SDimitry Andricclass LSX3R_Store<bits<32> op>
33206c3fb27SDimitry Andric    : Fmt3R_VRR<op, (outs), (ins LSX128:$vd, GPR:$rj, GPR:$rk),
33306c3fb27SDimitry Andric                "$vd, $rj, $rk">;
33406c3fb27SDimitry Andric
33506c3fb27SDimitry Andric//===----------------------------------------------------------------------===//
33606c3fb27SDimitry Andric// Instructions
33706c3fb27SDimitry Andric//===----------------------------------------------------------------------===//
33806c3fb27SDimitry Andric
33906c3fb27SDimitry Andriclet hasSideEffects = 0, Predicates = [HasExtLSX] in {
34006c3fb27SDimitry Andric
34106c3fb27SDimitry Andriclet mayLoad = 0, mayStore = 0 in {
34206c3fb27SDimitry Andric
34306c3fb27SDimitry Andricdef VADD_B : LSX3R_VVV<0x700a0000>;
34406c3fb27SDimitry Andricdef VADD_H : LSX3R_VVV<0x700a8000>;
34506c3fb27SDimitry Andricdef VADD_W : LSX3R_VVV<0x700b0000>;
34606c3fb27SDimitry Andricdef VADD_D : LSX3R_VVV<0x700b8000>;
34706c3fb27SDimitry Andricdef VADD_Q : LSX3R_VVV<0x712d0000>;
34806c3fb27SDimitry Andric
34906c3fb27SDimitry Andricdef VSUB_B : LSX3R_VVV<0x700c0000>;
35006c3fb27SDimitry Andricdef VSUB_H : LSX3R_VVV<0x700c8000>;
35106c3fb27SDimitry Andricdef VSUB_W : LSX3R_VVV<0x700d0000>;
35206c3fb27SDimitry Andricdef VSUB_D : LSX3R_VVV<0x700d8000>;
35306c3fb27SDimitry Andricdef VSUB_Q : LSX3R_VVV<0x712d8000>;
35406c3fb27SDimitry Andric
35506c3fb27SDimitry Andricdef VADDI_BU : LSX2RI5_VVI<0x728a0000>;
35606c3fb27SDimitry Andricdef VADDI_HU : LSX2RI5_VVI<0x728a8000>;
35706c3fb27SDimitry Andricdef VADDI_WU : LSX2RI5_VVI<0x728b0000>;
35806c3fb27SDimitry Andricdef VADDI_DU : LSX2RI5_VVI<0x728b8000>;
35906c3fb27SDimitry Andric
36006c3fb27SDimitry Andricdef VSUBI_BU : LSX2RI5_VVI<0x728c0000>;
36106c3fb27SDimitry Andricdef VSUBI_HU : LSX2RI5_VVI<0x728c8000>;
36206c3fb27SDimitry Andricdef VSUBI_WU : LSX2RI5_VVI<0x728d0000>;
36306c3fb27SDimitry Andricdef VSUBI_DU : LSX2RI5_VVI<0x728d8000>;
36406c3fb27SDimitry Andric
36506c3fb27SDimitry Andricdef VNEG_B : LSX2R_VV<0x729c3000>;
36606c3fb27SDimitry Andricdef VNEG_H : LSX2R_VV<0x729c3400>;
36706c3fb27SDimitry Andricdef VNEG_W : LSX2R_VV<0x729c3800>;
36806c3fb27SDimitry Andricdef VNEG_D : LSX2R_VV<0x729c3c00>;
36906c3fb27SDimitry Andric
37006c3fb27SDimitry Andricdef VSADD_B : LSX3R_VVV<0x70460000>;
37106c3fb27SDimitry Andricdef VSADD_H : LSX3R_VVV<0x70468000>;
37206c3fb27SDimitry Andricdef VSADD_W : LSX3R_VVV<0x70470000>;
37306c3fb27SDimitry Andricdef VSADD_D : LSX3R_VVV<0x70478000>;
37406c3fb27SDimitry Andricdef VSADD_BU : LSX3R_VVV<0x704a0000>;
37506c3fb27SDimitry Andricdef VSADD_HU : LSX3R_VVV<0x704a8000>;
37606c3fb27SDimitry Andricdef VSADD_WU : LSX3R_VVV<0x704b0000>;
37706c3fb27SDimitry Andricdef VSADD_DU : LSX3R_VVV<0x704b8000>;
37806c3fb27SDimitry Andric
37906c3fb27SDimitry Andricdef VSSUB_B : LSX3R_VVV<0x70480000>;
38006c3fb27SDimitry Andricdef VSSUB_H : LSX3R_VVV<0x70488000>;
38106c3fb27SDimitry Andricdef VSSUB_W : LSX3R_VVV<0x70490000>;
38206c3fb27SDimitry Andricdef VSSUB_D : LSX3R_VVV<0x70498000>;
38306c3fb27SDimitry Andricdef VSSUB_BU : LSX3R_VVV<0x704c0000>;
38406c3fb27SDimitry Andricdef VSSUB_HU : LSX3R_VVV<0x704c8000>;
38506c3fb27SDimitry Andricdef VSSUB_WU : LSX3R_VVV<0x704d0000>;
38606c3fb27SDimitry Andricdef VSSUB_DU : LSX3R_VVV<0x704d8000>;
38706c3fb27SDimitry Andric
38806c3fb27SDimitry Andricdef VHADDW_H_B : LSX3R_VVV<0x70540000>;
38906c3fb27SDimitry Andricdef VHADDW_W_H : LSX3R_VVV<0x70548000>;
39006c3fb27SDimitry Andricdef VHADDW_D_W : LSX3R_VVV<0x70550000>;
39106c3fb27SDimitry Andricdef VHADDW_Q_D : LSX3R_VVV<0x70558000>;
39206c3fb27SDimitry Andricdef VHADDW_HU_BU : LSX3R_VVV<0x70580000>;
39306c3fb27SDimitry Andricdef VHADDW_WU_HU : LSX3R_VVV<0x70588000>;
39406c3fb27SDimitry Andricdef VHADDW_DU_WU : LSX3R_VVV<0x70590000>;
39506c3fb27SDimitry Andricdef VHADDW_QU_DU : LSX3R_VVV<0x70598000>;
39606c3fb27SDimitry Andric
39706c3fb27SDimitry Andricdef VHSUBW_H_B : LSX3R_VVV<0x70560000>;
39806c3fb27SDimitry Andricdef VHSUBW_W_H : LSX3R_VVV<0x70568000>;
39906c3fb27SDimitry Andricdef VHSUBW_D_W : LSX3R_VVV<0x70570000>;
40006c3fb27SDimitry Andricdef VHSUBW_Q_D : LSX3R_VVV<0x70578000>;
40106c3fb27SDimitry Andricdef VHSUBW_HU_BU : LSX3R_VVV<0x705a0000>;
40206c3fb27SDimitry Andricdef VHSUBW_WU_HU : LSX3R_VVV<0x705a8000>;
40306c3fb27SDimitry Andricdef VHSUBW_DU_WU : LSX3R_VVV<0x705b0000>;
40406c3fb27SDimitry Andricdef VHSUBW_QU_DU : LSX3R_VVV<0x705b8000>;
40506c3fb27SDimitry Andric
40606c3fb27SDimitry Andricdef VADDWEV_H_B : LSX3R_VVV<0x701e0000>;
40706c3fb27SDimitry Andricdef VADDWEV_W_H : LSX3R_VVV<0x701e8000>;
40806c3fb27SDimitry Andricdef VADDWEV_D_W : LSX3R_VVV<0x701f0000>;
40906c3fb27SDimitry Andricdef VADDWEV_Q_D : LSX3R_VVV<0x701f8000>;
41006c3fb27SDimitry Andricdef VADDWOD_H_B : LSX3R_VVV<0x70220000>;
41106c3fb27SDimitry Andricdef VADDWOD_W_H : LSX3R_VVV<0x70228000>;
41206c3fb27SDimitry Andricdef VADDWOD_D_W : LSX3R_VVV<0x70230000>;
41306c3fb27SDimitry Andricdef VADDWOD_Q_D : LSX3R_VVV<0x70238000>;
41406c3fb27SDimitry Andric
41506c3fb27SDimitry Andricdef VSUBWEV_H_B : LSX3R_VVV<0x70200000>;
41606c3fb27SDimitry Andricdef VSUBWEV_W_H : LSX3R_VVV<0x70208000>;
41706c3fb27SDimitry Andricdef VSUBWEV_D_W : LSX3R_VVV<0x70210000>;
41806c3fb27SDimitry Andricdef VSUBWEV_Q_D : LSX3R_VVV<0x70218000>;
41906c3fb27SDimitry Andricdef VSUBWOD_H_B : LSX3R_VVV<0x70240000>;
42006c3fb27SDimitry Andricdef VSUBWOD_W_H : LSX3R_VVV<0x70248000>;
42106c3fb27SDimitry Andricdef VSUBWOD_D_W : LSX3R_VVV<0x70250000>;
42206c3fb27SDimitry Andricdef VSUBWOD_Q_D : LSX3R_VVV<0x70258000>;
42306c3fb27SDimitry Andric
42406c3fb27SDimitry Andricdef VADDWEV_H_BU : LSX3R_VVV<0x702e0000>;
42506c3fb27SDimitry Andricdef VADDWEV_W_HU : LSX3R_VVV<0x702e8000>;
42606c3fb27SDimitry Andricdef VADDWEV_D_WU : LSX3R_VVV<0x702f0000>;
42706c3fb27SDimitry Andricdef VADDWEV_Q_DU : LSX3R_VVV<0x702f8000>;
42806c3fb27SDimitry Andricdef VADDWOD_H_BU : LSX3R_VVV<0x70320000>;
42906c3fb27SDimitry Andricdef VADDWOD_W_HU : LSX3R_VVV<0x70328000>;
43006c3fb27SDimitry Andricdef VADDWOD_D_WU : LSX3R_VVV<0x70330000>;
43106c3fb27SDimitry Andricdef VADDWOD_Q_DU : LSX3R_VVV<0x70338000>;
43206c3fb27SDimitry Andric
43306c3fb27SDimitry Andricdef VSUBWEV_H_BU : LSX3R_VVV<0x70300000>;
43406c3fb27SDimitry Andricdef VSUBWEV_W_HU : LSX3R_VVV<0x70308000>;
43506c3fb27SDimitry Andricdef VSUBWEV_D_WU : LSX3R_VVV<0x70310000>;
43606c3fb27SDimitry Andricdef VSUBWEV_Q_DU : LSX3R_VVV<0x70318000>;
43706c3fb27SDimitry Andricdef VSUBWOD_H_BU : LSX3R_VVV<0x70340000>;
43806c3fb27SDimitry Andricdef VSUBWOD_W_HU : LSX3R_VVV<0x70348000>;
43906c3fb27SDimitry Andricdef VSUBWOD_D_WU : LSX3R_VVV<0x70350000>;
44006c3fb27SDimitry Andricdef VSUBWOD_Q_DU : LSX3R_VVV<0x70358000>;
44106c3fb27SDimitry Andric
44206c3fb27SDimitry Andricdef VADDWEV_H_BU_B : LSX3R_VVV<0x703e0000>;
44306c3fb27SDimitry Andricdef VADDWEV_W_HU_H : LSX3R_VVV<0x703e8000>;
44406c3fb27SDimitry Andricdef VADDWEV_D_WU_W : LSX3R_VVV<0x703f0000>;
44506c3fb27SDimitry Andricdef VADDWEV_Q_DU_D : LSX3R_VVV<0x703f8000>;
44606c3fb27SDimitry Andricdef VADDWOD_H_BU_B : LSX3R_VVV<0x70400000>;
44706c3fb27SDimitry Andricdef VADDWOD_W_HU_H : LSX3R_VVV<0x70408000>;
44806c3fb27SDimitry Andricdef VADDWOD_D_WU_W : LSX3R_VVV<0x70410000>;
44906c3fb27SDimitry Andricdef VADDWOD_Q_DU_D : LSX3R_VVV<0x70418000>;
45006c3fb27SDimitry Andric
45106c3fb27SDimitry Andricdef VAVG_B : LSX3R_VVV<0x70640000>;
45206c3fb27SDimitry Andricdef VAVG_H : LSX3R_VVV<0x70648000>;
45306c3fb27SDimitry Andricdef VAVG_W : LSX3R_VVV<0x70650000>;
45406c3fb27SDimitry Andricdef VAVG_D : LSX3R_VVV<0x70658000>;
45506c3fb27SDimitry Andricdef VAVG_BU : LSX3R_VVV<0x70660000>;
45606c3fb27SDimitry Andricdef VAVG_HU : LSX3R_VVV<0x70668000>;
45706c3fb27SDimitry Andricdef VAVG_WU : LSX3R_VVV<0x70670000>;
45806c3fb27SDimitry Andricdef VAVG_DU : LSX3R_VVV<0x70678000>;
45906c3fb27SDimitry Andricdef VAVGR_B : LSX3R_VVV<0x70680000>;
46006c3fb27SDimitry Andricdef VAVGR_H : LSX3R_VVV<0x70688000>;
46106c3fb27SDimitry Andricdef VAVGR_W : LSX3R_VVV<0x70690000>;
46206c3fb27SDimitry Andricdef VAVGR_D : LSX3R_VVV<0x70698000>;
46306c3fb27SDimitry Andricdef VAVGR_BU : LSX3R_VVV<0x706a0000>;
46406c3fb27SDimitry Andricdef VAVGR_HU : LSX3R_VVV<0x706a8000>;
46506c3fb27SDimitry Andricdef VAVGR_WU : LSX3R_VVV<0x706b0000>;
46606c3fb27SDimitry Andricdef VAVGR_DU : LSX3R_VVV<0x706b8000>;
46706c3fb27SDimitry Andric
46806c3fb27SDimitry Andricdef VABSD_B : LSX3R_VVV<0x70600000>;
46906c3fb27SDimitry Andricdef VABSD_H : LSX3R_VVV<0x70608000>;
47006c3fb27SDimitry Andricdef VABSD_W : LSX3R_VVV<0x70610000>;
47106c3fb27SDimitry Andricdef VABSD_D : LSX3R_VVV<0x70618000>;
47206c3fb27SDimitry Andricdef VABSD_BU : LSX3R_VVV<0x70620000>;
47306c3fb27SDimitry Andricdef VABSD_HU : LSX3R_VVV<0x70628000>;
47406c3fb27SDimitry Andricdef VABSD_WU : LSX3R_VVV<0x70630000>;
47506c3fb27SDimitry Andricdef VABSD_DU : LSX3R_VVV<0x70638000>;
47606c3fb27SDimitry Andric
47706c3fb27SDimitry Andricdef VADDA_B : LSX3R_VVV<0x705c0000>;
47806c3fb27SDimitry Andricdef VADDA_H : LSX3R_VVV<0x705c8000>;
47906c3fb27SDimitry Andricdef VADDA_W : LSX3R_VVV<0x705d0000>;
48006c3fb27SDimitry Andricdef VADDA_D : LSX3R_VVV<0x705d8000>;
48106c3fb27SDimitry Andric
48206c3fb27SDimitry Andricdef VMAX_B : LSX3R_VVV<0x70700000>;
48306c3fb27SDimitry Andricdef VMAX_H : LSX3R_VVV<0x70708000>;
48406c3fb27SDimitry Andricdef VMAX_W : LSX3R_VVV<0x70710000>;
48506c3fb27SDimitry Andricdef VMAX_D : LSX3R_VVV<0x70718000>;
48606c3fb27SDimitry Andricdef VMAXI_B : LSX2RI5_VVI<0x72900000, simm5>;
48706c3fb27SDimitry Andricdef VMAXI_H : LSX2RI5_VVI<0x72908000, simm5>;
48806c3fb27SDimitry Andricdef VMAXI_W : LSX2RI5_VVI<0x72910000, simm5>;
48906c3fb27SDimitry Andricdef VMAXI_D : LSX2RI5_VVI<0x72918000, simm5>;
49006c3fb27SDimitry Andricdef VMAX_BU : LSX3R_VVV<0x70740000>;
49106c3fb27SDimitry Andricdef VMAX_HU : LSX3R_VVV<0x70748000>;
49206c3fb27SDimitry Andricdef VMAX_WU : LSX3R_VVV<0x70750000>;
49306c3fb27SDimitry Andricdef VMAX_DU : LSX3R_VVV<0x70758000>;
49406c3fb27SDimitry Andricdef VMAXI_BU : LSX2RI5_VVI<0x72940000>;
49506c3fb27SDimitry Andricdef VMAXI_HU : LSX2RI5_VVI<0x72948000>;
49606c3fb27SDimitry Andricdef VMAXI_WU : LSX2RI5_VVI<0x72950000>;
49706c3fb27SDimitry Andricdef VMAXI_DU : LSX2RI5_VVI<0x72958000>;
49806c3fb27SDimitry Andric
49906c3fb27SDimitry Andricdef VMIN_B : LSX3R_VVV<0x70720000>;
50006c3fb27SDimitry Andricdef VMIN_H : LSX3R_VVV<0x70728000>;
50106c3fb27SDimitry Andricdef VMIN_W : LSX3R_VVV<0x70730000>;
50206c3fb27SDimitry Andricdef VMIN_D : LSX3R_VVV<0x70738000>;
50306c3fb27SDimitry Andricdef VMINI_B : LSX2RI5_VVI<0x72920000, simm5>;
50406c3fb27SDimitry Andricdef VMINI_H : LSX2RI5_VVI<0x72928000, simm5>;
50506c3fb27SDimitry Andricdef VMINI_W : LSX2RI5_VVI<0x72930000, simm5>;
50606c3fb27SDimitry Andricdef VMINI_D : LSX2RI5_VVI<0x72938000, simm5>;
50706c3fb27SDimitry Andricdef VMIN_BU : LSX3R_VVV<0x70760000>;
50806c3fb27SDimitry Andricdef VMIN_HU : LSX3R_VVV<0x70768000>;
50906c3fb27SDimitry Andricdef VMIN_WU : LSX3R_VVV<0x70770000>;
51006c3fb27SDimitry Andricdef VMIN_DU : LSX3R_VVV<0x70778000>;
51106c3fb27SDimitry Andricdef VMINI_BU : LSX2RI5_VVI<0x72960000>;
51206c3fb27SDimitry Andricdef VMINI_HU : LSX2RI5_VVI<0x72968000>;
51306c3fb27SDimitry Andricdef VMINI_WU : LSX2RI5_VVI<0x72970000>;
51406c3fb27SDimitry Andricdef VMINI_DU : LSX2RI5_VVI<0x72978000>;
51506c3fb27SDimitry Andric
51606c3fb27SDimitry Andricdef VMUL_B : LSX3R_VVV<0x70840000>;
51706c3fb27SDimitry Andricdef VMUL_H : LSX3R_VVV<0x70848000>;
51806c3fb27SDimitry Andricdef VMUL_W : LSX3R_VVV<0x70850000>;
51906c3fb27SDimitry Andricdef VMUL_D : LSX3R_VVV<0x70858000>;
52006c3fb27SDimitry Andric
52106c3fb27SDimitry Andricdef VMUH_B : LSX3R_VVV<0x70860000>;
52206c3fb27SDimitry Andricdef VMUH_H : LSX3R_VVV<0x70868000>;
52306c3fb27SDimitry Andricdef VMUH_W : LSX3R_VVV<0x70870000>;
52406c3fb27SDimitry Andricdef VMUH_D : LSX3R_VVV<0x70878000>;
52506c3fb27SDimitry Andricdef VMUH_BU : LSX3R_VVV<0x70880000>;
52606c3fb27SDimitry Andricdef VMUH_HU : LSX3R_VVV<0x70888000>;
52706c3fb27SDimitry Andricdef VMUH_WU : LSX3R_VVV<0x70890000>;
52806c3fb27SDimitry Andricdef VMUH_DU : LSX3R_VVV<0x70898000>;
52906c3fb27SDimitry Andric
53006c3fb27SDimitry Andricdef VMULWEV_H_B : LSX3R_VVV<0x70900000>;
53106c3fb27SDimitry Andricdef VMULWEV_W_H : LSX3R_VVV<0x70908000>;
53206c3fb27SDimitry Andricdef VMULWEV_D_W : LSX3R_VVV<0x70910000>;
53306c3fb27SDimitry Andricdef VMULWEV_Q_D : LSX3R_VVV<0x70918000>;
53406c3fb27SDimitry Andricdef VMULWOD_H_B : LSX3R_VVV<0x70920000>;
53506c3fb27SDimitry Andricdef VMULWOD_W_H : LSX3R_VVV<0x70928000>;
53606c3fb27SDimitry Andricdef VMULWOD_D_W : LSX3R_VVV<0x70930000>;
53706c3fb27SDimitry Andricdef VMULWOD_Q_D : LSX3R_VVV<0x70938000>;
53806c3fb27SDimitry Andricdef VMULWEV_H_BU : LSX3R_VVV<0x70980000>;
53906c3fb27SDimitry Andricdef VMULWEV_W_HU : LSX3R_VVV<0x70988000>;
54006c3fb27SDimitry Andricdef VMULWEV_D_WU : LSX3R_VVV<0x70990000>;
54106c3fb27SDimitry Andricdef VMULWEV_Q_DU : LSX3R_VVV<0x70998000>;
54206c3fb27SDimitry Andricdef VMULWOD_H_BU : LSX3R_VVV<0x709a0000>;
54306c3fb27SDimitry Andricdef VMULWOD_W_HU : LSX3R_VVV<0x709a8000>;
54406c3fb27SDimitry Andricdef VMULWOD_D_WU : LSX3R_VVV<0x709b0000>;
54506c3fb27SDimitry Andricdef VMULWOD_Q_DU : LSX3R_VVV<0x709b8000>;
54606c3fb27SDimitry Andricdef VMULWEV_H_BU_B : LSX3R_VVV<0x70a00000>;
54706c3fb27SDimitry Andricdef VMULWEV_W_HU_H : LSX3R_VVV<0x70a08000>;
54806c3fb27SDimitry Andricdef VMULWEV_D_WU_W : LSX3R_VVV<0x70a10000>;
54906c3fb27SDimitry Andricdef VMULWEV_Q_DU_D : LSX3R_VVV<0x70a18000>;
55006c3fb27SDimitry Andricdef VMULWOD_H_BU_B : LSX3R_VVV<0x70a20000>;
55106c3fb27SDimitry Andricdef VMULWOD_W_HU_H : LSX3R_VVV<0x70a28000>;
55206c3fb27SDimitry Andricdef VMULWOD_D_WU_W : LSX3R_VVV<0x70a30000>;
55306c3fb27SDimitry Andricdef VMULWOD_Q_DU_D : LSX3R_VVV<0x70a38000>;
55406c3fb27SDimitry Andric
55506c3fb27SDimitry Andricdef VMADD_B : LSX3R_VVVV<0x70a80000>;
55606c3fb27SDimitry Andricdef VMADD_H : LSX3R_VVVV<0x70a88000>;
55706c3fb27SDimitry Andricdef VMADD_W : LSX3R_VVVV<0x70a90000>;
55806c3fb27SDimitry Andricdef VMADD_D : LSX3R_VVVV<0x70a98000>;
55906c3fb27SDimitry Andric
56006c3fb27SDimitry Andricdef VMSUB_B : LSX3R_VVVV<0x70aa0000>;
56106c3fb27SDimitry Andricdef VMSUB_H : LSX3R_VVVV<0x70aa8000>;
56206c3fb27SDimitry Andricdef VMSUB_W : LSX3R_VVVV<0x70ab0000>;
56306c3fb27SDimitry Andricdef VMSUB_D : LSX3R_VVVV<0x70ab8000>;
56406c3fb27SDimitry Andric
56506c3fb27SDimitry Andricdef VMADDWEV_H_B : LSX3R_VVVV<0x70ac0000>;
56606c3fb27SDimitry Andricdef VMADDWEV_W_H : LSX3R_VVVV<0x70ac8000>;
56706c3fb27SDimitry Andricdef VMADDWEV_D_W : LSX3R_VVVV<0x70ad0000>;
56806c3fb27SDimitry Andricdef VMADDWEV_Q_D : LSX3R_VVVV<0x70ad8000>;
56906c3fb27SDimitry Andricdef VMADDWOD_H_B : LSX3R_VVVV<0x70ae0000>;
57006c3fb27SDimitry Andricdef VMADDWOD_W_H : LSX3R_VVVV<0x70ae8000>;
57106c3fb27SDimitry Andricdef VMADDWOD_D_W : LSX3R_VVVV<0x70af0000>;
57206c3fb27SDimitry Andricdef VMADDWOD_Q_D : LSX3R_VVVV<0x70af8000>;
57306c3fb27SDimitry Andricdef VMADDWEV_H_BU : LSX3R_VVVV<0x70b40000>;
57406c3fb27SDimitry Andricdef VMADDWEV_W_HU : LSX3R_VVVV<0x70b48000>;
57506c3fb27SDimitry Andricdef VMADDWEV_D_WU : LSX3R_VVVV<0x70b50000>;
57606c3fb27SDimitry Andricdef VMADDWEV_Q_DU : LSX3R_VVVV<0x70b58000>;
57706c3fb27SDimitry Andricdef VMADDWOD_H_BU : LSX3R_VVVV<0x70b60000>;
57806c3fb27SDimitry Andricdef VMADDWOD_W_HU : LSX3R_VVVV<0x70b68000>;
57906c3fb27SDimitry Andricdef VMADDWOD_D_WU : LSX3R_VVVV<0x70b70000>;
58006c3fb27SDimitry Andricdef VMADDWOD_Q_DU : LSX3R_VVVV<0x70b78000>;
58106c3fb27SDimitry Andricdef VMADDWEV_H_BU_B : LSX3R_VVVV<0x70bc0000>;
58206c3fb27SDimitry Andricdef VMADDWEV_W_HU_H : LSX3R_VVVV<0x70bc8000>;
58306c3fb27SDimitry Andricdef VMADDWEV_D_WU_W : LSX3R_VVVV<0x70bd0000>;
58406c3fb27SDimitry Andricdef VMADDWEV_Q_DU_D : LSX3R_VVVV<0x70bd8000>;
58506c3fb27SDimitry Andricdef VMADDWOD_H_BU_B : LSX3R_VVVV<0x70be0000>;
58606c3fb27SDimitry Andricdef VMADDWOD_W_HU_H : LSX3R_VVVV<0x70be8000>;
58706c3fb27SDimitry Andricdef VMADDWOD_D_WU_W : LSX3R_VVVV<0x70bf0000>;
58806c3fb27SDimitry Andricdef VMADDWOD_Q_DU_D : LSX3R_VVVV<0x70bf8000>;
58906c3fb27SDimitry Andric
59006c3fb27SDimitry Andricdef VDIV_B : LSX3R_VVV<0x70e00000>;
59106c3fb27SDimitry Andricdef VDIV_H : LSX3R_VVV<0x70e08000>;
59206c3fb27SDimitry Andricdef VDIV_W : LSX3R_VVV<0x70e10000>;
59306c3fb27SDimitry Andricdef VDIV_D : LSX3R_VVV<0x70e18000>;
59406c3fb27SDimitry Andricdef VDIV_BU : LSX3R_VVV<0x70e40000>;
59506c3fb27SDimitry Andricdef VDIV_HU : LSX3R_VVV<0x70e48000>;
59606c3fb27SDimitry Andricdef VDIV_WU : LSX3R_VVV<0x70e50000>;
59706c3fb27SDimitry Andricdef VDIV_DU : LSX3R_VVV<0x70e58000>;
59806c3fb27SDimitry Andric
59906c3fb27SDimitry Andricdef VMOD_B : LSX3R_VVV<0x70e20000>;
60006c3fb27SDimitry Andricdef VMOD_H : LSX3R_VVV<0x70e28000>;
60106c3fb27SDimitry Andricdef VMOD_W : LSX3R_VVV<0x70e30000>;
60206c3fb27SDimitry Andricdef VMOD_D : LSX3R_VVV<0x70e38000>;
60306c3fb27SDimitry Andricdef VMOD_BU : LSX3R_VVV<0x70e60000>;
60406c3fb27SDimitry Andricdef VMOD_HU : LSX3R_VVV<0x70e68000>;
60506c3fb27SDimitry Andricdef VMOD_WU : LSX3R_VVV<0x70e70000>;
60606c3fb27SDimitry Andricdef VMOD_DU : LSX3R_VVV<0x70e78000>;
60706c3fb27SDimitry Andric
60806c3fb27SDimitry Andricdef VSAT_B : LSX2RI3_VVI<0x73242000>;
60906c3fb27SDimitry Andricdef VSAT_H : LSX2RI4_VVI<0x73244000>;
61006c3fb27SDimitry Andricdef VSAT_W : LSX2RI5_VVI<0x73248000>;
61106c3fb27SDimitry Andricdef VSAT_D : LSX2RI6_VVI<0x73250000>;
61206c3fb27SDimitry Andricdef VSAT_BU : LSX2RI3_VVI<0x73282000>;
61306c3fb27SDimitry Andricdef VSAT_HU : LSX2RI4_VVI<0x73284000>;
61406c3fb27SDimitry Andricdef VSAT_WU : LSX2RI5_VVI<0x73288000>;
61506c3fb27SDimitry Andricdef VSAT_DU : LSX2RI6_VVI<0x73290000>;
61606c3fb27SDimitry Andric
61706c3fb27SDimitry Andricdef VEXTH_H_B : LSX2R_VV<0x729ee000>;
61806c3fb27SDimitry Andricdef VEXTH_W_H : LSX2R_VV<0x729ee400>;
61906c3fb27SDimitry Andricdef VEXTH_D_W : LSX2R_VV<0x729ee800>;
62006c3fb27SDimitry Andricdef VEXTH_Q_D : LSX2R_VV<0x729eec00>;
62106c3fb27SDimitry Andricdef VEXTH_HU_BU : LSX2R_VV<0x729ef000>;
62206c3fb27SDimitry Andricdef VEXTH_WU_HU : LSX2R_VV<0x729ef400>;
62306c3fb27SDimitry Andricdef VEXTH_DU_WU : LSX2R_VV<0x729ef800>;
62406c3fb27SDimitry Andricdef VEXTH_QU_DU : LSX2R_VV<0x729efc00>;
62506c3fb27SDimitry Andric
62606c3fb27SDimitry Andricdef VSIGNCOV_B : LSX3R_VVV<0x712e0000>;
62706c3fb27SDimitry Andricdef VSIGNCOV_H : LSX3R_VVV<0x712e8000>;
62806c3fb27SDimitry Andricdef VSIGNCOV_W : LSX3R_VVV<0x712f0000>;
62906c3fb27SDimitry Andricdef VSIGNCOV_D : LSX3R_VVV<0x712f8000>;
63006c3fb27SDimitry Andric
63106c3fb27SDimitry Andricdef VMSKLTZ_B : LSX2R_VV<0x729c4000>;
63206c3fb27SDimitry Andricdef VMSKLTZ_H : LSX2R_VV<0x729c4400>;
63306c3fb27SDimitry Andricdef VMSKLTZ_W : LSX2R_VV<0x729c4800>;
63406c3fb27SDimitry Andricdef VMSKLTZ_D : LSX2R_VV<0x729c4c00>;
63506c3fb27SDimitry Andric
63606c3fb27SDimitry Andricdef VMSKGEZ_B : LSX2R_VV<0x729c5000>;
63706c3fb27SDimitry Andric
63806c3fb27SDimitry Andricdef VMSKNZ_B : LSX2R_VV<0x729c6000>;
63906c3fb27SDimitry Andric
64006c3fb27SDimitry Andricdef VLDI : LSX1RI13_VI<0x73e00000>;
64106c3fb27SDimitry Andric
64206c3fb27SDimitry Andricdef VAND_V : LSX3R_VVV<0x71260000>;
64306c3fb27SDimitry Andricdef VOR_V : LSX3R_VVV<0x71268000>;
64406c3fb27SDimitry Andricdef VXOR_V : LSX3R_VVV<0x71270000>;
64506c3fb27SDimitry Andricdef VNOR_V : LSX3R_VVV<0x71278000>;
64606c3fb27SDimitry Andricdef VANDN_V : LSX3R_VVV<0x71280000>;
64706c3fb27SDimitry Andricdef VORN_V : LSX3R_VVV<0x71288000>;
64806c3fb27SDimitry Andric
64906c3fb27SDimitry Andricdef VANDI_B : LSX2RI8_VVI<0x73d00000>;
65006c3fb27SDimitry Andricdef VORI_B : LSX2RI8_VVI<0x73d40000>;
65106c3fb27SDimitry Andricdef VXORI_B : LSX2RI8_VVI<0x73d80000>;
65206c3fb27SDimitry Andricdef VNORI_B : LSX2RI8_VVI<0x73dc0000>;
65306c3fb27SDimitry Andric
65406c3fb27SDimitry Andricdef VSLL_B : LSX3R_VVV<0x70e80000>;
65506c3fb27SDimitry Andricdef VSLL_H : LSX3R_VVV<0x70e88000>;
65606c3fb27SDimitry Andricdef VSLL_W : LSX3R_VVV<0x70e90000>;
65706c3fb27SDimitry Andricdef VSLL_D : LSX3R_VVV<0x70e98000>;
65806c3fb27SDimitry Andricdef VSLLI_B : LSX2RI3_VVI<0x732c2000>;
65906c3fb27SDimitry Andricdef VSLLI_H : LSX2RI4_VVI<0x732c4000>;
66006c3fb27SDimitry Andricdef VSLLI_W : LSX2RI5_VVI<0x732c8000>;
66106c3fb27SDimitry Andricdef VSLLI_D : LSX2RI6_VVI<0x732d0000>;
66206c3fb27SDimitry Andric
66306c3fb27SDimitry Andricdef VSRL_B : LSX3R_VVV<0x70ea0000>;
66406c3fb27SDimitry Andricdef VSRL_H : LSX3R_VVV<0x70ea8000>;
66506c3fb27SDimitry Andricdef VSRL_W : LSX3R_VVV<0x70eb0000>;
66606c3fb27SDimitry Andricdef VSRL_D : LSX3R_VVV<0x70eb8000>;
66706c3fb27SDimitry Andricdef VSRLI_B : LSX2RI3_VVI<0x73302000>;
66806c3fb27SDimitry Andricdef VSRLI_H : LSX2RI4_VVI<0x73304000>;
66906c3fb27SDimitry Andricdef VSRLI_W : LSX2RI5_VVI<0x73308000>;
67006c3fb27SDimitry Andricdef VSRLI_D : LSX2RI6_VVI<0x73310000>;
67106c3fb27SDimitry Andric
67206c3fb27SDimitry Andricdef VSRA_B : LSX3R_VVV<0x70ec0000>;
67306c3fb27SDimitry Andricdef VSRA_H : LSX3R_VVV<0x70ec8000>;
67406c3fb27SDimitry Andricdef VSRA_W : LSX3R_VVV<0x70ed0000>;
67506c3fb27SDimitry Andricdef VSRA_D : LSX3R_VVV<0x70ed8000>;
67606c3fb27SDimitry Andricdef VSRAI_B : LSX2RI3_VVI<0x73342000>;
67706c3fb27SDimitry Andricdef VSRAI_H : LSX2RI4_VVI<0x73344000>;
67806c3fb27SDimitry Andricdef VSRAI_W : LSX2RI5_VVI<0x73348000>;
67906c3fb27SDimitry Andricdef VSRAI_D : LSX2RI6_VVI<0x73350000>;
68006c3fb27SDimitry Andric
68106c3fb27SDimitry Andricdef VROTR_B : LSX3R_VVV<0x70ee0000>;
68206c3fb27SDimitry Andricdef VROTR_H : LSX3R_VVV<0x70ee8000>;
68306c3fb27SDimitry Andricdef VROTR_W : LSX3R_VVV<0x70ef0000>;
68406c3fb27SDimitry Andricdef VROTR_D : LSX3R_VVV<0x70ef8000>;
68506c3fb27SDimitry Andricdef VROTRI_B : LSX2RI3_VVI<0x72a02000>;
68606c3fb27SDimitry Andricdef VROTRI_H : LSX2RI4_VVI<0x72a04000>;
68706c3fb27SDimitry Andricdef VROTRI_W : LSX2RI5_VVI<0x72a08000>;
68806c3fb27SDimitry Andricdef VROTRI_D : LSX2RI6_VVI<0x72a10000>;
68906c3fb27SDimitry Andric
69006c3fb27SDimitry Andricdef VSLLWIL_H_B : LSX2RI3_VVI<0x73082000>;
69106c3fb27SDimitry Andricdef VSLLWIL_W_H : LSX2RI4_VVI<0x73084000>;
69206c3fb27SDimitry Andricdef VSLLWIL_D_W : LSX2RI5_VVI<0x73088000>;
69306c3fb27SDimitry Andricdef VEXTL_Q_D : LSX2R_VV<0x73090000>;
69406c3fb27SDimitry Andricdef VSLLWIL_HU_BU : LSX2RI3_VVI<0x730c2000>;
69506c3fb27SDimitry Andricdef VSLLWIL_WU_HU : LSX2RI4_VVI<0x730c4000>;
69606c3fb27SDimitry Andricdef VSLLWIL_DU_WU : LSX2RI5_VVI<0x730c8000>;
69706c3fb27SDimitry Andricdef VEXTL_QU_DU : LSX2R_VV<0x730d0000>;
69806c3fb27SDimitry Andric
69906c3fb27SDimitry Andricdef VSRLR_B : LSX3R_VVV<0x70f00000>;
70006c3fb27SDimitry Andricdef VSRLR_H : LSX3R_VVV<0x70f08000>;
70106c3fb27SDimitry Andricdef VSRLR_W : LSX3R_VVV<0x70f10000>;
70206c3fb27SDimitry Andricdef VSRLR_D : LSX3R_VVV<0x70f18000>;
70306c3fb27SDimitry Andricdef VSRLRI_B : LSX2RI3_VVI<0x72a42000>;
70406c3fb27SDimitry Andricdef VSRLRI_H : LSX2RI4_VVI<0x72a44000>;
70506c3fb27SDimitry Andricdef VSRLRI_W : LSX2RI5_VVI<0x72a48000>;
70606c3fb27SDimitry Andricdef VSRLRI_D : LSX2RI6_VVI<0x72a50000>;
70706c3fb27SDimitry Andric
70806c3fb27SDimitry Andricdef VSRAR_B : LSX3R_VVV<0x70f20000>;
70906c3fb27SDimitry Andricdef VSRAR_H : LSX3R_VVV<0x70f28000>;
71006c3fb27SDimitry Andricdef VSRAR_W : LSX3R_VVV<0x70f30000>;
71106c3fb27SDimitry Andricdef VSRAR_D : LSX3R_VVV<0x70f38000>;
71206c3fb27SDimitry Andricdef VSRARI_B : LSX2RI3_VVI<0x72a82000>;
71306c3fb27SDimitry Andricdef VSRARI_H : LSX2RI4_VVI<0x72a84000>;
71406c3fb27SDimitry Andricdef VSRARI_W : LSX2RI5_VVI<0x72a88000>;
71506c3fb27SDimitry Andricdef VSRARI_D : LSX2RI6_VVI<0x72a90000>;
71606c3fb27SDimitry Andric
71706c3fb27SDimitry Andricdef VSRLN_B_H : LSX3R_VVV<0x70f48000>;
71806c3fb27SDimitry Andricdef VSRLN_H_W : LSX3R_VVV<0x70f50000>;
71906c3fb27SDimitry Andricdef VSRLN_W_D : LSX3R_VVV<0x70f58000>;
72006c3fb27SDimitry Andricdef VSRAN_B_H : LSX3R_VVV<0x70f68000>;
72106c3fb27SDimitry Andricdef VSRAN_H_W : LSX3R_VVV<0x70f70000>;
72206c3fb27SDimitry Andricdef VSRAN_W_D : LSX3R_VVV<0x70f78000>;
72306c3fb27SDimitry Andric
72406c3fb27SDimitry Andricdef VSRLNI_B_H : LSX2RI4_VVVI<0x73404000>;
72506c3fb27SDimitry Andricdef VSRLNI_H_W : LSX2RI5_VVVI<0x73408000>;
72606c3fb27SDimitry Andricdef VSRLNI_W_D : LSX2RI6_VVVI<0x73410000>;
72706c3fb27SDimitry Andricdef VSRLNI_D_Q : LSX2RI7_VVVI<0x73420000>;
72806c3fb27SDimitry Andricdef VSRANI_B_H : LSX2RI4_VVVI<0x73584000>;
72906c3fb27SDimitry Andricdef VSRANI_H_W : LSX2RI5_VVVI<0x73588000>;
73006c3fb27SDimitry Andricdef VSRANI_W_D : LSX2RI6_VVVI<0x73590000>;
73106c3fb27SDimitry Andricdef VSRANI_D_Q : LSX2RI7_VVVI<0x735a0000>;
73206c3fb27SDimitry Andric
73306c3fb27SDimitry Andricdef VSRLRN_B_H : LSX3R_VVV<0x70f88000>;
73406c3fb27SDimitry Andricdef VSRLRN_H_W : LSX3R_VVV<0x70f90000>;
73506c3fb27SDimitry Andricdef VSRLRN_W_D : LSX3R_VVV<0x70f98000>;
73606c3fb27SDimitry Andricdef VSRARN_B_H : LSX3R_VVV<0x70fa8000>;
73706c3fb27SDimitry Andricdef VSRARN_H_W : LSX3R_VVV<0x70fb0000>;
73806c3fb27SDimitry Andricdef VSRARN_W_D : LSX3R_VVV<0x70fb8000>;
73906c3fb27SDimitry Andric
74006c3fb27SDimitry Andricdef VSRLRNI_B_H : LSX2RI4_VVVI<0x73444000>;
74106c3fb27SDimitry Andricdef VSRLRNI_H_W : LSX2RI5_VVVI<0x73448000>;
74206c3fb27SDimitry Andricdef VSRLRNI_W_D : LSX2RI6_VVVI<0x73450000>;
74306c3fb27SDimitry Andricdef VSRLRNI_D_Q : LSX2RI7_VVVI<0x73460000>;
74406c3fb27SDimitry Andricdef VSRARNI_B_H : LSX2RI4_VVVI<0x735c4000>;
74506c3fb27SDimitry Andricdef VSRARNI_H_W : LSX2RI5_VVVI<0x735c8000>;
74606c3fb27SDimitry Andricdef VSRARNI_W_D : LSX2RI6_VVVI<0x735d0000>;
74706c3fb27SDimitry Andricdef VSRARNI_D_Q : LSX2RI7_VVVI<0x735e0000>;
74806c3fb27SDimitry Andric
74906c3fb27SDimitry Andricdef VSSRLN_B_H : LSX3R_VVV<0x70fc8000>;
75006c3fb27SDimitry Andricdef VSSRLN_H_W : LSX3R_VVV<0x70fd0000>;
75106c3fb27SDimitry Andricdef VSSRLN_W_D : LSX3R_VVV<0x70fd8000>;
75206c3fb27SDimitry Andricdef VSSRAN_B_H : LSX3R_VVV<0x70fe8000>;
75306c3fb27SDimitry Andricdef VSSRAN_H_W : LSX3R_VVV<0x70ff0000>;
75406c3fb27SDimitry Andricdef VSSRAN_W_D : LSX3R_VVV<0x70ff8000>;
75506c3fb27SDimitry Andricdef VSSRLN_BU_H : LSX3R_VVV<0x71048000>;
75606c3fb27SDimitry Andricdef VSSRLN_HU_W : LSX3R_VVV<0x71050000>;
75706c3fb27SDimitry Andricdef VSSRLN_WU_D : LSX3R_VVV<0x71058000>;
75806c3fb27SDimitry Andricdef VSSRAN_BU_H : LSX3R_VVV<0x71068000>;
75906c3fb27SDimitry Andricdef VSSRAN_HU_W : LSX3R_VVV<0x71070000>;
76006c3fb27SDimitry Andricdef VSSRAN_WU_D : LSX3R_VVV<0x71078000>;
76106c3fb27SDimitry Andric
76206c3fb27SDimitry Andricdef VSSRLNI_B_H : LSX2RI4_VVVI<0x73484000>;
76306c3fb27SDimitry Andricdef VSSRLNI_H_W : LSX2RI5_VVVI<0x73488000>;
76406c3fb27SDimitry Andricdef VSSRLNI_W_D : LSX2RI6_VVVI<0x73490000>;
76506c3fb27SDimitry Andricdef VSSRLNI_D_Q : LSX2RI7_VVVI<0x734a0000>;
76606c3fb27SDimitry Andricdef VSSRANI_B_H : LSX2RI4_VVVI<0x73604000>;
76706c3fb27SDimitry Andricdef VSSRANI_H_W : LSX2RI5_VVVI<0x73608000>;
76806c3fb27SDimitry Andricdef VSSRANI_W_D : LSX2RI6_VVVI<0x73610000>;
76906c3fb27SDimitry Andricdef VSSRANI_D_Q : LSX2RI7_VVVI<0x73620000>;
77006c3fb27SDimitry Andricdef VSSRLNI_BU_H : LSX2RI4_VVVI<0x734c4000>;
77106c3fb27SDimitry Andricdef VSSRLNI_HU_W : LSX2RI5_VVVI<0x734c8000>;
77206c3fb27SDimitry Andricdef VSSRLNI_WU_D : LSX2RI6_VVVI<0x734d0000>;
77306c3fb27SDimitry Andricdef VSSRLNI_DU_Q : LSX2RI7_VVVI<0x734e0000>;
77406c3fb27SDimitry Andricdef VSSRANI_BU_H : LSX2RI4_VVVI<0x73644000>;
77506c3fb27SDimitry Andricdef VSSRANI_HU_W : LSX2RI5_VVVI<0x73648000>;
77606c3fb27SDimitry Andricdef VSSRANI_WU_D : LSX2RI6_VVVI<0x73650000>;
77706c3fb27SDimitry Andricdef VSSRANI_DU_Q : LSX2RI7_VVVI<0x73660000>;
77806c3fb27SDimitry Andric
77906c3fb27SDimitry Andricdef VSSRLRN_B_H : LSX3R_VVV<0x71008000>;
78006c3fb27SDimitry Andricdef VSSRLRN_H_W : LSX3R_VVV<0x71010000>;
78106c3fb27SDimitry Andricdef VSSRLRN_W_D : LSX3R_VVV<0x71018000>;
78206c3fb27SDimitry Andricdef VSSRARN_B_H : LSX3R_VVV<0x71028000>;
78306c3fb27SDimitry Andricdef VSSRARN_H_W : LSX3R_VVV<0x71030000>;
78406c3fb27SDimitry Andricdef VSSRARN_W_D : LSX3R_VVV<0x71038000>;
78506c3fb27SDimitry Andricdef VSSRLRN_BU_H : LSX3R_VVV<0x71088000>;
78606c3fb27SDimitry Andricdef VSSRLRN_HU_W : LSX3R_VVV<0x71090000>;
78706c3fb27SDimitry Andricdef VSSRLRN_WU_D : LSX3R_VVV<0x71098000>;
78806c3fb27SDimitry Andricdef VSSRARN_BU_H : LSX3R_VVV<0x710a8000>;
78906c3fb27SDimitry Andricdef VSSRARN_HU_W : LSX3R_VVV<0x710b0000>;
79006c3fb27SDimitry Andricdef VSSRARN_WU_D : LSX3R_VVV<0x710b8000>;
79106c3fb27SDimitry Andric
79206c3fb27SDimitry Andricdef VSSRLRNI_B_H : LSX2RI4_VVVI<0x73504000>;
79306c3fb27SDimitry Andricdef VSSRLRNI_H_W : LSX2RI5_VVVI<0x73508000>;
79406c3fb27SDimitry Andricdef VSSRLRNI_W_D : LSX2RI6_VVVI<0x73510000>;
79506c3fb27SDimitry Andricdef VSSRLRNI_D_Q : LSX2RI7_VVVI<0x73520000>;
79606c3fb27SDimitry Andricdef VSSRARNI_B_H : LSX2RI4_VVVI<0x73684000>;
79706c3fb27SDimitry Andricdef VSSRARNI_H_W : LSX2RI5_VVVI<0x73688000>;
79806c3fb27SDimitry Andricdef VSSRARNI_W_D : LSX2RI6_VVVI<0x73690000>;
79906c3fb27SDimitry Andricdef VSSRARNI_D_Q : LSX2RI7_VVVI<0x736a0000>;
80006c3fb27SDimitry Andricdef VSSRLRNI_BU_H : LSX2RI4_VVVI<0x73544000>;
80106c3fb27SDimitry Andricdef VSSRLRNI_HU_W : LSX2RI5_VVVI<0x73548000>;
80206c3fb27SDimitry Andricdef VSSRLRNI_WU_D : LSX2RI6_VVVI<0x73550000>;
80306c3fb27SDimitry Andricdef VSSRLRNI_DU_Q : LSX2RI7_VVVI<0x73560000>;
80406c3fb27SDimitry Andricdef VSSRARNI_BU_H : LSX2RI4_VVVI<0x736c4000>;
80506c3fb27SDimitry Andricdef VSSRARNI_HU_W : LSX2RI5_VVVI<0x736c8000>;
80606c3fb27SDimitry Andricdef VSSRARNI_WU_D : LSX2RI6_VVVI<0x736d0000>;
80706c3fb27SDimitry Andricdef VSSRARNI_DU_Q : LSX2RI7_VVVI<0x736e0000>;
80806c3fb27SDimitry Andric
80906c3fb27SDimitry Andricdef VCLO_B : LSX2R_VV<0x729c0000>;
81006c3fb27SDimitry Andricdef VCLO_H : LSX2R_VV<0x729c0400>;
81106c3fb27SDimitry Andricdef VCLO_W : LSX2R_VV<0x729c0800>;
81206c3fb27SDimitry Andricdef VCLO_D : LSX2R_VV<0x729c0c00>;
81306c3fb27SDimitry Andricdef VCLZ_B : LSX2R_VV<0x729c1000>;
81406c3fb27SDimitry Andricdef VCLZ_H : LSX2R_VV<0x729c1400>;
81506c3fb27SDimitry Andricdef VCLZ_W : LSX2R_VV<0x729c1800>;
81606c3fb27SDimitry Andricdef VCLZ_D : LSX2R_VV<0x729c1c00>;
81706c3fb27SDimitry Andric
81806c3fb27SDimitry Andricdef VPCNT_B : LSX2R_VV<0x729c2000>;
81906c3fb27SDimitry Andricdef VPCNT_H : LSX2R_VV<0x729c2400>;
82006c3fb27SDimitry Andricdef VPCNT_W : LSX2R_VV<0x729c2800>;
82106c3fb27SDimitry Andricdef VPCNT_D : LSX2R_VV<0x729c2c00>;
82206c3fb27SDimitry Andric
82306c3fb27SDimitry Andricdef VBITCLR_B : LSX3R_VVV<0x710c0000>;
82406c3fb27SDimitry Andricdef VBITCLR_H : LSX3R_VVV<0x710c8000>;
82506c3fb27SDimitry Andricdef VBITCLR_W : LSX3R_VVV<0x710d0000>;
82606c3fb27SDimitry Andricdef VBITCLR_D : LSX3R_VVV<0x710d8000>;
82706c3fb27SDimitry Andricdef VBITCLRI_B : LSX2RI3_VVI<0x73102000>;
82806c3fb27SDimitry Andricdef VBITCLRI_H : LSX2RI4_VVI<0x73104000>;
82906c3fb27SDimitry Andricdef VBITCLRI_W : LSX2RI5_VVI<0x73108000>;
83006c3fb27SDimitry Andricdef VBITCLRI_D : LSX2RI6_VVI<0x73110000>;
83106c3fb27SDimitry Andric
83206c3fb27SDimitry Andricdef VBITSET_B : LSX3R_VVV<0x710e0000>;
83306c3fb27SDimitry Andricdef VBITSET_H : LSX3R_VVV<0x710e8000>;
83406c3fb27SDimitry Andricdef VBITSET_W : LSX3R_VVV<0x710f0000>;
83506c3fb27SDimitry Andricdef VBITSET_D : LSX3R_VVV<0x710f8000>;
83606c3fb27SDimitry Andricdef VBITSETI_B : LSX2RI3_VVI<0x73142000>;
83706c3fb27SDimitry Andricdef VBITSETI_H : LSX2RI4_VVI<0x73144000>;
83806c3fb27SDimitry Andricdef VBITSETI_W : LSX2RI5_VVI<0x73148000>;
83906c3fb27SDimitry Andricdef VBITSETI_D : LSX2RI6_VVI<0x73150000>;
84006c3fb27SDimitry Andric
84106c3fb27SDimitry Andricdef VBITREV_B : LSX3R_VVV<0x71100000>;
84206c3fb27SDimitry Andricdef VBITREV_H : LSX3R_VVV<0x71108000>;
84306c3fb27SDimitry Andricdef VBITREV_W : LSX3R_VVV<0x71110000>;
84406c3fb27SDimitry Andricdef VBITREV_D : LSX3R_VVV<0x71118000>;
84506c3fb27SDimitry Andricdef VBITREVI_B : LSX2RI3_VVI<0x73182000>;
84606c3fb27SDimitry Andricdef VBITREVI_H : LSX2RI4_VVI<0x73184000>;
84706c3fb27SDimitry Andricdef VBITREVI_W : LSX2RI5_VVI<0x73188000>;
84806c3fb27SDimitry Andricdef VBITREVI_D : LSX2RI6_VVI<0x73190000>;
84906c3fb27SDimitry Andric
85006c3fb27SDimitry Andricdef VFRSTP_B : LSX3R_VVVV<0x712b0000>;
85106c3fb27SDimitry Andricdef VFRSTP_H : LSX3R_VVVV<0x712b8000>;
85206c3fb27SDimitry Andricdef VFRSTPI_B : LSX2RI5_VVVI<0x729a0000>;
85306c3fb27SDimitry Andricdef VFRSTPI_H : LSX2RI5_VVVI<0x729a8000>;
85406c3fb27SDimitry Andric
85506c3fb27SDimitry Andricdef VFADD_S : LSX3R_VVV<0x71308000>;
85606c3fb27SDimitry Andricdef VFADD_D : LSX3R_VVV<0x71310000>;
85706c3fb27SDimitry Andricdef VFSUB_S : LSX3R_VVV<0x71328000>;
85806c3fb27SDimitry Andricdef VFSUB_D : LSX3R_VVV<0x71330000>;
85906c3fb27SDimitry Andricdef VFMUL_S : LSX3R_VVV<0x71388000>;
86006c3fb27SDimitry Andricdef VFMUL_D : LSX3R_VVV<0x71390000>;
86106c3fb27SDimitry Andricdef VFDIV_S : LSX3R_VVV<0x713a8000>;
86206c3fb27SDimitry Andricdef VFDIV_D : LSX3R_VVV<0x713b0000>;
86306c3fb27SDimitry Andric
86406c3fb27SDimitry Andricdef VFMADD_S : LSX4R_VVVV<0x09100000>;
86506c3fb27SDimitry Andricdef VFMADD_D : LSX4R_VVVV<0x09200000>;
86606c3fb27SDimitry Andricdef VFMSUB_S : LSX4R_VVVV<0x09500000>;
86706c3fb27SDimitry Andricdef VFMSUB_D : LSX4R_VVVV<0x09600000>;
86806c3fb27SDimitry Andricdef VFNMADD_S : LSX4R_VVVV<0x09900000>;
86906c3fb27SDimitry Andricdef VFNMADD_D : LSX4R_VVVV<0x09a00000>;
87006c3fb27SDimitry Andricdef VFNMSUB_S : LSX4R_VVVV<0x09d00000>;
87106c3fb27SDimitry Andricdef VFNMSUB_D : LSX4R_VVVV<0x09e00000>;
87206c3fb27SDimitry Andric
87306c3fb27SDimitry Andricdef VFMAX_S : LSX3R_VVV<0x713c8000>;
87406c3fb27SDimitry Andricdef VFMAX_D : LSX3R_VVV<0x713d0000>;
87506c3fb27SDimitry Andricdef VFMIN_S : LSX3R_VVV<0x713e8000>;
87606c3fb27SDimitry Andricdef VFMIN_D : LSX3R_VVV<0x713f0000>;
87706c3fb27SDimitry Andric
87806c3fb27SDimitry Andricdef VFMAXA_S : LSX3R_VVV<0x71408000>;
87906c3fb27SDimitry Andricdef VFMAXA_D : LSX3R_VVV<0x71410000>;
88006c3fb27SDimitry Andricdef VFMINA_S : LSX3R_VVV<0x71428000>;
88106c3fb27SDimitry Andricdef VFMINA_D : LSX3R_VVV<0x71430000>;
88206c3fb27SDimitry Andric
88306c3fb27SDimitry Andricdef VFLOGB_S : LSX2R_VV<0x729cc400>;
88406c3fb27SDimitry Andricdef VFLOGB_D : LSX2R_VV<0x729cc800>;
88506c3fb27SDimitry Andric
88606c3fb27SDimitry Andricdef VFCLASS_S : LSX2R_VV<0x729cd400>;
88706c3fb27SDimitry Andricdef VFCLASS_D : LSX2R_VV<0x729cd800>;
88806c3fb27SDimitry Andric
88906c3fb27SDimitry Andricdef VFSQRT_S : LSX2R_VV<0x729ce400>;
89006c3fb27SDimitry Andricdef VFSQRT_D : LSX2R_VV<0x729ce800>;
89106c3fb27SDimitry Andricdef VFRECIP_S : LSX2R_VV<0x729cf400>;
89206c3fb27SDimitry Andricdef VFRECIP_D : LSX2R_VV<0x729cf800>;
89306c3fb27SDimitry Andricdef VFRSQRT_S : LSX2R_VV<0x729d0400>;
89406c3fb27SDimitry Andricdef VFRSQRT_D : LSX2R_VV<0x729d0800>;
89506c3fb27SDimitry Andric
89606c3fb27SDimitry Andricdef VFCVTL_S_H : LSX2R_VV<0x729de800>;
89706c3fb27SDimitry Andricdef VFCVTH_S_H : LSX2R_VV<0x729dec00>;
89806c3fb27SDimitry Andricdef VFCVTL_D_S : LSX2R_VV<0x729df000>;
89906c3fb27SDimitry Andricdef VFCVTH_D_S : LSX2R_VV<0x729df400>;
90006c3fb27SDimitry Andricdef VFCVT_H_S : LSX3R_VVV<0x71460000>;
90106c3fb27SDimitry Andricdef VFCVT_S_D : LSX3R_VVV<0x71468000>;
90206c3fb27SDimitry Andric
90306c3fb27SDimitry Andricdef VFRINTRNE_S : LSX2R_VV<0x729d7400>;
90406c3fb27SDimitry Andricdef VFRINTRNE_D : LSX2R_VV<0x729d7800>;
90506c3fb27SDimitry Andricdef VFRINTRZ_S : LSX2R_VV<0x729d6400>;
90606c3fb27SDimitry Andricdef VFRINTRZ_D : LSX2R_VV<0x729d6800>;
90706c3fb27SDimitry Andricdef VFRINTRP_S : LSX2R_VV<0x729d5400>;
90806c3fb27SDimitry Andricdef VFRINTRP_D : LSX2R_VV<0x729d5800>;
90906c3fb27SDimitry Andricdef VFRINTRM_S : LSX2R_VV<0x729d4400>;
91006c3fb27SDimitry Andricdef VFRINTRM_D : LSX2R_VV<0x729d4800>;
91106c3fb27SDimitry Andricdef VFRINT_S : LSX2R_VV<0x729d3400>;
91206c3fb27SDimitry Andricdef VFRINT_D : LSX2R_VV<0x729d3800>;
91306c3fb27SDimitry Andric
91406c3fb27SDimitry Andricdef VFTINTRNE_W_S : LSX2R_VV<0x729e5000>;
91506c3fb27SDimitry Andricdef VFTINTRNE_L_D : LSX2R_VV<0x729e5400>;
91606c3fb27SDimitry Andricdef VFTINTRZ_W_S : LSX2R_VV<0x729e4800>;
91706c3fb27SDimitry Andricdef VFTINTRZ_L_D : LSX2R_VV<0x729e4c00>;
91806c3fb27SDimitry Andricdef VFTINTRP_W_S : LSX2R_VV<0x729e4000>;
91906c3fb27SDimitry Andricdef VFTINTRP_L_D : LSX2R_VV<0x729e4400>;
92006c3fb27SDimitry Andricdef VFTINTRM_W_S : LSX2R_VV<0x729e3800>;
92106c3fb27SDimitry Andricdef VFTINTRM_L_D : LSX2R_VV<0x729e3c00>;
92206c3fb27SDimitry Andricdef VFTINT_W_S : LSX2R_VV<0x729e3000>;
92306c3fb27SDimitry Andricdef VFTINT_L_D : LSX2R_VV<0x729e3400>;
92406c3fb27SDimitry Andricdef VFTINTRZ_WU_S : LSX2R_VV<0x729e7000>;
92506c3fb27SDimitry Andricdef VFTINTRZ_LU_D : LSX2R_VV<0x729e7400>;
92606c3fb27SDimitry Andricdef VFTINT_WU_S : LSX2R_VV<0x729e5800>;
92706c3fb27SDimitry Andricdef VFTINT_LU_D : LSX2R_VV<0x729e5c00>;
92806c3fb27SDimitry Andric
92906c3fb27SDimitry Andricdef VFTINTRNE_W_D : LSX3R_VVV<0x714b8000>;
93006c3fb27SDimitry Andricdef VFTINTRZ_W_D : LSX3R_VVV<0x714b0000>;
93106c3fb27SDimitry Andricdef VFTINTRP_W_D : LSX3R_VVV<0x714a8000>;
93206c3fb27SDimitry Andricdef VFTINTRM_W_D : LSX3R_VVV<0x714a0000>;
93306c3fb27SDimitry Andricdef VFTINT_W_D : LSX3R_VVV<0x71498000>;
93406c3fb27SDimitry Andric
93506c3fb27SDimitry Andricdef VFTINTRNEL_L_S : LSX2R_VV<0x729ea000>;
93606c3fb27SDimitry Andricdef VFTINTRNEH_L_S : LSX2R_VV<0x729ea400>;
93706c3fb27SDimitry Andricdef VFTINTRZL_L_S : LSX2R_VV<0x729e9800>;
93806c3fb27SDimitry Andricdef VFTINTRZH_L_S : LSX2R_VV<0x729e9c00>;
93906c3fb27SDimitry Andricdef VFTINTRPL_L_S : LSX2R_VV<0x729e9000>;
94006c3fb27SDimitry Andricdef VFTINTRPH_L_S : LSX2R_VV<0x729e9400>;
94106c3fb27SDimitry Andricdef VFTINTRML_L_S : LSX2R_VV<0x729e8800>;
94206c3fb27SDimitry Andricdef VFTINTRMH_L_S : LSX2R_VV<0x729e8c00>;
94306c3fb27SDimitry Andricdef VFTINTL_L_S : LSX2R_VV<0x729e8000>;
94406c3fb27SDimitry Andricdef VFTINTH_L_S : LSX2R_VV<0x729e8400>;
94506c3fb27SDimitry Andric
94606c3fb27SDimitry Andricdef VFFINT_S_W : LSX2R_VV<0x729e0000>;
94706c3fb27SDimitry Andricdef VFFINT_D_L : LSX2R_VV<0x729e0800>;
94806c3fb27SDimitry Andricdef VFFINT_S_WU : LSX2R_VV<0x729e0400>;
94906c3fb27SDimitry Andricdef VFFINT_D_LU : LSX2R_VV<0x729e0c00>;
95006c3fb27SDimitry Andricdef VFFINTL_D_W : LSX2R_VV<0x729e1000>;
95106c3fb27SDimitry Andricdef VFFINTH_D_W : LSX2R_VV<0x729e1400>;
95206c3fb27SDimitry Andricdef VFFINT_S_L : LSX3R_VVV<0x71480000>;
95306c3fb27SDimitry Andric
95406c3fb27SDimitry Andricdef VSEQ_B : LSX3R_VVV<0x70000000>;
95506c3fb27SDimitry Andricdef VSEQ_H : LSX3R_VVV<0x70008000>;
95606c3fb27SDimitry Andricdef VSEQ_W : LSX3R_VVV<0x70010000>;
95706c3fb27SDimitry Andricdef VSEQ_D : LSX3R_VVV<0x70018000>;
95806c3fb27SDimitry Andricdef VSEQI_B : LSX2RI5_VVI<0x72800000, simm5>;
95906c3fb27SDimitry Andricdef VSEQI_H : LSX2RI5_VVI<0x72808000, simm5>;
96006c3fb27SDimitry Andricdef VSEQI_W : LSX2RI5_VVI<0x72810000, simm5>;
96106c3fb27SDimitry Andricdef VSEQI_D : LSX2RI5_VVI<0x72818000, simm5>;
96206c3fb27SDimitry Andric
96306c3fb27SDimitry Andricdef VSLE_B : LSX3R_VVV<0x70020000>;
96406c3fb27SDimitry Andricdef VSLE_H : LSX3R_VVV<0x70028000>;
96506c3fb27SDimitry Andricdef VSLE_W : LSX3R_VVV<0x70030000>;
96606c3fb27SDimitry Andricdef VSLE_D : LSX3R_VVV<0x70038000>;
96706c3fb27SDimitry Andricdef VSLEI_B : LSX2RI5_VVI<0x72820000, simm5>;
96806c3fb27SDimitry Andricdef VSLEI_H : LSX2RI5_VVI<0x72828000, simm5>;
96906c3fb27SDimitry Andricdef VSLEI_W : LSX2RI5_VVI<0x72830000, simm5>;
97006c3fb27SDimitry Andricdef VSLEI_D : LSX2RI5_VVI<0x72838000, simm5>;
97106c3fb27SDimitry Andric
97206c3fb27SDimitry Andricdef VSLE_BU : LSX3R_VVV<0x70040000>;
97306c3fb27SDimitry Andricdef VSLE_HU : LSX3R_VVV<0x70048000>;
97406c3fb27SDimitry Andricdef VSLE_WU : LSX3R_VVV<0x70050000>;
97506c3fb27SDimitry Andricdef VSLE_DU : LSX3R_VVV<0x70058000>;
97606c3fb27SDimitry Andricdef VSLEI_BU : LSX2RI5_VVI<0x72840000>;
97706c3fb27SDimitry Andricdef VSLEI_HU : LSX2RI5_VVI<0x72848000>;
97806c3fb27SDimitry Andricdef VSLEI_WU : LSX2RI5_VVI<0x72850000>;
97906c3fb27SDimitry Andricdef VSLEI_DU : LSX2RI5_VVI<0x72858000>;
98006c3fb27SDimitry Andric
98106c3fb27SDimitry Andricdef VSLT_B : LSX3R_VVV<0x70060000>;
98206c3fb27SDimitry Andricdef VSLT_H : LSX3R_VVV<0x70068000>;
98306c3fb27SDimitry Andricdef VSLT_W : LSX3R_VVV<0x70070000>;
98406c3fb27SDimitry Andricdef VSLT_D : LSX3R_VVV<0x70078000>;
98506c3fb27SDimitry Andricdef VSLTI_B : LSX2RI5_VVI<0x72860000, simm5>;
98606c3fb27SDimitry Andricdef VSLTI_H : LSX2RI5_VVI<0x72868000, simm5>;
98706c3fb27SDimitry Andricdef VSLTI_W : LSX2RI5_VVI<0x72870000, simm5>;
98806c3fb27SDimitry Andricdef VSLTI_D : LSX2RI5_VVI<0x72878000, simm5>;
98906c3fb27SDimitry Andric
99006c3fb27SDimitry Andricdef VSLT_BU : LSX3R_VVV<0x70080000>;
99106c3fb27SDimitry Andricdef VSLT_HU : LSX3R_VVV<0x70088000>;
99206c3fb27SDimitry Andricdef VSLT_WU : LSX3R_VVV<0x70090000>;
99306c3fb27SDimitry Andricdef VSLT_DU : LSX3R_VVV<0x70098000>;
99406c3fb27SDimitry Andricdef VSLTI_BU : LSX2RI5_VVI<0x72880000>;
99506c3fb27SDimitry Andricdef VSLTI_HU : LSX2RI5_VVI<0x72888000>;
99606c3fb27SDimitry Andricdef VSLTI_WU : LSX2RI5_VVI<0x72890000>;
99706c3fb27SDimitry Andricdef VSLTI_DU : LSX2RI5_VVI<0x72898000>;
99806c3fb27SDimitry Andric
99906c3fb27SDimitry Andricdef VFCMP_CAF_S : LSX3R_VVV<0x0c500000>;
100006c3fb27SDimitry Andricdef VFCMP_SAF_S : LSX3R_VVV<0x0c508000>;
100106c3fb27SDimitry Andricdef VFCMP_CLT_S : LSX3R_VVV<0x0c510000>;
100206c3fb27SDimitry Andricdef VFCMP_SLT_S : LSX3R_VVV<0x0c518000>;
100306c3fb27SDimitry Andricdef VFCMP_CEQ_S : LSX3R_VVV<0x0c520000>;
100406c3fb27SDimitry Andricdef VFCMP_SEQ_S : LSX3R_VVV<0x0c528000>;
100506c3fb27SDimitry Andricdef VFCMP_CLE_S : LSX3R_VVV<0x0c530000>;
100606c3fb27SDimitry Andricdef VFCMP_SLE_S : LSX3R_VVV<0x0c538000>;
100706c3fb27SDimitry Andricdef VFCMP_CUN_S : LSX3R_VVV<0x0c540000>;
100806c3fb27SDimitry Andricdef VFCMP_SUN_S : LSX3R_VVV<0x0c548000>;
100906c3fb27SDimitry Andricdef VFCMP_CULT_S : LSX3R_VVV<0x0c550000>;
101006c3fb27SDimitry Andricdef VFCMP_SULT_S : LSX3R_VVV<0x0c558000>;
101106c3fb27SDimitry Andricdef VFCMP_CUEQ_S : LSX3R_VVV<0x0c560000>;
101206c3fb27SDimitry Andricdef VFCMP_SUEQ_S : LSX3R_VVV<0x0c568000>;
101306c3fb27SDimitry Andricdef VFCMP_CULE_S : LSX3R_VVV<0x0c570000>;
101406c3fb27SDimitry Andricdef VFCMP_SULE_S : LSX3R_VVV<0x0c578000>;
101506c3fb27SDimitry Andricdef VFCMP_CNE_S : LSX3R_VVV<0x0c580000>;
101606c3fb27SDimitry Andricdef VFCMP_SNE_S : LSX3R_VVV<0x0c588000>;
101706c3fb27SDimitry Andricdef VFCMP_COR_S : LSX3R_VVV<0x0c5a0000>;
101806c3fb27SDimitry Andricdef VFCMP_SOR_S : LSX3R_VVV<0x0c5a8000>;
101906c3fb27SDimitry Andricdef VFCMP_CUNE_S : LSX3R_VVV<0x0c5c0000>;
102006c3fb27SDimitry Andricdef VFCMP_SUNE_S : LSX3R_VVV<0x0c5c8000>;
102106c3fb27SDimitry Andric
102206c3fb27SDimitry Andricdef VFCMP_CAF_D : LSX3R_VVV<0x0c600000>;
102306c3fb27SDimitry Andricdef VFCMP_SAF_D : LSX3R_VVV<0x0c608000>;
102406c3fb27SDimitry Andricdef VFCMP_CLT_D : LSX3R_VVV<0x0c610000>;
102506c3fb27SDimitry Andricdef VFCMP_SLT_D : LSX3R_VVV<0x0c618000>;
102606c3fb27SDimitry Andricdef VFCMP_CEQ_D : LSX3R_VVV<0x0c620000>;
102706c3fb27SDimitry Andricdef VFCMP_SEQ_D : LSX3R_VVV<0x0c628000>;
102806c3fb27SDimitry Andricdef VFCMP_CLE_D : LSX3R_VVV<0x0c630000>;
102906c3fb27SDimitry Andricdef VFCMP_SLE_D : LSX3R_VVV<0x0c638000>;
103006c3fb27SDimitry Andricdef VFCMP_CUN_D : LSX3R_VVV<0x0c640000>;
103106c3fb27SDimitry Andricdef VFCMP_SUN_D : LSX3R_VVV<0x0c648000>;
103206c3fb27SDimitry Andricdef VFCMP_CULT_D : LSX3R_VVV<0x0c650000>;
103306c3fb27SDimitry Andricdef VFCMP_SULT_D : LSX3R_VVV<0x0c658000>;
103406c3fb27SDimitry Andricdef VFCMP_CUEQ_D : LSX3R_VVV<0x0c660000>;
103506c3fb27SDimitry Andricdef VFCMP_SUEQ_D : LSX3R_VVV<0x0c668000>;
103606c3fb27SDimitry Andricdef VFCMP_CULE_D : LSX3R_VVV<0x0c670000>;
103706c3fb27SDimitry Andricdef VFCMP_SULE_D : LSX3R_VVV<0x0c678000>;
103806c3fb27SDimitry Andricdef VFCMP_CNE_D : LSX3R_VVV<0x0c680000>;
103906c3fb27SDimitry Andricdef VFCMP_SNE_D : LSX3R_VVV<0x0c688000>;
104006c3fb27SDimitry Andricdef VFCMP_COR_D : LSX3R_VVV<0x0c6a0000>;
104106c3fb27SDimitry Andricdef VFCMP_SOR_D : LSX3R_VVV<0x0c6a8000>;
104206c3fb27SDimitry Andricdef VFCMP_CUNE_D : LSX3R_VVV<0x0c6c0000>;
104306c3fb27SDimitry Andricdef VFCMP_SUNE_D : LSX3R_VVV<0x0c6c8000>;
104406c3fb27SDimitry Andric
104506c3fb27SDimitry Andricdef VBITSEL_V : LSX4R_VVVV<0x0d100000>;
104606c3fb27SDimitry Andric
104706c3fb27SDimitry Andricdef VBITSELI_B : LSX2RI8_VVVI<0x73c40000>;
104806c3fb27SDimitry Andric
104906c3fb27SDimitry Andricdef VSETEQZ_V : LSX2R_CV<0x729c9800>;
105006c3fb27SDimitry Andricdef VSETNEZ_V : LSX2R_CV<0x729c9c00>;
105106c3fb27SDimitry Andricdef VSETANYEQZ_B : LSX2R_CV<0x729ca000>;
105206c3fb27SDimitry Andricdef VSETANYEQZ_H : LSX2R_CV<0x729ca400>;
105306c3fb27SDimitry Andricdef VSETANYEQZ_W : LSX2R_CV<0x729ca800>;
105406c3fb27SDimitry Andricdef VSETANYEQZ_D : LSX2R_CV<0x729cac00>;
105506c3fb27SDimitry Andricdef VSETALLNEZ_B : LSX2R_CV<0x729cb000>;
105606c3fb27SDimitry Andricdef VSETALLNEZ_H : LSX2R_CV<0x729cb400>;
105706c3fb27SDimitry Andricdef VSETALLNEZ_W : LSX2R_CV<0x729cb800>;
105806c3fb27SDimitry Andricdef VSETALLNEZ_D : LSX2R_CV<0x729cbc00>;
105906c3fb27SDimitry Andric
106006c3fb27SDimitry Andricdef VINSGR2VR_B : LSX2RI4_VVRI<0x72eb8000>;
106106c3fb27SDimitry Andricdef VINSGR2VR_H : LSX2RI3_VVRI<0x72ebc000>;
106206c3fb27SDimitry Andricdef VINSGR2VR_W : LSX2RI2_VVRI<0x72ebe000>;
106306c3fb27SDimitry Andricdef VINSGR2VR_D : LSX2RI1_VVRI<0x72ebf000>;
106406c3fb27SDimitry Andricdef VPICKVE2GR_B : LSX2RI4_RVI<0x72ef8000>;
106506c3fb27SDimitry Andricdef VPICKVE2GR_H : LSX2RI3_RVI<0x72efc000>;
106606c3fb27SDimitry Andricdef VPICKVE2GR_W : LSX2RI2_RVI<0x72efe000>;
106706c3fb27SDimitry Andricdef VPICKVE2GR_D : LSX2RI1_RVI<0x72eff000>;
106806c3fb27SDimitry Andricdef VPICKVE2GR_BU : LSX2RI4_RVI<0x72f38000>;
106906c3fb27SDimitry Andricdef VPICKVE2GR_HU : LSX2RI3_RVI<0x72f3c000>;
107006c3fb27SDimitry Andricdef VPICKVE2GR_WU : LSX2RI2_RVI<0x72f3e000>;
107106c3fb27SDimitry Andricdef VPICKVE2GR_DU : LSX2RI1_RVI<0x72f3f000>;
107206c3fb27SDimitry Andric
107306c3fb27SDimitry Andricdef VREPLGR2VR_B : LSX2R_VR<0x729f0000>;
107406c3fb27SDimitry Andricdef VREPLGR2VR_H : LSX2R_VR<0x729f0400>;
107506c3fb27SDimitry Andricdef VREPLGR2VR_W : LSX2R_VR<0x729f0800>;
107606c3fb27SDimitry Andricdef VREPLGR2VR_D : LSX2R_VR<0x729f0c00>;
107706c3fb27SDimitry Andric
107806c3fb27SDimitry Andricdef VREPLVE_B : LSX3R_VVR<0x71220000>;
107906c3fb27SDimitry Andricdef VREPLVE_H : LSX3R_VVR<0x71228000>;
108006c3fb27SDimitry Andricdef VREPLVE_W : LSX3R_VVR<0x71230000>;
108106c3fb27SDimitry Andricdef VREPLVE_D : LSX3R_VVR<0x71238000>;
108206c3fb27SDimitry Andricdef VREPLVEI_B : LSX2RI4_VVI<0x72f78000>;
108306c3fb27SDimitry Andricdef VREPLVEI_H : LSX2RI3_VVI<0x72f7c000>;
108406c3fb27SDimitry Andricdef VREPLVEI_W : LSX2RI2_VVI<0x72f7e000>;
108506c3fb27SDimitry Andricdef VREPLVEI_D : LSX2RI1_VVI<0x72f7f000>;
108606c3fb27SDimitry Andric
108706c3fb27SDimitry Andricdef VBSLL_V : LSX2RI5_VVI<0x728e0000>;
108806c3fb27SDimitry Andricdef VBSRL_V : LSX2RI5_VVI<0x728e8000>;
108906c3fb27SDimitry Andric
109006c3fb27SDimitry Andricdef VPACKEV_B : LSX3R_VVV<0x71160000>;
109106c3fb27SDimitry Andricdef VPACKEV_H : LSX3R_VVV<0x71168000>;
109206c3fb27SDimitry Andricdef VPACKEV_W : LSX3R_VVV<0x71170000>;
109306c3fb27SDimitry Andricdef VPACKEV_D : LSX3R_VVV<0x71178000>;
109406c3fb27SDimitry Andricdef VPACKOD_B : LSX3R_VVV<0x71180000>;
109506c3fb27SDimitry Andricdef VPACKOD_H : LSX3R_VVV<0x71188000>;
109606c3fb27SDimitry Andricdef VPACKOD_W : LSX3R_VVV<0x71190000>;
109706c3fb27SDimitry Andricdef VPACKOD_D : LSX3R_VVV<0x71198000>;
109806c3fb27SDimitry Andric
109906c3fb27SDimitry Andricdef VPICKEV_B : LSX3R_VVV<0x711e0000>;
110006c3fb27SDimitry Andricdef VPICKEV_H : LSX3R_VVV<0x711e8000>;
110106c3fb27SDimitry Andricdef VPICKEV_W : LSX3R_VVV<0x711f0000>;
110206c3fb27SDimitry Andricdef VPICKEV_D : LSX3R_VVV<0x711f8000>;
110306c3fb27SDimitry Andricdef VPICKOD_B : LSX3R_VVV<0x71200000>;
110406c3fb27SDimitry Andricdef VPICKOD_H : LSX3R_VVV<0x71208000>;
110506c3fb27SDimitry Andricdef VPICKOD_W : LSX3R_VVV<0x71210000>;
110606c3fb27SDimitry Andricdef VPICKOD_D : LSX3R_VVV<0x71218000>;
110706c3fb27SDimitry Andric
110806c3fb27SDimitry Andricdef VILVL_B : LSX3R_VVV<0x711a0000>;
110906c3fb27SDimitry Andricdef VILVL_H : LSX3R_VVV<0x711a8000>;
111006c3fb27SDimitry Andricdef VILVL_W : LSX3R_VVV<0x711b0000>;
111106c3fb27SDimitry Andricdef VILVL_D : LSX3R_VVV<0x711b8000>;
111206c3fb27SDimitry Andricdef VILVH_B : LSX3R_VVV<0x711c0000>;
111306c3fb27SDimitry Andricdef VILVH_H : LSX3R_VVV<0x711c8000>;
111406c3fb27SDimitry Andricdef VILVH_W : LSX3R_VVV<0x711d0000>;
111506c3fb27SDimitry Andricdef VILVH_D : LSX3R_VVV<0x711d8000>;
111606c3fb27SDimitry Andric
111706c3fb27SDimitry Andricdef VSHUF_B : LSX4R_VVVV<0x0d500000>;
111806c3fb27SDimitry Andric
111906c3fb27SDimitry Andricdef VSHUF_H : LSX3R_VVVV<0x717a8000>;
112006c3fb27SDimitry Andricdef VSHUF_W : LSX3R_VVVV<0x717b0000>;
112106c3fb27SDimitry Andricdef VSHUF_D : LSX3R_VVVV<0x717b8000>;
112206c3fb27SDimitry Andric
112306c3fb27SDimitry Andricdef VSHUF4I_B : LSX2RI8_VVI<0x73900000>;
112406c3fb27SDimitry Andricdef VSHUF4I_H : LSX2RI8_VVI<0x73940000>;
112506c3fb27SDimitry Andricdef VSHUF4I_W : LSX2RI8_VVI<0x73980000>;
112606c3fb27SDimitry Andricdef VSHUF4I_D : LSX2RI8_VVVI<0x739c0000>;
112706c3fb27SDimitry Andric
112806c3fb27SDimitry Andricdef VPERMI_W : LSX2RI8_VVVI<0x73e40000>;
112906c3fb27SDimitry Andric
113006c3fb27SDimitry Andricdef VEXTRINS_D : LSX2RI8_VVVI<0x73800000>;
113106c3fb27SDimitry Andricdef VEXTRINS_W : LSX2RI8_VVVI<0x73840000>;
113206c3fb27SDimitry Andricdef VEXTRINS_H : LSX2RI8_VVVI<0x73880000>;
113306c3fb27SDimitry Andricdef VEXTRINS_B : LSX2RI8_VVVI<0x738c0000>;
113406c3fb27SDimitry Andric} // mayLoad = 0, mayStore = 0
113506c3fb27SDimitry Andric
113606c3fb27SDimitry Andriclet mayLoad = 1, mayStore = 0 in {
113706c3fb27SDimitry Andricdef VLD : LSX2RI12_Load<0x2c000000>;
113806c3fb27SDimitry Andricdef VLDX : LSX3R_Load<0x38400000>;
113906c3fb27SDimitry Andric
114006c3fb27SDimitry Andricdef VLDREPL_B : LSX2RI12_Load<0x30800000>;
114106c3fb27SDimitry Andricdef VLDREPL_H : LSX2RI11_Load<0x30400000>;
114206c3fb27SDimitry Andricdef VLDREPL_W : LSX2RI10_Load<0x30200000>;
114306c3fb27SDimitry Andricdef VLDREPL_D : LSX2RI9_Load<0x30100000>;
114406c3fb27SDimitry Andric} // mayLoad = 1, mayStore = 0
114506c3fb27SDimitry Andric
114606c3fb27SDimitry Andriclet mayLoad = 0, mayStore = 1 in {
114706c3fb27SDimitry Andricdef VST : LSX2RI12_Store<0x2c400000>;
114806c3fb27SDimitry Andricdef VSTX : LSX3R_Store<0x38440000>;
114906c3fb27SDimitry Andric
115006c3fb27SDimitry Andricdef VSTELM_B : LSX2RI8I4_VRII<0x31800000>;
115106c3fb27SDimitry Andricdef VSTELM_H : LSX2RI8I3_VRII<0x31400000, simm8_lsl1>;
115206c3fb27SDimitry Andricdef VSTELM_W : LSX2RI8I2_VRII<0x31200000, simm8_lsl2>;
115306c3fb27SDimitry Andricdef VSTELM_D : LSX2RI8I1_VRII<0x31100000, simm8_lsl3>;
115406c3fb27SDimitry Andric} // mayLoad = 0, mayStore = 1
115506c3fb27SDimitry Andric
115606c3fb27SDimitry Andric} // hasSideEffects = 0, Predicates = [HasExtLSX]
115706c3fb27SDimitry Andric
115806c3fb27SDimitry Andric/// Pseudo-instructions
115906c3fb27SDimitry Andric
116006c3fb27SDimitry Andriclet Predicates = [HasExtLSX] in {
116106c3fb27SDimitry Andric
116206c3fb27SDimitry Andriclet hasSideEffects = 0, mayLoad = 0, mayStore = 0, isCodeGenOnly = 0,
116306c3fb27SDimitry Andric    isAsmParserOnly = 1 in {
116406c3fb27SDimitry Andricdef PseudoVREPLI_B : Pseudo<(outs LSX128:$vd), (ins simm10:$imm), [],
116506c3fb27SDimitry Andric                            "vrepli.b", "$vd, $imm">;
116606c3fb27SDimitry Andricdef PseudoVREPLI_H : Pseudo<(outs LSX128:$vd), (ins simm10:$imm), [],
116706c3fb27SDimitry Andric                            "vrepli.h", "$vd, $imm">;
116806c3fb27SDimitry Andricdef PseudoVREPLI_W : Pseudo<(outs LSX128:$vd), (ins simm10:$imm), [],
116906c3fb27SDimitry Andric                            "vrepli.w", "$vd, $imm">;
117006c3fb27SDimitry Andricdef PseudoVREPLI_D : Pseudo<(outs LSX128:$vd), (ins simm10:$imm), [],
117106c3fb27SDimitry Andric                            "vrepli.d", "$vd, $imm">;
117206c3fb27SDimitry Andric}
117306c3fb27SDimitry Andric
1174*5f757f3fSDimitry Andricdef PseudoVBNZ_B : VecCond<loongarch_vall_nonzero, v16i8>;
1175*5f757f3fSDimitry Andricdef PseudoVBNZ_H : VecCond<loongarch_vall_nonzero, v8i16>;
1176*5f757f3fSDimitry Andricdef PseudoVBNZ_W : VecCond<loongarch_vall_nonzero, v4i32>;
1177*5f757f3fSDimitry Andricdef PseudoVBNZ_D : VecCond<loongarch_vall_nonzero, v2i64>;
1178*5f757f3fSDimitry Andricdef PseudoVBNZ : VecCond<loongarch_vany_nonzero, v16i8>;
1179*5f757f3fSDimitry Andric
1180*5f757f3fSDimitry Andricdef PseudoVBZ_B : VecCond<loongarch_vall_zero, v16i8>;
1181*5f757f3fSDimitry Andricdef PseudoVBZ_H : VecCond<loongarch_vall_zero, v8i16>;
1182*5f757f3fSDimitry Andricdef PseudoVBZ_W : VecCond<loongarch_vall_zero, v4i32>;
1183*5f757f3fSDimitry Andricdef PseudoVBZ_D : VecCond<loongarch_vall_zero, v2i64>;
1184*5f757f3fSDimitry Andricdef PseudoVBZ : VecCond<loongarch_vany_zero, v16i8>;
1185*5f757f3fSDimitry Andric
1186*5f757f3fSDimitry Andric} // Predicates = [HasExtLSX]
1187*5f757f3fSDimitry Andric
1188*5f757f3fSDimitry Andricmulticlass PatVr<SDPatternOperator OpNode, string Inst> {
1189*5f757f3fSDimitry Andric  def : Pat<(v16i8 (OpNode (v16i8 LSX128:$vj))),
1190*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_B") LSX128:$vj)>;
1191*5f757f3fSDimitry Andric  def : Pat<(v8i16 (OpNode (v8i16 LSX128:$vj))),
1192*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_H") LSX128:$vj)>;
1193*5f757f3fSDimitry Andric  def : Pat<(v4i32 (OpNode (v4i32 LSX128:$vj))),
1194*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_W") LSX128:$vj)>;
1195*5f757f3fSDimitry Andric  def : Pat<(v2i64 (OpNode (v2i64 LSX128:$vj))),
1196*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_D") LSX128:$vj)>;
1197*5f757f3fSDimitry Andric}
1198*5f757f3fSDimitry Andric
1199*5f757f3fSDimitry Andricmulticlass PatVrF<SDPatternOperator OpNode, string Inst> {
1200*5f757f3fSDimitry Andric  def : Pat<(v4f32 (OpNode (v4f32 LSX128:$vj))),
1201*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_S") LSX128:$vj)>;
1202*5f757f3fSDimitry Andric  def : Pat<(v2f64 (OpNode (v2f64 LSX128:$vj))),
1203*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_D") LSX128:$vj)>;
1204*5f757f3fSDimitry Andric}
1205*5f757f3fSDimitry Andric
1206*5f757f3fSDimitry Andricmulticlass PatVrVr<SDPatternOperator OpNode, string Inst> {
1207*5f757f3fSDimitry Andric  def : Pat<(OpNode (v16i8 LSX128:$vj), (v16i8 LSX128:$vk)),
1208*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_B") LSX128:$vj, LSX128:$vk)>;
1209*5f757f3fSDimitry Andric  def : Pat<(OpNode (v8i16 LSX128:$vj), (v8i16 LSX128:$vk)),
1210*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_H") LSX128:$vj, LSX128:$vk)>;
1211*5f757f3fSDimitry Andric  def : Pat<(OpNode (v4i32 LSX128:$vj), (v4i32 LSX128:$vk)),
1212*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_W") LSX128:$vj, LSX128:$vk)>;
1213*5f757f3fSDimitry Andric  def : Pat<(OpNode (v2i64 LSX128:$vj), (v2i64 LSX128:$vk)),
1214*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_D") LSX128:$vj, LSX128:$vk)>;
1215*5f757f3fSDimitry Andric}
1216*5f757f3fSDimitry Andric
1217*5f757f3fSDimitry Andricmulticlass PatVrVrF<SDPatternOperator OpNode, string Inst> {
1218*5f757f3fSDimitry Andric  def : Pat<(OpNode (v4f32 LSX128:$vj), (v4f32 LSX128:$vk)),
1219*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_S") LSX128:$vj, LSX128:$vk)>;
1220*5f757f3fSDimitry Andric  def : Pat<(OpNode (v2f64 LSX128:$vj), (v2f64 LSX128:$vk)),
1221*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_D") LSX128:$vj, LSX128:$vk)>;
1222*5f757f3fSDimitry Andric}
1223*5f757f3fSDimitry Andric
1224*5f757f3fSDimitry Andricmulticlass PatVrVrU<SDPatternOperator OpNode, string Inst> {
1225*5f757f3fSDimitry Andric  def : Pat<(OpNode (v16i8 LSX128:$vj), (v16i8 LSX128:$vk)),
1226*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_BU") LSX128:$vj, LSX128:$vk)>;
1227*5f757f3fSDimitry Andric  def : Pat<(OpNode (v8i16 LSX128:$vj), (v8i16 LSX128:$vk)),
1228*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_HU") LSX128:$vj, LSX128:$vk)>;
1229*5f757f3fSDimitry Andric  def : Pat<(OpNode (v4i32 LSX128:$vj), (v4i32 LSX128:$vk)),
1230*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_WU") LSX128:$vj, LSX128:$vk)>;
1231*5f757f3fSDimitry Andric  def : Pat<(OpNode (v2i64 LSX128:$vj), (v2i64 LSX128:$vk)),
1232*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_DU") LSX128:$vj, LSX128:$vk)>;
1233*5f757f3fSDimitry Andric}
1234*5f757f3fSDimitry Andric
1235*5f757f3fSDimitry Andricmulticlass PatVrSimm5<SDPatternOperator OpNode, string Inst> {
1236*5f757f3fSDimitry Andric  def : Pat<(OpNode (v16i8 LSX128:$vj), (v16i8 (SplatPat_simm5 simm5:$imm))),
1237*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_B") LSX128:$vj, simm5:$imm)>;
1238*5f757f3fSDimitry Andric  def : Pat<(OpNode (v8i16 LSX128:$vj), (v8i16 (SplatPat_simm5 simm5:$imm))),
1239*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_H") LSX128:$vj, simm5:$imm)>;
1240*5f757f3fSDimitry Andric  def : Pat<(OpNode (v4i32 LSX128:$vj), (v4i32 (SplatPat_simm5 simm5:$imm))),
1241*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_W") LSX128:$vj, simm5:$imm)>;
1242*5f757f3fSDimitry Andric  def : Pat<(OpNode (v2i64 LSX128:$vj), (v2i64 (SplatPat_simm5 simm5:$imm))),
1243*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_D") LSX128:$vj, simm5:$imm)>;
1244*5f757f3fSDimitry Andric}
1245*5f757f3fSDimitry Andric
1246*5f757f3fSDimitry Andricmulticlass PatVrUimm5<SDPatternOperator OpNode, string Inst> {
1247*5f757f3fSDimitry Andric  def : Pat<(OpNode (v16i8 LSX128:$vj), (v16i8 (SplatPat_uimm5 uimm5:$imm))),
1248*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_BU") LSX128:$vj, uimm5:$imm)>;
1249*5f757f3fSDimitry Andric  def : Pat<(OpNode (v8i16 LSX128:$vj), (v8i16 (SplatPat_uimm5 uimm5:$imm))),
1250*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_HU") LSX128:$vj, uimm5:$imm)>;
1251*5f757f3fSDimitry Andric  def : Pat<(OpNode (v4i32 LSX128:$vj), (v4i32 (SplatPat_uimm5 uimm5:$imm))),
1252*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_WU") LSX128:$vj, uimm5:$imm)>;
1253*5f757f3fSDimitry Andric  def : Pat<(OpNode (v2i64 LSX128:$vj), (v2i64 (SplatPat_uimm5 uimm5:$imm))),
1254*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_DU") LSX128:$vj, uimm5:$imm)>;
1255*5f757f3fSDimitry Andric}
1256*5f757f3fSDimitry Andric
1257*5f757f3fSDimitry Andricmulticlass PatVrVrVr<SDPatternOperator OpNode, string Inst> {
1258*5f757f3fSDimitry Andric  def : Pat<(OpNode (v16i8 LSX128:$vd), (v16i8 LSX128:$vj), (v16i8 LSX128:$vk)),
1259*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_B") LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1260*5f757f3fSDimitry Andric  def : Pat<(OpNode (v8i16 LSX128:$vd), (v8i16 LSX128:$vj), (v8i16 LSX128:$vk)),
1261*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_H") LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1262*5f757f3fSDimitry Andric  def : Pat<(OpNode (v4i32 LSX128:$vd), (v4i32 LSX128:$vj), (v4i32 LSX128:$vk)),
1263*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_W") LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1264*5f757f3fSDimitry Andric  def : Pat<(OpNode (v2i64 LSX128:$vd), (v2i64 LSX128:$vj), (v2i64 LSX128:$vk)),
1265*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_D") LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1266*5f757f3fSDimitry Andric}
1267*5f757f3fSDimitry Andric
1268*5f757f3fSDimitry Andricmulticlass PatShiftVrVr<SDPatternOperator OpNode, string Inst> {
1269*5f757f3fSDimitry Andric  def : Pat<(OpNode (v16i8 LSX128:$vj), (and vsplati8_imm_eq_7,
1270*5f757f3fSDimitry Andric                                             (v16i8 LSX128:$vk))),
1271*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_B") LSX128:$vj, LSX128:$vk)>;
1272*5f757f3fSDimitry Andric  def : Pat<(OpNode (v8i16 LSX128:$vj), (and vsplati16_imm_eq_15,
1273*5f757f3fSDimitry Andric                                             (v8i16 LSX128:$vk))),
1274*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_H") LSX128:$vj, LSX128:$vk)>;
1275*5f757f3fSDimitry Andric  def : Pat<(OpNode (v4i32 LSX128:$vj), (and vsplati32_imm_eq_31,
1276*5f757f3fSDimitry Andric                                             (v4i32 LSX128:$vk))),
1277*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_W") LSX128:$vj, LSX128:$vk)>;
1278*5f757f3fSDimitry Andric  def : Pat<(OpNode (v2i64 LSX128:$vj), (and vsplati64_imm_eq_63,
1279*5f757f3fSDimitry Andric                                             (v2i64 LSX128:$vk))),
1280*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_D") LSX128:$vj, LSX128:$vk)>;
1281*5f757f3fSDimitry Andric}
1282*5f757f3fSDimitry Andric
1283*5f757f3fSDimitry Andricmulticlass PatShiftVrUimm<SDPatternOperator OpNode, string Inst> {
1284*5f757f3fSDimitry Andric  def : Pat<(OpNode (v16i8 LSX128:$vj), (v16i8 (SplatPat_uimm3 uimm3:$imm))),
1285*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_B") LSX128:$vj, uimm3:$imm)>;
1286*5f757f3fSDimitry Andric  def : Pat<(OpNode (v8i16 LSX128:$vj), (v8i16 (SplatPat_uimm4 uimm4:$imm))),
1287*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_H") LSX128:$vj, uimm4:$imm)>;
1288*5f757f3fSDimitry Andric  def : Pat<(OpNode (v4i32 LSX128:$vj), (v4i32 (SplatPat_uimm5 uimm5:$imm))),
1289*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_W") LSX128:$vj, uimm5:$imm)>;
1290*5f757f3fSDimitry Andric  def : Pat<(OpNode (v2i64 LSX128:$vj), (v2i64 (SplatPat_uimm6 uimm6:$imm))),
1291*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_D") LSX128:$vj, uimm6:$imm)>;
1292*5f757f3fSDimitry Andric}
1293*5f757f3fSDimitry Andric
1294*5f757f3fSDimitry Andricmulticlass PatCCVrSimm5<CondCode CC, string Inst> {
1295*5f757f3fSDimitry Andric  def : Pat<(v16i8 (setcc (v16i8 LSX128:$vj),
1296*5f757f3fSDimitry Andric                          (v16i8 (SplatPat_simm5 simm5:$imm)), CC)),
1297*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_B") LSX128:$vj, simm5:$imm)>;
1298*5f757f3fSDimitry Andric  def : Pat<(v8i16 (setcc (v8i16 LSX128:$vj),
1299*5f757f3fSDimitry Andric                          (v8i16 (SplatPat_simm5 simm5:$imm)), CC)),
1300*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_H") LSX128:$vj, simm5:$imm)>;
1301*5f757f3fSDimitry Andric  def : Pat<(v4i32 (setcc (v4i32 LSX128:$vj),
1302*5f757f3fSDimitry Andric                          (v4i32 (SplatPat_simm5 simm5:$imm)), CC)),
1303*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_W") LSX128:$vj, simm5:$imm)>;
1304*5f757f3fSDimitry Andric  def : Pat<(v2i64 (setcc (v2i64 LSX128:$vj),
1305*5f757f3fSDimitry Andric                          (v2i64 (SplatPat_simm5 simm5:$imm)), CC)),
1306*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_D") LSX128:$vj, simm5:$imm)>;
1307*5f757f3fSDimitry Andric}
1308*5f757f3fSDimitry Andric
1309*5f757f3fSDimitry Andricmulticlass PatCCVrUimm5<CondCode CC, string Inst> {
1310*5f757f3fSDimitry Andric  def : Pat<(v16i8 (setcc (v16i8 LSX128:$vj),
1311*5f757f3fSDimitry Andric                          (v16i8 (SplatPat_uimm5 uimm5:$imm)), CC)),
1312*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_BU") LSX128:$vj, uimm5:$imm)>;
1313*5f757f3fSDimitry Andric  def : Pat<(v8i16 (setcc (v8i16 LSX128:$vj),
1314*5f757f3fSDimitry Andric                          (v8i16 (SplatPat_uimm5 uimm5:$imm)), CC)),
1315*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_HU") LSX128:$vj, uimm5:$imm)>;
1316*5f757f3fSDimitry Andric  def : Pat<(v4i32 (setcc (v4i32 LSX128:$vj),
1317*5f757f3fSDimitry Andric                          (v4i32 (SplatPat_uimm5 uimm5:$imm)), CC)),
1318*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_WU") LSX128:$vj, uimm5:$imm)>;
1319*5f757f3fSDimitry Andric  def : Pat<(v2i64 (setcc (v2i64 LSX128:$vj),
1320*5f757f3fSDimitry Andric                          (v2i64 (SplatPat_uimm5 uimm5:$imm)), CC)),
1321*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_DU") LSX128:$vj, uimm5:$imm)>;
1322*5f757f3fSDimitry Andric}
1323*5f757f3fSDimitry Andric
1324*5f757f3fSDimitry Andricmulticlass PatCCVrVr<CondCode CC, string Inst> {
1325*5f757f3fSDimitry Andric  def : Pat<(v16i8 (setcc (v16i8 LSX128:$vj), (v16i8 LSX128:$vk), CC)),
1326*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_B") LSX128:$vj, LSX128:$vk)>;
1327*5f757f3fSDimitry Andric  def : Pat<(v8i16 (setcc (v8i16 LSX128:$vj), (v8i16 LSX128:$vk), CC)),
1328*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_H") LSX128:$vj, LSX128:$vk)>;
1329*5f757f3fSDimitry Andric  def : Pat<(v4i32 (setcc (v4i32 LSX128:$vj), (v4i32 LSX128:$vk), CC)),
1330*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_W") LSX128:$vj, LSX128:$vk)>;
1331*5f757f3fSDimitry Andric  def : Pat<(v2i64 (setcc (v2i64 LSX128:$vj), (v2i64 LSX128:$vk), CC)),
1332*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_D") LSX128:$vj, LSX128:$vk)>;
1333*5f757f3fSDimitry Andric}
1334*5f757f3fSDimitry Andric
1335*5f757f3fSDimitry Andricmulticlass PatCCVrVrU<CondCode CC, string Inst> {
1336*5f757f3fSDimitry Andric  def : Pat<(v16i8 (setcc (v16i8 LSX128:$vj), (v16i8 LSX128:$vk), CC)),
1337*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_BU") LSX128:$vj, LSX128:$vk)>;
1338*5f757f3fSDimitry Andric  def : Pat<(v8i16 (setcc (v8i16 LSX128:$vj), (v8i16 LSX128:$vk), CC)),
1339*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_HU") LSX128:$vj, LSX128:$vk)>;
1340*5f757f3fSDimitry Andric  def : Pat<(v4i32 (setcc (v4i32 LSX128:$vj), (v4i32 LSX128:$vk), CC)),
1341*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_WU") LSX128:$vj, LSX128:$vk)>;
1342*5f757f3fSDimitry Andric  def : Pat<(v2i64 (setcc (v2i64 LSX128:$vj), (v2i64 LSX128:$vk), CC)),
1343*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_DU") LSX128:$vj, LSX128:$vk)>;
1344*5f757f3fSDimitry Andric}
1345*5f757f3fSDimitry Andric
1346*5f757f3fSDimitry Andricmulticlass PatCCVrVrF<CondCode CC, string Inst> {
1347*5f757f3fSDimitry Andric  def : Pat<(v4i32 (setcc (v4f32 LSX128:$vj), (v4f32 LSX128:$vk), CC)),
1348*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_S") LSX128:$vj, LSX128:$vk)>;
1349*5f757f3fSDimitry Andric  def : Pat<(v2i64 (setcc (v2f64 LSX128:$vj), (v2f64 LSX128:$vk), CC)),
1350*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst#"_D") LSX128:$vj, LSX128:$vk)>;
1351*5f757f3fSDimitry Andric}
1352*5f757f3fSDimitry Andric
1353*5f757f3fSDimitry Andriclet Predicates = [HasExtLSX] in {
1354*5f757f3fSDimitry Andric
1355*5f757f3fSDimitry Andric// VADD_{B/H/W/D}
1356*5f757f3fSDimitry Andricdefm : PatVrVr<add, "VADD">;
1357*5f757f3fSDimitry Andric// VSUB_{B/H/W/D}
1358*5f757f3fSDimitry Andricdefm : PatVrVr<sub, "VSUB">;
1359*5f757f3fSDimitry Andric
1360*5f757f3fSDimitry Andric// VADDI_{B/H/W/D}U
1361*5f757f3fSDimitry Andricdefm : PatVrUimm5<add, "VADDI">;
1362*5f757f3fSDimitry Andric// VSUBI_{B/H/W/D}U
1363*5f757f3fSDimitry Andricdefm : PatVrUimm5<sub, "VSUBI">;
1364*5f757f3fSDimitry Andric
1365*5f757f3fSDimitry Andric// VNEG_{B/H/W/D}
1366*5f757f3fSDimitry Andricdef : Pat<(sub immAllZerosV, (v16i8 LSX128:$vj)), (VNEG_B LSX128:$vj)>;
1367*5f757f3fSDimitry Andricdef : Pat<(sub immAllZerosV, (v8i16 LSX128:$vj)), (VNEG_H LSX128:$vj)>;
1368*5f757f3fSDimitry Andricdef : Pat<(sub immAllZerosV, (v4i32 LSX128:$vj)), (VNEG_W LSX128:$vj)>;
1369*5f757f3fSDimitry Andricdef : Pat<(sub immAllZerosV, (v2i64 LSX128:$vj)), (VNEG_D LSX128:$vj)>;
1370*5f757f3fSDimitry Andric
1371*5f757f3fSDimitry Andric// VMAX[I]_{B/H/W/D}[U]
1372*5f757f3fSDimitry Andricdefm : PatVrVr<smax, "VMAX">;
1373*5f757f3fSDimitry Andricdefm : PatVrVrU<umax, "VMAX">;
1374*5f757f3fSDimitry Andricdefm : PatVrSimm5<smax, "VMAXI">;
1375*5f757f3fSDimitry Andricdefm : PatVrUimm5<umax, "VMAXI">;
1376*5f757f3fSDimitry Andric
1377*5f757f3fSDimitry Andric// VMIN[I]_{B/H/W/D}[U]
1378*5f757f3fSDimitry Andricdefm : PatVrVr<smin, "VMIN">;
1379*5f757f3fSDimitry Andricdefm : PatVrVrU<umin, "VMIN">;
1380*5f757f3fSDimitry Andricdefm : PatVrSimm5<smin, "VMINI">;
1381*5f757f3fSDimitry Andricdefm : PatVrUimm5<umin, "VMINI">;
1382*5f757f3fSDimitry Andric
1383*5f757f3fSDimitry Andric// VMUL_{B/H/W/D}
1384*5f757f3fSDimitry Andricdefm : PatVrVr<mul, "VMUL">;
1385*5f757f3fSDimitry Andric
1386*5f757f3fSDimitry Andric// VMUH_{B/H/W/D}[U]
1387*5f757f3fSDimitry Andricdefm : PatVrVr<mulhs, "VMUH">;
1388*5f757f3fSDimitry Andricdefm : PatVrVrU<mulhu, "VMUH">;
1389*5f757f3fSDimitry Andric
1390*5f757f3fSDimitry Andric// VMADD_{B/H/W/D}
1391*5f757f3fSDimitry Andricdefm : PatVrVrVr<muladd, "VMADD">;
1392*5f757f3fSDimitry Andric// VMSUB_{B/H/W/D}
1393*5f757f3fSDimitry Andricdefm : PatVrVrVr<mulsub, "VMSUB">;
1394*5f757f3fSDimitry Andric
1395*5f757f3fSDimitry Andric// VDIV_{B/H/W/D}[U]
1396*5f757f3fSDimitry Andricdefm : PatVrVr<sdiv, "VDIV">;
1397*5f757f3fSDimitry Andricdefm : PatVrVrU<udiv, "VDIV">;
1398*5f757f3fSDimitry Andric
1399*5f757f3fSDimitry Andric// VMOD_{B/H/W/D}[U]
1400*5f757f3fSDimitry Andricdefm : PatVrVr<srem, "VMOD">;
1401*5f757f3fSDimitry Andricdefm : PatVrVrU<urem, "VMOD">;
1402*5f757f3fSDimitry Andric
1403*5f757f3fSDimitry Andric// VAND_V
1404*5f757f3fSDimitry Andricforeach vt = [v16i8, v8i16, v4i32, v2i64] in
1405*5f757f3fSDimitry Andricdef : Pat<(and (vt LSX128:$vj), (vt LSX128:$vk)),
1406*5f757f3fSDimitry Andric          (VAND_V LSX128:$vj, LSX128:$vk)>;
1407*5f757f3fSDimitry Andric// VOR_V
1408*5f757f3fSDimitry Andricforeach vt = [v16i8, v8i16, v4i32, v2i64] in
1409*5f757f3fSDimitry Andricdef : Pat<(or (vt LSX128:$vj), (vt LSX128:$vk)),
1410*5f757f3fSDimitry Andric          (VOR_V LSX128:$vj, LSX128:$vk)>;
1411*5f757f3fSDimitry Andric// VXOR_V
1412*5f757f3fSDimitry Andricforeach vt = [v16i8, v8i16, v4i32, v2i64] in
1413*5f757f3fSDimitry Andricdef : Pat<(xor (vt LSX128:$vj), (vt LSX128:$vk)),
1414*5f757f3fSDimitry Andric          (VXOR_V LSX128:$vj, LSX128:$vk)>;
1415*5f757f3fSDimitry Andric// VNOR_V
1416*5f757f3fSDimitry Andricforeach vt = [v16i8, v8i16, v4i32, v2i64] in
1417*5f757f3fSDimitry Andricdef : Pat<(vnot (or (vt LSX128:$vj), (vt LSX128:$vk))),
1418*5f757f3fSDimitry Andric          (VNOR_V LSX128:$vj, LSX128:$vk)>;
1419*5f757f3fSDimitry Andric
1420*5f757f3fSDimitry Andric// VANDI_B
1421*5f757f3fSDimitry Andricdef : Pat<(and (v16i8 LSX128:$vj), (v16i8 (SplatPat_uimm8 uimm8:$imm))),
1422*5f757f3fSDimitry Andric          (VANDI_B LSX128:$vj, uimm8:$imm)>;
1423*5f757f3fSDimitry Andric// VORI_B
1424*5f757f3fSDimitry Andricdef : Pat<(or (v16i8 LSX128:$vj), (v16i8 (SplatPat_uimm8 uimm8:$imm))),
1425*5f757f3fSDimitry Andric          (VORI_B LSX128:$vj, uimm8:$imm)>;
1426*5f757f3fSDimitry Andric
1427*5f757f3fSDimitry Andric// VXORI_B
1428*5f757f3fSDimitry Andricdef : Pat<(xor (v16i8 LSX128:$vj), (v16i8 (SplatPat_uimm8 uimm8:$imm))),
1429*5f757f3fSDimitry Andric          (VXORI_B LSX128:$vj, uimm8:$imm)>;
1430*5f757f3fSDimitry Andric
1431*5f757f3fSDimitry Andric// VSLL[I]_{B/H/W/D}
1432*5f757f3fSDimitry Andricdefm : PatVrVr<shl, "VSLL">;
1433*5f757f3fSDimitry Andricdefm : PatShiftVrVr<shl, "VSLL">;
1434*5f757f3fSDimitry Andricdefm : PatShiftVrUimm<shl, "VSLLI">;
1435*5f757f3fSDimitry Andric
1436*5f757f3fSDimitry Andric// VSRL[I]_{B/H/W/D}
1437*5f757f3fSDimitry Andricdefm : PatVrVr<srl, "VSRL">;
1438*5f757f3fSDimitry Andricdefm : PatShiftVrVr<srl, "VSRL">;
1439*5f757f3fSDimitry Andricdefm : PatShiftVrUimm<srl, "VSRLI">;
1440*5f757f3fSDimitry Andric
1441*5f757f3fSDimitry Andric// VSRA[I]_{B/H/W/D}
1442*5f757f3fSDimitry Andricdefm : PatVrVr<sra, "VSRA">;
1443*5f757f3fSDimitry Andricdefm : PatShiftVrVr<sra, "VSRA">;
1444*5f757f3fSDimitry Andricdefm : PatShiftVrUimm<sra, "VSRAI">;
1445*5f757f3fSDimitry Andric
1446*5f757f3fSDimitry Andric// VCLZ_{B/H/W/D}
1447*5f757f3fSDimitry Andricdefm : PatVr<ctlz, "VCLZ">;
1448*5f757f3fSDimitry Andric
1449*5f757f3fSDimitry Andric// VPCNT_{B/H/W/D}
1450*5f757f3fSDimitry Andricdefm : PatVr<ctpop, "VPCNT">;
1451*5f757f3fSDimitry Andric
1452*5f757f3fSDimitry Andric// VBITCLR_{B/H/W/D}
1453*5f757f3fSDimitry Andricdef : Pat<(and v16i8:$vj, (vnot (shl vsplat_imm_eq_1, v16i8:$vk))),
1454*5f757f3fSDimitry Andric          (v16i8 (VBITCLR_B v16i8:$vj, v16i8:$vk))>;
1455*5f757f3fSDimitry Andricdef : Pat<(and v8i16:$vj, (vnot (shl vsplat_imm_eq_1, v8i16:$vk))),
1456*5f757f3fSDimitry Andric          (v8i16 (VBITCLR_H v8i16:$vj, v8i16:$vk))>;
1457*5f757f3fSDimitry Andricdef : Pat<(and v4i32:$vj, (vnot (shl vsplat_imm_eq_1, v4i32:$vk))),
1458*5f757f3fSDimitry Andric          (v4i32 (VBITCLR_W v4i32:$vj, v4i32:$vk))>;
1459*5f757f3fSDimitry Andricdef : Pat<(and v2i64:$vj, (vnot (shl vsplat_imm_eq_1, v2i64:$vk))),
1460*5f757f3fSDimitry Andric          (v2i64 (VBITCLR_D v2i64:$vj, v2i64:$vk))>;
1461*5f757f3fSDimitry Andricdef : Pat<(and v16i8:$vj, (vnot (shl vsplat_imm_eq_1,
1462*5f757f3fSDimitry Andric                                     (vsplati8imm7 v16i8:$vk)))),
1463*5f757f3fSDimitry Andric          (v16i8 (VBITCLR_B v16i8:$vj, v16i8:$vk))>;
1464*5f757f3fSDimitry Andricdef : Pat<(and v8i16:$vj, (vnot (shl vsplat_imm_eq_1,
1465*5f757f3fSDimitry Andric                                     (vsplati16imm15 v8i16:$vk)))),
1466*5f757f3fSDimitry Andric          (v8i16 (VBITCLR_H v8i16:$vj, v8i16:$vk))>;
1467*5f757f3fSDimitry Andricdef : Pat<(and v4i32:$vj, (vnot (shl vsplat_imm_eq_1,
1468*5f757f3fSDimitry Andric                                     (vsplati32imm31 v4i32:$vk)))),
1469*5f757f3fSDimitry Andric          (v4i32 (VBITCLR_W v4i32:$vj, v4i32:$vk))>;
1470*5f757f3fSDimitry Andricdef : Pat<(and v2i64:$vj, (vnot (shl vsplat_imm_eq_1,
1471*5f757f3fSDimitry Andric                                     (vsplati64imm63 v2i64:$vk)))),
1472*5f757f3fSDimitry Andric          (v2i64 (VBITCLR_D v2i64:$vj, v2i64:$vk))>;
1473*5f757f3fSDimitry Andric
1474*5f757f3fSDimitry Andric// VBITCLRI_{B/H/W/D}
1475*5f757f3fSDimitry Andricdef : Pat<(and (v16i8 LSX128:$vj), (v16i8 (vsplat_uimm_inv_pow2 uimm3:$imm))),
1476*5f757f3fSDimitry Andric          (VBITCLRI_B LSX128:$vj, uimm3:$imm)>;
1477*5f757f3fSDimitry Andricdef : Pat<(and (v8i16 LSX128:$vj), (v8i16 (vsplat_uimm_inv_pow2 uimm4:$imm))),
1478*5f757f3fSDimitry Andric          (VBITCLRI_H LSX128:$vj, uimm4:$imm)>;
1479*5f757f3fSDimitry Andricdef : Pat<(and (v4i32 LSX128:$vj), (v4i32 (vsplat_uimm_inv_pow2 uimm5:$imm))),
1480*5f757f3fSDimitry Andric          (VBITCLRI_W LSX128:$vj, uimm5:$imm)>;
1481*5f757f3fSDimitry Andricdef : Pat<(and (v2i64 LSX128:$vj), (v2i64 (vsplat_uimm_inv_pow2 uimm6:$imm))),
1482*5f757f3fSDimitry Andric          (VBITCLRI_D LSX128:$vj, uimm6:$imm)>;
1483*5f757f3fSDimitry Andric
1484*5f757f3fSDimitry Andric// VBITSET_{B/H/W/D}
1485*5f757f3fSDimitry Andricdef : Pat<(or v16i8:$vj, (shl vsplat_imm_eq_1, v16i8:$vk)),
1486*5f757f3fSDimitry Andric          (v16i8 (VBITSET_B v16i8:$vj, v16i8:$vk))>;
1487*5f757f3fSDimitry Andricdef : Pat<(or v8i16:$vj, (shl vsplat_imm_eq_1, v8i16:$vk)),
1488*5f757f3fSDimitry Andric          (v8i16 (VBITSET_H v8i16:$vj, v8i16:$vk))>;
1489*5f757f3fSDimitry Andricdef : Pat<(or v4i32:$vj, (shl vsplat_imm_eq_1, v4i32:$vk)),
1490*5f757f3fSDimitry Andric          (v4i32 (VBITSET_W v4i32:$vj, v4i32:$vk))>;
1491*5f757f3fSDimitry Andricdef : Pat<(or v2i64:$vj, (shl vsplat_imm_eq_1, v2i64:$vk)),
1492*5f757f3fSDimitry Andric          (v2i64 (VBITSET_D v2i64:$vj, v2i64:$vk))>;
1493*5f757f3fSDimitry Andricdef : Pat<(or v16i8:$vj, (shl vsplat_imm_eq_1, (vsplati8imm7 v16i8:$vk))),
1494*5f757f3fSDimitry Andric          (v16i8 (VBITSET_B v16i8:$vj, v16i8:$vk))>;
1495*5f757f3fSDimitry Andricdef : Pat<(or v8i16:$vj, (shl vsplat_imm_eq_1, (vsplati16imm15 v8i16:$vk))),
1496*5f757f3fSDimitry Andric          (v8i16 (VBITSET_H v8i16:$vj, v8i16:$vk))>;
1497*5f757f3fSDimitry Andricdef : Pat<(or v4i32:$vj, (shl vsplat_imm_eq_1, (vsplati32imm31 v4i32:$vk))),
1498*5f757f3fSDimitry Andric          (v4i32 (VBITSET_W v4i32:$vj, v4i32:$vk))>;
1499*5f757f3fSDimitry Andricdef : Pat<(or v2i64:$vj, (shl vsplat_imm_eq_1, (vsplati64imm63 v2i64:$vk))),
1500*5f757f3fSDimitry Andric          (v2i64 (VBITSET_D v2i64:$vj, v2i64:$vk))>;
1501*5f757f3fSDimitry Andric
1502*5f757f3fSDimitry Andric// VBITSETI_{B/H/W/D}
1503*5f757f3fSDimitry Andricdef : Pat<(or (v16i8 LSX128:$vj), (v16i8 (vsplat_uimm_pow2 uimm3:$imm))),
1504*5f757f3fSDimitry Andric          (VBITSETI_B LSX128:$vj, uimm3:$imm)>;
1505*5f757f3fSDimitry Andricdef : Pat<(or (v8i16 LSX128:$vj), (v8i16 (vsplat_uimm_pow2 uimm4:$imm))),
1506*5f757f3fSDimitry Andric          (VBITSETI_H LSX128:$vj, uimm4:$imm)>;
1507*5f757f3fSDimitry Andricdef : Pat<(or (v4i32 LSX128:$vj), (v4i32 (vsplat_uimm_pow2 uimm5:$imm))),
1508*5f757f3fSDimitry Andric          (VBITSETI_W LSX128:$vj, uimm5:$imm)>;
1509*5f757f3fSDimitry Andricdef : Pat<(or (v2i64 LSX128:$vj), (v2i64 (vsplat_uimm_pow2 uimm6:$imm))),
1510*5f757f3fSDimitry Andric          (VBITSETI_D LSX128:$vj, uimm6:$imm)>;
1511*5f757f3fSDimitry Andric
1512*5f757f3fSDimitry Andric// VBITREV_{B/H/W/D}
1513*5f757f3fSDimitry Andricdef : Pat<(xor v16i8:$vj, (shl vsplat_imm_eq_1, v16i8:$vk)),
1514*5f757f3fSDimitry Andric          (v16i8 (VBITREV_B v16i8:$vj, v16i8:$vk))>;
1515*5f757f3fSDimitry Andricdef : Pat<(xor v8i16:$vj, (shl vsplat_imm_eq_1, v8i16:$vk)),
1516*5f757f3fSDimitry Andric          (v8i16 (VBITREV_H v8i16:$vj, v8i16:$vk))>;
1517*5f757f3fSDimitry Andricdef : Pat<(xor v4i32:$vj, (shl vsplat_imm_eq_1, v4i32:$vk)),
1518*5f757f3fSDimitry Andric          (v4i32 (VBITREV_W v4i32:$vj, v4i32:$vk))>;
1519*5f757f3fSDimitry Andricdef : Pat<(xor v2i64:$vj, (shl vsplat_imm_eq_1, v2i64:$vk)),
1520*5f757f3fSDimitry Andric          (v2i64 (VBITREV_D v2i64:$vj, v2i64:$vk))>;
1521*5f757f3fSDimitry Andricdef : Pat<(xor v16i8:$vj, (shl vsplat_imm_eq_1, (vsplati8imm7 v16i8:$vk))),
1522*5f757f3fSDimitry Andric          (v16i8 (VBITREV_B v16i8:$vj, v16i8:$vk))>;
1523*5f757f3fSDimitry Andricdef : Pat<(xor v8i16:$vj, (shl vsplat_imm_eq_1, (vsplati16imm15 v8i16:$vk))),
1524*5f757f3fSDimitry Andric          (v8i16 (VBITREV_H v8i16:$vj, v8i16:$vk))>;
1525*5f757f3fSDimitry Andricdef : Pat<(xor v4i32:$vj, (shl vsplat_imm_eq_1, (vsplati32imm31 v4i32:$vk))),
1526*5f757f3fSDimitry Andric          (v4i32 (VBITREV_W v4i32:$vj, v4i32:$vk))>;
1527*5f757f3fSDimitry Andricdef : Pat<(xor v2i64:$vj, (shl vsplat_imm_eq_1, (vsplati64imm63 v2i64:$vk))),
1528*5f757f3fSDimitry Andric          (v2i64 (VBITREV_D v2i64:$vj, v2i64:$vk))>;
1529*5f757f3fSDimitry Andric
1530*5f757f3fSDimitry Andric// VBITREVI_{B/H/W/D}
1531*5f757f3fSDimitry Andricdef : Pat<(xor (v16i8 LSX128:$vj), (v16i8 (vsplat_uimm_pow2 uimm3:$imm))),
1532*5f757f3fSDimitry Andric          (VBITREVI_B LSX128:$vj, uimm3:$imm)>;
1533*5f757f3fSDimitry Andricdef : Pat<(xor (v8i16 LSX128:$vj), (v8i16 (vsplat_uimm_pow2 uimm4:$imm))),
1534*5f757f3fSDimitry Andric          (VBITREVI_H LSX128:$vj, uimm4:$imm)>;
1535*5f757f3fSDimitry Andricdef : Pat<(xor (v4i32 LSX128:$vj), (v4i32 (vsplat_uimm_pow2 uimm5:$imm))),
1536*5f757f3fSDimitry Andric          (VBITREVI_W LSX128:$vj, uimm5:$imm)>;
1537*5f757f3fSDimitry Andricdef : Pat<(xor (v2i64 LSX128:$vj), (v2i64 (vsplat_uimm_pow2 uimm6:$imm))),
1538*5f757f3fSDimitry Andric          (VBITREVI_D LSX128:$vj, uimm6:$imm)>;
1539*5f757f3fSDimitry Andric
1540*5f757f3fSDimitry Andric// VFADD_{S/D}
1541*5f757f3fSDimitry Andricdefm : PatVrVrF<fadd, "VFADD">;
1542*5f757f3fSDimitry Andric
1543*5f757f3fSDimitry Andric// VFSUB_{S/D}
1544*5f757f3fSDimitry Andricdefm : PatVrVrF<fsub, "VFSUB">;
1545*5f757f3fSDimitry Andric
1546*5f757f3fSDimitry Andric// VFMUL_{S/D}
1547*5f757f3fSDimitry Andricdefm : PatVrVrF<fmul, "VFMUL">;
1548*5f757f3fSDimitry Andric
1549*5f757f3fSDimitry Andric// VFDIV_{S/D}
1550*5f757f3fSDimitry Andricdefm : PatVrVrF<fdiv, "VFDIV">;
1551*5f757f3fSDimitry Andric
1552*5f757f3fSDimitry Andric// VFMADD_{S/D}
1553*5f757f3fSDimitry Andricdef : Pat<(fma v4f32:$vj, v4f32:$vk, v4f32:$va),
1554*5f757f3fSDimitry Andric          (VFMADD_S v4f32:$vj, v4f32:$vk, v4f32:$va)>;
1555*5f757f3fSDimitry Andricdef : Pat<(fma v2f64:$vj, v2f64:$vk, v2f64:$va),
1556*5f757f3fSDimitry Andric          (VFMADD_D v2f64:$vj, v2f64:$vk, v2f64:$va)>;
1557*5f757f3fSDimitry Andric
1558*5f757f3fSDimitry Andric// VFMSUB_{S/D}
1559*5f757f3fSDimitry Andricdef : Pat<(fma v4f32:$vj, v4f32:$vk, (fneg v4f32:$va)),
1560*5f757f3fSDimitry Andric          (VFMSUB_S v4f32:$vj, v4f32:$vk, v4f32:$va)>;
1561*5f757f3fSDimitry Andricdef : Pat<(fma v2f64:$vj, v2f64:$vk, (fneg v2f64:$va)),
1562*5f757f3fSDimitry Andric          (VFMSUB_D v2f64:$vj, v2f64:$vk, v2f64:$va)>;
1563*5f757f3fSDimitry Andric
1564*5f757f3fSDimitry Andric// VFNMADD_{S/D}
1565*5f757f3fSDimitry Andricdef : Pat<(fneg (fma v4f32:$vj, v4f32:$vk, v4f32:$va)),
1566*5f757f3fSDimitry Andric          (VFNMADD_S v4f32:$vj, v4f32:$vk, v4f32:$va)>;
1567*5f757f3fSDimitry Andricdef : Pat<(fneg (fma v2f64:$vj, v2f64:$vk, v2f64:$va)),
1568*5f757f3fSDimitry Andric          (VFNMADD_D v2f64:$vj, v2f64:$vk, v2f64:$va)>;
1569*5f757f3fSDimitry Andricdef : Pat<(fma_nsz (fneg v4f32:$vj), v4f32:$vk, (fneg v4f32:$va)),
1570*5f757f3fSDimitry Andric          (VFNMADD_S v4f32:$vj, v4f32:$vk, v4f32:$va)>;
1571*5f757f3fSDimitry Andricdef : Pat<(fma_nsz (fneg v2f64:$vj), v2f64:$vk, (fneg v2f64:$va)),
1572*5f757f3fSDimitry Andric          (VFNMADD_D v2f64:$vj, v2f64:$vk, v2f64:$va)>;
1573*5f757f3fSDimitry Andric
1574*5f757f3fSDimitry Andric// VFNMSUB_{S/D}
1575*5f757f3fSDimitry Andricdef : Pat<(fneg (fma v4f32:$vj, v4f32:$vk, (fneg v4f32:$va))),
1576*5f757f3fSDimitry Andric          (VFNMSUB_S v4f32:$vj, v4f32:$vk, v4f32:$va)>;
1577*5f757f3fSDimitry Andricdef : Pat<(fneg (fma v2f64:$vj, v2f64:$vk, (fneg v2f64:$va))),
1578*5f757f3fSDimitry Andric          (VFNMSUB_D v2f64:$vj, v2f64:$vk, v2f64:$va)>;
1579*5f757f3fSDimitry Andricdef : Pat<(fma_nsz (fneg v4f32:$vj), v4f32:$vk, v4f32:$va),
1580*5f757f3fSDimitry Andric          (VFNMSUB_S v4f32:$vj, v4f32:$vk, v4f32:$va)>;
1581*5f757f3fSDimitry Andricdef : Pat<(fma_nsz (fneg v2f64:$vj), v2f64:$vk, v2f64:$va),
1582*5f757f3fSDimitry Andric          (VFNMSUB_D v2f64:$vj, v2f64:$vk, v2f64:$va)>;
1583*5f757f3fSDimitry Andric
1584*5f757f3fSDimitry Andric// VFSQRT_{S/D}
1585*5f757f3fSDimitry Andricdefm : PatVrF<fsqrt, "VFSQRT">;
1586*5f757f3fSDimitry Andric
1587*5f757f3fSDimitry Andric// VFRECIP_{S/D}
1588*5f757f3fSDimitry Andricdef : Pat<(fdiv vsplatf32_fpimm_eq_1, v4f32:$vj),
1589*5f757f3fSDimitry Andric          (VFRECIP_S v4f32:$vj)>;
1590*5f757f3fSDimitry Andricdef : Pat<(fdiv vsplatf64_fpimm_eq_1, v2f64:$vj),
1591*5f757f3fSDimitry Andric          (VFRECIP_D v2f64:$vj)>;
1592*5f757f3fSDimitry Andric
1593*5f757f3fSDimitry Andric// VFRSQRT_{S/D}
1594*5f757f3fSDimitry Andricdef : Pat<(fdiv vsplatf32_fpimm_eq_1, (fsqrt v4f32:$vj)),
1595*5f757f3fSDimitry Andric          (VFRSQRT_S v4f32:$vj)>;
1596*5f757f3fSDimitry Andricdef : Pat<(fdiv vsplatf64_fpimm_eq_1, (fsqrt v2f64:$vj)),
1597*5f757f3fSDimitry Andric          (VFRSQRT_D v2f64:$vj)>;
1598*5f757f3fSDimitry Andric
1599*5f757f3fSDimitry Andric// VSEQ[I]_{B/H/W/D}
1600*5f757f3fSDimitry Andricdefm : PatCCVrSimm5<SETEQ, "VSEQI">;
1601*5f757f3fSDimitry Andricdefm : PatCCVrVr<SETEQ, "VSEQ">;
1602*5f757f3fSDimitry Andric
1603*5f757f3fSDimitry Andric// VSLE[I]_{B/H/W/D}[U]
1604*5f757f3fSDimitry Andricdefm : PatCCVrSimm5<SETLE, "VSLEI">;
1605*5f757f3fSDimitry Andricdefm : PatCCVrUimm5<SETULE, "VSLEI">;
1606*5f757f3fSDimitry Andricdefm : PatCCVrVr<SETLE, "VSLE">;
1607*5f757f3fSDimitry Andricdefm : PatCCVrVrU<SETULE, "VSLE">;
1608*5f757f3fSDimitry Andric
1609*5f757f3fSDimitry Andric// VSLT[I]_{B/H/W/D}[U]
1610*5f757f3fSDimitry Andricdefm : PatCCVrSimm5<SETLT, "VSLTI">;
1611*5f757f3fSDimitry Andricdefm : PatCCVrUimm5<SETULT, "VSLTI">;
1612*5f757f3fSDimitry Andricdefm : PatCCVrVr<SETLT, "VSLT">;
1613*5f757f3fSDimitry Andricdefm : PatCCVrVrU<SETULT, "VSLT">;
1614*5f757f3fSDimitry Andric
1615*5f757f3fSDimitry Andric// VFCMP.cond.{S/D}
1616*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETEQ, "VFCMP_CEQ">;
1617*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETOEQ, "VFCMP_CEQ">;
1618*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETUEQ, "VFCMP_CUEQ">;
1619*5f757f3fSDimitry Andric
1620*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETLE, "VFCMP_CLE">;
1621*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETOLE, "VFCMP_CLE">;
1622*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETULE, "VFCMP_CULE">;
1623*5f757f3fSDimitry Andric
1624*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETLT, "VFCMP_CLT">;
1625*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETOLT, "VFCMP_CLT">;
1626*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETULT, "VFCMP_CULT">;
1627*5f757f3fSDimitry Andric
1628*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETNE, "VFCMP_CNE">;
1629*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETONE, "VFCMP_CNE">;
1630*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETUNE, "VFCMP_CUNE">;
1631*5f757f3fSDimitry Andric
1632*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETO, "VFCMP_COR">;
1633*5f757f3fSDimitry Andricdefm : PatCCVrVrF<SETUO, "VFCMP_CUN">;
1634*5f757f3fSDimitry Andric
1635*5f757f3fSDimitry Andric// VINSGR2VR_{B/H/W/D}
1636*5f757f3fSDimitry Andricdef : Pat<(vector_insert v16i8:$vd, GRLenVT:$rj, uimm4:$imm),
1637*5f757f3fSDimitry Andric          (VINSGR2VR_B v16i8:$vd, GRLenVT:$rj, uimm4:$imm)>;
1638*5f757f3fSDimitry Andricdef : Pat<(vector_insert v8i16:$vd, GRLenVT:$rj, uimm3:$imm),
1639*5f757f3fSDimitry Andric          (VINSGR2VR_H v8i16:$vd, GRLenVT:$rj, uimm3:$imm)>;
1640*5f757f3fSDimitry Andricdef : Pat<(vector_insert v4i32:$vd, GRLenVT:$rj, uimm2:$imm),
1641*5f757f3fSDimitry Andric          (VINSGR2VR_W v4i32:$vd, GRLenVT:$rj, uimm2:$imm)>;
1642*5f757f3fSDimitry Andricdef : Pat<(vector_insert v2i64:$vd, GRLenVT:$rj, uimm1:$imm),
1643*5f757f3fSDimitry Andric          (VINSGR2VR_D v2i64:$vd, GRLenVT:$rj, uimm1:$imm)>;
1644*5f757f3fSDimitry Andric
1645*5f757f3fSDimitry Andricdef : Pat<(vector_insert v4f32:$vd, FPR32:$fj, uimm2:$imm),
1646*5f757f3fSDimitry Andric          (VINSGR2VR_W $vd, (COPY_TO_REGCLASS FPR32:$fj, GPR), uimm2:$imm)>;
1647*5f757f3fSDimitry Andricdef : Pat<(vector_insert v2f64:$vd, FPR64:$fj, uimm1:$imm),
1648*5f757f3fSDimitry Andric          (VINSGR2VR_D $vd, (COPY_TO_REGCLASS FPR64:$fj, GPR), uimm1:$imm)>;
1649*5f757f3fSDimitry Andric
1650*5f757f3fSDimitry Andric// VPICKVE2GR_{B/H/W}[U]
1651*5f757f3fSDimitry Andricdef : Pat<(loongarch_vpick_sext_elt v16i8:$vd, uimm4:$imm, i8),
1652*5f757f3fSDimitry Andric          (VPICKVE2GR_B v16i8:$vd, uimm4:$imm)>;
1653*5f757f3fSDimitry Andricdef : Pat<(loongarch_vpick_sext_elt v8i16:$vd, uimm3:$imm, i16),
1654*5f757f3fSDimitry Andric          (VPICKVE2GR_H v8i16:$vd, uimm3:$imm)>;
1655*5f757f3fSDimitry Andricdef : Pat<(loongarch_vpick_sext_elt v4i32:$vd, uimm2:$imm, i32),
1656*5f757f3fSDimitry Andric          (VPICKVE2GR_W v4i32:$vd, uimm2:$imm)>;
1657*5f757f3fSDimitry Andric
1658*5f757f3fSDimitry Andricdef : Pat<(loongarch_vpick_zext_elt v16i8:$vd, uimm4:$imm, i8),
1659*5f757f3fSDimitry Andric          (VPICKVE2GR_BU v16i8:$vd, uimm4:$imm)>;
1660*5f757f3fSDimitry Andricdef : Pat<(loongarch_vpick_zext_elt v8i16:$vd, uimm3:$imm, i16),
1661*5f757f3fSDimitry Andric          (VPICKVE2GR_HU v8i16:$vd, uimm3:$imm)>;
1662*5f757f3fSDimitry Andricdef : Pat<(loongarch_vpick_zext_elt v4i32:$vd, uimm2:$imm, i32),
1663*5f757f3fSDimitry Andric          (VPICKVE2GR_WU v4i32:$vd, uimm2:$imm)>;
1664*5f757f3fSDimitry Andric
1665*5f757f3fSDimitry Andric// VREPLGR2VR_{B/H/W/D}
1666*5f757f3fSDimitry Andricdef : Pat<(lsxsplati8 GPR:$rj), (VREPLGR2VR_B GPR:$rj)>;
1667*5f757f3fSDimitry Andricdef : Pat<(lsxsplati16 GPR:$rj), (VREPLGR2VR_H GPR:$rj)>;
1668*5f757f3fSDimitry Andricdef : Pat<(lsxsplati32 GPR:$rj), (VREPLGR2VR_W GPR:$rj)>;
1669*5f757f3fSDimitry Andricdef : Pat<(lsxsplati64 GPR:$rj), (VREPLGR2VR_D GPR:$rj)>;
1670*5f757f3fSDimitry Andric
1671*5f757f3fSDimitry Andric// VREPLVE_{B/H/W/D}
1672*5f757f3fSDimitry Andricdef : Pat<(loongarch_vreplve v16i8:$vj, GRLenVT:$rk),
1673*5f757f3fSDimitry Andric          (VREPLVE_B v16i8:$vj, GRLenVT:$rk)>;
1674*5f757f3fSDimitry Andricdef : Pat<(loongarch_vreplve v8i16:$vj, GRLenVT:$rk),
1675*5f757f3fSDimitry Andric          (VREPLVE_H v8i16:$vj, GRLenVT:$rk)>;
1676*5f757f3fSDimitry Andricdef : Pat<(loongarch_vreplve v4i32:$vj, GRLenVT:$rk),
1677*5f757f3fSDimitry Andric          (VREPLVE_W v4i32:$vj, GRLenVT:$rk)>;
1678*5f757f3fSDimitry Andricdef : Pat<(loongarch_vreplve v2i64:$vj, GRLenVT:$rk),
1679*5f757f3fSDimitry Andric          (VREPLVE_D v2i64:$vj, GRLenVT:$rk)>;
1680*5f757f3fSDimitry Andric
1681*5f757f3fSDimitry Andric// VREPLVEI_{W/D}
1682*5f757f3fSDimitry Andricdef : Pat<(lsxsplatf32 FPR32:$fj),
1683*5f757f3fSDimitry Andric          (VREPLVEI_W (SUBREG_TO_REG (i64 0), FPR32:$fj, sub_32), 0)>;
1684*5f757f3fSDimitry Andricdef : Pat<(lsxsplatf64 FPR64:$fj),
1685*5f757f3fSDimitry Andric          (VREPLVEI_D (SUBREG_TO_REG (i64 0), FPR64:$fj, sub_64), 0)>;
1686*5f757f3fSDimitry Andric
1687*5f757f3fSDimitry Andric// Loads/Stores
1688*5f757f3fSDimitry Andricforeach vt = [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64] in {
1689*5f757f3fSDimitry Andric  defm : LdPat<load, VLD, vt>;
1690*5f757f3fSDimitry Andric  def  : RegRegLdPat<load, VLDX, vt>;
1691*5f757f3fSDimitry Andric  defm : StPat<store, VST, LSX128, vt>;
1692*5f757f3fSDimitry Andric  def  : RegRegStPat<store, VSTX, LSX128, vt>;
1693*5f757f3fSDimitry Andric}
1694*5f757f3fSDimitry Andric
1695*5f757f3fSDimitry Andric// Vector extraction with constant index.
1696*5f757f3fSDimitry Andricdef : Pat<(i64 (vector_extract v16i8:$vj, uimm4:$imm)),
1697*5f757f3fSDimitry Andric          (VPICKVE2GR_B v16i8:$vj, uimm4:$imm)>;
1698*5f757f3fSDimitry Andricdef : Pat<(i64 (vector_extract v8i16:$vj, uimm3:$imm)),
1699*5f757f3fSDimitry Andric          (VPICKVE2GR_H v8i16:$vj, uimm3:$imm)>;
1700*5f757f3fSDimitry Andricdef : Pat<(i64 (vector_extract v4i32:$vj, uimm2:$imm)),
1701*5f757f3fSDimitry Andric          (VPICKVE2GR_W v4i32:$vj, uimm2:$imm)>;
1702*5f757f3fSDimitry Andricdef : Pat<(i64 (vector_extract v2i64:$vj, uimm1:$imm)),
1703*5f757f3fSDimitry Andric          (VPICKVE2GR_D v2i64:$vj, uimm1:$imm)>;
1704*5f757f3fSDimitry Andricdef : Pat<(f32 (vector_extract v4f32:$vj, uimm2:$imm)),
1705*5f757f3fSDimitry Andric          (f32 (EXTRACT_SUBREG (VREPLVEI_W v4f32:$vj, uimm2:$imm), sub_32))>;
1706*5f757f3fSDimitry Andricdef : Pat<(f64 (vector_extract v2f64:$vj, uimm1:$imm)),
1707*5f757f3fSDimitry Andric          (f64 (EXTRACT_SUBREG (VREPLVEI_D v2f64:$vj, uimm1:$imm), sub_64))>;
1708*5f757f3fSDimitry Andric
1709*5f757f3fSDimitry Andric// Vector extraction with variable index.
1710*5f757f3fSDimitry Andricdef : Pat<(i64 (vector_extract v16i8:$vj, i64:$rk)),
1711*5f757f3fSDimitry Andric          (SRAI_W (COPY_TO_REGCLASS (f32 (EXTRACT_SUBREG (VREPLVE_B v16i8:$vj,
1712*5f757f3fSDimitry Andric                                                                    i64:$rk),
1713*5f757f3fSDimitry Andric                                                         sub_32)),
1714*5f757f3fSDimitry Andric                                    GPR), (i64 24))>;
1715*5f757f3fSDimitry Andricdef : Pat<(i64 (vector_extract v8i16:$vj, i64:$rk)),
1716*5f757f3fSDimitry Andric          (SRAI_W (COPY_TO_REGCLASS (f32 (EXTRACT_SUBREG (VREPLVE_H v8i16:$vj,
1717*5f757f3fSDimitry Andric                                                                    i64:$rk),
1718*5f757f3fSDimitry Andric                                                         sub_32)),
1719*5f757f3fSDimitry Andric                                    GPR), (i64 16))>;
1720*5f757f3fSDimitry Andricdef : Pat<(i64 (vector_extract v4i32:$vj, i64:$rk)),
1721*5f757f3fSDimitry Andric          (COPY_TO_REGCLASS (f32 (EXTRACT_SUBREG (VREPLVE_W v4i32:$vj, i64:$rk),
1722*5f757f3fSDimitry Andric                                                 sub_32)),
1723*5f757f3fSDimitry Andric                            GPR)>;
1724*5f757f3fSDimitry Andricdef : Pat<(i64 (vector_extract v2i64:$vj, i64:$rk)),
1725*5f757f3fSDimitry Andric          (COPY_TO_REGCLASS (f64 (EXTRACT_SUBREG (VREPLVE_D v2i64:$vj, i64:$rk),
1726*5f757f3fSDimitry Andric                                                 sub_64)),
1727*5f757f3fSDimitry Andric                            GPR)>;
1728*5f757f3fSDimitry Andricdef : Pat<(f32 (vector_extract v4f32:$vj, i64:$rk)),
1729*5f757f3fSDimitry Andric          (f32 (EXTRACT_SUBREG (VREPLVE_W v4f32:$vj, i64:$rk), sub_32))>;
1730*5f757f3fSDimitry Andricdef : Pat<(f64 (vector_extract v2f64:$vj, i64:$rk)),
1731*5f757f3fSDimitry Andric          (f64 (EXTRACT_SUBREG (VREPLVE_D v2f64:$vj, i64:$rk), sub_64))>;
1732*5f757f3fSDimitry Andric
1733*5f757f3fSDimitry Andric// vselect
1734*5f757f3fSDimitry Andricdef : Pat<(v16i8 (vselect LSX128:$vj, LSX128:$vd,
1735*5f757f3fSDimitry Andric                          (v16i8 (SplatPat_uimm8 uimm8:$imm)))),
1736*5f757f3fSDimitry Andric          (VBITSELI_B LSX128:$vd, LSX128:$vj, uimm8:$imm)>;
1737*5f757f3fSDimitry Andricforeach vt = [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64] in
1738*5f757f3fSDimitry Andric  def  : Pat<(vt (vselect LSX128:$va, LSX128:$vk, LSX128:$vj)),
1739*5f757f3fSDimitry Andric             (VBITSEL_V LSX128:$vj, LSX128:$vk, LSX128:$va)>;
1740*5f757f3fSDimitry Andric
1741*5f757f3fSDimitry Andric// fneg
1742*5f757f3fSDimitry Andricdef : Pat<(fneg (v4f32 LSX128:$vj)), (VBITREVI_W LSX128:$vj, 31)>;
1743*5f757f3fSDimitry Andricdef : Pat<(fneg (v2f64 LSX128:$vj)), (VBITREVI_D LSX128:$vj, 63)>;
1744*5f757f3fSDimitry Andric
1745*5f757f3fSDimitry Andric} // Predicates = [HasExtLSX]
1746*5f757f3fSDimitry Andric
1747*5f757f3fSDimitry Andric/// Intrinsic pattern
1748*5f757f3fSDimitry Andric
1749*5f757f3fSDimitry Andricclass deriveLSXIntrinsic<string Inst> {
1750*5f757f3fSDimitry Andric  Intrinsic ret = !cast<Intrinsic>(!tolower("int_loongarch_lsx_"#Inst));
1751*5f757f3fSDimitry Andric}
1752*5f757f3fSDimitry Andric
1753*5f757f3fSDimitry Andriclet Predicates = [HasExtLSX] in {
1754*5f757f3fSDimitry Andric
1755*5f757f3fSDimitry Andric// vty: v16i8/v8i16/v4i32/v2i64
1756*5f757f3fSDimitry Andric// Pat<(Intrinsic vty:$vj, vty:$vk),
1757*5f757f3fSDimitry Andric//     (LAInst vty:$vj, vty:$vk)>;
1758*5f757f3fSDimitry Andricforeach Inst = ["VSADD_B", "VSADD_BU", "VSSUB_B", "VSSUB_BU",
1759*5f757f3fSDimitry Andric                "VHADDW_H_B", "VHADDW_HU_BU", "VHSUBW_H_B", "VHSUBW_HU_BU",
1760*5f757f3fSDimitry Andric                "VADDWEV_H_B", "VADDWOD_H_B", "VSUBWEV_H_B", "VSUBWOD_H_B",
1761*5f757f3fSDimitry Andric                "VADDWEV_H_BU", "VADDWOD_H_BU", "VSUBWEV_H_BU", "VSUBWOD_H_BU",
1762*5f757f3fSDimitry Andric                "VADDWEV_H_BU_B", "VADDWOD_H_BU_B",
1763*5f757f3fSDimitry Andric                "VAVG_B", "VAVG_BU", "VAVGR_B", "VAVGR_BU",
1764*5f757f3fSDimitry Andric                "VABSD_B", "VABSD_BU", "VADDA_B", "VMUH_B", "VMUH_BU",
1765*5f757f3fSDimitry Andric                "VMULWEV_H_B", "VMULWOD_H_B", "VMULWEV_H_BU", "VMULWOD_H_BU",
1766*5f757f3fSDimitry Andric                "VMULWEV_H_BU_B", "VMULWOD_H_BU_B", "VSIGNCOV_B",
1767*5f757f3fSDimitry Andric                "VANDN_V", "VORN_V", "VROTR_B", "VSRLR_B", "VSRAR_B",
1768*5f757f3fSDimitry Andric                "VSEQ_B", "VSLE_B", "VSLE_BU", "VSLT_B", "VSLT_BU",
1769*5f757f3fSDimitry Andric                "VPACKEV_B", "VPACKOD_B", "VPICKEV_B", "VPICKOD_B",
1770*5f757f3fSDimitry Andric                "VILVL_B", "VILVH_B"] in
1771*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1772*5f757f3fSDimitry Andric               (v16i8 LSX128:$vj), (v16i8 LSX128:$vk)),
1773*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk)>;
1774*5f757f3fSDimitry Andricforeach Inst = ["VSADD_H", "VSADD_HU", "VSSUB_H", "VSSUB_HU",
1775*5f757f3fSDimitry Andric                "VHADDW_W_H", "VHADDW_WU_HU", "VHSUBW_W_H", "VHSUBW_WU_HU",
1776*5f757f3fSDimitry Andric                "VADDWEV_W_H", "VADDWOD_W_H", "VSUBWEV_W_H", "VSUBWOD_W_H",
1777*5f757f3fSDimitry Andric                "VADDWEV_W_HU", "VADDWOD_W_HU", "VSUBWEV_W_HU", "VSUBWOD_W_HU",
1778*5f757f3fSDimitry Andric                "VADDWEV_W_HU_H", "VADDWOD_W_HU_H",
1779*5f757f3fSDimitry Andric                "VAVG_H", "VAVG_HU", "VAVGR_H", "VAVGR_HU",
1780*5f757f3fSDimitry Andric                "VABSD_H", "VABSD_HU", "VADDA_H", "VMUH_H", "VMUH_HU",
1781*5f757f3fSDimitry Andric                "VMULWEV_W_H", "VMULWOD_W_H", "VMULWEV_W_HU", "VMULWOD_W_HU",
1782*5f757f3fSDimitry Andric                "VMULWEV_W_HU_H", "VMULWOD_W_HU_H", "VSIGNCOV_H", "VROTR_H",
1783*5f757f3fSDimitry Andric                "VSRLR_H", "VSRAR_H", "VSRLN_B_H", "VSRAN_B_H", "VSRLRN_B_H",
1784*5f757f3fSDimitry Andric                "VSRARN_B_H", "VSSRLN_B_H", "VSSRAN_B_H", "VSSRLN_BU_H",
1785*5f757f3fSDimitry Andric                "VSSRAN_BU_H", "VSSRLRN_B_H", "VSSRARN_B_H", "VSSRLRN_BU_H",
1786*5f757f3fSDimitry Andric                "VSSRARN_BU_H",
1787*5f757f3fSDimitry Andric                "VSEQ_H", "VSLE_H", "VSLE_HU", "VSLT_H", "VSLT_HU",
1788*5f757f3fSDimitry Andric                "VPACKEV_H", "VPACKOD_H", "VPICKEV_H", "VPICKOD_H",
1789*5f757f3fSDimitry Andric                "VILVL_H", "VILVH_H"] in
1790*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1791*5f757f3fSDimitry Andric               (v8i16 LSX128:$vj), (v8i16 LSX128:$vk)),
1792*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk)>;
1793*5f757f3fSDimitry Andricforeach Inst = ["VSADD_W", "VSADD_WU", "VSSUB_W", "VSSUB_WU",
1794*5f757f3fSDimitry Andric                "VHADDW_D_W", "VHADDW_DU_WU", "VHSUBW_D_W", "VHSUBW_DU_WU",
1795*5f757f3fSDimitry Andric                "VADDWEV_D_W", "VADDWOD_D_W", "VSUBWEV_D_W", "VSUBWOD_D_W",
1796*5f757f3fSDimitry Andric                "VADDWEV_D_WU", "VADDWOD_D_WU", "VSUBWEV_D_WU", "VSUBWOD_D_WU",
1797*5f757f3fSDimitry Andric                "VADDWEV_D_WU_W", "VADDWOD_D_WU_W",
1798*5f757f3fSDimitry Andric                "VAVG_W", "VAVG_WU", "VAVGR_W", "VAVGR_WU",
1799*5f757f3fSDimitry Andric                "VABSD_W", "VABSD_WU", "VADDA_W", "VMUH_W", "VMUH_WU",
1800*5f757f3fSDimitry Andric                "VMULWEV_D_W", "VMULWOD_D_W", "VMULWEV_D_WU", "VMULWOD_D_WU",
1801*5f757f3fSDimitry Andric                "VMULWEV_D_WU_W", "VMULWOD_D_WU_W", "VSIGNCOV_W", "VROTR_W",
1802*5f757f3fSDimitry Andric                "VSRLR_W", "VSRAR_W", "VSRLN_H_W", "VSRAN_H_W", "VSRLRN_H_W",
1803*5f757f3fSDimitry Andric                "VSRARN_H_W", "VSSRLN_H_W", "VSSRAN_H_W", "VSSRLN_HU_W",
1804*5f757f3fSDimitry Andric                "VSSRAN_HU_W", "VSSRLRN_H_W", "VSSRARN_H_W", "VSSRLRN_HU_W",
1805*5f757f3fSDimitry Andric                "VSSRARN_HU_W",
1806*5f757f3fSDimitry Andric                "VSEQ_W", "VSLE_W", "VSLE_WU", "VSLT_W", "VSLT_WU",
1807*5f757f3fSDimitry Andric                "VPACKEV_W", "VPACKOD_W", "VPICKEV_W", "VPICKOD_W",
1808*5f757f3fSDimitry Andric                "VILVL_W", "VILVH_W"] in
1809*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1810*5f757f3fSDimitry Andric               (v4i32 LSX128:$vj), (v4i32 LSX128:$vk)),
1811*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk)>;
1812*5f757f3fSDimitry Andricforeach Inst = ["VADD_Q", "VSUB_Q",
1813*5f757f3fSDimitry Andric                "VSADD_D", "VSADD_DU", "VSSUB_D", "VSSUB_DU",
1814*5f757f3fSDimitry Andric                "VHADDW_Q_D", "VHADDW_QU_DU", "VHSUBW_Q_D", "VHSUBW_QU_DU",
1815*5f757f3fSDimitry Andric                "VADDWEV_Q_D", "VADDWOD_Q_D", "VSUBWEV_Q_D", "VSUBWOD_Q_D",
1816*5f757f3fSDimitry Andric                "VADDWEV_Q_DU", "VADDWOD_Q_DU", "VSUBWEV_Q_DU", "VSUBWOD_Q_DU",
1817*5f757f3fSDimitry Andric                "VADDWEV_Q_DU_D", "VADDWOD_Q_DU_D",
1818*5f757f3fSDimitry Andric                "VAVG_D", "VAVG_DU", "VAVGR_D", "VAVGR_DU",
1819*5f757f3fSDimitry Andric                "VABSD_D", "VABSD_DU", "VADDA_D", "VMUH_D", "VMUH_DU",
1820*5f757f3fSDimitry Andric                "VMULWEV_Q_D", "VMULWOD_Q_D", "VMULWEV_Q_DU", "VMULWOD_Q_DU",
1821*5f757f3fSDimitry Andric                "VMULWEV_Q_DU_D", "VMULWOD_Q_DU_D", "VSIGNCOV_D", "VROTR_D",
1822*5f757f3fSDimitry Andric                "VSRLR_D", "VSRAR_D", "VSRLN_W_D", "VSRAN_W_D", "VSRLRN_W_D",
1823*5f757f3fSDimitry Andric                "VSRARN_W_D", "VSSRLN_W_D", "VSSRAN_W_D", "VSSRLN_WU_D",
1824*5f757f3fSDimitry Andric                "VSSRAN_WU_D", "VSSRLRN_W_D", "VSSRARN_W_D", "VSSRLRN_WU_D",
1825*5f757f3fSDimitry Andric                "VSSRARN_WU_D", "VFFINT_S_L",
1826*5f757f3fSDimitry Andric                "VSEQ_D", "VSLE_D", "VSLE_DU", "VSLT_D", "VSLT_DU",
1827*5f757f3fSDimitry Andric                "VPACKEV_D", "VPACKOD_D", "VPICKEV_D", "VPICKOD_D",
1828*5f757f3fSDimitry Andric                "VILVL_D", "VILVH_D"] in
1829*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1830*5f757f3fSDimitry Andric               (v2i64 LSX128:$vj), (v2i64 LSX128:$vk)),
1831*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk)>;
1832*5f757f3fSDimitry Andric
1833*5f757f3fSDimitry Andric// vty: v16i8/v8i16/v4i32/v2i64
1834*5f757f3fSDimitry Andric// Pat<(Intrinsic vty:$vd, vty:$vj, vty:$vk),
1835*5f757f3fSDimitry Andric//     (LAInst vty:$vd, vty:$vj, vty:$vk)>;
1836*5f757f3fSDimitry Andricforeach Inst = ["VMADDWEV_H_B", "VMADDWOD_H_B", "VMADDWEV_H_BU",
1837*5f757f3fSDimitry Andric                "VMADDWOD_H_BU", "VMADDWEV_H_BU_B", "VMADDWOD_H_BU_B"] in
1838*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1839*5f757f3fSDimitry Andric               (v8i16 LSX128:$vd), (v16i8 LSX128:$vj), (v16i8 LSX128:$vk)),
1840*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1841*5f757f3fSDimitry Andricforeach Inst = ["VMADDWEV_W_H", "VMADDWOD_W_H", "VMADDWEV_W_HU",
1842*5f757f3fSDimitry Andric                "VMADDWOD_W_HU", "VMADDWEV_W_HU_H", "VMADDWOD_W_HU_H"] in
1843*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1844*5f757f3fSDimitry Andric               (v4i32 LSX128:$vd), (v8i16 LSX128:$vj), (v8i16 LSX128:$vk)),
1845*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1846*5f757f3fSDimitry Andricforeach Inst = ["VMADDWEV_D_W", "VMADDWOD_D_W", "VMADDWEV_D_WU",
1847*5f757f3fSDimitry Andric                "VMADDWOD_D_WU", "VMADDWEV_D_WU_W", "VMADDWOD_D_WU_W"] in
1848*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1849*5f757f3fSDimitry Andric               (v2i64 LSX128:$vd), (v4i32 LSX128:$vj), (v4i32 LSX128:$vk)),
1850*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1851*5f757f3fSDimitry Andricforeach Inst = ["VMADDWEV_Q_D", "VMADDWOD_Q_D", "VMADDWEV_Q_DU",
1852*5f757f3fSDimitry Andric                "VMADDWOD_Q_DU", "VMADDWEV_Q_DU_D", "VMADDWOD_Q_DU_D"] in
1853*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1854*5f757f3fSDimitry Andric               (v2i64 LSX128:$vd), (v2i64 LSX128:$vj), (v2i64 LSX128:$vk)),
1855*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1856*5f757f3fSDimitry Andric
1857*5f757f3fSDimitry Andric// vty: v16i8/v8i16/v4i32/v2i64
1858*5f757f3fSDimitry Andric// Pat<(Intrinsic vty:$vj),
1859*5f757f3fSDimitry Andric//     (LAInst vty:$vj)>;
1860*5f757f3fSDimitry Andricforeach Inst = ["VEXTH_H_B", "VEXTH_HU_BU",
1861*5f757f3fSDimitry Andric                "VMSKLTZ_B", "VMSKGEZ_B", "VMSKNZ_B",
1862*5f757f3fSDimitry Andric                "VCLO_B"] in
1863*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret (v16i8 LSX128:$vj)),
1864*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj)>;
1865*5f757f3fSDimitry Andricforeach Inst = ["VEXTH_W_H", "VEXTH_WU_HU", "VMSKLTZ_H",
1866*5f757f3fSDimitry Andric                "VCLO_H", "VFCVTL_S_H", "VFCVTH_S_H"] in
1867*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret (v8i16 LSX128:$vj)),
1868*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj)>;
1869*5f757f3fSDimitry Andricforeach Inst = ["VEXTH_D_W", "VEXTH_DU_WU", "VMSKLTZ_W",
1870*5f757f3fSDimitry Andric                "VCLO_W", "VFFINT_S_W", "VFFINT_S_WU",
1871*5f757f3fSDimitry Andric                "VFFINTL_D_W", "VFFINTH_D_W"] in
1872*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret (v4i32 LSX128:$vj)),
1873*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj)>;
1874*5f757f3fSDimitry Andricforeach Inst = ["VEXTH_Q_D", "VEXTH_QU_DU", "VMSKLTZ_D",
1875*5f757f3fSDimitry Andric                "VEXTL_Q_D", "VEXTL_QU_DU",
1876*5f757f3fSDimitry Andric                "VCLO_D", "VFFINT_D_L", "VFFINT_D_LU"] in
1877*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret (v2i64 LSX128:$vj)),
1878*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj)>;
1879*5f757f3fSDimitry Andric
1880*5f757f3fSDimitry Andric// Pat<(Intrinsic timm:$imm)
1881*5f757f3fSDimitry Andric//     (LAInst timm:$imm)>;
1882*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vldi timm:$imm),
1883*5f757f3fSDimitry Andric          (VLDI (to_valid_timm timm:$imm))>;
1884*5f757f3fSDimitry Andricforeach Inst = ["VREPLI_B", "VREPLI_H", "VREPLI_W", "VREPLI_D"] in
1885*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret timm:$imm),
1886*5f757f3fSDimitry Andric            (!cast<LAInst>("Pseudo"#Inst) (to_valid_timm timm:$imm))>;
1887*5f757f3fSDimitry Andric
1888*5f757f3fSDimitry Andric// vty: v16i8/v8i16/v4i32/v2i64
1889*5f757f3fSDimitry Andric// Pat<(Intrinsic vty:$vj, timm:$imm)
1890*5f757f3fSDimitry Andric//     (LAInst vty:$vj, timm:$imm)>;
1891*5f757f3fSDimitry Andricforeach Inst = ["VSAT_B", "VSAT_BU", "VNORI_B", "VROTRI_B", "VSLLWIL_H_B",
1892*5f757f3fSDimitry Andric                "VSLLWIL_HU_BU", "VSRLRI_B", "VSRARI_B",
1893*5f757f3fSDimitry Andric                "VSEQI_B", "VSLEI_B", "VSLEI_BU", "VSLTI_B", "VSLTI_BU",
1894*5f757f3fSDimitry Andric                "VREPLVEI_B", "VBSLL_V", "VBSRL_V", "VSHUF4I_B"] in
1895*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret (v16i8 LSX128:$vj), timm:$imm),
1896*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj, (to_valid_timm timm:$imm))>;
1897*5f757f3fSDimitry Andricforeach Inst = ["VSAT_H", "VSAT_HU", "VROTRI_H", "VSLLWIL_W_H",
1898*5f757f3fSDimitry Andric                "VSLLWIL_WU_HU", "VSRLRI_H", "VSRARI_H",
1899*5f757f3fSDimitry Andric                "VSEQI_H", "VSLEI_H", "VSLEI_HU", "VSLTI_H", "VSLTI_HU",
1900*5f757f3fSDimitry Andric                "VREPLVEI_H", "VSHUF4I_H"] in
1901*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret (v8i16 LSX128:$vj), timm:$imm),
1902*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj, (to_valid_timm timm:$imm))>;
1903*5f757f3fSDimitry Andricforeach Inst = ["VSAT_W", "VSAT_WU", "VROTRI_W", "VSLLWIL_D_W",
1904*5f757f3fSDimitry Andric                "VSLLWIL_DU_WU", "VSRLRI_W", "VSRARI_W",
1905*5f757f3fSDimitry Andric                "VSEQI_W", "VSLEI_W", "VSLEI_WU", "VSLTI_W", "VSLTI_WU",
1906*5f757f3fSDimitry Andric                "VREPLVEI_W", "VSHUF4I_W"] in
1907*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret (v4i32 LSX128:$vj), timm:$imm),
1908*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj, (to_valid_timm timm:$imm))>;
1909*5f757f3fSDimitry Andricforeach Inst = ["VSAT_D", "VSAT_DU", "VROTRI_D", "VSRLRI_D", "VSRARI_D",
1910*5f757f3fSDimitry Andric                "VSEQI_D", "VSLEI_D", "VSLEI_DU", "VSLTI_D", "VSLTI_DU",
1911*5f757f3fSDimitry Andric                "VPICKVE2GR_D", "VPICKVE2GR_DU",
1912*5f757f3fSDimitry Andric                "VREPLVEI_D"] in
1913*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret (v2i64 LSX128:$vj), timm:$imm),
1914*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj, (to_valid_timm timm:$imm))>;
1915*5f757f3fSDimitry Andric
1916*5f757f3fSDimitry Andric// vty: v16i8/v8i16/v4i32/v2i64
1917*5f757f3fSDimitry Andric// Pat<(Intrinsic vty:$vd, vty:$vj, timm:$imm)
1918*5f757f3fSDimitry Andric//     (LAInst vty:$vd, vty:$vj, timm:$imm)>;
1919*5f757f3fSDimitry Andricforeach Inst = ["VSRLNI_B_H", "VSRANI_B_H", "VSRLRNI_B_H", "VSRARNI_B_H",
1920*5f757f3fSDimitry Andric                "VSSRLNI_B_H", "VSSRANI_B_H", "VSSRLNI_BU_H", "VSSRANI_BU_H",
1921*5f757f3fSDimitry Andric                "VSSRLRNI_B_H", "VSSRARNI_B_H", "VSSRLRNI_BU_H", "VSSRARNI_BU_H",
1922*5f757f3fSDimitry Andric                "VFRSTPI_B", "VBITSELI_B", "VEXTRINS_B"] in
1923*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1924*5f757f3fSDimitry Andric               (v16i8 LSX128:$vd), (v16i8 LSX128:$vj), timm:$imm),
1925*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj,
1926*5f757f3fSDimitry Andric               (to_valid_timm timm:$imm))>;
1927*5f757f3fSDimitry Andricforeach Inst = ["VSRLNI_H_W", "VSRANI_H_W", "VSRLRNI_H_W", "VSRARNI_H_W",
1928*5f757f3fSDimitry Andric                "VSSRLNI_H_W", "VSSRANI_H_W", "VSSRLNI_HU_W", "VSSRANI_HU_W",
1929*5f757f3fSDimitry Andric                "VSSRLRNI_H_W", "VSSRARNI_H_W", "VSSRLRNI_HU_W", "VSSRARNI_HU_W",
1930*5f757f3fSDimitry Andric                "VFRSTPI_H", "VEXTRINS_H"] in
1931*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1932*5f757f3fSDimitry Andric               (v8i16 LSX128:$vd), (v8i16 LSX128:$vj), timm:$imm),
1933*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj,
1934*5f757f3fSDimitry Andric               (to_valid_timm timm:$imm))>;
1935*5f757f3fSDimitry Andricforeach Inst = ["VSRLNI_W_D", "VSRANI_W_D", "VSRLRNI_W_D", "VSRARNI_W_D",
1936*5f757f3fSDimitry Andric                "VSSRLNI_W_D", "VSSRANI_W_D", "VSSRLNI_WU_D", "VSSRANI_WU_D",
1937*5f757f3fSDimitry Andric                "VSSRLRNI_W_D", "VSSRARNI_W_D", "VSSRLRNI_WU_D", "VSSRARNI_WU_D",
1938*5f757f3fSDimitry Andric                "VPERMI_W", "VEXTRINS_W"] in
1939*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1940*5f757f3fSDimitry Andric               (v4i32 LSX128:$vd), (v4i32 LSX128:$vj), timm:$imm),
1941*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj,
1942*5f757f3fSDimitry Andric               (to_valid_timm timm:$imm))>;
1943*5f757f3fSDimitry Andricforeach Inst = ["VSRLNI_D_Q", "VSRANI_D_Q", "VSRLRNI_D_Q", "VSRARNI_D_Q",
1944*5f757f3fSDimitry Andric                "VSSRLNI_D_Q", "VSSRANI_D_Q", "VSSRLNI_DU_Q", "VSSRANI_DU_Q",
1945*5f757f3fSDimitry Andric                "VSSRLRNI_D_Q", "VSSRARNI_D_Q", "VSSRLRNI_DU_Q", "VSSRARNI_DU_Q",
1946*5f757f3fSDimitry Andric                "VSHUF4I_D", "VEXTRINS_D"] in
1947*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1948*5f757f3fSDimitry Andric               (v2i64 LSX128:$vd), (v2i64 LSX128:$vj), timm:$imm),
1949*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj,
1950*5f757f3fSDimitry Andric               (to_valid_timm timm:$imm))>;
1951*5f757f3fSDimitry Andric
1952*5f757f3fSDimitry Andric// vty: v16i8/v8i16/v4i32/v2i64
1953*5f757f3fSDimitry Andric// Pat<(Intrinsic vty:$vd, vty:$vj, vty:$vk),
1954*5f757f3fSDimitry Andric//     (LAInst vty:$vd, vty:$vj, vty:$vk)>;
1955*5f757f3fSDimitry Andricforeach Inst = ["VFRSTP_B", "VBITSEL_V", "VSHUF_B"] in
1956*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1957*5f757f3fSDimitry Andric               (v16i8 LSX128:$vd), (v16i8 LSX128:$vj), (v16i8 LSX128:$vk)),
1958*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1959*5f757f3fSDimitry Andricforeach Inst = ["VFRSTP_H", "VSHUF_H"] in
1960*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1961*5f757f3fSDimitry Andric               (v8i16 LSX128:$vd), (v8i16 LSX128:$vj), (v8i16 LSX128:$vk)),
1962*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1963*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vshuf_w (v4i32 LSX128:$vd), (v4i32 LSX128:$vj),
1964*5f757f3fSDimitry Andric                                     (v4i32 LSX128:$vk)),
1965*5f757f3fSDimitry Andric          (VSHUF_W LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1966*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vshuf_d (v2i64 LSX128:$vd), (v2i64 LSX128:$vj),
1967*5f757f3fSDimitry Andric                                     (v2i64 LSX128:$vk)),
1968*5f757f3fSDimitry Andric          (VSHUF_D LSX128:$vd, LSX128:$vj, LSX128:$vk)>;
1969*5f757f3fSDimitry Andric
1970*5f757f3fSDimitry Andric// vty: v4f32/v2f64
1971*5f757f3fSDimitry Andric// Pat<(Intrinsic vty:$vj, vty:$vk, vty:$va),
1972*5f757f3fSDimitry Andric//     (LAInst vty:$vj, vty:$vk, vty:$va)>;
1973*5f757f3fSDimitry Andricforeach Inst = ["VFMSUB_S", "VFNMADD_S", "VFNMSUB_S"] in
1974*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1975*5f757f3fSDimitry Andric               (v4f32 LSX128:$vj), (v4f32 LSX128:$vk), (v4f32 LSX128:$va)),
1976*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk, LSX128:$va)>;
1977*5f757f3fSDimitry Andricforeach Inst = ["VFMSUB_D", "VFNMADD_D", "VFNMSUB_D"] in
1978*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1979*5f757f3fSDimitry Andric               (v2f64 LSX128:$vj), (v2f64 LSX128:$vk), (v2f64 LSX128:$va)),
1980*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk, LSX128:$va)>;
1981*5f757f3fSDimitry Andric
1982*5f757f3fSDimitry Andric// vty: v4f32/v2f64
1983*5f757f3fSDimitry Andric// Pat<(Intrinsic vty:$vj, vty:$vk),
1984*5f757f3fSDimitry Andric//     (LAInst vty:$vj, vty:$vk)>;
1985*5f757f3fSDimitry Andricforeach Inst = ["VFMAX_S", "VFMIN_S", "VFMAXA_S", "VFMINA_S", "VFCVT_H_S",
1986*5f757f3fSDimitry Andric                "VFCMP_CAF_S", "VFCMP_CUN_S", "VFCMP_CEQ_S", "VFCMP_CUEQ_S",
1987*5f757f3fSDimitry Andric                "VFCMP_CLT_S", "VFCMP_CULT_S", "VFCMP_CLE_S", "VFCMP_CULE_S",
1988*5f757f3fSDimitry Andric                "VFCMP_CNE_S", "VFCMP_COR_S", "VFCMP_CUNE_S",
1989*5f757f3fSDimitry Andric                "VFCMP_SAF_S", "VFCMP_SUN_S", "VFCMP_SEQ_S", "VFCMP_SUEQ_S",
1990*5f757f3fSDimitry Andric                "VFCMP_SLT_S", "VFCMP_SULT_S", "VFCMP_SLE_S", "VFCMP_SULE_S",
1991*5f757f3fSDimitry Andric                "VFCMP_SNE_S", "VFCMP_SOR_S", "VFCMP_SUNE_S"] in
1992*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
1993*5f757f3fSDimitry Andric               (v4f32 LSX128:$vj), (v4f32 LSX128:$vk)),
1994*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk)>;
1995*5f757f3fSDimitry Andricforeach Inst = ["VFMAX_D", "VFMIN_D", "VFMAXA_D", "VFMINA_D", "VFCVT_S_D",
1996*5f757f3fSDimitry Andric                "VFTINTRNE_W_D", "VFTINTRZ_W_D", "VFTINTRP_W_D", "VFTINTRM_W_D",
1997*5f757f3fSDimitry Andric                "VFTINT_W_D",
1998*5f757f3fSDimitry Andric                "VFCMP_CAF_D", "VFCMP_CUN_D", "VFCMP_CEQ_D", "VFCMP_CUEQ_D",
1999*5f757f3fSDimitry Andric                "VFCMP_CLT_D", "VFCMP_CULT_D", "VFCMP_CLE_D", "VFCMP_CULE_D",
2000*5f757f3fSDimitry Andric                "VFCMP_CNE_D", "VFCMP_COR_D", "VFCMP_CUNE_D",
2001*5f757f3fSDimitry Andric                "VFCMP_SAF_D", "VFCMP_SUN_D", "VFCMP_SEQ_D", "VFCMP_SUEQ_D",
2002*5f757f3fSDimitry Andric                "VFCMP_SLT_D", "VFCMP_SULT_D", "VFCMP_SLE_D", "VFCMP_SULE_D",
2003*5f757f3fSDimitry Andric                "VFCMP_SNE_D", "VFCMP_SOR_D", "VFCMP_SUNE_D"] in
2004*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret
2005*5f757f3fSDimitry Andric               (v2f64 LSX128:$vj), (v2f64 LSX128:$vk)),
2006*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj, LSX128:$vk)>;
2007*5f757f3fSDimitry Andric
2008*5f757f3fSDimitry Andric// vty: v4f32/v2f64
2009*5f757f3fSDimitry Andric// Pat<(Intrinsic vty:$vj),
2010*5f757f3fSDimitry Andric//     (LAInst vty:$vj)>;
2011*5f757f3fSDimitry Andricforeach Inst = ["VFLOGB_S", "VFCLASS_S", "VFSQRT_S", "VFRECIP_S", "VFRSQRT_S",
2012*5f757f3fSDimitry Andric                "VFRINT_S", "VFCVTL_D_S", "VFCVTH_D_S",
2013*5f757f3fSDimitry Andric                "VFRINTRNE_S", "VFRINTRZ_S", "VFRINTRP_S", "VFRINTRM_S",
2014*5f757f3fSDimitry Andric                "VFTINTRNE_W_S", "VFTINTRZ_W_S", "VFTINTRP_W_S", "VFTINTRM_W_S",
2015*5f757f3fSDimitry Andric                "VFTINT_W_S", "VFTINTRZ_WU_S", "VFTINT_WU_S",
2016*5f757f3fSDimitry Andric                "VFTINTRNEL_L_S", "VFTINTRNEH_L_S", "VFTINTRZL_L_S",
2017*5f757f3fSDimitry Andric                "VFTINTRZH_L_S", "VFTINTRPL_L_S", "VFTINTRPH_L_S",
2018*5f757f3fSDimitry Andric                "VFTINTRML_L_S", "VFTINTRMH_L_S", "VFTINTL_L_S",
2019*5f757f3fSDimitry Andric                "VFTINTH_L_S"] in
2020*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret (v4f32 LSX128:$vj)),
2021*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj)>;
2022*5f757f3fSDimitry Andricforeach Inst = ["VFLOGB_D", "VFCLASS_D", "VFSQRT_D", "VFRECIP_D", "VFRSQRT_D",
2023*5f757f3fSDimitry Andric                "VFRINT_D",
2024*5f757f3fSDimitry Andric                "VFRINTRNE_D", "VFRINTRZ_D", "VFRINTRP_D", "VFRINTRM_D",
2025*5f757f3fSDimitry Andric                "VFTINTRNE_L_D", "VFTINTRZ_L_D", "VFTINTRP_L_D", "VFTINTRM_L_D",
2026*5f757f3fSDimitry Andric                "VFTINT_L_D", "VFTINTRZ_LU_D", "VFTINT_LU_D"] in
2027*5f757f3fSDimitry Andric  def : Pat<(deriveLSXIntrinsic<Inst>.ret (v2f64 LSX128:$vj)),
2028*5f757f3fSDimitry Andric            (!cast<LAInst>(Inst) LSX128:$vj)>;
2029*5f757f3fSDimitry Andric
2030*5f757f3fSDimitry Andric// load
2031*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vld GPR:$rj, timm:$imm),
2032*5f757f3fSDimitry Andric          (VLD GPR:$rj, (to_valid_timm timm:$imm))>;
2033*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vldx GPR:$rj, GPR:$rk),
2034*5f757f3fSDimitry Andric          (VLDX GPR:$rj, GPR:$rk)>;
2035*5f757f3fSDimitry Andric
2036*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vldrepl_b GPR:$rj, timm:$imm),
2037*5f757f3fSDimitry Andric          (VLDREPL_B GPR:$rj, (to_valid_timm timm:$imm))>;
2038*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vldrepl_h GPR:$rj, timm:$imm),
2039*5f757f3fSDimitry Andric          (VLDREPL_H GPR:$rj, (to_valid_timm timm:$imm))>;
2040*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vldrepl_w GPR:$rj, timm:$imm),
2041*5f757f3fSDimitry Andric          (VLDREPL_W GPR:$rj, (to_valid_timm timm:$imm))>;
2042*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vldrepl_d GPR:$rj, timm:$imm),
2043*5f757f3fSDimitry Andric          (VLDREPL_D GPR:$rj, (to_valid_timm timm:$imm))>;
2044*5f757f3fSDimitry Andric
2045*5f757f3fSDimitry Andric// store
2046*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vst LSX128:$vd, GPR:$rj, timm:$imm),
2047*5f757f3fSDimitry Andric          (VST LSX128:$vd, GPR:$rj, (to_valid_timm timm:$imm))>;
2048*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vstx LSX128:$vd, GPR:$rj, GPR:$rk),
2049*5f757f3fSDimitry Andric          (VSTX LSX128:$vd, GPR:$rj, GPR:$rk)>;
2050*5f757f3fSDimitry Andric
2051*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vstelm_b v16i8:$vd, GPR:$rj, timm:$imm, timm:$idx),
2052*5f757f3fSDimitry Andric          (VSTELM_B v16i8:$vd, GPR:$rj, (to_valid_timm timm:$imm),
2053*5f757f3fSDimitry Andric                    (to_valid_timm timm:$idx))>;
2054*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vstelm_h v8i16:$vd, GPR:$rj, timm:$imm, timm:$idx),
2055*5f757f3fSDimitry Andric          (VSTELM_H v8i16:$vd, GPR:$rj, (to_valid_timm timm:$imm),
2056*5f757f3fSDimitry Andric                    (to_valid_timm timm:$idx))>;
2057*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vstelm_w v4i32:$vd, GPR:$rj, timm:$imm, timm:$idx),
2058*5f757f3fSDimitry Andric          (VSTELM_W v4i32:$vd, GPR:$rj, (to_valid_timm timm:$imm),
2059*5f757f3fSDimitry Andric                    (to_valid_timm timm:$idx))>;
2060*5f757f3fSDimitry Andricdef : Pat<(int_loongarch_lsx_vstelm_d v2i64:$vd, GPR:$rj, timm:$imm, timm:$idx),
2061*5f757f3fSDimitry Andric          (VSTELM_D v2i64:$vd, GPR:$rj, (to_valid_timm timm:$imm),
2062*5f757f3fSDimitry Andric                    (to_valid_timm timm:$idx))>;
2063*5f757f3fSDimitry Andric
206406c3fb27SDimitry Andric} // Predicates = [HasExtLSX]
2065