1 //===- ARMInstrNEON.td - NEON support for ARM -----------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file describes the ARM NEON instruction set.
12 //===----------------------------------------------------------------------===//
14 //===----------------------------------------------------------------------===//
15 // NEON-specific DAG Nodes.
16 //===----------------------------------------------------------------------===//
18 def SDTARMVCMP : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisSameAs<1, 2>]>;
19 def SDTARMVCMPZ : SDTypeProfile<1, 1, []>;
21 def NEONvceq : SDNode<"ARMISD::VCEQ", SDTARMVCMP>;
22 def NEONvceqz : SDNode<"ARMISD::VCEQZ", SDTARMVCMPZ>;
23 def NEONvcge : SDNode<"ARMISD::VCGE", SDTARMVCMP>;
24 def NEONvcgez : SDNode<"ARMISD::VCGEZ", SDTARMVCMPZ>;
25 def NEONvclez : SDNode<"ARMISD::VCLEZ", SDTARMVCMPZ>;
26 def NEONvcgeu : SDNode<"ARMISD::VCGEU", SDTARMVCMP>;
27 def NEONvcgt : SDNode<"ARMISD::VCGT", SDTARMVCMP>;
28 def NEONvcgtz : SDNode<"ARMISD::VCGTZ", SDTARMVCMPZ>;
29 def NEONvcltz : SDNode<"ARMISD::VCLTZ", SDTARMVCMPZ>;
30 def NEONvcgtu : SDNode<"ARMISD::VCGTU", SDTARMVCMP>;
31 def NEONvtst : SDNode<"ARMISD::VTST", SDTARMVCMP>;
33 // Types for vector shift by immediates. The "SHX" version is for long and
34 // narrow operations where the source and destination vectors have different
35 // types. The "SHINS" version is for shift and insert operations.
36 def SDTARMVSH : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisSameAs<0, 1>,
38 def SDTARMVSHX : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisInt<1>,
40 def SDTARMVSHINS : SDTypeProfile<1, 3, [SDTCisInt<0>, SDTCisSameAs<0, 1>,
41 SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>;
43 def NEONvshl : SDNode<"ARMISD::VSHL", SDTARMVSH>;
44 def NEONvshrs : SDNode<"ARMISD::VSHRs", SDTARMVSH>;
45 def NEONvshru : SDNode<"ARMISD::VSHRu", SDTARMVSH>;
46 def NEONvshlls : SDNode<"ARMISD::VSHLLs", SDTARMVSHX>;
47 def NEONvshllu : SDNode<"ARMISD::VSHLLu", SDTARMVSHX>;
48 def NEONvshlli : SDNode<"ARMISD::VSHLLi", SDTARMVSHX>;
49 def NEONvshrn : SDNode<"ARMISD::VSHRN", SDTARMVSHX>;
51 def NEONvrshrs : SDNode<"ARMISD::VRSHRs", SDTARMVSH>;
52 def NEONvrshru : SDNode<"ARMISD::VRSHRu", SDTARMVSH>;
53 def NEONvrshrn : SDNode<"ARMISD::VRSHRN", SDTARMVSHX>;
55 def NEONvqshls : SDNode<"ARMISD::VQSHLs", SDTARMVSH>;
56 def NEONvqshlu : SDNode<"ARMISD::VQSHLu", SDTARMVSH>;
57 def NEONvqshlsu : SDNode<"ARMISD::VQSHLsu", SDTARMVSH>;
58 def NEONvqshrns : SDNode<"ARMISD::VQSHRNs", SDTARMVSHX>;
59 def NEONvqshrnu : SDNode<"ARMISD::VQSHRNu", SDTARMVSHX>;
60 def NEONvqshrnsu : SDNode<"ARMISD::VQSHRNsu", SDTARMVSHX>;
62 def NEONvqrshrns : SDNode<"ARMISD::VQRSHRNs", SDTARMVSHX>;
63 def NEONvqrshrnu : SDNode<"ARMISD::VQRSHRNu", SDTARMVSHX>;
64 def NEONvqrshrnsu : SDNode<"ARMISD::VQRSHRNsu", SDTARMVSHX>;
66 def NEONvsli : SDNode<"ARMISD::VSLI", SDTARMVSHINS>;
67 def NEONvsri : SDNode<"ARMISD::VSRI", SDTARMVSHINS>;
69 def SDTARMVGETLN : SDTypeProfile<1, 2, [SDTCisVT<0, i32>, SDTCisInt<1>,
71 def NEONvgetlaneu : SDNode<"ARMISD::VGETLANEu", SDTARMVGETLN>;
72 def NEONvgetlanes : SDNode<"ARMISD::VGETLANEs", SDTARMVGETLN>;
74 def SDTARMVMOVIMM : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisVT<1, i32>]>;
75 def NEONvmovImm : SDNode<"ARMISD::VMOVIMM", SDTARMVMOVIMM>;
76 def NEONvmvnImm : SDNode<"ARMISD::VMVNIMM", SDTARMVMOVIMM>;
78 def SDTARMVORRIMM : SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisSameAs<0, 1>,
80 def NEONvorrImm : SDNode<"ARMISD::VORRIMM", SDTARMVORRIMM>;
81 def NEONvbicImm : SDNode<"ARMISD::VBICIMM", SDTARMVORRIMM>;
83 def NEONvbsl : SDNode<"ARMISD::VBSL",
84 SDTypeProfile<1, 3, [SDTCisVec<0>,
87 SDTCisSameAs<0, 3>]>>;
89 def NEONvdup : SDNode<"ARMISD::VDUP", SDTypeProfile<1, 1, [SDTCisVec<0>]>>;
91 // VDUPLANE can produce a quad-register result from a double-register source,
92 // so the result is not constrained to match the source.
93 def NEONvduplane : SDNode<"ARMISD::VDUPLANE",
94 SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisVec<1>,
97 def SDTARMVEXT : SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0, 1>,
98 SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>;
99 def NEONvext : SDNode<"ARMISD::VEXT", SDTARMVEXT>;
101 def SDTARMVSHUF : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisSameAs<0, 1>]>;
102 def NEONvrev64 : SDNode<"ARMISD::VREV64", SDTARMVSHUF>;
103 def NEONvrev32 : SDNode<"ARMISD::VREV32", SDTARMVSHUF>;
104 def NEONvrev16 : SDNode<"ARMISD::VREV16", SDTARMVSHUF>;
106 def SDTARMVSHUF2 : SDTypeProfile<2, 2, [SDTCisVec<0>, SDTCisSameAs<0, 1>,
108 SDTCisSameAs<0, 3>]>;
109 def NEONzip : SDNode<"ARMISD::VZIP", SDTARMVSHUF2>;
110 def NEONuzp : SDNode<"ARMISD::VUZP", SDTARMVSHUF2>;
111 def NEONtrn : SDNode<"ARMISD::VTRN", SDTARMVSHUF2>;
113 def SDTARMVMULL : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisInt<1>,
114 SDTCisSameAs<1, 2>]>;
115 def NEONvmulls : SDNode<"ARMISD::VMULLs", SDTARMVMULL>;
116 def NEONvmullu : SDNode<"ARMISD::VMULLu", SDTARMVMULL>;
118 def SDTARMFMAX : SDTypeProfile<1, 2, [SDTCisVT<0, f32>, SDTCisSameAs<0, 1>,
119 SDTCisSameAs<0, 2>]>;
120 def NEONfmax : SDNode<"ARMISD::FMAX", SDTARMFMAX>;
121 def NEONfmin : SDNode<"ARMISD::FMIN", SDTARMFMAX>;
123 def NEONimmAllZerosV: PatLeaf<(NEONvmovImm (i32 timm)), [{
124 ConstantSDNode *ConstVal = cast<ConstantSDNode>(N->getOperand(0));
125 unsigned EltBits = 0;
126 uint64_t EltVal = ARM_AM::decodeNEONModImm(ConstVal->getZExtValue(), EltBits);
127 return (EltBits == 32 && EltVal == 0);
130 def NEONimmAllOnesV: PatLeaf<(NEONvmovImm (i32 timm)), [{
131 ConstantSDNode *ConstVal = cast<ConstantSDNode>(N->getOperand(0));
132 unsigned EltBits = 0;
133 uint64_t EltVal = ARM_AM::decodeNEONModImm(ConstVal->getZExtValue(), EltBits);
134 return (EltBits == 8 && EltVal == 0xff);
137 //===----------------------------------------------------------------------===//
138 // NEON operand definitions
139 //===----------------------------------------------------------------------===//
141 def nModImm : Operand<i32> {
142 let PrintMethod = "printNEONModImmOperand";
145 //===----------------------------------------------------------------------===//
146 // NEON load / store instructions
147 //===----------------------------------------------------------------------===//
149 // Use VLDM to load a Q register as a D register pair.
150 // This is a pseudo instruction that is expanded to VLDMD after reg alloc.
152 : PseudoVFPLdStM<(outs QPR:$dst), (ins GPR:$Rn),
154 [(set QPR:$dst, (v2f64 (load GPR:$Rn)))]>;
156 // Use VSTM to store a Q register as a D register pair.
157 // This is a pseudo instruction that is expanded to VSTMD after reg alloc.
159 : PseudoVFPLdStM<(outs), (ins QPR:$src, GPR:$Rn),
161 [(store (v2f64 QPR:$src), GPR:$Rn)]>;
163 // Classes for VLD* pseudo-instructions with multi-register operands.
164 // These are expanded to real instructions after register allocation.
165 class VLDQPseudo<InstrItinClass itin>
166 : PseudoNLdSt<(outs QPR:$dst), (ins addrmode6:$addr), itin, "">;
167 class VLDQWBPseudo<InstrItinClass itin>
168 : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
169 (ins addrmode6:$addr, am6offset:$offset), itin,
171 class VLDQQPseudo<InstrItinClass itin>
172 : PseudoNLdSt<(outs QQPR:$dst), (ins addrmode6:$addr), itin, "">;
173 class VLDQQWBPseudo<InstrItinClass itin>
174 : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
175 (ins addrmode6:$addr, am6offset:$offset), itin,
177 class VLDQQQQPseudo<InstrItinClass itin>
178 : PseudoNLdSt<(outs QQQQPR:$dst), (ins addrmode6:$addr, QQQQPR:$src),itin,"">;
179 class VLDQQQQWBPseudo<InstrItinClass itin>
180 : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
181 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
182 "$addr.addr = $wb, $src = $dst">;
184 let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
186 // VLD1 : Vector Load (multiple single elements)
187 class VLD1D<bits<4> op7_4, string Dt>
188 : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$Vd),
189 (ins addrmode6:$Rn), IIC_VLD1,
190 "vld1", Dt, "\\{$Vd\\}, $Rn", "", []> {
194 class VLD1Q<bits<4> op7_4, string Dt>
195 : NLdSt<0,0b10,0b1010,op7_4, (outs DPR:$Vd, DPR:$dst2),
196 (ins addrmode6:$Rn), IIC_VLD1x2,
197 "vld1", Dt, "\\{$Vd, $dst2\\}, $Rn", "", []> {
199 let Inst{5-4} = Rn{5-4};
202 def VLD1d8 : VLD1D<{0,0,0,?}, "8">;
203 def VLD1d16 : VLD1D<{0,1,0,?}, "16">;
204 def VLD1d32 : VLD1D<{1,0,0,?}, "32">;
205 def VLD1d64 : VLD1D<{1,1,0,?}, "64">;
207 def VLD1q8 : VLD1Q<{0,0,?,?}, "8">;
208 def VLD1q16 : VLD1Q<{0,1,?,?}, "16">;
209 def VLD1q32 : VLD1Q<{1,0,?,?}, "32">;
210 def VLD1q64 : VLD1Q<{1,1,?,?}, "64">;
212 def VLD1q8Pseudo : VLDQPseudo<IIC_VLD1x2>;
213 def VLD1q16Pseudo : VLDQPseudo<IIC_VLD1x2>;
214 def VLD1q32Pseudo : VLDQPseudo<IIC_VLD1x2>;
215 def VLD1q64Pseudo : VLDQPseudo<IIC_VLD1x2>;
217 // ...with address register writeback:
218 class VLD1DWB<bits<4> op7_4, string Dt>
219 : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$Vd, GPR:$wb),
220 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1u,
221 "vld1", Dt, "\\{$Vd\\}, $Rn$Rm",
222 "$Rn.addr = $wb", []> {
225 class VLD1QWB<bits<4> op7_4, string Dt>
226 : NLdSt<0,0b10,0b1010,op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
227 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1x2u,
228 "vld1", Dt, "\\{$Vd, $dst2\\}, $Rn$Rm",
229 "$Rn.addr = $wb", []> {
230 let Inst{5-4} = Rn{5-4};
233 def VLD1d8_UPD : VLD1DWB<{0,0,0,?}, "8">;
234 def VLD1d16_UPD : VLD1DWB<{0,1,0,?}, "16">;
235 def VLD1d32_UPD : VLD1DWB<{1,0,0,?}, "32">;
236 def VLD1d64_UPD : VLD1DWB<{1,1,0,?}, "64">;
238 def VLD1q8_UPD : VLD1QWB<{0,0,?,?}, "8">;
239 def VLD1q16_UPD : VLD1QWB<{0,1,?,?}, "16">;
240 def VLD1q32_UPD : VLD1QWB<{1,0,?,?}, "32">;
241 def VLD1q64_UPD : VLD1QWB<{1,1,?,?}, "64">;
243 def VLD1q8Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
244 def VLD1q16Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
245 def VLD1q32Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
246 def VLD1q64Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
248 // ...with 3 registers (some of these are only for the disassembler):
249 class VLD1D3<bits<4> op7_4, string Dt>
250 : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
251 (ins addrmode6:$Rn), IIC_VLD1x3, "vld1", Dt,
252 "\\{$Vd, $dst2, $dst3\\}, $Rn", "", []> {
256 class VLD1D3WB<bits<4> op7_4, string Dt>
257 : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
258 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1x3u, "vld1", Dt,
259 "\\{$Vd, $dst2, $dst3\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
263 def VLD1d8T : VLD1D3<{0,0,0,?}, "8">;
264 def VLD1d16T : VLD1D3<{0,1,0,?}, "16">;
265 def VLD1d32T : VLD1D3<{1,0,0,?}, "32">;
266 def VLD1d64T : VLD1D3<{1,1,0,?}, "64">;
268 def VLD1d8T_UPD : VLD1D3WB<{0,0,0,?}, "8">;
269 def VLD1d16T_UPD : VLD1D3WB<{0,1,0,?}, "16">;
270 def VLD1d32T_UPD : VLD1D3WB<{1,0,0,?}, "32">;
271 def VLD1d64T_UPD : VLD1D3WB<{1,1,0,?}, "64">;
273 def VLD1d64TPseudo : VLDQQPseudo<IIC_VLD1x3>;
274 def VLD1d64TPseudo_UPD : VLDQQWBPseudo<IIC_VLD1x3u>;
276 // ...with 4 registers (some of these are only for the disassembler):
277 class VLD1D4<bits<4> op7_4, string Dt>
278 : NLdSt<0,0b10,0b0010,op7_4,(outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
279 (ins addrmode6:$Rn), IIC_VLD1x4, "vld1", Dt,
280 "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []> {
282 let Inst{5-4} = Rn{5-4};
284 class VLD1D4WB<bits<4> op7_4, string Dt>
285 : NLdSt<0,0b10,0b0010,op7_4,
286 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
287 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1x4u, "vld1", Dt,
288 "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm", "$Rn.addr = $wb",
290 let Inst{5-4} = Rn{5-4};
293 def VLD1d8Q : VLD1D4<{0,0,?,?}, "8">;
294 def VLD1d16Q : VLD1D4<{0,1,?,?}, "16">;
295 def VLD1d32Q : VLD1D4<{1,0,?,?}, "32">;
296 def VLD1d64Q : VLD1D4<{1,1,?,?}, "64">;
298 def VLD1d8Q_UPD : VLD1D4WB<{0,0,?,?}, "8">;
299 def VLD1d16Q_UPD : VLD1D4WB<{0,1,?,?}, "16">;
300 def VLD1d32Q_UPD : VLD1D4WB<{1,0,?,?}, "32">;
301 def VLD1d64Q_UPD : VLD1D4WB<{1,1,?,?}, "64">;
303 def VLD1d64QPseudo : VLDQQPseudo<IIC_VLD1x4>;
304 def VLD1d64QPseudo_UPD : VLDQQWBPseudo<IIC_VLD1x4u>;
306 // VLD2 : Vector Load (multiple 2-element structures)
307 class VLD2D<bits<4> op11_8, bits<4> op7_4, string Dt>
308 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2),
309 (ins addrmode6:$Rn), IIC_VLD2,
310 "vld2", Dt, "\\{$Vd, $dst2\\}, $Rn", "", []> {
312 let Inst{5-4} = Rn{5-4};
314 class VLD2Q<bits<4> op7_4, string Dt>
315 : NLdSt<0, 0b10, 0b0011, op7_4,
316 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
317 (ins addrmode6:$Rn), IIC_VLD2x2,
318 "vld2", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []> {
320 let Inst{5-4} = Rn{5-4};
323 def VLD2d8 : VLD2D<0b1000, {0,0,?,?}, "8">;
324 def VLD2d16 : VLD2D<0b1000, {0,1,?,?}, "16">;
325 def VLD2d32 : VLD2D<0b1000, {1,0,?,?}, "32">;
327 def VLD2q8 : VLD2Q<{0,0,?,?}, "8">;
328 def VLD2q16 : VLD2Q<{0,1,?,?}, "16">;
329 def VLD2q32 : VLD2Q<{1,0,?,?}, "32">;
331 def VLD2d8Pseudo : VLDQPseudo<IIC_VLD2>;
332 def VLD2d16Pseudo : VLDQPseudo<IIC_VLD2>;
333 def VLD2d32Pseudo : VLDQPseudo<IIC_VLD2>;
335 def VLD2q8Pseudo : VLDQQPseudo<IIC_VLD2x2>;
336 def VLD2q16Pseudo : VLDQQPseudo<IIC_VLD2x2>;
337 def VLD2q32Pseudo : VLDQQPseudo<IIC_VLD2x2>;
339 // ...with address register writeback:
340 class VLD2DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
341 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
342 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD2u,
343 "vld2", Dt, "\\{$Vd, $dst2\\}, $Rn$Rm",
344 "$Rn.addr = $wb", []> {
345 let Inst{5-4} = Rn{5-4};
347 class VLD2QWB<bits<4> op7_4, string Dt>
348 : NLdSt<0, 0b10, 0b0011, op7_4,
349 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
350 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD2x2u,
351 "vld2", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm",
352 "$Rn.addr = $wb", []> {
353 let Inst{5-4} = Rn{5-4};
356 def VLD2d8_UPD : VLD2DWB<0b1000, {0,0,?,?}, "8">;
357 def VLD2d16_UPD : VLD2DWB<0b1000, {0,1,?,?}, "16">;
358 def VLD2d32_UPD : VLD2DWB<0b1000, {1,0,?,?}, "32">;
360 def VLD2q8_UPD : VLD2QWB<{0,0,?,?}, "8">;
361 def VLD2q16_UPD : VLD2QWB<{0,1,?,?}, "16">;
362 def VLD2q32_UPD : VLD2QWB<{1,0,?,?}, "32">;
364 def VLD2d8Pseudo_UPD : VLDQWBPseudo<IIC_VLD2u>;
365 def VLD2d16Pseudo_UPD : VLDQWBPseudo<IIC_VLD2u>;
366 def VLD2d32Pseudo_UPD : VLDQWBPseudo<IIC_VLD2u>;
368 def VLD2q8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD2x2u>;
369 def VLD2q16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD2x2u>;
370 def VLD2q32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD2x2u>;
372 // ...with double-spaced registers (for disassembly only):
373 def VLD2b8 : VLD2D<0b1001, {0,0,?,?}, "8">;
374 def VLD2b16 : VLD2D<0b1001, {0,1,?,?}, "16">;
375 def VLD2b32 : VLD2D<0b1001, {1,0,?,?}, "32">;
376 def VLD2b8_UPD : VLD2DWB<0b1001, {0,0,?,?}, "8">;
377 def VLD2b16_UPD : VLD2DWB<0b1001, {0,1,?,?}, "16">;
378 def VLD2b32_UPD : VLD2DWB<0b1001, {1,0,?,?}, "32">;
380 // VLD3 : Vector Load (multiple 3-element structures)
381 class VLD3D<bits<4> op11_8, bits<4> op7_4, string Dt>
382 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
383 (ins addrmode6:$Rn), IIC_VLD3,
384 "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn", "", []> {
389 def VLD3d8 : VLD3D<0b0100, {0,0,0,?}, "8">;
390 def VLD3d16 : VLD3D<0b0100, {0,1,0,?}, "16">;
391 def VLD3d32 : VLD3D<0b0100, {1,0,0,?}, "32">;
393 def VLD3d8Pseudo : VLDQQPseudo<IIC_VLD3>;
394 def VLD3d16Pseudo : VLDQQPseudo<IIC_VLD3>;
395 def VLD3d32Pseudo : VLDQQPseudo<IIC_VLD3>;
397 // ...with address register writeback:
398 class VLD3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
399 : NLdSt<0, 0b10, op11_8, op7_4,
400 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
401 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD3u,
402 "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn$Rm",
403 "$Rn.addr = $wb", []> {
407 def VLD3d8_UPD : VLD3DWB<0b0100, {0,0,0,?}, "8">;
408 def VLD3d16_UPD : VLD3DWB<0b0100, {0,1,0,?}, "16">;
409 def VLD3d32_UPD : VLD3DWB<0b0100, {1,0,0,?}, "32">;
411 def VLD3d8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>;
412 def VLD3d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>;
413 def VLD3d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>;
415 // ...with double-spaced registers:
416 def VLD3q8 : VLD3D<0b0101, {0,0,0,?}, "8">;
417 def VLD3q16 : VLD3D<0b0101, {0,1,0,?}, "16">;
418 def VLD3q32 : VLD3D<0b0101, {1,0,0,?}, "32">;
419 def VLD3q8_UPD : VLD3DWB<0b0101, {0,0,0,?}, "8">;
420 def VLD3q16_UPD : VLD3DWB<0b0101, {0,1,0,?}, "16">;
421 def VLD3q32_UPD : VLD3DWB<0b0101, {1,0,0,?}, "32">;
423 def VLD3q8Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
424 def VLD3q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
425 def VLD3q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
427 // ...alternate versions to be allocated odd register numbers:
428 def VLD3q8oddPseudo : VLDQQQQPseudo<IIC_VLD3>;
429 def VLD3q16oddPseudo : VLDQQQQPseudo<IIC_VLD3>;
430 def VLD3q32oddPseudo : VLDQQQQPseudo<IIC_VLD3>;
432 def VLD3q8oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
433 def VLD3q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
434 def VLD3q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
436 // VLD4 : Vector Load (multiple 4-element structures)
437 class VLD4D<bits<4> op11_8, bits<4> op7_4, string Dt>
438 : NLdSt<0, 0b10, op11_8, op7_4,
439 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
440 (ins addrmode6:$Rn), IIC_VLD4,
441 "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []> {
443 let Inst{5-4} = Rn{5-4};
446 def VLD4d8 : VLD4D<0b0000, {0,0,?,?}, "8">;
447 def VLD4d16 : VLD4D<0b0000, {0,1,?,?}, "16">;
448 def VLD4d32 : VLD4D<0b0000, {1,0,?,?}, "32">;
450 def VLD4d8Pseudo : VLDQQPseudo<IIC_VLD4>;
451 def VLD4d16Pseudo : VLDQQPseudo<IIC_VLD4>;
452 def VLD4d32Pseudo : VLDQQPseudo<IIC_VLD4>;
454 // ...with address register writeback:
455 class VLD4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
456 : NLdSt<0, 0b10, op11_8, op7_4,
457 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
458 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD4u,
459 "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm",
460 "$Rn.addr = $wb", []> {
461 let Inst{5-4} = Rn{5-4};
464 def VLD4d8_UPD : VLD4DWB<0b0000, {0,0,?,?}, "8">;
465 def VLD4d16_UPD : VLD4DWB<0b0000, {0,1,?,?}, "16">;
466 def VLD4d32_UPD : VLD4DWB<0b0000, {1,0,?,?}, "32">;
468 def VLD4d8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4u>;
469 def VLD4d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4u>;
470 def VLD4d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4u>;
472 // ...with double-spaced registers:
473 def VLD4q8 : VLD4D<0b0001, {0,0,?,?}, "8">;
474 def VLD4q16 : VLD4D<0b0001, {0,1,?,?}, "16">;
475 def VLD4q32 : VLD4D<0b0001, {1,0,?,?}, "32">;
476 def VLD4q8_UPD : VLD4DWB<0b0001, {0,0,?,?}, "8">;
477 def VLD4q16_UPD : VLD4DWB<0b0001, {0,1,?,?}, "16">;
478 def VLD4q32_UPD : VLD4DWB<0b0001, {1,0,?,?}, "32">;
480 def VLD4q8Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>;
481 def VLD4q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>;
482 def VLD4q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>;
484 // ...alternate versions to be allocated odd register numbers:
485 def VLD4q8oddPseudo : VLDQQQQPseudo<IIC_VLD4>;
486 def VLD4q16oddPseudo : VLDQQQQPseudo<IIC_VLD4>;
487 def VLD4q32oddPseudo : VLDQQQQPseudo<IIC_VLD4>;
489 def VLD4q8oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>;
490 def VLD4q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>;
491 def VLD4q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>;
493 } // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
495 // Classes for VLD*LN pseudo-instructions with multi-register operands.
496 // These are expanded to real instructions after register allocation.
497 class VLDQLNPseudo<InstrItinClass itin>
498 : PseudoNLdSt<(outs QPR:$dst),
499 (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
500 itin, "$src = $dst">;
501 class VLDQLNWBPseudo<InstrItinClass itin>
502 : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
503 (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
504 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
505 class VLDQQLNPseudo<InstrItinClass itin>
506 : PseudoNLdSt<(outs QQPR:$dst),
507 (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
508 itin, "$src = $dst">;
509 class VLDQQLNWBPseudo<InstrItinClass itin>
510 : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
511 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
512 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
513 class VLDQQQQLNPseudo<InstrItinClass itin>
514 : PseudoNLdSt<(outs QQQQPR:$dst),
515 (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
516 itin, "$src = $dst">;
517 class VLDQQQQLNWBPseudo<InstrItinClass itin>
518 : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
519 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
520 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
522 // VLD1LN : Vector Load (single element to one lane)
523 class VLD1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
525 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd),
526 (ins addrmode6:$Rn, DPR:$src, nohash_imm:$lane),
527 IIC_VLD1ln, "vld1", Dt, "\\{$Vd[$lane]\\}, $Rn",
529 [(set DPR:$Vd, (vector_insert (Ty DPR:$src),
530 (i32 (LoadOp addrmode6:$Rn)),
534 class VLD1LN32<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
536 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd),
537 (ins addrmode6oneL32:$Rn, DPR:$src, nohash_imm:$lane),
538 IIC_VLD1ln, "vld1", Dt, "\\{$Vd[$lane]\\}, $Rn",
540 [(set DPR:$Vd, (vector_insert (Ty DPR:$src),
541 (i32 (LoadOp addrmode6oneL32:$Rn)),
545 class VLD1QLNPseudo<ValueType Ty, PatFrag LoadOp> : VLDQLNPseudo<IIC_VLD1ln> {
546 let Pattern = [(set QPR:$dst, (vector_insert (Ty QPR:$src),
547 (i32 (LoadOp addrmode6:$addr)),
551 def VLD1LNd8 : VLD1LN<0b0000, {?,?,?,0}, "8", v8i8, extloadi8> {
552 let Inst{7-5} = lane{2-0};
554 def VLD1LNd16 : VLD1LN<0b0100, {?,?,0,?}, "16", v4i16, extloadi16> {
555 let Inst{7-6} = lane{1-0};
558 def VLD1LNd32 : VLD1LN32<0b1000, {?,0,?,?}, "32", v2i32, load> {
559 let Inst{7} = lane{0};
564 def VLD1LNq8Pseudo : VLD1QLNPseudo<v16i8, extloadi8>;
565 def VLD1LNq16Pseudo : VLD1QLNPseudo<v8i16, extloadi16>;
566 def VLD1LNq32Pseudo : VLD1QLNPseudo<v4i32, load>;
568 def : Pat<(vector_insert (v2f32 DPR:$src),
569 (f32 (load addrmode6:$addr)), imm:$lane),
570 (VLD1LNd32 addrmode6:$addr, DPR:$src, imm:$lane)>;
571 def : Pat<(vector_insert (v4f32 QPR:$src),
572 (f32 (load addrmode6:$addr)), imm:$lane),
573 (VLD1LNq32Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
575 let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
577 // ...with address register writeback:
578 class VLD1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
579 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, GPR:$wb),
580 (ins addrmode6:$Rn, am6offset:$Rm,
581 DPR:$src, nohash_imm:$lane), IIC_VLD1lnu, "vld1", Dt,
582 "\\{$Vd[$lane]\\}, $Rn$Rm",
583 "$src = $Vd, $Rn.addr = $wb", []>;
585 def VLD1LNd8_UPD : VLD1LNWB<0b0000, {?,?,?,0}, "8"> {
586 let Inst{7-5} = lane{2-0};
588 def VLD1LNd16_UPD : VLD1LNWB<0b0100, {?,?,0,?}, "16"> {
589 let Inst{7-6} = lane{1-0};
592 def VLD1LNd32_UPD : VLD1LNWB<0b1000, {?,0,?,?}, "32"> {
593 let Inst{7} = lane{0};
598 def VLD1LNq8Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>;
599 def VLD1LNq16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>;
600 def VLD1LNq32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>;
602 // VLD2LN : Vector Load (single 2-element structure to one lane)
603 class VLD2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
604 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2),
605 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, nohash_imm:$lane),
606 IIC_VLD2ln, "vld2", Dt, "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn",
607 "$src1 = $Vd, $src2 = $dst2", []> {
612 def VLD2LNd8 : VLD2LN<0b0001, {?,?,?,?}, "8"> {
613 let Inst{7-5} = lane{2-0};
615 def VLD2LNd16 : VLD2LN<0b0101, {?,?,0,?}, "16"> {
616 let Inst{7-6} = lane{1-0};
618 def VLD2LNd32 : VLD2LN<0b1001, {?,0,0,?}, "32"> {
619 let Inst{7} = lane{0};
622 def VLD2LNd8Pseudo : VLDQLNPseudo<IIC_VLD2ln>;
623 def VLD2LNd16Pseudo : VLDQLNPseudo<IIC_VLD2ln>;
624 def VLD2LNd32Pseudo : VLDQLNPseudo<IIC_VLD2ln>;
626 // ...with double-spaced registers:
627 def VLD2LNq16 : VLD2LN<0b0101, {?,?,1,?}, "16"> {
628 let Inst{7-6} = lane{1-0};
630 def VLD2LNq32 : VLD2LN<0b1001, {?,1,0,?}, "32"> {
631 let Inst{7} = lane{0};
634 def VLD2LNq16Pseudo : VLDQQLNPseudo<IIC_VLD2ln>;
635 def VLD2LNq32Pseudo : VLDQQLNPseudo<IIC_VLD2ln>;
637 // ...with address register writeback:
638 class VLD2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
639 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
640 (ins addrmode6:$Rn, am6offset:$Rm,
641 DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VLD2lnu, "vld2", Dt,
642 "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn$Rm",
643 "$src1 = $Vd, $src2 = $dst2, $Rn.addr = $wb", []> {
647 def VLD2LNd8_UPD : VLD2LNWB<0b0001, {?,?,?,?}, "8"> {
648 let Inst{7-5} = lane{2-0};
650 def VLD2LNd16_UPD : VLD2LNWB<0b0101, {?,?,0,?}, "16"> {
651 let Inst{7-6} = lane{1-0};
653 def VLD2LNd32_UPD : VLD2LNWB<0b1001, {?,0,0,?}, "32"> {
654 let Inst{7} = lane{0};
657 def VLD2LNd8Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>;
658 def VLD2LNd16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>;
659 def VLD2LNd32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>;
661 def VLD2LNq16_UPD : VLD2LNWB<0b0101, {?,?,1,?}, "16"> {
662 let Inst{7-6} = lane{1-0};
664 def VLD2LNq32_UPD : VLD2LNWB<0b1001, {?,1,0,?}, "32"> {
665 let Inst{7} = lane{0};
668 def VLD2LNq16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>;
669 def VLD2LNq32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>;
671 // VLD3LN : Vector Load (single 3-element structure to one lane)
672 class VLD3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
673 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
674 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3,
675 nohash_imm:$lane), IIC_VLD3ln, "vld3", Dt,
676 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn",
677 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3", []> {
681 def VLD3LNd8 : VLD3LN<0b0010, {?,?,?,0}, "8"> {
682 let Inst{7-5} = lane{2-0};
684 def VLD3LNd16 : VLD3LN<0b0110, {?,?,0,0}, "16"> {
685 let Inst{7-6} = lane{1-0};
687 def VLD3LNd32 : VLD3LN<0b1010, {?,0,0,0}, "32"> {
688 let Inst{7} = lane{0};
691 def VLD3LNd8Pseudo : VLDQQLNPseudo<IIC_VLD3ln>;
692 def VLD3LNd16Pseudo : VLDQQLNPseudo<IIC_VLD3ln>;
693 def VLD3LNd32Pseudo : VLDQQLNPseudo<IIC_VLD3ln>;
695 // ...with double-spaced registers:
696 def VLD3LNq16 : VLD3LN<0b0110, {?,?,1,0}, "16"> {
697 let Inst{7-6} = lane{1-0};
699 def VLD3LNq32 : VLD3LN<0b1010, {?,1,0,0}, "32"> {
700 let Inst{7} = lane{0};
703 def VLD3LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>;
704 def VLD3LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>;
706 // ...with address register writeback:
707 class VLD3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
708 : NLdStLn<1, 0b10, op11_8, op7_4,
709 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
710 (ins addrmode6:$Rn, am6offset:$Rm,
711 DPR:$src1, DPR:$src2, DPR:$src3, nohash_imm:$lane),
712 IIC_VLD3lnu, "vld3", Dt,
713 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn$Rm",
714 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $Rn.addr = $wb",
717 def VLD3LNd8_UPD : VLD3LNWB<0b0010, {?,?,?,0}, "8"> {
718 let Inst{7-5} = lane{2-0};
720 def VLD3LNd16_UPD : VLD3LNWB<0b0110, {?,?,0,0}, "16"> {
721 let Inst{7-6} = lane{1-0};
723 def VLD3LNd32_UPD : VLD3LNWB<0b1010, {?,0,0,0}, "32"> {
724 let Inst{7} = lane{0};
727 def VLD3LNd8Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>;
728 def VLD3LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>;
729 def VLD3LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>;
731 def VLD3LNq16_UPD : VLD3LNWB<0b0110, {?,?,1,0}, "16"> {
732 let Inst{7-6} = lane{1-0};
734 def VLD3LNq32_UPD : VLD3LNWB<0b1010, {?,1,0,0}, "32"> {
735 let Inst{7} = lane{0};
738 def VLD3LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>;
739 def VLD3LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>;
741 // VLD4LN : Vector Load (single 4-element structure to one lane)
742 class VLD4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
743 : NLdStLn<1, 0b10, op11_8, op7_4,
744 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
745 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4,
746 nohash_imm:$lane), IIC_VLD4ln, "vld4", Dt,
747 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn",
748 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4", []> {
753 def VLD4LNd8 : VLD4LN<0b0011, {?,?,?,?}, "8"> {
754 let Inst{7-5} = lane{2-0};
756 def VLD4LNd16 : VLD4LN<0b0111, {?,?,0,?}, "16"> {
757 let Inst{7-6} = lane{1-0};
759 def VLD4LNd32 : VLD4LN<0b1011, {?,0,?,?}, "32"> {
760 let Inst{7} = lane{0};
764 def VLD4LNd8Pseudo : VLDQQLNPseudo<IIC_VLD4ln>;
765 def VLD4LNd16Pseudo : VLDQQLNPseudo<IIC_VLD4ln>;
766 def VLD4LNd32Pseudo : VLDQQLNPseudo<IIC_VLD4ln>;
768 // ...with double-spaced registers:
769 def VLD4LNq16 : VLD4LN<0b0111, {?,?,1,?}, "16"> {
770 let Inst{7-6} = lane{1-0};
772 def VLD4LNq32 : VLD4LN<0b1011, {?,1,?,?}, "32"> {
773 let Inst{7} = lane{0};
777 def VLD4LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>;
778 def VLD4LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>;
780 // ...with address register writeback:
781 class VLD4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
782 : NLdStLn<1, 0b10, op11_8, op7_4,
783 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
784 (ins addrmode6:$Rn, am6offset:$Rm,
785 DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
786 IIC_VLD4lnu, "vld4", Dt,
787 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn$Rm",
788 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4, $Rn.addr = $wb",
793 def VLD4LNd8_UPD : VLD4LNWB<0b0011, {?,?,?,?}, "8"> {
794 let Inst{7-5} = lane{2-0};
796 def VLD4LNd16_UPD : VLD4LNWB<0b0111, {?,?,0,?}, "16"> {
797 let Inst{7-6} = lane{1-0};
799 def VLD4LNd32_UPD : VLD4LNWB<0b1011, {?,0,?,?}, "32"> {
800 let Inst{7} = lane{0};
804 def VLD4LNd8Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>;
805 def VLD4LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>;
806 def VLD4LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>;
808 def VLD4LNq16_UPD : VLD4LNWB<0b0111, {?,?,1,?}, "16"> {
809 let Inst{7-6} = lane{1-0};
811 def VLD4LNq32_UPD : VLD4LNWB<0b1011, {?,1,?,?}, "32"> {
812 let Inst{7} = lane{0};
816 def VLD4LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>;
817 def VLD4LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>;
819 } // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
821 // VLD1DUP : Vector Load (single element to all lanes)
822 class VLD1DUP<bits<4> op7_4, string Dt, ValueType Ty, PatFrag LoadOp>
823 : NLdSt<1, 0b10, 0b1100, op7_4, (outs DPR:$Vd), (ins addrmode6dup:$Rn),
824 IIC_VLD1dup, "vld1", Dt, "\\{$Vd[]\\}, $Rn", "",
825 [(set DPR:$Vd, (Ty (NEONvdup (i32 (LoadOp addrmode6dup:$Rn)))))]> {
829 class VLD1QDUPPseudo<ValueType Ty, PatFrag LoadOp> : VLDQPseudo<IIC_VLD1dup> {
830 let Pattern = [(set QPR:$dst,
831 (Ty (NEONvdup (i32 (LoadOp addrmode6dup:$addr)))))];
834 def VLD1DUPd8 : VLD1DUP<{0,0,0,?}, "8", v8i8, extloadi8>;
835 def VLD1DUPd16 : VLD1DUP<{0,1,0,?}, "16", v4i16, extloadi16>;
836 def VLD1DUPd32 : VLD1DUP<{1,0,0,?}, "32", v2i32, load>;
838 def VLD1DUPq8Pseudo : VLD1QDUPPseudo<v16i8, extloadi8>;
839 def VLD1DUPq16Pseudo : VLD1QDUPPseudo<v8i16, extloadi16>;
840 def VLD1DUPq32Pseudo : VLD1QDUPPseudo<v4i32, load>;
842 def : Pat<(v2f32 (NEONvdup (f32 (load addrmode6dup:$addr)))),
843 (VLD1DUPd32 addrmode6:$addr)>;
844 def : Pat<(v4f32 (NEONvdup (f32 (load addrmode6dup:$addr)))),
845 (VLD1DUPq32Pseudo addrmode6:$addr)>;
847 let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
849 class VLD1QDUP<bits<4> op7_4, string Dt>
850 : NLdSt<1, 0b10, 0b1100, op7_4, (outs DPR:$Vd, DPR:$dst2),
851 (ins addrmode6dup:$Rn), IIC_VLD1dup,
852 "vld1", Dt, "\\{$Vd[], $dst2[]\\}, $Rn", "", []> {
857 def VLD1DUPq8 : VLD1QDUP<{0,0,1,0}, "8">;
858 def VLD1DUPq16 : VLD1QDUP<{0,1,1,?}, "16">;
859 def VLD1DUPq32 : VLD1QDUP<{1,0,1,?}, "32">;
861 // ...with address register writeback:
862 class VLD1DUPWB<bits<4> op7_4, string Dt>
863 : NLdSt<1, 0b10, 0b1100, op7_4, (outs DPR:$Vd, GPR:$wb),
864 (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD1dupu,
865 "vld1", Dt, "\\{$Vd[]\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
868 class VLD1QDUPWB<bits<4> op7_4, string Dt>
869 : NLdSt<1, 0b10, 0b1100, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
870 (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD1dupu,
871 "vld1", Dt, "\\{$Vd[], $dst2[]\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
875 def VLD1DUPd8_UPD : VLD1DUPWB<{0,0,0,0}, "8">;
876 def VLD1DUPd16_UPD : VLD1DUPWB<{0,1,0,?}, "16">;
877 def VLD1DUPd32_UPD : VLD1DUPWB<{1,0,0,?}, "32">;
879 def VLD1DUPq8_UPD : VLD1QDUPWB<{0,0,1,0}, "8">;
880 def VLD1DUPq16_UPD : VLD1QDUPWB<{0,1,1,?}, "16">;
881 def VLD1DUPq32_UPD : VLD1QDUPWB<{1,0,1,?}, "32">;
883 def VLD1DUPq8Pseudo_UPD : VLDQWBPseudo<IIC_VLD1dupu>;
884 def VLD1DUPq16Pseudo_UPD : VLDQWBPseudo<IIC_VLD1dupu>;
885 def VLD1DUPq32Pseudo_UPD : VLDQWBPseudo<IIC_VLD1dupu>;
887 // VLD2DUP : Vector Load (single 2-element structure to all lanes)
888 class VLD2DUP<bits<4> op7_4, string Dt>
889 : NLdSt<1, 0b10, 0b1101, op7_4, (outs DPR:$Vd, DPR:$dst2),
890 (ins addrmode6dup:$Rn), IIC_VLD2dup,
891 "vld2", Dt, "\\{$Vd[], $dst2[]\\}, $Rn", "", []> {
896 def VLD2DUPd8 : VLD2DUP<{0,0,0,?}, "8">;
897 def VLD2DUPd16 : VLD2DUP<{0,1,0,?}, "16">;
898 def VLD2DUPd32 : VLD2DUP<{1,0,0,?}, "32">;
900 def VLD2DUPd8Pseudo : VLDQPseudo<IIC_VLD2dup>;
901 def VLD2DUPd16Pseudo : VLDQPseudo<IIC_VLD2dup>;
902 def VLD2DUPd32Pseudo : VLDQPseudo<IIC_VLD2dup>;
904 // ...with double-spaced registers (not used for codegen):
905 def VLD2DUPd8x2 : VLD2DUP<{0,0,1,?}, "8">;
906 def VLD2DUPd16x2 : VLD2DUP<{0,1,1,?}, "16">;
907 def VLD2DUPd32x2 : VLD2DUP<{1,0,1,?}, "32">;
909 // ...with address register writeback:
910 class VLD2DUPWB<bits<4> op7_4, string Dt>
911 : NLdSt<1, 0b10, 0b1101, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
912 (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD2dupu,
913 "vld2", Dt, "\\{$Vd[], $dst2[]\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
917 def VLD2DUPd8_UPD : VLD2DUPWB<{0,0,0,0}, "8">;
918 def VLD2DUPd16_UPD : VLD2DUPWB<{0,1,0,?}, "16">;
919 def VLD2DUPd32_UPD : VLD2DUPWB<{1,0,0,?}, "32">;
921 def VLD2DUPd8x2_UPD : VLD2DUPWB<{0,0,1,0}, "8">;
922 def VLD2DUPd16x2_UPD : VLD2DUPWB<{0,1,1,?}, "16">;
923 def VLD2DUPd32x2_UPD : VLD2DUPWB<{1,0,1,?}, "32">;
925 def VLD2DUPd8Pseudo_UPD : VLDQWBPseudo<IIC_VLD2dupu>;
926 def VLD2DUPd16Pseudo_UPD : VLDQWBPseudo<IIC_VLD2dupu>;
927 def VLD2DUPd32Pseudo_UPD : VLDQWBPseudo<IIC_VLD2dupu>;
929 // VLD3DUP : Vector Load (single 3-element structure to all lanes)
930 class VLD3DUP<bits<4> op7_4, string Dt>
931 : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
932 (ins addrmode6dup:$Rn), IIC_VLD3dup,
933 "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn", "", []> {
938 def VLD3DUPd8 : VLD3DUP<{0,0,0,?}, "8">;
939 def VLD3DUPd16 : VLD3DUP<{0,1,0,?}, "16">;
940 def VLD3DUPd32 : VLD3DUP<{1,0,0,?}, "32">;
942 def VLD3DUPd8Pseudo : VLDQQPseudo<IIC_VLD3dup>;
943 def VLD3DUPd16Pseudo : VLDQQPseudo<IIC_VLD3dup>;
944 def VLD3DUPd32Pseudo : VLDQQPseudo<IIC_VLD3dup>;
946 // ...with double-spaced registers (not used for codegen):
947 def VLD3DUPd8x2 : VLD3DUP<{0,0,1,?}, "8">;
948 def VLD3DUPd16x2 : VLD3DUP<{0,1,1,?}, "16">;
949 def VLD3DUPd32x2 : VLD3DUP<{1,0,1,?}, "32">;
951 // ...with address register writeback:
952 class VLD3DUPWB<bits<4> op7_4, string Dt>
953 : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
954 (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD3dupu,
955 "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn$Rm",
956 "$Rn.addr = $wb", []> {
960 def VLD3DUPd8_UPD : VLD3DUPWB<{0,0,0,0}, "8">;
961 def VLD3DUPd16_UPD : VLD3DUPWB<{0,1,0,?}, "16">;
962 def VLD3DUPd32_UPD : VLD3DUPWB<{1,0,0,?}, "32">;
964 def VLD3DUPd8x2_UPD : VLD3DUPWB<{0,0,1,0}, "8">;
965 def VLD3DUPd16x2_UPD : VLD3DUPWB<{0,1,1,?}, "16">;
966 def VLD3DUPd32x2_UPD : VLD3DUPWB<{1,0,1,?}, "32">;
968 def VLD3DUPd8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>;
969 def VLD3DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>;
970 def VLD3DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>;
972 // VLD4DUP : Vector Load (single 4-element structure to all lanes)
973 class VLD4DUP<bits<4> op7_4, string Dt>
974 : NLdSt<1, 0b10, 0b1111, op7_4,
975 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
976 (ins addrmode6dup:$Rn), IIC_VLD4dup,
977 "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn", "", []> {
982 def VLD4DUPd8 : VLD4DUP<{0,0,0,?}, "8">;
983 def VLD4DUPd16 : VLD4DUP<{0,1,0,?}, "16">;
984 def VLD4DUPd32 : VLD4DUP<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
986 def VLD4DUPd8Pseudo : VLDQQPseudo<IIC_VLD4dup>;
987 def VLD4DUPd16Pseudo : VLDQQPseudo<IIC_VLD4dup>;
988 def VLD4DUPd32Pseudo : VLDQQPseudo<IIC_VLD4dup>;
990 // ...with double-spaced registers (not used for codegen):
991 def VLD4DUPd8x2 : VLD4DUP<{0,0,1,?}, "8">;
992 def VLD4DUPd16x2 : VLD4DUP<{0,1,1,?}, "16">;
993 def VLD4DUPd32x2 : VLD4DUP<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
995 // ...with address register writeback:
996 class VLD4DUPWB<bits<4> op7_4, string Dt>
997 : NLdSt<1, 0b10, 0b1111, op7_4,
998 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
999 (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD4dupu,
1000 "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn$Rm",
1001 "$Rn.addr = $wb", []> {
1002 let Inst{4} = Rn{4};
1005 def VLD4DUPd8_UPD : VLD4DUPWB<{0,0,0,0}, "8">;
1006 def VLD4DUPd16_UPD : VLD4DUPWB<{0,1,0,?}, "16">;
1007 def VLD4DUPd32_UPD : VLD4DUPWB<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
1009 def VLD4DUPd8x2_UPD : VLD4DUPWB<{0,0,1,0}, "8">;
1010 def VLD4DUPd16x2_UPD : VLD4DUPWB<{0,1,1,?}, "16">;
1011 def VLD4DUPd32x2_UPD : VLD4DUPWB<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
1013 def VLD4DUPd8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>;
1014 def VLD4DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>;
1015 def VLD4DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>;
1017 } // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
1019 let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in {
1021 // Classes for VST* pseudo-instructions with multi-register operands.
1022 // These are expanded to real instructions after register allocation.
1023 class VSTQPseudo<InstrItinClass itin>
1024 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src), itin, "">;
1025 class VSTQWBPseudo<InstrItinClass itin>
1026 : PseudoNLdSt<(outs GPR:$wb),
1027 (ins addrmode6:$addr, am6offset:$offset, QPR:$src), itin,
1028 "$addr.addr = $wb">;
1029 class VSTQQPseudo<InstrItinClass itin>
1030 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src), itin, "">;
1031 class VSTQQWBPseudo<InstrItinClass itin>
1032 : PseudoNLdSt<(outs GPR:$wb),
1033 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src), itin,
1034 "$addr.addr = $wb">;
1035 class VSTQQQQPseudo<InstrItinClass itin>
1036 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src), itin, "">;
1037 class VSTQQQQWBPseudo<InstrItinClass itin>
1038 : PseudoNLdSt<(outs GPR:$wb),
1039 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
1040 "$addr.addr = $wb">;
1042 // VST1 : Vector Store (multiple single elements)
1043 class VST1D<bits<4> op7_4, string Dt>
1044 : NLdSt<0,0b00,0b0111,op7_4, (outs), (ins addrmode6:$Rn, DPR:$Vd),
1045 IIC_VST1, "vst1", Dt, "\\{$Vd\\}, $Rn", "", []> {
1047 let Inst{4} = Rn{4};
1049 class VST1Q<bits<4> op7_4, string Dt>
1050 : NLdSt<0,0b00,0b1010,op7_4, (outs),
1051 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2), IIC_VST1x2,
1052 "vst1", Dt, "\\{$Vd, $src2\\}, $Rn", "", []> {
1054 let Inst{5-4} = Rn{5-4};
1057 def VST1d8 : VST1D<{0,0,0,?}, "8">;
1058 def VST1d16 : VST1D<{0,1,0,?}, "16">;
1059 def VST1d32 : VST1D<{1,0,0,?}, "32">;
1060 def VST1d64 : VST1D<{1,1,0,?}, "64">;
1062 def VST1q8 : VST1Q<{0,0,?,?}, "8">;
1063 def VST1q16 : VST1Q<{0,1,?,?}, "16">;
1064 def VST1q32 : VST1Q<{1,0,?,?}, "32">;
1065 def VST1q64 : VST1Q<{1,1,?,?}, "64">;
1067 def VST1q8Pseudo : VSTQPseudo<IIC_VST1x2>;
1068 def VST1q16Pseudo : VSTQPseudo<IIC_VST1x2>;
1069 def VST1q32Pseudo : VSTQPseudo<IIC_VST1x2>;
1070 def VST1q64Pseudo : VSTQPseudo<IIC_VST1x2>;
1072 // ...with address register writeback:
1073 class VST1DWB<bits<4> op7_4, string Dt>
1074 : NLdSt<0, 0b00, 0b0111, op7_4, (outs GPR:$wb),
1075 (ins addrmode6:$Rn, am6offset:$Rm, DPR:$Vd), IIC_VST1u,
1076 "vst1", Dt, "\\{$Vd\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
1077 let Inst{4} = Rn{4};
1079 class VST1QWB<bits<4> op7_4, string Dt>
1080 : NLdSt<0, 0b00, 0b1010, op7_4, (outs GPR:$wb),
1081 (ins addrmode6:$Rn, am6offset:$Rm, DPR:$Vd, DPR:$src2),
1082 IIC_VST1x2u, "vst1", Dt, "\\{$Vd, $src2\\}, $Rn$Rm",
1083 "$Rn.addr = $wb", []> {
1084 let Inst{5-4} = Rn{5-4};
1087 def VST1d8_UPD : VST1DWB<{0,0,0,?}, "8">;
1088 def VST1d16_UPD : VST1DWB<{0,1,0,?}, "16">;
1089 def VST1d32_UPD : VST1DWB<{1,0,0,?}, "32">;
1090 def VST1d64_UPD : VST1DWB<{1,1,0,?}, "64">;
1092 def VST1q8_UPD : VST1QWB<{0,0,?,?}, "8">;
1093 def VST1q16_UPD : VST1QWB<{0,1,?,?}, "16">;
1094 def VST1q32_UPD : VST1QWB<{1,0,?,?}, "32">;
1095 def VST1q64_UPD : VST1QWB<{1,1,?,?}, "64">;
1097 def VST1q8Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
1098 def VST1q16Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
1099 def VST1q32Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
1100 def VST1q64Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
1102 // ...with 3 registers (some of these are only for the disassembler):
1103 class VST1D3<bits<4> op7_4, string Dt>
1104 : NLdSt<0, 0b00, 0b0110, op7_4, (outs),
1105 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3),
1106 IIC_VST1x3, "vst1", Dt, "\\{$Vd, $src2, $src3\\}, $Rn", "", []> {
1108 let Inst{4} = Rn{4};
1110 class VST1D3WB<bits<4> op7_4, string Dt>
1111 : NLdSt<0, 0b00, 0b0110, op7_4, (outs GPR:$wb),
1112 (ins addrmode6:$Rn, am6offset:$Rm,
1113 DPR:$Vd, DPR:$src2, DPR:$src3),
1114 IIC_VST1x3u, "vst1", Dt, "\\{$Vd, $src2, $src3\\}, $Rn$Rm",
1115 "$Rn.addr = $wb", []> {
1116 let Inst{4} = Rn{4};
1119 def VST1d8T : VST1D3<{0,0,0,?}, "8">;
1120 def VST1d16T : VST1D3<{0,1,0,?}, "16">;
1121 def VST1d32T : VST1D3<{1,0,0,?}, "32">;
1122 def VST1d64T : VST1D3<{1,1,0,?}, "64">;
1124 def VST1d8T_UPD : VST1D3WB<{0,0,0,?}, "8">;
1125 def VST1d16T_UPD : VST1D3WB<{0,1,0,?}, "16">;
1126 def VST1d32T_UPD : VST1D3WB<{1,0,0,?}, "32">;
1127 def VST1d64T_UPD : VST1D3WB<{1,1,0,?}, "64">;
1129 def VST1d64TPseudo : VSTQQPseudo<IIC_VST1x3>;
1130 def VST1d64TPseudo_UPD : VSTQQWBPseudo<IIC_VST1x3u>;
1132 // ...with 4 registers (some of these are only for the disassembler):
1133 class VST1D4<bits<4> op7_4, string Dt>
1134 : NLdSt<0, 0b00, 0b0010, op7_4, (outs),
1135 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
1136 IIC_VST1x4, "vst1", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn", "",
1139 let Inst{5-4} = Rn{5-4};
1141 class VST1D4WB<bits<4> op7_4, string Dt>
1142 : NLdSt<0, 0b00, 0b0010, op7_4, (outs GPR:$wb),
1143 (ins addrmode6:$Rn, am6offset:$Rm,
1144 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST1x4u,
1145 "vst1", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
1146 "$Rn.addr = $wb", []> {
1147 let Inst{5-4} = Rn{5-4};
1150 def VST1d8Q : VST1D4<{0,0,?,?}, "8">;
1151 def VST1d16Q : VST1D4<{0,1,?,?}, "16">;
1152 def VST1d32Q : VST1D4<{1,0,?,?}, "32">;
1153 def VST1d64Q : VST1D4<{1,1,?,?}, "64">;
1155 def VST1d8Q_UPD : VST1D4WB<{0,0,?,?}, "8">;
1156 def VST1d16Q_UPD : VST1D4WB<{0,1,?,?}, "16">;
1157 def VST1d32Q_UPD : VST1D4WB<{1,0,?,?}, "32">;
1158 def VST1d64Q_UPD : VST1D4WB<{1,1,?,?}, "64">;
1160 def VST1d64QPseudo : VSTQQPseudo<IIC_VST1x4>;
1161 def VST1d64QPseudo_UPD : VSTQQWBPseudo<IIC_VST1x4u>;
1163 // VST2 : Vector Store (multiple 2-element structures)
1164 class VST2D<bits<4> op11_8, bits<4> op7_4, string Dt>
1165 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
1166 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2),
1167 IIC_VST2, "vst2", Dt, "\\{$Vd, $src2\\}, $Rn", "", []> {
1169 let Inst{5-4} = Rn{5-4};
1171 class VST2Q<bits<4> op7_4, string Dt>
1172 : NLdSt<0, 0b00, 0b0011, op7_4, (outs),
1173 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
1174 IIC_VST2x2, "vst2", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn",
1177 let Inst{5-4} = Rn{5-4};
1180 def VST2d8 : VST2D<0b1000, {0,0,?,?}, "8">;
1181 def VST2d16 : VST2D<0b1000, {0,1,?,?}, "16">;
1182 def VST2d32 : VST2D<0b1000, {1,0,?,?}, "32">;
1184 def VST2q8 : VST2Q<{0,0,?,?}, "8">;
1185 def VST2q16 : VST2Q<{0,1,?,?}, "16">;
1186 def VST2q32 : VST2Q<{1,0,?,?}, "32">;
1188 def VST2d8Pseudo : VSTQPseudo<IIC_VST2>;
1189 def VST2d16Pseudo : VSTQPseudo<IIC_VST2>;
1190 def VST2d32Pseudo : VSTQPseudo<IIC_VST2>;
1192 def VST2q8Pseudo : VSTQQPseudo<IIC_VST2x2>;
1193 def VST2q16Pseudo : VSTQQPseudo<IIC_VST2x2>;
1194 def VST2q32Pseudo : VSTQQPseudo<IIC_VST2x2>;
1196 // ...with address register writeback:
1197 class VST2DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1198 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1199 (ins addrmode6:$Rn, am6offset:$Rm, DPR:$Vd, DPR:$src2),
1200 IIC_VST2u, "vst2", Dt, "\\{$Vd, $src2\\}, $Rn$Rm",
1201 "$Rn.addr = $wb", []> {
1202 let Inst{5-4} = Rn{5-4};
1204 class VST2QWB<bits<4> op7_4, string Dt>
1205 : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
1206 (ins addrmode6:$Rn, am6offset:$Rm,
1207 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST2x2u,
1208 "vst2", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
1209 "$Rn.addr = $wb", []> {
1210 let Inst{5-4} = Rn{5-4};
1213 def VST2d8_UPD : VST2DWB<0b1000, {0,0,?,?}, "8">;
1214 def VST2d16_UPD : VST2DWB<0b1000, {0,1,?,?}, "16">;
1215 def VST2d32_UPD : VST2DWB<0b1000, {1,0,?,?}, "32">;
1217 def VST2q8_UPD : VST2QWB<{0,0,?,?}, "8">;
1218 def VST2q16_UPD : VST2QWB<{0,1,?,?}, "16">;
1219 def VST2q32_UPD : VST2QWB<{1,0,?,?}, "32">;
1221 def VST2d8Pseudo_UPD : VSTQWBPseudo<IIC_VST2u>;
1222 def VST2d16Pseudo_UPD : VSTQWBPseudo<IIC_VST2u>;
1223 def VST2d32Pseudo_UPD : VSTQWBPseudo<IIC_VST2u>;
1225 def VST2q8Pseudo_UPD : VSTQQWBPseudo<IIC_VST2x2u>;
1226 def VST2q16Pseudo_UPD : VSTQQWBPseudo<IIC_VST2x2u>;
1227 def VST2q32Pseudo_UPD : VSTQQWBPseudo<IIC_VST2x2u>;
1229 // ...with double-spaced registers (for disassembly only):
1230 def VST2b8 : VST2D<0b1001, {0,0,?,?}, "8">;
1231 def VST2b16 : VST2D<0b1001, {0,1,?,?}, "16">;
1232 def VST2b32 : VST2D<0b1001, {1,0,?,?}, "32">;
1233 def VST2b8_UPD : VST2DWB<0b1001, {0,0,?,?}, "8">;
1234 def VST2b16_UPD : VST2DWB<0b1001, {0,1,?,?}, "16">;
1235 def VST2b32_UPD : VST2DWB<0b1001, {1,0,?,?}, "32">;
1237 // VST3 : Vector Store (multiple 3-element structures)
1238 class VST3D<bits<4> op11_8, bits<4> op7_4, string Dt>
1239 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
1240 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3,
1241 "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn", "", []> {
1243 let Inst{4} = Rn{4};
1246 def VST3d8 : VST3D<0b0100, {0,0,0,?}, "8">;
1247 def VST3d16 : VST3D<0b0100, {0,1,0,?}, "16">;
1248 def VST3d32 : VST3D<0b0100, {1,0,0,?}, "32">;
1250 def VST3d8Pseudo : VSTQQPseudo<IIC_VST3>;
1251 def VST3d16Pseudo : VSTQQPseudo<IIC_VST3>;
1252 def VST3d32Pseudo : VSTQQPseudo<IIC_VST3>;
1254 // ...with address register writeback:
1255 class VST3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1256 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1257 (ins addrmode6:$Rn, am6offset:$Rm,
1258 DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3u,
1259 "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn$Rm",
1260 "$Rn.addr = $wb", []> {
1261 let Inst{4} = Rn{4};
1264 def VST3d8_UPD : VST3DWB<0b0100, {0,0,0,?}, "8">;
1265 def VST3d16_UPD : VST3DWB<0b0100, {0,1,0,?}, "16">;
1266 def VST3d32_UPD : VST3DWB<0b0100, {1,0,0,?}, "32">;
1268 def VST3d8Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>;
1269 def VST3d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>;
1270 def VST3d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>;
1272 // ...with double-spaced registers:
1273 def VST3q8 : VST3D<0b0101, {0,0,0,?}, "8">;
1274 def VST3q16 : VST3D<0b0101, {0,1,0,?}, "16">;
1275 def VST3q32 : VST3D<0b0101, {1,0,0,?}, "32">;
1276 def VST3q8_UPD : VST3DWB<0b0101, {0,0,0,?}, "8">;
1277 def VST3q16_UPD : VST3DWB<0b0101, {0,1,0,?}, "16">;
1278 def VST3q32_UPD : VST3DWB<0b0101, {1,0,0,?}, "32">;
1280 def VST3q8Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1281 def VST3q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1282 def VST3q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1284 // ...alternate versions to be allocated odd register numbers:
1285 def VST3q8oddPseudo : VSTQQQQPseudo<IIC_VST3>;
1286 def VST3q16oddPseudo : VSTQQQQPseudo<IIC_VST3>;
1287 def VST3q32oddPseudo : VSTQQQQPseudo<IIC_VST3>;
1289 def VST3q8oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1290 def VST3q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1291 def VST3q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1293 // VST4 : Vector Store (multiple 4-element structures)
1294 class VST4D<bits<4> op11_8, bits<4> op7_4, string Dt>
1295 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
1296 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
1297 IIC_VST4, "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn",
1300 let Inst{5-4} = Rn{5-4};
1303 def VST4d8 : VST4D<0b0000, {0,0,?,?}, "8">;
1304 def VST4d16 : VST4D<0b0000, {0,1,?,?}, "16">;
1305 def VST4d32 : VST4D<0b0000, {1,0,?,?}, "32">;
1307 def VST4d8Pseudo : VSTQQPseudo<IIC_VST4>;
1308 def VST4d16Pseudo : VSTQQPseudo<IIC_VST4>;
1309 def VST4d32Pseudo : VSTQQPseudo<IIC_VST4>;
1311 // ...with address register writeback:
1312 class VST4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1313 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1314 (ins addrmode6:$Rn, am6offset:$Rm,
1315 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST4u,
1316 "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
1317 "$Rn.addr = $wb", []> {
1318 let Inst{5-4} = Rn{5-4};
1321 def VST4d8_UPD : VST4DWB<0b0000, {0,0,?,?}, "8">;
1322 def VST4d16_UPD : VST4DWB<0b0000, {0,1,?,?}, "16">;
1323 def VST4d32_UPD : VST4DWB<0b0000, {1,0,?,?}, "32">;
1325 def VST4d8Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>;
1326 def VST4d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>;
1327 def VST4d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>;
1329 // ...with double-spaced registers:
1330 def VST4q8 : VST4D<0b0001, {0,0,?,?}, "8">;
1331 def VST4q16 : VST4D<0b0001, {0,1,?,?}, "16">;
1332 def VST4q32 : VST4D<0b0001, {1,0,?,?}, "32">;
1333 def VST4q8_UPD : VST4DWB<0b0001, {0,0,?,?}, "8">;
1334 def VST4q16_UPD : VST4DWB<0b0001, {0,1,?,?}, "16">;
1335 def VST4q32_UPD : VST4DWB<0b0001, {1,0,?,?}, "32">;
1337 def VST4q8Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1338 def VST4q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1339 def VST4q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1341 // ...alternate versions to be allocated odd register numbers:
1342 def VST4q8oddPseudo : VSTQQQQPseudo<IIC_VST4>;
1343 def VST4q16oddPseudo : VSTQQQQPseudo<IIC_VST4>;
1344 def VST4q32oddPseudo : VSTQQQQPseudo<IIC_VST4>;
1346 def VST4q8oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1347 def VST4q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1348 def VST4q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1350 } // mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1
1352 // Classes for VST*LN pseudo-instructions with multi-register operands.
1353 // These are expanded to real instructions after register allocation.
1354 class VSTQLNPseudo<InstrItinClass itin>
1355 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
1357 class VSTQLNWBPseudo<InstrItinClass itin>
1358 : PseudoNLdSt<(outs GPR:$wb),
1359 (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
1360 nohash_imm:$lane), itin, "$addr.addr = $wb">;
1361 class VSTQQLNPseudo<InstrItinClass itin>
1362 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
1364 class VSTQQLNWBPseudo<InstrItinClass itin>
1365 : PseudoNLdSt<(outs GPR:$wb),
1366 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
1367 nohash_imm:$lane), itin, "$addr.addr = $wb">;
1368 class VSTQQQQLNPseudo<InstrItinClass itin>
1369 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
1371 class VSTQQQQLNWBPseudo<InstrItinClass itin>
1372 : PseudoNLdSt<(outs GPR:$wb),
1373 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
1374 nohash_imm:$lane), itin, "$addr.addr = $wb">;
1376 // VST1LN : Vector Store (single element from one lane)
1377 class VST1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
1378 PatFrag StoreOp, SDNode ExtractOp>
1379 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1380 (ins addrmode6:$Rn, DPR:$Vd, nohash_imm:$lane),
1381 IIC_VST1ln, "vst1", Dt, "\\{$Vd[$lane]\\}, $Rn", "",
1382 [(StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane), addrmode6:$Rn)]> {
1385 class VST1LN32<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
1386 PatFrag StoreOp, SDNode ExtractOp>
1387 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1388 (ins addrmode6oneL32:$Rn, DPR:$Vd, nohash_imm:$lane),
1389 IIC_VST1ln, "vst1", Dt, "\\{$Vd[$lane]\\}, $Rn", "",
1390 [(StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane), addrmode6oneL32:$Rn)]>{
1393 class VST1QLNPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
1394 : VSTQLNPseudo<IIC_VST1ln> {
1395 let Pattern = [(StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
1399 def VST1LNd8 : VST1LN<0b0000, {?,?,?,0}, "8", v8i8, truncstorei8,
1401 let Inst{7-5} = lane{2-0};
1403 def VST1LNd16 : VST1LN<0b0100, {?,?,0,?}, "16", v4i16, truncstorei16,
1405 let Inst{7-6} = lane{1-0};
1406 let Inst{4} = Rn{5};
1409 def VST1LNd32 : VST1LN32<0b1000, {?,0,?,?}, "32", v2i32, store, extractelt> {
1410 let Inst{7} = lane{0};
1411 let Inst{5-4} = Rn{5-4};
1414 def VST1LNq8Pseudo : VST1QLNPseudo<v16i8, truncstorei8, NEONvgetlaneu>;
1415 def VST1LNq16Pseudo : VST1QLNPseudo<v8i16, truncstorei16, NEONvgetlaneu>;
1416 def VST1LNq32Pseudo : VST1QLNPseudo<v4i32, store, extractelt>;
1418 def : Pat<(store (extractelt (v2f32 DPR:$src), imm:$lane), addrmode6:$addr),
1419 (VST1LNd32 addrmode6:$addr, DPR:$src, imm:$lane)>;
1420 def : Pat<(store (extractelt (v4f32 QPR:$src), imm:$lane), addrmode6:$addr),
1421 (VST1LNq32Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
1423 // ...with address register writeback:
1424 class VST1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
1425 PatFrag StoreOp, SDNode ExtractOp>
1426 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1427 (ins addrmode6:$Rn, am6offset:$Rm,
1428 DPR:$Vd, nohash_imm:$lane), IIC_VST1lnu, "vst1", Dt,
1429 "\\{$Vd[$lane]\\}, $Rn$Rm",
1431 [(set GPR:$wb, (StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane),
1432 addrmode6:$Rn, am6offset:$Rm))]>;
1433 class VST1QLNWBPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
1434 : VSTQLNWBPseudo<IIC_VST1lnu> {
1435 let Pattern = [(set GPR:$wb, (StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
1436 addrmode6:$addr, am6offset:$offset))];
1439 def VST1LNd8_UPD : VST1LNWB<0b0000, {?,?,?,0}, "8", v8i8, post_truncsti8,
1441 let Inst{7-5} = lane{2-0};
1443 def VST1LNd16_UPD : VST1LNWB<0b0100, {?,?,0,?}, "16", v4i16, post_truncsti16,
1445 let Inst{7-6} = lane{1-0};
1446 let Inst{4} = Rn{5};
1448 def VST1LNd32_UPD : VST1LNWB<0b1000, {?,0,?,?}, "32", v2i32, post_store,
1450 let Inst{7} = lane{0};
1451 let Inst{5-4} = Rn{5-4};
1454 def VST1LNq8Pseudo_UPD : VST1QLNWBPseudo<v16i8, post_truncsti8, NEONvgetlaneu>;
1455 def VST1LNq16Pseudo_UPD : VST1QLNWBPseudo<v8i16, post_truncsti16,NEONvgetlaneu>;
1456 def VST1LNq32Pseudo_UPD : VST1QLNWBPseudo<v4i32, post_store, extractelt>;
1458 let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in {
1460 // VST2LN : Vector Store (single 2-element structure from one lane)
1461 class VST2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1462 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1463 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, nohash_imm:$lane),
1464 IIC_VST2ln, "vst2", Dt, "\\{$Vd[$lane], $src2[$lane]\\}, $Rn",
1467 let Inst{4} = Rn{4};
1470 def VST2LNd8 : VST2LN<0b0001, {?,?,?,?}, "8"> {
1471 let Inst{7-5} = lane{2-0};
1473 def VST2LNd16 : VST2LN<0b0101, {?,?,0,?}, "16"> {
1474 let Inst{7-6} = lane{1-0};
1476 def VST2LNd32 : VST2LN<0b1001, {?,0,0,?}, "32"> {
1477 let Inst{7} = lane{0};
1480 def VST2LNd8Pseudo : VSTQLNPseudo<IIC_VST2ln>;
1481 def VST2LNd16Pseudo : VSTQLNPseudo<IIC_VST2ln>;
1482 def VST2LNd32Pseudo : VSTQLNPseudo<IIC_VST2ln>;
1484 // ...with double-spaced registers:
1485 def VST2LNq16 : VST2LN<0b0101, {?,?,1,?}, "16"> {
1486 let Inst{7-6} = lane{1-0};
1487 let Inst{4} = Rn{4};
1489 def VST2LNq32 : VST2LN<0b1001, {?,1,0,?}, "32"> {
1490 let Inst{7} = lane{0};
1491 let Inst{4} = Rn{4};
1494 def VST2LNq16Pseudo : VSTQQLNPseudo<IIC_VST2ln>;
1495 def VST2LNq32Pseudo : VSTQQLNPseudo<IIC_VST2ln>;
1497 // ...with address register writeback:
1498 class VST2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1499 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1500 (ins addrmode6:$addr, am6offset:$offset,
1501 DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VST2lnu, "vst2", Dt,
1502 "\\{$src1[$lane], $src2[$lane]\\}, $addr$offset",
1503 "$addr.addr = $wb", []> {
1504 let Inst{4} = Rn{4};
1507 def VST2LNd8_UPD : VST2LNWB<0b0001, {?,?,?,?}, "8"> {
1508 let Inst{7-5} = lane{2-0};
1510 def VST2LNd16_UPD : VST2LNWB<0b0101, {?,?,0,?}, "16"> {
1511 let Inst{7-6} = lane{1-0};
1513 def VST2LNd32_UPD : VST2LNWB<0b1001, {?,0,0,?}, "32"> {
1514 let Inst{7} = lane{0};
1517 def VST2LNd8Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>;
1518 def VST2LNd16Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>;
1519 def VST2LNd32Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>;
1521 def VST2LNq16_UPD : VST2LNWB<0b0101, {?,?,1,?}, "16"> {
1522 let Inst{7-6} = lane{1-0};
1524 def VST2LNq32_UPD : VST2LNWB<0b1001, {?,1,0,?}, "32"> {
1525 let Inst{7} = lane{0};
1528 def VST2LNq16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>;
1529 def VST2LNq32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>;
1531 // VST3LN : Vector Store (single 3-element structure from one lane)
1532 class VST3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1533 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1534 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3,
1535 nohash_imm:$lane), IIC_VST3ln, "vst3", Dt,
1536 "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn", "", []> {
1540 def VST3LNd8 : VST3LN<0b0010, {?,?,?,0}, "8"> {
1541 let Inst{7-5} = lane{2-0};
1543 def VST3LNd16 : VST3LN<0b0110, {?,?,0,0}, "16"> {
1544 let Inst{7-6} = lane{1-0};
1546 def VST3LNd32 : VST3LN<0b1010, {?,0,0,0}, "32"> {
1547 let Inst{7} = lane{0};
1550 def VST3LNd8Pseudo : VSTQQLNPseudo<IIC_VST3ln>;
1551 def VST3LNd16Pseudo : VSTQQLNPseudo<IIC_VST3ln>;
1552 def VST3LNd32Pseudo : VSTQQLNPseudo<IIC_VST3ln>;
1554 // ...with double-spaced registers:
1555 def VST3LNq16 : VST3LN<0b0110, {?,?,1,0}, "16"> {
1556 let Inst{7-6} = lane{1-0};
1558 def VST3LNq32 : VST3LN<0b1010, {?,1,0,0}, "32"> {
1559 let Inst{7} = lane{0};
1562 def VST3LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
1563 def VST3LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
1565 // ...with address register writeback:
1566 class VST3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1567 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1568 (ins addrmode6:$Rn, am6offset:$Rm,
1569 DPR:$Vd, DPR:$src2, DPR:$src3, nohash_imm:$lane),
1570 IIC_VST3lnu, "vst3", Dt,
1571 "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn$Rm",
1572 "$Rn.addr = $wb", []>;
1574 def VST3LNd8_UPD : VST3LNWB<0b0010, {?,?,?,0}, "8"> {
1575 let Inst{7-5} = lane{2-0};
1577 def VST3LNd16_UPD : VST3LNWB<0b0110, {?,?,0,0}, "16"> {
1578 let Inst{7-6} = lane{1-0};
1580 def VST3LNd32_UPD : VST3LNWB<0b1010, {?,0,0,0}, "32"> {
1581 let Inst{7} = lane{0};
1584 def VST3LNd8Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>;
1585 def VST3LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>;
1586 def VST3LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>;
1588 def VST3LNq16_UPD : VST3LNWB<0b0110, {?,?,1,0}, "16"> {
1589 let Inst{7-6} = lane{1-0};
1591 def VST3LNq32_UPD : VST3LNWB<0b1010, {?,1,0,0}, "32"> {
1592 let Inst{7} = lane{0};
1595 def VST3LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>;
1596 def VST3LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>;
1598 // VST4LN : Vector Store (single 4-element structure from one lane)
1599 class VST4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1600 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1601 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4,
1602 nohash_imm:$lane), IIC_VST4ln, "vst4", Dt,
1603 "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn",
1606 let Inst{4} = Rn{4};
1609 def VST4LNd8 : VST4LN<0b0011, {?,?,?,?}, "8"> {
1610 let Inst{7-5} = lane{2-0};
1612 def VST4LNd16 : VST4LN<0b0111, {?,?,0,?}, "16"> {
1613 let Inst{7-6} = lane{1-0};
1615 def VST4LNd32 : VST4LN<0b1011, {?,0,?,?}, "32"> {
1616 let Inst{7} = lane{0};
1617 let Inst{5} = Rn{5};
1620 def VST4LNd8Pseudo : VSTQQLNPseudo<IIC_VST4ln>;
1621 def VST4LNd16Pseudo : VSTQQLNPseudo<IIC_VST4ln>;
1622 def VST4LNd32Pseudo : VSTQQLNPseudo<IIC_VST4ln>;
1624 // ...with double-spaced registers:
1625 def VST4LNq16 : VST4LN<0b0111, {?,?,1,?}, "16"> {
1626 let Inst{7-6} = lane{1-0};
1628 def VST4LNq32 : VST4LN<0b1011, {?,1,?,?}, "32"> {
1629 let Inst{7} = lane{0};
1630 let Inst{5} = Rn{5};
1633 def VST4LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>;
1634 def VST4LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>;
1636 // ...with address register writeback:
1637 class VST4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1638 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1639 (ins addrmode6:$Rn, am6offset:$Rm,
1640 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
1641 IIC_VST4lnu, "vst4", Dt,
1642 "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn$Rm",
1643 "$Rn.addr = $wb", []> {
1644 let Inst{4} = Rn{4};
1647 def VST4LNd8_UPD : VST4LNWB<0b0011, {?,?,?,?}, "8"> {
1648 let Inst{7-5} = lane{2-0};
1650 def VST4LNd16_UPD : VST4LNWB<0b0111, {?,?,0,?}, "16"> {
1651 let Inst{7-6} = lane{1-0};
1653 def VST4LNd32_UPD : VST4LNWB<0b1011, {?,0,?,?}, "32"> {
1654 let Inst{7} = lane{0};
1655 let Inst{5} = Rn{5};
1658 def VST4LNd8Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>;
1659 def VST4LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>;
1660 def VST4LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>;
1662 def VST4LNq16_UPD : VST4LNWB<0b0111, {?,?,1,?}, "16"> {
1663 let Inst{7-6} = lane{1-0};
1665 def VST4LNq32_UPD : VST4LNWB<0b1011, {?,1,?,?}, "32"> {
1666 let Inst{7} = lane{0};
1667 let Inst{5} = Rn{5};
1670 def VST4LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>;
1671 def VST4LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>;
1673 } // mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1
1676 //===----------------------------------------------------------------------===//
1677 // NEON pattern fragments
1678 //===----------------------------------------------------------------------===//
1680 // Extract D sub-registers of Q registers.
1681 def DSubReg_i8_reg : SDNodeXForm<imm, [{
1682 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1683 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/8, MVT::i32);
1685 def DSubReg_i16_reg : SDNodeXForm<imm, [{
1686 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1687 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/4, MVT::i32);
1689 def DSubReg_i32_reg : SDNodeXForm<imm, [{
1690 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1691 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/2, MVT::i32);
1693 def DSubReg_f64_reg : SDNodeXForm<imm, [{
1694 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1695 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue(), MVT::i32);
1698 // Extract S sub-registers of Q/D registers.
1699 def SSubReg_f32_reg : SDNodeXForm<imm, [{
1700 assert(ARM::ssub_3 == ARM::ssub_0+3 && "Unexpected subreg numbering");
1701 return CurDAG->getTargetConstant(ARM::ssub_0 + N->getZExtValue(), MVT::i32);
1704 // Translate lane numbers from Q registers to D subregs.
1705 def SubReg_i8_lane : SDNodeXForm<imm, [{
1706 return CurDAG->getTargetConstant(N->getZExtValue() & 7, MVT::i32);
1708 def SubReg_i16_lane : SDNodeXForm<imm, [{
1709 return CurDAG->getTargetConstant(N->getZExtValue() & 3, MVT::i32);
1711 def SubReg_i32_lane : SDNodeXForm<imm, [{
1712 return CurDAG->getTargetConstant(N->getZExtValue() & 1, MVT::i32);
1715 //===----------------------------------------------------------------------===//
1716 // Instruction Classes
1717 //===----------------------------------------------------------------------===//
1719 // Basic 2-register operations: double- and quad-register.
1720 class N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1721 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
1722 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
1723 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
1724 (ins DPR:$Vm), IIC_VUNAD, OpcodeStr, Dt,"$Vd, $Vm", "",
1725 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm))))]>;
1726 class N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1727 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
1728 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
1729 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
1730 (ins QPR:$Vm), IIC_VUNAQ, OpcodeStr, Dt,"$Vd, $Vm", "",
1731 [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm))))]>;
1733 // Basic 2-register intrinsics, both double- and quad-register.
1734 class N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1735 bits<2> op17_16, bits<5> op11_7, bit op4,
1736 InstrItinClass itin, string OpcodeStr, string Dt,
1737 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1738 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
1739 (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
1740 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
1741 class N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1742 bits<2> op17_16, bits<5> op11_7, bit op4,
1743 InstrItinClass itin, string OpcodeStr, string Dt,
1744 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1745 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
1746 (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
1747 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
1749 // Narrow 2-register operations.
1750 class N2VN<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1751 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1752 InstrItinClass itin, string OpcodeStr, string Dt,
1753 ValueType TyD, ValueType TyQ, SDNode OpNode>
1754 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
1755 (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
1756 [(set DPR:$Vd, (TyD (OpNode (TyQ QPR:$Vm))))]>;
1758 // Narrow 2-register intrinsics.
1759 class N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1760 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1761 InstrItinClass itin, string OpcodeStr, string Dt,
1762 ValueType TyD, ValueType TyQ, Intrinsic IntOp>
1763 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
1764 (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
1765 [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vm))))]>;
1767 // Long 2-register operations (currently only used for VMOVL).
1768 class N2VL<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1769 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1770 InstrItinClass itin, string OpcodeStr, string Dt,
1771 ValueType TyQ, ValueType TyD, SDNode OpNode>
1772 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
1773 (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
1774 [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vm))))]>;
1776 // Long 2-register intrinsics.
1777 class N2VLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1778 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1779 InstrItinClass itin, string OpcodeStr, string Dt,
1780 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
1781 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
1782 (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
1783 [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vm))))]>;
1785 // 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
1786 class N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr, string Dt>
1787 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$Vd, DPR:$Vm),
1788 (ins DPR:$src1, DPR:$src2), IIC_VPERMD,
1789 OpcodeStr, Dt, "$Vd, $Vm",
1790 "$src1 = $Vd, $src2 = $Vm", []>;
1791 class N2VQShuffle<bits<2> op19_18, bits<5> op11_7,
1792 InstrItinClass itin, string OpcodeStr, string Dt>
1793 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$Vd, QPR:$Vm),
1794 (ins QPR:$src1, QPR:$src2), itin, OpcodeStr, Dt, "$Vd, $Vm",
1795 "$src1 = $Vd, $src2 = $Vm", []>;
1797 // Basic 3-register operations: double- and quad-register.
1798 class N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1799 InstrItinClass itin, string OpcodeStr, string Dt,
1800 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
1801 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1802 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1803 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1804 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
1805 let isCommutable = Commutable;
1807 // Same as N3VD but no data type.
1808 class N3VDX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1809 InstrItinClass itin, string OpcodeStr,
1810 ValueType ResTy, ValueType OpTy,
1811 SDNode OpNode, bit Commutable>
1812 : N3VX<op24, op23, op21_20, op11_8, 0, op4,
1813 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1814 OpcodeStr, "$Vd, $Vn, $Vm", "",
1815 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>{
1816 let isCommutable = Commutable;
1819 class N3VDSL<bits<2> op21_20, bits<4> op11_8,
1820 InstrItinClass itin, string OpcodeStr, string Dt,
1821 ValueType Ty, SDNode ShOp>
1822 : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
1823 (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
1824 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
1826 (Ty (ShOp (Ty DPR:$Vn),
1827 (Ty (NEONvduplane (Ty DPR_VFP2:$Vm),imm:$lane)))))]> {
1828 let isCommutable = 0;
1830 class N3VDSL16<bits<2> op21_20, bits<4> op11_8,
1831 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
1832 : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
1833 (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
1834 NVMulSLFrm, IIC_VMULi16D, OpcodeStr, Dt,"$Vd, $Vn, $Vm[$lane]","",
1836 (Ty (ShOp (Ty DPR:$Vn),
1837 (Ty (NEONvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
1838 let isCommutable = 0;
1841 class N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1842 InstrItinClass itin, string OpcodeStr, string Dt,
1843 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
1844 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1845 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
1846 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1847 [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
1848 let isCommutable = Commutable;
1850 class N3VQX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1851 InstrItinClass itin, string OpcodeStr,
1852 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
1853 : N3VX<op24, op23, op21_20, op11_8, 1, op4,
1854 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
1855 OpcodeStr, "$Vd, $Vn, $Vm", "",
1856 [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>{
1857 let isCommutable = Commutable;
1859 class N3VQSL<bits<2> op21_20, bits<4> op11_8,
1860 InstrItinClass itin, string OpcodeStr, string Dt,
1861 ValueType ResTy, ValueType OpTy, SDNode ShOp>
1862 : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
1863 (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
1864 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
1865 [(set (ResTy QPR:$Vd),
1866 (ResTy (ShOp (ResTy QPR:$Vn),
1867 (ResTy (NEONvduplane (OpTy DPR_VFP2:$Vm),
1869 let isCommutable = 0;
1871 class N3VQSL16<bits<2> op21_20, bits<4> op11_8, string OpcodeStr, string Dt,
1872 ValueType ResTy, ValueType OpTy, SDNode ShOp>
1873 : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
1874 (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
1875 NVMulSLFrm, IIC_VMULi16Q, OpcodeStr, Dt,"$Vd, $Vn, $Vm[$lane]","",
1876 [(set (ResTy QPR:$Vd),
1877 (ResTy (ShOp (ResTy QPR:$Vn),
1878 (ResTy (NEONvduplane (OpTy DPR_8:$Vm),
1880 let isCommutable = 0;
1883 // Basic 3-register intrinsics, both double- and quad-register.
1884 class N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1885 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1886 ValueType ResTy, ValueType OpTy, Intrinsic IntOp, bit Commutable>
1887 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1888 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), f, itin,
1889 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1890 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
1891 let isCommutable = Commutable;
1893 class N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1894 string OpcodeStr, string Dt, ValueType Ty, Intrinsic IntOp>
1895 : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
1896 (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
1897 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
1899 (Ty (IntOp (Ty DPR:$Vn),
1900 (Ty (NEONvduplane (Ty DPR_VFP2:$Vm),
1902 let isCommutable = 0;
1904 class N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1905 string OpcodeStr, string Dt, ValueType Ty, Intrinsic IntOp>
1906 : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
1907 (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
1908 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
1910 (Ty (IntOp (Ty DPR:$Vn),
1911 (Ty (NEONvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
1912 let isCommutable = 0;
1914 class N3VDIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1915 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1916 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1917 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1918 (outs DPR:$Vd), (ins DPR:$Vm, DPR:$Vn), f, itin,
1919 OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
1920 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (OpTy DPR:$Vn))))]> {
1921 let isCommutable = 0;
1924 class N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1925 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1926 ValueType ResTy, ValueType OpTy, Intrinsic IntOp, bit Commutable>
1927 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1928 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin,
1929 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1930 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
1931 let isCommutable = Commutable;
1933 class N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1934 string OpcodeStr, string Dt,
1935 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1936 : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
1937 (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
1938 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
1939 [(set (ResTy QPR:$Vd),
1940 (ResTy (IntOp (ResTy QPR:$Vn),
1941 (ResTy (NEONvduplane (OpTy DPR_VFP2:$Vm),
1943 let isCommutable = 0;
1945 class N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1946 string OpcodeStr, string Dt,
1947 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1948 : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
1949 (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
1950 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
1951 [(set (ResTy QPR:$Vd),
1952 (ResTy (IntOp (ResTy QPR:$Vn),
1953 (ResTy (NEONvduplane (OpTy DPR_8:$Vm),
1955 let isCommutable = 0;
1957 class N3VQIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1958 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1959 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1960 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1961 (outs QPR:$Vd), (ins QPR:$Vm, QPR:$Vn), f, itin,
1962 OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
1963 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (OpTy QPR:$Vn))))]> {
1964 let isCommutable = 0;
1967 // Multiply-Add/Sub operations: double- and quad-register.
1968 class N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1969 InstrItinClass itin, string OpcodeStr, string Dt,
1970 ValueType Ty, SDPatternOperator MulOp, SDPatternOperator OpNode>
1971 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1972 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1973 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1974 [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
1975 (Ty (MulOp DPR:$Vn, DPR:$Vm)))))]>;
1977 class N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1978 string OpcodeStr, string Dt,
1979 ValueType Ty, SDPatternOperator MulOp, SDPatternOperator ShOp>
1980 : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
1982 (ins DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
1984 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
1986 (Ty (ShOp (Ty DPR:$src1),
1988 (Ty (NEONvduplane (Ty DPR_VFP2:$Vm),
1990 class N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1991 string OpcodeStr, string Dt,
1992 ValueType Ty, SDNode MulOp, SDNode ShOp>
1993 : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
1995 (ins DPR:$src1, DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
1997 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
1999 (Ty (ShOp (Ty DPR:$src1),
2001 (Ty (NEONvduplane (Ty DPR_8:$Vm),
2004 class N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2005 InstrItinClass itin, string OpcodeStr, string Dt, ValueType Ty,
2006 SDPatternOperator MulOp, SDPatternOperator OpNode>
2007 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2008 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2009 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2010 [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
2011 (Ty (MulOp QPR:$Vn, QPR:$Vm)))))]>;
2012 class N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2013 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
2014 SDPatternOperator MulOp, SDPatternOperator ShOp>
2015 : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
2017 (ins QPR:$src1, QPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
2019 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
2020 [(set (ResTy QPR:$Vd),
2021 (ResTy (ShOp (ResTy QPR:$src1),
2022 (ResTy (MulOp QPR:$Vn,
2023 (ResTy (NEONvduplane (OpTy DPR_VFP2:$Vm),
2025 class N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2026 string OpcodeStr, string Dt,
2027 ValueType ResTy, ValueType OpTy,
2028 SDNode MulOp, SDNode ShOp>
2029 : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
2031 (ins QPR:$src1, QPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
2033 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
2034 [(set (ResTy QPR:$Vd),
2035 (ResTy (ShOp (ResTy QPR:$src1),
2036 (ResTy (MulOp QPR:$Vn,
2037 (ResTy (NEONvduplane (OpTy DPR_8:$Vm),
2040 // Neon Intrinsic-Op instructions (VABA): double- and quad-register.
2041 class N3VDIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2042 InstrItinClass itin, string OpcodeStr, string Dt,
2043 ValueType Ty, Intrinsic IntOp, SDNode OpNode>
2044 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2045 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2046 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2047 [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
2048 (Ty (IntOp (Ty DPR:$Vn), (Ty DPR:$Vm))))))]>;
2049 class N3VQIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2050 InstrItinClass itin, string OpcodeStr, string Dt,
2051 ValueType Ty, Intrinsic IntOp, SDNode OpNode>
2052 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2053 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2054 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2055 [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
2056 (Ty (IntOp (Ty QPR:$Vn), (Ty QPR:$Vm))))))]>;
2058 // Neon 3-argument intrinsics, both double- and quad-register.
2059 // The destination register is also used as the first source operand register.
2060 class N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2061 InstrItinClass itin, string OpcodeStr, string Dt,
2062 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2063 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2064 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2065 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2066 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$src1),
2067 (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>;
2068 class N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2069 InstrItinClass itin, string OpcodeStr, string Dt,
2070 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2071 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2072 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2073 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2074 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src1),
2075 (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>;
2077 // Long Multiply-Add/Sub operations.
2078 class N3VLMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2079 InstrItinClass itin, string OpcodeStr, string Dt,
2080 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
2081 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2082 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2083 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2084 [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
2085 (TyQ (MulOp (TyD DPR:$Vn),
2086 (TyD DPR:$Vm)))))]>;
2087 class N3VLMulOpSL<bit op24, bits<2> op21_20, bits<4> op11_8,
2088 InstrItinClass itin, string OpcodeStr, string Dt,
2089 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
2090 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
2091 (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
2093 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
2095 (OpNode (TyQ QPR:$src1),
2096 (TyQ (MulOp (TyD DPR:$Vn),
2097 (TyD (NEONvduplane (TyD DPR_VFP2:$Vm),
2099 class N3VLMulOpSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
2100 InstrItinClass itin, string OpcodeStr, string Dt,
2101 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
2102 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
2103 (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
2105 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
2107 (OpNode (TyQ QPR:$src1),
2108 (TyQ (MulOp (TyD DPR:$Vn),
2109 (TyD (NEONvduplane (TyD DPR_8:$Vm),
2112 // Long Intrinsic-Op vector operations with explicit extend (VABAL).
2113 class N3VLIntExtOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2114 InstrItinClass itin, string OpcodeStr, string Dt,
2115 ValueType TyQ, ValueType TyD, Intrinsic IntOp, SDNode ExtOp,
2117 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2118 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2119 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2120 [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
2121 (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
2122 (TyD DPR:$Vm)))))))]>;
2124 // Neon Long 3-argument intrinsic. The destination register is
2125 // a quad-register and is also used as the first source operand register.
2126 class N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2127 InstrItinClass itin, string OpcodeStr, string Dt,
2128 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
2129 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2130 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2131 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2133 (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$Vn), (TyD DPR:$Vm))))]>;
2134 class N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2135 string OpcodeStr, string Dt,
2136 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2137 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
2139 (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
2141 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
2142 [(set (ResTy QPR:$Vd),
2143 (ResTy (IntOp (ResTy QPR:$src1),
2145 (OpTy (NEONvduplane (OpTy DPR_VFP2:$Vm),
2147 class N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8,
2148 InstrItinClass itin, string OpcodeStr, string Dt,
2149 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2150 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
2152 (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
2154 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
2155 [(set (ResTy QPR:$Vd),
2156 (ResTy (IntOp (ResTy QPR:$src1),
2158 (OpTy (NEONvduplane (OpTy DPR_8:$Vm),
2161 // Narrowing 3-register intrinsics.
2162 class N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2163 string OpcodeStr, string Dt, ValueType TyD, ValueType TyQ,
2164 Intrinsic IntOp, bit Commutable>
2165 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2166 (outs DPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINi4D,
2167 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2168 [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vn), (TyQ QPR:$Vm))))]> {
2169 let isCommutable = Commutable;
2172 // Long 3-register operations.
2173 class N3VL<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2174 InstrItinClass itin, string OpcodeStr, string Dt,
2175 ValueType TyQ, ValueType TyD, SDNode OpNode, bit Commutable>
2176 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2177 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2178 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2179 [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
2180 let isCommutable = Commutable;
2182 class N3VLSL<bit op24, bits<2> op21_20, bits<4> op11_8,
2183 InstrItinClass itin, string OpcodeStr, string Dt,
2184 ValueType TyQ, ValueType TyD, SDNode OpNode>
2185 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
2186 (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
2187 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
2189 (TyQ (OpNode (TyD DPR:$Vn),
2190 (TyD (NEONvduplane (TyD DPR_VFP2:$Vm),imm:$lane)))))]>;
2191 class N3VLSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
2192 InstrItinClass itin, string OpcodeStr, string Dt,
2193 ValueType TyQ, ValueType TyD, SDNode OpNode>
2194 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
2195 (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
2196 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
2198 (TyQ (OpNode (TyD DPR:$Vn),
2199 (TyD (NEONvduplane (TyD DPR_8:$Vm), imm:$lane)))))]>;
2201 // Long 3-register operations with explicitly extended operands.
2202 class N3VLExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2203 InstrItinClass itin, string OpcodeStr, string Dt,
2204 ValueType TyQ, ValueType TyD, SDNode OpNode, SDNode ExtOp,
2206 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2207 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2208 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2209 [(set QPR:$Vd, (OpNode (TyQ (ExtOp (TyD DPR:$Vn))),
2210 (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
2211 let isCommutable = Commutable;
2214 // Long 3-register intrinsics with explicit extend (VABDL).
2215 class N3VLIntExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2216 InstrItinClass itin, string OpcodeStr, string Dt,
2217 ValueType TyQ, ValueType TyD, Intrinsic IntOp, SDNode ExtOp,
2219 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2220 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2221 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2222 [(set QPR:$Vd, (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
2223 (TyD DPR:$Vm))))))]> {
2224 let isCommutable = Commutable;
2227 // Long 3-register intrinsics.
2228 class N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2229 InstrItinClass itin, string OpcodeStr, string Dt,
2230 ValueType TyQ, ValueType TyD, Intrinsic IntOp, bit Commutable>
2231 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2232 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2233 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2234 [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
2235 let isCommutable = Commutable;
2237 class N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2238 string OpcodeStr, string Dt,
2239 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2240 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
2241 (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
2242 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
2243 [(set (ResTy QPR:$Vd),
2244 (ResTy (IntOp (OpTy DPR:$Vn),
2245 (OpTy (NEONvduplane (OpTy DPR_VFP2:$Vm),
2247 class N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
2248 InstrItinClass itin, string OpcodeStr, string Dt,
2249 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2250 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
2251 (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
2252 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
2253 [(set (ResTy QPR:$Vd),
2254 (ResTy (IntOp (OpTy DPR:$Vn),
2255 (OpTy (NEONvduplane (OpTy DPR_8:$Vm),
2258 // Wide 3-register operations.
2259 class N3VW<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2260 string OpcodeStr, string Dt, ValueType TyQ, ValueType TyD,
2261 SDNode OpNode, SDNode ExtOp, bit Commutable>
2262 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2263 (outs QPR:$Vd), (ins QPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VSUBiD,
2264 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2265 [(set QPR:$Vd, (OpNode (TyQ QPR:$Vn),
2266 (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
2267 let isCommutable = Commutable;
2270 // Pairwise long 2-register intrinsics, both double- and quad-register.
2271 class N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2272 bits<2> op17_16, bits<5> op11_7, bit op4,
2273 string OpcodeStr, string Dt,
2274 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2275 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
2276 (ins DPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
2277 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
2278 class N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2279 bits<2> op17_16, bits<5> op11_7, bit op4,
2280 string OpcodeStr, string Dt,
2281 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2282 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
2283 (ins QPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
2284 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
2286 // Pairwise long 2-register accumulate intrinsics,
2287 // both double- and quad-register.
2288 // The destination register is also used as the first source operand register.
2289 class N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2290 bits<2> op17_16, bits<5> op11_7, bit op4,
2291 string OpcodeStr, string Dt,
2292 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2293 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
2294 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vm), IIC_VPALiD,
2295 OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
2296 [(set DPR:$Vd, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$Vm))))]>;
2297 class N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2298 bits<2> op17_16, bits<5> op11_7, bit op4,
2299 string OpcodeStr, string Dt,
2300 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2301 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
2302 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vm), IIC_VPALiQ,
2303 OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
2304 [(set QPR:$Vd, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$Vm))))]>;
2306 // Shift by immediate,
2307 // both double- and quad-register.
2308 class N2VDSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2309 Format f, InstrItinClass itin, Operand ImmTy,
2310 string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
2311 : N2VImm<op24, op23, op11_8, op7, 0, op4,
2312 (outs DPR:$Vd), (ins DPR:$Vm, ImmTy:$SIMM), f, itin,
2313 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2314 [(set DPR:$Vd, (Ty (OpNode (Ty DPR:$Vm), (i32 imm:$SIMM))))]>;
2315 class N2VQSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2316 Format f, InstrItinClass itin, Operand ImmTy,
2317 string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
2318 : N2VImm<op24, op23, op11_8, op7, 1, op4,
2319 (outs QPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), f, itin,
2320 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2321 [(set QPR:$Vd, (Ty (OpNode (Ty QPR:$Vm), (i32 imm:$SIMM))))]>;
2323 // Long shift by immediate.
2324 class N2VLSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
2325 string OpcodeStr, string Dt,
2326 ValueType ResTy, ValueType OpTy, SDNode OpNode>
2327 : N2VImm<op24, op23, op11_8, op7, op6, op4,
2328 (outs QPR:$Vd), (ins DPR:$Vm, i32imm:$SIMM), N2RegVShLFrm,
2329 IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2330 [(set QPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm),
2331 (i32 imm:$SIMM))))]>;
2333 // Narrow shift by immediate.
2334 class N2VNSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
2335 InstrItinClass itin, string OpcodeStr, string Dt,
2336 ValueType ResTy, ValueType OpTy, Operand ImmTy, SDNode OpNode>
2337 : N2VImm<op24, op23, op11_8, op7, op6, op4,
2338 (outs DPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, itin,
2339 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2340 [(set DPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm),
2341 (i32 imm:$SIMM))))]>;
2343 // Shift right by immediate and accumulate,
2344 // both double- and quad-register.
2345 class N2VDShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2346 Operand ImmTy, string OpcodeStr, string Dt,
2347 ValueType Ty, SDNode ShOp>
2348 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
2349 (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
2350 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2351 [(set DPR:$Vd, (Ty (add DPR:$src1,
2352 (Ty (ShOp DPR:$Vm, (i32 imm:$SIMM))))))]>;
2353 class N2VQShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2354 Operand ImmTy, string OpcodeStr, string Dt,
2355 ValueType Ty, SDNode ShOp>
2356 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
2357 (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
2358 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2359 [(set QPR:$Vd, (Ty (add QPR:$src1,
2360 (Ty (ShOp QPR:$Vm, (i32 imm:$SIMM))))))]>;
2362 // Shift by immediate and insert,
2363 // both double- and quad-register.
2364 class N2VDShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2365 Operand ImmTy, Format f, string OpcodeStr, string Dt,
2366 ValueType Ty,SDNode ShOp>
2367 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
2368 (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiD,
2369 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2370 [(set DPR:$Vd, (Ty (ShOp DPR:$src1, DPR:$Vm, (i32 imm:$SIMM))))]>;
2371 class N2VQShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2372 Operand ImmTy, Format f, string OpcodeStr, string Dt,
2373 ValueType Ty,SDNode ShOp>
2374 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
2375 (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiQ,
2376 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2377 [(set QPR:$Vd, (Ty (ShOp QPR:$src1, QPR:$Vm, (i32 imm:$SIMM))))]>;
2379 // Convert, with fractional bits immediate,
2380 // both double- and quad-register.
2381 class N2VCvtD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2382 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
2384 : N2VImm<op24, op23, op11_8, op7, 0, op4,
2385 (outs DPR:$Vd), (ins DPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
2386 IIC_VUNAD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2387 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (i32 imm:$SIMM))))]>;
2388 class N2VCvtQ<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2389 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
2391 : N2VImm<op24, op23, op11_8, op7, 1, op4,
2392 (outs QPR:$Vd), (ins QPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
2393 IIC_VUNAQ, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2394 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (i32 imm:$SIMM))))]>;
2396 //===----------------------------------------------------------------------===//
2398 //===----------------------------------------------------------------------===//
2400 // Abbreviations used in multiclass suffixes:
2401 // Q = quarter int (8 bit) elements
2402 // H = half int (16 bit) elements
2403 // S = single int (32 bit) elements
2404 // D = double int (64 bit) elements
2406 // Neon 2-register vector operations and intrinsics.
2408 // Neon 2-register comparisons.
2409 // source operand element sizes of 8, 16 and 32 bits:
2410 multiclass N2V_QHS_cmp<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2411 bits<5> op11_7, bit op4, string opc, string Dt,
2412 string asm, SDNode OpNode> {
2413 // 64-bit vector types.
2414 def v8i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 0, op4,
2415 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
2416 opc, !strconcat(Dt, "8"), asm, "",
2417 [(set DPR:$Vd, (v8i8 (OpNode (v8i8 DPR:$Vm))))]>;
2418 def v4i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
2419 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
2420 opc, !strconcat(Dt, "16"), asm, "",
2421 [(set DPR:$Vd, (v4i16 (OpNode (v4i16 DPR:$Vm))))]>;
2422 def v2i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
2423 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
2424 opc, !strconcat(Dt, "32"), asm, "",
2425 [(set DPR:$Vd, (v2i32 (OpNode (v2i32 DPR:$Vm))))]>;
2426 def v2f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
2427 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
2428 opc, "f32", asm, "",
2429 [(set DPR:$Vd, (v2i32 (OpNode (v2f32 DPR:$Vm))))]> {
2430 let Inst{10} = 1; // overwrite F = 1
2433 // 128-bit vector types.
2434 def v16i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 1, op4,
2435 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
2436 opc, !strconcat(Dt, "8"), asm, "",
2437 [(set QPR:$Vd, (v16i8 (OpNode (v16i8 QPR:$Vm))))]>;
2438 def v8i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
2439 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
2440 opc, !strconcat(Dt, "16"), asm, "",
2441 [(set QPR:$Vd, (v8i16 (OpNode (v8i16 QPR:$Vm))))]>;
2442 def v4i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
2443 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
2444 opc, !strconcat(Dt, "32"), asm, "",
2445 [(set QPR:$Vd, (v4i32 (OpNode (v4i32 QPR:$Vm))))]>;
2446 def v4f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
2447 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
2448 opc, "f32", asm, "",
2449 [(set QPR:$Vd, (v4i32 (OpNode (v4f32 QPR:$Vm))))]> {
2450 let Inst{10} = 1; // overwrite F = 1
2455 // Neon 2-register vector intrinsics,
2456 // element sizes of 8, 16 and 32 bits:
2457 multiclass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2458 bits<5> op11_7, bit op4,
2459 InstrItinClass itinD, InstrItinClass itinQ,
2460 string OpcodeStr, string Dt, Intrinsic IntOp> {
2461 // 64-bit vector types.
2462 def v8i8 : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2463 itinD, OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
2464 def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2465 itinD, OpcodeStr, !strconcat(Dt, "16"),v4i16,v4i16,IntOp>;
2466 def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2467 itinD, OpcodeStr, !strconcat(Dt, "32"),v2i32,v2i32,IntOp>;
2469 // 128-bit vector types.
2470 def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2471 itinQ, OpcodeStr, !strconcat(Dt, "8"), v16i8,v16i8,IntOp>;
2472 def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2473 itinQ, OpcodeStr, !strconcat(Dt, "16"),v8i16,v8i16,IntOp>;
2474 def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2475 itinQ, OpcodeStr, !strconcat(Dt, "32"),v4i32,v4i32,IntOp>;
2479 // Neon Narrowing 2-register vector operations,
2480 // source operand element sizes of 16, 32 and 64 bits:
2481 multiclass N2VN_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2482 bits<5> op11_7, bit op6, bit op4,
2483 InstrItinClass itin, string OpcodeStr, string Dt,
2485 def v8i8 : N2VN<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
2486 itin, OpcodeStr, !strconcat(Dt, "16"),
2487 v8i8, v8i16, OpNode>;
2488 def v4i16 : N2VN<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
2489 itin, OpcodeStr, !strconcat(Dt, "32"),
2490 v4i16, v4i32, OpNode>;
2491 def v2i32 : N2VN<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
2492 itin, OpcodeStr, !strconcat(Dt, "64"),
2493 v2i32, v2i64, OpNode>;
2496 // Neon Narrowing 2-register vector intrinsics,
2497 // source operand element sizes of 16, 32 and 64 bits:
2498 multiclass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2499 bits<5> op11_7, bit op6, bit op4,
2500 InstrItinClass itin, string OpcodeStr, string Dt,
2502 def v8i8 : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
2503 itin, OpcodeStr, !strconcat(Dt, "16"),
2504 v8i8, v8i16, IntOp>;
2505 def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
2506 itin, OpcodeStr, !strconcat(Dt, "32"),
2507 v4i16, v4i32, IntOp>;
2508 def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
2509 itin, OpcodeStr, !strconcat(Dt, "64"),
2510 v2i32, v2i64, IntOp>;
2514 // Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
2515 // source operand element sizes of 16, 32 and 64 bits:
2516 multiclass N2VL_QHS<bits<2> op24_23, bits<5> op11_7, bit op6, bit op4,
2517 string OpcodeStr, string Dt, SDNode OpNode> {
2518 def v8i16 : N2VL<op24_23, 0b00, 0b10, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
2519 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode>;
2520 def v4i32 : N2VL<op24_23, 0b01, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
2521 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
2522 def v2i64 : N2VL<op24_23, 0b10, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
2523 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
2527 // Neon 3-register vector operations.
2529 // First with only element sizes of 8, 16 and 32 bits:
2530 multiclass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2531 InstrItinClass itinD16, InstrItinClass itinD32,
2532 InstrItinClass itinQ16, InstrItinClass itinQ32,
2533 string OpcodeStr, string Dt,
2534 SDNode OpNode, bit Commutable = 0> {
2535 // 64-bit vector types.
2536 def v8i8 : N3VD<op24, op23, 0b00, op11_8, op4, itinD16,
2537 OpcodeStr, !strconcat(Dt, "8"),
2538 v8i8, v8i8, OpNode, Commutable>;
2539 def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16,
2540 OpcodeStr, !strconcat(Dt, "16"),
2541 v4i16, v4i16, OpNode, Commutable>;
2542 def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32,
2543 OpcodeStr, !strconcat(Dt, "32"),
2544 v2i32, v2i32, OpNode, Commutable>;
2546 // 128-bit vector types.
2547 def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16,
2548 OpcodeStr, !strconcat(Dt, "8"),
2549 v16i8, v16i8, OpNode, Commutable>;
2550 def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16,
2551 OpcodeStr, !strconcat(Dt, "16"),
2552 v8i16, v8i16, OpNode, Commutable>;
2553 def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32,
2554 OpcodeStr, !strconcat(Dt, "32"),
2555 v4i32, v4i32, OpNode, Commutable>;
2558 multiclass N3VSL_HS<bits<4> op11_8, string OpcodeStr, string Dt, SDNode ShOp> {
2559 def v4i16 : N3VDSL16<0b01, op11_8, OpcodeStr, !strconcat(Dt, "16"),
2561 def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, OpcodeStr, !strconcat(Dt,"32"),
2563 def v8i16 : N3VQSL16<0b01, op11_8, OpcodeStr, !strconcat(Dt, "16"),
2564 v8i16, v4i16, ShOp>;
2565 def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, OpcodeStr, !strconcat(Dt,"32"),
2566 v4i32, v2i32, ShOp>;
2569 // ....then also with element size 64 bits:
2570 multiclass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2571 InstrItinClass itinD, InstrItinClass itinQ,
2572 string OpcodeStr, string Dt,
2573 SDNode OpNode, bit Commutable = 0>
2574 : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ,
2575 OpcodeStr, Dt, OpNode, Commutable> {
2576 def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD,
2577 OpcodeStr, !strconcat(Dt, "64"),
2578 v1i64, v1i64, OpNode, Commutable>;
2579 def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ,
2580 OpcodeStr, !strconcat(Dt, "64"),
2581 v2i64, v2i64, OpNode, Commutable>;
2585 // Neon 3-register vector intrinsics.
2587 // First with only element sizes of 16 and 32 bits:
2588 multiclass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2589 InstrItinClass itinD16, InstrItinClass itinD32,
2590 InstrItinClass itinQ16, InstrItinClass itinQ32,
2591 string OpcodeStr, string Dt,
2592 Intrinsic IntOp, bit Commutable = 0> {
2593 // 64-bit vector types.
2594 def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, f, itinD16,
2595 OpcodeStr, !strconcat(Dt, "16"),
2596 v4i16, v4i16, IntOp, Commutable>;
2597 def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, f, itinD32,
2598 OpcodeStr, !strconcat(Dt, "32"),
2599 v2i32, v2i32, IntOp, Commutable>;
2601 // 128-bit vector types.
2602 def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, f, itinQ16,
2603 OpcodeStr, !strconcat(Dt, "16"),
2604 v8i16, v8i16, IntOp, Commutable>;
2605 def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, f, itinQ32,
2606 OpcodeStr, !strconcat(Dt, "32"),
2607 v4i32, v4i32, IntOp, Commutable>;
2609 multiclass N3VInt_HSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2610 InstrItinClass itinD16, InstrItinClass itinD32,
2611 InstrItinClass itinQ16, InstrItinClass itinQ32,
2612 string OpcodeStr, string Dt,
2614 // 64-bit vector types.
2615 def v4i16 : N3VDIntSh<op24, op23, 0b01, op11_8, op4, f, itinD16,
2616 OpcodeStr, !strconcat(Dt, "16"),
2617 v4i16, v4i16, IntOp>;
2618 def v2i32 : N3VDIntSh<op24, op23, 0b10, op11_8, op4, f, itinD32,
2619 OpcodeStr, !strconcat(Dt, "32"),
2620 v2i32, v2i32, IntOp>;
2622 // 128-bit vector types.
2623 def v8i16 : N3VQIntSh<op24, op23, 0b01, op11_8, op4, f, itinQ16,
2624 OpcodeStr, !strconcat(Dt, "16"),
2625 v8i16, v8i16, IntOp>;
2626 def v4i32 : N3VQIntSh<op24, op23, 0b10, op11_8, op4, f, itinQ32,
2627 OpcodeStr, !strconcat(Dt, "32"),
2628 v4i32, v4i32, IntOp>;
2631 multiclass N3VIntSL_HS<bits<4> op11_8,
2632 InstrItinClass itinD16, InstrItinClass itinD32,
2633 InstrItinClass itinQ16, InstrItinClass itinQ32,
2634 string OpcodeStr, string Dt, Intrinsic IntOp> {
2635 def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16,
2636 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp>;
2637 def v2i32 : N3VDIntSL<0b10, op11_8, itinD32,
2638 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp>;
2639 def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16,
2640 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16, IntOp>;
2641 def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32,
2642 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32, IntOp>;
2645 // ....then also with element size of 8 bits:
2646 multiclass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2647 InstrItinClass itinD16, InstrItinClass itinD32,
2648 InstrItinClass itinQ16, InstrItinClass itinQ32,
2649 string OpcodeStr, string Dt,
2650 Intrinsic IntOp, bit Commutable = 0>
2651 : N3VInt_HS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2652 OpcodeStr, Dt, IntOp, Commutable> {
2653 def v8i8 : N3VDInt<op24, op23, 0b00, op11_8, op4, f, itinD16,
2654 OpcodeStr, !strconcat(Dt, "8"),
2655 v8i8, v8i8, IntOp, Commutable>;
2656 def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, f, itinQ16,
2657 OpcodeStr, !strconcat(Dt, "8"),
2658 v16i8, v16i8, IntOp, Commutable>;
2660 multiclass N3VInt_QHSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2661 InstrItinClass itinD16, InstrItinClass itinD32,
2662 InstrItinClass itinQ16, InstrItinClass itinQ32,
2663 string OpcodeStr, string Dt,
2665 : N3VInt_HSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2666 OpcodeStr, Dt, IntOp> {
2667 def v8i8 : N3VDIntSh<op24, op23, 0b00, op11_8, op4, f, itinD16,
2668 OpcodeStr, !strconcat(Dt, "8"),
2670 def v16i8 : N3VQIntSh<op24, op23, 0b00, op11_8, op4, f, itinQ16,
2671 OpcodeStr, !strconcat(Dt, "8"),
2672 v16i8, v16i8, IntOp>;
2676 // ....then also with element size of 64 bits:
2677 multiclass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2678 InstrItinClass itinD16, InstrItinClass itinD32,
2679 InstrItinClass itinQ16, InstrItinClass itinQ32,
2680 string OpcodeStr, string Dt,
2681 Intrinsic IntOp, bit Commutable = 0>
2682 : N3VInt_QHS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2683 OpcodeStr, Dt, IntOp, Commutable> {
2684 def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, f, itinD32,
2685 OpcodeStr, !strconcat(Dt, "64"),
2686 v1i64, v1i64, IntOp, Commutable>;
2687 def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, f, itinQ32,
2688 OpcodeStr, !strconcat(Dt, "64"),
2689 v2i64, v2i64, IntOp, Commutable>;
2691 multiclass N3VInt_QHSDSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2692 InstrItinClass itinD16, InstrItinClass itinD32,
2693 InstrItinClass itinQ16, InstrItinClass itinQ32,
2694 string OpcodeStr, string Dt,
2696 : N3VInt_QHSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2697 OpcodeStr, Dt, IntOp> {
2698 def v1i64 : N3VDIntSh<op24, op23, 0b11, op11_8, op4, f, itinD32,
2699 OpcodeStr, !strconcat(Dt, "64"),
2700 v1i64, v1i64, IntOp>;
2701 def v2i64 : N3VQIntSh<op24, op23, 0b11, op11_8, op4, f, itinQ32,
2702 OpcodeStr, !strconcat(Dt, "64"),
2703 v2i64, v2i64, IntOp>;
2706 // Neon Narrowing 3-register vector intrinsics,
2707 // source operand element sizes of 16, 32 and 64 bits:
2708 multiclass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2709 string OpcodeStr, string Dt,
2710 Intrinsic IntOp, bit Commutable = 0> {
2711 def v8i8 : N3VNInt<op24, op23, 0b00, op11_8, op4,
2712 OpcodeStr, !strconcat(Dt, "16"),
2713 v8i8, v8i16, IntOp, Commutable>;
2714 def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4,
2715 OpcodeStr, !strconcat(Dt, "32"),
2716 v4i16, v4i32, IntOp, Commutable>;
2717 def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4,
2718 OpcodeStr, !strconcat(Dt, "64"),
2719 v2i32, v2i64, IntOp, Commutable>;
2723 // Neon Long 3-register vector operations.
2725 multiclass N3VL_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2726 InstrItinClass itin16, InstrItinClass itin32,
2727 string OpcodeStr, string Dt,
2728 SDNode OpNode, bit Commutable = 0> {
2729 def v8i16 : N3VL<op24, op23, 0b00, op11_8, op4, itin16,
2730 OpcodeStr, !strconcat(Dt, "8"),
2731 v8i16, v8i8, OpNode, Commutable>;
2732 def v4i32 : N3VL<op24, op23, 0b01, op11_8, op4, itin16,
2733 OpcodeStr, !strconcat(Dt, "16"),
2734 v4i32, v4i16, OpNode, Commutable>;
2735 def v2i64 : N3VL<op24, op23, 0b10, op11_8, op4, itin32,
2736 OpcodeStr, !strconcat(Dt, "32"),
2737 v2i64, v2i32, OpNode, Commutable>;
2740 multiclass N3VLSL_HS<bit op24, bits<4> op11_8,
2741 InstrItinClass itin, string OpcodeStr, string Dt,
2743 def v4i16 : N3VLSL16<op24, 0b01, op11_8, itin, OpcodeStr,
2744 !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
2745 def v2i32 : N3VLSL<op24, 0b10, op11_8, itin, OpcodeStr,
2746 !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
2749 multiclass N3VLExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2750 InstrItinClass itin16, InstrItinClass itin32,
2751 string OpcodeStr, string Dt,
2752 SDNode OpNode, SDNode ExtOp, bit Commutable = 0> {
2753 def v8i16 : N3VLExt<op24, op23, 0b00, op11_8, op4, itin16,
2754 OpcodeStr, !strconcat(Dt, "8"),
2755 v8i16, v8i8, OpNode, ExtOp, Commutable>;
2756 def v4i32 : N3VLExt<op24, op23, 0b01, op11_8, op4, itin16,
2757 OpcodeStr, !strconcat(Dt, "16"),
2758 v4i32, v4i16, OpNode, ExtOp, Commutable>;
2759 def v2i64 : N3VLExt<op24, op23, 0b10, op11_8, op4, itin32,
2760 OpcodeStr, !strconcat(Dt, "32"),
2761 v2i64, v2i32, OpNode, ExtOp, Commutable>;
2764 // Neon Long 3-register vector intrinsics.
2766 // First with only element sizes of 16 and 32 bits:
2767 multiclass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
2768 InstrItinClass itin16, InstrItinClass itin32,
2769 string OpcodeStr, string Dt,
2770 Intrinsic IntOp, bit Commutable = 0> {
2771 def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin16,
2772 OpcodeStr, !strconcat(Dt, "16"),
2773 v4i32, v4i16, IntOp, Commutable>;
2774 def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin32,
2775 OpcodeStr, !strconcat(Dt, "32"),
2776 v2i64, v2i32, IntOp, Commutable>;
2779 multiclass N3VLIntSL_HS<bit op24, bits<4> op11_8,
2780 InstrItinClass itin, string OpcodeStr, string Dt,
2782 def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin,
2783 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
2784 def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin,
2785 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
2788 // ....then also with element size of 8 bits:
2789 multiclass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2790 InstrItinClass itin16, InstrItinClass itin32,
2791 string OpcodeStr, string Dt,
2792 Intrinsic IntOp, bit Commutable = 0>
2793 : N3VLInt_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt,
2794 IntOp, Commutable> {
2795 def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin16,
2796 OpcodeStr, !strconcat(Dt, "8"),
2797 v8i16, v8i8, IntOp, Commutable>;
2800 // ....with explicit extend (VABDL).
2801 multiclass N3VLIntExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2802 InstrItinClass itin, string OpcodeStr, string Dt,
2803 Intrinsic IntOp, SDNode ExtOp, bit Commutable = 0> {
2804 def v8i16 : N3VLIntExt<op24, op23, 0b00, op11_8, op4, itin,
2805 OpcodeStr, !strconcat(Dt, "8"),
2806 v8i16, v8i8, IntOp, ExtOp, Commutable>;
2807 def v4i32 : N3VLIntExt<op24, op23, 0b01, op11_8, op4, itin,
2808 OpcodeStr, !strconcat(Dt, "16"),
2809 v4i32, v4i16, IntOp, ExtOp, Commutable>;
2810 def v2i64 : N3VLIntExt<op24, op23, 0b10, op11_8, op4, itin,
2811 OpcodeStr, !strconcat(Dt, "32"),
2812 v2i64, v2i32, IntOp, ExtOp, Commutable>;
2816 // Neon Wide 3-register vector intrinsics,
2817 // source operand element sizes of 8, 16 and 32 bits:
2818 multiclass N3VW_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2819 string OpcodeStr, string Dt,
2820 SDNode OpNode, SDNode ExtOp, bit Commutable = 0> {
2821 def v8i16 : N3VW<op24, op23, 0b00, op11_8, op4,
2822 OpcodeStr, !strconcat(Dt, "8"),
2823 v8i16, v8i8, OpNode, ExtOp, Commutable>;
2824 def v4i32 : N3VW<op24, op23, 0b01, op11_8, op4,
2825 OpcodeStr, !strconcat(Dt, "16"),
2826 v4i32, v4i16, OpNode, ExtOp, Commutable>;
2827 def v2i64 : N3VW<op24, op23, 0b10, op11_8, op4,
2828 OpcodeStr, !strconcat(Dt, "32"),
2829 v2i64, v2i32, OpNode, ExtOp, Commutable>;
2833 // Neon Multiply-Op vector operations,
2834 // element sizes of 8, 16 and 32 bits:
2835 multiclass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2836 InstrItinClass itinD16, InstrItinClass itinD32,
2837 InstrItinClass itinQ16, InstrItinClass itinQ32,
2838 string OpcodeStr, string Dt, SDNode OpNode> {
2839 // 64-bit vector types.
2840 def v8i8 : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16,
2841 OpcodeStr, !strconcat(Dt, "8"), v8i8, mul, OpNode>;
2842 def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16,
2843 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, OpNode>;
2844 def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32,
2845 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, OpNode>;
2847 // 128-bit vector types.
2848 def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16,
2849 OpcodeStr, !strconcat(Dt, "8"), v16i8, mul, OpNode>;
2850 def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16,
2851 OpcodeStr, !strconcat(Dt, "16"), v8i16, mul, OpNode>;
2852 def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32,
2853 OpcodeStr, !strconcat(Dt, "32"), v4i32, mul, OpNode>;
2856 multiclass N3VMulOpSL_HS<bits<4> op11_8,
2857 InstrItinClass itinD16, InstrItinClass itinD32,
2858 InstrItinClass itinQ16, InstrItinClass itinQ32,
2859 string OpcodeStr, string Dt, SDNode ShOp> {
2860 def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16,
2861 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, ShOp>;
2862 def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32,
2863 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, ShOp>;
2864 def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16,
2865 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16,
2867 def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32,
2868 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32,
2872 // Neon Intrinsic-Op vector operations,
2873 // element sizes of 8, 16 and 32 bits:
2874 multiclass N3VIntOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2875 InstrItinClass itinD, InstrItinClass itinQ,
2876 string OpcodeStr, string Dt, Intrinsic IntOp,
2878 // 64-bit vector types.
2879 def v8i8 : N3VDIntOp<op24, op23, 0b00, op11_8, op4, itinD,
2880 OpcodeStr, !strconcat(Dt, "8"), v8i8, IntOp, OpNode>;
2881 def v4i16 : N3VDIntOp<op24, op23, 0b01, op11_8, op4, itinD,
2882 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp, OpNode>;
2883 def v2i32 : N3VDIntOp<op24, op23, 0b10, op11_8, op4, itinD,
2884 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp, OpNode>;
2886 // 128-bit vector types.
2887 def v16i8 : N3VQIntOp<op24, op23, 0b00, op11_8, op4, itinQ,
2888 OpcodeStr, !strconcat(Dt, "8"), v16i8, IntOp, OpNode>;
2889 def v8i16 : N3VQIntOp<op24, op23, 0b01, op11_8, op4, itinQ,
2890 OpcodeStr, !strconcat(Dt, "16"), v8i16, IntOp, OpNode>;
2891 def v4i32 : N3VQIntOp<op24, op23, 0b10, op11_8, op4, itinQ,
2892 OpcodeStr, !strconcat(Dt, "32"), v4i32, IntOp, OpNode>;
2895 // Neon 3-argument intrinsics,
2896 // element sizes of 8, 16 and 32 bits:
2897 multiclass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2898 InstrItinClass itinD, InstrItinClass itinQ,
2899 string OpcodeStr, string Dt, Intrinsic IntOp> {
2900 // 64-bit vector types.
2901 def v8i8 : N3VDInt3<op24, op23, 0b00, op11_8, op4, itinD,
2902 OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
2903 def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, itinD,
2904 OpcodeStr, !strconcat(Dt, "16"), v4i16, v4i16, IntOp>;
2905 def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, itinD,
2906 OpcodeStr, !strconcat(Dt, "32"), v2i32, v2i32, IntOp>;
2908 // 128-bit vector types.
2909 def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, itinQ,
2910 OpcodeStr, !strconcat(Dt, "8"), v16i8, v16i8, IntOp>;
2911 def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, itinQ,
2912 OpcodeStr, !strconcat(Dt, "16"), v8i16, v8i16, IntOp>;
2913 def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, itinQ,
2914 OpcodeStr, !strconcat(Dt, "32"), v4i32, v4i32, IntOp>;
2918 // Neon Long Multiply-Op vector operations,
2919 // element sizes of 8, 16 and 32 bits:
2920 multiclass N3VLMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2921 InstrItinClass itin16, InstrItinClass itin32,
2922 string OpcodeStr, string Dt, SDNode MulOp,
2924 def v8i16 : N3VLMulOp<op24, op23, 0b00, op11_8, op4, itin16, OpcodeStr,
2925 !strconcat(Dt, "8"), v8i16, v8i8, MulOp, OpNode>;
2926 def v4i32 : N3VLMulOp<op24, op23, 0b01, op11_8, op4, itin16, OpcodeStr,
2927 !strconcat(Dt, "16"), v4i32, v4i16, MulOp, OpNode>;
2928 def v2i64 : N3VLMulOp<op24, op23, 0b10, op11_8, op4, itin32, OpcodeStr,
2929 !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
2932 multiclass N3VLMulOpSL_HS<bit op24, bits<4> op11_8, string OpcodeStr,
2933 string Dt, SDNode MulOp, SDNode OpNode> {
2934 def v4i16 : N3VLMulOpSL16<op24, 0b01, op11_8, IIC_VMACi16D, OpcodeStr,
2935 !strconcat(Dt,"16"), v4i32, v4i16, MulOp, OpNode>;
2936 def v2i32 : N3VLMulOpSL<op24, 0b10, op11_8, IIC_VMACi32D, OpcodeStr,
2937 !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
2941 // Neon Long 3-argument intrinsics.
2943 // First with only element sizes of 16 and 32 bits:
2944 multiclass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
2945 InstrItinClass itin16, InstrItinClass itin32,
2946 string OpcodeStr, string Dt, Intrinsic IntOp> {
2947 def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, itin16,
2948 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
2949 def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, itin32,
2950 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
2953 multiclass N3VLInt3SL_HS<bit op24, bits<4> op11_8,
2954 string OpcodeStr, string Dt, Intrinsic IntOp> {
2955 def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D,
2956 OpcodeStr, !strconcat(Dt,"16"), v4i32, v4i16, IntOp>;
2957 def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D,
2958 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
2961 // ....then also with element size of 8 bits:
2962 multiclass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2963 InstrItinClass itin16, InstrItinClass itin32,
2964 string OpcodeStr, string Dt, Intrinsic IntOp>
2965 : N3VLInt3_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt, IntOp> {
2966 def v8i16 : N3VLInt3<op24, op23, 0b00, op11_8, op4, itin16,
2967 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, IntOp>;
2970 // ....with explicit extend (VABAL).
2971 multiclass N3VLIntExtOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2972 InstrItinClass itin, string OpcodeStr, string Dt,
2973 Intrinsic IntOp, SDNode ExtOp, SDNode OpNode> {
2974 def v8i16 : N3VLIntExtOp<op24, op23, 0b00, op11_8, op4, itin,
2975 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8,
2976 IntOp, ExtOp, OpNode>;
2977 def v4i32 : N3VLIntExtOp<op24, op23, 0b01, op11_8, op4, itin,
2978 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16,
2979 IntOp, ExtOp, OpNode>;
2980 def v2i64 : N3VLIntExtOp<op24, op23, 0b10, op11_8, op4, itin,
2981 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32,
2982 IntOp, ExtOp, OpNode>;
2986 // Neon Pairwise long 2-register intrinsics,
2987 // element sizes of 8, 16 and 32 bits:
2988 multiclass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2989 bits<5> op11_7, bit op4,
2990 string OpcodeStr, string Dt, Intrinsic IntOp> {
2991 // 64-bit vector types.
2992 def v8i8 : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2993 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
2994 def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2995 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
2996 def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2997 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
2999 // 128-bit vector types.
3000 def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3001 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
3002 def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3003 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
3004 def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3005 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
3009 // Neon Pairwise long 2-register accumulate intrinsics,
3010 // element sizes of 8, 16 and 32 bits:
3011 multiclass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
3012 bits<5> op11_7, bit op4,
3013 string OpcodeStr, string Dt, Intrinsic IntOp> {
3014 // 64-bit vector types.
3015 def v8i8 : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3016 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
3017 def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3018 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
3019 def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3020 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
3022 // 128-bit vector types.
3023 def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3024 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
3025 def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3026 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
3027 def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3028 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
3032 // Neon 2-register vector shift by immediate,
3033 // with f of either N2RegVShLFrm or N2RegVShRFrm
3034 // element sizes of 8, 16, 32 and 64 bits:
3035 multiclass N2VShL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3036 InstrItinClass itin, string OpcodeStr, string Dt,
3038 // 64-bit vector types.
3039 def v8i8 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
3040 OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
3041 let Inst{21-19} = 0b001; // imm6 = 001xxx
3043 def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
3044 OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
3045 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3047 def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
3048 OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
3049 let Inst{21} = 0b1; // imm6 = 1xxxxx
3051 def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
3052 OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
3055 // 128-bit vector types.
3056 def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
3057 OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
3058 let Inst{21-19} = 0b001; // imm6 = 001xxx
3060 def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
3061 OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
3062 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3064 def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
3065 OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
3066 let Inst{21} = 0b1; // imm6 = 1xxxxx
3068 def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
3069 OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
3072 multiclass N2VShR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3073 InstrItinClass itin, string OpcodeStr, string Dt,
3075 // 64-bit vector types.
3076 def v8i8 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
3077 OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
3078 let Inst{21-19} = 0b001; // imm6 = 001xxx
3080 def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
3081 OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
3082 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3084 def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
3085 OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
3086 let Inst{21} = 0b1; // imm6 = 1xxxxx
3088 def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
3089 OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
3092 // 128-bit vector types.
3093 def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
3094 OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
3095 let Inst{21-19} = 0b001; // imm6 = 001xxx
3097 def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
3098 OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
3099 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3101 def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
3102 OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
3103 let Inst{21} = 0b1; // imm6 = 1xxxxx
3105 def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
3106 OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
3110 // Neon Shift-Accumulate vector operations,
3111 // element sizes of 8, 16, 32 and 64 bits:
3112 multiclass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3113 string OpcodeStr, string Dt, SDNode ShOp> {
3114 // 64-bit vector types.
3115 def v8i8 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
3116 OpcodeStr, !strconcat(Dt, "8"), v8i8, ShOp> {
3117 let Inst{21-19} = 0b001; // imm6 = 001xxx
3119 def v4i16 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
3120 OpcodeStr, !strconcat(Dt, "16"), v4i16, ShOp> {
3121 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3123 def v2i32 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
3124 OpcodeStr, !strconcat(Dt, "32"), v2i32, ShOp> {
3125 let Inst{21} = 0b1; // imm6 = 1xxxxx
3127 def v1i64 : N2VDShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
3128 OpcodeStr, !strconcat(Dt, "64"), v1i64, ShOp>;
3131 // 128-bit vector types.
3132 def v16i8 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
3133 OpcodeStr, !strconcat(Dt, "8"), v16i8, ShOp> {
3134 let Inst{21-19} = 0b001; // imm6 = 001xxx
3136 def v8i16 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
3137 OpcodeStr, !strconcat(Dt, "16"), v8i16, ShOp> {
3138 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3140 def v4i32 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
3141 OpcodeStr, !strconcat(Dt, "32"), v4i32, ShOp> {
3142 let Inst{21} = 0b1; // imm6 = 1xxxxx
3144 def v2i64 : N2VQShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
3145 OpcodeStr, !strconcat(Dt, "64"), v2i64, ShOp>;
3149 // Neon Shift-Insert vector operations,
3150 // with f of either N2RegVShLFrm or N2RegVShRFrm
3151 // element sizes of 8, 16, 32 and 64 bits:
3152 multiclass N2VShInsL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3154 // 64-bit vector types.
3155 def v8i8 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
3156 N2RegVShLFrm, OpcodeStr, "8", v8i8, NEONvsli> {
3157 let Inst{21-19} = 0b001; // imm6 = 001xxx
3159 def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
3160 N2RegVShLFrm, OpcodeStr, "16", v4i16, NEONvsli> {
3161 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3163 def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
3164 N2RegVShLFrm, OpcodeStr, "32", v2i32, NEONvsli> {
3165 let Inst{21} = 0b1; // imm6 = 1xxxxx
3167 def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, i32imm,
3168 N2RegVShLFrm, OpcodeStr, "64", v1i64, NEONvsli>;
3171 // 128-bit vector types.
3172 def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
3173 N2RegVShLFrm, OpcodeStr, "8", v16i8, NEONvsli> {
3174 let Inst{21-19} = 0b001; // imm6 = 001xxx
3176 def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
3177 N2RegVShLFrm, OpcodeStr, "16", v8i16, NEONvsli> {
3178 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3180 def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
3181 N2RegVShLFrm, OpcodeStr, "32", v4i32, NEONvsli> {
3182 let Inst{21} = 0b1; // imm6 = 1xxxxx
3184 def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, i32imm,
3185 N2RegVShLFrm, OpcodeStr, "64", v2i64, NEONvsli>;
3188 multiclass N2VShInsR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3190 // 64-bit vector types.
3191 def v8i8 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm8,
3192 N2RegVShRFrm, OpcodeStr, "8", v8i8, NEONvsri> {
3193 let Inst{21-19} = 0b001; // imm6 = 001xxx
3195 def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm16,
3196 N2RegVShRFrm, OpcodeStr, "16", v4i16, NEONvsri> {
3197 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3199 def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm32,
3200 N2RegVShRFrm, OpcodeStr, "32", v2i32, NEONvsri> {
3201 let Inst{21} = 0b1; // imm6 = 1xxxxx
3203 def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, shr_imm64,
3204 N2RegVShRFrm, OpcodeStr, "64", v1i64, NEONvsri>;
3207 // 128-bit vector types.
3208 def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm8,
3209 N2RegVShRFrm, OpcodeStr, "8", v16i8, NEONvsri> {
3210 let Inst{21-19} = 0b001; // imm6 = 001xxx
3212 def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm16,
3213 N2RegVShRFrm, OpcodeStr, "16", v8i16, NEONvsri> {
3214 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3216 def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm32,
3217 N2RegVShRFrm, OpcodeStr, "32", v4i32, NEONvsri> {
3218 let Inst{21} = 0b1; // imm6 = 1xxxxx
3220 def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, shr_imm64,
3221 N2RegVShRFrm, OpcodeStr, "64", v2i64, NEONvsri>;
3225 // Neon Shift Long operations,
3226 // element sizes of 8, 16, 32 bits:
3227 multiclass N2VLSh_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
3228 bit op4, string OpcodeStr, string Dt, SDNode OpNode> {
3229 def v8i16 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
3230 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode> {
3231 let Inst{21-19} = 0b001; // imm6 = 001xxx
3233 def v4i32 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
3234 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode> {
3235 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3237 def v2i64 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
3238 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode> {
3239 let Inst{21} = 0b1; // imm6 = 1xxxxx
3243 // Neon Shift Narrow operations,
3244 // element sizes of 16, 32, 64 bits:
3245 multiclass N2VNSh_HSD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
3246 bit op4, InstrItinClass itin, string OpcodeStr, string Dt,
3248 def v8i8 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
3249 OpcodeStr, !strconcat(Dt, "16"),
3250 v8i8, v8i16, shr_imm8, OpNode> {
3251 let Inst{21-19} = 0b001; // imm6 = 001xxx
3253 def v4i16 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
3254 OpcodeStr, !strconcat(Dt, "32"),
3255 v4i16, v4i32, shr_imm16, OpNode> {
3256 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3258 def v2i32 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
3259 OpcodeStr, !strconcat(Dt, "64"),
3260 v2i32, v2i64, shr_imm32, OpNode> {
3261 let Inst{21} = 0b1; // imm6 = 1xxxxx
3265 //===----------------------------------------------------------------------===//
3266 // Instruction Definitions.
3267 //===----------------------------------------------------------------------===//
3269 // Vector Add Operations.
3271 // VADD : Vector Add (integer and floating-point)
3272 defm VADD : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd", "i",
3274 def VADDfd : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd", "f32",
3275 v2f32, v2f32, fadd, 1>;
3276 def VADDfq : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd", "f32",
3277 v4f32, v4f32, fadd, 1>;
3278 // VADDL : Vector Add Long (Q = D + D)
3279 defm VADDLs : N3VLExt_QHS<0,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
3280 "vaddl", "s", add, sext, 1>;
3281 defm VADDLu : N3VLExt_QHS<1,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
3282 "vaddl", "u", add, zext, 1>;
3283 // VADDW : Vector Add Wide (Q = Q + D)
3284 defm VADDWs : N3VW_QHS<0,1,0b0001,0, "vaddw", "s", add, sext, 0>;
3285 defm VADDWu : N3VW_QHS<1,1,0b0001,0, "vaddw", "u", add, zext, 0>;
3286 // VHADD : Vector Halving Add
3287 defm VHADDs : N3VInt_QHS<0, 0, 0b0000, 0, N3RegFrm,
3288 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3289 "vhadd", "s", int_arm_neon_vhadds, 1>;
3290 defm VHADDu : N3VInt_QHS<1, 0, 0b0000, 0, N3RegFrm,
3291 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3292 "vhadd", "u", int_arm_neon_vhaddu, 1>;
3293 // VRHADD : Vector Rounding Halving Add
3294 defm VRHADDs : N3VInt_QHS<0, 0, 0b0001, 0, N3RegFrm,
3295 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3296 "vrhadd", "s", int_arm_neon_vrhadds, 1>;
3297 defm VRHADDu : N3VInt_QHS<1, 0, 0b0001, 0, N3RegFrm,
3298 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3299 "vrhadd", "u", int_arm_neon_vrhaddu, 1>;
3300 // VQADD : Vector Saturating Add
3301 defm VQADDs : N3VInt_QHSD<0, 0, 0b0000, 1, N3RegFrm,
3302 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3303 "vqadd", "s", int_arm_neon_vqadds, 1>;
3304 defm VQADDu : N3VInt_QHSD<1, 0, 0b0000, 1, N3RegFrm,
3305 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3306 "vqadd", "u", int_arm_neon_vqaddu, 1>;
3307 // VADDHN : Vector Add and Narrow Returning High Half (D = Q + Q)
3308 defm VADDHN : N3VNInt_HSD<0,1,0b0100,0, "vaddhn", "i",
3309 int_arm_neon_vaddhn, 1>;
3310 // VRADDHN : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
3311 defm VRADDHN : N3VNInt_HSD<1,1,0b0100,0, "vraddhn", "i",
3312 int_arm_neon_vraddhn, 1>;
3314 // Vector Multiply Operations.
3316 // VMUL : Vector Multiply (integer, polynomial and floating-point)
3317 defm VMUL : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D,
3318 IIC_VMULi16Q, IIC_VMULi32Q, "vmul", "i", mul, 1>;
3319 def VMULpd : N3VDInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16D, "vmul",
3320 "p8", v8i8, v8i8, int_arm_neon_vmulp, 1>;
3321 def VMULpq : N3VQInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16Q, "vmul",
3322 "p8", v16i8, v16i8, int_arm_neon_vmulp, 1>;
3323 def VMULfd : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VFMULD, "vmul", "f32",
3324 v2f32, v2f32, fmul, 1>;
3325 def VMULfq : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VFMULQ, "vmul", "f32",
3326 v4f32, v4f32, fmul, 1>;
3327 defm VMULsl : N3VSL_HS<0b1000, "vmul", "i", mul>;
3328 def VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul", "f32", v2f32, fmul>;
3329 def VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul", "f32", v4f32,
3332 def : Pat<(v8i16 (mul (v8i16 QPR:$src1),
3333 (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))),
3334 (v8i16 (VMULslv8i16 (v8i16 QPR:$src1),
3335 (v4i16 (EXTRACT_SUBREG QPR:$src2,
3336 (DSubReg_i16_reg imm:$lane))),
3337 (SubReg_i16_lane imm:$lane)))>;
3338 def : Pat<(v4i32 (mul (v4i32 QPR:$src1),
3339 (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))),
3340 (v4i32 (VMULslv4i32 (v4i32 QPR:$src1),
3341 (v2i32 (EXTRACT_SUBREG QPR:$src2,
3342 (DSubReg_i32_reg imm:$lane))),
3343 (SubReg_i32_lane imm:$lane)))>;
3344 def : Pat<(v4f32 (fmul (v4f32 QPR:$src1),
3345 (v4f32 (NEONvduplane (v4f32 QPR:$src2), imm:$lane)))),
3346 (v4f32 (VMULslfq (v4f32 QPR:$src1),
3347 (v2f32 (EXTRACT_SUBREG QPR:$src2,
3348 (DSubReg_i32_reg imm:$lane))),
3349 (SubReg_i32_lane imm:$lane)))>;
3351 // VQDMULH : Vector Saturating Doubling Multiply Returning High Half
3352 defm VQDMULH : N3VInt_HS<0, 0, 0b1011, 0, N3RegFrm, IIC_VMULi16D, IIC_VMULi32D,
3353 IIC_VMULi16Q, IIC_VMULi32Q,
3354 "vqdmulh", "s", int_arm_neon_vqdmulh, 1>;
3355 defm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D,
3356 IIC_VMULi16Q, IIC_VMULi32Q,
3357 "vqdmulh", "s", int_arm_neon_vqdmulh>;
3358 def : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1),
3359 (v8i16 (NEONvduplane (v8i16 QPR:$src2),
3361 (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1),
3362 (v4i16 (EXTRACT_SUBREG QPR:$src2,
3363 (DSubReg_i16_reg imm:$lane))),
3364 (SubReg_i16_lane imm:$lane)))>;
3365 def : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1),
3366 (v4i32 (NEONvduplane (v4i32 QPR:$src2),
3368 (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1),
3369 (v2i32 (EXTRACT_SUBREG QPR:$src2,
3370 (DSubReg_i32_reg imm:$lane))),
3371 (SubReg_i32_lane imm:$lane)))>;
3373 // VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
3374 defm VQRDMULH : N3VInt_HS<1, 0, 0b1011, 0, N3RegFrm,
3375 IIC_VMULi16D,IIC_VMULi32D,IIC_VMULi16Q,IIC_VMULi32Q,
3376 "vqrdmulh", "s", int_arm_neon_vqrdmulh, 1>;
3377 defm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D,
3378 IIC_VMULi16Q, IIC_VMULi32Q,
3379 "vqrdmulh", "s", int_arm_neon_vqrdmulh>;
3380 def : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1),
3381 (v8i16 (NEONvduplane (v8i16 QPR:$src2),
3383 (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1),
3384 (v4i16 (EXTRACT_SUBREG QPR:$src2,
3385 (DSubReg_i16_reg imm:$lane))),
3386 (SubReg_i16_lane imm:$lane)))>;
3387 def : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1),
3388 (v4i32 (NEONvduplane (v4i32 QPR:$src2),
3390 (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1),
3391 (v2i32 (EXTRACT_SUBREG QPR:$src2,
3392 (DSubReg_i32_reg imm:$lane))),
3393 (SubReg_i32_lane imm:$lane)))>;
3395 // VMULL : Vector Multiply Long (integer and polynomial) (Q = D * D)
3396 defm VMULLs : N3VL_QHS<0,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
3397 "vmull", "s", NEONvmulls, 1>;
3398 defm VMULLu : N3VL_QHS<1,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
3399 "vmull", "u", NEONvmullu, 1>;
3400 def VMULLp : N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull", "p8",
3401 v8i16, v8i8, int_arm_neon_vmullp, 1>;
3402 defm VMULLsls : N3VLSL_HS<0, 0b1010, IIC_VMULi16D, "vmull", "s", NEONvmulls>;
3403 defm VMULLslu : N3VLSL_HS<1, 0b1010, IIC_VMULi16D, "vmull", "u", NEONvmullu>;
3405 // VQDMULL : Vector Saturating Doubling Multiply Long (Q = D * D)
3406 defm VQDMULL : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, IIC_VMULi32D,
3407 "vqdmull", "s", int_arm_neon_vqdmull, 1>;
3408 defm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D,
3409 "vqdmull", "s", int_arm_neon_vqdmull>;
3411 // Vector Multiply-Accumulate and Multiply-Subtract Operations.
3413 // VMLA : Vector Multiply Accumulate (integer and floating-point)
3414 defm VMLA : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
3415 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
3416 def VMLAfd : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla", "f32",
3417 v2f32, fmul_su, fadd_mlx>,
3418 Requires<[HasNEON, UseFPVMLx]>;
3419 def VMLAfq : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla", "f32",
3420 v4f32, fmul_su, fadd_mlx>,
3421 Requires<[HasNEON, UseFPVMLx]>;
3422 defm VMLAsl : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D,
3423 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
3424 def VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla", "f32",
3425 v2f32, fmul_su, fadd_mlx>,
3426 Requires<[HasNEON, UseFPVMLx]>;
3427 def VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla", "f32",
3428 v4f32, v2f32, fmul_su, fadd_mlx>,
3429 Requires<[HasNEON, UseFPVMLx]>;
3431 def : Pat<(v8i16 (add (v8i16 QPR:$src1),
3432 (mul (v8i16 QPR:$src2),
3433 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
3434 (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
3435 (v4i16 (EXTRACT_SUBREG QPR:$src3,
3436 (DSubReg_i16_reg imm:$lane))),
3437 (SubReg_i16_lane imm:$lane)))>;
3439 def : Pat<(v4i32 (add (v4i32 QPR:$src1),
3440 (mul (v4i32 QPR:$src2),
3441 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
3442 (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
3443 (v2i32 (EXTRACT_SUBREG QPR:$src3,
3444 (DSubReg_i32_reg imm:$lane))),
3445 (SubReg_i32_lane imm:$lane)))>;
3447 def : Pat<(v4f32 (fadd_mlx (v4f32 QPR:$src1),
3448 (fmul_su (v4f32 QPR:$src2),
3449 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
3450 (v4f32 (VMLAslfq (v4f32 QPR:$src1),
3452 (v2f32 (EXTRACT_SUBREG QPR:$src3,
3453 (DSubReg_i32_reg imm:$lane))),
3454 (SubReg_i32_lane imm:$lane)))>,
3455 Requires<[HasNEON, UseFPVMLx]>;
3457 // VMLAL : Vector Multiply Accumulate Long (Q += D * D)
3458 defm VMLALs : N3VLMulOp_QHS<0,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
3459 "vmlal", "s", NEONvmulls, add>;
3460 defm VMLALu : N3VLMulOp_QHS<1,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
3461 "vmlal", "u", NEONvmullu, add>;
3463 defm VMLALsls : N3VLMulOpSL_HS<0, 0b0010, "vmlal", "s", NEONvmulls, add>;
3464 defm VMLALslu : N3VLMulOpSL_HS<1, 0b0010, "vmlal", "u", NEONvmullu, add>;
3466 // VQDMLAL : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
3467 defm VQDMLAL : N3VLInt3_HS<0, 1, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
3468 "vqdmlal", "s", int_arm_neon_vqdmlal>;
3469 defm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal", "s", int_arm_neon_vqdmlal>;
3471 // VMLS : Vector Multiply Subtract (integer and floating-point)
3472 defm VMLS : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
3473 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
3474 def VMLSfd : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls", "f32",
3475 v2f32, fmul_su, fsub_mlx>,
3476 Requires<[HasNEON, UseFPVMLx]>;
3477 def VMLSfq : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls", "f32",
3478 v4f32, fmul_su, fsub_mlx>,
3479 Requires<[HasNEON, UseFPVMLx]>;
3480 defm VMLSsl : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D,
3481 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
3482 def VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls", "f32",
3483 v2f32, fmul_su, fsub_mlx>,
3484 Requires<[HasNEON, UseFPVMLx]>;
3485 def VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls", "f32",
3486 v4f32, v2f32, fmul_su, fsub_mlx>,
3487 Requires<[HasNEON, UseFPVMLx]>;
3489 def : Pat<(v8i16 (sub (v8i16 QPR:$src1),
3490 (mul (v8i16 QPR:$src2),
3491 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
3492 (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
3493 (v4i16 (EXTRACT_SUBREG QPR:$src3,
3494 (DSubReg_i16_reg imm:$lane))),
3495 (SubReg_i16_lane imm:$lane)))>;
3497 def : Pat<(v4i32 (sub (v4i32 QPR:$src1),
3498 (mul (v4i32 QPR:$src2),
3499 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
3500 (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
3501 (v2i32 (EXTRACT_SUBREG QPR:$src3,
3502 (DSubReg_i32_reg imm:$lane))),
3503 (SubReg_i32_lane imm:$lane)))>;
3505 def : Pat<(v4f32 (fsub_mlx (v4f32 QPR:$src1),
3506 (fmul_su (v4f32 QPR:$src2),
3507 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
3508 (v4f32 (VMLSslfq (v4f32 QPR:$src1), (v4f32 QPR:$src2),
3509 (v2f32 (EXTRACT_SUBREG QPR:$src3,
3510 (DSubReg_i32_reg imm:$lane))),
3511 (SubReg_i32_lane imm:$lane)))>,
3512 Requires<[HasNEON, UseFPVMLx]>;
3514 // VMLSL : Vector Multiply Subtract Long (Q -= D * D)
3515 defm VMLSLs : N3VLMulOp_QHS<0,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
3516 "vmlsl", "s", NEONvmulls, sub>;
3517 defm VMLSLu : N3VLMulOp_QHS<1,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
3518 "vmlsl", "u", NEONvmullu, sub>;
3520 defm VMLSLsls : N3VLMulOpSL_HS<0, 0b0110, "vmlsl", "s", NEONvmulls, sub>;
3521 defm VMLSLslu : N3VLMulOpSL_HS<1, 0b0110, "vmlsl", "u", NEONvmullu, sub>;
3523 // VQDMLSL : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
3524 defm VQDMLSL : N3VLInt3_HS<0, 1, 0b1011, 0, IIC_VMACi16D, IIC_VMACi32D,
3525 "vqdmlsl", "s", int_arm_neon_vqdmlsl>;
3526 defm VQDMLSLsl: N3VLInt3SL_HS<0, 0b111, "vqdmlsl", "s", int_arm_neon_vqdmlsl>;
3528 // Vector Subtract Operations.
3530 // VSUB : Vector Subtract (integer and floating-point)
3531 defm VSUB : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ,
3532 "vsub", "i", sub, 0>;
3533 def VSUBfd : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub", "f32",
3534 v2f32, v2f32, fsub, 0>;
3535 def VSUBfq : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub", "f32",
3536 v4f32, v4f32, fsub, 0>;
3537 // VSUBL : Vector Subtract Long (Q = D - D)
3538 defm VSUBLs : N3VLExt_QHS<0,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
3539 "vsubl", "s", sub, sext, 0>;
3540 defm VSUBLu : N3VLExt_QHS<1,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
3541 "vsubl", "u", sub, zext, 0>;
3542 // VSUBW : Vector Subtract Wide (Q = Q - D)
3543 defm VSUBWs : N3VW_QHS<0,1,0b0011,0, "vsubw", "s", sub, sext, 0>;
3544 defm VSUBWu : N3VW_QHS<1,1,0b0011,0, "vsubw", "u", sub, zext, 0>;
3545 // VHSUB : Vector Halving Subtract
3546 defm VHSUBs : N3VInt_QHS<0, 0, 0b0010, 0, N3RegFrm,
3547 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3548 "vhsub", "s", int_arm_neon_vhsubs, 0>;
3549 defm VHSUBu : N3VInt_QHS<1, 0, 0b0010, 0, N3RegFrm,
3550 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3551 "vhsub", "u", int_arm_neon_vhsubu, 0>;
3552 // VQSUB : Vector Saturing Subtract
3553 defm VQSUBs : N3VInt_QHSD<0, 0, 0b0010, 1, N3RegFrm,
3554 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3555 "vqsub", "s", int_arm_neon_vqsubs, 0>;
3556 defm VQSUBu : N3VInt_QHSD<1, 0, 0b0010, 1, N3RegFrm,
3557 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3558 "vqsub", "u", int_arm_neon_vqsubu, 0>;
3559 // VSUBHN : Vector Subtract and Narrow Returning High Half (D = Q - Q)
3560 defm VSUBHN : N3VNInt_HSD<0,1,0b0110,0, "vsubhn", "i",
3561 int_arm_neon_vsubhn, 0>;
3562 // VRSUBHN : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
3563 defm VRSUBHN : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn", "i",
3564 int_arm_neon_vrsubhn, 0>;
3566 // Vector Comparisons.
3568 // VCEQ : Vector Compare Equal
3569 defm VCEQ : N3V_QHS<1, 0, 0b1000, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3570 IIC_VSUBi4Q, "vceq", "i", NEONvceq, 1>;
3571 def VCEQfd : N3VD<0,0,0b00,0b1110,0, IIC_VBIND, "vceq", "f32", v2i32, v2f32,
3573 def VCEQfq : N3VQ<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq", "f32", v4i32, v4f32,
3576 defm VCEQz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00010, 0, "vceq", "i",
3577 "$Vd, $Vm, #0", NEONvceqz>;
3579 // VCGE : Vector Compare Greater Than or Equal
3580 defm VCGEs : N3V_QHS<0, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3581 IIC_VSUBi4Q, "vcge", "s", NEONvcge, 0>;
3582 defm VCGEu : N3V_QHS<1, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3583 IIC_VSUBi4Q, "vcge", "u", NEONvcgeu, 0>;
3584 def VCGEfd : N3VD<1,0,0b00,0b1110,0, IIC_VBIND, "vcge", "f32", v2i32, v2f32,
3586 def VCGEfq : N3VQ<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge", "f32", v4i32, v4f32,
3589 defm VCGEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00001, 0, "vcge", "s",
3590 "$Vd, $Vm, #0", NEONvcgez>;
3591 defm VCLEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00011, 0, "vcle", "s",
3592 "$Vd, $Vm, #0", NEONvclez>;
3594 // VCGT : Vector Compare Greater Than
3595 defm VCGTs : N3V_QHS<0, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3596 IIC_VSUBi4Q, "vcgt", "s", NEONvcgt, 0>;
3597 defm VCGTu : N3V_QHS<1, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3598 IIC_VSUBi4Q, "vcgt", "u", NEONvcgtu, 0>;
3599 def VCGTfd : N3VD<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt", "f32", v2i32, v2f32,
3601 def VCGTfq : N3VQ<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt", "f32", v4i32, v4f32,
3604 defm VCGTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00000, 0, "vcgt", "s",
3605 "$Vd, $Vm, #0", NEONvcgtz>;
3606 defm VCLTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00100, 0, "vclt", "s",
3607 "$Vd, $Vm, #0", NEONvcltz>;
3609 // VACGE : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
3610 def VACGEd : N3VDInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
3611 "f32", v2i32, v2f32, int_arm_neon_vacged, 0>;
3612 def VACGEq : N3VQInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
3613 "f32", v4i32, v4f32, int_arm_neon_vacgeq, 0>;
3614 // VACGT : Vector Absolute Compare Greater Than (aka VCAGT)
3615 def VACGTd : N3VDInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
3616 "f32", v2i32, v2f32, int_arm_neon_vacgtd, 0>;
3617 def VACGTq : N3VQInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
3618 "f32", v4i32, v4f32, int_arm_neon_vacgtq, 0>;
3619 // VTST : Vector Test Bits
3620 defm VTST : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
3621 IIC_VBINi4Q, "vtst", "", NEONvtst, 1>;
3623 // Vector Bitwise Operations.
3625 def vnotd : PatFrag<(ops node:$in),
3626 (xor node:$in, (bitconvert (v8i8 NEONimmAllOnesV)))>;
3627 def vnotq : PatFrag<(ops node:$in),
3628 (xor node:$in, (bitconvert (v16i8 NEONimmAllOnesV)))>;
3631 // VAND : Vector Bitwise AND
3632 def VANDd : N3VDX<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand",
3633 v2i32, v2i32, and, 1>;
3634 def VANDq : N3VQX<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand",
3635 v4i32, v4i32, and, 1>;
3637 // VEOR : Vector Bitwise Exclusive OR
3638 def VEORd : N3VDX<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor",
3639 v2i32, v2i32, xor, 1>;
3640 def VEORq : N3VQX<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor",
3641 v4i32, v4i32, xor, 1>;
3643 // VORR : Vector Bitwise OR
3644 def VORRd : N3VDX<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr",
3645 v2i32, v2i32, or, 1>;
3646 def VORRq : N3VQX<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr",
3647 v4i32, v4i32, or, 1>;
3649 def VORRiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 0, 1,
3650 (outs DPR:$Vd), (ins nModImm:$SIMM, DPR:$src),
3652 "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
3654 (v4i16 (NEONvorrImm DPR:$src, timm:$SIMM)))]> {
3655 let Inst{9} = SIMM{9};
3658 def VORRiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 0, 1,
3659 (outs DPR:$Vd), (ins nModImm:$SIMM, DPR:$src),
3661 "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
3663 (v2i32 (NEONvorrImm DPR:$src, timm:$SIMM)))]> {
3664 let Inst{10-9} = SIMM{10-9};
3667 def VORRiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 0, 1,
3668 (outs QPR:$Vd), (ins nModImm:$SIMM, QPR:$src),
3670 "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
3672 (v8i16 (NEONvorrImm QPR:$src, timm:$SIMM)))]> {
3673 let Inst{9} = SIMM{9};
3676 def VORRiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 0, 1,
3677 (outs QPR:$Vd), (ins nModImm:$SIMM, QPR:$src),
3679 "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
3681 (v4i32 (NEONvorrImm QPR:$src, timm:$SIMM)))]> {
3682 let Inst{10-9} = SIMM{10-9};
3686 // VBIC : Vector Bitwise Bit Clear (AND NOT)
3687 def VBICd : N3VX<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
3688 (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
3689 "vbic", "$Vd, $Vn, $Vm", "",
3690 [(set DPR:$Vd, (v2i32 (and DPR:$Vn,
3691 (vnotd DPR:$Vm))))]>;
3692 def VBICq : N3VX<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
3693 (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
3694 "vbic", "$Vd, $Vn, $Vm", "",
3695 [(set QPR:$Vd, (v4i32 (and QPR:$Vn,
3696 (vnotq QPR:$Vm))))]>;
3698 def VBICiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 1, 1,
3699 (outs DPR:$Vd), (ins nModImm:$SIMM, DPR:$src),
3701 "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
3703 (v4i16 (NEONvbicImm DPR:$src, timm:$SIMM)))]> {
3704 let Inst{9} = SIMM{9};
3707 def VBICiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 1, 1,
3708 (outs DPR:$Vd), (ins nModImm:$SIMM, DPR:$src),
3710 "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
3712 (v2i32 (NEONvbicImm DPR:$src, timm:$SIMM)))]> {
3713 let Inst{10-9} = SIMM{10-9};
3716 def VBICiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 1, 1,
3717 (outs QPR:$Vd), (ins nModImm:$SIMM, QPR:$src),
3719 "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
3721 (v8i16 (NEONvbicImm QPR:$src, timm:$SIMM)))]> {
3722 let Inst{9} = SIMM{9};
3725 def VBICiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 1, 1,
3726 (outs QPR:$Vd), (ins nModImm:$SIMM, QPR:$src),
3728 "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
3730 (v4i32 (NEONvbicImm QPR:$src, timm:$SIMM)))]> {
3731 let Inst{10-9} = SIMM{10-9};
3734 // VORN : Vector Bitwise OR NOT
3735 def VORNd : N3VX<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$Vd),
3736 (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
3737 "vorn", "$Vd, $Vn, $Vm", "",
3738 [(set DPR:$Vd, (v2i32 (or DPR:$Vn,
3739 (vnotd DPR:$Vm))))]>;
3740 def VORNq : N3VX<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$Vd),
3741 (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
3742 "vorn", "$Vd, $Vn, $Vm", "",
3743 [(set QPR:$Vd, (v4i32 (or QPR:$Vn,
3744 (vnotq QPR:$Vm))))]>;
3746 // VMVN : Vector Bitwise NOT (Immediate)
3748 let isReMaterializable = 1 in {
3750 def VMVNv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 1, 1, (outs DPR:$Vd),
3751 (ins nModImm:$SIMM), IIC_VMOVImm,
3752 "vmvn", "i16", "$Vd, $SIMM", "",
3753 [(set DPR:$Vd, (v4i16 (NEONvmvnImm timm:$SIMM)))]> {
3754 let Inst{9} = SIMM{9};
3757 def VMVNv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 1, 1, (outs QPR:$Vd),
3758 (ins nModImm:$SIMM), IIC_VMOVImm,
3759 "vmvn", "i16", "$Vd, $SIMM", "",
3760 [(set QPR:$Vd, (v8i16 (NEONvmvnImm timm:$SIMM)))]> {
3761 let Inst{9} = SIMM{9};
3764 def VMVNv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 1, 1, (outs DPR:$Vd),
3765 (ins nModImm:$SIMM), IIC_VMOVImm,
3766 "vmvn", "i32", "$Vd, $SIMM", "",
3767 [(set DPR:$Vd, (v2i32 (NEONvmvnImm timm:$SIMM)))]> {
3768 let Inst{11-8} = SIMM{11-8};
3771 def VMVNv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 1, 1, (outs QPR:$Vd),
3772 (ins nModImm:$SIMM), IIC_VMOVImm,
3773 "vmvn", "i32", "$Vd, $SIMM", "",
3774 [(set QPR:$Vd, (v4i32 (NEONvmvnImm timm:$SIMM)))]> {
3775 let Inst{11-8} = SIMM{11-8};
3779 // VMVN : Vector Bitwise NOT
3780 def VMVNd : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
3781 (outs DPR:$Vd), (ins DPR:$Vm), IIC_VSUBiD,
3782 "vmvn", "$Vd, $Vm", "",
3783 [(set DPR:$Vd, (v2i32 (vnotd DPR:$Vm)))]>;
3784 def VMVNq : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
3785 (outs QPR:$Vd), (ins QPR:$Vm), IIC_VSUBiD,
3786 "vmvn", "$Vd, $Vm", "",
3787 [(set QPR:$Vd, (v4i32 (vnotq QPR:$Vm)))]>;
3788 def : Pat<(v2i32 (vnotd DPR:$src)), (VMVNd DPR:$src)>;
3789 def : Pat<(v4i32 (vnotq QPR:$src)), (VMVNq QPR:$src)>;
3791 // VBSL : Vector Bitwise Select
3792 def VBSLd : N3VX<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
3793 (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
3794 N3RegFrm, IIC_VCNTiD,
3795 "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3797 (v2i32 (NEONvbsl DPR:$src1, DPR:$Vn, DPR:$Vm)))]>;
3799 def : Pat<(v2i32 (or (and DPR:$Vn, DPR:$Vd),
3800 (and DPR:$Vm, (vnotd DPR:$Vd)))),
3801 (VBSLd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
3803 def VBSLq : N3VX<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
3804 (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
3805 N3RegFrm, IIC_VCNTiQ,
3806 "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3808 (v4i32 (NEONvbsl QPR:$src1, QPR:$Vn, QPR:$Vm)))]>;
3810 def : Pat<(v4i32 (or (and QPR:$Vn, QPR:$Vd),
3811 (and QPR:$Vm, (vnotq QPR:$Vd)))),
3812 (VBSLq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
3814 // VBIF : Vector Bitwise Insert if False
3815 // like VBSL but with: "vbif $dst, $src3, $src1", "$src2 = $dst",
3816 // FIXME: This instruction's encoding MAY NOT BE correct.
3817 def VBIFd : N3VX<1, 0, 0b11, 0b0001, 0, 1,
3818 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
3819 N3RegFrm, IIC_VBINiD,
3820 "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3821 [/* For disassembly only; pattern left blank */]>;
3822 def VBIFq : N3VX<1, 0, 0b11, 0b0001, 1, 1,
3823 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
3824 N3RegFrm, IIC_VBINiQ,
3825 "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3826 [/* For disassembly only; pattern left blank */]>;
3828 // VBIT : Vector Bitwise Insert if True
3829 // like VBSL but with: "vbit $dst, $src2, $src1", "$src3 = $dst",
3830 // FIXME: This instruction's encoding MAY NOT BE correct.
3831 def VBITd : N3VX<1, 0, 0b10, 0b0001, 0, 1,
3832 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
3833 N3RegFrm, IIC_VBINiD,
3834 "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3835 [/* For disassembly only; pattern left blank */]>;
3836 def VBITq : N3VX<1, 0, 0b10, 0b0001, 1, 1,
3837 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
3838 N3RegFrm, IIC_VBINiQ,
3839 "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3840 [/* For disassembly only; pattern left blank */]>;
3842 // VBIT/VBIF are not yet implemented. The TwoAddress pass will not go looking
3843 // for equivalent operations with different register constraints; it just
3846 // Vector Absolute Differences.
3848 // VABD : Vector Absolute Difference
3849 defm VABDs : N3VInt_QHS<0, 0, 0b0111, 0, N3RegFrm,
3850 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3851 "vabd", "s", int_arm_neon_vabds, 1>;
3852 defm VABDu : N3VInt_QHS<1, 0, 0b0111, 0, N3RegFrm,
3853 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3854 "vabd", "u", int_arm_neon_vabdu, 1>;
3855 def VABDfd : N3VDInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBIND,
3856 "vabd", "f32", v2f32, v2f32, int_arm_neon_vabds, 1>;
3857 def VABDfq : N3VQInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBINQ,
3858 "vabd", "f32", v4f32, v4f32, int_arm_neon_vabds, 1>;
3860 // VABDL : Vector Absolute Difference Long (Q = | D - D |)
3861 defm VABDLs : N3VLIntExt_QHS<0,1,0b0111,0, IIC_VSUBi4Q,
3862 "vabdl", "s", int_arm_neon_vabds, zext, 1>;
3863 defm VABDLu : N3VLIntExt_QHS<1,1,0b0111,0, IIC_VSUBi4Q,
3864 "vabdl", "u", int_arm_neon_vabdu, zext, 1>;
3866 // VABA : Vector Absolute Difference and Accumulate
3867 defm VABAs : N3VIntOp_QHS<0,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
3868 "vaba", "s", int_arm_neon_vabds, add>;
3869 defm VABAu : N3VIntOp_QHS<1,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
3870 "vaba", "u", int_arm_neon_vabdu, add>;
3872 // VABAL : Vector Absolute Difference and Accumulate Long (Q += | D - D |)
3873 defm VABALs : N3VLIntExtOp_QHS<0,1,0b0101,0, IIC_VABAD,
3874 "vabal", "s", int_arm_neon_vabds, zext, add>;
3875 defm VABALu : N3VLIntExtOp_QHS<1,1,0b0101,0, IIC_VABAD,
3876 "vabal", "u", int_arm_neon_vabdu, zext, add>;
3878 // Vector Maximum and Minimum.
3880 // VMAX : Vector Maximum
3881 defm VMAXs : N3VInt_QHS<0, 0, 0b0110, 0, N3RegFrm,
3882 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3883 "vmax", "s", int_arm_neon_vmaxs, 1>;
3884 defm VMAXu : N3VInt_QHS<1, 0, 0b0110, 0, N3RegFrm,
3885 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3886 "vmax", "u", int_arm_neon_vmaxu, 1>;
3887 def VMAXfd : N3VDInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBIND,
3889 v2f32, v2f32, int_arm_neon_vmaxs, 1>;
3890 def VMAXfq : N3VQInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBINQ,
3892 v4f32, v4f32, int_arm_neon_vmaxs, 1>;
3894 // VMIN : Vector Minimum
3895 defm VMINs : N3VInt_QHS<0, 0, 0b0110, 1, N3RegFrm,
3896 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3897 "vmin", "s", int_arm_neon_vmins, 1>;
3898 defm VMINu : N3VInt_QHS<1, 0, 0b0110, 1, N3RegFrm,
3899 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3900 "vmin", "u", int_arm_neon_vminu, 1>;
3901 def VMINfd : N3VDInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBIND,
3903 v2f32, v2f32, int_arm_neon_vmins, 1>;
3904 def VMINfq : N3VQInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBINQ,
3906 v4f32, v4f32, int_arm_neon_vmins, 1>;
3908 // Vector Pairwise Operations.
3910 // VPADD : Vector Pairwise Add
3911 def VPADDi8 : N3VDInt<0, 0, 0b00, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
3913 v8i8, v8i8, int_arm_neon_vpadd, 0>;
3914 def VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
3916 v4i16, v4i16, int_arm_neon_vpadd, 0>;
3917 def VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
3919 v2i32, v2i32, int_arm_neon_vpadd, 0>;
3920 def VPADDf : N3VDInt<1, 0, 0b00, 0b1101, 0, N3RegFrm,
3921 IIC_VPBIND, "vpadd", "f32",
3922 v2f32, v2f32, int_arm_neon_vpadd, 0>;
3924 // VPADDL : Vector Pairwise Add Long
3925 defm VPADDLs : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl", "s",
3926 int_arm_neon_vpaddls>;
3927 defm VPADDLu : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl", "u",
3928 int_arm_neon_vpaddlu>;
3930 // VPADAL : Vector Pairwise Add and Accumulate Long
3931 defm VPADALs : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01100, 0, "vpadal", "s",
3932 int_arm_neon_vpadals>;
3933 defm VPADALu : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01101, 0, "vpadal", "u",
3934 int_arm_neon_vpadalu>;
3936 // VPMAX : Vector Pairwise Maximum
3937 def VPMAXs8 : N3VDInt<0, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3938 "s8", v8i8, v8i8, int_arm_neon_vpmaxs, 0>;
3939 def VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3940 "s16", v4i16, v4i16, int_arm_neon_vpmaxs, 0>;
3941 def VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3942 "s32", v2i32, v2i32, int_arm_neon_vpmaxs, 0>;
3943 def VPMAXu8 : N3VDInt<1, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3944 "u8", v8i8, v8i8, int_arm_neon_vpmaxu, 0>;
3945 def VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3946 "u16", v4i16, v4i16, int_arm_neon_vpmaxu, 0>;
3947 def VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3948 "u32", v2i32, v2i32, int_arm_neon_vpmaxu, 0>;
3949 def VPMAXf : N3VDInt<1, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmax",
3950 "f32", v2f32, v2f32, int_arm_neon_vpmaxs, 0>;
3952 // VPMIN : Vector Pairwise Minimum
3953 def VPMINs8 : N3VDInt<0, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3954 "s8", v8i8, v8i8, int_arm_neon_vpmins, 0>;
3955 def VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3956 "s16", v4i16, v4i16, int_arm_neon_vpmins, 0>;
3957 def VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3958 "s32", v2i32, v2i32, int_arm_neon_vpmins, 0>;
3959 def VPMINu8 : N3VDInt<1, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3960 "u8", v8i8, v8i8, int_arm_neon_vpminu, 0>;
3961 def VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3962 "u16", v4i16, v4i16, int_arm_neon_vpminu, 0>;
3963 def VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3964 "u32", v2i32, v2i32, int_arm_neon_vpminu, 0>;
3965 def VPMINf : N3VDInt<1, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmin",
3966 "f32", v2f32, v2f32, int_arm_neon_vpmins, 0>;
3968 // Vector Reciprocal and Reciprocal Square Root Estimate and Step.
3970 // VRECPE : Vector Reciprocal Estimate
3971 def VRECPEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
3972 IIC_VUNAD, "vrecpe", "u32",
3973 v2i32, v2i32, int_arm_neon_vrecpe>;
3974 def VRECPEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
3975 IIC_VUNAQ, "vrecpe", "u32",
3976 v4i32, v4i32, int_arm_neon_vrecpe>;
3977 def VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
3978 IIC_VUNAD, "vrecpe", "f32",
3979 v2f32, v2f32, int_arm_neon_vrecpe>;
3980 def VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
3981 IIC_VUNAQ, "vrecpe", "f32",
3982 v4f32, v4f32, int_arm_neon_vrecpe>;
3984 // VRECPS : Vector Reciprocal Step
3985 def VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
3986 IIC_VRECSD, "vrecps", "f32",
3987 v2f32, v2f32, int_arm_neon_vrecps, 1>;
3988 def VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
3989 IIC_VRECSQ, "vrecps", "f32",
3990 v4f32, v4f32, int_arm_neon_vrecps, 1>;
3992 // VRSQRTE : Vector Reciprocal Square Root Estimate
3993 def VRSQRTEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
3994 IIC_VUNAD, "vrsqrte", "u32",
3995 v2i32, v2i32, int_arm_neon_vrsqrte>;
3996 def VRSQRTEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
3997 IIC_VUNAQ, "vrsqrte", "u32",
3998 v4i32, v4i32, int_arm_neon_vrsqrte>;
3999 def VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
4000 IIC_VUNAD, "vrsqrte", "f32",
4001 v2f32, v2f32, int_arm_neon_vrsqrte>;
4002 def VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
4003 IIC_VUNAQ, "vrsqrte", "f32",
4004 v4f32, v4f32, int_arm_neon_vrsqrte>;
4006 // VRSQRTS : Vector Reciprocal Square Root Step
4007 def VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
4008 IIC_VRECSD, "vrsqrts", "f32",
4009 v2f32, v2f32, int_arm_neon_vrsqrts, 1>;
4010 def VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
4011 IIC_VRECSQ, "vrsqrts", "f32",
4012 v4f32, v4f32, int_arm_neon_vrsqrts, 1>;
4016 // VSHL : Vector Shift
4017 defm VSHLs : N3VInt_QHSDSh<0, 0, 0b0100, 0, N3RegVShFrm,
4018 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
4019 "vshl", "s", int_arm_neon_vshifts>;
4020 defm VSHLu : N3VInt_QHSDSh<1, 0, 0b0100, 0, N3RegVShFrm,
4021 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
4022 "vshl", "u", int_arm_neon_vshiftu>;
4024 // VSHL : Vector Shift Left (Immediate)
4025 defm VSHLi : N2VShL_QHSD<0, 1, 0b0101, 1, IIC_VSHLiD, "vshl", "i", NEONvshl>;
4027 // VSHR : Vector Shift Right (Immediate)
4028 defm VSHRs : N2VShR_QHSD<0, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "s",NEONvshrs>;
4029 defm VSHRu : N2VShR_QHSD<1, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "u",NEONvshru>;
4031 // VSHLL : Vector Shift Left Long
4032 defm VSHLLs : N2VLSh_QHS<0, 1, 0b1010, 0, 0, 1, "vshll", "s", NEONvshlls>;
4033 defm VSHLLu : N2VLSh_QHS<1, 1, 0b1010, 0, 0, 1, "vshll", "u", NEONvshllu>;
4035 // VSHLL : Vector Shift Left Long (with maximum shift count)
4036 class N2VLShMax<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
4037 bit op6, bit op4, string OpcodeStr, string Dt, ValueType ResTy,
4038 ValueType OpTy, SDNode OpNode>
4039 : N2VLSh<op24, op23, op11_8, op7, op6, op4, OpcodeStr, Dt,
4040 ResTy, OpTy, OpNode> {
4041 let Inst{21-16} = op21_16;
4043 def VSHLLi8 : N2VLShMax<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll", "i8",
4044 v8i16, v8i8, NEONvshlli>;
4045 def VSHLLi16 : N2VLShMax<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll", "i16",
4046 v4i32, v4i16, NEONvshlli>;
4047 def VSHLLi32 : N2VLShMax<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll", "i32",
4048 v2i64, v2i32, NEONvshlli>;
4050 // VSHRN : Vector Shift Right and Narrow
4051 defm VSHRN : N2VNSh_HSD<0,1,0b1000,0,0,1, IIC_VSHLiD, "vshrn", "i",
4054 // VRSHL : Vector Rounding Shift
4055 defm VRSHLs : N3VInt_QHSDSh<0, 0, 0b0101, 0, N3RegVShFrm,
4056 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
4057 "vrshl", "s", int_arm_neon_vrshifts>;
4058 defm VRSHLu : N3VInt_QHSDSh<1, 0, 0b0101, 0, N3RegVShFrm,
4059 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
4060 "vrshl", "u", int_arm_neon_vrshiftu>;
4061 // VRSHR : Vector Rounding Shift Right
4062 defm VRSHRs : N2VShR_QHSD<0,1,0b0010,1, IIC_VSHLi4D, "vrshr", "s",NEONvrshrs>;
4063 defm VRSHRu : N2VShR_QHSD<1,1,0b0010,1, IIC_VSHLi4D, "vrshr", "u",NEONvrshru>;
4065 // VRSHRN : Vector Rounding Shift Right and Narrow
4066 defm VRSHRN : N2VNSh_HSD<0, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vrshrn", "i",
4069 // VQSHL : Vector Saturating Shift
4070 defm VQSHLs : N3VInt_QHSDSh<0, 0, 0b0100, 1, N3RegVShFrm,
4071 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
4072 "vqshl", "s", int_arm_neon_vqshifts>;
4073 defm VQSHLu : N3VInt_QHSDSh<1, 0, 0b0100, 1, N3RegVShFrm,
4074 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
4075 "vqshl", "u", int_arm_neon_vqshiftu>;
4076 // VQSHL : Vector Saturating Shift Left (Immediate)
4077 defm VQSHLsi : N2VShL_QHSD<0,1,0b0111,1, IIC_VSHLi4D, "vqshl", "s",NEONvqshls>;
4078 defm VQSHLui : N2VShL_QHSD<1,1,0b0111,1, IIC_VSHLi4D, "vqshl", "u",NEONvqshlu>;
4080 // VQSHLU : Vector Saturating Shift Left (Immediate, Unsigned)
4081 defm VQSHLsu : N2VShL_QHSD<1,1,0b0110,1, IIC_VSHLi4D,"vqshlu","s",NEONvqshlsu>;
4083 // VQSHRN : Vector Saturating Shift Right and Narrow
4084 defm VQSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "s",
4086 defm VQSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "u",
4089 // VQSHRUN : Vector Saturating Shift Right and Narrow (Unsigned)
4090 defm VQSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 0, 1, IIC_VSHLi4D, "vqshrun", "s",
4093 // VQRSHL : Vector Saturating Rounding Shift
4094 defm VQRSHLs : N3VInt_QHSDSh<0, 0, 0b0101, 1, N3RegVShFrm,
4095 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
4096 "vqrshl", "s", int_arm_neon_vqrshifts>;
4097 defm VQRSHLu : N3VInt_QHSDSh<1, 0, 0b0101, 1, N3RegVShFrm,
4098 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
4099 "vqrshl", "u", int_arm_neon_vqrshiftu>;
4101 // VQRSHRN : Vector Saturating Rounding Shift Right and Narrow
4102 defm VQRSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "s",
4104 defm VQRSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "u",
4107 // VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned)
4108 defm VQRSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vqrshrun", "s",
4111 // VSRA : Vector Shift Right and Accumulate
4112 defm VSRAs : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra", "s", NEONvshrs>;
4113 defm VSRAu : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra", "u", NEONvshru>;
4114 // VRSRA : Vector Rounding Shift Right and Accumulate
4115 defm VRSRAs : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra", "s", NEONvrshrs>;
4116 defm VRSRAu : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra", "u", NEONvrshru>;
4118 // VSLI : Vector Shift Left and Insert
4119 defm VSLI : N2VShInsL_QHSD<1, 1, 0b0101, 1, "vsli">;
4121 // VSRI : Vector Shift Right and Insert
4122 defm VSRI : N2VShInsR_QHSD<1, 1, 0b0100, 1, "vsri">;
4124 // Vector Absolute and Saturating Absolute.
4126 // VABS : Vector Absolute Value
4127 defm VABS : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0,
4128 IIC_VUNAiD, IIC_VUNAiQ, "vabs", "s",
4130 def VABSfd : N2VDInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
4131 IIC_VUNAD, "vabs", "f32",
4132 v2f32, v2f32, int_arm_neon_vabs>;
4133 def VABSfq : N2VQInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
4134 IIC_VUNAQ, "vabs", "f32",
4135 v4f32, v4f32, int_arm_neon_vabs>;
4137 // VQABS : Vector Saturating Absolute Value
4138 defm VQABS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0,
4139 IIC_VQUNAiD, IIC_VQUNAiQ, "vqabs", "s",
4140 int_arm_neon_vqabs>;
4144 def vnegd : PatFrag<(ops node:$in),
4145 (sub (bitconvert (v2i32 NEONimmAllZerosV)), node:$in)>;
4146 def vnegq : PatFrag<(ops node:$in),
4147 (sub (bitconvert (v4i32 NEONimmAllZerosV)), node:$in)>;
4149 class VNEGD<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
4150 : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$Vd), (ins DPR:$Vm),
4151 IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
4152 [(set DPR:$Vd, (Ty (vnegd DPR:$Vm)))]>;
4153 class VNEGQ<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
4154 : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$Vd), (ins QPR:$Vm),
4155 IIC_VSHLiQ, OpcodeStr, Dt, "$Vd, $Vm", "",
4156 [(set QPR:$Vd, (Ty (vnegq QPR:$Vm)))]>;
4158 // VNEG : Vector Negate (integer)
4159 def VNEGs8d : VNEGD<0b00, "vneg", "s8", v8i8>;
4160 def VNEGs16d : VNEGD<0b01, "vneg", "s16", v4i16>;
4161 def VNEGs32d : VNEGD<0b10, "vneg", "s32", v2i32>;
4162 def VNEGs8q : VNEGQ<0b00, "vneg", "s8", v16i8>;
4163 def VNEGs16q : VNEGQ<0b01, "vneg", "s16", v8i16>;
4164 def VNEGs32q : VNEGQ<0b10, "vneg", "s32", v4i32>;
4166 // VNEG : Vector Negate (floating-point)
4167 def VNEGfd : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
4168 (outs DPR:$Vd), (ins DPR:$Vm), IIC_VUNAD,
4169 "vneg", "f32", "$Vd, $Vm", "",
4170 [(set DPR:$Vd, (v2f32 (fneg DPR:$Vm)))]>;
4171 def VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0,
4172 (outs QPR:$Vd), (ins QPR:$Vm), IIC_VUNAQ,
4173 "vneg", "f32", "$Vd, $Vm", "",
4174 [(set QPR:$Vd, (v4f32 (fneg QPR:$Vm)))]>;
4176 def : Pat<(v8i8 (vnegd DPR:$src)), (VNEGs8d DPR:$src)>;
4177 def : Pat<(v4i16 (vnegd DPR:$src)), (VNEGs16d DPR:$src)>;
4178 def : Pat<(v2i32 (vnegd DPR:$src)), (VNEGs32d DPR:$src)>;
4179 def : Pat<(v16i8 (vnegq QPR:$src)), (VNEGs8q QPR:$src)>;
4180 def : Pat<(v8i16 (vnegq QPR:$src)), (VNEGs16q QPR:$src)>;
4181 def : Pat<(v4i32 (vnegq QPR:$src)), (VNEGs32q QPR:$src)>;
4183 // VQNEG : Vector Saturating Negate
4184 defm VQNEG : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0,
4185 IIC_VQUNAiD, IIC_VQUNAiQ, "vqneg", "s",
4186 int_arm_neon_vqneg>;
4188 // Vector Bit Counting Operations.
4190 // VCLS : Vector Count Leading Sign Bits
4191 defm VCLS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0,
4192 IIC_VCNTiD, IIC_VCNTiQ, "vcls", "s",
4194 // VCLZ : Vector Count Leading Zeros
4195 defm VCLZ : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0,
4196 IIC_VCNTiD, IIC_VCNTiQ, "vclz", "i",
4198 // VCNT : Vector Count One Bits
4199 def VCNTd : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
4200 IIC_VCNTiD, "vcnt", "8",
4201 v8i8, v8i8, int_arm_neon_vcnt>;
4202 def VCNTq : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
4203 IIC_VCNTiQ, "vcnt", "8",
4204 v16i8, v16i8, int_arm_neon_vcnt>;
4206 // Vector Swap -- for disassembly only.
4207 def VSWPd : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 0, 0,
4208 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
4209 "vswp", "$Vd, $Vm", "", []>;
4210 def VSWPq : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 1, 0,
4211 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
4212 "vswp", "$Vd, $Vm", "", []>;
4214 // Vector Move Operations.
4216 // VMOV : Vector Move (Register)
4218 let neverHasSideEffects = 1 in {
4219 def VMOVDneon: N3VX<0, 0, 0b10, 0b0001, 0, 1, (outs DPR:$Vd), (ins DPR:$Vm),
4220 N3RegFrm, IIC_VMOV, "vmov", "$Vd, $Vm", "", []> {
4221 let Vn{4-0} = Vm{4-0};
4223 def VMOVQ : N3VX<0, 0, 0b10, 0b0001, 1, 1, (outs QPR:$Vd), (ins QPR:$Vm),
4224 N3RegFrm, IIC_VMOV, "vmov", "$Vd, $Vm", "", []> {
4225 let Vn{4-0} = Vm{4-0};
4228 // Pseudo vector move instructions for QQ and QQQQ registers. This should
4229 // be expanded after register allocation is completed.
4230 def VMOVQQ : PseudoInst<(outs QQPR:$dst), (ins QQPR:$src),
4233 def VMOVQQQQ : PseudoInst<(outs QQQQPR:$dst), (ins QQQQPR:$src),
4235 } // neverHasSideEffects
4237 // VMOV : Vector Move (Immediate)
4239 let isReMaterializable = 1 in {
4240 def VMOVv8i8 : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$Vd),
4241 (ins nModImm:$SIMM), IIC_VMOVImm,
4242 "vmov", "i8", "$Vd, $SIMM", "",
4243 [(set DPR:$Vd, (v8i8 (NEONvmovImm timm:$SIMM)))]>;
4244 def VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$Vd),
4245 (ins nModImm:$SIMM), IIC_VMOVImm,
4246 "vmov", "i8", "$Vd, $SIMM", "",
4247 [(set QPR:$Vd, (v16i8 (NEONvmovImm timm:$SIMM)))]>;
4249 def VMOVv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 0, 1, (outs DPR:$Vd),
4250 (ins nModImm:$SIMM), IIC_VMOVImm,
4251 "vmov", "i16", "$Vd, $SIMM", "",
4252 [(set DPR:$Vd, (v4i16 (NEONvmovImm timm:$SIMM)))]> {
4253 let Inst{9} = SIMM{9};
4256 def VMOVv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 0, 1, (outs QPR:$Vd),
4257 (ins nModImm:$SIMM), IIC_VMOVImm,
4258 "vmov", "i16", "$Vd, $SIMM", "",
4259 [(set QPR:$Vd, (v8i16 (NEONvmovImm timm:$SIMM)))]> {
4260 let Inst{9} = SIMM{9};
4263 def VMOVv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 0, 1, (outs DPR:$Vd),
4264 (ins nModImm:$SIMM), IIC_VMOVImm,
4265 "vmov", "i32", "$Vd, $SIMM", "",
4266 [(set DPR:$Vd, (v2i32 (NEONvmovImm timm:$SIMM)))]> {
4267 let Inst{11-8} = SIMM{11-8};
4270 def VMOVv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 0, 1, (outs QPR:$Vd),
4271 (ins nModImm:$SIMM), IIC_VMOVImm,
4272 "vmov", "i32", "$Vd, $SIMM", "",
4273 [(set QPR:$Vd, (v4i32 (NEONvmovImm timm:$SIMM)))]> {
4274 let Inst{11-8} = SIMM{11-8};
4277 def VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$Vd),
4278 (ins nModImm:$SIMM), IIC_VMOVImm,
4279 "vmov", "i64", "$Vd, $SIMM", "",
4280 [(set DPR:$Vd, (v1i64 (NEONvmovImm timm:$SIMM)))]>;
4281 def VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$Vd),
4282 (ins nModImm:$SIMM), IIC_VMOVImm,
4283 "vmov", "i64", "$Vd, $SIMM", "",
4284 [(set QPR:$Vd, (v2i64 (NEONvmovImm timm:$SIMM)))]>;
4285 } // isReMaterializable
4287 // VMOV : Vector Get Lane (move scalar to ARM core register)
4289 def VGETLNs8 : NVGetLane<{1,1,1,0,0,1,?,1}, 0b1011, {?,?},
4290 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4291 IIC_VMOVSI, "vmov", "s8", "$R, $V[$lane]",
4292 [(set GPR:$R, (NEONvgetlanes (v8i8 DPR:$V),
4294 let Inst{21} = lane{2};
4295 let Inst{6-5} = lane{1-0};
4297 def VGETLNs16 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, {?,1},
4298 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4299 IIC_VMOVSI, "vmov", "s16", "$R, $V[$lane]",
4300 [(set GPR:$R, (NEONvgetlanes (v4i16 DPR:$V),
4302 let Inst{21} = lane{1};
4303 let Inst{6} = lane{0};
4305 def VGETLNu8 : NVGetLane<{1,1,1,0,1,1,?,1}, 0b1011, {?,?},
4306 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4307 IIC_VMOVSI, "vmov", "u8", "$R, $V[$lane]",
4308 [(set GPR:$R, (NEONvgetlaneu (v8i8 DPR:$V),
4310 let Inst{21} = lane{2};
4311 let Inst{6-5} = lane{1-0};
4313 def VGETLNu16 : NVGetLane<{1,1,1,0,1,0,?,1}, 0b1011, {?,1},
4314 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4315 IIC_VMOVSI, "vmov", "u16", "$R, $V[$lane]",
4316 [(set GPR:$R, (NEONvgetlaneu (v4i16 DPR:$V),
4318 let Inst{21} = lane{1};
4319 let Inst{6} = lane{0};
4321 def VGETLNi32 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, 0b00,
4322 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4323 IIC_VMOVSI, "vmov", "32", "$R, $V[$lane]",
4324 [(set GPR:$R, (extractelt (v2i32 DPR:$V),
4326 let Inst{21} = lane{0};
4328 // def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
4329 def : Pat<(NEONvgetlanes (v16i8 QPR:$src), imm:$lane),
4330 (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
4331 (DSubReg_i8_reg imm:$lane))),
4332 (SubReg_i8_lane imm:$lane))>;
4333 def : Pat<(NEONvgetlanes (v8i16 QPR:$src), imm:$lane),
4334 (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
4335 (DSubReg_i16_reg imm:$lane))),
4336 (SubReg_i16_lane imm:$lane))>;
4337 def : Pat<(NEONvgetlaneu (v16i8 QPR:$src), imm:$lane),
4338 (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
4339 (DSubReg_i8_reg imm:$lane))),
4340 (SubReg_i8_lane imm:$lane))>;
4341 def : Pat<(NEONvgetlaneu (v8i16 QPR:$src), imm:$lane),
4342 (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
4343 (DSubReg_i16_reg imm:$lane))),
4344 (SubReg_i16_lane imm:$lane))>;
4345 def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
4346 (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
4347 (DSubReg_i32_reg imm:$lane))),
4348 (SubReg_i32_lane imm:$lane))>;
4349 def : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2),
4350 (EXTRACT_SUBREG (v2f32 (COPY_TO_REGCLASS (v2f32 DPR:$src1),DPR_VFP2)),
4351 (SSubReg_f32_reg imm:$src2))>;
4352 def : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
4353 (EXTRACT_SUBREG (v4f32 (COPY_TO_REGCLASS (v4f32 QPR:$src1),QPR_VFP2)),
4354 (SSubReg_f32_reg imm:$src2))>;
4355 //def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
4356 // (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
4357 def : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
4358 (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
4361 // VMOV : Vector Set Lane (move ARM core register to scalar)
4363 let Constraints = "$src1 = $V" in {
4364 def VSETLNi8 : NVSetLane<{1,1,1,0,0,1,?,0}, 0b1011, {?,?}, (outs DPR:$V),
4365 (ins DPR:$src1, GPR:$R, nohash_imm:$lane),
4366 IIC_VMOVISL, "vmov", "8", "$V[$lane], $R",
4367 [(set DPR:$V, (vector_insert (v8i8 DPR:$src1),
4368 GPR:$R, imm:$lane))]> {
4369 let Inst{21} = lane{2};
4370 let Inst{6-5} = lane{1-0};
4372 def VSETLNi16 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, {?,1}, (outs DPR:$V),
4373 (ins DPR:$src1, GPR:$R, nohash_imm:$lane),
4374 IIC_VMOVISL, "vmov", "16", "$V[$lane], $R",
4375 [(set DPR:$V, (vector_insert (v4i16 DPR:$src1),
4376 GPR:$R, imm:$lane))]> {
4377 let Inst{21} = lane{1};
4378 let Inst{6} = lane{0};
4380 def VSETLNi32 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, 0b00, (outs DPR:$V),
4381 (ins DPR:$src1, GPR:$R, nohash_imm:$lane),
4382 IIC_VMOVISL, "vmov", "32", "$V[$lane], $R",
4383 [(set DPR:$V, (insertelt (v2i32 DPR:$src1),
4384 GPR:$R, imm:$lane))]> {
4385 let Inst{21} = lane{0};
4388 def : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
4389 (v16i8 (INSERT_SUBREG QPR:$src1,
4390 (v8i8 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
4391 (DSubReg_i8_reg imm:$lane))),
4392 GPR:$src2, (SubReg_i8_lane imm:$lane))),
4393 (DSubReg_i8_reg imm:$lane)))>;
4394 def : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
4395 (v8i16 (INSERT_SUBREG QPR:$src1,
4396 (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
4397 (DSubReg_i16_reg imm:$lane))),
4398 GPR:$src2, (SubReg_i16_lane imm:$lane))),
4399 (DSubReg_i16_reg imm:$lane)))>;
4400 def : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
4401 (v4i32 (INSERT_SUBREG QPR:$src1,
4402 (v2i32 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
4403 (DSubReg_i32_reg imm:$lane))),
4404 GPR:$src2, (SubReg_i32_lane imm:$lane))),
4405 (DSubReg_i32_reg imm:$lane)))>;
4407 def : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)),
4408 (INSERT_SUBREG (v2f32 (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2)),
4409 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
4410 def : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
4411 (INSERT_SUBREG (v4f32 (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2)),
4412 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
4414 //def : Pat<(v2i64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
4415 // (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
4416 def : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
4417 (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
4419 def : Pat<(v2f32 (scalar_to_vector SPR:$src)),
4420 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
4421 def : Pat<(v2f64 (scalar_to_vector (f64 DPR:$src))),
4422 (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
4423 def : Pat<(v4f32 (scalar_to_vector SPR:$src)),
4424 (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
4426 def : Pat<(v8i8 (scalar_to_vector GPR:$src)),
4427 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
4428 def : Pat<(v4i16 (scalar_to_vector GPR:$src)),
4429 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
4430 def : Pat<(v2i32 (scalar_to_vector GPR:$src)),
4431 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
4433 def : Pat<(v16i8 (scalar_to_vector GPR:$src)),
4434 (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)),
4435 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
4437 def : Pat<(v8i16 (scalar_to_vector GPR:$src)),
4438 (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)),
4439 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
4441 def : Pat<(v4i32 (scalar_to_vector GPR:$src)),
4442 (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
4443 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
4446 // VDUP : Vector Duplicate (from ARM core register to all elements)
4448 class VDUPD<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
4449 : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$V), (ins GPR:$R),
4450 IIC_VMOVIS, "vdup", Dt, "$V, $R",
4451 [(set DPR:$V, (Ty (NEONvdup (i32 GPR:$R))))]>;
4452 class VDUPQ<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
4453 : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$V), (ins GPR:$R),
4454 IIC_VMOVIS, "vdup", Dt, "$V, $R",
4455 [(set QPR:$V, (Ty (NEONvdup (i32 GPR:$R))))]>;
4457 def VDUP8d : VDUPD<0b11101100, 0b00, "8", v8i8>;
4458 def VDUP16d : VDUPD<0b11101000, 0b01, "16", v4i16>;
4459 def VDUP32d : VDUPD<0b11101000, 0b00, "32", v2i32>;
4460 def VDUP8q : VDUPQ<0b11101110, 0b00, "8", v16i8>;
4461 def VDUP16q : VDUPQ<0b11101010, 0b01, "16", v8i16>;
4462 def VDUP32q : VDUPQ<0b11101010, 0b00, "32", v4i32>;
4464 def : Pat<(v2f32 (NEONvdup (f32 (bitconvert GPR:$R)))), (VDUP32d GPR:$R)>;
4465 def : Pat<(v4f32 (NEONvdup (f32 (bitconvert GPR:$R)))), (VDUP32q GPR:$R)>;
4467 // VDUP : Vector Duplicate Lane (from scalar to all elements)
4469 class VDUPLND<bits<4> op19_16, string OpcodeStr, string Dt,
4471 : NVDupLane<op19_16, 0, (outs DPR:$Vd), (ins DPR:$Vm, nohash_imm:$lane),
4472 IIC_VMOVD, OpcodeStr, Dt, "$Vd, $Vm[$lane]",
4473 [(set DPR:$Vd, (Ty (NEONvduplane (Ty DPR:$Vm), imm:$lane)))]>;
4475 class VDUPLNQ<bits<4> op19_16, string OpcodeStr, string Dt,
4476 ValueType ResTy, ValueType OpTy>
4477 : NVDupLane<op19_16, 1, (outs QPR:$Vd), (ins DPR:$Vm, nohash_imm:$lane),
4478 IIC_VMOVQ, OpcodeStr, Dt, "$Vd, $Vm[$lane]",
4479 [(set QPR:$Vd, (ResTy (NEONvduplane (OpTy DPR:$Vm),
4482 // Inst{19-16} is partially specified depending on the element size.
4484 def VDUPLN8d : VDUPLND<{?,?,?,1}, "vdup", "8", v8i8> {
4485 let Inst{19-17} = lane{2-0};
4487 def VDUPLN16d : VDUPLND<{?,?,1,0}, "vdup", "16", v4i16> {
4488 let Inst{19-18} = lane{1-0};
4490 def VDUPLN32d : VDUPLND<{?,1,0,0}, "vdup", "32", v2i32> {
4491 let Inst{19} = lane{0};
4493 def VDUPLN8q : VDUPLNQ<{?,?,?,1}, "vdup", "8", v16i8, v8i8> {
4494 let Inst{19-17} = lane{2-0};
4496 def VDUPLN16q : VDUPLNQ<{?,?,1,0}, "vdup", "16", v8i16, v4i16> {
4497 let Inst{19-18} = lane{1-0};
4499 def VDUPLN32q : VDUPLNQ<{?,1,0,0}, "vdup", "32", v4i32, v2i32> {
4500 let Inst{19} = lane{0};
4503 def : Pat<(v2f32 (NEONvduplane (v2f32 DPR:$Vm), imm:$lane)),
4504 (VDUPLN32d DPR:$Vm, imm:$lane)>;
4506 def : Pat<(v4f32 (NEONvduplane (v2f32 DPR:$Vm), imm:$lane)),
4507 (VDUPLN32q DPR:$Vm, imm:$lane)>;
4509 def : Pat<(v16i8 (NEONvduplane (v16i8 QPR:$src), imm:$lane)),
4510 (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src,
4511 (DSubReg_i8_reg imm:$lane))),
4512 (SubReg_i8_lane imm:$lane)))>;
4513 def : Pat<(v8i16 (NEONvduplane (v8i16 QPR:$src), imm:$lane)),
4514 (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src,
4515 (DSubReg_i16_reg imm:$lane))),
4516 (SubReg_i16_lane imm:$lane)))>;
4517 def : Pat<(v4i32 (NEONvduplane (v4i32 QPR:$src), imm:$lane)),
4518 (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src,
4519 (DSubReg_i32_reg imm:$lane))),
4520 (SubReg_i32_lane imm:$lane)))>;
4521 def : Pat<(v4f32 (NEONvduplane (v4f32 QPR:$src), imm:$lane)),
4522 (v4f32 (VDUPLN32q (v2f32 (EXTRACT_SUBREG QPR:$src,
4523 (DSubReg_i32_reg imm:$lane))),
4524 (SubReg_i32_lane imm:$lane)))>;
4526 def VDUPfdf : PseudoNeonI<(outs DPR:$dst), (ins SPR:$src), IIC_VMOVD, "",
4527 [(set DPR:$dst, (v2f32 (NEONvdup (f32 SPR:$src))))]>;
4528 def VDUPfqf : PseudoNeonI<(outs QPR:$dst), (ins SPR:$src), IIC_VMOVD, "",
4529 [(set QPR:$dst, (v4f32 (NEONvdup (f32 SPR:$src))))]>;
4531 // VMOVN : Vector Narrowing Move
4532 defm VMOVN : N2VN_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVN,
4533 "vmovn", "i", trunc>;
4534 // VQMOVN : Vector Saturating Narrowing Move
4535 defm VQMOVNs : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD,
4536 "vqmovn", "s", int_arm_neon_vqmovns>;
4537 defm VQMOVNu : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD,
4538 "vqmovn", "u", int_arm_neon_vqmovnu>;
4539 defm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD,
4540 "vqmovun", "s", int_arm_neon_vqmovnsu>;
4541 // VMOVL : Vector Lengthening Move
4542 defm VMOVLs : N2VL_QHS<0b01,0b10100,0,1, "vmovl", "s", sext>;
4543 defm VMOVLu : N2VL_QHS<0b11,0b10100,0,1, "vmovl", "u", zext>;
4545 // Vector Conversions.
4547 // VCVT : Vector Convert Between Floating-Point and Integers
4548 def VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
4549 v2i32, v2f32, fp_to_sint>;
4550 def VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
4551 v2i32, v2f32, fp_to_uint>;
4552 def VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
4553 v2f32, v2i32, sint_to_fp>;
4554 def VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
4555 v2f32, v2i32, uint_to_fp>;
4557 def VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
4558 v4i32, v4f32, fp_to_sint>;
4559 def VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
4560 v4i32, v4f32, fp_to_uint>;
4561 def VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
4562 v4f32, v4i32, sint_to_fp>;
4563 def VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
4564 v4f32, v4i32, uint_to_fp>;
4566 // VCVT : Vector Convert Between Floating-Point and Fixed-Point.
4567 def VCVTf2xsd : N2VCvtD<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
4568 v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
4569 def VCVTf2xud : N2VCvtD<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
4570 v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
4571 def VCVTxs2fd : N2VCvtD<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
4572 v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
4573 def VCVTxu2fd : N2VCvtD<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
4574 v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
4576 def VCVTf2xsq : N2VCvtQ<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
4577 v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
4578 def VCVTf2xuq : N2VCvtQ<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
4579 v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
4580 def VCVTxs2fq : N2VCvtQ<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
4581 v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
4582 def VCVTxu2fq : N2VCvtQ<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
4583 v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
4585 // VCVT : Vector Convert Between Half-Precision and Single-Precision.
4586 def VCVTf2h : N2VNInt<0b11, 0b11, 0b01, 0b10, 0b01100, 0, 0,
4587 IIC_VUNAQ, "vcvt", "f16.f32",
4588 v4i16, v4f32, int_arm_neon_vcvtfp2hf>,
4589 Requires<[HasNEON, HasFP16]>;
4590 def VCVTh2f : N2VLInt<0b11, 0b11, 0b01, 0b10, 0b01110, 0, 0,
4591 IIC_VUNAQ, "vcvt", "f32.f16",
4592 v4f32, v4i16, int_arm_neon_vcvthf2fp>,
4593 Requires<[HasNEON, HasFP16]>;
4597 // VREV64 : Vector Reverse elements within 64-bit doublewords
4599 class VREV64D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4600 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$Vd),
4601 (ins DPR:$Vm), IIC_VMOVD,
4602 OpcodeStr, Dt, "$Vd, $Vm", "",
4603 [(set DPR:$Vd, (Ty (NEONvrev64 (Ty DPR:$Vm))))]>;
4604 class VREV64Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4605 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$Vd),
4606 (ins QPR:$Vm), IIC_VMOVQ,
4607 OpcodeStr, Dt, "$Vd, $Vm", "",
4608 [(set QPR:$Vd, (Ty (NEONvrev64 (Ty QPR:$Vm))))]>;
4610 def VREV64d8 : VREV64D<0b00, "vrev64", "8", v8i8>;
4611 def VREV64d16 : VREV64D<0b01, "vrev64", "16", v4i16>;
4612 def VREV64d32 : VREV64D<0b10, "vrev64", "32", v2i32>;
4613 def : Pat<(v2f32 (NEONvrev64 (v2f32 DPR:$Vm))), (VREV64d32 DPR:$Vm)>;
4615 def VREV64q8 : VREV64Q<0b00, "vrev64", "8", v16i8>;
4616 def VREV64q16 : VREV64Q<0b01, "vrev64", "16", v8i16>;
4617 def VREV64q32 : VREV64Q<0b10, "vrev64", "32", v4i32>;
4618 def : Pat<(v4f32 (NEONvrev64 (v4f32 QPR:$Vm))), (VREV64q32 QPR:$Vm)>;
4620 // VREV32 : Vector Reverse elements within 32-bit words
4622 class VREV32D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4623 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$Vd),
4624 (ins DPR:$Vm), IIC_VMOVD,
4625 OpcodeStr, Dt, "$Vd, $Vm", "",
4626 [(set DPR:$Vd, (Ty (NEONvrev32 (Ty DPR:$Vm))))]>;
4627 class VREV32Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4628 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$Vd),
4629 (ins QPR:$Vm), IIC_VMOVQ,
4630 OpcodeStr, Dt, "$Vd, $Vm", "",
4631 [(set QPR:$Vd, (Ty (NEONvrev32 (Ty QPR:$Vm))))]>;
4633 def VREV32d8 : VREV32D<0b00, "vrev32", "8", v8i8>;
4634 def VREV32d16 : VREV32D<0b01, "vrev32", "16", v4i16>;
4636 def VREV32q8 : VREV32Q<0b00, "vrev32", "8", v16i8>;
4637 def VREV32q16 : VREV32Q<0b01, "vrev32", "16", v8i16>;
4639 // VREV16 : Vector Reverse elements within 16-bit halfwords
4641 class VREV16D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4642 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$Vd),
4643 (ins DPR:$Vm), IIC_VMOVD,
4644 OpcodeStr, Dt, "$Vd, $Vm", "",
4645 [(set DPR:$Vd, (Ty (NEONvrev16 (Ty DPR:$Vm))))]>;
4646 class VREV16Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4647 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$Vd),
4648 (ins QPR:$Vm), IIC_VMOVQ,
4649 OpcodeStr, Dt, "$Vd, $Vm", "",
4650 [(set QPR:$Vd, (Ty (NEONvrev16 (Ty QPR:$Vm))))]>;
4652 def VREV16d8 : VREV16D<0b00, "vrev16", "8", v8i8>;
4653 def VREV16q8 : VREV16Q<0b00, "vrev16", "8", v16i8>;
4655 // Other Vector Shuffles.
4657 // Aligned extractions: really just dropping registers
4659 class AlignedVEXTq<ValueType DestTy, ValueType SrcTy, SDNodeXForm LaneCVT>
4660 : Pat<(DestTy (vector_extract_subvec (SrcTy QPR:$src), (i32 imm:$start))),
4661 (EXTRACT_SUBREG (SrcTy QPR:$src), (LaneCVT imm:$start))>;
4663 def : AlignedVEXTq<v8i8, v16i8, DSubReg_i8_reg>;
4665 def : AlignedVEXTq<v4i16, v8i16, DSubReg_i16_reg>;
4667 def : AlignedVEXTq<v2i32, v4i32, DSubReg_i32_reg>;
4669 def : AlignedVEXTq<v1i64, v2i64, DSubReg_f64_reg>;
4671 def : AlignedVEXTq<v2f32, v4f32, DSubReg_i32_reg>;
4674 // VEXT : Vector Extract
4676 class VEXTd<string OpcodeStr, string Dt, ValueType Ty>
4677 : N3V<0,1,0b11,{?,?,?,?},0,0, (outs DPR:$Vd),
4678 (ins DPR:$Vn, DPR:$Vm, i32imm:$index), NVExtFrm,
4679 IIC_VEXTD, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
4680 [(set DPR:$Vd, (Ty (NEONvext (Ty DPR:$Vn),
4681 (Ty DPR:$Vm), imm:$index)))]> {
4683 let Inst{11-8} = index{3-0};
4686 class VEXTq<string OpcodeStr, string Dt, ValueType Ty>
4687 : N3V<0,1,0b11,{?,?,?,?},1,0, (outs QPR:$Vd),
4688 (ins QPR:$Vn, QPR:$Vm, i32imm:$index), NVExtFrm,
4689 IIC_VEXTQ, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
4690 [(set QPR:$Vd, (Ty (NEONvext (Ty QPR:$Vn),
4691 (Ty QPR:$Vm), imm:$index)))]> {
4693 let Inst{11-8} = index{3-0};
4696 def VEXTd8 : VEXTd<"vext", "8", v8i8> {
4697 let Inst{11-8} = index{3-0};
4699 def VEXTd16 : VEXTd<"vext", "16", v4i16> {
4700 let Inst{11-9} = index{2-0};
4703 def VEXTd32 : VEXTd<"vext", "32", v2i32> {
4704 let Inst{11-10} = index{1-0};
4705 let Inst{9-8} = 0b00;
4707 def VEXTdf : VEXTd<"vext", "32", v2f32> {
4708 let Inst{11-10} = index{1-0};
4709 let Inst{9-8} = 0b00;
4713 def VEXTq8 : VEXTq<"vext", "8", v16i8> {
4714 let Inst{11-8} = index{3-0};
4716 def VEXTq16 : VEXTq<"vext", "16", v8i16> {
4717 let Inst{11-9} = index{2-0};
4720 def VEXTq32 : VEXTq<"vext", "32", v4i32> {
4721 let Inst{11-10} = index{1-0};
4722 let Inst{9-8} = 0b00;
4724 def VEXTqf : VEXTq<"vext", "32", v4f32> {
4725 let Inst{11-10} = index{1-0};
4726 let Inst{9-8} = 0b00;
4729 // VTRN : Vector Transpose
4731 def VTRNd8 : N2VDShuffle<0b00, 0b00001, "vtrn", "8">;
4732 def VTRNd16 : N2VDShuffle<0b01, 0b00001, "vtrn", "16">;
4733 def VTRNd32 : N2VDShuffle<0b10, 0b00001, "vtrn", "32">;
4735 def VTRNq8 : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn", "8">;
4736 def VTRNq16 : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn", "16">;
4737 def VTRNq32 : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn", "32">;
4739 // VUZP : Vector Unzip (Deinterleave)
4741 def VUZPd8 : N2VDShuffle<0b00, 0b00010, "vuzp", "8">;
4742 def VUZPd16 : N2VDShuffle<0b01, 0b00010, "vuzp", "16">;
4743 def VUZPd32 : N2VDShuffle<0b10, 0b00010, "vuzp", "32">;
4745 def VUZPq8 : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp", "8">;
4746 def VUZPq16 : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp", "16">;
4747 def VUZPq32 : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp", "32">;
4749 // VZIP : Vector Zip (Interleave)
4751 def VZIPd8 : N2VDShuffle<0b00, 0b00011, "vzip", "8">;
4752 def VZIPd16 : N2VDShuffle<0b01, 0b00011, "vzip", "16">;
4753 def VZIPd32 : N2VDShuffle<0b10, 0b00011, "vzip", "32">;
4755 def VZIPq8 : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip", "8">;
4756 def VZIPq16 : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip", "16">;
4757 def VZIPq32 : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip", "32">;
4759 // Vector Table Lookup and Table Extension.
4761 // VTBL : Vector Table Lookup
4763 : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$Vd),
4764 (ins DPR:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB1,
4765 "vtbl", "8", "$Vd, \\{$Vn\\}, $Vm", "",
4766 [(set DPR:$Vd, (v8i8 (int_arm_neon_vtbl1 DPR:$Vn, DPR:$Vm)))]>;
4767 let hasExtraSrcRegAllocReq = 1 in {
4769 : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$Vd),
4770 (ins DPR:$Vn, DPR:$tbl2, DPR:$Vm), NVTBLFrm, IIC_VTB2,
4771 "vtbl", "8", "$Vd, \\{$Vn, $tbl2\\}, $Vm", "", []>;
4773 : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$Vd),
4774 (ins DPR:$Vn, DPR:$tbl2, DPR:$tbl3, DPR:$Vm), NVTBLFrm, IIC_VTB3,
4775 "vtbl", "8", "$Vd, \\{$Vn, $tbl2, $tbl3\\}, $Vm", "", []>;
4777 : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$Vd),
4778 (ins DPR:$Vn, DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$Vm),
4780 "vtbl", "8", "$Vd, \\{$Vn, $tbl2, $tbl3, $tbl4\\}, $Vm", "", []>;
4781 } // hasExtraSrcRegAllocReq = 1
4784 : PseudoNeonI<(outs DPR:$dst), (ins QPR:$tbl, DPR:$src), IIC_VTB2, "", []>;
4786 : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB3, "", []>;
4788 : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB4, "", []>;
4790 // VTBX : Vector Table Extension
4792 : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$Vd),
4793 (ins DPR:$orig, DPR:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX1,
4794 "vtbx", "8", "$Vd, \\{$Vn\\}, $Vm", "$orig = $Vd",
4795 [(set DPR:$Vd, (v8i8 (int_arm_neon_vtbx1
4796 DPR:$orig, DPR:$Vn, DPR:$Vm)))]>;
4797 let hasExtraSrcRegAllocReq = 1 in {
4799 : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$Vd),
4800 (ins DPR:$orig, DPR:$Vn, DPR:$tbl2, DPR:$Vm), NVTBLFrm, IIC_VTBX2,
4801 "vtbx", "8", "$Vd, \\{$Vn, $tbl2\\}, $Vm", "$orig = $Vd", []>;
4803 : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$Vd),
4804 (ins DPR:$orig, DPR:$Vn, DPR:$tbl2, DPR:$tbl3, DPR:$Vm),
4805 NVTBLFrm, IIC_VTBX3,
4806 "vtbx", "8", "$Vd, \\{$Vn, $tbl2, $tbl3\\}, $Vm",
4809 : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$Vd), (ins DPR:$orig, DPR:$Vn,
4810 DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$Vm), NVTBLFrm, IIC_VTBX4,
4811 "vtbx", "8", "$Vd, \\{$Vn, $tbl2, $tbl3, $tbl4\\}, $Vm",
4813 } // hasExtraSrcRegAllocReq = 1
4816 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QPR:$tbl, DPR:$src),
4817 IIC_VTBX2, "$orig = $dst", []>;
4819 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
4820 IIC_VTBX3, "$orig = $dst", []>;
4822 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
4823 IIC_VTBX4, "$orig = $dst", []>;
4825 //===----------------------------------------------------------------------===//
4826 // NEON instructions for single-precision FP math
4827 //===----------------------------------------------------------------------===//
4829 class N2VSPat<SDNode OpNode, NeonI Inst>
4830 : NEONFPPat<(f32 (OpNode SPR:$a)),
4832 (v2f32 (COPY_TO_REGCLASS (Inst
4834 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
4835 SPR:$a, ssub_0)), DPR_VFP2)), ssub_0)>;
4837 class N3VSPat<SDNode OpNode, NeonI Inst>
4838 : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
4840 (v2f32 (COPY_TO_REGCLASS (Inst
4842 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
4845 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
4846 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
4848 class N3VSMulOpPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
4849 : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
4851 (v2f32 (COPY_TO_REGCLASS (Inst
4853 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
4856 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
4859 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
4860 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
4862 def : N3VSPat<fadd, VADDfd>;
4863 def : N3VSPat<fsub, VSUBfd>;
4864 def : N3VSPat<fmul, VMULfd>;
4865 def : N3VSMulOpPat<fmul, fadd, VMLAfd>,
4866 Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
4867 def : N3VSMulOpPat<fmul, fsub, VMLSfd>,
4868 Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
4869 def : N2VSPat<fabs, VABSfd>;
4870 def : N2VSPat<fneg, VNEGfd>;
4871 def : N3VSPat<NEONfmax, VMAXfd>;
4872 def : N3VSPat<NEONfmin, VMINfd>;
4873 def : N2VSPat<arm_ftosi, VCVTf2sd>;
4874 def : N2VSPat<arm_ftoui, VCVTf2ud>;
4875 def : N2VSPat<arm_sitof, VCVTs2fd>;
4876 def : N2VSPat<arm_uitof, VCVTu2fd>;
4878 //===----------------------------------------------------------------------===//
4879 // Non-Instruction Patterns
4880 //===----------------------------------------------------------------------===//
4883 def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
4884 def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
4885 def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (v1i64 DPR:$src)>;
4886 def : Pat<(v1i64 (bitconvert (f64 DPR:$src))), (v1i64 DPR:$src)>;
4887 def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
4888 def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
4889 def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
4890 def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (v2i32 DPR:$src)>;
4891 def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (v2i32 DPR:$src)>;
4892 def : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
4893 def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
4894 def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
4895 def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (v4i16 DPR:$src)>;
4896 def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (v4i16 DPR:$src)>;
4897 def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
4898 def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (v8i8 DPR:$src)>;
4899 def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (v8i8 DPR:$src)>;
4900 def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (v8i8 DPR:$src)>;
4901 def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (v8i8 DPR:$src)>;
4902 def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (v8i8 DPR:$src)>;
4903 def : Pat<(f64 (bitconvert (v1i64 DPR:$src))), (f64 DPR:$src)>;
4904 def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (f64 DPR:$src)>;
4905 def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (f64 DPR:$src)>;
4906 def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (f64 DPR:$src)>;
4907 def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (f64 DPR:$src)>;
4908 def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (v2f32 DPR:$src)>;
4909 def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
4910 def : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
4911 def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
4912 def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (v2f32 DPR:$src)>;
4914 def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
4915 def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
4916 def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
4917 def : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
4918 def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
4919 def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
4920 def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
4921 def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
4922 def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
4923 def : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
4924 def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
4925 def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
4926 def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
4927 def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
4928 def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
4929 def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
4930 def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
4931 def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
4932 def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
4933 def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
4934 def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
4935 def : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
4936 def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
4937 def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
4938 def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
4939 def : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
4940 def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
4941 def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
4942 def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
4943 def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;