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 NEONvduplaneq : SDNode<"ARMISD::VDUPLANEQ",
69 SDTypeProfile<1, 2, [SDTCisVT<2, i32>]>>;
71 def SDTARMVLD2 : SDTypeProfile<2, 1, [SDTCisSameAs<0, 1>, SDTCisPtrTy<2>]>;
72 def SDTARMVLD3 : SDTypeProfile<3, 1, [SDTCisSameAs<0, 1>,
73 SDTCisSameAs<0, 2>, SDTCisPtrTy<3>]>;
74 def SDTARMVLD4 : SDTypeProfile<4, 1, [SDTCisSameAs<0, 1>,
76 SDTCisSameAs<0, 3>, SDTCisPtrTy<4>]>;
77 def NEONvld2d : SDNode<"ARMISD::VLD2D", SDTARMVLD2,
78 [SDNPHasChain, SDNPMayLoad]>;
79 def NEONvld3d : SDNode<"ARMISD::VLD3D", SDTARMVLD3,
80 [SDNPHasChain, SDNPMayLoad]>;
81 def NEONvld4d : SDNode<"ARMISD::VLD4D", SDTARMVLD4,
82 [SDNPHasChain, SDNPMayLoad]>;
84 def SDTARMVST2 : SDTypeProfile<0, 3, [SDTCisPtrTy<0>, SDTCisSameAs<1, 2>]>;
85 def SDTARMVST3 : SDTypeProfile<0, 4, [SDTCisPtrTy<0>, SDTCisSameAs<1, 2>,
87 def SDTARMVST4 : SDTypeProfile<0, 5, [SDTCisPtrTy<0>, SDTCisSameAs<1, 2>,
91 def NEONvst2d : SDNode<"ARMISD::VST2D", SDTARMVST2,
92 [SDNPHasChain, SDNPMayStore]>;
93 def NEONvst3d : SDNode<"ARMISD::VST3D", SDTARMVST3,
94 [SDNPHasChain, SDNPMayStore]>;
95 def NEONvst4d : SDNode<"ARMISD::VST4D", SDTARMVST4,
96 [SDNPHasChain, SDNPMayStore]>;
98 //===----------------------------------------------------------------------===//
99 // NEON operand definitions
100 //===----------------------------------------------------------------------===//
102 // addrmode_neonldstm := reg
104 /* TODO: Take advantage of vldm.
105 def addrmode_neonldstm : Operand<i32>,
106 ComplexPattern<i32, 2, "SelectAddrModeNeonLdStM", []> {
107 let PrintMethod = "printAddrNeonLdStMOperand";
108 let MIOperandInfo = (ops GPR, i32imm);
112 //===----------------------------------------------------------------------===//
113 // NEON load / store instructions
114 //===----------------------------------------------------------------------===//
116 /* TODO: Take advantage of vldm.
118 def VLDMD : NI<(outs),
119 (ins addrmode_neonldstm:$addr, reglist:$dst1, variable_ops),
121 "vldm${addr:submode} ${addr:base}, $dst1",
123 let Inst{27-25} = 0b110;
125 let Inst{11-9} = 0b101;
128 def VLDMS : NI<(outs),
129 (ins addrmode_neonldstm:$addr, reglist:$dst1, variable_ops),
131 "vldm${addr:submode} ${addr:base}, $dst1",
133 let Inst{27-25} = 0b110;
135 let Inst{11-9} = 0b101;
140 // Use vldmia to load a Q register as a D register pair.
141 def VLDRQ : NI4<(outs QPR:$dst), (ins addrmode4:$addr),
143 "vldmia $addr, ${dst:dregpair}",
144 [(set QPR:$dst, (v2f64 (load addrmode4:$addr)))]> {
145 let Inst{27-25} = 0b110;
146 let Inst{24} = 0; // P bit
147 let Inst{23} = 1; // U bit
149 let Inst{11-9} = 0b101;
152 // Use vstmia to store a Q register as a D register pair.
153 def VSTRQ : NI4<(outs), (ins QPR:$src, addrmode4:$addr),
155 "vstmia $addr, ${src:dregpair}",
156 [(store (v2f64 QPR:$src), addrmode4:$addr)]> {
157 let Inst{27-25} = 0b110;
158 let Inst{24} = 0; // P bit
159 let Inst{23} = 1; // U bit
161 let Inst{11-9} = 0b101;
164 // VLD1 : Vector Load (multiple single elements)
165 class VLD1D<string OpcodeStr, ValueType Ty, Intrinsic IntOp>
166 : NLdSt<(outs DPR:$dst), (ins addrmode6:$addr),
168 !strconcat(OpcodeStr, "\t\\{$dst\\}, $addr"),
169 [(set DPR:$dst, (Ty (IntOp addrmode6:$addr)))]>;
170 class VLD1Q<string OpcodeStr, ValueType Ty, Intrinsic IntOp>
171 : NLdSt<(outs QPR:$dst), (ins addrmode6:$addr),
173 !strconcat(OpcodeStr, "\t${dst:dregpair}, $addr"),
174 [(set QPR:$dst, (Ty (IntOp addrmode6:$addr)))]>;
176 def VLD1d8 : VLD1D<"vld1.8", v8i8, int_arm_neon_vld1>;
177 def VLD1d16 : VLD1D<"vld1.16", v4i16, int_arm_neon_vld1>;
178 def VLD1d32 : VLD1D<"vld1.32", v2i32, int_arm_neon_vld1>;
179 def VLD1df : VLD1D<"vld1.32", v2f32, int_arm_neon_vld1>;
180 def VLD1d64 : VLD1D<"vld1.64", v1i64, int_arm_neon_vld1>;
182 def VLD1q8 : VLD1Q<"vld1.8", v16i8, int_arm_neon_vld1>;
183 def VLD1q16 : VLD1Q<"vld1.16", v8i16, int_arm_neon_vld1>;
184 def VLD1q32 : VLD1Q<"vld1.32", v4i32, int_arm_neon_vld1>;
185 def VLD1qf : VLD1Q<"vld1.32", v4f32, int_arm_neon_vld1>;
186 def VLD1q64 : VLD1Q<"vld1.64", v2i64, int_arm_neon_vld1>;
188 // VLD2 : Vector Load (multiple 2-element structures)
189 class VLD2D<string OpcodeStr>
190 : NLdSt<(outs DPR:$dst1, DPR:$dst2), (ins addrmode6:$addr),
192 !strconcat(OpcodeStr, "\t\\{$dst1,$dst2\\}, $addr"), []>;
194 def VLD2d8 : VLD2D<"vld2.8">;
195 def VLD2d16 : VLD2D<"vld2.16">;
196 def VLD2d32 : VLD2D<"vld2.32">;
198 // VLD3 : Vector Load (multiple 3-element structures)
199 class VLD3D<string OpcodeStr>
200 : NLdSt<(outs DPR:$dst1, DPR:$dst2, DPR:$dst3), (ins addrmode6:$addr),
202 !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3\\}, $addr"), []>;
204 def VLD3d8 : VLD3D<"vld3.8">;
205 def VLD3d16 : VLD3D<"vld3.16">;
206 def VLD3d32 : VLD3D<"vld3.32">;
208 // VLD4 : Vector Load (multiple 4-element structures)
209 class VLD4D<string OpcodeStr>
210 : NLdSt<(outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4),
211 (ins addrmode6:$addr),
213 !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3,$dst4\\}, $addr"), []>;
215 def VLD4d8 : VLD4D<"vld4.8">;
216 def VLD4d16 : VLD4D<"vld4.16">;
217 def VLD4d32 : VLD4D<"vld4.32">;
219 // VST1 : Vector Store (multiple single elements)
220 class VST1D<string OpcodeStr, ValueType Ty, Intrinsic IntOp>
221 : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src),
223 !strconcat(OpcodeStr, "\t\\{$src\\}, $addr"),
224 [(IntOp addrmode6:$addr, (Ty DPR:$src))]>;
225 class VST1Q<string OpcodeStr, ValueType Ty, Intrinsic IntOp>
226 : NLdSt<(outs), (ins addrmode6:$addr, QPR:$src),
228 !strconcat(OpcodeStr, "\t${src:dregpair}, $addr"),
229 [(IntOp addrmode6:$addr, (Ty QPR:$src))]>;
231 def VST1d8 : VST1D<"vst1.8", v8i8, int_arm_neon_vst1>;
232 def VST1d16 : VST1D<"vst1.16", v4i16, int_arm_neon_vst1>;
233 def VST1d32 : VST1D<"vst1.32", v2i32, int_arm_neon_vst1>;
234 def VST1df : VST1D<"vst1.32", v2f32, int_arm_neon_vst1>;
235 def VST1d64 : VST1D<"vst1.64", v1i64, int_arm_neon_vst1>;
237 def VST1q8 : VST1Q<"vst1.8", v16i8, int_arm_neon_vst1>;
238 def VST1q16 : VST1Q<"vst1.16", v8i16, int_arm_neon_vst1>;
239 def VST1q32 : VST1Q<"vst1.32", v4i32, int_arm_neon_vst1>;
240 def VST1qf : VST1Q<"vst1.32", v4f32, int_arm_neon_vst1>;
241 def VST1q64 : VST1Q<"vst1.64", v2i64, int_arm_neon_vst1>;
243 // VST2 : Vector Store (multiple 2-element structures)
244 class VST2D<string OpcodeStr>
245 : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2), NoItinerary,
246 !strconcat(OpcodeStr, "\t\\{$src1,$src2\\}, $addr"), []>;
248 def VST2d8 : VST2D<"vst2.8">;
249 def VST2d16 : VST2D<"vst2.16">;
250 def VST2d32 : VST2D<"vst2.32">;
252 // VST3 : Vector Store (multiple 3-element structures)
253 class VST3D<string OpcodeStr>
254 : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3),
256 !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3\\}, $addr"), []>;
258 def VST3d8 : VST3D<"vst3.8">;
259 def VST3d16 : VST3D<"vst3.16">;
260 def VST3d32 : VST3D<"vst3.32">;
262 // VST4 : Vector Store (multiple 4-element structures)
263 class VST4D<string OpcodeStr>
264 : NLdSt<(outs), (ins addrmode6:$addr,
265 DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4), NoItinerary,
266 !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3,$src4\\}, $addr"), []>;
268 def VST4d8 : VST4D<"vst4.8">;
269 def VST4d16 : VST4D<"vst4.16">;
270 def VST4d32 : VST4D<"vst4.32">;
273 //===----------------------------------------------------------------------===//
274 // NEON pattern fragments
275 //===----------------------------------------------------------------------===//
277 // Extract D sub-registers of Q registers.
278 // (arm_dsubreg_0 is 5; arm_dsubreg_1 is 6)
279 def DSubReg_i8_reg : SDNodeXForm<imm, [{
280 return CurDAG->getTargetConstant(5 + N->getZExtValue() / 8, EVT::i32);
282 def DSubReg_i16_reg : SDNodeXForm<imm, [{
283 return CurDAG->getTargetConstant(5 + N->getZExtValue() / 4, EVT::i32);
285 def DSubReg_i32_reg : SDNodeXForm<imm, [{
286 return CurDAG->getTargetConstant(5 + N->getZExtValue() / 2, EVT::i32);
288 def DSubReg_f64_reg : SDNodeXForm<imm, [{
289 return CurDAG->getTargetConstant(5 + N->getZExtValue(), EVT::i32);
292 // Extract S sub-registers of Q registers.
293 // (arm_ssubreg_0 is 1; arm_ssubreg_1 is 2; etc.)
294 def SSubReg_f32_reg : SDNodeXForm<imm, [{
295 return CurDAG->getTargetConstant(1 + N->getZExtValue(), EVT::i32);
298 // Translate lane numbers from Q registers to D subregs.
299 def SubReg_i8_lane : SDNodeXForm<imm, [{
300 return CurDAG->getTargetConstant(N->getZExtValue() & 7, EVT::i32);
302 def SubReg_i16_lane : SDNodeXForm<imm, [{
303 return CurDAG->getTargetConstant(N->getZExtValue() & 3, EVT::i32);
305 def SubReg_i32_lane : SDNodeXForm<imm, [{
306 return CurDAG->getTargetConstant(N->getZExtValue() & 1, EVT::i32);
309 //===----------------------------------------------------------------------===//
310 // Instruction Classes
311 //===----------------------------------------------------------------------===//
313 // Basic 2-register operations, both double- and quad-register.
314 class N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
315 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
316 ValueType ResTy, ValueType OpTy, SDNode OpNode>
317 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
318 (ins DPR:$src), NoItinerary, !strconcat(OpcodeStr, "\t$dst, $src"), "",
319 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src))))]>;
320 class N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
321 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
322 ValueType ResTy, ValueType OpTy, SDNode OpNode>
323 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
324 (ins QPR:$src), NoItinerary, !strconcat(OpcodeStr, "\t$dst, $src"), "",
325 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src))))]>;
327 // Basic 2-register operations, scalar single-precision.
328 class N2VDs<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
329 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
330 ValueType ResTy, ValueType OpTy, SDNode OpNode>
331 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
332 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src),
333 NoItinerary, !strconcat(OpcodeStr, "\t$dst, $src"), "", []>;
335 class N2VDsPat<SDNode OpNode, ValueType ResTy, ValueType OpTy, NeonI Inst>
336 : NEONFPPat<(ResTy (OpNode SPR:$a)),
338 (Inst (INSERT_SUBREG (OpTy (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0)),
341 // Basic 2-register intrinsics, both double- and quad-register.
342 class N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
343 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
344 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
345 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
346 (ins DPR:$src), NoItinerary, !strconcat(OpcodeStr, "\t$dst, $src"), "",
347 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
348 class N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
349 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
350 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
351 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
352 (ins QPR:$src), NoItinerary, !strconcat(OpcodeStr, "\t$dst, $src"), "",
353 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
355 // Basic 2-register intrinsics, scalar single-precision
356 class N2VDInts<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
357 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
358 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
359 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
360 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), NoItinerary,
361 !strconcat(OpcodeStr, "\t$dst, $src"), "", []>;
363 class N2VDIntsPat<SDNode OpNode, NeonI Inst>
364 : NEONFPPat<(f32 (OpNode SPR:$a)),
366 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0)),
369 // Narrow 2-register intrinsics.
370 class N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
371 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
372 string OpcodeStr, ValueType TyD, ValueType TyQ, Intrinsic IntOp>
373 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$dst),
374 (ins QPR:$src), NoItinerary, !strconcat(OpcodeStr, "\t$dst, $src"), "",
375 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src))))]>;
377 // Long 2-register intrinsics. (This is currently only used for VMOVL and is
378 // derived from N2VImm instead of N2V because of the way the size is encoded.)
379 class N2VLInt<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
380 bit op6, bit op4, string OpcodeStr, ValueType TyQ, ValueType TyD,
382 : N2VImm<op24, op23, op21_16, op11_8, op7, op6, op4, (outs QPR:$dst),
383 (ins DPR:$src), NoItinerary, !strconcat(OpcodeStr, "\t$dst, $src"), "",
384 [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src))))]>;
386 // 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
387 class N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr>
388 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$dst1, DPR:$dst2),
389 (ins DPR:$src1, DPR:$src2), NoItinerary,
390 !strconcat(OpcodeStr, "\t$dst1, $dst2"),
391 "$src1 = $dst1, $src2 = $dst2", []>;
392 class N2VQShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr>
393 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$dst1, QPR:$dst2),
394 (ins QPR:$src1, QPR:$src2), NoItinerary,
395 !strconcat(OpcodeStr, "\t$dst1, $dst2"),
396 "$src1 = $dst1, $src2 = $dst2", []>;
398 // Basic 3-register operations, both double- and quad-register.
399 class N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
400 string OpcodeStr, ValueType ResTy, ValueType OpTy,
401 SDNode OpNode, bit Commutable>
402 : N3V<op24, op23, op21_20, op11_8, 0, op4,
403 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), NoItinerary,
404 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
405 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src1), (OpTy DPR:$src2))))]> {
406 let isCommutable = Commutable;
408 class N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
409 string OpcodeStr, ValueType ResTy, ValueType OpTy,
410 SDNode OpNode, bit Commutable>
411 : N3V<op24, op23, op21_20, op11_8, 1, op4,
412 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), NoItinerary,
413 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
414 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src1), (OpTy QPR:$src2))))]> {
415 let isCommutable = Commutable;
418 // Basic 3-register operations, scalar single-precision
419 class N3VDs<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
420 string OpcodeStr, ValueType ResTy, ValueType OpTy,
421 SDNode OpNode, bit Commutable>
422 : N3V<op24, op23, op21_20, op11_8, 0, op4,
423 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src1, DPR_VFP2:$src2), NoItinerary,
424 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "", []> {
425 let isCommutable = Commutable;
427 class N3VDsPat<SDNode OpNode, NeonI Inst>
428 : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
430 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0),
431 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$b, arm_ssubreg_0)),
434 // Basic 3-register intrinsics, both double- and quad-register.
435 class N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
436 string OpcodeStr, ValueType ResTy, ValueType OpTy,
437 Intrinsic IntOp, bit Commutable>
438 : N3V<op24, op23, op21_20, op11_8, 0, op4,
439 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), NoItinerary,
440 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
441 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1), (OpTy DPR:$src2))))]> {
442 let isCommutable = Commutable;
444 class N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
445 string OpcodeStr, ValueType ResTy, ValueType OpTy,
446 Intrinsic IntOp, bit Commutable>
447 : N3V<op24, op23, op21_20, op11_8, 1, op4,
448 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), NoItinerary,
449 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
450 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1), (OpTy QPR:$src2))))]> {
451 let isCommutable = Commutable;
454 // Multiply-Add/Sub operations, both double- and quad-register.
455 class N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
456 string OpcodeStr, ValueType Ty, SDNode MulOp, SDNode OpNode>
457 : N3V<op24, op23, op21_20, op11_8, 0, op4,
458 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), NoItinerary,
459 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
460 [(set DPR:$dst, (Ty (OpNode DPR:$src1,
461 (Ty (MulOp DPR:$src2, DPR:$src3)))))]>;
462 class N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
463 string OpcodeStr, ValueType Ty, SDNode MulOp, SDNode OpNode>
464 : N3V<op24, op23, op21_20, op11_8, 1, op4,
465 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), NoItinerary,
466 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
467 [(set QPR:$dst, (Ty (OpNode QPR:$src1,
468 (Ty (MulOp QPR:$src2, QPR:$src3)))))]>;
470 // Multiply-Add/Sub operations, scalar single-precision
471 class N3VDMulOps<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
472 string OpcodeStr, ValueType Ty, SDNode MulOp, SDNode OpNode>
473 : N3V<op24, op23, op21_20, op11_8, 0, op4,
474 (outs DPR_VFP2:$dst),
475 (ins DPR_VFP2:$src1, DPR_VFP2:$src2, DPR_VFP2:$src3), NoItinerary,
476 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst", []>;
478 class N3VDMulOpsPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
479 : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
481 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$acc, arm_ssubreg_0),
482 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0),
483 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$b, arm_ssubreg_0)),
486 // Neon 3-argument intrinsics, both double- and quad-register.
487 // The destination register is also used as the first source operand register.
488 class N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
489 string OpcodeStr, ValueType ResTy, ValueType OpTy,
491 : N3V<op24, op23, op21_20, op11_8, 0, op4,
492 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), NoItinerary,
493 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
494 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1),
495 (OpTy DPR:$src2), (OpTy DPR:$src3))))]>;
496 class N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
497 string OpcodeStr, ValueType ResTy, ValueType OpTy,
499 : N3V<op24, op23, op21_20, op11_8, 1, op4,
500 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), NoItinerary,
501 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
502 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1),
503 (OpTy QPR:$src2), (OpTy QPR:$src3))))]>;
505 // Neon Long 3-argument intrinsic. The destination register is
506 // a quad-register and is also used as the first source operand register.
507 class N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
508 string OpcodeStr, ValueType TyQ, ValueType TyD, Intrinsic IntOp>
509 : N3V<op24, op23, op21_20, op11_8, 0, op4,
510 (outs QPR:$dst), (ins QPR:$src1, DPR:$src2, DPR:$src3), NoItinerary,
511 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
513 (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$src2), (TyD DPR:$src3))))]>;
515 // Narrowing 3-register intrinsics.
516 class N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
517 string OpcodeStr, ValueType TyD, ValueType TyQ,
518 Intrinsic IntOp, bit Commutable>
519 : N3V<op24, op23, op21_20, op11_8, 0, op4,
520 (outs DPR:$dst), (ins QPR:$src1, QPR:$src2), NoItinerary,
521 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
522 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src1), (TyQ QPR:$src2))))]> {
523 let isCommutable = Commutable;
526 // Long 3-register intrinsics.
527 class N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
528 string OpcodeStr, ValueType TyQ, ValueType TyD,
529 Intrinsic IntOp, bit Commutable>
530 : N3V<op24, op23, op21_20, op11_8, 0, op4,
531 (outs QPR:$dst), (ins DPR:$src1, DPR:$src2), NoItinerary,
532 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
533 [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src1), (TyD DPR:$src2))))]> {
534 let isCommutable = Commutable;
537 // Wide 3-register intrinsics.
538 class N3VWInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
539 string OpcodeStr, ValueType TyQ, ValueType TyD,
540 Intrinsic IntOp, bit Commutable>
541 : N3V<op24, op23, op21_20, op11_8, 0, op4,
542 (outs QPR:$dst), (ins QPR:$src1, DPR:$src2), NoItinerary,
543 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
544 [(set QPR:$dst, (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$src2))))]> {
545 let isCommutable = Commutable;
548 // Pairwise long 2-register intrinsics, both double- and quad-register.
549 class N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
550 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
551 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
552 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
553 (ins DPR:$src), NoItinerary, !strconcat(OpcodeStr, "\t$dst, $src"), "",
554 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
555 class N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
556 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
557 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
558 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
559 (ins QPR:$src), NoItinerary, !strconcat(OpcodeStr, "\t$dst, $src"), "",
560 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
562 // Pairwise long 2-register accumulate intrinsics,
563 // both double- and quad-register.
564 // The destination register is also used as the first source operand register.
565 class N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
566 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
567 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
568 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
569 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), NoItinerary,
570 !strconcat(OpcodeStr, "\t$dst, $src2"), "$src1 = $dst",
571 [(set DPR:$dst, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$src2))))]>;
572 class N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
573 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
574 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
575 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
576 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), NoItinerary,
577 !strconcat(OpcodeStr, "\t$dst, $src2"), "$src1 = $dst",
578 [(set QPR:$dst, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$src2))))]>;
580 // Shift by immediate,
581 // both double- and quad-register.
582 class N2VDSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
583 bit op4, string OpcodeStr, ValueType Ty, SDNode OpNode>
584 : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4,
585 (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), NoItinerary,
586 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
587 [(set DPR:$dst, (Ty (OpNode (Ty DPR:$src), (i32 imm:$SIMM))))]>;
588 class N2VQSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
589 bit op4, string OpcodeStr, ValueType Ty, SDNode OpNode>
590 : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4,
591 (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), NoItinerary,
592 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
593 [(set QPR:$dst, (Ty (OpNode (Ty QPR:$src), (i32 imm:$SIMM))))]>;
595 // Long shift by immediate.
596 class N2VLSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
597 bit op6, bit op4, string OpcodeStr, ValueType ResTy,
598 ValueType OpTy, SDNode OpNode>
599 : N2VImm<op24, op23, op21_16, op11_8, op7, op6, op4,
600 (outs QPR:$dst), (ins DPR:$src, i32imm:$SIMM), NoItinerary,
601 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
602 [(set QPR:$dst, (ResTy (OpNode (OpTy DPR:$src),
603 (i32 imm:$SIMM))))]>;
605 // Narrow shift by immediate.
606 class N2VNSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
607 bit op6, bit op4, string OpcodeStr, ValueType ResTy,
608 ValueType OpTy, SDNode OpNode>
609 : N2VImm<op24, op23, op21_16, op11_8, op7, op6, op4,
610 (outs DPR:$dst), (ins QPR:$src, i32imm:$SIMM), NoItinerary,
611 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
612 [(set DPR:$dst, (ResTy (OpNode (OpTy QPR:$src),
613 (i32 imm:$SIMM))))]>;
615 // Shift right by immediate and accumulate,
616 // both double- and quad-register.
617 class N2VDShAdd<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
618 bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp>
619 : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4,
620 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, i32imm:$SIMM),
622 !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst",
623 [(set DPR:$dst, (Ty (add DPR:$src1,
624 (Ty (ShOp DPR:$src2, (i32 imm:$SIMM))))))]>;
625 class N2VQShAdd<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
626 bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp>
627 : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4,
628 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, i32imm:$SIMM),
630 !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst",
631 [(set QPR:$dst, (Ty (add QPR:$src1,
632 (Ty (ShOp QPR:$src2, (i32 imm:$SIMM))))))]>;
634 // Shift by immediate and insert,
635 // both double- and quad-register.
636 class N2VDShIns<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
637 bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp>
638 : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4,
639 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, i32imm:$SIMM),
641 !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst",
642 [(set DPR:$dst, (Ty (ShOp DPR:$src1, DPR:$src2, (i32 imm:$SIMM))))]>;
643 class N2VQShIns<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
644 bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp>
645 : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4,
646 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, i32imm:$SIMM),
648 !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst",
649 [(set QPR:$dst, (Ty (ShOp QPR:$src1, QPR:$src2, (i32 imm:$SIMM))))]>;
651 // Convert, with fractional bits immediate,
652 // both double- and quad-register.
653 class N2VCvtD<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
654 bit op4, string OpcodeStr, ValueType ResTy, ValueType OpTy,
656 : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4,
657 (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), NoItinerary,
658 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
659 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src), (i32 imm:$SIMM))))]>;
660 class N2VCvtQ<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
661 bit op4, string OpcodeStr, ValueType ResTy, ValueType OpTy,
663 : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4,
664 (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), NoItinerary,
665 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
666 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src), (i32 imm:$SIMM))))]>;
668 //===----------------------------------------------------------------------===//
670 //===----------------------------------------------------------------------===//
672 // Neon 3-register vector operations.
674 // First with only element sizes of 8, 16 and 32 bits:
675 multiclass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
676 string OpcodeStr, SDNode OpNode, bit Commutable = 0> {
677 // 64-bit vector types.
678 def v8i8 : N3VD<op24, op23, 0b00, op11_8, op4, !strconcat(OpcodeStr, "8"),
679 v8i8, v8i8, OpNode, Commutable>;
680 def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, !strconcat(OpcodeStr, "16"),
681 v4i16, v4i16, OpNode, Commutable>;
682 def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, !strconcat(OpcodeStr, "32"),
683 v2i32, v2i32, OpNode, Commutable>;
685 // 128-bit vector types.
686 def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, !strconcat(OpcodeStr, "8"),
687 v16i8, v16i8, OpNode, Commutable>;
688 def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, !strconcat(OpcodeStr, "16"),
689 v8i16, v8i16, OpNode, Commutable>;
690 def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, !strconcat(OpcodeStr, "32"),
691 v4i32, v4i32, OpNode, Commutable>;
694 // ....then also with element size 64 bits:
695 multiclass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
696 string OpcodeStr, SDNode OpNode, bit Commutable = 0>
697 : N3V_QHS<op24, op23, op11_8, op4, OpcodeStr, OpNode, Commutable> {
698 def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, !strconcat(OpcodeStr, "64"),
699 v1i64, v1i64, OpNode, Commutable>;
700 def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, !strconcat(OpcodeStr, "64"),
701 v2i64, v2i64, OpNode, Commutable>;
705 // Neon Narrowing 2-register vector intrinsics,
706 // source operand element sizes of 16, 32 and 64 bits:
707 multiclass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
708 bits<5> op11_7, bit op6, bit op4, string OpcodeStr,
710 def v8i8 : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
711 !strconcat(OpcodeStr, "16"), v8i8, v8i16, IntOp>;
712 def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
713 !strconcat(OpcodeStr, "32"), v4i16, v4i32, IntOp>;
714 def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
715 !strconcat(OpcodeStr, "64"), v2i32, v2i64, IntOp>;
719 // Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
720 // source operand element sizes of 16, 32 and 64 bits:
721 multiclass N2VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
722 bit op4, string OpcodeStr, Intrinsic IntOp> {
723 def v8i16 : N2VLInt<op24, op23, 0b001000, op11_8, op7, op6, op4,
724 !strconcat(OpcodeStr, "8"), v8i16, v8i8, IntOp>;
725 def v4i32 : N2VLInt<op24, op23, 0b010000, op11_8, op7, op6, op4,
726 !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>;
727 def v2i64 : N2VLInt<op24, op23, 0b100000, op11_8, op7, op6, op4,
728 !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>;
732 // Neon 3-register vector intrinsics.
734 // First with only element sizes of 16 and 32 bits:
735 multiclass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
736 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> {
737 // 64-bit vector types.
738 def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, !strconcat(OpcodeStr,"16"),
739 v4i16, v4i16, IntOp, Commutable>;
740 def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, !strconcat(OpcodeStr,"32"),
741 v2i32, v2i32, IntOp, Commutable>;
743 // 128-bit vector types.
744 def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, !strconcat(OpcodeStr,"16"),
745 v8i16, v8i16, IntOp, Commutable>;
746 def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, !strconcat(OpcodeStr,"32"),
747 v4i32, v4i32, IntOp, Commutable>;
750 // ....then also with element size of 8 bits:
751 multiclass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
752 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0>
753 : N3VInt_HS<op24, op23, op11_8, op4, OpcodeStr, IntOp, Commutable> {
754 def v8i8 : N3VDInt<op24, op23, 0b00, op11_8, op4, !strconcat(OpcodeStr, "8"),
755 v8i8, v8i8, IntOp, Commutable>;
756 def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, !strconcat(OpcodeStr, "8"),
757 v16i8, v16i8, IntOp, Commutable>;
760 // ....then also with element size of 64 bits:
761 multiclass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
762 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0>
763 : N3VInt_QHS<op24, op23, op11_8, op4, OpcodeStr, IntOp, Commutable> {
764 def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, !strconcat(OpcodeStr,"64"),
765 v1i64, v1i64, IntOp, Commutable>;
766 def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, !strconcat(OpcodeStr,"64"),
767 v2i64, v2i64, IntOp, Commutable>;
771 // Neon Narrowing 3-register vector intrinsics,
772 // source operand element sizes of 16, 32 and 64 bits:
773 multiclass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
774 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> {
775 def v8i8 : N3VNInt<op24, op23, 0b00, op11_8, op4, !strconcat(OpcodeStr,"16"),
776 v8i8, v8i16, IntOp, Commutable>;
777 def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4, !strconcat(OpcodeStr,"32"),
778 v4i16, v4i32, IntOp, Commutable>;
779 def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4, !strconcat(OpcodeStr,"64"),
780 v2i32, v2i64, IntOp, Commutable>;
784 // Neon Long 3-register vector intrinsics.
786 // First with only element sizes of 16 and 32 bits:
787 multiclass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
788 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> {
789 def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, !strconcat(OpcodeStr,"16"),
790 v4i32, v4i16, IntOp, Commutable>;
791 def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, !strconcat(OpcodeStr,"32"),
792 v2i64, v2i32, IntOp, Commutable>;
795 // ....then also with element size of 8 bits:
796 multiclass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
797 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0>
798 : N3VLInt_HS<op24, op23, op11_8, op4, OpcodeStr, IntOp, Commutable> {
799 def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, !strconcat(OpcodeStr, "8"),
800 v8i16, v8i8, IntOp, Commutable>;
804 // Neon Wide 3-register vector intrinsics,
805 // source operand element sizes of 8, 16 and 32 bits:
806 multiclass N3VWInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
807 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> {
808 def v8i16 : N3VWInt<op24, op23, 0b00, op11_8, op4, !strconcat(OpcodeStr, "8"),
809 v8i16, v8i8, IntOp, Commutable>;
810 def v4i32 : N3VWInt<op24, op23, 0b01, op11_8, op4, !strconcat(OpcodeStr,"16"),
811 v4i32, v4i16, IntOp, Commutable>;
812 def v2i64 : N3VWInt<op24, op23, 0b10, op11_8, op4, !strconcat(OpcodeStr,"32"),
813 v2i64, v2i32, IntOp, Commutable>;
817 // Neon Multiply-Op vector operations,
818 // element sizes of 8, 16 and 32 bits:
819 multiclass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
820 string OpcodeStr, SDNode OpNode> {
821 // 64-bit vector types.
822 def v8i8 : N3VDMulOp<op24, op23, 0b00, op11_8, op4,
823 !strconcat(OpcodeStr, "8"), v8i8, mul, OpNode>;
824 def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4,
825 !strconcat(OpcodeStr, "16"), v4i16, mul, OpNode>;
826 def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4,
827 !strconcat(OpcodeStr, "32"), v2i32, mul, OpNode>;
829 // 128-bit vector types.
830 def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4,
831 !strconcat(OpcodeStr, "8"), v16i8, mul, OpNode>;
832 def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4,
833 !strconcat(OpcodeStr, "16"), v8i16, mul, OpNode>;
834 def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4,
835 !strconcat(OpcodeStr, "32"), v4i32, mul, OpNode>;
839 // Neon 3-argument intrinsics,
840 // element sizes of 8, 16 and 32 bits:
841 multiclass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
842 string OpcodeStr, Intrinsic IntOp> {
843 // 64-bit vector types.
844 def v8i8 : N3VDInt3<op24, op23, 0b00, op11_8, op4,
845 !strconcat(OpcodeStr, "8"), v8i8, v8i8, IntOp>;
846 def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4,
847 !strconcat(OpcodeStr, "16"), v4i16, v4i16, IntOp>;
848 def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4,
849 !strconcat(OpcodeStr, "32"), v2i32, v2i32, IntOp>;
851 // 128-bit vector types.
852 def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4,
853 !strconcat(OpcodeStr, "8"), v16i8, v16i8, IntOp>;
854 def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4,
855 !strconcat(OpcodeStr, "16"), v8i16, v8i16, IntOp>;
856 def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4,
857 !strconcat(OpcodeStr, "32"), v4i32, v4i32, IntOp>;
861 // Neon Long 3-argument intrinsics.
863 // First with only element sizes of 16 and 32 bits:
864 multiclass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
865 string OpcodeStr, Intrinsic IntOp> {
866 def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4,
867 !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>;
868 def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4,
869 !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>;
872 // ....then also with element size of 8 bits:
873 multiclass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
874 string OpcodeStr, Intrinsic IntOp>
875 : N3VLInt3_HS<op24, op23, op11_8, op4, OpcodeStr, IntOp> {
876 def v8i16 : N3VLInt3<op24, op23, 0b01, op11_8, op4,
877 !strconcat(OpcodeStr, "8"), v8i16, v8i8, IntOp>;
881 // Neon 2-register vector intrinsics,
882 // element sizes of 8, 16 and 32 bits:
883 multiclass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
884 bits<5> op11_7, bit op4, string OpcodeStr,
886 // 64-bit vector types.
887 def v8i8 : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
888 !strconcat(OpcodeStr, "8"), v8i8, v8i8, IntOp>;
889 def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
890 !strconcat(OpcodeStr, "16"), v4i16, v4i16, IntOp>;
891 def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
892 !strconcat(OpcodeStr, "32"), v2i32, v2i32, IntOp>;
894 // 128-bit vector types.
895 def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
896 !strconcat(OpcodeStr, "8"), v16i8, v16i8, IntOp>;
897 def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
898 !strconcat(OpcodeStr, "16"), v8i16, v8i16, IntOp>;
899 def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
900 !strconcat(OpcodeStr, "32"), v4i32, v4i32, IntOp>;
904 // Neon Pairwise long 2-register intrinsics,
905 // element sizes of 8, 16 and 32 bits:
906 multiclass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
907 bits<5> op11_7, bit op4,
908 string OpcodeStr, Intrinsic IntOp> {
909 // 64-bit vector types.
910 def v8i8 : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
911 !strconcat(OpcodeStr, "8"), v4i16, v8i8, IntOp>;
912 def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
913 !strconcat(OpcodeStr, "16"), v2i32, v4i16, IntOp>;
914 def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
915 !strconcat(OpcodeStr, "32"), v1i64, v2i32, IntOp>;
917 // 128-bit vector types.
918 def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
919 !strconcat(OpcodeStr, "8"), v8i16, v16i8, IntOp>;
920 def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
921 !strconcat(OpcodeStr, "16"), v4i32, v8i16, IntOp>;
922 def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
923 !strconcat(OpcodeStr, "32"), v2i64, v4i32, IntOp>;
927 // Neon Pairwise long 2-register accumulate intrinsics,
928 // element sizes of 8, 16 and 32 bits:
929 multiclass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
930 bits<5> op11_7, bit op4,
931 string OpcodeStr, Intrinsic IntOp> {
932 // 64-bit vector types.
933 def v8i8 : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
934 !strconcat(OpcodeStr, "8"), v4i16, v8i8, IntOp>;
935 def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
936 !strconcat(OpcodeStr, "16"), v2i32, v4i16, IntOp>;
937 def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
938 !strconcat(OpcodeStr, "32"), v1i64, v2i32, IntOp>;
940 // 128-bit vector types.
941 def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
942 !strconcat(OpcodeStr, "8"), v8i16, v16i8, IntOp>;
943 def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
944 !strconcat(OpcodeStr, "16"), v4i32, v8i16, IntOp>;
945 def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
946 !strconcat(OpcodeStr, "32"), v2i64, v4i32, IntOp>;
950 // Neon 2-register vector shift by immediate,
951 // element sizes of 8, 16, 32 and 64 bits:
952 multiclass N2VSh_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
953 string OpcodeStr, SDNode OpNode> {
954 // 64-bit vector types.
955 def v8i8 : N2VDSh<op24, op23, 0b001000, op11_8, 0, op4,
956 !strconcat(OpcodeStr, "8"), v8i8, OpNode>;
957 def v4i16 : N2VDSh<op24, op23, 0b010000, op11_8, 0, op4,
958 !strconcat(OpcodeStr, "16"), v4i16, OpNode>;
959 def v2i32 : N2VDSh<op24, op23, 0b100000, op11_8, 0, op4,
960 !strconcat(OpcodeStr, "32"), v2i32, OpNode>;
961 def v1i64 : N2VDSh<op24, op23, 0b000000, op11_8, 1, op4,
962 !strconcat(OpcodeStr, "64"), v1i64, OpNode>;
964 // 128-bit vector types.
965 def v16i8 : N2VQSh<op24, op23, 0b001000, op11_8, 0, op4,
966 !strconcat(OpcodeStr, "8"), v16i8, OpNode>;
967 def v8i16 : N2VQSh<op24, op23, 0b010000, op11_8, 0, op4,
968 !strconcat(OpcodeStr, "16"), v8i16, OpNode>;
969 def v4i32 : N2VQSh<op24, op23, 0b100000, op11_8, 0, op4,
970 !strconcat(OpcodeStr, "32"), v4i32, OpNode>;
971 def v2i64 : N2VQSh<op24, op23, 0b000000, op11_8, 1, op4,
972 !strconcat(OpcodeStr, "64"), v2i64, OpNode>;
976 // Neon Shift-Accumulate vector operations,
977 // element sizes of 8, 16, 32 and 64 bits:
978 multiclass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
979 string OpcodeStr, SDNode ShOp> {
980 // 64-bit vector types.
981 def v8i8 : N2VDShAdd<op24, op23, 0b001000, op11_8, 0, op4,
982 !strconcat(OpcodeStr, "8"), v8i8, ShOp>;
983 def v4i16 : N2VDShAdd<op24, op23, 0b010000, op11_8, 0, op4,
984 !strconcat(OpcodeStr, "16"), v4i16, ShOp>;
985 def v2i32 : N2VDShAdd<op24, op23, 0b100000, op11_8, 0, op4,
986 !strconcat(OpcodeStr, "32"), v2i32, ShOp>;
987 def v1i64 : N2VDShAdd<op24, op23, 0b000000, op11_8, 1, op4,
988 !strconcat(OpcodeStr, "64"), v1i64, ShOp>;
990 // 128-bit vector types.
991 def v16i8 : N2VQShAdd<op24, op23, 0b001000, op11_8, 0, op4,
992 !strconcat(OpcodeStr, "8"), v16i8, ShOp>;
993 def v8i16 : N2VQShAdd<op24, op23, 0b010000, op11_8, 0, op4,
994 !strconcat(OpcodeStr, "16"), v8i16, ShOp>;
995 def v4i32 : N2VQShAdd<op24, op23, 0b100000, op11_8, 0, op4,
996 !strconcat(OpcodeStr, "32"), v4i32, ShOp>;
997 def v2i64 : N2VQShAdd<op24, op23, 0b000000, op11_8, 1, op4,
998 !strconcat(OpcodeStr, "64"), v2i64, ShOp>;
1002 // Neon Shift-Insert vector operations,
1003 // element sizes of 8, 16, 32 and 64 bits:
1004 multiclass N2VShIns_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
1005 string OpcodeStr, SDNode ShOp> {
1006 // 64-bit vector types.
1007 def v8i8 : N2VDShIns<op24, op23, 0b001000, op11_8, 0, op4,
1008 !strconcat(OpcodeStr, "8"), v8i8, ShOp>;
1009 def v4i16 : N2VDShIns<op24, op23, 0b010000, op11_8, 0, op4,
1010 !strconcat(OpcodeStr, "16"), v4i16, ShOp>;
1011 def v2i32 : N2VDShIns<op24, op23, 0b100000, op11_8, 0, op4,
1012 !strconcat(OpcodeStr, "32"), v2i32, ShOp>;
1013 def v1i64 : N2VDShIns<op24, op23, 0b000000, op11_8, 1, op4,
1014 !strconcat(OpcodeStr, "64"), v1i64, ShOp>;
1016 // 128-bit vector types.
1017 def v16i8 : N2VQShIns<op24, op23, 0b001000, op11_8, 0, op4,
1018 !strconcat(OpcodeStr, "8"), v16i8, ShOp>;
1019 def v8i16 : N2VQShIns<op24, op23, 0b010000, op11_8, 0, op4,
1020 !strconcat(OpcodeStr, "16"), v8i16, ShOp>;
1021 def v4i32 : N2VQShIns<op24, op23, 0b100000, op11_8, 0, op4,
1022 !strconcat(OpcodeStr, "32"), v4i32, ShOp>;
1023 def v2i64 : N2VQShIns<op24, op23, 0b000000, op11_8, 1, op4,
1024 !strconcat(OpcodeStr, "64"), v2i64, ShOp>;
1027 //===----------------------------------------------------------------------===//
1028 // Instruction Definitions.
1029 //===----------------------------------------------------------------------===//
1031 // Vector Add Operations.
1033 // VADD : Vector Add (integer and floating-point)
1034 defm VADD : N3V_QHSD<0, 0, 0b1000, 0, "vadd.i", add, 1>;
1035 def VADDfd : N3VD<0, 0, 0b00, 0b1101, 0, "vadd.f32", v2f32, v2f32, fadd, 1>;
1036 def VADDfq : N3VQ<0, 0, 0b00, 0b1101, 0, "vadd.f32", v4f32, v4f32, fadd, 1>;
1037 // VADDL : Vector Add Long (Q = D + D)
1038 defm VADDLs : N3VLInt_QHS<0,1,0b0000,0, "vaddl.s", int_arm_neon_vaddls, 1>;
1039 defm VADDLu : N3VLInt_QHS<1,1,0b0000,0, "vaddl.u", int_arm_neon_vaddlu, 1>;
1040 // VADDW : Vector Add Wide (Q = Q + D)
1041 defm VADDWs : N3VWInt_QHS<0,1,0b0001,0, "vaddw.s", int_arm_neon_vaddws, 0>;
1042 defm VADDWu : N3VWInt_QHS<1,1,0b0001,0, "vaddw.u", int_arm_neon_vaddwu, 0>;
1043 // VHADD : Vector Halving Add
1044 defm VHADDs : N3VInt_QHS<0,0,0b0000,0, "vhadd.s", int_arm_neon_vhadds, 1>;
1045 defm VHADDu : N3VInt_QHS<1,0,0b0000,0, "vhadd.u", int_arm_neon_vhaddu, 1>;
1046 // VRHADD : Vector Rounding Halving Add
1047 defm VRHADDs : N3VInt_QHS<0,0,0b0001,0, "vrhadd.s", int_arm_neon_vrhadds, 1>;
1048 defm VRHADDu : N3VInt_QHS<1,0,0b0001,0, "vrhadd.u", int_arm_neon_vrhaddu, 1>;
1049 // VQADD : Vector Saturating Add
1050 defm VQADDs : N3VInt_QHSD<0,0,0b0000,1, "vqadd.s", int_arm_neon_vqadds, 1>;
1051 defm VQADDu : N3VInt_QHSD<1,0,0b0000,1, "vqadd.u", int_arm_neon_vqaddu, 1>;
1052 // VADDHN : Vector Add and Narrow Returning High Half (D = Q + Q)
1053 defm VADDHN : N3VNInt_HSD<0,1,0b0100,0, "vaddhn.i", int_arm_neon_vaddhn, 1>;
1054 // VRADDHN : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
1055 defm VRADDHN : N3VNInt_HSD<1,1,0b0100,0, "vraddhn.i", int_arm_neon_vraddhn, 1>;
1057 // Vector Multiply Operations.
1059 // VMUL : Vector Multiply (integer, polynomial and floating-point)
1060 defm VMUL : N3V_QHS<0, 0, 0b1001, 1, "vmul.i", mul, 1>;
1061 def VMULpd : N3VDInt<1, 0, 0b00, 0b1001, 1, "vmul.p8", v8i8, v8i8,
1062 int_arm_neon_vmulp, 1>;
1063 def VMULpq : N3VQInt<1, 0, 0b00, 0b1001, 1, "vmul.p8", v16i8, v16i8,
1064 int_arm_neon_vmulp, 1>;
1065 def VMULfd : N3VD<1, 0, 0b00, 0b1101, 1, "vmul.f32", v2f32, v2f32, fmul, 1>;
1066 def VMULfq : N3VQ<1, 0, 0b00, 0b1101, 1, "vmul.f32", v4f32, v4f32, fmul, 1>;
1067 // VQDMULH : Vector Saturating Doubling Multiply Returning High Half
1068 defm VQDMULH : N3VInt_HS<0,0,0b1011,0, "vqdmulh.s", int_arm_neon_vqdmulh, 1>;
1069 // VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
1070 defm VQRDMULH : N3VInt_HS<1,0,0b1011,0, "vqrdmulh.s", int_arm_neon_vqrdmulh, 1>;
1071 // VMULL : Vector Multiply Long (integer and polynomial) (Q = D * D)
1072 defm VMULLs : N3VLInt_QHS<0,1,0b1100,0, "vmull.s", int_arm_neon_vmulls, 1>;
1073 defm VMULLu : N3VLInt_QHS<1,1,0b1100,0, "vmull.u", int_arm_neon_vmullu, 1>;
1074 def VMULLp : N3VLInt<0, 1, 0b00, 0b1110, 0, "vmull.p8", v8i16, v8i8,
1075 int_arm_neon_vmullp, 1>;
1076 // VQDMULL : Vector Saturating Doubling Multiply Long (Q = D * D)
1077 defm VQDMULL : N3VLInt_HS<0,1,0b1101,0, "vqdmull.s", int_arm_neon_vqdmull, 1>;
1079 // Vector Multiply-Accumulate and Multiply-Subtract Operations.
1081 // VMLA : Vector Multiply Accumulate (integer and floating-point)
1082 defm VMLA : N3VMulOp_QHS<0, 0, 0b1001, 0, "vmla.i", add>;
1083 def VMLAfd : N3VDMulOp<0, 0, 0b00, 0b1101, 1, "vmla.f32", v2f32, fmul, fadd>;
1084 def VMLAfq : N3VQMulOp<0, 0, 0b00, 0b1101, 1, "vmla.f32", v4f32, fmul, fadd>;
1085 // VMLAL : Vector Multiply Accumulate Long (Q += D * D)
1086 defm VMLALs : N3VLInt3_QHS<0,1,0b1000,0, "vmlal.s", int_arm_neon_vmlals>;
1087 defm VMLALu : N3VLInt3_QHS<1,1,0b1000,0, "vmlal.u", int_arm_neon_vmlalu>;
1088 // VQDMLAL : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
1089 defm VQDMLAL : N3VLInt3_HS<0, 1, 0b1001, 0, "vqdmlal.s", int_arm_neon_vqdmlal>;
1090 // VMLS : Vector Multiply Subtract (integer and floating-point)
1091 defm VMLS : N3VMulOp_QHS<0, 0, 0b1001, 0, "vmls.i", sub>;
1092 def VMLSfd : N3VDMulOp<0, 0, 0b10, 0b1101, 1, "vmls.f32", v2f32, fmul, fsub>;
1093 def VMLSfq : N3VQMulOp<0, 0, 0b10, 0b1101, 1, "vmls.f32", v4f32, fmul, fsub>;
1094 // VMLSL : Vector Multiply Subtract Long (Q -= D * D)
1095 defm VMLSLs : N3VLInt3_QHS<0,1,0b1010,0, "vmlsl.s", int_arm_neon_vmlsls>;
1096 defm VMLSLu : N3VLInt3_QHS<1,1,0b1010,0, "vmlsl.u", int_arm_neon_vmlslu>;
1097 // VQDMLSL : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
1098 defm VQDMLSL : N3VLInt3_HS<0, 1, 0b1011, 0, "vqdmlsl.s", int_arm_neon_vqdmlsl>;
1100 // Vector Subtract Operations.
1102 // VSUB : Vector Subtract (integer and floating-point)
1103 defm VSUB : N3V_QHSD<1, 0, 0b1000, 0, "vsub.i", sub, 0>;
1104 def VSUBfd : N3VD<0, 0, 0b10, 0b1101, 0, "vsub.f32", v2f32, v2f32, fsub, 0>;
1105 def VSUBfq : N3VQ<0, 0, 0b10, 0b1101, 0, "vsub.f32", v4f32, v4f32, fsub, 0>;
1106 // VSUBL : Vector Subtract Long (Q = D - D)
1107 defm VSUBLs : N3VLInt_QHS<0,1,0b0010,0, "vsubl.s", int_arm_neon_vsubls, 1>;
1108 defm VSUBLu : N3VLInt_QHS<1,1,0b0010,0, "vsubl.u", int_arm_neon_vsublu, 1>;
1109 // VSUBW : Vector Subtract Wide (Q = Q - D)
1110 defm VSUBWs : N3VWInt_QHS<0,1,0b0011,0, "vsubw.s", int_arm_neon_vsubws, 0>;
1111 defm VSUBWu : N3VWInt_QHS<1,1,0b0011,0, "vsubw.u", int_arm_neon_vsubwu, 0>;
1112 // VHSUB : Vector Halving Subtract
1113 defm VHSUBs : N3VInt_QHS<0, 0, 0b0010, 0, "vhsub.s", int_arm_neon_vhsubs, 0>;
1114 defm VHSUBu : N3VInt_QHS<1, 0, 0b0010, 0, "vhsub.u", int_arm_neon_vhsubu, 0>;
1115 // VQSUB : Vector Saturing Subtract
1116 defm VQSUBs : N3VInt_QHSD<0, 0, 0b0010, 1, "vqsub.s", int_arm_neon_vqsubs, 0>;
1117 defm VQSUBu : N3VInt_QHSD<1, 0, 0b0010, 1, "vqsub.u", int_arm_neon_vqsubu, 0>;
1118 // VSUBHN : Vector Subtract and Narrow Returning High Half (D = Q - Q)
1119 defm VSUBHN : N3VNInt_HSD<0,1,0b0110,0, "vsubhn.i", int_arm_neon_vsubhn, 0>;
1120 // VRSUBHN : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
1121 defm VRSUBHN : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn.i", int_arm_neon_vrsubhn, 0>;
1123 // Vector Comparisons.
1125 // VCEQ : Vector Compare Equal
1126 defm VCEQ : N3V_QHS<1, 0, 0b1000, 1, "vceq.i", NEONvceq, 1>;
1127 def VCEQfd : N3VD<0,0,0b00,0b1110,0, "vceq.f32", v2i32, v2f32, NEONvceq, 1>;
1128 def VCEQfq : N3VQ<0,0,0b00,0b1110,0, "vceq.f32", v4i32, v4f32, NEONvceq, 1>;
1129 // VCGE : Vector Compare Greater Than or Equal
1130 defm VCGEs : N3V_QHS<0, 0, 0b0011, 1, "vcge.s", NEONvcge, 0>;
1131 defm VCGEu : N3V_QHS<1, 0, 0b0011, 1, "vcge.u", NEONvcgeu, 0>;
1132 def VCGEfd : N3VD<1,0,0b00,0b1110,0, "vcge.f32", v2i32, v2f32, NEONvcge, 0>;
1133 def VCGEfq : N3VQ<1,0,0b00,0b1110,0, "vcge.f32", v4i32, v4f32, NEONvcge, 0>;
1134 // VCGT : Vector Compare Greater Than
1135 defm VCGTs : N3V_QHS<0, 0, 0b0011, 0, "vcgt.s", NEONvcgt, 0>;
1136 defm VCGTu : N3V_QHS<1, 0, 0b0011, 0, "vcgt.u", NEONvcgtu, 0>;
1137 def VCGTfd : N3VD<1,0,0b10,0b1110,0, "vcgt.f32", v2i32, v2f32, NEONvcgt, 0>;
1138 def VCGTfq : N3VQ<1,0,0b10,0b1110,0, "vcgt.f32", v4i32, v4f32, NEONvcgt, 0>;
1139 // VACGE : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
1140 def VACGEd : N3VDInt<1, 0, 0b00, 0b1110, 1, "vacge.f32", v2i32, v2f32,
1141 int_arm_neon_vacged, 0>;
1142 def VACGEq : N3VQInt<1, 0, 0b00, 0b1110, 1, "vacge.f32", v4i32, v4f32,
1143 int_arm_neon_vacgeq, 0>;
1144 // VACGT : Vector Absolute Compare Greater Than (aka VCAGT)
1145 def VACGTd : N3VDInt<1, 0, 0b10, 0b1110, 1, "vacgt.f32", v2i32, v2f32,
1146 int_arm_neon_vacgtd, 0>;
1147 def VACGTq : N3VQInt<1, 0, 0b10, 0b1110, 1, "vacgt.f32", v4i32, v4f32,
1148 int_arm_neon_vacgtq, 0>;
1149 // VTST : Vector Test Bits
1150 defm VTST : N3V_QHS<0, 0, 0b1000, 1, "vtst.i", NEONvtst, 1>;
1152 // Vector Bitwise Operations.
1154 // VAND : Vector Bitwise AND
1155 def VANDd : N3VD<0, 0, 0b00, 0b0001, 1, "vand", v2i32, v2i32, and, 1>;
1156 def VANDq : N3VQ<0, 0, 0b00, 0b0001, 1, "vand", v4i32, v4i32, and, 1>;
1158 // VEOR : Vector Bitwise Exclusive OR
1159 def VEORd : N3VD<1, 0, 0b00, 0b0001, 1, "veor", v2i32, v2i32, xor, 1>;
1160 def VEORq : N3VQ<1, 0, 0b00, 0b0001, 1, "veor", v4i32, v4i32, xor, 1>;
1162 // VORR : Vector Bitwise OR
1163 def VORRd : N3VD<0, 0, 0b10, 0b0001, 1, "vorr", v2i32, v2i32, or, 1>;
1164 def VORRq : N3VQ<0, 0, 0b10, 0b0001, 1, "vorr", v4i32, v4i32, or, 1>;
1166 // VBIC : Vector Bitwise Bit Clear (AND NOT)
1167 def VBICd : N3V<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst),
1168 (ins DPR:$src1, DPR:$src2), NoItinerary,
1169 "vbic\t$dst, $src1, $src2", "",
1170 [(set DPR:$dst, (v2i32 (and DPR:$src1,(vnot DPR:$src2))))]>;
1171 def VBICq : N3V<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst),
1172 (ins QPR:$src1, QPR:$src2), NoItinerary,
1173 "vbic\t$dst, $src1, $src2", "",
1174 [(set QPR:$dst, (v4i32 (and QPR:$src1,(vnot QPR:$src2))))]>;
1176 // VORN : Vector Bitwise OR NOT
1177 def VORNd : N3V<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$dst),
1178 (ins DPR:$src1, DPR:$src2), NoItinerary,
1179 "vorn\t$dst, $src1, $src2", "",
1180 [(set DPR:$dst, (v2i32 (or DPR:$src1, (vnot DPR:$src2))))]>;
1181 def VORNq : N3V<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$dst),
1182 (ins QPR:$src1, QPR:$src2), NoItinerary,
1183 "vorn\t$dst, $src1, $src2", "",
1184 [(set QPR:$dst, (v4i32 (or QPR:$src1, (vnot QPR:$src2))))]>;
1186 // VMVN : Vector Bitwise NOT
1187 def VMVNd : N2V<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
1188 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
1189 "vmvn\t$dst, $src", "",
1190 [(set DPR:$dst, (v2i32 (vnot DPR:$src)))]>;
1191 def VMVNq : N2V<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
1192 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
1193 "vmvn\t$dst, $src", "",
1194 [(set QPR:$dst, (v4i32 (vnot QPR:$src)))]>;
1195 def : Pat<(v2i32 (vnot_conv DPR:$src)), (VMVNd DPR:$src)>;
1196 def : Pat<(v4i32 (vnot_conv QPR:$src)), (VMVNq QPR:$src)>;
1198 // VBSL : Vector Bitwise Select
1199 def VBSLd : N3V<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst),
1200 (ins DPR:$src1, DPR:$src2, DPR:$src3), NoItinerary,
1201 "vbsl\t$dst, $src2, $src3", "$src1 = $dst",
1203 (v2i32 (or (and DPR:$src2, DPR:$src1),
1204 (and DPR:$src3, (vnot DPR:$src1)))))]>;
1205 def VBSLq : N3V<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst),
1206 (ins QPR:$src1, QPR:$src2, QPR:$src3), NoItinerary,
1207 "vbsl\t$dst, $src2, $src3", "$src1 = $dst",
1209 (v4i32 (or (and QPR:$src2, QPR:$src1),
1210 (and QPR:$src3, (vnot QPR:$src1)))))]>;
1212 // VBIF : Vector Bitwise Insert if False
1213 // like VBSL but with: "vbif\t$dst, $src3, $src1", "$src2 = $dst",
1214 // VBIT : Vector Bitwise Insert if True
1215 // like VBSL but with: "vbit\t$dst, $src2, $src1", "$src3 = $dst",
1216 // These are not yet implemented. The TwoAddress pass will not go looking
1217 // for equivalent operations with different register constraints; it just
1220 // Vector Absolute Differences.
1222 // VABD : Vector Absolute Difference
1223 defm VABDs : N3VInt_QHS<0, 0, 0b0111, 0, "vabd.s", int_arm_neon_vabds, 0>;
1224 defm VABDu : N3VInt_QHS<1, 0, 0b0111, 0, "vabd.u", int_arm_neon_vabdu, 0>;
1225 def VABDfd : N3VDInt<1, 0, 0b10, 0b1101, 0, "vabd.f32", v2f32, v2f32,
1226 int_arm_neon_vabds, 0>;
1227 def VABDfq : N3VQInt<1, 0, 0b10, 0b1101, 0, "vabd.f32", v4f32, v4f32,
1228 int_arm_neon_vabds, 0>;
1230 // VABDL : Vector Absolute Difference Long (Q = | D - D |)
1231 defm VABDLs : N3VLInt_QHS<0,1,0b0111,0, "vabdl.s", int_arm_neon_vabdls, 0>;
1232 defm VABDLu : N3VLInt_QHS<1,1,0b0111,0, "vabdl.u", int_arm_neon_vabdlu, 0>;
1234 // VABA : Vector Absolute Difference and Accumulate
1235 defm VABAs : N3VInt3_QHS<0,1,0b0101,0, "vaba.s", int_arm_neon_vabas>;
1236 defm VABAu : N3VInt3_QHS<1,1,0b0101,0, "vaba.u", int_arm_neon_vabau>;
1238 // VABAL : Vector Absolute Difference and Accumulate Long (Q += | D - D |)
1239 defm VABALs : N3VLInt3_QHS<0,1,0b0101,0, "vabal.s", int_arm_neon_vabals>;
1240 defm VABALu : N3VLInt3_QHS<1,1,0b0101,0, "vabal.u", int_arm_neon_vabalu>;
1242 // Vector Maximum and Minimum.
1244 // VMAX : Vector Maximum
1245 defm VMAXs : N3VInt_QHS<0, 0, 0b0110, 0, "vmax.s", int_arm_neon_vmaxs, 1>;
1246 defm VMAXu : N3VInt_QHS<1, 0, 0b0110, 0, "vmax.u", int_arm_neon_vmaxu, 1>;
1247 def VMAXfd : N3VDInt<0, 0, 0b00, 0b1111, 0, "vmax.f32", v2f32, v2f32,
1248 int_arm_neon_vmaxs, 1>;
1249 def VMAXfq : N3VQInt<0, 0, 0b00, 0b1111, 0, "vmax.f32", v4f32, v4f32,
1250 int_arm_neon_vmaxs, 1>;
1252 // VMIN : Vector Minimum
1253 defm VMINs : N3VInt_QHS<0, 0, 0b0110, 1, "vmin.s", int_arm_neon_vmins, 1>;
1254 defm VMINu : N3VInt_QHS<1, 0, 0b0110, 1, "vmin.u", int_arm_neon_vminu, 1>;
1255 def VMINfd : N3VDInt<0, 0, 0b10, 0b1111, 0, "vmin.f32", v2f32, v2f32,
1256 int_arm_neon_vmins, 1>;
1257 def VMINfq : N3VQInt<0, 0, 0b10, 0b1111, 0, "vmin.f32", v4f32, v4f32,
1258 int_arm_neon_vmins, 1>;
1260 // Vector Pairwise Operations.
1262 // VPADD : Vector Pairwise Add
1263 def VPADDi8 : N3VDInt<0, 0, 0b00, 0b1011, 1, "vpadd.i8", v8i8, v8i8,
1264 int_arm_neon_vpadd, 0>;
1265 def VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, "vpadd.i16", v4i16, v4i16,
1266 int_arm_neon_vpadd, 0>;
1267 def VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, "vpadd.i32", v2i32, v2i32,
1268 int_arm_neon_vpadd, 0>;
1269 def VPADDf : N3VDInt<1, 0, 0b00, 0b1101, 0, "vpadd.f32", v2f32, v2f32,
1270 int_arm_neon_vpadd, 0>;
1272 // VPADDL : Vector Pairwise Add Long
1273 defm VPADDLs : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl.s",
1274 int_arm_neon_vpaddls>;
1275 defm VPADDLu : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl.u",
1276 int_arm_neon_vpaddlu>;
1278 // VPADAL : Vector Pairwise Add and Accumulate Long
1279 defm VPADALs : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpadal.s",
1280 int_arm_neon_vpadals>;
1281 defm VPADALu : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpadal.u",
1282 int_arm_neon_vpadalu>;
1284 // VPMAX : Vector Pairwise Maximum
1285 def VPMAXs8 : N3VDInt<0, 0, 0b00, 0b1010, 0, "vpmax.s8", v8i8, v8i8,
1286 int_arm_neon_vpmaxs, 0>;
1287 def VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, "vpmax.s16", v4i16, v4i16,
1288 int_arm_neon_vpmaxs, 0>;
1289 def VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, "vpmax.s32", v2i32, v2i32,
1290 int_arm_neon_vpmaxs, 0>;
1291 def VPMAXu8 : N3VDInt<1, 0, 0b00, 0b1010, 0, "vpmax.u8", v8i8, v8i8,
1292 int_arm_neon_vpmaxu, 0>;
1293 def VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, "vpmax.u16", v4i16, v4i16,
1294 int_arm_neon_vpmaxu, 0>;
1295 def VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, "vpmax.u32", v2i32, v2i32,
1296 int_arm_neon_vpmaxu, 0>;
1297 def VPMAXf : N3VDInt<1, 0, 0b00, 0b1111, 0, "vpmax.f32", v2f32, v2f32,
1298 int_arm_neon_vpmaxs, 0>;
1300 // VPMIN : Vector Pairwise Minimum
1301 def VPMINs8 : N3VDInt<0, 0, 0b00, 0b1010, 1, "vpmin.s8", v8i8, v8i8,
1302 int_arm_neon_vpmins, 0>;
1303 def VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, "vpmin.s16", v4i16, v4i16,
1304 int_arm_neon_vpmins, 0>;
1305 def VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, "vpmin.s32", v2i32, v2i32,
1306 int_arm_neon_vpmins, 0>;
1307 def VPMINu8 : N3VDInt<1, 0, 0b00, 0b1010, 1, "vpmin.u8", v8i8, v8i8,
1308 int_arm_neon_vpminu, 0>;
1309 def VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, "vpmin.u16", v4i16, v4i16,
1310 int_arm_neon_vpminu, 0>;
1311 def VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, "vpmin.u32", v2i32, v2i32,
1312 int_arm_neon_vpminu, 0>;
1313 def VPMINf : N3VDInt<1, 0, 0b10, 0b1111, 0, "vpmin.f32", v2f32, v2f32,
1314 int_arm_neon_vpmins, 0>;
1316 // Vector Reciprocal and Reciprocal Square Root Estimate and Step.
1318 // VRECPE : Vector Reciprocal Estimate
1319 def VRECPEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0, "vrecpe.u32",
1320 v2i32, v2i32, int_arm_neon_vrecpe>;
1321 def VRECPEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0, "vrecpe.u32",
1322 v4i32, v4i32, int_arm_neon_vrecpe>;
1323 def VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0, "vrecpe.f32",
1324 v2f32, v2f32, int_arm_neon_vrecpe>;
1325 def VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0, "vrecpe.f32",
1326 v4f32, v4f32, int_arm_neon_vrecpe>;
1328 // VRECPS : Vector Reciprocal Step
1329 def VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1, "vrecps.f32", v2f32, v2f32,
1330 int_arm_neon_vrecps, 1>;
1331 def VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1, "vrecps.f32", v4f32, v4f32,
1332 int_arm_neon_vrecps, 1>;
1334 // VRSQRTE : Vector Reciprocal Square Root Estimate
1335 def VRSQRTEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0, "vrsqrte.u32",
1336 v2i32, v2i32, int_arm_neon_vrsqrte>;
1337 def VRSQRTEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0, "vrsqrte.u32",
1338 v4i32, v4i32, int_arm_neon_vrsqrte>;
1339 def VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0, "vrsqrte.f32",
1340 v2f32, v2f32, int_arm_neon_vrsqrte>;
1341 def VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0, "vrsqrte.f32",
1342 v4f32, v4f32, int_arm_neon_vrsqrte>;
1344 // VRSQRTS : Vector Reciprocal Square Root Step
1345 def VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1, "vrsqrts.f32", v2f32, v2f32,
1346 int_arm_neon_vrsqrts, 1>;
1347 def VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1, "vrsqrts.f32", v4f32, v4f32,
1348 int_arm_neon_vrsqrts, 1>;
1352 // VSHL : Vector Shift
1353 defm VSHLs : N3VInt_QHSD<0, 0, 0b0100, 0, "vshl.s", int_arm_neon_vshifts, 0>;
1354 defm VSHLu : N3VInt_QHSD<1, 0, 0b0100, 0, "vshl.u", int_arm_neon_vshiftu, 0>;
1355 // VSHL : Vector Shift Left (Immediate)
1356 defm VSHLi : N2VSh_QHSD<0, 1, 0b0111, 1, "vshl.i", NEONvshl>;
1357 // VSHR : Vector Shift Right (Immediate)
1358 defm VSHRs : N2VSh_QHSD<0, 1, 0b0000, 1, "vshr.s", NEONvshrs>;
1359 defm VSHRu : N2VSh_QHSD<1, 1, 0b0000, 1, "vshr.u", NEONvshru>;
1361 // VSHLL : Vector Shift Left Long
1362 def VSHLLs8 : N2VLSh<0, 1, 0b001000, 0b1010, 0, 0, 1, "vshll.s8",
1363 v8i16, v8i8, NEONvshlls>;
1364 def VSHLLs16 : N2VLSh<0, 1, 0b010000, 0b1010, 0, 0, 1, "vshll.s16",
1365 v4i32, v4i16, NEONvshlls>;
1366 def VSHLLs32 : N2VLSh<0, 1, 0b100000, 0b1010, 0, 0, 1, "vshll.s32",
1367 v2i64, v2i32, NEONvshlls>;
1368 def VSHLLu8 : N2VLSh<1, 1, 0b001000, 0b1010, 0, 0, 1, "vshll.u8",
1369 v8i16, v8i8, NEONvshllu>;
1370 def VSHLLu16 : N2VLSh<1, 1, 0b010000, 0b1010, 0, 0, 1, "vshll.u16",
1371 v4i32, v4i16, NEONvshllu>;
1372 def VSHLLu32 : N2VLSh<1, 1, 0b100000, 0b1010, 0, 0, 1, "vshll.u32",
1373 v2i64, v2i32, NEONvshllu>;
1375 // VSHLL : Vector Shift Left Long (with maximum shift count)
1376 def VSHLLi8 : N2VLSh<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll.i8",
1377 v8i16, v8i8, NEONvshlli>;
1378 def VSHLLi16 : N2VLSh<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll.i16",
1379 v4i32, v4i16, NEONvshlli>;
1380 def VSHLLi32 : N2VLSh<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll.i32",
1381 v2i64, v2i32, NEONvshlli>;
1383 // VSHRN : Vector Shift Right and Narrow
1384 def VSHRN16 : N2VNSh<0, 1, 0b001000, 0b1000, 0, 0, 1, "vshrn.i16",
1385 v8i8, v8i16, NEONvshrn>;
1386 def VSHRN32 : N2VNSh<0, 1, 0b010000, 0b1000, 0, 0, 1, "vshrn.i32",
1387 v4i16, v4i32, NEONvshrn>;
1388 def VSHRN64 : N2VNSh<0, 1, 0b100000, 0b1000, 0, 0, 1, "vshrn.i64",
1389 v2i32, v2i64, NEONvshrn>;
1391 // VRSHL : Vector Rounding Shift
1392 defm VRSHLs : N3VInt_QHSD<0,0,0b0101,0, "vrshl.s", int_arm_neon_vrshifts, 0>;
1393 defm VRSHLu : N3VInt_QHSD<1,0,0b0101,0, "vrshl.u", int_arm_neon_vrshiftu, 0>;
1394 // VRSHR : Vector Rounding Shift Right
1395 defm VRSHRs : N2VSh_QHSD<0, 1, 0b0010, 1, "vrshr.s", NEONvrshrs>;
1396 defm VRSHRu : N2VSh_QHSD<1, 1, 0b0010, 1, "vrshr.u", NEONvrshru>;
1398 // VRSHRN : Vector Rounding Shift Right and Narrow
1399 def VRSHRN16 : N2VNSh<0, 1, 0b001000, 0b1000, 0, 1, 1, "vrshrn.i16",
1400 v8i8, v8i16, NEONvrshrn>;
1401 def VRSHRN32 : N2VNSh<0, 1, 0b010000, 0b1000, 0, 1, 1, "vrshrn.i32",
1402 v4i16, v4i32, NEONvrshrn>;
1403 def VRSHRN64 : N2VNSh<0, 1, 0b100000, 0b1000, 0, 1, 1, "vrshrn.i64",
1404 v2i32, v2i64, NEONvrshrn>;
1406 // VQSHL : Vector Saturating Shift
1407 defm VQSHLs : N3VInt_QHSD<0,0,0b0100,1, "vqshl.s", int_arm_neon_vqshifts, 0>;
1408 defm VQSHLu : N3VInt_QHSD<1,0,0b0100,1, "vqshl.u", int_arm_neon_vqshiftu, 0>;
1409 // VQSHL : Vector Saturating Shift Left (Immediate)
1410 defm VQSHLsi : N2VSh_QHSD<0, 1, 0b0111, 1, "vqshl.s", NEONvqshls>;
1411 defm VQSHLui : N2VSh_QHSD<1, 1, 0b0111, 1, "vqshl.u", NEONvqshlu>;
1412 // VQSHLU : Vector Saturating Shift Left (Immediate, Unsigned)
1413 defm VQSHLsu : N2VSh_QHSD<1, 1, 0b0110, 1, "vqshlu.s", NEONvqshlsu>;
1415 // VQSHRN : Vector Saturating Shift Right and Narrow
1416 def VQSHRNs16 : N2VNSh<0, 1, 0b001000, 0b1001, 0, 0, 1, "vqshrn.s16",
1417 v8i8, v8i16, NEONvqshrns>;
1418 def VQSHRNs32 : N2VNSh<0, 1, 0b010000, 0b1001, 0, 0, 1, "vqshrn.s32",
1419 v4i16, v4i32, NEONvqshrns>;
1420 def VQSHRNs64 : N2VNSh<0, 1, 0b100000, 0b1001, 0, 0, 1, "vqshrn.s64",
1421 v2i32, v2i64, NEONvqshrns>;
1422 def VQSHRNu16 : N2VNSh<1, 1, 0b001000, 0b1001, 0, 0, 1, "vqshrn.u16",
1423 v8i8, v8i16, NEONvqshrnu>;
1424 def VQSHRNu32 : N2VNSh<1, 1, 0b010000, 0b1001, 0, 0, 1, "vqshrn.u32",
1425 v4i16, v4i32, NEONvqshrnu>;
1426 def VQSHRNu64 : N2VNSh<1, 1, 0b100000, 0b1001, 0, 0, 1, "vqshrn.u64",
1427 v2i32, v2i64, NEONvqshrnu>;
1429 // VQSHRUN : Vector Saturating Shift Right and Narrow (Unsigned)
1430 def VQSHRUN16 : N2VNSh<1, 1, 0b001000, 0b1000, 0, 0, 1, "vqshrun.s16",
1431 v8i8, v8i16, NEONvqshrnsu>;
1432 def VQSHRUN32 : N2VNSh<1, 1, 0b010000, 0b1000, 0, 0, 1, "vqshrun.s32",
1433 v4i16, v4i32, NEONvqshrnsu>;
1434 def VQSHRUN64 : N2VNSh<1, 1, 0b100000, 0b1000, 0, 0, 1, "vqshrun.s64",
1435 v2i32, v2i64, NEONvqshrnsu>;
1437 // VQRSHL : Vector Saturating Rounding Shift
1438 defm VQRSHLs : N3VInt_QHSD<0, 0, 0b0101, 1, "vqrshl.s",
1439 int_arm_neon_vqrshifts, 0>;
1440 defm VQRSHLu : N3VInt_QHSD<1, 0, 0b0101, 1, "vqrshl.u",
1441 int_arm_neon_vqrshiftu, 0>;
1443 // VQRSHRN : Vector Saturating Rounding Shift Right and Narrow
1444 def VQRSHRNs16: N2VNSh<0, 1, 0b001000, 0b1001, 0, 1, 1, "vqrshrn.s16",
1445 v8i8, v8i16, NEONvqrshrns>;
1446 def VQRSHRNs32: N2VNSh<0, 1, 0b010000, 0b1001, 0, 1, 1, "vqrshrn.s32",
1447 v4i16, v4i32, NEONvqrshrns>;
1448 def VQRSHRNs64: N2VNSh<0, 1, 0b100000, 0b1001, 0, 1, 1, "vqrshrn.s64",
1449 v2i32, v2i64, NEONvqrshrns>;
1450 def VQRSHRNu16: N2VNSh<1, 1, 0b001000, 0b1001, 0, 1, 1, "vqrshrn.u16",
1451 v8i8, v8i16, NEONvqrshrnu>;
1452 def VQRSHRNu32: N2VNSh<1, 1, 0b010000, 0b1001, 0, 1, 1, "vqrshrn.u32",
1453 v4i16, v4i32, NEONvqrshrnu>;
1454 def VQRSHRNu64: N2VNSh<1, 1, 0b100000, 0b1001, 0, 1, 1, "vqrshrn.u64",
1455 v2i32, v2i64, NEONvqrshrnu>;
1457 // VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned)
1458 def VQRSHRUN16: N2VNSh<1, 1, 0b001000, 0b1000, 0, 1, 1, "vqrshrun.s16",
1459 v8i8, v8i16, NEONvqrshrnsu>;
1460 def VQRSHRUN32: N2VNSh<1, 1, 0b010000, 0b1000, 0, 1, 1, "vqrshrun.s32",
1461 v4i16, v4i32, NEONvqrshrnsu>;
1462 def VQRSHRUN64: N2VNSh<1, 1, 0b100000, 0b1000, 0, 1, 1, "vqrshrun.s64",
1463 v2i32, v2i64, NEONvqrshrnsu>;
1465 // VSRA : Vector Shift Right and Accumulate
1466 defm VSRAs : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra.s", NEONvshrs>;
1467 defm VSRAu : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra.u", NEONvshru>;
1468 // VRSRA : Vector Rounding Shift Right and Accumulate
1469 defm VRSRAs : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra.s", NEONvrshrs>;
1470 defm VRSRAu : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra.u", NEONvrshru>;
1472 // VSLI : Vector Shift Left and Insert
1473 defm VSLI : N2VShIns_QHSD<1, 1, 0b0101, 1, "vsli.", NEONvsli>;
1474 // VSRI : Vector Shift Right and Insert
1475 defm VSRI : N2VShIns_QHSD<1, 1, 0b0100, 1, "vsri.", NEONvsri>;
1477 // Vector Absolute and Saturating Absolute.
1479 // VABS : Vector Absolute Value
1480 defm VABS : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0, "vabs.s",
1482 def VABSfd : N2VDInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0, "vabs.f32",
1483 v2f32, v2f32, int_arm_neon_vabs>;
1484 def VABSfq : N2VQInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0, "vabs.f32",
1485 v4f32, v4f32, int_arm_neon_vabs>;
1487 // VQABS : Vector Saturating Absolute Value
1488 defm VQABS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0, "vqabs.s",
1489 int_arm_neon_vqabs>;
1493 def vneg : PatFrag<(ops node:$in), (sub immAllZerosV, node:$in)>;
1494 def vneg_conv : PatFrag<(ops node:$in), (sub immAllZerosV_bc, node:$in)>;
1496 class VNEGD<bits<2> size, string OpcodeStr, ValueType Ty>
1497 : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$dst), (ins DPR:$src),
1499 !strconcat(OpcodeStr, "\t$dst, $src"), "",
1500 [(set DPR:$dst, (Ty (vneg DPR:$src)))]>;
1501 class VNEGQ<bits<2> size, string OpcodeStr, ValueType Ty>
1502 : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$dst), (ins QPR:$src),
1504 !strconcat(OpcodeStr, "\t$dst, $src"), "",
1505 [(set QPR:$dst, (Ty (vneg QPR:$src)))]>;
1507 // VNEG : Vector Negate
1508 def VNEGs8d : VNEGD<0b00, "vneg.s8", v8i8>;
1509 def VNEGs16d : VNEGD<0b01, "vneg.s16", v4i16>;
1510 def VNEGs32d : VNEGD<0b10, "vneg.s32", v2i32>;
1511 def VNEGs8q : VNEGQ<0b00, "vneg.s8", v16i8>;
1512 def VNEGs16q : VNEGQ<0b01, "vneg.s16", v8i16>;
1513 def VNEGs32q : VNEGQ<0b10, "vneg.s32", v4i32>;
1515 // VNEG : Vector Negate (floating-point)
1516 def VNEGf32d : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
1517 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
1518 "vneg.f32\t$dst, $src", "",
1519 [(set DPR:$dst, (v2f32 (fneg DPR:$src)))]>;
1520 def VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0,
1521 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
1522 "vneg.f32\t$dst, $src", "",
1523 [(set QPR:$dst, (v4f32 (fneg QPR:$src)))]>;
1525 def : Pat<(v8i8 (vneg_conv DPR:$src)), (VNEGs8d DPR:$src)>;
1526 def : Pat<(v4i16 (vneg_conv DPR:$src)), (VNEGs16d DPR:$src)>;
1527 def : Pat<(v2i32 (vneg_conv DPR:$src)), (VNEGs32d DPR:$src)>;
1528 def : Pat<(v16i8 (vneg_conv QPR:$src)), (VNEGs8q QPR:$src)>;
1529 def : Pat<(v8i16 (vneg_conv QPR:$src)), (VNEGs16q QPR:$src)>;
1530 def : Pat<(v4i32 (vneg_conv QPR:$src)), (VNEGs32q QPR:$src)>;
1532 // VQNEG : Vector Saturating Negate
1533 defm VQNEG : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0, "vqneg.s",
1534 int_arm_neon_vqneg>;
1536 // Vector Bit Counting Operations.
1538 // VCLS : Vector Count Leading Sign Bits
1539 defm VCLS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0, "vcls.s",
1541 // VCLZ : Vector Count Leading Zeros
1542 defm VCLZ : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0, "vclz.i",
1544 // VCNT : Vector Count One Bits
1545 def VCNTd : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0, "vcnt.8",
1546 v8i8, v8i8, int_arm_neon_vcnt>;
1547 def VCNTq : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0, "vcnt.8",
1548 v16i8, v16i8, int_arm_neon_vcnt>;
1550 // Vector Move Operations.
1552 // VMOV : Vector Move (Register)
1554 def VMOVD : N3V<0, 0, 0b10, 0b0001, 0, 1, (outs DPR:$dst), (ins DPR:$src),
1555 NoItinerary, "vmov\t$dst, $src", "", []>;
1556 def VMOVQ : N3V<0, 0, 0b10, 0b0001, 1, 1, (outs QPR:$dst), (ins QPR:$src),
1557 NoItinerary, "vmov\t$dst, $src", "", []>;
1559 // VMOV : Vector Move (Immediate)
1561 // VMOV_get_imm8 xform function: convert build_vector to VMOV.i8 imm.
1562 def VMOV_get_imm8 : SDNodeXForm<build_vector, [{
1563 return ARM::getVMOVImm(N, 1, *CurDAG);
1565 def vmovImm8 : PatLeaf<(build_vector), [{
1566 return ARM::getVMOVImm(N, 1, *CurDAG).getNode() != 0;
1569 // VMOV_get_imm16 xform function: convert build_vector to VMOV.i16 imm.
1570 def VMOV_get_imm16 : SDNodeXForm<build_vector, [{
1571 return ARM::getVMOVImm(N, 2, *CurDAG);
1573 def vmovImm16 : PatLeaf<(build_vector), [{
1574 return ARM::getVMOVImm(N, 2, *CurDAG).getNode() != 0;
1575 }], VMOV_get_imm16>;
1577 // VMOV_get_imm32 xform function: convert build_vector to VMOV.i32 imm.
1578 def VMOV_get_imm32 : SDNodeXForm<build_vector, [{
1579 return ARM::getVMOVImm(N, 4, *CurDAG);
1581 def vmovImm32 : PatLeaf<(build_vector), [{
1582 return ARM::getVMOVImm(N, 4, *CurDAG).getNode() != 0;
1583 }], VMOV_get_imm32>;
1585 // VMOV_get_imm64 xform function: convert build_vector to VMOV.i64 imm.
1586 def VMOV_get_imm64 : SDNodeXForm<build_vector, [{
1587 return ARM::getVMOVImm(N, 8, *CurDAG);
1589 def vmovImm64 : PatLeaf<(build_vector), [{
1590 return ARM::getVMOVImm(N, 8, *CurDAG).getNode() != 0;
1591 }], VMOV_get_imm64>;
1593 // Note: Some of the cmode bits in the following VMOV instructions need to
1594 // be encoded based on the immed values.
1596 def VMOVv8i8 : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$dst),
1597 (ins i8imm:$SIMM), NoItinerary,
1598 "vmov.i8\t$dst, $SIMM", "",
1599 [(set DPR:$dst, (v8i8 vmovImm8:$SIMM))]>;
1600 def VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$dst),
1601 (ins i8imm:$SIMM), NoItinerary,
1602 "vmov.i8\t$dst, $SIMM", "",
1603 [(set QPR:$dst, (v16i8 vmovImm8:$SIMM))]>;
1605 def VMOVv4i16 : N1ModImm<1, 0b000, 0b1000, 0, 0, 0, 1, (outs DPR:$dst),
1606 (ins i16imm:$SIMM), NoItinerary,
1607 "vmov.i16\t$dst, $SIMM", "",
1608 [(set DPR:$dst, (v4i16 vmovImm16:$SIMM))]>;
1609 def VMOVv8i16 : N1ModImm<1, 0b000, 0b1000, 0, 1, 0, 1, (outs QPR:$dst),
1610 (ins i16imm:$SIMM), NoItinerary,
1611 "vmov.i16\t$dst, $SIMM", "",
1612 [(set QPR:$dst, (v8i16 vmovImm16:$SIMM))]>;
1614 def VMOVv2i32 : N1ModImm<1, 0b000, 0b0000, 0, 0, 0, 1, (outs DPR:$dst),
1615 (ins i32imm:$SIMM), NoItinerary,
1616 "vmov.i32\t$dst, $SIMM", "",
1617 [(set DPR:$dst, (v2i32 vmovImm32:$SIMM))]>;
1618 def VMOVv4i32 : N1ModImm<1, 0b000, 0b0000, 0, 1, 0, 1, (outs QPR:$dst),
1619 (ins i32imm:$SIMM), NoItinerary,
1620 "vmov.i32\t$dst, $SIMM", "",
1621 [(set QPR:$dst, (v4i32 vmovImm32:$SIMM))]>;
1623 def VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$dst),
1624 (ins i64imm:$SIMM), NoItinerary,
1625 "vmov.i64\t$dst, $SIMM", "",
1626 [(set DPR:$dst, (v1i64 vmovImm64:$SIMM))]>;
1627 def VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$dst),
1628 (ins i64imm:$SIMM), NoItinerary,
1629 "vmov.i64\t$dst, $SIMM", "",
1630 [(set QPR:$dst, (v2i64 vmovImm64:$SIMM))]>;
1632 // VMOV : Vector Get Lane (move scalar to ARM core register)
1634 def VGETLNs8 : NVGetLane<0b11100101, 0b1011, 0b00,
1635 (outs GPR:$dst), (ins DPR:$src, lane_cst:$lane),
1636 NoItinerary, "vmov", ".s8\t$dst, $src[$lane]",
1637 [(set GPR:$dst, (NEONvgetlanes (v8i8 DPR:$src),
1639 def VGETLNs16 : NVGetLane<0b11100001, 0b1011, 0b01,
1640 (outs GPR:$dst), (ins DPR:$src, lane_cst:$lane),
1641 NoItinerary, "vmov", ".s16\t$dst, $src[$lane]",
1642 [(set GPR:$dst, (NEONvgetlanes (v4i16 DPR:$src),
1644 def VGETLNu8 : NVGetLane<0b11101101, 0b1011, 0b00,
1645 (outs GPR:$dst), (ins DPR:$src, lane_cst:$lane),
1646 NoItinerary, "vmov", ".u8\t$dst, $src[$lane]",
1647 [(set GPR:$dst, (NEONvgetlaneu (v8i8 DPR:$src),
1649 def VGETLNu16 : NVGetLane<0b11101001, 0b1011, 0b01,
1650 (outs GPR:$dst), (ins DPR:$src, lane_cst:$lane),
1651 NoItinerary, "vmov", ".u16\t$dst, $src[$lane]",
1652 [(set GPR:$dst, (NEONvgetlaneu (v4i16 DPR:$src),
1654 def VGETLNi32 : NVGetLane<0b11100001, 0b1011, 0b00,
1655 (outs GPR:$dst), (ins DPR:$src, lane_cst:$lane),
1656 NoItinerary, "vmov", ".32\t$dst, $src[$lane]",
1657 [(set GPR:$dst, (extractelt (v2i32 DPR:$src),
1659 // def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
1660 def : Pat<(NEONvgetlanes (v16i8 QPR:$src), imm:$lane),
1661 (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
1662 (DSubReg_i8_reg imm:$lane))),
1663 (SubReg_i8_lane imm:$lane))>;
1664 def : Pat<(NEONvgetlanes (v8i16 QPR:$src), imm:$lane),
1665 (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
1666 (DSubReg_i16_reg imm:$lane))),
1667 (SubReg_i16_lane imm:$lane))>;
1668 def : Pat<(NEONvgetlaneu (v16i8 QPR:$src), imm:$lane),
1669 (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
1670 (DSubReg_i8_reg imm:$lane))),
1671 (SubReg_i8_lane imm:$lane))>;
1672 def : Pat<(NEONvgetlaneu (v8i16 QPR:$src), imm:$lane),
1673 (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
1674 (DSubReg_i16_reg imm:$lane))),
1675 (SubReg_i16_lane imm:$lane))>;
1676 def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
1677 (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
1678 (DSubReg_i32_reg imm:$lane))),
1679 (SubReg_i32_lane imm:$lane))>;
1680 def : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
1681 (EXTRACT_SUBREG QPR:$src1, (SSubReg_f32_reg imm:$src2))>;
1682 //def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
1683 // (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
1684 def : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
1685 (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
1688 // VMOV : Vector Set Lane (move ARM core register to scalar)
1690 let Constraints = "$src1 = $dst" in {
1691 def VSETLNi8 : NVSetLane<0b11100100, 0b1011, 0b00, (outs DPR:$dst),
1692 (ins DPR:$src1, GPR:$src2, lane_cst:$lane),
1693 NoItinerary, "vmov", ".8\t$dst[$lane], $src2",
1694 [(set DPR:$dst, (vector_insert (v8i8 DPR:$src1),
1695 GPR:$src2, imm:$lane))]>;
1696 def VSETLNi16 : NVSetLane<0b11100000, 0b1011, 0b01, (outs DPR:$dst),
1697 (ins DPR:$src1, GPR:$src2, lane_cst:$lane),
1698 NoItinerary, "vmov", ".16\t$dst[$lane], $src2",
1699 [(set DPR:$dst, (vector_insert (v4i16 DPR:$src1),
1700 GPR:$src2, imm:$lane))]>;
1701 def VSETLNi32 : NVSetLane<0b11100000, 0b1011, 0b00, (outs DPR:$dst),
1702 (ins DPR:$src1, GPR:$src2, lane_cst:$lane),
1703 NoItinerary, "vmov", ".32\t$dst[$lane], $src2",
1704 [(set DPR:$dst, (insertelt (v2i32 DPR:$src1),
1705 GPR:$src2, imm:$lane))]>;
1707 def : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
1708 (v16i8 (INSERT_SUBREG QPR:$src1,
1709 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
1710 (DSubReg_i8_reg imm:$lane))),
1711 GPR:$src2, (SubReg_i8_lane imm:$lane)),
1712 (DSubReg_i8_reg imm:$lane)))>;
1713 def : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
1714 (v8i16 (INSERT_SUBREG QPR:$src1,
1715 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
1716 (DSubReg_i16_reg imm:$lane))),
1717 GPR:$src2, (SubReg_i16_lane imm:$lane)),
1718 (DSubReg_i16_reg imm:$lane)))>;
1719 def : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
1720 (v4i32 (INSERT_SUBREG QPR:$src1,
1721 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
1722 (DSubReg_i32_reg imm:$lane))),
1723 GPR:$src2, (SubReg_i32_lane imm:$lane)),
1724 (DSubReg_i32_reg imm:$lane)))>;
1726 def : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
1727 (INSERT_SUBREG QPR:$src1, SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
1729 //def : Pat<(v2i64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
1730 // (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
1731 def : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
1732 (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
1734 // VDUP : Vector Duplicate (from ARM core register to all elements)
1736 def splat_lo : PatFrag<(ops node:$lhs, node:$rhs),
1737 (vector_shuffle node:$lhs, node:$rhs), [{
1738 ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N);
1739 return SVOp->isSplat() && SVOp->getSplatIndex() == 0;
1742 class VDUPD<bits<8> opcod1, bits<2> opcod3, string asmSize, ValueType Ty>
1743 : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$dst), (ins GPR:$src),
1744 NoItinerary, "vdup", !strconcat(asmSize, "\t$dst, $src"),
1745 [(set DPR:$dst, (Ty (splat_lo (scalar_to_vector GPR:$src), undef)))]>;
1746 class VDUPQ<bits<8> opcod1, bits<2> opcod3, string asmSize, ValueType Ty>
1747 : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$dst), (ins GPR:$src),
1748 NoItinerary, "vdup", !strconcat(asmSize, "\t$dst, $src"),
1749 [(set QPR:$dst, (Ty (splat_lo (scalar_to_vector GPR:$src), undef)))]>;
1751 def VDUP8d : VDUPD<0b11101100, 0b00, ".8", v8i8>;
1752 def VDUP16d : VDUPD<0b11101000, 0b01, ".16", v4i16>;
1753 def VDUP32d : VDUPD<0b11101000, 0b00, ".32", v2i32>;
1754 def VDUP8q : VDUPQ<0b11101110, 0b00, ".8", v16i8>;
1755 def VDUP16q : VDUPQ<0b11101010, 0b01, ".16", v8i16>;
1756 def VDUP32q : VDUPQ<0b11101010, 0b00, ".32", v4i32>;
1758 def VDUPfd : NVDup<0b11101000, 0b1011, 0b00, (outs DPR:$dst), (ins GPR:$src),
1759 NoItinerary, "vdup", ".32\t$dst, $src",
1760 [(set DPR:$dst, (v2f32 (splat_lo
1762 (f32 (bitconvert GPR:$src))),
1764 def VDUPfq : NVDup<0b11101010, 0b1011, 0b00, (outs QPR:$dst), (ins GPR:$src),
1765 NoItinerary, "vdup", ".32\t$dst, $src",
1766 [(set QPR:$dst, (v4f32 (splat_lo
1768 (f32 (bitconvert GPR:$src))),
1771 // VDUP : Vector Duplicate Lane (from scalar to all elements)
1773 def SHUFFLE_get_splat_lane : SDNodeXForm<vector_shuffle, [{
1774 ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N);
1775 return CurDAG->getTargetConstant(SVOp->getSplatIndex(), EVT::i32);
1778 def splat_lane : PatFrag<(ops node:$lhs, node:$rhs),
1779 (vector_shuffle node:$lhs, node:$rhs), [{
1780 ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N);
1781 return SVOp->isSplat();
1782 }], SHUFFLE_get_splat_lane>;
1784 class VDUPLND<bits<2> op19_18, bits<2> op17_16, string OpcodeStr, ValueType Ty>
1785 : N2V<0b11, 0b11, op19_18, op17_16, 0b11000, 0, 0,
1786 (outs DPR:$dst), (ins DPR:$src, lane_cst:$lane), NoItinerary,
1787 !strconcat(OpcodeStr, "\t$dst, $src[$lane]"), "",
1788 [(set DPR:$dst, (Ty (splat_lane:$lane DPR:$src, undef)))]>;
1790 // vector_shuffle requires that the source and destination types match, so
1791 // VDUP to a 128-bit result uses a target-specific VDUPLANEQ node.
1792 class VDUPLNQ<bits<2> op19_18, bits<2> op17_16, string OpcodeStr,
1793 ValueType ResTy, ValueType OpTy>
1794 : N2V<0b11, 0b11, op19_18, op17_16, 0b11000, 1, 0,
1795 (outs QPR:$dst), (ins DPR:$src, lane_cst:$lane), NoItinerary,
1796 !strconcat(OpcodeStr, "\t$dst, $src[$lane]"), "",
1797 [(set QPR:$dst, (ResTy (NEONvduplaneq (OpTy DPR:$src), imm:$lane)))]>;
1799 def VDUPLN8d : VDUPLND<0b00, 0b01, "vdup.8", v8i8>;
1800 def VDUPLN16d : VDUPLND<0b00, 0b10, "vdup.16", v4i16>;
1801 def VDUPLN32d : VDUPLND<0b01, 0b00, "vdup.32", v2i32>;
1802 def VDUPLNfd : VDUPLND<0b01, 0b00, "vdup.32", v2f32>;
1803 def VDUPLN8q : VDUPLNQ<0b00, 0b01, "vdup.8", v16i8, v8i8>;
1804 def VDUPLN16q : VDUPLNQ<0b00, 0b10, "vdup.16", v8i16, v4i16>;
1805 def VDUPLN32q : VDUPLNQ<0b01, 0b00, "vdup.32", v4i32, v2i32>;
1806 def VDUPLNfq : VDUPLNQ<0b01, 0b00, "vdup.32", v4f32, v2f32>;
1808 def VDUPfdf : N2V<0b11, 0b11, 0b01, 0b00, 0b11000, 0, 0,
1809 (outs DPR:$dst), (ins SPR:$src),
1810 NoItinerary, "vdup.32\t$dst, ${src:lane}", "",
1811 [(set DPR:$dst, (v2f32 (splat_lo
1812 (scalar_to_vector SPR:$src),
1815 def VDUPfqf : N2V<0b11, 0b11, 0b01, 0b00, 0b11000, 1, 0,
1816 (outs QPR:$dst), (ins SPR:$src),
1817 NoItinerary, "vdup.32\t$dst, ${src:lane}", "",
1818 [(set QPR:$dst, (v4f32 (splat_lo
1819 (scalar_to_vector SPR:$src),
1822 // VMOVN : Vector Narrowing Move
1823 defm VMOVN : N2VNInt_HSD<0b11,0b11,0b10,0b00100,0,0, "vmovn.i",
1824 int_arm_neon_vmovn>;
1825 // VQMOVN : Vector Saturating Narrowing Move
1826 defm VQMOVNs : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, "vqmovn.s",
1827 int_arm_neon_vqmovns>;
1828 defm VQMOVNu : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, "vqmovn.u",
1829 int_arm_neon_vqmovnu>;
1830 defm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, "vqmovun.s",
1831 int_arm_neon_vqmovnsu>;
1832 // VMOVL : Vector Lengthening Move
1833 defm VMOVLs : N2VLInt_QHS<0,1,0b1010,0,0,1, "vmovl.s", int_arm_neon_vmovls>;
1834 defm VMOVLu : N2VLInt_QHS<1,1,0b1010,0,0,1, "vmovl.u", int_arm_neon_vmovlu>;
1836 // Vector Conversions.
1838 // VCVT : Vector Convert Between Floating-Point and Integers
1839 def VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt.s32.f32",
1840 v2i32, v2f32, fp_to_sint>;
1841 def VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt.u32.f32",
1842 v2i32, v2f32, fp_to_uint>;
1843 def VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt.f32.s32",
1844 v2f32, v2i32, sint_to_fp>;
1845 def VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt.f32.u32",
1846 v2f32, v2i32, uint_to_fp>;
1848 def VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt.s32.f32",
1849 v4i32, v4f32, fp_to_sint>;
1850 def VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt.u32.f32",
1851 v4i32, v4f32, fp_to_uint>;
1852 def VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt.f32.s32",
1853 v4f32, v4i32, sint_to_fp>;
1854 def VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt.f32.u32",
1855 v4f32, v4i32, uint_to_fp>;
1857 // VCVT : Vector Convert Between Floating-Point and Fixed-Point.
1858 // Note: Some of the opcode bits in the following VCVT instructions need to
1859 // be encoded based on the immed values.
1860 def VCVTf2xsd : N2VCvtD<0, 1, 0b000000, 0b1111, 0, 1, "vcvt.s32.f32",
1861 v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
1862 def VCVTf2xud : N2VCvtD<1, 1, 0b000000, 0b1111, 0, 1, "vcvt.u32.f32",
1863 v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
1864 def VCVTxs2fd : N2VCvtD<0, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.s32",
1865 v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
1866 def VCVTxu2fd : N2VCvtD<1, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.u32",
1867 v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
1869 def VCVTf2xsq : N2VCvtQ<0, 1, 0b000000, 0b1111, 0, 1, "vcvt.s32.f32",
1870 v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
1871 def VCVTf2xuq : N2VCvtQ<1, 1, 0b000000, 0b1111, 0, 1, "vcvt.u32.f32",
1872 v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
1873 def VCVTxs2fq : N2VCvtQ<0, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.s32",
1874 v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
1875 def VCVTxu2fq : N2VCvtQ<1, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.u32",
1876 v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
1878 // VREV : Vector Reverse
1880 def vrev64_shuffle : PatFrag<(ops node:$in),
1881 (vector_shuffle node:$in, undef), [{
1882 ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N);
1883 return ARM::isVREVMask(SVOp, 64);
1886 def vrev32_shuffle : PatFrag<(ops node:$in),
1887 (vector_shuffle node:$in, undef), [{
1888 ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N);
1889 return ARM::isVREVMask(SVOp, 32);
1892 def vrev16_shuffle : PatFrag<(ops node:$in),
1893 (vector_shuffle node:$in, undef), [{
1894 ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N);
1895 return ARM::isVREVMask(SVOp, 16);
1898 // VREV64 : Vector Reverse elements within 64-bit doublewords
1900 class VREV64D<bits<2> op19_18, string OpcodeStr, ValueType Ty>
1901 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$dst),
1902 (ins DPR:$src), NoItinerary,
1903 !strconcat(OpcodeStr, "\t$dst, $src"), "",
1904 [(set DPR:$dst, (Ty (vrev64_shuffle (Ty DPR:$src))))]>;
1905 class VREV64Q<bits<2> op19_18, string OpcodeStr, ValueType Ty>
1906 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$dst),
1907 (ins QPR:$src), NoItinerary,
1908 !strconcat(OpcodeStr, "\t$dst, $src"), "",
1909 [(set QPR:$dst, (Ty (vrev64_shuffle (Ty QPR:$src))))]>;
1911 def VREV64d8 : VREV64D<0b00, "vrev64.8", v8i8>;
1912 def VREV64d16 : VREV64D<0b01, "vrev64.16", v4i16>;
1913 def VREV64d32 : VREV64D<0b10, "vrev64.32", v2i32>;
1914 def VREV64df : VREV64D<0b10, "vrev64.32", v2f32>;
1916 def VREV64q8 : VREV64Q<0b00, "vrev64.8", v16i8>;
1917 def VREV64q16 : VREV64Q<0b01, "vrev64.16", v8i16>;
1918 def VREV64q32 : VREV64Q<0b10, "vrev64.32", v4i32>;
1919 def VREV64qf : VREV64Q<0b10, "vrev64.32", v4f32>;
1921 // VREV32 : Vector Reverse elements within 32-bit words
1923 class VREV32D<bits<2> op19_18, string OpcodeStr, ValueType Ty>
1924 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$dst),
1925 (ins DPR:$src), NoItinerary,
1926 !strconcat(OpcodeStr, "\t$dst, $src"), "",
1927 [(set DPR:$dst, (Ty (vrev32_shuffle (Ty DPR:$src))))]>;
1928 class VREV32Q<bits<2> op19_18, string OpcodeStr, ValueType Ty>
1929 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$dst),
1930 (ins QPR:$src), NoItinerary,
1931 !strconcat(OpcodeStr, "\t$dst, $src"), "",
1932 [(set QPR:$dst, (Ty (vrev32_shuffle (Ty QPR:$src))))]>;
1934 def VREV32d8 : VREV32D<0b00, "vrev32.8", v8i8>;
1935 def VREV32d16 : VREV32D<0b01, "vrev32.16", v4i16>;
1937 def VREV32q8 : VREV32Q<0b00, "vrev32.8", v16i8>;
1938 def VREV32q16 : VREV32Q<0b01, "vrev32.16", v8i16>;
1940 // VREV16 : Vector Reverse elements within 16-bit halfwords
1942 class VREV16D<bits<2> op19_18, string OpcodeStr, ValueType Ty>
1943 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$dst),
1944 (ins DPR:$src), NoItinerary,
1945 !strconcat(OpcodeStr, "\t$dst, $src"), "",
1946 [(set DPR:$dst, (Ty (vrev16_shuffle (Ty DPR:$src))))]>;
1947 class VREV16Q<bits<2> op19_18, string OpcodeStr, ValueType Ty>
1948 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$dst),
1949 (ins QPR:$src), NoItinerary,
1950 !strconcat(OpcodeStr, "\t$dst, $src"), "",
1951 [(set QPR:$dst, (Ty (vrev16_shuffle (Ty QPR:$src))))]>;
1953 def VREV16d8 : VREV16D<0b00, "vrev16.8", v8i8>;
1954 def VREV16q8 : VREV16Q<0b00, "vrev16.8", v16i8>;
1956 // VTRN : Vector Transpose
1958 def VTRNd8 : N2VDShuffle<0b00, 0b00001, "vtrn.8">;
1959 def VTRNd16 : N2VDShuffle<0b01, 0b00001, "vtrn.16">;
1960 def VTRNd32 : N2VDShuffle<0b10, 0b00001, "vtrn.32">;
1962 def VTRNq8 : N2VQShuffle<0b00, 0b00001, "vtrn.8">;
1963 def VTRNq16 : N2VQShuffle<0b01, 0b00001, "vtrn.16">;
1964 def VTRNq32 : N2VQShuffle<0b10, 0b00001, "vtrn.32">;
1966 // VUZP : Vector Unzip (Deinterleave)
1968 def VUZPd8 : N2VDShuffle<0b00, 0b00010, "vuzp.8">;
1969 def VUZPd16 : N2VDShuffle<0b01, 0b00010, "vuzp.16">;
1970 def VUZPd32 : N2VDShuffle<0b10, 0b00010, "vuzp.32">;
1972 def VUZPq8 : N2VQShuffle<0b00, 0b00010, "vuzp.8">;
1973 def VUZPq16 : N2VQShuffle<0b01, 0b00010, "vuzp.16">;
1974 def VUZPq32 : N2VQShuffle<0b10, 0b00010, "vuzp.32">;
1976 // VZIP : Vector Zip (Interleave)
1978 def VZIPd8 : N2VDShuffle<0b00, 0b00011, "vzip.8">;
1979 def VZIPd16 : N2VDShuffle<0b01, 0b00011, "vzip.16">;
1980 def VZIPd32 : N2VDShuffle<0b10, 0b00011, "vzip.32">;
1982 def VZIPq8 : N2VQShuffle<0b00, 0b00011, "vzip.8">;
1983 def VZIPq16 : N2VQShuffle<0b01, 0b00011, "vzip.16">;
1984 def VZIPq32 : N2VQShuffle<0b10, 0b00011, "vzip.32">;
1986 //===----------------------------------------------------------------------===//
1987 // NEON instructions for single-precision FP math
1988 //===----------------------------------------------------------------------===//
1990 // These need separate instructions because they must use DPR_VFP2 register
1991 // class which have SPR sub-registers.
1993 // Vector Add Operations used for single-precision FP
1994 let neverHasSideEffects = 1 in
1995 def VADDfd_sfp : N3VDs<0, 0, 0b00, 0b1101, 0, "vadd.f32", v2f32, v2f32, fadd,1>;
1996 def : N3VDsPat<fadd, VADDfd_sfp>;
1998 // Vector Sub Operations used for single-precision FP
1999 let neverHasSideEffects = 1 in
2000 def VSUBfd_sfp : N3VDs<0, 0, 0b10, 0b1101, 0, "vsub.f32", v2f32, v2f32, fsub,0>;
2001 def : N3VDsPat<fsub, VSUBfd_sfp>;
2003 // Vector Multiply Operations used for single-precision FP
2004 let neverHasSideEffects = 1 in
2005 def VMULfd_sfp : N3VDs<1, 0, 0b00, 0b1101, 1, "vmul.f32", v2f32, v2f32, fmul,1>;
2006 def : N3VDsPat<fmul, VMULfd_sfp>;
2008 // Vector Multiply-Accumulate/Subtract used for single-precision FP
2009 let neverHasSideEffects = 1 in
2010 def VMLAfd_sfp : N3VDMulOps<0, 0, 0b00, 0b1101, 1, "vmla.f32", v2f32,fmul,fadd>;
2011 def : N3VDMulOpsPat<fmul, fadd, VMLAfd_sfp>;
2013 let neverHasSideEffects = 1 in
2014 def VMLSfd_sfp : N3VDMulOps<0, 0, 0b10, 0b1101, 1, "vmls.f32", v2f32,fmul,fsub>;
2015 def : N3VDMulOpsPat<fmul, fsub, VMLSfd_sfp>;
2017 // Vector Absolute used for single-precision FP
2018 let neverHasSideEffects = 1 in
2019 def VABSfd_sfp : N2VDInts<0b11, 0b11, 0b10, 0b01, 0b01110, 0, "vabs.f32",
2020 v2f32, v2f32, int_arm_neon_vabs>;
2021 def : N2VDIntsPat<fabs, VABSfd_sfp>;
2023 // Vector Negate used for single-precision FP
2024 let neverHasSideEffects = 1 in
2025 def VNEGf32d_sfp : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
2026 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), NoItinerary,
2027 "vneg.f32\t$dst, $src", "", []>;
2028 def : N2VDIntsPat<fneg, VNEGf32d_sfp>;
2030 // Vector Convert between single-precision FP and integer
2031 let neverHasSideEffects = 1 in
2032 def VCVTf2sd_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt.s32.f32",
2033 v2i32, v2f32, fp_to_sint>;
2034 def : N2VDsPat<arm_ftosi, f32, v2f32, VCVTf2sd_sfp>;
2036 let neverHasSideEffects = 1 in
2037 def VCVTf2ud_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt.u32.f32",
2038 v2i32, v2f32, fp_to_uint>;
2039 def : N2VDsPat<arm_ftoui, f32, v2f32, VCVTf2ud_sfp>;
2041 let neverHasSideEffects = 1 in
2042 def VCVTs2fd_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt.f32.s32",
2043 v2f32, v2i32, sint_to_fp>;
2044 def : N2VDsPat<arm_sitof, f32, v2i32, VCVTs2fd_sfp>;
2046 let neverHasSideEffects = 1 in
2047 def VCVTu2fd_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt.f32.u32",
2048 v2f32, v2i32, uint_to_fp>;
2049 def : N2VDsPat<arm_uitof, f32, v2i32, VCVTu2fd_sfp>;
2051 //===----------------------------------------------------------------------===//
2052 // Non-Instruction Patterns
2053 //===----------------------------------------------------------------------===//
2056 def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
2057 def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
2058 def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (v1i64 DPR:$src)>;
2059 def : Pat<(v1i64 (bitconvert (f64 DPR:$src))), (v1i64 DPR:$src)>;
2060 def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
2061 def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
2062 def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
2063 def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (v2i32 DPR:$src)>;
2064 def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (v2i32 DPR:$src)>;
2065 def : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
2066 def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
2067 def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
2068 def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (v4i16 DPR:$src)>;
2069 def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (v4i16 DPR:$src)>;
2070 def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
2071 def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (v8i8 DPR:$src)>;
2072 def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (v8i8 DPR:$src)>;
2073 def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (v8i8 DPR:$src)>;
2074 def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (v8i8 DPR:$src)>;
2075 def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (v8i8 DPR:$src)>;
2076 def : Pat<(f64 (bitconvert (v1i64 DPR:$src))), (f64 DPR:$src)>;
2077 def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (f64 DPR:$src)>;
2078 def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (f64 DPR:$src)>;
2079 def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (f64 DPR:$src)>;
2080 def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (f64 DPR:$src)>;
2081 def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (v2f32 DPR:$src)>;
2082 def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
2083 def : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
2084 def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
2085 def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (v2f32 DPR:$src)>;
2087 def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
2088 def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
2089 def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
2090 def : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
2091 def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
2092 def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
2093 def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
2094 def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
2095 def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
2096 def : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
2097 def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
2098 def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
2099 def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
2100 def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
2101 def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
2102 def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
2103 def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
2104 def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
2105 def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
2106 def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
2107 def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
2108 def : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
2109 def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
2110 def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
2111 def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
2112 def : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
2113 def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
2114 def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
2115 def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
2116 def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;