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 NEONvdup : SDNode<"ARMISD::VDUP", SDTypeProfile<1, 1, [SDTCisVec<0>]>>;
85 // VDUPLANE can produce a quad-register result from a double-register source,
86 // so the result is not constrained to match the source.
87 def NEONvduplane : SDNode<"ARMISD::VDUPLANE",
88 SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisVec<1>,
91 def SDTARMVEXT : SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0, 1>,
92 SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>;
93 def NEONvext : SDNode<"ARMISD::VEXT", SDTARMVEXT>;
95 def SDTARMVSHUF : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisSameAs<0, 1>]>;
96 def NEONvrev64 : SDNode<"ARMISD::VREV64", SDTARMVSHUF>;
97 def NEONvrev32 : SDNode<"ARMISD::VREV32", SDTARMVSHUF>;
98 def NEONvrev16 : SDNode<"ARMISD::VREV16", SDTARMVSHUF>;
100 def SDTARMVSHUF2 : SDTypeProfile<2, 2, [SDTCisVec<0>, SDTCisSameAs<0, 1>,
102 SDTCisSameAs<0, 3>]>;
103 def NEONzip : SDNode<"ARMISD::VZIP", SDTARMVSHUF2>;
104 def NEONuzp : SDNode<"ARMISD::VUZP", SDTARMVSHUF2>;
105 def NEONtrn : SDNode<"ARMISD::VTRN", SDTARMVSHUF2>;
107 def SDTARMVMULL : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisInt<1>,
108 SDTCisSameAs<1, 2>]>;
109 def NEONvmulls : SDNode<"ARMISD::VMULLs", SDTARMVMULL>;
110 def NEONvmullu : SDNode<"ARMISD::VMULLu", SDTARMVMULL>;
112 def SDTARMFMAX : SDTypeProfile<1, 2, [SDTCisVT<0, f32>, SDTCisSameAs<0, 1>,
113 SDTCisSameAs<0, 2>]>;
114 def NEONfmax : SDNode<"ARMISD::FMAX", SDTARMFMAX>;
115 def NEONfmin : SDNode<"ARMISD::FMIN", SDTARMFMAX>;
117 def NEONimmAllZerosV: PatLeaf<(NEONvmovImm (i32 timm)), [{
118 ConstantSDNode *ConstVal = cast<ConstantSDNode>(N->getOperand(0));
119 unsigned EltBits = 0;
120 uint64_t EltVal = ARM_AM::decodeNEONModImm(ConstVal->getZExtValue(), EltBits);
121 return (EltBits == 32 && EltVal == 0);
124 def NEONimmAllOnesV: PatLeaf<(NEONvmovImm (i32 timm)), [{
125 ConstantSDNode *ConstVal = cast<ConstantSDNode>(N->getOperand(0));
126 unsigned EltBits = 0;
127 uint64_t EltVal = ARM_AM::decodeNEONModImm(ConstVal->getZExtValue(), EltBits);
128 return (EltBits == 8 && EltVal == 0xff);
131 //===----------------------------------------------------------------------===//
132 // NEON operand definitions
133 //===----------------------------------------------------------------------===//
135 def nModImm : Operand<i32> {
136 let PrintMethod = "printNEONModImmOperand";
139 //===----------------------------------------------------------------------===//
140 // NEON load / store instructions
141 //===----------------------------------------------------------------------===//
143 // Use VLDM to load a Q register as a D register pair.
144 // This is a pseudo instruction that is expanded to VLDMD after reg alloc.
146 : PseudoVFPLdStM<(outs QPR:$dst), (ins GPR:$Rn),
148 [(set QPR:$dst, (v2f64 (load GPR:$Rn)))]>;
150 : PseudoVFPLdStM<(outs QPR:$dst), (ins GPR:$Rn),
152 [(set QPR:$dst, (v2f64 (load GPR:$Rn)))]>;
154 // Use VSTM to store a Q register as a D register pair.
155 // This is a pseudo instruction that is expanded to VSTMD after reg alloc.
157 : PseudoVFPLdStM<(outs), (ins QPR:$src, GPR:$Rn),
159 [(store (v2f64 QPR:$src), GPR:$Rn)]>;
161 : PseudoVFPLdStM<(outs), (ins QPR:$src, GPR:$Rn),
163 [(store (v2f64 QPR:$src), GPR:$Rn)]>;
165 // Classes for VLD* pseudo-instructions with multi-register operands.
166 // These are expanded to real instructions after register allocation.
167 class VLDQPseudo<InstrItinClass itin>
168 : PseudoNLdSt<(outs QPR:$dst), (ins addrmode6:$addr), itin, "">;
169 class VLDQWBPseudo<InstrItinClass itin>
170 : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
171 (ins addrmode6:$addr, am6offset:$offset), itin,
173 class VLDQQPseudo<InstrItinClass itin>
174 : PseudoNLdSt<(outs QQPR:$dst), (ins addrmode6:$addr), itin, "">;
175 class VLDQQWBPseudo<InstrItinClass itin>
176 : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
177 (ins addrmode6:$addr, am6offset:$offset), itin,
179 class VLDQQQQWBPseudo<InstrItinClass itin>
180 : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
181 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
182 "$addr.addr = $wb, $src = $dst">;
184 let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
186 // VLD1 : Vector Load (multiple single elements)
187 class VLD1D<bits<4> op7_4, string Dt>
188 : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$Vd),
189 (ins addrmode6:$Rn), IIC_VLD1,
190 "vld1", Dt, "\\{$Vd\\}, $Rn", "", []> {
194 class VLD1Q<bits<4> op7_4, string Dt>
195 : NLdSt<0,0b10,0b1010,op7_4, (outs DPR:$Vd, DPR:$dst2),
196 (ins addrmode6:$Rn), IIC_VLD1x2,
197 "vld1", Dt, "\\{$Vd, $dst2\\}, $Rn", "", []> {
199 let Inst{5-4} = Rn{5-4};
202 def VLD1d8 : VLD1D<{0,0,0,?}, "8">;
203 def VLD1d16 : VLD1D<{0,1,0,?}, "16">;
204 def VLD1d32 : VLD1D<{1,0,0,?}, "32">;
205 def VLD1d64 : VLD1D<{1,1,0,?}, "64">;
207 def VLD1q8 : VLD1Q<{0,0,?,?}, "8">;
208 def VLD1q16 : VLD1Q<{0,1,?,?}, "16">;
209 def VLD1q32 : VLD1Q<{1,0,?,?}, "32">;
210 def VLD1q64 : VLD1Q<{1,1,?,?}, "64">;
212 def VLD1q8Pseudo : VLDQPseudo<IIC_VLD1x2>;
213 def VLD1q16Pseudo : VLDQPseudo<IIC_VLD1x2>;
214 def VLD1q32Pseudo : VLDQPseudo<IIC_VLD1x2>;
215 def VLD1q64Pseudo : VLDQPseudo<IIC_VLD1x2>;
217 // ...with address register writeback:
218 class VLD1DWB<bits<4> op7_4, string Dt>
219 : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$Vd, GPR:$wb),
220 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1u,
221 "vld1", Dt, "\\{$Vd\\}, $Rn$Rm",
222 "$Rn.addr = $wb", []> {
225 class VLD1QWB<bits<4> op7_4, string Dt>
226 : NLdSt<0,0b10,0b1010,op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
227 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1x2u,
228 "vld1", Dt, "\\{$Vd, $dst2\\}, $Rn$Rm",
229 "$Rn.addr = $wb", []> {
230 let Inst{5-4} = Rn{5-4};
233 def VLD1d8_UPD : VLD1DWB<{0,0,0,?}, "8">;
234 def VLD1d16_UPD : VLD1DWB<{0,1,0,?}, "16">;
235 def VLD1d32_UPD : VLD1DWB<{1,0,0,?}, "32">;
236 def VLD1d64_UPD : VLD1DWB<{1,1,0,?}, "64">;
238 def VLD1q8_UPD : VLD1QWB<{0,0,?,?}, "8">;
239 def VLD1q16_UPD : VLD1QWB<{0,1,?,?}, "16">;
240 def VLD1q32_UPD : VLD1QWB<{1,0,?,?}, "32">;
241 def VLD1q64_UPD : VLD1QWB<{1,1,?,?}, "64">;
243 def VLD1q8Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
244 def VLD1q16Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
245 def VLD1q32Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
246 def VLD1q64Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
248 // ...with 3 registers (some of these are only for the disassembler):
249 class VLD1D3<bits<4> op7_4, string Dt>
250 : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
251 (ins addrmode6:$Rn), IIC_VLD1x3, "vld1", Dt,
252 "\\{$Vd, $dst2, $dst3\\}, $Rn", "", []> {
256 class VLD1D3WB<bits<4> op7_4, string Dt>
257 : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
258 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1x3u, "vld1", Dt,
259 "\\{$Vd, $dst2, $dst3\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
263 def VLD1d8T : VLD1D3<{0,0,0,?}, "8">;
264 def VLD1d16T : VLD1D3<{0,1,0,?}, "16">;
265 def VLD1d32T : VLD1D3<{1,0,0,?}, "32">;
266 def VLD1d64T : VLD1D3<{1,1,0,?}, "64">;
268 def VLD1d8T_UPD : VLD1D3WB<{0,0,0,?}, "8">;
269 def VLD1d16T_UPD : VLD1D3WB<{0,1,0,?}, "16">;
270 def VLD1d32T_UPD : VLD1D3WB<{1,0,0,?}, "32">;
271 def VLD1d64T_UPD : VLD1D3WB<{1,1,0,?}, "64">;
273 def VLD1d64TPseudo : VLDQQPseudo<IIC_VLD1x3>;
274 def VLD1d64TPseudo_UPD : VLDQQWBPseudo<IIC_VLD1x3u>;
276 // ...with 4 registers (some of these are only for the disassembler):
277 class VLD1D4<bits<4> op7_4, string Dt>
278 : NLdSt<0,0b10,0b0010,op7_4,(outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
279 (ins addrmode6:$Rn), IIC_VLD1x4, "vld1", Dt,
280 "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []> {
282 let Inst{5-4} = Rn{5-4};
284 class VLD1D4WB<bits<4> op7_4, string Dt>
285 : NLdSt<0,0b10,0b0010,op7_4,
286 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
287 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD4, "vld1", Dt,
288 "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm", "$Rn.addr = $wb",
290 let Inst{5-4} = Rn{5-4};
293 def VLD1d8Q : VLD1D4<{0,0,?,?}, "8">;
294 def VLD1d16Q : VLD1D4<{0,1,?,?}, "16">;
295 def VLD1d32Q : VLD1D4<{1,0,?,?}, "32">;
296 def VLD1d64Q : VLD1D4<{1,1,?,?}, "64">;
298 def VLD1d8Q_UPD : VLD1D4WB<{0,0,?,?}, "8">;
299 def VLD1d16Q_UPD : VLD1D4WB<{0,1,?,?}, "16">;
300 def VLD1d32Q_UPD : VLD1D4WB<{1,0,?,?}, "32">;
301 def VLD1d64Q_UPD : VLD1D4WB<{1,1,?,?}, "64">;
303 def VLD1d64QPseudo : VLDQQPseudo<IIC_VLD1x4>;
304 def VLD1d64QPseudo_UPD : VLDQQWBPseudo<IIC_VLD1x4u>;
306 // VLD2 : Vector Load (multiple 2-element structures)
307 class VLD2D<bits<4> op11_8, bits<4> op7_4, string Dt>
308 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2),
309 (ins addrmode6:$Rn), IIC_VLD2,
310 "vld2", Dt, "\\{$Vd, $dst2\\}, $Rn", "", []> {
312 let Inst{5-4} = Rn{5-4};
314 class VLD2Q<bits<4> op7_4, string Dt>
315 : NLdSt<0, 0b10, 0b0011, op7_4,
316 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
317 (ins addrmode6:$Rn), IIC_VLD2x2,
318 "vld2", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []> {
320 let Inst{5-4} = Rn{5-4};
323 def VLD2d8 : VLD2D<0b1000, {0,0,?,?}, "8">;
324 def VLD2d16 : VLD2D<0b1000, {0,1,?,?}, "16">;
325 def VLD2d32 : VLD2D<0b1000, {1,0,?,?}, "32">;
327 def VLD2q8 : VLD2Q<{0,0,?,?}, "8">;
328 def VLD2q16 : VLD2Q<{0,1,?,?}, "16">;
329 def VLD2q32 : VLD2Q<{1,0,?,?}, "32">;
331 def VLD2d8Pseudo : VLDQPseudo<IIC_VLD2>;
332 def VLD2d16Pseudo : VLDQPseudo<IIC_VLD2>;
333 def VLD2d32Pseudo : VLDQPseudo<IIC_VLD2>;
335 def VLD2q8Pseudo : VLDQQPseudo<IIC_VLD2x2>;
336 def VLD2q16Pseudo : VLDQQPseudo<IIC_VLD2x2>;
337 def VLD2q32Pseudo : VLDQQPseudo<IIC_VLD2x2>;
339 // ...with address register writeback:
340 class VLD2DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
341 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
342 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD2u,
343 "vld2", Dt, "\\{$Vd, $dst2\\}, $Rn$Rm",
344 "$Rn.addr = $wb", []> {
345 let Inst{5-4} = Rn{5-4};
347 class VLD2QWB<bits<4> op7_4, string Dt>
348 : NLdSt<0, 0b10, 0b0011, op7_4,
349 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
350 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD2x2u,
351 "vld2", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm",
352 "$Rn.addr = $wb", []> {
353 let Inst{5-4} = Rn{5-4};
356 def VLD2d8_UPD : VLD2DWB<0b1000, {0,0,?,?}, "8">;
357 def VLD2d16_UPD : VLD2DWB<0b1000, {0,1,?,?}, "16">;
358 def VLD2d32_UPD : VLD2DWB<0b1000, {1,0,?,?}, "32">;
360 def VLD2q8_UPD : VLD2QWB<{0,0,?,?}, "8">;
361 def VLD2q16_UPD : VLD2QWB<{0,1,?,?}, "16">;
362 def VLD2q32_UPD : VLD2QWB<{1,0,?,?}, "32">;
364 def VLD2d8Pseudo_UPD : VLDQWBPseudo<IIC_VLD2u>;
365 def VLD2d16Pseudo_UPD : VLDQWBPseudo<IIC_VLD2u>;
366 def VLD2d32Pseudo_UPD : VLDQWBPseudo<IIC_VLD2u>;
368 def VLD2q8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD2x2u>;
369 def VLD2q16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD2x2u>;
370 def VLD2q32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD2x2u>;
372 // ...with double-spaced registers (for disassembly only):
373 def VLD2b8 : VLD2D<0b1001, {0,0,?,?}, "8">;
374 def VLD2b16 : VLD2D<0b1001, {0,1,?,?}, "16">;
375 def VLD2b32 : VLD2D<0b1001, {1,0,?,?}, "32">;
376 def VLD2b8_UPD : VLD2DWB<0b1001, {0,0,?,?}, "8">;
377 def VLD2b16_UPD : VLD2DWB<0b1001, {0,1,?,?}, "16">;
378 def VLD2b32_UPD : VLD2DWB<0b1001, {1,0,?,?}, "32">;
380 // VLD3 : Vector Load (multiple 3-element structures)
381 class VLD3D<bits<4> op11_8, bits<4> op7_4, string Dt>
382 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
383 (ins addrmode6:$Rn), IIC_VLD3,
384 "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn", "", []> {
389 def VLD3d8 : VLD3D<0b0100, {0,0,0,?}, "8">;
390 def VLD3d16 : VLD3D<0b0100, {0,1,0,?}, "16">;
391 def VLD3d32 : VLD3D<0b0100, {1,0,0,?}, "32">;
393 def VLD3d8Pseudo : VLDQQPseudo<IIC_VLD3>;
394 def VLD3d16Pseudo : VLDQQPseudo<IIC_VLD3>;
395 def VLD3d32Pseudo : VLDQQPseudo<IIC_VLD3>;
397 // ...with address register writeback:
398 class VLD3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
399 : NLdSt<0, 0b10, op11_8, op7_4,
400 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
401 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD3u,
402 "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn$Rm",
403 "$Rn.addr = $wb", []> {
407 def VLD3d8_UPD : VLD3DWB<0b0100, {0,0,0,?}, "8">;
408 def VLD3d16_UPD : VLD3DWB<0b0100, {0,1,0,?}, "16">;
409 def VLD3d32_UPD : VLD3DWB<0b0100, {1,0,0,?}, "32">;
411 def VLD3d8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>;
412 def VLD3d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>;
413 def VLD3d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>;
415 // ...with double-spaced registers (non-updating versions for disassembly only):
416 def VLD3q8 : VLD3D<0b0101, {0,0,0,?}, "8">;
417 def VLD3q16 : VLD3D<0b0101, {0,1,0,?}, "16">;
418 def VLD3q32 : VLD3D<0b0101, {1,0,0,?}, "32">;
419 def VLD3q8_UPD : VLD3DWB<0b0101, {0,0,0,?}, "8">;
420 def VLD3q16_UPD : VLD3DWB<0b0101, {0,1,0,?}, "16">;
421 def VLD3q32_UPD : VLD3DWB<0b0101, {1,0,0,?}, "32">;
423 def VLD3q8Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
424 def VLD3q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
425 def VLD3q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
427 // ...alternate versions to be allocated odd register numbers:
428 def VLD3q8oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
429 def VLD3q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
430 def VLD3q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
432 // VLD4 : Vector Load (multiple 4-element structures)
433 class VLD4D<bits<4> op11_8, bits<4> op7_4, string Dt>
434 : NLdSt<0, 0b10, op11_8, op7_4,
435 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
436 (ins addrmode6:$Rn), IIC_VLD4,
437 "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []> {
439 let Inst{5-4} = Rn{5-4};
442 def VLD4d8 : VLD4D<0b0000, {0,0,?,?}, "8">;
443 def VLD4d16 : VLD4D<0b0000, {0,1,?,?}, "16">;
444 def VLD4d32 : VLD4D<0b0000, {1,0,?,?}, "32">;
446 def VLD4d8Pseudo : VLDQQPseudo<IIC_VLD4>;
447 def VLD4d16Pseudo : VLDQQPseudo<IIC_VLD4>;
448 def VLD4d32Pseudo : VLDQQPseudo<IIC_VLD4>;
450 // ...with address register writeback:
451 class VLD4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
452 : NLdSt<0, 0b10, op11_8, op7_4,
453 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
454 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD4,
455 "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm",
456 "$Rn.addr = $wb", []> {
457 let Inst{5-4} = Rn{5-4};
460 def VLD4d8_UPD : VLD4DWB<0b0000, {0,0,?,?}, "8">;
461 def VLD4d16_UPD : VLD4DWB<0b0000, {0,1,?,?}, "16">;
462 def VLD4d32_UPD : VLD4DWB<0b0000, {1,0,?,?}, "32">;
464 def VLD4d8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4>;
465 def VLD4d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4>;
466 def VLD4d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4>;
468 // ...with double-spaced registers (non-updating versions for disassembly only):
469 def VLD4q8 : VLD4D<0b0001, {0,0,?,?}, "8">;
470 def VLD4q16 : VLD4D<0b0001, {0,1,?,?}, "16">;
471 def VLD4q32 : VLD4D<0b0001, {1,0,?,?}, "32">;
472 def VLD4q8_UPD : VLD4DWB<0b0001, {0,0,?,?}, "8">;
473 def VLD4q16_UPD : VLD4DWB<0b0001, {0,1,?,?}, "16">;
474 def VLD4q32_UPD : VLD4DWB<0b0001, {1,0,?,?}, "32">;
476 def VLD4q8Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4>;
477 def VLD4q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4>;
478 def VLD4q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4>;
480 // ...alternate versions to be allocated odd register numbers:
481 def VLD4q8oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4>;
482 def VLD4q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4>;
483 def VLD4q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4>;
485 } // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
487 // Classes for VLD*LN pseudo-instructions with multi-register operands.
488 // These are expanded to real instructions after register allocation.
489 class VLDQLNPseudo<InstrItinClass itin>
490 : PseudoNLdSt<(outs QPR:$dst),
491 (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
492 itin, "$src = $dst">;
493 class VLDQLNWBPseudo<InstrItinClass itin>
494 : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
495 (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
496 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
497 class VLDQQLNPseudo<InstrItinClass itin>
498 : PseudoNLdSt<(outs QQPR:$dst),
499 (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
500 itin, "$src = $dst">;
501 class VLDQQLNWBPseudo<InstrItinClass itin>
502 : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
503 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
504 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
505 class VLDQQQQLNPseudo<InstrItinClass itin>
506 : PseudoNLdSt<(outs QQQQPR:$dst),
507 (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
508 itin, "$src = $dst">;
509 class VLDQQQQLNWBPseudo<InstrItinClass itin>
510 : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
511 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
512 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
514 // VLD1LN : Vector Load (single element to one lane)
515 class VLD1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
517 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd),
518 (ins addrmode6:$Rn, DPR:$src, nohash_imm:$lane),
519 IIC_VLD1ln, "vld1", Dt, "\\{$Vd[$lane]\\}, $Rn",
521 [(set DPR:$Vd, (vector_insert (Ty DPR:$src),
522 (i32 (LoadOp addrmode6:$Rn)),
526 class VLD1QLNPseudo<ValueType Ty, PatFrag LoadOp> : VLDQLNPseudo<IIC_VLD1ln> {
527 let Pattern = [(set QPR:$dst, (vector_insert (Ty QPR:$src),
528 (i32 (LoadOp addrmode6:$addr)),
532 def VLD1LNd8 : VLD1LN<0b0000, {?,?,?,0}, "8", v8i8, extloadi8> {
533 let Inst{7-5} = lane{2-0};
535 def VLD1LNd16 : VLD1LN<0b0100, {?,?,0,?}, "16", v4i16, extloadi16> {
536 let Inst{7-6} = lane{1-0};
539 def VLD1LNd32 : VLD1LN<0b1000, {?,0,?,?}, "32", v2i32, load> {
540 let Inst{7} = lane{0};
545 def VLD1LNq8Pseudo : VLD1QLNPseudo<v16i8, extloadi8>;
546 def VLD1LNq16Pseudo : VLD1QLNPseudo<v8i16, extloadi16>;
547 def VLD1LNq32Pseudo : VLD1QLNPseudo<v4i32, load>;
549 let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
551 // ...with address register writeback:
552 class VLD1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
553 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, GPR:$wb),
554 (ins addrmode6:$Rn, am6offset:$Rm,
555 DPR:$src, nohash_imm:$lane), IIC_VLD1lnu, "vld1", Dt,
556 "\\{$Vd[$lane]\\}, $Rn$Rm",
557 "$src = $Vd, $Rn.addr = $wb", []>;
559 def VLD1LNd8_UPD : VLD1LNWB<0b0000, {?,?,?,0}, "8"> {
560 let Inst{7-5} = lane{2-0};
562 def VLD1LNd16_UPD : VLD1LNWB<0b0100, {?,?,0,?}, "16"> {
563 let Inst{7-6} = lane{1-0};
566 def VLD1LNd32_UPD : VLD1LNWB<0b1000, {?,0,?,?}, "32"> {
567 let Inst{7} = lane{0};
572 def VLD1LNq8Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>;
573 def VLD1LNq16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>;
574 def VLD1LNq32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>;
576 // VLD2LN : Vector Load (single 2-element structure to one lane)
577 class VLD2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
578 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2),
579 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, nohash_imm:$lane),
580 IIC_VLD2ln, "vld2", Dt, "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn",
581 "$src1 = $Vd, $src2 = $dst2", []> {
586 def VLD2LNd8 : VLD2LN<0b0001, {?,?,?,?}, "8"> {
587 let Inst{7-5} = lane{2-0};
589 def VLD2LNd16 : VLD2LN<0b0101, {?,?,0,?}, "16"> {
590 let Inst{7-6} = lane{1-0};
592 def VLD2LNd32 : VLD2LN<0b1001, {?,0,0,?}, "32"> {
593 let Inst{7} = lane{0};
596 def VLD2LNd8Pseudo : VLDQLNPseudo<IIC_VLD2ln>;
597 def VLD2LNd16Pseudo : VLDQLNPseudo<IIC_VLD2ln>;
598 def VLD2LNd32Pseudo : VLDQLNPseudo<IIC_VLD2ln>;
600 // ...with double-spaced registers:
601 def VLD2LNq16 : VLD2LN<0b0101, {?,?,1,?}, "16"> {
602 let Inst{7-6} = lane{1-0};
604 def VLD2LNq32 : VLD2LN<0b1001, {?,1,0,?}, "32"> {
605 let Inst{7} = lane{0};
608 def VLD2LNq16Pseudo : VLDQQLNPseudo<IIC_VLD2ln>;
609 def VLD2LNq32Pseudo : VLDQQLNPseudo<IIC_VLD2ln>;
611 // ...with address register writeback:
612 class VLD2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
613 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
614 (ins addrmode6:$Rn, am6offset:$Rm,
615 DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VLD2lnu, "vld2", Dt,
616 "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn$Rm",
617 "$src1 = $Vd, $src2 = $dst2, $Rn.addr = $wb", []> {
621 def VLD2LNd8_UPD : VLD2LNWB<0b0001, {?,?,?,?}, "8"> {
622 let Inst{7-5} = lane{2-0};
624 def VLD2LNd16_UPD : VLD2LNWB<0b0101, {?,?,0,?}, "16"> {
625 let Inst{7-6} = lane{1-0};
627 def VLD2LNd32_UPD : VLD2LNWB<0b1001, {?,0,0,?}, "32"> {
628 let Inst{7} = lane{0};
631 def VLD2LNd8Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>;
632 def VLD2LNd16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>;
633 def VLD2LNd32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>;
635 def VLD2LNq16_UPD : VLD2LNWB<0b0101, {?,?,1,?}, "16"> {
636 let Inst{7-6} = lane{1-0};
638 def VLD2LNq32_UPD : VLD2LNWB<0b1001, {?,1,0,?}, "32"> {
639 let Inst{7} = lane{0};
642 def VLD2LNq16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>;
643 def VLD2LNq32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>;
645 // VLD3LN : Vector Load (single 3-element structure to one lane)
646 class VLD3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
647 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
648 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3,
649 nohash_imm:$lane), IIC_VLD3ln, "vld3", Dt,
650 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn",
651 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3", []> {
655 def VLD3LNd8 : VLD3LN<0b0010, {?,?,?,0}, "8"> {
656 let Inst{7-5} = lane{2-0};
658 def VLD3LNd16 : VLD3LN<0b0110, {?,?,0,0}, "16"> {
659 let Inst{7-6} = lane{1-0};
661 def VLD3LNd32 : VLD3LN<0b1010, {?,0,0,0}, "32"> {
662 let Inst{7} = lane{0};
665 def VLD3LNd8Pseudo : VLDQQLNPseudo<IIC_VLD3ln>;
666 def VLD3LNd16Pseudo : VLDQQLNPseudo<IIC_VLD3ln>;
667 def VLD3LNd32Pseudo : VLDQQLNPseudo<IIC_VLD3ln>;
669 // ...with double-spaced registers:
670 def VLD3LNq16 : VLD3LN<0b0110, {?,?,1,0}, "16"> {
671 let Inst{7-6} = lane{1-0};
673 def VLD3LNq32 : VLD3LN<0b1010, {?,1,0,0}, "32"> {
674 let Inst{7} = lane{0};
677 def VLD3LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>;
678 def VLD3LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>;
680 // ...with address register writeback:
681 class VLD3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
682 : NLdStLn<1, 0b10, op11_8, op7_4,
683 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
684 (ins addrmode6:$Rn, am6offset:$Rm,
685 DPR:$src1, DPR:$src2, DPR:$src3, nohash_imm:$lane),
686 IIC_VLD3lnu, "vld3", Dt,
687 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn$Rm",
688 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $Rn.addr = $wb",
691 def VLD3LNd8_UPD : VLD3LNWB<0b0010, {?,?,?,0}, "8"> {
692 let Inst{7-5} = lane{2-0};
694 def VLD3LNd16_UPD : VLD3LNWB<0b0110, {?,?,0,0}, "16"> {
695 let Inst{7-6} = lane{1-0};
697 def VLD3LNd32_UPD : VLD3LNWB<0b1010, {?,0,0,0}, "32"> {
698 let Inst{7} = lane{0};
701 def VLD3LNd8Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>;
702 def VLD3LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>;
703 def VLD3LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>;
705 def VLD3LNq16_UPD : VLD3LNWB<0b0110, {?,?,1,0}, "16"> {
706 let Inst{7-6} = lane{1-0};
708 def VLD3LNq32_UPD : VLD3LNWB<0b1010, {?,1,0,0}, "32"> {
709 let Inst{7} = lane{0};
712 def VLD3LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>;
713 def VLD3LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>;
715 // VLD4LN : Vector Load (single 4-element structure to one lane)
716 class VLD4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
717 : NLdStLn<1, 0b10, op11_8, op7_4,
718 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
719 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4,
720 nohash_imm:$lane), IIC_VLD4ln, "vld4", Dt,
721 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn",
722 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4", []> {
727 def VLD4LNd8 : VLD4LN<0b0011, {?,?,?,?}, "8"> {
728 let Inst{7-5} = lane{2-0};
730 def VLD4LNd16 : VLD4LN<0b0111, {?,?,0,?}, "16"> {
731 let Inst{7-6} = lane{1-0};
733 def VLD4LNd32 : VLD4LN<0b1011, {?,0,?,?}, "32"> {
734 let Inst{7} = lane{0};
738 def VLD4LNd8Pseudo : VLDQQLNPseudo<IIC_VLD4ln>;
739 def VLD4LNd16Pseudo : VLDQQLNPseudo<IIC_VLD4ln>;
740 def VLD4LNd32Pseudo : VLDQQLNPseudo<IIC_VLD4ln>;
742 // ...with double-spaced registers:
743 def VLD4LNq16 : VLD4LN<0b0111, {?,?,1,?}, "16"> {
744 let Inst{7-6} = lane{1-0};
746 def VLD4LNq32 : VLD4LN<0b1011, {?,1,?,?}, "32"> {
747 let Inst{7} = lane{0};
751 def VLD4LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>;
752 def VLD4LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>;
754 // ...with address register writeback:
755 class VLD4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
756 : NLdStLn<1, 0b10, op11_8, op7_4,
757 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
758 (ins addrmode6:$Rn, am6offset:$Rm,
759 DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
760 IIC_VLD4ln, "vld4", Dt,
761 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn$Rm",
762 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4, $Rn.addr = $wb",
767 def VLD4LNd8_UPD : VLD4LNWB<0b0011, {?,?,?,?}, "8"> {
768 let Inst{7-5} = lane{2-0};
770 def VLD4LNd16_UPD : VLD4LNWB<0b0111, {?,?,0,?}, "16"> {
771 let Inst{7-6} = lane{1-0};
773 def VLD4LNd32_UPD : VLD4LNWB<0b1011, {?,0,?,?}, "32"> {
774 let Inst{7} = lane{0};
778 def VLD4LNd8Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>;
779 def VLD4LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>;
780 def VLD4LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>;
782 def VLD4LNq16_UPD : VLD4LNWB<0b0111, {?,?,1,?}, "16"> {
783 let Inst{7-6} = lane{1-0};
785 def VLD4LNq32_UPD : VLD4LNWB<0b1011, {?,1,?,?}, "32"> {
786 let Inst{7} = lane{0};
790 def VLD4LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>;
791 def VLD4LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>;
793 } // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
795 // VLD1DUP : Vector Load (single element to all lanes)
796 class VLD1DUP<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
798 : NLdSt<1, 0b10, op11_8, op7_4, (outs DPR:$Vd), (ins addrmode6:$Rn),
799 IIC_VLD1dup, "vld1", Dt, "\\{$Vd[]\\}, $Rn", "",
800 [(set DPR:$Vd, (Ty (NEONvdup (i32 (LoadOp addrmode6:$Rn)))))]> {
803 class VLD1QDUPPseudo<ValueType Ty, PatFrag LoadOp> : VLDQPseudo<IIC_VLD1dup> {
804 let Pattern = [(set QPR:$dst,
805 (Ty (NEONvdup (i32 (LoadOp addrmode6:$addr)))))];
808 def VLD1DUPd8 : VLD1DUP<0b1100, {0,0,0,?}, "8", v8i8, extloadi8> {
811 def VLD1DUPd16 : VLD1DUP<0b1100, {0,1,0,?}, "16", v4i16, extloadi16> {
814 def VLD1DUPd32 : VLD1DUP<0b1100, {1,0,0,?}, "32", v2i32, load> {
818 def VLD1DUPq8Pseudo : VLD1QDUPPseudo<v16i8, extloadi8>;
819 def VLD1DUPq16Pseudo : VLD1QDUPPseudo<v8i16, extloadi16>;
820 def VLD1DUPq32Pseudo : VLD1QDUPPseudo<v4i32, load>;
822 let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
824 class VLD1QDUP<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
826 : NLdSt<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2),
827 (ins addrmode6:$Rn), IIC_VLD1dup,
828 "vld1", Dt, "\\{$Vd[], $dst2[]\\}, $Rn", "", []> {
832 def VLD1DUPq8 : VLD1QDUP<0b1100, {0,0,1,0}, "8", v16i8, extloadi8>;
833 def VLD1DUPq16 : VLD1QDUP<0b1100, {0,1,1,?}, "16", v8i16, extloadi16> {
836 def VLD1DUPq32 : VLD1QDUP<0b1100, {1,0,1,?}, "32", v4i32, load> {
840 // ...with address register writeback:
841 class VLD1DUPWB<bits<4> op11_8, bits<4> op7_4, string Dt>
842 : NLdSt<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, GPR:$wb),
843 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1dupu,
844 "vld1", Dt, "\\{$Vd[]\\}, $Rn$Rm", "$Rn.addr = $wb", []>;
845 class VLD1QDUPWB<bits<4> op11_8, bits<4> op7_4, string Dt>
846 : NLdSt<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
847 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1dupu,
848 "vld1", Dt, "\\{$Vd[], $dst2[]\\}, $Rn$Rm", "$Rn.addr = $wb", []>;
850 def VLD1DUPd8_UPD : VLD1DUPWB<0b1100, {0,0,0,0}, "8">;
851 def VLD1DUPd16_UPD : VLD1DUPWB<0b1100, {0,1,0,?}, "16"> { let Inst{4} = Rn{4}; }
852 def VLD1DUPd32_UPD : VLD1DUPWB<0b1100, {1,0,0,?}, "32"> { let Inst{4} = Rn{4}; }
854 def VLD1DUPq8_UPD : VLD1QDUPWB<0b1100, {0,0,1,0}, "8">;
855 def VLD1DUPq16_UPD : VLD1QDUPWB<0b1100, {0,1,1,?}, "16"> {
858 def VLD1DUPq32_UPD : VLD1QDUPWB<0b1100, {1,0,1,?}, "32"> {
862 def VLD1DUPq8Pseudo_UPD : VLDQWBPseudo<IIC_VLD1dupu>;
863 def VLD1DUPq16Pseudo_UPD : VLDQWBPseudo<IIC_VLD1dupu>;
864 def VLD1DUPq32Pseudo_UPD : VLDQWBPseudo<IIC_VLD1dupu>;
866 // VLD2DUP : Vector Load (single 2-element structure to all lanes)
867 // VLD3DUP : Vector Load (single 3-element structure to all lanes)
868 // VLD4DUP : Vector Load (single 4-element structure to all lanes)
869 // FIXME: Not yet implemented.
870 } // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
872 let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in {
874 // Classes for VST* pseudo-instructions with multi-register operands.
875 // These are expanded to real instructions after register allocation.
876 class VSTQPseudo<InstrItinClass itin>
877 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src), itin, "">;
878 class VSTQWBPseudo<InstrItinClass itin>
879 : PseudoNLdSt<(outs GPR:$wb),
880 (ins addrmode6:$addr, am6offset:$offset, QPR:$src), itin,
882 class VSTQQPseudo<InstrItinClass itin>
883 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src), itin, "">;
884 class VSTQQWBPseudo<InstrItinClass itin>
885 : PseudoNLdSt<(outs GPR:$wb),
886 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src), itin,
888 class VSTQQQQWBPseudo<InstrItinClass itin>
889 : PseudoNLdSt<(outs GPR:$wb),
890 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
893 // VST1 : Vector Store (multiple single elements)
894 class VST1D<bits<4> op7_4, string Dt>
895 : NLdSt<0,0b00,0b0111,op7_4, (outs), (ins addrmode6:$Rn, DPR:$Vd),
896 IIC_VST1, "vst1", Dt, "\\{$Vd\\}, $Rn", "", []> {
900 class VST1Q<bits<4> op7_4, string Dt>
901 : NLdSt<0,0b00,0b1010,op7_4, (outs),
902 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2), IIC_VST1x2,
903 "vst1", Dt, "\\{$Vd, $src2\\}, $Rn", "", []> {
905 let Inst{5-4} = Rn{5-4};
908 def VST1d8 : VST1D<{0,0,0,?}, "8">;
909 def VST1d16 : VST1D<{0,1,0,?}, "16">;
910 def VST1d32 : VST1D<{1,0,0,?}, "32">;
911 def VST1d64 : VST1D<{1,1,0,?}, "64">;
913 def VST1q8 : VST1Q<{0,0,?,?}, "8">;
914 def VST1q16 : VST1Q<{0,1,?,?}, "16">;
915 def VST1q32 : VST1Q<{1,0,?,?}, "32">;
916 def VST1q64 : VST1Q<{1,1,?,?}, "64">;
918 def VST1q8Pseudo : VSTQPseudo<IIC_VST1x2>;
919 def VST1q16Pseudo : VSTQPseudo<IIC_VST1x2>;
920 def VST1q32Pseudo : VSTQPseudo<IIC_VST1x2>;
921 def VST1q64Pseudo : VSTQPseudo<IIC_VST1x2>;
923 // ...with address register writeback:
924 class VST1DWB<bits<4> op7_4, string Dt>
925 : NLdSt<0, 0b00, 0b0111, op7_4, (outs GPR:$wb),
926 (ins addrmode6:$Rn, am6offset:$Rm, DPR:$Vd), IIC_VST1u,
927 "vst1", Dt, "\\{$Vd\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
930 class VST1QWB<bits<4> op7_4, string Dt>
931 : NLdSt<0, 0b00, 0b1010, op7_4, (outs GPR:$wb),
932 (ins addrmode6:$Rn, am6offset:$Rm, DPR:$Vd, DPR:$src2),
933 IIC_VST1x2u, "vst1", Dt, "\\{$Vd, $src2\\}, $Rn$Rm",
934 "$Rn.addr = $wb", []> {
935 let Inst{5-4} = Rn{5-4};
938 def VST1d8_UPD : VST1DWB<{0,0,0,?}, "8">;
939 def VST1d16_UPD : VST1DWB<{0,1,0,?}, "16">;
940 def VST1d32_UPD : VST1DWB<{1,0,0,?}, "32">;
941 def VST1d64_UPD : VST1DWB<{1,1,0,?}, "64">;
943 def VST1q8_UPD : VST1QWB<{0,0,?,?}, "8">;
944 def VST1q16_UPD : VST1QWB<{0,1,?,?}, "16">;
945 def VST1q32_UPD : VST1QWB<{1,0,?,?}, "32">;
946 def VST1q64_UPD : VST1QWB<{1,1,?,?}, "64">;
948 def VST1q8Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
949 def VST1q16Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
950 def VST1q32Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
951 def VST1q64Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
953 // ...with 3 registers (some of these are only for the disassembler):
954 class VST1D3<bits<4> op7_4, string Dt>
955 : NLdSt<0, 0b00, 0b0110, op7_4, (outs),
956 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3),
957 IIC_VST1x3, "vst1", Dt, "\\{$Vd, $src2, $src3\\}, $Rn", "", []> {
961 class VST1D3WB<bits<4> op7_4, string Dt>
962 : NLdSt<0, 0b00, 0b0110, op7_4, (outs GPR:$wb),
963 (ins addrmode6:$Rn, am6offset:$Rm,
964 DPR:$Vd, DPR:$src2, DPR:$src3),
965 IIC_VST1x3u, "vst1", Dt, "\\{$Vd, $src2, $src3\\}, $Rn$Rm",
966 "$Rn.addr = $wb", []> {
970 def VST1d8T : VST1D3<{0,0,0,?}, "8">;
971 def VST1d16T : VST1D3<{0,1,0,?}, "16">;
972 def VST1d32T : VST1D3<{1,0,0,?}, "32">;
973 def VST1d64T : VST1D3<{1,1,0,?}, "64">;
975 def VST1d8T_UPD : VST1D3WB<{0,0,0,?}, "8">;
976 def VST1d16T_UPD : VST1D3WB<{0,1,0,?}, "16">;
977 def VST1d32T_UPD : VST1D3WB<{1,0,0,?}, "32">;
978 def VST1d64T_UPD : VST1D3WB<{1,1,0,?}, "64">;
980 def VST1d64TPseudo : VSTQQPseudo<IIC_VST1x3>;
981 def VST1d64TPseudo_UPD : VSTQQWBPseudo<IIC_VST1x3u>;
983 // ...with 4 registers (some of these are only for the disassembler):
984 class VST1D4<bits<4> op7_4, string Dt>
985 : NLdSt<0, 0b00, 0b0010, op7_4, (outs),
986 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
987 IIC_VST1x4, "vst1", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn", "",
990 let Inst{5-4} = Rn{5-4};
992 class VST1D4WB<bits<4> op7_4, string Dt>
993 : NLdSt<0, 0b00, 0b0010, op7_4, (outs GPR:$wb),
994 (ins addrmode6:$Rn, am6offset:$Rm,
995 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST1x4u,
996 "vst1", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
997 "$Rn.addr = $wb", []> {
998 let Inst{5-4} = Rn{5-4};
1001 def VST1d8Q : VST1D4<{0,0,?,?}, "8">;
1002 def VST1d16Q : VST1D4<{0,1,?,?}, "16">;
1003 def VST1d32Q : VST1D4<{1,0,?,?}, "32">;
1004 def VST1d64Q : VST1D4<{1,1,?,?}, "64">;
1006 def VST1d8Q_UPD : VST1D4WB<{0,0,?,?}, "8">;
1007 def VST1d16Q_UPD : VST1D4WB<{0,1,?,?}, "16">;
1008 def VST1d32Q_UPD : VST1D4WB<{1,0,?,?}, "32">;
1009 def VST1d64Q_UPD : VST1D4WB<{1,1,?,?}, "64">;
1011 def VST1d64QPseudo : VSTQQPseudo<IIC_VST1x4>;
1012 def VST1d64QPseudo_UPD : VSTQQWBPseudo<IIC_VST1x4u>;
1014 // VST2 : Vector Store (multiple 2-element structures)
1015 class VST2D<bits<4> op11_8, bits<4> op7_4, string Dt>
1016 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
1017 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2),
1018 IIC_VST2, "vst2", Dt, "\\{$Vd, $src2\\}, $Rn", "", []> {
1020 let Inst{5-4} = Rn{5-4};
1022 class VST2Q<bits<4> op7_4, string Dt>
1023 : NLdSt<0, 0b00, 0b0011, op7_4, (outs),
1024 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
1025 IIC_VST2x2, "vst2", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn",
1028 let Inst{5-4} = Rn{5-4};
1031 def VST2d8 : VST2D<0b1000, {0,0,?,?}, "8">;
1032 def VST2d16 : VST2D<0b1000, {0,1,?,?}, "16">;
1033 def VST2d32 : VST2D<0b1000, {1,0,?,?}, "32">;
1035 def VST2q8 : VST2Q<{0,0,?,?}, "8">;
1036 def VST2q16 : VST2Q<{0,1,?,?}, "16">;
1037 def VST2q32 : VST2Q<{1,0,?,?}, "32">;
1039 def VST2d8Pseudo : VSTQPseudo<IIC_VST2>;
1040 def VST2d16Pseudo : VSTQPseudo<IIC_VST2>;
1041 def VST2d32Pseudo : VSTQPseudo<IIC_VST2>;
1043 def VST2q8Pseudo : VSTQQPseudo<IIC_VST2x2>;
1044 def VST2q16Pseudo : VSTQQPseudo<IIC_VST2x2>;
1045 def VST2q32Pseudo : VSTQQPseudo<IIC_VST2x2>;
1047 // ...with address register writeback:
1048 class VST2DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1049 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1050 (ins addrmode6:$Rn, am6offset:$Rm, DPR:$Vd, DPR:$src2),
1051 IIC_VST2u, "vst2", Dt, "\\{$Vd, $src2\\}, $Rn$Rm",
1052 "$Rn.addr = $wb", []> {
1053 let Inst{5-4} = Rn{5-4};
1055 class VST2QWB<bits<4> op7_4, string Dt>
1056 : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
1057 (ins addrmode6:$Rn, am6offset:$Rm,
1058 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST2x2u,
1059 "vst2", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
1060 "$Rn.addr = $wb", []> {
1061 let Inst{5-4} = Rn{5-4};
1064 def VST2d8_UPD : VST2DWB<0b1000, {0,0,?,?}, "8">;
1065 def VST2d16_UPD : VST2DWB<0b1000, {0,1,?,?}, "16">;
1066 def VST2d32_UPD : VST2DWB<0b1000, {1,0,?,?}, "32">;
1068 def VST2q8_UPD : VST2QWB<{0,0,?,?}, "8">;
1069 def VST2q16_UPD : VST2QWB<{0,1,?,?}, "16">;
1070 def VST2q32_UPD : VST2QWB<{1,0,?,?}, "32">;
1072 def VST2d8Pseudo_UPD : VSTQWBPseudo<IIC_VST2u>;
1073 def VST2d16Pseudo_UPD : VSTQWBPseudo<IIC_VST2u>;
1074 def VST2d32Pseudo_UPD : VSTQWBPseudo<IIC_VST2u>;
1076 def VST2q8Pseudo_UPD : VSTQQWBPseudo<IIC_VST2x2u>;
1077 def VST2q16Pseudo_UPD : VSTQQWBPseudo<IIC_VST2x2u>;
1078 def VST2q32Pseudo_UPD : VSTQQWBPseudo<IIC_VST2x2u>;
1080 // ...with double-spaced registers (for disassembly only):
1081 def VST2b8 : VST2D<0b1001, {0,0,?,?}, "8">;
1082 def VST2b16 : VST2D<0b1001, {0,1,?,?}, "16">;
1083 def VST2b32 : VST2D<0b1001, {1,0,?,?}, "32">;
1084 def VST2b8_UPD : VST2DWB<0b1001, {0,0,?,?}, "8">;
1085 def VST2b16_UPD : VST2DWB<0b1001, {0,1,?,?}, "16">;
1086 def VST2b32_UPD : VST2DWB<0b1001, {1,0,?,?}, "32">;
1088 // VST3 : Vector Store (multiple 3-element structures)
1089 class VST3D<bits<4> op11_8, bits<4> op7_4, string Dt>
1090 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
1091 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3,
1092 "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn", "", []> {
1094 let Inst{4} = Rn{4};
1097 def VST3d8 : VST3D<0b0100, {0,0,0,?}, "8">;
1098 def VST3d16 : VST3D<0b0100, {0,1,0,?}, "16">;
1099 def VST3d32 : VST3D<0b0100, {1,0,0,?}, "32">;
1101 def VST3d8Pseudo : VSTQQPseudo<IIC_VST3>;
1102 def VST3d16Pseudo : VSTQQPseudo<IIC_VST3>;
1103 def VST3d32Pseudo : VSTQQPseudo<IIC_VST3>;
1105 // ...with address register writeback:
1106 class VST3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1107 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1108 (ins addrmode6:$Rn, am6offset:$Rm,
1109 DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3u,
1110 "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn$Rm",
1111 "$Rn.addr = $wb", []> {
1112 let Inst{4} = Rn{4};
1115 def VST3d8_UPD : VST3DWB<0b0100, {0,0,0,?}, "8">;
1116 def VST3d16_UPD : VST3DWB<0b0100, {0,1,0,?}, "16">;
1117 def VST3d32_UPD : VST3DWB<0b0100, {1,0,0,?}, "32">;
1119 def VST3d8Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>;
1120 def VST3d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>;
1121 def VST3d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>;
1123 // ...with double-spaced registers (non-updating versions for disassembly only):
1124 def VST3q8 : VST3D<0b0101, {0,0,0,?}, "8">;
1125 def VST3q16 : VST3D<0b0101, {0,1,0,?}, "16">;
1126 def VST3q32 : VST3D<0b0101, {1,0,0,?}, "32">;
1127 def VST3q8_UPD : VST3DWB<0b0101, {0,0,0,?}, "8">;
1128 def VST3q16_UPD : VST3DWB<0b0101, {0,1,0,?}, "16">;
1129 def VST3q32_UPD : VST3DWB<0b0101, {1,0,0,?}, "32">;
1131 def VST3q8Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1132 def VST3q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1133 def VST3q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1135 // ...alternate versions to be allocated odd register numbers:
1136 def VST3q8oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1137 def VST3q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1138 def VST3q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1140 // VST4 : Vector Store (multiple 4-element structures)
1141 class VST4D<bits<4> op11_8, bits<4> op7_4, string Dt>
1142 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
1143 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
1144 IIC_VST4, "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn",
1147 let Inst{5-4} = Rn{5-4};
1150 def VST4d8 : VST4D<0b0000, {0,0,?,?}, "8">;
1151 def VST4d16 : VST4D<0b0000, {0,1,?,?}, "16">;
1152 def VST4d32 : VST4D<0b0000, {1,0,?,?}, "32">;
1154 def VST4d8Pseudo : VSTQQPseudo<IIC_VST4>;
1155 def VST4d16Pseudo : VSTQQPseudo<IIC_VST4>;
1156 def VST4d32Pseudo : VSTQQPseudo<IIC_VST4>;
1158 // ...with address register writeback:
1159 class VST4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1160 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1161 (ins addrmode6:$Rn, am6offset:$Rm,
1162 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST4u,
1163 "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
1164 "$Rn.addr = $wb", []> {
1165 let Inst{5-4} = Rn{5-4};
1168 def VST4d8_UPD : VST4DWB<0b0000, {0,0,?,?}, "8">;
1169 def VST4d16_UPD : VST4DWB<0b0000, {0,1,?,?}, "16">;
1170 def VST4d32_UPD : VST4DWB<0b0000, {1,0,?,?}, "32">;
1172 def VST4d8Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>;
1173 def VST4d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>;
1174 def VST4d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>;
1176 // ...with double-spaced registers (non-updating versions for disassembly only):
1177 def VST4q8 : VST4D<0b0001, {0,0,?,?}, "8">;
1178 def VST4q16 : VST4D<0b0001, {0,1,?,?}, "16">;
1179 def VST4q32 : VST4D<0b0001, {1,0,?,?}, "32">;
1180 def VST4q8_UPD : VST4DWB<0b0001, {0,0,?,?}, "8">;
1181 def VST4q16_UPD : VST4DWB<0b0001, {0,1,?,?}, "16">;
1182 def VST4q32_UPD : VST4DWB<0b0001, {1,0,?,?}, "32">;
1184 def VST4q8Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1185 def VST4q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1186 def VST4q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1188 // ...alternate versions to be allocated odd register numbers:
1189 def VST4q8oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1190 def VST4q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1191 def VST4q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1193 } // mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1
1195 // Classes for VST*LN pseudo-instructions with multi-register operands.
1196 // These are expanded to real instructions after register allocation.
1197 class VSTQLNPseudo<InstrItinClass itin>
1198 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
1200 class VSTQLNWBPseudo<InstrItinClass itin>
1201 : PseudoNLdSt<(outs GPR:$wb),
1202 (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
1203 nohash_imm:$lane), itin, "$addr.addr = $wb">;
1204 class VSTQQLNPseudo<InstrItinClass itin>
1205 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
1207 class VSTQQLNWBPseudo<InstrItinClass itin>
1208 : PseudoNLdSt<(outs GPR:$wb),
1209 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
1210 nohash_imm:$lane), itin, "$addr.addr = $wb">;
1211 class VSTQQQQLNPseudo<InstrItinClass itin>
1212 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
1214 class VSTQQQQLNWBPseudo<InstrItinClass itin>
1215 : PseudoNLdSt<(outs GPR:$wb),
1216 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
1217 nohash_imm:$lane), itin, "$addr.addr = $wb">;
1219 // VST1LN : Vector Store (single element from one lane)
1220 class VST1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
1221 PatFrag StoreOp, SDNode ExtractOp>
1222 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1223 (ins addrmode6:$Rn, DPR:$Vd, nohash_imm:$lane),
1224 IIC_VST1ln, "vst1", Dt, "\\{$Vd[$lane]\\}, $Rn", "",
1225 [(StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane), addrmode6:$Rn)]> {
1228 class VST1QLNPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
1229 : VSTQLNPseudo<IIC_VST1ln> {
1230 let Pattern = [(StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
1234 def VST1LNd8 : VST1LN<0b0000, {?,?,?,0}, "8", v8i8, truncstorei8,
1236 let Inst{7-5} = lane{2-0};
1238 def VST1LNd16 : VST1LN<0b0100, {?,?,0,?}, "16", v4i16, truncstorei16,
1240 let Inst{7-6} = lane{1-0};
1241 let Inst{4} = Rn{5};
1243 def VST1LNd32 : VST1LN<0b1000, {?,0,?,?}, "32", v2i32, store, extractelt> {
1244 let Inst{7} = lane{0};
1245 let Inst{5-4} = Rn{5-4};
1248 def VST1LNq8Pseudo : VST1QLNPseudo<v16i8, truncstorei8, NEONvgetlaneu>;
1249 def VST1LNq16Pseudo : VST1QLNPseudo<v8i16, truncstorei16, NEONvgetlaneu>;
1250 def VST1LNq32Pseudo : VST1QLNPseudo<v4i32, store, extractelt>;
1252 let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in {
1254 // ...with address register writeback:
1255 class VST1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1256 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1257 (ins addrmode6:$Rn, am6offset:$Rm,
1258 DPR:$Vd, nohash_imm:$lane), IIC_VST1lnu, "vst1", Dt,
1259 "\\{$Vd[$lane]\\}, $Rn$Rm",
1260 "$Rn.addr = $wb", []>;
1262 def VST1LNd8_UPD : VST1LNWB<0b0000, {?,?,?,0}, "8"> {
1263 let Inst{7-5} = lane{2-0};
1265 def VST1LNd16_UPD : VST1LNWB<0b0100, {?,?,0,?}, "16"> {
1266 let Inst{7-6} = lane{1-0};
1267 let Inst{4} = Rn{5};
1269 def VST1LNd32_UPD : VST1LNWB<0b1000, {?,0,?,?}, "32"> {
1270 let Inst{7} = lane{0};
1271 let Inst{5-4} = Rn{5-4};
1274 def VST1LNq8Pseudo_UPD : VSTQLNWBPseudo<IIC_VST1lnu>;
1275 def VST1LNq16Pseudo_UPD : VSTQLNWBPseudo<IIC_VST1lnu>;
1276 def VST1LNq32Pseudo_UPD : VSTQLNWBPseudo<IIC_VST1lnu>;
1278 // VST2LN : Vector Store (single 2-element structure from one lane)
1279 class VST2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1280 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1281 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, nohash_imm:$lane),
1282 IIC_VST2ln, "vst2", Dt, "\\{$Vd[$lane], $src2[$lane]\\}, $Rn",
1285 let Inst{4} = Rn{4};
1288 def VST2LNd8 : VST2LN<0b0001, {?,?,?,?}, "8"> {
1289 let Inst{7-5} = lane{2-0};
1291 def VST2LNd16 : VST2LN<0b0101, {?,?,0,?}, "16"> {
1292 let Inst{7-6} = lane{1-0};
1294 def VST2LNd32 : VST2LN<0b1001, {?,0,0,?}, "32"> {
1295 let Inst{7} = lane{0};
1298 def VST2LNd8Pseudo : VSTQLNPseudo<IIC_VST2ln>;
1299 def VST2LNd16Pseudo : VSTQLNPseudo<IIC_VST2ln>;
1300 def VST2LNd32Pseudo : VSTQLNPseudo<IIC_VST2ln>;
1302 // ...with double-spaced registers:
1303 def VST2LNq16 : VST2LN<0b0101, {?,?,1,?}, "16"> {
1304 let Inst{7-6} = lane{1-0};
1305 let Inst{4} = Rn{4};
1307 def VST2LNq32 : VST2LN<0b1001, {?,1,0,?}, "32"> {
1308 let Inst{7} = lane{0};
1309 let Inst{4} = Rn{4};
1312 def VST2LNq16Pseudo : VSTQQLNPseudo<IIC_VST2ln>;
1313 def VST2LNq32Pseudo : VSTQQLNPseudo<IIC_VST2ln>;
1315 // ...with address register writeback:
1316 class VST2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1317 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1318 (ins addrmode6:$addr, am6offset:$offset,
1319 DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VST2lnu, "vst2", Dt,
1320 "\\{$src1[$lane], $src2[$lane]\\}, $addr$offset",
1321 "$addr.addr = $wb", []> {
1322 let Inst{4} = Rn{4};
1325 def VST2LNd8_UPD : VST2LNWB<0b0001, {?,?,?,?}, "8"> {
1326 let Inst{7-5} = lane{2-0};
1328 def VST2LNd16_UPD : VST2LNWB<0b0101, {?,?,0,?}, "16"> {
1329 let Inst{7-6} = lane{1-0};
1331 def VST2LNd32_UPD : VST2LNWB<0b1001, {?,0,0,?}, "32"> {
1332 let Inst{7} = lane{0};
1335 def VST2LNd8Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>;
1336 def VST2LNd16Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>;
1337 def VST2LNd32Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>;
1339 def VST2LNq16_UPD : VST2LNWB<0b0101, {?,?,1,?}, "16"> {
1340 let Inst{7-6} = lane{1-0};
1342 def VST2LNq32_UPD : VST2LNWB<0b1001, {?,1,0,?}, "32"> {
1343 let Inst{7} = lane{0};
1346 def VST2LNq16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>;
1347 def VST2LNq32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>;
1349 // VST3LN : Vector Store (single 3-element structure from one lane)
1350 class VST3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1351 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1352 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3,
1353 nohash_imm:$lane), IIC_VST3ln, "vst3", Dt,
1354 "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn", "", []> {
1358 def VST3LNd8 : VST3LN<0b0010, {?,?,?,0}, "8"> {
1359 let Inst{7-5} = lane{2-0};
1361 def VST3LNd16 : VST3LN<0b0110, {?,?,0,0}, "16"> {
1362 let Inst{7-6} = lane{1-0};
1364 def VST3LNd32 : VST3LN<0b1010, {?,0,0,0}, "32"> {
1365 let Inst{7} = lane{0};
1368 def VST3LNd8Pseudo : VSTQQLNPseudo<IIC_VST3ln>;
1369 def VST3LNd16Pseudo : VSTQQLNPseudo<IIC_VST3ln>;
1370 def VST3LNd32Pseudo : VSTQQLNPseudo<IIC_VST3ln>;
1372 // ...with double-spaced registers:
1373 def VST3LNq16 : VST3LN<0b0110, {?,?,1,0}, "16"> {
1374 let Inst{7-6} = lane{1-0};
1376 def VST3LNq32 : VST3LN<0b1010, {?,1,0,0}, "32"> {
1377 let Inst{7} = lane{0};
1380 def VST3LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
1381 def VST3LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
1383 // ...with address register writeback:
1384 class VST3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1385 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1386 (ins addrmode6:$Rn, am6offset:$Rm,
1387 DPR:$Vd, DPR:$src2, DPR:$src3, nohash_imm:$lane),
1388 IIC_VST3lnu, "vst3", Dt,
1389 "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn$Rm",
1390 "$Rn.addr = $wb", []>;
1392 def VST3LNd8_UPD : VST3LNWB<0b0010, {?,?,?,0}, "8"> {
1393 let Inst{7-5} = lane{2-0};
1395 def VST3LNd16_UPD : VST3LNWB<0b0110, {?,?,0,0}, "16"> {
1396 let Inst{7-6} = lane{1-0};
1398 def VST3LNd32_UPD : VST3LNWB<0b1010, {?,0,0,0}, "32"> {
1399 let Inst{7} = lane{0};
1402 def VST3LNd8Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>;
1403 def VST3LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>;
1404 def VST3LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>;
1406 def VST3LNq16_UPD : VST3LNWB<0b0110, {?,?,1,0}, "16"> {
1407 let Inst{7-6} = lane{1-0};
1409 def VST3LNq32_UPD : VST3LNWB<0b1010, {?,1,0,0}, "32"> {
1410 let Inst{7} = lane{0};
1413 def VST3LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>;
1414 def VST3LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>;
1416 // VST4LN : Vector Store (single 4-element structure from one lane)
1417 class VST4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1418 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1419 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4,
1420 nohash_imm:$lane), IIC_VST4ln, "vst4", Dt,
1421 "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn",
1424 let Inst{4} = Rn{4};
1427 def VST4LNd8 : VST4LN<0b0011, {?,?,?,?}, "8"> {
1428 let Inst{7-5} = lane{2-0};
1430 def VST4LNd16 : VST4LN<0b0111, {?,?,0,?}, "16"> {
1431 let Inst{7-6} = lane{1-0};
1433 def VST4LNd32 : VST4LN<0b1011, {?,0,?,?}, "32"> {
1434 let Inst{7} = lane{0};
1435 let Inst{5} = Rn{5};
1438 def VST4LNd8Pseudo : VSTQQLNPseudo<IIC_VST4ln>;
1439 def VST4LNd16Pseudo : VSTQQLNPseudo<IIC_VST4ln>;
1440 def VST4LNd32Pseudo : VSTQQLNPseudo<IIC_VST4ln>;
1442 // ...with double-spaced registers:
1443 def VST4LNq16 : VST4LN<0b0111, {?,?,1,?}, "16"> {
1444 let Inst{7-6} = lane{1-0};
1446 def VST4LNq32 : VST4LN<0b1011, {?,1,?,?}, "32"> {
1447 let Inst{7} = lane{0};
1448 let Inst{5} = Rn{5};
1451 def VST4LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>;
1452 def VST4LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>;
1454 // ...with address register writeback:
1455 class VST4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1456 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1457 (ins addrmode6:$Rn, am6offset:$Rm,
1458 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
1459 IIC_VST4lnu, "vst4", Dt,
1460 "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn$Rm",
1461 "$Rn.addr = $wb", []> {
1462 let Inst{4} = Rn{4};
1465 def VST4LNd8_UPD : VST4LNWB<0b0011, {?,?,?,?}, "8"> {
1466 let Inst{7-5} = lane{2-0};
1468 def VST4LNd16_UPD : VST4LNWB<0b0111, {?,?,0,?}, "16"> {
1469 let Inst{7-6} = lane{1-0};
1471 def VST4LNd32_UPD : VST4LNWB<0b1011, {?,0,?,?}, "32"> {
1472 let Inst{7} = lane{0};
1473 let Inst{5} = Rn{5};
1476 def VST4LNd8Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>;
1477 def VST4LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>;
1478 def VST4LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>;
1480 def VST4LNq16_UPD : VST4LNWB<0b0111, {?,?,1,?}, "16"> {
1481 let Inst{7-6} = lane{1-0};
1483 def VST4LNq32_UPD : VST4LNWB<0b1011, {?,1,?,?}, "32"> {
1484 let Inst{7} = lane{0};
1485 let Inst{5} = Rn{5};
1488 def VST4LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>;
1489 def VST4LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>;
1491 } // mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1
1494 //===----------------------------------------------------------------------===//
1495 // NEON pattern fragments
1496 //===----------------------------------------------------------------------===//
1498 // Extract D sub-registers of Q registers.
1499 def DSubReg_i8_reg : SDNodeXForm<imm, [{
1500 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1501 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/8, MVT::i32);
1503 def DSubReg_i16_reg : SDNodeXForm<imm, [{
1504 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1505 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/4, MVT::i32);
1507 def DSubReg_i32_reg : SDNodeXForm<imm, [{
1508 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1509 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/2, MVT::i32);
1511 def DSubReg_f64_reg : SDNodeXForm<imm, [{
1512 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1513 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue(), MVT::i32);
1516 // Extract S sub-registers of Q/D registers.
1517 def SSubReg_f32_reg : SDNodeXForm<imm, [{
1518 assert(ARM::ssub_3 == ARM::ssub_0+3 && "Unexpected subreg numbering");
1519 return CurDAG->getTargetConstant(ARM::ssub_0 + N->getZExtValue(), MVT::i32);
1522 // Translate lane numbers from Q registers to D subregs.
1523 def SubReg_i8_lane : SDNodeXForm<imm, [{
1524 return CurDAG->getTargetConstant(N->getZExtValue() & 7, MVT::i32);
1526 def SubReg_i16_lane : SDNodeXForm<imm, [{
1527 return CurDAG->getTargetConstant(N->getZExtValue() & 3, MVT::i32);
1529 def SubReg_i32_lane : SDNodeXForm<imm, [{
1530 return CurDAG->getTargetConstant(N->getZExtValue() & 1, MVT::i32);
1533 //===----------------------------------------------------------------------===//
1534 // Instruction Classes
1535 //===----------------------------------------------------------------------===//
1537 // Basic 2-register operations: single-, double- and quad-register.
1538 class N2VS<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1539 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
1540 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
1541 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
1542 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src),
1543 IIC_VUNAD, OpcodeStr, Dt, "$dst, $src", "", []>;
1544 class N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1545 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
1546 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
1547 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
1548 (ins DPR:$src), IIC_VUNAD, OpcodeStr, Dt,"$dst, $src", "",
1549 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src))))]>;
1550 class N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1551 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
1552 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
1553 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
1554 (ins QPR:$src), IIC_VUNAQ, OpcodeStr, Dt,"$dst, $src", "",
1555 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src))))]>;
1557 // Basic 2-register intrinsics, both double- and quad-register.
1558 class N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1559 bits<2> op17_16, bits<5> op11_7, bit op4,
1560 InstrItinClass itin, string OpcodeStr, string Dt,
1561 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1562 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
1563 (ins DPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
1564 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
1565 class N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1566 bits<2> op17_16, bits<5> op11_7, bit op4,
1567 InstrItinClass itin, string OpcodeStr, string Dt,
1568 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1569 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
1570 (ins QPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
1571 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
1573 // Narrow 2-register operations.
1574 class N2VN<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1575 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1576 InstrItinClass itin, string OpcodeStr, string Dt,
1577 ValueType TyD, ValueType TyQ, SDNode OpNode>
1578 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$dst),
1579 (ins QPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
1580 [(set DPR:$dst, (TyD (OpNode (TyQ QPR:$src))))]>;
1582 // Narrow 2-register intrinsics.
1583 class N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1584 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1585 InstrItinClass itin, string OpcodeStr, string Dt,
1586 ValueType TyD, ValueType TyQ, Intrinsic IntOp>
1587 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$dst),
1588 (ins QPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
1589 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src))))]>;
1591 // Long 2-register operations (currently only used for VMOVL).
1592 class N2VL<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1593 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1594 InstrItinClass itin, string OpcodeStr, string Dt,
1595 ValueType TyQ, ValueType TyD, SDNode OpNode>
1596 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$dst),
1597 (ins DPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
1598 [(set QPR:$dst, (TyQ (OpNode (TyD DPR:$src))))]>;
1600 // 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
1601 class N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr, string Dt>
1602 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$dst1, DPR:$dst2),
1603 (ins DPR:$src1, DPR:$src2), IIC_VPERMD,
1604 OpcodeStr, Dt, "$dst1, $dst2",
1605 "$src1 = $dst1, $src2 = $dst2", []>;
1606 class N2VQShuffle<bits<2> op19_18, bits<5> op11_7,
1607 InstrItinClass itin, string OpcodeStr, string Dt>
1608 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$dst1, QPR:$dst2),
1609 (ins QPR:$src1, QPR:$src2), itin, OpcodeStr, Dt, "$dst1, $dst2",
1610 "$src1 = $dst1, $src2 = $dst2", []>;
1612 // Basic 3-register operations: single-, double- and quad-register.
1613 class N3VS<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1614 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
1615 SDNode OpNode, bit Commutable>
1616 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1617 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src1, DPR_VFP2:$src2), N3RegFrm,
1618 IIC_VBIND, OpcodeStr, Dt, "$dst, $src1, $src2", "", []> {
1619 let isCommutable = Commutable;
1622 class N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1623 InstrItinClass itin, string OpcodeStr, string Dt,
1624 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
1625 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1626 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1627 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1628 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
1629 let isCommutable = Commutable;
1631 // Same as N3VD but no data type.
1632 class N3VDX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1633 InstrItinClass itin, string OpcodeStr,
1634 ValueType ResTy, ValueType OpTy,
1635 SDNode OpNode, bit Commutable>
1636 : N3VX<op24, op23, op21_20, op11_8, 0, op4,
1637 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1638 OpcodeStr, "$Vd, $Vn, $Vm", "",
1639 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>{
1640 let isCommutable = Commutable;
1643 class N3VDSL<bits<2> op21_20, bits<4> op11_8,
1644 InstrItinClass itin, string OpcodeStr, string Dt,
1645 ValueType Ty, SDNode ShOp>
1646 : N3V<0, 1, op21_20, op11_8, 1, 0,
1647 (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
1648 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1649 [(set (Ty DPR:$dst),
1650 (Ty (ShOp (Ty DPR:$src1),
1651 (Ty (NEONvduplane (Ty DPR_VFP2:$src2),imm:$lane)))))]> {
1652 let isCommutable = 0;
1654 class N3VDSL16<bits<2> op21_20, bits<4> op11_8,
1655 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
1656 : N3V<0, 1, op21_20, op11_8, 1, 0,
1657 (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
1658 NVMulSLFrm, IIC_VMULi16D, OpcodeStr, Dt,"$dst, $src1, $src2[$lane]","",
1659 [(set (Ty DPR:$dst),
1660 (Ty (ShOp (Ty DPR:$src1),
1661 (Ty (NEONvduplane (Ty DPR_8:$src2), imm:$lane)))))]> {
1662 let isCommutable = 0;
1665 class N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1666 InstrItinClass itin, string OpcodeStr, string Dt,
1667 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
1668 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1669 (outs QPR:$Qd), (ins QPR:$Qn, QPR:$Qm), N3RegFrm, itin,
1670 OpcodeStr, Dt, "$Qd, $Qn, $Qm", "",
1671 [(set QPR:$Qd, (ResTy (OpNode (OpTy QPR:$Qn), (OpTy QPR:$Qm))))]> {
1672 let isCommutable = Commutable;
1674 class N3VQX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1675 InstrItinClass itin, string OpcodeStr,
1676 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
1677 : N3VX<op24, op23, op21_20, op11_8, 1, op4,
1678 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), N3RegFrm, itin,
1679 OpcodeStr, "$dst, $src1, $src2", "",
1680 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src1), (OpTy QPR:$src2))))]>{
1681 let isCommutable = Commutable;
1683 class N3VQSL<bits<2> op21_20, bits<4> op11_8,
1684 InstrItinClass itin, string OpcodeStr, string Dt,
1685 ValueType ResTy, ValueType OpTy, SDNode ShOp>
1686 : N3V<1, 1, op21_20, op11_8, 1, 0,
1687 (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
1688 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1689 [(set (ResTy QPR:$dst),
1690 (ResTy (ShOp (ResTy QPR:$src1),
1691 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2),
1693 let isCommutable = 0;
1695 class N3VQSL16<bits<2> op21_20, bits<4> op11_8, string OpcodeStr, string Dt,
1696 ValueType ResTy, ValueType OpTy, SDNode ShOp>
1697 : N3V<1, 1, op21_20, op11_8, 1, 0,
1698 (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane),
1699 NVMulSLFrm, IIC_VMULi16Q, OpcodeStr, Dt,"$dst, $src1, $src2[$lane]","",
1700 [(set (ResTy QPR:$dst),
1701 (ResTy (ShOp (ResTy QPR:$src1),
1702 (ResTy (NEONvduplane (OpTy DPR_8:$src2),
1704 let isCommutable = 0;
1707 // Basic 3-register intrinsics, both double- and quad-register.
1708 class N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1709 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1710 ValueType ResTy, ValueType OpTy, Intrinsic IntOp, bit Commutable>
1711 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1712 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), f, itin,
1713 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1714 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
1715 let isCommutable = Commutable;
1717 class N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1718 string OpcodeStr, string Dt, ValueType Ty, Intrinsic IntOp>
1719 : N3V<0, 1, op21_20, op11_8, 1, 0,
1720 (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
1721 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1722 [(set (Ty DPR:$dst),
1723 (Ty (IntOp (Ty DPR:$src1),
1724 (Ty (NEONvduplane (Ty DPR_VFP2:$src2),
1726 let isCommutable = 0;
1728 class N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1729 string OpcodeStr, string Dt, ValueType Ty, Intrinsic IntOp>
1730 : N3V<0, 1, op21_20, op11_8, 1, 0,
1731 (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
1732 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1733 [(set (Ty DPR:$dst),
1734 (Ty (IntOp (Ty DPR:$src1),
1735 (Ty (NEONvduplane (Ty DPR_8:$src2), imm:$lane)))))]> {
1736 let isCommutable = 0;
1738 class N3VDIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1739 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1740 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1741 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1742 (outs DPR:$Vd), (ins DPR:$Vm, DPR:$Vn), f, itin,
1743 OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
1744 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (OpTy DPR:$Vn))))]> {
1745 let isCommutable = 0;
1748 class N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1749 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1750 ValueType ResTy, ValueType OpTy, Intrinsic IntOp, bit Commutable>
1751 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1752 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin,
1753 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1754 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
1755 let isCommutable = Commutable;
1757 class N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1758 string OpcodeStr, string Dt,
1759 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1760 : N3V<1, 1, op21_20, op11_8, 1, 0,
1761 (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
1762 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1763 [(set (ResTy QPR:$dst),
1764 (ResTy (IntOp (ResTy QPR:$src1),
1765 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2),
1767 let isCommutable = 0;
1769 class N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1770 string OpcodeStr, string Dt,
1771 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1772 : N3V<1, 1, op21_20, op11_8, 1, 0,
1773 (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane),
1774 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1775 [(set (ResTy QPR:$dst),
1776 (ResTy (IntOp (ResTy QPR:$src1),
1777 (ResTy (NEONvduplane (OpTy DPR_8:$src2),
1779 let isCommutable = 0;
1781 class N3VQIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1782 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1783 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1784 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1785 (outs QPR:$Vd), (ins QPR:$Vm, QPR:$Vn), f, itin,
1786 OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
1787 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (OpTy QPR:$Vn))))]> {
1788 let isCommutable = 0;
1791 // Multiply-Add/Sub operations: single-, double- and quad-register.
1792 class N3VSMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1793 InstrItinClass itin, string OpcodeStr, string Dt,
1794 ValueType Ty, SDNode MulOp, SDNode OpNode>
1795 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1796 (outs DPR_VFP2:$dst),
1797 (ins DPR_VFP2:$src1, DPR_VFP2:$src2, DPR_VFP2:$src3), N3RegFrm, itin,
1798 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst", []>;
1800 class N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1801 InstrItinClass itin, string OpcodeStr, string Dt,
1802 ValueType Ty, SDNode MulOp, SDNode OpNode>
1803 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1804 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1805 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1806 [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
1807 (Ty (MulOp DPR:$Vn, DPR:$Vm)))))]>;
1809 class N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1810 string OpcodeStr, string Dt,
1811 ValueType Ty, SDNode MulOp, SDNode ShOp>
1812 : N3V<0, 1, op21_20, op11_8, 1, 0,
1814 (ins DPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane),
1816 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1817 [(set (Ty DPR:$dst),
1818 (Ty (ShOp (Ty DPR:$src1),
1819 (Ty (MulOp DPR:$src2,
1820 (Ty (NEONvduplane (Ty DPR_VFP2:$src3),
1822 class N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1823 string OpcodeStr, string Dt,
1824 ValueType Ty, SDNode MulOp, SDNode ShOp>
1825 : N3V<0, 1, op21_20, op11_8, 1, 0,
1827 (ins DPR:$src1, DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
1829 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
1831 (Ty (ShOp (Ty DPR:$src1),
1833 (Ty (NEONvduplane (Ty DPR_8:$Vm),
1836 class N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1837 InstrItinClass itin, string OpcodeStr, string Dt, ValueType Ty,
1838 SDNode MulOp, SDNode OpNode>
1839 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1840 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
1841 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1842 [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
1843 (Ty (MulOp QPR:$Vn, QPR:$Vm)))))]>;
1844 class N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1845 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
1846 SDNode MulOp, SDNode ShOp>
1847 : N3V<1, 1, op21_20, op11_8, 1, 0,
1849 (ins QPR:$src1, QPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane),
1851 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1852 [(set (ResTy QPR:$dst),
1853 (ResTy (ShOp (ResTy QPR:$src1),
1854 (ResTy (MulOp QPR:$src2,
1855 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src3),
1857 class N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1858 string OpcodeStr, string Dt,
1859 ValueType ResTy, ValueType OpTy,
1860 SDNode MulOp, SDNode ShOp>
1861 : N3V<1, 1, op21_20, op11_8, 1, 0,
1863 (ins QPR:$src1, QPR:$src2, DPR_8:$src3, nohash_imm:$lane),
1865 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1866 [(set (ResTy QPR:$dst),
1867 (ResTy (ShOp (ResTy QPR:$src1),
1868 (ResTy (MulOp QPR:$src2,
1869 (ResTy (NEONvduplane (OpTy DPR_8:$src3),
1872 // Neon Intrinsic-Op instructions (VABA): double- and quad-register.
1873 class N3VDIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1874 InstrItinClass itin, string OpcodeStr, string Dt,
1875 ValueType Ty, Intrinsic IntOp, SDNode OpNode>
1876 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1877 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1878 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1879 [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
1880 (Ty (IntOp (Ty DPR:$Vn), (Ty DPR:$Vm))))))]>;
1881 class N3VQIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1882 InstrItinClass itin, string OpcodeStr, string Dt,
1883 ValueType Ty, Intrinsic IntOp, SDNode OpNode>
1884 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1885 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
1886 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1887 [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
1888 (Ty (IntOp (Ty QPR:$Vn), (Ty QPR:$Vm))))))]>;
1890 // Neon 3-argument intrinsics, both double- and quad-register.
1891 // The destination register is also used as the first source operand register.
1892 class N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1893 InstrItinClass itin, string OpcodeStr, string Dt,
1894 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1895 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1896 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), N3RegFrm, itin,
1897 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
1898 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1),
1899 (OpTy DPR:$src2), (OpTy DPR:$src3))))]>;
1900 class N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1901 InstrItinClass itin, string OpcodeStr, string Dt,
1902 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1903 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1904 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), N3RegFrm, itin,
1905 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
1906 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1),
1907 (OpTy QPR:$src2), (OpTy QPR:$src3))))]>;
1909 // Long Multiply-Add/Sub operations.
1910 class N3VLMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1911 InstrItinClass itin, string OpcodeStr, string Dt,
1912 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
1913 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1914 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1915 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1916 [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
1917 (TyQ (MulOp (TyD DPR:$Vn),
1918 (TyD DPR:$Vm)))))]>;
1919 class N3VLMulOpSL<bit op24, bits<2> op21_20, bits<4> op11_8,
1920 InstrItinClass itin, string OpcodeStr, string Dt,
1921 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
1922 : N3V<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$dst),
1923 (ins QPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane),
1925 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1927 (OpNode (TyQ QPR:$src1),
1928 (TyQ (MulOp (TyD DPR:$src2),
1929 (TyD (NEONvduplane (TyD DPR_VFP2:$src3),
1931 class N3VLMulOpSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
1932 InstrItinClass itin, string OpcodeStr, string Dt,
1933 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
1934 : N3V<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$dst),
1935 (ins QPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane),
1937 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1939 (OpNode (TyQ QPR:$src1),
1940 (TyQ (MulOp (TyD DPR:$src2),
1941 (TyD (NEONvduplane (TyD DPR_8:$src3),
1944 // Long Intrinsic-Op vector operations with explicit extend (VABAL).
1945 class N3VLIntExtOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1946 InstrItinClass itin, string OpcodeStr, string Dt,
1947 ValueType TyQ, ValueType TyD, Intrinsic IntOp, SDNode ExtOp,
1949 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1950 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1951 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1952 [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
1953 (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
1954 (TyD DPR:$Vm)))))))]>;
1956 // Neon Long 3-argument intrinsic. The destination register is
1957 // a quad-register and is also used as the first source operand register.
1958 class N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1959 InstrItinClass itin, string OpcodeStr, string Dt,
1960 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
1961 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1962 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1963 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1965 (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$Vn), (TyD DPR:$Vm))))]>;
1966 class N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1967 string OpcodeStr, string Dt,
1968 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1969 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1971 (ins QPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane),
1973 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1974 [(set (ResTy QPR:$dst),
1975 (ResTy (IntOp (ResTy QPR:$src1),
1977 (OpTy (NEONvduplane (OpTy DPR_VFP2:$src3),
1979 class N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8,
1980 InstrItinClass itin, string OpcodeStr, string Dt,
1981 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1982 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1984 (ins QPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane),
1986 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1987 [(set (ResTy QPR:$dst),
1988 (ResTy (IntOp (ResTy QPR:$src1),
1990 (OpTy (NEONvduplane (OpTy DPR_8:$src3),
1993 // Narrowing 3-register intrinsics.
1994 class N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1995 string OpcodeStr, string Dt, ValueType TyD, ValueType TyQ,
1996 Intrinsic IntOp, bit Commutable>
1997 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1998 (outs DPR:$dst), (ins QPR:$src1, QPR:$src2), N3RegFrm, IIC_VBINi4D,
1999 OpcodeStr, Dt, "$dst, $src1, $src2", "",
2000 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src1), (TyQ QPR:$src2))))]> {
2001 let isCommutable = Commutable;
2004 // Long 3-register operations.
2005 class N3VL<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2006 InstrItinClass itin, string OpcodeStr, string Dt,
2007 ValueType TyQ, ValueType TyD, SDNode OpNode, bit Commutable>
2008 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2009 (outs QPR:$dst), (ins DPR:$src1, DPR:$src2), N3RegFrm, itin,
2010 OpcodeStr, Dt, "$dst, $src1, $src2", "",
2011 [(set QPR:$dst, (TyQ (OpNode (TyD DPR:$src1), (TyD DPR:$src2))))]> {
2012 let isCommutable = Commutable;
2014 class N3VLSL<bit op24, bits<2> op21_20, bits<4> op11_8,
2015 InstrItinClass itin, string OpcodeStr, string Dt,
2016 ValueType TyQ, ValueType TyD, SDNode OpNode>
2017 : N3V<op24, 1, op21_20, op11_8, 1, 0,
2018 (outs QPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
2019 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
2021 (TyQ (OpNode (TyD DPR:$src1),
2022 (TyD (NEONvduplane (TyD DPR_VFP2:$src2),imm:$lane)))))]>;
2023 class N3VLSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
2024 InstrItinClass itin, string OpcodeStr, string Dt,
2025 ValueType TyQ, ValueType TyD, SDNode OpNode>
2026 : N3V<op24, 1, op21_20, op11_8, 1, 0,
2027 (outs QPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
2028 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
2030 (TyQ (OpNode (TyD DPR:$src1),
2031 (TyD (NEONvduplane (TyD DPR_8:$src2), imm:$lane)))))]>;
2033 // Long 3-register operations with explicitly extended operands.
2034 class N3VLExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2035 InstrItinClass itin, string OpcodeStr, string Dt,
2036 ValueType TyQ, ValueType TyD, SDNode OpNode, SDNode ExtOp,
2038 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2039 (outs QPR:$Qd), (ins DPR:$Dn, DPR:$Dm), N3RegFrm, itin,
2040 OpcodeStr, Dt, "$Qd, $Dn, $Dm", "",
2041 [(set QPR:$Qd, (OpNode (TyQ (ExtOp (TyD DPR:$Dn))),
2042 (TyQ (ExtOp (TyD DPR:$Dm)))))]> {
2043 let isCommutable = Commutable;
2046 // Long 3-register intrinsics with explicit extend (VABDL).
2047 class N3VLIntExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2048 InstrItinClass itin, string OpcodeStr, string Dt,
2049 ValueType TyQ, ValueType TyD, Intrinsic IntOp, SDNode ExtOp,
2051 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2052 (outs QPR:$dst), (ins DPR:$src1, DPR:$src2), N3RegFrm, itin,
2053 OpcodeStr, Dt, "$dst, $src1, $src2", "",
2054 [(set QPR:$dst, (TyQ (ExtOp (TyD (IntOp (TyD DPR:$src1),
2055 (TyD DPR:$src2))))))]> {
2056 let isCommutable = Commutable;
2059 // Long 3-register intrinsics.
2060 class N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2061 InstrItinClass itin, string OpcodeStr, string Dt,
2062 ValueType TyQ, ValueType TyD, Intrinsic IntOp, bit Commutable>
2063 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2064 (outs QPR:$dst), (ins DPR:$src1, DPR:$src2), N3RegFrm, itin,
2065 OpcodeStr, Dt, "$dst, $src1, $src2", "",
2066 [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src1), (TyD DPR:$src2))))]> {
2067 let isCommutable = Commutable;
2069 class N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2070 string OpcodeStr, string Dt,
2071 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2072 : N3V<op24, 1, op21_20, op11_8, 1, 0,
2073 (outs QPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
2074 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
2075 [(set (ResTy QPR:$dst),
2076 (ResTy (IntOp (OpTy DPR:$src1),
2077 (OpTy (NEONvduplane (OpTy DPR_VFP2:$src2),
2079 class N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
2080 InstrItinClass itin, string OpcodeStr, string Dt,
2081 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2082 : N3V<op24, 1, op21_20, op11_8, 1, 0,
2083 (outs QPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
2084 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
2085 [(set (ResTy QPR:$dst),
2086 (ResTy (IntOp (OpTy DPR:$src1),
2087 (OpTy (NEONvduplane (OpTy DPR_8:$src2),
2090 // Wide 3-register operations.
2091 class N3VW<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2092 string OpcodeStr, string Dt, ValueType TyQ, ValueType TyD,
2093 SDNode OpNode, SDNode ExtOp, bit Commutable>
2094 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2095 (outs QPR:$Qd), (ins QPR:$Qn, DPR:$Dm), N3RegFrm, IIC_VSUBiD,
2096 OpcodeStr, Dt, "$Qd, $Qn, $Dm", "",
2097 [(set QPR:$Qd, (OpNode (TyQ QPR:$Qn),
2098 (TyQ (ExtOp (TyD DPR:$Dm)))))]> {
2099 let isCommutable = Commutable;
2102 // Pairwise long 2-register intrinsics, both double- and quad-register.
2103 class N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2104 bits<2> op17_16, bits<5> op11_7, bit op4,
2105 string OpcodeStr, string Dt,
2106 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2107 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
2108 (ins DPR:$src), IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
2109 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
2110 class N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2111 bits<2> op17_16, bits<5> op11_7, bit op4,
2112 string OpcodeStr, string Dt,
2113 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2114 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
2115 (ins QPR:$src), IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
2116 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
2118 // Pairwise long 2-register accumulate intrinsics,
2119 // both double- and quad-register.
2120 // The destination register is also used as the first source operand register.
2121 class N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2122 bits<2> op17_16, bits<5> op11_7, bit op4,
2123 string OpcodeStr, string Dt,
2124 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2125 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
2126 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vm), IIC_VPALiD,
2127 OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
2128 [(set DPR:$Vd, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$Vm))))]>;
2129 class N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2130 bits<2> op17_16, bits<5> op11_7, bit op4,
2131 string OpcodeStr, string Dt,
2132 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2133 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
2134 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vm), IIC_VPALiQ,
2135 OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
2136 [(set QPR:$Vd, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$Vm))))]>;
2138 // Shift by immediate,
2139 // both double- and quad-register.
2140 class N2VDSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2141 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
2142 ValueType Ty, SDNode OpNode>
2143 : N2VImm<op24, op23, op11_8, op7, 0, op4,
2144 (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), f, itin,
2145 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
2146 [(set DPR:$dst, (Ty (OpNode (Ty DPR:$src), (i32 imm:$SIMM))))]>;
2147 class N2VQSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2148 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
2149 ValueType Ty, SDNode OpNode>
2150 : N2VImm<op24, op23, op11_8, op7, 1, op4,
2151 (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), f, itin,
2152 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
2153 [(set QPR:$dst, (Ty (OpNode (Ty QPR:$src), (i32 imm:$SIMM))))]>;
2155 // Long shift by immediate.
2156 class N2VLSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
2157 string OpcodeStr, string Dt,
2158 ValueType ResTy, ValueType OpTy, SDNode OpNode>
2159 : N2VImm<op24, op23, op11_8, op7, op6, op4,
2160 (outs QPR:$dst), (ins DPR:$src, i32imm:$SIMM), N2RegVShLFrm,
2161 IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src, $SIMM", "",
2162 [(set QPR:$dst, (ResTy (OpNode (OpTy DPR:$src),
2163 (i32 imm:$SIMM))))]>;
2165 // Narrow shift by immediate.
2166 class N2VNSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
2167 InstrItinClass itin, string OpcodeStr, string Dt,
2168 ValueType ResTy, ValueType OpTy, SDNode OpNode>
2169 : N2VImm<op24, op23, op11_8, op7, op6, op4,
2170 (outs DPR:$dst), (ins QPR:$src, i32imm:$SIMM), N2RegVShRFrm, itin,
2171 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
2172 [(set DPR:$dst, (ResTy (OpNode (OpTy QPR:$src),
2173 (i32 imm:$SIMM))))]>;
2175 // Shift right by immediate and accumulate,
2176 // both double- and quad-register.
2177 class N2VDShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2178 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
2179 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
2180 (ins DPR:$src1, DPR:$Vm, i32imm:$SIMM), N2RegVShRFrm, IIC_VPALiD,
2181 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2182 [(set DPR:$Vd, (Ty (add DPR:$src1,
2183 (Ty (ShOp DPR:$Vm, (i32 imm:$SIMM))))))]>;
2184 class N2VQShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2185 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
2186 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
2187 (ins QPR:$src1, QPR:$Vm, i32imm:$SIMM), N2RegVShRFrm, IIC_VPALiD,
2188 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2189 [(set QPR:$Vd, (Ty (add QPR:$src1,
2190 (Ty (ShOp QPR:$Vm, (i32 imm:$SIMM))))))]>;
2192 // Shift by immediate and insert,
2193 // both double- and quad-register.
2194 class N2VDShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2195 Format f, string OpcodeStr, string Dt, ValueType Ty,SDNode ShOp>
2196 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
2197 (ins DPR:$src1, DPR:$Vm, i32imm:$SIMM), f, IIC_VSHLiD,
2198 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2199 [(set DPR:$Vd, (Ty (ShOp DPR:$src1, DPR:$Vm, (i32 imm:$SIMM))))]>;
2200 class N2VQShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2201 Format f, string OpcodeStr, string Dt, ValueType Ty,SDNode ShOp>
2202 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
2203 (ins QPR:$src1, QPR:$Vm, i32imm:$SIMM), f, IIC_VSHLiQ,
2204 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2205 [(set QPR:$Vd, (Ty (ShOp QPR:$src1, QPR:$Vm, (i32 imm:$SIMM))))]>;
2207 // Convert, with fractional bits immediate,
2208 // both double- and quad-register.
2209 class N2VCvtD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2210 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
2212 : N2VImm<op24, op23, op11_8, op7, 0, op4,
2213 (outs DPR:$Vd), (ins DPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
2214 IIC_VUNAD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2215 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (i32 imm:$SIMM))))]>;
2216 class N2VCvtQ<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2217 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
2219 : N2VImm<op24, op23, op11_8, op7, 1, op4,
2220 (outs QPR:$Vd), (ins QPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
2221 IIC_VUNAQ, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2222 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (i32 imm:$SIMM))))]>;
2224 //===----------------------------------------------------------------------===//
2226 //===----------------------------------------------------------------------===//
2228 // Abbreviations used in multiclass suffixes:
2229 // Q = quarter int (8 bit) elements
2230 // H = half int (16 bit) elements
2231 // S = single int (32 bit) elements
2232 // D = double int (64 bit) elements
2234 // Neon 2-register vector operations -- for disassembly only.
2236 // First with only element sizes of 8, 16 and 32 bits:
2237 multiclass N2V_QHS_cmp<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2238 bits<5> op11_7, bit op4, string opc, string Dt,
2239 string asm, SDNode OpNode> {
2240 // 64-bit vector types.
2241 def v8i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 0, op4,
2242 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
2243 opc, !strconcat(Dt, "8"), asm, "",
2244 [(set DPR:$dst, (v8i8 (OpNode (v8i8 DPR:$src))))]>;
2245 def v4i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
2246 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
2247 opc, !strconcat(Dt, "16"), asm, "",
2248 [(set DPR:$dst, (v4i16 (OpNode (v4i16 DPR:$src))))]>;
2249 def v2i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
2250 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
2251 opc, !strconcat(Dt, "32"), asm, "",
2252 [(set DPR:$dst, (v2i32 (OpNode (v2i32 DPR:$src))))]>;
2253 def v2f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
2254 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
2255 opc, "f32", asm, "",
2256 [(set DPR:$dst, (v2f32 (OpNode (v2f32 DPR:$src))))]> {
2257 let Inst{10} = 1; // overwrite F = 1
2260 // 128-bit vector types.
2261 def v16i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 1, op4,
2262 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
2263 opc, !strconcat(Dt, "8"), asm, "",
2264 [(set QPR:$dst, (v16i8 (OpNode (v16i8 QPR:$src))))]>;
2265 def v8i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
2266 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
2267 opc, !strconcat(Dt, "16"), asm, "",
2268 [(set QPR:$dst, (v8i16 (OpNode (v8i16 QPR:$src))))]>;
2269 def v4i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
2270 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
2271 opc, !strconcat(Dt, "32"), asm, "",
2272 [(set QPR:$dst, (v4i32 (OpNode (v4i32 QPR:$src))))]>;
2273 def v4f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
2274 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
2275 opc, "f32", asm, "",
2276 [(set QPR:$dst, (v4f32 (OpNode (v4f32 QPR:$src))))]> {
2277 let Inst{10} = 1; // overwrite F = 1
2281 // Neon 3-register vector operations.
2283 // First with only element sizes of 8, 16 and 32 bits:
2284 multiclass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2285 InstrItinClass itinD16, InstrItinClass itinD32,
2286 InstrItinClass itinQ16, InstrItinClass itinQ32,
2287 string OpcodeStr, string Dt,
2288 SDNode OpNode, bit Commutable = 0> {
2289 // 64-bit vector types.
2290 def v8i8 : N3VD<op24, op23, 0b00, op11_8, op4, itinD16,
2291 OpcodeStr, !strconcat(Dt, "8"),
2292 v8i8, v8i8, OpNode, Commutable>;
2293 def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16,
2294 OpcodeStr, !strconcat(Dt, "16"),
2295 v4i16, v4i16, OpNode, Commutable>;
2296 def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32,
2297 OpcodeStr, !strconcat(Dt, "32"),
2298 v2i32, v2i32, OpNode, Commutable>;
2300 // 128-bit vector types.
2301 def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16,
2302 OpcodeStr, !strconcat(Dt, "8"),
2303 v16i8, v16i8, OpNode, Commutable>;
2304 def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16,
2305 OpcodeStr, !strconcat(Dt, "16"),
2306 v8i16, v8i16, OpNode, Commutable>;
2307 def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32,
2308 OpcodeStr, !strconcat(Dt, "32"),
2309 v4i32, v4i32, OpNode, Commutable>;
2312 multiclass N3VSL_HS<bits<4> op11_8, string OpcodeStr, string Dt, SDNode ShOp> {
2313 def v4i16 : N3VDSL16<0b01, op11_8, OpcodeStr, !strconcat(Dt, "16"),
2315 def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, OpcodeStr, !strconcat(Dt,"32"),
2317 def v8i16 : N3VQSL16<0b01, op11_8, OpcodeStr, !strconcat(Dt, "16"),
2318 v8i16, v4i16, ShOp>;
2319 def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, OpcodeStr, !strconcat(Dt,"32"),
2320 v4i32, v2i32, ShOp>;
2323 // ....then also with element size 64 bits:
2324 multiclass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2325 InstrItinClass itinD, InstrItinClass itinQ,
2326 string OpcodeStr, string Dt,
2327 SDNode OpNode, bit Commutable = 0>
2328 : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ,
2329 OpcodeStr, Dt, OpNode, Commutable> {
2330 def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD,
2331 OpcodeStr, !strconcat(Dt, "64"),
2332 v1i64, v1i64, OpNode, Commutable>;
2333 def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ,
2334 OpcodeStr, !strconcat(Dt, "64"),
2335 v2i64, v2i64, OpNode, Commutable>;
2339 // Neon Narrowing 2-register vector operations,
2340 // source operand element sizes of 16, 32 and 64 bits:
2341 multiclass N2VN_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2342 bits<5> op11_7, bit op6, bit op4,
2343 InstrItinClass itin, string OpcodeStr, string Dt,
2345 def v8i8 : N2VN<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
2346 itin, OpcodeStr, !strconcat(Dt, "16"),
2347 v8i8, v8i16, OpNode>;
2348 def v4i16 : N2VN<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
2349 itin, OpcodeStr, !strconcat(Dt, "32"),
2350 v4i16, v4i32, OpNode>;
2351 def v2i32 : N2VN<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
2352 itin, OpcodeStr, !strconcat(Dt, "64"),
2353 v2i32, v2i64, OpNode>;
2356 // Neon Narrowing 2-register vector intrinsics,
2357 // source operand element sizes of 16, 32 and 64 bits:
2358 multiclass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2359 bits<5> op11_7, bit op6, bit op4,
2360 InstrItinClass itin, string OpcodeStr, string Dt,
2362 def v8i8 : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
2363 itin, OpcodeStr, !strconcat(Dt, "16"),
2364 v8i8, v8i16, IntOp>;
2365 def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
2366 itin, OpcodeStr, !strconcat(Dt, "32"),
2367 v4i16, v4i32, IntOp>;
2368 def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
2369 itin, OpcodeStr, !strconcat(Dt, "64"),
2370 v2i32, v2i64, IntOp>;
2374 // Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
2375 // source operand element sizes of 16, 32 and 64 bits:
2376 multiclass N2VL_QHS<bits<2> op24_23, bits<5> op11_7, bit op6, bit op4,
2377 string OpcodeStr, string Dt, SDNode OpNode> {
2378 def v8i16 : N2VL<op24_23, 0b00, 0b10, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
2379 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode>;
2380 def v4i32 : N2VL<op24_23, 0b01, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
2381 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
2382 def v2i64 : N2VL<op24_23, 0b10, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
2383 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
2387 // Neon 3-register vector intrinsics.
2389 // First with only element sizes of 16 and 32 bits:
2390 multiclass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2391 InstrItinClass itinD16, InstrItinClass itinD32,
2392 InstrItinClass itinQ16, InstrItinClass itinQ32,
2393 string OpcodeStr, string Dt,
2394 Intrinsic IntOp, bit Commutable = 0> {
2395 // 64-bit vector types.
2396 def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, f, itinD16,
2397 OpcodeStr, !strconcat(Dt, "16"),
2398 v4i16, v4i16, IntOp, Commutable>;
2399 def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, f, itinD32,
2400 OpcodeStr, !strconcat(Dt, "32"),
2401 v2i32, v2i32, IntOp, Commutable>;
2403 // 128-bit vector types.
2404 def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, f, itinQ16,
2405 OpcodeStr, !strconcat(Dt, "16"),
2406 v8i16, v8i16, IntOp, Commutable>;
2407 def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, f, itinQ32,
2408 OpcodeStr, !strconcat(Dt, "32"),
2409 v4i32, v4i32, IntOp, Commutable>;
2411 multiclass N3VInt_HSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2412 InstrItinClass itinD16, InstrItinClass itinD32,
2413 InstrItinClass itinQ16, InstrItinClass itinQ32,
2414 string OpcodeStr, string Dt,
2416 // 64-bit vector types.
2417 def v4i16 : N3VDIntSh<op24, op23, 0b01, op11_8, op4, f, itinD16,
2418 OpcodeStr, !strconcat(Dt, "16"),
2419 v4i16, v4i16, IntOp>;
2420 def v2i32 : N3VDIntSh<op24, op23, 0b10, op11_8, op4, f, itinD32,
2421 OpcodeStr, !strconcat(Dt, "32"),
2422 v2i32, v2i32, IntOp>;
2424 // 128-bit vector types.
2425 def v8i16 : N3VQIntSh<op24, op23, 0b01, op11_8, op4, f, itinQ16,
2426 OpcodeStr, !strconcat(Dt, "16"),
2427 v8i16, v8i16, IntOp>;
2428 def v4i32 : N3VQIntSh<op24, op23, 0b10, op11_8, op4, f, itinQ32,
2429 OpcodeStr, !strconcat(Dt, "32"),
2430 v4i32, v4i32, IntOp>;
2433 multiclass N3VIntSL_HS<bits<4> op11_8,
2434 InstrItinClass itinD16, InstrItinClass itinD32,
2435 InstrItinClass itinQ16, InstrItinClass itinQ32,
2436 string OpcodeStr, string Dt, Intrinsic IntOp> {
2437 def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16,
2438 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp>;
2439 def v2i32 : N3VDIntSL<0b10, op11_8, itinD32,
2440 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp>;
2441 def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16,
2442 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16, IntOp>;
2443 def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32,
2444 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32, IntOp>;
2447 // ....then also with element size of 8 bits:
2448 multiclass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2449 InstrItinClass itinD16, InstrItinClass itinD32,
2450 InstrItinClass itinQ16, InstrItinClass itinQ32,
2451 string OpcodeStr, string Dt,
2452 Intrinsic IntOp, bit Commutable = 0>
2453 : N3VInt_HS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2454 OpcodeStr, Dt, IntOp, Commutable> {
2455 def v8i8 : N3VDInt<op24, op23, 0b00, op11_8, op4, f, itinD16,
2456 OpcodeStr, !strconcat(Dt, "8"),
2457 v8i8, v8i8, IntOp, Commutable>;
2458 def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, f, itinQ16,
2459 OpcodeStr, !strconcat(Dt, "8"),
2460 v16i8, v16i8, IntOp, Commutable>;
2462 multiclass N3VInt_QHSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2463 InstrItinClass itinD16, InstrItinClass itinD32,
2464 InstrItinClass itinQ16, InstrItinClass itinQ32,
2465 string OpcodeStr, string Dt,
2467 : N3VInt_HSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2468 OpcodeStr, Dt, IntOp> {
2469 def v8i8 : N3VDIntSh<op24, op23, 0b00, op11_8, op4, f, itinD16,
2470 OpcodeStr, !strconcat(Dt, "8"),
2472 def v16i8 : N3VQIntSh<op24, op23, 0b00, op11_8, op4, f, itinQ16,
2473 OpcodeStr, !strconcat(Dt, "8"),
2474 v16i8, v16i8, IntOp>;
2478 // ....then also with element size of 64 bits:
2479 multiclass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2480 InstrItinClass itinD16, InstrItinClass itinD32,
2481 InstrItinClass itinQ16, InstrItinClass itinQ32,
2482 string OpcodeStr, string Dt,
2483 Intrinsic IntOp, bit Commutable = 0>
2484 : N3VInt_QHS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2485 OpcodeStr, Dt, IntOp, Commutable> {
2486 def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, f, itinD32,
2487 OpcodeStr, !strconcat(Dt, "64"),
2488 v1i64, v1i64, IntOp, Commutable>;
2489 def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, f, itinQ32,
2490 OpcodeStr, !strconcat(Dt, "64"),
2491 v2i64, v2i64, IntOp, Commutable>;
2493 multiclass N3VInt_QHSDSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2494 InstrItinClass itinD16, InstrItinClass itinD32,
2495 InstrItinClass itinQ16, InstrItinClass itinQ32,
2496 string OpcodeStr, string Dt,
2498 : N3VInt_QHSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2499 OpcodeStr, Dt, IntOp> {
2500 def v1i64 : N3VDIntSh<op24, op23, 0b11, op11_8, op4, f, itinD32,
2501 OpcodeStr, !strconcat(Dt, "64"),
2502 v1i64, v1i64, IntOp>;
2503 def v2i64 : N3VQIntSh<op24, op23, 0b11, op11_8, op4, f, itinQ32,
2504 OpcodeStr, !strconcat(Dt, "64"),
2505 v2i64, v2i64, IntOp>;
2508 // Neon Narrowing 3-register vector intrinsics,
2509 // source operand element sizes of 16, 32 and 64 bits:
2510 multiclass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2511 string OpcodeStr, string Dt,
2512 Intrinsic IntOp, bit Commutable = 0> {
2513 def v8i8 : N3VNInt<op24, op23, 0b00, op11_8, op4,
2514 OpcodeStr, !strconcat(Dt, "16"),
2515 v8i8, v8i16, IntOp, Commutable>;
2516 def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4,
2517 OpcodeStr, !strconcat(Dt, "32"),
2518 v4i16, v4i32, IntOp, Commutable>;
2519 def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4,
2520 OpcodeStr, !strconcat(Dt, "64"),
2521 v2i32, v2i64, IntOp, Commutable>;
2525 // Neon Long 3-register vector operations.
2527 multiclass N3VL_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2528 InstrItinClass itin16, InstrItinClass itin32,
2529 string OpcodeStr, string Dt,
2530 SDNode OpNode, bit Commutable = 0> {
2531 def v8i16 : N3VL<op24, op23, 0b00, op11_8, op4, itin16,
2532 OpcodeStr, !strconcat(Dt, "8"),
2533 v8i16, v8i8, OpNode, Commutable>;
2534 def v4i32 : N3VL<op24, op23, 0b01, op11_8, op4, itin16,
2535 OpcodeStr, !strconcat(Dt, "16"),
2536 v4i32, v4i16, OpNode, Commutable>;
2537 def v2i64 : N3VL<op24, op23, 0b10, op11_8, op4, itin32,
2538 OpcodeStr, !strconcat(Dt, "32"),
2539 v2i64, v2i32, OpNode, Commutable>;
2542 multiclass N3VLSL_HS<bit op24, bits<4> op11_8,
2543 InstrItinClass itin, string OpcodeStr, string Dt,
2545 def v4i16 : N3VLSL16<op24, 0b01, op11_8, itin, OpcodeStr,
2546 !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
2547 def v2i32 : N3VLSL<op24, 0b10, op11_8, itin, OpcodeStr,
2548 !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
2551 multiclass N3VLExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2552 InstrItinClass itin16, InstrItinClass itin32,
2553 string OpcodeStr, string Dt,
2554 SDNode OpNode, SDNode ExtOp, bit Commutable = 0> {
2555 def v8i16 : N3VLExt<op24, op23, 0b00, op11_8, op4, itin16,
2556 OpcodeStr, !strconcat(Dt, "8"),
2557 v8i16, v8i8, OpNode, ExtOp, Commutable>;
2558 def v4i32 : N3VLExt<op24, op23, 0b01, op11_8, op4, itin16,
2559 OpcodeStr, !strconcat(Dt, "16"),
2560 v4i32, v4i16, OpNode, ExtOp, Commutable>;
2561 def v2i64 : N3VLExt<op24, op23, 0b10, op11_8, op4, itin32,
2562 OpcodeStr, !strconcat(Dt, "32"),
2563 v2i64, v2i32, OpNode, ExtOp, Commutable>;
2566 // Neon Long 3-register vector intrinsics.
2568 // First with only element sizes of 16 and 32 bits:
2569 multiclass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
2570 InstrItinClass itin16, InstrItinClass itin32,
2571 string OpcodeStr, string Dt,
2572 Intrinsic IntOp, bit Commutable = 0> {
2573 def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin16,
2574 OpcodeStr, !strconcat(Dt, "16"),
2575 v4i32, v4i16, IntOp, Commutable>;
2576 def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin32,
2577 OpcodeStr, !strconcat(Dt, "32"),
2578 v2i64, v2i32, IntOp, Commutable>;
2581 multiclass N3VLIntSL_HS<bit op24, bits<4> op11_8,
2582 InstrItinClass itin, string OpcodeStr, string Dt,
2584 def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin,
2585 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
2586 def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin,
2587 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
2590 // ....then also with element size of 8 bits:
2591 multiclass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2592 InstrItinClass itin16, InstrItinClass itin32,
2593 string OpcodeStr, string Dt,
2594 Intrinsic IntOp, bit Commutable = 0>
2595 : N3VLInt_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt,
2596 IntOp, Commutable> {
2597 def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin16,
2598 OpcodeStr, !strconcat(Dt, "8"),
2599 v8i16, v8i8, IntOp, Commutable>;
2602 // ....with explicit extend (VABDL).
2603 multiclass N3VLIntExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2604 InstrItinClass itin, string OpcodeStr, string Dt,
2605 Intrinsic IntOp, SDNode ExtOp, bit Commutable = 0> {
2606 def v8i16 : N3VLIntExt<op24, op23, 0b00, op11_8, op4, itin,
2607 OpcodeStr, !strconcat(Dt, "8"),
2608 v8i16, v8i8, IntOp, ExtOp, Commutable>;
2609 def v4i32 : N3VLIntExt<op24, op23, 0b01, op11_8, op4, itin,
2610 OpcodeStr, !strconcat(Dt, "16"),
2611 v4i32, v4i16, IntOp, ExtOp, Commutable>;
2612 def v2i64 : N3VLIntExt<op24, op23, 0b10, op11_8, op4, itin,
2613 OpcodeStr, !strconcat(Dt, "32"),
2614 v2i64, v2i32, IntOp, ExtOp, Commutable>;
2618 // Neon Wide 3-register vector intrinsics,
2619 // source operand element sizes of 8, 16 and 32 bits:
2620 multiclass N3VW_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2621 string OpcodeStr, string Dt,
2622 SDNode OpNode, SDNode ExtOp, bit Commutable = 0> {
2623 def v8i16 : N3VW<op24, op23, 0b00, op11_8, op4,
2624 OpcodeStr, !strconcat(Dt, "8"),
2625 v8i16, v8i8, OpNode, ExtOp, Commutable>;
2626 def v4i32 : N3VW<op24, op23, 0b01, op11_8, op4,
2627 OpcodeStr, !strconcat(Dt, "16"),
2628 v4i32, v4i16, OpNode, ExtOp, Commutable>;
2629 def v2i64 : N3VW<op24, op23, 0b10, op11_8, op4,
2630 OpcodeStr, !strconcat(Dt, "32"),
2631 v2i64, v2i32, OpNode, ExtOp, Commutable>;
2635 // Neon Multiply-Op vector operations,
2636 // element sizes of 8, 16 and 32 bits:
2637 multiclass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2638 InstrItinClass itinD16, InstrItinClass itinD32,
2639 InstrItinClass itinQ16, InstrItinClass itinQ32,
2640 string OpcodeStr, string Dt, SDNode OpNode> {
2641 // 64-bit vector types.
2642 def v8i8 : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16,
2643 OpcodeStr, !strconcat(Dt, "8"), v8i8, mul, OpNode>;
2644 def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16,
2645 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, OpNode>;
2646 def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32,
2647 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, OpNode>;
2649 // 128-bit vector types.
2650 def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16,
2651 OpcodeStr, !strconcat(Dt, "8"), v16i8, mul, OpNode>;
2652 def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16,
2653 OpcodeStr, !strconcat(Dt, "16"), v8i16, mul, OpNode>;
2654 def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32,
2655 OpcodeStr, !strconcat(Dt, "32"), v4i32, mul, OpNode>;
2658 multiclass N3VMulOpSL_HS<bits<4> op11_8,
2659 InstrItinClass itinD16, InstrItinClass itinD32,
2660 InstrItinClass itinQ16, InstrItinClass itinQ32,
2661 string OpcodeStr, string Dt, SDNode ShOp> {
2662 def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16,
2663 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, ShOp>;
2664 def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32,
2665 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, ShOp>;
2666 def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16,
2667 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16,
2669 def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32,
2670 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32,
2674 // Neon Intrinsic-Op vector operations,
2675 // element sizes of 8, 16 and 32 bits:
2676 multiclass N3VIntOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2677 InstrItinClass itinD, InstrItinClass itinQ,
2678 string OpcodeStr, string Dt, Intrinsic IntOp,
2680 // 64-bit vector types.
2681 def v8i8 : N3VDIntOp<op24, op23, 0b00, op11_8, op4, itinD,
2682 OpcodeStr, !strconcat(Dt, "8"), v8i8, IntOp, OpNode>;
2683 def v4i16 : N3VDIntOp<op24, op23, 0b01, op11_8, op4, itinD,
2684 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp, OpNode>;
2685 def v2i32 : N3VDIntOp<op24, op23, 0b10, op11_8, op4, itinD,
2686 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp, OpNode>;
2688 // 128-bit vector types.
2689 def v16i8 : N3VQIntOp<op24, op23, 0b00, op11_8, op4, itinQ,
2690 OpcodeStr, !strconcat(Dt, "8"), v16i8, IntOp, OpNode>;
2691 def v8i16 : N3VQIntOp<op24, op23, 0b01, op11_8, op4, itinQ,
2692 OpcodeStr, !strconcat(Dt, "16"), v8i16, IntOp, OpNode>;
2693 def v4i32 : N3VQIntOp<op24, op23, 0b10, op11_8, op4, itinQ,
2694 OpcodeStr, !strconcat(Dt, "32"), v4i32, IntOp, OpNode>;
2697 // Neon 3-argument intrinsics,
2698 // element sizes of 8, 16 and 32 bits:
2699 multiclass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2700 InstrItinClass itinD, InstrItinClass itinQ,
2701 string OpcodeStr, string Dt, Intrinsic IntOp> {
2702 // 64-bit vector types.
2703 def v8i8 : N3VDInt3<op24, op23, 0b00, op11_8, op4, itinD,
2704 OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
2705 def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, itinD,
2706 OpcodeStr, !strconcat(Dt, "16"), v4i16, v4i16, IntOp>;
2707 def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, itinD,
2708 OpcodeStr, !strconcat(Dt, "32"), v2i32, v2i32, IntOp>;
2710 // 128-bit vector types.
2711 def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, itinQ,
2712 OpcodeStr, !strconcat(Dt, "8"), v16i8, v16i8, IntOp>;
2713 def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, itinQ,
2714 OpcodeStr, !strconcat(Dt, "16"), v8i16, v8i16, IntOp>;
2715 def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, itinQ,
2716 OpcodeStr, !strconcat(Dt, "32"), v4i32, v4i32, IntOp>;
2720 // Neon Long Multiply-Op vector operations,
2721 // element sizes of 8, 16 and 32 bits:
2722 multiclass N3VLMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2723 InstrItinClass itin16, InstrItinClass itin32,
2724 string OpcodeStr, string Dt, SDNode MulOp,
2726 def v8i16 : N3VLMulOp<op24, op23, 0b00, op11_8, op4, itin16, OpcodeStr,
2727 !strconcat(Dt, "8"), v8i16, v8i8, MulOp, OpNode>;
2728 def v4i32 : N3VLMulOp<op24, op23, 0b01, op11_8, op4, itin16, OpcodeStr,
2729 !strconcat(Dt, "16"), v4i32, v4i16, MulOp, OpNode>;
2730 def v2i64 : N3VLMulOp<op24, op23, 0b10, op11_8, op4, itin32, OpcodeStr,
2731 !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
2734 multiclass N3VLMulOpSL_HS<bit op24, bits<4> op11_8, string OpcodeStr,
2735 string Dt, SDNode MulOp, SDNode OpNode> {
2736 def v4i16 : N3VLMulOpSL16<op24, 0b01, op11_8, IIC_VMACi16D, OpcodeStr,
2737 !strconcat(Dt,"16"), v4i32, v4i16, MulOp, OpNode>;
2738 def v2i32 : N3VLMulOpSL<op24, 0b10, op11_8, IIC_VMACi32D, OpcodeStr,
2739 !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
2743 // Neon Long 3-argument intrinsics.
2745 // First with only element sizes of 16 and 32 bits:
2746 multiclass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
2747 InstrItinClass itin16, InstrItinClass itin32,
2748 string OpcodeStr, string Dt, Intrinsic IntOp> {
2749 def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, itin16,
2750 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
2751 def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, itin32,
2752 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
2755 multiclass N3VLInt3SL_HS<bit op24, bits<4> op11_8,
2756 string OpcodeStr, string Dt, Intrinsic IntOp> {
2757 def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D,
2758 OpcodeStr, !strconcat(Dt,"16"), v4i32, v4i16, IntOp>;
2759 def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D,
2760 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
2763 // ....then also with element size of 8 bits:
2764 multiclass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2765 InstrItinClass itin16, InstrItinClass itin32,
2766 string OpcodeStr, string Dt, Intrinsic IntOp>
2767 : N3VLInt3_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt, IntOp> {
2768 def v8i16 : N3VLInt3<op24, op23, 0b00, op11_8, op4, itin16,
2769 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, IntOp>;
2772 // ....with explicit extend (VABAL).
2773 multiclass N3VLIntExtOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2774 InstrItinClass itin, string OpcodeStr, string Dt,
2775 Intrinsic IntOp, SDNode ExtOp, SDNode OpNode> {
2776 def v8i16 : N3VLIntExtOp<op24, op23, 0b00, op11_8, op4, itin,
2777 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8,
2778 IntOp, ExtOp, OpNode>;
2779 def v4i32 : N3VLIntExtOp<op24, op23, 0b01, op11_8, op4, itin,
2780 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16,
2781 IntOp, ExtOp, OpNode>;
2782 def v2i64 : N3VLIntExtOp<op24, op23, 0b10, op11_8, op4, itin,
2783 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32,
2784 IntOp, ExtOp, OpNode>;
2788 // Neon 2-register vector intrinsics,
2789 // element sizes of 8, 16 and 32 bits:
2790 multiclass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2791 bits<5> op11_7, bit op4,
2792 InstrItinClass itinD, InstrItinClass itinQ,
2793 string OpcodeStr, string Dt, Intrinsic IntOp> {
2794 // 64-bit vector types.
2795 def v8i8 : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2796 itinD, OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
2797 def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2798 itinD, OpcodeStr, !strconcat(Dt, "16"),v4i16,v4i16,IntOp>;
2799 def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2800 itinD, OpcodeStr, !strconcat(Dt, "32"),v2i32,v2i32,IntOp>;
2802 // 128-bit vector types.
2803 def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2804 itinQ, OpcodeStr, !strconcat(Dt, "8"), v16i8,v16i8,IntOp>;
2805 def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2806 itinQ, OpcodeStr, !strconcat(Dt, "16"),v8i16,v8i16,IntOp>;
2807 def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2808 itinQ, OpcodeStr, !strconcat(Dt, "32"),v4i32,v4i32,IntOp>;
2812 // Neon Pairwise long 2-register intrinsics,
2813 // element sizes of 8, 16 and 32 bits:
2814 multiclass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2815 bits<5> op11_7, bit op4,
2816 string OpcodeStr, string Dt, Intrinsic IntOp> {
2817 // 64-bit vector types.
2818 def v8i8 : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2819 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
2820 def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2821 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
2822 def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2823 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
2825 // 128-bit vector types.
2826 def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2827 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
2828 def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2829 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
2830 def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2831 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
2835 // Neon Pairwise long 2-register accumulate intrinsics,
2836 // element sizes of 8, 16 and 32 bits:
2837 multiclass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2838 bits<5> op11_7, bit op4,
2839 string OpcodeStr, string Dt, Intrinsic IntOp> {
2840 // 64-bit vector types.
2841 def v8i8 : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2842 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
2843 def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2844 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
2845 def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2846 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
2848 // 128-bit vector types.
2849 def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2850 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
2851 def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2852 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
2853 def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2854 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
2858 // Neon 2-register vector shift by immediate,
2859 // with f of either N2RegVShLFrm or N2RegVShRFrm
2860 // element sizes of 8, 16, 32 and 64 bits:
2861 multiclass N2VSh_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2862 InstrItinClass itin, string OpcodeStr, string Dt,
2863 SDNode OpNode, Format f> {
2864 // 64-bit vector types.
2865 def v8i8 : N2VDSh<op24, op23, op11_8, 0, op4, f, itin,
2866 OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
2867 let Inst{21-19} = 0b001; // imm6 = 001xxx
2869 def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, f, itin,
2870 OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
2871 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2873 def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, f, itin,
2874 OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
2875 let Inst{21} = 0b1; // imm6 = 1xxxxx
2877 def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, f, itin,
2878 OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
2881 // 128-bit vector types.
2882 def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, f, itin,
2883 OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
2884 let Inst{21-19} = 0b001; // imm6 = 001xxx
2886 def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, f, itin,
2887 OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
2888 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2890 def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, f, itin,
2891 OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
2892 let Inst{21} = 0b1; // imm6 = 1xxxxx
2894 def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, f, itin,
2895 OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
2899 // Neon Shift-Accumulate vector operations,
2900 // element sizes of 8, 16, 32 and 64 bits:
2901 multiclass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2902 string OpcodeStr, string Dt, SDNode ShOp> {
2903 // 64-bit vector types.
2904 def v8i8 : N2VDShAdd<op24, op23, op11_8, 0, op4,
2905 OpcodeStr, !strconcat(Dt, "8"), v8i8, ShOp> {
2906 let Inst{21-19} = 0b001; // imm6 = 001xxx
2908 def v4i16 : N2VDShAdd<op24, op23, op11_8, 0, op4,
2909 OpcodeStr, !strconcat(Dt, "16"), v4i16, ShOp> {
2910 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2912 def v2i32 : N2VDShAdd<op24, op23, op11_8, 0, op4,
2913 OpcodeStr, !strconcat(Dt, "32"), v2i32, ShOp> {
2914 let Inst{21} = 0b1; // imm6 = 1xxxxx
2916 def v1i64 : N2VDShAdd<op24, op23, op11_8, 1, op4,
2917 OpcodeStr, !strconcat(Dt, "64"), v1i64, ShOp>;
2920 // 128-bit vector types.
2921 def v16i8 : N2VQShAdd<op24, op23, op11_8, 0, op4,
2922 OpcodeStr, !strconcat(Dt, "8"), v16i8, ShOp> {
2923 let Inst{21-19} = 0b001; // imm6 = 001xxx
2925 def v8i16 : N2VQShAdd<op24, op23, op11_8, 0, op4,
2926 OpcodeStr, !strconcat(Dt, "16"), v8i16, ShOp> {
2927 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2929 def v4i32 : N2VQShAdd<op24, op23, op11_8, 0, op4,
2930 OpcodeStr, !strconcat(Dt, "32"), v4i32, ShOp> {
2931 let Inst{21} = 0b1; // imm6 = 1xxxxx
2933 def v2i64 : N2VQShAdd<op24, op23, op11_8, 1, op4,
2934 OpcodeStr, !strconcat(Dt, "64"), v2i64, ShOp>;
2939 // Neon Shift-Insert vector operations,
2940 // with f of either N2RegVShLFrm or N2RegVShRFrm
2941 // element sizes of 8, 16, 32 and 64 bits:
2942 multiclass N2VShIns_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2943 string OpcodeStr, SDNode ShOp,
2945 // 64-bit vector types.
2946 def v8i8 : N2VDShIns<op24, op23, op11_8, 0, op4,
2947 f, OpcodeStr, "8", v8i8, ShOp> {
2948 let Inst{21-19} = 0b001; // imm6 = 001xxx
2950 def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4,
2951 f, OpcodeStr, "16", v4i16, ShOp> {
2952 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2954 def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4,
2955 f, OpcodeStr, "32", v2i32, ShOp> {
2956 let Inst{21} = 0b1; // imm6 = 1xxxxx
2958 def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4,
2959 f, OpcodeStr, "64", v1i64, ShOp>;
2962 // 128-bit vector types.
2963 def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4,
2964 f, OpcodeStr, "8", v16i8, ShOp> {
2965 let Inst{21-19} = 0b001; // imm6 = 001xxx
2967 def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4,
2968 f, OpcodeStr, "16", v8i16, ShOp> {
2969 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2971 def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4,
2972 f, OpcodeStr, "32", v4i32, ShOp> {
2973 let Inst{21} = 0b1; // imm6 = 1xxxxx
2975 def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4,
2976 f, OpcodeStr, "64", v2i64, ShOp>;
2980 // Neon Shift Long operations,
2981 // element sizes of 8, 16, 32 bits:
2982 multiclass N2VLSh_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
2983 bit op4, string OpcodeStr, string Dt, SDNode OpNode> {
2984 def v8i16 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
2985 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode> {
2986 let Inst{21-19} = 0b001; // imm6 = 001xxx
2988 def v4i32 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
2989 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode> {
2990 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2992 def v2i64 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
2993 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode> {
2994 let Inst{21} = 0b1; // imm6 = 1xxxxx
2998 // Neon Shift Narrow operations,
2999 // element sizes of 16, 32, 64 bits:
3000 multiclass N2VNSh_HSD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
3001 bit op4, InstrItinClass itin, string OpcodeStr, string Dt,
3003 def v8i8 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
3004 OpcodeStr, !strconcat(Dt, "16"), v8i8, v8i16, OpNode> {
3005 let Inst{21-19} = 0b001; // imm6 = 001xxx
3007 def v4i16 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
3008 OpcodeStr, !strconcat(Dt, "32"), v4i16, v4i32, OpNode> {
3009 let Inst{21-20} = 0b01; // imm6 = 01xxxx
3011 def v2i32 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
3012 OpcodeStr, !strconcat(Dt, "64"), v2i32, v2i64, OpNode> {
3013 let Inst{21} = 0b1; // imm6 = 1xxxxx
3017 //===----------------------------------------------------------------------===//
3018 // Instruction Definitions.
3019 //===----------------------------------------------------------------------===//
3021 // Vector Add Operations.
3023 // VADD : Vector Add (integer and floating-point)
3024 defm VADD : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd", "i",
3026 def VADDfd : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd", "f32",
3027 v2f32, v2f32, fadd, 1>;
3028 def VADDfq : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd", "f32",
3029 v4f32, v4f32, fadd, 1>;
3030 // VADDL : Vector Add Long (Q = D + D)
3031 defm VADDLs : N3VLExt_QHS<0,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
3032 "vaddl", "s", add, sext, 1>;
3033 defm VADDLu : N3VLExt_QHS<1,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
3034 "vaddl", "u", add, zext, 1>;
3035 // VADDW : Vector Add Wide (Q = Q + D)
3036 defm VADDWs : N3VW_QHS<0,1,0b0001,0, "vaddw", "s", add, sext, 0>;
3037 defm VADDWu : N3VW_QHS<1,1,0b0001,0, "vaddw", "u", add, zext, 0>;
3038 // VHADD : Vector Halving Add
3039 defm VHADDs : N3VInt_QHS<0, 0, 0b0000, 0, N3RegFrm,
3040 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3041 "vhadd", "s", int_arm_neon_vhadds, 1>;
3042 defm VHADDu : N3VInt_QHS<1, 0, 0b0000, 0, N3RegFrm,
3043 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3044 "vhadd", "u", int_arm_neon_vhaddu, 1>;
3045 // VRHADD : Vector Rounding Halving Add
3046 defm VRHADDs : N3VInt_QHS<0, 0, 0b0001, 0, N3RegFrm,
3047 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3048 "vrhadd", "s", int_arm_neon_vrhadds, 1>;
3049 defm VRHADDu : N3VInt_QHS<1, 0, 0b0001, 0, N3RegFrm,
3050 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3051 "vrhadd", "u", int_arm_neon_vrhaddu, 1>;
3052 // VQADD : Vector Saturating Add
3053 defm VQADDs : N3VInt_QHSD<0, 0, 0b0000, 1, N3RegFrm,
3054 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3055 "vqadd", "s", int_arm_neon_vqadds, 1>;
3056 defm VQADDu : N3VInt_QHSD<1, 0, 0b0000, 1, N3RegFrm,
3057 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
3058 "vqadd", "u", int_arm_neon_vqaddu, 1>;
3059 // VADDHN : Vector Add and Narrow Returning High Half (D = Q + Q)
3060 defm VADDHN : N3VNInt_HSD<0,1,0b0100,0, "vaddhn", "i",
3061 int_arm_neon_vaddhn, 1>;
3062 // VRADDHN : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
3063 defm VRADDHN : N3VNInt_HSD<1,1,0b0100,0, "vraddhn", "i",
3064 int_arm_neon_vraddhn, 1>;
3066 // Vector Multiply Operations.
3068 // VMUL : Vector Multiply (integer, polynomial and floating-point)
3069 defm VMUL : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D,
3070 IIC_VMULi16Q, IIC_VMULi32Q, "vmul", "i", mul, 1>;
3071 def VMULpd : N3VDInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16D, "vmul",
3072 "p8", v8i8, v8i8, int_arm_neon_vmulp, 1>;
3073 def VMULpq : N3VQInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16Q, "vmul",
3074 "p8", v16i8, v16i8, int_arm_neon_vmulp, 1>;
3075 def VMULfd : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VFMULD, "vmul", "f32",
3076 v2f32, v2f32, fmul, 1>;
3077 def VMULfq : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VFMULQ, "vmul", "f32",
3078 v4f32, v4f32, fmul, 1>;
3079 defm VMULsl : N3VSL_HS<0b1000, "vmul", "i", mul>;
3080 def VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul", "f32", v2f32, fmul>;
3081 def VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul", "f32", v4f32,
3084 def : Pat<(v8i16 (mul (v8i16 QPR:$src1),
3085 (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))),
3086 (v8i16 (VMULslv8i16 (v8i16 QPR:$src1),
3087 (v4i16 (EXTRACT_SUBREG QPR:$src2,
3088 (DSubReg_i16_reg imm:$lane))),
3089 (SubReg_i16_lane imm:$lane)))>;
3090 def : Pat<(v4i32 (mul (v4i32 QPR:$src1),
3091 (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))),
3092 (v4i32 (VMULslv4i32 (v4i32 QPR:$src1),
3093 (v2i32 (EXTRACT_SUBREG QPR:$src2,
3094 (DSubReg_i32_reg imm:$lane))),
3095 (SubReg_i32_lane imm:$lane)))>;
3096 def : Pat<(v4f32 (fmul (v4f32 QPR:$src1),
3097 (v4f32 (NEONvduplane (v4f32 QPR:$src2), imm:$lane)))),
3098 (v4f32 (VMULslfq (v4f32 QPR:$src1),
3099 (v2f32 (EXTRACT_SUBREG QPR:$src2,
3100 (DSubReg_i32_reg imm:$lane))),
3101 (SubReg_i32_lane imm:$lane)))>;
3103 // VQDMULH : Vector Saturating Doubling Multiply Returning High Half
3104 defm VQDMULH : N3VInt_HS<0, 0, 0b1011, 0, N3RegFrm, IIC_VMULi16D, IIC_VMULi32D,
3105 IIC_VMULi16Q, IIC_VMULi32Q,
3106 "vqdmulh", "s", int_arm_neon_vqdmulh, 1>;
3107 defm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D,
3108 IIC_VMULi16Q, IIC_VMULi32Q,
3109 "vqdmulh", "s", int_arm_neon_vqdmulh>;
3110 def : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1),
3111 (v8i16 (NEONvduplane (v8i16 QPR:$src2),
3113 (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1),
3114 (v4i16 (EXTRACT_SUBREG QPR:$src2,
3115 (DSubReg_i16_reg imm:$lane))),
3116 (SubReg_i16_lane imm:$lane)))>;
3117 def : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1),
3118 (v4i32 (NEONvduplane (v4i32 QPR:$src2),
3120 (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1),
3121 (v2i32 (EXTRACT_SUBREG QPR:$src2,
3122 (DSubReg_i32_reg imm:$lane))),
3123 (SubReg_i32_lane imm:$lane)))>;
3125 // VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
3126 defm VQRDMULH : N3VInt_HS<1, 0, 0b1011, 0, N3RegFrm,
3127 IIC_VMULi16D,IIC_VMULi32D,IIC_VMULi16Q,IIC_VMULi32Q,
3128 "vqrdmulh", "s", int_arm_neon_vqrdmulh, 1>;
3129 defm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D,
3130 IIC_VMULi16Q, IIC_VMULi32Q,
3131 "vqrdmulh", "s", int_arm_neon_vqrdmulh>;
3132 def : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1),
3133 (v8i16 (NEONvduplane (v8i16 QPR:$src2),
3135 (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1),
3136 (v4i16 (EXTRACT_SUBREG QPR:$src2,
3137 (DSubReg_i16_reg imm:$lane))),
3138 (SubReg_i16_lane imm:$lane)))>;
3139 def : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1),
3140 (v4i32 (NEONvduplane (v4i32 QPR:$src2),
3142 (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1),
3143 (v2i32 (EXTRACT_SUBREG QPR:$src2,
3144 (DSubReg_i32_reg imm:$lane))),
3145 (SubReg_i32_lane imm:$lane)))>;
3147 // VMULL : Vector Multiply Long (integer and polynomial) (Q = D * D)
3148 defm VMULLs : N3VL_QHS<0,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
3149 "vmull", "s", NEONvmulls, 1>;
3150 defm VMULLu : N3VL_QHS<1,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
3151 "vmull", "u", NEONvmullu, 1>;
3152 def VMULLp : N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull", "p8",
3153 v8i16, v8i8, int_arm_neon_vmullp, 1>;
3154 defm VMULLsls : N3VLSL_HS<0, 0b1010, IIC_VMULi16D, "vmull", "s", NEONvmulls>;
3155 defm VMULLslu : N3VLSL_HS<1, 0b1010, IIC_VMULi16D, "vmull", "u", NEONvmullu>;
3157 // VQDMULL : Vector Saturating Doubling Multiply Long (Q = D * D)
3158 defm VQDMULL : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, IIC_VMULi32D,
3159 "vqdmull", "s", int_arm_neon_vqdmull, 1>;
3160 defm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D,
3161 "vqdmull", "s", int_arm_neon_vqdmull>;
3163 // Vector Multiply-Accumulate and Multiply-Subtract Operations.
3165 // VMLA : Vector Multiply Accumulate (integer and floating-point)
3166 defm VMLA : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
3167 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
3168 def VMLAfd : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla", "f32",
3170 def VMLAfq : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla", "f32",
3172 defm VMLAsl : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D,
3173 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
3174 def VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla", "f32",
3176 def VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla", "f32",
3177 v4f32, v2f32, fmul, fadd>;
3179 def : Pat<(v8i16 (add (v8i16 QPR:$src1),
3180 (mul (v8i16 QPR:$src2),
3181 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
3182 (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
3183 (v4i16 (EXTRACT_SUBREG QPR:$src3,
3184 (DSubReg_i16_reg imm:$lane))),
3185 (SubReg_i16_lane imm:$lane)))>;
3187 def : Pat<(v4i32 (add (v4i32 QPR:$src1),
3188 (mul (v4i32 QPR:$src2),
3189 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
3190 (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
3191 (v2i32 (EXTRACT_SUBREG QPR:$src3,
3192 (DSubReg_i32_reg imm:$lane))),
3193 (SubReg_i32_lane imm:$lane)))>;
3195 def : Pat<(v4f32 (fadd (v4f32 QPR:$src1),
3196 (fmul (v4f32 QPR:$src2),
3197 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
3198 (v4f32 (VMLAslfq (v4f32 QPR:$src1),
3200 (v2f32 (EXTRACT_SUBREG QPR:$src3,
3201 (DSubReg_i32_reg imm:$lane))),
3202 (SubReg_i32_lane imm:$lane)))>;
3204 // VMLAL : Vector Multiply Accumulate Long (Q += D * D)
3205 defm VMLALs : N3VLMulOp_QHS<0,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
3206 "vmlal", "s", NEONvmulls, add>;
3207 defm VMLALu : N3VLMulOp_QHS<1,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
3208 "vmlal", "u", NEONvmullu, add>;
3210 defm VMLALsls : N3VLMulOpSL_HS<0, 0b0010, "vmlal", "s", NEONvmulls, add>;
3211 defm VMLALslu : N3VLMulOpSL_HS<1, 0b0010, "vmlal", "u", NEONvmullu, add>;
3213 // VQDMLAL : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
3214 defm VQDMLAL : N3VLInt3_HS<0, 1, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
3215 "vqdmlal", "s", int_arm_neon_vqdmlal>;
3216 defm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal", "s", int_arm_neon_vqdmlal>;
3218 // VMLS : Vector Multiply Subtract (integer and floating-point)
3219 defm VMLS : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
3220 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
3221 def VMLSfd : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls", "f32",
3223 def VMLSfq : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls", "f32",
3225 defm VMLSsl : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D,
3226 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
3227 def VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls", "f32",
3229 def VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls", "f32",
3230 v4f32, v2f32, fmul, fsub>;
3232 def : Pat<(v8i16 (sub (v8i16 QPR:$src1),
3233 (mul (v8i16 QPR:$src2),
3234 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
3235 (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
3236 (v4i16 (EXTRACT_SUBREG QPR:$src3,
3237 (DSubReg_i16_reg imm:$lane))),
3238 (SubReg_i16_lane imm:$lane)))>;
3240 def : Pat<(v4i32 (sub (v4i32 QPR:$src1),
3241 (mul (v4i32 QPR:$src2),
3242 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
3243 (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
3244 (v2i32 (EXTRACT_SUBREG QPR:$src3,
3245 (DSubReg_i32_reg imm:$lane))),
3246 (SubReg_i32_lane imm:$lane)))>;
3248 def : Pat<(v4f32 (fsub (v4f32 QPR:$src1),
3249 (fmul (v4f32 QPR:$src2),
3250 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
3251 (v4f32 (VMLSslfq (v4f32 QPR:$src1), (v4f32 QPR:$src2),
3252 (v2f32 (EXTRACT_SUBREG QPR:$src3,
3253 (DSubReg_i32_reg imm:$lane))),
3254 (SubReg_i32_lane imm:$lane)))>;
3256 // VMLSL : Vector Multiply Subtract Long (Q -= D * D)
3257 defm VMLSLs : N3VLMulOp_QHS<0,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
3258 "vmlsl", "s", NEONvmulls, sub>;
3259 defm VMLSLu : N3VLMulOp_QHS<1,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
3260 "vmlsl", "u", NEONvmullu, sub>;
3262 defm VMLSLsls : N3VLMulOpSL_HS<0, 0b0110, "vmlsl", "s", NEONvmulls, sub>;
3263 defm VMLSLslu : N3VLMulOpSL_HS<1, 0b0110, "vmlsl", "u", NEONvmullu, sub>;
3265 // VQDMLSL : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
3266 defm VQDMLSL : N3VLInt3_HS<0, 1, 0b1011, 0, IIC_VMACi16D, IIC_VMACi32D,
3267 "vqdmlsl", "s", int_arm_neon_vqdmlsl>;
3268 defm VQDMLSLsl: N3VLInt3SL_HS<0, 0b111, "vqdmlsl", "s", int_arm_neon_vqdmlsl>;
3270 // Vector Subtract Operations.
3272 // VSUB : Vector Subtract (integer and floating-point)
3273 defm VSUB : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ,
3274 "vsub", "i", sub, 0>;
3275 def VSUBfd : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub", "f32",
3276 v2f32, v2f32, fsub, 0>;
3277 def VSUBfq : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub", "f32",
3278 v4f32, v4f32, fsub, 0>;
3279 // VSUBL : Vector Subtract Long (Q = D - D)
3280 defm VSUBLs : N3VLExt_QHS<0,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
3281 "vsubl", "s", sub, sext, 0>;
3282 defm VSUBLu : N3VLExt_QHS<1,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
3283 "vsubl", "u", sub, zext, 0>;
3284 // VSUBW : Vector Subtract Wide (Q = Q - D)
3285 defm VSUBWs : N3VW_QHS<0,1,0b0011,0, "vsubw", "s", sub, sext, 0>;
3286 defm VSUBWu : N3VW_QHS<1,1,0b0011,0, "vsubw", "u", sub, zext, 0>;
3287 // VHSUB : Vector Halving Subtract
3288 defm VHSUBs : N3VInt_QHS<0, 0, 0b0010, 0, N3RegFrm,
3289 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3290 "vhsub", "s", int_arm_neon_vhsubs, 0>;
3291 defm VHSUBu : N3VInt_QHS<1, 0, 0b0010, 0, N3RegFrm,
3292 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3293 "vhsub", "u", int_arm_neon_vhsubu, 0>;
3294 // VQSUB : Vector Saturing Subtract
3295 defm VQSUBs : N3VInt_QHSD<0, 0, 0b0010, 1, N3RegFrm,
3296 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3297 "vqsub", "s", int_arm_neon_vqsubs, 0>;
3298 defm VQSUBu : N3VInt_QHSD<1, 0, 0b0010, 1, N3RegFrm,
3299 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3300 "vqsub", "u", int_arm_neon_vqsubu, 0>;
3301 // VSUBHN : Vector Subtract and Narrow Returning High Half (D = Q - Q)
3302 defm VSUBHN : N3VNInt_HSD<0,1,0b0110,0, "vsubhn", "i",
3303 int_arm_neon_vsubhn, 0>;
3304 // VRSUBHN : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
3305 defm VRSUBHN : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn", "i",
3306 int_arm_neon_vrsubhn, 0>;
3308 // Vector Comparisons.
3310 // VCEQ : Vector Compare Equal
3311 defm VCEQ : N3V_QHS<1, 0, 0b1000, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3312 IIC_VSUBi4Q, "vceq", "i", NEONvceq, 1>;
3313 def VCEQfd : N3VD<0,0,0b00,0b1110,0, IIC_VBIND, "vceq", "f32", v2i32, v2f32,
3315 def VCEQfq : N3VQ<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq", "f32", v4i32, v4f32,
3318 defm VCEQz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00010, 0, "vceq", "i",
3319 "$dst, $src, #0", NEONvceqz>;
3321 // VCGE : Vector Compare Greater Than or Equal
3322 defm VCGEs : N3V_QHS<0, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3323 IIC_VSUBi4Q, "vcge", "s", NEONvcge, 0>;
3324 defm VCGEu : N3V_QHS<1, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3325 IIC_VSUBi4Q, "vcge", "u", NEONvcgeu, 0>;
3326 def VCGEfd : N3VD<1,0,0b00,0b1110,0, IIC_VBIND, "vcge", "f32", v2i32, v2f32,
3328 def VCGEfq : N3VQ<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge", "f32", v4i32, v4f32,
3331 defm VCGEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00001, 0, "vcge", "s",
3332 "$dst, $src, #0", NEONvcgez>;
3333 defm VCLEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00011, 0, "vcle", "s",
3334 "$dst, $src, #0", NEONvclez>;
3336 // VCGT : Vector Compare Greater Than
3337 defm VCGTs : N3V_QHS<0, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3338 IIC_VSUBi4Q, "vcgt", "s", NEONvcgt, 0>;
3339 defm VCGTu : N3V_QHS<1, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3340 IIC_VSUBi4Q, "vcgt", "u", NEONvcgtu, 0>;
3341 def VCGTfd : N3VD<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt", "f32", v2i32, v2f32,
3343 def VCGTfq : N3VQ<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt", "f32", v4i32, v4f32,
3346 defm VCGTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00000, 0, "vcgt", "s",
3347 "$dst, $src, #0", NEONvcgtz>;
3348 defm VCLTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00100, 0, "vclt", "s",
3349 "$dst, $src, #0", NEONvcltz>;
3351 // VACGE : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
3352 def VACGEd : N3VDInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
3353 "f32", v2i32, v2f32, int_arm_neon_vacged, 0>;
3354 def VACGEq : N3VQInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
3355 "f32", v4i32, v4f32, int_arm_neon_vacgeq, 0>;
3356 // VACGT : Vector Absolute Compare Greater Than (aka VCAGT)
3357 def VACGTd : N3VDInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
3358 "f32", v2i32, v2f32, int_arm_neon_vacgtd, 0>;
3359 def VACGTq : N3VQInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
3360 "f32", v4i32, v4f32, int_arm_neon_vacgtq, 0>;
3361 // VTST : Vector Test Bits
3362 defm VTST : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
3363 IIC_VBINi4Q, "vtst", "", NEONvtst, 1>;
3365 // Vector Bitwise Operations.
3367 def vnotd : PatFrag<(ops node:$in),
3368 (xor node:$in, (bitconvert (v8i8 NEONimmAllOnesV)))>;
3369 def vnotq : PatFrag<(ops node:$in),
3370 (xor node:$in, (bitconvert (v16i8 NEONimmAllOnesV)))>;
3373 // VAND : Vector Bitwise AND
3374 def VANDd : N3VDX<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand",
3375 v2i32, v2i32, and, 1>;
3376 def VANDq : N3VQX<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand",
3377 v4i32, v4i32, and, 1>;
3379 // VEOR : Vector Bitwise Exclusive OR
3380 def VEORd : N3VDX<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor",
3381 v2i32, v2i32, xor, 1>;
3382 def VEORq : N3VQX<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor",
3383 v4i32, v4i32, xor, 1>;
3385 // VORR : Vector Bitwise OR
3386 def VORRd : N3VDX<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr",
3387 v2i32, v2i32, or, 1>;
3388 def VORRq : N3VQX<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr",
3389 v4i32, v4i32, or, 1>;
3391 def VORRiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 0, 1,
3392 (outs DPR:$Vd), (ins nModImm:$SIMM, DPR:$src),
3394 "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
3396 (v4i16 (NEONvorrImm DPR:$src, timm:$SIMM)))]> {
3397 let Inst{9} = SIMM{9};
3400 def VORRiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 0, 1,
3401 (outs DPR:$Vd), (ins nModImm:$SIMM, DPR:$src),
3403 "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
3405 (v2i32 (NEONvorrImm DPR:$src, timm:$SIMM)))]> {
3406 let Inst{10-9} = SIMM{10-9};
3409 def VORRiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 0, 1,
3410 (outs QPR:$Vd), (ins nModImm:$SIMM, QPR:$src),
3412 "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
3414 (v8i16 (NEONvorrImm QPR:$src, timm:$SIMM)))]> {
3415 let Inst{9} = SIMM{9};
3418 def VORRiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 0, 1,
3419 (outs QPR:$Vd), (ins nModImm:$SIMM, QPR:$src),
3421 "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
3423 (v4i32 (NEONvorrImm QPR:$src, timm:$SIMM)))]> {
3424 let Inst{10-9} = SIMM{10-9};
3428 // VBIC : Vector Bitwise Bit Clear (AND NOT)
3429 def VBICd : N3VX<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst),
3430 (ins DPR:$src1, DPR:$src2), N3RegFrm, IIC_VBINiD,
3431 "vbic", "$dst, $src1, $src2", "",
3432 [(set DPR:$dst, (v2i32 (and DPR:$src1,
3433 (vnotd DPR:$src2))))]>;
3434 def VBICq : N3VX<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst),
3435 (ins QPR:$src1, QPR:$src2), N3RegFrm, IIC_VBINiQ,
3436 "vbic", "$dst, $src1, $src2", "",
3437 [(set QPR:$dst, (v4i32 (and QPR:$src1,
3438 (vnotq QPR:$src2))))]>;
3440 def VBICiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 1, 1,
3441 (outs DPR:$Vd), (ins nModImm:$SIMM, DPR:$src),
3443 "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
3445 (v4i16 (NEONvbicImm DPR:$src, timm:$SIMM)))]> {
3446 let Inst{9} = SIMM{9};
3449 def VBICiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 1, 1,
3450 (outs DPR:$Vd), (ins nModImm:$SIMM, DPR:$src),
3452 "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
3454 (v2i32 (NEONvbicImm DPR:$src, timm:$SIMM)))]> {
3455 let Inst{10-9} = SIMM{10-9};
3458 def VBICiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 1, 1,
3459 (outs QPR:$Vd), (ins nModImm:$SIMM, QPR:$src),
3461 "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
3463 (v8i16 (NEONvbicImm QPR:$src, timm:$SIMM)))]> {
3464 let Inst{9} = SIMM{9};
3467 def VBICiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 1, 1,
3468 (outs QPR:$Vd), (ins nModImm:$SIMM, QPR:$src),
3470 "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
3472 (v4i32 (NEONvbicImm QPR:$src, timm:$SIMM)))]> {
3473 let Inst{10-9} = SIMM{10-9};
3476 // VORN : Vector Bitwise OR NOT
3477 def VORNd : N3VX<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$dst),
3478 (ins DPR:$src1, DPR:$src2), N3RegFrm, IIC_VBINiD,
3479 "vorn", "$dst, $src1, $src2", "",
3480 [(set DPR:$dst, (v2i32 (or DPR:$src1,
3481 (vnotd DPR:$src2))))]>;
3482 def VORNq : N3VX<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$dst),
3483 (ins QPR:$src1, QPR:$src2), N3RegFrm, IIC_VBINiQ,
3484 "vorn", "$dst, $src1, $src2", "",
3485 [(set QPR:$dst, (v4i32 (or QPR:$src1,
3486 (vnotq QPR:$src2))))]>;
3488 // VMVN : Vector Bitwise NOT (Immediate)
3490 let isReMaterializable = 1 in {
3492 def VMVNv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 1, 1, (outs DPR:$dst),
3493 (ins nModImm:$SIMM), IIC_VMOVImm,
3494 "vmvn", "i16", "$dst, $SIMM", "",
3495 [(set DPR:$dst, (v4i16 (NEONvmvnImm timm:$SIMM)))]> {
3496 let Inst{9} = SIMM{9};
3499 def VMVNv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 1, 1, (outs QPR:$dst),
3500 (ins nModImm:$SIMM), IIC_VMOVImm,
3501 "vmvn", "i16", "$dst, $SIMM", "",
3502 [(set QPR:$dst, (v8i16 (NEONvmvnImm timm:$SIMM)))]> {
3503 let Inst{9} = SIMM{9};
3506 def VMVNv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 1, 1, (outs DPR:$dst),
3507 (ins nModImm:$SIMM), IIC_VMOVImm,
3508 "vmvn", "i32", "$dst, $SIMM", "",
3509 [(set DPR:$dst, (v2i32 (NEONvmvnImm timm:$SIMM)))]> {
3510 let Inst{11-8} = SIMM{11-8};
3513 def VMVNv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 1, 1, (outs QPR:$dst),
3514 (ins nModImm:$SIMM), IIC_VMOVImm,
3515 "vmvn", "i32", "$dst, $SIMM", "",
3516 [(set QPR:$dst, (v4i32 (NEONvmvnImm timm:$SIMM)))]> {
3517 let Inst{11-8} = SIMM{11-8};
3521 // VMVN : Vector Bitwise NOT
3522 def VMVNd : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
3523 (outs DPR:$dst), (ins DPR:$src), IIC_VSUBiD,
3524 "vmvn", "$dst, $src", "",
3525 [(set DPR:$dst, (v2i32 (vnotd DPR:$src)))]>;
3526 def VMVNq : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
3527 (outs QPR:$dst), (ins QPR:$src), IIC_VSUBiD,
3528 "vmvn", "$dst, $src", "",
3529 [(set QPR:$dst, (v4i32 (vnotq QPR:$src)))]>;
3530 def : Pat<(v2i32 (vnotd DPR:$src)), (VMVNd DPR:$src)>;
3531 def : Pat<(v4i32 (vnotq QPR:$src)), (VMVNq QPR:$src)>;
3533 // VBSL : Vector Bitwise Select
3534 def VBSLd : N3VX<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
3535 (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
3536 N3RegFrm, IIC_VCNTiD,
3537 "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3539 (v2i32 (or (and DPR:$Vn, DPR:$src1),
3540 (and DPR:$Vm, (vnotd DPR:$src1)))))]>;
3541 def VBSLq : N3VX<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
3542 (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
3543 N3RegFrm, IIC_VCNTiQ,
3544 "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3546 (v4i32 (or (and QPR:$Vn, QPR:$src1),
3547 (and QPR:$Vm, (vnotq QPR:$src1)))))]>;
3549 // VBIF : Vector Bitwise Insert if False
3550 // like VBSL but with: "vbif $dst, $src3, $src1", "$src2 = $dst",
3551 // FIXME: This instruction's encoding MAY NOT BE correct.
3552 def VBIFd : N3VX<1, 0, 0b11, 0b0001, 0, 1,
3553 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
3554 N3RegFrm, IIC_VBINiD,
3555 "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3556 [/* For disassembly only; pattern left blank */]>;
3557 def VBIFq : N3VX<1, 0, 0b11, 0b0001, 1, 1,
3558 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
3559 N3RegFrm, IIC_VBINiQ,
3560 "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3561 [/* For disassembly only; pattern left blank */]>;
3563 // VBIT : Vector Bitwise Insert if True
3564 // like VBSL but with: "vbit $dst, $src2, $src1", "$src3 = $dst",
3565 // FIXME: This instruction's encoding MAY NOT BE correct.
3566 def VBITd : N3VX<1, 0, 0b10, 0b0001, 0, 1,
3567 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
3568 N3RegFrm, IIC_VBINiD,
3569 "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3570 [/* For disassembly only; pattern left blank */]>;
3571 def VBITq : N3VX<1, 0, 0b10, 0b0001, 1, 1,
3572 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
3573 N3RegFrm, IIC_VBINiQ,
3574 "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3575 [/* For disassembly only; pattern left blank */]>;
3577 // VBIT/VBIF are not yet implemented. The TwoAddress pass will not go looking
3578 // for equivalent operations with different register constraints; it just
3581 // Vector Absolute Differences.
3583 // VABD : Vector Absolute Difference
3584 defm VABDs : N3VInt_QHS<0, 0, 0b0111, 0, N3RegFrm,
3585 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3586 "vabd", "s", int_arm_neon_vabds, 1>;
3587 defm VABDu : N3VInt_QHS<1, 0, 0b0111, 0, N3RegFrm,
3588 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3589 "vabd", "u", int_arm_neon_vabdu, 1>;
3590 def VABDfd : N3VDInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBIND,
3591 "vabd", "f32", v2f32, v2f32, int_arm_neon_vabds, 1>;
3592 def VABDfq : N3VQInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBINQ,
3593 "vabd", "f32", v4f32, v4f32, int_arm_neon_vabds, 1>;
3595 // VABDL : Vector Absolute Difference Long (Q = | D - D |)
3596 defm VABDLs : N3VLIntExt_QHS<0,1,0b0111,0, IIC_VSUBi4Q,
3597 "vabdl", "s", int_arm_neon_vabds, zext, 1>;
3598 defm VABDLu : N3VLIntExt_QHS<1,1,0b0111,0, IIC_VSUBi4Q,
3599 "vabdl", "u", int_arm_neon_vabdu, zext, 1>;
3601 // VABA : Vector Absolute Difference and Accumulate
3602 defm VABAs : N3VIntOp_QHS<0,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
3603 "vaba", "s", int_arm_neon_vabds, add>;
3604 defm VABAu : N3VIntOp_QHS<1,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
3605 "vaba", "u", int_arm_neon_vabdu, add>;
3607 // VABAL : Vector Absolute Difference and Accumulate Long (Q += | D - D |)
3608 defm VABALs : N3VLIntExtOp_QHS<0,1,0b0101,0, IIC_VABAD,
3609 "vabal", "s", int_arm_neon_vabds, zext, add>;
3610 defm VABALu : N3VLIntExtOp_QHS<1,1,0b0101,0, IIC_VABAD,
3611 "vabal", "u", int_arm_neon_vabdu, zext, add>;
3613 // Vector Maximum and Minimum.
3615 // VMAX : Vector Maximum
3616 defm VMAXs : N3VInt_QHS<0, 0, 0b0110, 0, N3RegFrm,
3617 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3618 "vmax", "s", int_arm_neon_vmaxs, 1>;
3619 defm VMAXu : N3VInt_QHS<1, 0, 0b0110, 0, N3RegFrm,
3620 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3621 "vmax", "u", int_arm_neon_vmaxu, 1>;
3622 def VMAXfd : N3VDInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBIND,
3624 v2f32, v2f32, int_arm_neon_vmaxs, 1>;
3625 def VMAXfq : N3VQInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBINQ,
3627 v4f32, v4f32, int_arm_neon_vmaxs, 1>;
3629 // VMIN : Vector Minimum
3630 defm VMINs : N3VInt_QHS<0, 0, 0b0110, 1, N3RegFrm,
3631 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3632 "vmin", "s", int_arm_neon_vmins, 1>;
3633 defm VMINu : N3VInt_QHS<1, 0, 0b0110, 1, N3RegFrm,
3634 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3635 "vmin", "u", int_arm_neon_vminu, 1>;
3636 def VMINfd : N3VDInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBIND,
3638 v2f32, v2f32, int_arm_neon_vmins, 1>;
3639 def VMINfq : N3VQInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBINQ,
3641 v4f32, v4f32, int_arm_neon_vmins, 1>;
3643 // Vector Pairwise Operations.
3645 // VPADD : Vector Pairwise Add
3646 def VPADDi8 : N3VDInt<0, 0, 0b00, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
3648 v8i8, v8i8, int_arm_neon_vpadd, 0>;
3649 def VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
3651 v4i16, v4i16, int_arm_neon_vpadd, 0>;
3652 def VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
3654 v2i32, v2i32, int_arm_neon_vpadd, 0>;
3655 def VPADDf : N3VDInt<1, 0, 0b00, 0b1101, 0, N3RegFrm,
3656 IIC_VPBIND, "vpadd", "f32",
3657 v2f32, v2f32, int_arm_neon_vpadd, 0>;
3659 // VPADDL : Vector Pairwise Add Long
3660 defm VPADDLs : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl", "s",
3661 int_arm_neon_vpaddls>;
3662 defm VPADDLu : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl", "u",
3663 int_arm_neon_vpaddlu>;
3665 // VPADAL : Vector Pairwise Add and Accumulate Long
3666 defm VPADALs : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01100, 0, "vpadal", "s",
3667 int_arm_neon_vpadals>;
3668 defm VPADALu : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01101, 0, "vpadal", "u",
3669 int_arm_neon_vpadalu>;
3671 // VPMAX : Vector Pairwise Maximum
3672 def VPMAXs8 : N3VDInt<0, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3673 "s8", v8i8, v8i8, int_arm_neon_vpmaxs, 0>;
3674 def VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3675 "s16", v4i16, v4i16, int_arm_neon_vpmaxs, 0>;
3676 def VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3677 "s32", v2i32, v2i32, int_arm_neon_vpmaxs, 0>;
3678 def VPMAXu8 : N3VDInt<1, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3679 "u8", v8i8, v8i8, int_arm_neon_vpmaxu, 0>;
3680 def VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3681 "u16", v4i16, v4i16, int_arm_neon_vpmaxu, 0>;
3682 def VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3683 "u32", v2i32, v2i32, int_arm_neon_vpmaxu, 0>;
3684 def VPMAXf : N3VDInt<1, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmax",
3685 "f32", v2f32, v2f32, int_arm_neon_vpmaxs, 0>;
3687 // VPMIN : Vector Pairwise Minimum
3688 def VPMINs8 : N3VDInt<0, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3689 "s8", v8i8, v8i8, int_arm_neon_vpmins, 0>;
3690 def VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3691 "s16", v4i16, v4i16, int_arm_neon_vpmins, 0>;
3692 def VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3693 "s32", v2i32, v2i32, int_arm_neon_vpmins, 0>;
3694 def VPMINu8 : N3VDInt<1, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3695 "u8", v8i8, v8i8, int_arm_neon_vpminu, 0>;
3696 def VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3697 "u16", v4i16, v4i16, int_arm_neon_vpminu, 0>;
3698 def VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3699 "u32", v2i32, v2i32, int_arm_neon_vpminu, 0>;
3700 def VPMINf : N3VDInt<1, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmin",
3701 "f32", v2f32, v2f32, int_arm_neon_vpmins, 0>;
3703 // Vector Reciprocal and Reciprocal Square Root Estimate and Step.
3705 // VRECPE : Vector Reciprocal Estimate
3706 def VRECPEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
3707 IIC_VUNAD, "vrecpe", "u32",
3708 v2i32, v2i32, int_arm_neon_vrecpe>;
3709 def VRECPEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
3710 IIC_VUNAQ, "vrecpe", "u32",
3711 v4i32, v4i32, int_arm_neon_vrecpe>;
3712 def VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
3713 IIC_VUNAD, "vrecpe", "f32",
3714 v2f32, v2f32, int_arm_neon_vrecpe>;
3715 def VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
3716 IIC_VUNAQ, "vrecpe", "f32",
3717 v4f32, v4f32, int_arm_neon_vrecpe>;
3719 // VRECPS : Vector Reciprocal Step
3720 def VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
3721 IIC_VRECSD, "vrecps", "f32",
3722 v2f32, v2f32, int_arm_neon_vrecps, 1>;
3723 def VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
3724 IIC_VRECSQ, "vrecps", "f32",
3725 v4f32, v4f32, int_arm_neon_vrecps, 1>;
3727 // VRSQRTE : Vector Reciprocal Square Root Estimate
3728 def VRSQRTEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
3729 IIC_VUNAD, "vrsqrte", "u32",
3730 v2i32, v2i32, int_arm_neon_vrsqrte>;
3731 def VRSQRTEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
3732 IIC_VUNAQ, "vrsqrte", "u32",
3733 v4i32, v4i32, int_arm_neon_vrsqrte>;
3734 def VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
3735 IIC_VUNAD, "vrsqrte", "f32",
3736 v2f32, v2f32, int_arm_neon_vrsqrte>;
3737 def VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
3738 IIC_VUNAQ, "vrsqrte", "f32",
3739 v4f32, v4f32, int_arm_neon_vrsqrte>;
3741 // VRSQRTS : Vector Reciprocal Square Root Step
3742 def VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
3743 IIC_VRECSD, "vrsqrts", "f32",
3744 v2f32, v2f32, int_arm_neon_vrsqrts, 1>;
3745 def VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
3746 IIC_VRECSQ, "vrsqrts", "f32",
3747 v4f32, v4f32, int_arm_neon_vrsqrts, 1>;
3751 // VSHL : Vector Shift
3752 defm VSHLs : N3VInt_QHSDSh<0, 0, 0b0100, 0, N3RegVShFrm,
3753 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
3754 "vshl", "s", int_arm_neon_vshifts>;
3755 defm VSHLu : N3VInt_QHSDSh<1, 0, 0b0100, 0, N3RegVShFrm,
3756 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
3757 "vshl", "u", int_arm_neon_vshiftu>;
3758 // VSHL : Vector Shift Left (Immediate)
3759 defm VSHLi : N2VSh_QHSD<0, 1, 0b0101, 1, IIC_VSHLiD, "vshl", "i", NEONvshl,
3761 // VSHR : Vector Shift Right (Immediate)
3762 defm VSHRs : N2VSh_QHSD<0, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "s", NEONvshrs,
3764 defm VSHRu : N2VSh_QHSD<1, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "u", NEONvshru,
3767 // VSHLL : Vector Shift Left Long
3768 defm VSHLLs : N2VLSh_QHS<0, 1, 0b1010, 0, 0, 1, "vshll", "s", NEONvshlls>;
3769 defm VSHLLu : N2VLSh_QHS<1, 1, 0b1010, 0, 0, 1, "vshll", "u", NEONvshllu>;
3771 // VSHLL : Vector Shift Left Long (with maximum shift count)
3772 class N2VLShMax<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
3773 bit op6, bit op4, string OpcodeStr, string Dt, ValueType ResTy,
3774 ValueType OpTy, SDNode OpNode>
3775 : N2VLSh<op24, op23, op11_8, op7, op6, op4, OpcodeStr, Dt,
3776 ResTy, OpTy, OpNode> {
3777 let Inst{21-16} = op21_16;
3779 def VSHLLi8 : N2VLShMax<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll", "i8",
3780 v8i16, v8i8, NEONvshlli>;
3781 def VSHLLi16 : N2VLShMax<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll", "i16",
3782 v4i32, v4i16, NEONvshlli>;
3783 def VSHLLi32 : N2VLShMax<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll", "i32",
3784 v2i64, v2i32, NEONvshlli>;
3786 // VSHRN : Vector Shift Right and Narrow
3787 defm VSHRN : N2VNSh_HSD<0,1,0b1000,0,0,1, IIC_VSHLiD, "vshrn", "i",
3790 // VRSHL : Vector Rounding Shift
3791 defm VRSHLs : N3VInt_QHSDSh<0, 0, 0b0101, 0, N3RegVShFrm,
3792 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
3793 "vrshl", "s", int_arm_neon_vrshifts>;
3794 defm VRSHLu : N3VInt_QHSDSh<1, 0, 0b0101, 0, N3RegVShFrm,
3795 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
3796 "vrshl", "u", int_arm_neon_vrshiftu>;
3797 // VRSHR : Vector Rounding Shift Right
3798 defm VRSHRs : N2VSh_QHSD<0,1,0b0010,1, IIC_VSHLi4D, "vrshr", "s", NEONvrshrs,
3800 defm VRSHRu : N2VSh_QHSD<1,1,0b0010,1, IIC_VSHLi4D, "vrshr", "u", NEONvrshru,
3803 // VRSHRN : Vector Rounding Shift Right and Narrow
3804 defm VRSHRN : N2VNSh_HSD<0, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vrshrn", "i",
3807 // VQSHL : Vector Saturating Shift
3808 defm VQSHLs : N3VInt_QHSDSh<0, 0, 0b0100, 1, N3RegVShFrm,
3809 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
3810 "vqshl", "s", int_arm_neon_vqshifts>;
3811 defm VQSHLu : N3VInt_QHSDSh<1, 0, 0b0100, 1, N3RegVShFrm,
3812 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
3813 "vqshl", "u", int_arm_neon_vqshiftu>;
3814 // VQSHL : Vector Saturating Shift Left (Immediate)
3815 defm VQSHLsi : N2VSh_QHSD<0,1,0b0111,1, IIC_VSHLi4D, "vqshl", "s",NEONvqshls,
3817 defm VQSHLui : N2VSh_QHSD<1,1,0b0111,1, IIC_VSHLi4D, "vqshl", "u",NEONvqshlu,
3819 // VQSHLU : Vector Saturating Shift Left (Immediate, Unsigned)
3820 defm VQSHLsu : N2VSh_QHSD<1,1,0b0110,1, IIC_VSHLi4D,"vqshlu","s",NEONvqshlsu,
3823 // VQSHRN : Vector Saturating Shift Right and Narrow
3824 defm VQSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "s",
3826 defm VQSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "u",
3829 // VQSHRUN : Vector Saturating Shift Right and Narrow (Unsigned)
3830 defm VQSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 0, 1, IIC_VSHLi4D, "vqshrun", "s",
3833 // VQRSHL : Vector Saturating Rounding Shift
3834 defm VQRSHLs : N3VInt_QHSDSh<0, 0, 0b0101, 1, N3RegVShFrm,
3835 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
3836 "vqrshl", "s", int_arm_neon_vqrshifts>;
3837 defm VQRSHLu : N3VInt_QHSDSh<1, 0, 0b0101, 1, N3RegVShFrm,
3838 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
3839 "vqrshl", "u", int_arm_neon_vqrshiftu>;
3841 // VQRSHRN : Vector Saturating Rounding Shift Right and Narrow
3842 defm VQRSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "s",
3844 defm VQRSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "u",
3847 // VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned)
3848 defm VQRSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vqrshrun", "s",
3851 // VSRA : Vector Shift Right and Accumulate
3852 defm VSRAs : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra", "s", NEONvshrs>;
3853 defm VSRAu : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra", "u", NEONvshru>;
3854 // VRSRA : Vector Rounding Shift Right and Accumulate
3855 defm VRSRAs : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra", "s", NEONvrshrs>;
3856 defm VRSRAu : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra", "u", NEONvrshru>;
3858 // VSLI : Vector Shift Left and Insert
3859 defm VSLI : N2VShIns_QHSD<1, 1, 0b0101, 1, "vsli", NEONvsli, N2RegVShLFrm>;
3860 // VSRI : Vector Shift Right and Insert
3861 defm VSRI : N2VShIns_QHSD<1, 1, 0b0100, 1, "vsri", NEONvsri, N2RegVShRFrm>;
3863 // Vector Absolute and Saturating Absolute.
3865 // VABS : Vector Absolute Value
3866 defm VABS : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0,
3867 IIC_VUNAiD, IIC_VUNAiQ, "vabs", "s",
3869 def VABSfd : N2VDInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
3870 IIC_VUNAD, "vabs", "f32",
3871 v2f32, v2f32, int_arm_neon_vabs>;
3872 def VABSfq : N2VQInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
3873 IIC_VUNAQ, "vabs", "f32",
3874 v4f32, v4f32, int_arm_neon_vabs>;
3876 // VQABS : Vector Saturating Absolute Value
3877 defm VQABS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0,
3878 IIC_VQUNAiD, IIC_VQUNAiQ, "vqabs", "s",
3879 int_arm_neon_vqabs>;
3883 def vnegd : PatFrag<(ops node:$in),
3884 (sub (bitconvert (v2i32 NEONimmAllZerosV)), node:$in)>;
3885 def vnegq : PatFrag<(ops node:$in),
3886 (sub (bitconvert (v4i32 NEONimmAllZerosV)), node:$in)>;
3888 class VNEGD<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
3889 : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$dst), (ins DPR:$src),
3890 IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
3891 [(set DPR:$dst, (Ty (vnegd DPR:$src)))]>;
3892 class VNEGQ<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
3893 : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$dst), (ins QPR:$src),
3894 IIC_VSHLiQ, OpcodeStr, Dt, "$dst, $src", "",
3895 [(set QPR:$dst, (Ty (vnegq QPR:$src)))]>;
3897 // VNEG : Vector Negate (integer)
3898 def VNEGs8d : VNEGD<0b00, "vneg", "s8", v8i8>;
3899 def VNEGs16d : VNEGD<0b01, "vneg", "s16", v4i16>;
3900 def VNEGs32d : VNEGD<0b10, "vneg", "s32", v2i32>;
3901 def VNEGs8q : VNEGQ<0b00, "vneg", "s8", v16i8>;
3902 def VNEGs16q : VNEGQ<0b01, "vneg", "s16", v8i16>;
3903 def VNEGs32q : VNEGQ<0b10, "vneg", "s32", v4i32>;
3905 // VNEG : Vector Negate (floating-point)
3906 def VNEGfd : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
3907 (outs DPR:$dst), (ins DPR:$src), IIC_VUNAD,
3908 "vneg", "f32", "$dst, $src", "",
3909 [(set DPR:$dst, (v2f32 (fneg DPR:$src)))]>;
3910 def VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0,
3911 (outs QPR:$dst), (ins QPR:$src), IIC_VUNAQ,
3912 "vneg", "f32", "$dst, $src", "",
3913 [(set QPR:$dst, (v4f32 (fneg QPR:$src)))]>;
3915 def : Pat<(v8i8 (vnegd DPR:$src)), (VNEGs8d DPR:$src)>;
3916 def : Pat<(v4i16 (vnegd DPR:$src)), (VNEGs16d DPR:$src)>;
3917 def : Pat<(v2i32 (vnegd DPR:$src)), (VNEGs32d DPR:$src)>;
3918 def : Pat<(v16i8 (vnegq QPR:$src)), (VNEGs8q QPR:$src)>;
3919 def : Pat<(v8i16 (vnegq QPR:$src)), (VNEGs16q QPR:$src)>;
3920 def : Pat<(v4i32 (vnegq QPR:$src)), (VNEGs32q QPR:$src)>;
3922 // VQNEG : Vector Saturating Negate
3923 defm VQNEG : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0,
3924 IIC_VQUNAiD, IIC_VQUNAiQ, "vqneg", "s",
3925 int_arm_neon_vqneg>;
3927 // Vector Bit Counting Operations.
3929 // VCLS : Vector Count Leading Sign Bits
3930 defm VCLS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0,
3931 IIC_VCNTiD, IIC_VCNTiQ, "vcls", "s",
3933 // VCLZ : Vector Count Leading Zeros
3934 defm VCLZ : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0,
3935 IIC_VCNTiD, IIC_VCNTiQ, "vclz", "i",
3937 // VCNT : Vector Count One Bits
3938 def VCNTd : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
3939 IIC_VCNTiD, "vcnt", "8",
3940 v8i8, v8i8, int_arm_neon_vcnt>;
3941 def VCNTq : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
3942 IIC_VCNTiQ, "vcnt", "8",
3943 v16i8, v16i8, int_arm_neon_vcnt>;
3945 // Vector Swap -- for disassembly only.
3946 def VSWPd : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 0, 0,
3947 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
3948 "vswp", "$dst, $src", "", []>;
3949 def VSWPq : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 1, 0,
3950 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
3951 "vswp", "$dst, $src", "", []>;
3953 // Vector Move Operations.
3955 // VMOV : Vector Move (Register)
3957 let neverHasSideEffects = 1 in {
3958 def VMOVDneon: N3VX<0, 0, 0b10, 0b0001, 0, 1, (outs DPR:$Vd), (ins DPR:$Vm),
3959 N3RegFrm, IIC_VMOV, "vmov", "$Vd, $Vm", "", []> {
3960 let Vn{4-0} = Vm{4-0};
3962 def VMOVQ : N3VX<0, 0, 0b10, 0b0001, 1, 1, (outs QPR:$Vd), (ins QPR:$Vm),
3963 N3RegFrm, IIC_VMOV, "vmov", "$Vd, $Vm", "", []> {
3964 let Vn{4-0} = Vm{4-0};
3967 // Pseudo vector move instructions for QQ and QQQQ registers. This should
3968 // be expanded after register allocation is completed.
3969 def VMOVQQ : PseudoInst<(outs QQPR:$dst), (ins QQPR:$src),
3972 def VMOVQQQQ : PseudoInst<(outs QQQQPR:$dst), (ins QQQQPR:$src),
3974 } // neverHasSideEffects
3976 // VMOV : Vector Move (Immediate)
3978 let isReMaterializable = 1 in {
3979 def VMOVv8i8 : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$dst),
3980 (ins nModImm:$SIMM), IIC_VMOVImm,
3981 "vmov", "i8", "$dst, $SIMM", "",
3982 [(set DPR:$dst, (v8i8 (NEONvmovImm timm:$SIMM)))]>;
3983 def VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$dst),
3984 (ins nModImm:$SIMM), IIC_VMOVImm,
3985 "vmov", "i8", "$dst, $SIMM", "",
3986 [(set QPR:$dst, (v16i8 (NEONvmovImm timm:$SIMM)))]>;
3988 def VMOVv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 0, 1, (outs DPR:$dst),
3989 (ins nModImm:$SIMM), IIC_VMOVImm,
3990 "vmov", "i16", "$dst, $SIMM", "",
3991 [(set DPR:$dst, (v4i16 (NEONvmovImm timm:$SIMM)))]> {
3992 let Inst{9} = SIMM{9};
3995 def VMOVv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 0, 1, (outs QPR:$dst),
3996 (ins nModImm:$SIMM), IIC_VMOVImm,
3997 "vmov", "i16", "$dst, $SIMM", "",
3998 [(set QPR:$dst, (v8i16 (NEONvmovImm timm:$SIMM)))]> {
3999 let Inst{9} = SIMM{9};
4002 def VMOVv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 0, 1, (outs DPR:$dst),
4003 (ins nModImm:$SIMM), IIC_VMOVImm,
4004 "vmov", "i32", "$dst, $SIMM", "",
4005 [(set DPR:$dst, (v2i32 (NEONvmovImm timm:$SIMM)))]> {
4006 let Inst{11-8} = SIMM{11-8};
4009 def VMOVv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 0, 1, (outs QPR:$dst),
4010 (ins nModImm:$SIMM), IIC_VMOVImm,
4011 "vmov", "i32", "$dst, $SIMM", "",
4012 [(set QPR:$dst, (v4i32 (NEONvmovImm timm:$SIMM)))]> {
4013 let Inst{11-8} = SIMM{11-8};
4016 def VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$dst),
4017 (ins nModImm:$SIMM), IIC_VMOVImm,
4018 "vmov", "i64", "$dst, $SIMM", "",
4019 [(set DPR:$dst, (v1i64 (NEONvmovImm timm:$SIMM)))]>;
4020 def VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$dst),
4021 (ins nModImm:$SIMM), IIC_VMOVImm,
4022 "vmov", "i64", "$dst, $SIMM", "",
4023 [(set QPR:$dst, (v2i64 (NEONvmovImm timm:$SIMM)))]>;
4024 } // isReMaterializable
4026 // VMOV : Vector Get Lane (move scalar to ARM core register)
4028 def VGETLNs8 : NVGetLane<{1,1,1,0,0,1,?,1}, 0b1011, {?,?},
4029 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4030 IIC_VMOVSI, "vmov", "s8", "$R, $V[$lane]",
4031 [(set GPR:$R, (NEONvgetlanes (v8i8 DPR:$V),
4033 let Inst{21} = lane{2};
4034 let Inst{6-5} = lane{1-0};
4036 def VGETLNs16 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, {?,1},
4037 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4038 IIC_VMOVSI, "vmov", "s16", "$R, $V[$lane]",
4039 [(set GPR:$R, (NEONvgetlanes (v4i16 DPR:$V),
4041 let Inst{21} = lane{1};
4042 let Inst{6} = lane{0};
4044 def VGETLNu8 : NVGetLane<{1,1,1,0,1,1,?,1}, 0b1011, {?,?},
4045 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4046 IIC_VMOVSI, "vmov", "u8", "$R, $V[$lane]",
4047 [(set GPR:$R, (NEONvgetlaneu (v8i8 DPR:$V),
4049 let Inst{21} = lane{2};
4050 let Inst{6-5} = lane{1-0};
4052 def VGETLNu16 : NVGetLane<{1,1,1,0,1,0,?,1}, 0b1011, {?,1},
4053 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4054 IIC_VMOVSI, "vmov", "u16", "$R, $V[$lane]",
4055 [(set GPR:$R, (NEONvgetlaneu (v4i16 DPR:$V),
4057 let Inst{21} = lane{1};
4058 let Inst{6} = lane{0};
4060 def VGETLNi32 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, 0b00,
4061 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
4062 IIC_VMOVSI, "vmov", "32", "$R, $V[$lane]",
4063 [(set GPR:$R, (extractelt (v2i32 DPR:$V),
4065 let Inst{21} = lane{0};
4067 // def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
4068 def : Pat<(NEONvgetlanes (v16i8 QPR:$src), imm:$lane),
4069 (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
4070 (DSubReg_i8_reg imm:$lane))),
4071 (SubReg_i8_lane imm:$lane))>;
4072 def : Pat<(NEONvgetlanes (v8i16 QPR:$src), imm:$lane),
4073 (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
4074 (DSubReg_i16_reg imm:$lane))),
4075 (SubReg_i16_lane imm:$lane))>;
4076 def : Pat<(NEONvgetlaneu (v16i8 QPR:$src), imm:$lane),
4077 (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
4078 (DSubReg_i8_reg imm:$lane))),
4079 (SubReg_i8_lane imm:$lane))>;
4080 def : Pat<(NEONvgetlaneu (v8i16 QPR:$src), imm:$lane),
4081 (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
4082 (DSubReg_i16_reg imm:$lane))),
4083 (SubReg_i16_lane imm:$lane))>;
4084 def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
4085 (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
4086 (DSubReg_i32_reg imm:$lane))),
4087 (SubReg_i32_lane imm:$lane))>;
4088 def : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2),
4089 (EXTRACT_SUBREG (v2f32 (COPY_TO_REGCLASS (v2f32 DPR:$src1),DPR_VFP2)),
4090 (SSubReg_f32_reg imm:$src2))>;
4091 def : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
4092 (EXTRACT_SUBREG (v4f32 (COPY_TO_REGCLASS (v4f32 QPR:$src1),QPR_VFP2)),
4093 (SSubReg_f32_reg imm:$src2))>;
4094 //def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
4095 // (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
4096 def : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
4097 (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
4100 // VMOV : Vector Set Lane (move ARM core register to scalar)
4102 let Constraints = "$src1 = $V" in {
4103 def VSETLNi8 : NVSetLane<{1,1,1,0,0,1,?,0}, 0b1011, {?,?}, (outs DPR:$V),
4104 (ins DPR:$src1, GPR:$R, nohash_imm:$lane),
4105 IIC_VMOVISL, "vmov", "8", "$V[$lane], $R",
4106 [(set DPR:$V, (vector_insert (v8i8 DPR:$src1),
4107 GPR:$R, imm:$lane))]> {
4108 let Inst{21} = lane{2};
4109 let Inst{6-5} = lane{1-0};
4111 def VSETLNi16 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, {?,1}, (outs DPR:$V),
4112 (ins DPR:$src1, GPR:$R, nohash_imm:$lane),
4113 IIC_VMOVISL, "vmov", "16", "$V[$lane], $R",
4114 [(set DPR:$V, (vector_insert (v4i16 DPR:$src1),
4115 GPR:$R, imm:$lane))]> {
4116 let Inst{21} = lane{1};
4117 let Inst{6} = lane{0};
4119 def VSETLNi32 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, 0b00, (outs DPR:$V),
4120 (ins DPR:$src1, GPR:$R, nohash_imm:$lane),
4121 IIC_VMOVISL, "vmov", "32", "$V[$lane], $R",
4122 [(set DPR:$V, (insertelt (v2i32 DPR:$src1),
4123 GPR:$R, imm:$lane))]> {
4124 let Inst{21} = lane{0};
4127 def : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
4128 (v16i8 (INSERT_SUBREG QPR:$src1,
4129 (v8i8 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
4130 (DSubReg_i8_reg imm:$lane))),
4131 GPR:$src2, (SubReg_i8_lane imm:$lane))),
4132 (DSubReg_i8_reg imm:$lane)))>;
4133 def : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
4134 (v8i16 (INSERT_SUBREG QPR:$src1,
4135 (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
4136 (DSubReg_i16_reg imm:$lane))),
4137 GPR:$src2, (SubReg_i16_lane imm:$lane))),
4138 (DSubReg_i16_reg imm:$lane)))>;
4139 def : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
4140 (v4i32 (INSERT_SUBREG QPR:$src1,
4141 (v2i32 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
4142 (DSubReg_i32_reg imm:$lane))),
4143 GPR:$src2, (SubReg_i32_lane imm:$lane))),
4144 (DSubReg_i32_reg imm:$lane)))>;
4146 def : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)),
4147 (INSERT_SUBREG (v2f32 (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2)),
4148 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
4149 def : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
4150 (INSERT_SUBREG (v4f32 (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2)),
4151 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
4153 //def : Pat<(v2i64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
4154 // (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
4155 def : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
4156 (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
4158 def : Pat<(v2f32 (scalar_to_vector SPR:$src)),
4159 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
4160 def : Pat<(v2f64 (scalar_to_vector (f64 DPR:$src))),
4161 (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
4162 def : Pat<(v4f32 (scalar_to_vector SPR:$src)),
4163 (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
4165 def : Pat<(v8i8 (scalar_to_vector GPR:$src)),
4166 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
4167 def : Pat<(v4i16 (scalar_to_vector GPR:$src)),
4168 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
4169 def : Pat<(v2i32 (scalar_to_vector GPR:$src)),
4170 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
4172 def : Pat<(v16i8 (scalar_to_vector GPR:$src)),
4173 (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)),
4174 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
4176 def : Pat<(v8i16 (scalar_to_vector GPR:$src)),
4177 (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)),
4178 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
4180 def : Pat<(v4i32 (scalar_to_vector GPR:$src)),
4181 (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
4182 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
4185 // VDUP : Vector Duplicate (from ARM core register to all elements)
4187 class VDUPD<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
4188 : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$dst), (ins GPR:$src),
4189 IIC_VMOVIS, "vdup", Dt, "$dst, $src",
4190 [(set DPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>;
4191 class VDUPQ<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
4192 : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$dst), (ins GPR:$src),
4193 IIC_VMOVIS, "vdup", Dt, "$dst, $src",
4194 [(set QPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>;
4196 def VDUP8d : VDUPD<0b11101100, 0b00, "8", v8i8>;
4197 def VDUP16d : VDUPD<0b11101000, 0b01, "16", v4i16>;
4198 def VDUP32d : VDUPD<0b11101000, 0b00, "32", v2i32>;
4199 def VDUP8q : VDUPQ<0b11101110, 0b00, "8", v16i8>;
4200 def VDUP16q : VDUPQ<0b11101010, 0b01, "16", v8i16>;
4201 def VDUP32q : VDUPQ<0b11101010, 0b00, "32", v4i32>;
4203 def VDUPfd : NVDup<0b11101000, 0b1011, 0b00, (outs DPR:$dst), (ins GPR:$src),
4204 IIC_VMOVIS, "vdup", "32", "$dst, $src",
4205 [(set DPR:$dst, (v2f32 (NEONvdup
4206 (f32 (bitconvert GPR:$src)))))]>;
4207 def VDUPfq : NVDup<0b11101010, 0b1011, 0b00, (outs QPR:$dst), (ins GPR:$src),
4208 IIC_VMOVIS, "vdup", "32", "$dst, $src",
4209 [(set QPR:$dst, (v4f32 (NEONvdup
4210 (f32 (bitconvert GPR:$src)))))]>;
4212 // VDUP : Vector Duplicate Lane (from scalar to all elements)
4214 class VDUPLND<bits<4> op19_16, string OpcodeStr, string Dt,
4216 : NVDupLane<op19_16, 0, (outs DPR:$dst), (ins DPR:$src, nohash_imm:$lane),
4217 IIC_VMOVD, OpcodeStr, Dt, "$dst, $src[$lane]",
4218 [(set DPR:$dst, (Ty (NEONvduplane (Ty DPR:$src), imm:$lane)))]>;
4220 class VDUPLNQ<bits<4> op19_16, string OpcodeStr, string Dt,
4221 ValueType ResTy, ValueType OpTy>
4222 : NVDupLane<op19_16, 1, (outs QPR:$dst), (ins DPR:$src, nohash_imm:$lane),
4223 IIC_VMOVQ, OpcodeStr, Dt, "$dst, $src[$lane]",
4224 [(set QPR:$dst, (ResTy (NEONvduplane (OpTy DPR:$src),
4227 // Inst{19-16} is partially specified depending on the element size.
4229 def VDUPLN8d : VDUPLND<{?,?,?,1}, "vdup", "8", v8i8> {
4230 let Inst{19-17} = lane{2-0};
4232 def VDUPLN16d : VDUPLND<{?,?,1,0}, "vdup", "16", v4i16> {
4233 let Inst{19-18} = lane{1-0};
4235 def VDUPLN32d : VDUPLND<{?,1,0,0}, "vdup", "32", v2i32> {
4236 let Inst{19} = lane{0};
4238 def VDUPLNfd : VDUPLND<{?,1,0,0}, "vdup", "32", v2f32> {
4239 let Inst{19} = lane{0};
4241 def VDUPLN8q : VDUPLNQ<{?,?,?,1}, "vdup", "8", v16i8, v8i8> {
4242 let Inst{19-17} = lane{2-0};
4244 def VDUPLN16q : VDUPLNQ<{?,?,1,0}, "vdup", "16", v8i16, v4i16> {
4245 let Inst{19-18} = lane{1-0};
4247 def VDUPLN32q : VDUPLNQ<{?,1,0,0}, "vdup", "32", v4i32, v2i32> {
4248 let Inst{19} = lane{0};
4250 def VDUPLNfq : VDUPLNQ<{?,1,0,0}, "vdup", "32", v4f32, v2f32> {
4251 let Inst{19} = lane{0};
4254 def : Pat<(v16i8 (NEONvduplane (v16i8 QPR:$src), imm:$lane)),
4255 (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src,
4256 (DSubReg_i8_reg imm:$lane))),
4257 (SubReg_i8_lane imm:$lane)))>;
4258 def : Pat<(v8i16 (NEONvduplane (v8i16 QPR:$src), imm:$lane)),
4259 (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src,
4260 (DSubReg_i16_reg imm:$lane))),
4261 (SubReg_i16_lane imm:$lane)))>;
4262 def : Pat<(v4i32 (NEONvduplane (v4i32 QPR:$src), imm:$lane)),
4263 (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src,
4264 (DSubReg_i32_reg imm:$lane))),
4265 (SubReg_i32_lane imm:$lane)))>;
4266 def : Pat<(v4f32 (NEONvduplane (v4f32 QPR:$src), imm:$lane)),
4267 (v4f32 (VDUPLNfq (v2f32 (EXTRACT_SUBREG QPR:$src,
4268 (DSubReg_i32_reg imm:$lane))),
4269 (SubReg_i32_lane imm:$lane)))>;
4271 def VDUPfdf : PseudoNeonI<(outs DPR:$dst), (ins SPR:$src), IIC_VMOVD, "",
4272 [(set DPR:$dst, (v2f32 (NEONvdup (f32 SPR:$src))))]>;
4273 def VDUPfqf : PseudoNeonI<(outs QPR:$dst), (ins SPR:$src), IIC_VMOVD, "",
4274 [(set QPR:$dst, (v4f32 (NEONvdup (f32 SPR:$src))))]>;
4276 // VMOVN : Vector Narrowing Move
4277 defm VMOVN : N2VN_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVN,
4278 "vmovn", "i", trunc>;
4279 // VQMOVN : Vector Saturating Narrowing Move
4280 defm VQMOVNs : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD,
4281 "vqmovn", "s", int_arm_neon_vqmovns>;
4282 defm VQMOVNu : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD,
4283 "vqmovn", "u", int_arm_neon_vqmovnu>;
4284 defm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD,
4285 "vqmovun", "s", int_arm_neon_vqmovnsu>;
4286 // VMOVL : Vector Lengthening Move
4287 defm VMOVLs : N2VL_QHS<0b01,0b10100,0,1, "vmovl", "s", sext>;
4288 defm VMOVLu : N2VL_QHS<0b11,0b10100,0,1, "vmovl", "u", zext>;
4290 // Vector Conversions.
4292 // VCVT : Vector Convert Between Floating-Point and Integers
4293 def VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
4294 v2i32, v2f32, fp_to_sint>;
4295 def VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
4296 v2i32, v2f32, fp_to_uint>;
4297 def VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
4298 v2f32, v2i32, sint_to_fp>;
4299 def VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
4300 v2f32, v2i32, uint_to_fp>;
4302 def VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
4303 v4i32, v4f32, fp_to_sint>;
4304 def VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
4305 v4i32, v4f32, fp_to_uint>;
4306 def VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
4307 v4f32, v4i32, sint_to_fp>;
4308 def VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
4309 v4f32, v4i32, uint_to_fp>;
4311 // VCVT : Vector Convert Between Floating-Point and Fixed-Point.
4312 def VCVTf2xsd : N2VCvtD<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
4313 v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
4314 def VCVTf2xud : N2VCvtD<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
4315 v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
4316 def VCVTxs2fd : N2VCvtD<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
4317 v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
4318 def VCVTxu2fd : N2VCvtD<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
4319 v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
4321 def VCVTf2xsq : N2VCvtQ<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
4322 v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
4323 def VCVTf2xuq : N2VCvtQ<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
4324 v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
4325 def VCVTxs2fq : N2VCvtQ<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
4326 v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
4327 def VCVTxu2fq : N2VCvtQ<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
4328 v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
4332 // VREV64 : Vector Reverse elements within 64-bit doublewords
4334 class VREV64D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4335 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$Vd),
4336 (ins DPR:$Vm), IIC_VMOVD,
4337 OpcodeStr, Dt, "$Vd, $Vm", "",
4338 [(set DPR:$Vd, (Ty (NEONvrev64 (Ty DPR:$Vm))))]>;
4339 class VREV64Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4340 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$Vd),
4341 (ins QPR:$Vm), IIC_VMOVQ,
4342 OpcodeStr, Dt, "$Vd, $Vm", "",
4343 [(set QPR:$Vd, (Ty (NEONvrev64 (Ty QPR:$Vm))))]>;
4345 def VREV64d8 : VREV64D<0b00, "vrev64", "8", v8i8>;
4346 def VREV64d16 : VREV64D<0b01, "vrev64", "16", v4i16>;
4347 def VREV64d32 : VREV64D<0b10, "vrev64", "32", v2i32>;
4348 def VREV64df : VREV64D<0b10, "vrev64", "32", v2f32>;
4350 def VREV64q8 : VREV64Q<0b00, "vrev64", "8", v16i8>;
4351 def VREV64q16 : VREV64Q<0b01, "vrev64", "16", v8i16>;
4352 def VREV64q32 : VREV64Q<0b10, "vrev64", "32", v4i32>;
4353 def VREV64qf : VREV64Q<0b10, "vrev64", "32", v4f32>;
4355 // VREV32 : Vector Reverse elements within 32-bit words
4357 class VREV32D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4358 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$Vd),
4359 (ins DPR:$Vm), IIC_VMOVD,
4360 OpcodeStr, Dt, "$Vd, $Vm", "",
4361 [(set DPR:$Vd, (Ty (NEONvrev32 (Ty DPR:$Vm))))]>;
4362 class VREV32Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4363 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$Vd),
4364 (ins QPR:$Vm), IIC_VMOVQ,
4365 OpcodeStr, Dt, "$Vd, $Vm", "",
4366 [(set QPR:$Vd, (Ty (NEONvrev32 (Ty QPR:$Vm))))]>;
4368 def VREV32d8 : VREV32D<0b00, "vrev32", "8", v8i8>;
4369 def VREV32d16 : VREV32D<0b01, "vrev32", "16", v4i16>;
4371 def VREV32q8 : VREV32Q<0b00, "vrev32", "8", v16i8>;
4372 def VREV32q16 : VREV32Q<0b01, "vrev32", "16", v8i16>;
4374 // VREV16 : Vector Reverse elements within 16-bit halfwords
4376 class VREV16D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4377 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$Vd),
4378 (ins DPR:$Vm), IIC_VMOVD,
4379 OpcodeStr, Dt, "$Vd, $Vm", "",
4380 [(set DPR:$Vd, (Ty (NEONvrev16 (Ty DPR:$Vm))))]>;
4381 class VREV16Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4382 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$Vd),
4383 (ins QPR:$Vm), IIC_VMOVQ,
4384 OpcodeStr, Dt, "$Vd, $Vm", "",
4385 [(set QPR:$Vd, (Ty (NEONvrev16 (Ty QPR:$Vm))))]>;
4387 def VREV16d8 : VREV16D<0b00, "vrev16", "8", v8i8>;
4388 def VREV16q8 : VREV16Q<0b00, "vrev16", "8", v16i8>;
4390 // Other Vector Shuffles.
4392 // VEXT : Vector Extract
4394 class VEXTd<string OpcodeStr, string Dt, ValueType Ty>
4395 : N3V<0,1,0b11,{?,?,?,?},0,0, (outs DPR:$Vd),
4396 (ins DPR:$Vn, DPR:$Vm, i32imm:$index), NVExtFrm,
4397 IIC_VEXTD, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
4398 [(set DPR:$Vd, (Ty (NEONvext (Ty DPR:$Vn),
4399 (Ty DPR:$Vm), imm:$index)))]> {
4401 let Inst{11-8} = index{3-0};
4404 class VEXTq<string OpcodeStr, string Dt, ValueType Ty>
4405 : N3V<0,1,0b11,{?,?,?,?},1,0, (outs QPR:$Vd),
4406 (ins QPR:$Vn, QPR:$Vm, i32imm:$index), NVExtFrm,
4407 IIC_VEXTQ, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
4408 [(set QPR:$Vd, (Ty (NEONvext (Ty QPR:$Vn),
4409 (Ty QPR:$Vm), imm:$index)))]> {
4411 let Inst{11-8} = index{3-0};
4414 def VEXTd8 : VEXTd<"vext", "8", v8i8> {
4415 let Inst{11-8} = index{3-0};
4417 def VEXTd16 : VEXTd<"vext", "16", v4i16> {
4418 let Inst{11-9} = index{2-0};
4421 def VEXTd32 : VEXTd<"vext", "32", v2i32> {
4422 let Inst{11-10} = index{1-0};
4423 let Inst{9-8} = 0b00;
4425 def VEXTdf : VEXTd<"vext", "32", v2f32> {
4426 let Inst{11} = index{0};
4427 let Inst{10-8} = 0b000;
4430 def VEXTq8 : VEXTq<"vext", "8", v16i8> {
4431 let Inst{11-8} = index{3-0};
4433 def VEXTq16 : VEXTq<"vext", "16", v8i16> {
4434 let Inst{11-9} = index{2-0};
4437 def VEXTq32 : VEXTq<"vext", "32", v4i32> {
4438 let Inst{11-10} = index{1-0};
4439 let Inst{9-8} = 0b00;
4441 def VEXTqf : VEXTq<"vext", "32", v4f32> {
4442 let Inst{11} = index{0};
4443 let Inst{10-8} = 0b000;
4446 // VTRN : Vector Transpose
4448 def VTRNd8 : N2VDShuffle<0b00, 0b00001, "vtrn", "8">;
4449 def VTRNd16 : N2VDShuffle<0b01, 0b00001, "vtrn", "16">;
4450 def VTRNd32 : N2VDShuffle<0b10, 0b00001, "vtrn", "32">;
4452 def VTRNq8 : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn", "8">;
4453 def VTRNq16 : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn", "16">;
4454 def VTRNq32 : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn", "32">;
4456 // VUZP : Vector Unzip (Deinterleave)
4458 def VUZPd8 : N2VDShuffle<0b00, 0b00010, "vuzp", "8">;
4459 def VUZPd16 : N2VDShuffle<0b01, 0b00010, "vuzp", "16">;
4460 def VUZPd32 : N2VDShuffle<0b10, 0b00010, "vuzp", "32">;
4462 def VUZPq8 : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp", "8">;
4463 def VUZPq16 : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp", "16">;
4464 def VUZPq32 : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp", "32">;
4466 // VZIP : Vector Zip (Interleave)
4468 def VZIPd8 : N2VDShuffle<0b00, 0b00011, "vzip", "8">;
4469 def VZIPd16 : N2VDShuffle<0b01, 0b00011, "vzip", "16">;
4470 def VZIPd32 : N2VDShuffle<0b10, 0b00011, "vzip", "32">;
4472 def VZIPq8 : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip", "8">;
4473 def VZIPq16 : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip", "16">;
4474 def VZIPq32 : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip", "32">;
4476 // Vector Table Lookup and Table Extension.
4478 // VTBL : Vector Table Lookup
4480 : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$Vd),
4481 (ins DPR:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB1,
4482 "vtbl", "8", "$Vd, \\{$Vn\\}, $Vm", "",
4483 [(set DPR:$Vd, (v8i8 (int_arm_neon_vtbl1 DPR:$Vn, DPR:$Vm)))]>;
4484 let hasExtraSrcRegAllocReq = 1 in {
4486 : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$Vd),
4487 (ins DPR:$Vn, DPR:$tbl2, DPR:$Vm), NVTBLFrm, IIC_VTB2,
4488 "vtbl", "8", "$Vd, \\{$Vn, $tbl2\\}, $Vm", "", []>;
4490 : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$Vd),
4491 (ins DPR:$Vn, DPR:$tbl2, DPR:$tbl3, DPR:$Vm), NVTBLFrm, IIC_VTB3,
4492 "vtbl", "8", "$Vd, \\{$Vn, $tbl2, $tbl3\\}, $Vm", "", []>;
4494 : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$Vd),
4495 (ins DPR:$Vn, DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$Vm),
4497 "vtbl", "8", "$Vd, \\{$Vn, $tbl2, $tbl3, $tbl4\\}, $Vm", "", []>;
4498 } // hasExtraSrcRegAllocReq = 1
4501 : PseudoNeonI<(outs DPR:$dst), (ins QPR:$tbl, DPR:$src), IIC_VTB2, "", []>;
4503 : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB3, "", []>;
4505 : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB4, "", []>;
4507 // VTBX : Vector Table Extension
4509 : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$Vd),
4510 (ins DPR:$orig, DPR:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX1,
4511 "vtbx", "8", "$Vd, \\{$Vn\\}, $Vm", "$orig = $Vd",
4512 [(set DPR:$Vd, (v8i8 (int_arm_neon_vtbx1
4513 DPR:$orig, DPR:$Vn, DPR:$Vm)))]>;
4514 let hasExtraSrcRegAllocReq = 1 in {
4516 : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$Vd),
4517 (ins DPR:$orig, DPR:$Vn, DPR:$tbl2, DPR:$Vm), NVTBLFrm, IIC_VTBX2,
4518 "vtbx", "8", "$Vd, \\{$Vn, $tbl2\\}, $Vm", "$orig = $Vd", []>;
4520 : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$Vd),
4521 (ins DPR:$orig, DPR:$Vn, DPR:$tbl2, DPR:$tbl3, DPR:$Vm),
4522 NVTBLFrm, IIC_VTBX3,
4523 "vtbx", "8", "$Vd, \\{$Vn, $tbl2, $tbl3\\}, $Vm",
4526 : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$Vd), (ins DPR:$orig, DPR:$Vn,
4527 DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$Vm), NVTBLFrm, IIC_VTBX4,
4528 "vtbx", "8", "$Vd, \\{$Vn, $tbl2, $tbl3, $tbl4\\}, $Vm",
4530 } // hasExtraSrcRegAllocReq = 1
4533 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QPR:$tbl, DPR:$src),
4534 IIC_VTBX2, "$orig = $dst", []>;
4536 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
4537 IIC_VTBX3, "$orig = $dst", []>;
4539 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
4540 IIC_VTBX4, "$orig = $dst", []>;
4542 //===----------------------------------------------------------------------===//
4543 // NEON instructions for single-precision FP math
4544 //===----------------------------------------------------------------------===//
4546 class N2VSPat<SDNode OpNode, ValueType ResTy, ValueType OpTy, NeonI Inst>
4547 : NEONFPPat<(ResTy (OpNode SPR:$a)),
4548 (EXTRACT_SUBREG (OpTy (Inst (INSERT_SUBREG (OpTy (IMPLICIT_DEF)),
4552 class N3VSPat<SDNode OpNode, NeonI Inst>
4553 : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
4554 (EXTRACT_SUBREG (v2f32
4555 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
4557 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
4561 class N3VSMulOpPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
4562 : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
4563 (EXTRACT_SUBREG (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
4565 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
4567 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
4571 // These need separate instructions because they must use DPR_VFP2 register
4572 // class which have SPR sub-registers.
4574 // Vector Add Operations used for single-precision FP
4575 let neverHasSideEffects = 1 in
4576 def VADDfd_sfp : N3VS<0,0,0b00,0b1101,0, "vadd", "f32", v2f32, v2f32, fadd, 1>;
4577 def : N3VSPat<fadd, VADDfd_sfp>;
4579 // Vector Sub Operations used for single-precision FP
4580 let neverHasSideEffects = 1 in
4581 def VSUBfd_sfp : N3VS<0,0,0b10,0b1101,0, "vsub", "f32", v2f32, v2f32, fsub, 0>;
4582 def : N3VSPat<fsub, VSUBfd_sfp>;
4584 // Vector Multiply Operations used for single-precision FP
4585 let neverHasSideEffects = 1 in
4586 def VMULfd_sfp : N3VS<1,0,0b00,0b1101,1, "vmul", "f32", v2f32, v2f32, fmul, 1>;
4587 def : N3VSPat<fmul, VMULfd_sfp>;
4589 // Vector Multiply-Accumulate/Subtract used for single-precision FP
4590 // vml[as].f32 can cause 4-8 cycle stalls in following ASIMD instructions, so
4591 // we want to avoid them for now. e.g., alternating vmla/vadd instructions.
4593 //let neverHasSideEffects = 1 in
4594 //def VMLAfd_sfp : N3VSMulOp<0,0,0b00,0b1101,1, IIC_VMACD, "vmla", "f32",
4595 // v2f32, fmul, fadd>;
4596 //def : N3VSMulOpPat<fmul, fadd, VMLAfd_sfp>;
4598 //let neverHasSideEffects = 1 in
4599 //def VMLSfd_sfp : N3VSMulOp<0,0,0b10,0b1101,1, IIC_VMACD, "vmls", "f32",
4600 // v2f32, fmul, fsub>;
4601 //def : N3VSMulOpPat<fmul, fsub, VMLSfd_sfp>;
4603 // Vector Absolute used for single-precision FP
4604 let neverHasSideEffects = 1 in
4605 def VABSfd_sfp : N2V<0b11, 0b11, 0b10, 0b01, 0b01110, 0, 0,
4606 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), IIC_VUNAD,
4607 "vabs", "f32", "$dst, $src", "", []>;
4608 def : N2VSPat<fabs, f32, v2f32, VABSfd_sfp>;
4610 // Vector Negate used for single-precision FP
4611 let neverHasSideEffects = 1 in
4612 def VNEGfd_sfp : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
4613 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), IIC_VUNAD,
4614 "vneg", "f32", "$dst, $src", "", []>;
4615 def : N2VSPat<fneg, f32, v2f32, VNEGfd_sfp>;
4617 // Vector Maximum used for single-precision FP
4618 let neverHasSideEffects = 1 in
4619 def VMAXfd_sfp : N3V<0, 0, 0b00, 0b1111, 0, 0, (outs DPR_VFP2:$dst),
4620 (ins DPR_VFP2:$src1, DPR_VFP2:$src2), N3RegFrm, IIC_VBIND,
4621 "vmax", "f32", "$dst, $src1, $src2", "", []>;
4622 def : N3VSPat<NEONfmax, VMAXfd_sfp>;
4624 // Vector Minimum used for single-precision FP
4625 let neverHasSideEffects = 1 in
4626 def VMINfd_sfp : N3V<0, 0, 0b00, 0b1111, 0, 0, (outs DPR_VFP2:$dst),
4627 (ins DPR_VFP2:$src1, DPR_VFP2:$src2), N3RegFrm, IIC_VBIND,
4628 "vmin", "f32", "$dst, $src1, $src2", "", []>;
4629 def : N3VSPat<NEONfmin, VMINfd_sfp>;
4631 // Vector Convert between single-precision FP and integer
4632 let neverHasSideEffects = 1 in
4633 def VCVTf2sd_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
4634 v2i32, v2f32, fp_to_sint>;
4635 def : N2VSPat<arm_ftosi, f32, v2f32, VCVTf2sd_sfp>;
4637 let neverHasSideEffects = 1 in
4638 def VCVTf2ud_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
4639 v2i32, v2f32, fp_to_uint>;
4640 def : N2VSPat<arm_ftoui, f32, v2f32, VCVTf2ud_sfp>;
4642 let neverHasSideEffects = 1 in
4643 def VCVTs2fd_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
4644 v2f32, v2i32, sint_to_fp>;
4645 def : N2VSPat<arm_sitof, f32, v2i32, VCVTs2fd_sfp>;
4647 let neverHasSideEffects = 1 in
4648 def VCVTu2fd_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
4649 v2f32, v2i32, uint_to_fp>;
4650 def : N2VSPat<arm_uitof, f32, v2i32, VCVTu2fd_sfp>;
4652 //===----------------------------------------------------------------------===//
4653 // Non-Instruction Patterns
4654 //===----------------------------------------------------------------------===//
4657 def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
4658 def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
4659 def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (v1i64 DPR:$src)>;
4660 def : Pat<(v1i64 (bitconvert (f64 DPR:$src))), (v1i64 DPR:$src)>;
4661 def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
4662 def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
4663 def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
4664 def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (v2i32 DPR:$src)>;
4665 def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (v2i32 DPR:$src)>;
4666 def : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
4667 def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
4668 def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
4669 def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (v4i16 DPR:$src)>;
4670 def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (v4i16 DPR:$src)>;
4671 def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
4672 def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (v8i8 DPR:$src)>;
4673 def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (v8i8 DPR:$src)>;
4674 def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (v8i8 DPR:$src)>;
4675 def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (v8i8 DPR:$src)>;
4676 def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (v8i8 DPR:$src)>;
4677 def : Pat<(f64 (bitconvert (v1i64 DPR:$src))), (f64 DPR:$src)>;
4678 def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (f64 DPR:$src)>;
4679 def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (f64 DPR:$src)>;
4680 def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (f64 DPR:$src)>;
4681 def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (f64 DPR:$src)>;
4682 def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (v2f32 DPR:$src)>;
4683 def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
4684 def : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
4685 def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
4686 def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (v2f32 DPR:$src)>;
4688 def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
4689 def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
4690 def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
4691 def : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
4692 def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
4693 def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
4694 def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
4695 def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
4696 def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
4697 def : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
4698 def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
4699 def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
4700 def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
4701 def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
4702 def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
4703 def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
4704 def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
4705 def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
4706 def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
4707 def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
4708 def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
4709 def : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
4710 def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
4711 def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
4712 def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
4713 def : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
4714 def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
4715 def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
4716 def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
4717 def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;