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,
180 class VLDQQQQWBPseudo<InstrItinClass itin>
181 : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
182 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
183 "$addr.addr = $wb, $src = $dst">;
185 let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
187 // VLD1 : Vector Load (multiple single elements)
188 class VLD1D<bits<4> op7_4, string Dt>
189 : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$Vd),
190 (ins addrmode6:$Rn), IIC_VLD1,
191 "vld1", Dt, "\\{$Vd\\}, $Rn", "", []> {
195 class VLD1Q<bits<4> op7_4, string Dt>
196 : NLdSt<0,0b10,0b1010,op7_4, (outs DPR:$Vd, DPR:$dst2),
197 (ins addrmode6:$Rn), IIC_VLD1x2,
198 "vld1", Dt, "\\{$Vd, $dst2\\}, $Rn", "", []> {
200 let Inst{5-4} = Rn{5-4};
203 def VLD1d8 : VLD1D<{0,0,0,?}, "8">;
204 def VLD1d16 : VLD1D<{0,1,0,?}, "16">;
205 def VLD1d32 : VLD1D<{1,0,0,?}, "32">;
206 def VLD1d64 : VLD1D<{1,1,0,?}, "64">;
208 def VLD1q8 : VLD1Q<{0,0,?,?}, "8">;
209 def VLD1q16 : VLD1Q<{0,1,?,?}, "16">;
210 def VLD1q32 : VLD1Q<{1,0,?,?}, "32">;
211 def VLD1q64 : VLD1Q<{1,1,?,?}, "64">;
213 def VLD1q8Pseudo : VLDQPseudo<IIC_VLD1x2>;
214 def VLD1q16Pseudo : VLDQPseudo<IIC_VLD1x2>;
215 def VLD1q32Pseudo : VLDQPseudo<IIC_VLD1x2>;
216 def VLD1q64Pseudo : VLDQPseudo<IIC_VLD1x2>;
218 // ...with address register writeback:
219 class VLD1DWB<bits<4> op7_4, string Dt>
220 : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$Vd, GPR:$wb),
221 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1u,
222 "vld1", Dt, "\\{$Vd\\}, $Rn$Rm",
223 "$Rn.addr = $wb", []> {
226 class VLD1QWB<bits<4> op7_4, string Dt>
227 : NLdSt<0,0b10,0b1010,op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
228 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1x2u,
229 "vld1", Dt, "\\{$Vd, $dst2\\}, $Rn$Rm",
230 "$Rn.addr = $wb", []> {
231 let Inst{5-4} = Rn{5-4};
234 def VLD1d8_UPD : VLD1DWB<{0,0,0,?}, "8">;
235 def VLD1d16_UPD : VLD1DWB<{0,1,0,?}, "16">;
236 def VLD1d32_UPD : VLD1DWB<{1,0,0,?}, "32">;
237 def VLD1d64_UPD : VLD1DWB<{1,1,0,?}, "64">;
239 def VLD1q8_UPD : VLD1QWB<{0,0,?,?}, "8">;
240 def VLD1q16_UPD : VLD1QWB<{0,1,?,?}, "16">;
241 def VLD1q32_UPD : VLD1QWB<{1,0,?,?}, "32">;
242 def VLD1q64_UPD : VLD1QWB<{1,1,?,?}, "64">;
244 def VLD1q8Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
245 def VLD1q16Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
246 def VLD1q32Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
247 def VLD1q64Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
249 // ...with 3 registers (some of these are only for the disassembler):
250 class VLD1D3<bits<4> op7_4, string Dt>
251 : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
252 (ins addrmode6:$Rn), IIC_VLD1x3, "vld1", Dt,
253 "\\{$Vd, $dst2, $dst3\\}, $Rn", "", []> {
257 class VLD1D3WB<bits<4> op7_4, string Dt>
258 : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
259 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1x3u, "vld1", Dt,
260 "\\{$Vd, $dst2, $dst3\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
264 def VLD1d8T : VLD1D3<{0,0,0,?}, "8">;
265 def VLD1d16T : VLD1D3<{0,1,0,?}, "16">;
266 def VLD1d32T : VLD1D3<{1,0,0,?}, "32">;
267 def VLD1d64T : VLD1D3<{1,1,0,?}, "64">;
269 def VLD1d8T_UPD : VLD1D3WB<{0,0,0,?}, "8">;
270 def VLD1d16T_UPD : VLD1D3WB<{0,1,0,?}, "16">;
271 def VLD1d32T_UPD : VLD1D3WB<{1,0,0,?}, "32">;
272 def VLD1d64T_UPD : VLD1D3WB<{1,1,0,?}, "64">;
274 def VLD1d64TPseudo : VLDQQPseudo<IIC_VLD1x3>;
275 def VLD1d64TPseudo_UPD : VLDQQWBPseudo<IIC_VLD1x3u>;
277 // ...with 4 registers (some of these are only for the disassembler):
278 class VLD1D4<bits<4> op7_4, string Dt>
279 : NLdSt<0,0b10,0b0010,op7_4,(outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
280 (ins addrmode6:$Rn), IIC_VLD1x4, "vld1", Dt,
281 "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []> {
283 let Inst{5-4} = Rn{5-4};
285 class VLD1D4WB<bits<4> op7_4, string Dt>
286 : NLdSt<0,0b10,0b0010,op7_4,
287 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
288 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1x4u, "vld1", Dt,
289 "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm", "$Rn.addr = $wb",
291 let Inst{5-4} = Rn{5-4};
294 def VLD1d8Q : VLD1D4<{0,0,?,?}, "8">;
295 def VLD1d16Q : VLD1D4<{0,1,?,?}, "16">;
296 def VLD1d32Q : VLD1D4<{1,0,?,?}, "32">;
297 def VLD1d64Q : VLD1D4<{1,1,?,?}, "64">;
299 def VLD1d8Q_UPD : VLD1D4WB<{0,0,?,?}, "8">;
300 def VLD1d16Q_UPD : VLD1D4WB<{0,1,?,?}, "16">;
301 def VLD1d32Q_UPD : VLD1D4WB<{1,0,?,?}, "32">;
302 def VLD1d64Q_UPD : VLD1D4WB<{1,1,?,?}, "64">;
304 def VLD1d64QPseudo : VLDQQPseudo<IIC_VLD1x4>;
305 def VLD1d64QPseudo_UPD : VLDQQWBPseudo<IIC_VLD1x4u>;
307 // VLD2 : Vector Load (multiple 2-element structures)
308 class VLD2D<bits<4> op11_8, bits<4> op7_4, string Dt>
309 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2),
310 (ins addrmode6:$Rn), IIC_VLD2,
311 "vld2", Dt, "\\{$Vd, $dst2\\}, $Rn", "", []> {
313 let Inst{5-4} = Rn{5-4};
315 class VLD2Q<bits<4> op7_4, string Dt>
316 : NLdSt<0, 0b10, 0b0011, op7_4,
317 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
318 (ins addrmode6:$Rn), IIC_VLD2x2,
319 "vld2", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []> {
321 let Inst{5-4} = Rn{5-4};
324 def VLD2d8 : VLD2D<0b1000, {0,0,?,?}, "8">;
325 def VLD2d16 : VLD2D<0b1000, {0,1,?,?}, "16">;
326 def VLD2d32 : VLD2D<0b1000, {1,0,?,?}, "32">;
328 def VLD2q8 : VLD2Q<{0,0,?,?}, "8">;
329 def VLD2q16 : VLD2Q<{0,1,?,?}, "16">;
330 def VLD2q32 : VLD2Q<{1,0,?,?}, "32">;
332 def VLD2d8Pseudo : VLDQPseudo<IIC_VLD2>;
333 def VLD2d16Pseudo : VLDQPseudo<IIC_VLD2>;
334 def VLD2d32Pseudo : VLDQPseudo<IIC_VLD2>;
336 def VLD2q8Pseudo : VLDQQPseudo<IIC_VLD2x2>;
337 def VLD2q16Pseudo : VLDQQPseudo<IIC_VLD2x2>;
338 def VLD2q32Pseudo : VLDQQPseudo<IIC_VLD2x2>;
340 // ...with address register writeback:
341 class VLD2DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
342 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
343 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD2u,
344 "vld2", Dt, "\\{$Vd, $dst2\\}, $Rn$Rm",
345 "$Rn.addr = $wb", []> {
346 let Inst{5-4} = Rn{5-4};
348 class VLD2QWB<bits<4> op7_4, string Dt>
349 : NLdSt<0, 0b10, 0b0011, op7_4,
350 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
351 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD2x2u,
352 "vld2", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm",
353 "$Rn.addr = $wb", []> {
354 let Inst{5-4} = Rn{5-4};
357 def VLD2d8_UPD : VLD2DWB<0b1000, {0,0,?,?}, "8">;
358 def VLD2d16_UPD : VLD2DWB<0b1000, {0,1,?,?}, "16">;
359 def VLD2d32_UPD : VLD2DWB<0b1000, {1,0,?,?}, "32">;
361 def VLD2q8_UPD : VLD2QWB<{0,0,?,?}, "8">;
362 def VLD2q16_UPD : VLD2QWB<{0,1,?,?}, "16">;
363 def VLD2q32_UPD : VLD2QWB<{1,0,?,?}, "32">;
365 def VLD2d8Pseudo_UPD : VLDQWBPseudo<IIC_VLD2u>;
366 def VLD2d16Pseudo_UPD : VLDQWBPseudo<IIC_VLD2u>;
367 def VLD2d32Pseudo_UPD : VLDQWBPseudo<IIC_VLD2u>;
369 def VLD2q8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD2x2u>;
370 def VLD2q16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD2x2u>;
371 def VLD2q32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD2x2u>;
373 // ...with double-spaced registers (for disassembly only):
374 def VLD2b8 : VLD2D<0b1001, {0,0,?,?}, "8">;
375 def VLD2b16 : VLD2D<0b1001, {0,1,?,?}, "16">;
376 def VLD2b32 : VLD2D<0b1001, {1,0,?,?}, "32">;
377 def VLD2b8_UPD : VLD2DWB<0b1001, {0,0,?,?}, "8">;
378 def VLD2b16_UPD : VLD2DWB<0b1001, {0,1,?,?}, "16">;
379 def VLD2b32_UPD : VLD2DWB<0b1001, {1,0,?,?}, "32">;
381 // VLD3 : Vector Load (multiple 3-element structures)
382 class VLD3D<bits<4> op11_8, bits<4> op7_4, string Dt>
383 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
384 (ins addrmode6:$Rn), IIC_VLD3,
385 "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn", "", []> {
390 def VLD3d8 : VLD3D<0b0100, {0,0,0,?}, "8">;
391 def VLD3d16 : VLD3D<0b0100, {0,1,0,?}, "16">;
392 def VLD3d32 : VLD3D<0b0100, {1,0,0,?}, "32">;
394 def VLD3d8Pseudo : VLDQQPseudo<IIC_VLD3>;
395 def VLD3d16Pseudo : VLDQQPseudo<IIC_VLD3>;
396 def VLD3d32Pseudo : VLDQQPseudo<IIC_VLD3>;
398 // ...with address register writeback:
399 class VLD3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
400 : NLdSt<0, 0b10, op11_8, op7_4,
401 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
402 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD3u,
403 "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn$Rm",
404 "$Rn.addr = $wb", []> {
408 def VLD3d8_UPD : VLD3DWB<0b0100, {0,0,0,?}, "8">;
409 def VLD3d16_UPD : VLD3DWB<0b0100, {0,1,0,?}, "16">;
410 def VLD3d32_UPD : VLD3DWB<0b0100, {1,0,0,?}, "32">;
412 def VLD3d8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>;
413 def VLD3d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>;
414 def VLD3d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>;
416 // ...with double-spaced registers:
417 def VLD3q8 : VLD3D<0b0101, {0,0,0,?}, "8">;
418 def VLD3q16 : VLD3D<0b0101, {0,1,0,?}, "16">;
419 def VLD3q32 : VLD3D<0b0101, {1,0,0,?}, "32">;
420 def VLD3q8_UPD : VLD3DWB<0b0101, {0,0,0,?}, "8">;
421 def VLD3q16_UPD : VLD3DWB<0b0101, {0,1,0,?}, "16">;
422 def VLD3q32_UPD : VLD3DWB<0b0101, {1,0,0,?}, "32">;
424 def VLD3q8Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
425 def VLD3q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
426 def VLD3q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
428 // ...alternate versions to be allocated odd register numbers:
429 def VLD3q8oddPseudo : VLDQQQQPseudo<IIC_VLD3>;
430 def VLD3q16oddPseudo : VLDQQQQPseudo<IIC_VLD3>;
431 def VLD3q32oddPseudo : VLDQQQQPseudo<IIC_VLD3>;
433 def VLD3q8oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
434 def VLD3q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
435 def VLD3q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
437 // VLD4 : Vector Load (multiple 4-element structures)
438 class VLD4D<bits<4> op11_8, bits<4> op7_4, string Dt>
439 : NLdSt<0, 0b10, op11_8, op7_4,
440 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
441 (ins addrmode6:$Rn), IIC_VLD4,
442 "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []> {
444 let Inst{5-4} = Rn{5-4};
447 def VLD4d8 : VLD4D<0b0000, {0,0,?,?}, "8">;
448 def VLD4d16 : VLD4D<0b0000, {0,1,?,?}, "16">;
449 def VLD4d32 : VLD4D<0b0000, {1,0,?,?}, "32">;
451 def VLD4d8Pseudo : VLDQQPseudo<IIC_VLD4>;
452 def VLD4d16Pseudo : VLDQQPseudo<IIC_VLD4>;
453 def VLD4d32Pseudo : VLDQQPseudo<IIC_VLD4>;
455 // ...with address register writeback:
456 class VLD4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
457 : NLdSt<0, 0b10, op11_8, op7_4,
458 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
459 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD4u,
460 "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm",
461 "$Rn.addr = $wb", []> {
462 let Inst{5-4} = Rn{5-4};
465 def VLD4d8_UPD : VLD4DWB<0b0000, {0,0,?,?}, "8">;
466 def VLD4d16_UPD : VLD4DWB<0b0000, {0,1,?,?}, "16">;
467 def VLD4d32_UPD : VLD4DWB<0b0000, {1,0,?,?}, "32">;
469 def VLD4d8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4u>;
470 def VLD4d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4u>;
471 def VLD4d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4u>;
473 // ...with double-spaced registers:
474 def VLD4q8 : VLD4D<0b0001, {0,0,?,?}, "8">;
475 def VLD4q16 : VLD4D<0b0001, {0,1,?,?}, "16">;
476 def VLD4q32 : VLD4D<0b0001, {1,0,?,?}, "32">;
477 def VLD4q8_UPD : VLD4DWB<0b0001, {0,0,?,?}, "8">;
478 def VLD4q16_UPD : VLD4DWB<0b0001, {0,1,?,?}, "16">;
479 def VLD4q32_UPD : VLD4DWB<0b0001, {1,0,?,?}, "32">;
481 def VLD4q8Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>;
482 def VLD4q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>;
483 def VLD4q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>;
485 // ...alternate versions to be allocated odd register numbers:
486 def VLD4q8oddPseudo : VLDQQQQPseudo<IIC_VLD4>;
487 def VLD4q16oddPseudo : VLDQQQQPseudo<IIC_VLD4>;
488 def VLD4q32oddPseudo : VLDQQQQPseudo<IIC_VLD4>;
490 def VLD4q8oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>;
491 def VLD4q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>;
492 def VLD4q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>;
494 } // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
496 // Classes for VLD*LN pseudo-instructions with multi-register operands.
497 // These are expanded to real instructions after register allocation.
498 class VLDQLNPseudo<InstrItinClass itin>
499 : PseudoNLdSt<(outs QPR:$dst),
500 (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
501 itin, "$src = $dst">;
502 class VLDQLNWBPseudo<InstrItinClass itin>
503 : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
504 (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
505 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
506 class VLDQQLNPseudo<InstrItinClass itin>
507 : PseudoNLdSt<(outs QQPR:$dst),
508 (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
509 itin, "$src = $dst">;
510 class VLDQQLNWBPseudo<InstrItinClass itin>
511 : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
512 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
513 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
514 class VLDQQQQLNPseudo<InstrItinClass itin>
515 : PseudoNLdSt<(outs QQQQPR:$dst),
516 (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
517 itin, "$src = $dst">;
518 class VLDQQQQLNWBPseudo<InstrItinClass itin>
519 : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
520 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
521 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
523 // VLD1LN : Vector Load (single element to one lane)
524 class VLD1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
526 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd),
527 (ins addrmode6:$Rn, DPR:$src, nohash_imm:$lane),
528 IIC_VLD1ln, "vld1", Dt, "\\{$Vd[$lane]\\}, $Rn",
530 [(set DPR:$Vd, (vector_insert (Ty DPR:$src),
531 (i32 (LoadOp addrmode6:$Rn)),
535 class VLD1LN32<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
537 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd),
538 (ins addrmode6oneL32:$Rn, DPR:$src, nohash_imm:$lane),
539 IIC_VLD1ln, "vld1", Dt, "\\{$Vd[$lane]\\}, $Rn",
541 [(set DPR:$Vd, (vector_insert (Ty DPR:$src),
542 (i32 (LoadOp addrmode6oneL32:$Rn)),
546 class VLD1QLNPseudo<ValueType Ty, PatFrag LoadOp> : VLDQLNPseudo<IIC_VLD1ln> {
547 let Pattern = [(set QPR:$dst, (vector_insert (Ty QPR:$src),
548 (i32 (LoadOp addrmode6:$addr)),
552 def VLD1LNd8 : VLD1LN<0b0000, {?,?,?,0}, "8", v8i8, extloadi8> {
553 let Inst{7-5} = lane{2-0};
555 def VLD1LNd16 : VLD1LN<0b0100, {?,?,0,?}, "16", v4i16, extloadi16> {
556 let Inst{7-6} = lane{1-0};
559 def VLD1LNd32 : VLD1LN32<0b1000, {?,0,?,?}, "32", v2i32, load> {
560 let Inst{7} = lane{0};
565 def VLD1LNq8Pseudo : VLD1QLNPseudo<v16i8, extloadi8>;
566 def VLD1LNq16Pseudo : VLD1QLNPseudo<v8i16, extloadi16>;
567 def VLD1LNq32Pseudo : VLD1QLNPseudo<v4i32, load>;
569 def : Pat<(vector_insert (v2f32 DPR:$src),
570 (f32 (load addrmode6:$addr)), imm:$lane),
571 (VLD1LNd32 addrmode6:$addr, DPR:$src, imm:$lane)>;
572 def : Pat<(vector_insert (v4f32 QPR:$src),
573 (f32 (load addrmode6:$addr)), imm:$lane),
574 (VLD1LNq32Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
576 let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
578 // ...with address register writeback:
579 class VLD1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
580 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, GPR:$wb),
581 (ins addrmode6:$Rn, am6offset:$Rm,
582 DPR:$src, nohash_imm:$lane), IIC_VLD1lnu, "vld1", Dt,
583 "\\{$Vd[$lane]\\}, $Rn$Rm",
584 "$src = $Vd, $Rn.addr = $wb", []>;
586 def VLD1LNd8_UPD : VLD1LNWB<0b0000, {?,?,?,0}, "8"> {
587 let Inst{7-5} = lane{2-0};
589 def VLD1LNd16_UPD : VLD1LNWB<0b0100, {?,?,0,?}, "16"> {
590 let Inst{7-6} = lane{1-0};
593 def VLD1LNd32_UPD : VLD1LNWB<0b1000, {?,0,?,?}, "32"> {
594 let Inst{7} = lane{0};
599 def VLD1LNq8Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>;
600 def VLD1LNq16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>;
601 def VLD1LNq32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>;
603 // VLD2LN : Vector Load (single 2-element structure to one lane)
604 class VLD2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
605 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2),
606 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, nohash_imm:$lane),
607 IIC_VLD2ln, "vld2", Dt, "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn",
608 "$src1 = $Vd, $src2 = $dst2", []> {
613 def VLD2LNd8 : VLD2LN<0b0001, {?,?,?,?}, "8"> {
614 let Inst{7-5} = lane{2-0};
616 def VLD2LNd16 : VLD2LN<0b0101, {?,?,0,?}, "16"> {
617 let Inst{7-6} = lane{1-0};
619 def VLD2LNd32 : VLD2LN<0b1001, {?,0,0,?}, "32"> {
620 let Inst{7} = lane{0};
623 def VLD2LNd8Pseudo : VLDQLNPseudo<IIC_VLD2ln>;
624 def VLD2LNd16Pseudo : VLDQLNPseudo<IIC_VLD2ln>;
625 def VLD2LNd32Pseudo : VLDQLNPseudo<IIC_VLD2ln>;
627 // ...with double-spaced registers:
628 def VLD2LNq16 : VLD2LN<0b0101, {?,?,1,?}, "16"> {
629 let Inst{7-6} = lane{1-0};
631 def VLD2LNq32 : VLD2LN<0b1001, {?,1,0,?}, "32"> {
632 let Inst{7} = lane{0};
635 def VLD2LNq16Pseudo : VLDQQLNPseudo<IIC_VLD2ln>;
636 def VLD2LNq32Pseudo : VLDQQLNPseudo<IIC_VLD2ln>;
638 // ...with address register writeback:
639 class VLD2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
640 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
641 (ins addrmode6:$Rn, am6offset:$Rm,
642 DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VLD2lnu, "vld2", Dt,
643 "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn$Rm",
644 "$src1 = $Vd, $src2 = $dst2, $Rn.addr = $wb", []> {
648 def VLD2LNd8_UPD : VLD2LNWB<0b0001, {?,?,?,?}, "8"> {
649 let Inst{7-5} = lane{2-0};
651 def VLD2LNd16_UPD : VLD2LNWB<0b0101, {?,?,0,?}, "16"> {
652 let Inst{7-6} = lane{1-0};
654 def VLD2LNd32_UPD : VLD2LNWB<0b1001, {?,0,0,?}, "32"> {
655 let Inst{7} = lane{0};
658 def VLD2LNd8Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>;
659 def VLD2LNd16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>;
660 def VLD2LNd32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>;
662 def VLD2LNq16_UPD : VLD2LNWB<0b0101, {?,?,1,?}, "16"> {
663 let Inst{7-6} = lane{1-0};
665 def VLD2LNq32_UPD : VLD2LNWB<0b1001, {?,1,0,?}, "32"> {
666 let Inst{7} = lane{0};
669 def VLD2LNq16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>;
670 def VLD2LNq32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>;
672 // VLD3LN : Vector Load (single 3-element structure to one lane)
673 class VLD3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
674 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
675 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3,
676 nohash_imm:$lane), IIC_VLD3ln, "vld3", Dt,
677 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn",
678 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3", []> {
682 def VLD3LNd8 : VLD3LN<0b0010, {?,?,?,0}, "8"> {
683 let Inst{7-5} = lane{2-0};
685 def VLD3LNd16 : VLD3LN<0b0110, {?,?,0,0}, "16"> {
686 let Inst{7-6} = lane{1-0};
688 def VLD3LNd32 : VLD3LN<0b1010, {?,0,0,0}, "32"> {
689 let Inst{7} = lane{0};
692 def VLD3LNd8Pseudo : VLDQQLNPseudo<IIC_VLD3ln>;
693 def VLD3LNd16Pseudo : VLDQQLNPseudo<IIC_VLD3ln>;
694 def VLD3LNd32Pseudo : VLDQQLNPseudo<IIC_VLD3ln>;
696 // ...with double-spaced registers:
697 def VLD3LNq16 : VLD3LN<0b0110, {?,?,1,0}, "16"> {
698 let Inst{7-6} = lane{1-0};
700 def VLD3LNq32 : VLD3LN<0b1010, {?,1,0,0}, "32"> {
701 let Inst{7} = lane{0};
704 def VLD3LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>;
705 def VLD3LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>;
707 // ...with address register writeback:
708 class VLD3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
709 : NLdStLn<1, 0b10, op11_8, op7_4,
710 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
711 (ins addrmode6:$Rn, am6offset:$Rm,
712 DPR:$src1, DPR:$src2, DPR:$src3, nohash_imm:$lane),
713 IIC_VLD3lnu, "vld3", Dt,
714 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn$Rm",
715 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $Rn.addr = $wb",
718 def VLD3LNd8_UPD : VLD3LNWB<0b0010, {?,?,?,0}, "8"> {
719 let Inst{7-5} = lane{2-0};
721 def VLD3LNd16_UPD : VLD3LNWB<0b0110, {?,?,0,0}, "16"> {
722 let Inst{7-6} = lane{1-0};
724 def VLD3LNd32_UPD : VLD3LNWB<0b1010, {?,0,0,0}, "32"> {
725 let Inst{7} = lane{0};
728 def VLD3LNd8Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>;
729 def VLD3LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>;
730 def VLD3LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>;
732 def VLD3LNq16_UPD : VLD3LNWB<0b0110, {?,?,1,0}, "16"> {
733 let Inst{7-6} = lane{1-0};
735 def VLD3LNq32_UPD : VLD3LNWB<0b1010, {?,1,0,0}, "32"> {
736 let Inst{7} = lane{0};
739 def VLD3LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>;
740 def VLD3LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>;
742 // VLD4LN : Vector Load (single 4-element structure to one lane)
743 class VLD4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
744 : NLdStLn<1, 0b10, op11_8, op7_4,
745 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
746 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4,
747 nohash_imm:$lane), IIC_VLD4ln, "vld4", Dt,
748 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn",
749 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4", []> {
754 def VLD4LNd8 : VLD4LN<0b0011, {?,?,?,?}, "8"> {
755 let Inst{7-5} = lane{2-0};
757 def VLD4LNd16 : VLD4LN<0b0111, {?,?,0,?}, "16"> {
758 let Inst{7-6} = lane{1-0};
760 def VLD4LNd32 : VLD4LN<0b1011, {?,0,?,?}, "32"> {
761 let Inst{7} = lane{0};
765 def VLD4LNd8Pseudo : VLDQQLNPseudo<IIC_VLD4ln>;
766 def VLD4LNd16Pseudo : VLDQQLNPseudo<IIC_VLD4ln>;
767 def VLD4LNd32Pseudo : VLDQQLNPseudo<IIC_VLD4ln>;
769 // ...with double-spaced registers:
770 def VLD4LNq16 : VLD4LN<0b0111, {?,?,1,?}, "16"> {
771 let Inst{7-6} = lane{1-0};
773 def VLD4LNq32 : VLD4LN<0b1011, {?,1,?,?}, "32"> {
774 let Inst{7} = lane{0};
778 def VLD4LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>;
779 def VLD4LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>;
781 // ...with address register writeback:
782 class VLD4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
783 : NLdStLn<1, 0b10, op11_8, op7_4,
784 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
785 (ins addrmode6:$Rn, am6offset:$Rm,
786 DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
787 IIC_VLD4lnu, "vld4", Dt,
788 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn$Rm",
789 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4, $Rn.addr = $wb",
794 def VLD4LNd8_UPD : VLD4LNWB<0b0011, {?,?,?,?}, "8"> {
795 let Inst{7-5} = lane{2-0};
797 def VLD4LNd16_UPD : VLD4LNWB<0b0111, {?,?,0,?}, "16"> {
798 let Inst{7-6} = lane{1-0};
800 def VLD4LNd32_UPD : VLD4LNWB<0b1011, {?,0,?,?}, "32"> {
801 let Inst{7} = lane{0};
805 def VLD4LNd8Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>;
806 def VLD4LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>;
807 def VLD4LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>;
809 def VLD4LNq16_UPD : VLD4LNWB<0b0111, {?,?,1,?}, "16"> {
810 let Inst{7-6} = lane{1-0};
812 def VLD4LNq32_UPD : VLD4LNWB<0b1011, {?,1,?,?}, "32"> {
813 let Inst{7} = lane{0};
817 def VLD4LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>;
818 def VLD4LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>;
820 } // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
822 // VLD1DUP : Vector Load (single element to all lanes)
823 class VLD1DUP<bits<4> op7_4, string Dt, ValueType Ty, PatFrag LoadOp>
824 : NLdSt<1, 0b10, 0b1100, op7_4, (outs DPR:$Vd), (ins addrmode6dup:$Rn),
825 IIC_VLD1dup, "vld1", Dt, "\\{$Vd[]\\}, $Rn", "",
826 [(set DPR:$Vd, (Ty (NEONvdup (i32 (LoadOp addrmode6dup:$Rn)))))]> {
830 class VLD1QDUPPseudo<ValueType Ty, PatFrag LoadOp> : VLDQPseudo<IIC_VLD1dup> {
831 let Pattern = [(set QPR:$dst,
832 (Ty (NEONvdup (i32 (LoadOp addrmode6dup:$addr)))))];
835 def VLD1DUPd8 : VLD1DUP<{0,0,0,?}, "8", v8i8, extloadi8>;
836 def VLD1DUPd16 : VLD1DUP<{0,1,0,?}, "16", v4i16, extloadi16>;
837 def VLD1DUPd32 : VLD1DUP<{1,0,0,?}, "32", v2i32, load>;
839 def VLD1DUPq8Pseudo : VLD1QDUPPseudo<v16i8, extloadi8>;
840 def VLD1DUPq16Pseudo : VLD1QDUPPseudo<v8i16, extloadi16>;
841 def VLD1DUPq32Pseudo : VLD1QDUPPseudo<v4i32, load>;
843 def : Pat<(v2f32 (NEONvdup (f32 (load addrmode6dup:$addr)))),
844 (VLD1DUPd32 addrmode6:$addr)>;
845 def : Pat<(v4f32 (NEONvdup (f32 (load addrmode6dup:$addr)))),
846 (VLD1DUPq32Pseudo addrmode6:$addr)>;
848 let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
850 class VLD1QDUP<bits<4> op7_4, string Dt>
851 : NLdSt<1, 0b10, 0b1100, op7_4, (outs DPR:$Vd, DPR:$dst2),
852 (ins addrmode6dup:$Rn), IIC_VLD1dup,
853 "vld1", Dt, "\\{$Vd[], $dst2[]\\}, $Rn", "", []> {
858 def VLD1DUPq8 : VLD1QDUP<{0,0,1,0}, "8">;
859 def VLD1DUPq16 : VLD1QDUP<{0,1,1,?}, "16">;
860 def VLD1DUPq32 : VLD1QDUP<{1,0,1,?}, "32">;
862 // ...with address register writeback:
863 class VLD1DUPWB<bits<4> op7_4, string Dt>
864 : NLdSt<1, 0b10, 0b1100, op7_4, (outs DPR:$Vd, GPR:$wb),
865 (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD1dupu,
866 "vld1", Dt, "\\{$Vd[]\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
869 class VLD1QDUPWB<bits<4> op7_4, string Dt>
870 : NLdSt<1, 0b10, 0b1100, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
871 (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD1dupu,
872 "vld1", Dt, "\\{$Vd[], $dst2[]\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
876 def VLD1DUPd8_UPD : VLD1DUPWB<{0,0,0,0}, "8">;
877 def VLD1DUPd16_UPD : VLD1DUPWB<{0,1,0,?}, "16">;
878 def VLD1DUPd32_UPD : VLD1DUPWB<{1,0,0,?}, "32">;
880 def VLD1DUPq8_UPD : VLD1QDUPWB<{0,0,1,0}, "8">;
881 def VLD1DUPq16_UPD : VLD1QDUPWB<{0,1,1,?}, "16">;
882 def VLD1DUPq32_UPD : VLD1QDUPWB<{1,0,1,?}, "32">;
884 def VLD1DUPq8Pseudo_UPD : VLDQWBPseudo<IIC_VLD1dupu>;
885 def VLD1DUPq16Pseudo_UPD : VLDQWBPseudo<IIC_VLD1dupu>;
886 def VLD1DUPq32Pseudo_UPD : VLDQWBPseudo<IIC_VLD1dupu>;
888 // VLD2DUP : Vector Load (single 2-element structure to all lanes)
889 class VLD2DUP<bits<4> op7_4, string Dt>
890 : NLdSt<1, 0b10, 0b1101, op7_4, (outs DPR:$Vd, DPR:$dst2),
891 (ins addrmode6dup:$Rn), IIC_VLD2dup,
892 "vld2", Dt, "\\{$Vd[], $dst2[]\\}, $Rn", "", []> {
897 def VLD2DUPd8 : VLD2DUP<{0,0,0,?}, "8">;
898 def VLD2DUPd16 : VLD2DUP<{0,1,0,?}, "16">;
899 def VLD2DUPd32 : VLD2DUP<{1,0,0,?}, "32">;
901 def VLD2DUPd8Pseudo : VLDQPseudo<IIC_VLD2dup>;
902 def VLD2DUPd16Pseudo : VLDQPseudo<IIC_VLD2dup>;
903 def VLD2DUPd32Pseudo : VLDQPseudo<IIC_VLD2dup>;
905 // ...with double-spaced registers (not used for codegen):
906 def VLD2DUPd8x2 : VLD2DUP<{0,0,1,?}, "8">;
907 def VLD2DUPd16x2 : VLD2DUP<{0,1,1,?}, "16">;
908 def VLD2DUPd32x2 : VLD2DUP<{1,0,1,?}, "32">;
910 // ...with address register writeback:
911 class VLD2DUPWB<bits<4> op7_4, string Dt>
912 : NLdSt<1, 0b10, 0b1101, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
913 (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD2dupu,
914 "vld2", Dt, "\\{$Vd[], $dst2[]\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
918 def VLD2DUPd8_UPD : VLD2DUPWB<{0,0,0,0}, "8">;
919 def VLD2DUPd16_UPD : VLD2DUPWB<{0,1,0,?}, "16">;
920 def VLD2DUPd32_UPD : VLD2DUPWB<{1,0,0,?}, "32">;
922 def VLD2DUPd8x2_UPD : VLD2DUPWB<{0,0,1,0}, "8">;
923 def VLD2DUPd16x2_UPD : VLD2DUPWB<{0,1,1,?}, "16">;
924 def VLD2DUPd32x2_UPD : VLD2DUPWB<{1,0,1,?}, "32">;
926 def VLD2DUPd8Pseudo_UPD : VLDQWBPseudo<IIC_VLD2dupu>;
927 def VLD2DUPd16Pseudo_UPD : VLDQWBPseudo<IIC_VLD2dupu>;
928 def VLD2DUPd32Pseudo_UPD : VLDQWBPseudo<IIC_VLD2dupu>;
930 // VLD3DUP : Vector Load (single 3-element structure to all lanes)
931 class VLD3DUP<bits<4> op7_4, string Dt>
932 : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
933 (ins addrmode6dup:$Rn), IIC_VLD3dup,
934 "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn", "", []> {
939 def VLD3DUPd8 : VLD3DUP<{0,0,0,?}, "8">;
940 def VLD3DUPd16 : VLD3DUP<{0,1,0,?}, "16">;
941 def VLD3DUPd32 : VLD3DUP<{1,0,0,?}, "32">;
943 def VLD3DUPd8Pseudo : VLDQQPseudo<IIC_VLD3dup>;
944 def VLD3DUPd16Pseudo : VLDQQPseudo<IIC_VLD3dup>;
945 def VLD3DUPd32Pseudo : VLDQQPseudo<IIC_VLD3dup>;
947 // ...with double-spaced registers (not used for codegen):
948 def VLD3DUPd8x2 : VLD3DUP<{0,0,1,?}, "8">;
949 def VLD3DUPd16x2 : VLD3DUP<{0,1,1,?}, "16">;
950 def VLD3DUPd32x2 : VLD3DUP<{1,0,1,?}, "32">;
952 // ...with address register writeback:
953 class VLD3DUPWB<bits<4> op7_4, string Dt>
954 : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
955 (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD3dupu,
956 "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn$Rm",
957 "$Rn.addr = $wb", []> {
961 def VLD3DUPd8_UPD : VLD3DUPWB<{0,0,0,0}, "8">;
962 def VLD3DUPd16_UPD : VLD3DUPWB<{0,1,0,?}, "16">;
963 def VLD3DUPd32_UPD : VLD3DUPWB<{1,0,0,?}, "32">;
965 def VLD3DUPd8x2_UPD : VLD3DUPWB<{0,0,1,0}, "8">;
966 def VLD3DUPd16x2_UPD : VLD3DUPWB<{0,1,1,?}, "16">;
967 def VLD3DUPd32x2_UPD : VLD3DUPWB<{1,0,1,?}, "32">;
969 def VLD3DUPd8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>;
970 def VLD3DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>;
971 def VLD3DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>;
973 // VLD4DUP : Vector Load (single 4-element structure to all lanes)
974 class VLD4DUP<bits<4> op7_4, string Dt>
975 : NLdSt<1, 0b10, 0b1111, op7_4,
976 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
977 (ins addrmode6dup:$Rn), IIC_VLD4dup,
978 "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn", "", []> {
983 def VLD4DUPd8 : VLD4DUP<{0,0,0,?}, "8">;
984 def VLD4DUPd16 : VLD4DUP<{0,1,0,?}, "16">;
985 def VLD4DUPd32 : VLD4DUP<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
987 def VLD4DUPd8Pseudo : VLDQQPseudo<IIC_VLD4dup>;
988 def VLD4DUPd16Pseudo : VLDQQPseudo<IIC_VLD4dup>;
989 def VLD4DUPd32Pseudo : VLDQQPseudo<IIC_VLD4dup>;
991 // ...with double-spaced registers (not used for codegen):
992 def VLD4DUPd8x2 : VLD4DUP<{0,0,1,?}, "8">;
993 def VLD4DUPd16x2 : VLD4DUP<{0,1,1,?}, "16">;
994 def VLD4DUPd32x2 : VLD4DUP<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
996 // ...with address register writeback:
997 class VLD4DUPWB<bits<4> op7_4, string Dt>
998 : NLdSt<1, 0b10, 0b1111, op7_4,
999 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
1000 (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD4dupu,
1001 "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn$Rm",
1002 "$Rn.addr = $wb", []> {
1003 let Inst{4} = Rn{4};
1006 def VLD4DUPd8_UPD : VLD4DUPWB<{0,0,0,0}, "8">;
1007 def VLD4DUPd16_UPD : VLD4DUPWB<{0,1,0,?}, "16">;
1008 def VLD4DUPd32_UPD : VLD4DUPWB<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
1010 def VLD4DUPd8x2_UPD : VLD4DUPWB<{0,0,1,0}, "8">;
1011 def VLD4DUPd16x2_UPD : VLD4DUPWB<{0,1,1,?}, "16">;
1012 def VLD4DUPd32x2_UPD : VLD4DUPWB<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
1014 def VLD4DUPd8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>;
1015 def VLD4DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>;
1016 def VLD4DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>;
1018 } // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
1020 let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in {
1022 // Classes for VST* pseudo-instructions with multi-register operands.
1023 // These are expanded to real instructions after register allocation.
1024 class VSTQPseudo<InstrItinClass itin>
1025 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src), itin, "">;
1026 class VSTQWBPseudo<InstrItinClass itin>
1027 : PseudoNLdSt<(outs GPR:$wb),
1028 (ins addrmode6:$addr, am6offset:$offset, QPR:$src), itin,
1029 "$addr.addr = $wb">;
1030 class VSTQQPseudo<InstrItinClass itin>
1031 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src), itin, "">;
1032 class VSTQQWBPseudo<InstrItinClass itin>
1033 : PseudoNLdSt<(outs GPR:$wb),
1034 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src), itin,
1035 "$addr.addr = $wb">;
1036 class VSTQQQQPseudo<InstrItinClass itin>
1037 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src), itin, "">;
1038 class VSTQQQQWBPseudo<InstrItinClass itin>
1039 : PseudoNLdSt<(outs GPR:$wb),
1040 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
1041 "$addr.addr = $wb">;
1043 // VST1 : Vector Store (multiple single elements)
1044 class VST1D<bits<4> op7_4, string Dt>
1045 : NLdSt<0,0b00,0b0111,op7_4, (outs), (ins addrmode6:$Rn, DPR:$Vd),
1046 IIC_VST1, "vst1", Dt, "\\{$Vd\\}, $Rn", "", []> {
1048 let Inst{4} = Rn{4};
1050 class VST1Q<bits<4> op7_4, string Dt>
1051 : NLdSt<0,0b00,0b1010,op7_4, (outs),
1052 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2), IIC_VST1x2,
1053 "vst1", Dt, "\\{$Vd, $src2\\}, $Rn", "", []> {
1055 let Inst{5-4} = Rn{5-4};
1058 def VST1d8 : VST1D<{0,0,0,?}, "8">;
1059 def VST1d16 : VST1D<{0,1,0,?}, "16">;
1060 def VST1d32 : VST1D<{1,0,0,?}, "32">;
1061 def VST1d64 : VST1D<{1,1,0,?}, "64">;
1063 def VST1q8 : VST1Q<{0,0,?,?}, "8">;
1064 def VST1q16 : VST1Q<{0,1,?,?}, "16">;
1065 def VST1q32 : VST1Q<{1,0,?,?}, "32">;
1066 def VST1q64 : VST1Q<{1,1,?,?}, "64">;
1068 def VST1q8Pseudo : VSTQPseudo<IIC_VST1x2>;
1069 def VST1q16Pseudo : VSTQPseudo<IIC_VST1x2>;
1070 def VST1q32Pseudo : VSTQPseudo<IIC_VST1x2>;
1071 def VST1q64Pseudo : VSTQPseudo<IIC_VST1x2>;
1073 // ...with address register writeback:
1074 class VST1DWB<bits<4> op7_4, string Dt>
1075 : NLdSt<0, 0b00, 0b0111, op7_4, (outs GPR:$wb),
1076 (ins addrmode6:$Rn, am6offset:$Rm, DPR:$Vd), IIC_VST1u,
1077 "vst1", Dt, "\\{$Vd\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
1078 let Inst{4} = Rn{4};
1080 class VST1QWB<bits<4> op7_4, string Dt>
1081 : NLdSt<0, 0b00, 0b1010, op7_4, (outs GPR:$wb),
1082 (ins addrmode6:$Rn, am6offset:$Rm, DPR:$Vd, DPR:$src2),
1083 IIC_VST1x2u, "vst1", Dt, "\\{$Vd, $src2\\}, $Rn$Rm",
1084 "$Rn.addr = $wb", []> {
1085 let Inst{5-4} = Rn{5-4};
1088 def VST1d8_UPD : VST1DWB<{0,0,0,?}, "8">;
1089 def VST1d16_UPD : VST1DWB<{0,1,0,?}, "16">;
1090 def VST1d32_UPD : VST1DWB<{1,0,0,?}, "32">;
1091 def VST1d64_UPD : VST1DWB<{1,1,0,?}, "64">;
1093 def VST1q8_UPD : VST1QWB<{0,0,?,?}, "8">;
1094 def VST1q16_UPD : VST1QWB<{0,1,?,?}, "16">;
1095 def VST1q32_UPD : VST1QWB<{1,0,?,?}, "32">;
1096 def VST1q64_UPD : VST1QWB<{1,1,?,?}, "64">;
1098 def VST1q8Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
1099 def VST1q16Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
1100 def VST1q32Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
1101 def VST1q64Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
1103 // ...with 3 registers (some of these are only for the disassembler):
1104 class VST1D3<bits<4> op7_4, string Dt>
1105 : NLdSt<0, 0b00, 0b0110, op7_4, (outs),
1106 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3),
1107 IIC_VST1x3, "vst1", Dt, "\\{$Vd, $src2, $src3\\}, $Rn", "", []> {
1109 let Inst{4} = Rn{4};
1111 class VST1D3WB<bits<4> op7_4, string Dt>
1112 : NLdSt<0, 0b00, 0b0110, op7_4, (outs GPR:$wb),
1113 (ins addrmode6:$Rn, am6offset:$Rm,
1114 DPR:$Vd, DPR:$src2, DPR:$src3),
1115 IIC_VST1x3u, "vst1", Dt, "\\{$Vd, $src2, $src3\\}, $Rn$Rm",
1116 "$Rn.addr = $wb", []> {
1117 let Inst{4} = Rn{4};
1120 def VST1d8T : VST1D3<{0,0,0,?}, "8">;
1121 def VST1d16T : VST1D3<{0,1,0,?}, "16">;
1122 def VST1d32T : VST1D3<{1,0,0,?}, "32">;
1123 def VST1d64T : VST1D3<{1,1,0,?}, "64">;
1125 def VST1d8T_UPD : VST1D3WB<{0,0,0,?}, "8">;
1126 def VST1d16T_UPD : VST1D3WB<{0,1,0,?}, "16">;
1127 def VST1d32T_UPD : VST1D3WB<{1,0,0,?}, "32">;
1128 def VST1d64T_UPD : VST1D3WB<{1,1,0,?}, "64">;
1130 def VST1d64TPseudo : VSTQQPseudo<IIC_VST1x3>;
1131 def VST1d64TPseudo_UPD : VSTQQWBPseudo<IIC_VST1x3u>;
1133 // ...with 4 registers (some of these are only for the disassembler):
1134 class VST1D4<bits<4> op7_4, string Dt>
1135 : NLdSt<0, 0b00, 0b0010, op7_4, (outs),
1136 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
1137 IIC_VST1x4, "vst1", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn", "",
1140 let Inst{5-4} = Rn{5-4};
1142 class VST1D4WB<bits<4> op7_4, string Dt>
1143 : NLdSt<0, 0b00, 0b0010, op7_4, (outs GPR:$wb),
1144 (ins addrmode6:$Rn, am6offset:$Rm,
1145 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST1x4u,
1146 "vst1", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
1147 "$Rn.addr = $wb", []> {
1148 let Inst{5-4} = Rn{5-4};
1151 def VST1d8Q : VST1D4<{0,0,?,?}, "8">;
1152 def VST1d16Q : VST1D4<{0,1,?,?}, "16">;
1153 def VST1d32Q : VST1D4<{1,0,?,?}, "32">;
1154 def VST1d64Q : VST1D4<{1,1,?,?}, "64">;
1156 def VST1d8Q_UPD : VST1D4WB<{0,0,?,?}, "8">;
1157 def VST1d16Q_UPD : VST1D4WB<{0,1,?,?}, "16">;
1158 def VST1d32Q_UPD : VST1D4WB<{1,0,?,?}, "32">;
1159 def VST1d64Q_UPD : VST1D4WB<{1,1,?,?}, "64">;
1161 def VST1d64QPseudo : VSTQQPseudo<IIC_VST1x4>;
1162 def VST1d64QPseudo_UPD : VSTQQWBPseudo<IIC_VST1x4u>;
1164 // VST2 : Vector Store (multiple 2-element structures)
1165 class VST2D<bits<4> op11_8, bits<4> op7_4, string Dt>
1166 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
1167 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2),
1168 IIC_VST2, "vst2", Dt, "\\{$Vd, $src2\\}, $Rn", "", []> {
1170 let Inst{5-4} = Rn{5-4};
1172 class VST2Q<bits<4> op7_4, string Dt>
1173 : NLdSt<0, 0b00, 0b0011, op7_4, (outs),
1174 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
1175 IIC_VST2x2, "vst2", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn",
1178 let Inst{5-4} = Rn{5-4};
1181 def VST2d8 : VST2D<0b1000, {0,0,?,?}, "8">;
1182 def VST2d16 : VST2D<0b1000, {0,1,?,?}, "16">;
1183 def VST2d32 : VST2D<0b1000, {1,0,?,?}, "32">;
1185 def VST2q8 : VST2Q<{0,0,?,?}, "8">;
1186 def VST2q16 : VST2Q<{0,1,?,?}, "16">;
1187 def VST2q32 : VST2Q<{1,0,?,?}, "32">;
1189 def VST2d8Pseudo : VSTQPseudo<IIC_VST2>;
1190 def VST2d16Pseudo : VSTQPseudo<IIC_VST2>;
1191 def VST2d32Pseudo : VSTQPseudo<IIC_VST2>;
1193 def VST2q8Pseudo : VSTQQPseudo<IIC_VST2x2>;
1194 def VST2q16Pseudo : VSTQQPseudo<IIC_VST2x2>;
1195 def VST2q32Pseudo : VSTQQPseudo<IIC_VST2x2>;
1197 // ...with address register writeback:
1198 class VST2DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1199 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1200 (ins addrmode6:$Rn, am6offset:$Rm, DPR:$Vd, DPR:$src2),
1201 IIC_VST2u, "vst2", Dt, "\\{$Vd, $src2\\}, $Rn$Rm",
1202 "$Rn.addr = $wb", []> {
1203 let Inst{5-4} = Rn{5-4};
1205 class VST2QWB<bits<4> op7_4, string Dt>
1206 : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
1207 (ins addrmode6:$Rn, am6offset:$Rm,
1208 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST2x2u,
1209 "vst2", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
1210 "$Rn.addr = $wb", []> {
1211 let Inst{5-4} = Rn{5-4};
1214 def VST2d8_UPD : VST2DWB<0b1000, {0,0,?,?}, "8">;
1215 def VST2d16_UPD : VST2DWB<0b1000, {0,1,?,?}, "16">;
1216 def VST2d32_UPD : VST2DWB<0b1000, {1,0,?,?}, "32">;
1218 def VST2q8_UPD : VST2QWB<{0,0,?,?}, "8">;
1219 def VST2q16_UPD : VST2QWB<{0,1,?,?}, "16">;
1220 def VST2q32_UPD : VST2QWB<{1,0,?,?}, "32">;
1222 def VST2d8Pseudo_UPD : VSTQWBPseudo<IIC_VST2u>;
1223 def VST2d16Pseudo_UPD : VSTQWBPseudo<IIC_VST2u>;
1224 def VST2d32Pseudo_UPD : VSTQWBPseudo<IIC_VST2u>;
1226 def VST2q8Pseudo_UPD : VSTQQWBPseudo<IIC_VST2x2u>;
1227 def VST2q16Pseudo_UPD : VSTQQWBPseudo<IIC_VST2x2u>;
1228 def VST2q32Pseudo_UPD : VSTQQWBPseudo<IIC_VST2x2u>;
1230 // ...with double-spaced registers (for disassembly only):
1231 def VST2b8 : VST2D<0b1001, {0,0,?,?}, "8">;
1232 def VST2b16 : VST2D<0b1001, {0,1,?,?}, "16">;
1233 def VST2b32 : VST2D<0b1001, {1,0,?,?}, "32">;
1234 def VST2b8_UPD : VST2DWB<0b1001, {0,0,?,?}, "8">;
1235 def VST2b16_UPD : VST2DWB<0b1001, {0,1,?,?}, "16">;
1236 def VST2b32_UPD : VST2DWB<0b1001, {1,0,?,?}, "32">;
1238 // VST3 : Vector Store (multiple 3-element structures)
1239 class VST3D<bits<4> op11_8, bits<4> op7_4, string Dt>
1240 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
1241 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3,
1242 "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn", "", []> {
1244 let Inst{4} = Rn{4};
1247 def VST3d8 : VST3D<0b0100, {0,0,0,?}, "8">;
1248 def VST3d16 : VST3D<0b0100, {0,1,0,?}, "16">;
1249 def VST3d32 : VST3D<0b0100, {1,0,0,?}, "32">;
1251 def VST3d8Pseudo : VSTQQPseudo<IIC_VST3>;
1252 def VST3d16Pseudo : VSTQQPseudo<IIC_VST3>;
1253 def VST3d32Pseudo : VSTQQPseudo<IIC_VST3>;
1255 // ...with address register writeback:
1256 class VST3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1257 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1258 (ins addrmode6:$Rn, am6offset:$Rm,
1259 DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3u,
1260 "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn$Rm",
1261 "$Rn.addr = $wb", []> {
1262 let Inst{4} = Rn{4};
1265 def VST3d8_UPD : VST3DWB<0b0100, {0,0,0,?}, "8">;
1266 def VST3d16_UPD : VST3DWB<0b0100, {0,1,0,?}, "16">;
1267 def VST3d32_UPD : VST3DWB<0b0100, {1,0,0,?}, "32">;
1269 def VST3d8Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>;
1270 def VST3d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>;
1271 def VST3d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>;
1273 // ...with double-spaced registers:
1274 def VST3q8 : VST3D<0b0101, {0,0,0,?}, "8">;
1275 def VST3q16 : VST3D<0b0101, {0,1,0,?}, "16">;
1276 def VST3q32 : VST3D<0b0101, {1,0,0,?}, "32">;
1277 def VST3q8_UPD : VST3DWB<0b0101, {0,0,0,?}, "8">;
1278 def VST3q16_UPD : VST3DWB<0b0101, {0,1,0,?}, "16">;
1279 def VST3q32_UPD : VST3DWB<0b0101, {1,0,0,?}, "32">;
1281 def VST3q8Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1282 def VST3q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1283 def VST3q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1285 // ...alternate versions to be allocated odd register numbers:
1286 def VST3q8oddPseudo : VSTQQQQPseudo<IIC_VST3>;
1287 def VST3q16oddPseudo : VSTQQQQPseudo<IIC_VST3>;
1288 def VST3q32oddPseudo : VSTQQQQPseudo<IIC_VST3>;
1290 def VST3q8oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1291 def VST3q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1292 def VST3q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1294 // VST4 : Vector Store (multiple 4-element structures)
1295 class VST4D<bits<4> op11_8, bits<4> op7_4, string Dt>
1296 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
1297 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
1298 IIC_VST4, "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn",
1301 let Inst{5-4} = Rn{5-4};
1304 def VST4d8 : VST4D<0b0000, {0,0,?,?}, "8">;
1305 def VST4d16 : VST4D<0b0000, {0,1,?,?}, "16">;
1306 def VST4d32 : VST4D<0b0000, {1,0,?,?}, "32">;
1308 def VST4d8Pseudo : VSTQQPseudo<IIC_VST4>;
1309 def VST4d16Pseudo : VSTQQPseudo<IIC_VST4>;
1310 def VST4d32Pseudo : VSTQQPseudo<IIC_VST4>;
1312 // ...with address register writeback:
1313 class VST4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1314 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1315 (ins addrmode6:$Rn, am6offset:$Rm,
1316 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST4u,
1317 "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
1318 "$Rn.addr = $wb", []> {
1319 let Inst{5-4} = Rn{5-4};
1322 def VST4d8_UPD : VST4DWB<0b0000, {0,0,?,?}, "8">;
1323 def VST4d16_UPD : VST4DWB<0b0000, {0,1,?,?}, "16">;
1324 def VST4d32_UPD : VST4DWB<0b0000, {1,0,?,?}, "32">;
1326 def VST4d8Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>;
1327 def VST4d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>;
1328 def VST4d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>;
1330 // ...with double-spaced registers:
1331 def VST4q8 : VST4D<0b0001, {0,0,?,?}, "8">;
1332 def VST4q16 : VST4D<0b0001, {0,1,?,?}, "16">;
1333 def VST4q32 : VST4D<0b0001, {1,0,?,?}, "32">;
1334 def VST4q8_UPD : VST4DWB<0b0001, {0,0,?,?}, "8">;
1335 def VST4q16_UPD : VST4DWB<0b0001, {0,1,?,?}, "16">;
1336 def VST4q32_UPD : VST4DWB<0b0001, {1,0,?,?}, "32">;
1338 def VST4q8Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1339 def VST4q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1340 def VST4q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1342 // ...alternate versions to be allocated odd register numbers:
1343 def VST4q8oddPseudo : VSTQQQQPseudo<IIC_VST4>;
1344 def VST4q16oddPseudo : VSTQQQQPseudo<IIC_VST4>;
1345 def VST4q32oddPseudo : VSTQQQQPseudo<IIC_VST4>;
1347 def VST4q8oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1348 def VST4q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1349 def VST4q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1351 } // mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1
1353 // Classes for VST*LN pseudo-instructions with multi-register operands.
1354 // These are expanded to real instructions after register allocation.
1355 class VSTQLNPseudo<InstrItinClass itin>
1356 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
1358 class VSTQLNWBPseudo<InstrItinClass itin>
1359 : PseudoNLdSt<(outs GPR:$wb),
1360 (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
1361 nohash_imm:$lane), itin, "$addr.addr = $wb">;
1362 class VSTQQLNPseudo<InstrItinClass itin>
1363 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
1365 class VSTQQLNWBPseudo<InstrItinClass itin>
1366 : PseudoNLdSt<(outs GPR:$wb),
1367 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
1368 nohash_imm:$lane), itin, "$addr.addr = $wb">;
1369 class VSTQQQQLNPseudo<InstrItinClass itin>
1370 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
1372 class VSTQQQQLNWBPseudo<InstrItinClass itin>
1373 : PseudoNLdSt<(outs GPR:$wb),
1374 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
1375 nohash_imm:$lane), itin, "$addr.addr = $wb">;
1377 // VST1LN : Vector Store (single element from one lane)
1378 class VST1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
1379 PatFrag StoreOp, SDNode ExtractOp>
1380 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1381 (ins addrmode6:$Rn, DPR:$Vd, nohash_imm:$lane),
1382 IIC_VST1ln, "vst1", Dt, "\\{$Vd[$lane]\\}, $Rn", "",
1383 [(StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane), addrmode6:$Rn)]> {
1386 class VST1LN32<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
1387 PatFrag StoreOp, SDNode ExtractOp>
1388 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1389 (ins addrmode6oneL32:$Rn, DPR:$Vd, nohash_imm:$lane),
1390 IIC_VST1ln, "vst1", Dt, "\\{$Vd[$lane]\\}, $Rn", "",
1391 [(StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane), addrmode6oneL32:$Rn)]>{
1394 class VST1QLNPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
1395 : VSTQLNPseudo<IIC_VST1ln> {
1396 let Pattern = [(StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
1400 def VST1LNd8 : VST1LN<0b0000, {?,?,?,0}, "8", v8i8, truncstorei8,
1402 let Inst{7-5} = lane{2-0};
1404 def VST1LNd16 : VST1LN<0b0100, {?,?,0,?}, "16", v4i16, truncstorei16,
1406 let Inst{7-6} = lane{1-0};
1407 let Inst{4} = Rn{5};
1410 def VST1LNd32 : VST1LN32<0b1000, {?,0,?,?}, "32", v2i32, store, extractelt> {
1411 let Inst{7} = lane{0};
1412 let Inst{5-4} = Rn{5-4};
1415 def VST1LNq8Pseudo : VST1QLNPseudo<v16i8, truncstorei8, NEONvgetlaneu>;
1416 def VST1LNq16Pseudo : VST1QLNPseudo<v8i16, truncstorei16, NEONvgetlaneu>;
1417 def VST1LNq32Pseudo : VST1QLNPseudo<v4i32, store, extractelt>;
1419 def : Pat<(store (extractelt (v2f32 DPR:$src), imm:$lane), addrmode6:$addr),
1420 (VST1LNd32 addrmode6:$addr, DPR:$src, imm:$lane)>;
1421 def : Pat<(store (extractelt (v4f32 QPR:$src), imm:$lane), addrmode6:$addr),
1422 (VST1LNq32Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
1424 // ...with address register writeback:
1425 class VST1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
1426 PatFrag StoreOp, SDNode ExtractOp>
1427 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1428 (ins addrmode6:$Rn, am6offset:$Rm,
1429 DPR:$Vd, nohash_imm:$lane), IIC_VST1lnu, "vst1", Dt,
1430 "\\{$Vd[$lane]\\}, $Rn$Rm",
1432 [(set GPR:$wb, (StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane),
1433 addrmode6:$Rn, am6offset:$Rm))]>;
1434 class VST1QLNWBPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
1435 : VSTQLNWBPseudo<IIC_VST1lnu> {
1436 let Pattern = [(set GPR:$wb, (StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
1437 addrmode6:$addr, am6offset:$offset))];
1440 def VST1LNd8_UPD : VST1LNWB<0b0000, {?,?,?,0}, "8", v8i8, post_truncsti8,
1442 let Inst{7-5} = lane{2-0};
1444 def VST1LNd16_UPD : VST1LNWB<0b0100, {?,?,0,?}, "16", v4i16, post_truncsti16,
1446 let Inst{7-6} = lane{1-0};
1447 let Inst{4} = Rn{5};
1449 def VST1LNd32_UPD : VST1LNWB<0b1000, {?,0,?,?}, "32", v2i32, post_store,
1451 let Inst{7} = lane{0};
1452 let Inst{5-4} = Rn{5-4};
1455 def VST1LNq8Pseudo_UPD : VST1QLNWBPseudo<v16i8, post_truncsti8, NEONvgetlaneu>;
1456 def VST1LNq16Pseudo_UPD : VST1QLNWBPseudo<v8i16, post_truncsti16,NEONvgetlaneu>;
1457 def VST1LNq32Pseudo_UPD : VST1QLNWBPseudo<v4i32, post_store, extractelt>;
1459 let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in {
1461 // VST2LN : Vector Store (single 2-element structure from one lane)
1462 class VST2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1463 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1464 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, nohash_imm:$lane),
1465 IIC_VST2ln, "vst2", Dt, "\\{$Vd[$lane], $src2[$lane]\\}, $Rn",
1468 let Inst{4} = Rn{4};
1471 def VST2LNd8 : VST2LN<0b0001, {?,?,?,?}, "8"> {
1472 let Inst{7-5} = lane{2-0};
1474 def VST2LNd16 : VST2LN<0b0101, {?,?,0,?}, "16"> {
1475 let Inst{7-6} = lane{1-0};
1477 def VST2LNd32 : VST2LN<0b1001, {?,0,0,?}, "32"> {
1478 let Inst{7} = lane{0};
1481 def VST2LNd8Pseudo : VSTQLNPseudo<IIC_VST2ln>;
1482 def VST2LNd16Pseudo : VSTQLNPseudo<IIC_VST2ln>;
1483 def VST2LNd32Pseudo : VSTQLNPseudo<IIC_VST2ln>;
1485 // ...with double-spaced registers:
1486 def VST2LNq16 : VST2LN<0b0101, {?,?,1,?}, "16"> {
1487 let Inst{7-6} = lane{1-0};
1488 let Inst{4} = Rn{4};
1490 def VST2LNq32 : VST2LN<0b1001, {?,1,0,?}, "32"> {
1491 let Inst{7} = lane{0};
1492 let Inst{4} = Rn{4};
1495 def VST2LNq16Pseudo : VSTQQLNPseudo<IIC_VST2ln>;
1496 def VST2LNq32Pseudo : VSTQQLNPseudo<IIC_VST2ln>;
1498 // ...with address register writeback:
1499 class VST2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1500 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1501 (ins addrmode6:$addr, am6offset:$offset,
1502 DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VST2lnu, "vst2", Dt,
1503 "\\{$src1[$lane], $src2[$lane]\\}, $addr$offset",
1504 "$addr.addr = $wb", []> {
1505 let Inst{4} = Rn{4};
1508 def VST2LNd8_UPD : VST2LNWB<0b0001, {?,?,?,?}, "8"> {
1509 let Inst{7-5} = lane{2-0};
1511 def VST2LNd16_UPD : VST2LNWB<0b0101, {?,?,0,?}, "16"> {
1512 let Inst{7-6} = lane{1-0};
1514 def VST2LNd32_UPD : VST2LNWB<0b1001, {?,0,0,?}, "32"> {
1515 let Inst{7} = lane{0};
1518 def VST2LNd8Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>;
1519 def VST2LNd16Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>;
1520 def VST2LNd32Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>;
1522 def VST2LNq16_UPD : VST2LNWB<0b0101, {?,?,1,?}, "16"> {
1523 let Inst{7-6} = lane{1-0};
1525 def VST2LNq32_UPD : VST2LNWB<0b1001, {?,1,0,?}, "32"> {
1526 let Inst{7} = lane{0};
1529 def VST2LNq16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>;
1530 def VST2LNq32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>;
1532 // VST3LN : Vector Store (single 3-element structure from one lane)
1533 class VST3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1534 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1535 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3,
1536 nohash_imm:$lane), IIC_VST3ln, "vst3", Dt,
1537 "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn", "", []> {
1541 def VST3LNd8 : VST3LN<0b0010, {?,?,?,0}, "8"> {
1542 let Inst{7-5} = lane{2-0};
1544 def VST3LNd16 : VST3LN<0b0110, {?,?,0,0}, "16"> {
1545 let Inst{7-6} = lane{1-0};
1547 def VST3LNd32 : VST3LN<0b1010, {?,0,0,0}, "32"> {
1548 let Inst{7} = lane{0};
1551 def VST3LNd8Pseudo : VSTQQLNPseudo<IIC_VST3ln>;
1552 def VST3LNd16Pseudo : VSTQQLNPseudo<IIC_VST3ln>;
1553 def VST3LNd32Pseudo : VSTQQLNPseudo<IIC_VST3ln>;
1555 // ...with double-spaced registers:
1556 def VST3LNq16 : VST3LN<0b0110, {?,?,1,0}, "16"> {
1557 let Inst{7-6} = lane{1-0};
1559 def VST3LNq32 : VST3LN<0b1010, {?,1,0,0}, "32"> {
1560 let Inst{7} = lane{0};
1563 def VST3LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
1564 def VST3LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
1566 // ...with address register writeback:
1567 class VST3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1568 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1569 (ins addrmode6:$Rn, am6offset:$Rm,
1570 DPR:$Vd, DPR:$src2, DPR:$src3, nohash_imm:$lane),
1571 IIC_VST3lnu, "vst3", Dt,
1572 "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn$Rm",
1573 "$Rn.addr = $wb", []>;
1575 def VST3LNd8_UPD : VST3LNWB<0b0010, {?,?,?,0}, "8"> {
1576 let Inst{7-5} = lane{2-0};
1578 def VST3LNd16_UPD : VST3LNWB<0b0110, {?,?,0,0}, "16"> {
1579 let Inst{7-6} = lane{1-0};
1581 def VST3LNd32_UPD : VST3LNWB<0b1010, {?,0,0,0}, "32"> {
1582 let Inst{7} = lane{0};
1585 def VST3LNd8Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>;
1586 def VST3LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>;
1587 def VST3LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>;
1589 def VST3LNq16_UPD : VST3LNWB<0b0110, {?,?,1,0}, "16"> {
1590 let Inst{7-6} = lane{1-0};
1592 def VST3LNq32_UPD : VST3LNWB<0b1010, {?,1,0,0}, "32"> {
1593 let Inst{7} = lane{0};
1596 def VST3LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>;
1597 def VST3LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>;
1599 // VST4LN : Vector Store (single 4-element structure from one lane)
1600 class VST4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1601 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1602 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4,
1603 nohash_imm:$lane), IIC_VST4ln, "vst4", Dt,
1604 "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn",
1607 let Inst{4} = Rn{4};
1610 def VST4LNd8 : VST4LN<0b0011, {?,?,?,?}, "8"> {
1611 let Inst{7-5} = lane{2-0};
1613 def VST4LNd16 : VST4LN<0b0111, {?,?,0,?}, "16"> {
1614 let Inst{7-6} = lane{1-0};
1616 def VST4LNd32 : VST4LN<0b1011, {?,0,?,?}, "32"> {
1617 let Inst{7} = lane{0};
1618 let Inst{5} = Rn{5};
1621 def VST4LNd8Pseudo : VSTQQLNPseudo<IIC_VST4ln>;
1622 def VST4LNd16Pseudo : VSTQQLNPseudo<IIC_VST4ln>;
1623 def VST4LNd32Pseudo : VSTQQLNPseudo<IIC_VST4ln>;
1625 // ...with double-spaced registers:
1626 def VST4LNq16 : VST4LN<0b0111, {?,?,1,?}, "16"> {
1627 let Inst{7-6} = lane{1-0};
1629 def VST4LNq32 : VST4LN<0b1011, {?,1,?,?}, "32"> {
1630 let Inst{7} = lane{0};
1631 let Inst{5} = Rn{5};
1634 def VST4LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>;
1635 def VST4LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>;
1637 // ...with address register writeback:
1638 class VST4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1639 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1640 (ins addrmode6:$Rn, am6offset:$Rm,
1641 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
1642 IIC_VST4lnu, "vst4", Dt,
1643 "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn$Rm",
1644 "$Rn.addr = $wb", []> {
1645 let Inst{4} = Rn{4};
1648 def VST4LNd8_UPD : VST4LNWB<0b0011, {?,?,?,?}, "8"> {
1649 let Inst{7-5} = lane{2-0};
1651 def VST4LNd16_UPD : VST4LNWB<0b0111, {?,?,0,?}, "16"> {
1652 let Inst{7-6} = lane{1-0};
1654 def VST4LNd32_UPD : VST4LNWB<0b1011, {?,0,?,?}, "32"> {
1655 let Inst{7} = lane{0};
1656 let Inst{5} = Rn{5};
1659 def VST4LNd8Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>;
1660 def VST4LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>;
1661 def VST4LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>;
1663 def VST4LNq16_UPD : VST4LNWB<0b0111, {?,?,1,?}, "16"> {
1664 let Inst{7-6} = lane{1-0};
1666 def VST4LNq32_UPD : VST4LNWB<0b1011, {?,1,?,?}, "32"> {
1667 let Inst{7} = lane{0};
1668 let Inst{5} = Rn{5};
1671 def VST4LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>;
1672 def VST4LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>;
1674 } // mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1
1677 //===----------------------------------------------------------------------===//
1678 // NEON pattern fragments
1679 //===----------------------------------------------------------------------===//
1681 // Extract D sub-registers of Q registers.
1682 def DSubReg_i8_reg : SDNodeXForm<imm, [{
1683 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1684 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/8, MVT::i32);
1686 def DSubReg_i16_reg : SDNodeXForm<imm, [{
1687 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1688 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/4, MVT::i32);
1690 def DSubReg_i32_reg : SDNodeXForm<imm, [{
1691 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1692 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/2, MVT::i32);
1694 def DSubReg_f64_reg : SDNodeXForm<imm, [{
1695 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1696 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue(), MVT::i32);
1699 // Extract S sub-registers of Q/D registers.
1700 def SSubReg_f32_reg : SDNodeXForm<imm, [{
1701 assert(ARM::ssub_3 == ARM::ssub_0+3 && "Unexpected subreg numbering");
1702 return CurDAG->getTargetConstant(ARM::ssub_0 + N->getZExtValue(), MVT::i32);
1705 // Translate lane numbers from Q registers to D subregs.
1706 def SubReg_i8_lane : SDNodeXForm<imm, [{
1707 return CurDAG->getTargetConstant(N->getZExtValue() & 7, MVT::i32);
1709 def SubReg_i16_lane : SDNodeXForm<imm, [{
1710 return CurDAG->getTargetConstant(N->getZExtValue() & 3, MVT::i32);
1712 def SubReg_i32_lane : SDNodeXForm<imm, [{
1713 return CurDAG->getTargetConstant(N->getZExtValue() & 1, MVT::i32);
1716 //===----------------------------------------------------------------------===//
1717 // Instruction Classes
1718 //===----------------------------------------------------------------------===//
1720 // Basic 2-register operations: double- and quad-register.
1721 class N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1722 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
1723 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
1724 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
1725 (ins DPR:$Vm), IIC_VUNAD, OpcodeStr, Dt,"$Vd, $Vm", "",
1726 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm))))]>;
1727 class N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1728 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
1729 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
1730 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
1731 (ins QPR:$Vm), IIC_VUNAQ, OpcodeStr, Dt,"$Vd, $Vm", "",
1732 [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm))))]>;
1734 // Basic 2-register intrinsics, both double- and quad-register.
1735 class N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1736 bits<2> op17_16, bits<5> op11_7, bit op4,
1737 InstrItinClass itin, string OpcodeStr, string Dt,
1738 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1739 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
1740 (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
1741 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
1742 class N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1743 bits<2> op17_16, bits<5> op11_7, bit op4,
1744 InstrItinClass itin, string OpcodeStr, string Dt,
1745 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1746 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
1747 (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
1748 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
1750 // Narrow 2-register operations.
1751 class N2VN<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1752 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1753 InstrItinClass itin, string OpcodeStr, string Dt,
1754 ValueType TyD, ValueType TyQ, SDNode OpNode>
1755 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
1756 (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
1757 [(set DPR:$Vd, (TyD (OpNode (TyQ QPR:$Vm))))]>;
1759 // Narrow 2-register intrinsics.
1760 class N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1761 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1762 InstrItinClass itin, string OpcodeStr, string Dt,
1763 ValueType TyD, ValueType TyQ, Intrinsic IntOp>
1764 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
1765 (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
1766 [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vm))))]>;
1768 // Long 2-register operations (currently only used for VMOVL).
1769 class N2VL<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1770 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1771 InstrItinClass itin, string OpcodeStr, string Dt,
1772 ValueType TyQ, ValueType TyD, SDNode OpNode>
1773 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
1774 (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
1775 [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vm))))]>;
1777 // Long 2-register intrinsics.
1778 class N2VLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1779 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1780 InstrItinClass itin, string OpcodeStr, string Dt,
1781 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
1782 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
1783 (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
1784 [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vm))))]>;
1786 // 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
1787 class N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr, string Dt>
1788 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$Vd, DPR:$Vm),
1789 (ins DPR:$src1, DPR:$src2), IIC_VPERMD,
1790 OpcodeStr, Dt, "$Vd, $Vm",
1791 "$src1 = $Vd, $src2 = $Vm", []>;
1792 class N2VQShuffle<bits<2> op19_18, bits<5> op11_7,
1793 InstrItinClass itin, string OpcodeStr, string Dt>
1794 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$Vd, QPR:$Vm),
1795 (ins QPR:$src1, QPR:$src2), itin, OpcodeStr, Dt, "$Vd, $Vm",
1796 "$src1 = $Vd, $src2 = $Vm", []>;
1798 // Basic 3-register operations: double- and quad-register.
1799 class N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1800 InstrItinClass itin, string OpcodeStr, string Dt,
1801 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
1802 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1803 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1804 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1805 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
1806 let isCommutable = Commutable;
1808 // Same as N3VD but no data type.
1809 class N3VDX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1810 InstrItinClass itin, string OpcodeStr,
1811 ValueType ResTy, ValueType OpTy,
1812 SDNode OpNode, bit Commutable>
1813 : N3VX<op24, op23, op21_20, op11_8, 0, op4,
1814 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1815 OpcodeStr, "$Vd, $Vn, $Vm", "",
1816 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>{
1817 let isCommutable = Commutable;
1820 class N3VDSL<bits<2> op21_20, bits<4> op11_8,
1821 InstrItinClass itin, string OpcodeStr, string Dt,
1822 ValueType Ty, SDNode ShOp>
1823 : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
1824 (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
1825 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
1827 (Ty (ShOp (Ty DPR:$Vn),
1828 (Ty (NEONvduplane (Ty DPR_VFP2:$Vm),imm:$lane)))))]> {
1829 let isCommutable = 0;
1831 class N3VDSL16<bits<2> op21_20, bits<4> op11_8,
1832 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
1833 : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
1834 (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
1835 NVMulSLFrm, IIC_VMULi16D, OpcodeStr, Dt,"$Vd, $Vn, $Vm[$lane]","",
1837 (Ty (ShOp (Ty DPR:$Vn),
1838 (Ty (NEONvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
1839 let isCommutable = 0;
1842 class N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1843 InstrItinClass itin, string OpcodeStr, string Dt,
1844 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
1845 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1846 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
1847 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1848 [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
1849 let isCommutable = Commutable;
1851 class N3VQX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1852 InstrItinClass itin, string OpcodeStr,
1853 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
1854 : N3VX<op24, op23, op21_20, op11_8, 1, op4,
1855 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
1856 OpcodeStr, "$Vd, $Vn, $Vm", "",
1857 [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>{
1858 let isCommutable = Commutable;
1860 class N3VQSL<bits<2> op21_20, bits<4> op11_8,
1861 InstrItinClass itin, string OpcodeStr, string Dt,
1862 ValueType ResTy, ValueType OpTy, SDNode ShOp>
1863 : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
1864 (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
1865 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
1866 [(set (ResTy QPR:$Vd),
1867 (ResTy (ShOp (ResTy QPR:$Vn),
1868 (ResTy (NEONvduplane (OpTy DPR_VFP2:$Vm),
1870 let isCommutable = 0;
1872 class N3VQSL16<bits<2> op21_20, bits<4> op11_8, string OpcodeStr, string Dt,
1873 ValueType ResTy, ValueType OpTy, SDNode ShOp>
1874 : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
1875 (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
1876 NVMulSLFrm, IIC_VMULi16Q, OpcodeStr, Dt,"$Vd, $Vn, $Vm[$lane]","",
1877 [(set (ResTy QPR:$Vd),
1878 (ResTy (ShOp (ResTy QPR:$Vn),
1879 (ResTy (NEONvduplane (OpTy DPR_8:$Vm),
1881 let isCommutable = 0;
1884 // Basic 3-register intrinsics, both double- and quad-register.
1885 class N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1886 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1887 ValueType ResTy, ValueType OpTy, Intrinsic IntOp, bit Commutable>
1888 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1889 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), f, itin,
1890 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1891 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
1892 let isCommutable = Commutable;
1894 class N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1895 string OpcodeStr, string Dt, ValueType Ty, Intrinsic IntOp>
1896 : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
1897 (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
1898 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
1900 (Ty (IntOp (Ty DPR:$Vn),
1901 (Ty (NEONvduplane (Ty DPR_VFP2:$Vm),
1903 let isCommutable = 0;
1905 class N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1906 string OpcodeStr, string Dt, ValueType Ty, Intrinsic IntOp>
1907 : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
1908 (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
1909 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
1911 (Ty (IntOp (Ty DPR:$Vn),
1912 (Ty (NEONvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
1913 let isCommutable = 0;
1915 class N3VDIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1916 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1917 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1918 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1919 (outs DPR:$Vd), (ins DPR:$Vm, DPR:$Vn), f, itin,
1920 OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
1921 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (OpTy DPR:$Vn))))]> {
1922 let isCommutable = 0;
1925 class N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1926 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1927 ValueType ResTy, ValueType OpTy, Intrinsic IntOp, bit Commutable>
1928 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1929 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin,
1930 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1931 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
1932 let isCommutable = Commutable;
1934 class N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1935 string OpcodeStr, string Dt,
1936 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1937 : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
1938 (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
1939 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
1940 [(set (ResTy QPR:$Vd),
1941 (ResTy (IntOp (ResTy QPR:$Vn),
1942 (ResTy (NEONvduplane (OpTy DPR_VFP2:$Vm),
1944 let isCommutable = 0;
1946 class N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1947 string OpcodeStr, string Dt,
1948 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1949 : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
1950 (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
1951 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
1952 [(set (ResTy QPR:$Vd),
1953 (ResTy (IntOp (ResTy QPR:$Vn),
1954 (ResTy (NEONvduplane (OpTy DPR_8:$Vm),
1956 let isCommutable = 0;
1958 class N3VQIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1959 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1960 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1961 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1962 (outs QPR:$Vd), (ins QPR:$Vm, QPR:$Vn), f, itin,
1963 OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
1964 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (OpTy QPR:$Vn))))]> {
1965 let isCommutable = 0;
1968 // Multiply-Add/Sub operations: double- and quad-register.
1969 class N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1970 InstrItinClass itin, string OpcodeStr, string Dt,
1971 ValueType Ty, SDPatternOperator MulOp, SDPatternOperator OpNode>
1972 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1973 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1974 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1975 [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
1976 (Ty (MulOp DPR:$Vn, DPR:$Vm)))))]>;
1978 class N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1979 string OpcodeStr, string Dt,
1980 ValueType Ty, SDPatternOperator MulOp, SDPatternOperator ShOp>
1981 : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
1983 (ins DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
1985 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
1987 (Ty (ShOp (Ty DPR:$src1),
1989 (Ty (NEONvduplane (Ty DPR_VFP2:$Vm),
1991 class N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1992 string OpcodeStr, string Dt,
1993 ValueType Ty, SDNode MulOp, SDNode ShOp>
1994 : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
1996 (ins DPR:$src1, DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
1998 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
2000 (Ty (ShOp (Ty DPR:$src1),
2002 (Ty (NEONvduplane (Ty DPR_8:$Vm),
2005 class N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2006 InstrItinClass itin, string OpcodeStr, string Dt, ValueType Ty,
2007 SDPatternOperator MulOp, SDPatternOperator OpNode>
2008 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2009 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2010 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2011 [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
2012 (Ty (MulOp QPR:$Vn, QPR:$Vm)))))]>;
2013 class N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2014 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
2015 SDPatternOperator MulOp, SDPatternOperator ShOp>
2016 : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
2018 (ins QPR:$src1, QPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
2020 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
2021 [(set (ResTy QPR:$Vd),
2022 (ResTy (ShOp (ResTy QPR:$src1),
2023 (ResTy (MulOp QPR:$Vn,
2024 (ResTy (NEONvduplane (OpTy DPR_VFP2:$Vm),
2026 class N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2027 string OpcodeStr, string Dt,
2028 ValueType ResTy, ValueType OpTy,
2029 SDNode MulOp, SDNode ShOp>
2030 : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
2032 (ins QPR:$src1, QPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
2034 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
2035 [(set (ResTy QPR:$Vd),
2036 (ResTy (ShOp (ResTy QPR:$src1),
2037 (ResTy (MulOp QPR:$Vn,
2038 (ResTy (NEONvduplane (OpTy DPR_8:$Vm),
2041 // Neon Intrinsic-Op instructions (VABA): double- and quad-register.
2042 class N3VDIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2043 InstrItinClass itin, string OpcodeStr, string Dt,
2044 ValueType Ty, Intrinsic IntOp, SDNode OpNode>
2045 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2046 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2047 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2048 [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
2049 (Ty (IntOp (Ty DPR:$Vn), (Ty DPR:$Vm))))))]>;
2050 class N3VQIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2051 InstrItinClass itin, string OpcodeStr, string Dt,
2052 ValueType Ty, Intrinsic IntOp, SDNode OpNode>
2053 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2054 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2055 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2056 [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
2057 (Ty (IntOp (Ty QPR:$Vn), (Ty QPR:$Vm))))))]>;
2059 // Neon 3-argument intrinsics, both double- and quad-register.
2060 // The destination register is also used as the first source operand register.
2061 class N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2062 InstrItinClass itin, string OpcodeStr, string Dt,
2063 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2064 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2065 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2066 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2067 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$src1),
2068 (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>;
2069 class N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2070 InstrItinClass itin, string OpcodeStr, string Dt,
2071 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2072 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2073 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2074 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2075 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src1),
2076 (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>;
2078 // Long Multiply-Add/Sub operations.
2079 class N3VLMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2080 InstrItinClass itin, string OpcodeStr, string Dt,
2081 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
2082 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2083 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2084 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2085 [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
2086 (TyQ (MulOp (TyD DPR:$Vn),
2087 (TyD DPR:$Vm)))))]>;
2088 class N3VLMulOpSL<bit op24, bits<2> op21_20, bits<4> op11_8,
2089 InstrItinClass itin, string OpcodeStr, string Dt,
2090 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
2091 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
2092 (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
2094 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
2096 (OpNode (TyQ QPR:$src1),
2097 (TyQ (MulOp (TyD DPR:$Vn),
2098 (TyD (NEONvduplane (TyD DPR_VFP2:$Vm),
2100 class N3VLMulOpSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
2101 InstrItinClass itin, string OpcodeStr, string Dt,
2102 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
2103 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
2104 (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
2106 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
2108 (OpNode (TyQ QPR:$src1),
2109 (TyQ (MulOp (TyD DPR:$Vn),
2110 (TyD (NEONvduplane (TyD DPR_8:$Vm),
2113 // Long Intrinsic-Op vector operations with explicit extend (VABAL).
2114 class N3VLIntExtOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2115 InstrItinClass itin, string OpcodeStr, string Dt,
2116 ValueType TyQ, ValueType TyD, Intrinsic IntOp, SDNode ExtOp,
2118 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2119 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2120 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2121 [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
2122 (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
2123 (TyD DPR:$Vm)))))))]>;
2125 // Neon Long 3-argument intrinsic. The destination register is
2126 // a quad-register and is also used as the first source operand register.
2127 class N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2128 InstrItinClass itin, string OpcodeStr, string Dt,
2129 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
2130 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2131 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2132 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2134 (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$Vn), (TyD DPR:$Vm))))]>;
2135 class N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2136 string OpcodeStr, string Dt,
2137 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2138 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
2140 (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
2142 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
2143 [(set (ResTy QPR:$Vd),
2144 (ResTy (IntOp (ResTy QPR:$src1),
2146 (OpTy (NEONvduplane (OpTy DPR_VFP2:$Vm),
2148 class N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8,
2149 InstrItinClass itin, string OpcodeStr, string Dt,
2150 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2151 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
2153 (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
2155 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
2156 [(set (ResTy QPR:$Vd),
2157 (ResTy (IntOp (ResTy QPR:$src1),
2159 (OpTy (NEONvduplane (OpTy DPR_8:$Vm),
2162 // Narrowing 3-register intrinsics.
2163 class N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2164 string OpcodeStr, string Dt, ValueType TyD, ValueType TyQ,
2165 Intrinsic IntOp, bit Commutable>
2166 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2167 (outs DPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINi4D,
2168 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2169 [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vn), (TyQ QPR:$Vm))))]> {
2170 let isCommutable = Commutable;
2173 // Long 3-register operations.
2174 class N3VL<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2175 InstrItinClass itin, string OpcodeStr, string Dt,
2176 ValueType TyQ, ValueType TyD, SDNode OpNode, bit Commutable>
2177 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2178 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2179 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2180 [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
2181 let isCommutable = Commutable;
2183 class N3VLSL<bit op24, bits<2> op21_20, bits<4> op11_8,
2184 InstrItinClass itin, string OpcodeStr, string Dt,
2185 ValueType TyQ, ValueType TyD, SDNode OpNode>
2186 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
2187 (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
2188 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
2190 (TyQ (OpNode (TyD DPR:$Vn),
2191 (TyD (NEONvduplane (TyD DPR_VFP2:$Vm),imm:$lane)))))]>;
2192 class N3VLSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
2193 InstrItinClass itin, string OpcodeStr, string Dt,
2194 ValueType TyQ, ValueType TyD, SDNode OpNode>
2195 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
2196 (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
2197 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
2199 (TyQ (OpNode (TyD DPR:$Vn),
2200 (TyD (NEONvduplane (TyD DPR_8:$Vm), imm:$lane)))))]>;
2202 // Long 3-register operations with explicitly extended operands.
2203 class N3VLExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2204 InstrItinClass itin, string OpcodeStr, string Dt,
2205 ValueType TyQ, ValueType TyD, SDNode OpNode, SDNode ExtOp,
2207 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2208 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2209 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2210 [(set QPR:$Vd, (OpNode (TyQ (ExtOp (TyD DPR:$Vn))),
2211 (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
2212 let isCommutable = Commutable;
2215 // Long 3-register intrinsics with explicit extend (VABDL).
2216 class N3VLIntExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2217 InstrItinClass itin, string OpcodeStr, string Dt,
2218 ValueType TyQ, ValueType TyD, Intrinsic IntOp, SDNode ExtOp,
2220 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2221 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2222 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2223 [(set QPR:$Vd, (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
2224 (TyD DPR:$Vm))))))]> {
2225 let isCommutable = Commutable;
2228 // Long 3-register intrinsics.
2229 class N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2230 InstrItinClass itin, string OpcodeStr, string Dt,
2231 ValueType TyQ, ValueType TyD, Intrinsic IntOp, bit Commutable>
2232 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2233 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2234 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2235 [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
2236 let isCommutable = Commutable;
2238 class N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2239 string OpcodeStr, string Dt,
2240 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2241 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
2242 (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, nohash_imm:$lane),
2243 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
2244 [(set (ResTy QPR:$Vd),
2245 (ResTy (IntOp (OpTy DPR:$Vn),
2246 (OpTy (NEONvduplane (OpTy DPR_VFP2:$Vm),
2248 class N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
2249 InstrItinClass itin, string OpcodeStr, string Dt,
2250 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2251 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
2252 (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
2253 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "",
2254 [(set (ResTy QPR:$Vd),
2255 (ResTy (IntOp (OpTy DPR:$Vn),
2256 (OpTy (NEONvduplane (OpTy DPR_8:$Vm),
2259 // Wide 3-register operations.
2260 class N3VW<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2261 string OpcodeStr, string Dt, ValueType TyQ, ValueType TyD,
2262 SDNode OpNode, SDNode ExtOp, bit Commutable>
2263 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2264 (outs QPR:$Vd), (ins QPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VSUBiD,
2265 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2266 [(set QPR:$Vd, (OpNode (TyQ QPR:$Vn),
2267 (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
2268 let isCommutable = Commutable;
2271 // Pairwise long 2-register intrinsics, both double- and quad-register.
2272 class N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2273 bits<2> op17_16, bits<5> op11_7, bit op4,
2274 string OpcodeStr, string Dt,
2275 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2276 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
2277 (ins DPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
2278 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
2279 class N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2280 bits<2> op17_16, bits<5> op11_7, bit op4,
2281 string OpcodeStr, string Dt,
2282 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2283 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
2284 (ins QPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
2285 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
2287 // Pairwise long 2-register accumulate intrinsics,
2288 // both double- and quad-register.
2289 // The destination register is also used as the first source operand register.
2290 class N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2291 bits<2> op17_16, bits<5> op11_7, bit op4,
2292 string OpcodeStr, string Dt,
2293 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2294 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
2295 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vm), IIC_VPALiD,
2296 OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
2297 [(set DPR:$Vd, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$Vm))))]>;
2298 class N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2299 bits<2> op17_16, bits<5> op11_7, bit op4,
2300 string OpcodeStr, string Dt,
2301 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2302 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
2303 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vm), IIC_VPALiQ,
2304 OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
2305 [(set QPR:$Vd, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$Vm))))]>;
2307 // Shift by immediate,
2308 // both double- and quad-register.
2309 class N2VDSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2310 Format f, InstrItinClass itin, Operand ImmTy,
2311 string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
2312 : N2VImm<op24, op23, op11_8, op7, 0, op4,
2313 (outs DPR:$Vd), (ins DPR:$Vm, ImmTy:$SIMM), f, itin,
2314 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2315 [(set DPR:$Vd, (Ty (OpNode (Ty DPR:$Vm), (i32 imm:$SIMM))))]>;
2316 class N2VQSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2317 Format f, InstrItinClass itin, Operand ImmTy,
2318 string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
2319 : N2VImm<op24, op23, op11_8, op7, 1, op4,
2320 (outs QPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), f, itin,
2321 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2322 [(set QPR:$Vd, (Ty (OpNode (Ty QPR:$Vm), (i32 imm:$SIMM))))]>;
2324 // Long shift by immediate.
2325 class N2VLSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
2326 string OpcodeStr, string Dt,
2327 ValueType ResTy, ValueType OpTy, SDNode OpNode>
2328 : N2VImm<op24, op23, op11_8, op7, op6, op4,
2329 (outs QPR:$Vd), (ins DPR:$Vm, i32imm:$SIMM), N2RegVShLFrm,
2330 IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2331 [(set QPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm),
2332 (i32 imm:$SIMM))))]>;
2334 // Narrow shift by immediate.
2335 class N2VNSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
2336 InstrItinClass itin, string OpcodeStr, string Dt,
2337 ValueType ResTy, ValueType OpTy, Operand ImmTy, SDNode OpNode>
2338 : N2VImm<op24, op23, op11_8, op7, op6, op4,
2339 (outs DPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, itin,
2340 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2341 [(set DPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm),
2342 (i32 imm:$SIMM))))]>;
2344 // Shift right by immediate and accumulate,
2345 // both double- and quad-register.
2346 class N2VDShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2347 Operand ImmTy, string OpcodeStr, string Dt,
2348 ValueType Ty, SDNode ShOp>
2349 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
2350 (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
2351 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2352 [(set DPR:$Vd, (Ty (add DPR:$src1,
2353 (Ty (ShOp DPR:$Vm, (i32 imm:$SIMM))))))]>;
2354 class N2VQShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2355 Operand ImmTy, string OpcodeStr, string Dt,
2356 ValueType Ty, SDNode ShOp>
2357 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
2358 (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
2359 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2360 [(set QPR:$Vd, (Ty (add QPR:$src1,
2361 (Ty (ShOp QPR:$Vm, (i32 imm:$SIMM))))))]>;
2363 // Shift by immediate and insert,
2364 // both double- and quad-register.
2365 class N2VDShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2366 Operand ImmTy, Format f, string OpcodeStr, string Dt,
2367 ValueType Ty,SDNode ShOp>
2368 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
2369 (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiD,
2370 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2371 [(set DPR:$Vd, (Ty (ShOp DPR:$src1, DPR:$Vm, (i32 imm:$SIMM))))]>;
2372 class N2VQShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2373 Operand ImmTy, Format f, string OpcodeStr, string Dt,
2374 ValueType Ty,SDNode ShOp>
2375 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
2376 (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiQ,
2377 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2378 [(set QPR:$Vd, (Ty (ShOp QPR:$src1, QPR:$Vm, (i32 imm:$SIMM))))]>;
2380 // Convert, with fractional bits immediate,
2381 // both double- and quad-register.
2382 class N2VCvtD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2383 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
2385 : N2VImm<op24, op23, op11_8, op7, 0, op4,
2386 (outs DPR:$Vd), (ins DPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
2387 IIC_VUNAD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2388 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (i32 imm:$SIMM))))]>;
2389 class N2VCvtQ<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2390 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
2392 : N2VImm<op24, op23, op11_8, op7, 1, op4,
2393 (outs QPR:$Vd), (ins QPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
2394 IIC_VUNAQ, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2395 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (i32 imm:$SIMM))))]>;
2397 //===----------------------------------------------------------------------===//
2399 //===----------------------------------------------------------------------===//
2401 // Abbreviations used in multiclass suffixes:
2402 // Q = quarter int (8 bit) elements
2403 // H = half int (16 bit) elements
2404 // S = single int (32 bit) elements
2405 // D = double int (64 bit) elements
2407 // Neon 2-register vector operations and intrinsics.
2409 // Neon 2-register comparisons.
2410 // source operand element sizes of 8, 16 and 32 bits:
2411 multiclass N2V_QHS_cmp<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2412 bits<5> op11_7, bit op4, string opc, string Dt,
2413 string asm, SDNode OpNode> {
2414 // 64-bit vector types.
2415 def v8i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 0, op4,
2416 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
2417 opc, !strconcat(Dt, "8"), asm, "",
2418 [(set DPR:$Vd, (v8i8 (OpNode (v8i8 DPR:$Vm))))]>;
2419 def v4i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
2420 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
2421 opc, !strconcat(Dt, "16"), asm, "",
2422 [(set DPR:$Vd, (v4i16 (OpNode (v4i16 DPR:$Vm))))]>;
2423 def v2i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
2424 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
2425 opc, !strconcat(Dt, "32"), asm, "",
2426 [(set DPR:$Vd, (v2i32 (OpNode (v2i32 DPR:$Vm))))]>;
2427 def v2f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
2428 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
2429 opc, "f32", asm, "",
2430 [(set DPR:$Vd, (v2i32 (OpNode (v2f32 DPR:$Vm))))]> {
2431 let Inst{10} = 1; // overwrite F = 1
2434 // 128-bit vector types.
2435 def v16i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 1, op4,
2436 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
2437 opc, !strconcat(Dt, "8"), asm, "",
2438 [(set QPR:$Vd, (v16i8 (OpNode (v16i8 QPR:$Vm))))]>;
2439 def v8i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
2440 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
2441 opc, !strconcat(Dt, "16"), asm, "",
2442 [(set QPR:$Vd, (v8i16 (OpNode (v8i16 QPR:$Vm))))]>;
2443 def v4i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
2444 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
2445 opc, !strconcat(Dt, "32"), asm, "",
2446 [(set QPR:$Vd, (v4i32 (OpNode (v4i32 QPR:$Vm))))]>;
2447 def v4f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
2448 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
2449 opc, "f32", asm, "",
2450 [(set QPR:$Vd, (v4i32 (OpNode (v4f32 QPR:$Vm))))]> {
2451 let Inst{10} = 1; // overwrite F = 1
2456 // Neon 2-register vector intrinsics,
2457 // element sizes of 8, 16 and 32 bits:
2458 multiclass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2459 bits<5> op11_7, bit op4,
2460 InstrItinClass itinD, InstrItinClass itinQ,
2461 string OpcodeStr, string Dt, Intrinsic IntOp> {
2462 // 64-bit vector types.
2463 def v8i8 : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2464 itinD, OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
2465 def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2466 itinD, OpcodeStr, !strconcat(Dt, "16"),v4i16,v4i16,IntOp>;
2467 def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2468 itinD, OpcodeStr, !strconcat(Dt, "32"),v2i32,v2i32,IntOp>;
2470 // 128-bit vector types.
2471 def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2472 itinQ, OpcodeStr, !strconcat(Dt, "8"), v16i8,v16i8,IntOp>;
2473 def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2474 itinQ, OpcodeStr, !strconcat(Dt, "16"),v8i16,v8i16,IntOp>;
2475 def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2476 itinQ, OpcodeStr, !strconcat(Dt, "32"),v4i32,v4i32,IntOp>;
2480 // Neon Narrowing 2-register vector operations,
2481 // source operand element sizes of 16, 32 and 64 bits:
2482 multiclass N2VN_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2483 bits<5> op11_7, bit op6, bit op4,
2484 InstrItinClass itin, string OpcodeStr, string Dt,
2486 def v8i8 : N2VN<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
2487 itin, OpcodeStr, !strconcat(Dt, "16"),
2488 v8i8, v8i16, OpNode>;
2489 def v4i16 : N2VN<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
2490 itin, OpcodeStr, !strconcat(Dt, "32"),
2491 v4i16, v4i32, OpNode>;
2492 def v2i32 : N2VN<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
2493 itin, OpcodeStr, !strconcat(Dt, "64"),
2494 v2i32, v2i64, OpNode>;
2497 // Neon Narrowing 2-register vector intrinsics,
2498 // source operand element sizes of 16, 32 and 64 bits:
2499 multiclass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2500 bits<5> op11_7, bit op6, bit op4,
2501 InstrItinClass itin, string OpcodeStr, string Dt,
2503 def v8i8 : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
2504 itin, OpcodeStr, !strconcat(Dt, "16"),
2505 v8i8, v8i16, IntOp>;
2506 def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
2507 itin, OpcodeStr, !strconcat(Dt, "32"),
2508 v4i16, v4i32, IntOp>;
2509 def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
2510 itin, OpcodeStr, !strconcat(Dt, "64"),
2511 v2i32, v2i64, IntOp>;
2515 // Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
2516 // source operand element sizes of 16, 32 and 64 bits:
2517 multiclass N2VL_QHS<bits<2> op24_23, bits<5> op11_7, bit op6, bit op4,
2518 string OpcodeStr, string Dt, SDNode OpNode> {
2519 def v8i16 : N2VL<op24_23, 0b00, 0b10, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
2520 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode>;
2521 def v4i32 : N2VL<op24_23, 0b01, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
2522 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
2523 def v2i64 : N2VL<op24_23, 0b10, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
2524 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
2528 // Neon 3-register vector operations.
2530 // First with only element sizes of 8, 16 and 32 bits:
2531 multiclass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2532 InstrItinClass itinD16, InstrItinClass itinD32,
2533 InstrItinClass itinQ16, InstrItinClass itinQ32,
2534 string OpcodeStr, string Dt,
2535 SDNode OpNode, bit Commutable = 0> {
2536 // 64-bit vector types.
2537 def v8i8 : N3VD<op24, op23, 0b00, op11_8, op4, itinD16,
2538 OpcodeStr, !strconcat(Dt, "8"),
2539 v8i8, v8i8, OpNode, Commutable>;
2540 def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16,
2541 OpcodeStr, !strconcat(Dt, "16"),
2542 v4i16, v4i16, OpNode, Commutable>;
2543 def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32,
2544 OpcodeStr, !strconcat(Dt, "32"),
2545 v2i32, v2i32, OpNode, Commutable>;
2547 // 128-bit vector types.
2548 def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16,
2549 OpcodeStr, !strconcat(Dt, "8"),
2550 v16i8, v16i8, OpNode, Commutable>;
2551 def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16,
2552 OpcodeStr, !strconcat(Dt, "16"),
2553 v8i16, v8i16, OpNode, Commutable>;
2554 def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32,
2555 OpcodeStr, !strconcat(Dt, "32"),
2556 v4i32, v4i32, OpNode, Commutable>;
2559 multiclass N3VSL_HS<bits<4> op11_8, string OpcodeStr, string Dt, SDNode ShOp> {
2560 def v4i16 : N3VDSL16<0b01, op11_8, OpcodeStr, !strconcat(Dt, "16"),
2562 def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, OpcodeStr, !strconcat(Dt,"32"),
2564 def v8i16 : N3VQSL16<0b01, op11_8, OpcodeStr, !strconcat(Dt, "16"),
2565 v8i16, v4i16, ShOp>;
2566 def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, OpcodeStr, !strconcat(Dt,"32"),
2567 v4i32, v2i32, ShOp>;
2570 // ....then also with element size 64 bits:
2571 multiclass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2572 InstrItinClass itinD, InstrItinClass itinQ,
2573 string OpcodeStr, string Dt,
2574 SDNode OpNode, bit Commutable = 0>
2575 : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ,
2576 OpcodeStr, Dt, OpNode, Commutable> {
2577 def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD,
2578 OpcodeStr, !strconcat(Dt, "64"),
2579 v1i64, v1i64, OpNode, Commutable>;
2580 def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ,
2581 OpcodeStr, !strconcat(Dt, "64"),
2582 v2i64, v2i64, OpNode, Commutable>;
2586 // Neon 3-register vector intrinsics.
2588 // First with only element sizes of 16 and 32 bits:
2589 multiclass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2590 InstrItinClass itinD16, InstrItinClass itinD32,
2591 InstrItinClass itinQ16, InstrItinClass itinQ32,
2592 string OpcodeStr, string Dt,
2593 Intrinsic IntOp, bit Commutable = 0> {
2594 // 64-bit vector types.
2595 def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, f, itinD16,
2596 OpcodeStr, !strconcat(Dt, "16"),
2597 v4i16, v4i16, IntOp, Commutable>;
2598 def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, f, itinD32,
2599 OpcodeStr, !strconcat(Dt, "32"),
2600 v2i32, v2i32, IntOp, Commutable>;
2602 // 128-bit vector types.
2603 def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, f, itinQ16,
2604 OpcodeStr, !strconcat(Dt, "16"),
2605 v8i16, v8i16, IntOp, Commutable>;
2606 def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, f, itinQ32,
2607 OpcodeStr, !strconcat(Dt, "32"),
2608 v4i32, v4i32, IntOp, Commutable>;
2610 multiclass N3VInt_HSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2611 InstrItinClass itinD16, InstrItinClass itinD32,
2612 InstrItinClass itinQ16, InstrItinClass itinQ32,
2613 string OpcodeStr, string Dt,
2615 // 64-bit vector types.
2616 def v4i16 : N3VDIntSh<op24, op23, 0b01, op11_8, op4, f, itinD16,
2617 OpcodeStr, !strconcat(Dt, "16"),
2618 v4i16, v4i16, IntOp>;
2619 def v2i32 : N3VDIntSh<op24, op23, 0b10, op11_8, op4, f, itinD32,
2620 OpcodeStr, !strconcat(Dt, "32"),
2621 v2i32, v2i32, IntOp>;
2623 // 128-bit vector types.
2624 def v8i16 : N3VQIntSh<op24, op23, 0b01, op11_8, op4, f, itinQ16,
2625 OpcodeStr, !strconcat(Dt, "16"),
2626 v8i16, v8i16, IntOp>;
2627 def v4i32 : N3VQIntSh<op24, op23, 0b10, op11_8, op4, f, itinQ32,
2628 OpcodeStr, !strconcat(Dt, "32"),
2629 v4i32, v4i32, IntOp>;
2632 multiclass N3VIntSL_HS<bits<4> op11_8,
2633 InstrItinClass itinD16, InstrItinClass itinD32,
2634 InstrItinClass itinQ16, InstrItinClass itinQ32,
2635 string OpcodeStr, string Dt, Intrinsic IntOp> {
2636 def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16,
2637 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp>;
2638 def v2i32 : N3VDIntSL<0b10, op11_8, itinD32,
2639 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp>;
2640 def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16,
2641 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16, IntOp>;
2642 def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32,
2643 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32, IntOp>;
2646 // ....then also with element size of 8 bits:
2647 multiclass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2648 InstrItinClass itinD16, InstrItinClass itinD32,
2649 InstrItinClass itinQ16, InstrItinClass itinQ32,
2650 string OpcodeStr, string Dt,
2651 Intrinsic IntOp, bit Commutable = 0>
2652 : N3VInt_HS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2653 OpcodeStr, Dt, IntOp, Commutable> {
2654 def v8i8 : N3VDInt<op24, op23, 0b00, op11_8, op4, f, itinD16,
2655 OpcodeStr, !strconcat(Dt, "8"),
2656 v8i8, v8i8, IntOp, Commutable>;
2657 def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, f, itinQ16,
2658 OpcodeStr, !strconcat(Dt, "8"),
2659 v16i8, v16i8, IntOp, Commutable>;
2661 multiclass N3VInt_QHSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2662 InstrItinClass itinD16, InstrItinClass itinD32,
2663 InstrItinClass itinQ16, InstrItinClass itinQ32,
2664 string OpcodeStr, string Dt,
2666 : N3VInt_HSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2667 OpcodeStr, Dt, IntOp> {
2668 def v8i8 : N3VDIntSh<op24, op23, 0b00, op11_8, op4, f, itinD16,
2669 OpcodeStr, !strconcat(Dt, "8"),
2671 def v16i8 : N3VQIntSh<op24, op23, 0b00, op11_8, op4, f, itinQ16,
2672 OpcodeStr, !strconcat(Dt, "8"),
2673 v16i8, v16i8, IntOp>;
2677 // ....then also with element size of 64 bits:
2678 multiclass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2679 InstrItinClass itinD16, InstrItinClass itinD32,
2680 InstrItinClass itinQ16, InstrItinClass itinQ32,
2681 string OpcodeStr, string Dt,
2682 Intrinsic IntOp, bit Commutable = 0>
2683 : N3VInt_QHS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2684 OpcodeStr, Dt, IntOp, Commutable> {
2685 def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, f, itinD32,
2686 OpcodeStr, !strconcat(Dt, "64"),
2687 v1i64, v1i64, IntOp, Commutable>;
2688 def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, f, itinQ32,
2689 OpcodeStr, !strconcat(Dt, "64"),
2690 v2i64, v2i64, IntOp, Commutable>;
2692 multiclass N3VInt_QHSDSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2693 InstrItinClass itinD16, InstrItinClass itinD32,
2694 InstrItinClass itinQ16, InstrItinClass itinQ32,
2695 string OpcodeStr, string Dt,
2697 : N3VInt_QHSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2698 OpcodeStr, Dt, IntOp> {
2699 def v1i64 : N3VDIntSh<op24, op23, 0b11, op11_8, op4, f, itinD32,
2700 OpcodeStr, !strconcat(Dt, "64"),
2701 v1i64, v1i64, IntOp>;
2702 def v2i64 : N3VQIntSh<op24, op23, 0b11, op11_8, op4, f, itinQ32,
2703 OpcodeStr, !strconcat(Dt, "64"),
2704 v2i64, v2i64, IntOp>;
2707 // Neon Narrowing 3-register vector intrinsics,
2708 // source operand element sizes of 16, 32 and 64 bits:
2709 multiclass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2710 string OpcodeStr, string Dt,
2711 Intrinsic IntOp, bit Commutable = 0> {
2712 def v8i8 : N3VNInt<op24, op23, 0b00, op11_8, op4,
2713 OpcodeStr, !strconcat(Dt, "16"),
2714 v8i8, v8i16, IntOp, Commutable>;
2715 def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4,
2716 OpcodeStr, !strconcat(Dt, "32"),
2717 v4i16, v4i32, IntOp, Commutable>;
2718 def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4,
2719 OpcodeStr, !strconcat(Dt, "64"),
2720 v2i32, v2i64, IntOp, Commutable>;
2724 // Neon Long 3-register vector operations.
2726 multiclass N3VL_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2727 InstrItinClass itin16, InstrItinClass itin32,
2728 string OpcodeStr, string Dt,
2729 SDNode OpNode, bit Commutable = 0> {
2730 def v8i16 : N3VL<op24, op23, 0b00, op11_8, op4, itin16,
2731 OpcodeStr, !strconcat(Dt, "8"),
2732 v8i16, v8i8, OpNode, Commutable>;
2733 def v4i32 : N3VL<op24, op23, 0b01, op11_8, op4, itin16,
2734 OpcodeStr, !strconcat(Dt, "16"),
2735 v4i32, v4i16, OpNode, Commutable>;
2736 def v2i64 : N3VL<op24, op23, 0b10, op11_8, op4, itin32,
2737 OpcodeStr, !strconcat(Dt, "32"),
2738 v2i64, v2i32, OpNode, Commutable>;
2741 multiclass N3VLSL_HS<bit op24, bits<4> op11_8,
2742 InstrItinClass itin, string OpcodeStr, string Dt,
2744 def v4i16 : N3VLSL16<op24, 0b01, op11_8, itin, OpcodeStr,
2745 !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
2746 def v2i32 : N3VLSL<op24, 0b10, op11_8, itin, OpcodeStr,
2747 !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
2750 multiclass N3VLExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2751 InstrItinClass itin16, InstrItinClass itin32,
2752 string OpcodeStr, string Dt,
2753 SDNode OpNode, SDNode ExtOp, bit Commutable = 0> {
2754 def v8i16 : N3VLExt<op24, op23, 0b00, op11_8, op4, itin16,
2755 OpcodeStr, !strconcat(Dt, "8"),
2756 v8i16, v8i8, OpNode, ExtOp, Commutable>;
2757 def v4i32 : N3VLExt<op24, op23, 0b01, op11_8, op4, itin16,
2758 OpcodeStr, !strconcat(Dt, "16"),
2759 v4i32, v4i16, OpNode, ExtOp, Commutable>;
2760 def v2i64 : N3VLExt<op24, op23, 0b10, op11_8, op4, itin32,
2761 OpcodeStr, !strconcat(Dt, "32"),
2762 v2i64, v2i32, OpNode, ExtOp, Commutable>;
2765 // Neon Long 3-register vector intrinsics.
2767 // First with only element sizes of 16 and 32 bits:
2768 multiclass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
2769 InstrItinClass itin16, InstrItinClass itin32,
2770 string OpcodeStr, string Dt,
2771 Intrinsic IntOp, bit Commutable = 0> {
2772 def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin16,
2773 OpcodeStr, !strconcat(Dt, "16"),
2774 v4i32, v4i16, IntOp, Commutable>;
2775 def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin32,
2776 OpcodeStr, !strconcat(Dt, "32"),
2777 v2i64, v2i32, IntOp, Commutable>;
2780 multiclass N3VLIntSL_HS<bit op24, bits<4> op11_8,
2781 InstrItinClass itin, string OpcodeStr, string Dt,
2783 def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin,
2784 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
2785 def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin,
2786 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
2789 // ....then also with element size of 8 bits:
2790 multiclass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2791 InstrItinClass itin16, InstrItinClass itin32,
2792 string OpcodeStr, string Dt,
2793 Intrinsic IntOp, bit Commutable = 0>
2794 : N3VLInt_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt,
2795 IntOp, Commutable> {
2796 def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin16,
2797 OpcodeStr, !strconcat(Dt, "8"),
2798 v8i16, v8i8, IntOp, Commutable>;
2801 // ....with explicit extend (VABDL).
2802 multiclass N3VLIntExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2803 InstrItinClass itin, string OpcodeStr, string Dt,
2804 Intrinsic IntOp, SDNode ExtOp, bit Commutable = 0> {
2805 def v8i16 : N3VLIntExt<op24, op23, 0b00, op11_8, op4, itin,
2806 OpcodeStr, !strconcat(Dt, "8"),
2807 v8i16, v8i8, IntOp, ExtOp, Commutable>;
2808 def v4i32 : N3VLIntExt<op24, op23, 0b01, op11_8, op4, itin,
2809 OpcodeStr, !strconcat(Dt, "16"),
2810 v4i32, v4i16, IntOp, ExtOp, Commutable>;
2811 def v2i64 : N3VLIntExt<op24, op23, 0b10, op11_8, op4, itin,
2812 OpcodeStr, !strconcat(Dt, "32"),
2813 v2i64, v2i32, IntOp, ExtOp, Commutable>;
2817 // Neon Wide 3-register vector intrinsics,
2818 // source operand element sizes of 8, 16 and 32 bits:
2819 multiclass N3VW_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2820 string OpcodeStr, string Dt,
2821 SDNode OpNode, SDNode ExtOp, bit Commutable = 0> {
2822 def v8i16 : N3VW<op24, op23, 0b00, op11_8, op4,
2823 OpcodeStr, !strconcat(Dt, "8"),
2824 v8i16, v8i8, OpNode, ExtOp, Commutable>;
2825 def v4i32 : N3VW<op24, op23, 0b01, op11_8, op4,
2826 OpcodeStr, !strconcat(Dt, "16"),
2827 v4i32, v4i16, OpNode, ExtOp, Commutable>;
2828 def v2i64 : N3VW<op24, op23, 0b10, op11_8, op4,
2829 OpcodeStr, !strconcat(Dt, "32"),
2830 v2i64, v2i32, OpNode, ExtOp, Commutable>;
2834 // Neon Multiply-Op vector operations,
2835 // element sizes of 8, 16 and 32 bits:
2836 multiclass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2837 InstrItinClass itinD16, InstrItinClass itinD32,
2838 InstrItinClass itinQ16, InstrItinClass itinQ32,
2839 string OpcodeStr, string Dt, SDNode OpNode> {
2840 // 64-bit vector types.
2841 def v8i8 : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16,
2842 OpcodeStr, !strconcat(Dt, "8"), v8i8, mul, OpNode>;
2843 def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16,
2844 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, OpNode>;
2845 def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32,
2846 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, OpNode>;
2848 // 128-bit vector types.
2849 def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16,
2850 OpcodeStr, !strconcat(Dt, "8"), v16i8, mul, OpNode>;
2851 def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16,
2852 OpcodeStr, !strconcat(Dt, "16"), v8i16, mul, OpNode>;
2853 def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32,
2854 OpcodeStr, !strconcat(Dt, "32"), v4i32, mul, OpNode>;
2857 multiclass N3VMulOpSL_HS<bits<4> op11_8,
2858 InstrItinClass itinD16, InstrItinClass itinD32,
2859 InstrItinClass itinQ16, InstrItinClass itinQ32,
2860 string OpcodeStr, string Dt, SDNode ShOp> {
2861 def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16,
2862 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, ShOp>;
2863 def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32,
2864 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, ShOp>;
2865 def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16,
2866 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16,
2868 def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32,
2869 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32,
2873 // Neon Intrinsic-Op vector operations,
2874 // element sizes of 8, 16 and 32 bits:
2875 multiclass N3VIntOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2876 InstrItinClass itinD, InstrItinClass itinQ,
2877 string OpcodeStr, string Dt, Intrinsic IntOp,
2879 // 64-bit vector types.
2880 def v8i8 : N3VDIntOp<op24, op23, 0b00, op11_8, op4, itinD,
2881 OpcodeStr, !strconcat(Dt, "8"), v8i8, IntOp, OpNode>;
2882 def v4i16 : N3VDIntOp<op24, op23, 0b01, op11_8, op4, itinD,
2883 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp, OpNode>;
2884 def v2i32 : N3VDIntOp<op24, op23, 0b10, op11_8, op4, itinD,
2885 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp, OpNode>;
2887 // 128-bit vector types.
2888 def v16i8 : N3VQIntOp<op24, op23, 0b00, op11_8, op4, itinQ,
2889 OpcodeStr, !strconcat(Dt, "8"), v16i8, IntOp, OpNode>;
2890 def v8i16 : N3VQIntOp<op24, op23, 0b01, op11_8, op4, itinQ,
2891 OpcodeStr, !strconcat(Dt, "16"), v8i16, IntOp, OpNode>;
2892 def v4i32 : N3VQIntOp<op24, op23, 0b10, op11_8, op4, itinQ,
2893 OpcodeStr, !strconcat(Dt, "32"), v4i32, IntOp, OpNode>;
2896 // Neon 3-argument intrinsics,
2897 // element sizes of 8, 16 and 32 bits:
2898 multiclass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2899 InstrItinClass itinD, InstrItinClass itinQ,
2900 string OpcodeStr, string Dt, Intrinsic IntOp> {
2901 // 64-bit vector types.
2902 def v8i8 : N3VDInt3<op24, op23, 0b00, op11_8, op4, itinD,
2903 OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
2904 def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, itinD,
2905 OpcodeStr, !strconcat(Dt, "16"), v4i16, v4i16, IntOp>;
2906 def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, itinD,
2907 OpcodeStr, !strconcat(Dt, "32"), v2i32, v2i32, IntOp>;
2909 // 128-bit vector types.
2910 def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, itinQ,
2911 OpcodeStr, !strconcat(Dt, "8"), v16i8, v16i8, IntOp>;
2912 def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, itinQ,
2913 OpcodeStr, !strconcat(Dt, "16"), v8i16, v8i16, IntOp>;
2914 def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, itinQ,
2915 OpcodeStr, !strconcat(Dt, "32"), v4i32, v4i32, IntOp>;
2919 // Neon Long Multiply-Op vector operations,
2920 // element sizes of 8, 16 and 32 bits:
2921 multiclass N3VLMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2922 InstrItinClass itin16, InstrItinClass itin32,
2923 string OpcodeStr, string Dt, SDNode MulOp,
2925 def v8i16 : N3VLMulOp<op24, op23, 0b00, op11_8, op4, itin16, OpcodeStr,
2926 !strconcat(Dt, "8"), v8i16, v8i8, MulOp, OpNode>;
2927 def v4i32 : N3VLMulOp<op24, op23, 0b01, op11_8, op4, itin16, OpcodeStr,
2928 !strconcat(Dt, "16"), v4i32, v4i16, MulOp, OpNode>;
2929 def v2i64 : N3VLMulOp<op24, op23, 0b10, op11_8, op4, itin32, OpcodeStr,
2930 !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
2933 multiclass N3VLMulOpSL_HS<bit op24, bits<4> op11_8, string OpcodeStr,
2934 string Dt, SDNode MulOp, SDNode OpNode> {
2935 def v4i16 : N3VLMulOpSL16<op24, 0b01, op11_8, IIC_VMACi16D, OpcodeStr,
2936 !strconcat(Dt,"16"), v4i32, v4i16, MulOp, OpNode>;
2937 def v2i32 : N3VLMulOpSL<op24, 0b10, op11_8, IIC_VMACi32D, OpcodeStr,
2938 !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
2942 // Neon Long 3-argument intrinsics.
2944 // First with only element sizes of 16 and 32 bits:
2945 multiclass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
2946 InstrItinClass itin16, InstrItinClass itin32,
2947 string OpcodeStr, string Dt, Intrinsic IntOp> {
2948 def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, itin16,
2949 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
2950 def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, itin32,
2951 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
2954 multiclass N3VLInt3SL_HS<bit op24, bits<4> op11_8,
2955 string OpcodeStr, string Dt, Intrinsic IntOp> {
2956 def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D,
2957 OpcodeStr, !strconcat(Dt,"16"), v4i32, v4i16, IntOp>;
2958 def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D,
2959 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
2962 // ....then also with element size of 8 bits:
2963 multiclass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2964 InstrItinClass itin16, InstrItinClass itin32,
2965 string OpcodeStr, string Dt, Intrinsic IntOp>
2966 : N3VLInt3_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt, IntOp> {
2967 def v8i16 : N3VLInt3<op24, op23, 0b00, op11_8, op4, itin16,
2968 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, IntOp>;
2971 // ....with explicit extend (VABAL).
2972 multiclass N3VLIntExtOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2973 InstrItinClass itin, string OpcodeStr, string Dt,
2974 Intrinsic IntOp, SDNode ExtOp, SDNode OpNode> {
2975 def v8i16 : N3VLIntExtOp<op24, op23, 0b00, op11_8, op4, itin,
2976 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8,
2977 IntOp, ExtOp, OpNode>;
2978 def v4i32 : N3VLIntExtOp<op24, op23, 0b01, op11_8, op4, itin,
2979 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16,
2980 IntOp, ExtOp, OpNode>;
2981 def v2i64 : N3VLIntExtOp<op24, op23, 0b10, op11_8, op4, itin,
2982 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32,
2983 IntOp, ExtOp, OpNode>;
2987 // Neon Pairwise long 2-register intrinsics,
2988 // element sizes of 8, 16 and 32 bits:
2989 multiclass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2990 bits<5> op11_7, bit op4,
2991 string OpcodeStr, string Dt, Intrinsic IntOp> {
2992 // 64-bit vector types.
2993 def v8i8 : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2994 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
2995 def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2996 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
2997 def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2998 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
3000 // 128-bit vector types.
3001 def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3002 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
3003 def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3004 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
3005 def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3006 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
3010 // Neon Pairwise long 2-register accumulate intrinsics,
3011 // element sizes of 8, 16 and 32 bits:
3012 multiclass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
3013 bits<5> op11_7, bit op4,
3014 string OpcodeStr, string Dt, Intrinsic IntOp> {
3015 // 64-bit vector types.
3016 def v8i8 : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3017 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
3018 def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3019 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
3020 def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3021 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
3023 // 128-bit vector types.
3024 def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3025 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
3026 def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3027 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
3028 def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3029 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
3033 // Neon 2-register vector shift by immediate,
3034 // with f of either N2RegVShLFrm or N2RegVShRFrm
3035 // element sizes of 8, 16, 32 and 64 bits:
3036 multiclass N2VShL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3037 InstrItinClass itin, string OpcodeStr, string Dt,
3039 // 64-bit vector types.
3040 def v8i8 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
3041 OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
3042 let Inst{21-19} = 0b001; // imm6 = 001xxx
3044 def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
3045 OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
3046 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3048 def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
3049 OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
3050 let Inst{21} = 0b1; // imm6 = 1xxxxx
3052 def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
3053 OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
3056 // 128-bit vector types.
3057 def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
3058 OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
3059 let Inst{21-19} = 0b001; // imm6 = 001xxx
3061 def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
3062 OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
3063 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3065 def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
3066 OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
3067 let Inst{21} = 0b1; // imm6 = 1xxxxx
3069 def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
3070 OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
3073 multiclass N2VShR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3074 InstrItinClass itin, string OpcodeStr, string Dt,
3076 // 64-bit vector types.
3077 def v8i8 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
3078 OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
3079 let Inst{21-19} = 0b001; // imm6 = 001xxx
3081 def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
3082 OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
3083 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3085 def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
3086 OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
3087 let Inst{21} = 0b1; // imm6 = 1xxxxx
3089 def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
3090 OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
3093 // 128-bit vector types.
3094 def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
3095 OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
3096 let Inst{21-19} = 0b001; // imm6 = 001xxx
3098 def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
3099 OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
3100 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3102 def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
3103 OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
3104 let Inst{21} = 0b1; // imm6 = 1xxxxx
3106 def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
3107 OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
3111 // Neon Shift-Accumulate vector operations,
3112 // element sizes of 8, 16, 32 and 64 bits:
3113 multiclass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3114 string OpcodeStr, string Dt, SDNode ShOp> {
3115 // 64-bit vector types.
3116 def v8i8 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
3117 OpcodeStr, !strconcat(Dt, "8"), v8i8, ShOp> {
3118 let Inst{21-19} = 0b001; // imm6 = 001xxx
3120 def v4i16 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
3121 OpcodeStr, !strconcat(Dt, "16"), v4i16, ShOp> {
3122 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3124 def v2i32 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
3125 OpcodeStr, !strconcat(Dt, "32"), v2i32, ShOp> {
3126 let Inst{21} = 0b1; // imm6 = 1xxxxx
3128 def v1i64 : N2VDShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
3129 OpcodeStr, !strconcat(Dt, "64"), v1i64, ShOp>;
3132 // 128-bit vector types.
3133 def v16i8 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
3134 OpcodeStr, !strconcat(Dt, "8"), v16i8, ShOp> {
3135 let Inst{21-19} = 0b001; // imm6 = 001xxx
3137 def v8i16 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
3138 OpcodeStr, !strconcat(Dt, "16"), v8i16, ShOp> {
3139 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3141 def v4i32 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
3142 OpcodeStr, !strconcat(Dt, "32"), v4i32, ShOp> {
3143 let Inst{21} = 0b1; // imm6 = 1xxxxx
3145 def v2i64 : N2VQShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
3146 OpcodeStr, !strconcat(Dt, "64"), v2i64, ShOp>;
3150 // Neon Shift-Insert vector operations,
3151 // with f of either N2RegVShLFrm or N2RegVShRFrm
3152 // element sizes of 8, 16, 32 and 64 bits:
3153 multiclass N2VShInsL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3155 // 64-bit vector types.
3156 def v8i8 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
3157 N2RegVShLFrm, OpcodeStr, "8", v8i8, NEONvsli> {
3158 let Inst{21-19} = 0b001; // imm6 = 001xxx
3160 def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
3161 N2RegVShLFrm, OpcodeStr, "16", v4i16, NEONvsli> {
3162 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3164 def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
3165 N2RegVShLFrm, OpcodeStr, "32", v2i32, NEONvsli> {
3166 let Inst{21} = 0b1; // imm6 = 1xxxxx
3168 def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, i32imm,
3169 N2RegVShLFrm, OpcodeStr, "64", v1i64, NEONvsli>;
3172 // 128-bit vector types.
3173 def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
3174 N2RegVShLFrm, OpcodeStr, "8", v16i8, NEONvsli> {
3175 let Inst{21-19} = 0b001; // imm6 = 001xxx
3177 def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
3178 N2RegVShLFrm, OpcodeStr, "16", v8i16, NEONvsli> {
3179 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3181 def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
3182 N2RegVShLFrm, OpcodeStr, "32", v4i32, NEONvsli> {
3183 let Inst{21} = 0b1; // imm6 = 1xxxxx
3185 def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, i32imm,
3186 N2RegVShLFrm, OpcodeStr, "64", v2i64, NEONvsli>;
3189 multiclass N2VShInsR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3191 // 64-bit vector types.
3192 def v8i8 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm8,
3193 N2RegVShRFrm, OpcodeStr, "8", v8i8, NEONvsri> {
3194 let Inst{21-19} = 0b001; // imm6 = 001xxx
3196 def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm16,
3197 N2RegVShRFrm, OpcodeStr, "16", v4i16, NEONvsri> {
3198 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3200 def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm32,
3201 N2RegVShRFrm, OpcodeStr, "32", v2i32, NEONvsri> {
3202 let Inst{21} = 0b1; // imm6 = 1xxxxx
3204 def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, shr_imm64,
3205 N2RegVShRFrm, OpcodeStr, "64", v1i64, NEONvsri>;
3208 // 128-bit vector types.
3209 def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm8,
3210 N2RegVShRFrm, OpcodeStr, "8", v16i8, NEONvsri> {
3211 let Inst{21-19} = 0b001; // imm6 = 001xxx
3213 def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm16,
3214 N2RegVShRFrm, OpcodeStr, "16", v8i16, NEONvsri> {
3215 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3217 def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm32,
3218 N2RegVShRFrm, OpcodeStr, "32", v4i32, NEONvsri> {
3219 let Inst{21} = 0b1; // imm6 = 1xxxxx
3221 def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, shr_imm64,
3222 N2RegVShRFrm, OpcodeStr, "64", v2i64, NEONvsri>;
3226 // Neon Shift Long operations,
3227 // element sizes of 8, 16, 32 bits:
3228 multiclass N2VLSh_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
3229 bit op4, string OpcodeStr, string Dt, SDNode OpNode> {
3230 def v8i16 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
3231 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode> {
3232 let Inst{21-19} = 0b001; // imm6 = 001xxx
3234 def v4i32 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
3235 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode> {
3236 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3238 def v2i64 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
3239 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode> {
3240 let Inst{21} = 0b1; // imm6 = 1xxxxx
3244 // Neon Shift Narrow operations,
3245 // element sizes of 16, 32, 64 bits:
3246 multiclass N2VNSh_HSD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
3247 bit op4, InstrItinClass itin, string OpcodeStr, string Dt,
3249 def v8i8 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
3250 OpcodeStr, !strconcat(Dt, "16"),
3251 v8i8, v8i16, shr_imm8, OpNode> {
3252 let Inst{21-19} = 0b001; // imm6 = 001xxx
3254 def v4i16 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
3255 OpcodeStr, !strconcat(Dt, "32"),
3256 v4i16, v4i32, shr_imm16, OpNode> {
3257 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3259 def v2i32 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
3260 OpcodeStr, !strconcat(Dt, "64"),
3261 v2i32, v2i64, shr_imm32, OpNode> {
3262 let Inst{21} = 0b1; // imm6 = 1xxxxx
3266 //===----------------------------------------------------------------------===//
3267 // Instruction Definitions.
3268 //===----------------------------------------------------------------------===//
3270 // Vector Add Operations.
3272 // VADD : Vector Add (integer and floating-point)
3273 defm VADD : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd", "i",
3275 def VADDfd : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd", "f32",
3276 v2f32, v2f32, fadd, 1>;
3277 def VADDfq : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd", "f32",
3278 v4f32, v4f32, fadd, 1>;
3279 // VADDL : Vector Add Long (Q = D + D)
3280 defm VADDLs : N3VLExt_QHS<0,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
3281 "vaddl", "s", add, sext, 1>;
3282 defm VADDLu : N3VLExt_QHS<1,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
3283 "vaddl", "u", add, zext, 1>;
3284 // VADDW : Vector Add Wide (Q = Q + D)
3285 defm VADDWs : N3VW_QHS<0,1,0b0001,0, "vaddw", "s", add, sext, 0>;
3286 defm VADDWu : N3VW_QHS<1,1,0b0001,0, "vaddw", "u", add, zext, 0>;
3287 // VHADD : Vector Halving Add
3288 defm VHADDs : N3VInt_QHS<0, 0, 0b0000, 0, N3RegFrm,
3289 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3290 "vhadd", "s", int_arm_neon_vhadds, 1>;
3291 defm VHADDu : N3VInt_QHS<1, 0, 0b0000, 0, N3RegFrm,
3292 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3293 "vhadd", "u", int_arm_neon_vhaddu, 1>;
3294 // VRHADD : Vector Rounding Halving Add
3295 defm VRHADDs : N3VInt_QHS<0, 0, 0b0001, 0, N3RegFrm,
3296 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3297 "vrhadd", "s", int_arm_neon_vrhadds, 1>;
3298 defm VRHADDu : N3VInt_QHS<1, 0, 0b0001, 0, N3RegFrm,
3299 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3300 "vrhadd", "u", int_arm_neon_vrhaddu, 1>;
3301 // VQADD : Vector Saturating Add
3302 defm VQADDs : N3VInt_QHSD<0, 0, 0b0000, 1, N3RegFrm,
3303 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3304 "vqadd", "s", int_arm_neon_vqadds, 1>;
3305 defm VQADDu : N3VInt_QHSD<1, 0, 0b0000, 1, N3RegFrm,
3306 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3307 "vqadd", "u", int_arm_neon_vqaddu, 1>;
3308 // VADDHN : Vector Add and Narrow Returning High Half (D = Q + Q)
3309 defm VADDHN : N3VNInt_HSD<0,1,0b0100,0, "vaddhn", "i",
3310 int_arm_neon_vaddhn, 1>;
3311 // VRADDHN : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
3312 defm VRADDHN : N3VNInt_HSD<1,1,0b0100,0, "vraddhn", "i",
3313 int_arm_neon_vraddhn, 1>;
3315 // Vector Multiply Operations.
3317 // VMUL : Vector Multiply (integer, polynomial and floating-point)
3318 defm VMUL : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D,
3319 IIC_VMULi16Q, IIC_VMULi32Q, "vmul", "i", mul, 1>;
3320 def VMULpd : N3VDInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16D, "vmul",
3321 "p8", v8i8, v8i8, int_arm_neon_vmulp, 1>;
3322 def VMULpq : N3VQInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16Q, "vmul",
3323 "p8", v16i8, v16i8, int_arm_neon_vmulp, 1>;
3324 def VMULfd : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VFMULD, "vmul", "f32",
3325 v2f32, v2f32, fmul, 1>;
3326 def VMULfq : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VFMULQ, "vmul", "f32",
3327 v4f32, v4f32, fmul, 1>;
3328 defm VMULsl : N3VSL_HS<0b1000, "vmul", "i", mul>;
3329 def VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul", "f32", v2f32, fmul>;
3330 def VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul", "f32", v4f32,
3333 def : Pat<(v8i16 (mul (v8i16 QPR:$src1),
3334 (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))),
3335 (v8i16 (VMULslv8i16 (v8i16 QPR:$src1),
3336 (v4i16 (EXTRACT_SUBREG QPR:$src2,
3337 (DSubReg_i16_reg imm:$lane))),
3338 (SubReg_i16_lane imm:$lane)))>;
3339 def : Pat<(v4i32 (mul (v4i32 QPR:$src1),
3340 (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))),
3341 (v4i32 (VMULslv4i32 (v4i32 QPR:$src1),
3342 (v2i32 (EXTRACT_SUBREG QPR:$src2,
3343 (DSubReg_i32_reg imm:$lane))),
3344 (SubReg_i32_lane imm:$lane)))>;
3345 def : Pat<(v4f32 (fmul (v4f32 QPR:$src1),
3346 (v4f32 (NEONvduplane (v4f32 QPR:$src2), imm:$lane)))),
3347 (v4f32 (VMULslfq (v4f32 QPR:$src1),
3348 (v2f32 (EXTRACT_SUBREG QPR:$src2,
3349 (DSubReg_i32_reg imm:$lane))),
3350 (SubReg_i32_lane imm:$lane)))>;
3352 // VQDMULH : Vector Saturating Doubling Multiply Returning High Half
3353 defm VQDMULH : N3VInt_HS<0, 0, 0b1011, 0, N3RegFrm, IIC_VMULi16D, IIC_VMULi32D,
3354 IIC_VMULi16Q, IIC_VMULi32Q,
3355 "vqdmulh", "s", int_arm_neon_vqdmulh, 1>;
3356 defm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D,
3357 IIC_VMULi16Q, IIC_VMULi32Q,
3358 "vqdmulh", "s", int_arm_neon_vqdmulh>;
3359 def : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1),
3360 (v8i16 (NEONvduplane (v8i16 QPR:$src2),
3362 (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1),
3363 (v4i16 (EXTRACT_SUBREG QPR:$src2,
3364 (DSubReg_i16_reg imm:$lane))),
3365 (SubReg_i16_lane imm:$lane)))>;
3366 def : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1),
3367 (v4i32 (NEONvduplane (v4i32 QPR:$src2),
3369 (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1),
3370 (v2i32 (EXTRACT_SUBREG QPR:$src2,
3371 (DSubReg_i32_reg imm:$lane))),
3372 (SubReg_i32_lane imm:$lane)))>;
3374 // VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
3375 defm VQRDMULH : N3VInt_HS<1, 0, 0b1011, 0, N3RegFrm,
3376 IIC_VMULi16D,IIC_VMULi32D,IIC_VMULi16Q,IIC_VMULi32Q,
3377 "vqrdmulh", "s", int_arm_neon_vqrdmulh, 1>;
3378 defm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D,
3379 IIC_VMULi16Q, IIC_VMULi32Q,
3380 "vqrdmulh", "s", int_arm_neon_vqrdmulh>;
3381 def : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1),
3382 (v8i16 (NEONvduplane (v8i16 QPR:$src2),
3384 (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1),
3385 (v4i16 (EXTRACT_SUBREG QPR:$src2,
3386 (DSubReg_i16_reg imm:$lane))),
3387 (SubReg_i16_lane imm:$lane)))>;
3388 def : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1),
3389 (v4i32 (NEONvduplane (v4i32 QPR:$src2),
3391 (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1),
3392 (v2i32 (EXTRACT_SUBREG QPR:$src2,
3393 (DSubReg_i32_reg imm:$lane))),
3394 (SubReg_i32_lane imm:$lane)))>;
3396 // VMULL : Vector Multiply Long (integer and polynomial) (Q = D * D)
3397 defm VMULLs : N3VL_QHS<0,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
3398 "vmull", "s", NEONvmulls, 1>;
3399 defm VMULLu : N3VL_QHS<1,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
3400 "vmull", "u", NEONvmullu, 1>;
3401 def VMULLp : N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull", "p8",
3402 v8i16, v8i8, int_arm_neon_vmullp, 1>;
3403 defm VMULLsls : N3VLSL_HS<0, 0b1010, IIC_VMULi16D, "vmull", "s", NEONvmulls>;
3404 defm VMULLslu : N3VLSL_HS<1, 0b1010, IIC_VMULi16D, "vmull", "u", NEONvmullu>;
3406 // VQDMULL : Vector Saturating Doubling Multiply Long (Q = D * D)
3407 defm VQDMULL : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, IIC_VMULi32D,
3408 "vqdmull", "s", int_arm_neon_vqdmull, 1>;
3409 defm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D,
3410 "vqdmull", "s", int_arm_neon_vqdmull>;
3412 // Vector Multiply-Accumulate and Multiply-Subtract Operations.
3414 // VMLA : Vector Multiply Accumulate (integer and floating-point)
3415 defm VMLA : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
3416 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
3417 def VMLAfd : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla", "f32",
3418 v2f32, fmul_su, fadd_mlx>,
3419 Requires<[HasNEON, UseFPVMLx]>;
3420 def VMLAfq : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla", "f32",
3421 v4f32, fmul_su, fadd_mlx>,
3422 Requires<[HasNEON, UseFPVMLx]>;
3423 defm VMLAsl : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D,
3424 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
3425 def VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla", "f32",
3426 v2f32, fmul_su, fadd_mlx>,
3427 Requires<[HasNEON, UseFPVMLx]>;
3428 def VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla", "f32",
3429 v4f32, v2f32, fmul_su, fadd_mlx>,
3430 Requires<[HasNEON, UseFPVMLx]>;
3432 def : Pat<(v8i16 (add (v8i16 QPR:$src1),
3433 (mul (v8i16 QPR:$src2),
3434 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
3435 (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
3436 (v4i16 (EXTRACT_SUBREG QPR:$src3,
3437 (DSubReg_i16_reg imm:$lane))),
3438 (SubReg_i16_lane imm:$lane)))>;
3440 def : Pat<(v4i32 (add (v4i32 QPR:$src1),
3441 (mul (v4i32 QPR:$src2),
3442 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
3443 (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
3444 (v2i32 (EXTRACT_SUBREG QPR:$src3,
3445 (DSubReg_i32_reg imm:$lane))),
3446 (SubReg_i32_lane imm:$lane)))>;
3448 def : Pat<(v4f32 (fadd_mlx (v4f32 QPR:$src1),
3449 (fmul_su (v4f32 QPR:$src2),
3450 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
3451 (v4f32 (VMLAslfq (v4f32 QPR:$src1),
3453 (v2f32 (EXTRACT_SUBREG QPR:$src3,
3454 (DSubReg_i32_reg imm:$lane))),
3455 (SubReg_i32_lane imm:$lane)))>,
3456 Requires<[HasNEON, UseFPVMLx]>;
3458 // VMLAL : Vector Multiply Accumulate Long (Q += D * D)
3459 defm VMLALs : N3VLMulOp_QHS<0,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
3460 "vmlal", "s", NEONvmulls, add>;
3461 defm VMLALu : N3VLMulOp_QHS<1,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
3462 "vmlal", "u", NEONvmullu, add>;
3464 defm VMLALsls : N3VLMulOpSL_HS<0, 0b0010, "vmlal", "s", NEONvmulls, add>;
3465 defm VMLALslu : N3VLMulOpSL_HS<1, 0b0010, "vmlal", "u", NEONvmullu, add>;
3467 // VQDMLAL : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
3468 defm VQDMLAL : N3VLInt3_HS<0, 1, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
3469 "vqdmlal", "s", int_arm_neon_vqdmlal>;
3470 defm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal", "s", int_arm_neon_vqdmlal>;
3472 // VMLS : Vector Multiply Subtract (integer and floating-point)
3473 defm VMLS : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
3474 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
3475 def VMLSfd : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls", "f32",
3476 v2f32, fmul_su, fsub_mlx>,
3477 Requires<[HasNEON, UseFPVMLx]>;
3478 def VMLSfq : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls", "f32",
3479 v4f32, fmul_su, fsub_mlx>,
3480 Requires<[HasNEON, UseFPVMLx]>;
3481 defm VMLSsl : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D,
3482 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
3483 def VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls", "f32",
3484 v2f32, fmul_su, fsub_mlx>,
3485 Requires<[HasNEON, UseFPVMLx]>;
3486 def VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls", "f32",
3487 v4f32, v2f32, fmul_su, fsub_mlx>,
3488 Requires<[HasNEON, UseFPVMLx]>;
3490 def : Pat<(v8i16 (sub (v8i16 QPR:$src1),
3491 (mul (v8i16 QPR:$src2),
3492 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
3493 (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
3494 (v4i16 (EXTRACT_SUBREG QPR:$src3,
3495 (DSubReg_i16_reg imm:$lane))),
3496 (SubReg_i16_lane imm:$lane)))>;
3498 def : Pat<(v4i32 (sub (v4i32 QPR:$src1),
3499 (mul (v4i32 QPR:$src2),
3500 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
3501 (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
3502 (v2i32 (EXTRACT_SUBREG QPR:$src3,
3503 (DSubReg_i32_reg imm:$lane))),
3504 (SubReg_i32_lane imm:$lane)))>;
3506 def : Pat<(v4f32 (fsub_mlx (v4f32 QPR:$src1),
3507 (fmul_su (v4f32 QPR:$src2),
3508 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
3509 (v4f32 (VMLSslfq (v4f32 QPR:$src1), (v4f32 QPR:$src2),
3510 (v2f32 (EXTRACT_SUBREG QPR:$src3,
3511 (DSubReg_i32_reg imm:$lane))),
3512 (SubReg_i32_lane imm:$lane)))>,
3513 Requires<[HasNEON, UseFPVMLx]>;
3515 // VMLSL : Vector Multiply Subtract Long (Q -= D * D)
3516 defm VMLSLs : N3VLMulOp_QHS<0,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
3517 "vmlsl", "s", NEONvmulls, sub>;
3518 defm VMLSLu : N3VLMulOp_QHS<1,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
3519 "vmlsl", "u", NEONvmullu, sub>;
3521 defm VMLSLsls : N3VLMulOpSL_HS<0, 0b0110, "vmlsl", "s", NEONvmulls, sub>;
3522 defm VMLSLslu : N3VLMulOpSL_HS<1, 0b0110, "vmlsl", "u", NEONvmullu, sub>;
3524 // VQDMLSL : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
3525 defm VQDMLSL : N3VLInt3_HS<0, 1, 0b1011, 0, IIC_VMACi16D, IIC_VMACi32D,
3526 "vqdmlsl", "s", int_arm_neon_vqdmlsl>;
3527 defm VQDMLSLsl: N3VLInt3SL_HS<0, 0b111, "vqdmlsl", "s", int_arm_neon_vqdmlsl>;
3529 // Vector Subtract Operations.
3531 // VSUB : Vector Subtract (integer and floating-point)
3532 defm VSUB : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ,
3533 "vsub", "i", sub, 0>;
3534 def VSUBfd : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub", "f32",
3535 v2f32, v2f32, fsub, 0>;
3536 def VSUBfq : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub", "f32",
3537 v4f32, v4f32, fsub, 0>;
3538 // VSUBL : Vector Subtract Long (Q = D - D)
3539 defm VSUBLs : N3VLExt_QHS<0,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
3540 "vsubl", "s", sub, sext, 0>;
3541 defm VSUBLu : N3VLExt_QHS<1,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
3542 "vsubl", "u", sub, zext, 0>;
3543 // VSUBW : Vector Subtract Wide (Q = Q - D)
3544 defm VSUBWs : N3VW_QHS<0,1,0b0011,0, "vsubw", "s", sub, sext, 0>;
3545 defm VSUBWu : N3VW_QHS<1,1,0b0011,0, "vsubw", "u", sub, zext, 0>;
3546 // VHSUB : Vector Halving Subtract
3547 defm VHSUBs : N3VInt_QHS<0, 0, 0b0010, 0, N3RegFrm,
3548 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3549 "vhsub", "s", int_arm_neon_vhsubs, 0>;
3550 defm VHSUBu : N3VInt_QHS<1, 0, 0b0010, 0, N3RegFrm,
3551 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3552 "vhsub", "u", int_arm_neon_vhsubu, 0>;
3553 // VQSUB : Vector Saturing Subtract
3554 defm VQSUBs : N3VInt_QHSD<0, 0, 0b0010, 1, N3RegFrm,
3555 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3556 "vqsub", "s", int_arm_neon_vqsubs, 0>;
3557 defm VQSUBu : N3VInt_QHSD<1, 0, 0b0010, 1, N3RegFrm,
3558 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3559 "vqsub", "u", int_arm_neon_vqsubu, 0>;
3560 // VSUBHN : Vector Subtract and Narrow Returning High Half (D = Q - Q)
3561 defm VSUBHN : N3VNInt_HSD<0,1,0b0110,0, "vsubhn", "i",
3562 int_arm_neon_vsubhn, 0>;
3563 // VRSUBHN : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
3564 defm VRSUBHN : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn", "i",
3565 int_arm_neon_vrsubhn, 0>;
3567 // Vector Comparisons.
3569 // VCEQ : Vector Compare Equal
3570 defm VCEQ : N3V_QHS<1, 0, 0b1000, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3571 IIC_VSUBi4Q, "vceq", "i", NEONvceq, 1>;
3572 def VCEQfd : N3VD<0,0,0b00,0b1110,0, IIC_VBIND, "vceq", "f32", v2i32, v2f32,
3574 def VCEQfq : N3VQ<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq", "f32", v4i32, v4f32,
3577 defm VCEQz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00010, 0, "vceq", "i",
3578 "$Vd, $Vm, #0", NEONvceqz>;
3580 // VCGE : Vector Compare Greater Than or Equal
3581 defm VCGEs : N3V_QHS<0, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3582 IIC_VSUBi4Q, "vcge", "s", NEONvcge, 0>;
3583 defm VCGEu : N3V_QHS<1, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3584 IIC_VSUBi4Q, "vcge", "u", NEONvcgeu, 0>;
3585 def VCGEfd : N3VD<1,0,0b00,0b1110,0, IIC_VBIND, "vcge", "f32", v2i32, v2f32,
3587 def VCGEfq : N3VQ<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge", "f32", v4i32, v4f32,
3590 defm VCGEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00001, 0, "vcge", "s",
3591 "$Vd, $Vm, #0", NEONvcgez>;
3592 defm VCLEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00011, 0, "vcle", "s",
3593 "$Vd, $Vm, #0", NEONvclez>;
3595 // VCGT : Vector Compare Greater Than
3596 defm VCGTs : N3V_QHS<0, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3597 IIC_VSUBi4Q, "vcgt", "s", NEONvcgt, 0>;
3598 defm VCGTu : N3V_QHS<1, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3599 IIC_VSUBi4Q, "vcgt", "u", NEONvcgtu, 0>;
3600 def VCGTfd : N3VD<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt", "f32", v2i32, v2f32,
3602 def VCGTfq : N3VQ<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt", "f32", v4i32, v4f32,
3605 defm VCGTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00000, 0, "vcgt", "s",
3606 "$Vd, $Vm, #0", NEONvcgtz>;
3607 defm VCLTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00100, 0, "vclt", "s",
3608 "$Vd, $Vm, #0", NEONvcltz>;
3610 // VACGE : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
3611 def VACGEd : N3VDInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
3612 "f32", v2i32, v2f32, int_arm_neon_vacged, 0>;
3613 def VACGEq : N3VQInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
3614 "f32", v4i32, v4f32, int_arm_neon_vacgeq, 0>;
3615 // VACGT : Vector Absolute Compare Greater Than (aka VCAGT)
3616 def VACGTd : N3VDInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
3617 "f32", v2i32, v2f32, int_arm_neon_vacgtd, 0>;
3618 def VACGTq : N3VQInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
3619 "f32", v4i32, v4f32, int_arm_neon_vacgtq, 0>;
3620 // VTST : Vector Test Bits
3621 defm VTST : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
3622 IIC_VBINi4Q, "vtst", "", NEONvtst, 1>;
3624 // Vector Bitwise Operations.
3626 def vnotd : PatFrag<(ops node:$in),
3627 (xor node:$in, (bitconvert (v8i8 NEONimmAllOnesV)))>;
3628 def vnotq : PatFrag<(ops node:$in),
3629 (xor node:$in, (bitconvert (v16i8 NEONimmAllOnesV)))>;
3632 // VAND : Vector Bitwise AND
3633 def VANDd : N3VDX<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand",
3634 v2i32, v2i32, and, 1>;
3635 def VANDq : N3VQX<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand",
3636 v4i32, v4i32, and, 1>;
3638 // VEOR : Vector Bitwise Exclusive OR
3639 def VEORd : N3VDX<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor",
3640 v2i32, v2i32, xor, 1>;
3641 def VEORq : N3VQX<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor",
3642 v4i32, v4i32, xor, 1>;
3644 // VORR : Vector Bitwise OR
3645 def VORRd : N3VDX<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr",
3646 v2i32, v2i32, or, 1>;
3647 def VORRq : N3VQX<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr",
3648 v4i32, v4i32, or, 1>;
3650 def VORRiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 0, 1,
3651 (outs DPR:$Vd), (ins nModImm:$SIMM, DPR:$src),
3653 "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
3655 (v4i16 (NEONvorrImm DPR:$src, timm:$SIMM)))]> {
3656 let Inst{9} = SIMM{9};
3659 def VORRiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 0, 1,
3660 (outs DPR:$Vd), (ins nModImm:$SIMM, DPR:$src),
3662 "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
3664 (v2i32 (NEONvorrImm DPR:$src, timm:$SIMM)))]> {
3665 let Inst{10-9} = SIMM{10-9};
3668 def VORRiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 0, 1,
3669 (outs QPR:$Vd), (ins nModImm:$SIMM, QPR:$src),
3671 "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
3673 (v8i16 (NEONvorrImm QPR:$src, timm:$SIMM)))]> {
3674 let Inst{9} = SIMM{9};
3677 def VORRiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 0, 1,
3678 (outs QPR:$Vd), (ins nModImm:$SIMM, QPR:$src),
3680 "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
3682 (v4i32 (NEONvorrImm QPR:$src, timm:$SIMM)))]> {
3683 let Inst{10-9} = SIMM{10-9};
3687 // VBIC : Vector Bitwise Bit Clear (AND NOT)
3688 def VBICd : N3VX<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
3689 (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
3690 "vbic", "$Vd, $Vn, $Vm", "",
3691 [(set DPR:$Vd, (v2i32 (and DPR:$Vn,
3692 (vnotd DPR:$Vm))))]>;
3693 def VBICq : N3VX<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
3694 (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
3695 "vbic", "$Vd, $Vn, $Vm", "",
3696 [(set QPR:$Vd, (v4i32 (and QPR:$Vn,
3697 (vnotq QPR:$Vm))))]>;
3699 def VBICiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 1, 1,
3700 (outs DPR:$Vd), (ins nModImm:$SIMM, DPR:$src),
3702 "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
3704 (v4i16 (NEONvbicImm DPR:$src, timm:$SIMM)))]> {
3705 let Inst{9} = SIMM{9};
3708 def VBICiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 1, 1,
3709 (outs DPR:$Vd), (ins nModImm:$SIMM, DPR:$src),
3711 "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
3713 (v2i32 (NEONvbicImm DPR:$src, timm:$SIMM)))]> {
3714 let Inst{10-9} = SIMM{10-9};
3717 def VBICiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 1, 1,
3718 (outs QPR:$Vd), (ins nModImm:$SIMM, QPR:$src),
3720 "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
3722 (v8i16 (NEONvbicImm QPR:$src, timm:$SIMM)))]> {
3723 let Inst{9} = SIMM{9};
3726 def VBICiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 1, 1,
3727 (outs QPR:$Vd), (ins nModImm:$SIMM, QPR:$src),
3729 "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
3731 (v4i32 (NEONvbicImm QPR:$src, timm:$SIMM)))]> {
3732 let Inst{10-9} = SIMM{10-9};
3735 // VORN : Vector Bitwise OR NOT
3736 def VORNd : N3VX<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$Vd),
3737 (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
3738 "vorn", "$Vd, $Vn, $Vm", "",
3739 [(set DPR:$Vd, (v2i32 (or DPR:$Vn,
3740 (vnotd DPR:$Vm))))]>;
3741 def VORNq : N3VX<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$Vd),
3742 (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
3743 "vorn", "$Vd, $Vn, $Vm", "",
3744 [(set QPR:$Vd, (v4i32 (or QPR:$Vn,
3745 (vnotq QPR:$Vm))))]>;
3747 // VMVN : Vector Bitwise NOT (Immediate)
3749 let isReMaterializable = 1 in {
3751 def VMVNv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 1, 1, (outs DPR:$Vd),
3752 (ins nModImm:$SIMM), IIC_VMOVImm,
3753 "vmvn", "i16", "$Vd, $SIMM", "",
3754 [(set DPR:$Vd, (v4i16 (NEONvmvnImm timm:$SIMM)))]> {
3755 let Inst{9} = SIMM{9};
3758 def VMVNv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 1, 1, (outs QPR:$Vd),
3759 (ins nModImm:$SIMM), IIC_VMOVImm,
3760 "vmvn", "i16", "$Vd, $SIMM", "",
3761 [(set QPR:$Vd, (v8i16 (NEONvmvnImm timm:$SIMM)))]> {
3762 let Inst{9} = SIMM{9};
3765 def VMVNv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 1, 1, (outs DPR:$Vd),
3766 (ins nModImm:$SIMM), IIC_VMOVImm,
3767 "vmvn", "i32", "$Vd, $SIMM", "",
3768 [(set DPR:$Vd, (v2i32 (NEONvmvnImm timm:$SIMM)))]> {
3769 let Inst{11-8} = SIMM{11-8};
3772 def VMVNv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 1, 1, (outs QPR:$Vd),
3773 (ins nModImm:$SIMM), IIC_VMOVImm,
3774 "vmvn", "i32", "$Vd, $SIMM", "",
3775 [(set QPR:$Vd, (v4i32 (NEONvmvnImm timm:$SIMM)))]> {
3776 let Inst{11-8} = SIMM{11-8};
3780 // VMVN : Vector Bitwise NOT
3781 def VMVNd : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
3782 (outs DPR:$Vd), (ins DPR:$Vm), IIC_VSUBiD,
3783 "vmvn", "$Vd, $Vm", "",
3784 [(set DPR:$Vd, (v2i32 (vnotd DPR:$Vm)))]>;
3785 def VMVNq : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
3786 (outs QPR:$Vd), (ins QPR:$Vm), IIC_VSUBiD,
3787 "vmvn", "$Vd, $Vm", "",
3788 [(set QPR:$Vd, (v4i32 (vnotq QPR:$Vm)))]>;
3789 def : Pat<(v2i32 (vnotd DPR:$src)), (VMVNd DPR:$src)>;
3790 def : Pat<(v4i32 (vnotq QPR:$src)), (VMVNq QPR:$src)>;
3792 // VBSL : Vector Bitwise Select
3793 def VBSLd : N3VX<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
3794 (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
3795 N3RegFrm, IIC_VCNTiD,
3796 "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3798 (v2i32 (NEONvbsl DPR:$src1, DPR:$Vn, DPR:$Vm)))]>;
3800 def : Pat<(v2i32 (or (and DPR:$Vn, DPR:$Vd),
3801 (and DPR:$Vm, (vnotd DPR:$Vd)))),
3802 (VBSLd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
3804 def VBSLq : N3VX<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
3805 (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
3806 N3RegFrm, IIC_VCNTiQ,
3807 "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3809 (v4i32 (NEONvbsl QPR:$src1, QPR:$Vn, QPR:$Vm)))]>;
3811 def : Pat<(v4i32 (or (and QPR:$Vn, QPR:$Vd),
3812 (and QPR:$Vm, (vnotq QPR:$Vd)))),
3813 (VBSLq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
3815 // VBIF : Vector Bitwise Insert if False
3816 // like VBSL but with: "vbif $dst, $src3, $src1", "$src2 = $dst",
3817 // FIXME: This instruction's encoding MAY NOT BE correct.
3818 def VBIFd : N3VX<1, 0, 0b11, 0b0001, 0, 1,
3819 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
3820 N3RegFrm, IIC_VBINiD,
3821 "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3822 [/* For disassembly only; pattern left blank */]>;
3823 def VBIFq : N3VX<1, 0, 0b11, 0b0001, 1, 1,
3824 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
3825 N3RegFrm, IIC_VBINiQ,
3826 "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3827 [/* For disassembly only; pattern left blank */]>;
3829 // VBIT : Vector Bitwise Insert if True
3830 // like VBSL but with: "vbit $dst, $src2, $src1", "$src3 = $dst",
3831 // FIXME: This instruction's encoding MAY NOT BE correct.
3832 def VBITd : N3VX<1, 0, 0b10, 0b0001, 0, 1,
3833 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
3834 N3RegFrm, IIC_VBINiD,
3835 "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3836 [/* For disassembly only; pattern left blank */]>;
3837 def VBITq : N3VX<1, 0, 0b10, 0b0001, 1, 1,
3838 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
3839 N3RegFrm, IIC_VBINiQ,
3840 "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3841 [/* For disassembly only; pattern left blank */]>;
3843 // VBIT/VBIF are not yet implemented. The TwoAddress pass will not go looking
3844 // for equivalent operations with different register constraints; it just
3847 // Vector Absolute Differences.
3849 // VABD : Vector Absolute Difference
3850 defm VABDs : N3VInt_QHS<0, 0, 0b0111, 0, N3RegFrm,
3851 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3852 "vabd", "s", int_arm_neon_vabds, 1>;
3853 defm VABDu : N3VInt_QHS<1, 0, 0b0111, 0, N3RegFrm,
3854 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3855 "vabd", "u", int_arm_neon_vabdu, 1>;
3856 def VABDfd : N3VDInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBIND,
3857 "vabd", "f32", v2f32, v2f32, int_arm_neon_vabds, 1>;
3858 def VABDfq : N3VQInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBINQ,
3859 "vabd", "f32", v4f32, v4f32, int_arm_neon_vabds, 1>;
3861 // VABDL : Vector Absolute Difference Long (Q = | D - D |)
3862 defm VABDLs : N3VLIntExt_QHS<0,1,0b0111,0, IIC_VSUBi4Q,
3863 "vabdl", "s", int_arm_neon_vabds, zext, 1>;
3864 defm VABDLu : N3VLIntExt_QHS<1,1,0b0111,0, IIC_VSUBi4Q,
3865 "vabdl", "u", int_arm_neon_vabdu, zext, 1>;
3867 // VABA : Vector Absolute Difference and Accumulate
3868 defm VABAs : N3VIntOp_QHS<0,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
3869 "vaba", "s", int_arm_neon_vabds, add>;
3870 defm VABAu : N3VIntOp_QHS<1,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
3871 "vaba", "u", int_arm_neon_vabdu, add>;
3873 // VABAL : Vector Absolute Difference and Accumulate Long (Q += | D - D |)
3874 defm VABALs : N3VLIntExtOp_QHS<0,1,0b0101,0, IIC_VABAD,
3875 "vabal", "s", int_arm_neon_vabds, zext, add>;
3876 defm VABALu : N3VLIntExtOp_QHS<1,1,0b0101,0, IIC_VABAD,
3877 "vabal", "u", int_arm_neon_vabdu, zext, add>;
3879 // Vector Maximum and Minimum.
3881 // VMAX : Vector Maximum
3882 defm VMAXs : N3VInt_QHS<0, 0, 0b0110, 0, N3RegFrm,
3883 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3884 "vmax", "s", int_arm_neon_vmaxs, 1>;
3885 defm VMAXu : N3VInt_QHS<1, 0, 0b0110, 0, N3RegFrm,
3886 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3887 "vmax", "u", int_arm_neon_vmaxu, 1>;
3888 def VMAXfd : N3VDInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBIND,
3890 v2f32, v2f32, int_arm_neon_vmaxs, 1>;
3891 def VMAXfq : N3VQInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBINQ,
3893 v4f32, v4f32, int_arm_neon_vmaxs, 1>;
3895 // VMIN : Vector Minimum
3896 defm VMINs : N3VInt_QHS<0, 0, 0b0110, 1, N3RegFrm,
3897 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3898 "vmin", "s", int_arm_neon_vmins, 1>;
3899 defm VMINu : N3VInt_QHS<1, 0, 0b0110, 1, N3RegFrm,
3900 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3901 "vmin", "u", int_arm_neon_vminu, 1>;
3902 def VMINfd : N3VDInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBIND,
3904 v2f32, v2f32, int_arm_neon_vmins, 1>;
3905 def VMINfq : N3VQInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBINQ,
3907 v4f32, v4f32, int_arm_neon_vmins, 1>;
3909 // Vector Pairwise Operations.
3911 // VPADD : Vector Pairwise Add
3912 def VPADDi8 : N3VDInt<0, 0, 0b00, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
3914 v8i8, v8i8, int_arm_neon_vpadd, 0>;
3915 def VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
3917 v4i16, v4i16, int_arm_neon_vpadd, 0>;
3918 def VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
3920 v2i32, v2i32, int_arm_neon_vpadd, 0>;
3921 def VPADDf : N3VDInt<1, 0, 0b00, 0b1101, 0, N3RegFrm,
3922 IIC_VPBIND, "vpadd", "f32",
3923 v2f32, v2f32, int_arm_neon_vpadd, 0>;
3925 // VPADDL : Vector Pairwise Add Long
3926 defm VPADDLs : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl", "s",
3927 int_arm_neon_vpaddls>;
3928 defm VPADDLu : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl", "u",
3929 int_arm_neon_vpaddlu>;
3931 // VPADAL : Vector Pairwise Add and Accumulate Long
3932 defm VPADALs : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01100, 0, "vpadal", "s",
3933 int_arm_neon_vpadals>;
3934 defm VPADALu : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01101, 0, "vpadal", "u",
3935 int_arm_neon_vpadalu>;
3937 // VPMAX : Vector Pairwise Maximum
3938 def VPMAXs8 : N3VDInt<0, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3939 "s8", v8i8, v8i8, int_arm_neon_vpmaxs, 0>;
3940 def VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3941 "s16", v4i16, v4i16, int_arm_neon_vpmaxs, 0>;
3942 def VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3943 "s32", v2i32, v2i32, int_arm_neon_vpmaxs, 0>;
3944 def VPMAXu8 : N3VDInt<1, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3945 "u8", v8i8, v8i8, int_arm_neon_vpmaxu, 0>;
3946 def VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3947 "u16", v4i16, v4i16, int_arm_neon_vpmaxu, 0>;
3948 def VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3949 "u32", v2i32, v2i32, int_arm_neon_vpmaxu, 0>;
3950 def VPMAXf : N3VDInt<1, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmax",
3951 "f32", v2f32, v2f32, int_arm_neon_vpmaxs, 0>;
3953 // VPMIN : Vector Pairwise Minimum
3954 def VPMINs8 : N3VDInt<0, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3955 "s8", v8i8, v8i8, int_arm_neon_vpmins, 0>;
3956 def VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3957 "s16", v4i16, v4i16, int_arm_neon_vpmins, 0>;
3958 def VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3959 "s32", v2i32, v2i32, int_arm_neon_vpmins, 0>;
3960 def VPMINu8 : N3VDInt<1, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3961 "u8", v8i8, v8i8, int_arm_neon_vpminu, 0>;
3962 def VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3963 "u16", v4i16, v4i16, int_arm_neon_vpminu, 0>;
3964 def VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3965 "u32", v2i32, v2i32, int_arm_neon_vpminu, 0>;
3966 def VPMINf : N3VDInt<1, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmin",
3967 "f32", v2f32, v2f32, int_arm_neon_vpmins, 0>;
3969 // Vector Reciprocal and Reciprocal Square Root Estimate and Step.
3971 // VRECPE : Vector Reciprocal Estimate
3972 def VRECPEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
3973 IIC_VUNAD, "vrecpe", "u32",
3974 v2i32, v2i32, int_arm_neon_vrecpe>;
3975 def VRECPEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
3976 IIC_VUNAQ, "vrecpe", "u32",
3977 v4i32, v4i32, int_arm_neon_vrecpe>;
3978 def VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
3979 IIC_VUNAD, "vrecpe", "f32",
3980 v2f32, v2f32, int_arm_neon_vrecpe>;
3981 def VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
3982 IIC_VUNAQ, "vrecpe", "f32",
3983 v4f32, v4f32, int_arm_neon_vrecpe>;
3985 // VRECPS : Vector Reciprocal Step
3986 def VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
3987 IIC_VRECSD, "vrecps", "f32",
3988 v2f32, v2f32, int_arm_neon_vrecps, 1>;
3989 def VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
3990 IIC_VRECSQ, "vrecps", "f32",
3991 v4f32, v4f32, int_arm_neon_vrecps, 1>;
3993 // VRSQRTE : Vector Reciprocal Square Root Estimate
3994 def VRSQRTEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
3995 IIC_VUNAD, "vrsqrte", "u32",
3996 v2i32, v2i32, int_arm_neon_vrsqrte>;
3997 def VRSQRTEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
3998 IIC_VUNAQ, "vrsqrte", "u32",
3999 v4i32, v4i32, int_arm_neon_vrsqrte>;
4000 def VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
4001 IIC_VUNAD, "vrsqrte", "f32",
4002 v2f32, v2f32, int_arm_neon_vrsqrte>;
4003 def VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
4004 IIC_VUNAQ, "vrsqrte", "f32",
4005 v4f32, v4f32, int_arm_neon_vrsqrte>;
4007 // VRSQRTS : Vector Reciprocal Square Root Step
4008 def VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
4009 IIC_VRECSD, "vrsqrts", "f32",
4010 v2f32, v2f32, int_arm_neon_vrsqrts, 1>;
4011 def VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
4012 IIC_VRECSQ, "vrsqrts", "f32",
4013 v4f32, v4f32, int_arm_neon_vrsqrts, 1>;
4017 // VSHL : Vector Shift
4018 defm VSHLs : N3VInt_QHSDSh<0, 0, 0b0100, 0, N3RegVShFrm,
4019 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
4020 "vshl", "s", int_arm_neon_vshifts>;
4021 defm VSHLu : N3VInt_QHSDSh<1, 0, 0b0100, 0, N3RegVShFrm,
4022 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
4023 "vshl", "u", int_arm_neon_vshiftu>;
4025 // VSHL : Vector Shift Left (Immediate)
4026 defm VSHLi : N2VShL_QHSD<0, 1, 0b0101, 1, IIC_VSHLiD, "vshl", "i", NEONvshl>;
4028 // VSHR : Vector Shift Right (Immediate)
4029 defm VSHRs : N2VShR_QHSD<0, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "s",NEONvshrs>;
4030 defm VSHRu : N2VShR_QHSD<1, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "u",NEONvshru>;
4032 // VSHLL : Vector Shift Left Long
4033 defm VSHLLs : N2VLSh_QHS<0, 1, 0b1010, 0, 0, 1, "vshll", "s", NEONvshlls>;
4034 defm VSHLLu : N2VLSh_QHS<1, 1, 0b1010, 0, 0, 1, "vshll", "u", NEONvshllu>;
4036 // VSHLL : Vector Shift Left Long (with maximum shift count)
4037 class N2VLShMax<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
4038 bit op6, bit op4, string OpcodeStr, string Dt, ValueType ResTy,
4039 ValueType OpTy, SDNode OpNode>
4040 : N2VLSh<op24, op23, op11_8, op7, op6, op4, OpcodeStr, Dt,
4041 ResTy, OpTy, OpNode> {
4042 let Inst{21-16} = op21_16;
4044 def VSHLLi8 : N2VLShMax<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll", "i8",
4045 v8i16, v8i8, NEONvshlli>;
4046 def VSHLLi16 : N2VLShMax<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll", "i16",
4047 v4i32, v4i16, NEONvshlli>;
4048 def VSHLLi32 : N2VLShMax<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll", "i32",
4049 v2i64, v2i32, NEONvshlli>;
4051 // VSHRN : Vector Shift Right and Narrow
4052 defm VSHRN : N2VNSh_HSD<0,1,0b1000,0,0,1, IIC_VSHLiD, "vshrn", "i",
4055 // VRSHL : Vector Rounding Shift
4056 defm VRSHLs : N3VInt_QHSDSh<0, 0, 0b0101, 0, N3RegVShFrm,
4057 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
4058 "vrshl", "s", int_arm_neon_vrshifts>;
4059 defm VRSHLu : N3VInt_QHSDSh<1, 0, 0b0101, 0, N3RegVShFrm,
4060 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
4061 "vrshl", "u", int_arm_neon_vrshiftu>;
4062 // VRSHR : Vector Rounding Shift Right
4063 defm VRSHRs : N2VShR_QHSD<0,1,0b0010,1, IIC_VSHLi4D, "vrshr", "s",NEONvrshrs>;
4064 defm VRSHRu : N2VShR_QHSD<1,1,0b0010,1, IIC_VSHLi4D, "vrshr", "u",NEONvrshru>;
4066 // VRSHRN : Vector Rounding Shift Right and Narrow
4067 defm VRSHRN : N2VNSh_HSD<0, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vrshrn", "i",
4070 // VQSHL : Vector Saturating Shift
4071 defm VQSHLs : N3VInt_QHSDSh<0, 0, 0b0100, 1, N3RegVShFrm,
4072 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
4073 "vqshl", "s", int_arm_neon_vqshifts>;
4074 defm VQSHLu : N3VInt_QHSDSh<1, 0, 0b0100, 1, N3RegVShFrm,
4075 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
4076 "vqshl", "u", int_arm_neon_vqshiftu>;
4077 // VQSHL : Vector Saturating Shift Left (Immediate)
4078 defm VQSHLsi : N2VShL_QHSD<0,1,0b0111,1, IIC_VSHLi4D, "vqshl", "s",NEONvqshls>;
4079 defm VQSHLui : N2VShL_QHSD<1,1,0b0111,1, IIC_VSHLi4D, "vqshl", "u",NEONvqshlu>;
4081 // VQSHLU : Vector Saturating Shift Left (Immediate, Unsigned)
4082 defm VQSHLsu : N2VShL_QHSD<1,1,0b0110,1, IIC_VSHLi4D,"vqshlu","s",NEONvqshlsu>;
4084 // VQSHRN : Vector Saturating Shift Right and Narrow
4085 defm VQSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "s",
4087 defm VQSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "u",
4090 // VQSHRUN : Vector Saturating Shift Right and Narrow (Unsigned)
4091 defm VQSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 0, 1, IIC_VSHLi4D, "vqshrun", "s",
4094 // VQRSHL : Vector Saturating Rounding Shift
4095 defm VQRSHLs : N3VInt_QHSDSh<0, 0, 0b0101, 1, N3RegVShFrm,
4096 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
4097 "vqrshl", "s", int_arm_neon_vqrshifts>;
4098 defm VQRSHLu : N3VInt_QHSDSh<1, 0, 0b0101, 1, N3RegVShFrm,
4099 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
4100 "vqrshl", "u", int_arm_neon_vqrshiftu>;
4102 // VQRSHRN : Vector Saturating Rounding Shift Right and Narrow
4103 defm VQRSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "s",
4105 defm VQRSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "u",
4108 // VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned)
4109 defm VQRSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vqrshrun", "s",
4112 // VSRA : Vector Shift Right and Accumulate
4113 defm VSRAs : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra", "s", NEONvshrs>;
4114 defm VSRAu : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra", "u", NEONvshru>;
4115 // VRSRA : Vector Rounding Shift Right and Accumulate
4116 defm VRSRAs : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra", "s", NEONvrshrs>;
4117 defm VRSRAu : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra", "u", NEONvrshru>;
4119 // VSLI : Vector Shift Left and Insert
4120 defm VSLI : N2VShInsL_QHSD<1, 1, 0b0101, 1, "vsli">;
4122 // VSRI : Vector Shift Right and Insert
4123 defm VSRI : N2VShInsR_QHSD<1, 1, 0b0100, 1, "vsri">;
4125 // Vector Absolute and Saturating Absolute.
4127 // VABS : Vector Absolute Value
4128 defm VABS : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0,
4129 IIC_VUNAiD, IIC_VUNAiQ, "vabs", "s",
4131 def VABSfd : N2VDInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
4132 IIC_VUNAD, "vabs", "f32",
4133 v2f32, v2f32, int_arm_neon_vabs>;
4134 def VABSfq : N2VQInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
4135 IIC_VUNAQ, "vabs", "f32",
4136 v4f32, v4f32, int_arm_neon_vabs>;
4138 // VQABS : Vector Saturating Absolute Value
4139 defm VQABS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0,
4140 IIC_VQUNAiD, IIC_VQUNAiQ, "vqabs", "s",
4141 int_arm_neon_vqabs>;
4145 def vnegd : PatFrag<(ops node:$in),
4146 (sub (bitconvert (v2i32 NEONimmAllZerosV)), node:$in)>;
4147 def vnegq : PatFrag<(ops node:$in),
4148 (sub (bitconvert (v4i32 NEONimmAllZerosV)), node:$in)>;
4150 class VNEGD<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
4151 : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$Vd), (ins DPR:$Vm),
4152 IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
4153 [(set DPR:$Vd, (Ty (vnegd DPR:$Vm)))]>;
4154 class VNEGQ<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
4155 : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$Vd), (ins QPR:$Vm),
4156 IIC_VSHLiQ, OpcodeStr, Dt, "$Vd, $Vm", "",
4157 [(set QPR:$Vd, (Ty (vnegq QPR:$Vm)))]>;
4159 // VNEG : Vector Negate (integer)
4160 def VNEGs8d : VNEGD<0b00, "vneg", "s8", v8i8>;
4161 def VNEGs16d : VNEGD<0b01, "vneg", "s16", v4i16>;
4162 def VNEGs32d : VNEGD<0b10, "vneg", "s32", v2i32>;
4163 def VNEGs8q : VNEGQ<0b00, "vneg", "s8", v16i8>;
4164 def VNEGs16q : VNEGQ<0b01, "vneg", "s16", v8i16>;
4165 def VNEGs32q : VNEGQ<0b10, "vneg", "s32", v4i32>;
4167 // VNEG : Vector Negate (floating-point)
4168 def VNEGfd : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
4169 (outs DPR:$Vd), (ins DPR:$Vm), IIC_VUNAD,
4170 "vneg", "f32", "$Vd, $Vm", "",
4171 [(set DPR:$Vd, (v2f32 (fneg DPR:$Vm)))]>;
4172 def VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0,
4173 (outs QPR:$Vd), (ins QPR:$Vm), IIC_VUNAQ,
4174 "vneg", "f32", "$Vd, $Vm", "",
4175 [(set QPR:$Vd, (v4f32 (fneg QPR:$Vm)))]>;
4177 def : Pat<(v8i8 (vnegd DPR:$src)), (VNEGs8d DPR:$src)>;
4178 def : Pat<(v4i16 (vnegd DPR:$src)), (VNEGs16d DPR:$src)>;
4179 def : Pat<(v2i32 (vnegd DPR:$src)), (VNEGs32d DPR:$src)>;
4180 def : Pat<(v16i8 (vnegq QPR:$src)), (VNEGs8q QPR:$src)>;
4181 def : Pat<(v8i16 (vnegq QPR:$src)), (VNEGs16q QPR:$src)>;
4182 def : Pat<(v4i32 (vnegq QPR:$src)), (VNEGs32q QPR:$src)>;
4184 // VQNEG : Vector Saturating Negate
4185 defm VQNEG : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0,
4186 IIC_VQUNAiD, IIC_VQUNAiQ, "vqneg", "s",
4187 int_arm_neon_vqneg>;
4189 // Vector Bit Counting Operations.
4191 // VCLS : Vector Count Leading Sign Bits
4192 defm VCLS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0,
4193 IIC_VCNTiD, IIC_VCNTiQ, "vcls", "s",
4195 // VCLZ : Vector Count Leading Zeros
4196 defm VCLZ : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0,
4197 IIC_VCNTiD, IIC_VCNTiQ, "vclz", "i",
4199 // VCNT : Vector Count One Bits
4200 def VCNTd : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
4201 IIC_VCNTiD, "vcnt", "8",
4202 v8i8, v8i8, int_arm_neon_vcnt>;
4203 def VCNTq : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
4204 IIC_VCNTiQ, "vcnt", "8",
4205 v16i8, v16i8, int_arm_neon_vcnt>;
4207 // Vector Swap -- for disassembly only.
4208 def VSWPd : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 0, 0,
4209 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
4210 "vswp", "$Vd, $Vm", "", []>;
4211 def VSWPq : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 1, 0,
4212 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
4213 "vswp", "$Vd, $Vm", "", []>;
4215 // Vector Move Operations.
4217 // VMOV : Vector Move (Register)
4218 def : InstAlias<"vmov${p} $Vd, $Vm",
4219 (VORRd DPR:$Vd, DPR:$Vm, DPR:$Vm, pred:$p)>;
4220 def : InstAlias<"vmov${p} $Vd, $Vm",
4221 (VORRq QPR:$Vd, QPR:$Vm, QPR:$Vm, pred:$p)>;
4223 let neverHasSideEffects = 1 in {
4224 // Pseudo vector move instructions for QQ and QQQQ registers. This should
4225 // be expanded after register allocation is completed.
4226 def VMOVQQ : PseudoInst<(outs QQPR:$dst), (ins QQPR:$src),
4229 def VMOVQQQQ : PseudoInst<(outs QQQQPR:$dst), (ins QQQQPR:$src),
4231 } // neverHasSideEffects
4233 // VMOV : Vector Move (Immediate)
4235 let isReMaterializable = 1 in {
4236 def VMOVv8i8 : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$Vd),
4237 (ins nModImm:$SIMM), IIC_VMOVImm,
4238 "vmov", "i8", "$Vd, $SIMM", "",
4239 [(set DPR:$Vd, (v8i8 (NEONvmovImm timm:$SIMM)))]>;
4240 def VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$Vd),
4241 (ins nModImm:$SIMM), IIC_VMOVImm,
4242 "vmov", "i8", "$Vd, $SIMM", "",
4243 [(set QPR:$Vd, (v16i8 (NEONvmovImm timm:$SIMM)))]>;
4245 def VMOVv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 0, 1, (outs DPR:$Vd),
4246 (ins nModImm:$SIMM), IIC_VMOVImm,
4247 "vmov", "i16", "$Vd, $SIMM", "",
4248 [(set DPR:$Vd, (v4i16 (NEONvmovImm timm:$SIMM)))]> {
4249 let Inst{9} = SIMM{9};
4252 def VMOVv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 0, 1, (outs QPR:$Vd),
4253 (ins nModImm:$SIMM), IIC_VMOVImm,
4254 "vmov", "i16", "$Vd, $SIMM", "",
4255 [(set QPR:$Vd, (v8i16 (NEONvmovImm timm:$SIMM)))]> {
4256 let Inst{9} = SIMM{9};
4259 def VMOVv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 0, 1, (outs DPR:$Vd),
4260 (ins nModImm:$SIMM), IIC_VMOVImm,
4261 "vmov", "i32", "$Vd, $SIMM", "",
4262 [(set DPR:$Vd, (v2i32 (NEONvmovImm timm:$SIMM)))]> {
4263 let Inst{11-8} = SIMM{11-8};
4266 def VMOVv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 0, 1, (outs QPR:$Vd),
4267 (ins nModImm:$SIMM), IIC_VMOVImm,
4268 "vmov", "i32", "$Vd, $SIMM", "",
4269 [(set QPR:$Vd, (v4i32 (NEONvmovImm timm:$SIMM)))]> {
4270 let Inst{11-8} = SIMM{11-8};
4273 def VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$Vd),
4274 (ins nModImm:$SIMM), IIC_VMOVImm,
4275 "vmov", "i64", "$Vd, $SIMM", "",
4276 [(set DPR:$Vd, (v1i64 (NEONvmovImm timm:$SIMM)))]>;
4277 def VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$Vd),
4278 (ins nModImm:$SIMM), IIC_VMOVImm,
4279 "vmov", "i64", "$Vd, $SIMM", "",
4280 [(set QPR:$Vd, (v2i64 (NEONvmovImm timm:$SIMM)))]>;
4281 } // isReMaterializable
4283 // VMOV : Vector Get Lane (move scalar to ARM core register)
4285 def VGETLNs8 : NVGetLane<{1,1,1,0,0,1,?,1}, 0b1011, {?,?},
4286 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4287 IIC_VMOVSI, "vmov", "s8", "$R, $V[$lane]",
4288 [(set GPR:$R, (NEONvgetlanes (v8i8 DPR:$V),
4290 let Inst{21} = lane{2};
4291 let Inst{6-5} = lane{1-0};
4293 def VGETLNs16 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, {?,1},
4294 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4295 IIC_VMOVSI, "vmov", "s16", "$R, $V[$lane]",
4296 [(set GPR:$R, (NEONvgetlanes (v4i16 DPR:$V),
4298 let Inst{21} = lane{1};
4299 let Inst{6} = lane{0};
4301 def VGETLNu8 : NVGetLane<{1,1,1,0,1,1,?,1}, 0b1011, {?,?},
4302 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4303 IIC_VMOVSI, "vmov", "u8", "$R, $V[$lane]",
4304 [(set GPR:$R, (NEONvgetlaneu (v8i8 DPR:$V),
4306 let Inst{21} = lane{2};
4307 let Inst{6-5} = lane{1-0};
4309 def VGETLNu16 : NVGetLane<{1,1,1,0,1,0,?,1}, 0b1011, {?,1},
4310 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4311 IIC_VMOVSI, "vmov", "u16", "$R, $V[$lane]",
4312 [(set GPR:$R, (NEONvgetlaneu (v4i16 DPR:$V),
4314 let Inst{21} = lane{1};
4315 let Inst{6} = lane{0};
4317 def VGETLNi32 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, 0b00,
4318 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4319 IIC_VMOVSI, "vmov", "32", "$R, $V[$lane]",
4320 [(set GPR:$R, (extractelt (v2i32 DPR:$V),
4322 let Inst{21} = lane{0};
4324 // def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
4325 def : Pat<(NEONvgetlanes (v16i8 QPR:$src), imm:$lane),
4326 (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
4327 (DSubReg_i8_reg imm:$lane))),
4328 (SubReg_i8_lane imm:$lane))>;
4329 def : Pat<(NEONvgetlanes (v8i16 QPR:$src), imm:$lane),
4330 (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
4331 (DSubReg_i16_reg imm:$lane))),
4332 (SubReg_i16_lane imm:$lane))>;
4333 def : Pat<(NEONvgetlaneu (v16i8 QPR:$src), imm:$lane),
4334 (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
4335 (DSubReg_i8_reg imm:$lane))),
4336 (SubReg_i8_lane imm:$lane))>;
4337 def : Pat<(NEONvgetlaneu (v8i16 QPR:$src), imm:$lane),
4338 (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
4339 (DSubReg_i16_reg imm:$lane))),
4340 (SubReg_i16_lane imm:$lane))>;
4341 def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
4342 (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
4343 (DSubReg_i32_reg imm:$lane))),
4344 (SubReg_i32_lane imm:$lane))>;
4345 def : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2),
4346 (EXTRACT_SUBREG (v2f32 (COPY_TO_REGCLASS (v2f32 DPR:$src1),DPR_VFP2)),
4347 (SSubReg_f32_reg imm:$src2))>;
4348 def : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
4349 (EXTRACT_SUBREG (v4f32 (COPY_TO_REGCLASS (v4f32 QPR:$src1),QPR_VFP2)),
4350 (SSubReg_f32_reg imm:$src2))>;
4351 //def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
4352 // (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
4353 def : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
4354 (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
4357 // VMOV : Vector Set Lane (move ARM core register to scalar)
4359 let Constraints = "$src1 = $V" in {
4360 def VSETLNi8 : NVSetLane<{1,1,1,0,0,1,?,0}, 0b1011, {?,?}, (outs DPR:$V),
4361 (ins DPR:$src1, GPR:$R, nohash_imm:$lane),
4362 IIC_VMOVISL, "vmov", "8", "$V[$lane], $R",
4363 [(set DPR:$V, (vector_insert (v8i8 DPR:$src1),
4364 GPR:$R, imm:$lane))]> {
4365 let Inst{21} = lane{2};
4366 let Inst{6-5} = lane{1-0};
4368 def VSETLNi16 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, {?,1}, (outs DPR:$V),
4369 (ins DPR:$src1, GPR:$R, nohash_imm:$lane),
4370 IIC_VMOVISL, "vmov", "16", "$V[$lane], $R",
4371 [(set DPR:$V, (vector_insert (v4i16 DPR:$src1),
4372 GPR:$R, imm:$lane))]> {
4373 let Inst{21} = lane{1};
4374 let Inst{6} = lane{0};
4376 def VSETLNi32 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, 0b00, (outs DPR:$V),
4377 (ins DPR:$src1, GPR:$R, nohash_imm:$lane),
4378 IIC_VMOVISL, "vmov", "32", "$V[$lane], $R",
4379 [(set DPR:$V, (insertelt (v2i32 DPR:$src1),
4380 GPR:$R, imm:$lane))]> {
4381 let Inst{21} = lane{0};
4384 def : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
4385 (v16i8 (INSERT_SUBREG QPR:$src1,
4386 (v8i8 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
4387 (DSubReg_i8_reg imm:$lane))),
4388 GPR:$src2, (SubReg_i8_lane imm:$lane))),
4389 (DSubReg_i8_reg imm:$lane)))>;
4390 def : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
4391 (v8i16 (INSERT_SUBREG QPR:$src1,
4392 (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
4393 (DSubReg_i16_reg imm:$lane))),
4394 GPR:$src2, (SubReg_i16_lane imm:$lane))),
4395 (DSubReg_i16_reg imm:$lane)))>;
4396 def : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
4397 (v4i32 (INSERT_SUBREG QPR:$src1,
4398 (v2i32 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
4399 (DSubReg_i32_reg imm:$lane))),
4400 GPR:$src2, (SubReg_i32_lane imm:$lane))),
4401 (DSubReg_i32_reg imm:$lane)))>;
4403 def : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)),
4404 (INSERT_SUBREG (v2f32 (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2)),
4405 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
4406 def : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
4407 (INSERT_SUBREG (v4f32 (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2)),
4408 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
4410 //def : Pat<(v2i64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
4411 // (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
4412 def : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
4413 (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
4415 def : Pat<(v2f32 (scalar_to_vector SPR:$src)),
4416 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
4417 def : Pat<(v2f64 (scalar_to_vector (f64 DPR:$src))),
4418 (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
4419 def : Pat<(v4f32 (scalar_to_vector SPR:$src)),
4420 (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
4422 def : Pat<(v8i8 (scalar_to_vector GPR:$src)),
4423 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
4424 def : Pat<(v4i16 (scalar_to_vector GPR:$src)),
4425 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
4426 def : Pat<(v2i32 (scalar_to_vector GPR:$src)),
4427 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
4429 def : Pat<(v16i8 (scalar_to_vector GPR:$src)),
4430 (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)),
4431 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
4433 def : Pat<(v8i16 (scalar_to_vector GPR:$src)),
4434 (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)),
4435 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
4437 def : Pat<(v4i32 (scalar_to_vector GPR:$src)),
4438 (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
4439 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
4442 // VDUP : Vector Duplicate (from ARM core register to all elements)
4444 class VDUPD<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
4445 : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$V), (ins GPR:$R),
4446 IIC_VMOVIS, "vdup", Dt, "$V, $R",
4447 [(set DPR:$V, (Ty (NEONvdup (i32 GPR:$R))))]>;
4448 class VDUPQ<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
4449 : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$V), (ins GPR:$R),
4450 IIC_VMOVIS, "vdup", Dt, "$V, $R",
4451 [(set QPR:$V, (Ty (NEONvdup (i32 GPR:$R))))]>;
4453 def VDUP8d : VDUPD<0b11101100, 0b00, "8", v8i8>;
4454 def VDUP16d : VDUPD<0b11101000, 0b01, "16", v4i16>;
4455 def VDUP32d : VDUPD<0b11101000, 0b00, "32", v2i32>;
4456 def VDUP8q : VDUPQ<0b11101110, 0b00, "8", v16i8>;
4457 def VDUP16q : VDUPQ<0b11101010, 0b01, "16", v8i16>;
4458 def VDUP32q : VDUPQ<0b11101010, 0b00, "32", v4i32>;
4460 def : Pat<(v2f32 (NEONvdup (f32 (bitconvert GPR:$R)))), (VDUP32d GPR:$R)>;
4461 def : Pat<(v4f32 (NEONvdup (f32 (bitconvert GPR:$R)))), (VDUP32q GPR:$R)>;
4463 // VDUP : Vector Duplicate Lane (from scalar to all elements)
4465 class VDUPLND<bits<4> op19_16, string OpcodeStr, string Dt,
4467 : NVDupLane<op19_16, 0, (outs DPR:$Vd), (ins DPR:$Vm, nohash_imm:$lane),
4468 IIC_VMOVD, OpcodeStr, Dt, "$Vd, $Vm[$lane]",
4469 [(set DPR:$Vd, (Ty (NEONvduplane (Ty DPR:$Vm), imm:$lane)))]>;
4471 class VDUPLNQ<bits<4> op19_16, string OpcodeStr, string Dt,
4472 ValueType ResTy, ValueType OpTy>
4473 : NVDupLane<op19_16, 1, (outs QPR:$Vd), (ins DPR:$Vm, nohash_imm:$lane),
4474 IIC_VMOVQ, OpcodeStr, Dt, "$Vd, $Vm[$lane]",
4475 [(set QPR:$Vd, (ResTy (NEONvduplane (OpTy DPR:$Vm),
4478 // Inst{19-16} is partially specified depending on the element size.
4480 def VDUPLN8d : VDUPLND<{?,?,?,1}, "vdup", "8", v8i8> {
4481 let Inst{19-17} = lane{2-0};
4483 def VDUPLN16d : VDUPLND<{?,?,1,0}, "vdup", "16", v4i16> {
4484 let Inst{19-18} = lane{1-0};
4486 def VDUPLN32d : VDUPLND<{?,1,0,0}, "vdup", "32", v2i32> {
4487 let Inst{19} = lane{0};
4489 def VDUPLN8q : VDUPLNQ<{?,?,?,1}, "vdup", "8", v16i8, v8i8> {
4490 let Inst{19-17} = lane{2-0};
4492 def VDUPLN16q : VDUPLNQ<{?,?,1,0}, "vdup", "16", v8i16, v4i16> {
4493 let Inst{19-18} = lane{1-0};
4495 def VDUPLN32q : VDUPLNQ<{?,1,0,0}, "vdup", "32", v4i32, v2i32> {
4496 let Inst{19} = lane{0};
4499 def : Pat<(v2f32 (NEONvduplane (v2f32 DPR:$Vm), imm:$lane)),
4500 (VDUPLN32d DPR:$Vm, imm:$lane)>;
4502 def : Pat<(v4f32 (NEONvduplane (v2f32 DPR:$Vm), imm:$lane)),
4503 (VDUPLN32q DPR:$Vm, imm:$lane)>;
4505 def : Pat<(v16i8 (NEONvduplane (v16i8 QPR:$src), imm:$lane)),
4506 (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src,
4507 (DSubReg_i8_reg imm:$lane))),
4508 (SubReg_i8_lane imm:$lane)))>;
4509 def : Pat<(v8i16 (NEONvduplane (v8i16 QPR:$src), imm:$lane)),
4510 (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src,
4511 (DSubReg_i16_reg imm:$lane))),
4512 (SubReg_i16_lane imm:$lane)))>;
4513 def : Pat<(v4i32 (NEONvduplane (v4i32 QPR:$src), imm:$lane)),
4514 (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src,
4515 (DSubReg_i32_reg imm:$lane))),
4516 (SubReg_i32_lane imm:$lane)))>;
4517 def : Pat<(v4f32 (NEONvduplane (v4f32 QPR:$src), imm:$lane)),
4518 (v4f32 (VDUPLN32q (v2f32 (EXTRACT_SUBREG QPR:$src,
4519 (DSubReg_i32_reg imm:$lane))),
4520 (SubReg_i32_lane imm:$lane)))>;
4522 def VDUPfdf : PseudoNeonI<(outs DPR:$dst), (ins SPR:$src), IIC_VMOVD, "",
4523 [(set DPR:$dst, (v2f32 (NEONvdup (f32 SPR:$src))))]>;
4524 def VDUPfqf : PseudoNeonI<(outs QPR:$dst), (ins SPR:$src), IIC_VMOVD, "",
4525 [(set QPR:$dst, (v4f32 (NEONvdup (f32 SPR:$src))))]>;
4527 // VMOVN : Vector Narrowing Move
4528 defm VMOVN : N2VN_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVN,
4529 "vmovn", "i", trunc>;
4530 // VQMOVN : Vector Saturating Narrowing Move
4531 defm VQMOVNs : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD,
4532 "vqmovn", "s", int_arm_neon_vqmovns>;
4533 defm VQMOVNu : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD,
4534 "vqmovn", "u", int_arm_neon_vqmovnu>;
4535 defm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD,
4536 "vqmovun", "s", int_arm_neon_vqmovnsu>;
4537 // VMOVL : Vector Lengthening Move
4538 defm VMOVLs : N2VL_QHS<0b01,0b10100,0,1, "vmovl", "s", sext>;
4539 defm VMOVLu : N2VL_QHS<0b11,0b10100,0,1, "vmovl", "u", zext>;
4541 // Vector Conversions.
4543 // VCVT : Vector Convert Between Floating-Point and Integers
4544 def VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
4545 v2i32, v2f32, fp_to_sint>;
4546 def VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
4547 v2i32, v2f32, fp_to_uint>;
4548 def VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
4549 v2f32, v2i32, sint_to_fp>;
4550 def VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
4551 v2f32, v2i32, uint_to_fp>;
4553 def VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
4554 v4i32, v4f32, fp_to_sint>;
4555 def VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
4556 v4i32, v4f32, fp_to_uint>;
4557 def VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
4558 v4f32, v4i32, sint_to_fp>;
4559 def VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
4560 v4f32, v4i32, uint_to_fp>;
4562 // VCVT : Vector Convert Between Floating-Point and Fixed-Point.
4563 def VCVTf2xsd : N2VCvtD<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
4564 v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
4565 def VCVTf2xud : N2VCvtD<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
4566 v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
4567 def VCVTxs2fd : N2VCvtD<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
4568 v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
4569 def VCVTxu2fd : N2VCvtD<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
4570 v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
4572 def VCVTf2xsq : N2VCvtQ<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
4573 v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
4574 def VCVTf2xuq : N2VCvtQ<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
4575 v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
4576 def VCVTxs2fq : N2VCvtQ<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
4577 v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
4578 def VCVTxu2fq : N2VCvtQ<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
4579 v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
4581 // VCVT : Vector Convert Between Half-Precision and Single-Precision.
4582 def VCVTf2h : N2VNInt<0b11, 0b11, 0b01, 0b10, 0b01100, 0, 0,
4583 IIC_VUNAQ, "vcvt", "f16.f32",
4584 v4i16, v4f32, int_arm_neon_vcvtfp2hf>,
4585 Requires<[HasNEON, HasFP16]>;
4586 def VCVTh2f : N2VLInt<0b11, 0b11, 0b01, 0b10, 0b01110, 0, 0,
4587 IIC_VUNAQ, "vcvt", "f32.f16",
4588 v4f32, v4i16, int_arm_neon_vcvthf2fp>,
4589 Requires<[HasNEON, HasFP16]>;
4593 // VREV64 : Vector Reverse elements within 64-bit doublewords
4595 class VREV64D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4596 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$Vd),
4597 (ins DPR:$Vm), IIC_VMOVD,
4598 OpcodeStr, Dt, "$Vd, $Vm", "",
4599 [(set DPR:$Vd, (Ty (NEONvrev64 (Ty DPR:$Vm))))]>;
4600 class VREV64Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4601 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$Vd),
4602 (ins QPR:$Vm), IIC_VMOVQ,
4603 OpcodeStr, Dt, "$Vd, $Vm", "",
4604 [(set QPR:$Vd, (Ty (NEONvrev64 (Ty QPR:$Vm))))]>;
4606 def VREV64d8 : VREV64D<0b00, "vrev64", "8", v8i8>;
4607 def VREV64d16 : VREV64D<0b01, "vrev64", "16", v4i16>;
4608 def VREV64d32 : VREV64D<0b10, "vrev64", "32", v2i32>;
4609 def : Pat<(v2f32 (NEONvrev64 (v2f32 DPR:$Vm))), (VREV64d32 DPR:$Vm)>;
4611 def VREV64q8 : VREV64Q<0b00, "vrev64", "8", v16i8>;
4612 def VREV64q16 : VREV64Q<0b01, "vrev64", "16", v8i16>;
4613 def VREV64q32 : VREV64Q<0b10, "vrev64", "32", v4i32>;
4614 def : Pat<(v4f32 (NEONvrev64 (v4f32 QPR:$Vm))), (VREV64q32 QPR:$Vm)>;
4616 // VREV32 : Vector Reverse elements within 32-bit words
4618 class VREV32D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4619 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$Vd),
4620 (ins DPR:$Vm), IIC_VMOVD,
4621 OpcodeStr, Dt, "$Vd, $Vm", "",
4622 [(set DPR:$Vd, (Ty (NEONvrev32 (Ty DPR:$Vm))))]>;
4623 class VREV32Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4624 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$Vd),
4625 (ins QPR:$Vm), IIC_VMOVQ,
4626 OpcodeStr, Dt, "$Vd, $Vm", "",
4627 [(set QPR:$Vd, (Ty (NEONvrev32 (Ty QPR:$Vm))))]>;
4629 def VREV32d8 : VREV32D<0b00, "vrev32", "8", v8i8>;
4630 def VREV32d16 : VREV32D<0b01, "vrev32", "16", v4i16>;
4632 def VREV32q8 : VREV32Q<0b00, "vrev32", "8", v16i8>;
4633 def VREV32q16 : VREV32Q<0b01, "vrev32", "16", v8i16>;
4635 // VREV16 : Vector Reverse elements within 16-bit halfwords
4637 class VREV16D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4638 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$Vd),
4639 (ins DPR:$Vm), IIC_VMOVD,
4640 OpcodeStr, Dt, "$Vd, $Vm", "",
4641 [(set DPR:$Vd, (Ty (NEONvrev16 (Ty DPR:$Vm))))]>;
4642 class VREV16Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4643 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$Vd),
4644 (ins QPR:$Vm), IIC_VMOVQ,
4645 OpcodeStr, Dt, "$Vd, $Vm", "",
4646 [(set QPR:$Vd, (Ty (NEONvrev16 (Ty QPR:$Vm))))]>;
4648 def VREV16d8 : VREV16D<0b00, "vrev16", "8", v8i8>;
4649 def VREV16q8 : VREV16Q<0b00, "vrev16", "8", v16i8>;
4651 // Other Vector Shuffles.
4653 // Aligned extractions: really just dropping registers
4655 class AlignedVEXTq<ValueType DestTy, ValueType SrcTy, SDNodeXForm LaneCVT>
4656 : Pat<(DestTy (vector_extract_subvec (SrcTy QPR:$src), (i32 imm:$start))),
4657 (EXTRACT_SUBREG (SrcTy QPR:$src), (LaneCVT imm:$start))>;
4659 def : AlignedVEXTq<v8i8, v16i8, DSubReg_i8_reg>;
4661 def : AlignedVEXTq<v4i16, v8i16, DSubReg_i16_reg>;
4663 def : AlignedVEXTq<v2i32, v4i32, DSubReg_i32_reg>;
4665 def : AlignedVEXTq<v1i64, v2i64, DSubReg_f64_reg>;
4667 def : AlignedVEXTq<v2f32, v4f32, DSubReg_i32_reg>;
4670 // VEXT : Vector Extract
4672 class VEXTd<string OpcodeStr, string Dt, ValueType Ty>
4673 : N3V<0,1,0b11,{?,?,?,?},0,0, (outs DPR:$Vd),
4674 (ins DPR:$Vn, DPR:$Vm, i32imm:$index), NVExtFrm,
4675 IIC_VEXTD, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
4676 [(set DPR:$Vd, (Ty (NEONvext (Ty DPR:$Vn),
4677 (Ty DPR:$Vm), imm:$index)))]> {
4679 let Inst{11-8} = index{3-0};
4682 class VEXTq<string OpcodeStr, string Dt, ValueType Ty>
4683 : N3V<0,1,0b11,{?,?,?,?},1,0, (outs QPR:$Vd),
4684 (ins QPR:$Vn, QPR:$Vm, i32imm:$index), NVExtFrm,
4685 IIC_VEXTQ, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
4686 [(set QPR:$Vd, (Ty (NEONvext (Ty QPR:$Vn),
4687 (Ty QPR:$Vm), imm:$index)))]> {
4689 let Inst{11-8} = index{3-0};
4692 def VEXTd8 : VEXTd<"vext", "8", v8i8> {
4693 let Inst{11-8} = index{3-0};
4695 def VEXTd16 : VEXTd<"vext", "16", v4i16> {
4696 let Inst{11-9} = index{2-0};
4699 def VEXTd32 : VEXTd<"vext", "32", v2i32> {
4700 let Inst{11-10} = index{1-0};
4701 let Inst{9-8} = 0b00;
4703 def : Pat<(v2f32 (NEONvext (v2f32 DPR:$Vn),
4706 (VEXTd32 DPR:$Vn, DPR:$Vm, imm:$index)>;
4708 def VEXTq8 : VEXTq<"vext", "8", v16i8> {
4709 let Inst{11-8} = index{3-0};
4711 def VEXTq16 : VEXTq<"vext", "16", v8i16> {
4712 let Inst{11-9} = index{2-0};
4715 def VEXTq32 : VEXTq<"vext", "32", v4i32> {
4716 let Inst{11-10} = index{1-0};
4717 let Inst{9-8} = 0b00;
4719 def : Pat<(v4f32 (NEONvext (v4f32 QPR:$Vn),
4722 (VEXTq32 QPR:$Vn, QPR:$Vm, imm:$index)>;
4724 // VTRN : Vector Transpose
4726 def VTRNd8 : N2VDShuffle<0b00, 0b00001, "vtrn", "8">;
4727 def VTRNd16 : N2VDShuffle<0b01, 0b00001, "vtrn", "16">;
4728 def VTRNd32 : N2VDShuffle<0b10, 0b00001, "vtrn", "32">;
4730 def VTRNq8 : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn", "8">;
4731 def VTRNq16 : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn", "16">;
4732 def VTRNq32 : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn", "32">;
4734 // VUZP : Vector Unzip (Deinterleave)
4736 def VUZPd8 : N2VDShuffle<0b00, 0b00010, "vuzp", "8">;
4737 def VUZPd16 : N2VDShuffle<0b01, 0b00010, "vuzp", "16">;
4738 def VUZPd32 : N2VDShuffle<0b10, 0b00010, "vuzp", "32">;
4740 def VUZPq8 : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp", "8">;
4741 def VUZPq16 : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp", "16">;
4742 def VUZPq32 : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp", "32">;
4744 // VZIP : Vector Zip (Interleave)
4746 def VZIPd8 : N2VDShuffle<0b00, 0b00011, "vzip", "8">;
4747 def VZIPd16 : N2VDShuffle<0b01, 0b00011, "vzip", "16">;
4748 def VZIPd32 : N2VDShuffle<0b10, 0b00011, "vzip", "32">;
4750 def VZIPq8 : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip", "8">;
4751 def VZIPq16 : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip", "16">;
4752 def VZIPq32 : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip", "32">;
4754 // Vector Table Lookup and Table Extension.
4756 // VTBL : Vector Table Lookup
4758 : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$Vd),
4759 (ins DPR:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB1,
4760 "vtbl", "8", "$Vd, \\{$Vn\\}, $Vm", "",
4761 [(set DPR:$Vd, (v8i8 (int_arm_neon_vtbl1 DPR:$Vn, DPR:$Vm)))]>;
4762 let hasExtraSrcRegAllocReq = 1 in {
4764 : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$Vd),
4765 (ins DPR:$Vn, DPR:$tbl2, DPR:$Vm), NVTBLFrm, IIC_VTB2,
4766 "vtbl", "8", "$Vd, \\{$Vn, $tbl2\\}, $Vm", "", []>;
4768 : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$Vd),
4769 (ins DPR:$Vn, DPR:$tbl2, DPR:$tbl3, DPR:$Vm), NVTBLFrm, IIC_VTB3,
4770 "vtbl", "8", "$Vd, \\{$Vn, $tbl2, $tbl3\\}, $Vm", "", []>;
4772 : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$Vd),
4773 (ins DPR:$Vn, DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$Vm),
4775 "vtbl", "8", "$Vd, \\{$Vn, $tbl2, $tbl3, $tbl4\\}, $Vm", "", []>;
4776 } // hasExtraSrcRegAllocReq = 1
4779 : PseudoNeonI<(outs DPR:$dst), (ins QPR:$tbl, DPR:$src), IIC_VTB2, "", []>;
4781 : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB3, "", []>;
4783 : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB4, "", []>;
4785 // VTBX : Vector Table Extension
4787 : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$Vd),
4788 (ins DPR:$orig, DPR:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX1,
4789 "vtbx", "8", "$Vd, \\{$Vn\\}, $Vm", "$orig = $Vd",
4790 [(set DPR:$Vd, (v8i8 (int_arm_neon_vtbx1
4791 DPR:$orig, DPR:$Vn, DPR:$Vm)))]>;
4792 let hasExtraSrcRegAllocReq = 1 in {
4794 : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$Vd),
4795 (ins DPR:$orig, DPR:$Vn, DPR:$tbl2, DPR:$Vm), NVTBLFrm, IIC_VTBX2,
4796 "vtbx", "8", "$Vd, \\{$Vn, $tbl2\\}, $Vm", "$orig = $Vd", []>;
4798 : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$Vd),
4799 (ins DPR:$orig, DPR:$Vn, DPR:$tbl2, DPR:$tbl3, DPR:$Vm),
4800 NVTBLFrm, IIC_VTBX3,
4801 "vtbx", "8", "$Vd, \\{$Vn, $tbl2, $tbl3\\}, $Vm",
4804 : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$Vd), (ins DPR:$orig, DPR:$Vn,
4805 DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$Vm), NVTBLFrm, IIC_VTBX4,
4806 "vtbx", "8", "$Vd, \\{$Vn, $tbl2, $tbl3, $tbl4\\}, $Vm",
4808 } // hasExtraSrcRegAllocReq = 1
4811 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QPR:$tbl, DPR:$src),
4812 IIC_VTBX2, "$orig = $dst", []>;
4814 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
4815 IIC_VTBX3, "$orig = $dst", []>;
4817 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
4818 IIC_VTBX4, "$orig = $dst", []>;
4820 //===----------------------------------------------------------------------===//
4821 // NEON instructions for single-precision FP math
4822 //===----------------------------------------------------------------------===//
4824 class N2VSPat<SDNode OpNode, NeonI Inst>
4825 : NEONFPPat<(f32 (OpNode SPR:$a)),
4827 (v2f32 (COPY_TO_REGCLASS (Inst
4829 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
4830 SPR:$a, ssub_0)), DPR_VFP2)), ssub_0)>;
4832 class N3VSPat<SDNode OpNode, NeonI Inst>
4833 : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
4835 (v2f32 (COPY_TO_REGCLASS (Inst
4837 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
4840 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
4841 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
4843 class N3VSMulOpPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
4844 : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
4846 (v2f32 (COPY_TO_REGCLASS (Inst
4848 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
4851 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
4854 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
4855 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
4857 def : N3VSPat<fadd, VADDfd>;
4858 def : N3VSPat<fsub, VSUBfd>;
4859 def : N3VSPat<fmul, VMULfd>;
4860 def : N3VSMulOpPat<fmul, fadd, VMLAfd>,
4861 Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
4862 def : N3VSMulOpPat<fmul, fsub, VMLSfd>,
4863 Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
4864 def : N2VSPat<fabs, VABSfd>;
4865 def : N2VSPat<fneg, VNEGfd>;
4866 def : N3VSPat<NEONfmax, VMAXfd>;
4867 def : N3VSPat<NEONfmin, VMINfd>;
4868 def : N2VSPat<arm_ftosi, VCVTf2sd>;
4869 def : N2VSPat<arm_ftoui, VCVTf2ud>;
4870 def : N2VSPat<arm_sitof, VCVTs2fd>;
4871 def : N2VSPat<arm_uitof, VCVTu2fd>;
4873 //===----------------------------------------------------------------------===//
4874 // Non-Instruction Patterns
4875 //===----------------------------------------------------------------------===//
4878 def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
4879 def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
4880 def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (v1i64 DPR:$src)>;
4881 def : Pat<(v1i64 (bitconvert (f64 DPR:$src))), (v1i64 DPR:$src)>;
4882 def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
4883 def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
4884 def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
4885 def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (v2i32 DPR:$src)>;
4886 def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (v2i32 DPR:$src)>;
4887 def : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
4888 def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
4889 def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
4890 def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (v4i16 DPR:$src)>;
4891 def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (v4i16 DPR:$src)>;
4892 def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
4893 def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (v8i8 DPR:$src)>;
4894 def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (v8i8 DPR:$src)>;
4895 def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (v8i8 DPR:$src)>;
4896 def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (v8i8 DPR:$src)>;
4897 def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (v8i8 DPR:$src)>;
4898 def : Pat<(f64 (bitconvert (v1i64 DPR:$src))), (f64 DPR:$src)>;
4899 def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (f64 DPR:$src)>;
4900 def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (f64 DPR:$src)>;
4901 def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (f64 DPR:$src)>;
4902 def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (f64 DPR:$src)>;
4903 def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (v2f32 DPR:$src)>;
4904 def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
4905 def : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
4906 def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
4907 def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (v2f32 DPR:$src)>;
4909 def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
4910 def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
4911 def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
4912 def : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
4913 def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
4914 def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
4915 def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
4916 def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
4917 def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
4918 def : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
4919 def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
4920 def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
4921 def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
4922 def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
4923 def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
4924 def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
4925 def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
4926 def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
4927 def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
4928 def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
4929 def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
4930 def : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
4931 def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
4932 def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
4933 def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
4934 def : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
4935 def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
4936 def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
4937 def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
4938 def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;