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>]>;
20 def NEONvceq : SDNode<"ARMISD::VCEQ", SDTARMVCMP>;
21 def NEONvcge : SDNode<"ARMISD::VCGE", SDTARMVCMP>;
22 def NEONvcgeu : SDNode<"ARMISD::VCGEU", SDTARMVCMP>;
23 def NEONvcgt : SDNode<"ARMISD::VCGT", SDTARMVCMP>;
24 def NEONvcgtu : SDNode<"ARMISD::VCGTU", SDTARMVCMP>;
25 def NEONvtst : SDNode<"ARMISD::VTST", SDTARMVCMP>;
27 // Types for vector shift by immediates. The "SHX" version is for long and
28 // narrow operations where the source and destination vectors have different
29 // types. The "SHINS" version is for shift and insert operations.
30 def SDTARMVSH : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisSameAs<0, 1>,
32 def SDTARMVSHX : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisInt<1>,
34 def SDTARMVSHINS : SDTypeProfile<1, 3, [SDTCisInt<0>, SDTCisSameAs<0, 1>,
35 SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>;
37 def NEONvshl : SDNode<"ARMISD::VSHL", SDTARMVSH>;
38 def NEONvshrs : SDNode<"ARMISD::VSHRs", SDTARMVSH>;
39 def NEONvshru : SDNode<"ARMISD::VSHRu", SDTARMVSH>;
40 def NEONvshlls : SDNode<"ARMISD::VSHLLs", SDTARMVSHX>;
41 def NEONvshllu : SDNode<"ARMISD::VSHLLu", SDTARMVSHX>;
42 def NEONvshlli : SDNode<"ARMISD::VSHLLi", SDTARMVSHX>;
43 def NEONvshrn : SDNode<"ARMISD::VSHRN", SDTARMVSHX>;
45 def NEONvrshrs : SDNode<"ARMISD::VRSHRs", SDTARMVSH>;
46 def NEONvrshru : SDNode<"ARMISD::VRSHRu", SDTARMVSH>;
47 def NEONvrshrn : SDNode<"ARMISD::VRSHRN", SDTARMVSHX>;
49 def NEONvqshls : SDNode<"ARMISD::VQSHLs", SDTARMVSH>;
50 def NEONvqshlu : SDNode<"ARMISD::VQSHLu", SDTARMVSH>;
51 def NEONvqshlsu : SDNode<"ARMISD::VQSHLsu", SDTARMVSH>;
52 def NEONvqshrns : SDNode<"ARMISD::VQSHRNs", SDTARMVSHX>;
53 def NEONvqshrnu : SDNode<"ARMISD::VQSHRNu", SDTARMVSHX>;
54 def NEONvqshrnsu : SDNode<"ARMISD::VQSHRNsu", SDTARMVSHX>;
56 def NEONvqrshrns : SDNode<"ARMISD::VQRSHRNs", SDTARMVSHX>;
57 def NEONvqrshrnu : SDNode<"ARMISD::VQRSHRNu", SDTARMVSHX>;
58 def NEONvqrshrnsu : SDNode<"ARMISD::VQRSHRNsu", SDTARMVSHX>;
60 def NEONvsli : SDNode<"ARMISD::VSLI", SDTARMVSHINS>;
61 def NEONvsri : SDNode<"ARMISD::VSRI", SDTARMVSHINS>;
63 def SDTARMVGETLN : SDTypeProfile<1, 2, [SDTCisVT<0, i32>, SDTCisInt<1>,
65 def NEONvgetlaneu : SDNode<"ARMISD::VGETLANEu", SDTARMVGETLN>;
66 def NEONvgetlanes : SDNode<"ARMISD::VGETLANEs", SDTARMVGETLN>;
68 def SDTARMVMOVIMM : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisVT<1, i32>]>;
69 def NEONvmovImm : SDNode<"ARMISD::VMOVIMM", SDTARMVMOVIMM>;
70 def NEONvmvnImm : SDNode<"ARMISD::VMVNIMM", SDTARMVMOVIMM>;
72 def NEONvdup : SDNode<"ARMISD::VDUP", SDTypeProfile<1, 1, [SDTCisVec<0>]>>;
74 // VDUPLANE can produce a quad-register result from a double-register source,
75 // so the result is not constrained to match the source.
76 def NEONvduplane : SDNode<"ARMISD::VDUPLANE",
77 SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisVec<1>,
80 def SDTARMVEXT : SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0, 1>,
81 SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>;
82 def NEONvext : SDNode<"ARMISD::VEXT", SDTARMVEXT>;
84 def SDTARMVSHUF : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisSameAs<0, 1>]>;
85 def NEONvrev64 : SDNode<"ARMISD::VREV64", SDTARMVSHUF>;
86 def NEONvrev32 : SDNode<"ARMISD::VREV32", SDTARMVSHUF>;
87 def NEONvrev16 : SDNode<"ARMISD::VREV16", SDTARMVSHUF>;
89 def SDTARMVSHUF2 : SDTypeProfile<2, 2, [SDTCisVec<0>, SDTCisSameAs<0, 1>,
92 def NEONzip : SDNode<"ARMISD::VZIP", SDTARMVSHUF2>;
93 def NEONuzp : SDNode<"ARMISD::VUZP", SDTARMVSHUF2>;
94 def NEONtrn : SDNode<"ARMISD::VTRN", SDTARMVSHUF2>;
96 def SDTARMVMULL : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisInt<1>,
98 def NEONvmulls : SDNode<"ARMISD::VMULLs", SDTARMVMULL>;
99 def NEONvmullu : SDNode<"ARMISD::VMULLu", SDTARMVMULL>;
101 def SDTARMFMAX : SDTypeProfile<1, 2, [SDTCisVT<0, f32>, SDTCisSameAs<0, 1>,
102 SDTCisSameAs<0, 2>]>;
103 def NEONfmax : SDNode<"ARMISD::FMAX", SDTARMFMAX>;
104 def NEONfmin : SDNode<"ARMISD::FMIN", SDTARMFMAX>;
106 def NEONimmAllZerosV: PatLeaf<(NEONvmovImm (i32 timm)), [{
107 ConstantSDNode *ConstVal = cast<ConstantSDNode>(N->getOperand(0));
108 unsigned EltBits = 0;
109 uint64_t EltVal = ARM_AM::decodeNEONModImm(ConstVal->getZExtValue(), EltBits);
110 return (EltBits == 32 && EltVal == 0);
113 def NEONimmAllOnesV: PatLeaf<(NEONvmovImm (i32 timm)), [{
114 ConstantSDNode *ConstVal = cast<ConstantSDNode>(N->getOperand(0));
115 unsigned EltBits = 0;
116 uint64_t EltVal = ARM_AM::decodeNEONModImm(ConstVal->getZExtValue(), EltBits);
117 return (EltBits == 8 && EltVal == 0xff);
120 //===----------------------------------------------------------------------===//
121 // NEON operand definitions
122 //===----------------------------------------------------------------------===//
124 def nModImm : Operand<i32> {
125 let PrintMethod = "printNEONModImmOperand";
128 //===----------------------------------------------------------------------===//
129 // NEON load / store instructions
130 //===----------------------------------------------------------------------===//
132 // Use VLDM to load a Q register as a D register pair.
133 // This is a pseudo instruction that is expanded to VLDMD after reg alloc.
135 : PseudoVFPLdStM<(outs QPR:$dst), (ins GPR:$Rn, ldstm_mode:$mode),
137 [(set QPR:$dst, (v2f64 (load GPR:$Rn)))]>;
139 // Use VSTM to store a Q register as a D register pair.
140 // This is a pseudo instruction that is expanded to VSTMD after reg alloc.
142 : PseudoVFPLdStM<(outs), (ins QPR:$src, GPR:$Rn, ldstm_mode:$mode),
144 [(store (v2f64 QPR:$src), GPR:$Rn)]>;
146 let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
148 // Classes for VLD* pseudo-instructions with multi-register operands.
149 // These are expanded to real instructions after register allocation.
150 class VLDQPseudo<InstrItinClass itin>
151 : PseudoNLdSt<(outs QPR:$dst), (ins addrmode6:$addr), itin, "">;
152 class VLDQWBPseudo<InstrItinClass itin>
153 : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
154 (ins addrmode6:$addr, am6offset:$offset), itin,
156 class VLDQQPseudo<InstrItinClass itin>
157 : PseudoNLdSt<(outs QQPR:$dst), (ins addrmode6:$addr), itin, "">;
158 class VLDQQWBPseudo<InstrItinClass itin>
159 : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
160 (ins addrmode6:$addr, am6offset:$offset), itin,
162 class VLDQQQQWBPseudo<InstrItinClass itin>
163 : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
164 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
165 "$addr.addr = $wb, $src = $dst">;
167 // VLD1 : Vector Load (multiple single elements)
168 class VLD1D<bits<4> op7_4, string Dt>
169 : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$Vd),
170 (ins addrmode6:$Rn), IIC_VLD1,
171 "vld1", Dt, "\\{$Vd\\}, $Rn", "", []> {
175 class VLD1Q<bits<4> op7_4, string Dt>
176 : NLdSt<0,0b10,0b1010,op7_4, (outs DPR:$Vd, DPR:$dst2),
177 (ins addrmode6:$Rn), IIC_VLD1x2,
178 "vld1", Dt, "\\{$Vd, $dst2\\}, $Rn", "", []> {
180 let Inst{5-4} = Rn{5-4};
183 def VLD1d8 : VLD1D<{0,0,0,?}, "8">;
184 def VLD1d16 : VLD1D<{0,1,0,?}, "16">;
185 def VLD1d32 : VLD1D<{1,0,0,?}, "32">;
186 def VLD1d64 : VLD1D<{1,1,0,?}, "64">;
188 def VLD1q8 : VLD1Q<{0,0,?,?}, "8">;
189 def VLD1q16 : VLD1Q<{0,1,?,?}, "16">;
190 def VLD1q32 : VLD1Q<{1,0,?,?}, "32">;
191 def VLD1q64 : VLD1Q<{1,1,?,?}, "64">;
193 def VLD1q8Pseudo : VLDQPseudo<IIC_VLD1x2>;
194 def VLD1q16Pseudo : VLDQPseudo<IIC_VLD1x2>;
195 def VLD1q32Pseudo : VLDQPseudo<IIC_VLD1x2>;
196 def VLD1q64Pseudo : VLDQPseudo<IIC_VLD1x2>;
198 // ...with address register writeback:
199 class VLD1DWB<bits<4> op7_4, string Dt>
200 : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$Vd, GPR:$wb),
201 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1u,
202 "vld1", Dt, "\\{$Vd\\}, $Rn$Rm",
203 "$Rn.addr = $wb", []> {
206 class VLD1QWB<bits<4> op7_4, string Dt>
207 : NLdSt<0,0b10,0b1010,op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
208 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1x2u,
209 "vld1", Dt, "\\{$Vd, $dst2\\}, $Rn$Rm",
210 "$Rn.addr = $wb", []> {
211 let Inst{5-4} = Rn{5-4};
214 def VLD1d8_UPD : VLD1DWB<{0,0,0,?}, "8">;
215 def VLD1d16_UPD : VLD1DWB<{0,1,0,?}, "16">;
216 def VLD1d32_UPD : VLD1DWB<{1,0,0,?}, "32">;
217 def VLD1d64_UPD : VLD1DWB<{1,1,0,?}, "64">;
219 def VLD1q8_UPD : VLD1QWB<{0,0,?,?}, "8">;
220 def VLD1q16_UPD : VLD1QWB<{0,1,?,?}, "16">;
221 def VLD1q32_UPD : VLD1QWB<{1,0,?,?}, "32">;
222 def VLD1q64_UPD : VLD1QWB<{1,1,?,?}, "64">;
224 def VLD1q8Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
225 def VLD1q16Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
226 def VLD1q32Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
227 def VLD1q64Pseudo_UPD : VLDQWBPseudo<IIC_VLD1x2u>;
229 // ...with 3 registers (some of these are only for the disassembler):
230 class VLD1D3<bits<4> op7_4, string Dt>
231 : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
232 (ins addrmode6:$Rn), IIC_VLD1x3, "vld1", Dt,
233 "\\{$Vd, $dst2, $dst3\\}, $Rn", "", []> {
237 class VLD1D3WB<bits<4> op7_4, string Dt>
238 : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
239 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD1x3u, "vld1", Dt,
240 "\\{$Vd, $dst2, $dst3\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
244 def VLD1d8T : VLD1D3<{0,0,0,?}, "8">;
245 def VLD1d16T : VLD1D3<{0,1,0,?}, "16">;
246 def VLD1d32T : VLD1D3<{1,0,0,?}, "32">;
247 def VLD1d64T : VLD1D3<{1,1,0,?}, "64">;
249 def VLD1d8T_UPD : VLD1D3WB<{0,0,0,?}, "8">;
250 def VLD1d16T_UPD : VLD1D3WB<{0,1,0,?}, "16">;
251 def VLD1d32T_UPD : VLD1D3WB<{1,0,0,?}, "32">;
252 def VLD1d64T_UPD : VLD1D3WB<{1,1,0,?}, "64">;
254 def VLD1d64TPseudo : VLDQQPseudo<IIC_VLD1x3>;
255 def VLD1d64TPseudo_UPD : VLDQQWBPseudo<IIC_VLD1x3u>;
257 // ...with 4 registers (some of these are only for the disassembler):
258 class VLD1D4<bits<4> op7_4, string Dt>
259 : NLdSt<0,0b10,0b0010,op7_4,(outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
260 (ins addrmode6:$Rn), IIC_VLD1x4, "vld1", Dt,
261 "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []> {
263 let Inst{5-4} = Rn{5-4};
265 class VLD1D4WB<bits<4> op7_4, string Dt>
266 : NLdSt<0,0b10,0b0010,op7_4,
267 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
268 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD4, "vld1", Dt,
269 "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm", "$Rn.addr = $wb",
271 let Inst{5-4} = Rn{5-4};
274 def VLD1d8Q : VLD1D4<{0,0,?,?}, "8">;
275 def VLD1d16Q : VLD1D4<{0,1,?,?}, "16">;
276 def VLD1d32Q : VLD1D4<{1,0,?,?}, "32">;
277 def VLD1d64Q : VLD1D4<{1,1,?,?}, "64">;
279 def VLD1d8Q_UPD : VLD1D4WB<{0,0,?,?}, "8">;
280 def VLD1d16Q_UPD : VLD1D4WB<{0,1,?,?}, "16">;
281 def VLD1d32Q_UPD : VLD1D4WB<{1,0,?,?}, "32">;
282 def VLD1d64Q_UPD : VLD1D4WB<{1,1,?,?}, "64">;
284 def VLD1d64QPseudo : VLDQQPseudo<IIC_VLD1x4>;
285 def VLD1d64QPseudo_UPD : VLDQQWBPseudo<IIC_VLD1x4u>;
287 // VLD2 : Vector Load (multiple 2-element structures)
288 class VLD2D<bits<4> op11_8, bits<4> op7_4, string Dt>
289 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2),
290 (ins addrmode6:$Rn), IIC_VLD2,
291 "vld2", Dt, "\\{$Vd, $dst2\\}, $Rn", "", []> {
293 let Inst{5-4} = Rn{5-4};
295 class VLD2Q<bits<4> op7_4, string Dt>
296 : NLdSt<0, 0b10, 0b0011, op7_4,
297 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
298 (ins addrmode6:$Rn), IIC_VLD2x2,
299 "vld2", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []> {
301 let Inst{5-4} = Rn{5-4};
304 def VLD2d8 : VLD2D<0b1000, {0,0,?,?}, "8">;
305 def VLD2d16 : VLD2D<0b1000, {0,1,?,?}, "16">;
306 def VLD2d32 : VLD2D<0b1000, {1,0,?,?}, "32">;
308 def VLD2q8 : VLD2Q<{0,0,?,?}, "8">;
309 def VLD2q16 : VLD2Q<{0,1,?,?}, "16">;
310 def VLD2q32 : VLD2Q<{1,0,?,?}, "32">;
312 def VLD2d8Pseudo : VLDQPseudo<IIC_VLD2>;
313 def VLD2d16Pseudo : VLDQPseudo<IIC_VLD2>;
314 def VLD2d32Pseudo : VLDQPseudo<IIC_VLD2>;
316 def VLD2q8Pseudo : VLDQQPseudo<IIC_VLD2x2>;
317 def VLD2q16Pseudo : VLDQQPseudo<IIC_VLD2x2>;
318 def VLD2q32Pseudo : VLDQQPseudo<IIC_VLD2x2>;
320 // ...with address register writeback:
321 class VLD2DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
322 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
323 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD2u,
324 "vld2", Dt, "\\{$Vd, $dst2\\}, $Rn$Rm",
325 "$Rn.addr = $wb", []> {
326 let Inst{5-4} = Rn{5-4};
328 class VLD2QWB<bits<4> op7_4, string Dt>
329 : NLdSt<0, 0b10, 0b0011, op7_4,
330 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
331 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD2x2u,
332 "vld2", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm",
333 "$Rn.addr = $wb", []> {
334 let Inst{5-4} = Rn{5-4};
337 def VLD2d8_UPD : VLD2DWB<0b1000, {0,0,?,?}, "8">;
338 def VLD2d16_UPD : VLD2DWB<0b1000, {0,1,?,?}, "16">;
339 def VLD2d32_UPD : VLD2DWB<0b1000, {1,0,?,?}, "32">;
341 def VLD2q8_UPD : VLD2QWB<{0,0,?,?}, "8">;
342 def VLD2q16_UPD : VLD2QWB<{0,1,?,?}, "16">;
343 def VLD2q32_UPD : VLD2QWB<{1,0,?,?}, "32">;
345 def VLD2d8Pseudo_UPD : VLDQWBPseudo<IIC_VLD2u>;
346 def VLD2d16Pseudo_UPD : VLDQWBPseudo<IIC_VLD2u>;
347 def VLD2d32Pseudo_UPD : VLDQWBPseudo<IIC_VLD2u>;
349 def VLD2q8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD2x2u>;
350 def VLD2q16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD2x2u>;
351 def VLD2q32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD2x2u>;
353 // ...with double-spaced registers (for disassembly only):
354 def VLD2b8 : VLD2D<0b1001, {0,0,?,?}, "8">;
355 def VLD2b16 : VLD2D<0b1001, {0,1,?,?}, "16">;
356 def VLD2b32 : VLD2D<0b1001, {1,0,?,?}, "32">;
357 def VLD2b8_UPD : VLD2DWB<0b1001, {0,0,?,?}, "8">;
358 def VLD2b16_UPD : VLD2DWB<0b1001, {0,1,?,?}, "16">;
359 def VLD2b32_UPD : VLD2DWB<0b1001, {1,0,?,?}, "32">;
361 // VLD3 : Vector Load (multiple 3-element structures)
362 class VLD3D<bits<4> op11_8, bits<4> op7_4, string Dt>
363 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
364 (ins addrmode6:$Rn), IIC_VLD3,
365 "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn", "", []> {
370 def VLD3d8 : VLD3D<0b0100, {0,0,0,?}, "8">;
371 def VLD3d16 : VLD3D<0b0100, {0,1,0,?}, "16">;
372 def VLD3d32 : VLD3D<0b0100, {1,0,0,?}, "32">;
374 def VLD3d8Pseudo : VLDQQPseudo<IIC_VLD3>;
375 def VLD3d16Pseudo : VLDQQPseudo<IIC_VLD3>;
376 def VLD3d32Pseudo : VLDQQPseudo<IIC_VLD3>;
378 // ...with address register writeback:
379 class VLD3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
380 : NLdSt<0, 0b10, op11_8, op7_4,
381 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
382 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD3u,
383 "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn$Rm",
384 "$Rn.addr = $wb", []> {
388 def VLD3d8_UPD : VLD3DWB<0b0100, {0,0,0,?}, "8">;
389 def VLD3d16_UPD : VLD3DWB<0b0100, {0,1,0,?}, "16">;
390 def VLD3d32_UPD : VLD3DWB<0b0100, {1,0,0,?}, "32">;
392 def VLD3d8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>;
393 def VLD3d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>;
394 def VLD3d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>;
396 // ...with double-spaced registers (non-updating versions for disassembly only):
397 def VLD3q8 : VLD3D<0b0101, {0,0,0,?}, "8">;
398 def VLD3q16 : VLD3D<0b0101, {0,1,0,?}, "16">;
399 def VLD3q32 : VLD3D<0b0101, {1,0,0,?}, "32">;
400 def VLD3q8_UPD : VLD3DWB<0b0101, {0,0,0,?}, "8">;
401 def VLD3q16_UPD : VLD3DWB<0b0101, {0,1,0,?}, "16">;
402 def VLD3q32_UPD : VLD3DWB<0b0101, {1,0,0,?}, "32">;
404 def VLD3q8Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
405 def VLD3q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
406 def VLD3q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
408 // ...alternate versions to be allocated odd register numbers:
409 def VLD3q8oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
410 def VLD3q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
411 def VLD3q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>;
413 // VLD4 : Vector Load (multiple 4-element structures)
414 class VLD4D<bits<4> op11_8, bits<4> op7_4, string Dt>
415 : NLdSt<0, 0b10, op11_8, op7_4,
416 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
417 (ins addrmode6:$Rn), IIC_VLD4,
418 "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []> {
420 let Inst{5-4} = Rn{5-4};
423 def VLD4d8 : VLD4D<0b0000, {0,0,?,?}, "8">;
424 def VLD4d16 : VLD4D<0b0000, {0,1,?,?}, "16">;
425 def VLD4d32 : VLD4D<0b0000, {1,0,?,?}, "32">;
427 def VLD4d8Pseudo : VLDQQPseudo<IIC_VLD4>;
428 def VLD4d16Pseudo : VLDQQPseudo<IIC_VLD4>;
429 def VLD4d32Pseudo : VLDQQPseudo<IIC_VLD4>;
431 // ...with address register writeback:
432 class VLD4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
433 : NLdSt<0, 0b10, op11_8, op7_4,
434 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
435 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD4,
436 "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm",
437 "$Rn.addr = $wb", []> {
438 let Inst{5-4} = Rn{5-4};
441 def VLD4d8_UPD : VLD4DWB<0b0000, {0,0,?,?}, "8">;
442 def VLD4d16_UPD : VLD4DWB<0b0000, {0,1,?,?}, "16">;
443 def VLD4d32_UPD : VLD4DWB<0b0000, {1,0,?,?}, "32">;
445 def VLD4d8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4>;
446 def VLD4d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4>;
447 def VLD4d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4>;
449 // ...with double-spaced registers (non-updating versions for disassembly only):
450 def VLD4q8 : VLD4D<0b0001, {0,0,?,?}, "8">;
451 def VLD4q16 : VLD4D<0b0001, {0,1,?,?}, "16">;
452 def VLD4q32 : VLD4D<0b0001, {1,0,?,?}, "32">;
453 def VLD4q8_UPD : VLD4DWB<0b0001, {0,0,?,?}, "8">;
454 def VLD4q16_UPD : VLD4DWB<0b0001, {0,1,?,?}, "16">;
455 def VLD4q32_UPD : VLD4DWB<0b0001, {1,0,?,?}, "32">;
457 def VLD4q8Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4>;
458 def VLD4q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4>;
459 def VLD4q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4>;
461 // ...alternate versions to be allocated odd register numbers:
462 def VLD4q8oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4>;
463 def VLD4q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4>;
464 def VLD4q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4>;
466 } // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
468 // Classes for VLD*LN pseudo-instructions with multi-register operands.
469 // These are expanded to real instructions after register allocation.
470 class VLDQLNPseudo<InstrItinClass itin>
471 : PseudoNLdSt<(outs QPR:$dst),
472 (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
473 itin, "$src = $dst">;
474 class VLDQLNWBPseudo<InstrItinClass itin>
475 : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
476 (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
477 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
478 class VLDQQLNPseudo<InstrItinClass itin>
479 : PseudoNLdSt<(outs QQPR:$dst),
480 (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
481 itin, "$src = $dst">;
482 class VLDQQLNWBPseudo<InstrItinClass itin>
483 : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
484 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
485 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
486 class VLDQQQQLNPseudo<InstrItinClass itin>
487 : PseudoNLdSt<(outs QQQQPR:$dst),
488 (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
489 itin, "$src = $dst">;
490 class VLDQQQQLNWBPseudo<InstrItinClass itin>
491 : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
492 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
493 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
495 // VLD1LN : Vector Load (single element to one lane)
496 class VLD1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
498 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd),
499 (ins addrmode6:$Rn, DPR:$src, nohash_imm:$lane),
500 IIC_VLD1ln, "vld1", Dt, "\\{$Vd[$lane]\\}, $Rn",
502 [(set DPR:$Vd, (vector_insert (Ty DPR:$src),
503 (i32 (LoadOp addrmode6:$Rn)),
507 class VLD1QLNPseudo<ValueType Ty, PatFrag LoadOp> : VLDQLNPseudo<IIC_VLD1ln> {
508 let Pattern = [(set QPR:$dst, (vector_insert (Ty QPR:$src),
509 (i32 (LoadOp addrmode6:$addr)),
513 def VLD1LNd8 : VLD1LN<0b0000, {?,?,?,0}, "8", v8i8, extloadi8> {
514 let Inst{7-5} = lane{2-0};
516 def VLD1LNd16 : VLD1LN<0b0100, {?,?,0,?}, "16", v4i16, extloadi16> {
517 let Inst{7-6} = lane{1-0};
520 def VLD1LNd32 : VLD1LN<0b1000, {?,0,?,?}, "32", v2i32, load> {
521 let Inst{7} = lane{0};
526 def VLD1LNq8Pseudo : VLD1QLNPseudo<v16i8, extloadi8>;
527 def VLD1LNq16Pseudo : VLD1QLNPseudo<v8i16, extloadi16>;
528 def VLD1LNq32Pseudo : VLD1QLNPseudo<v4i32, load>;
530 let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
532 // ...with address register writeback:
533 class VLD1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
534 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, GPR:$wb),
535 (ins addrmode6:$Rn, am6offset:$Rm,
536 DPR:$src, nohash_imm:$lane), IIC_VLD1lnu, "vld1", Dt,
537 "\\{$Vd[$lane]\\}, $Rn$Rm",
538 "$src = $Vd, $Rn.addr = $wb", []>;
540 def VLD1LNd8_UPD : VLD1LNWB<0b0000, {?,?,?,0}, "8"> {
541 let Inst{7-5} = lane{2-0};
543 def VLD1LNd16_UPD : VLD1LNWB<0b0100, {?,?,0,?}, "16"> {
544 let Inst{7-6} = lane{1-0};
547 def VLD1LNd32_UPD : VLD1LNWB<0b1000, {?,0,?,?}, "32"> {
548 let Inst{7} = lane{0};
553 def VLD1LNq8Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>;
554 def VLD1LNq16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>;
555 def VLD1LNq32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>;
557 // VLD2LN : Vector Load (single 2-element structure to one lane)
558 class VLD2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
559 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2),
560 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, nohash_imm:$lane),
561 IIC_VLD2ln, "vld2", Dt, "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn",
562 "$src1 = $Vd, $src2 = $dst2", []> {
567 def VLD2LNd8 : VLD2LN<0b0001, {?,?,?,?}, "8"> {
568 let Inst{7-5} = lane{2-0};
570 def VLD2LNd16 : VLD2LN<0b0101, {?,?,0,?}, "16"> {
571 let Inst{7-6} = lane{1-0};
573 def VLD2LNd32 : VLD2LN<0b1001, {?,0,0,?}, "32"> {
574 let Inst{7} = lane{0};
577 def VLD2LNd8Pseudo : VLDQLNPseudo<IIC_VLD2ln>;
578 def VLD2LNd16Pseudo : VLDQLNPseudo<IIC_VLD2ln>;
579 def VLD2LNd32Pseudo : VLDQLNPseudo<IIC_VLD2ln>;
581 // ...with double-spaced registers:
582 def VLD2LNq16 : VLD2LN<0b0101, {?,?,1,?}, "16"> {
583 let Inst{7-6} = lane{1-0};
585 def VLD2LNq32 : VLD2LN<0b1001, {?,1,0,?}, "32"> {
586 let Inst{7} = lane{0};
589 def VLD2LNq16Pseudo : VLDQQLNPseudo<IIC_VLD2ln>;
590 def VLD2LNq32Pseudo : VLDQQLNPseudo<IIC_VLD2ln>;
592 // ...with address register writeback:
593 class VLD2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
594 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
595 (ins addrmode6:$Rn, am6offset:$Rm,
596 DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VLD2lnu, "vld2", Dt,
597 "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn$Rm",
598 "$src1 = $Vd, $src2 = $dst2, $Rn.addr = $wb", []> {
602 def VLD2LNd8_UPD : VLD2LNWB<0b0001, {?,?,?,?}, "8"> {
603 let Inst{7-5} = lane{2-0};
605 def VLD2LNd16_UPD : VLD2LNWB<0b0101, {?,?,0,?}, "16"> {
606 let Inst{7-6} = lane{1-0};
608 def VLD2LNd32_UPD : VLD2LNWB<0b1001, {?,0,0,?}, "32"> {
609 let Inst{7} = lane{0};
612 def VLD2LNd8Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>;
613 def VLD2LNd16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>;
614 def VLD2LNd32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>;
616 def VLD2LNq16_UPD : VLD2LNWB<0b0101, {?,?,1,?}, "16"> {
617 let Inst{7-6} = lane{1-0};
619 def VLD2LNq32_UPD : VLD2LNWB<0b1001, {?,1,0,?}, "32"> {
620 let Inst{7} = lane{0};
623 def VLD2LNq16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>;
624 def VLD2LNq32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>;
626 // VLD3LN : Vector Load (single 3-element structure to one lane)
627 class VLD3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
628 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
629 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3,
630 nohash_imm:$lane), IIC_VLD3ln, "vld3", Dt,
631 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn",
632 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3", []> {
636 def VLD3LNd8 : VLD3LN<0b0010, {?,?,?,0}, "8"> {
637 let Inst{7-5} = lane{2-0};
639 def VLD3LNd16 : VLD3LN<0b0110, {?,?,0,0}, "16"> {
640 let Inst{7-6} = lane{1-0};
642 def VLD3LNd32 : VLD3LN<0b1010, {?,0,0,0}, "32"> {
643 let Inst{7} = lane{0};
646 def VLD3LNd8Pseudo : VLDQQLNPseudo<IIC_VLD3ln>;
647 def VLD3LNd16Pseudo : VLDQQLNPseudo<IIC_VLD3ln>;
648 def VLD3LNd32Pseudo : VLDQQLNPseudo<IIC_VLD3ln>;
650 // ...with double-spaced registers:
651 def VLD3LNq16 : VLD3LN<0b0110, {?,?,1,0}, "16"> {
652 let Inst{7-6} = lane{1-0};
654 def VLD3LNq32 : VLD3LN<0b1010, {?,1,0,0}, "32"> {
655 let Inst{7} = lane{0};
658 def VLD3LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>;
659 def VLD3LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>;
661 // ...with address register writeback:
662 class VLD3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
663 : NLdStLn<1, 0b10, op11_8, op7_4,
664 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
665 (ins addrmode6:$Rn, am6offset:$Rm,
666 DPR:$src1, DPR:$src2, DPR:$src3, nohash_imm:$lane),
667 IIC_VLD3lnu, "vld3", Dt,
668 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn$Rm",
669 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $Rn.addr = $wb",
672 def VLD3LNd8_UPD : VLD3LNWB<0b0010, {?,?,?,0}, "8"> {
673 let Inst{7-5} = lane{2-0};
675 def VLD3LNd16_UPD : VLD3LNWB<0b0110, {?,?,0,0}, "16"> {
676 let Inst{7-6} = lane{1-0};
678 def VLD3LNd32_UPD : VLD3LNWB<0b1010, {?,0,0,0}, "32"> {
679 let Inst{7} = lane{0};
682 def VLD3LNd8Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>;
683 def VLD3LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>;
684 def VLD3LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>;
686 def VLD3LNq16_UPD : VLD3LNWB<0b0110, {?,?,1,0}, "16"> {
687 let Inst{7-6} = lane{1-0};
689 def VLD3LNq32_UPD : VLD3LNWB<0b1010, {?,1,0,0}, "32"> {
690 let Inst{7} = lane{0};
693 def VLD3LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>;
694 def VLD3LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>;
696 // VLD4LN : Vector Load (single 4-element structure to one lane)
697 class VLD4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
698 : NLdStLn<1, 0b10, op11_8, op7_4,
699 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
700 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4,
701 nohash_imm:$lane), IIC_VLD4ln, "vld4", Dt,
702 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn",
703 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4", []> {
708 def VLD4LNd8 : VLD4LN<0b0011, {?,?,?,?}, "8"> {
709 let Inst{7-5} = lane{2-0};
711 def VLD4LNd16 : VLD4LN<0b0111, {?,?,0,?}, "16"> {
712 let Inst{7-6} = lane{1-0};
714 def VLD4LNd32 : VLD4LN<0b1011, {?,0,?,?}, "32"> {
715 let Inst{7} = lane{0};
719 def VLD4LNd8Pseudo : VLDQQLNPseudo<IIC_VLD4ln>;
720 def VLD4LNd16Pseudo : VLDQQLNPseudo<IIC_VLD4ln>;
721 def VLD4LNd32Pseudo : VLDQQLNPseudo<IIC_VLD4ln>;
723 // ...with double-spaced registers:
724 def VLD4LNq16 : VLD4LN<0b0111, {?,?,1,?}, "16"> {
725 let Inst{7-6} = lane{1-0};
727 def VLD4LNq32 : VLD4LN<0b1011, {?,1,?,?}, "32"> {
728 let Inst{7} = lane{0};
732 def VLD4LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>;
733 def VLD4LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>;
735 // ...with address register writeback:
736 class VLD4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
737 : NLdStLn<1, 0b10, op11_8, op7_4,
738 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
739 (ins addrmode6:$Rn, am6offset:$Rm,
740 DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
741 IIC_VLD4ln, "vld4", Dt,
742 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn$Rm",
743 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4, $Rn.addr = $wb",
748 def VLD4LNd8_UPD : VLD4LNWB<0b0011, {?,?,?,?}, "8"> {
749 let Inst{7-5} = lane{2-0};
751 def VLD4LNd16_UPD : VLD4LNWB<0b0111, {?,?,0,?}, "16"> {
752 let Inst{7-6} = lane{1-0};
754 def VLD4LNd32_UPD : VLD4LNWB<0b1011, {?,0,?,?}, "32"> {
755 let Inst{7} = lane{0};
759 def VLD4LNd8Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>;
760 def VLD4LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>;
761 def VLD4LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>;
763 def VLD4LNq16_UPD : VLD4LNWB<0b0111, {?,?,1,?}, "16"> {
764 let Inst{7-6} = lane{1-0};
766 def VLD4LNq32_UPD : VLD4LNWB<0b1011, {?,1,?,?}, "32"> {
767 let Inst{7} = lane{0};
771 def VLD4LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>;
772 def VLD4LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>;
774 // VLD1DUP : Vector Load (single element to all lanes)
775 // VLD2DUP : Vector Load (single 2-element structure to all lanes)
776 // VLD3DUP : Vector Load (single 3-element structure to all lanes)
777 // VLD4DUP : Vector Load (single 4-element structure to all lanes)
778 // FIXME: Not yet implemented.
779 } // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
781 let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in {
783 // Classes for VST* pseudo-instructions with multi-register operands.
784 // These are expanded to real instructions after register allocation.
785 class VSTQPseudo<InstrItinClass itin>
786 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src), itin, "">;
787 class VSTQWBPseudo<InstrItinClass itin>
788 : PseudoNLdSt<(outs GPR:$wb),
789 (ins addrmode6:$addr, am6offset:$offset, QPR:$src), itin,
791 class VSTQQPseudo<InstrItinClass itin>
792 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src), itin, "">;
793 class VSTQQWBPseudo<InstrItinClass itin>
794 : PseudoNLdSt<(outs GPR:$wb),
795 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src), itin,
797 class VSTQQQQWBPseudo<InstrItinClass itin>
798 : PseudoNLdSt<(outs GPR:$wb),
799 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
802 // VST1 : Vector Store (multiple single elements)
803 class VST1D<bits<4> op7_4, string Dt>
804 : NLdSt<0,0b00,0b0111,op7_4, (outs), (ins addrmode6:$Rn, DPR:$Vd),
805 IIC_VST1, "vst1", Dt, "\\{$Vd\\}, $Rn", "", []> {
809 class VST1Q<bits<4> op7_4, string Dt>
810 : NLdSt<0,0b00,0b1010,op7_4, (outs),
811 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2), IIC_VST1x2,
812 "vst1", Dt, "\\{$Vd, $src2\\}, $Rn", "", []> {
814 let Inst{5-4} = Rn{5-4};
817 def VST1d8 : VST1D<{0,0,0,?}, "8">;
818 def VST1d16 : VST1D<{0,1,0,?}, "16">;
819 def VST1d32 : VST1D<{1,0,0,?}, "32">;
820 def VST1d64 : VST1D<{1,1,0,?}, "64">;
822 def VST1q8 : VST1Q<{0,0,?,?}, "8">;
823 def VST1q16 : VST1Q<{0,1,?,?}, "16">;
824 def VST1q32 : VST1Q<{1,0,?,?}, "32">;
825 def VST1q64 : VST1Q<{1,1,?,?}, "64">;
827 def VST1q8Pseudo : VSTQPseudo<IIC_VST1x2>;
828 def VST1q16Pseudo : VSTQPseudo<IIC_VST1x2>;
829 def VST1q32Pseudo : VSTQPseudo<IIC_VST1x2>;
830 def VST1q64Pseudo : VSTQPseudo<IIC_VST1x2>;
832 // ...with address register writeback:
833 class VST1DWB<bits<4> op7_4, string Dt>
834 : NLdSt<0, 0b00, 0b0111, op7_4, (outs GPR:$wb),
835 (ins addrmode6:$Rn, am6offset:$Rm, DPR:$Vd), IIC_VST1u,
836 "vst1", Dt, "\\{$Vd\\}, $Rn$Rm", "$Rn.addr = $wb", []> {
839 class VST1QWB<bits<4> op7_4, string Dt>
840 : NLdSt<0, 0b00, 0b1010, op7_4, (outs GPR:$wb),
841 (ins addrmode6:$Rn, am6offset:$Rm, DPR:$Vd, DPR:$src2),
842 IIC_VST1x2u, "vst1", Dt, "\\{$Vd, $src2\\}, $Rn$Rm",
843 "$Rn.addr = $wb", []> {
844 let Inst{5-4} = Rn{5-4};
847 def VST1d8_UPD : VST1DWB<{0,0,0,?}, "8">;
848 def VST1d16_UPD : VST1DWB<{0,1,0,?}, "16">;
849 def VST1d32_UPD : VST1DWB<{1,0,0,?}, "32">;
850 def VST1d64_UPD : VST1DWB<{1,1,0,?}, "64">;
852 def VST1q8_UPD : VST1QWB<{0,0,?,?}, "8">;
853 def VST1q16_UPD : VST1QWB<{0,1,?,?}, "16">;
854 def VST1q32_UPD : VST1QWB<{1,0,?,?}, "32">;
855 def VST1q64_UPD : VST1QWB<{1,1,?,?}, "64">;
857 def VST1q8Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
858 def VST1q16Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
859 def VST1q32Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
860 def VST1q64Pseudo_UPD : VSTQWBPseudo<IIC_VST1x2u>;
862 // ...with 3 registers (some of these are only for the disassembler):
863 class VST1D3<bits<4> op7_4, string Dt>
864 : NLdSt<0, 0b00, 0b0110, op7_4, (outs),
865 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3),
866 IIC_VST1x3, "vst1", Dt, "\\{$Vd, $src2, $src3\\}, $Rn", "", []> {
870 class VST1D3WB<bits<4> op7_4, string Dt>
871 : NLdSt<0, 0b00, 0b0110, op7_4, (outs GPR:$wb),
872 (ins addrmode6:$Rn, am6offset:$Rm,
873 DPR:$Vd, DPR:$src2, DPR:$src3),
874 IIC_VST1x3u, "vst1", Dt, "\\{$Vd, $src2, $src3\\}, $Rn$Rm",
875 "$Rn.addr = $wb", []> {
879 def VST1d8T : VST1D3<{0,0,0,?}, "8">;
880 def VST1d16T : VST1D3<{0,1,0,?}, "16">;
881 def VST1d32T : VST1D3<{1,0,0,?}, "32">;
882 def VST1d64T : VST1D3<{1,1,0,?}, "64">;
884 def VST1d8T_UPD : VST1D3WB<{0,0,0,?}, "8">;
885 def VST1d16T_UPD : VST1D3WB<{0,1,0,?}, "16">;
886 def VST1d32T_UPD : VST1D3WB<{1,0,0,?}, "32">;
887 def VST1d64T_UPD : VST1D3WB<{1,1,0,?}, "64">;
889 def VST1d64TPseudo : VSTQQPseudo<IIC_VST1x3>;
890 def VST1d64TPseudo_UPD : VSTQQWBPseudo<IIC_VST1x3u>;
892 // ...with 4 registers (some of these are only for the disassembler):
893 class VST1D4<bits<4> op7_4, string Dt>
894 : NLdSt<0, 0b00, 0b0010, op7_4, (outs),
895 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
896 IIC_VST1x4, "vst1", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn", "",
899 let Inst{5-4} = Rn{5-4};
901 class VST1D4WB<bits<4> op7_4, string Dt>
902 : NLdSt<0, 0b00, 0b0010, op7_4, (outs GPR:$wb),
903 (ins addrmode6:$Rn, am6offset:$Rm,
904 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST1x4u,
905 "vst1", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
906 "$Rn.addr = $wb", []> {
907 let Inst{5-4} = Rn{5-4};
910 def VST1d8Q : VST1D4<{0,0,?,?}, "8">;
911 def VST1d16Q : VST1D4<{0,1,?,?}, "16">;
912 def VST1d32Q : VST1D4<{1,0,?,?}, "32">;
913 def VST1d64Q : VST1D4<{1,1,?,?}, "64">;
915 def VST1d8Q_UPD : VST1D4WB<{0,0,?,?}, "8">;
916 def VST1d16Q_UPD : VST1D4WB<{0,1,?,?}, "16">;
917 def VST1d32Q_UPD : VST1D4WB<{1,0,?,?}, "32">;
918 def VST1d64Q_UPD : VST1D4WB<{1,1,?,?}, "64">;
920 def VST1d64QPseudo : VSTQQPseudo<IIC_VST1x4>;
921 def VST1d64QPseudo_UPD : VSTQQWBPseudo<IIC_VST1x4u>;
923 // VST2 : Vector Store (multiple 2-element structures)
924 class VST2D<bits<4> op11_8, bits<4> op7_4, string Dt>
925 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
926 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2),
927 IIC_VST2, "vst2", Dt, "\\{$Vd, $src2\\}, $Rn", "", []> {
929 let Inst{5-4} = Rn{5-4};
931 class VST2Q<bits<4> op7_4, string Dt>
932 : NLdSt<0, 0b00, 0b0011, op7_4, (outs),
933 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
934 IIC_VST2x2, "vst2", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn",
937 let Inst{5-4} = Rn{5-4};
940 def VST2d8 : VST2D<0b1000, {0,0,?,?}, "8">;
941 def VST2d16 : VST2D<0b1000, {0,1,?,?}, "16">;
942 def VST2d32 : VST2D<0b1000, {1,0,?,?}, "32">;
944 def VST2q8 : VST2Q<{0,0,?,?}, "8">;
945 def VST2q16 : VST2Q<{0,1,?,?}, "16">;
946 def VST2q32 : VST2Q<{1,0,?,?}, "32">;
948 def VST2d8Pseudo : VSTQPseudo<IIC_VST2>;
949 def VST2d16Pseudo : VSTQPseudo<IIC_VST2>;
950 def VST2d32Pseudo : VSTQPseudo<IIC_VST2>;
952 def VST2q8Pseudo : VSTQQPseudo<IIC_VST2x2>;
953 def VST2q16Pseudo : VSTQQPseudo<IIC_VST2x2>;
954 def VST2q32Pseudo : VSTQQPseudo<IIC_VST2x2>;
956 // ...with address register writeback:
957 class VST2DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
958 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
959 (ins addrmode6:$Rn, am6offset:$Rm, DPR:$Vd, DPR:$src2),
960 IIC_VST2u, "vst2", Dt, "\\{$Vd, $src2\\}, $Rn$Rm",
961 "$Rn.addr = $wb", []> {
962 let Inst{5-4} = Rn{5-4};
964 class VST2QWB<bits<4> op7_4, string Dt>
965 : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
966 (ins addrmode6:$Rn, am6offset:$Rm,
967 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST2x2u,
968 "vst2", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
969 "$Rn.addr = $wb", []> {
970 let Inst{5-4} = Rn{5-4};
973 def VST2d8_UPD : VST2DWB<0b1000, {0,0,?,?}, "8">;
974 def VST2d16_UPD : VST2DWB<0b1000, {0,1,?,?}, "16">;
975 def VST2d32_UPD : VST2DWB<0b1000, {1,0,?,?}, "32">;
977 def VST2q8_UPD : VST2QWB<{0,0,?,?}, "8">;
978 def VST2q16_UPD : VST2QWB<{0,1,?,?}, "16">;
979 def VST2q32_UPD : VST2QWB<{1,0,?,?}, "32">;
981 def VST2d8Pseudo_UPD : VSTQWBPseudo<IIC_VST2u>;
982 def VST2d16Pseudo_UPD : VSTQWBPseudo<IIC_VST2u>;
983 def VST2d32Pseudo_UPD : VSTQWBPseudo<IIC_VST2u>;
985 def VST2q8Pseudo_UPD : VSTQQWBPseudo<IIC_VST2x2u>;
986 def VST2q16Pseudo_UPD : VSTQQWBPseudo<IIC_VST2x2u>;
987 def VST2q32Pseudo_UPD : VSTQQWBPseudo<IIC_VST2x2u>;
989 // ...with double-spaced registers (for disassembly only):
990 def VST2b8 : VST2D<0b1001, {0,0,?,?}, "8">;
991 def VST2b16 : VST2D<0b1001, {0,1,?,?}, "16">;
992 def VST2b32 : VST2D<0b1001, {1,0,?,?}, "32">;
993 def VST2b8_UPD : VST2DWB<0b1001, {0,0,?,?}, "8">;
994 def VST2b16_UPD : VST2DWB<0b1001, {0,1,?,?}, "16">;
995 def VST2b32_UPD : VST2DWB<0b1001, {1,0,?,?}, "32">;
997 // VST3 : Vector Store (multiple 3-element structures)
998 class VST3D<bits<4> op11_8, bits<4> op7_4, string Dt>
999 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
1000 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3,
1001 "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn", "", []> {
1003 let Inst{4} = Rn{4};
1006 def VST3d8 : VST3D<0b0100, {0,0,0,?}, "8">;
1007 def VST3d16 : VST3D<0b0100, {0,1,0,?}, "16">;
1008 def VST3d32 : VST3D<0b0100, {1,0,0,?}, "32">;
1010 def VST3d8Pseudo : VSTQQPseudo<IIC_VST3>;
1011 def VST3d16Pseudo : VSTQQPseudo<IIC_VST3>;
1012 def VST3d32Pseudo : VSTQQPseudo<IIC_VST3>;
1014 // ...with address register writeback:
1015 class VST3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1016 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1017 (ins addrmode6:$Rn, am6offset:$Rm,
1018 DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3u,
1019 "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn$Rm",
1020 "$Rn.addr = $wb", []> {
1021 let Inst{4} = Rn{4};
1024 def VST3d8_UPD : VST3DWB<0b0100, {0,0,0,?}, "8">;
1025 def VST3d16_UPD : VST3DWB<0b0100, {0,1,0,?}, "16">;
1026 def VST3d32_UPD : VST3DWB<0b0100, {1,0,0,?}, "32">;
1028 def VST3d8Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>;
1029 def VST3d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>;
1030 def VST3d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>;
1032 // ...with double-spaced registers (non-updating versions for disassembly only):
1033 def VST3q8 : VST3D<0b0101, {0,0,0,?}, "8">;
1034 def VST3q16 : VST3D<0b0101, {0,1,0,?}, "16">;
1035 def VST3q32 : VST3D<0b0101, {1,0,0,?}, "32">;
1036 def VST3q8_UPD : VST3DWB<0b0101, {0,0,0,?}, "8">;
1037 def VST3q16_UPD : VST3DWB<0b0101, {0,1,0,?}, "16">;
1038 def VST3q32_UPD : VST3DWB<0b0101, {1,0,0,?}, "32">;
1040 def VST3q8Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1041 def VST3q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1042 def VST3q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1044 // ...alternate versions to be allocated odd register numbers:
1045 def VST3q8oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1046 def VST3q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1047 def VST3q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>;
1049 // VST4 : Vector Store (multiple 4-element structures)
1050 class VST4D<bits<4> op11_8, bits<4> op7_4, string Dt>
1051 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
1052 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
1053 IIC_VST4, "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn",
1056 let Inst{5-4} = Rn{5-4};
1059 def VST4d8 : VST4D<0b0000, {0,0,?,?}, "8">;
1060 def VST4d16 : VST4D<0b0000, {0,1,?,?}, "16">;
1061 def VST4d32 : VST4D<0b0000, {1,0,?,?}, "32">;
1063 def VST4d8Pseudo : VSTQQPseudo<IIC_VST4>;
1064 def VST4d16Pseudo : VSTQQPseudo<IIC_VST4>;
1065 def VST4d32Pseudo : VSTQQPseudo<IIC_VST4>;
1067 // ...with address register writeback:
1068 class VST4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1069 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1070 (ins addrmode6:$Rn, am6offset:$Rm,
1071 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST4u,
1072 "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
1073 "$Rn.addr = $wb", []> {
1074 let Inst{5-4} = Rn{5-4};
1077 def VST4d8_UPD : VST4DWB<0b0000, {0,0,?,?}, "8">;
1078 def VST4d16_UPD : VST4DWB<0b0000, {0,1,?,?}, "16">;
1079 def VST4d32_UPD : VST4DWB<0b0000, {1,0,?,?}, "32">;
1081 def VST4d8Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>;
1082 def VST4d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>;
1083 def VST4d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>;
1085 // ...with double-spaced registers (non-updating versions for disassembly only):
1086 def VST4q8 : VST4D<0b0001, {0,0,?,?}, "8">;
1087 def VST4q16 : VST4D<0b0001, {0,1,?,?}, "16">;
1088 def VST4q32 : VST4D<0b0001, {1,0,?,?}, "32">;
1089 def VST4q8_UPD : VST4DWB<0b0001, {0,0,?,?}, "8">;
1090 def VST4q16_UPD : VST4DWB<0b0001, {0,1,?,?}, "16">;
1091 def VST4q32_UPD : VST4DWB<0b0001, {1,0,?,?}, "32">;
1093 def VST4q8Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1094 def VST4q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1095 def VST4q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1097 // ...alternate versions to be allocated odd register numbers:
1098 def VST4q8oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1099 def VST4q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1100 def VST4q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>;
1102 } // mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1
1104 // Classes for VST*LN pseudo-instructions with multi-register operands.
1105 // These are expanded to real instructions after register allocation.
1106 class VSTQLNPseudo<InstrItinClass itin>
1107 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
1109 class VSTQLNWBPseudo<InstrItinClass itin>
1110 : PseudoNLdSt<(outs GPR:$wb),
1111 (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
1112 nohash_imm:$lane), itin, "$addr.addr = $wb">;
1113 class VSTQQLNPseudo<InstrItinClass itin>
1114 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
1116 class VSTQQLNWBPseudo<InstrItinClass itin>
1117 : PseudoNLdSt<(outs GPR:$wb),
1118 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
1119 nohash_imm:$lane), itin, "$addr.addr = $wb">;
1120 class VSTQQQQLNPseudo<InstrItinClass itin>
1121 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
1123 class VSTQQQQLNWBPseudo<InstrItinClass itin>
1124 : PseudoNLdSt<(outs GPR:$wb),
1125 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
1126 nohash_imm:$lane), itin, "$addr.addr = $wb">;
1128 // VST1LN : Vector Store (single element from one lane)
1129 class VST1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
1130 PatFrag StoreOp, SDNode ExtractOp>
1131 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1132 (ins addrmode6:$Rn, DPR:$Vd, nohash_imm:$lane),
1133 IIC_VST1ln, "vst1", Dt, "\\{$Vd[$lane]\\}, $Rn", "",
1134 [(StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane), addrmode6:$Rn)]> {
1137 class VST1QLNPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
1138 : VSTQLNPseudo<IIC_VST1ln> {
1139 let Pattern = [(StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
1143 def VST1LNd8 : VST1LN<0b0000, {?,?,?,0}, "8", v8i8, truncstorei8,
1145 let Inst{7-5} = lane{2-0};
1147 def VST1LNd16 : VST1LN<0b0100, {?,?,0,?}, "16", v4i16, truncstorei16,
1149 let Inst{7-6} = lane{1-0};
1150 let Inst{4} = Rn{5};
1152 def VST1LNd32 : VST1LN<0b1000, {?,0,?,?}, "32", v2i32, store, extractelt> {
1153 let Inst{7} = lane{0};
1154 let Inst{5-4} = Rn{5-4};
1157 def VST1LNq8Pseudo : VST1QLNPseudo<v16i8, truncstorei8, NEONvgetlaneu>;
1158 def VST1LNq16Pseudo : VST1QLNPseudo<v8i16, truncstorei16, NEONvgetlaneu>;
1159 def VST1LNq32Pseudo : VST1QLNPseudo<v4i32, store, extractelt>;
1161 let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in {
1163 // ...with address register writeback:
1164 class VST1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1165 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1166 (ins addrmode6:$Rn, am6offset:$Rm,
1167 DPR:$Vd, nohash_imm:$lane), IIC_VST1lnu, "vst1", Dt,
1168 "\\{$Vd[$lane]\\}, $Rn$Rm",
1169 "$Rn.addr = $wb", []>;
1171 def VST1LNd8_UPD : VST1LNWB<0b0000, {?,?,?,0}, "8"> {
1172 let Inst{7-5} = lane{2-0};
1174 def VST1LNd16_UPD : VST1LNWB<0b0100, {?,?,0,?}, "16"> {
1175 let Inst{7-6} = lane{1-0};
1176 let Inst{4} = Rn{5};
1178 def VST1LNd32_UPD : VST1LNWB<0b1000, {?,0,?,?}, "32"> {
1179 let Inst{7} = lane{0};
1180 let Inst{5-4} = Rn{5-4};
1183 def VST1LNq8Pseudo_UPD : VSTQLNWBPseudo<IIC_VST1lnu>;
1184 def VST1LNq16Pseudo_UPD : VSTQLNWBPseudo<IIC_VST1lnu>;
1185 def VST1LNq32Pseudo_UPD : VSTQLNWBPseudo<IIC_VST1lnu>;
1187 // VST2LN : Vector Store (single 2-element structure from one lane)
1188 class VST2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1189 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1190 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, nohash_imm:$lane),
1191 IIC_VST2ln, "vst2", Dt, "\\{$Vd[$lane], $src2[$lane]\\}, $Rn",
1194 let Inst{4} = Rn{4};
1197 def VST2LNd8 : VST2LN<0b0001, {?,?,?,?}, "8"> {
1198 let Inst{7-5} = lane{2-0};
1200 def VST2LNd16 : VST2LN<0b0101, {?,?,0,?}, "16"> {
1201 let Inst{7-6} = lane{1-0};
1203 def VST2LNd32 : VST2LN<0b1001, {?,0,0,?}, "32"> {
1204 let Inst{7} = lane{0};
1207 def VST2LNd8Pseudo : VSTQLNPseudo<IIC_VST2ln>;
1208 def VST2LNd16Pseudo : VSTQLNPseudo<IIC_VST2ln>;
1209 def VST2LNd32Pseudo : VSTQLNPseudo<IIC_VST2ln>;
1211 // ...with double-spaced registers:
1212 def VST2LNq16 : VST2LN<0b0101, {?,?,1,?}, "16"> {
1213 let Inst{7-6} = lane{1-0};
1214 let Inst{4} = Rn{4};
1216 def VST2LNq32 : VST2LN<0b1001, {?,1,0,?}, "32"> {
1217 let Inst{7} = lane{0};
1218 let Inst{4} = Rn{4};
1221 def VST2LNq16Pseudo : VSTQQLNPseudo<IIC_VST2ln>;
1222 def VST2LNq32Pseudo : VSTQQLNPseudo<IIC_VST2ln>;
1224 // ...with address register writeback:
1225 class VST2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1226 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1227 (ins addrmode6:$addr, am6offset:$offset,
1228 DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VST2lnu, "vst2", Dt,
1229 "\\{$src1[$lane], $src2[$lane]\\}, $addr$offset",
1230 "$addr.addr = $wb", []> {
1231 let Inst{4} = Rn{4};
1234 def VST2LNd8_UPD : VST2LNWB<0b0001, {?,?,?,?}, "8"> {
1235 let Inst{7-5} = lane{2-0};
1237 def VST2LNd16_UPD : VST2LNWB<0b0101, {?,?,0,?}, "16"> {
1238 let Inst{7-6} = lane{1-0};
1240 def VST2LNd32_UPD : VST2LNWB<0b1001, {?,0,0,?}, "32"> {
1241 let Inst{7} = lane{0};
1244 def VST2LNd8Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>;
1245 def VST2LNd16Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>;
1246 def VST2LNd32Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>;
1248 def VST2LNq16_UPD : VST2LNWB<0b0101, {?,?,1,?}, "16"> {
1249 let Inst{7-6} = lane{1-0};
1251 def VST2LNq32_UPD : VST2LNWB<0b1001, {?,1,0,?}, "32"> {
1252 let Inst{7} = lane{0};
1255 def VST2LNq16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>;
1256 def VST2LNq32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>;
1258 // VST3LN : Vector Store (single 3-element structure from one lane)
1259 class VST3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1260 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1261 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3,
1262 nohash_imm:$lane), IIC_VST3ln, "vst3", Dt,
1263 "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn", "", []> {
1267 def VST3LNd8 : VST3LN<0b0010, {?,?,?,0}, "8"> {
1268 let Inst{7-5} = lane{2-0};
1270 def VST3LNd16 : VST3LN<0b0110, {?,?,0,0}, "16"> {
1271 let Inst{7-6} = lane{1-0};
1273 def VST3LNd32 : VST3LN<0b1010, {?,0,0,0}, "32"> {
1274 let Inst{7} = lane{0};
1277 def VST3LNd8Pseudo : VSTQQLNPseudo<IIC_VST3ln>;
1278 def VST3LNd16Pseudo : VSTQQLNPseudo<IIC_VST3ln>;
1279 def VST3LNd32Pseudo : VSTQQLNPseudo<IIC_VST3ln>;
1281 // ...with double-spaced registers:
1282 def VST3LNq16 : VST3LN<0b0110, {?,?,1,0}, "16"> {
1283 let Inst{7-6} = lane{1-0};
1285 def VST3LNq32 : VST3LN<0b1010, {?,1,0,0}, "32"> {
1286 let Inst{7} = lane{0};
1289 def VST3LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
1290 def VST3LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
1292 // ...with address register writeback:
1293 class VST3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1294 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1295 (ins addrmode6:$Rn, am6offset:$Rm,
1296 DPR:$Vd, DPR:$src2, DPR:$src3, nohash_imm:$lane),
1297 IIC_VST3lnu, "vst3", Dt,
1298 "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn$Rm",
1299 "$Rn.addr = $wb", []>;
1301 def VST3LNd8_UPD : VST3LNWB<0b0010, {?,?,?,0}, "8"> {
1302 let Inst{7-5} = lane{2-0};
1304 def VST3LNd16_UPD : VST3LNWB<0b0110, {?,?,0,0}, "16"> {
1305 let Inst{7-6} = lane{1-0};
1307 def VST3LNd32_UPD : VST3LNWB<0b1010, {?,0,0,0}, "32"> {
1308 let Inst{7} = lane{0};
1311 def VST3LNd8Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>;
1312 def VST3LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>;
1313 def VST3LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>;
1315 def VST3LNq16_UPD : VST3LNWB<0b0110, {?,?,1,0}, "16"> {
1316 let Inst{7-6} = lane{1-0};
1318 def VST3LNq32_UPD : VST3LNWB<0b1010, {?,1,0,0}, "32"> {
1319 let Inst{7} = lane{0};
1322 def VST3LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>;
1323 def VST3LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>;
1325 // VST4LN : Vector Store (single 4-element structure from one lane)
1326 class VST4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1327 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
1328 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4,
1329 nohash_imm:$lane), IIC_VST4ln, "vst4", Dt,
1330 "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn",
1333 let Inst{4} = Rn{4};
1336 def VST4LNd8 : VST4LN<0b0011, {?,?,?,?}, "8"> {
1337 let Inst{7-5} = lane{2-0};
1339 def VST4LNd16 : VST4LN<0b0111, {?,?,0,?}, "16"> {
1340 let Inst{7-6} = lane{1-0};
1342 def VST4LNd32 : VST4LN<0b1011, {?,0,?,?}, "32"> {
1343 let Inst{7} = lane{0};
1344 let Inst{5} = Rn{5};
1347 def VST4LNd8Pseudo : VSTQQLNPseudo<IIC_VST4ln>;
1348 def VST4LNd16Pseudo : VSTQQLNPseudo<IIC_VST4ln>;
1349 def VST4LNd32Pseudo : VSTQQLNPseudo<IIC_VST4ln>;
1351 // ...with double-spaced registers:
1352 def VST4LNq16 : VST4LN<0b0111, {?,?,1,?}, "16"> {
1353 let Inst{7-6} = lane{1-0};
1355 def VST4LNq32 : VST4LN<0b1011, {?,1,?,?}, "32"> {
1356 let Inst{7} = lane{0};
1357 let Inst{5} = Rn{5};
1360 def VST4LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>;
1361 def VST4LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>;
1363 // ...with address register writeback:
1364 class VST4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1365 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
1366 (ins addrmode6:$Rn, am6offset:$Rm,
1367 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
1368 IIC_VST4lnu, "vst4", Dt,
1369 "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn$Rm",
1370 "$Rn.addr = $wb", []> {
1371 let Inst{4} = Rn{4};
1374 def VST4LNd8_UPD : VST4LNWB<0b0011, {?,?,?,?}, "8"> {
1375 let Inst{7-5} = lane{2-0};
1377 def VST4LNd16_UPD : VST4LNWB<0b0111, {?,?,0,?}, "16"> {
1378 let Inst{7-6} = lane{1-0};
1380 def VST4LNd32_UPD : VST4LNWB<0b1011, {?,0,?,?}, "32"> {
1381 let Inst{7} = lane{0};
1382 let Inst{5} = Rn{5};
1385 def VST4LNd8Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>;
1386 def VST4LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>;
1387 def VST4LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>;
1389 def VST4LNq16_UPD : VST4LNWB<0b0111, {?,?,1,?}, "16"> {
1390 let Inst{7-6} = lane{1-0};
1392 def VST4LNq32_UPD : VST4LNWB<0b1011, {?,1,?,?}, "32"> {
1393 let Inst{7} = lane{0};
1394 let Inst{5} = Rn{5};
1397 def VST4LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>;
1398 def VST4LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>;
1400 } // mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1
1403 //===----------------------------------------------------------------------===//
1404 // NEON pattern fragments
1405 //===----------------------------------------------------------------------===//
1407 // Extract D sub-registers of Q registers.
1408 def DSubReg_i8_reg : SDNodeXForm<imm, [{
1409 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1410 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/8, MVT::i32);
1412 def DSubReg_i16_reg : SDNodeXForm<imm, [{
1413 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1414 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/4, MVT::i32);
1416 def DSubReg_i32_reg : SDNodeXForm<imm, [{
1417 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1418 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/2, MVT::i32);
1420 def DSubReg_f64_reg : SDNodeXForm<imm, [{
1421 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
1422 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue(), MVT::i32);
1425 // Extract S sub-registers of Q/D registers.
1426 def SSubReg_f32_reg : SDNodeXForm<imm, [{
1427 assert(ARM::ssub_3 == ARM::ssub_0+3 && "Unexpected subreg numbering");
1428 return CurDAG->getTargetConstant(ARM::ssub_0 + N->getZExtValue(), MVT::i32);
1431 // Translate lane numbers from Q registers to D subregs.
1432 def SubReg_i8_lane : SDNodeXForm<imm, [{
1433 return CurDAG->getTargetConstant(N->getZExtValue() & 7, MVT::i32);
1435 def SubReg_i16_lane : SDNodeXForm<imm, [{
1436 return CurDAG->getTargetConstant(N->getZExtValue() & 3, MVT::i32);
1438 def SubReg_i32_lane : SDNodeXForm<imm, [{
1439 return CurDAG->getTargetConstant(N->getZExtValue() & 1, MVT::i32);
1442 //===----------------------------------------------------------------------===//
1443 // Instruction Classes
1444 //===----------------------------------------------------------------------===//
1446 // Basic 2-register operations: single-, double- and quad-register.
1447 class N2VS<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1448 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
1449 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
1450 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
1451 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src),
1452 IIC_VUNAD, OpcodeStr, Dt, "$dst, $src", "", []>;
1453 class N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1454 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
1455 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
1456 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
1457 (ins DPR:$src), IIC_VUNAD, OpcodeStr, Dt,"$dst, $src", "",
1458 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src))))]>;
1459 class N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1460 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
1461 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
1462 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
1463 (ins QPR:$src), IIC_VUNAQ, OpcodeStr, Dt,"$dst, $src", "",
1464 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src))))]>;
1466 // Basic 2-register intrinsics, both double- and quad-register.
1467 class N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1468 bits<2> op17_16, bits<5> op11_7, bit op4,
1469 InstrItinClass itin, string OpcodeStr, string Dt,
1470 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1471 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
1472 (ins DPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
1473 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
1474 class N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1475 bits<2> op17_16, bits<5> op11_7, bit op4,
1476 InstrItinClass itin, string OpcodeStr, string Dt,
1477 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1478 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
1479 (ins QPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
1480 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
1482 // Narrow 2-register operations.
1483 class N2VN<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1484 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1485 InstrItinClass itin, string OpcodeStr, string Dt,
1486 ValueType TyD, ValueType TyQ, SDNode OpNode>
1487 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$dst),
1488 (ins QPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
1489 [(set DPR:$dst, (TyD (OpNode (TyQ QPR:$src))))]>;
1491 // Narrow 2-register intrinsics.
1492 class N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1493 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1494 InstrItinClass itin, string OpcodeStr, string Dt,
1495 ValueType TyD, ValueType TyQ, Intrinsic IntOp>
1496 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$dst),
1497 (ins QPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
1498 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src))))]>;
1500 // Long 2-register operations (currently only used for VMOVL).
1501 class N2VL<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
1502 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
1503 InstrItinClass itin, string OpcodeStr, string Dt,
1504 ValueType TyQ, ValueType TyD, SDNode OpNode>
1505 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$dst),
1506 (ins DPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
1507 [(set QPR:$dst, (TyQ (OpNode (TyD DPR:$src))))]>;
1509 // 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
1510 class N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr, string Dt>
1511 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$dst1, DPR:$dst2),
1512 (ins DPR:$src1, DPR:$src2), IIC_VPERMD,
1513 OpcodeStr, Dt, "$dst1, $dst2",
1514 "$src1 = $dst1, $src2 = $dst2", []>;
1515 class N2VQShuffle<bits<2> op19_18, bits<5> op11_7,
1516 InstrItinClass itin, string OpcodeStr, string Dt>
1517 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$dst1, QPR:$dst2),
1518 (ins QPR:$src1, QPR:$src2), itin, OpcodeStr, Dt, "$dst1, $dst2",
1519 "$src1 = $dst1, $src2 = $dst2", []>;
1521 // Basic 3-register operations: single-, double- and quad-register.
1522 class N3VS<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1523 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
1524 SDNode OpNode, bit Commutable>
1525 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1526 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src1, DPR_VFP2:$src2), N3RegFrm,
1527 IIC_VBIND, OpcodeStr, Dt, "$dst, $src1, $src2", "", []> {
1528 let isCommutable = Commutable;
1531 class N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1532 InstrItinClass itin, string OpcodeStr, string Dt,
1533 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
1534 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1535 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1536 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1537 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
1538 let isCommutable = Commutable;
1540 // Same as N3VD but no data type.
1541 class N3VDX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1542 InstrItinClass itin, string OpcodeStr,
1543 ValueType ResTy, ValueType OpTy,
1544 SDNode OpNode, bit Commutable>
1545 : N3VX<op24, op23, op21_20, op11_8, 0, op4,
1546 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), N3RegFrm, itin,
1547 OpcodeStr, "$dst, $src1, $src2", "",
1548 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src1), (OpTy DPR:$src2))))]>{
1549 let isCommutable = Commutable;
1552 class N3VDSL<bits<2> op21_20, bits<4> op11_8,
1553 InstrItinClass itin, string OpcodeStr, string Dt,
1554 ValueType Ty, SDNode ShOp>
1555 : N3V<0, 1, op21_20, op11_8, 1, 0,
1556 (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
1557 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1558 [(set (Ty DPR:$dst),
1559 (Ty (ShOp (Ty DPR:$src1),
1560 (Ty (NEONvduplane (Ty DPR_VFP2:$src2),imm:$lane)))))]> {
1561 let isCommutable = 0;
1563 class N3VDSL16<bits<2> op21_20, bits<4> op11_8,
1564 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
1565 : N3V<0, 1, op21_20, op11_8, 1, 0,
1566 (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
1567 NVMulSLFrm, IIC_VMULi16D, OpcodeStr, Dt,"$dst, $src1, $src2[$lane]","",
1568 [(set (Ty DPR:$dst),
1569 (Ty (ShOp (Ty DPR:$src1),
1570 (Ty (NEONvduplane (Ty DPR_8:$src2), imm:$lane)))))]> {
1571 let isCommutable = 0;
1574 class N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1575 InstrItinClass itin, string OpcodeStr, string Dt,
1576 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
1577 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1578 (outs QPR:$Qd), (ins QPR:$Qn, QPR:$Qm), N3RegFrm, itin,
1579 OpcodeStr, Dt, "$Qd, $Qn, $Qm", "",
1580 [(set QPR:$Qd, (ResTy (OpNode (OpTy QPR:$Qn), (OpTy QPR:$Qm))))]> {
1581 let isCommutable = Commutable;
1583 class N3VQX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1584 InstrItinClass itin, string OpcodeStr,
1585 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
1586 : N3VX<op24, op23, op21_20, op11_8, 1, op4,
1587 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), N3RegFrm, itin,
1588 OpcodeStr, "$dst, $src1, $src2", "",
1589 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src1), (OpTy QPR:$src2))))]>{
1590 let isCommutable = Commutable;
1592 class N3VQSL<bits<2> op21_20, bits<4> op11_8,
1593 InstrItinClass itin, string OpcodeStr, string Dt,
1594 ValueType ResTy, ValueType OpTy, SDNode ShOp>
1595 : N3V<1, 1, op21_20, op11_8, 1, 0,
1596 (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
1597 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1598 [(set (ResTy QPR:$dst),
1599 (ResTy (ShOp (ResTy QPR:$src1),
1600 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2),
1602 let isCommutable = 0;
1604 class N3VQSL16<bits<2> op21_20, bits<4> op11_8, string OpcodeStr, string Dt,
1605 ValueType ResTy, ValueType OpTy, SDNode ShOp>
1606 : N3V<1, 1, op21_20, op11_8, 1, 0,
1607 (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane),
1608 NVMulSLFrm, IIC_VMULi16Q, OpcodeStr, Dt,"$dst, $src1, $src2[$lane]","",
1609 [(set (ResTy QPR:$dst),
1610 (ResTy (ShOp (ResTy QPR:$src1),
1611 (ResTy (NEONvduplane (OpTy DPR_8:$src2),
1613 let isCommutable = 0;
1616 // Basic 3-register intrinsics, both double- and quad-register.
1617 class N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1618 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1619 ValueType ResTy, ValueType OpTy, Intrinsic IntOp, bit Commutable>
1620 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1621 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), f, itin,
1622 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1623 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
1624 let isCommutable = Commutable;
1626 class N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1627 string OpcodeStr, string Dt, ValueType Ty, Intrinsic IntOp>
1628 : N3V<0, 1, op21_20, op11_8, 1, 0,
1629 (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
1630 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1631 [(set (Ty DPR:$dst),
1632 (Ty (IntOp (Ty DPR:$src1),
1633 (Ty (NEONvduplane (Ty DPR_VFP2:$src2),
1635 let isCommutable = 0;
1637 class N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1638 string OpcodeStr, string Dt, ValueType Ty, Intrinsic IntOp>
1639 : N3V<0, 1, op21_20, op11_8, 1, 0,
1640 (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
1641 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1642 [(set (Ty DPR:$dst),
1643 (Ty (IntOp (Ty DPR:$src1),
1644 (Ty (NEONvduplane (Ty DPR_8:$src2), imm:$lane)))))]> {
1645 let isCommutable = 0;
1647 class N3VDIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1648 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1649 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1650 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1651 (outs DPR:$Vd), (ins DPR:$Vm, DPR:$Vn), f, itin,
1652 OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
1653 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (OpTy DPR:$Vn))))]> {
1654 let isCommutable = 0;
1657 class N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1658 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1659 ValueType ResTy, ValueType OpTy, Intrinsic IntOp, bit Commutable>
1660 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1661 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin,
1662 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
1663 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
1664 let isCommutable = Commutable;
1666 class N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1667 string OpcodeStr, string Dt,
1668 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1669 : N3V<1, 1, op21_20, op11_8, 1, 0,
1670 (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
1671 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1672 [(set (ResTy QPR:$dst),
1673 (ResTy (IntOp (ResTy QPR:$src1),
1674 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2),
1676 let isCommutable = 0;
1678 class N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1679 string OpcodeStr, string Dt,
1680 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1681 : N3V<1, 1, op21_20, op11_8, 1, 0,
1682 (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane),
1683 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1684 [(set (ResTy QPR:$dst),
1685 (ResTy (IntOp (ResTy QPR:$src1),
1686 (ResTy (NEONvduplane (OpTy DPR_8:$src2),
1688 let isCommutable = 0;
1690 class N3VQIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1691 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
1692 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1693 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1694 (outs QPR:$Vd), (ins QPR:$Vm, QPR:$Vn), f, itin,
1695 OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
1696 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (OpTy QPR:$Vn))))]> {
1697 let isCommutable = 0;
1700 // Multiply-Add/Sub operations: single-, double- and quad-register.
1701 class N3VSMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1702 InstrItinClass itin, string OpcodeStr, string Dt,
1703 ValueType Ty, SDNode MulOp, SDNode OpNode>
1704 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1705 (outs DPR_VFP2:$dst),
1706 (ins DPR_VFP2:$src1, DPR_VFP2:$src2, DPR_VFP2:$src3), N3RegFrm, itin,
1707 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst", []>;
1709 class N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1710 InstrItinClass itin, string OpcodeStr, string Dt,
1711 ValueType Ty, SDNode MulOp, SDNode OpNode>
1712 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1713 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1714 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1715 [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
1716 (Ty (MulOp DPR:$Vn, DPR:$Vm)))))]>;
1718 class N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1719 string OpcodeStr, string Dt,
1720 ValueType Ty, SDNode MulOp, SDNode ShOp>
1721 : N3V<0, 1, op21_20, op11_8, 1, 0,
1723 (ins DPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane),
1725 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1726 [(set (Ty DPR:$dst),
1727 (Ty (ShOp (Ty DPR:$src1),
1728 (Ty (MulOp DPR:$src2,
1729 (Ty (NEONvduplane (Ty DPR_VFP2:$src3),
1731 class N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1732 string OpcodeStr, string Dt,
1733 ValueType Ty, SDNode MulOp, SDNode ShOp>
1734 : N3V<0, 1, op21_20, op11_8, 1, 0,
1736 (ins DPR:$src1, DPR:$Vn, DPR_8:$Vm, nohash_imm:$lane),
1738 OpcodeStr, Dt, "$Vd, $Vn, $Vm[$lane]", "$src1 = $Vd",
1740 (Ty (ShOp (Ty DPR:$src1),
1742 (Ty (NEONvduplane (Ty DPR_8:$Vm),
1745 class N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1746 InstrItinClass itin, string OpcodeStr, string Dt, ValueType Ty,
1747 SDNode MulOp, SDNode OpNode>
1748 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1749 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
1750 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1751 [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
1752 (Ty (MulOp QPR:$Vn, QPR:$Vm)))))]>;
1753 class N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1754 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
1755 SDNode MulOp, SDNode ShOp>
1756 : N3V<1, 1, op21_20, op11_8, 1, 0,
1758 (ins QPR:$src1, QPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane),
1760 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1761 [(set (ResTy QPR:$dst),
1762 (ResTy (ShOp (ResTy QPR:$src1),
1763 (ResTy (MulOp QPR:$src2,
1764 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src3),
1766 class N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1767 string OpcodeStr, string Dt,
1768 ValueType ResTy, ValueType OpTy,
1769 SDNode MulOp, SDNode ShOp>
1770 : N3V<1, 1, op21_20, op11_8, 1, 0,
1772 (ins QPR:$src1, QPR:$src2, DPR_8:$src3, nohash_imm:$lane),
1774 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1775 [(set (ResTy QPR:$dst),
1776 (ResTy (ShOp (ResTy QPR:$src1),
1777 (ResTy (MulOp QPR:$src2,
1778 (ResTy (NEONvduplane (OpTy DPR_8:$src3),
1781 // Neon Intrinsic-Op instructions (VABA): double- and quad-register.
1782 class N3VDIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1783 InstrItinClass itin, string OpcodeStr, string Dt,
1784 ValueType Ty, Intrinsic IntOp, SDNode OpNode>
1785 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1786 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1787 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1788 [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
1789 (Ty (IntOp (Ty DPR:$Vn), (Ty DPR:$Vm))))))]>;
1790 class N3VQIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1791 InstrItinClass itin, string OpcodeStr, string Dt,
1792 ValueType Ty, Intrinsic IntOp, SDNode OpNode>
1793 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1794 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
1795 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1796 [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
1797 (Ty (IntOp (Ty QPR:$Vn), (Ty QPR:$Vm))))))]>;
1799 // Neon 3-argument intrinsics, both double- and quad-register.
1800 // The destination register is also used as the first source operand register.
1801 class N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1802 InstrItinClass itin, string OpcodeStr, string Dt,
1803 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1804 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1805 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), N3RegFrm, itin,
1806 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
1807 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1),
1808 (OpTy DPR:$src2), (OpTy DPR:$src3))))]>;
1809 class N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1810 InstrItinClass itin, string OpcodeStr, string Dt,
1811 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1812 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1813 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), N3RegFrm, itin,
1814 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
1815 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1),
1816 (OpTy QPR:$src2), (OpTy QPR:$src3))))]>;
1818 // Long Multiply-Add/Sub operations.
1819 class N3VLMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1820 InstrItinClass itin, string OpcodeStr, string Dt,
1821 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
1822 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1823 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1824 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1825 [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
1826 (TyQ (MulOp (TyD DPR:$Vn),
1827 (TyD DPR:$Vm)))))]>;
1828 class N3VLMulOpSL<bit op24, bits<2> op21_20, bits<4> op11_8,
1829 InstrItinClass itin, string OpcodeStr, string Dt,
1830 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
1831 : N3V<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$dst),
1832 (ins QPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane),
1834 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1836 (OpNode (TyQ QPR:$src1),
1837 (TyQ (MulOp (TyD DPR:$src2),
1838 (TyD (NEONvduplane (TyD DPR_VFP2:$src3),
1840 class N3VLMulOpSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
1841 InstrItinClass itin, string OpcodeStr, string Dt,
1842 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
1843 : N3V<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$dst),
1844 (ins QPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane),
1846 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1848 (OpNode (TyQ QPR:$src1),
1849 (TyQ (MulOp (TyD DPR:$src2),
1850 (TyD (NEONvduplane (TyD DPR_8:$src3),
1853 // Long Intrinsic-Op vector operations with explicit extend (VABAL).
1854 class N3VLIntExtOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1855 InstrItinClass itin, string OpcodeStr, string Dt,
1856 ValueType TyQ, ValueType TyD, Intrinsic IntOp, SDNode ExtOp,
1858 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1859 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1860 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1861 [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
1862 (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
1863 (TyD DPR:$Vm)))))))]>;
1865 // Neon Long 3-argument intrinsic. The destination register is
1866 // a quad-register and is also used as the first source operand register.
1867 class N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1868 InstrItinClass itin, string OpcodeStr, string Dt,
1869 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
1870 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1871 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
1872 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
1874 (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$Vn), (TyD DPR:$Vm))))]>;
1875 class N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1876 string OpcodeStr, string Dt,
1877 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1878 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1880 (ins QPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane),
1882 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1883 [(set (ResTy QPR:$dst),
1884 (ResTy (IntOp (ResTy QPR:$src1),
1886 (OpTy (NEONvduplane (OpTy DPR_VFP2:$src3),
1888 class N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8,
1889 InstrItinClass itin, string OpcodeStr, string Dt,
1890 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1891 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1893 (ins QPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane),
1895 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1896 [(set (ResTy QPR:$dst),
1897 (ResTy (IntOp (ResTy QPR:$src1),
1899 (OpTy (NEONvduplane (OpTy DPR_8:$src3),
1902 // Narrowing 3-register intrinsics.
1903 class N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1904 string OpcodeStr, string Dt, ValueType TyD, ValueType TyQ,
1905 Intrinsic IntOp, bit Commutable>
1906 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1907 (outs DPR:$dst), (ins QPR:$src1, QPR:$src2), N3RegFrm, IIC_VBINi4D,
1908 OpcodeStr, Dt, "$dst, $src1, $src2", "",
1909 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src1), (TyQ QPR:$src2))))]> {
1910 let isCommutable = Commutable;
1913 // Long 3-register operations.
1914 class N3VL<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1915 InstrItinClass itin, string OpcodeStr, string Dt,
1916 ValueType TyQ, ValueType TyD, SDNode OpNode, bit Commutable>
1917 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1918 (outs QPR:$dst), (ins DPR:$src1, DPR:$src2), N3RegFrm, itin,
1919 OpcodeStr, Dt, "$dst, $src1, $src2", "",
1920 [(set QPR:$dst, (TyQ (OpNode (TyD DPR:$src1), (TyD DPR:$src2))))]> {
1921 let isCommutable = Commutable;
1923 class N3VLSL<bit op24, bits<2> op21_20, bits<4> op11_8,
1924 InstrItinClass itin, string OpcodeStr, string Dt,
1925 ValueType TyQ, ValueType TyD, SDNode OpNode>
1926 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1927 (outs QPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
1928 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1930 (TyQ (OpNode (TyD DPR:$src1),
1931 (TyD (NEONvduplane (TyD DPR_VFP2:$src2),imm:$lane)))))]>;
1932 class N3VLSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
1933 InstrItinClass itin, string OpcodeStr, string Dt,
1934 ValueType TyQ, ValueType TyD, SDNode OpNode>
1935 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1936 (outs QPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
1937 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1939 (TyQ (OpNode (TyD DPR:$src1),
1940 (TyD (NEONvduplane (TyD DPR_8:$src2), imm:$lane)))))]>;
1942 // Long 3-register operations with explicitly extended operands.
1943 class N3VLExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1944 InstrItinClass itin, string OpcodeStr, string Dt,
1945 ValueType TyQ, ValueType TyD, SDNode OpNode, SDNode ExtOp,
1947 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1948 (outs QPR:$Qd), (ins DPR:$Dn, DPR:$Dm), N3RegFrm, itin,
1949 OpcodeStr, Dt, "$Qd, $Dn, $Dm", "",
1950 [(set QPR:$Qd, (OpNode (TyQ (ExtOp (TyD DPR:$Dn))),
1951 (TyQ (ExtOp (TyD DPR:$Dm)))))]> {
1952 let isCommutable = Commutable;
1955 // Long 3-register intrinsics with explicit extend (VABDL).
1956 class N3VLIntExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1957 InstrItinClass itin, string OpcodeStr, string Dt,
1958 ValueType TyQ, ValueType TyD, Intrinsic IntOp, SDNode ExtOp,
1960 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1961 (outs QPR:$dst), (ins DPR:$src1, DPR:$src2), N3RegFrm, itin,
1962 OpcodeStr, Dt, "$dst, $src1, $src2", "",
1963 [(set QPR:$dst, (TyQ (ExtOp (TyD (IntOp (TyD DPR:$src1),
1964 (TyD DPR:$src2))))))]> {
1965 let isCommutable = Commutable;
1968 // Long 3-register intrinsics.
1969 class N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1970 InstrItinClass itin, string OpcodeStr, string Dt,
1971 ValueType TyQ, ValueType TyD, Intrinsic IntOp, bit Commutable>
1972 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1973 (outs QPR:$dst), (ins DPR:$src1, DPR:$src2), N3RegFrm, itin,
1974 OpcodeStr, Dt, "$dst, $src1, $src2", "",
1975 [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src1), (TyD DPR:$src2))))]> {
1976 let isCommutable = Commutable;
1978 class N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
1979 string OpcodeStr, string Dt,
1980 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1981 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1982 (outs QPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
1983 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1984 [(set (ResTy QPR:$dst),
1985 (ResTy (IntOp (OpTy DPR:$src1),
1986 (OpTy (NEONvduplane (OpTy DPR_VFP2:$src2),
1988 class N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
1989 InstrItinClass itin, string OpcodeStr, string Dt,
1990 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1991 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1992 (outs QPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
1993 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1994 [(set (ResTy QPR:$dst),
1995 (ResTy (IntOp (OpTy DPR:$src1),
1996 (OpTy (NEONvduplane (OpTy DPR_8:$src2),
1999 // Wide 3-register operations.
2000 class N3VW<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2001 string OpcodeStr, string Dt, ValueType TyQ, ValueType TyD,
2002 SDNode OpNode, SDNode ExtOp, bit Commutable>
2003 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2004 (outs QPR:$Qd), (ins QPR:$Qn, DPR:$Dm), N3RegFrm, IIC_VSUBiD,
2005 OpcodeStr, Dt, "$Qd, $Qn, $Dm", "",
2006 [(set QPR:$Qd, (OpNode (TyQ QPR:$Qn),
2007 (TyQ (ExtOp (TyD DPR:$Dm)))))]> {
2008 let isCommutable = Commutable;
2011 // Pairwise long 2-register intrinsics, both double- and quad-register.
2012 class N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2013 bits<2> op17_16, bits<5> op11_7, bit op4,
2014 string OpcodeStr, string Dt,
2015 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2016 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
2017 (ins DPR:$src), IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
2018 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
2019 class N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2020 bits<2> op17_16, bits<5> op11_7, bit op4,
2021 string OpcodeStr, string Dt,
2022 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2023 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
2024 (ins QPR:$src), IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
2025 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
2027 // Pairwise long 2-register accumulate intrinsics,
2028 // both double- and quad-register.
2029 // The destination register is also used as the first source operand register.
2030 class N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2031 bits<2> op17_16, bits<5> op11_7, bit op4,
2032 string OpcodeStr, string Dt,
2033 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2034 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
2035 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vm), IIC_VPALiD,
2036 OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
2037 [(set DPR:$Vd, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$Vm))))]>;
2038 class N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2039 bits<2> op17_16, bits<5> op11_7, bit op4,
2040 string OpcodeStr, string Dt,
2041 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
2042 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
2043 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vm), IIC_VPALiQ,
2044 OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
2045 [(set QPR:$Vd, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$Vm))))]>;
2047 // Shift by immediate,
2048 // both double- and quad-register.
2049 class N2VDSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2050 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
2051 ValueType Ty, SDNode OpNode>
2052 : N2VImm<op24, op23, op11_8, op7, 0, op4,
2053 (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), f, itin,
2054 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
2055 [(set DPR:$dst, (Ty (OpNode (Ty DPR:$src), (i32 imm:$SIMM))))]>;
2056 class N2VQSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2057 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
2058 ValueType Ty, SDNode OpNode>
2059 : N2VImm<op24, op23, op11_8, op7, 1, op4,
2060 (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), f, itin,
2061 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
2062 [(set QPR:$dst, (Ty (OpNode (Ty QPR:$src), (i32 imm:$SIMM))))]>;
2064 // Long shift by immediate.
2065 class N2VLSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
2066 string OpcodeStr, string Dt,
2067 ValueType ResTy, ValueType OpTy, SDNode OpNode>
2068 : N2VImm<op24, op23, op11_8, op7, op6, op4,
2069 (outs QPR:$dst), (ins DPR:$src, i32imm:$SIMM), N2RegVShLFrm,
2070 IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src, $SIMM", "",
2071 [(set QPR:$dst, (ResTy (OpNode (OpTy DPR:$src),
2072 (i32 imm:$SIMM))))]>;
2074 // Narrow shift by immediate.
2075 class N2VNSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
2076 InstrItinClass itin, string OpcodeStr, string Dt,
2077 ValueType ResTy, ValueType OpTy, SDNode OpNode>
2078 : N2VImm<op24, op23, op11_8, op7, op6, op4,
2079 (outs DPR:$dst), (ins QPR:$src, i32imm:$SIMM), N2RegVShRFrm, itin,
2080 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
2081 [(set DPR:$dst, (ResTy (OpNode (OpTy QPR:$src),
2082 (i32 imm:$SIMM))))]>;
2084 // Shift right by immediate and accumulate,
2085 // both double- and quad-register.
2086 class N2VDShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2087 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
2088 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
2089 (ins DPR:$src1, DPR:$Vm, i32imm:$SIMM), N2RegVShRFrm, IIC_VPALiD,
2090 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2091 [(set DPR:$Vd, (Ty (add DPR:$src1,
2092 (Ty (ShOp DPR:$Vm, (i32 imm:$SIMM))))))]>;
2093 class N2VQShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2094 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
2095 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
2096 (ins QPR:$src1, QPR:$Vm, i32imm:$SIMM), N2RegVShRFrm, IIC_VPALiD,
2097 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2098 [(set QPR:$Vd, (Ty (add QPR:$src1,
2099 (Ty (ShOp QPR:$Vm, (i32 imm:$SIMM))))))]>;
2101 // Shift by immediate and insert,
2102 // both double- and quad-register.
2103 class N2VDShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2104 Format f, string OpcodeStr, string Dt, ValueType Ty,SDNode ShOp>
2105 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
2106 (ins DPR:$src1, DPR:$Vm, i32imm:$SIMM), f, IIC_VSHLiD,
2107 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2108 [(set DPR:$Vd, (Ty (ShOp DPR:$src1, DPR:$Vm, (i32 imm:$SIMM))))]>;
2109 class N2VQShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2110 Format f, string OpcodeStr, string Dt, ValueType Ty,SDNode ShOp>
2111 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
2112 (ins QPR:$src1, QPR:$Vm, i32imm:$SIMM), f, IIC_VSHLiQ,
2113 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
2114 [(set QPR:$Vd, (Ty (ShOp QPR:$src1, QPR:$Vm, (i32 imm:$SIMM))))]>;
2116 // Convert, with fractional bits immediate,
2117 // both double- and quad-register.
2118 class N2VCvtD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2119 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
2121 : N2VImm<op24, op23, op11_8, op7, 0, op4,
2122 (outs DPR:$Vd), (ins DPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
2123 IIC_VUNAD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2124 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (i32 imm:$SIMM))))]>;
2125 class N2VCvtQ<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
2126 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
2128 : N2VImm<op24, op23, op11_8, op7, 1, op4,
2129 (outs QPR:$Vd), (ins QPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
2130 IIC_VUNAQ, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
2131 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (i32 imm:$SIMM))))]>;
2133 //===----------------------------------------------------------------------===//
2135 //===----------------------------------------------------------------------===//
2137 // Abbreviations used in multiclass suffixes:
2138 // Q = quarter int (8 bit) elements
2139 // H = half int (16 bit) elements
2140 // S = single int (32 bit) elements
2141 // D = double int (64 bit) elements
2143 // Neon 2-register vector operations -- for disassembly only.
2145 // First with only element sizes of 8, 16 and 32 bits:
2146 multiclass N2V_QHS_cmp<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2147 bits<5> op11_7, bit op4, string opc, string Dt,
2149 // 64-bit vector types.
2150 def v8i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 0, op4,
2151 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
2152 opc, !strconcat(Dt, "8"), asm, "", []>;
2153 def v4i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
2154 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
2155 opc, !strconcat(Dt, "16"), asm, "", []>;
2156 def v2i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
2157 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
2158 opc, !strconcat(Dt, "32"), asm, "", []>;
2159 def v2f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
2160 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
2161 opc, "f32", asm, "", []> {
2162 let Inst{10} = 1; // overwrite F = 1
2165 // 128-bit vector types.
2166 def v16i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 1, op4,
2167 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
2168 opc, !strconcat(Dt, "8"), asm, "", []>;
2169 def v8i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
2170 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
2171 opc, !strconcat(Dt, "16"), asm, "", []>;
2172 def v4i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
2173 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
2174 opc, !strconcat(Dt, "32"), asm, "", []>;
2175 def v4f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
2176 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
2177 opc, "f32", asm, "", []> {
2178 let Inst{10} = 1; // overwrite F = 1
2182 // Neon 3-register vector operations.
2184 // First with only element sizes of 8, 16 and 32 bits:
2185 multiclass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2186 InstrItinClass itinD16, InstrItinClass itinD32,
2187 InstrItinClass itinQ16, InstrItinClass itinQ32,
2188 string OpcodeStr, string Dt,
2189 SDNode OpNode, bit Commutable = 0> {
2190 // 64-bit vector types.
2191 def v8i8 : N3VD<op24, op23, 0b00, op11_8, op4, itinD16,
2192 OpcodeStr, !strconcat(Dt, "8"),
2193 v8i8, v8i8, OpNode, Commutable>;
2194 def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16,
2195 OpcodeStr, !strconcat(Dt, "16"),
2196 v4i16, v4i16, OpNode, Commutable>;
2197 def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32,
2198 OpcodeStr, !strconcat(Dt, "32"),
2199 v2i32, v2i32, OpNode, Commutable>;
2201 // 128-bit vector types.
2202 def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16,
2203 OpcodeStr, !strconcat(Dt, "8"),
2204 v16i8, v16i8, OpNode, Commutable>;
2205 def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16,
2206 OpcodeStr, !strconcat(Dt, "16"),
2207 v8i16, v8i16, OpNode, Commutable>;
2208 def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32,
2209 OpcodeStr, !strconcat(Dt, "32"),
2210 v4i32, v4i32, OpNode, Commutable>;
2213 multiclass N3VSL_HS<bits<4> op11_8, string OpcodeStr, string Dt, SDNode ShOp> {
2214 def v4i16 : N3VDSL16<0b01, op11_8, OpcodeStr, !strconcat(Dt, "16"),
2216 def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, OpcodeStr, !strconcat(Dt,"32"),
2218 def v8i16 : N3VQSL16<0b01, op11_8, OpcodeStr, !strconcat(Dt, "16"),
2219 v8i16, v4i16, ShOp>;
2220 def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, OpcodeStr, !strconcat(Dt,"32"),
2221 v4i32, v2i32, ShOp>;
2224 // ....then also with element size 64 bits:
2225 multiclass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2226 InstrItinClass itinD, InstrItinClass itinQ,
2227 string OpcodeStr, string Dt,
2228 SDNode OpNode, bit Commutable = 0>
2229 : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ,
2230 OpcodeStr, Dt, OpNode, Commutable> {
2231 def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD,
2232 OpcodeStr, !strconcat(Dt, "64"),
2233 v1i64, v1i64, OpNode, Commutable>;
2234 def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ,
2235 OpcodeStr, !strconcat(Dt, "64"),
2236 v2i64, v2i64, OpNode, Commutable>;
2240 // Neon Narrowing 2-register vector operations,
2241 // source operand element sizes of 16, 32 and 64 bits:
2242 multiclass N2VN_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2243 bits<5> op11_7, bit op6, bit op4,
2244 InstrItinClass itin, string OpcodeStr, string Dt,
2246 def v8i8 : N2VN<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
2247 itin, OpcodeStr, !strconcat(Dt, "16"),
2248 v8i8, v8i16, OpNode>;
2249 def v4i16 : N2VN<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
2250 itin, OpcodeStr, !strconcat(Dt, "32"),
2251 v4i16, v4i32, OpNode>;
2252 def v2i32 : N2VN<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
2253 itin, OpcodeStr, !strconcat(Dt, "64"),
2254 v2i32, v2i64, OpNode>;
2257 // Neon Narrowing 2-register vector intrinsics,
2258 // source operand element sizes of 16, 32 and 64 bits:
2259 multiclass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2260 bits<5> op11_7, bit op6, bit op4,
2261 InstrItinClass itin, string OpcodeStr, string Dt,
2263 def v8i8 : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
2264 itin, OpcodeStr, !strconcat(Dt, "16"),
2265 v8i8, v8i16, IntOp>;
2266 def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
2267 itin, OpcodeStr, !strconcat(Dt, "32"),
2268 v4i16, v4i32, IntOp>;
2269 def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
2270 itin, OpcodeStr, !strconcat(Dt, "64"),
2271 v2i32, v2i64, IntOp>;
2275 // Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
2276 // source operand element sizes of 16, 32 and 64 bits:
2277 multiclass N2VL_QHS<bits<2> op24_23, bits<5> op11_7, bit op6, bit op4,
2278 string OpcodeStr, string Dt, SDNode OpNode> {
2279 def v8i16 : N2VL<op24_23, 0b00, 0b10, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
2280 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode>;
2281 def v4i32 : N2VL<op24_23, 0b01, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
2282 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
2283 def v2i64 : N2VL<op24_23, 0b10, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
2284 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
2288 // Neon 3-register vector intrinsics.
2290 // First with only element sizes of 16 and 32 bits:
2291 multiclass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2292 InstrItinClass itinD16, InstrItinClass itinD32,
2293 InstrItinClass itinQ16, InstrItinClass itinQ32,
2294 string OpcodeStr, string Dt,
2295 Intrinsic IntOp, bit Commutable = 0> {
2296 // 64-bit vector types.
2297 def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, f, itinD16,
2298 OpcodeStr, !strconcat(Dt, "16"),
2299 v4i16, v4i16, IntOp, Commutable>;
2300 def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, f, itinD32,
2301 OpcodeStr, !strconcat(Dt, "32"),
2302 v2i32, v2i32, IntOp, Commutable>;
2304 // 128-bit vector types.
2305 def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, f, itinQ16,
2306 OpcodeStr, !strconcat(Dt, "16"),
2307 v8i16, v8i16, IntOp, Commutable>;
2308 def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, f, itinQ32,
2309 OpcodeStr, !strconcat(Dt, "32"),
2310 v4i32, v4i32, IntOp, Commutable>;
2312 multiclass N3VInt_HSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2313 InstrItinClass itinD16, InstrItinClass itinD32,
2314 InstrItinClass itinQ16, InstrItinClass itinQ32,
2315 string OpcodeStr, string Dt,
2317 // 64-bit vector types.
2318 def v4i16 : N3VDIntSh<op24, op23, 0b01, op11_8, op4, f, itinD16,
2319 OpcodeStr, !strconcat(Dt, "16"),
2320 v4i16, v4i16, IntOp>;
2321 def v2i32 : N3VDIntSh<op24, op23, 0b10, op11_8, op4, f, itinD32,
2322 OpcodeStr, !strconcat(Dt, "32"),
2323 v2i32, v2i32, IntOp>;
2325 // 128-bit vector types.
2326 def v8i16 : N3VQIntSh<op24, op23, 0b01, op11_8, op4, f, itinQ16,
2327 OpcodeStr, !strconcat(Dt, "16"),
2328 v8i16, v8i16, IntOp>;
2329 def v4i32 : N3VQIntSh<op24, op23, 0b10, op11_8, op4, f, itinQ32,
2330 OpcodeStr, !strconcat(Dt, "32"),
2331 v4i32, v4i32, IntOp>;
2334 multiclass N3VIntSL_HS<bits<4> op11_8,
2335 InstrItinClass itinD16, InstrItinClass itinD32,
2336 InstrItinClass itinQ16, InstrItinClass itinQ32,
2337 string OpcodeStr, string Dt, Intrinsic IntOp> {
2338 def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16,
2339 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp>;
2340 def v2i32 : N3VDIntSL<0b10, op11_8, itinD32,
2341 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp>;
2342 def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16,
2343 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16, IntOp>;
2344 def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32,
2345 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32, IntOp>;
2348 // ....then also with element size of 8 bits:
2349 multiclass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2350 InstrItinClass itinD16, InstrItinClass itinD32,
2351 InstrItinClass itinQ16, InstrItinClass itinQ32,
2352 string OpcodeStr, string Dt,
2353 Intrinsic IntOp, bit Commutable = 0>
2354 : N3VInt_HS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2355 OpcodeStr, Dt, IntOp, Commutable> {
2356 def v8i8 : N3VDInt<op24, op23, 0b00, op11_8, op4, f, itinD16,
2357 OpcodeStr, !strconcat(Dt, "8"),
2358 v8i8, v8i8, IntOp, Commutable>;
2359 def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, f, itinQ16,
2360 OpcodeStr, !strconcat(Dt, "8"),
2361 v16i8, v16i8, IntOp, Commutable>;
2363 multiclass N3VInt_QHSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2364 InstrItinClass itinD16, InstrItinClass itinD32,
2365 InstrItinClass itinQ16, InstrItinClass itinQ32,
2366 string OpcodeStr, string Dt,
2368 : N3VInt_HSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2369 OpcodeStr, Dt, IntOp> {
2370 def v8i8 : N3VDIntSh<op24, op23, 0b00, op11_8, op4, f, itinD16,
2371 OpcodeStr, !strconcat(Dt, "8"),
2373 def v16i8 : N3VQIntSh<op24, op23, 0b00, op11_8, op4, f, itinQ16,
2374 OpcodeStr, !strconcat(Dt, "8"),
2375 v16i8, v16i8, IntOp>;
2379 // ....then also with element size of 64 bits:
2380 multiclass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2381 InstrItinClass itinD16, InstrItinClass itinD32,
2382 InstrItinClass itinQ16, InstrItinClass itinQ32,
2383 string OpcodeStr, string Dt,
2384 Intrinsic IntOp, bit Commutable = 0>
2385 : N3VInt_QHS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2386 OpcodeStr, Dt, IntOp, Commutable> {
2387 def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, f, itinD32,
2388 OpcodeStr, !strconcat(Dt, "64"),
2389 v1i64, v1i64, IntOp, Commutable>;
2390 def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, f, itinQ32,
2391 OpcodeStr, !strconcat(Dt, "64"),
2392 v2i64, v2i64, IntOp, Commutable>;
2394 multiclass N3VInt_QHSDSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
2395 InstrItinClass itinD16, InstrItinClass itinD32,
2396 InstrItinClass itinQ16, InstrItinClass itinQ32,
2397 string OpcodeStr, string Dt,
2399 : N3VInt_QHSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
2400 OpcodeStr, Dt, IntOp> {
2401 def v1i64 : N3VDIntSh<op24, op23, 0b11, op11_8, op4, f, itinD32,
2402 OpcodeStr, !strconcat(Dt, "64"),
2403 v1i64, v1i64, IntOp>;
2404 def v2i64 : N3VQIntSh<op24, op23, 0b11, op11_8, op4, f, itinQ32,
2405 OpcodeStr, !strconcat(Dt, "64"),
2406 v2i64, v2i64, IntOp>;
2409 // Neon Narrowing 3-register vector intrinsics,
2410 // source operand element sizes of 16, 32 and 64 bits:
2411 multiclass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2412 string OpcodeStr, string Dt,
2413 Intrinsic IntOp, bit Commutable = 0> {
2414 def v8i8 : N3VNInt<op24, op23, 0b00, op11_8, op4,
2415 OpcodeStr, !strconcat(Dt, "16"),
2416 v8i8, v8i16, IntOp, Commutable>;
2417 def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4,
2418 OpcodeStr, !strconcat(Dt, "32"),
2419 v4i16, v4i32, IntOp, Commutable>;
2420 def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4,
2421 OpcodeStr, !strconcat(Dt, "64"),
2422 v2i32, v2i64, IntOp, Commutable>;
2426 // Neon Long 3-register vector operations.
2428 multiclass N3VL_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2429 InstrItinClass itin16, InstrItinClass itin32,
2430 string OpcodeStr, string Dt,
2431 SDNode OpNode, bit Commutable = 0> {
2432 def v8i16 : N3VL<op24, op23, 0b00, op11_8, op4, itin16,
2433 OpcodeStr, !strconcat(Dt, "8"),
2434 v8i16, v8i8, OpNode, Commutable>;
2435 def v4i32 : N3VL<op24, op23, 0b01, op11_8, op4, itin16,
2436 OpcodeStr, !strconcat(Dt, "16"),
2437 v4i32, v4i16, OpNode, Commutable>;
2438 def v2i64 : N3VL<op24, op23, 0b10, op11_8, op4, itin32,
2439 OpcodeStr, !strconcat(Dt, "32"),
2440 v2i64, v2i32, OpNode, Commutable>;
2443 multiclass N3VLSL_HS<bit op24, bits<4> op11_8,
2444 InstrItinClass itin, string OpcodeStr, string Dt,
2446 def v4i16 : N3VLSL16<op24, 0b01, op11_8, itin, OpcodeStr,
2447 !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
2448 def v2i32 : N3VLSL<op24, 0b10, op11_8, itin, OpcodeStr,
2449 !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
2452 multiclass N3VLExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2453 InstrItinClass itin16, InstrItinClass itin32,
2454 string OpcodeStr, string Dt,
2455 SDNode OpNode, SDNode ExtOp, bit Commutable = 0> {
2456 def v8i16 : N3VLExt<op24, op23, 0b00, op11_8, op4, itin16,
2457 OpcodeStr, !strconcat(Dt, "8"),
2458 v8i16, v8i8, OpNode, ExtOp, Commutable>;
2459 def v4i32 : N3VLExt<op24, op23, 0b01, op11_8, op4, itin16,
2460 OpcodeStr, !strconcat(Dt, "16"),
2461 v4i32, v4i16, OpNode, ExtOp, Commutable>;
2462 def v2i64 : N3VLExt<op24, op23, 0b10, op11_8, op4, itin32,
2463 OpcodeStr, !strconcat(Dt, "32"),
2464 v2i64, v2i32, OpNode, ExtOp, Commutable>;
2467 // Neon Long 3-register vector intrinsics.
2469 // First with only element sizes of 16 and 32 bits:
2470 multiclass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
2471 InstrItinClass itin16, InstrItinClass itin32,
2472 string OpcodeStr, string Dt,
2473 Intrinsic IntOp, bit Commutable = 0> {
2474 def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin16,
2475 OpcodeStr, !strconcat(Dt, "16"),
2476 v4i32, v4i16, IntOp, Commutable>;
2477 def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin32,
2478 OpcodeStr, !strconcat(Dt, "32"),
2479 v2i64, v2i32, IntOp, Commutable>;
2482 multiclass N3VLIntSL_HS<bit op24, bits<4> op11_8,
2483 InstrItinClass itin, string OpcodeStr, string Dt,
2485 def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin,
2486 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
2487 def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin,
2488 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
2491 // ....then also with element size of 8 bits:
2492 multiclass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2493 InstrItinClass itin16, InstrItinClass itin32,
2494 string OpcodeStr, string Dt,
2495 Intrinsic IntOp, bit Commutable = 0>
2496 : N3VLInt_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt,
2497 IntOp, Commutable> {
2498 def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin16,
2499 OpcodeStr, !strconcat(Dt, "8"),
2500 v8i16, v8i8, IntOp, Commutable>;
2503 // ....with explicit extend (VABDL).
2504 multiclass N3VLIntExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2505 InstrItinClass itin, string OpcodeStr, string Dt,
2506 Intrinsic IntOp, SDNode ExtOp, bit Commutable = 0> {
2507 def v8i16 : N3VLIntExt<op24, op23, 0b00, op11_8, op4, itin,
2508 OpcodeStr, !strconcat(Dt, "8"),
2509 v8i16, v8i8, IntOp, ExtOp, Commutable>;
2510 def v4i32 : N3VLIntExt<op24, op23, 0b01, op11_8, op4, itin,
2511 OpcodeStr, !strconcat(Dt, "16"),
2512 v4i32, v4i16, IntOp, ExtOp, Commutable>;
2513 def v2i64 : N3VLIntExt<op24, op23, 0b10, op11_8, op4, itin,
2514 OpcodeStr, !strconcat(Dt, "32"),
2515 v2i64, v2i32, IntOp, ExtOp, Commutable>;
2519 // Neon Wide 3-register vector intrinsics,
2520 // source operand element sizes of 8, 16 and 32 bits:
2521 multiclass N3VW_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2522 string OpcodeStr, string Dt,
2523 SDNode OpNode, SDNode ExtOp, bit Commutable = 0> {
2524 def v8i16 : N3VW<op24, op23, 0b00, op11_8, op4,
2525 OpcodeStr, !strconcat(Dt, "8"),
2526 v8i16, v8i8, OpNode, ExtOp, Commutable>;
2527 def v4i32 : N3VW<op24, op23, 0b01, op11_8, op4,
2528 OpcodeStr, !strconcat(Dt, "16"),
2529 v4i32, v4i16, OpNode, ExtOp, Commutable>;
2530 def v2i64 : N3VW<op24, op23, 0b10, op11_8, op4,
2531 OpcodeStr, !strconcat(Dt, "32"),
2532 v2i64, v2i32, OpNode, ExtOp, Commutable>;
2536 // Neon Multiply-Op vector operations,
2537 // element sizes of 8, 16 and 32 bits:
2538 multiclass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2539 InstrItinClass itinD16, InstrItinClass itinD32,
2540 InstrItinClass itinQ16, InstrItinClass itinQ32,
2541 string OpcodeStr, string Dt, SDNode OpNode> {
2542 // 64-bit vector types.
2543 def v8i8 : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16,
2544 OpcodeStr, !strconcat(Dt, "8"), v8i8, mul, OpNode>;
2545 def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16,
2546 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, OpNode>;
2547 def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32,
2548 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, OpNode>;
2550 // 128-bit vector types.
2551 def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16,
2552 OpcodeStr, !strconcat(Dt, "8"), v16i8, mul, OpNode>;
2553 def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16,
2554 OpcodeStr, !strconcat(Dt, "16"), v8i16, mul, OpNode>;
2555 def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32,
2556 OpcodeStr, !strconcat(Dt, "32"), v4i32, mul, OpNode>;
2559 multiclass N3VMulOpSL_HS<bits<4> op11_8,
2560 InstrItinClass itinD16, InstrItinClass itinD32,
2561 InstrItinClass itinQ16, InstrItinClass itinQ32,
2562 string OpcodeStr, string Dt, SDNode ShOp> {
2563 def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16,
2564 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, ShOp>;
2565 def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32,
2566 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, ShOp>;
2567 def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16,
2568 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16,
2570 def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32,
2571 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32,
2575 // Neon Intrinsic-Op vector operations,
2576 // element sizes of 8, 16 and 32 bits:
2577 multiclass N3VIntOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2578 InstrItinClass itinD, InstrItinClass itinQ,
2579 string OpcodeStr, string Dt, Intrinsic IntOp,
2581 // 64-bit vector types.
2582 def v8i8 : N3VDIntOp<op24, op23, 0b00, op11_8, op4, itinD,
2583 OpcodeStr, !strconcat(Dt, "8"), v8i8, IntOp, OpNode>;
2584 def v4i16 : N3VDIntOp<op24, op23, 0b01, op11_8, op4, itinD,
2585 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp, OpNode>;
2586 def v2i32 : N3VDIntOp<op24, op23, 0b10, op11_8, op4, itinD,
2587 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp, OpNode>;
2589 // 128-bit vector types.
2590 def v16i8 : N3VQIntOp<op24, op23, 0b00, op11_8, op4, itinQ,
2591 OpcodeStr, !strconcat(Dt, "8"), v16i8, IntOp, OpNode>;
2592 def v8i16 : N3VQIntOp<op24, op23, 0b01, op11_8, op4, itinQ,
2593 OpcodeStr, !strconcat(Dt, "16"), v8i16, IntOp, OpNode>;
2594 def v4i32 : N3VQIntOp<op24, op23, 0b10, op11_8, op4, itinQ,
2595 OpcodeStr, !strconcat(Dt, "32"), v4i32, IntOp, OpNode>;
2598 // Neon 3-argument intrinsics,
2599 // element sizes of 8, 16 and 32 bits:
2600 multiclass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2601 InstrItinClass itinD, InstrItinClass itinQ,
2602 string OpcodeStr, string Dt, Intrinsic IntOp> {
2603 // 64-bit vector types.
2604 def v8i8 : N3VDInt3<op24, op23, 0b00, op11_8, op4, itinD,
2605 OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
2606 def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, itinD,
2607 OpcodeStr, !strconcat(Dt, "16"), v4i16, v4i16, IntOp>;
2608 def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, itinD,
2609 OpcodeStr, !strconcat(Dt, "32"), v2i32, v2i32, IntOp>;
2611 // 128-bit vector types.
2612 def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, itinQ,
2613 OpcodeStr, !strconcat(Dt, "8"), v16i8, v16i8, IntOp>;
2614 def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, itinQ,
2615 OpcodeStr, !strconcat(Dt, "16"), v8i16, v8i16, IntOp>;
2616 def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, itinQ,
2617 OpcodeStr, !strconcat(Dt, "32"), v4i32, v4i32, IntOp>;
2621 // Neon Long Multiply-Op vector operations,
2622 // element sizes of 8, 16 and 32 bits:
2623 multiclass N3VLMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2624 InstrItinClass itin16, InstrItinClass itin32,
2625 string OpcodeStr, string Dt, SDNode MulOp,
2627 def v8i16 : N3VLMulOp<op24, op23, 0b00, op11_8, op4, itin16, OpcodeStr,
2628 !strconcat(Dt, "8"), v8i16, v8i8, MulOp, OpNode>;
2629 def v4i32 : N3VLMulOp<op24, op23, 0b01, op11_8, op4, itin16, OpcodeStr,
2630 !strconcat(Dt, "16"), v4i32, v4i16, MulOp, OpNode>;
2631 def v2i64 : N3VLMulOp<op24, op23, 0b10, op11_8, op4, itin32, OpcodeStr,
2632 !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
2635 multiclass N3VLMulOpSL_HS<bit op24, bits<4> op11_8, string OpcodeStr,
2636 string Dt, SDNode MulOp, SDNode OpNode> {
2637 def v4i16 : N3VLMulOpSL16<op24, 0b01, op11_8, IIC_VMACi16D, OpcodeStr,
2638 !strconcat(Dt,"16"), v4i32, v4i16, MulOp, OpNode>;
2639 def v2i32 : N3VLMulOpSL<op24, 0b10, op11_8, IIC_VMACi32D, OpcodeStr,
2640 !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
2644 // Neon Long 3-argument intrinsics.
2646 // First with only element sizes of 16 and 32 bits:
2647 multiclass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
2648 InstrItinClass itin16, InstrItinClass itin32,
2649 string OpcodeStr, string Dt, Intrinsic IntOp> {
2650 def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, itin16,
2651 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
2652 def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, itin32,
2653 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
2656 multiclass N3VLInt3SL_HS<bit op24, bits<4> op11_8,
2657 string OpcodeStr, string Dt, Intrinsic IntOp> {
2658 def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D,
2659 OpcodeStr, !strconcat(Dt,"16"), v4i32, v4i16, IntOp>;
2660 def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D,
2661 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
2664 // ....then also with element size of 8 bits:
2665 multiclass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2666 InstrItinClass itin16, InstrItinClass itin32,
2667 string OpcodeStr, string Dt, Intrinsic IntOp>
2668 : N3VLInt3_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt, IntOp> {
2669 def v8i16 : N3VLInt3<op24, op23, 0b00, op11_8, op4, itin16,
2670 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, IntOp>;
2673 // ....with explicit extend (VABAL).
2674 multiclass N3VLIntExtOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
2675 InstrItinClass itin, string OpcodeStr, string Dt,
2676 Intrinsic IntOp, SDNode ExtOp, SDNode OpNode> {
2677 def v8i16 : N3VLIntExtOp<op24, op23, 0b00, op11_8, op4, itin,
2678 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8,
2679 IntOp, ExtOp, OpNode>;
2680 def v4i32 : N3VLIntExtOp<op24, op23, 0b01, op11_8, op4, itin,
2681 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16,
2682 IntOp, ExtOp, OpNode>;
2683 def v2i64 : N3VLIntExtOp<op24, op23, 0b10, op11_8, op4, itin,
2684 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32,
2685 IntOp, ExtOp, OpNode>;
2689 // Neon 2-register vector intrinsics,
2690 // element sizes of 8, 16 and 32 bits:
2691 multiclass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2692 bits<5> op11_7, bit op4,
2693 InstrItinClass itinD, InstrItinClass itinQ,
2694 string OpcodeStr, string Dt, Intrinsic IntOp> {
2695 // 64-bit vector types.
2696 def v8i8 : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2697 itinD, OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
2698 def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2699 itinD, OpcodeStr, !strconcat(Dt, "16"),v4i16,v4i16,IntOp>;
2700 def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2701 itinD, OpcodeStr, !strconcat(Dt, "32"),v2i32,v2i32,IntOp>;
2703 // 128-bit vector types.
2704 def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2705 itinQ, OpcodeStr, !strconcat(Dt, "8"), v16i8,v16i8,IntOp>;
2706 def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2707 itinQ, OpcodeStr, !strconcat(Dt, "16"),v8i16,v8i16,IntOp>;
2708 def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2709 itinQ, OpcodeStr, !strconcat(Dt, "32"),v4i32,v4i32,IntOp>;
2713 // Neon Pairwise long 2-register intrinsics,
2714 // element sizes of 8, 16 and 32 bits:
2715 multiclass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2716 bits<5> op11_7, bit op4,
2717 string OpcodeStr, string Dt, Intrinsic IntOp> {
2718 // 64-bit vector types.
2719 def v8i8 : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2720 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
2721 def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2722 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
2723 def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2724 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
2726 // 128-bit vector types.
2727 def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2728 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
2729 def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2730 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
2731 def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2732 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
2736 // Neon Pairwise long 2-register accumulate intrinsics,
2737 // element sizes of 8, 16 and 32 bits:
2738 multiclass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
2739 bits<5> op11_7, bit op4,
2740 string OpcodeStr, string Dt, Intrinsic IntOp> {
2741 // 64-bit vector types.
2742 def v8i8 : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2743 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
2744 def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2745 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
2746 def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2747 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
2749 // 128-bit vector types.
2750 def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
2751 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
2752 def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
2753 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
2754 def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
2755 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
2759 // Neon 2-register vector shift by immediate,
2760 // with f of either N2RegVShLFrm or N2RegVShRFrm
2761 // element sizes of 8, 16, 32 and 64 bits:
2762 multiclass N2VSh_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2763 InstrItinClass itin, string OpcodeStr, string Dt,
2764 SDNode OpNode, Format f> {
2765 // 64-bit vector types.
2766 def v8i8 : N2VDSh<op24, op23, op11_8, 0, op4, f, itin,
2767 OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
2768 let Inst{21-19} = 0b001; // imm6 = 001xxx
2770 def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, f, itin,
2771 OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
2772 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2774 def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, f, itin,
2775 OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
2776 let Inst{21} = 0b1; // imm6 = 1xxxxx
2778 def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, f, itin,
2779 OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
2782 // 128-bit vector types.
2783 def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, f, itin,
2784 OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
2785 let Inst{21-19} = 0b001; // imm6 = 001xxx
2787 def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, f, itin,
2788 OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
2789 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2791 def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, f, itin,
2792 OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
2793 let Inst{21} = 0b1; // imm6 = 1xxxxx
2795 def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, f, itin,
2796 OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
2800 // Neon Shift-Accumulate vector operations,
2801 // element sizes of 8, 16, 32 and 64 bits:
2802 multiclass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2803 string OpcodeStr, string Dt, SDNode ShOp> {
2804 // 64-bit vector types.
2805 def v8i8 : N2VDShAdd<op24, op23, op11_8, 0, op4,
2806 OpcodeStr, !strconcat(Dt, "8"), v8i8, ShOp> {
2807 let Inst{21-19} = 0b001; // imm6 = 001xxx
2809 def v4i16 : N2VDShAdd<op24, op23, op11_8, 0, op4,
2810 OpcodeStr, !strconcat(Dt, "16"), v4i16, ShOp> {
2811 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2813 def v2i32 : N2VDShAdd<op24, op23, op11_8, 0, op4,
2814 OpcodeStr, !strconcat(Dt, "32"), v2i32, ShOp> {
2815 let Inst{21} = 0b1; // imm6 = 1xxxxx
2817 def v1i64 : N2VDShAdd<op24, op23, op11_8, 1, op4,
2818 OpcodeStr, !strconcat(Dt, "64"), v1i64, ShOp>;
2821 // 128-bit vector types.
2822 def v16i8 : N2VQShAdd<op24, op23, op11_8, 0, op4,
2823 OpcodeStr, !strconcat(Dt, "8"), v16i8, ShOp> {
2824 let Inst{21-19} = 0b001; // imm6 = 001xxx
2826 def v8i16 : N2VQShAdd<op24, op23, op11_8, 0, op4,
2827 OpcodeStr, !strconcat(Dt, "16"), v8i16, ShOp> {
2828 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2830 def v4i32 : N2VQShAdd<op24, op23, op11_8, 0, op4,
2831 OpcodeStr, !strconcat(Dt, "32"), v4i32, ShOp> {
2832 let Inst{21} = 0b1; // imm6 = 1xxxxx
2834 def v2i64 : N2VQShAdd<op24, op23, op11_8, 1, op4,
2835 OpcodeStr, !strconcat(Dt, "64"), v2i64, ShOp>;
2840 // Neon Shift-Insert vector operations,
2841 // with f of either N2RegVShLFrm or N2RegVShRFrm
2842 // element sizes of 8, 16, 32 and 64 bits:
2843 multiclass N2VShIns_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
2844 string OpcodeStr, SDNode ShOp,
2846 // 64-bit vector types.
2847 def v8i8 : N2VDShIns<op24, op23, op11_8, 0, op4,
2848 f, OpcodeStr, "8", v8i8, ShOp> {
2849 let Inst{21-19} = 0b001; // imm6 = 001xxx
2851 def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4,
2852 f, OpcodeStr, "16", v4i16, ShOp> {
2853 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2855 def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4,
2856 f, OpcodeStr, "32", v2i32, ShOp> {
2857 let Inst{21} = 0b1; // imm6 = 1xxxxx
2859 def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4,
2860 f, OpcodeStr, "64", v1i64, ShOp>;
2863 // 128-bit vector types.
2864 def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4,
2865 f, OpcodeStr, "8", v16i8, ShOp> {
2866 let Inst{21-19} = 0b001; // imm6 = 001xxx
2868 def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4,
2869 f, OpcodeStr, "16", v8i16, ShOp> {
2870 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2872 def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4,
2873 f, OpcodeStr, "32", v4i32, ShOp> {
2874 let Inst{21} = 0b1; // imm6 = 1xxxxx
2876 def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4,
2877 f, OpcodeStr, "64", v2i64, ShOp>;
2881 // Neon Shift Long operations,
2882 // element sizes of 8, 16, 32 bits:
2883 multiclass N2VLSh_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
2884 bit op4, string OpcodeStr, string Dt, SDNode OpNode> {
2885 def v8i16 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
2886 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode> {
2887 let Inst{21-19} = 0b001; // imm6 = 001xxx
2889 def v4i32 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
2890 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode> {
2891 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2893 def v2i64 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
2894 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode> {
2895 let Inst{21} = 0b1; // imm6 = 1xxxxx
2899 // Neon Shift Narrow operations,
2900 // element sizes of 16, 32, 64 bits:
2901 multiclass N2VNSh_HSD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
2902 bit op4, InstrItinClass itin, string OpcodeStr, string Dt,
2904 def v8i8 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
2905 OpcodeStr, !strconcat(Dt, "16"), v8i8, v8i16, OpNode> {
2906 let Inst{21-19} = 0b001; // imm6 = 001xxx
2908 def v4i16 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
2909 OpcodeStr, !strconcat(Dt, "32"), v4i16, v4i32, OpNode> {
2910 let Inst{21-20} = 0b01; // imm6 = 01xxxx
2912 def v2i32 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
2913 OpcodeStr, !strconcat(Dt, "64"), v2i32, v2i64, OpNode> {
2914 let Inst{21} = 0b1; // imm6 = 1xxxxx
2918 //===----------------------------------------------------------------------===//
2919 // Instruction Definitions.
2920 //===----------------------------------------------------------------------===//
2922 // Vector Add Operations.
2924 // VADD : Vector Add (integer and floating-point)
2925 defm VADD : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd", "i",
2927 def VADDfd : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd", "f32",
2928 v2f32, v2f32, fadd, 1>;
2929 def VADDfq : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd", "f32",
2930 v4f32, v4f32, fadd, 1>;
2931 // VADDL : Vector Add Long (Q = D + D)
2932 defm VADDLs : N3VLExt_QHS<0,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
2933 "vaddl", "s", add, sext, 1>;
2934 defm VADDLu : N3VLExt_QHS<1,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
2935 "vaddl", "u", add, zext, 1>;
2936 // VADDW : Vector Add Wide (Q = Q + D)
2937 defm VADDWs : N3VW_QHS<0,1,0b0001,0, "vaddw", "s", add, sext, 0>;
2938 defm VADDWu : N3VW_QHS<1,1,0b0001,0, "vaddw", "u", add, zext, 0>;
2939 // VHADD : Vector Halving Add
2940 defm VHADDs : N3VInt_QHS<0, 0, 0b0000, 0, N3RegFrm,
2941 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
2942 "vhadd", "s", int_arm_neon_vhadds, 1>;
2943 defm VHADDu : N3VInt_QHS<1, 0, 0b0000, 0, N3RegFrm,
2944 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
2945 "vhadd", "u", int_arm_neon_vhaddu, 1>;
2946 // VRHADD : Vector Rounding Halving Add
2947 defm VRHADDs : N3VInt_QHS<0, 0, 0b0001, 0, N3RegFrm,
2948 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
2949 "vrhadd", "s", int_arm_neon_vrhadds, 1>;
2950 defm VRHADDu : N3VInt_QHS<1, 0, 0b0001, 0, N3RegFrm,
2951 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
2952 "vrhadd", "u", int_arm_neon_vrhaddu, 1>;
2953 // VQADD : Vector Saturating Add
2954 defm VQADDs : N3VInt_QHSD<0, 0, 0b0000, 1, N3RegFrm,
2955 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
2956 "vqadd", "s", int_arm_neon_vqadds, 1>;
2957 defm VQADDu : N3VInt_QHSD<1, 0, 0b0000, 1, N3RegFrm,
2958 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
2959 "vqadd", "u", int_arm_neon_vqaddu, 1>;
2960 // VADDHN : Vector Add and Narrow Returning High Half (D = Q + Q)
2961 defm VADDHN : N3VNInt_HSD<0,1,0b0100,0, "vaddhn", "i",
2962 int_arm_neon_vaddhn, 1>;
2963 // VRADDHN : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
2964 defm VRADDHN : N3VNInt_HSD<1,1,0b0100,0, "vraddhn", "i",
2965 int_arm_neon_vraddhn, 1>;
2967 // Vector Multiply Operations.
2969 // VMUL : Vector Multiply (integer, polynomial and floating-point)
2970 defm VMUL : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D,
2971 IIC_VMULi16Q, IIC_VMULi32Q, "vmul", "i", mul, 1>;
2972 def VMULpd : N3VDInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16D, "vmul",
2973 "p8", v8i8, v8i8, int_arm_neon_vmulp, 1>;
2974 def VMULpq : N3VQInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16Q, "vmul",
2975 "p8", v16i8, v16i8, int_arm_neon_vmulp, 1>;
2976 def VMULfd : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VFMULD, "vmul", "f32",
2977 v2f32, v2f32, fmul, 1>;
2978 def VMULfq : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VFMULQ, "vmul", "f32",
2979 v4f32, v4f32, fmul, 1>;
2980 defm VMULsl : N3VSL_HS<0b1000, "vmul", "i", mul>;
2981 def VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul", "f32", v2f32, fmul>;
2982 def VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul", "f32", v4f32,
2985 def : Pat<(v8i16 (mul (v8i16 QPR:$src1),
2986 (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))),
2987 (v8i16 (VMULslv8i16 (v8i16 QPR:$src1),
2988 (v4i16 (EXTRACT_SUBREG QPR:$src2,
2989 (DSubReg_i16_reg imm:$lane))),
2990 (SubReg_i16_lane imm:$lane)))>;
2991 def : Pat<(v4i32 (mul (v4i32 QPR:$src1),
2992 (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))),
2993 (v4i32 (VMULslv4i32 (v4i32 QPR:$src1),
2994 (v2i32 (EXTRACT_SUBREG QPR:$src2,
2995 (DSubReg_i32_reg imm:$lane))),
2996 (SubReg_i32_lane imm:$lane)))>;
2997 def : Pat<(v4f32 (fmul (v4f32 QPR:$src1),
2998 (v4f32 (NEONvduplane (v4f32 QPR:$src2), imm:$lane)))),
2999 (v4f32 (VMULslfq (v4f32 QPR:$src1),
3000 (v2f32 (EXTRACT_SUBREG QPR:$src2,
3001 (DSubReg_i32_reg imm:$lane))),
3002 (SubReg_i32_lane imm:$lane)))>;
3004 // VQDMULH : Vector Saturating Doubling Multiply Returning High Half
3005 defm VQDMULH : N3VInt_HS<0, 0, 0b1011, 0, N3RegFrm, IIC_VMULi16D, IIC_VMULi32D,
3006 IIC_VMULi16Q, IIC_VMULi32Q,
3007 "vqdmulh", "s", int_arm_neon_vqdmulh, 1>;
3008 defm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D,
3009 IIC_VMULi16Q, IIC_VMULi32Q,
3010 "vqdmulh", "s", int_arm_neon_vqdmulh>;
3011 def : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1),
3012 (v8i16 (NEONvduplane (v8i16 QPR:$src2),
3014 (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1),
3015 (v4i16 (EXTRACT_SUBREG QPR:$src2,
3016 (DSubReg_i16_reg imm:$lane))),
3017 (SubReg_i16_lane imm:$lane)))>;
3018 def : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1),
3019 (v4i32 (NEONvduplane (v4i32 QPR:$src2),
3021 (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1),
3022 (v2i32 (EXTRACT_SUBREG QPR:$src2,
3023 (DSubReg_i32_reg imm:$lane))),
3024 (SubReg_i32_lane imm:$lane)))>;
3026 // VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
3027 defm VQRDMULH : N3VInt_HS<1, 0, 0b1011, 0, N3RegFrm,
3028 IIC_VMULi16D,IIC_VMULi32D,IIC_VMULi16Q,IIC_VMULi32Q,
3029 "vqrdmulh", "s", int_arm_neon_vqrdmulh, 1>;
3030 defm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D,
3031 IIC_VMULi16Q, IIC_VMULi32Q,
3032 "vqrdmulh", "s", int_arm_neon_vqrdmulh>;
3033 def : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1),
3034 (v8i16 (NEONvduplane (v8i16 QPR:$src2),
3036 (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1),
3037 (v4i16 (EXTRACT_SUBREG QPR:$src2,
3038 (DSubReg_i16_reg imm:$lane))),
3039 (SubReg_i16_lane imm:$lane)))>;
3040 def : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1),
3041 (v4i32 (NEONvduplane (v4i32 QPR:$src2),
3043 (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1),
3044 (v2i32 (EXTRACT_SUBREG QPR:$src2,
3045 (DSubReg_i32_reg imm:$lane))),
3046 (SubReg_i32_lane imm:$lane)))>;
3048 // VMULL : Vector Multiply Long (integer and polynomial) (Q = D * D)
3049 defm VMULLs : N3VL_QHS<0,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
3050 "vmull", "s", NEONvmulls, 1>;
3051 defm VMULLu : N3VL_QHS<1,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
3052 "vmull", "u", NEONvmullu, 1>;
3053 def VMULLp : N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull", "p8",
3054 v8i16, v8i8, int_arm_neon_vmullp, 1>;
3055 defm VMULLsls : N3VLSL_HS<0, 0b1010, IIC_VMULi16D, "vmull", "s", NEONvmulls>;
3056 defm VMULLslu : N3VLSL_HS<1, 0b1010, IIC_VMULi16D, "vmull", "u", NEONvmullu>;
3058 // VQDMULL : Vector Saturating Doubling Multiply Long (Q = D * D)
3059 defm VQDMULL : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, IIC_VMULi32D,
3060 "vqdmull", "s", int_arm_neon_vqdmull, 1>;
3061 defm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D,
3062 "vqdmull", "s", int_arm_neon_vqdmull>;
3064 // Vector Multiply-Accumulate and Multiply-Subtract Operations.
3066 // VMLA : Vector Multiply Accumulate (integer and floating-point)
3067 defm VMLA : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
3068 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
3069 def VMLAfd : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla", "f32",
3071 def VMLAfq : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla", "f32",
3073 defm VMLAsl : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D,
3074 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
3075 def VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla", "f32",
3077 def VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla", "f32",
3078 v4f32, v2f32, fmul, fadd>;
3080 def : Pat<(v8i16 (add (v8i16 QPR:$src1),
3081 (mul (v8i16 QPR:$src2),
3082 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
3083 (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
3084 (v4i16 (EXTRACT_SUBREG QPR:$src3,
3085 (DSubReg_i16_reg imm:$lane))),
3086 (SubReg_i16_lane imm:$lane)))>;
3088 def : Pat<(v4i32 (add (v4i32 QPR:$src1),
3089 (mul (v4i32 QPR:$src2),
3090 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
3091 (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
3092 (v2i32 (EXTRACT_SUBREG QPR:$src3,
3093 (DSubReg_i32_reg imm:$lane))),
3094 (SubReg_i32_lane imm:$lane)))>;
3096 def : Pat<(v4f32 (fadd (v4f32 QPR:$src1),
3097 (fmul (v4f32 QPR:$src2),
3098 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
3099 (v4f32 (VMLAslfq (v4f32 QPR:$src1),
3101 (v2f32 (EXTRACT_SUBREG QPR:$src3,
3102 (DSubReg_i32_reg imm:$lane))),
3103 (SubReg_i32_lane imm:$lane)))>;
3105 // VMLAL : Vector Multiply Accumulate Long (Q += D * D)
3106 defm VMLALs : N3VLMulOp_QHS<0,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
3107 "vmlal", "s", NEONvmulls, add>;
3108 defm VMLALu : N3VLMulOp_QHS<1,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
3109 "vmlal", "u", NEONvmullu, add>;
3111 defm VMLALsls : N3VLMulOpSL_HS<0, 0b0010, "vmlal", "s", NEONvmulls, add>;
3112 defm VMLALslu : N3VLMulOpSL_HS<1, 0b0010, "vmlal", "u", NEONvmullu, add>;
3114 // VQDMLAL : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
3115 defm VQDMLAL : N3VLInt3_HS<0, 1, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
3116 "vqdmlal", "s", int_arm_neon_vqdmlal>;
3117 defm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal", "s", int_arm_neon_vqdmlal>;
3119 // VMLS : Vector Multiply Subtract (integer and floating-point)
3120 defm VMLS : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
3121 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
3122 def VMLSfd : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls", "f32",
3124 def VMLSfq : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls", "f32",
3126 defm VMLSsl : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D,
3127 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
3128 def VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls", "f32",
3130 def VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls", "f32",
3131 v4f32, v2f32, fmul, fsub>;
3133 def : Pat<(v8i16 (sub (v8i16 QPR:$src1),
3134 (mul (v8i16 QPR:$src2),
3135 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
3136 (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
3137 (v4i16 (EXTRACT_SUBREG QPR:$src3,
3138 (DSubReg_i16_reg imm:$lane))),
3139 (SubReg_i16_lane imm:$lane)))>;
3141 def : Pat<(v4i32 (sub (v4i32 QPR:$src1),
3142 (mul (v4i32 QPR:$src2),
3143 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
3144 (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
3145 (v2i32 (EXTRACT_SUBREG QPR:$src3,
3146 (DSubReg_i32_reg imm:$lane))),
3147 (SubReg_i32_lane imm:$lane)))>;
3149 def : Pat<(v4f32 (fsub (v4f32 QPR:$src1),
3150 (fmul (v4f32 QPR:$src2),
3151 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
3152 (v4f32 (VMLSslfq (v4f32 QPR:$src1), (v4f32 QPR:$src2),
3153 (v2f32 (EXTRACT_SUBREG QPR:$src3,
3154 (DSubReg_i32_reg imm:$lane))),
3155 (SubReg_i32_lane imm:$lane)))>;
3157 // VMLSL : Vector Multiply Subtract Long (Q -= D * D)
3158 defm VMLSLs : N3VLMulOp_QHS<0,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
3159 "vmlsl", "s", NEONvmulls, sub>;
3160 defm VMLSLu : N3VLMulOp_QHS<1,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
3161 "vmlsl", "u", NEONvmullu, sub>;
3163 defm VMLSLsls : N3VLMulOpSL_HS<0, 0b0110, "vmlsl", "s", NEONvmulls, sub>;
3164 defm VMLSLslu : N3VLMulOpSL_HS<1, 0b0110, "vmlsl", "u", NEONvmullu, sub>;
3166 // VQDMLSL : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
3167 defm VQDMLSL : N3VLInt3_HS<0, 1, 0b1011, 0, IIC_VMACi16D, IIC_VMACi32D,
3168 "vqdmlsl", "s", int_arm_neon_vqdmlsl>;
3169 defm VQDMLSLsl: N3VLInt3SL_HS<0, 0b111, "vqdmlsl", "s", int_arm_neon_vqdmlsl>;
3171 // Vector Subtract Operations.
3173 // VSUB : Vector Subtract (integer and floating-point)
3174 defm VSUB : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ,
3175 "vsub", "i", sub, 0>;
3176 def VSUBfd : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub", "f32",
3177 v2f32, v2f32, fsub, 0>;
3178 def VSUBfq : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub", "f32",
3179 v4f32, v4f32, fsub, 0>;
3180 // VSUBL : Vector Subtract Long (Q = D - D)
3181 defm VSUBLs : N3VLExt_QHS<0,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
3182 "vsubl", "s", sub, sext, 0>;
3183 defm VSUBLu : N3VLExt_QHS<1,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
3184 "vsubl", "u", sub, zext, 0>;
3185 // VSUBW : Vector Subtract Wide (Q = Q - D)
3186 defm VSUBWs : N3VW_QHS<0,1,0b0011,0, "vsubw", "s", sub, sext, 0>;
3187 defm VSUBWu : N3VW_QHS<1,1,0b0011,0, "vsubw", "u", sub, zext, 0>;
3188 // VHSUB : Vector Halving Subtract
3189 defm VHSUBs : N3VInt_QHS<0, 0, 0b0010, 0, N3RegFrm,
3190 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3191 "vhsub", "s", int_arm_neon_vhsubs, 0>;
3192 defm VHSUBu : N3VInt_QHS<1, 0, 0b0010, 0, N3RegFrm,
3193 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3194 "vhsub", "u", int_arm_neon_vhsubu, 0>;
3195 // VQSUB : Vector Saturing Subtract
3196 defm VQSUBs : N3VInt_QHSD<0, 0, 0b0010, 1, N3RegFrm,
3197 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3198 "vqsub", "s", int_arm_neon_vqsubs, 0>;
3199 defm VQSUBu : N3VInt_QHSD<1, 0, 0b0010, 1, N3RegFrm,
3200 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3201 "vqsub", "u", int_arm_neon_vqsubu, 0>;
3202 // VSUBHN : Vector Subtract and Narrow Returning High Half (D = Q - Q)
3203 defm VSUBHN : N3VNInt_HSD<0,1,0b0110,0, "vsubhn", "i",
3204 int_arm_neon_vsubhn, 0>;
3205 // VRSUBHN : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
3206 defm VRSUBHN : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn", "i",
3207 int_arm_neon_vrsubhn, 0>;
3209 // Vector Comparisons.
3211 // VCEQ : Vector Compare Equal
3212 defm VCEQ : N3V_QHS<1, 0, 0b1000, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3213 IIC_VSUBi4Q, "vceq", "i", NEONvceq, 1>;
3214 def VCEQfd : N3VD<0,0,0b00,0b1110,0, IIC_VBIND, "vceq", "f32", v2i32, v2f32,
3216 def VCEQfq : N3VQ<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq", "f32", v4i32, v4f32,
3218 // For disassembly only.
3219 defm VCEQz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00010, 0, "vceq", "i",
3222 // VCGE : Vector Compare Greater Than or Equal
3223 defm VCGEs : N3V_QHS<0, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3224 IIC_VSUBi4Q, "vcge", "s", NEONvcge, 0>;
3225 defm VCGEu : N3V_QHS<1, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3226 IIC_VSUBi4Q, "vcge", "u", NEONvcgeu, 0>;
3227 def VCGEfd : N3VD<1,0,0b00,0b1110,0, IIC_VBIND, "vcge", "f32", v2i32, v2f32,
3229 def VCGEfq : N3VQ<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge", "f32", v4i32, v4f32,
3231 // For disassembly only.
3232 // FIXME: This instruction's encoding MAY NOT BE correct.
3233 defm VCGEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00001, 0, "vcge", "s",
3235 // For disassembly only.
3236 // FIXME: This instruction's encoding MAY NOT BE correct.
3237 defm VCLEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00011, 0, "vcle", "s",
3240 // VCGT : Vector Compare Greater Than
3241 defm VCGTs : N3V_QHS<0, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3242 IIC_VSUBi4Q, "vcgt", "s", NEONvcgt, 0>;
3243 defm VCGTu : N3V_QHS<1, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
3244 IIC_VSUBi4Q, "vcgt", "u", NEONvcgtu, 0>;
3245 def VCGTfd : N3VD<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt", "f32", v2i32, v2f32,
3247 def VCGTfq : N3VQ<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt", "f32", v4i32, v4f32,
3249 // For disassembly only.
3250 // FIXME: This instruction's encoding MAY NOT BE correct.
3251 defm VCGTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00000, 0, "vcgt", "s",
3253 // For disassembly only.
3254 // FIXME: This instruction's encoding MAY NOT BE correct.
3255 defm VCLTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00100, 0, "vclt", "s",
3258 // VACGE : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
3259 def VACGEd : N3VDInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
3260 "f32", v2i32, v2f32, int_arm_neon_vacged, 0>;
3261 def VACGEq : N3VQInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
3262 "f32", v4i32, v4f32, int_arm_neon_vacgeq, 0>;
3263 // VACGT : Vector Absolute Compare Greater Than (aka VCAGT)
3264 def VACGTd : N3VDInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
3265 "f32", v2i32, v2f32, int_arm_neon_vacgtd, 0>;
3266 def VACGTq : N3VQInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
3267 "f32", v4i32, v4f32, int_arm_neon_vacgtq, 0>;
3268 // VTST : Vector Test Bits
3269 defm VTST : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
3270 IIC_VBINi4Q, "vtst", "", NEONvtst, 1>;
3272 // Vector Bitwise Operations.
3274 def vnotd : PatFrag<(ops node:$in),
3275 (xor node:$in, (bitconvert (v8i8 NEONimmAllOnesV)))>;
3276 def vnotq : PatFrag<(ops node:$in),
3277 (xor node:$in, (bitconvert (v16i8 NEONimmAllOnesV)))>;
3280 // VAND : Vector Bitwise AND
3281 def VANDd : N3VDX<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand",
3282 v2i32, v2i32, and, 1>;
3283 def VANDq : N3VQX<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand",
3284 v4i32, v4i32, and, 1>;
3286 // VEOR : Vector Bitwise Exclusive OR
3287 def VEORd : N3VDX<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor",
3288 v2i32, v2i32, xor, 1>;
3289 def VEORq : N3VQX<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor",
3290 v4i32, v4i32, xor, 1>;
3292 // VORR : Vector Bitwise OR
3293 def VORRd : N3VDX<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr",
3294 v2i32, v2i32, or, 1>;
3295 def VORRq : N3VQX<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr",
3296 v4i32, v4i32, or, 1>;
3298 // VBIC : Vector Bitwise Bit Clear (AND NOT)
3299 def VBICd : N3VX<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst),
3300 (ins DPR:$src1, DPR:$src2), N3RegFrm, IIC_VBINiD,
3301 "vbic", "$dst, $src1, $src2", "",
3302 [(set DPR:$dst, (v2i32 (and DPR:$src1,
3303 (vnotd DPR:$src2))))]>;
3304 def VBICq : N3VX<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst),
3305 (ins QPR:$src1, QPR:$src2), N3RegFrm, IIC_VBINiQ,
3306 "vbic", "$dst, $src1, $src2", "",
3307 [(set QPR:$dst, (v4i32 (and QPR:$src1,
3308 (vnotq QPR:$src2))))]>;
3310 // VORN : Vector Bitwise OR NOT
3311 def VORNd : N3VX<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$dst),
3312 (ins DPR:$src1, DPR:$src2), N3RegFrm, IIC_VBINiD,
3313 "vorn", "$dst, $src1, $src2", "",
3314 [(set DPR:$dst, (v2i32 (or DPR:$src1,
3315 (vnotd DPR:$src2))))]>;
3316 def VORNq : N3VX<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$dst),
3317 (ins QPR:$src1, QPR:$src2), N3RegFrm, IIC_VBINiQ,
3318 "vorn", "$dst, $src1, $src2", "",
3319 [(set QPR:$dst, (v4i32 (or QPR:$src1,
3320 (vnotq QPR:$src2))))]>;
3322 // VMVN : Vector Bitwise NOT (Immediate)
3324 let isReMaterializable = 1 in {
3326 def VMVNv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 1, 1, (outs DPR:$dst),
3327 (ins nModImm:$SIMM), IIC_VMOVImm,
3328 "vmvn", "i16", "$dst, $SIMM", "",
3329 [(set DPR:$dst, (v4i16 (NEONvmvnImm timm:$SIMM)))]> {
3330 let Inst{9} = SIMM{9};
3333 def VMVNv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 1, 1, (outs QPR:$dst),
3334 (ins nModImm:$SIMM), IIC_VMOVImm,
3335 "vmvn", "i16", "$dst, $SIMM", "",
3336 [(set QPR:$dst, (v8i16 (NEONvmvnImm timm:$SIMM)))]> {
3337 let Inst{9} = SIMM{9};
3340 def VMVNv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 1, 1, (outs DPR:$dst),
3341 (ins nModImm:$SIMM), IIC_VMOVImm,
3342 "vmvn", "i32", "$dst, $SIMM", "",
3343 [(set DPR:$dst, (v2i32 (NEONvmvnImm timm:$SIMM)))]> {
3344 let Inst{11-8} = SIMM{11-8};
3347 def VMVNv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 1, 1, (outs QPR:$dst),
3348 (ins nModImm:$SIMM), IIC_VMOVImm,
3349 "vmvn", "i32", "$dst, $SIMM", "",
3350 [(set QPR:$dst, (v4i32 (NEONvmvnImm timm:$SIMM)))]> {
3351 let Inst{11-8} = SIMM{11-8};
3355 // VMVN : Vector Bitwise NOT
3356 def VMVNd : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
3357 (outs DPR:$dst), (ins DPR:$src), IIC_VSUBiD,
3358 "vmvn", "$dst, $src", "",
3359 [(set DPR:$dst, (v2i32 (vnotd DPR:$src)))]>;
3360 def VMVNq : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
3361 (outs QPR:$dst), (ins QPR:$src), IIC_VSUBiD,
3362 "vmvn", "$dst, $src", "",
3363 [(set QPR:$dst, (v4i32 (vnotq QPR:$src)))]>;
3364 def : Pat<(v2i32 (vnotd DPR:$src)), (VMVNd DPR:$src)>;
3365 def : Pat<(v4i32 (vnotq QPR:$src)), (VMVNq QPR:$src)>;
3367 // VBSL : Vector Bitwise Select
3368 def VBSLd : N3VX<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
3369 (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
3370 N3RegFrm, IIC_VCNTiD,
3371 "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3373 (v2i32 (or (and DPR:$Vn, DPR:$src1),
3374 (and DPR:$Vm, (vnotd DPR:$src1)))))]>;
3375 def VBSLq : N3VX<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
3376 (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
3377 N3RegFrm, IIC_VCNTiQ,
3378 "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3380 (v4i32 (or (and QPR:$Vn, QPR:$src1),
3381 (and QPR:$Vm, (vnotq QPR:$src1)))))]>;
3383 // VBIF : Vector Bitwise Insert if False
3384 // like VBSL but with: "vbif $dst, $src3, $src1", "$src2 = $dst",
3385 // FIXME: This instruction's encoding MAY NOT BE correct.
3386 def VBIFd : N3VX<1, 0, 0b11, 0b0001, 0, 1,
3387 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
3388 N3RegFrm, IIC_VBINiD,
3389 "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3390 [/* For disassembly only; pattern left blank */]>;
3391 def VBIFq : N3VX<1, 0, 0b11, 0b0001, 1, 1,
3392 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
3393 N3RegFrm, IIC_VBINiQ,
3394 "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3395 [/* For disassembly only; pattern left blank */]>;
3397 // VBIT : Vector Bitwise Insert if True
3398 // like VBSL but with: "vbit $dst, $src2, $src1", "$src3 = $dst",
3399 // FIXME: This instruction's encoding MAY NOT BE correct.
3400 def VBITd : N3VX<1, 0, 0b10, 0b0001, 0, 1,
3401 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
3402 N3RegFrm, IIC_VBINiD,
3403 "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3404 [/* For disassembly only; pattern left blank */]>;
3405 def VBITq : N3VX<1, 0, 0b10, 0b0001, 1, 1,
3406 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
3407 N3RegFrm, IIC_VBINiQ,
3408 "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
3409 [/* For disassembly only; pattern left blank */]>;
3411 // VBIT/VBIF are not yet implemented. The TwoAddress pass will not go looking
3412 // for equivalent operations with different register constraints; it just
3415 // Vector Absolute Differences.
3417 // VABD : Vector Absolute Difference
3418 defm VABDs : N3VInt_QHS<0, 0, 0b0111, 0, N3RegFrm,
3419 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3420 "vabd", "s", int_arm_neon_vabds, 1>;
3421 defm VABDu : N3VInt_QHS<1, 0, 0b0111, 0, N3RegFrm,
3422 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3423 "vabd", "u", int_arm_neon_vabdu, 1>;
3424 def VABDfd : N3VDInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBIND,
3425 "vabd", "f32", v2f32, v2f32, int_arm_neon_vabds, 1>;
3426 def VABDfq : N3VQInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBINQ,
3427 "vabd", "f32", v4f32, v4f32, int_arm_neon_vabds, 1>;
3429 // VABDL : Vector Absolute Difference Long (Q = | D - D |)
3430 defm VABDLs : N3VLIntExt_QHS<0,1,0b0111,0, IIC_VSUBi4Q,
3431 "vabdl", "s", int_arm_neon_vabds, zext, 1>;
3432 defm VABDLu : N3VLIntExt_QHS<1,1,0b0111,0, IIC_VSUBi4Q,
3433 "vabdl", "u", int_arm_neon_vabdu, zext, 1>;
3435 // VABA : Vector Absolute Difference and Accumulate
3436 defm VABAs : N3VIntOp_QHS<0,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
3437 "vaba", "s", int_arm_neon_vabds, add>;
3438 defm VABAu : N3VIntOp_QHS<1,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
3439 "vaba", "u", int_arm_neon_vabdu, add>;
3441 // VABAL : Vector Absolute Difference and Accumulate Long (Q += | D - D |)
3442 defm VABALs : N3VLIntExtOp_QHS<0,1,0b0101,0, IIC_VABAD,
3443 "vabal", "s", int_arm_neon_vabds, zext, add>;
3444 defm VABALu : N3VLIntExtOp_QHS<1,1,0b0101,0, IIC_VABAD,
3445 "vabal", "u", int_arm_neon_vabdu, zext, add>;
3447 // Vector Maximum and Minimum.
3449 // VMAX : Vector Maximum
3450 defm VMAXs : N3VInt_QHS<0, 0, 0b0110, 0, N3RegFrm,
3451 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3452 "vmax", "s", int_arm_neon_vmaxs, 1>;
3453 defm VMAXu : N3VInt_QHS<1, 0, 0b0110, 0, N3RegFrm,
3454 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3455 "vmax", "u", int_arm_neon_vmaxu, 1>;
3456 def VMAXfd : N3VDInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBIND,
3458 v2f32, v2f32, int_arm_neon_vmaxs, 1>;
3459 def VMAXfq : N3VQInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBINQ,
3461 v4f32, v4f32, int_arm_neon_vmaxs, 1>;
3463 // VMIN : Vector Minimum
3464 defm VMINs : N3VInt_QHS<0, 0, 0b0110, 1, N3RegFrm,
3465 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3466 "vmin", "s", int_arm_neon_vmins, 1>;
3467 defm VMINu : N3VInt_QHS<1, 0, 0b0110, 1, N3RegFrm,
3468 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
3469 "vmin", "u", int_arm_neon_vminu, 1>;
3470 def VMINfd : N3VDInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBIND,
3472 v2f32, v2f32, int_arm_neon_vmins, 1>;
3473 def VMINfq : N3VQInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBINQ,
3475 v4f32, v4f32, int_arm_neon_vmins, 1>;
3477 // Vector Pairwise Operations.
3479 // VPADD : Vector Pairwise Add
3480 def VPADDi8 : N3VDInt<0, 0, 0b00, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
3482 v8i8, v8i8, int_arm_neon_vpadd, 0>;
3483 def VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
3485 v4i16, v4i16, int_arm_neon_vpadd, 0>;
3486 def VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
3488 v2i32, v2i32, int_arm_neon_vpadd, 0>;
3489 def VPADDf : N3VDInt<1, 0, 0b00, 0b1101, 0, N3RegFrm,
3490 IIC_VPBIND, "vpadd", "f32",
3491 v2f32, v2f32, int_arm_neon_vpadd, 0>;
3493 // VPADDL : Vector Pairwise Add Long
3494 defm VPADDLs : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl", "s",
3495 int_arm_neon_vpaddls>;
3496 defm VPADDLu : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl", "u",
3497 int_arm_neon_vpaddlu>;
3499 // VPADAL : Vector Pairwise Add and Accumulate Long
3500 defm VPADALs : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01100, 0, "vpadal", "s",
3501 int_arm_neon_vpadals>;
3502 defm VPADALu : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01101, 0, "vpadal", "u",
3503 int_arm_neon_vpadalu>;
3505 // VPMAX : Vector Pairwise Maximum
3506 def VPMAXs8 : N3VDInt<0, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3507 "s8", v8i8, v8i8, int_arm_neon_vpmaxs, 0>;
3508 def VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3509 "s16", v4i16, v4i16, int_arm_neon_vpmaxs, 0>;
3510 def VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3511 "s32", v2i32, v2i32, int_arm_neon_vpmaxs, 0>;
3512 def VPMAXu8 : N3VDInt<1, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3513 "u8", v8i8, v8i8, int_arm_neon_vpmaxu, 0>;
3514 def VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3515 "u16", v4i16, v4i16, int_arm_neon_vpmaxu, 0>;
3516 def VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
3517 "u32", v2i32, v2i32, int_arm_neon_vpmaxu, 0>;
3518 def VPMAXf : N3VDInt<1, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmax",
3519 "f32", v2f32, v2f32, int_arm_neon_vpmaxs, 0>;
3521 // VPMIN : Vector Pairwise Minimum
3522 def VPMINs8 : N3VDInt<0, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3523 "s8", v8i8, v8i8, int_arm_neon_vpmins, 0>;
3524 def VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3525 "s16", v4i16, v4i16, int_arm_neon_vpmins, 0>;
3526 def VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3527 "s32", v2i32, v2i32, int_arm_neon_vpmins, 0>;
3528 def VPMINu8 : N3VDInt<1, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3529 "u8", v8i8, v8i8, int_arm_neon_vpminu, 0>;
3530 def VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3531 "u16", v4i16, v4i16, int_arm_neon_vpminu, 0>;
3532 def VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
3533 "u32", v2i32, v2i32, int_arm_neon_vpminu, 0>;
3534 def VPMINf : N3VDInt<1, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmin",
3535 "f32", v2f32, v2f32, int_arm_neon_vpmins, 0>;
3537 // Vector Reciprocal and Reciprocal Square Root Estimate and Step.
3539 // VRECPE : Vector Reciprocal Estimate
3540 def VRECPEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
3541 IIC_VUNAD, "vrecpe", "u32",
3542 v2i32, v2i32, int_arm_neon_vrecpe>;
3543 def VRECPEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
3544 IIC_VUNAQ, "vrecpe", "u32",
3545 v4i32, v4i32, int_arm_neon_vrecpe>;
3546 def VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
3547 IIC_VUNAD, "vrecpe", "f32",
3548 v2f32, v2f32, int_arm_neon_vrecpe>;
3549 def VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
3550 IIC_VUNAQ, "vrecpe", "f32",
3551 v4f32, v4f32, int_arm_neon_vrecpe>;
3553 // VRECPS : Vector Reciprocal Step
3554 def VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
3555 IIC_VRECSD, "vrecps", "f32",
3556 v2f32, v2f32, int_arm_neon_vrecps, 1>;
3557 def VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
3558 IIC_VRECSQ, "vrecps", "f32",
3559 v4f32, v4f32, int_arm_neon_vrecps, 1>;
3561 // VRSQRTE : Vector Reciprocal Square Root Estimate
3562 def VRSQRTEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
3563 IIC_VUNAD, "vrsqrte", "u32",
3564 v2i32, v2i32, int_arm_neon_vrsqrte>;
3565 def VRSQRTEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
3566 IIC_VUNAQ, "vrsqrte", "u32",
3567 v4i32, v4i32, int_arm_neon_vrsqrte>;
3568 def VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
3569 IIC_VUNAD, "vrsqrte", "f32",
3570 v2f32, v2f32, int_arm_neon_vrsqrte>;
3571 def VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
3572 IIC_VUNAQ, "vrsqrte", "f32",
3573 v4f32, v4f32, int_arm_neon_vrsqrte>;
3575 // VRSQRTS : Vector Reciprocal Square Root Step
3576 def VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
3577 IIC_VRECSD, "vrsqrts", "f32",
3578 v2f32, v2f32, int_arm_neon_vrsqrts, 1>;
3579 def VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
3580 IIC_VRECSQ, "vrsqrts", "f32",
3581 v4f32, v4f32, int_arm_neon_vrsqrts, 1>;
3585 // VSHL : Vector Shift
3586 defm VSHLs : N3VInt_QHSDSh<0, 0, 0b0100, 0, N3RegVShFrm,
3587 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
3588 "vshl", "s", int_arm_neon_vshifts>;
3589 defm VSHLu : N3VInt_QHSDSh<1, 0, 0b0100, 0, N3RegVShFrm,
3590 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
3591 "vshl", "u", int_arm_neon_vshiftu>;
3592 // VSHL : Vector Shift Left (Immediate)
3593 defm VSHLi : N2VSh_QHSD<0, 1, 0b0101, 1, IIC_VSHLiD, "vshl", "i", NEONvshl,
3595 // VSHR : Vector Shift Right (Immediate)
3596 defm VSHRs : N2VSh_QHSD<0, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "s", NEONvshrs,
3598 defm VSHRu : N2VSh_QHSD<1, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "u", NEONvshru,
3601 // VSHLL : Vector Shift Left Long
3602 defm VSHLLs : N2VLSh_QHS<0, 1, 0b1010, 0, 0, 1, "vshll", "s", NEONvshlls>;
3603 defm VSHLLu : N2VLSh_QHS<1, 1, 0b1010, 0, 0, 1, "vshll", "u", NEONvshllu>;
3605 // VSHLL : Vector Shift Left Long (with maximum shift count)
3606 class N2VLShMax<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
3607 bit op6, bit op4, string OpcodeStr, string Dt, ValueType ResTy,
3608 ValueType OpTy, SDNode OpNode>
3609 : N2VLSh<op24, op23, op11_8, op7, op6, op4, OpcodeStr, Dt,
3610 ResTy, OpTy, OpNode> {
3611 let Inst{21-16} = op21_16;
3613 def VSHLLi8 : N2VLShMax<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll", "i8",
3614 v8i16, v8i8, NEONvshlli>;
3615 def VSHLLi16 : N2VLShMax<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll", "i16",
3616 v4i32, v4i16, NEONvshlli>;
3617 def VSHLLi32 : N2VLShMax<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll", "i32",
3618 v2i64, v2i32, NEONvshlli>;
3620 // VSHRN : Vector Shift Right and Narrow
3621 defm VSHRN : N2VNSh_HSD<0,1,0b1000,0,0,1, IIC_VSHLiD, "vshrn", "i",
3624 // VRSHL : Vector Rounding Shift
3625 defm VRSHLs : N3VInt_QHSDSh<0, 0, 0b0101, 0, N3RegVShFrm,
3626 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
3627 "vrshl", "s", int_arm_neon_vrshifts>;
3628 defm VRSHLu : N3VInt_QHSDSh<1, 0, 0b0101, 0, N3RegVShFrm,
3629 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
3630 "vrshl", "u", int_arm_neon_vrshiftu>;
3631 // VRSHR : Vector Rounding Shift Right
3632 defm VRSHRs : N2VSh_QHSD<0,1,0b0010,1, IIC_VSHLi4D, "vrshr", "s", NEONvrshrs,
3634 defm VRSHRu : N2VSh_QHSD<1,1,0b0010,1, IIC_VSHLi4D, "vrshr", "u", NEONvrshru,
3637 // VRSHRN : Vector Rounding Shift Right and Narrow
3638 defm VRSHRN : N2VNSh_HSD<0, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vrshrn", "i",
3641 // VQSHL : Vector Saturating Shift
3642 defm VQSHLs : N3VInt_QHSDSh<0, 0, 0b0100, 1, N3RegVShFrm,
3643 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
3644 "vqshl", "s", int_arm_neon_vqshifts>;
3645 defm VQSHLu : N3VInt_QHSDSh<1, 0, 0b0100, 1, N3RegVShFrm,
3646 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
3647 "vqshl", "u", int_arm_neon_vqshiftu>;
3648 // VQSHL : Vector Saturating Shift Left (Immediate)
3649 defm VQSHLsi : N2VSh_QHSD<0,1,0b0111,1, IIC_VSHLi4D, "vqshl", "s",NEONvqshls,
3651 defm VQSHLui : N2VSh_QHSD<1,1,0b0111,1, IIC_VSHLi4D, "vqshl", "u",NEONvqshlu,
3653 // VQSHLU : Vector Saturating Shift Left (Immediate, Unsigned)
3654 defm VQSHLsu : N2VSh_QHSD<1,1,0b0110,1, IIC_VSHLi4D,"vqshlu","s",NEONvqshlsu,
3657 // VQSHRN : Vector Saturating Shift Right and Narrow
3658 defm VQSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "s",
3660 defm VQSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "u",
3663 // VQSHRUN : Vector Saturating Shift Right and Narrow (Unsigned)
3664 defm VQSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 0, 1, IIC_VSHLi4D, "vqshrun", "s",
3667 // VQRSHL : Vector Saturating Rounding Shift
3668 defm VQRSHLs : N3VInt_QHSDSh<0, 0, 0b0101, 1, N3RegVShFrm,
3669 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
3670 "vqrshl", "s", int_arm_neon_vqrshifts>;
3671 defm VQRSHLu : N3VInt_QHSDSh<1, 0, 0b0101, 1, N3RegVShFrm,
3672 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
3673 "vqrshl", "u", int_arm_neon_vqrshiftu>;
3675 // VQRSHRN : Vector Saturating Rounding Shift Right and Narrow
3676 defm VQRSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "s",
3678 defm VQRSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "u",
3681 // VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned)
3682 defm VQRSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vqrshrun", "s",
3685 // VSRA : Vector Shift Right and Accumulate
3686 defm VSRAs : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra", "s", NEONvshrs>;
3687 defm VSRAu : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra", "u", NEONvshru>;
3688 // VRSRA : Vector Rounding Shift Right and Accumulate
3689 defm VRSRAs : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra", "s", NEONvrshrs>;
3690 defm VRSRAu : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra", "u", NEONvrshru>;
3692 // VSLI : Vector Shift Left and Insert
3693 defm VSLI : N2VShIns_QHSD<1, 1, 0b0101, 1, "vsli", NEONvsli, N2RegVShLFrm>;
3694 // VSRI : Vector Shift Right and Insert
3695 defm VSRI : N2VShIns_QHSD<1, 1, 0b0100, 1, "vsri", NEONvsri, N2RegVShRFrm>;
3697 // Vector Absolute and Saturating Absolute.
3699 // VABS : Vector Absolute Value
3700 defm VABS : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0,
3701 IIC_VUNAiD, IIC_VUNAiQ, "vabs", "s",
3703 def VABSfd : N2VDInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
3704 IIC_VUNAD, "vabs", "f32",
3705 v2f32, v2f32, int_arm_neon_vabs>;
3706 def VABSfq : N2VQInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
3707 IIC_VUNAQ, "vabs", "f32",
3708 v4f32, v4f32, int_arm_neon_vabs>;
3710 // VQABS : Vector Saturating Absolute Value
3711 defm VQABS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0,
3712 IIC_VQUNAiD, IIC_VQUNAiQ, "vqabs", "s",
3713 int_arm_neon_vqabs>;
3717 def vnegd : PatFrag<(ops node:$in),
3718 (sub (bitconvert (v2i32 NEONimmAllZerosV)), node:$in)>;
3719 def vnegq : PatFrag<(ops node:$in),
3720 (sub (bitconvert (v4i32 NEONimmAllZerosV)), node:$in)>;
3722 class VNEGD<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
3723 : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$dst), (ins DPR:$src),
3724 IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
3725 [(set DPR:$dst, (Ty (vnegd DPR:$src)))]>;
3726 class VNEGQ<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
3727 : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$dst), (ins QPR:$src),
3728 IIC_VSHLiQ, OpcodeStr, Dt, "$dst, $src", "",
3729 [(set QPR:$dst, (Ty (vnegq QPR:$src)))]>;
3731 // VNEG : Vector Negate (integer)
3732 def VNEGs8d : VNEGD<0b00, "vneg", "s8", v8i8>;
3733 def VNEGs16d : VNEGD<0b01, "vneg", "s16", v4i16>;
3734 def VNEGs32d : VNEGD<0b10, "vneg", "s32", v2i32>;
3735 def VNEGs8q : VNEGQ<0b00, "vneg", "s8", v16i8>;
3736 def VNEGs16q : VNEGQ<0b01, "vneg", "s16", v8i16>;
3737 def VNEGs32q : VNEGQ<0b10, "vneg", "s32", v4i32>;
3739 // VNEG : Vector Negate (floating-point)
3740 def VNEGfd : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
3741 (outs DPR:$dst), (ins DPR:$src), IIC_VUNAD,
3742 "vneg", "f32", "$dst, $src", "",
3743 [(set DPR:$dst, (v2f32 (fneg DPR:$src)))]>;
3744 def VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0,
3745 (outs QPR:$dst), (ins QPR:$src), IIC_VUNAQ,
3746 "vneg", "f32", "$dst, $src", "",
3747 [(set QPR:$dst, (v4f32 (fneg QPR:$src)))]>;
3749 def : Pat<(v8i8 (vnegd DPR:$src)), (VNEGs8d DPR:$src)>;
3750 def : Pat<(v4i16 (vnegd DPR:$src)), (VNEGs16d DPR:$src)>;
3751 def : Pat<(v2i32 (vnegd DPR:$src)), (VNEGs32d DPR:$src)>;
3752 def : Pat<(v16i8 (vnegq QPR:$src)), (VNEGs8q QPR:$src)>;
3753 def : Pat<(v8i16 (vnegq QPR:$src)), (VNEGs16q QPR:$src)>;
3754 def : Pat<(v4i32 (vnegq QPR:$src)), (VNEGs32q QPR:$src)>;
3756 // VQNEG : Vector Saturating Negate
3757 defm VQNEG : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0,
3758 IIC_VQUNAiD, IIC_VQUNAiQ, "vqneg", "s",
3759 int_arm_neon_vqneg>;
3761 // Vector Bit Counting Operations.
3763 // VCLS : Vector Count Leading Sign Bits
3764 defm VCLS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0,
3765 IIC_VCNTiD, IIC_VCNTiQ, "vcls", "s",
3767 // VCLZ : Vector Count Leading Zeros
3768 defm VCLZ : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0,
3769 IIC_VCNTiD, IIC_VCNTiQ, "vclz", "i",
3771 // VCNT : Vector Count One Bits
3772 def VCNTd : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
3773 IIC_VCNTiD, "vcnt", "8",
3774 v8i8, v8i8, int_arm_neon_vcnt>;
3775 def VCNTq : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
3776 IIC_VCNTiQ, "vcnt", "8",
3777 v16i8, v16i8, int_arm_neon_vcnt>;
3779 // Vector Swap -- for disassembly only.
3780 def VSWPd : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 0, 0,
3781 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
3782 "vswp", "$dst, $src", "", []>;
3783 def VSWPq : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 1, 0,
3784 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
3785 "vswp", "$dst, $src", "", []>;
3787 // Vector Move Operations.
3789 // VMOV : Vector Move (Register)
3791 let neverHasSideEffects = 1 in {
3792 def VMOVDneon: N3VX<0, 0, 0b10, 0b0001, 0, 1, (outs DPR:$dst), (ins DPR:$src),
3793 N3RegFrm, IIC_VMOV, "vmov", "$dst, $src", "", []>;
3794 def VMOVQ : N3VX<0, 0, 0b10, 0b0001, 1, 1, (outs QPR:$dst), (ins QPR:$src),
3795 N3RegFrm, IIC_VMOV, "vmov", "$dst, $src", "", []>;
3797 // Pseudo vector move instructions for QQ and QQQQ registers. This should
3798 // be expanded after register allocation is completed.
3799 def VMOVQQ : PseudoInst<(outs QQPR:$dst), (ins QQPR:$src),
3800 NoItinerary, "", []>;
3802 def VMOVQQQQ : PseudoInst<(outs QQQQPR:$dst), (ins QQQQPR:$src),
3803 NoItinerary, "", []>;
3804 } // neverHasSideEffects
3806 // VMOV : Vector Move (Immediate)
3808 let isReMaterializable = 1 in {
3809 def VMOVv8i8 : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$dst),
3810 (ins nModImm:$SIMM), IIC_VMOVImm,
3811 "vmov", "i8", "$dst, $SIMM", "",
3812 [(set DPR:$dst, (v8i8 (NEONvmovImm timm:$SIMM)))]>;
3813 def VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$dst),
3814 (ins nModImm:$SIMM), IIC_VMOVImm,
3815 "vmov", "i8", "$dst, $SIMM", "",
3816 [(set QPR:$dst, (v16i8 (NEONvmovImm timm:$SIMM)))]>;
3818 def VMOVv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 0, 1, (outs DPR:$dst),
3819 (ins nModImm:$SIMM), IIC_VMOVImm,
3820 "vmov", "i16", "$dst, $SIMM", "",
3821 [(set DPR:$dst, (v4i16 (NEONvmovImm timm:$SIMM)))]> {
3822 let Inst{9} = SIMM{9};
3825 def VMOVv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 0, 1, (outs QPR:$dst),
3826 (ins nModImm:$SIMM), IIC_VMOVImm,
3827 "vmov", "i16", "$dst, $SIMM", "",
3828 [(set QPR:$dst, (v8i16 (NEONvmovImm timm:$SIMM)))]> {
3829 let Inst{9} = SIMM{9};
3832 def VMOVv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 0, 1, (outs DPR:$dst),
3833 (ins nModImm:$SIMM), IIC_VMOVImm,
3834 "vmov", "i32", "$dst, $SIMM", "",
3835 [(set DPR:$dst, (v2i32 (NEONvmovImm timm:$SIMM)))]> {
3836 let Inst{11-8} = SIMM{11-8};
3839 def VMOVv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 0, 1, (outs QPR:$dst),
3840 (ins nModImm:$SIMM), IIC_VMOVImm,
3841 "vmov", "i32", "$dst, $SIMM", "",
3842 [(set QPR:$dst, (v4i32 (NEONvmovImm timm:$SIMM)))]> {
3843 let Inst{11-8} = SIMM{11-8};
3846 def VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$dst),
3847 (ins nModImm:$SIMM), IIC_VMOVImm,
3848 "vmov", "i64", "$dst, $SIMM", "",
3849 [(set DPR:$dst, (v1i64 (NEONvmovImm timm:$SIMM)))]>;
3850 def VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$dst),
3851 (ins nModImm:$SIMM), IIC_VMOVImm,
3852 "vmov", "i64", "$dst, $SIMM", "",
3853 [(set QPR:$dst, (v2i64 (NEONvmovImm timm:$SIMM)))]>;
3854 } // isReMaterializable
3856 // VMOV : Vector Get Lane (move scalar to ARM core register)
3858 def VGETLNs8 : NVGetLane<{1,1,1,0,0,1,?,1}, 0b1011, {?,?},
3859 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
3860 IIC_VMOVSI, "vmov", "s8", "$R, $V[$lane]",
3861 [(set GPR:$R, (NEONvgetlanes (v8i8 DPR:$V),
3863 let Inst{21} = lane{2};
3864 let Inst{6-5} = lane{1-0};
3866 def VGETLNs16 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, {?,1},
3867 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
3868 IIC_VMOVSI, "vmov", "s16", "$R, $V[$lane]",
3869 [(set GPR:$R, (NEONvgetlanes (v4i16 DPR:$V),
3871 let Inst{21} = lane{1};
3872 let Inst{6} = lane{0};
3874 def VGETLNu8 : NVGetLane<{1,1,1,0,1,1,?,1}, 0b1011, {?,?},
3875 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
3876 IIC_VMOVSI, "vmov", "u8", "$R, $V[$lane]",
3877 [(set GPR:$R, (NEONvgetlaneu (v8i8 DPR:$V),
3879 let Inst{21} = lane{2};
3880 let Inst{6-5} = lane{1-0};
3882 def VGETLNu16 : NVGetLane<{1,1,1,0,1,0,?,1}, 0b1011, {?,1},
3883 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
3884 IIC_VMOVSI, "vmov", "u16", "$R, $V[$lane]",
3885 [(set GPR:$R, (NEONvgetlaneu (v4i16 DPR:$V),
3887 let Inst{21} = lane{1};
3888 let Inst{6} = lane{0};
3890 def VGETLNi32 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, 0b00,
3891 (outs GPR:$R), (ins DPR:$V, nohash_imm:$lane),
3892 IIC_VMOVSI, "vmov", "32", "$R, $V[$lane]",
3893 [(set GPR:$R, (extractelt (v2i32 DPR:$V),
3895 let Inst{21} = lane{0};
3897 // def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
3898 def : Pat<(NEONvgetlanes (v16i8 QPR:$src), imm:$lane),
3899 (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
3900 (DSubReg_i8_reg imm:$lane))),
3901 (SubReg_i8_lane imm:$lane))>;
3902 def : Pat<(NEONvgetlanes (v8i16 QPR:$src), imm:$lane),
3903 (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
3904 (DSubReg_i16_reg imm:$lane))),
3905 (SubReg_i16_lane imm:$lane))>;
3906 def : Pat<(NEONvgetlaneu (v16i8 QPR:$src), imm:$lane),
3907 (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
3908 (DSubReg_i8_reg imm:$lane))),
3909 (SubReg_i8_lane imm:$lane))>;
3910 def : Pat<(NEONvgetlaneu (v8i16 QPR:$src), imm:$lane),
3911 (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
3912 (DSubReg_i16_reg imm:$lane))),
3913 (SubReg_i16_lane imm:$lane))>;
3914 def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
3915 (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
3916 (DSubReg_i32_reg imm:$lane))),
3917 (SubReg_i32_lane imm:$lane))>;
3918 def : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2),
3919 (EXTRACT_SUBREG (v2f32 (COPY_TO_REGCLASS (v2f32 DPR:$src1),DPR_VFP2)),
3920 (SSubReg_f32_reg imm:$src2))>;
3921 def : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
3922 (EXTRACT_SUBREG (v4f32 (COPY_TO_REGCLASS (v4f32 QPR:$src1),QPR_VFP2)),
3923 (SSubReg_f32_reg imm:$src2))>;
3924 //def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
3925 // (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
3926 def : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
3927 (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
3930 // VMOV : Vector Set Lane (move ARM core register to scalar)
3932 let Constraints = "$src1 = $V" in {
3933 def VSETLNi8 : NVSetLane<{1,1,1,0,0,1,?,0}, 0b1011, {?,?}, (outs DPR:$V),
3934 (ins DPR:$src1, GPR:$R, nohash_imm:$lane),
3935 IIC_VMOVISL, "vmov", "8", "$V[$lane], $R",
3936 [(set DPR:$V, (vector_insert (v8i8 DPR:$src1),
3937 GPR:$R, imm:$lane))]> {
3938 let Inst{21} = lane{2};
3939 let Inst{6-5} = lane{1-0};
3941 def VSETLNi16 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, {?,1}, (outs DPR:$V),
3942 (ins DPR:$src1, GPR:$R, nohash_imm:$lane),
3943 IIC_VMOVISL, "vmov", "16", "$V[$lane], $R",
3944 [(set DPR:$V, (vector_insert (v4i16 DPR:$src1),
3945 GPR:$R, imm:$lane))]> {
3946 let Inst{21} = lane{1};
3947 let Inst{6} = lane{0};
3949 def VSETLNi32 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, 0b00, (outs DPR:$V),
3950 (ins DPR:$src1, GPR:$R, nohash_imm:$lane),
3951 IIC_VMOVISL, "vmov", "32", "$V[$lane], $R",
3952 [(set DPR:$V, (insertelt (v2i32 DPR:$src1),
3953 GPR:$R, imm:$lane))]> {
3954 let Inst{21} = lane{0};
3957 def : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
3958 (v16i8 (INSERT_SUBREG QPR:$src1,
3959 (v8i8 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
3960 (DSubReg_i8_reg imm:$lane))),
3961 GPR:$src2, (SubReg_i8_lane imm:$lane))),
3962 (DSubReg_i8_reg imm:$lane)))>;
3963 def : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
3964 (v8i16 (INSERT_SUBREG QPR:$src1,
3965 (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
3966 (DSubReg_i16_reg imm:$lane))),
3967 GPR:$src2, (SubReg_i16_lane imm:$lane))),
3968 (DSubReg_i16_reg imm:$lane)))>;
3969 def : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
3970 (v4i32 (INSERT_SUBREG QPR:$src1,
3971 (v2i32 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
3972 (DSubReg_i32_reg imm:$lane))),
3973 GPR:$src2, (SubReg_i32_lane imm:$lane))),
3974 (DSubReg_i32_reg imm:$lane)))>;
3976 def : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)),
3977 (INSERT_SUBREG (v2f32 (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2)),
3978 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
3979 def : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
3980 (INSERT_SUBREG (v4f32 (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2)),
3981 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
3983 //def : Pat<(v2i64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
3984 // (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
3985 def : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
3986 (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
3988 def : Pat<(v2f32 (scalar_to_vector SPR:$src)),
3989 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
3990 def : Pat<(v2f64 (scalar_to_vector (f64 DPR:$src))),
3991 (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
3992 def : Pat<(v4f32 (scalar_to_vector SPR:$src)),
3993 (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
3995 def : Pat<(v8i8 (scalar_to_vector GPR:$src)),
3996 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
3997 def : Pat<(v4i16 (scalar_to_vector GPR:$src)),
3998 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
3999 def : Pat<(v2i32 (scalar_to_vector GPR:$src)),
4000 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
4002 def : Pat<(v16i8 (scalar_to_vector GPR:$src)),
4003 (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)),
4004 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
4006 def : Pat<(v8i16 (scalar_to_vector GPR:$src)),
4007 (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)),
4008 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
4010 def : Pat<(v4i32 (scalar_to_vector GPR:$src)),
4011 (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
4012 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
4015 // VDUP : Vector Duplicate (from ARM core register to all elements)
4017 class VDUPD<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
4018 : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$dst), (ins GPR:$src),
4019 IIC_VMOVIS, "vdup", Dt, "$dst, $src",
4020 [(set DPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>;
4021 class VDUPQ<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
4022 : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$dst), (ins GPR:$src),
4023 IIC_VMOVIS, "vdup", Dt, "$dst, $src",
4024 [(set QPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>;
4026 def VDUP8d : VDUPD<0b11101100, 0b00, "8", v8i8>;
4027 def VDUP16d : VDUPD<0b11101000, 0b01, "16", v4i16>;
4028 def VDUP32d : VDUPD<0b11101000, 0b00, "32", v2i32>;
4029 def VDUP8q : VDUPQ<0b11101110, 0b00, "8", v16i8>;
4030 def VDUP16q : VDUPQ<0b11101010, 0b01, "16", v8i16>;
4031 def VDUP32q : VDUPQ<0b11101010, 0b00, "32", v4i32>;
4033 def VDUPfd : NVDup<0b11101000, 0b1011, 0b00, (outs DPR:$dst), (ins GPR:$src),
4034 IIC_VMOVIS, "vdup", "32", "$dst, $src",
4035 [(set DPR:$dst, (v2f32 (NEONvdup
4036 (f32 (bitconvert GPR:$src)))))]>;
4037 def VDUPfq : NVDup<0b11101010, 0b1011, 0b00, (outs QPR:$dst), (ins GPR:$src),
4038 IIC_VMOVIS, "vdup", "32", "$dst, $src",
4039 [(set QPR:$dst, (v4f32 (NEONvdup
4040 (f32 (bitconvert GPR:$src)))))]>;
4042 // VDUP : Vector Duplicate Lane (from scalar to all elements)
4044 class VDUPLND<bits<4> op19_16, string OpcodeStr, string Dt,
4046 : NVDupLane<op19_16, 0, (outs DPR:$dst), (ins DPR:$src, nohash_imm:$lane),
4047 IIC_VMOVD, OpcodeStr, Dt, "$dst, $src[$lane]",
4048 [(set DPR:$dst, (Ty (NEONvduplane (Ty DPR:$src), imm:$lane)))]>;
4050 class VDUPLNQ<bits<4> op19_16, string OpcodeStr, string Dt,
4051 ValueType ResTy, ValueType OpTy>
4052 : NVDupLane<op19_16, 1, (outs QPR:$dst), (ins DPR:$src, nohash_imm:$lane),
4053 IIC_VMOVQ, OpcodeStr, Dt, "$dst, $src[$lane]",
4054 [(set QPR:$dst, (ResTy (NEONvduplane (OpTy DPR:$src),
4057 // Inst{19-16} is partially specified depending on the element size.
4059 def VDUPLN8d : VDUPLND<{?,?,?,1}, "vdup", "8", v8i8> {
4060 let Inst{19-17} = lane{2-0};
4062 def VDUPLN16d : VDUPLND<{?,?,1,0}, "vdup", "16", v4i16> {
4063 let Inst{19-18} = lane{1-0};
4065 def VDUPLN32d : VDUPLND<{?,1,0,0}, "vdup", "32", v2i32> {
4066 let Inst{19} = lane{0};
4068 def VDUPLNfd : VDUPLND<{?,1,0,0}, "vdup", "32", v2f32> {
4069 let Inst{19} = lane{0};
4071 def VDUPLN8q : VDUPLNQ<{?,?,?,1}, "vdup", "8", v16i8, v8i8> {
4072 let Inst{19-17} = lane{2-0};
4074 def VDUPLN16q : VDUPLNQ<{?,?,1,0}, "vdup", "16", v8i16, v4i16> {
4075 let Inst{19-18} = lane{1-0};
4077 def VDUPLN32q : VDUPLNQ<{?,1,0,0}, "vdup", "32", v4i32, v2i32> {
4078 let Inst{19} = lane{0};
4080 def VDUPLNfq : VDUPLNQ<{?,1,0,0}, "vdup", "32", v4f32, v2f32> {
4081 let Inst{19} = lane{0};
4084 def : Pat<(v16i8 (NEONvduplane (v16i8 QPR:$src), imm:$lane)),
4085 (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src,
4086 (DSubReg_i8_reg imm:$lane))),
4087 (SubReg_i8_lane imm:$lane)))>;
4088 def : Pat<(v8i16 (NEONvduplane (v8i16 QPR:$src), imm:$lane)),
4089 (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src,
4090 (DSubReg_i16_reg imm:$lane))),
4091 (SubReg_i16_lane imm:$lane)))>;
4092 def : Pat<(v4i32 (NEONvduplane (v4i32 QPR:$src), imm:$lane)),
4093 (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src,
4094 (DSubReg_i32_reg imm:$lane))),
4095 (SubReg_i32_lane imm:$lane)))>;
4096 def : Pat<(v4f32 (NEONvduplane (v4f32 QPR:$src), imm:$lane)),
4097 (v4f32 (VDUPLNfq (v2f32 (EXTRACT_SUBREG QPR:$src,
4098 (DSubReg_i32_reg imm:$lane))),
4099 (SubReg_i32_lane imm:$lane)))>;
4101 def VDUPfdf : PseudoNeonI<(outs DPR:$dst), (ins SPR:$src), IIC_VMOVD, "",
4102 [(set DPR:$dst, (v2f32 (NEONvdup (f32 SPR:$src))))]>;
4103 def VDUPfqf : PseudoNeonI<(outs QPR:$dst), (ins SPR:$src), IIC_VMOVD, "",
4104 [(set QPR:$dst, (v4f32 (NEONvdup (f32 SPR:$src))))]>;
4106 // VMOVN : Vector Narrowing Move
4107 defm VMOVN : N2VN_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVN,
4108 "vmovn", "i", trunc>;
4109 // VQMOVN : Vector Saturating Narrowing Move
4110 defm VQMOVNs : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD,
4111 "vqmovn", "s", int_arm_neon_vqmovns>;
4112 defm VQMOVNu : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD,
4113 "vqmovn", "u", int_arm_neon_vqmovnu>;
4114 defm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD,
4115 "vqmovun", "s", int_arm_neon_vqmovnsu>;
4116 // VMOVL : Vector Lengthening Move
4117 defm VMOVLs : N2VL_QHS<0b01,0b10100,0,1, "vmovl", "s", sext>;
4118 defm VMOVLu : N2VL_QHS<0b11,0b10100,0,1, "vmovl", "u", zext>;
4120 // Vector Conversions.
4122 // VCVT : Vector Convert Between Floating-Point and Integers
4123 def VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
4124 v2i32, v2f32, fp_to_sint>;
4125 def VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
4126 v2i32, v2f32, fp_to_uint>;
4127 def VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
4128 v2f32, v2i32, sint_to_fp>;
4129 def VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
4130 v2f32, v2i32, uint_to_fp>;
4132 def VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
4133 v4i32, v4f32, fp_to_sint>;
4134 def VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
4135 v4i32, v4f32, fp_to_uint>;
4136 def VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
4137 v4f32, v4i32, sint_to_fp>;
4138 def VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
4139 v4f32, v4i32, uint_to_fp>;
4141 // VCVT : Vector Convert Between Floating-Point and Fixed-Point.
4142 def VCVTf2xsd : N2VCvtD<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
4143 v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
4144 def VCVTf2xud : N2VCvtD<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
4145 v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
4146 def VCVTxs2fd : N2VCvtD<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
4147 v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
4148 def VCVTxu2fd : N2VCvtD<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
4149 v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
4151 def VCVTf2xsq : N2VCvtQ<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
4152 v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
4153 def VCVTf2xuq : N2VCvtQ<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
4154 v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
4155 def VCVTxs2fq : N2VCvtQ<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
4156 v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
4157 def VCVTxu2fq : N2VCvtQ<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
4158 v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
4162 // VREV64 : Vector Reverse elements within 64-bit doublewords
4164 class VREV64D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4165 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$dst),
4166 (ins DPR:$src), IIC_VMOVD,
4167 OpcodeStr, Dt, "$dst, $src", "",
4168 [(set DPR:$dst, (Ty (NEONvrev64 (Ty DPR:$src))))]>;
4169 class VREV64Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4170 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$dst),
4171 (ins QPR:$src), IIC_VMOVQ,
4172 OpcodeStr, Dt, "$dst, $src", "",
4173 [(set QPR:$dst, (Ty (NEONvrev64 (Ty QPR:$src))))]>;
4175 def VREV64d8 : VREV64D<0b00, "vrev64", "8", v8i8>;
4176 def VREV64d16 : VREV64D<0b01, "vrev64", "16", v4i16>;
4177 def VREV64d32 : VREV64D<0b10, "vrev64", "32", v2i32>;
4178 def VREV64df : VREV64D<0b10, "vrev64", "32", v2f32>;
4180 def VREV64q8 : VREV64Q<0b00, "vrev64", "8", v16i8>;
4181 def VREV64q16 : VREV64Q<0b01, "vrev64", "16", v8i16>;
4182 def VREV64q32 : VREV64Q<0b10, "vrev64", "32", v4i32>;
4183 def VREV64qf : VREV64Q<0b10, "vrev64", "32", v4f32>;
4185 // VREV32 : Vector Reverse elements within 32-bit words
4187 class VREV32D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4188 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$dst),
4189 (ins DPR:$src), IIC_VMOVD,
4190 OpcodeStr, Dt, "$dst, $src", "",
4191 [(set DPR:$dst, (Ty (NEONvrev32 (Ty DPR:$src))))]>;
4192 class VREV32Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4193 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$dst),
4194 (ins QPR:$src), IIC_VMOVQ,
4195 OpcodeStr, Dt, "$dst, $src", "",
4196 [(set QPR:$dst, (Ty (NEONvrev32 (Ty QPR:$src))))]>;
4198 def VREV32d8 : VREV32D<0b00, "vrev32", "8", v8i8>;
4199 def VREV32d16 : VREV32D<0b01, "vrev32", "16", v4i16>;
4201 def VREV32q8 : VREV32Q<0b00, "vrev32", "8", v16i8>;
4202 def VREV32q16 : VREV32Q<0b01, "vrev32", "16", v8i16>;
4204 // VREV16 : Vector Reverse elements within 16-bit halfwords
4206 class VREV16D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4207 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$dst),
4208 (ins DPR:$src), IIC_VMOVD,
4209 OpcodeStr, Dt, "$dst, $src", "",
4210 [(set DPR:$dst, (Ty (NEONvrev16 (Ty DPR:$src))))]>;
4211 class VREV16Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
4212 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$dst),
4213 (ins QPR:$src), IIC_VMOVQ,
4214 OpcodeStr, Dt, "$dst, $src", "",
4215 [(set QPR:$dst, (Ty (NEONvrev16 (Ty QPR:$src))))]>;
4217 def VREV16d8 : VREV16D<0b00, "vrev16", "8", v8i8>;
4218 def VREV16q8 : VREV16Q<0b00, "vrev16", "8", v16i8>;
4220 // Other Vector Shuffles.
4222 // VEXT : Vector Extract
4224 class VEXTd<string OpcodeStr, string Dt, ValueType Ty>
4225 : N3V<0,1,0b11,{?,?,?,?},0,0, (outs DPR:$dst),
4226 (ins DPR:$lhs, DPR:$rhs, i32imm:$index), NVExtFrm,
4227 IIC_VEXTD, OpcodeStr, Dt, "$dst, $lhs, $rhs, $index", "",
4228 [(set DPR:$dst, (Ty (NEONvext (Ty DPR:$lhs),
4229 (Ty DPR:$rhs), imm:$index)))]> {
4231 let Inst{11-8} = index{3-0};
4234 class VEXTq<string OpcodeStr, string Dt, ValueType Ty>
4235 : N3V<0,1,0b11,{?,?,?,?},1,0, (outs QPR:$dst),
4236 (ins QPR:$lhs, QPR:$rhs, i32imm:$index), NVExtFrm,
4237 IIC_VEXTQ, OpcodeStr, Dt, "$dst, $lhs, $rhs, $index", "",
4238 [(set QPR:$dst, (Ty (NEONvext (Ty QPR:$lhs),
4239 (Ty QPR:$rhs), imm:$index)))]> {
4241 let Inst{11-8} = index{3-0};
4244 def VEXTd8 : VEXTd<"vext", "8", v8i8> {
4245 let Inst{11-8} = index{3-0};
4247 def VEXTd16 : VEXTd<"vext", "16", v4i16> {
4248 let Inst{11-9} = index{2-0};
4251 def VEXTd32 : VEXTd<"vext", "32", v2i32> {
4252 let Inst{11-10} = index{1-0};
4253 let Inst{9-8} = 0b00;
4255 def VEXTdf : VEXTd<"vext", "32", v2f32> {
4256 let Inst{11} = index{0};
4257 let Inst{10-8} = 0b000;
4260 def VEXTq8 : VEXTq<"vext", "8", v16i8> {
4261 let Inst{11-8} = index{3-0};
4263 def VEXTq16 : VEXTq<"vext", "16", v8i16> {
4264 let Inst{11-9} = index{2-0};
4267 def VEXTq32 : VEXTq<"vext", "32", v4i32> {
4268 let Inst{11-10} = index{1-0};
4269 let Inst{9-8} = 0b00;
4271 def VEXTqf : VEXTq<"vext", "32", v4f32> {
4272 let Inst{11} = index{0};
4273 let Inst{10-8} = 0b000;
4276 // VTRN : Vector Transpose
4278 def VTRNd8 : N2VDShuffle<0b00, 0b00001, "vtrn", "8">;
4279 def VTRNd16 : N2VDShuffle<0b01, 0b00001, "vtrn", "16">;
4280 def VTRNd32 : N2VDShuffle<0b10, 0b00001, "vtrn", "32">;
4282 def VTRNq8 : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn", "8">;
4283 def VTRNq16 : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn", "16">;
4284 def VTRNq32 : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn", "32">;
4286 // VUZP : Vector Unzip (Deinterleave)
4288 def VUZPd8 : N2VDShuffle<0b00, 0b00010, "vuzp", "8">;
4289 def VUZPd16 : N2VDShuffle<0b01, 0b00010, "vuzp", "16">;
4290 def VUZPd32 : N2VDShuffle<0b10, 0b00010, "vuzp", "32">;
4292 def VUZPq8 : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp", "8">;
4293 def VUZPq16 : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp", "16">;
4294 def VUZPq32 : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp", "32">;
4296 // VZIP : Vector Zip (Interleave)
4298 def VZIPd8 : N2VDShuffle<0b00, 0b00011, "vzip", "8">;
4299 def VZIPd16 : N2VDShuffle<0b01, 0b00011, "vzip", "16">;
4300 def VZIPd32 : N2VDShuffle<0b10, 0b00011, "vzip", "32">;
4302 def VZIPq8 : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip", "8">;
4303 def VZIPq16 : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip", "16">;
4304 def VZIPq32 : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip", "32">;
4306 // Vector Table Lookup and Table Extension.
4308 // VTBL : Vector Table Lookup
4310 : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$Vd),
4311 (ins DPR:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB1,
4312 "vtbl", "8", "$Vd, \\{$Vn\\}, $Vm", "",
4313 [(set DPR:$Vd, (v8i8 (int_arm_neon_vtbl1 DPR:$Vn, DPR:$Vm)))]>;
4314 let hasExtraSrcRegAllocReq = 1 in {
4316 : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$Vd),
4317 (ins DPR:$Vn, DPR:$tbl2, DPR:$Vm), NVTBLFrm, IIC_VTB2,
4318 "vtbl", "8", "$Vd, \\{$Vn, $tbl2\\}, $Vm", "", []>;
4320 : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$Vd),
4321 (ins DPR:$Vn, DPR:$tbl2, DPR:$tbl3, DPR:$Vm), NVTBLFrm, IIC_VTB3,
4322 "vtbl", "8", "$Vd, \\{$Vn, $tbl2, $tbl3\\}, $Vm", "", []>;
4324 : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$Vd),
4325 (ins DPR:$Vn, DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$Vm),
4327 "vtbl", "8", "$Vd, \\{$Vn, $tbl2, $tbl3, $tbl4\\}, $Vm", "", []>;
4328 } // hasExtraSrcRegAllocReq = 1
4331 : PseudoNeonI<(outs DPR:$dst), (ins QPR:$tbl, DPR:$src), IIC_VTB2, "", []>;
4333 : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB3, "", []>;
4335 : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB4, "", []>;
4337 // VTBX : Vector Table Extension
4339 : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$Vd),
4340 (ins DPR:$orig, DPR:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX1,
4341 "vtbx", "8", "$Vd, \\{$Vn\\}, $Vm", "$orig = $Vd",
4342 [(set DPR:$Vd, (v8i8 (int_arm_neon_vtbx1
4343 DPR:$orig, DPR:$Vn, DPR:$Vm)))]>;
4344 let hasExtraSrcRegAllocReq = 1 in {
4346 : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$Vd),
4347 (ins DPR:$orig, DPR:$Vn, DPR:$tbl2, DPR:$Vm), NVTBLFrm, IIC_VTBX2,
4348 "vtbx", "8", "$Vd, \\{$Vn, $tbl2\\}, $Vm", "$orig = $Vd", []>;
4350 : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$Vd),
4351 (ins DPR:$orig, DPR:$Vn, DPR:$tbl2, DPR:$tbl3, DPR:$Vm),
4352 NVTBLFrm, IIC_VTBX3,
4353 "vtbx", "8", "$Vd, \\{$Vn, $tbl2, $tbl3\\}, $Vm",
4356 : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$Vd), (ins DPR:$orig, DPR:$Vn,
4357 DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$Vm), NVTBLFrm, IIC_VTBX4,
4358 "vtbx", "8", "$Vd, \\{$Vn, $tbl2, $tbl3, $tbl4\\}, $Vm",
4360 } // hasExtraSrcRegAllocReq = 1
4363 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QPR:$tbl, DPR:$src),
4364 IIC_VTBX2, "$orig = $dst", []>;
4366 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
4367 IIC_VTBX3, "$orig = $dst", []>;
4369 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
4370 IIC_VTBX4, "$orig = $dst", []>;
4372 //===----------------------------------------------------------------------===//
4373 // NEON instructions for single-precision FP math
4374 //===----------------------------------------------------------------------===//
4376 class N2VSPat<SDNode OpNode, ValueType ResTy, ValueType OpTy, NeonI Inst>
4377 : NEONFPPat<(ResTy (OpNode SPR:$a)),
4378 (EXTRACT_SUBREG (OpTy (Inst (INSERT_SUBREG (OpTy (IMPLICIT_DEF)),
4382 class N3VSPat<SDNode OpNode, NeonI Inst>
4383 : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
4384 (EXTRACT_SUBREG (v2f32
4385 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
4387 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
4391 class N3VSMulOpPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
4392 : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
4393 (EXTRACT_SUBREG (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
4395 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
4397 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
4401 // These need separate instructions because they must use DPR_VFP2 register
4402 // class which have SPR sub-registers.
4404 // Vector Add Operations used for single-precision FP
4405 let neverHasSideEffects = 1 in
4406 def VADDfd_sfp : N3VS<0,0,0b00,0b1101,0, "vadd", "f32", v2f32, v2f32, fadd, 1>;
4407 def : N3VSPat<fadd, VADDfd_sfp>;
4409 // Vector Sub Operations used for single-precision FP
4410 let neverHasSideEffects = 1 in
4411 def VSUBfd_sfp : N3VS<0,0,0b10,0b1101,0, "vsub", "f32", v2f32, v2f32, fsub, 0>;
4412 def : N3VSPat<fsub, VSUBfd_sfp>;
4414 // Vector Multiply Operations used for single-precision FP
4415 let neverHasSideEffects = 1 in
4416 def VMULfd_sfp : N3VS<1,0,0b00,0b1101,1, "vmul", "f32", v2f32, v2f32, fmul, 1>;
4417 def : N3VSPat<fmul, VMULfd_sfp>;
4419 // Vector Multiply-Accumulate/Subtract used for single-precision FP
4420 // vml[as].f32 can cause 4-8 cycle stalls in following ASIMD instructions, so
4421 // we want to avoid them for now. e.g., alternating vmla/vadd instructions.
4423 //let neverHasSideEffects = 1 in
4424 //def VMLAfd_sfp : N3VSMulOp<0,0,0b00,0b1101,1, IIC_VMACD, "vmla", "f32",
4425 // v2f32, fmul, fadd>;
4426 //def : N3VSMulOpPat<fmul, fadd, VMLAfd_sfp>;
4428 //let neverHasSideEffects = 1 in
4429 //def VMLSfd_sfp : N3VSMulOp<0,0,0b10,0b1101,1, IIC_VMACD, "vmls", "f32",
4430 // v2f32, fmul, fsub>;
4431 //def : N3VSMulOpPat<fmul, fsub, VMLSfd_sfp>;
4433 // Vector Absolute used for single-precision FP
4434 let neverHasSideEffects = 1 in
4435 def VABSfd_sfp : N2V<0b11, 0b11, 0b10, 0b01, 0b01110, 0, 0,
4436 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), IIC_VUNAD,
4437 "vabs", "f32", "$dst, $src", "", []>;
4438 def : N2VSPat<fabs, f32, v2f32, VABSfd_sfp>;
4440 // Vector Negate used for single-precision FP
4441 let neverHasSideEffects = 1 in
4442 def VNEGfd_sfp : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
4443 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), IIC_VUNAD,
4444 "vneg", "f32", "$dst, $src", "", []>;
4445 def : N2VSPat<fneg, f32, v2f32, VNEGfd_sfp>;
4447 // Vector Maximum used for single-precision FP
4448 let neverHasSideEffects = 1 in
4449 def VMAXfd_sfp : N3V<0, 0, 0b00, 0b1111, 0, 0, (outs DPR_VFP2:$dst),
4450 (ins DPR_VFP2:$src1, DPR_VFP2:$src2), N3RegFrm, IIC_VBIND,
4451 "vmax", "f32", "$dst, $src1, $src2", "", []>;
4452 def : N3VSPat<NEONfmax, VMAXfd_sfp>;
4454 // Vector Minimum used for single-precision FP
4455 let neverHasSideEffects = 1 in
4456 def VMINfd_sfp : N3V<0, 0, 0b00, 0b1111, 0, 0, (outs DPR_VFP2:$dst),
4457 (ins DPR_VFP2:$src1, DPR_VFP2:$src2), N3RegFrm, IIC_VBIND,
4458 "vmin", "f32", "$dst, $src1, $src2", "", []>;
4459 def : N3VSPat<NEONfmin, VMINfd_sfp>;
4461 // Vector Convert between single-precision FP and integer
4462 let neverHasSideEffects = 1 in
4463 def VCVTf2sd_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
4464 v2i32, v2f32, fp_to_sint>;
4465 def : N2VSPat<arm_ftosi, f32, v2f32, VCVTf2sd_sfp>;
4467 let neverHasSideEffects = 1 in
4468 def VCVTf2ud_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
4469 v2i32, v2f32, fp_to_uint>;
4470 def : N2VSPat<arm_ftoui, f32, v2f32, VCVTf2ud_sfp>;
4472 let neverHasSideEffects = 1 in
4473 def VCVTs2fd_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
4474 v2f32, v2i32, sint_to_fp>;
4475 def : N2VSPat<arm_sitof, f32, v2i32, VCVTs2fd_sfp>;
4477 let neverHasSideEffects = 1 in
4478 def VCVTu2fd_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
4479 v2f32, v2i32, uint_to_fp>;
4480 def : N2VSPat<arm_uitof, f32, v2i32, VCVTu2fd_sfp>;
4482 //===----------------------------------------------------------------------===//
4483 // Non-Instruction Patterns
4484 //===----------------------------------------------------------------------===//
4487 def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
4488 def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
4489 def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (v1i64 DPR:$src)>;
4490 def : Pat<(v1i64 (bitconvert (f64 DPR:$src))), (v1i64 DPR:$src)>;
4491 def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
4492 def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
4493 def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
4494 def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (v2i32 DPR:$src)>;
4495 def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (v2i32 DPR:$src)>;
4496 def : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
4497 def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
4498 def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
4499 def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (v4i16 DPR:$src)>;
4500 def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (v4i16 DPR:$src)>;
4501 def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
4502 def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (v8i8 DPR:$src)>;
4503 def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (v8i8 DPR:$src)>;
4504 def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (v8i8 DPR:$src)>;
4505 def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (v8i8 DPR:$src)>;
4506 def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (v8i8 DPR:$src)>;
4507 def : Pat<(f64 (bitconvert (v1i64 DPR:$src))), (f64 DPR:$src)>;
4508 def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (f64 DPR:$src)>;
4509 def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (f64 DPR:$src)>;
4510 def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (f64 DPR:$src)>;
4511 def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (f64 DPR:$src)>;
4512 def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (v2f32 DPR:$src)>;
4513 def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
4514 def : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
4515 def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
4516 def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (v2f32 DPR:$src)>;
4518 def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
4519 def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
4520 def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
4521 def : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
4522 def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
4523 def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
4524 def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
4525 def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
4526 def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
4527 def : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
4528 def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
4529 def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
4530 def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
4531 def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
4532 def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
4533 def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
4534 def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
4535 def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
4536 def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
4537 def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
4538 def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
4539 def : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
4540 def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
4541 def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
4542 def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
4543 def : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
4544 def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
4545 def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
4546 def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
4547 def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;