1 //===-- ARMInstrNEON.td - NEON support for ARM -------------*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file describes the ARM NEON instruction set.
11 //===----------------------------------------------------------------------===//
14 //===----------------------------------------------------------------------===//
15 // NEON-specific Operands.
16 //===----------------------------------------------------------------------===//
17 def nModImm : Operand<i32> {
18 let PrintMethod = "printVMOVModImmOperand";
21 def nImmSplatI8AsmOperand : AsmOperandClass { let Name = "NEONi8splat"; }
22 def nImmSplatI8 : Operand<i32> {
23 let PrintMethod = "printVMOVModImmOperand";
24 let ParserMatchClass = nImmSplatI8AsmOperand;
26 def nImmSplatI16AsmOperand : AsmOperandClass { let Name = "NEONi16splat"; }
27 def nImmSplatI16 : Operand<i32> {
28 let PrintMethod = "printVMOVModImmOperand";
29 let ParserMatchClass = nImmSplatI16AsmOperand;
31 def nImmSplatI32AsmOperand : AsmOperandClass { let Name = "NEONi32splat"; }
32 def nImmSplatI32 : Operand<i32> {
33 let PrintMethod = "printVMOVModImmOperand";
34 let ParserMatchClass = nImmSplatI32AsmOperand;
36 def nImmSplatNotI16AsmOperand : AsmOperandClass { let Name = "NEONi16splatNot"; }
37 def nImmSplatNotI16 : Operand<i32> {
38 let ParserMatchClass = nImmSplatNotI16AsmOperand;
40 def nImmSplatNotI32AsmOperand : AsmOperandClass { let Name = "NEONi32splatNot"; }
41 def nImmSplatNotI32 : Operand<i32> {
42 let ParserMatchClass = nImmSplatNotI32AsmOperand;
44 def nImmVMOVI32AsmOperand : AsmOperandClass { let Name = "NEONi32vmov"; }
45 def nImmVMOVI32 : Operand<i32> {
46 let PrintMethod = "printVMOVModImmOperand";
47 let ParserMatchClass = nImmVMOVI32AsmOperand;
50 class nImmVMOVIAsmOperandReplicate<ValueType From, ValueType To>
52 let Name = "NEONi" # To.Size # "vmovi" # From.Size # "Replicate";
53 let PredicateMethod = "isNEONmovReplicate<" # From.Size # ", " # To.Size # ">";
54 let RenderMethod = "addNEONvmovi" # From.Size # "ReplicateOperands";
57 class nImmVINVIAsmOperandReplicate<ValueType From, ValueType To>
59 let Name = "NEONi" # To.Size # "invi" # From.Size # "Replicate";
60 let PredicateMethod = "isNEONinvReplicate<" # From.Size # ", " # To.Size # ">";
61 let RenderMethod = "addNEONinvi" # From.Size # "ReplicateOperands";
64 class nImmVMOVIReplicate<ValueType From, ValueType To> : Operand<i32> {
65 let PrintMethod = "printVMOVModImmOperand";
66 let ParserMatchClass = nImmVMOVIAsmOperandReplicate<From, To>;
69 class nImmVINVIReplicate<ValueType From, ValueType To> : Operand<i32> {
70 let PrintMethod = "printVMOVModImmOperand";
71 let ParserMatchClass = nImmVINVIAsmOperandReplicate<From, To>;
74 def nImmVMOVI32NegAsmOperand : AsmOperandClass { let Name = "NEONi32vmovNeg"; }
75 def nImmVMOVI32Neg : Operand<i32> {
76 let PrintMethod = "printVMOVModImmOperand";
77 let ParserMatchClass = nImmVMOVI32NegAsmOperand;
79 def nImmVMOVF32 : Operand<i32> {
80 let PrintMethod = "printFPImmOperand";
81 let ParserMatchClass = FPImmOperand;
83 def nImmSplatI64AsmOperand : AsmOperandClass { let Name = "NEONi64splat"; }
84 def nImmSplatI64 : Operand<i32> {
85 let PrintMethod = "printVMOVModImmOperand";
86 let ParserMatchClass = nImmSplatI64AsmOperand;
89 def VectorIndex8Operand : AsmOperandClass { let Name = "VectorIndex8"; }
90 def VectorIndex16Operand : AsmOperandClass { let Name = "VectorIndex16"; }
91 def VectorIndex32Operand : AsmOperandClass { let Name = "VectorIndex32"; }
92 def VectorIndex64Operand : AsmOperandClass { let Name = "VectorIndex64"; }
93 def VectorIndex8 : Operand<i32>, ImmLeaf<i32, [{
94 return ((uint64_t)Imm) < 8;
96 let ParserMatchClass = VectorIndex8Operand;
97 let PrintMethod = "printVectorIndex";
98 let MIOperandInfo = (ops i32imm);
100 def VectorIndex16 : Operand<i32>, ImmLeaf<i32, [{
101 return ((uint64_t)Imm) < 4;
103 let ParserMatchClass = VectorIndex16Operand;
104 let PrintMethod = "printVectorIndex";
105 let MIOperandInfo = (ops i32imm);
107 def VectorIndex32 : Operand<i32>, ImmLeaf<i32, [{
108 return ((uint64_t)Imm) < 2;
110 let ParserMatchClass = VectorIndex32Operand;
111 let PrintMethod = "printVectorIndex";
112 let MIOperandInfo = (ops i32imm);
114 def VectorIndex64 : Operand<i32>, ImmLeaf<i32, [{
115 return ((uint64_t)Imm) < 1;
117 let ParserMatchClass = VectorIndex64Operand;
118 let PrintMethod = "printVectorIndex";
119 let MIOperandInfo = (ops i32imm);
122 // Register list of one D register.
123 def VecListOneDAsmOperand : AsmOperandClass {
124 let Name = "VecListOneD";
125 let ParserMethod = "parseVectorList";
126 let RenderMethod = "addVecListOperands";
128 def VecListOneD : RegisterOperand<DPR, "printVectorListOne"> {
129 let ParserMatchClass = VecListOneDAsmOperand;
131 // Register list of two sequential D registers.
132 def VecListDPairAsmOperand : AsmOperandClass {
133 let Name = "VecListDPair";
134 let ParserMethod = "parseVectorList";
135 let RenderMethod = "addVecListOperands";
137 def VecListDPair : RegisterOperand<DPair, "printVectorListTwo"> {
138 let ParserMatchClass = VecListDPairAsmOperand;
140 // Register list of three sequential D registers.
141 def VecListThreeDAsmOperand : AsmOperandClass {
142 let Name = "VecListThreeD";
143 let ParserMethod = "parseVectorList";
144 let RenderMethod = "addVecListOperands";
146 def VecListThreeD : RegisterOperand<DPR, "printVectorListThree"> {
147 let ParserMatchClass = VecListThreeDAsmOperand;
149 // Register list of four sequential D registers.
150 def VecListFourDAsmOperand : AsmOperandClass {
151 let Name = "VecListFourD";
152 let ParserMethod = "parseVectorList";
153 let RenderMethod = "addVecListOperands";
155 def VecListFourD : RegisterOperand<DPR, "printVectorListFour"> {
156 let ParserMatchClass = VecListFourDAsmOperand;
158 // Register list of two D registers spaced by 2 (two sequential Q registers).
159 def VecListDPairSpacedAsmOperand : AsmOperandClass {
160 let Name = "VecListDPairSpaced";
161 let ParserMethod = "parseVectorList";
162 let RenderMethod = "addVecListOperands";
164 def VecListDPairSpaced : RegisterOperand<DPair, "printVectorListTwoSpaced"> {
165 let ParserMatchClass = VecListDPairSpacedAsmOperand;
167 // Register list of three D registers spaced by 2 (three Q registers).
168 def VecListThreeQAsmOperand : AsmOperandClass {
169 let Name = "VecListThreeQ";
170 let ParserMethod = "parseVectorList";
171 let RenderMethod = "addVecListOperands";
173 def VecListThreeQ : RegisterOperand<DPR, "printVectorListThreeSpaced"> {
174 let ParserMatchClass = VecListThreeQAsmOperand;
176 // Register list of three D registers spaced by 2 (three Q registers).
177 def VecListFourQAsmOperand : AsmOperandClass {
178 let Name = "VecListFourQ";
179 let ParserMethod = "parseVectorList";
180 let RenderMethod = "addVecListOperands";
182 def VecListFourQ : RegisterOperand<DPR, "printVectorListFourSpaced"> {
183 let ParserMatchClass = VecListFourQAsmOperand;
186 // Register list of one D register, with "all lanes" subscripting.
187 def VecListOneDAllLanesAsmOperand : AsmOperandClass {
188 let Name = "VecListOneDAllLanes";
189 let ParserMethod = "parseVectorList";
190 let RenderMethod = "addVecListOperands";
192 def VecListOneDAllLanes : RegisterOperand<DPR, "printVectorListOneAllLanes"> {
193 let ParserMatchClass = VecListOneDAllLanesAsmOperand;
195 // Register list of two D registers, with "all lanes" subscripting.
196 def VecListDPairAllLanesAsmOperand : AsmOperandClass {
197 let Name = "VecListDPairAllLanes";
198 let ParserMethod = "parseVectorList";
199 let RenderMethod = "addVecListOperands";
201 def VecListDPairAllLanes : RegisterOperand<DPair,
202 "printVectorListTwoAllLanes"> {
203 let ParserMatchClass = VecListDPairAllLanesAsmOperand;
205 // Register list of two D registers spaced by 2 (two sequential Q registers).
206 def VecListDPairSpacedAllLanesAsmOperand : AsmOperandClass {
207 let Name = "VecListDPairSpacedAllLanes";
208 let ParserMethod = "parseVectorList";
209 let RenderMethod = "addVecListOperands";
211 def VecListDPairSpacedAllLanes : RegisterOperand<DPairSpc,
212 "printVectorListTwoSpacedAllLanes"> {
213 let ParserMatchClass = VecListDPairSpacedAllLanesAsmOperand;
215 // Register list of three D registers, with "all lanes" subscripting.
216 def VecListThreeDAllLanesAsmOperand : AsmOperandClass {
217 let Name = "VecListThreeDAllLanes";
218 let ParserMethod = "parseVectorList";
219 let RenderMethod = "addVecListOperands";
221 def VecListThreeDAllLanes : RegisterOperand<DPR,
222 "printVectorListThreeAllLanes"> {
223 let ParserMatchClass = VecListThreeDAllLanesAsmOperand;
225 // Register list of three D registers spaced by 2 (three sequential Q regs).
226 def VecListThreeQAllLanesAsmOperand : AsmOperandClass {
227 let Name = "VecListThreeQAllLanes";
228 let ParserMethod = "parseVectorList";
229 let RenderMethod = "addVecListOperands";
231 def VecListThreeQAllLanes : RegisterOperand<DPR,
232 "printVectorListThreeSpacedAllLanes"> {
233 let ParserMatchClass = VecListThreeQAllLanesAsmOperand;
235 // Register list of four D registers, with "all lanes" subscripting.
236 def VecListFourDAllLanesAsmOperand : AsmOperandClass {
237 let Name = "VecListFourDAllLanes";
238 let ParserMethod = "parseVectorList";
239 let RenderMethod = "addVecListOperands";
241 def VecListFourDAllLanes : RegisterOperand<DPR, "printVectorListFourAllLanes"> {
242 let ParserMatchClass = VecListFourDAllLanesAsmOperand;
244 // Register list of four D registers spaced by 2 (four sequential Q regs).
245 def VecListFourQAllLanesAsmOperand : AsmOperandClass {
246 let Name = "VecListFourQAllLanes";
247 let ParserMethod = "parseVectorList";
248 let RenderMethod = "addVecListOperands";
250 def VecListFourQAllLanes : RegisterOperand<DPR,
251 "printVectorListFourSpacedAllLanes"> {
252 let ParserMatchClass = VecListFourQAllLanesAsmOperand;
256 // Register list of one D register, with byte lane subscripting.
257 def VecListOneDByteIndexAsmOperand : AsmOperandClass {
258 let Name = "VecListOneDByteIndexed";
259 let ParserMethod = "parseVectorList";
260 let RenderMethod = "addVecListIndexedOperands";
262 def VecListOneDByteIndexed : Operand<i32> {
263 let ParserMatchClass = VecListOneDByteIndexAsmOperand;
264 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
266 // ...with half-word lane subscripting.
267 def VecListOneDHWordIndexAsmOperand : AsmOperandClass {
268 let Name = "VecListOneDHWordIndexed";
269 let ParserMethod = "parseVectorList";
270 let RenderMethod = "addVecListIndexedOperands";
272 def VecListOneDHWordIndexed : Operand<i32> {
273 let ParserMatchClass = VecListOneDHWordIndexAsmOperand;
274 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
276 // ...with word lane subscripting.
277 def VecListOneDWordIndexAsmOperand : AsmOperandClass {
278 let Name = "VecListOneDWordIndexed";
279 let ParserMethod = "parseVectorList";
280 let RenderMethod = "addVecListIndexedOperands";
282 def VecListOneDWordIndexed : Operand<i32> {
283 let ParserMatchClass = VecListOneDWordIndexAsmOperand;
284 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
287 // Register list of two D registers with byte lane subscripting.
288 def VecListTwoDByteIndexAsmOperand : AsmOperandClass {
289 let Name = "VecListTwoDByteIndexed";
290 let ParserMethod = "parseVectorList";
291 let RenderMethod = "addVecListIndexedOperands";
293 def VecListTwoDByteIndexed : Operand<i32> {
294 let ParserMatchClass = VecListTwoDByteIndexAsmOperand;
295 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
297 // ...with half-word lane subscripting.
298 def VecListTwoDHWordIndexAsmOperand : AsmOperandClass {
299 let Name = "VecListTwoDHWordIndexed";
300 let ParserMethod = "parseVectorList";
301 let RenderMethod = "addVecListIndexedOperands";
303 def VecListTwoDHWordIndexed : Operand<i32> {
304 let ParserMatchClass = VecListTwoDHWordIndexAsmOperand;
305 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
307 // ...with word lane subscripting.
308 def VecListTwoDWordIndexAsmOperand : AsmOperandClass {
309 let Name = "VecListTwoDWordIndexed";
310 let ParserMethod = "parseVectorList";
311 let RenderMethod = "addVecListIndexedOperands";
313 def VecListTwoDWordIndexed : Operand<i32> {
314 let ParserMatchClass = VecListTwoDWordIndexAsmOperand;
315 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
317 // Register list of two Q registers with half-word lane subscripting.
318 def VecListTwoQHWordIndexAsmOperand : AsmOperandClass {
319 let Name = "VecListTwoQHWordIndexed";
320 let ParserMethod = "parseVectorList";
321 let RenderMethod = "addVecListIndexedOperands";
323 def VecListTwoQHWordIndexed : Operand<i32> {
324 let ParserMatchClass = VecListTwoQHWordIndexAsmOperand;
325 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
327 // ...with word lane subscripting.
328 def VecListTwoQWordIndexAsmOperand : AsmOperandClass {
329 let Name = "VecListTwoQWordIndexed";
330 let ParserMethod = "parseVectorList";
331 let RenderMethod = "addVecListIndexedOperands";
333 def VecListTwoQWordIndexed : Operand<i32> {
334 let ParserMatchClass = VecListTwoQWordIndexAsmOperand;
335 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
339 // Register list of three D registers with byte lane subscripting.
340 def VecListThreeDByteIndexAsmOperand : AsmOperandClass {
341 let Name = "VecListThreeDByteIndexed";
342 let ParserMethod = "parseVectorList";
343 let RenderMethod = "addVecListIndexedOperands";
345 def VecListThreeDByteIndexed : Operand<i32> {
346 let ParserMatchClass = VecListThreeDByteIndexAsmOperand;
347 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
349 // ...with half-word lane subscripting.
350 def VecListThreeDHWordIndexAsmOperand : AsmOperandClass {
351 let Name = "VecListThreeDHWordIndexed";
352 let ParserMethod = "parseVectorList";
353 let RenderMethod = "addVecListIndexedOperands";
355 def VecListThreeDHWordIndexed : Operand<i32> {
356 let ParserMatchClass = VecListThreeDHWordIndexAsmOperand;
357 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
359 // ...with word lane subscripting.
360 def VecListThreeDWordIndexAsmOperand : AsmOperandClass {
361 let Name = "VecListThreeDWordIndexed";
362 let ParserMethod = "parseVectorList";
363 let RenderMethod = "addVecListIndexedOperands";
365 def VecListThreeDWordIndexed : Operand<i32> {
366 let ParserMatchClass = VecListThreeDWordIndexAsmOperand;
367 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
369 // Register list of three Q registers with half-word lane subscripting.
370 def VecListThreeQHWordIndexAsmOperand : AsmOperandClass {
371 let Name = "VecListThreeQHWordIndexed";
372 let ParserMethod = "parseVectorList";
373 let RenderMethod = "addVecListIndexedOperands";
375 def VecListThreeQHWordIndexed : Operand<i32> {
376 let ParserMatchClass = VecListThreeQHWordIndexAsmOperand;
377 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
379 // ...with word lane subscripting.
380 def VecListThreeQWordIndexAsmOperand : AsmOperandClass {
381 let Name = "VecListThreeQWordIndexed";
382 let ParserMethod = "parseVectorList";
383 let RenderMethod = "addVecListIndexedOperands";
385 def VecListThreeQWordIndexed : Operand<i32> {
386 let ParserMatchClass = VecListThreeQWordIndexAsmOperand;
387 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
390 // Register list of four D registers with byte lane subscripting.
391 def VecListFourDByteIndexAsmOperand : AsmOperandClass {
392 let Name = "VecListFourDByteIndexed";
393 let ParserMethod = "parseVectorList";
394 let RenderMethod = "addVecListIndexedOperands";
396 def VecListFourDByteIndexed : Operand<i32> {
397 let ParserMatchClass = VecListFourDByteIndexAsmOperand;
398 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
400 // ...with half-word lane subscripting.
401 def VecListFourDHWordIndexAsmOperand : AsmOperandClass {
402 let Name = "VecListFourDHWordIndexed";
403 let ParserMethod = "parseVectorList";
404 let RenderMethod = "addVecListIndexedOperands";
406 def VecListFourDHWordIndexed : Operand<i32> {
407 let ParserMatchClass = VecListFourDHWordIndexAsmOperand;
408 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
410 // ...with word lane subscripting.
411 def VecListFourDWordIndexAsmOperand : AsmOperandClass {
412 let Name = "VecListFourDWordIndexed";
413 let ParserMethod = "parseVectorList";
414 let RenderMethod = "addVecListIndexedOperands";
416 def VecListFourDWordIndexed : Operand<i32> {
417 let ParserMatchClass = VecListFourDWordIndexAsmOperand;
418 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
420 // Register list of four Q registers with half-word lane subscripting.
421 def VecListFourQHWordIndexAsmOperand : AsmOperandClass {
422 let Name = "VecListFourQHWordIndexed";
423 let ParserMethod = "parseVectorList";
424 let RenderMethod = "addVecListIndexedOperands";
426 def VecListFourQHWordIndexed : Operand<i32> {
427 let ParserMatchClass = VecListFourQHWordIndexAsmOperand;
428 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
430 // ...with word lane subscripting.
431 def VecListFourQWordIndexAsmOperand : AsmOperandClass {
432 let Name = "VecListFourQWordIndexed";
433 let ParserMethod = "parseVectorList";
434 let RenderMethod = "addVecListIndexedOperands";
436 def VecListFourQWordIndexed : Operand<i32> {
437 let ParserMatchClass = VecListFourQWordIndexAsmOperand;
438 let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
441 def dword_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
442 return cast<LoadSDNode>(N)->getAlign() >= 8;
444 def dword_alignedstore : PatFrag<(ops node:$val, node:$ptr),
445 (store node:$val, node:$ptr), [{
446 return cast<StoreSDNode>(N)->getAlign() >= 8;
448 def word_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
449 return cast<LoadSDNode>(N)->getAlign() == 4;
451 def word_alignedstore : PatFrag<(ops node:$val, node:$ptr),
452 (store node:$val, node:$ptr), [{
453 return cast<StoreSDNode>(N)->getAlign() == 4;
455 def hword_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
456 return cast<LoadSDNode>(N)->getAlign() == 2;
458 def hword_alignedstore : PatFrag<(ops node:$val, node:$ptr),
459 (store node:$val, node:$ptr), [{
460 return cast<StoreSDNode>(N)->getAlign() == 2;
462 def byte_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
463 return cast<LoadSDNode>(N)->getAlign() == 1;
465 def byte_alignedstore : PatFrag<(ops node:$val, node:$ptr),
466 (store node:$val, node:$ptr), [{
467 return cast<StoreSDNode>(N)->getAlign() == 1;
469 def non_word_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
470 return cast<LoadSDNode>(N)->getAlign() < 4;
472 def non_word_alignedstore : PatFrag<(ops node:$val, node:$ptr),
473 (store node:$val, node:$ptr), [{
474 return cast<StoreSDNode>(N)->getAlign() < 4;
477 //===----------------------------------------------------------------------===//
478 // NEON-specific DAG Nodes.
479 //===----------------------------------------------------------------------===//
481 def SDTARMVTST : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisSameAs<1, 2>]>;
482 def NEONvtst : SDNode<"ARMISD::VTST", SDTARMVTST>;
484 // Types for vector shift by immediates. The "SHX" version is for long and
485 // narrow operations where the source and destination vectors have different
486 // types. The "SHINS" version is for shift and insert operations.
487 def SDTARMVSHXIMM : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisInt<1>,
489 def SDTARMVSHINSIMM : SDTypeProfile<1, 3, [SDTCisInt<0>, SDTCisSameAs<0, 1>,
490 SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>;
492 def NEONvshrnImm : SDNode<"ARMISD::VSHRNIMM", SDTARMVSHXIMM>;
494 def NEONvrshrsImm : SDNode<"ARMISD::VRSHRsIMM", SDTARMVSHIMM>;
495 def NEONvrshruImm : SDNode<"ARMISD::VRSHRuIMM", SDTARMVSHIMM>;
496 def NEONvrshrnImm : SDNode<"ARMISD::VRSHRNIMM", SDTARMVSHXIMM>;
498 def NEONvqshlsImm : SDNode<"ARMISD::VQSHLsIMM", SDTARMVSHIMM>;
499 def NEONvqshluImm : SDNode<"ARMISD::VQSHLuIMM", SDTARMVSHIMM>;
500 def NEONvqshlsuImm : SDNode<"ARMISD::VQSHLsuIMM", SDTARMVSHIMM>;
501 def NEONvqshrnsImm : SDNode<"ARMISD::VQSHRNsIMM", SDTARMVSHXIMM>;
502 def NEONvqshrnuImm : SDNode<"ARMISD::VQSHRNuIMM", SDTARMVSHXIMM>;
503 def NEONvqshrnsuImm : SDNode<"ARMISD::VQSHRNsuIMM", SDTARMVSHXIMM>;
505 def NEONvqrshrnsImm : SDNode<"ARMISD::VQRSHRNsIMM", SDTARMVSHXIMM>;
506 def NEONvqrshrnuImm : SDNode<"ARMISD::VQRSHRNuIMM", SDTARMVSHXIMM>;
507 def NEONvqrshrnsuImm : SDNode<"ARMISD::VQRSHRNsuIMM", SDTARMVSHXIMM>;
509 def NEONvsliImm : SDNode<"ARMISD::VSLIIMM", SDTARMVSHINSIMM>;
510 def NEONvsriImm : SDNode<"ARMISD::VSRIIMM", SDTARMVSHINSIMM>;
512 def NEONvbsp : SDNode<"ARMISD::VBSP",
513 SDTypeProfile<1, 3, [SDTCisVec<0>,
516 SDTCisSameAs<0, 3>]>>;
518 def SDTARMVEXT : SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0, 1>,
519 SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>;
520 def NEONvext : SDNode<"ARMISD::VEXT", SDTARMVEXT>;
522 def SDTARMVSHUF2 : SDTypeProfile<2, 2, [SDTCisVec<0>, SDTCisSameAs<0, 1>,
524 SDTCisSameAs<0, 3>]>;
525 def NEONzip : SDNode<"ARMISD::VZIP", SDTARMVSHUF2>;
526 def NEONuzp : SDNode<"ARMISD::VUZP", SDTARMVSHUF2>;
527 def NEONtrn : SDNode<"ARMISD::VTRN", SDTARMVSHUF2>;
529 def SDTARMVTBL1 : SDTypeProfile<1, 2, [SDTCisVT<0, v8i8>, SDTCisVT<1, v8i8>,
531 def SDTARMVTBL2 : SDTypeProfile<1, 3, [SDTCisVT<0, v8i8>, SDTCisVT<1, v8i8>,
532 SDTCisVT<2, v8i8>, SDTCisVT<3, v8i8>]>;
533 def NEONvtbl1 : SDNode<"ARMISD::VTBL1", SDTARMVTBL1>;
534 def NEONvtbl2 : SDNode<"ARMISD::VTBL2", SDTARMVTBL2>;
537 //===----------------------------------------------------------------------===//
538 // NEON load / store instructions
539 //===----------------------------------------------------------------------===//
541 // Use VLDM to load a Q register as a D register pair.
542 // This is a pseudo instruction that is expanded to VLDMD after reg alloc.
544 : PseudoVFPLdStM<(outs DPair:$dst), (ins GPR:$Rn),
546 [(set DPair:$dst, (v2f64 (word_alignedload GPR:$Rn)))]>;
548 // Use VSTM to store a Q register as a D register pair.
549 // This is a pseudo instruction that is expanded to VSTMD after reg alloc.
551 : PseudoVFPLdStM<(outs), (ins DPair:$src, GPR:$Rn),
553 [(word_alignedstore (v2f64 DPair:$src), GPR:$Rn)]>;
555 // Classes for VLD* pseudo-instructions with multi-register operands.
556 // These are expanded to real instructions after register allocation.
557 class VLDQPseudo<InstrItinClass itin>
558 : PseudoNLdSt<(outs QPR:$dst), (ins addrmode6:$addr), itin, "">;
559 class VLDQWBPseudo<InstrItinClass itin>
560 : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
561 (ins addrmode6:$addr, am6offset:$offset), itin,
563 class VLDQWBfixedPseudo<InstrItinClass itin>
564 : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
565 (ins addrmode6:$addr), itin,
567 class VLDQWBregisterPseudo<InstrItinClass itin>
568 : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
569 (ins addrmode6:$addr, rGPR:$offset), itin,
572 class VLDQQPseudo<InstrItinClass itin>
573 : PseudoNLdSt<(outs QQPR:$dst), (ins addrmode6:$addr), itin, "">;
574 class VLDQQWBPseudo<InstrItinClass itin>
575 : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
576 (ins addrmode6:$addr, am6offset:$offset), itin,
578 class VLDQQWBfixedPseudo<InstrItinClass itin>
579 : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
580 (ins addrmode6:$addr), itin,
582 class VLDQQWBregisterPseudo<InstrItinClass itin>
583 : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
584 (ins addrmode6:$addr, rGPR:$offset), itin,
588 class VLDQQQQPseudo<InstrItinClass itin>
589 : PseudoNLdSt<(outs QQQQPR:$dst), (ins addrmode6:$addr, QQQQPR:$src),itin,
591 class VLDQQQQWBPseudo<InstrItinClass itin>
592 : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
593 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
594 "$addr.addr = $wb, $src = $dst">;
596 let mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1 in {
598 // VLD1 : Vector Load (multiple single elements)
599 class VLD1D<bits<4> op7_4, string Dt, Operand AddrMode>
600 : NLdSt<0,0b10,0b0111,op7_4, (outs VecListOneD:$Vd),
601 (ins AddrMode:$Rn), IIC_VLD1,
602 "vld1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVLD1]> {
605 let DecoderMethod = "DecodeVLDST1Instruction";
607 class VLD1Q<bits<4> op7_4, string Dt, Operand AddrMode>
608 : NLdSt<0,0b10,0b1010,op7_4, (outs VecListDPair:$Vd),
609 (ins AddrMode:$Rn), IIC_VLD1x2,
610 "vld1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVLD2]> {
612 let Inst{5-4} = Rn{5-4};
613 let DecoderMethod = "DecodeVLDST1Instruction";
616 def VLD1d8 : VLD1D<{0,0,0,?}, "8", addrmode6align64>;
617 def VLD1d16 : VLD1D<{0,1,0,?}, "16", addrmode6align64>;
618 def VLD1d32 : VLD1D<{1,0,0,?}, "32", addrmode6align64>;
619 def VLD1d64 : VLD1D<{1,1,0,?}, "64", addrmode6align64>;
621 def VLD1q8 : VLD1Q<{0,0,?,?}, "8", addrmode6align64or128>;
622 def VLD1q16 : VLD1Q<{0,1,?,?}, "16", addrmode6align64or128>;
623 def VLD1q32 : VLD1Q<{1,0,?,?}, "32", addrmode6align64or128>;
624 def VLD1q64 : VLD1Q<{1,1,?,?}, "64", addrmode6align64or128>;
626 // ...with address register writeback:
627 multiclass VLD1DWB<bits<4> op7_4, string Dt, Operand AddrMode> {
628 def _fixed : NLdSt<0,0b10, 0b0111,op7_4, (outs VecListOneD:$Vd, GPR:$wb),
629 (ins AddrMode:$Rn), IIC_VLD1u,
630 "vld1", Dt, "$Vd, $Rn!",
631 "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
632 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
634 let DecoderMethod = "DecodeVLDST1Instruction";
636 def _register : NLdSt<0,0b10,0b0111,op7_4, (outs VecListOneD:$Vd, GPR:$wb),
637 (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1u,
638 "vld1", Dt, "$Vd, $Rn, $Rm",
639 "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
641 let DecoderMethod = "DecodeVLDST1Instruction";
644 multiclass VLD1QWB<bits<4> op7_4, string Dt, Operand AddrMode> {
645 def _fixed : NLdSt<0,0b10,0b1010,op7_4, (outs VecListDPair:$Vd, GPR:$wb),
646 (ins AddrMode:$Rn), IIC_VLD1x2u,
647 "vld1", Dt, "$Vd, $Rn!",
648 "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
649 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
650 let Inst{5-4} = Rn{5-4};
651 let DecoderMethod = "DecodeVLDST1Instruction";
653 def _register : NLdSt<0,0b10,0b1010,op7_4, (outs VecListDPair:$Vd, GPR:$wb),
654 (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1x2u,
655 "vld1", Dt, "$Vd, $Rn, $Rm",
656 "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
657 let Inst{5-4} = Rn{5-4};
658 let DecoderMethod = "DecodeVLDST1Instruction";
662 defm VLD1d8wb : VLD1DWB<{0,0,0,?}, "8", addrmode6align64>;
663 defm VLD1d16wb : VLD1DWB<{0,1,0,?}, "16", addrmode6align64>;
664 defm VLD1d32wb : VLD1DWB<{1,0,0,?}, "32", addrmode6align64>;
665 defm VLD1d64wb : VLD1DWB<{1,1,0,?}, "64", addrmode6align64>;
666 defm VLD1q8wb : VLD1QWB<{0,0,?,?}, "8", addrmode6align64or128>;
667 defm VLD1q16wb : VLD1QWB<{0,1,?,?}, "16", addrmode6align64or128>;
668 defm VLD1q32wb : VLD1QWB<{1,0,?,?}, "32", addrmode6align64or128>;
669 defm VLD1q64wb : VLD1QWB<{1,1,?,?}, "64", addrmode6align64or128>;
671 // ...with 3 registers
672 class VLD1D3<bits<4> op7_4, string Dt, Operand AddrMode>
673 : NLdSt<0,0b10,0b0110,op7_4, (outs VecListThreeD:$Vd),
674 (ins AddrMode:$Rn), IIC_VLD1x3, "vld1", Dt,
675 "$Vd, $Rn", "", []>, Sched<[WriteVLD3]> {
678 let DecoderMethod = "DecodeVLDST1Instruction";
680 multiclass VLD1D3WB<bits<4> op7_4, string Dt, Operand AddrMode> {
681 def _fixed : NLdSt<0,0b10,0b0110, op7_4, (outs VecListThreeD:$Vd, GPR:$wb),
682 (ins AddrMode:$Rn), IIC_VLD1x2u,
683 "vld1", Dt, "$Vd, $Rn!",
684 "$Rn.addr = $wb", []>, Sched<[WriteVLD3]> {
685 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
687 let DecoderMethod = "DecodeVLDST1Instruction";
689 def _register : NLdSt<0,0b10,0b0110,op7_4, (outs VecListThreeD:$Vd, GPR:$wb),
690 (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1x2u,
691 "vld1", Dt, "$Vd, $Rn, $Rm",
692 "$Rn.addr = $wb", []>, Sched<[WriteVLD3]> {
694 let DecoderMethod = "DecodeVLDST1Instruction";
698 def VLD1d8T : VLD1D3<{0,0,0,?}, "8", addrmode6align64>;
699 def VLD1d16T : VLD1D3<{0,1,0,?}, "16", addrmode6align64>;
700 def VLD1d32T : VLD1D3<{1,0,0,?}, "32", addrmode6align64>;
701 def VLD1d64T : VLD1D3<{1,1,0,?}, "64", addrmode6align64>;
703 defm VLD1d8Twb : VLD1D3WB<{0,0,0,?}, "8", addrmode6align64>;
704 defm VLD1d16Twb : VLD1D3WB<{0,1,0,?}, "16", addrmode6align64>;
705 defm VLD1d32Twb : VLD1D3WB<{1,0,0,?}, "32", addrmode6align64>;
706 defm VLD1d64Twb : VLD1D3WB<{1,1,0,?}, "64", addrmode6align64>;
708 def VLD1d8TPseudo : VLDQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
709 def VLD1d8TPseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
710 def VLD1d8TPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
711 def VLD1d16TPseudo : VLDQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
712 def VLD1d16TPseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
713 def VLD1d16TPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
714 def VLD1d32TPseudo : VLDQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
715 def VLD1d32TPseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
716 def VLD1d32TPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
717 def VLD1d64TPseudo : VLDQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
718 def VLD1d64TPseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
719 def VLD1d64TPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
721 def VLD1q8HighTPseudo : VLDQQQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
722 def VLD1q8HighTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
723 def VLD1q8LowTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
724 def VLD1q16HighTPseudo : VLDQQQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
725 def VLD1q16HighTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
726 def VLD1q16LowTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
727 def VLD1q32HighTPseudo : VLDQQQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
728 def VLD1q32HighTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
729 def VLD1q32LowTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
730 def VLD1q64HighTPseudo : VLDQQQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
731 def VLD1q64HighTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
732 def VLD1q64LowTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
734 // ...with 4 registers
735 class VLD1D4<bits<4> op7_4, string Dt, Operand AddrMode>
736 : NLdSt<0, 0b10, 0b0010, op7_4, (outs VecListFourD:$Vd),
737 (ins AddrMode:$Rn), IIC_VLD1x4, "vld1", Dt,
738 "$Vd, $Rn", "", []>, Sched<[WriteVLD4]> {
740 let Inst{5-4} = Rn{5-4};
741 let DecoderMethod = "DecodeVLDST1Instruction";
743 multiclass VLD1D4WB<bits<4> op7_4, string Dt, Operand AddrMode> {
744 def _fixed : NLdSt<0,0b10,0b0010, op7_4, (outs VecListFourD:$Vd, GPR:$wb),
745 (ins AddrMode:$Rn), IIC_VLD1x2u,
746 "vld1", Dt, "$Vd, $Rn!",
747 "$Rn.addr = $wb", []>, Sched<[WriteVLD4]> {
748 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
749 let Inst{5-4} = Rn{5-4};
750 let DecoderMethod = "DecodeVLDST1Instruction";
752 def _register : NLdSt<0,0b10,0b0010,op7_4, (outs VecListFourD:$Vd, GPR:$wb),
753 (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1x2u,
754 "vld1", Dt, "$Vd, $Rn, $Rm",
755 "$Rn.addr = $wb", []>, Sched<[WriteVLD4]> {
756 let Inst{5-4} = Rn{5-4};
757 let DecoderMethod = "DecodeVLDST1Instruction";
761 def VLD1d8Q : VLD1D4<{0,0,?,?}, "8", addrmode6align64or128or256>;
762 def VLD1d16Q : VLD1D4<{0,1,?,?}, "16", addrmode6align64or128or256>;
763 def VLD1d32Q : VLD1D4<{1,0,?,?}, "32", addrmode6align64or128or256>;
764 def VLD1d64Q : VLD1D4<{1,1,?,?}, "64", addrmode6align64or128or256>;
766 defm VLD1d8Qwb : VLD1D4WB<{0,0,?,?}, "8", addrmode6align64or128or256>;
767 defm VLD1d16Qwb : VLD1D4WB<{0,1,?,?}, "16", addrmode6align64or128or256>;
768 defm VLD1d32Qwb : VLD1D4WB<{1,0,?,?}, "32", addrmode6align64or128or256>;
769 defm VLD1d64Qwb : VLD1D4WB<{1,1,?,?}, "64", addrmode6align64or128or256>;
771 def VLD1d8QPseudo : VLDQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
772 def VLD1d8QPseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
773 def VLD1d8QPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
774 def VLD1d16QPseudo : VLDQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
775 def VLD1d16QPseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
776 def VLD1d16QPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
777 def VLD1d32QPseudo : VLDQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
778 def VLD1d32QPseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
779 def VLD1d32QPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
780 def VLD1d64QPseudo : VLDQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
781 def VLD1d64QPseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
782 def VLD1d64QPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
784 def VLD1q8LowQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
785 def VLD1q8HighQPseudo : VLDQQQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
786 def VLD1q8HighQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
787 def VLD1q16LowQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
788 def VLD1q16HighQPseudo : VLDQQQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
789 def VLD1q16HighQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
790 def VLD1q32LowQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
791 def VLD1q32HighQPseudo : VLDQQQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
792 def VLD1q32HighQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
793 def VLD1q64LowQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
794 def VLD1q64HighQPseudo : VLDQQQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
795 def VLD1q64HighQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
797 // VLD2 : Vector Load (multiple 2-element structures)
798 class VLD2<bits<4> op11_8, bits<4> op7_4, string Dt, RegisterOperand VdTy,
799 InstrItinClass itin, Operand AddrMode>
800 : NLdSt<0, 0b10, op11_8, op7_4, (outs VdTy:$Vd),
801 (ins AddrMode:$Rn), itin,
802 "vld2", Dt, "$Vd, $Rn", "", []> {
804 let Inst{5-4} = Rn{5-4};
805 let DecoderMethod = "DecodeVLDST2Instruction";
808 def VLD2d8 : VLD2<0b1000, {0,0,?,?}, "8", VecListDPair, IIC_VLD2,
809 addrmode6align64or128>, Sched<[WriteVLD2]>;
810 def VLD2d16 : VLD2<0b1000, {0,1,?,?}, "16", VecListDPair, IIC_VLD2,
811 addrmode6align64or128>, Sched<[WriteVLD2]>;
812 def VLD2d32 : VLD2<0b1000, {1,0,?,?}, "32", VecListDPair, IIC_VLD2,
813 addrmode6align64or128>, Sched<[WriteVLD2]>;
815 def VLD2q8 : VLD2<0b0011, {0,0,?,?}, "8", VecListFourD, IIC_VLD2x2,
816 addrmode6align64or128or256>, Sched<[WriteVLD4]>;
817 def VLD2q16 : VLD2<0b0011, {0,1,?,?}, "16", VecListFourD, IIC_VLD2x2,
818 addrmode6align64or128or256>, Sched<[WriteVLD4]>;
819 def VLD2q32 : VLD2<0b0011, {1,0,?,?}, "32", VecListFourD, IIC_VLD2x2,
820 addrmode6align64or128or256>, Sched<[WriteVLD4]>;
822 def VLD2q8Pseudo : VLDQQPseudo<IIC_VLD2x2>, Sched<[WriteVLD4]>;
823 def VLD2q16Pseudo : VLDQQPseudo<IIC_VLD2x2>, Sched<[WriteVLD4]>;
824 def VLD2q32Pseudo : VLDQQPseudo<IIC_VLD2x2>, Sched<[WriteVLD4]>;
826 // ...with address register writeback:
827 multiclass VLD2WB<bits<4> op11_8, bits<4> op7_4, string Dt,
828 RegisterOperand VdTy, InstrItinClass itin, Operand AddrMode> {
829 def _fixed : NLdSt<0, 0b10, op11_8, op7_4, (outs VdTy:$Vd, GPR:$wb),
830 (ins AddrMode:$Rn), itin,
831 "vld2", Dt, "$Vd, $Rn!",
832 "$Rn.addr = $wb", []> {
833 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
834 let Inst{5-4} = Rn{5-4};
835 let DecoderMethod = "DecodeVLDST2Instruction";
837 def _register : NLdSt<0, 0b10, op11_8, op7_4, (outs VdTy:$Vd, GPR:$wb),
838 (ins AddrMode:$Rn, rGPR:$Rm), itin,
839 "vld2", Dt, "$Vd, $Rn, $Rm",
840 "$Rn.addr = $wb", []> {
841 let Inst{5-4} = Rn{5-4};
842 let DecoderMethod = "DecodeVLDST2Instruction";
846 defm VLD2d8wb : VLD2WB<0b1000, {0,0,?,?}, "8", VecListDPair, IIC_VLD2u,
847 addrmode6align64or128>, Sched<[WriteVLD2]>;
848 defm VLD2d16wb : VLD2WB<0b1000, {0,1,?,?}, "16", VecListDPair, IIC_VLD2u,
849 addrmode6align64or128>, Sched<[WriteVLD2]>;
850 defm VLD2d32wb : VLD2WB<0b1000, {1,0,?,?}, "32", VecListDPair, IIC_VLD2u,
851 addrmode6align64or128>, Sched<[WriteVLD2]>;
853 defm VLD2q8wb : VLD2WB<0b0011, {0,0,?,?}, "8", VecListFourD, IIC_VLD2x2u,
854 addrmode6align64or128or256>, Sched<[WriteVLD4]>;
855 defm VLD2q16wb : VLD2WB<0b0011, {0,1,?,?}, "16", VecListFourD, IIC_VLD2x2u,
856 addrmode6align64or128or256>, Sched<[WriteVLD4]>;
857 defm VLD2q32wb : VLD2WB<0b0011, {1,0,?,?}, "32", VecListFourD, IIC_VLD2x2u,
858 addrmode6align64or128or256>, Sched<[WriteVLD4]>;
860 def VLD2q8PseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
861 def VLD2q16PseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
862 def VLD2q32PseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
863 def VLD2q8PseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
864 def VLD2q16PseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
865 def VLD2q32PseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
867 // ...with double-spaced registers
868 def VLD2b8 : VLD2<0b1001, {0,0,?,?}, "8", VecListDPairSpaced, IIC_VLD2,
869 addrmode6align64or128>, Sched<[WriteVLD2]>;
870 def VLD2b16 : VLD2<0b1001, {0,1,?,?}, "16", VecListDPairSpaced, IIC_VLD2,
871 addrmode6align64or128>, Sched<[WriteVLD2]>;
872 def VLD2b32 : VLD2<0b1001, {1,0,?,?}, "32", VecListDPairSpaced, IIC_VLD2,
873 addrmode6align64or128>, Sched<[WriteVLD2]>;
874 defm VLD2b8wb : VLD2WB<0b1001, {0,0,?,?}, "8", VecListDPairSpaced, IIC_VLD2u,
875 addrmode6align64or128>, Sched<[WriteVLD2]>;
876 defm VLD2b16wb : VLD2WB<0b1001, {0,1,?,?}, "16", VecListDPairSpaced, IIC_VLD2u,
877 addrmode6align64or128>, Sched<[WriteVLD2]>;
878 defm VLD2b32wb : VLD2WB<0b1001, {1,0,?,?}, "32", VecListDPairSpaced, IIC_VLD2u,
879 addrmode6align64or128>, Sched<[WriteVLD2]>;
881 // VLD3 : Vector Load (multiple 3-element structures)
882 class VLD3D<bits<4> op11_8, bits<4> op7_4, string Dt>
883 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
884 (ins addrmode6:$Rn), IIC_VLD3,
885 "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn", "", []>, Sched<[WriteVLD3]> {
888 let DecoderMethod = "DecodeVLDST3Instruction";
891 def VLD3d8 : VLD3D<0b0100, {0,0,0,?}, "8">;
892 def VLD3d16 : VLD3D<0b0100, {0,1,0,?}, "16">;
893 def VLD3d32 : VLD3D<0b0100, {1,0,0,?}, "32">;
895 def VLD3d8Pseudo : VLDQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
896 def VLD3d16Pseudo : VLDQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
897 def VLD3d32Pseudo : VLDQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
899 // ...with address register writeback:
900 class VLD3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
901 : NLdSt<0, 0b10, op11_8, op7_4,
902 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
903 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD3u,
904 "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn$Rm",
905 "$Rn.addr = $wb", []>, Sched<[WriteVLD3]> {
907 let DecoderMethod = "DecodeVLDST3Instruction";
910 def VLD3d8_UPD : VLD3DWB<0b0100, {0,0,0,?}, "8">;
911 def VLD3d16_UPD : VLD3DWB<0b0100, {0,1,0,?}, "16">;
912 def VLD3d32_UPD : VLD3DWB<0b0100, {1,0,0,?}, "32">;
914 def VLD3d8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
915 def VLD3d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
916 def VLD3d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
918 // ...with double-spaced registers:
919 def VLD3q8 : VLD3D<0b0101, {0,0,0,?}, "8">;
920 def VLD3q16 : VLD3D<0b0101, {0,1,0,?}, "16">;
921 def VLD3q32 : VLD3D<0b0101, {1,0,0,?}, "32">;
922 def VLD3q8_UPD : VLD3DWB<0b0101, {0,0,0,?}, "8">;
923 def VLD3q16_UPD : VLD3DWB<0b0101, {0,1,0,?}, "16">;
924 def VLD3q32_UPD : VLD3DWB<0b0101, {1,0,0,?}, "32">;
926 def VLD3q8Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
927 def VLD3q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
928 def VLD3q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
930 // ...alternate versions to be allocated odd register numbers:
931 def VLD3q8oddPseudo : VLDQQQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
932 def VLD3q16oddPseudo : VLDQQQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
933 def VLD3q32oddPseudo : VLDQQQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
935 def VLD3q8oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
936 def VLD3q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
937 def VLD3q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
939 // VLD4 : Vector Load (multiple 4-element structures)
940 class VLD4D<bits<4> op11_8, bits<4> op7_4, string Dt>
941 : NLdSt<0, 0b10, op11_8, op7_4,
942 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
943 (ins addrmode6:$Rn), IIC_VLD4,
944 "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []>,
947 let Inst{5-4} = Rn{5-4};
948 let DecoderMethod = "DecodeVLDST4Instruction";
951 def VLD4d8 : VLD4D<0b0000, {0,0,?,?}, "8">;
952 def VLD4d16 : VLD4D<0b0000, {0,1,?,?}, "16">;
953 def VLD4d32 : VLD4D<0b0000, {1,0,?,?}, "32">;
955 def VLD4d8Pseudo : VLDQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
956 def VLD4d16Pseudo : VLDQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
957 def VLD4d32Pseudo : VLDQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
959 // ...with address register writeback:
960 class VLD4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
961 : NLdSt<0, 0b10, op11_8, op7_4,
962 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
963 (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD4u,
964 "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm",
965 "$Rn.addr = $wb", []>, Sched<[WriteVLD4]> {
966 let Inst{5-4} = Rn{5-4};
967 let DecoderMethod = "DecodeVLDST4Instruction";
970 def VLD4d8_UPD : VLD4DWB<0b0000, {0,0,?,?}, "8">;
971 def VLD4d16_UPD : VLD4DWB<0b0000, {0,1,?,?}, "16">;
972 def VLD4d32_UPD : VLD4DWB<0b0000, {1,0,?,?}, "32">;
974 def VLD4d8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
975 def VLD4d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
976 def VLD4d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
978 // ...with double-spaced registers:
979 def VLD4q8 : VLD4D<0b0001, {0,0,?,?}, "8">;
980 def VLD4q16 : VLD4D<0b0001, {0,1,?,?}, "16">;
981 def VLD4q32 : VLD4D<0b0001, {1,0,?,?}, "32">;
982 def VLD4q8_UPD : VLD4DWB<0b0001, {0,0,?,?}, "8">;
983 def VLD4q16_UPD : VLD4DWB<0b0001, {0,1,?,?}, "16">;
984 def VLD4q32_UPD : VLD4DWB<0b0001, {1,0,?,?}, "32">;
986 def VLD4q8Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
987 def VLD4q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
988 def VLD4q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
990 // ...alternate versions to be allocated odd register numbers:
991 def VLD4q8oddPseudo : VLDQQQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
992 def VLD4q16oddPseudo : VLDQQQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
993 def VLD4q32oddPseudo : VLDQQQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
995 def VLD4q8oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
996 def VLD4q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
997 def VLD4q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
999 } // mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1
1001 // Classes for VLD*LN pseudo-instructions with multi-register operands.
1002 // These are expanded to real instructions after register allocation.
1003 class VLDQLNPseudo<InstrItinClass itin>
1004 : PseudoNLdSt<(outs QPR:$dst),
1005 (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
1006 itin, "$src = $dst">;
1007 class VLDQLNWBPseudo<InstrItinClass itin>
1008 : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
1009 (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
1010 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
1011 class VLDQQLNPseudo<InstrItinClass itin>
1012 : PseudoNLdSt<(outs QQPR:$dst),
1013 (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
1014 itin, "$src = $dst">;
1015 class VLDQQLNWBPseudo<InstrItinClass itin>
1016 : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
1017 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
1018 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
1019 class VLDQQQQLNPseudo<InstrItinClass itin>
1020 : PseudoNLdSt<(outs QQQQPR:$dst),
1021 (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
1022 itin, "$src = $dst">;
1023 class VLDQQQQLNWBPseudo<InstrItinClass itin>
1024 : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
1025 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
1026 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
1028 // VLD1LN : Vector Load (single element to one lane)
1029 class VLD1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
1031 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd),
1032 (ins addrmode6:$Rn, DPR:$src, nohash_imm:$lane),
1033 IIC_VLD1ln, "vld1", Dt, "\\{$Vd[$lane]\\}, $Rn",
1035 [(set DPR:$Vd, (vector_insert (Ty DPR:$src),
1036 (i32 (LoadOp addrmode6:$Rn)),
1039 let DecoderMethod = "DecodeVLD1LN";
1041 class VLD1LN32<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
1043 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd),
1044 (ins addrmode6oneL32:$Rn, DPR:$src, nohash_imm:$lane),
1045 IIC_VLD1ln, "vld1", Dt, "\\{$Vd[$lane]\\}, $Rn",
1047 [(set DPR:$Vd, (vector_insert (Ty DPR:$src),
1048 (i32 (LoadOp addrmode6oneL32:$Rn)),
1049 imm:$lane))]>, Sched<[WriteVLD1]> {
1051 let DecoderMethod = "DecodeVLD1LN";
1053 class VLD1QLNPseudo<ValueType Ty, PatFrag LoadOp> : VLDQLNPseudo<IIC_VLD1ln>,
1054 Sched<[WriteVLD1]> {
1055 let Pattern = [(set QPR:$dst, (vector_insert (Ty QPR:$src),
1056 (i32 (LoadOp addrmode6:$addr)),
1060 def VLD1LNd8 : VLD1LN<0b0000, {?,?,?,0}, "8", v8i8, extloadi8> {
1061 let Inst{7-5} = lane{2-0};
1063 def VLD1LNd16 : VLD1LN<0b0100, {?,?,0,?}, "16", v4i16, extloadi16> {
1064 let Inst{7-6} = lane{1-0};
1065 let Inst{5-4} = Rn{5-4};
1067 def VLD1LNd32 : VLD1LN32<0b1000, {?,0,?,?}, "32", v2i32, load> {
1068 let Inst{7} = lane{0};
1069 let Inst{5-4} = Rn{5-4};
1072 def VLD1LNq8Pseudo : VLD1QLNPseudo<v16i8, extloadi8>;
1073 def VLD1LNq16Pseudo : VLD1QLNPseudo<v8i16, extloadi16>;
1074 def VLD1LNq32Pseudo : VLD1QLNPseudo<v4i32, load>;
1076 let Predicates = [HasNEON] in {
1077 def : Pat<(vector_insert (v4f16 DPR:$src),
1078 (f16 (load addrmode6:$addr)), imm:$lane),
1079 (VLD1LNd16 addrmode6:$addr, DPR:$src, imm:$lane)>;
1080 def : Pat<(vector_insert (v8f16 QPR:$src),
1081 (f16 (load addrmode6:$addr)), imm:$lane),
1082 (VLD1LNq16Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
1083 def : Pat<(vector_insert (v4bf16 DPR:$src),
1084 (bf16 (load addrmode6:$addr)), imm:$lane),
1085 (VLD1LNd16 addrmode6:$addr, DPR:$src, imm:$lane)>;
1086 def : Pat<(vector_insert (v8bf16 QPR:$src),
1087 (bf16 (load addrmode6:$addr)), imm:$lane),
1088 (VLD1LNq16Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
1089 def : Pat<(vector_insert (v2f32 DPR:$src),
1090 (f32 (load addrmode6:$addr)), imm:$lane),
1091 (VLD1LNd32 addrmode6:$addr, DPR:$src, imm:$lane)>;
1092 def : Pat<(vector_insert (v4f32 QPR:$src),
1093 (f32 (load addrmode6:$addr)), imm:$lane),
1094 (VLD1LNq32Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
1096 // A 64-bit subvector insert to the first 128-bit vector position
1097 // is a subregister copy that needs no instruction.
1098 def : Pat<(insert_subvector undef, (v1i64 DPR:$src), (i32 0)),
1099 (INSERT_SUBREG (v2i64 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
1100 def : Pat<(insert_subvector undef, (v2i32 DPR:$src), (i32 0)),
1101 (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
1102 def : Pat<(insert_subvector undef, (v2f32 DPR:$src), (i32 0)),
1103 (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
1104 def : Pat<(insert_subvector undef, (v4i16 DPR:$src), (i32 0)),
1105 (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
1106 def : Pat<(insert_subvector undef, (v4f16 DPR:$src), (i32 0)),
1107 (INSERT_SUBREG (v8f16 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
1108 def : Pat<(insert_subvector (v16i8 undef), (v8i8 DPR:$src), (i32 0)),
1109 (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
1113 let mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1 in {
1115 // ...with address register writeback:
1116 class VLD1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1117 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, GPR:$wb),
1118 (ins addrmode6:$Rn, am6offset:$Rm,
1119 DPR:$src, nohash_imm:$lane), IIC_VLD1lnu, "vld1", Dt,
1120 "\\{$Vd[$lane]\\}, $Rn$Rm",
1121 "$src = $Vd, $Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
1122 let DecoderMethod = "DecodeVLD1LN";
1125 def VLD1LNd8_UPD : VLD1LNWB<0b0000, {?,?,?,0}, "8"> {
1126 let Inst{7-5} = lane{2-0};
1128 def VLD1LNd16_UPD : VLD1LNWB<0b0100, {?,?,0,?}, "16"> {
1129 let Inst{7-6} = lane{1-0};
1130 let Inst{4} = Rn{4};
1132 def VLD1LNd32_UPD : VLD1LNWB<0b1000, {?,0,?,?}, "32"> {
1133 let Inst{7} = lane{0};
1134 let Inst{5} = Rn{4};
1135 let Inst{4} = Rn{4};
1138 def VLD1LNq8Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>, Sched<[WriteVLD1]>;
1139 def VLD1LNq16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>, Sched<[WriteVLD1]>;
1140 def VLD1LNq32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>, Sched<[WriteVLD1]>;
1142 // VLD2LN : Vector Load (single 2-element structure to one lane)
1143 class VLD2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1144 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2),
1145 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, nohash_imm:$lane),
1146 IIC_VLD2ln, "vld2", Dt, "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn",
1147 "$src1 = $Vd, $src2 = $dst2", []>, Sched<[WriteVLD1]> {
1149 let Inst{4} = Rn{4};
1150 let DecoderMethod = "DecodeVLD2LN";
1153 def VLD2LNd8 : VLD2LN<0b0001, {?,?,?,?}, "8"> {
1154 let Inst{7-5} = lane{2-0};
1156 def VLD2LNd16 : VLD2LN<0b0101, {?,?,0,?}, "16"> {
1157 let Inst{7-6} = lane{1-0};
1159 def VLD2LNd32 : VLD2LN<0b1001, {?,0,0,?}, "32"> {
1160 let Inst{7} = lane{0};
1163 def VLD2LNd8Pseudo : VLDQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
1164 def VLD2LNd16Pseudo : VLDQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
1165 def VLD2LNd32Pseudo : VLDQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
1167 // ...with double-spaced registers:
1168 def VLD2LNq16 : VLD2LN<0b0101, {?,?,1,?}, "16"> {
1169 let Inst{7-6} = lane{1-0};
1171 def VLD2LNq32 : VLD2LN<0b1001, {?,1,0,?}, "32"> {
1172 let Inst{7} = lane{0};
1175 def VLD2LNq16Pseudo : VLDQQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
1176 def VLD2LNq32Pseudo : VLDQQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
1178 // ...with address register writeback:
1179 class VLD2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1180 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
1181 (ins addrmode6:$Rn, am6offset:$Rm,
1182 DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VLD2lnu, "vld2", Dt,
1183 "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn$Rm",
1184 "$src1 = $Vd, $src2 = $dst2, $Rn.addr = $wb", []> {
1185 let Inst{4} = Rn{4};
1186 let DecoderMethod = "DecodeVLD2LN";
1189 def VLD2LNd8_UPD : VLD2LNWB<0b0001, {?,?,?,?}, "8"> {
1190 let Inst{7-5} = lane{2-0};
1192 def VLD2LNd16_UPD : VLD2LNWB<0b0101, {?,?,0,?}, "16"> {
1193 let Inst{7-6} = lane{1-0};
1195 def VLD2LNd32_UPD : VLD2LNWB<0b1001, {?,0,0,?}, "32"> {
1196 let Inst{7} = lane{0};
1199 def VLD2LNd8Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
1200 def VLD2LNd16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
1201 def VLD2LNd32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
1203 def VLD2LNq16_UPD : VLD2LNWB<0b0101, {?,?,1,?}, "16"> {
1204 let Inst{7-6} = lane{1-0};
1206 def VLD2LNq32_UPD : VLD2LNWB<0b1001, {?,1,0,?}, "32"> {
1207 let Inst{7} = lane{0};
1210 def VLD2LNq16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
1211 def VLD2LNq32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
1213 // VLD3LN : Vector Load (single 3-element structure to one lane)
1214 class VLD3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1215 : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
1216 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3,
1217 nohash_imm:$lane), IIC_VLD3ln, "vld3", Dt,
1218 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn",
1219 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3", []>, Sched<[WriteVLD2]> {
1221 let DecoderMethod = "DecodeVLD3LN";
1224 def VLD3LNd8 : VLD3LN<0b0010, {?,?,?,0}, "8"> {
1225 let Inst{7-5} = lane{2-0};
1227 def VLD3LNd16 : VLD3LN<0b0110, {?,?,0,0}, "16"> {
1228 let Inst{7-6} = lane{1-0};
1230 def VLD3LNd32 : VLD3LN<0b1010, {?,0,0,0}, "32"> {
1231 let Inst{7} = lane{0};
1234 def VLD3LNd8Pseudo : VLDQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
1235 def VLD3LNd16Pseudo : VLDQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
1236 def VLD3LNd32Pseudo : VLDQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
1238 // ...with double-spaced registers:
1239 def VLD3LNq16 : VLD3LN<0b0110, {?,?,1,0}, "16"> {
1240 let Inst{7-6} = lane{1-0};
1242 def VLD3LNq32 : VLD3LN<0b1010, {?,1,0,0}, "32"> {
1243 let Inst{7} = lane{0};
1246 def VLD3LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
1247 def VLD3LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
1249 // ...with address register writeback:
1250 class VLD3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1251 : NLdStLn<1, 0b10, op11_8, op7_4,
1252 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
1253 (ins addrmode6:$Rn, am6offset:$Rm,
1254 DPR:$src1, DPR:$src2, DPR:$src3, nohash_imm:$lane),
1255 IIC_VLD3lnu, "vld3", Dt,
1256 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn$Rm",
1257 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $Rn.addr = $wb",
1258 []>, Sched<[WriteVLD2]> {
1259 let DecoderMethod = "DecodeVLD3LN";
1262 def VLD3LNd8_UPD : VLD3LNWB<0b0010, {?,?,?,0}, "8"> {
1263 let Inst{7-5} = lane{2-0};
1265 def VLD3LNd16_UPD : VLD3LNWB<0b0110, {?,?,0,0}, "16"> {
1266 let Inst{7-6} = lane{1-0};
1268 def VLD3LNd32_UPD : VLD3LNWB<0b1010, {?,0,0,0}, "32"> {
1269 let Inst{7} = lane{0};
1272 def VLD3LNd8Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
1273 def VLD3LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
1274 def VLD3LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
1276 def VLD3LNq16_UPD : VLD3LNWB<0b0110, {?,?,1,0}, "16"> {
1277 let Inst{7-6} = lane{1-0};
1279 def VLD3LNq32_UPD : VLD3LNWB<0b1010, {?,1,0,0}, "32"> {
1280 let Inst{7} = lane{0};
1283 def VLD3LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
1284 def VLD3LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
1286 // VLD4LN : Vector Load (single 4-element structure to one lane)
1287 class VLD4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
1288 : NLdStLn<1, 0b10, op11_8, op7_4,
1289 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
1290 (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4,
1291 nohash_imm:$lane), IIC_VLD4ln, "vld4", Dt,
1292 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn",
1293 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4", []>,
1294 Sched<[WriteVLD2]> {
1296 let Inst{4} = Rn{4};
1297 let DecoderMethod = "DecodeVLD4LN";
1300 def VLD4LNd8 : VLD4LN<0b0011, {?,?,?,?}, "8"> {
1301 let Inst{7-5} = lane{2-0};
1303 def VLD4LNd16 : VLD4LN<0b0111, {?,?,0,?}, "16"> {
1304 let Inst{7-6} = lane{1-0};
1306 def VLD4LNd32 : VLD4LN<0b1011, {?,0,?,?}, "32"> {
1307 let Inst{7} = lane{0};
1308 let Inst{5} = Rn{5};
1311 def VLD4LNd8Pseudo : VLDQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
1312 def VLD4LNd16Pseudo : VLDQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
1313 def VLD4LNd32Pseudo : VLDQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
1315 // ...with double-spaced registers:
1316 def VLD4LNq16 : VLD4LN<0b0111, {?,?,1,?}, "16"> {
1317 let Inst{7-6} = lane{1-0};
1319 def VLD4LNq32 : VLD4LN<0b1011, {?,1,?,?}, "32"> {
1320 let Inst{7} = lane{0};
1321 let Inst{5} = Rn{5};
1324 def VLD4LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
1325 def VLD4LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
1327 // ...with address register writeback:
1328 class VLD4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
1329 : NLdStLn<1, 0b10, op11_8, op7_4,
1330 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
1331 (ins addrmode6:$Rn, am6offset:$Rm,
1332 DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
1333 IIC_VLD4lnu, "vld4", Dt,
1334 "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn$Rm",
1335 "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4, $Rn.addr = $wb",
1337 let Inst{4} = Rn{4};
1338 let DecoderMethod = "DecodeVLD4LN" ;
1341 def VLD4LNd8_UPD : VLD4LNWB<0b0011, {?,?,?,?}, "8"> {
1342 let Inst{7-5} = lane{2-0};
1344 def VLD4LNd16_UPD : VLD4LNWB<0b0111, {?,?,0,?}, "16"> {
1345 let Inst{7-6} = lane{1-0};
1347 def VLD4LNd32_UPD : VLD4LNWB<0b1011, {?,0,?,?}, "32"> {
1348 let Inst{7} = lane{0};
1349 let Inst{5} = Rn{5};
1352 def VLD4LNd8Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
1353 def VLD4LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
1354 def VLD4LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
1356 def VLD4LNq16_UPD : VLD4LNWB<0b0111, {?,?,1,?}, "16"> {
1357 let Inst{7-6} = lane{1-0};
1359 def VLD4LNq32_UPD : VLD4LNWB<0b1011, {?,1,?,?}, "32"> {
1360 let Inst{7} = lane{0};
1361 let Inst{5} = Rn{5};
1364 def VLD4LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
1365 def VLD4LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
1367 } // mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1
1369 // VLD1DUP : Vector Load (single element to all lanes)
1370 class VLD1DUP<bits<4> op7_4, string Dt, ValueType Ty, PatFrag LoadOp,
1372 : NLdSt<1, 0b10, 0b1100, op7_4, (outs VecListOneDAllLanes:$Vd),
1374 IIC_VLD1dup, "vld1", Dt, "$Vd, $Rn", "",
1375 [(set VecListOneDAllLanes:$Vd,
1376 (Ty (ARMvdup (i32 (LoadOp AddrMode:$Rn)))))]>,
1377 Sched<[WriteVLD2]> {
1379 let Inst{4} = Rn{4};
1380 let DecoderMethod = "DecodeVLD1DupInstruction";
1382 def VLD1DUPd8 : VLD1DUP<{0,0,0,?}, "8", v8i8, extloadi8,
1383 addrmode6dupalignNone>;
1384 def VLD1DUPd16 : VLD1DUP<{0,1,0,?}, "16", v4i16, extloadi16,
1385 addrmode6dupalign16>;
1386 def VLD1DUPd32 : VLD1DUP<{1,0,0,?}, "32", v2i32, load,
1387 addrmode6dupalign32>;
1389 let Predicates = [HasNEON] in {
1390 def : Pat<(v2f32 (ARMvdup (f32 (load addrmode6dup:$addr)))),
1391 (VLD1DUPd32 addrmode6:$addr)>;
1394 class VLD1QDUP<bits<4> op7_4, string Dt, ValueType Ty, PatFrag LoadOp,
1396 : NLdSt<1, 0b10, 0b1100, op7_4, (outs VecListDPairAllLanes:$Vd),
1397 (ins AddrMode:$Rn), IIC_VLD1dup,
1398 "vld1", Dt, "$Vd, $Rn", "",
1399 [(set VecListDPairAllLanes:$Vd,
1400 (Ty (ARMvdup (i32 (LoadOp AddrMode:$Rn)))))]> {
1402 let Inst{4} = Rn{4};
1403 let DecoderMethod = "DecodeVLD1DupInstruction";
1406 def VLD1DUPq8 : VLD1QDUP<{0,0,1,0}, "8", v16i8, extloadi8,
1407 addrmode6dupalignNone>;
1408 def VLD1DUPq16 : VLD1QDUP<{0,1,1,?}, "16", v8i16, extloadi16,
1409 addrmode6dupalign16>;
1410 def VLD1DUPq32 : VLD1QDUP<{1,0,1,?}, "32", v4i32, load,
1411 addrmode6dupalign32>;
1413 let Predicates = [HasNEON] in {
1414 def : Pat<(v4f32 (ARMvdup (f32 (load addrmode6dup:$addr)))),
1415 (VLD1DUPq32 addrmode6:$addr)>;
1418 let mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1 in {
1419 // ...with address register writeback:
1420 multiclass VLD1DUPWB<bits<4> op7_4, string Dt, Operand AddrMode> {
1421 def _fixed : NLdSt<1, 0b10, 0b1100, op7_4,
1422 (outs VecListOneDAllLanes:$Vd, GPR:$wb),
1423 (ins AddrMode:$Rn), IIC_VLD1dupu,
1424 "vld1", Dt, "$Vd, $Rn!",
1425 "$Rn.addr = $wb", []> {
1426 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1427 let Inst{4} = Rn{4};
1428 let DecoderMethod = "DecodeVLD1DupInstruction";
1430 def _register : NLdSt<1, 0b10, 0b1100, op7_4,
1431 (outs VecListOneDAllLanes:$Vd, GPR:$wb),
1432 (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1dupu,
1433 "vld1", Dt, "$Vd, $Rn, $Rm",
1434 "$Rn.addr = $wb", []> {
1435 let Inst{4} = Rn{4};
1436 let DecoderMethod = "DecodeVLD1DupInstruction";
1439 multiclass VLD1QDUPWB<bits<4> op7_4, string Dt, Operand AddrMode> {
1440 def _fixed : NLdSt<1, 0b10, 0b1100, op7_4,
1441 (outs VecListDPairAllLanes:$Vd, GPR:$wb),
1442 (ins AddrMode:$Rn), IIC_VLD1dupu,
1443 "vld1", Dt, "$Vd, $Rn!",
1444 "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
1445 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1446 let Inst{4} = Rn{4};
1447 let DecoderMethod = "DecodeVLD1DupInstruction";
1449 def _register : NLdSt<1, 0b10, 0b1100, op7_4,
1450 (outs VecListDPairAllLanes:$Vd, GPR:$wb),
1451 (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1dupu,
1452 "vld1", Dt, "$Vd, $Rn, $Rm",
1453 "$Rn.addr = $wb", []> {
1454 let Inst{4} = Rn{4};
1455 let DecoderMethod = "DecodeVLD1DupInstruction";
1459 defm VLD1DUPd8wb : VLD1DUPWB<{0,0,0,0}, "8", addrmode6dupalignNone>;
1460 defm VLD1DUPd16wb : VLD1DUPWB<{0,1,0,?}, "16", addrmode6dupalign16>;
1461 defm VLD1DUPd32wb : VLD1DUPWB<{1,0,0,?}, "32", addrmode6dupalign32>;
1463 defm VLD1DUPq8wb : VLD1QDUPWB<{0,0,1,0}, "8", addrmode6dupalignNone>;
1464 defm VLD1DUPq16wb : VLD1QDUPWB<{0,1,1,?}, "16", addrmode6dupalign16>;
1465 defm VLD1DUPq32wb : VLD1QDUPWB<{1,0,1,?}, "32", addrmode6dupalign32>;
1467 // VLD2DUP : Vector Load (single 2-element structure to all lanes)
1468 class VLD2DUP<bits<4> op7_4, string Dt, RegisterOperand VdTy, Operand AddrMode>
1469 : NLdSt<1, 0b10, 0b1101, op7_4, (outs VdTy:$Vd),
1470 (ins AddrMode:$Rn), IIC_VLD2dup,
1471 "vld2", Dt, "$Vd, $Rn", "", []> {
1473 let Inst{4} = Rn{4};
1474 let DecoderMethod = "DecodeVLD2DupInstruction";
1477 def VLD2DUPd8 : VLD2DUP<{0,0,0,?}, "8", VecListDPairAllLanes,
1478 addrmode6dupalign16>;
1479 def VLD2DUPd16 : VLD2DUP<{0,1,0,?}, "16", VecListDPairAllLanes,
1480 addrmode6dupalign32>;
1481 def VLD2DUPd32 : VLD2DUP<{1,0,0,?}, "32", VecListDPairAllLanes,
1482 addrmode6dupalign64>;
1484 // HACK this one, VLD2DUPd8x2 must be changed at the same time with VLD2b8 or
1485 // "vld2.8 {d0[], d2[]}, [r4:32]" will become "vld2.8 {d0, d2}, [r4:32]".
1486 // ...with double-spaced registers
1487 def VLD2DUPd8x2 : VLD2DUP<{0,0,1,?}, "8", VecListDPairSpacedAllLanes,
1488 addrmode6dupalign16>;
1489 def VLD2DUPd16x2 : VLD2DUP<{0,1,1,?}, "16", VecListDPairSpacedAllLanes,
1490 addrmode6dupalign32>;
1491 def VLD2DUPd32x2 : VLD2DUP<{1,0,1,?}, "32", VecListDPairSpacedAllLanes,
1492 addrmode6dupalign64>;
1494 // Duplicate of VLDQQPseudo but with a constraint variable
1495 // to ensure the odd and even lanes use the same register range
1496 class VLDQQPseudoInputDST<InstrItinClass itin>
1497 : PseudoNLdSt<(outs QQPR:$dst), (ins addrmode6:$addr, QQPR: $src), itin,
1499 class VLDQQWBPseudoInputDST<InstrItinClass itin>
1500 : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
1501 (ins addrmode6:$addr, am6offset:$offset, QQPR: $src), itin,
1502 "$addr.addr = $wb, $src = $dst">;
1503 class VLDQQWBfixedPseudoInputDST<InstrItinClass itin>
1504 : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
1505 (ins addrmode6:$addr, QQPR: $src), itin,
1506 "$addr.addr = $wb, $src = $dst">;
1508 def VLD2DUPq8EvenPseudo : VLDQQPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1509 def VLD2DUPq8OddPseudo : VLDQQPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1510 def VLD2DUPq16EvenPseudo : VLDQQPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1511 def VLD2DUPq16OddPseudo : VLDQQPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1512 def VLD2DUPq32EvenPseudo : VLDQQPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1513 def VLD2DUPq32OddPseudo : VLDQQPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1515 // ...with address register writeback:
1516 multiclass VLD2DUPWB<bits<4> op7_4, string Dt, RegisterOperand VdTy,
1518 def _fixed : NLdSt<1, 0b10, 0b1101, op7_4,
1519 (outs VdTy:$Vd, GPR:$wb),
1520 (ins AddrMode:$Rn), IIC_VLD2dupu,
1521 "vld2", Dt, "$Vd, $Rn!",
1522 "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
1523 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1524 let Inst{4} = Rn{4};
1525 let DecoderMethod = "DecodeVLD2DupInstruction";
1527 def _register : NLdSt<1, 0b10, 0b1101, op7_4,
1528 (outs VdTy:$Vd, GPR:$wb),
1529 (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD2dupu,
1530 "vld2", Dt, "$Vd, $Rn, $Rm",
1531 "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
1532 let Inst{4} = Rn{4};
1533 let DecoderMethod = "DecodeVLD2DupInstruction";
1537 defm VLD2DUPd8wb : VLD2DUPWB<{0,0,0,0}, "8", VecListDPairAllLanes,
1538 addrmode6dupalign16>;
1539 defm VLD2DUPd16wb : VLD2DUPWB<{0,1,0,?}, "16", VecListDPairAllLanes,
1540 addrmode6dupalign32>;
1541 defm VLD2DUPd32wb : VLD2DUPWB<{1,0,0,?}, "32", VecListDPairAllLanes,
1542 addrmode6dupalign64>;
1544 defm VLD2DUPd8x2wb : VLD2DUPWB<{0,0,1,0}, "8", VecListDPairSpacedAllLanes,
1545 addrmode6dupalign16>;
1546 defm VLD2DUPd16x2wb : VLD2DUPWB<{0,1,1,?}, "16", VecListDPairSpacedAllLanes,
1547 addrmode6dupalign32>;
1548 defm VLD2DUPd32x2wb : VLD2DUPWB<{1,0,1,?}, "32", VecListDPairSpacedAllLanes,
1549 addrmode6dupalign64>;
1551 def VLD2DUPq8OddPseudoWB_fixed : VLDQQWBfixedPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1552 def VLD2DUPq16OddPseudoWB_fixed : VLDQQWBfixedPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1553 def VLD2DUPq32OddPseudoWB_fixed : VLDQQWBfixedPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1554 def VLD2DUPq8OddPseudoWB_register : VLDQQWBPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1555 def VLD2DUPq16OddPseudoWB_register : VLDQQWBPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1556 def VLD2DUPq32OddPseudoWB_register : VLDQQWBPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1558 // VLD3DUP : Vector Load (single 3-element structure to all lanes)
1559 class VLD3DUP<bits<4> op7_4, string Dt>
1560 : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
1561 (ins addrmode6dup:$Rn), IIC_VLD3dup,
1562 "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn", "", []>,
1563 Sched<[WriteVLD2]> {
1566 let DecoderMethod = "DecodeVLD3DupInstruction";
1569 def VLD3DUPd8 : VLD3DUP<{0,0,0,?}, "8">;
1570 def VLD3DUPd16 : VLD3DUP<{0,1,0,?}, "16">;
1571 def VLD3DUPd32 : VLD3DUP<{1,0,0,?}, "32">;
1573 def VLD3DUPd8Pseudo : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1574 def VLD3DUPd16Pseudo : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1575 def VLD3DUPd32Pseudo : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1577 // ...with double-spaced registers (not used for codegen):
1578 def VLD3DUPq8 : VLD3DUP<{0,0,1,?}, "8">;
1579 def VLD3DUPq16 : VLD3DUP<{0,1,1,?}, "16">;
1580 def VLD3DUPq32 : VLD3DUP<{1,0,1,?}, "32">;
1582 def VLD3DUPq8EvenPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1583 def VLD3DUPq8OddPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1584 def VLD3DUPq16EvenPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1585 def VLD3DUPq16OddPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1586 def VLD3DUPq32EvenPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1587 def VLD3DUPq32OddPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1589 // ...with address register writeback:
1590 class VLD3DUPWB<bits<4> op7_4, string Dt, Operand AddrMode>
1591 : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
1592 (ins AddrMode:$Rn, am6offset:$Rm), IIC_VLD3dupu,
1593 "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn$Rm",
1594 "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
1596 let DecoderMethod = "DecodeVLD3DupInstruction";
1599 def VLD3DUPd8_UPD : VLD3DUPWB<{0,0,0,0}, "8", addrmode6dupalign64>;
1600 def VLD3DUPd16_UPD : VLD3DUPWB<{0,1,0,?}, "16", addrmode6dupalign64>;
1601 def VLD3DUPd32_UPD : VLD3DUPWB<{1,0,0,?}, "32", addrmode6dupalign64>;
1603 def VLD3DUPq8_UPD : VLD3DUPWB<{0,0,1,0}, "8", addrmode6dupalign64>;
1604 def VLD3DUPq16_UPD : VLD3DUPWB<{0,1,1,?}, "16", addrmode6dupalign64>;
1605 def VLD3DUPq32_UPD : VLD3DUPWB<{1,0,1,?}, "32", addrmode6dupalign64>;
1607 def VLD3DUPd8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1608 def VLD3DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1609 def VLD3DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1611 def VLD3DUPq8OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1612 def VLD3DUPq16OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1613 def VLD3DUPq32OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1615 // VLD4DUP : Vector Load (single 4-element structure to all lanes)
1616 class VLD4DUP<bits<4> op7_4, string Dt>
1617 : NLdSt<1, 0b10, 0b1111, op7_4,
1618 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
1619 (ins addrmode6dup:$Rn), IIC_VLD4dup,
1620 "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn", "", []> {
1622 let Inst{4} = Rn{4};
1623 let DecoderMethod = "DecodeVLD4DupInstruction";
1626 def VLD4DUPd8 : VLD4DUP<{0,0,0,?}, "8">;
1627 def VLD4DUPd16 : VLD4DUP<{0,1,0,?}, "16">;
1628 def VLD4DUPd32 : VLD4DUP<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
1630 def VLD4DUPd8Pseudo : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1631 def VLD4DUPd16Pseudo : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1632 def VLD4DUPd32Pseudo : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1634 // ...with double-spaced registers (not used for codegen):
1635 def VLD4DUPq8 : VLD4DUP<{0,0,1,?}, "8">;
1636 def VLD4DUPq16 : VLD4DUP<{0,1,1,?}, "16">;
1637 def VLD4DUPq32 : VLD4DUP<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
1639 def VLD4DUPq8EvenPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1640 def VLD4DUPq8OddPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1641 def VLD4DUPq16EvenPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1642 def VLD4DUPq16OddPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1643 def VLD4DUPq32EvenPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1644 def VLD4DUPq32OddPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1646 // ...with address register writeback:
1647 class VLD4DUPWB<bits<4> op7_4, string Dt>
1648 : NLdSt<1, 0b10, 0b1111, op7_4,
1649 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
1650 (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD4dupu,
1651 "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn$Rm",
1652 "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
1653 let Inst{4} = Rn{4};
1654 let DecoderMethod = "DecodeVLD4DupInstruction";
1657 def VLD4DUPd8_UPD : VLD4DUPWB<{0,0,0,0}, "8">;
1658 def VLD4DUPd16_UPD : VLD4DUPWB<{0,1,0,?}, "16">;
1659 def VLD4DUPd32_UPD : VLD4DUPWB<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
1661 def VLD4DUPq8_UPD : VLD4DUPWB<{0,0,1,0}, "8">;
1662 def VLD4DUPq16_UPD : VLD4DUPWB<{0,1,1,?}, "16">;
1663 def VLD4DUPq32_UPD : VLD4DUPWB<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
1665 def VLD4DUPd8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1666 def VLD4DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1667 def VLD4DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1669 def VLD4DUPq8OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1670 def VLD4DUPq16OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1671 def VLD4DUPq32OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1673 } // mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1
1675 let mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1 in {
1677 // Classes for VST* pseudo-instructions with multi-register operands.
1678 // These are expanded to real instructions after register allocation.
1679 class VSTQPseudo<InstrItinClass itin>
1680 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src), itin, "">;
1681 class VSTQWBPseudo<InstrItinClass itin>
1682 : PseudoNLdSt<(outs GPR:$wb),
1683 (ins addrmode6:$addr, am6offset:$offset, QPR:$src), itin,
1684 "$addr.addr = $wb">;
1685 class VSTQWBfixedPseudo<InstrItinClass itin>
1686 : PseudoNLdSt<(outs GPR:$wb),
1687 (ins addrmode6:$addr, QPR:$src), itin,
1688 "$addr.addr = $wb">;
1689 class VSTQWBregisterPseudo<InstrItinClass itin>
1690 : PseudoNLdSt<(outs GPR:$wb),
1691 (ins addrmode6:$addr, rGPR:$offset, QPR:$src), itin,
1692 "$addr.addr = $wb">;
1693 class VSTQQPseudo<InstrItinClass itin>
1694 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src), itin, "">;
1695 class VSTQQWBPseudo<InstrItinClass itin>
1696 : PseudoNLdSt<(outs GPR:$wb),
1697 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src), itin,
1698 "$addr.addr = $wb">;
1699 class VSTQQWBfixedPseudo<InstrItinClass itin>
1700 : PseudoNLdSt<(outs GPR:$wb),
1701 (ins addrmode6:$addr, QQPR:$src), itin,
1702 "$addr.addr = $wb">;
1703 class VSTQQWBregisterPseudo<InstrItinClass itin>
1704 : PseudoNLdSt<(outs GPR:$wb),
1705 (ins addrmode6:$addr, rGPR:$offset, QQPR:$src), itin,
1706 "$addr.addr = $wb">;
1708 class VSTQQQQPseudo<InstrItinClass itin>
1709 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src), itin, "">;
1710 class VSTQQQQWBPseudo<InstrItinClass itin>
1711 : PseudoNLdSt<(outs GPR:$wb),
1712 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
1713 "$addr.addr = $wb">;
1715 // VST1 : Vector Store (multiple single elements)
1716 class VST1D<bits<4> op7_4, string Dt, Operand AddrMode>
1717 : NLdSt<0,0b00,0b0111,op7_4, (outs), (ins AddrMode:$Rn, VecListOneD:$Vd),
1718 IIC_VST1, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST1]> {
1720 let Inst{4} = Rn{4};
1721 let DecoderMethod = "DecodeVLDST1Instruction";
1723 class VST1Q<bits<4> op7_4, string Dt, Operand AddrMode>
1724 : NLdSt<0,0b00,0b1010,op7_4, (outs), (ins AddrMode:$Rn, VecListDPair:$Vd),
1725 IIC_VST1x2, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST2]> {
1727 let Inst{5-4} = Rn{5-4};
1728 let DecoderMethod = "DecodeVLDST1Instruction";
1731 def VST1d8 : VST1D<{0,0,0,?}, "8", addrmode6align64>;
1732 def VST1d16 : VST1D<{0,1,0,?}, "16", addrmode6align64>;
1733 def VST1d32 : VST1D<{1,0,0,?}, "32", addrmode6align64>;
1734 def VST1d64 : VST1D<{1,1,0,?}, "64", addrmode6align64>;
1736 def VST1q8 : VST1Q<{0,0,?,?}, "8", addrmode6align64or128>;
1737 def VST1q16 : VST1Q<{0,1,?,?}, "16", addrmode6align64or128>;
1738 def VST1q32 : VST1Q<{1,0,?,?}, "32", addrmode6align64or128>;
1739 def VST1q64 : VST1Q<{1,1,?,?}, "64", addrmode6align64or128>;
1741 // ...with address register writeback:
1742 multiclass VST1DWB<bits<4> op7_4, string Dt, Operand AddrMode> {
1743 def _fixed : NLdSt<0,0b00, 0b0111,op7_4, (outs GPR:$wb),
1744 (ins AddrMode:$Rn, VecListOneD:$Vd), IIC_VLD1u,
1745 "vst1", Dt, "$Vd, $Rn!",
1746 "$Rn.addr = $wb", []>, Sched<[WriteVST1]> {
1747 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1748 let Inst{4} = Rn{4};
1749 let DecoderMethod = "DecodeVLDST1Instruction";
1751 def _register : NLdSt<0,0b00,0b0111,op7_4, (outs GPR:$wb),
1752 (ins AddrMode:$Rn, rGPR:$Rm, VecListOneD:$Vd),
1754 "vst1", Dt, "$Vd, $Rn, $Rm",
1755 "$Rn.addr = $wb", []>, Sched<[WriteVST1]> {
1756 let Inst{4} = Rn{4};
1757 let DecoderMethod = "DecodeVLDST1Instruction";
1760 multiclass VST1QWB<bits<4> op7_4, string Dt, Operand AddrMode> {
1761 def _fixed : NLdSt<0,0b00,0b1010,op7_4, (outs GPR:$wb),
1762 (ins AddrMode:$Rn, VecListDPair:$Vd), IIC_VLD1x2u,
1763 "vst1", Dt, "$Vd, $Rn!",
1764 "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
1765 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1766 let Inst{5-4} = Rn{5-4};
1767 let DecoderMethod = "DecodeVLDST1Instruction";
1769 def _register : NLdSt<0,0b00,0b1010,op7_4, (outs GPR:$wb),
1770 (ins AddrMode:$Rn, rGPR:$Rm, VecListDPair:$Vd),
1772 "vst1", Dt, "$Vd, $Rn, $Rm",
1773 "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
1774 let Inst{5-4} = Rn{5-4};
1775 let DecoderMethod = "DecodeVLDST1Instruction";
1779 defm VST1d8wb : VST1DWB<{0,0,0,?}, "8", addrmode6align64>;
1780 defm VST1d16wb : VST1DWB<{0,1,0,?}, "16", addrmode6align64>;
1781 defm VST1d32wb : VST1DWB<{1,0,0,?}, "32", addrmode6align64>;
1782 defm VST1d64wb : VST1DWB<{1,1,0,?}, "64", addrmode6align64>;
1784 defm VST1q8wb : VST1QWB<{0,0,?,?}, "8", addrmode6align64or128>;
1785 defm VST1q16wb : VST1QWB<{0,1,?,?}, "16", addrmode6align64or128>;
1786 defm VST1q32wb : VST1QWB<{1,0,?,?}, "32", addrmode6align64or128>;
1787 defm VST1q64wb : VST1QWB<{1,1,?,?}, "64", addrmode6align64or128>;
1789 // ...with 3 registers
1790 class VST1D3<bits<4> op7_4, string Dt, Operand AddrMode>
1791 : NLdSt<0, 0b00, 0b0110, op7_4, (outs),
1792 (ins AddrMode:$Rn, VecListThreeD:$Vd),
1793 IIC_VST1x3, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST3]> {
1795 let Inst{4} = Rn{4};
1796 let DecoderMethod = "DecodeVLDST1Instruction";
1798 multiclass VST1D3WB<bits<4> op7_4, string Dt, Operand AddrMode> {
1799 def _fixed : NLdSt<0,0b00,0b0110,op7_4, (outs GPR:$wb),
1800 (ins AddrMode:$Rn, VecListThreeD:$Vd), IIC_VLD1x3u,
1801 "vst1", Dt, "$Vd, $Rn!",
1802 "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
1803 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1804 let Inst{5-4} = Rn{5-4};
1805 let DecoderMethod = "DecodeVLDST1Instruction";
1807 def _register : NLdSt<0,0b00,0b0110,op7_4, (outs GPR:$wb),
1808 (ins AddrMode:$Rn, rGPR:$Rm, VecListThreeD:$Vd),
1810 "vst1", Dt, "$Vd, $Rn, $Rm",
1811 "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
1812 let Inst{5-4} = Rn{5-4};
1813 let DecoderMethod = "DecodeVLDST1Instruction";
1817 def VST1d8T : VST1D3<{0,0,0,?}, "8", addrmode6align64>;
1818 def VST1d16T : VST1D3<{0,1,0,?}, "16", addrmode6align64>;
1819 def VST1d32T : VST1D3<{1,0,0,?}, "32", addrmode6align64>;
1820 def VST1d64T : VST1D3<{1,1,0,?}, "64", addrmode6align64>;
1822 defm VST1d8Twb : VST1D3WB<{0,0,0,?}, "8", addrmode6align64>;
1823 defm VST1d16Twb : VST1D3WB<{0,1,0,?}, "16", addrmode6align64>;
1824 defm VST1d32Twb : VST1D3WB<{1,0,0,?}, "32", addrmode6align64>;
1825 defm VST1d64Twb : VST1D3WB<{1,1,0,?}, "64", addrmode6align64>;
1827 def VST1d8TPseudo : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1828 def VST1d8TPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1829 def VST1d8TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1830 def VST1d16TPseudo : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1831 def VST1d16TPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1832 def VST1d16TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1833 def VST1d32TPseudo : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1834 def VST1d32TPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1835 def VST1d32TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1836 def VST1d64TPseudo : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1837 def VST1d64TPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1838 def VST1d64TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1840 def VST1q8HighTPseudo : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1841 def VST1q16HighTPseudo : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1842 def VST1q32HighTPseudo : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1843 def VST1q64HighTPseudo : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1845 def VST1q8HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1846 def VST1q16HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1847 def VST1q32HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1848 def VST1q64HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1850 def VST1q8LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1851 def VST1q16LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1852 def VST1q32LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1853 def VST1q64LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1855 // ...with 4 registers
1856 class VST1D4<bits<4> op7_4, string Dt, Operand AddrMode>
1857 : NLdSt<0, 0b00, 0b0010, op7_4, (outs),
1858 (ins AddrMode:$Rn, VecListFourD:$Vd),
1859 IIC_VST1x4, "vst1", Dt, "$Vd, $Rn", "",
1860 []>, Sched<[WriteVST4]> {
1862 let Inst{5-4} = Rn{5-4};
1863 let DecoderMethod = "DecodeVLDST1Instruction";
1865 multiclass VST1D4WB<bits<4> op7_4, string Dt, Operand AddrMode> {
1866 def _fixed : NLdSt<0,0b00,0b0010,op7_4, (outs GPR:$wb),
1867 (ins AddrMode:$Rn, VecListFourD:$Vd), IIC_VLD1x4u,
1868 "vst1", Dt, "$Vd, $Rn!",
1869 "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
1870 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1871 let Inst{5-4} = Rn{5-4};
1872 let DecoderMethod = "DecodeVLDST1Instruction";
1874 def _register : NLdSt<0,0b00,0b0010,op7_4, (outs GPR:$wb),
1875 (ins AddrMode:$Rn, rGPR:$Rm, VecListFourD:$Vd),
1877 "vst1", Dt, "$Vd, $Rn, $Rm",
1878 "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
1879 let Inst{5-4} = Rn{5-4};
1880 let DecoderMethod = "DecodeVLDST1Instruction";
1884 def VST1d8Q : VST1D4<{0,0,?,?}, "8", addrmode6align64or128or256>;
1885 def VST1d16Q : VST1D4<{0,1,?,?}, "16", addrmode6align64or128or256>;
1886 def VST1d32Q : VST1D4<{1,0,?,?}, "32", addrmode6align64or128or256>;
1887 def VST1d64Q : VST1D4<{1,1,?,?}, "64", addrmode6align64or128or256>;
1889 defm VST1d8Qwb : VST1D4WB<{0,0,?,?}, "8", addrmode6align64or128or256>;
1890 defm VST1d16Qwb : VST1D4WB<{0,1,?,?}, "16", addrmode6align64or128or256>;
1891 defm VST1d32Qwb : VST1D4WB<{1,0,?,?}, "32", addrmode6align64or128or256>;
1892 defm VST1d64Qwb : VST1D4WB<{1,1,?,?}, "64", addrmode6align64or128or256>;
1894 def VST1d8QPseudo : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1895 def VST1d8QPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1896 def VST1d8QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1897 def VST1d16QPseudo : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1898 def VST1d16QPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1899 def VST1d16QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1900 def VST1d32QPseudo : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1901 def VST1d32QPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1902 def VST1d32QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1903 def VST1d64QPseudo : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1904 def VST1d64QPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1905 def VST1d64QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1907 def VST1q8HighQPseudo : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1908 def VST1q16HighQPseudo : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1909 def VST1q32HighQPseudo : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1910 def VST1q64HighQPseudo : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1912 def VST1q8HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1913 def VST1q16HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1914 def VST1q32HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1915 def VST1q64HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1917 def VST1q8LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1918 def VST1q16LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1919 def VST1q32LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1920 def VST1q64LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1922 // VST2 : Vector Store (multiple 2-element structures)
1923 class VST2<bits<4> op11_8, bits<4> op7_4, string Dt, RegisterOperand VdTy,
1924 InstrItinClass itin, Operand AddrMode>
1925 : NLdSt<0, 0b00, op11_8, op7_4, (outs), (ins AddrMode:$Rn, VdTy:$Vd),
1926 itin, "vst2", Dt, "$Vd, $Rn", "", []> {
1928 let Inst{5-4} = Rn{5-4};
1929 let DecoderMethod = "DecodeVLDST2Instruction";
1932 def VST2d8 : VST2<0b1000, {0,0,?,?}, "8", VecListDPair, IIC_VST2,
1933 addrmode6align64or128>, Sched<[WriteVST2]>;
1934 def VST2d16 : VST2<0b1000, {0,1,?,?}, "16", VecListDPair, IIC_VST2,
1935 addrmode6align64or128>, Sched<[WriteVST2]>;
1936 def VST2d32 : VST2<0b1000, {1,0,?,?}, "32", VecListDPair, IIC_VST2,
1937 addrmode6align64or128>, Sched<[WriteVST2]>;
1939 def VST2q8 : VST2<0b0011, {0,0,?,?}, "8", VecListFourD, IIC_VST2x2,
1940 addrmode6align64or128or256>, Sched<[WriteVST4]>;
1941 def VST2q16 : VST2<0b0011, {0,1,?,?}, "16", VecListFourD, IIC_VST2x2,
1942 addrmode6align64or128or256>, Sched<[WriteVST4]>;
1943 def VST2q32 : VST2<0b0011, {1,0,?,?}, "32", VecListFourD, IIC_VST2x2,
1944 addrmode6align64or128or256>, Sched<[WriteVST4]>;
1946 def VST2q8Pseudo : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
1947 def VST2q16Pseudo : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
1948 def VST2q32Pseudo : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
1950 // ...with address register writeback:
1951 multiclass VST2DWB<bits<4> op11_8, bits<4> op7_4, string Dt,
1952 RegisterOperand VdTy, Operand AddrMode> {
1953 def _fixed : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1954 (ins AddrMode:$Rn, VdTy:$Vd), IIC_VLD1u,
1955 "vst2", Dt, "$Vd, $Rn!",
1956 "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
1957 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1958 let Inst{5-4} = Rn{5-4};
1959 let DecoderMethod = "DecodeVLDST2Instruction";
1961 def _register : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1962 (ins AddrMode:$Rn, rGPR:$Rm, VdTy:$Vd), IIC_VLD1u,
1963 "vst2", Dt, "$Vd, $Rn, $Rm",
1964 "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
1965 let Inst{5-4} = Rn{5-4};
1966 let DecoderMethod = "DecodeVLDST2Instruction";
1969 multiclass VST2QWB<bits<4> op7_4, string Dt, Operand AddrMode> {
1970 def _fixed : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
1971 (ins AddrMode:$Rn, VecListFourD:$Vd), IIC_VLD1u,
1972 "vst2", Dt, "$Vd, $Rn!",
1973 "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
1974 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1975 let Inst{5-4} = Rn{5-4};
1976 let DecoderMethod = "DecodeVLDST2Instruction";
1978 def _register : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
1979 (ins AddrMode:$Rn, rGPR:$Rm, VecListFourD:$Vd),
1981 "vst2", Dt, "$Vd, $Rn, $Rm",
1982 "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
1983 let Inst{5-4} = Rn{5-4};
1984 let DecoderMethod = "DecodeVLDST2Instruction";
1988 defm VST2d8wb : VST2DWB<0b1000, {0,0,?,?}, "8", VecListDPair,
1989 addrmode6align64or128>;
1990 defm VST2d16wb : VST2DWB<0b1000, {0,1,?,?}, "16", VecListDPair,
1991 addrmode6align64or128>;
1992 defm VST2d32wb : VST2DWB<0b1000, {1,0,?,?}, "32", VecListDPair,
1993 addrmode6align64or128>;
1995 defm VST2q8wb : VST2QWB<{0,0,?,?}, "8", addrmode6align64or128or256>;
1996 defm VST2q16wb : VST2QWB<{0,1,?,?}, "16", addrmode6align64or128or256>;
1997 defm VST2q32wb : VST2QWB<{1,0,?,?}, "32", addrmode6align64or128or256>;
1999 def VST2q8PseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
2000 def VST2q16PseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
2001 def VST2q32PseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
2002 def VST2q8PseudoWB_register : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
2003 def VST2q16PseudoWB_register : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
2004 def VST2q32PseudoWB_register : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
2006 // ...with double-spaced registers
2007 def VST2b8 : VST2<0b1001, {0,0,?,?}, "8", VecListDPairSpaced, IIC_VST2,
2008 addrmode6align64or128>;
2009 def VST2b16 : VST2<0b1001, {0,1,?,?}, "16", VecListDPairSpaced, IIC_VST2,
2010 addrmode6align64or128>;
2011 def VST2b32 : VST2<0b1001, {1,0,?,?}, "32", VecListDPairSpaced, IIC_VST2,
2012 addrmode6align64or128>;
2013 defm VST2b8wb : VST2DWB<0b1001, {0,0,?,?}, "8", VecListDPairSpaced,
2014 addrmode6align64or128>;
2015 defm VST2b16wb : VST2DWB<0b1001, {0,1,?,?}, "16", VecListDPairSpaced,
2016 addrmode6align64or128>;
2017 defm VST2b32wb : VST2DWB<0b1001, {1,0,?,?}, "32", VecListDPairSpaced,
2018 addrmode6align64or128>;
2020 // VST3 : Vector Store (multiple 3-element structures)
2021 class VST3D<bits<4> op11_8, bits<4> op7_4, string Dt>
2022 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
2023 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3,
2024 "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn", "", []>, Sched<[WriteVST3]> {
2026 let Inst{4} = Rn{4};
2027 let DecoderMethod = "DecodeVLDST3Instruction";
2030 def VST3d8 : VST3D<0b0100, {0,0,0,?}, "8">;
2031 def VST3d16 : VST3D<0b0100, {0,1,0,?}, "16">;
2032 def VST3d32 : VST3D<0b0100, {1,0,0,?}, "32">;
2034 def VST3d8Pseudo : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
2035 def VST3d16Pseudo : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
2036 def VST3d32Pseudo : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
2038 // ...with address register writeback:
2039 class VST3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
2040 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
2041 (ins addrmode6:$Rn, am6offset:$Rm,
2042 DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3u,
2043 "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn$Rm",
2044 "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
2045 let Inst{4} = Rn{4};
2046 let DecoderMethod = "DecodeVLDST3Instruction";
2049 def VST3d8_UPD : VST3DWB<0b0100, {0,0,0,?}, "8">;
2050 def VST3d16_UPD : VST3DWB<0b0100, {0,1,0,?}, "16">;
2051 def VST3d32_UPD : VST3DWB<0b0100, {1,0,0,?}, "32">;
2053 def VST3d8Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2054 def VST3d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2055 def VST3d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2057 // ...with double-spaced registers:
2058 def VST3q8 : VST3D<0b0101, {0,0,0,?}, "8">;
2059 def VST3q16 : VST3D<0b0101, {0,1,0,?}, "16">;
2060 def VST3q32 : VST3D<0b0101, {1,0,0,?}, "32">;
2061 def VST3q8_UPD : VST3DWB<0b0101, {0,0,0,?}, "8">;
2062 def VST3q16_UPD : VST3DWB<0b0101, {0,1,0,?}, "16">;
2063 def VST3q32_UPD : VST3DWB<0b0101, {1,0,0,?}, "32">;
2065 def VST3q8Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2066 def VST3q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2067 def VST3q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2069 // ...alternate versions to be allocated odd register numbers:
2070 def VST3q8oddPseudo : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
2071 def VST3q16oddPseudo : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
2072 def VST3q32oddPseudo : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
2074 def VST3q8oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2075 def VST3q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2076 def VST3q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2078 // VST4 : Vector Store (multiple 4-element structures)
2079 class VST4D<bits<4> op11_8, bits<4> op7_4, string Dt>
2080 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
2081 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
2082 IIC_VST4, "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn",
2083 "", []>, Sched<[WriteVST4]> {
2085 let Inst{5-4} = Rn{5-4};
2086 let DecoderMethod = "DecodeVLDST4Instruction";
2089 def VST4d8 : VST4D<0b0000, {0,0,?,?}, "8">;
2090 def VST4d16 : VST4D<0b0000, {0,1,?,?}, "16">;
2091 def VST4d32 : VST4D<0b0000, {1,0,?,?}, "32">;
2093 def VST4d8Pseudo : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
2094 def VST4d16Pseudo : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
2095 def VST4d32Pseudo : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
2097 // ...with address register writeback:
2098 class VST4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
2099 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
2100 (ins addrmode6:$Rn, am6offset:$Rm,
2101 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST4u,
2102 "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
2103 "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
2104 let Inst{5-4} = Rn{5-4};
2105 let DecoderMethod = "DecodeVLDST4Instruction";
2108 def VST4d8_UPD : VST4DWB<0b0000, {0,0,?,?}, "8">;
2109 def VST4d16_UPD : VST4DWB<0b0000, {0,1,?,?}, "16">;
2110 def VST4d32_UPD : VST4DWB<0b0000, {1,0,?,?}, "32">;
2112 def VST4d8Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2113 def VST4d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2114 def VST4d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2116 // ...with double-spaced registers:
2117 def VST4q8 : VST4D<0b0001, {0,0,?,?}, "8">;
2118 def VST4q16 : VST4D<0b0001, {0,1,?,?}, "16">;
2119 def VST4q32 : VST4D<0b0001, {1,0,?,?}, "32">;
2120 def VST4q8_UPD : VST4DWB<0b0001, {0,0,?,?}, "8">;
2121 def VST4q16_UPD : VST4DWB<0b0001, {0,1,?,?}, "16">;
2122 def VST4q32_UPD : VST4DWB<0b0001, {1,0,?,?}, "32">;
2124 def VST4q8Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2125 def VST4q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2126 def VST4q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2128 // ...alternate versions to be allocated odd register numbers:
2129 def VST4q8oddPseudo : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
2130 def VST4q16oddPseudo : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
2131 def VST4q32oddPseudo : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
2133 def VST4q8oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2134 def VST4q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2135 def VST4q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2137 } // mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1
2139 // Classes for VST*LN pseudo-instructions with multi-register operands.
2140 // These are expanded to real instructions after register allocation.
2141 class VSTQLNPseudo<InstrItinClass itin>
2142 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
2144 class VSTQLNWBPseudo<InstrItinClass itin>
2145 : PseudoNLdSt<(outs GPR:$wb),
2146 (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
2147 nohash_imm:$lane), itin, "$addr.addr = $wb">;
2148 class VSTQQLNPseudo<InstrItinClass itin>
2149 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
2151 class VSTQQLNWBPseudo<InstrItinClass itin>
2152 : PseudoNLdSt<(outs GPR:$wb),
2153 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
2154 nohash_imm:$lane), itin, "$addr.addr = $wb">;
2155 class VSTQQQQLNPseudo<InstrItinClass itin>
2156 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
2158 class VSTQQQQLNWBPseudo<InstrItinClass itin>
2159 : PseudoNLdSt<(outs GPR:$wb),
2160 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
2161 nohash_imm:$lane), itin, "$addr.addr = $wb">;
2163 // VST1LN : Vector Store (single element from one lane)
2164 class VST1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
2165 PatFrag StoreOp, SDNode ExtractOp, Operand AddrMode>
2166 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
2167 (ins AddrMode:$Rn, DPR:$Vd, nohash_imm:$lane),
2168 IIC_VST1ln, "vst1", Dt, "\\{$Vd[$lane]\\}, $Rn", "",
2169 [(StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane), AddrMode:$Rn)]>,
2170 Sched<[WriteVST1]> {
2172 let DecoderMethod = "DecodeVST1LN";
2174 class VST1QLNPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
2175 : VSTQLNPseudo<IIC_VST1ln>, Sched<[WriteVST1]> {
2176 let Pattern = [(StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
2180 def VST1LNd8 : VST1LN<0b0000, {?,?,?,0}, "8", v8i8, truncstorei8,
2181 ARMvgetlaneu, addrmode6> {
2182 let Inst{7-5} = lane{2-0};
2184 def VST1LNd16 : VST1LN<0b0100, {?,?,0,?}, "16", v4i16, truncstorei16,
2185 ARMvgetlaneu, addrmode6> {
2186 let Inst{7-6} = lane{1-0};
2187 let Inst{4} = Rn{4};
2190 def VST1LNd32 : VST1LN<0b1000, {?,0,?,?}, "32", v2i32, store, extractelt,
2192 let Inst{7} = lane{0};
2193 let Inst{5-4} = Rn{5-4};
2196 def VST1LNq8Pseudo : VST1QLNPseudo<v16i8, truncstorei8, ARMvgetlaneu>;
2197 def VST1LNq16Pseudo : VST1QLNPseudo<v8i16, truncstorei16, ARMvgetlaneu>;
2198 def VST1LNq32Pseudo : VST1QLNPseudo<v4i32, store, extractelt>;
2200 let Predicates = [HasNEON] in {
2201 def : Pat<(store (extractelt (v2f32 DPR:$src), imm:$lane), addrmode6:$addr),
2202 (VST1LNd32 addrmode6:$addr, DPR:$src, imm:$lane)>;
2203 def : Pat<(store (extractelt (v4f32 QPR:$src), imm:$lane), addrmode6:$addr),
2204 (VST1LNq32Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
2206 def : Pat<(store (extractelt (v4f16 DPR:$src), imm:$lane), addrmode6:$addr),
2207 (VST1LNd16 addrmode6:$addr, DPR:$src, imm:$lane)>;
2208 def : Pat<(store (extractelt (v8f16 QPR:$src), imm:$lane), addrmode6:$addr),
2209 (VST1LNq16Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
2212 // ...with address register writeback:
2213 class VST1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
2214 PatFrag StoreOp, SDNode ExtractOp, Operand AdrMode>
2215 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
2216 (ins AdrMode:$Rn, am6offset:$Rm,
2217 DPR:$Vd, nohash_imm:$lane), IIC_VST1lnu, "vst1", Dt,
2218 "\\{$Vd[$lane]\\}, $Rn$Rm",
2220 [(set GPR:$wb, (StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane),
2221 AdrMode:$Rn, am6offset:$Rm))]>,
2222 Sched<[WriteVST1]> {
2223 let DecoderMethod = "DecodeVST1LN";
2225 class VST1QLNWBPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
2226 : VSTQLNWBPseudo<IIC_VST1lnu>, Sched<[WriteVST1]> {
2227 let Pattern = [(set GPR:$wb, (StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
2228 addrmode6:$addr, am6offset:$offset))];
2231 def VST1LNd8_UPD : VST1LNWB<0b0000, {?,?,?,0}, "8", v8i8, post_truncsti8,
2232 ARMvgetlaneu, addrmode6> {
2233 let Inst{7-5} = lane{2-0};
2235 def VST1LNd16_UPD : VST1LNWB<0b0100, {?,?,0,?}, "16", v4i16, post_truncsti16,
2236 ARMvgetlaneu, addrmode6> {
2237 let Inst{7-6} = lane{1-0};
2238 let Inst{4} = Rn{4};
2240 def VST1LNd32_UPD : VST1LNWB<0b1000, {?,0,?,?}, "32", v2i32, post_store,
2241 extractelt, addrmode6oneL32> {
2242 let Inst{7} = lane{0};
2243 let Inst{5-4} = Rn{5-4};
2246 def VST1LNq8Pseudo_UPD : VST1QLNWBPseudo<v16i8, post_truncsti8, ARMvgetlaneu>;
2247 def VST1LNq16Pseudo_UPD : VST1QLNWBPseudo<v8i16, post_truncsti16,ARMvgetlaneu>;
2248 def VST1LNq32Pseudo_UPD : VST1QLNWBPseudo<v4i32, post_store, extractelt>;
2250 let mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1 in {
2252 // VST2LN : Vector Store (single 2-element structure from one lane)
2253 class VST2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
2254 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
2255 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, nohash_imm:$lane),
2256 IIC_VST2ln, "vst2", Dt, "\\{$Vd[$lane], $src2[$lane]\\}, $Rn",
2257 "", []>, Sched<[WriteVST1]> {
2259 let Inst{4} = Rn{4};
2260 let DecoderMethod = "DecodeVST2LN";
2263 def VST2LNd8 : VST2LN<0b0001, {?,?,?,?}, "8"> {
2264 let Inst{7-5} = lane{2-0};
2266 def VST2LNd16 : VST2LN<0b0101, {?,?,0,?}, "16"> {
2267 let Inst{7-6} = lane{1-0};
2269 def VST2LNd32 : VST2LN<0b1001, {?,0,0,?}, "32"> {
2270 let Inst{7} = lane{0};
2273 def VST2LNd8Pseudo : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
2274 def VST2LNd16Pseudo : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
2275 def VST2LNd32Pseudo : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
2277 // ...with double-spaced registers:
2278 def VST2LNq16 : VST2LN<0b0101, {?,?,1,?}, "16"> {
2279 let Inst{7-6} = lane{1-0};
2280 let Inst{4} = Rn{4};
2282 def VST2LNq32 : VST2LN<0b1001, {?,1,0,?}, "32"> {
2283 let Inst{7} = lane{0};
2284 let Inst{4} = Rn{4};
2287 def VST2LNq16Pseudo : VSTQQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
2288 def VST2LNq32Pseudo : VSTQQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
2290 // ...with address register writeback:
2291 class VST2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
2292 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
2293 (ins addrmode6:$Rn, am6offset:$Rm,
2294 DPR:$Vd, DPR:$src2, nohash_imm:$lane), IIC_VST2lnu, "vst2", Dt,
2295 "\\{$Vd[$lane], $src2[$lane]\\}, $Rn$Rm",
2296 "$Rn.addr = $wb", []> {
2297 let Inst{4} = Rn{4};
2298 let DecoderMethod = "DecodeVST2LN";
2301 def VST2LNd8_UPD : VST2LNWB<0b0001, {?,?,?,?}, "8"> {
2302 let Inst{7-5} = lane{2-0};
2304 def VST2LNd16_UPD : VST2LNWB<0b0101, {?,?,0,?}, "16"> {
2305 let Inst{7-6} = lane{1-0};
2307 def VST2LNd32_UPD : VST2LNWB<0b1001, {?,0,0,?}, "32"> {
2308 let Inst{7} = lane{0};
2311 def VST2LNd8Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
2312 def VST2LNd16Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
2313 def VST2LNd32Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
2315 def VST2LNq16_UPD : VST2LNWB<0b0101, {?,?,1,?}, "16"> {
2316 let Inst{7-6} = lane{1-0};
2318 def VST2LNq32_UPD : VST2LNWB<0b1001, {?,1,0,?}, "32"> {
2319 let Inst{7} = lane{0};
2322 def VST2LNq16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
2323 def VST2LNq32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
2325 // VST3LN : Vector Store (single 3-element structure from one lane)
2326 class VST3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
2327 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
2328 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3,
2329 nohash_imm:$lane), IIC_VST3ln, "vst3", Dt,
2330 "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn", "", []>,
2331 Sched<[WriteVST2]> {
2333 let DecoderMethod = "DecodeVST3LN";
2336 def VST3LNd8 : VST3LN<0b0010, {?,?,?,0}, "8"> {
2337 let Inst{7-5} = lane{2-0};
2339 def VST3LNd16 : VST3LN<0b0110, {?,?,0,0}, "16"> {
2340 let Inst{7-6} = lane{1-0};
2342 def VST3LNd32 : VST3LN<0b1010, {?,0,0,0}, "32"> {
2343 let Inst{7} = lane{0};
2346 def VST3LNd8Pseudo : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
2347 def VST3LNd16Pseudo : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
2348 def VST3LNd32Pseudo : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
2350 // ...with double-spaced registers:
2351 def VST3LNq16 : VST3LN<0b0110, {?,?,1,0}, "16"> {
2352 let Inst{7-6} = lane{1-0};
2354 def VST3LNq32 : VST3LN<0b1010, {?,1,0,0}, "32"> {
2355 let Inst{7} = lane{0};
2358 def VST3LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
2359 def VST3LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
2361 // ...with address register writeback:
2362 class VST3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
2363 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
2364 (ins addrmode6:$Rn, am6offset:$Rm,
2365 DPR:$Vd, DPR:$src2, DPR:$src3, nohash_imm:$lane),
2366 IIC_VST3lnu, "vst3", Dt,
2367 "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn$Rm",
2368 "$Rn.addr = $wb", []> {
2369 let DecoderMethod = "DecodeVST3LN";
2372 def VST3LNd8_UPD : VST3LNWB<0b0010, {?,?,?,0}, "8"> {
2373 let Inst{7-5} = lane{2-0};
2375 def VST3LNd16_UPD : VST3LNWB<0b0110, {?,?,0,0}, "16"> {
2376 let Inst{7-6} = lane{1-0};
2378 def VST3LNd32_UPD : VST3LNWB<0b1010, {?,0,0,0}, "32"> {
2379 let Inst{7} = lane{0};
2382 def VST3LNd8Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
2383 def VST3LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
2384 def VST3LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
2386 def VST3LNq16_UPD : VST3LNWB<0b0110, {?,?,1,0}, "16"> {
2387 let Inst{7-6} = lane{1-0};
2389 def VST3LNq32_UPD : VST3LNWB<0b1010, {?,1,0,0}, "32"> {
2390 let Inst{7} = lane{0};
2393 def VST3LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
2394 def VST3LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
2396 // VST4LN : Vector Store (single 4-element structure from one lane)
2397 class VST4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
2398 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
2399 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4,
2400 nohash_imm:$lane), IIC_VST4ln, "vst4", Dt,
2401 "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn",
2402 "", []>, Sched<[WriteVST2]> {
2404 let Inst{4} = Rn{4};
2405 let DecoderMethod = "DecodeVST4LN";
2408 def VST4LNd8 : VST4LN<0b0011, {?,?,?,?}, "8"> {
2409 let Inst{7-5} = lane{2-0};
2411 def VST4LNd16 : VST4LN<0b0111, {?,?,0,?}, "16"> {
2412 let Inst{7-6} = lane{1-0};
2414 def VST4LNd32 : VST4LN<0b1011, {?,0,?,?}, "32"> {
2415 let Inst{7} = lane{0};
2416 let Inst{5} = Rn{5};
2419 def VST4LNd8Pseudo : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
2420 def VST4LNd16Pseudo : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
2421 def VST4LNd32Pseudo : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
2423 // ...with double-spaced registers:
2424 def VST4LNq16 : VST4LN<0b0111, {?,?,1,?}, "16"> {
2425 let Inst{7-6} = lane{1-0};
2427 def VST4LNq32 : VST4LN<0b1011, {?,1,?,?}, "32"> {
2428 let Inst{7} = lane{0};
2429 let Inst{5} = Rn{5};
2432 def VST4LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
2433 def VST4LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
2435 // ...with address register writeback:
2436 class VST4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
2437 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
2438 (ins addrmode6:$Rn, am6offset:$Rm,
2439 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
2440 IIC_VST4lnu, "vst4", Dt,
2441 "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn$Rm",
2442 "$Rn.addr = $wb", []> {
2443 let Inst{4} = Rn{4};
2444 let DecoderMethod = "DecodeVST4LN";
2447 def VST4LNd8_UPD : VST4LNWB<0b0011, {?,?,?,?}, "8"> {
2448 let Inst{7-5} = lane{2-0};
2450 def VST4LNd16_UPD : VST4LNWB<0b0111, {?,?,0,?}, "16"> {
2451 let Inst{7-6} = lane{1-0};
2453 def VST4LNd32_UPD : VST4LNWB<0b1011, {?,0,?,?}, "32"> {
2454 let Inst{7} = lane{0};
2455 let Inst{5} = Rn{5};
2458 def VST4LNd8Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
2459 def VST4LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
2460 def VST4LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
2462 def VST4LNq16_UPD : VST4LNWB<0b0111, {?,?,1,?}, "16"> {
2463 let Inst{7-6} = lane{1-0};
2465 def VST4LNq32_UPD : VST4LNWB<0b1011, {?,1,?,?}, "32"> {
2466 let Inst{7} = lane{0};
2467 let Inst{5} = Rn{5};
2470 def VST4LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
2471 def VST4LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
2473 } // mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1
2475 // Use vld1/vst1 for unaligned f64 load / store
2476 let Predicates = [IsLE,HasNEON] in {
2477 def : Pat<(f64 (hword_alignedload addrmode6:$addr)),
2478 (VLD1d16 addrmode6:$addr)>;
2479 def : Pat<(hword_alignedstore (f64 DPR:$value), addrmode6:$addr),
2480 (VST1d16 addrmode6:$addr, DPR:$value)>;
2481 def : Pat<(f64 (byte_alignedload addrmode6:$addr)),
2482 (VLD1d8 addrmode6:$addr)>;
2483 def : Pat<(byte_alignedstore (f64 DPR:$value), addrmode6:$addr),
2484 (VST1d8 addrmode6:$addr, DPR:$value)>;
2486 let Predicates = [IsBE,HasNEON] in {
2487 def : Pat<(f64 (non_word_alignedload addrmode6:$addr)),
2488 (VLD1d64 addrmode6:$addr)>;
2489 def : Pat<(non_word_alignedstore (f64 DPR:$value), addrmode6:$addr),
2490 (VST1d64 addrmode6:$addr, DPR:$value)>;
2493 // Use vld1/vst1 for Q and QQ. Also use them for unaligned v2f64
2494 // load / store if it's legal.
2495 let Predicates = [HasNEON] in {
2496 def : Pat<(v2f64 (dword_alignedload addrmode6:$addr)),
2497 (VLD1q64 addrmode6:$addr)>;
2498 def : Pat<(dword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
2499 (VST1q64 addrmode6:$addr, QPR:$value)>;
2501 let Predicates = [IsLE,HasNEON] in {
2502 def : Pat<(v2f64 (word_alignedload addrmode6:$addr)),
2503 (VLD1q32 addrmode6:$addr)>;
2504 def : Pat<(word_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
2505 (VST1q32 addrmode6:$addr, QPR:$value)>;
2506 def : Pat<(v2f64 (hword_alignedload addrmode6:$addr)),
2507 (VLD1q16 addrmode6:$addr)>;
2508 def : Pat<(hword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
2509 (VST1q16 addrmode6:$addr, QPR:$value)>;
2510 def : Pat<(v2f64 (byte_alignedload addrmode6:$addr)),
2511 (VLD1q8 addrmode6:$addr)>;
2512 def : Pat<(byte_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
2513 (VST1q8 addrmode6:$addr, QPR:$value)>;
2516 //===----------------------------------------------------------------------===//
2517 // Instruction Classes
2518 //===----------------------------------------------------------------------===//
2520 // Basic 2-register operations: double- and quad-register.
2521 class N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2522 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
2523 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
2524 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
2525 (ins DPR:$Vm), IIC_VUNAD, OpcodeStr, Dt,"$Vd, $Vm", "",
2526 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm))))]>;
2527 class N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2528 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
2529 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
2530 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
2531 (ins QPR:$Vm), IIC_VUNAQ, OpcodeStr, Dt,"$Vd, $Vm", "",
2532 [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm))))]>;
2534 // Basic 2-register intrinsics, both double- and quad-register.
2535 class N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2536 bits<2> op17_16, bits<5> op11_7, bit op4,
2537 InstrItinClass itin, string OpcodeStr, string Dt,
2538 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2539 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
2540 (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
2541 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
2542 class N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2543 bits<2> op17_16, bits<5> op11_7, bit op4,
2544 InstrItinClass itin, string OpcodeStr, string Dt,
2545 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2546 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
2547 (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
2548 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
2550 // Same as above, but not predicated.
2551 class N2VDIntnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op7,
2552 InstrItinClass itin, string OpcodeStr, string Dt,
2553 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2554 : N2Vnp<op19_18, op17_16, op10_8, op7, 0, (outs DPR:$Vd), (ins DPR:$Vm),
2555 itin, OpcodeStr, Dt,
2556 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
2558 class N2VQIntnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op7,
2559 InstrItinClass itin, string OpcodeStr, string Dt,
2560 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2561 : N2Vnp<op19_18, op17_16, op10_8, op7, 1, (outs QPR:$Vd), (ins QPR:$Vm),
2562 itin, OpcodeStr, Dt,
2563 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
2565 // Similar to NV2VQIntnp with some more encoding bits exposed (crypto).
2566 class N2VQIntXnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op6,
2567 bit op7, InstrItinClass itin, string OpcodeStr, string Dt,
2568 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2569 : N2Vnp<op19_18, op17_16, op10_8, op7, op6, (outs QPR:$Vd), (ins QPR:$Vm),
2570 itin, OpcodeStr, Dt,
2571 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
2573 // Same as N2VQIntXnp but with Vd as a src register.
2574 class N2VQIntX2np<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op6,
2575 bit op7, InstrItinClass itin, string OpcodeStr, string Dt,
2576 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2577 : N2Vnp<op19_18, op17_16, op10_8, op7, op6,
2578 (outs QPR:$Vd), (ins QPR:$src, QPR:$Vm),
2579 itin, OpcodeStr, Dt,
2580 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src), (OpTy QPR:$Vm))))]> {
2581 let Constraints = "$src = $Vd";
2584 // Narrow 2-register operations.
2585 class N2VN<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2586 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
2587 InstrItinClass itin, string OpcodeStr, string Dt,
2588 ValueType TyD, ValueType TyQ, SDNode OpNode>
2589 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
2590 (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
2591 [(set DPR:$Vd, (TyD (OpNode (TyQ QPR:$Vm))))]>;
2593 // Narrow 2-register intrinsics.
2594 class N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2595 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
2596 InstrItinClass itin, string OpcodeStr, string Dt,
2597 ValueType TyD, ValueType TyQ, SDPatternOperator IntOp>
2598 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
2599 (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
2600 [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vm))))]>;
2602 // Long 2-register operations (currently only used for VMOVL).
2603 class N2VL<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2604 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
2605 InstrItinClass itin, string OpcodeStr, string Dt,
2606 ValueType TyQ, ValueType TyD, SDNode OpNode>
2607 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
2608 (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
2609 [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vm))))]>;
2611 // Long 2-register intrinsics.
2612 class N2VLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2613 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
2614 InstrItinClass itin, string OpcodeStr, string Dt,
2615 ValueType TyQ, ValueType TyD, SDPatternOperator IntOp>
2616 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
2617 (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
2618 [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vm))))]>;
2620 // 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
2621 class N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr, string Dt>
2622 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$Vd, DPR:$Vm),
2623 (ins DPR:$src1, DPR:$src2), IIC_VPERMD,
2624 OpcodeStr, Dt, "$Vd, $Vm",
2625 "$src1 = $Vd, $src2 = $Vm", []>;
2626 class N2VQShuffle<bits<2> op19_18, bits<5> op11_7,
2627 InstrItinClass itin, string OpcodeStr, string Dt>
2628 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$Vd, QPR:$Vm),
2629 (ins QPR:$src1, QPR:$src2), itin, OpcodeStr, Dt, "$Vd, $Vm",
2630 "$src1 = $Vd, $src2 = $Vm", []>;
2632 // Basic 3-register operations: double- and quad-register.
2633 class N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2634 InstrItinClass itin, string OpcodeStr, string Dt,
2635 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
2636 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2637 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2638 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2639 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
2640 // All of these have a two-operand InstAlias.
2641 let TwoOperandAliasConstraint = "$Vn = $Vd";
2642 let isCommutable = Commutable;
2644 // Same as N3VD but no data type.
2645 class N3VDX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2646 InstrItinClass itin, string OpcodeStr,
2647 ValueType ResTy, ValueType OpTy,
2648 SDNode OpNode, bit Commutable>
2649 : N3VX<op24, op23, op21_20, op11_8, 0, op4,
2650 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2651 OpcodeStr, "$Vd, $Vn, $Vm", "",
2652 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>{
2653 // All of these have a two-operand InstAlias.
2654 let TwoOperandAliasConstraint = "$Vn = $Vd";
2655 let isCommutable = Commutable;
2658 class N3VDSL<bits<2> op21_20, bits<4> op11_8,
2659 InstrItinClass itin, string OpcodeStr, string Dt,
2660 ValueType Ty, SDNode ShOp>
2661 : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
2662 (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2663 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
2665 (Ty (ShOp (Ty DPR:$Vn),
2666 (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),imm:$lane)))))]> {
2667 // All of these have a two-operand InstAlias.
2668 let TwoOperandAliasConstraint = "$Vn = $Vd";
2669 let isCommutable = 0;
2671 class N3VDSL16<bits<2> op21_20, bits<4> op11_8,
2672 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
2673 : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
2674 (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
2675 NVMulSLFrm, IIC_VMULi16D, OpcodeStr, Dt,"$Vd, $Vn, $Vm$lane","",
2677 (Ty (ShOp (Ty DPR:$Vn),
2678 (Ty (ARMvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
2679 // All of these have a two-operand InstAlias.
2680 let TwoOperandAliasConstraint = "$Vn = $Vd";
2681 let isCommutable = 0;
2684 class N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2685 InstrItinClass itin, string OpcodeStr, string Dt,
2686 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
2687 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2688 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2689 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2690 [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
2691 // All of these have a two-operand InstAlias.
2692 let TwoOperandAliasConstraint = "$Vn = $Vd";
2693 let isCommutable = Commutable;
2695 class N3VQX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2696 InstrItinClass itin, string OpcodeStr,
2697 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
2698 : N3VX<op24, op23, op21_20, op11_8, 1, op4,
2699 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2700 OpcodeStr, "$Vd, $Vn, $Vm", "",
2701 [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>{
2702 // All of these have a two-operand InstAlias.
2703 let TwoOperandAliasConstraint = "$Vn = $Vd";
2704 let isCommutable = Commutable;
2706 class N3VQSL<bits<2> op21_20, bits<4> op11_8,
2707 InstrItinClass itin, string OpcodeStr, string Dt,
2708 ValueType ResTy, ValueType OpTy, SDNode ShOp>
2709 : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
2710 (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2711 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
2712 [(set (ResTy QPR:$Vd),
2713 (ResTy (ShOp (ResTy QPR:$Vn),
2714 (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
2716 // All of these have a two-operand InstAlias.
2717 let TwoOperandAliasConstraint = "$Vn = $Vd";
2718 let isCommutable = 0;
2720 class N3VQSL16<bits<2> op21_20, bits<4> op11_8, string OpcodeStr, string Dt,
2721 ValueType ResTy, ValueType OpTy, SDNode ShOp>
2722 : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
2723 (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
2724 NVMulSLFrm, IIC_VMULi16Q, OpcodeStr, Dt,"$Vd, $Vn, $Vm$lane", "",
2725 [(set (ResTy QPR:$Vd),
2726 (ResTy (ShOp (ResTy QPR:$Vn),
2727 (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
2729 // All of these have a two-operand InstAlias.
2730 let TwoOperandAliasConstraint = "$Vn = $Vd";
2731 let isCommutable = 0;
2734 // Basic 3-register intrinsics, both double- and quad-register.
2735 class N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2736 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
2737 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp, bit Commutable>
2738 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2739 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), f, itin,
2740 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2741 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
2742 // All of these have a two-operand InstAlias.
2743 let TwoOperandAliasConstraint = "$Vn = $Vd";
2744 let isCommutable = Commutable;
2747 class N3VDIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
2748 bit op4, Format f, InstrItinClass itin, string OpcodeStr,
2749 string Dt, ValueType ResTy, ValueType OpTy,
2750 SDPatternOperator IntOp, bit Commutable>
2751 : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
2752 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), f, itin, OpcodeStr, Dt,
2753 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
2754 let isCommutable = Commutable;
2758 class N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2759 string OpcodeStr, string Dt, ValueType Ty, SDPatternOperator IntOp>
2760 : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
2761 (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2762 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
2764 (Ty (IntOp (Ty DPR:$Vn),
2765 (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),
2767 let isCommutable = 0;
2770 class N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2771 string OpcodeStr, string Dt, ValueType Ty, SDPatternOperator IntOp>
2772 : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
2773 (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
2774 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
2776 (Ty (IntOp (Ty DPR:$Vn),
2777 (Ty (ARMvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
2778 let isCommutable = 0;
2780 class N3VDIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2781 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
2782 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2783 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2784 (outs DPR:$Vd), (ins DPR:$Vm, DPR:$Vn), f, itin,
2785 OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
2786 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (OpTy DPR:$Vn))))]> {
2787 let TwoOperandAliasConstraint = "$Vm = $Vd";
2788 let isCommutable = 0;
2791 class N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2792 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
2793 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp, bit Commutable>
2794 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2795 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin,
2796 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2797 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
2798 // All of these have a two-operand InstAlias.
2799 let TwoOperandAliasConstraint = "$Vn = $Vd";
2800 let isCommutable = Commutable;
2803 class N3VQIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
2804 bit op4, Format f, InstrItinClass itin, string OpcodeStr,
2805 string Dt, ValueType ResTy, ValueType OpTy,
2806 SDPatternOperator IntOp, bit Commutable>
2807 : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
2808 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin, OpcodeStr, Dt,
2809 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
2810 let isCommutable = Commutable;
2813 // Same as N3VQIntnp but with Vd as a src register.
2814 class N3VQInt3np<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
2815 bit op4, Format f, InstrItinClass itin, string OpcodeStr,
2816 string Dt, ValueType ResTy, ValueType OpTy,
2817 SDPatternOperator IntOp>
2818 : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
2819 (outs QPR:$Vd), (ins QPR:$src, QPR:$Vn, QPR:$Vm),
2820 f, itin, OpcodeStr, Dt,
2821 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src), (OpTy QPR:$Vn),
2822 (OpTy QPR:$Vm))))]> {
2823 let Constraints = "$src = $Vd";
2824 let isCommutable = 0;
2827 class N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2828 string OpcodeStr, string Dt,
2829 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2830 : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
2831 (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2832 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
2833 [(set (ResTy QPR:$Vd),
2834 (ResTy (IntOp (ResTy QPR:$Vn),
2835 (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
2837 let isCommutable = 0;
2839 class N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2840 string OpcodeStr, string Dt,
2841 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2842 : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
2843 (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
2844 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
2845 [(set (ResTy QPR:$Vd),
2846 (ResTy (IntOp (ResTy QPR:$Vn),
2847 (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
2849 let isCommutable = 0;
2851 class N3VQIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2852 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
2853 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2854 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2855 (outs QPR:$Vd), (ins QPR:$Vm, QPR:$Vn), f, itin,
2856 OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
2857 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (OpTy QPR:$Vn))))]> {
2858 let TwoOperandAliasConstraint = "$Vm = $Vd";
2859 let isCommutable = 0;
2862 // Multiply-Add/Sub operations: double- and quad-register.
2863 class N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2864 InstrItinClass itin, string OpcodeStr, string Dt,
2865 ValueType Ty, SDPatternOperator MulOp, SDPatternOperator OpNode>
2866 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2867 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2868 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2869 [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
2870 (Ty (MulOp DPR:$Vn, DPR:$Vm)))))]>;
2872 class N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2873 string OpcodeStr, string Dt,
2874 ValueType Ty, SDPatternOperator MulOp, SDPatternOperator ShOp>
2875 : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
2877 (ins DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2879 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
2881 (Ty (ShOp (Ty DPR:$src1),
2883 (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),
2885 class N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2886 string OpcodeStr, string Dt,
2887 ValueType Ty, SDPatternOperator MulOp, SDPatternOperator ShOp>
2888 : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
2890 (ins DPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
2892 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
2894 (Ty (ShOp (Ty DPR:$src1),
2896 (Ty (ARMvduplane (Ty DPR_8:$Vm),
2899 class N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2900 InstrItinClass itin, string OpcodeStr, string Dt, ValueType Ty,
2901 SDPatternOperator MulOp, SDPatternOperator OpNode>
2902 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2903 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2904 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2905 [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
2906 (Ty (MulOp QPR:$Vn, QPR:$Vm)))))]>;
2907 class N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2908 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
2909 SDPatternOperator MulOp, SDPatternOperator ShOp>
2910 : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
2912 (ins QPR:$src1, QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2914 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
2915 [(set (ResTy QPR:$Vd),
2916 (ResTy (ShOp (ResTy QPR:$src1),
2917 (ResTy (MulOp QPR:$Vn,
2918 (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
2920 class N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2921 string OpcodeStr, string Dt,
2922 ValueType ResTy, ValueType OpTy,
2923 SDPatternOperator MulOp, SDPatternOperator ShOp>
2924 : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
2926 (ins QPR:$src1, QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
2928 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
2929 [(set (ResTy QPR:$Vd),
2930 (ResTy (ShOp (ResTy QPR:$src1),
2931 (ResTy (MulOp QPR:$Vn,
2932 (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
2935 // Neon Intrinsic-Op instructions (VABA): double- and quad-register.
2936 class N3VDIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2937 InstrItinClass itin, string OpcodeStr, string Dt,
2938 ValueType Ty, SDPatternOperator IntOp, SDNode OpNode>
2939 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2940 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2941 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2942 [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
2943 (Ty (IntOp (Ty DPR:$Vn), (Ty DPR:$Vm))))))]>;
2944 class N3VQIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2945 InstrItinClass itin, string OpcodeStr, string Dt,
2946 ValueType Ty, SDPatternOperator IntOp, SDNode OpNode>
2947 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2948 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2949 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2950 [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
2951 (Ty (IntOp (Ty QPR:$Vn), (Ty QPR:$Vm))))))]>;
2953 // Neon 3-argument intrinsics, both double- and quad-register.
2954 // The destination register is also used as the first source operand register.
2955 class N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2956 InstrItinClass itin, string OpcodeStr, string Dt,
2957 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2958 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2959 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2960 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2961 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$src1),
2962 (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>;
2963 class N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2964 InstrItinClass itin, string OpcodeStr, string Dt,
2965 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2966 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2967 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2968 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2969 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src1),
2970 (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>;
2972 // Long Multiply-Add/Sub operations.
2973 class N3VLMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2974 InstrItinClass itin, string OpcodeStr, string Dt,
2975 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
2976 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2977 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2978 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2979 [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
2980 (TyQ (MulOp (TyD DPR:$Vn),
2981 (TyD DPR:$Vm)))))]>;
2982 class N3VLMulOpSL<bit op24, bits<2> op21_20, bits<4> op11_8,
2983 InstrItinClass itin, string OpcodeStr, string Dt,
2984 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
2985 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
2986 (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2988 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
2990 (OpNode (TyQ QPR:$src1),
2991 (TyQ (MulOp (TyD DPR:$Vn),
2992 (TyD (ARMvduplane (TyD DPR_VFP2:$Vm),
2994 class N3VLMulOpSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
2995 InstrItinClass itin, string OpcodeStr, string Dt,
2996 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
2997 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
2998 (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
3000 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
3002 (OpNode (TyQ QPR:$src1),
3003 (TyQ (MulOp (TyD DPR:$Vn),
3004 (TyD (ARMvduplane (TyD DPR_8:$Vm),
3007 // Long Intrinsic-Op vector operations with explicit extend (VABAL).
3008 class N3VLIntExtOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3009 InstrItinClass itin, string OpcodeStr, string Dt,
3010 ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, SDNode ExtOp,
3012 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3013 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
3014 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
3015 [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
3016 (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
3017 (TyD DPR:$Vm)))))))]>;
3019 // Neon Long 3-argument intrinsic. The destination register is
3020 // a quad-register and is also used as the first source operand register.
3021 class N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3022 InstrItinClass itin, string OpcodeStr, string Dt,
3023 ValueType TyQ, ValueType TyD, SDPatternOperator IntOp>
3024 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3025 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
3026 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
3028 (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$Vn), (TyD DPR:$Vm))))]>;
3029 class N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
3030 string OpcodeStr, string Dt,
3031 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3032 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
3034 (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
3036 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
3037 [(set (ResTy QPR:$Vd),
3038 (ResTy (IntOp (ResTy QPR:$src1),
3040 (OpTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
3042 class N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8,
3043 InstrItinClass itin, string OpcodeStr, string Dt,
3044 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3045 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
3047 (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
3049 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
3050 [(set (ResTy QPR:$Vd),
3051 (ResTy (IntOp (ResTy QPR:$src1),
3053 (OpTy (ARMvduplane (OpTy DPR_8:$Vm),
3056 // Narrowing 3-register intrinsics.
3057 class N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3058 string OpcodeStr, string Dt, ValueType TyD, ValueType TyQ,
3059 SDPatternOperator IntOp, bit Commutable>
3060 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3061 (outs DPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINi4D,
3062 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3063 [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vn), (TyQ QPR:$Vm))))]> {
3064 let isCommutable = Commutable;
3067 // Long 3-register operations.
3068 class N3VL<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3069 InstrItinClass itin, string OpcodeStr, string Dt,
3070 ValueType TyQ, ValueType TyD, SDNode OpNode, bit Commutable>
3071 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3072 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
3073 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3074 [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
3075 let isCommutable = Commutable;
3078 class N3VLSL<bit op24, bits<2> op21_20, bits<4> op11_8,
3079 InstrItinClass itin, string OpcodeStr, string Dt,
3080 ValueType TyQ, ValueType TyD, SDNode OpNode>
3081 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
3082 (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
3083 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
3085 (TyQ (OpNode (TyD DPR:$Vn),
3086 (TyD (ARMvduplane (TyD DPR_VFP2:$Vm),imm:$lane)))))]>;
3087 class N3VLSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
3088 InstrItinClass itin, string OpcodeStr, string Dt,
3089 ValueType TyQ, ValueType TyD, SDNode OpNode>
3090 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
3091 (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
3092 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
3094 (TyQ (OpNode (TyD DPR:$Vn),
3095 (TyD (ARMvduplane (TyD DPR_8:$Vm), imm:$lane)))))]>;
3097 // Long 3-register operations with explicitly extended operands.
3098 class N3VLExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3099 InstrItinClass itin, string OpcodeStr, string Dt,
3100 ValueType TyQ, ValueType TyD, SDNode OpNode, SDPatternOperator ExtOp,
3102 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3103 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
3104 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3105 [(set QPR:$Vd, (OpNode (TyQ (ExtOp (TyD DPR:$Vn))),
3106 (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
3107 let isCommutable = Commutable;
3110 // Long 3-register intrinsics with explicit extend (VABDL).
3111 class N3VLIntExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3112 InstrItinClass itin, string OpcodeStr, string Dt,
3113 ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, SDNode ExtOp,
3115 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3116 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
3117 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3118 [(set QPR:$Vd, (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
3119 (TyD DPR:$Vm))))))]> {
3120 let isCommutable = Commutable;
3123 // Long 3-register intrinsics.
3124 class N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3125 InstrItinClass itin, string OpcodeStr, string Dt,
3126 ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, bit Commutable>
3127 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3128 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
3129 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3130 [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
3131 let isCommutable = Commutable;
3134 // Same as above, but not predicated.
3135 class N3VLIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
3136 bit op4, InstrItinClass itin, string OpcodeStr,
3137 string Dt, ValueType ResTy, ValueType OpTy,
3138 SDPatternOperator IntOp, bit Commutable>
3139 : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
3140 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin, OpcodeStr, Dt,
3141 [(set QPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
3142 let isCommutable = Commutable;
3146 class N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
3147 string OpcodeStr, string Dt,
3148 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3149 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
3150 (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
3151 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
3152 [(set (ResTy QPR:$Vd),
3153 (ResTy (IntOp (OpTy DPR:$Vn),
3154 (OpTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
3156 class N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
3157 InstrItinClass itin, string OpcodeStr, string Dt,
3158 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3159 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
3160 (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
3161 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
3162 [(set (ResTy QPR:$Vd),
3163 (ResTy (IntOp (OpTy DPR:$Vn),
3164 (OpTy (ARMvduplane (OpTy DPR_8:$Vm),
3167 // Wide 3-register operations.
3168 class N3VW<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3169 string OpcodeStr, string Dt, ValueType TyQ, ValueType TyD,
3170 SDNode OpNode, SDPatternOperator ExtOp, bit Commutable>
3171 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3172 (outs QPR:$Vd), (ins QPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VSUBiD,
3173 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3174 [(set QPR:$Vd, (OpNode (TyQ QPR:$Vn),
3175 (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
3176 // All of these have a two-operand InstAlias.
3177 let TwoOperandAliasConstraint = "$Vn = $Vd";
3178 let isCommutable = Commutable;
3181 // Pairwise long 2-register intrinsics, both double- and quad-register.
3182 class N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
3183 bits<2> op17_16, bits<5> op11_7, bit op4,
3184 string OpcodeStr, string Dt,
3185 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3186 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
3187 (ins DPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
3188 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
3189 class N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
3190 bits<2> op17_16, bits<5> op11_7, bit op4,
3191 string OpcodeStr, string Dt,
3192 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3193 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
3194 (ins QPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
3195 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
3197 // Pairwise long 2-register accumulate intrinsics,
3198 // both double- and quad-register.
3199 // The destination register is also used as the first source operand register.
3200 class N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
3201 bits<2> op17_16, bits<5> op11_7, bit op4,
3202 string OpcodeStr, string Dt,
3203 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3204 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
3205 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vm), IIC_VPALiD,
3206 OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
3207 [(set DPR:$Vd, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$Vm))))]>;
3208 class N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
3209 bits<2> op17_16, bits<5> op11_7, bit op4,
3210 string OpcodeStr, string Dt,
3211 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3212 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
3213 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vm), IIC_VPALiQ,
3214 OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
3215 [(set QPR:$Vd, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$Vm))))]>;
3217 // Shift by immediate,
3218 // both double- and quad-register.
3219 let TwoOperandAliasConstraint = "$Vm = $Vd" in {
3220 class N2VDSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3221 Format f, InstrItinClass itin, Operand ImmTy,
3222 string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
3223 : N2VImm<op24, op23, op11_8, op7, 0, op4,
3224 (outs DPR:$Vd), (ins DPR:$Vm, ImmTy:$SIMM), f, itin,
3225 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
3226 [(set DPR:$Vd, (Ty (OpNode (Ty DPR:$Vm), (i32 imm:$SIMM))))]>;
3227 class N2VQSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3228 Format f, InstrItinClass itin, Operand ImmTy,
3229 string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
3230 : N2VImm<op24, op23, op11_8, op7, 1, op4,
3231 (outs QPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), f, itin,
3232 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
3233 [(set QPR:$Vd, (Ty (OpNode (Ty QPR:$Vm), (i32 imm:$SIMM))))]>;
3236 // Long shift by immediate.
3237 class N2VLSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
3238 string OpcodeStr, string Dt,
3239 ValueType ResTy, ValueType OpTy, Operand ImmTy,
3240 SDPatternOperator OpNode>
3241 : N2VImm<op24, op23, op11_8, op7, op6, op4,
3242 (outs QPR:$Vd), (ins DPR:$Vm, ImmTy:$SIMM), N2RegVShLFrm,
3243 IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
3244 [(set QPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm), ImmTy:$SIMM)))]>;
3246 // Narrow shift by immediate.
3247 class N2VNSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
3248 InstrItinClass itin, string OpcodeStr, string Dt,
3249 ValueType ResTy, ValueType OpTy, Operand ImmTy,
3250 SDPatternOperator OpNode>
3251 : N2VImm<op24, op23, op11_8, op7, op6, op4,
3252 (outs DPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, itin,
3253 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
3254 [(set DPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm),
3255 (i32 ImmTy:$SIMM))))]>;
3257 // Shift right by immediate and accumulate,
3258 // both double- and quad-register.
3259 let TwoOperandAliasConstraint = "$Vm = $Vd" in {
3260 class N2VDShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3261 Operand ImmTy, string OpcodeStr, string Dt,
3262 ValueType Ty, SDNode ShOp>
3263 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
3264 (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
3265 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
3266 [(set DPR:$Vd, (Ty (add DPR:$src1,
3267 (Ty (ShOp DPR:$Vm, (i32 imm:$SIMM))))))]>;
3268 class N2VQShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3269 Operand ImmTy, string OpcodeStr, string Dt,
3270 ValueType Ty, SDNode ShOp>
3271 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
3272 (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
3273 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
3274 [(set QPR:$Vd, (Ty (add QPR:$src1,
3275 (Ty (ShOp QPR:$Vm, (i32 imm:$SIMM))))))]>;
3278 // Shift by immediate and insert,
3279 // both double- and quad-register.
3280 let TwoOperandAliasConstraint = "$Vm = $Vd" in {
3281 class N2VDShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3282 Operand ImmTy, Format f, string OpcodeStr, string Dt,
3283 ValueType Ty,SDNode ShOp>
3284 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
3285 (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiD,
3286 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
3287 [(set DPR:$Vd, (Ty (ShOp DPR:$src1, DPR:$Vm, (i32 imm:$SIMM))))]>;
3288 class N2VQShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3289 Operand ImmTy, Format f, string OpcodeStr, string Dt,
3290 ValueType Ty,SDNode ShOp>
3291 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
3292 (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiQ,
3293 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
3294 [(set QPR:$Vd, (Ty (ShOp QPR:$src1, QPR:$Vm, (i32 imm:$SIMM))))]>;
3297 // Convert, with fractional bits immediate,
3298 // both double- and quad-register.
3299 class N2VCvtD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3300 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
3301 SDPatternOperator IntOp>
3302 : N2VImm<op24, op23, op11_8, op7, 0, op4,
3303 (outs DPR:$Vd), (ins DPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
3304 IIC_VUNAD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
3305 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (i32 imm:$SIMM))))]>;
3306 class N2VCvtQ<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3307 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
3308 SDPatternOperator IntOp>
3309 : N2VImm<op24, op23, op11_8, op7, 1, op4,
3310 (outs QPR:$Vd), (ins QPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
3311 IIC_VUNAQ, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
3312 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (i32 imm:$SIMM))))]>;
3314 //===----------------------------------------------------------------------===//
3316 //===----------------------------------------------------------------------===//
3318 // Abbreviations used in multiclass suffixes:
3319 // Q = quarter int (8 bit) elements
3320 // H = half int (16 bit) elements
3321 // S = single int (32 bit) elements
3322 // D = double int (64 bit) elements
3324 // Neon 2-register vector operations and intrinsics.
3326 // Neon 2-register comparisons.
3327 // source operand element sizes of 8, 16 and 32 bits:
3328 multiclass N2V_QHS_cmp<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
3329 bits<5> op11_7, bit op4, string opc, string Dt,
3330 string asm, PatFrag fc> {
3331 // 64-bit vector types.
3332 def v8i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 0, op4,
3333 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
3334 opc, !strconcat(Dt, "8"), asm, "",
3335 [(set DPR:$Vd, (v8i8 (ARMvcmpz (v8i8 DPR:$Vm), fc)))]>;
3336 def v4i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
3337 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
3338 opc, !strconcat(Dt, "16"), asm, "",
3339 [(set DPR:$Vd, (v4i16 (ARMvcmpz (v4i16 DPR:$Vm), fc)))]>;
3340 def v2i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
3341 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
3342 opc, !strconcat(Dt, "32"), asm, "",
3343 [(set DPR:$Vd, (v2i32 (ARMvcmpz (v2i32 DPR:$Vm), fc)))]>;
3344 def v2f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
3345 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
3346 opc, "f32", asm, "",
3347 [(set DPR:$Vd, (v2i32 (ARMvcmpz (v2f32 DPR:$Vm), fc)))]> {
3348 let Inst{10} = 1; // overwrite F = 1
3350 def v4f16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
3351 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
3352 opc, "f16", asm, "",
3353 [(set DPR:$Vd, (v4i16 (ARMvcmpz (v4f16 DPR:$Vm), fc)))]>,
3354 Requires<[HasNEON,HasFullFP16]> {
3355 let Inst{10} = 1; // overwrite F = 1
3358 // 128-bit vector types.
3359 def v16i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 1, op4,
3360 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
3361 opc, !strconcat(Dt, "8"), asm, "",
3362 [(set QPR:$Vd, (v16i8 (ARMvcmpz (v16i8 QPR:$Vm), fc)))]>;
3363 def v8i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
3364 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
3365 opc, !strconcat(Dt, "16"), asm, "",
3366 [(set QPR:$Vd, (v8i16 (ARMvcmpz (v8i16 QPR:$Vm), fc)))]>;
3367 def v4i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
3368 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
3369 opc, !strconcat(Dt, "32"), asm, "",
3370 [(set QPR:$Vd, (v4i32 (ARMvcmpz (v4i32 QPR:$Vm), fc)))]>;
3371 def v4f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
3372 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
3373 opc, "f32", asm, "",
3374 [(set QPR:$Vd, (v4i32 (ARMvcmpz (v4f32 QPR:$Vm), fc)))]> {
3375 let Inst{10} = 1; // overwrite F = 1
3377 def v8f16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
3378 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
3379 opc, "f16", asm, "",
3380 [(set QPR:$Vd, (v8i16 (ARMvcmpz (v8f16 QPR:$Vm), fc)))]>,
3381 Requires<[HasNEON,HasFullFP16]> {
3382 let Inst{10} = 1; // overwrite F = 1
3386 // Neon 3-register comparisons.
3387 class N3VQ_cmp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3388 InstrItinClass itin, string OpcodeStr, string Dt,
3389 ValueType ResTy, ValueType OpTy, PatFrag fc, bit Commutable>
3390 : N3V<op24, op23, op21_20, op11_8, 1, op4,
3391 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
3392 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3393 [(set QPR:$Vd, (ResTy (ARMvcmp (OpTy QPR:$Vn), (OpTy QPR:$Vm), fc)))]> {
3394 // All of these have a two-operand InstAlias.
3395 let TwoOperandAliasConstraint = "$Vn = $Vd";
3396 let isCommutable = Commutable;
3399 class N3VD_cmp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3400 InstrItinClass itin, string OpcodeStr, string Dt,
3401 ValueType ResTy, ValueType OpTy, PatFrag fc, bit Commutable>
3402 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3403 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
3404 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3405 [(set DPR:$Vd, (ResTy (ARMvcmp (OpTy DPR:$Vn), (OpTy DPR:$Vm), fc)))]> {
3406 // All of these have a two-operand InstAlias.
3407 let TwoOperandAliasConstraint = "$Vn = $Vd";
3408 let isCommutable = Commutable;
3411 multiclass N3V_QHS_cmp<bit op24, bit op23, bits<4> op11_8, bit op4,
3412 InstrItinClass itinD16, InstrItinClass itinD32,
3413 InstrItinClass itinQ16, InstrItinClass itinQ32,
3414 string OpcodeStr, string Dt,
3415 PatFrag fc, bit Commutable = 0> {
3416 // 64-bit vector types.
3417 def v8i8 : N3VD_cmp<op24, op23, 0b00, op11_8, op4, itinD16,
3418 OpcodeStr, !strconcat(Dt, "8"),
3419 v8i8, v8i8, fc, Commutable>;
3420 def v4i16 : N3VD_cmp<op24, op23, 0b01, op11_8, op4, itinD16,
3421 OpcodeStr, !strconcat(Dt, "16"),
3422 v4i16, v4i16, fc, Commutable>;
3423 def v2i32 : N3VD_cmp<op24, op23, 0b10, op11_8, op4, itinD32,
3424 OpcodeStr, !strconcat(Dt, "32"),
3425 v2i32, v2i32, fc, Commutable>;
3427 // 128-bit vector types.
3428 def v16i8 : N3VQ_cmp<op24, op23, 0b00, op11_8, op4, itinQ16,
3429 OpcodeStr, !strconcat(Dt, "8"),
3430 v16i8, v16i8, fc, Commutable>;
3431 def v8i16 : N3VQ_cmp<op24, op23, 0b01, op11_8, op4, itinQ16,
3432 OpcodeStr, !strconcat(Dt, "16"),
3433 v8i16, v8i16, fc, Commutable>;
3434 def v4i32 : N3VQ_cmp<op24, op23, 0b10, op11_8, op4, itinQ32,
3435 OpcodeStr, !strconcat(Dt, "32"),
3436 v4i32, v4i32, fc, Commutable>;
3440 // Neon 2-register vector intrinsics,
3441 // element sizes of 8, 16 and 32 bits:
3442 multiclass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
3443 bits<5> op11_7, bit op4,
3444 InstrItinClass itinD, InstrItinClass itinQ,
3445 string OpcodeStr, string Dt, SDPatternOperator IntOp> {
3446 // 64-bit vector types.
3447 def v8i8 : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3448 itinD, OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
3449 def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3450 itinD, OpcodeStr, !strconcat(Dt, "16"),v4i16,v4i16,IntOp>;
3451 def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3452 itinD, OpcodeStr, !strconcat(Dt, "32"),v2i32,v2i32,IntOp>;
3454 // 128-bit vector types.
3455 def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3456 itinQ, OpcodeStr, !strconcat(Dt, "8"), v16i8,v16i8,IntOp>;
3457 def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3458 itinQ, OpcodeStr, !strconcat(Dt, "16"),v8i16,v8i16,IntOp>;
3459 def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3460 itinQ, OpcodeStr, !strconcat(Dt, "32"),v4i32,v4i32,IntOp>;
3464 // Neon Narrowing 2-register vector operations,
3465 // source operand element sizes of 16, 32 and 64 bits:
3466 multiclass N2VN_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
3467 bits<5> op11_7, bit op6, bit op4,
3468 InstrItinClass itin, string OpcodeStr, string Dt,
3470 def v8i8 : N2VN<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
3471 itin, OpcodeStr, !strconcat(Dt, "16"),
3472 v8i8, v8i16, OpNode>;
3473 def v4i16 : N2VN<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
3474 itin, OpcodeStr, !strconcat(Dt, "32"),
3475 v4i16, v4i32, OpNode>;
3476 def v2i32 : N2VN<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
3477 itin, OpcodeStr, !strconcat(Dt, "64"),
3478 v2i32, v2i64, OpNode>;
3481 // Neon Narrowing 2-register vector intrinsics,
3482 // source operand element sizes of 16, 32 and 64 bits:
3483 multiclass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
3484 bits<5> op11_7, bit op6, bit op4,
3485 InstrItinClass itin, string OpcodeStr, string Dt,
3486 SDPatternOperator IntOp> {
3487 def v8i8 : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
3488 itin, OpcodeStr, !strconcat(Dt, "16"),
3489 v8i8, v8i16, IntOp>;
3490 def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
3491 itin, OpcodeStr, !strconcat(Dt, "32"),
3492 v4i16, v4i32, IntOp>;
3493 def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
3494 itin, OpcodeStr, !strconcat(Dt, "64"),
3495 v2i32, v2i64, IntOp>;
3499 // Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
3500 // source operand element sizes of 16, 32 and 64 bits:
3501 multiclass N2VL_QHS<bits<2> op24_23, bits<5> op11_7, bit op6, bit op4,
3502 string OpcodeStr, string Dt, SDNode OpNode> {
3503 def v8i16 : N2VL<op24_23, 0b00, 0b10, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
3504 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode>;
3505 def v4i32 : N2VL<op24_23, 0b01, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
3506 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
3507 def v2i64 : N2VL<op24_23, 0b10, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
3508 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
3512 // Neon 3-register vector operations.
3514 // First with only element sizes of 8, 16 and 32 bits:
3515 multiclass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3516 InstrItinClass itinD16, InstrItinClass itinD32,
3517 InstrItinClass itinQ16, InstrItinClass itinQ32,
3518 string OpcodeStr, string Dt,
3519 SDNode OpNode, bit Commutable = 0> {
3520 // 64-bit vector types.
3521 def v8i8 : N3VD<op24, op23, 0b00, op11_8, op4, itinD16,
3522 OpcodeStr, !strconcat(Dt, "8"),
3523 v8i8, v8i8, OpNode, Commutable>;
3524 def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16,
3525 OpcodeStr, !strconcat(Dt, "16"),
3526 v4i16, v4i16, OpNode, Commutable>;
3527 def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32,
3528 OpcodeStr, !strconcat(Dt, "32"),
3529 v2i32, v2i32, OpNode, Commutable>;
3531 // 128-bit vector types.
3532 def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16,
3533 OpcodeStr, !strconcat(Dt, "8"),
3534 v16i8, v16i8, OpNode, Commutable>;
3535 def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16,
3536 OpcodeStr, !strconcat(Dt, "16"),
3537 v8i16, v8i16, OpNode, Commutable>;
3538 def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32,
3539 OpcodeStr, !strconcat(Dt, "32"),
3540 v4i32, v4i32, OpNode, Commutable>;
3543 multiclass N3VSL_HS<bits<4> op11_8, string OpcodeStr, SDNode ShOp> {
3544 def v4i16 : N3VDSL16<0b01, op11_8, OpcodeStr, "i16", v4i16, ShOp>;
3545 def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, OpcodeStr, "i32", v2i32, ShOp>;
3546 def v8i16 : N3VQSL16<0b01, op11_8, OpcodeStr, "i16", v8i16, v4i16, ShOp>;
3547 def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, OpcodeStr, "i32",
3548 v4i32, v2i32, ShOp>;
3551 // ....then also with element size 64 bits:
3552 multiclass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3553 InstrItinClass itinD, InstrItinClass itinQ,
3554 string OpcodeStr, string Dt,
3555 SDNode OpNode, bit Commutable = 0>
3556 : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ,
3557 OpcodeStr, Dt, OpNode, Commutable> {
3558 def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD,
3559 OpcodeStr, !strconcat(Dt, "64"),
3560 v1i64, v1i64, OpNode, Commutable>;
3561 def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ,
3562 OpcodeStr, !strconcat(Dt, "64"),
3563 v2i64, v2i64, OpNode, Commutable>;
3567 // Neon 3-register vector intrinsics.
3569 // First with only element sizes of 16 and 32 bits:
3570 multiclass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
3571 InstrItinClass itinD16, InstrItinClass itinD32,
3572 InstrItinClass itinQ16, InstrItinClass itinQ32,
3573 string OpcodeStr, string Dt,
3574 SDPatternOperator IntOp, bit Commutable = 0> {
3575 // 64-bit vector types.
3576 def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, f, itinD16,
3577 OpcodeStr, !strconcat(Dt, "16"),
3578 v4i16, v4i16, IntOp, Commutable>;
3579 def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, f, itinD32,
3580 OpcodeStr, !strconcat(Dt, "32"),
3581 v2i32, v2i32, IntOp, Commutable>;
3583 // 128-bit vector types.
3584 def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, f, itinQ16,
3585 OpcodeStr, !strconcat(Dt, "16"),
3586 v8i16, v8i16, IntOp, Commutable>;
3587 def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, f, itinQ32,
3588 OpcodeStr, !strconcat(Dt, "32"),
3589 v4i32, v4i32, IntOp, Commutable>;
3591 multiclass N3VInt_HSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
3592 InstrItinClass itinD16, InstrItinClass itinD32,
3593 InstrItinClass itinQ16, InstrItinClass itinQ32,
3594 string OpcodeStr, string Dt,
3595 SDPatternOperator IntOp> {
3596 // 64-bit vector types.
3597 def v4i16 : N3VDIntSh<op24, op23, 0b01, op11_8, op4, f, itinD16,
3598 OpcodeStr, !strconcat(Dt, "16"),
3599 v4i16, v4i16, IntOp>;
3600 def v2i32 : N3VDIntSh<op24, op23, 0b10, op11_8, op4, f, itinD32,
3601 OpcodeStr, !strconcat(Dt, "32"),
3602 v2i32, v2i32, IntOp>;
3604 // 128-bit vector types.
3605 def v8i16 : N3VQIntSh<op24, op23, 0b01, op11_8, op4, f, itinQ16,
3606 OpcodeStr, !strconcat(Dt, "16"),
3607 v8i16, v8i16, IntOp>;
3608 def v4i32 : N3VQIntSh<op24, op23, 0b10, op11_8, op4, f, itinQ32,
3609 OpcodeStr, !strconcat(Dt, "32"),
3610 v4i32, v4i32, IntOp>;
3613 multiclass N3VIntSL_HS<bits<4> op11_8,
3614 InstrItinClass itinD16, InstrItinClass itinD32,
3615 InstrItinClass itinQ16, InstrItinClass itinQ32,
3616 string OpcodeStr, string Dt, SDPatternOperator IntOp> {
3617 def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16,
3618 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp>;
3619 def v2i32 : N3VDIntSL<0b10, op11_8, itinD32,
3620 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp>;
3621 def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16,
3622 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16, IntOp>;
3623 def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32,
3624 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32, IntOp>;
3627 // ....then also with element size of 8 bits:
3628 multiclass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
3629 InstrItinClass itinD16, InstrItinClass itinD32,
3630 InstrItinClass itinQ16, InstrItinClass itinQ32,
3631 string OpcodeStr, string Dt,
3632 SDPatternOperator IntOp, bit Commutable = 0>
3633 : N3VInt_HS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
3634 OpcodeStr, Dt, IntOp, Commutable> {
3635 def v8i8 : N3VDInt<op24, op23, 0b00, op11_8, op4, f, itinD16,
3636 OpcodeStr, !strconcat(Dt, "8"),
3637 v8i8, v8i8, IntOp, Commutable>;
3638 def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, f, itinQ16,
3639 OpcodeStr, !strconcat(Dt, "8"),
3640 v16i8, v16i8, IntOp, Commutable>;
3642 multiclass N3VInt_QHSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
3643 InstrItinClass itinD16, InstrItinClass itinD32,
3644 InstrItinClass itinQ16, InstrItinClass itinQ32,
3645 string OpcodeStr, string Dt,
3646 SDPatternOperator IntOp>
3647 : N3VInt_HSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
3648 OpcodeStr, Dt, IntOp> {
3649 def v8i8 : N3VDIntSh<op24, op23, 0b00, op11_8, op4, f, itinD16,
3650 OpcodeStr, !strconcat(Dt, "8"),
3652 def v16i8 : N3VQIntSh<op24, op23, 0b00, op11_8, op4, f, itinQ16,
3653 OpcodeStr, !strconcat(Dt, "8"),
3654 v16i8, v16i8, IntOp>;
3658 // ....then also with element size of 64 bits:
3659 multiclass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
3660 InstrItinClass itinD16, InstrItinClass itinD32,
3661 InstrItinClass itinQ16, InstrItinClass itinQ32,
3662 string OpcodeStr, string Dt,
3663 SDPatternOperator IntOp, bit Commutable = 0>
3664 : N3VInt_QHS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
3665 OpcodeStr, Dt, IntOp, Commutable> {
3666 def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, f, itinD32,
3667 OpcodeStr, !strconcat(Dt, "64"),
3668 v1i64, v1i64, IntOp, Commutable>;
3669 def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, f, itinQ32,
3670 OpcodeStr, !strconcat(Dt, "64"),
3671 v2i64, v2i64, IntOp, Commutable>;
3673 multiclass N3VInt_QHSDSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
3674 InstrItinClass itinD16, InstrItinClass itinD32,
3675 InstrItinClass itinQ16, InstrItinClass itinQ32,
3676 string OpcodeStr, string Dt,
3677 SDPatternOperator IntOp>
3678 : N3VInt_QHSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
3679 OpcodeStr, Dt, IntOp> {
3680 def v1i64 : N3VDIntSh<op24, op23, 0b11, op11_8, op4, f, itinD32,
3681 OpcodeStr, !strconcat(Dt, "64"),
3682 v1i64, v1i64, IntOp>;
3683 def v2i64 : N3VQIntSh<op24, op23, 0b11, op11_8, op4, f, itinQ32,
3684 OpcodeStr, !strconcat(Dt, "64"),
3685 v2i64, v2i64, IntOp>;
3688 // Neon Narrowing 3-register vector intrinsics,
3689 // source operand element sizes of 16, 32 and 64 bits:
3690 multiclass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3691 string OpcodeStr, string Dt,
3692 SDPatternOperator IntOp, bit Commutable = 0> {
3693 def v8i8 : N3VNInt<op24, op23, 0b00, op11_8, op4,
3694 OpcodeStr, !strconcat(Dt, "16"),
3695 v8i8, v8i16, IntOp, Commutable>;
3696 def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4,
3697 OpcodeStr, !strconcat(Dt, "32"),
3698 v4i16, v4i32, IntOp, Commutable>;
3699 def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4,
3700 OpcodeStr, !strconcat(Dt, "64"),
3701 v2i32, v2i64, IntOp, Commutable>;
3705 // Neon Long 3-register vector operations.
3707 multiclass N3VL_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3708 InstrItinClass itin16, InstrItinClass itin32,
3709 string OpcodeStr, string Dt,
3710 SDNode OpNode, bit Commutable = 0> {
3711 def v8i16 : N3VL<op24, op23, 0b00, op11_8, op4, itin16,
3712 OpcodeStr, !strconcat(Dt, "8"),
3713 v8i16, v8i8, OpNode, Commutable>;
3714 def v4i32 : N3VL<op24, op23, 0b01, op11_8, op4, itin16,
3715 OpcodeStr, !strconcat(Dt, "16"),
3716 v4i32, v4i16, OpNode, Commutable>;
3717 def v2i64 : N3VL<op24, op23, 0b10, op11_8, op4, itin32,
3718 OpcodeStr, !strconcat(Dt, "32"),
3719 v2i64, v2i32, OpNode, Commutable>;
3722 multiclass N3VLSL_HS<bit op24, bits<4> op11_8,
3723 InstrItinClass itin, string OpcodeStr, string Dt,
3725 def v4i16 : N3VLSL16<op24, 0b01, op11_8, itin, OpcodeStr,
3726 !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
3727 def v2i32 : N3VLSL<op24, 0b10, op11_8, itin, OpcodeStr,
3728 !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
3731 multiclass N3VLExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3732 InstrItinClass itin16, InstrItinClass itin32,
3733 string OpcodeStr, string Dt,
3734 SDNode OpNode, SDPatternOperator ExtOp, bit Commutable = 0> {
3735 def v8i16 : N3VLExt<op24, op23, 0b00, op11_8, op4, itin16,
3736 OpcodeStr, !strconcat(Dt, "8"),
3737 v8i16, v8i8, OpNode, ExtOp, Commutable>;
3738 def v4i32 : N3VLExt<op24, op23, 0b01, op11_8, op4, itin16,
3739 OpcodeStr, !strconcat(Dt, "16"),
3740 v4i32, v4i16, OpNode, ExtOp, Commutable>;
3741 def v2i64 : N3VLExt<op24, op23, 0b10, op11_8, op4, itin32,
3742 OpcodeStr, !strconcat(Dt, "32"),
3743 v2i64, v2i32, OpNode, ExtOp, Commutable>;
3746 // Neon Long 3-register vector intrinsics.
3748 // First with only element sizes of 16 and 32 bits:
3749 multiclass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
3750 InstrItinClass itin16, InstrItinClass itin32,
3751 string OpcodeStr, string Dt,
3752 SDPatternOperator IntOp, bit Commutable = 0> {
3753 def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin16,
3754 OpcodeStr, !strconcat(Dt, "16"),
3755 v4i32, v4i16, IntOp, Commutable>;
3756 def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin32,
3757 OpcodeStr, !strconcat(Dt, "32"),
3758 v2i64, v2i32, IntOp, Commutable>;
3761 multiclass N3VLIntSL_HS<bit op24, bits<4> op11_8,
3762 InstrItinClass itin, string OpcodeStr, string Dt,
3763 SDPatternOperator IntOp> {
3764 def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin,
3765 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
3766 def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin,
3767 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
3770 // ....then also with element size of 8 bits:
3771 multiclass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3772 InstrItinClass itin16, InstrItinClass itin32,
3773 string OpcodeStr, string Dt,
3774 SDPatternOperator IntOp, bit Commutable = 0>
3775 : N3VLInt_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt,
3776 IntOp, Commutable> {
3777 def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin16,
3778 OpcodeStr, !strconcat(Dt, "8"),
3779 v8i16, v8i8, IntOp, Commutable>;
3782 // ....with explicit extend (VABDL).
3783 multiclass N3VLIntExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3784 InstrItinClass itin, string OpcodeStr, string Dt,
3785 SDPatternOperator IntOp, SDNode ExtOp, bit Commutable = 0> {
3786 def v8i16 : N3VLIntExt<op24, op23, 0b00, op11_8, op4, itin,
3787 OpcodeStr, !strconcat(Dt, "8"),
3788 v8i16, v8i8, IntOp, ExtOp, Commutable>;
3789 def v4i32 : N3VLIntExt<op24, op23, 0b01, op11_8, op4, itin,
3790 OpcodeStr, !strconcat(Dt, "16"),
3791 v4i32, v4i16, IntOp, ExtOp, Commutable>;
3792 def v2i64 : N3VLIntExt<op24, op23, 0b10, op11_8, op4, itin,
3793 OpcodeStr, !strconcat(Dt, "32"),
3794 v2i64, v2i32, IntOp, ExtOp, Commutable>;
3798 // Neon Wide 3-register vector intrinsics,
3799 // source operand element sizes of 8, 16 and 32 bits:
3800 multiclass N3VW_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3801 string OpcodeStr, string Dt,
3802 SDNode OpNode, SDPatternOperator ExtOp, bit Commutable = 0> {
3803 def v8i16 : N3VW<op24, op23, 0b00, op11_8, op4,
3804 OpcodeStr, !strconcat(Dt, "8"),
3805 v8i16, v8i8, OpNode, ExtOp, Commutable>;
3806 def v4i32 : N3VW<op24, op23, 0b01, op11_8, op4,
3807 OpcodeStr, !strconcat(Dt, "16"),
3808 v4i32, v4i16, OpNode, ExtOp, Commutable>;
3809 def v2i64 : N3VW<op24, op23, 0b10, op11_8, op4,
3810 OpcodeStr, !strconcat(Dt, "32"),
3811 v2i64, v2i32, OpNode, ExtOp, Commutable>;
3815 // Neon Multiply-Op vector operations,
3816 // element sizes of 8, 16 and 32 bits:
3817 multiclass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3818 InstrItinClass itinD16, InstrItinClass itinD32,
3819 InstrItinClass itinQ16, InstrItinClass itinQ32,
3820 string OpcodeStr, string Dt, SDNode OpNode> {
3821 // 64-bit vector types.
3822 def v8i8 : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16,
3823 OpcodeStr, !strconcat(Dt, "8"), v8i8, mul, OpNode>;
3824 def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16,
3825 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, OpNode>;
3826 def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32,
3827 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, OpNode>;
3829 // 128-bit vector types.
3830 def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16,
3831 OpcodeStr, !strconcat(Dt, "8"), v16i8, mul, OpNode>;
3832 def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16,
3833 OpcodeStr, !strconcat(Dt, "16"), v8i16, mul, OpNode>;
3834 def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32,
3835 OpcodeStr, !strconcat(Dt, "32"), v4i32, mul, OpNode>;
3838 multiclass N3VMulOpSL_HS<bits<4> op11_8,
3839 InstrItinClass itinD16, InstrItinClass itinD32,
3840 InstrItinClass itinQ16, InstrItinClass itinQ32,
3841 string OpcodeStr, string Dt, SDPatternOperator ShOp> {
3842 def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16,
3843 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, ShOp>;
3844 def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32,
3845 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, ShOp>;
3846 def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16,
3847 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16,
3849 def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32,
3850 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32,
3854 // Neon Intrinsic-Op vector operations,
3855 // element sizes of 8, 16 and 32 bits:
3856 multiclass N3VIntOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3857 InstrItinClass itinD, InstrItinClass itinQ,
3858 string OpcodeStr, string Dt, SDPatternOperator IntOp,
3860 // 64-bit vector types.
3861 def v8i8 : N3VDIntOp<op24, op23, 0b00, op11_8, op4, itinD,
3862 OpcodeStr, !strconcat(Dt, "8"), v8i8, IntOp, OpNode>;
3863 def v4i16 : N3VDIntOp<op24, op23, 0b01, op11_8, op4, itinD,
3864 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp, OpNode>;
3865 def v2i32 : N3VDIntOp<op24, op23, 0b10, op11_8, op4, itinD,
3866 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp, OpNode>;
3868 // 128-bit vector types.
3869 def v16i8 : N3VQIntOp<op24, op23, 0b00, op11_8, op4, itinQ,
3870 OpcodeStr, !strconcat(Dt, "8"), v16i8, IntOp, OpNode>;
3871 def v8i16 : N3VQIntOp<op24, op23, 0b01, op11_8, op4, itinQ,
3872 OpcodeStr, !strconcat(Dt, "16"), v8i16, IntOp, OpNode>;
3873 def v4i32 : N3VQIntOp<op24, op23, 0b10, op11_8, op4, itinQ,
3874 OpcodeStr, !strconcat(Dt, "32"), v4i32, IntOp, OpNode>;
3877 // Neon 3-argument intrinsics,
3878 // element sizes of 16 and 32 bits:
3879 multiclass N3VInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
3880 InstrItinClass itinD16, InstrItinClass itinD32,
3881 InstrItinClass itinQ16, InstrItinClass itinQ32,
3882 string OpcodeStr, string Dt, SDPatternOperator IntOp> {
3883 // 64-bit vector types.
3884 def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, itinD16,
3885 OpcodeStr, !strconcat(Dt, "16"), v4i16, v4i16, IntOp>;
3886 def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, itinD32,
3887 OpcodeStr, !strconcat(Dt, "32"), v2i32, v2i32, IntOp>;
3889 // 128-bit vector types.
3890 def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, itinQ16,
3891 OpcodeStr, !strconcat(Dt, "16"), v8i16, v8i16, IntOp>;
3892 def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, itinQ32,
3893 OpcodeStr, !strconcat(Dt, "32"), v4i32, v4i32, IntOp>;
3896 // element sizes of 8, 16 and 32 bits:
3897 multiclass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3898 InstrItinClass itinD16, InstrItinClass itinD32,
3899 InstrItinClass itinQ16, InstrItinClass itinQ32,
3900 string OpcodeStr, string Dt, SDPatternOperator IntOp>
3901 :N3VInt3_HS <op24, op23, op11_8, op4, itinD16, itinD32,
3902 itinQ16, itinQ32, OpcodeStr, Dt, IntOp>{
3903 // 64-bit vector types.
3904 def v8i8 : N3VDInt3<op24, op23, 0b00, op11_8, op4, itinD16,
3905 OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
3906 // 128-bit vector types.
3907 def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, itinQ16,
3908 OpcodeStr, !strconcat(Dt, "8"), v16i8, v16i8, IntOp>;
3911 // Neon Long Multiply-Op vector operations,
3912 // element sizes of 8, 16 and 32 bits:
3913 multiclass N3VLMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3914 InstrItinClass itin16, InstrItinClass itin32,
3915 string OpcodeStr, string Dt, SDNode MulOp,
3917 def v8i16 : N3VLMulOp<op24, op23, 0b00, op11_8, op4, itin16, OpcodeStr,
3918 !strconcat(Dt, "8"), v8i16, v8i8, MulOp, OpNode>;
3919 def v4i32 : N3VLMulOp<op24, op23, 0b01, op11_8, op4, itin16, OpcodeStr,
3920 !strconcat(Dt, "16"), v4i32, v4i16, MulOp, OpNode>;
3921 def v2i64 : N3VLMulOp<op24, op23, 0b10, op11_8, op4, itin32, OpcodeStr,
3922 !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
3925 multiclass N3VLMulOpSL_HS<bit op24, bits<4> op11_8, string OpcodeStr,
3926 string Dt, SDNode MulOp, SDNode OpNode> {
3927 def v4i16 : N3VLMulOpSL16<op24, 0b01, op11_8, IIC_VMACi16D, OpcodeStr,
3928 !strconcat(Dt,"16"), v4i32, v4i16, MulOp, OpNode>;
3929 def v2i32 : N3VLMulOpSL<op24, 0b10, op11_8, IIC_VMACi32D, OpcodeStr,
3930 !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
3934 // Neon Long 3-argument intrinsics.
3936 // First with only element sizes of 16 and 32 bits:
3937 multiclass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
3938 InstrItinClass itin16, InstrItinClass itin32,
3939 string OpcodeStr, string Dt, SDPatternOperator IntOp> {
3940 def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, itin16,
3941 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
3942 def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, itin32,
3943 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
3946 multiclass N3VLInt3SL_HS<bit op24, bits<4> op11_8,
3947 string OpcodeStr, string Dt, SDPatternOperator IntOp> {
3948 def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D,
3949 OpcodeStr, !strconcat(Dt,"16"), v4i32, v4i16, IntOp>;
3950 def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D,
3951 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
3954 // ....then also with element size of 8 bits:
3955 multiclass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3956 InstrItinClass itin16, InstrItinClass itin32,
3957 string OpcodeStr, string Dt, SDPatternOperator IntOp>
3958 : N3VLInt3_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt, IntOp> {
3959 def v8i16 : N3VLInt3<op24, op23, 0b00, op11_8, op4, itin16,
3960 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, IntOp>;
3963 // ....with explicit extend (VABAL).
3964 multiclass N3VLIntExtOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3965 InstrItinClass itin, string OpcodeStr, string Dt,
3966 SDPatternOperator IntOp, SDNode ExtOp, SDNode OpNode> {
3967 def v8i16 : N3VLIntExtOp<op24, op23, 0b00, op11_8, op4, itin,
3968 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8,
3969 IntOp, ExtOp, OpNode>;
3970 def v4i32 : N3VLIntExtOp<op24, op23, 0b01, op11_8, op4, itin,
3971 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16,
3972 IntOp, ExtOp, OpNode>;
3973 def v2i64 : N3VLIntExtOp<op24, op23, 0b10, op11_8, op4, itin,
3974 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32,
3975 IntOp, ExtOp, OpNode>;
3979 // Neon Pairwise long 2-register intrinsics,
3980 // element sizes of 8, 16 and 32 bits:
3981 multiclass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
3982 bits<5> op11_7, bit op4,
3983 string OpcodeStr, string Dt, SDPatternOperator IntOp> {
3984 // 64-bit vector types.
3985 def v8i8 : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3986 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
3987 def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3988 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
3989 def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3990 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
3992 // 128-bit vector types.
3993 def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3994 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
3995 def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3996 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
3997 def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3998 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
4002 // Neon Pairwise long 2-register accumulate intrinsics,
4003 // element sizes of 8, 16 and 32 bits:
4004 multiclass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
4005 bits<5> op11_7, bit op4,
4006 string OpcodeStr, string Dt, SDPatternOperator IntOp> {
4007 // 64-bit vector types.
4008 def v8i8 : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
4009 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
4010 def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
4011 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
4012 def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
4013 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
4015 // 128-bit vector types.
4016 def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
4017 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
4018 def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
4019 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
4020 def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
4021 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
4025 // Neon 2-register vector shift by immediate,
4026 // with f of either N2RegVShLFrm or N2RegVShRFrm
4027 // element sizes of 8, 16, 32 and 64 bits:
4028 multiclass N2VShL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
4029 InstrItinClass itin, string OpcodeStr, string Dt,
4031 // 64-bit vector types.
4032 def v8i8 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
4033 OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
4034 let Inst{21-19} = 0b001; // imm6 = 001xxx
4036 def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
4037 OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
4038 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4040 def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
4041 OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
4042 let Inst{21} = 0b1; // imm6 = 1xxxxx
4044 def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
4045 OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
4048 // 128-bit vector types.
4049 def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
4050 OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
4051 let Inst{21-19} = 0b001; // imm6 = 001xxx
4053 def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
4054 OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
4055 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4057 def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
4058 OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
4059 let Inst{21} = 0b1; // imm6 = 1xxxxx
4061 def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
4062 OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
4065 multiclass N2VShR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
4066 InstrItinClass itin, string OpcodeStr, string Dt,
4068 // 64-bit vector types.
4069 def v8i8 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
4070 OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
4071 let Inst{21-19} = 0b001; // imm6 = 001xxx
4073 def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
4074 OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
4075 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4077 def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
4078 OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
4079 let Inst{21} = 0b1; // imm6 = 1xxxxx
4081 def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
4082 OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
4085 // 128-bit vector types.
4086 def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
4087 OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
4088 let Inst{21-19} = 0b001; // imm6 = 001xxx
4090 def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
4091 OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
4092 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4094 def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
4095 OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
4096 let Inst{21} = 0b1; // imm6 = 1xxxxx
4098 def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
4099 OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
4103 // Neon Shift-Accumulate vector operations,
4104 // element sizes of 8, 16, 32 and 64 bits:
4105 multiclass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
4106 string OpcodeStr, string Dt, SDNode ShOp> {
4107 // 64-bit vector types.
4108 def v8i8 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
4109 OpcodeStr, !strconcat(Dt, "8"), v8i8, ShOp> {
4110 let Inst{21-19} = 0b001; // imm6 = 001xxx
4112 def v4i16 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
4113 OpcodeStr, !strconcat(Dt, "16"), v4i16, ShOp> {
4114 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4116 def v2i32 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
4117 OpcodeStr, !strconcat(Dt, "32"), v2i32, ShOp> {
4118 let Inst{21} = 0b1; // imm6 = 1xxxxx
4120 def v1i64 : N2VDShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
4121 OpcodeStr, !strconcat(Dt, "64"), v1i64, ShOp>;
4124 // 128-bit vector types.
4125 def v16i8 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
4126 OpcodeStr, !strconcat(Dt, "8"), v16i8, ShOp> {
4127 let Inst{21-19} = 0b001; // imm6 = 001xxx
4129 def v8i16 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
4130 OpcodeStr, !strconcat(Dt, "16"), v8i16, ShOp> {
4131 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4133 def v4i32 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
4134 OpcodeStr, !strconcat(Dt, "32"), v4i32, ShOp> {
4135 let Inst{21} = 0b1; // imm6 = 1xxxxx
4137 def v2i64 : N2VQShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
4138 OpcodeStr, !strconcat(Dt, "64"), v2i64, ShOp>;
4142 // Neon Shift-Insert vector operations,
4143 // with f of either N2RegVShLFrm or N2RegVShRFrm
4144 // element sizes of 8, 16, 32 and 64 bits:
4145 multiclass N2VShInsL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
4147 // 64-bit vector types.
4148 def v8i8 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
4149 N2RegVShLFrm, OpcodeStr, "8", v8i8, NEONvsliImm> {
4150 let Inst{21-19} = 0b001; // imm6 = 001xxx
4152 def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
4153 N2RegVShLFrm, OpcodeStr, "16", v4i16, NEONvsliImm> {
4154 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4156 def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
4157 N2RegVShLFrm, OpcodeStr, "32", v2i32, NEONvsliImm> {
4158 let Inst{21} = 0b1; // imm6 = 1xxxxx
4160 def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, i32imm,
4161 N2RegVShLFrm, OpcodeStr, "64", v1i64, NEONvsliImm>;
4164 // 128-bit vector types.
4165 def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
4166 N2RegVShLFrm, OpcodeStr, "8", v16i8, NEONvsliImm> {
4167 let Inst{21-19} = 0b001; // imm6 = 001xxx
4169 def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
4170 N2RegVShLFrm, OpcodeStr, "16", v8i16, NEONvsliImm> {
4171 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4173 def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
4174 N2RegVShLFrm, OpcodeStr, "32", v4i32, NEONvsliImm> {
4175 let Inst{21} = 0b1; // imm6 = 1xxxxx
4177 def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, i32imm,
4178 N2RegVShLFrm, OpcodeStr, "64", v2i64, NEONvsliImm>;
4181 multiclass N2VShInsR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
4183 // 64-bit vector types.
4184 def v8i8 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm8,
4185 N2RegVShRFrm, OpcodeStr, "8", v8i8, NEONvsriImm> {
4186 let Inst{21-19} = 0b001; // imm6 = 001xxx
4188 def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm16,
4189 N2RegVShRFrm, OpcodeStr, "16", v4i16, NEONvsriImm> {
4190 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4192 def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm32,
4193 N2RegVShRFrm, OpcodeStr, "32", v2i32, NEONvsriImm> {
4194 let Inst{21} = 0b1; // imm6 = 1xxxxx
4196 def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, shr_imm64,
4197 N2RegVShRFrm, OpcodeStr, "64", v1i64, NEONvsriImm>;
4200 // 128-bit vector types.
4201 def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm8,
4202 N2RegVShRFrm, OpcodeStr, "8", v16i8, NEONvsriImm> {
4203 let Inst{21-19} = 0b001; // imm6 = 001xxx
4205 def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm16,
4206 N2RegVShRFrm, OpcodeStr, "16", v8i16, NEONvsriImm> {
4207 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4209 def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm32,
4210 N2RegVShRFrm, OpcodeStr, "32", v4i32, NEONvsriImm> {
4211 let Inst{21} = 0b1; // imm6 = 1xxxxx
4213 def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, shr_imm64,
4214 N2RegVShRFrm, OpcodeStr, "64", v2i64, NEONvsriImm>;
4218 // Neon Shift Long operations,
4219 // element sizes of 8, 16, 32 bits:
4220 multiclass N2VLSh_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
4221 bit op4, string OpcodeStr, string Dt,
4222 SDPatternOperator OpNode> {
4223 def v8i16 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
4224 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, imm1_7, OpNode> {
4225 let Inst{21-19} = 0b001; // imm6 = 001xxx
4227 def v4i32 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
4228 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, imm1_15, OpNode> {
4229 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4231 def v2i64 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
4232 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, imm1_31, OpNode> {
4233 let Inst{21} = 0b1; // imm6 = 1xxxxx
4237 // Neon Shift Narrow operations,
4238 // element sizes of 16, 32, 64 bits:
4239 multiclass N2VNSh_HSD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
4240 bit op4, InstrItinClass itin, string OpcodeStr, string Dt,
4241 SDPatternOperator OpNode> {
4242 def v8i8 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
4243 OpcodeStr, !strconcat(Dt, "16"),
4244 v8i8, v8i16, shr_imm8, OpNode> {
4245 let Inst{21-19} = 0b001; // imm6 = 001xxx
4247 def v4i16 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
4248 OpcodeStr, !strconcat(Dt, "32"),
4249 v4i16, v4i32, shr_imm16, OpNode> {
4250 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4252 def v2i32 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
4253 OpcodeStr, !strconcat(Dt, "64"),
4254 v2i32, v2i64, shr_imm32, OpNode> {
4255 let Inst{21} = 0b1; // imm6 = 1xxxxx
4259 //===----------------------------------------------------------------------===//
4260 // Instruction Definitions.
4261 //===----------------------------------------------------------------------===//
4263 // Vector Add Operations.
4265 // VADD : Vector Add (integer and floating-point)
4266 defm VADD : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd", "i",
4268 def VADDfd : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd", "f32",
4269 v2f32, v2f32, fadd, 1>;
4270 def VADDfq : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd", "f32",
4271 v4f32, v4f32, fadd, 1>;
4272 def VADDhd : N3VD<0, 0, 0b01, 0b1101, 0, IIC_VBIND, "vadd", "f16",
4273 v4f16, v4f16, fadd, 1>,
4274 Requires<[HasNEON,HasFullFP16]>;
4275 def VADDhq : N3VQ<0, 0, 0b01, 0b1101, 0, IIC_VBINQ, "vadd", "f16",
4276 v8f16, v8f16, fadd, 1>,
4277 Requires<[HasNEON,HasFullFP16]>;
4278 // VADDL : Vector Add Long (Q = D + D)
4279 defm VADDLs : N3VLExt_QHS<0,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
4280 "vaddl", "s", add, sext, 1>;
4281 defm VADDLu : N3VLExt_QHS<1,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
4282 "vaddl", "u", add, zanyext, 1>;
4283 // VADDW : Vector Add Wide (Q = Q + D)
4284 defm VADDWs : N3VW_QHS<0,1,0b0001,0, "vaddw", "s", add, sext, 0>;
4285 defm VADDWu : N3VW_QHS<1,1,0b0001,0, "vaddw", "u", add, zanyext, 0>;
4286 // VHADD : Vector Halving Add
4287 defm VHADDs : N3VInt_QHS<0, 0, 0b0000, 0, N3RegFrm,
4288 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4289 "vhadd", "s", int_arm_neon_vhadds, 1>;
4290 defm VHADDu : N3VInt_QHS<1, 0, 0b0000, 0, N3RegFrm,
4291 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4292 "vhadd", "u", int_arm_neon_vhaddu, 1>;
4293 // VRHADD : Vector Rounding Halving Add
4294 defm VRHADDs : N3VInt_QHS<0, 0, 0b0001, 0, N3RegFrm,
4295 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4296 "vrhadd", "s", int_arm_neon_vrhadds, 1>;
4297 defm VRHADDu : N3VInt_QHS<1, 0, 0b0001, 0, N3RegFrm,
4298 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4299 "vrhadd", "u", int_arm_neon_vrhaddu, 1>;
4300 // VQADD : Vector Saturating Add
4301 defm VQADDs : N3VInt_QHSD<0, 0, 0b0000, 1, N3RegFrm,
4302 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4303 "vqadd", "s", saddsat, 1>;
4304 defm VQADDu : N3VInt_QHSD<1, 0, 0b0000, 1, N3RegFrm,
4305 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4306 "vqadd", "u", uaddsat, 1>;
4307 // VADDHN : Vector Add and Narrow Returning High Half (D = Q + Q)
4308 defm VADDHN : N3VNInt_HSD<0,1,0b0100,0, "vaddhn", "i", null_frag, 1>;
4309 // VRADDHN : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
4310 defm VRADDHN : N3VNInt_HSD<1,1,0b0100,0, "vraddhn", "i",
4311 int_arm_neon_vraddhn, 1>;
4313 let Predicates = [HasNEON] in {
4314 def : Pat<(v8i8 (trunc (ARMvshruImm (add (v8i16 QPR:$Vn), QPR:$Vm), 8))),
4315 (VADDHNv8i8 QPR:$Vn, QPR:$Vm)>;
4316 def : Pat<(v4i16 (trunc (ARMvshruImm (add (v4i32 QPR:$Vn), QPR:$Vm), 16))),
4317 (VADDHNv4i16 QPR:$Vn, QPR:$Vm)>;
4318 def : Pat<(v2i32 (trunc (ARMvshruImm (add (v2i64 QPR:$Vn), QPR:$Vm), 32))),
4319 (VADDHNv2i32 QPR:$Vn, QPR:$Vm)>;
4322 // Vector Multiply Operations.
4324 // VMUL : Vector Multiply (integer, polynomial and floating-point)
4325 defm VMUL : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D,
4326 IIC_VMULi16Q, IIC_VMULi32Q, "vmul", "i", mul, 1>;
4327 def VMULpd : N3VDInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16D, "vmul",
4328 "p8", v8i8, v8i8, int_arm_neon_vmulp, 1>;
4329 def VMULpq : N3VQInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16Q, "vmul",
4330 "p8", v16i8, v16i8, int_arm_neon_vmulp, 1>;
4331 def VMULfd : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VFMULD, "vmul", "f32",
4332 v2f32, v2f32, fmul, 1>;
4333 def VMULfq : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VFMULQ, "vmul", "f32",
4334 v4f32, v4f32, fmul, 1>;
4335 def VMULhd : N3VD<1, 0, 0b01, 0b1101, 1, IIC_VFMULD, "vmul", "f16",
4336 v4f16, v4f16, fmul, 1>,
4337 Requires<[HasNEON,HasFullFP16]>;
4338 def VMULhq : N3VQ<1, 0, 0b01, 0b1101, 1, IIC_VFMULQ, "vmul", "f16",
4339 v8f16, v8f16, fmul, 1>,
4340 Requires<[HasNEON,HasFullFP16]>;
4341 defm VMULsl : N3VSL_HS<0b1000, "vmul", mul>;
4342 def VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul", "f32", v2f32, fmul>;
4343 def VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul", "f32", v4f32,
4345 def VMULslhd : N3VDSL16<0b01, 0b1001, "vmul", "f16", v4f16, fmul>,
4346 Requires<[HasNEON,HasFullFP16]>;
4347 def VMULslhq : N3VQSL16<0b01, 0b1001, "vmul", "f16", v8f16,
4349 Requires<[HasNEON,HasFullFP16]>;
4351 let Predicates = [HasNEON] in {
4352 def : Pat<(v8i16 (mul (v8i16 QPR:$src1),
4353 (v8i16 (ARMvduplane (v8i16 QPR:$src2), imm:$lane)))),
4354 (v8i16 (VMULslv8i16 (v8i16 QPR:$src1),
4355 (v4i16 (EXTRACT_SUBREG QPR:$src2,
4356 (DSubReg_i16_reg imm:$lane))),
4357 (SubReg_i16_lane imm:$lane)))>;
4358 def : Pat<(v4i32 (mul (v4i32 QPR:$src1),
4359 (v4i32 (ARMvduplane (v4i32 QPR:$src2), imm:$lane)))),
4360 (v4i32 (VMULslv4i32 (v4i32 QPR:$src1),
4361 (v2i32 (EXTRACT_SUBREG QPR:$src2,
4362 (DSubReg_i32_reg imm:$lane))),
4363 (SubReg_i32_lane imm:$lane)))>;
4364 def : Pat<(v4f32 (fmul (v4f32 QPR:$src1),
4365 (v4f32 (ARMvduplane (v4f32 QPR:$src2), imm:$lane)))),
4366 (v4f32 (VMULslfq (v4f32 QPR:$src1),
4367 (v2f32 (EXTRACT_SUBREG QPR:$src2,
4368 (DSubReg_i32_reg imm:$lane))),
4369 (SubReg_i32_lane imm:$lane)))>;
4370 def : Pat<(v8f16 (fmul (v8f16 QPR:$src1),
4371 (v8f16 (ARMvduplane (v8f16 QPR:$src2), imm:$lane)))),
4372 (v8f16 (VMULslhq(v8f16 QPR:$src1),
4373 (v4f16 (EXTRACT_SUBREG QPR:$src2,
4374 (DSubReg_i16_reg imm:$lane))),
4375 (SubReg_i16_lane imm:$lane)))>;
4377 def : Pat<(v2f32 (fmul DPR:$Rn, (ARMvdup (f32 SPR:$Rm)))),
4379 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$Rm, ssub_0),
4381 def : Pat<(v4f16 (fmul DPR:$Rn, (ARMvdup (f16 HPR:$Rm)))),
4383 (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), (f16 HPR:$Rm), ssub_0),
4385 def : Pat<(v4f32 (fmul QPR:$Rn, (ARMvdup (f32 SPR:$Rm)))),
4387 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$Rm, ssub_0),
4389 def : Pat<(v8f16 (fmul QPR:$Rn, (ARMvdup (f16 HPR:$Rm)))),
4391 (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), (f16 HPR:$Rm), ssub_0),
4395 // VQDMULH : Vector Saturating Doubling Multiply Returning High Half
4396 defm VQDMULH : N3VInt_HS<0, 0, 0b1011, 0, N3RegFrm, IIC_VMULi16D, IIC_VMULi32D,
4397 IIC_VMULi16Q, IIC_VMULi32Q,
4398 "vqdmulh", "s", int_arm_neon_vqdmulh, 1>;
4399 defm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D,
4400 IIC_VMULi16Q, IIC_VMULi32Q,
4401 "vqdmulh", "s", int_arm_neon_vqdmulh>;
4403 let Predicates = [HasNEON] in {
4404 def : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1),
4405 (v8i16 (ARMvduplane (v8i16 QPR:$src2),
4407 (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1),
4408 (v4i16 (EXTRACT_SUBREG QPR:$src2,
4409 (DSubReg_i16_reg imm:$lane))),
4410 (SubReg_i16_lane imm:$lane)))>;
4411 def : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1),
4412 (v4i32 (ARMvduplane (v4i32 QPR:$src2),
4414 (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1),
4415 (v2i32 (EXTRACT_SUBREG QPR:$src2,
4416 (DSubReg_i32_reg imm:$lane))),
4417 (SubReg_i32_lane imm:$lane)))>;
4420 // VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
4421 defm VQRDMULH : N3VInt_HS<1, 0, 0b1011, 0, N3RegFrm,
4422 IIC_VMULi16D,IIC_VMULi32D,IIC_VMULi16Q,IIC_VMULi32Q,
4423 "vqrdmulh", "s", int_arm_neon_vqrdmulh, 1>;
4424 defm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D,
4425 IIC_VMULi16Q, IIC_VMULi32Q,
4426 "vqrdmulh", "s", int_arm_neon_vqrdmulh>;
4428 let Predicates = [HasNEON] in {
4429 def : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1),
4430 (v8i16 (ARMvduplane (v8i16 QPR:$src2),
4432 (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1),
4433 (v4i16 (EXTRACT_SUBREG QPR:$src2,
4434 (DSubReg_i16_reg imm:$lane))),
4435 (SubReg_i16_lane imm:$lane)))>;
4436 def : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1),
4437 (v4i32 (ARMvduplane (v4i32 QPR:$src2),
4439 (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1),
4440 (v2i32 (EXTRACT_SUBREG QPR:$src2,
4441 (DSubReg_i32_reg imm:$lane))),
4442 (SubReg_i32_lane imm:$lane)))>;
4445 // VMULL : Vector Multiply Long (integer and polynomial) (Q = D * D)
4446 let PostEncoderMethod = "NEONThumb2DataIPostEncoder",
4447 DecoderNamespace = "NEONData" in {
4448 defm VMULLs : N3VL_QHS<0,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
4449 "vmull", "s", ARMvmulls, 1>;
4450 defm VMULLu : N3VL_QHS<1,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
4451 "vmull", "u", ARMvmullu, 1>;
4452 def VMULLp8 : N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull", "p8",
4453 v8i16, v8i8, int_arm_neon_vmullp, 1>;
4454 def VMULLp64 : N3VLIntnp<0b00101, 0b10, 0b1110, 0, 0, NoItinerary,
4455 "vmull", "p64", v2i64, v1i64, int_arm_neon_vmullp, 1>,
4456 Requires<[HasV8, HasAES]>;
4458 defm VMULLsls : N3VLSL_HS<0, 0b1010, IIC_VMULi16D, "vmull", "s", ARMvmulls>;
4459 defm VMULLslu : N3VLSL_HS<1, 0b1010, IIC_VMULi16D, "vmull", "u", ARMvmullu>;
4461 // VQDMULL : Vector Saturating Doubling Multiply Long (Q = D * D)
4462 defm VQDMULL : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, IIC_VMULi32D,
4463 "vqdmull", "s", int_arm_neon_vqdmull, 1>;
4464 defm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D,
4465 "vqdmull", "s", int_arm_neon_vqdmull>;
4467 // Vector Multiply-Accumulate and Multiply-Subtract Operations.
4469 // VMLA : Vector Multiply Accumulate (integer and floating-point)
4470 defm VMLA : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
4471 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
4472 def VMLAfd : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla", "f32",
4473 v2f32, fmul_su, fadd_mlx>,
4474 Requires<[HasNEON, UseFPVMLx]>;
4475 def VMLAfq : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla", "f32",
4476 v4f32, fmul_su, fadd_mlx>,
4477 Requires<[HasNEON, UseFPVMLx]>;
4478 def VMLAhd : N3VDMulOp<0, 0, 0b01, 0b1101, 1, IIC_VMACD, "vmla", "f16",
4479 v4f16, fmul_su, fadd_mlx>,
4480 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4481 def VMLAhq : N3VQMulOp<0, 0, 0b01, 0b1101, 1, IIC_VMACQ, "vmla", "f16",
4482 v8f16, fmul_su, fadd_mlx>,
4483 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4484 defm VMLAsl : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D,
4485 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
4486 def VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla", "f32",
4487 v2f32, fmul_su, fadd_mlx>,
4488 Requires<[HasNEON, UseFPVMLx]>;
4489 def VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla", "f32",
4490 v4f32, v2f32, fmul_su, fadd_mlx>,
4491 Requires<[HasNEON, UseFPVMLx]>;
4492 def VMLAslhd : N3VDMulOpSL16<0b01, 0b0001, IIC_VMACD, "vmla", "f16",
4494 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4495 def VMLAslhq : N3VQMulOpSL16<0b01, 0b0001, IIC_VMACQ, "vmla", "f16",
4496 v8f16, v4f16, fmul, fadd>,
4497 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4499 let Predicates = [HasNEON] in {
4500 def : Pat<(v8i16 (add (v8i16 QPR:$src1),
4501 (mul (v8i16 QPR:$src2),
4502 (v8i16 (ARMvduplane (v8i16 QPR:$src3), imm:$lane))))),
4503 (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
4504 (v4i16 (EXTRACT_SUBREG QPR:$src3,
4505 (DSubReg_i16_reg imm:$lane))),
4506 (SubReg_i16_lane imm:$lane)))>;
4508 def : Pat<(v4i32 (add (v4i32 QPR:$src1),
4509 (mul (v4i32 QPR:$src2),
4510 (v4i32 (ARMvduplane (v4i32 QPR:$src3), imm:$lane))))),
4511 (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
4512 (v2i32 (EXTRACT_SUBREG QPR:$src3,
4513 (DSubReg_i32_reg imm:$lane))),
4514 (SubReg_i32_lane imm:$lane)))>;
4517 def : Pat<(v4f32 (fadd_mlx (v4f32 QPR:$src1),
4518 (fmul_su (v4f32 QPR:$src2),
4519 (v4f32 (ARMvduplane (v4f32 QPR:$src3), imm:$lane))))),
4520 (v4f32 (VMLAslfq (v4f32 QPR:$src1),
4522 (v2f32 (EXTRACT_SUBREG QPR:$src3,
4523 (DSubReg_i32_reg imm:$lane))),
4524 (SubReg_i32_lane imm:$lane)))>,
4525 Requires<[HasNEON, UseFPVMLx]>;
4527 // VMLAL : Vector Multiply Accumulate Long (Q += D * D)
4528 defm VMLALs : N3VLMulOp_QHS<0,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
4529 "vmlal", "s", ARMvmulls, add>;
4530 defm VMLALu : N3VLMulOp_QHS<1,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
4531 "vmlal", "u", ARMvmullu, add>;
4533 defm VMLALsls : N3VLMulOpSL_HS<0, 0b0010, "vmlal", "s", ARMvmulls, add>;
4534 defm VMLALslu : N3VLMulOpSL_HS<1, 0b0010, "vmlal", "u", ARMvmullu, add>;
4536 let Predicates = [HasNEON, HasV8_1a] in {
4537 // v8.1a Neon Rounding Double Multiply-Op vector operations,
4538 // VQRDMLAH : Vector Saturating Rounding Doubling Multiply Accumulate Long
4540 defm VQRDMLAH : N3VInt3_HS<1, 0, 0b1011, 1, IIC_VMACi16D, IIC_VMACi32D,
4541 IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlah", "s",
4543 def : Pat<(v4i16 (int_arm_neon_vqrdmlah (v4i16 DPR:$src1), (v4i16 DPR:$Vn),
4545 (v4i16 (VQRDMLAHv4i16 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
4546 def : Pat<(v2i32 (int_arm_neon_vqrdmlah (v2i32 DPR:$src1), (v2i32 DPR:$Vn),
4548 (v2i32 (VQRDMLAHv2i32 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
4549 def : Pat<(v8i16 (int_arm_neon_vqrdmlah (v8i16 QPR:$src1), (v8i16 QPR:$Vn),
4551 (v8i16 (VQRDMLAHv8i16 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
4552 def : Pat<(v4i32 (int_arm_neon_vqrdmlah (v4i32 QPR:$src1), (v4i32 QPR:$Vn),
4554 (v4i32 (VQRDMLAHv4i32 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
4556 defm VQRDMLAHsl : N3VMulOpSL_HS<0b1110, IIC_VMACi16D, IIC_VMACi32D,
4557 IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlah", "s",
4559 def : Pat<(v4i16 (int_arm_neon_vqrdmlah (v4i16 DPR:$src1),
4561 (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
4563 (v4i16 (VQRDMLAHslv4i16 DPR:$src1, DPR:$Vn, DPR_8:$Vm,
4565 def : Pat<(v2i32 (int_arm_neon_vqrdmlah (v2i32 DPR:$src1),
4567 (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
4569 (v2i32 (VQRDMLAHslv2i32 DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
4571 def : Pat<(v8i16 (int_arm_neon_vqrdmlah (v8i16 QPR:$src1),
4573 (v8i16 (ARMvduplane (v8i16 QPR:$src3),
4575 (v8i16 (VQRDMLAHslv8i16 (v8i16 QPR:$src1),
4577 (v4i16 (EXTRACT_SUBREG
4579 (DSubReg_i16_reg imm:$lane))),
4580 (SubReg_i16_lane imm:$lane)))>;
4581 def : Pat<(v4i32 (int_arm_neon_vqrdmlah (v4i32 QPR:$src1),
4583 (v4i32 (ARMvduplane (v4i32 QPR:$src3),
4585 (v4i32 (VQRDMLAHslv4i32 (v4i32 QPR:$src1),
4587 (v2i32 (EXTRACT_SUBREG
4589 (DSubReg_i32_reg imm:$lane))),
4590 (SubReg_i32_lane imm:$lane)))>;
4592 // VQRDMLSH : Vector Saturating Rounding Doubling Multiply Subtract Long
4594 defm VQRDMLSH : N3VInt3_HS<1, 0, 0b1100, 1, IIC_VMACi16D, IIC_VMACi32D,
4595 IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlsh", "s",
4597 def : Pat<(v4i16 (int_arm_neon_vqrdmlsh (v4i16 DPR:$src1), (v4i16 DPR:$Vn),
4599 (v4i16 (VQRDMLSHv4i16 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
4600 def : Pat<(v2i32 (int_arm_neon_vqrdmlsh (v2i32 DPR:$src1), (v2i32 DPR:$Vn),
4602 (v2i32 (VQRDMLSHv2i32 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
4603 def : Pat<(v8i16 (int_arm_neon_vqrdmlsh (v8i16 QPR:$src1), (v8i16 QPR:$Vn),
4605 (v8i16 (VQRDMLSHv8i16 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
4606 def : Pat<(v4i32 (int_arm_neon_vqrdmlsh (v4i32 QPR:$src1), (v4i32 QPR:$Vn),
4608 (v4i32 (VQRDMLSHv4i32 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
4610 defm VQRDMLSHsl : N3VMulOpSL_HS<0b1111, IIC_VMACi16D, IIC_VMACi32D,
4611 IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlsh", "s",
4613 def : Pat<(v4i16 (int_arm_neon_vqrdmlsh (v4i16 DPR:$src1),
4615 (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
4617 (v4i16 (VQRDMLSHslv4i16 DPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane))>;
4618 def : Pat<(v2i32 (int_arm_neon_vqrdmlsh (v2i32 DPR:$src1),
4620 (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
4622 (v2i32 (VQRDMLSHslv2i32 DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
4624 def : Pat<(v8i16 (int_arm_neon_vqrdmlsh (v8i16 QPR:$src1),
4626 (v8i16 (ARMvduplane (v8i16 QPR:$src3),
4628 (v8i16 (VQRDMLSHslv8i16 (v8i16 QPR:$src1),
4630 (v4i16 (EXTRACT_SUBREG
4632 (DSubReg_i16_reg imm:$lane))),
4633 (SubReg_i16_lane imm:$lane)))>;
4634 def : Pat<(v4i32 (int_arm_neon_vqrdmlsh (v4i32 QPR:$src1),
4636 (v4i32 (ARMvduplane (v4i32 QPR:$src3),
4638 (v4i32 (VQRDMLSHslv4i32 (v4i32 QPR:$src1),
4640 (v2i32 (EXTRACT_SUBREG
4642 (DSubReg_i32_reg imm:$lane))),
4643 (SubReg_i32_lane imm:$lane)))>;
4645 // VQDMLAL : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
4646 defm VQDMLAL : N3VLInt3_HS<0, 1, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
4647 "vqdmlal", "s", null_frag>;
4648 defm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal", "s", null_frag>;
4650 let Predicates = [HasNEON] in {
4651 def : Pat<(v4i32 (saddsat (v4i32 QPR:$src1),
4652 (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
4653 (v4i16 DPR:$Vm))))),
4654 (VQDMLALv4i32 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4655 def : Pat<(v2i64 (saddsat (v2i64 QPR:$src1),
4656 (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
4657 (v2i32 DPR:$Vm))))),
4658 (VQDMLALv2i64 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4659 def : Pat<(v4i32 (saddsat (v4i32 QPR:$src1),
4660 (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
4661 (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
4663 (VQDMLALslv4i16 QPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane)>;
4664 def : Pat<(v2i64 (saddsat (v2i64 QPR:$src1),
4665 (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
4666 (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
4668 (VQDMLALslv2i32 QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, imm:$lane)>;
4671 // VMLS : Vector Multiply Subtract (integer and floating-point)
4672 defm VMLS : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
4673 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
4674 def VMLSfd : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls", "f32",
4675 v2f32, fmul_su, fsub_mlx>,
4676 Requires<[HasNEON, UseFPVMLx]>;
4677 def VMLSfq : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls", "f32",
4678 v4f32, fmul_su, fsub_mlx>,
4679 Requires<[HasNEON, UseFPVMLx]>;
4680 def VMLShd : N3VDMulOp<0, 0, 0b11, 0b1101, 1, IIC_VMACD, "vmls", "f16",
4682 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4683 def VMLShq : N3VQMulOp<0, 0, 0b11, 0b1101, 1, IIC_VMACQ, "vmls", "f16",
4685 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4686 defm VMLSsl : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D,
4687 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
4688 def VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls", "f32",
4689 v2f32, fmul_su, fsub_mlx>,
4690 Requires<[HasNEON, UseFPVMLx]>;
4691 def VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls", "f32",
4692 v4f32, v2f32, fmul_su, fsub_mlx>,
4693 Requires<[HasNEON, UseFPVMLx]>;
4694 def VMLSslhd : N3VDMulOpSL16<0b01, 0b0101, IIC_VMACD, "vmls", "f16",
4696 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4697 def VMLSslhq : N3VQMulOpSL16<0b01, 0b0101, IIC_VMACQ, "vmls", "f16",
4698 v8f16, v4f16, fmul, fsub>,
4699 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4701 let Predicates = [HasNEON] in {
4702 def : Pat<(v8i16 (sub (v8i16 QPR:$src1),
4703 (mul (v8i16 QPR:$src2),
4704 (v8i16 (ARMvduplane (v8i16 QPR:$src3), imm:$lane))))),
4705 (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
4706 (v4i16 (EXTRACT_SUBREG QPR:$src3,
4707 (DSubReg_i16_reg imm:$lane))),
4708 (SubReg_i16_lane imm:$lane)))>;
4710 def : Pat<(v4i32 (sub (v4i32 QPR:$src1),
4711 (mul (v4i32 QPR:$src2),
4712 (v4i32 (ARMvduplane (v4i32 QPR:$src3), imm:$lane))))),
4713 (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
4714 (v2i32 (EXTRACT_SUBREG QPR:$src3,
4715 (DSubReg_i32_reg imm:$lane))),
4716 (SubReg_i32_lane imm:$lane)))>;
4719 def : Pat<(v4f32 (fsub_mlx (v4f32 QPR:$src1),
4720 (fmul_su (v4f32 QPR:$src2),
4721 (v4f32 (ARMvduplane (v4f32 QPR:$src3), imm:$lane))))),
4722 (v4f32 (VMLSslfq (v4f32 QPR:$src1), (v4f32 QPR:$src2),
4723 (v2f32 (EXTRACT_SUBREG QPR:$src3,
4724 (DSubReg_i32_reg imm:$lane))),
4725 (SubReg_i32_lane imm:$lane)))>,
4726 Requires<[HasNEON, UseFPVMLx]>;
4728 // VMLSL : Vector Multiply Subtract Long (Q -= D * D)
4729 defm VMLSLs : N3VLMulOp_QHS<0,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
4730 "vmlsl", "s", ARMvmulls, sub>;
4731 defm VMLSLu : N3VLMulOp_QHS<1,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
4732 "vmlsl", "u", ARMvmullu, sub>;
4734 defm VMLSLsls : N3VLMulOpSL_HS<0, 0b0110, "vmlsl", "s", ARMvmulls, sub>;
4735 defm VMLSLslu : N3VLMulOpSL_HS<1, 0b0110, "vmlsl", "u", ARMvmullu, sub>;
4737 // VQDMLSL : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
4738 defm VQDMLSL : N3VLInt3_HS<0, 1, 0b1011, 0, IIC_VMACi16D, IIC_VMACi32D,
4739 "vqdmlsl", "s", null_frag>;
4740 defm VQDMLSLsl: N3VLInt3SL_HS<0, 0b0111, "vqdmlsl", "s", null_frag>;
4742 let Predicates = [HasNEON] in {
4743 def : Pat<(v4i32 (ssubsat (v4i32 QPR:$src1),
4744 (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
4745 (v4i16 DPR:$Vm))))),
4746 (VQDMLSLv4i32 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4747 def : Pat<(v2i64 (ssubsat (v2i64 QPR:$src1),
4748 (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
4749 (v2i32 DPR:$Vm))))),
4750 (VQDMLSLv2i64 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4751 def : Pat<(v4i32 (ssubsat (v4i32 QPR:$src1),
4752 (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
4753 (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
4755 (VQDMLSLslv4i16 QPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane)>;
4756 def : Pat<(v2i64 (ssubsat (v2i64 QPR:$src1),
4757 (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
4758 (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
4760 (VQDMLSLslv2i32 QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, imm:$lane)>;
4763 // Fused Vector Multiply-Accumulate and Fused Multiply-Subtract Operations.
4764 def VFMAfd : N3VDMulOp<0, 0, 0b00, 0b1100, 1, IIC_VFMACD, "vfma", "f32",
4765 v2f32, fmul_su, fadd_mlx>,
4766 Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
4768 def VFMAfq : N3VQMulOp<0, 0, 0b00, 0b1100, 1, IIC_VFMACQ, "vfma", "f32",
4769 v4f32, fmul_su, fadd_mlx>,
4770 Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
4771 def VFMAhd : N3VDMulOp<0, 0, 0b01, 0b1100, 1, IIC_VFMACD, "vfma", "f16",
4773 Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
4775 def VFMAhq : N3VQMulOp<0, 0, 0b01, 0b1100, 1, IIC_VFMACQ, "vfma", "f16",
4777 Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
4779 // Fused Vector Multiply Subtract (floating-point)
4780 def VFMSfd : N3VDMulOp<0, 0, 0b10, 0b1100, 1, IIC_VFMACD, "vfms", "f32",
4781 v2f32, fmul_su, fsub_mlx>,
4782 Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
4783 def VFMSfq : N3VQMulOp<0, 0, 0b10, 0b1100, 1, IIC_VFMACQ, "vfms", "f32",
4784 v4f32, fmul_su, fsub_mlx>,
4785 Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
4786 def VFMShd : N3VDMulOp<0, 0, 0b11, 0b1100, 1, IIC_VFMACD, "vfms", "f16",
4788 Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
4789 def VFMShq : N3VQMulOp<0, 0, 0b11, 0b1100, 1, IIC_VFMACQ, "vfms", "f16",
4791 Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
4793 // Match @llvm.fma.* intrinsics
4794 def : Pat<(v4f16 (fma DPR:$Vn, DPR:$Vm, DPR:$src1)),
4795 (VFMAhd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
4796 Requires<[HasNEON,HasFullFP16]>;
4797 def : Pat<(v8f16 (fma QPR:$Vn, QPR:$Vm, QPR:$src1)),
4798 (VFMAhq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
4799 Requires<[HasNEON,HasFullFP16]>;
4800 def : Pat<(v2f32 (fma DPR:$Vn, DPR:$Vm, DPR:$src1)),
4801 (VFMAfd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
4802 Requires<[HasNEON,HasVFP4]>;
4803 def : Pat<(v4f32 (fma QPR:$Vn, QPR:$Vm, QPR:$src1)),
4804 (VFMAfq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
4805 Requires<[HasNEON,HasVFP4]>;
4806 def : Pat<(v2f32 (fma (fneg DPR:$Vn), DPR:$Vm, DPR:$src1)),
4807 (VFMSfd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
4808 Requires<[HasNEON,HasVFP4]>;
4809 def : Pat<(v4f32 (fma (fneg QPR:$Vn), QPR:$Vm, QPR:$src1)),
4810 (VFMSfq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
4811 Requires<[HasNEON,HasVFP4]>;
4813 // ARMv8.2a dot product instructions.
4814 // We put them in the VFPV8 decoder namespace because the ARM and Thumb
4815 // encodings are the same and thus no further bit twiddling is necessary
4816 // in the disassembler.
4817 class VDOT<bit op6, bit op4, bit op23, RegisterClass RegTy, string Asm,
4818 string AsmTy, ValueType AccumTy, ValueType InputTy,
4819 SDPatternOperator OpNode> :
4820 N3Vnp<{0b1100, op23}, 0b10, 0b1101, op6, op4, (outs RegTy:$dst),
4821 (ins RegTy:$Vd, RegTy:$Vn, RegTy:$Vm), N3RegFrm, IIC_VDOTPROD,
4823 [(set (AccumTy RegTy:$dst),
4824 (OpNode (AccumTy RegTy:$Vd),
4825 (InputTy RegTy:$Vn),
4826 (InputTy RegTy:$Vm)))]> {
4827 let Predicates = [HasDotProd];
4828 let DecoderNamespace = "VFPV8";
4829 let Constraints = "$dst = $Vd";
4832 def VUDOTD : VDOT<0, 1, 0, DPR, "vudot", "u8", v2i32, v8i8, int_arm_neon_udot>;
4833 def VSDOTD : VDOT<0, 0, 0, DPR, "vsdot", "s8", v2i32, v8i8, int_arm_neon_sdot>;
4834 def VUDOTQ : VDOT<1, 1, 0, QPR, "vudot", "u8", v4i32, v16i8, int_arm_neon_udot>;
4835 def VSDOTQ : VDOT<1, 0, 0, QPR, "vsdot", "s8", v4i32, v16i8, int_arm_neon_sdot>;
4837 // Indexed dot product instructions:
4838 multiclass DOTI<string opc, string dt, bit Q, bit U, RegisterClass Ty,
4839 ValueType AccumType, ValueType InputType, SDPatternOperator OpNode,
4841 def "" : N3Vnp<0b11100, 0b10, 0b1101, Q, U, (outs Ty:$dst),
4842 (ins Ty:$Vd, Ty:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
4843 N3RegFrm, IIC_VDOTPROD, opc, dt, []> {
4846 let AsmString = !strconcat(opc, ".", dt, "\t$Vd, $Vn, $Vm$lane");
4847 let Constraints = "$dst = $Vd";
4848 let Predicates = [HasDotProd];
4849 let DecoderNamespace = "VFPV8";
4853 (AccumType (OpNode (AccumType Ty:$Vd),
4855 (InputType (bitconvert (AccumType
4856 (ARMvduplane (AccumType Ty:$Vm),
4857 VectorIndex32:$lane)))))),
4858 (!cast<Instruction>(NAME) Ty:$Vd, Ty:$Vn, RHS, VectorIndex32:$lane)>;
4861 defm VUDOTDI : DOTI<"vudot", "u8", 0b0, 0b1, DPR, v2i32, v8i8,
4862 int_arm_neon_udot, (v2i32 DPR_VFP2:$Vm)>;
4863 defm VSDOTDI : DOTI<"vsdot", "s8", 0b0, 0b0, DPR, v2i32, v8i8,
4864 int_arm_neon_sdot, (v2i32 DPR_VFP2:$Vm)>;
4865 defm VUDOTQI : DOTI<"vudot", "u8", 0b1, 0b1, QPR, v4i32, v16i8,
4866 int_arm_neon_udot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
4867 defm VSDOTQI : DOTI<"vsdot", "s8", 0b1, 0b0, QPR, v4i32, v16i8,
4868 int_arm_neon_sdot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
4870 // v8.6A matrix multiplication extension
4871 let Predicates = [HasMatMulInt8] in {
4872 class N3VMatMul<bit B, bit U, string Asm, string AsmTy,
4873 SDPatternOperator OpNode>
4874 : N3Vnp<{0b1100, B}, 0b10, 0b1100, 1, U, (outs QPR:$dst),
4875 (ins QPR:$Vd, QPR:$Vn, QPR:$Vm), N3RegFrm, NoItinerary,
4877 [(set (v4i32 QPR:$dst), (OpNode (v4i32 QPR:$Vd),
4879 (v16i8 QPR:$Vm)))]> {
4880 let DecoderNamespace = "VFPV8";
4881 let Constraints = "$dst = $Vd";
4884 multiclass N3VMixedDotLane<bit Q, bit U, string Asm, string AsmTy, RegisterClass RegTy,
4885 ValueType AccumTy, ValueType InputTy, SDPatternOperator OpNode,
4888 def "" : N3Vnp<0b11101, 0b00, 0b1101, Q, U, (outs RegTy:$dst),
4889 (ins RegTy:$Vd, RegTy:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane), N3RegFrm,
4890 NoItinerary, Asm, AsmTy, []> {
4893 let AsmString = !strconcat(Asm, ".", AsmTy, "\t$Vd, $Vn, $Vm$lane");
4894 let DecoderNamespace = "VFPV8";
4895 let Constraints = "$dst = $Vd";
4899 (AccumTy (OpNode (AccumTy RegTy:$Vd),
4900 (InputTy RegTy:$Vn),
4901 (InputTy (bitconvert (AccumTy
4902 (ARMvduplane (AccumTy RegTy:$Vm),
4903 VectorIndex32:$lane)))))),
4904 (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
4908 multiclass SUDOTLane<bit Q, RegisterClass RegTy, ValueType AccumTy, ValueType InputTy, dag RHS>
4909 : N3VMixedDotLane<Q, 1, "vsudot", "u8", RegTy, AccumTy, InputTy, null_frag, (ins)> {
4911 (AccumTy (int_arm_neon_usdot (AccumTy RegTy:$Vd),
4912 (InputTy (bitconvert (AccumTy
4913 (ARMvduplane (AccumTy RegTy:$Vm),
4914 VectorIndex32:$lane)))),
4915 (InputTy RegTy:$Vn))),
4916 (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
4919 def VSMMLA : N3VMatMul<0, 0, "vsmmla", "s8", int_arm_neon_smmla>;
4920 def VUMMLA : N3VMatMul<0, 1, "vummla", "u8", int_arm_neon_ummla>;
4921 def VUSMMLA : N3VMatMul<1, 0, "vusmmla", "s8", int_arm_neon_usmmla>;
4922 def VUSDOTD : VDOT<0, 0, 1, DPR, "vusdot", "s8", v2i32, v8i8, int_arm_neon_usdot>;
4923 def VUSDOTQ : VDOT<1, 0, 1, QPR, "vusdot", "s8", v4i32, v16i8, int_arm_neon_usdot>;
4925 defm VUSDOTDI : N3VMixedDotLane<0, 0, "vusdot", "s8", DPR, v2i32, v8i8,
4926 int_arm_neon_usdot, (v2i32 DPR_VFP2:$Vm)>;
4927 defm VUSDOTQI : N3VMixedDotLane<1, 0, "vusdot", "s8", QPR, v4i32, v16i8,
4928 int_arm_neon_usdot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
4929 defm VSUDOTDI : SUDOTLane<0, DPR, v2i32, v8i8, (v2i32 DPR_VFP2:$Vm)>;
4930 defm VSUDOTQI : SUDOTLane<1, QPR, v4i32, v16i8, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
4933 // ARMv8.3 complex operations
4934 class BaseN3VCP8ComplexTied<bit op21, bit op4, bit s, bit q,
4935 InstrItinClass itin, dag oops, dag iops,
4936 string opc, string dt, list<dag> pattern>
4937 : N3VCP8<{?,?}, {op21,s}, q, op4, oops,
4938 iops, itin, opc, dt, "$Vd, $Vn, $Vm, $rot", "$src1 = $Vd", pattern>{
4940 let Inst{24-23} = rot;
4943 class BaseN3VCP8ComplexOdd<bit op23, bit op21, bit op4, bit s, bit q,
4944 InstrItinClass itin, dag oops, dag iops, string opc,
4945 string dt, list<dag> pattern>
4946 : N3VCP8<{?,op23}, {op21,s}, q, op4, oops,
4947 iops, itin, opc, dt, "$Vd, $Vn, $Vm, $rot", "", pattern> {
4952 class BaseN3VCP8ComplexTiedLane32<bit op4, bit s, bit q, InstrItinClass itin,
4953 dag oops, dag iops, string opc, string dt,
4955 : N3VLaneCP8<s, {?,?}, q, op4, oops, iops, itin, opc, dt,
4956 "$Vd, $Vn, $Vm$lane, $rot", "$src1 = $Vd", pattern> {
4960 let Inst{21-20} = rot;
4964 class BaseN3VCP8ComplexTiedLane64<bit op4, bit s, bit q, InstrItinClass itin,
4965 dag oops, dag iops, string opc, string dt,
4967 : N3VLaneCP8<s, {?,?}, q, op4, oops, iops, itin, opc, dt,
4968 "$Vd, $Vn, $Vm$lane, $rot", "$src1 = $Vd", pattern> {
4972 let Inst{21-20} = rot;
4973 let Inst{5} = Vm{4};
4974 // This is needed because the lane operand does not have any bits in the
4975 // encoding (it only has one possible value), so we need to manually set it
4976 // to it's default value.
4977 let DecoderMethod = "DecodeNEONComplexLane64Instruction";
4980 multiclass N3VCP8ComplexTied<bit op21, bit op4,
4982 let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
4983 def v4f16 : BaseN3VCP8ComplexTied<op21, op4, 0, 0, IIC_VMACD, (outs DPR:$Vd),
4984 (ins DPR:$src1, DPR:$Vn, DPR:$Vm, complexrotateop:$rot),
4985 OpcodeStr, "f16", []>;
4986 def v8f16 : BaseN3VCP8ComplexTied<op21, op4, 0, 1, IIC_VMACQ, (outs QPR:$Vd),
4987 (ins QPR:$src1, QPR:$Vn, QPR:$Vm, complexrotateop:$rot),
4988 OpcodeStr, "f16", []>;
4990 let Predicates = [HasNEON,HasV8_3a] in {
4991 def v2f32 : BaseN3VCP8ComplexTied<op21, op4, 1, 0, IIC_VMACD, (outs DPR:$Vd),
4992 (ins DPR:$src1, DPR:$Vn, DPR:$Vm, complexrotateop:$rot),
4993 OpcodeStr, "f32", []>;
4994 def v4f32 : BaseN3VCP8ComplexTied<op21, op4, 1, 1, IIC_VMACQ, (outs QPR:$Vd),
4995 (ins QPR:$src1, QPR:$Vn, QPR:$Vm, complexrotateop:$rot),
4996 OpcodeStr, "f32", []>;
5000 multiclass N3VCP8ComplexOdd<bit op23, bit op21, bit op4,
5002 let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
5003 def v4f16 : BaseN3VCP8ComplexOdd<op23, op21, op4, 0, 0, IIC_VMACD,
5005 (ins DPR:$Vn, DPR:$Vm, complexrotateopodd:$rot),
5006 OpcodeStr, "f16", []>;
5007 def v8f16 : BaseN3VCP8ComplexOdd<op23, op21, op4, 0, 1, IIC_VMACQ,
5009 (ins QPR:$Vn, QPR:$Vm, complexrotateopodd:$rot),
5010 OpcodeStr, "f16", []>;
5012 let Predicates = [HasNEON,HasV8_3a] in {
5013 def v2f32 : BaseN3VCP8ComplexOdd<op23, op21, op4, 1, 0, IIC_VMACD,
5015 (ins DPR:$Vn, DPR:$Vm, complexrotateopodd:$rot),
5016 OpcodeStr, "f32", []>;
5017 def v4f32 : BaseN3VCP8ComplexOdd<op23, op21, op4, 1, 1, IIC_VMACQ,
5019 (ins QPR:$Vn, QPR:$Vm, complexrotateopodd:$rot),
5020 OpcodeStr, "f32", []>;
5024 // These instructions index by pairs of lanes, so the VectorIndexes are twice
5025 // as wide as the data types.
5026 multiclass N3VCP8ComplexTiedLane<bit op4, string OpcodeStr> {
5027 let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
5028 def v4f16_indexed : BaseN3VCP8ComplexTiedLane32<op4, 0, 0, IIC_VMACD,
5030 (ins DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
5031 VectorIndex32:$lane, complexrotateop:$rot),
5032 OpcodeStr, "f16", []>;
5033 def v8f16_indexed : BaseN3VCP8ComplexTiedLane32<op4, 0, 1, IIC_VMACQ,
5035 (ins QPR:$src1, QPR:$Vn, DPR_VFP2:$Vm,
5036 VectorIndex32:$lane, complexrotateop:$rot),
5037 OpcodeStr, "f16", []>;
5039 let Predicates = [HasNEON,HasV8_3a] in {
5040 def v2f32_indexed : BaseN3VCP8ComplexTiedLane64<op4, 1, 0, IIC_VMACD,
5042 (ins DPR:$src1, DPR:$Vn, DPR:$Vm, VectorIndex64:$lane,
5043 complexrotateop:$rot),
5044 OpcodeStr, "f32", []>;
5045 def v4f32_indexed : BaseN3VCP8ComplexTiedLane64<op4, 1, 1, IIC_VMACQ,
5047 (ins QPR:$src1, QPR:$Vn, DPR:$Vm, VectorIndex64:$lane,
5048 complexrotateop:$rot),
5049 OpcodeStr, "f32", []>;
5053 defm VCMLA : N3VCP8ComplexTied<1, 0, "vcmla">;
5054 defm VCADD : N3VCP8ComplexOdd<1, 0, 0, "vcadd">;
5055 defm VCMLA : N3VCP8ComplexTiedLane<0, "vcmla">;
5057 let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
5058 def : Pat<(v4f16 (int_arm_neon_vcadd_rot90 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm))),
5059 (VCADDv4f16 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm), (i32 0))>;
5060 def : Pat<(v4f16 (int_arm_neon_vcadd_rot270 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm))),
5061 (VCADDv4f16 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm), (i32 1))>;
5062 def : Pat<(v8f16 (int_arm_neon_vcadd_rot90 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm))),
5063 (VCADDv8f16 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm), (i32 0))>;
5064 def : Pat<(v8f16 (int_arm_neon_vcadd_rot270 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm))),
5065 (VCADDv8f16 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm), (i32 1))>;
5067 let Predicates = [HasNEON,HasV8_3a] in {
5068 def : Pat<(v2f32 (int_arm_neon_vcadd_rot90 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm))),
5069 (VCADDv2f32 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm), (i32 0))>;
5070 def : Pat<(v2f32 (int_arm_neon_vcadd_rot270 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm))),
5071 (VCADDv2f32 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm), (i32 1))>;
5072 def : Pat<(v4f32 (int_arm_neon_vcadd_rot90 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm))),
5073 (VCADDv4f32 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm), (i32 0))>;
5074 def : Pat<(v4f32 (int_arm_neon_vcadd_rot270 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm))),
5075 (VCADDv4f32 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm), (i32 1))>;
5078 // Vector Subtract Operations.
5080 // VSUB : Vector Subtract (integer and floating-point)
5081 defm VSUB : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ,
5082 "vsub", "i", sub, 0>;
5083 def VSUBfd : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub", "f32",
5084 v2f32, v2f32, fsub, 0>;
5085 def VSUBfq : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub", "f32",
5086 v4f32, v4f32, fsub, 0>;
5087 def VSUBhd : N3VD<0, 0, 0b11, 0b1101, 0, IIC_VBIND, "vsub", "f16",
5088 v4f16, v4f16, fsub, 0>,
5089 Requires<[HasNEON,HasFullFP16]>;
5090 def VSUBhq : N3VQ<0, 0, 0b11, 0b1101, 0, IIC_VBINQ, "vsub", "f16",
5091 v8f16, v8f16, fsub, 0>,
5092 Requires<[HasNEON,HasFullFP16]>;
5093 // VSUBL : Vector Subtract Long (Q = D - D)
5094 defm VSUBLs : N3VLExt_QHS<0,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
5095 "vsubl", "s", sub, sext, 0>;
5096 defm VSUBLu : N3VLExt_QHS<1,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
5097 "vsubl", "u", sub, zanyext, 0>;
5098 // VSUBW : Vector Subtract Wide (Q = Q - D)
5099 defm VSUBWs : N3VW_QHS<0,1,0b0011,0, "vsubw", "s", sub, sext, 0>;
5100 defm VSUBWu : N3VW_QHS<1,1,0b0011,0, "vsubw", "u", sub, zanyext, 0>;
5101 // VHSUB : Vector Halving Subtract
5102 defm VHSUBs : N3VInt_QHS<0, 0, 0b0010, 0, N3RegFrm,
5103 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5104 "vhsub", "s", int_arm_neon_vhsubs, 0>;
5105 defm VHSUBu : N3VInt_QHS<1, 0, 0b0010, 0, N3RegFrm,
5106 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5107 "vhsub", "u", int_arm_neon_vhsubu, 0>;
5108 // VQSUB : Vector Saturing Subtract
5109 defm VQSUBs : N3VInt_QHSD<0, 0, 0b0010, 1, N3RegFrm,
5110 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5111 "vqsub", "s", ssubsat, 0>;
5112 defm VQSUBu : N3VInt_QHSD<1, 0, 0b0010, 1, N3RegFrm,
5113 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5114 "vqsub", "u", usubsat, 0>;
5115 // VSUBHN : Vector Subtract and Narrow Returning High Half (D = Q - Q)
5116 defm VSUBHN : N3VNInt_HSD<0,1,0b0110,0, "vsubhn", "i", null_frag, 0>;
5117 // VRSUBHN : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
5118 defm VRSUBHN : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn", "i",
5119 int_arm_neon_vrsubhn, 0>;
5121 let Predicates = [HasNEON] in {
5122 def : Pat<(v8i8 (trunc (ARMvshruImm (sub (v8i16 QPR:$Vn), QPR:$Vm), 8))),
5123 (VSUBHNv8i8 QPR:$Vn, QPR:$Vm)>;
5124 def : Pat<(v4i16 (trunc (ARMvshruImm (sub (v4i32 QPR:$Vn), QPR:$Vm), 16))),
5125 (VSUBHNv4i16 QPR:$Vn, QPR:$Vm)>;
5126 def : Pat<(v2i32 (trunc (ARMvshruImm (sub (v2i64 QPR:$Vn), QPR:$Vm), 32))),
5127 (VSUBHNv2i32 QPR:$Vn, QPR:$Vm)>;
5130 // Vector Comparisons.
5132 // VCEQ : Vector Compare Equal
5133 defm VCEQ : N3V_QHS_cmp<1, 0, 0b1000, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5134 IIC_VSUBi4Q, "vceq", "i", ARMCCeq, 1>;
5135 def VCEQfd : N3VD_cmp<0,0,0b00,0b1110,0, IIC_VBIND, "vceq", "f32", v2i32, v2f32,
5137 def VCEQfq : N3VQ_cmp<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq", "f32", v4i32, v4f32,
5139 def VCEQhd : N3VD_cmp<0,0,0b01,0b1110,0, IIC_VBIND, "vceq", "f16", v4i16, v4f16,
5141 Requires<[HasNEON, HasFullFP16]>;
5142 def VCEQhq : N3VQ_cmp<0,0,0b01,0b1110,0, IIC_VBINQ, "vceq", "f16", v8i16, v8f16,
5144 Requires<[HasNEON, HasFullFP16]>;
5146 let TwoOperandAliasConstraint = "$Vm = $Vd" in
5147 defm VCEQz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00010, 0, "vceq", "i",
5148 "$Vd, $Vm, #0", ARMCCeq>;
5150 // VCGE : Vector Compare Greater Than or Equal
5151 defm VCGEs : N3V_QHS_cmp<0, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5152 IIC_VSUBi4Q, "vcge", "s", ARMCCge, 0>;
5153 defm VCGEu : N3V_QHS_cmp<1, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5154 IIC_VSUBi4Q, "vcge", "u", ARMCChs, 0>;
5155 def VCGEfd : N3VD_cmp<1,0,0b00,0b1110,0, IIC_VBIND, "vcge", "f32", v2i32, v2f32,
5157 def VCGEfq : N3VQ_cmp<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge", "f32", v4i32, v4f32,
5159 def VCGEhd : N3VD_cmp<1,0,0b01,0b1110,0, IIC_VBIND, "vcge", "f16", v4i16, v4f16,
5161 Requires<[HasNEON, HasFullFP16]>;
5162 def VCGEhq : N3VQ_cmp<1,0,0b01,0b1110,0, IIC_VBINQ, "vcge", "f16", v8i16, v8f16,
5164 Requires<[HasNEON, HasFullFP16]>;
5166 let TwoOperandAliasConstraint = "$Vm = $Vd" in {
5167 defm VCGEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00001, 0, "vcge", "s",
5168 "$Vd, $Vm, #0", ARMCCge>;
5169 defm VCLEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00011, 0, "vcle", "s",
5170 "$Vd, $Vm, #0", ARMCCle>;
5173 // VCGT : Vector Compare Greater Than
5174 defm VCGTs : N3V_QHS_cmp<0, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5175 IIC_VSUBi4Q, "vcgt", "s", ARMCCgt, 0>;
5176 defm VCGTu : N3V_QHS_cmp<1, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5177 IIC_VSUBi4Q, "vcgt", "u", ARMCChi, 0>;
5178 def VCGTfd : N3VD_cmp<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt", "f32", v2i32, v2f32,
5180 def VCGTfq : N3VQ_cmp<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt", "f32", v4i32, v4f32,
5182 def VCGThd : N3VD_cmp<1,0,0b11,0b1110,0, IIC_VBIND, "vcgt", "f16", v4i16, v4f16,
5184 Requires<[HasNEON, HasFullFP16]>;
5185 def VCGThq : N3VQ_cmp<1,0,0b11,0b1110,0, IIC_VBINQ, "vcgt", "f16", v8i16, v8f16,
5187 Requires<[HasNEON, HasFullFP16]>;
5189 let TwoOperandAliasConstraint = "$Vm = $Vd" in {
5190 defm VCGTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00000, 0, "vcgt", "s",
5191 "$Vd, $Vm, #0", ARMCCgt>;
5192 defm VCLTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00100, 0, "vclt", "s",
5193 "$Vd, $Vm, #0", ARMCClt>;
5196 // VACGE : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
5197 def VACGEfd : N3VDInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
5198 "f32", v2i32, v2f32, int_arm_neon_vacge, 0>;
5199 def VACGEfq : N3VQInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
5200 "f32", v4i32, v4f32, int_arm_neon_vacge, 0>;
5201 def VACGEhd : N3VDInt<1, 0, 0b01, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
5202 "f16", v4i16, v4f16, int_arm_neon_vacge, 0>,
5203 Requires<[HasNEON, HasFullFP16]>;
5204 def VACGEhq : N3VQInt<1, 0, 0b01, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
5205 "f16", v8i16, v8f16, int_arm_neon_vacge, 0>,
5206 Requires<[HasNEON, HasFullFP16]>;
5207 // VACGT : Vector Absolute Compare Greater Than (aka VCAGT)
5208 def VACGTfd : N3VDInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
5209 "f32", v2i32, v2f32, int_arm_neon_vacgt, 0>;
5210 def VACGTfq : N3VQInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
5211 "f32", v4i32, v4f32, int_arm_neon_vacgt, 0>;
5212 def VACGThd : N3VDInt<1, 0, 0b11, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
5213 "f16", v4i16, v4f16, int_arm_neon_vacgt, 0>,
5214 Requires<[HasNEON, HasFullFP16]>;
5215 def VACGThq : N3VQInt<1, 0, 0b11, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
5216 "f16", v8i16, v8f16, int_arm_neon_vacgt, 0>,
5217 Requires<[HasNEON, HasFullFP16]>;
5218 // VTST : Vector Test Bits
5219 defm VTST : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
5220 IIC_VBINi4Q, "vtst", "", NEONvtst, 1>;
5222 def: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vn, $Vm",
5223 (VACGTfd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
5224 def: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vn, $Vm",
5225 (VACGTfq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
5226 def: NEONInstAlias<"vacle${p}.f32 $Vd, $Vn, $Vm",
5227 (VACGEfd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
5228 def: NEONInstAlias<"vacle${p}.f32 $Vd, $Vn, $Vm",
5229 (VACGEfq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
5230 let Predicates = [HasNEON, HasFullFP16] in {
5231 def: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vn, $Vm",
5232 (VACGThd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
5233 def: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vn, $Vm",
5234 (VACGThq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
5235 def: NEONInstAlias<"vacle${p}.f16 $Vd, $Vn, $Vm",
5236 (VACGEhd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
5237 def: NEONInstAlias<"vacle${p}.f16 $Vd, $Vn, $Vm",
5238 (VACGEhq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
5241 // +fp16fml Floating Point Multiplication Variants
5242 let Predicates = [HasNEON, HasFP16FML], DecoderNamespace= "VFPV8" in {
5244 class N3VCP8F16Q1<string asm, RegisterClass Td, RegisterClass Tn,
5245 RegisterClass Tm, bits<2> op1, bits<2> op2, bit op3>
5246 : N3VCP8<op1, op2, 1, op3, (outs Td:$Vd), (ins Tn:$Vn, Tm:$Vm), NoItinerary,
5247 asm, "f16", "$Vd, $Vn, $Vm", "", []>;
5249 class N3VCP8F16Q0<string asm, RegisterClass Td, RegisterClass Tn,
5250 RegisterClass Tm, bits<2> op1, bits<2> op2, bit op3>
5251 : N3VCP8Q0<op1, op2, 0, op3, (outs Td:$Vd), (ins Tn:$Vn, Tm:$Vm), NoItinerary,
5252 asm, "f16", "$Vd, $Vn, $Vm", "", []>;
5254 // Vd, Vs, Vs[0-15], Idx[0-1]
5255 class VFMD<string opc, string type, bits<2> S>
5256 : N3VLaneCP8<0, S, 0, 1, (outs DPR:$Vd),
5257 (ins SPR:$Vn, SPR_8:$Vm, VectorIndex32:$idx),
5258 IIC_VMACD, opc, type, "$Vd, $Vn, $Vm$idx", "", []> {
5261 let Inst{19-16} = Vn{4-1};
5262 let Inst{7} = Vn{0};
5263 let Inst{5} = Vm{0};
5264 let Inst{2-0} = Vm{3-1};
5267 // Vq, Vd, Vd[0-7], Idx[0-3]
5268 class VFMQ<string opc, string type, bits<2> S>
5269 : N3VLaneCP8<0, S, 1, 1, (outs QPR:$Vd),
5270 (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$idx),
5271 IIC_VMACD, opc, type, "$Vd, $Vn, $Vm$idx", "", []> {
5273 let Inst{5} = idx{1};
5274 let Inst{3} = idx{0};
5278 def VFMALD : N3VCP8F16Q0<"vfmal", DPR, SPR, SPR, 0b00, 0b10, 1>;
5279 def VFMSLD : N3VCP8F16Q0<"vfmsl", DPR, SPR, SPR, 0b01, 0b10, 1>;
5280 def VFMALQ : N3VCP8F16Q1<"vfmal", QPR, DPR, DPR, 0b00, 0b10, 1>;
5281 def VFMSLQ : N3VCP8F16Q1<"vfmsl", QPR, DPR, DPR, 0b01, 0b10, 1>;
5282 def VFMALDI : VFMD<"vfmal", "f16", 0b00>;
5283 def VFMSLDI : VFMD<"vfmsl", "f16", 0b01>;
5284 def VFMALQI : VFMQ<"vfmal", "f16", 0b00>;
5285 def VFMSLQI : VFMQ<"vfmsl", "f16", 0b01>;
5286 } // HasNEON, HasFP16FML
5289 def: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vm",
5290 (VACGTfd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
5291 def: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vm",
5292 (VACGTfq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
5293 def: NEONInstAlias<"vacle${p}.f32 $Vd, $Vm",
5294 (VACGEfd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
5295 def: NEONInstAlias<"vacle${p}.f32 $Vd, $Vm",
5296 (VACGEfq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
5297 let Predicates = [HasNEON, HasFullFP16] in {
5298 def: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vm",
5299 (VACGThd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
5300 def: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vm",
5301 (VACGThq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
5302 def: NEONInstAlias<"vacle${p}.f16 $Vd, $Vm",
5303 (VACGEhd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
5304 def: NEONInstAlias<"vacle${p}.f16 $Vd, $Vm",
5305 (VACGEhq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
5308 // Vector Bitwise Operations.
5310 def vnotd : PatFrag<(ops node:$in),
5311 (xor node:$in, ARMimmAllOnesD)>;
5312 def vnotq : PatFrag<(ops node:$in),
5313 (xor node:$in, ARMimmAllOnesV)>;
5316 // VAND : Vector Bitwise AND
5317 def VANDd : N3VDX<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand",
5318 v2i32, v2i32, and, 1>;
5319 def VANDq : N3VQX<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand",
5320 v4i32, v4i32, and, 1>;
5322 // VEOR : Vector Bitwise Exclusive OR
5323 def VEORd : N3VDX<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor",
5324 v2i32, v2i32, xor, 1>;
5325 def VEORq : N3VQX<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor",
5326 v4i32, v4i32, xor, 1>;
5328 // VORR : Vector Bitwise OR
5329 def VORRd : N3VDX<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr",
5330 v2i32, v2i32, or, 1>;
5331 def VORRq : N3VQX<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr",
5332 v4i32, v4i32, or, 1>;
5334 multiclass BitwisePatterns<string Name, SDPatternOperator OpNodeD,
5335 SDPatternOperator OpNodeQ> {
5336 def : Pat<(v8i8 (OpNodeD DPR:$LHS, DPR:$RHS)),
5337 (!cast<Instruction>(Name#"d") DPR:$LHS, DPR:$RHS)>;
5338 def : Pat<(v4i16 (OpNodeD DPR:$LHS, DPR:$RHS)),
5339 (!cast<Instruction>(Name#"d") DPR:$LHS, DPR:$RHS)>;
5340 def : Pat<(v1i64 (OpNodeD DPR:$LHS, DPR:$RHS)),
5341 (!cast<Instruction>(Name#"d") DPR:$LHS, DPR:$RHS)>;
5343 def : Pat<(v16i8 (OpNodeQ QPR:$LHS, QPR:$RHS)),
5344 (!cast<Instruction>(Name#"q") QPR:$LHS, QPR:$RHS)>;
5345 def : Pat<(v8i16 (OpNodeQ QPR:$LHS, QPR:$RHS)),
5346 (!cast<Instruction>(Name#"q") QPR:$LHS, QPR:$RHS)>;
5347 def : Pat<(v2i64 (OpNodeQ QPR:$LHS, QPR:$RHS)),
5348 (!cast<Instruction>(Name#"q") QPR:$LHS, QPR:$RHS)>;
5351 let Predicates = [HasNEON] in {
5352 defm : BitwisePatterns<"VAND", and, and>;
5353 defm : BitwisePatterns<"VORR", or, or>;
5354 defm : BitwisePatterns<"VEOR", xor, xor>;
5357 def VORRiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 0, 1,
5358 (outs DPR:$Vd), (ins nImmSplatI16:$SIMM, DPR:$src),
5360 "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
5362 (v4i16 (ARMvorrImm DPR:$src, timm:$SIMM)))]> {
5363 let Inst{9} = SIMM{9};
5366 def VORRiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 0, 1,
5367 (outs DPR:$Vd), (ins nImmSplatI32:$SIMM, DPR:$src),
5369 "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
5371 (v2i32 (ARMvorrImm DPR:$src, timm:$SIMM)))]> {
5372 let Inst{10-9} = SIMM{10-9};
5375 def VORRiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 0, 1,
5376 (outs QPR:$Vd), (ins nImmSplatI16:$SIMM, QPR:$src),
5378 "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
5380 (v8i16 (ARMvorrImm QPR:$src, timm:$SIMM)))]> {
5381 let Inst{9} = SIMM{9};
5384 def VORRiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 0, 1,
5385 (outs QPR:$Vd), (ins nImmSplatI32:$SIMM, QPR:$src),
5387 "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
5389 (v4i32 (ARMvorrImm QPR:$src, timm:$SIMM)))]> {
5390 let Inst{10-9} = SIMM{10-9};
5394 // VBIC : Vector Bitwise Bit Clear (AND NOT)
5395 let TwoOperandAliasConstraint = "$Vn = $Vd" in {
5396 def VBICd : N3VX<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
5397 (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
5398 "vbic", "$Vd, $Vn, $Vm", "",
5399 [(set DPR:$Vd, (v2i32 (and DPR:$Vn,
5400 (vnotd DPR:$Vm))))]>;
5401 def VBICq : N3VX<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
5402 (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
5403 "vbic", "$Vd, $Vn, $Vm", "",
5404 [(set QPR:$Vd, (v4i32 (and QPR:$Vn,
5405 (vnotq QPR:$Vm))))]>;
5408 let Predicates = [HasNEON] in {
5409 defm : BitwisePatterns<"VBIC", BinOpFrag<(and node:$LHS, (vnotd node:$RHS))>,
5410 BinOpFrag<(and node:$LHS, (vnotq node:$RHS))>>;
5413 def VBICiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 1, 1,
5414 (outs DPR:$Vd), (ins nImmSplatI16:$SIMM, DPR:$src),
5416 "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
5418 (v4i16 (ARMvbicImm DPR:$src, timm:$SIMM)))]> {
5419 let Inst{9} = SIMM{9};
5422 def VBICiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 1, 1,
5423 (outs DPR:$Vd), (ins nImmSplatI32:$SIMM, DPR:$src),
5425 "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
5427 (v2i32 (ARMvbicImm DPR:$src, timm:$SIMM)))]> {
5428 let Inst{10-9} = SIMM{10-9};
5431 def VBICiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 1, 1,
5432 (outs QPR:$Vd), (ins nImmSplatI16:$SIMM, QPR:$src),
5434 "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
5436 (v8i16 (ARMvbicImm QPR:$src, timm:$SIMM)))]> {
5437 let Inst{9} = SIMM{9};
5440 def VBICiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 1, 1,
5441 (outs QPR:$Vd), (ins nImmSplatI32:$SIMM, QPR:$src),
5443 "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
5445 (v4i32 (ARMvbicImm QPR:$src, timm:$SIMM)))]> {
5446 let Inst{10-9} = SIMM{10-9};
5449 // VORN : Vector Bitwise OR NOT
5450 def VORNd : N3VX<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$Vd),
5451 (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
5452 "vorn", "$Vd, $Vn, $Vm", "",
5453 [(set DPR:$Vd, (v2i32 (or DPR:$Vn,
5454 (vnotd DPR:$Vm))))]>;
5455 def VORNq : N3VX<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$Vd),
5456 (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
5457 "vorn", "$Vd, $Vn, $Vm", "",
5458 [(set QPR:$Vd, (v4i32 (or QPR:$Vn,
5459 (vnotq QPR:$Vm))))]>;
5461 let Predicates = [HasNEON] in {
5462 defm : BitwisePatterns<"VORN", BinOpFrag<(or node:$LHS, (vnotd node:$RHS))>,
5463 BinOpFrag<(or node:$LHS, (vnotq node:$RHS))>>;
5466 // VMVN : Vector Bitwise NOT (Immediate)
5468 let isReMaterializable = 1 in {
5470 def VMVNv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 1, 1, (outs DPR:$Vd),
5471 (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
5472 "vmvn", "i16", "$Vd, $SIMM", "",
5473 [(set DPR:$Vd, (v4i16 (ARMvmvnImm timm:$SIMM)))]> {
5474 let Inst{9} = SIMM{9};
5477 def VMVNv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 1, 1, (outs QPR:$Vd),
5478 (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
5479 "vmvn", "i16", "$Vd, $SIMM", "",
5480 [(set QPR:$Vd, (v8i16 (ARMvmvnImm timm:$SIMM)))]> {
5481 let Inst{9} = SIMM{9};
5484 def VMVNv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 1, 1, (outs DPR:$Vd),
5485 (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
5486 "vmvn", "i32", "$Vd, $SIMM", "",
5487 [(set DPR:$Vd, (v2i32 (ARMvmvnImm timm:$SIMM)))]> {
5488 let Inst{11-8} = SIMM{11-8};
5491 def VMVNv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 1, 1, (outs QPR:$Vd),
5492 (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
5493 "vmvn", "i32", "$Vd, $SIMM", "",
5494 [(set QPR:$Vd, (v4i32 (ARMvmvnImm timm:$SIMM)))]> {
5495 let Inst{11-8} = SIMM{11-8};
5499 // VMVN : Vector Bitwise NOT
5500 def VMVNd : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
5501 (outs DPR:$Vd), (ins DPR:$Vm), IIC_VSUBiD,
5502 "vmvn", "$Vd, $Vm", "",
5503 [(set DPR:$Vd, (v2i32 (vnotd DPR:$Vm)))]>;
5504 def VMVNq : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
5505 (outs QPR:$Vd), (ins QPR:$Vm), IIC_VSUBiD,
5506 "vmvn", "$Vd, $Vm", "",
5507 [(set QPR:$Vd, (v4i32 (vnotq QPR:$Vm)))]>;
5508 let Predicates = [HasNEON] in {
5509 def : Pat<(v1i64 (vnotd DPR:$src)),
5511 def : Pat<(v4i16 (vnotd DPR:$src)),
5513 def : Pat<(v8i8 (vnotd DPR:$src)),
5515 def : Pat<(v2i64 (vnotq QPR:$src)),
5517 def : Pat<(v8i16 (vnotq QPR:$src)),
5519 def : Pat<(v16i8 (vnotq QPR:$src)),
5523 // The TwoAddress pass will not go looking for equivalent operations
5524 // with different register constraints; it just inserts copies.
5525 // That is why pseudo VBSP implemented. Is is expanded later into
5526 // VBIT/VBIF/VBSL taking into account register constraints to avoid copies.
5527 def VBSPd : PseudoNeonI<(outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
5528 IIC_VBINiD, "", []>;
5529 let Predicates = [HasNEON] in {
5530 def : Pat<(v8i8 (NEONvbsp (v8i8 DPR:$src1),
5531 (v8i8 DPR:$Vn), (v8i8 DPR:$Vm))),
5532 (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
5533 def : Pat<(v4i16 (NEONvbsp (v4i16 DPR:$src1),
5534 (v4i16 DPR:$Vn), (v4i16 DPR:$Vm))),
5535 (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
5536 def : Pat<(v2i32 (NEONvbsp (v2i32 DPR:$src1),
5537 (v2i32 DPR:$Vn), (v2i32 DPR:$Vm))),
5538 (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
5539 def : Pat<(v2f32 (NEONvbsp (v2f32 DPR:$src1),
5540 (v2f32 DPR:$Vn), (v2f32 DPR:$Vm))),
5541 (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
5542 def : Pat<(v1i64 (NEONvbsp (v1i64 DPR:$src1),
5543 (v1i64 DPR:$Vn), (v1i64 DPR:$Vm))),
5544 (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
5546 def : Pat<(v8i8 (or (and DPR:$Vn, DPR:$Vd),
5547 (and DPR:$Vm, (vnotd DPR:$Vd)))),
5548 (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
5549 def : Pat<(v4i16 (or (and DPR:$Vn, DPR:$Vd),
5550 (and DPR:$Vm, (vnotd DPR:$Vd)))),
5551 (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
5552 def : Pat<(v2i32 (or (and DPR:$Vn, DPR:$Vd),
5553 (and DPR:$Vm, (vnotd DPR:$Vd)))),
5554 (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
5555 def : Pat<(v1i64 (or (and DPR:$Vn, DPR:$Vd),
5556 (and DPR:$Vm, (vnotd DPR:$Vd)))),
5557 (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
5560 def VBSPq : PseudoNeonI<(outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
5561 IIC_VBINiQ, "", []>;
5562 let Predicates = [HasNEON] in {
5563 def : Pat<(v16i8 (NEONvbsp (v16i8 QPR:$src1),
5564 (v16i8 QPR:$Vn), (v16i8 QPR:$Vm))),
5565 (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
5566 def : Pat<(v8i16 (NEONvbsp (v8i16 QPR:$src1),
5567 (v8i16 QPR:$Vn), (v8i16 QPR:$Vm))),
5568 (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
5569 def : Pat<(v4i32 (NEONvbsp (v4i32 QPR:$src1),
5570 (v4i32 QPR:$Vn), (v4i32 QPR:$Vm))),
5571 (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
5572 def : Pat<(v4f32 (NEONvbsp (v4f32 QPR:$src1),
5573 (v4f32 QPR:$Vn), (v4f32 QPR:$Vm))),
5574 (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
5575 def : Pat<(v2i64 (NEONvbsp (v2i64 QPR:$src1),
5576 (v2i64 QPR:$Vn), (v2i64 QPR:$Vm))),
5577 (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
5579 def : Pat<(v16i8 (or (and QPR:$Vn, QPR:$Vd),
5580 (and QPR:$Vm, (vnotq QPR:$Vd)))),
5581 (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
5582 def : Pat<(v8i16 (or (and QPR:$Vn, QPR:$Vd),
5583 (and QPR:$Vm, (vnotq QPR:$Vd)))),
5584 (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
5585 def : Pat<(v4i32 (or (and QPR:$Vn, QPR:$Vd),
5586 (and QPR:$Vm, (vnotq QPR:$Vd)))),
5587 (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
5588 def : Pat<(v2i64 (or (and QPR:$Vn, QPR:$Vd),
5589 (and QPR:$Vm, (vnotq QPR:$Vd)))),
5590 (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
5593 // VBSL : Vector Bitwise Select
5594 def VBSLd : N3VX<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
5595 (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
5596 N3RegFrm, IIC_VBINiD,
5597 "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5600 def VBSLq : N3VX<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
5601 (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
5602 N3RegFrm, IIC_VBINiQ,
5603 "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5606 // VBIF : Vector Bitwise Insert if False
5607 // like VBSL but with: "vbif $dst, $src3, $src1", "$src2 = $dst",
5608 def VBIFd : N3VX<1, 0, 0b11, 0b0001, 0, 1,
5609 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
5610 N3RegFrm, IIC_VBINiD,
5611 "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5613 def VBIFq : N3VX<1, 0, 0b11, 0b0001, 1, 1,
5614 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
5615 N3RegFrm, IIC_VBINiQ,
5616 "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5619 // VBIT : Vector Bitwise Insert if True
5620 // like VBSL but with: "vbit $dst, $src2, $src1", "$src3 = $dst",
5621 def VBITd : N3VX<1, 0, 0b10, 0b0001, 0, 1,
5622 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
5623 N3RegFrm, IIC_VBINiD,
5624 "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5626 def VBITq : N3VX<1, 0, 0b10, 0b0001, 1, 1,
5627 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
5628 N3RegFrm, IIC_VBINiQ,
5629 "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5632 // Vector Absolute Differences.
5634 // VABD : Vector Absolute Difference
5635 defm VABDs : N3VInt_QHS<0, 0, 0b0111, 0, N3RegFrm,
5636 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5637 "vabd", "s", abds, 1>;
5638 defm VABDu : N3VInt_QHS<1, 0, 0b0111, 0, N3RegFrm,
5639 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5640 "vabd", "u", abdu, 1>;
5641 def VABDfd : N3VDInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBIND,
5642 "vabd", "f32", v2f32, v2f32, int_arm_neon_vabds, 1>;
5643 def VABDfq : N3VQInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBINQ,
5644 "vabd", "f32", v4f32, v4f32, int_arm_neon_vabds, 1>;
5645 def VABDhd : N3VDInt<1, 0, 0b11, 0b1101, 0, N3RegFrm, IIC_VBIND,
5646 "vabd", "f16", v4f16, v4f16, int_arm_neon_vabds, 1>,
5647 Requires<[HasNEON, HasFullFP16]>;
5648 def VABDhq : N3VQInt<1, 0, 0b11, 0b1101, 0, N3RegFrm, IIC_VBINQ,
5649 "vabd", "f16", v8f16, v8f16, int_arm_neon_vabds, 1>,
5650 Requires<[HasNEON, HasFullFP16]>;
5652 // VABDL : Vector Absolute Difference Long (Q = | D - D |)
5653 defm VABDLs : N3VLIntExt_QHS<0,1,0b0111,0, IIC_VSUBi4Q,
5654 "vabdl", "s", abds, zext, 1>;
5655 defm VABDLu : N3VLIntExt_QHS<1,1,0b0111,0, IIC_VSUBi4Q,
5656 "vabdl", "u", abdu, zext, 1>;
5658 let Predicates = [HasNEON] in {
5659 def : Pat<(v8i16 (zext (abdu (v8i8 DPR:$opA), (v8i8 DPR:$opB)))),
5660 (VABDLuv8i16 DPR:$opA, DPR:$opB)>;
5661 def : Pat<(v4i32 (zext (abdu (v4i16 DPR:$opA), (v4i16 DPR:$opB)))),
5662 (VABDLuv4i32 DPR:$opA, DPR:$opB)>;
5663 def : Pat<(v2i64 (zext (abdu (v2i32 DPR:$opA), (v2i32 DPR:$opB)))),
5664 (VABDLuv2i64 DPR:$opA, DPR:$opB)>;
5667 // VABA : Vector Absolute Difference and Accumulate
5668 defm VABAs : N3VIntOp_QHS<0,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
5669 "vaba", "s", abds, add>;
5670 defm VABAu : N3VIntOp_QHS<1,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
5671 "vaba", "u", abdu, add>;
5673 // VABAL : Vector Absolute Difference and Accumulate Long (Q += | D - D |)
5674 defm VABALs : N3VLIntExtOp_QHS<0,1,0b0101,0, IIC_VABAD,
5675 "vabal", "s", abds, zext, add>;
5676 defm VABALu : N3VLIntExtOp_QHS<1,1,0b0101,0, IIC_VABAD,
5677 "vabal", "u", abdu, zext, add>;
5679 // Vector Maximum and Minimum.
5681 // VMAX : Vector Maximum
5682 defm VMAXs : N3VInt_QHS<0, 0, 0b0110, 0, N3RegFrm,
5683 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5684 "vmax", "s", smax, 1>;
5685 defm VMAXu : N3VInt_QHS<1, 0, 0b0110, 0, N3RegFrm,
5686 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5687 "vmax", "u", umax, 1>;
5688 def VMAXfd : N3VDInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBIND,
5690 v2f32, v2f32, fmaximum, 1>;
5691 def VMAXfq : N3VQInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBINQ,
5693 v4f32, v4f32, fmaximum, 1>;
5694 def VMAXhd : N3VDInt<0, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VBIND,
5696 v4f16, v4f16, fmaximum, 1>,
5697 Requires<[HasNEON, HasFullFP16]>;
5698 def VMAXhq : N3VQInt<0, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VBINQ,
5700 v8f16, v8f16, fmaximum, 1>,
5701 Requires<[HasNEON, HasFullFP16]>;
5704 let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
5705 def NEON_VMAXNMNDf : N3VDIntnp<0b00110, 0b00, 0b1111, 0, 1,
5706 N3RegFrm, NoItinerary, "vmaxnm", "f32",
5707 v2f32, v2f32, fmaxnum, 1>,
5708 Requires<[HasFPARMv8, HasNEON]>;
5709 def NEON_VMAXNMNQf : N3VQIntnp<0b00110, 0b00, 0b1111, 1, 1,
5710 N3RegFrm, NoItinerary, "vmaxnm", "f32",
5711 v4f32, v4f32, fmaxnum, 1>,
5712 Requires<[HasFPARMv8, HasNEON]>;
5713 def NEON_VMAXNMNDh : N3VDIntnp<0b00110, 0b01, 0b1111, 0, 1,
5714 N3RegFrm, NoItinerary, "vmaxnm", "f16",
5715 v4f16, v4f16, fmaxnum, 1>,
5716 Requires<[HasFPARMv8, HasNEON, HasFullFP16]>;
5717 def NEON_VMAXNMNQh : N3VQIntnp<0b00110, 0b01, 0b1111, 1, 1,
5718 N3RegFrm, NoItinerary, "vmaxnm", "f16",
5719 v8f16, v8f16, fmaxnum, 1>,
5720 Requires<[HasFPARMv8, HasNEON, HasFullFP16]>;
5723 // VMIN : Vector Minimum
5724 defm VMINs : N3VInt_QHS<0, 0, 0b0110, 1, N3RegFrm,
5725 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5726 "vmin", "s", smin, 1>;
5727 defm VMINu : N3VInt_QHS<1, 0, 0b0110, 1, N3RegFrm,
5728 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5729 "vmin", "u", umin, 1>;
5730 def VMINfd : N3VDInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBIND,
5732 v2f32, v2f32, fminimum, 1>;
5733 def VMINfq : N3VQInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBINQ,
5735 v4f32, v4f32, fminimum, 1>;
5736 def VMINhd : N3VDInt<0, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VBIND,
5738 v4f16, v4f16, fminimum, 1>,
5739 Requires<[HasNEON, HasFullFP16]>;
5740 def VMINhq : N3VQInt<0, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VBINQ,
5742 v8f16, v8f16, fminimum, 1>,
5743 Requires<[HasNEON, HasFullFP16]>;
5746 let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
5747 def NEON_VMINNMNDf : N3VDIntnp<0b00110, 0b10, 0b1111, 0, 1,
5748 N3RegFrm, NoItinerary, "vminnm", "f32",
5749 v2f32, v2f32, fminnum, 1>,
5750 Requires<[HasFPARMv8, HasNEON]>;
5751 def NEON_VMINNMNQf : N3VQIntnp<0b00110, 0b10, 0b1111, 1, 1,
5752 N3RegFrm, NoItinerary, "vminnm", "f32",
5753 v4f32, v4f32, fminnum, 1>,
5754 Requires<[HasFPARMv8, HasNEON]>;
5755 def NEON_VMINNMNDh : N3VDIntnp<0b00110, 0b11, 0b1111, 0, 1,
5756 N3RegFrm, NoItinerary, "vminnm", "f16",
5757 v4f16, v4f16, fminnum, 1>,
5758 Requires<[HasFPARMv8, HasNEON, HasFullFP16]>;
5759 def NEON_VMINNMNQh : N3VQIntnp<0b00110, 0b11, 0b1111, 1, 1,
5760 N3RegFrm, NoItinerary, "vminnm", "f16",
5761 v8f16, v8f16, fminnum, 1>,
5762 Requires<[HasFPARMv8, HasNEON, HasFullFP16]>;
5765 // Vector Pairwise Operations.
5767 // VPADD : Vector Pairwise Add
5768 def VPADDi8 : N3VDInt<0, 0, 0b00, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
5770 v8i8, v8i8, int_arm_neon_vpadd, 0>;
5771 def VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
5773 v4i16, v4i16, int_arm_neon_vpadd, 0>;
5774 def VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
5776 v2i32, v2i32, int_arm_neon_vpadd, 0>;
5777 def VPADDf : N3VDInt<1, 0, 0b00, 0b1101, 0, N3RegFrm,
5778 IIC_VPBIND, "vpadd", "f32",
5779 v2f32, v2f32, int_arm_neon_vpadd, 0>;
5780 def VPADDh : N3VDInt<1, 0, 0b01, 0b1101, 0, N3RegFrm,
5781 IIC_VPBIND, "vpadd", "f16",
5782 v4f16, v4f16, int_arm_neon_vpadd, 0>,
5783 Requires<[HasNEON, HasFullFP16]>;
5785 // VPADDL : Vector Pairwise Add Long
5786 defm VPADDLs : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl", "s",
5787 int_arm_neon_vpaddls>;
5788 defm VPADDLu : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl", "u",
5789 int_arm_neon_vpaddlu>;
5791 // VPADAL : Vector Pairwise Add and Accumulate Long
5792 defm VPADALs : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01100, 0, "vpadal", "s",
5793 int_arm_neon_vpadals>;
5794 defm VPADALu : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01101, 0, "vpadal", "u",
5795 int_arm_neon_vpadalu>;
5797 // VPMAX : Vector Pairwise Maximum
5798 def VPMAXs8 : N3VDInt<0, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
5799 "s8", v8i8, v8i8, int_arm_neon_vpmaxs, 0>;
5800 def VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
5801 "s16", v4i16, v4i16, int_arm_neon_vpmaxs, 0>;
5802 def VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
5803 "s32", v2i32, v2i32, int_arm_neon_vpmaxs, 0>;
5804 def VPMAXu8 : N3VDInt<1, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
5805 "u8", v8i8, v8i8, int_arm_neon_vpmaxu, 0>;
5806 def VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
5807 "u16", v4i16, v4i16, int_arm_neon_vpmaxu, 0>;
5808 def VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
5809 "u32", v2i32, v2i32, int_arm_neon_vpmaxu, 0>;
5810 def VPMAXf : N3VDInt<1, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmax",
5811 "f32", v2f32, v2f32, int_arm_neon_vpmaxs, 0>;
5812 def VPMAXh : N3VDInt<1, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmax",
5813 "f16", v4f16, v4f16, int_arm_neon_vpmaxs, 0>,
5814 Requires<[HasNEON, HasFullFP16]>;
5816 // VPMIN : Vector Pairwise Minimum
5817 def VPMINs8 : N3VDInt<0, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
5818 "s8", v8i8, v8i8, int_arm_neon_vpmins, 0>;
5819 def VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
5820 "s16", v4i16, v4i16, int_arm_neon_vpmins, 0>;
5821 def VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
5822 "s32", v2i32, v2i32, int_arm_neon_vpmins, 0>;
5823 def VPMINu8 : N3VDInt<1, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
5824 "u8", v8i8, v8i8, int_arm_neon_vpminu, 0>;
5825 def VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
5826 "u16", v4i16, v4i16, int_arm_neon_vpminu, 0>;
5827 def VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
5828 "u32", v2i32, v2i32, int_arm_neon_vpminu, 0>;
5829 def VPMINf : N3VDInt<1, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmin",
5830 "f32", v2f32, v2f32, int_arm_neon_vpmins, 0>;
5831 def VPMINh : N3VDInt<1, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmin",
5832 "f16", v4f16, v4f16, int_arm_neon_vpmins, 0>,
5833 Requires<[HasNEON, HasFullFP16]>;
5835 // Vector Reciprocal and Reciprocal Square Root Estimate and Step.
5837 // VRECPE : Vector Reciprocal Estimate
5838 def VRECPEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
5839 IIC_VUNAD, "vrecpe", "u32",
5840 v2i32, v2i32, int_arm_neon_vrecpe>;
5841 def VRECPEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
5842 IIC_VUNAQ, "vrecpe", "u32",
5843 v4i32, v4i32, int_arm_neon_vrecpe>;
5844 def VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
5845 IIC_VUNAD, "vrecpe", "f32",
5846 v2f32, v2f32, int_arm_neon_vrecpe>;
5847 def VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
5848 IIC_VUNAQ, "vrecpe", "f32",
5849 v4f32, v4f32, int_arm_neon_vrecpe>;
5850 def VRECPEhd : N2VDInt<0b11, 0b11, 0b01, 0b11, 0b01010, 0,
5851 IIC_VUNAD, "vrecpe", "f16",
5852 v4f16, v4f16, int_arm_neon_vrecpe>,
5853 Requires<[HasNEON, HasFullFP16]>;
5854 def VRECPEhq : N2VQInt<0b11, 0b11, 0b01, 0b11, 0b01010, 0,
5855 IIC_VUNAQ, "vrecpe", "f16",
5856 v8f16, v8f16, int_arm_neon_vrecpe>,
5857 Requires<[HasNEON, HasFullFP16]>;
5859 // VRECPS : Vector Reciprocal Step
5860 def VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
5861 IIC_VRECSD, "vrecps", "f32",
5862 v2f32, v2f32, int_arm_neon_vrecps, 1>;
5863 def VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
5864 IIC_VRECSQ, "vrecps", "f32",
5865 v4f32, v4f32, int_arm_neon_vrecps, 1>;
5866 def VRECPShd : N3VDInt<0, 0, 0b01, 0b1111, 1, N3RegFrm,
5867 IIC_VRECSD, "vrecps", "f16",
5868 v4f16, v4f16, int_arm_neon_vrecps, 1>,
5869 Requires<[HasNEON, HasFullFP16]>;
5870 def VRECPShq : N3VQInt<0, 0, 0b01, 0b1111, 1, N3RegFrm,
5871 IIC_VRECSQ, "vrecps", "f16",
5872 v8f16, v8f16, int_arm_neon_vrecps, 1>,
5873 Requires<[HasNEON, HasFullFP16]>;
5875 // VRSQRTE : Vector Reciprocal Square Root Estimate
5876 def VRSQRTEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
5877 IIC_VUNAD, "vrsqrte", "u32",
5878 v2i32, v2i32, int_arm_neon_vrsqrte>;
5879 def VRSQRTEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
5880 IIC_VUNAQ, "vrsqrte", "u32",
5881 v4i32, v4i32, int_arm_neon_vrsqrte>;
5882 def VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
5883 IIC_VUNAD, "vrsqrte", "f32",
5884 v2f32, v2f32, int_arm_neon_vrsqrte>;
5885 def VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
5886 IIC_VUNAQ, "vrsqrte", "f32",
5887 v4f32, v4f32, int_arm_neon_vrsqrte>;
5888 def VRSQRTEhd : N2VDInt<0b11, 0b11, 0b01, 0b11, 0b01011, 0,
5889 IIC_VUNAD, "vrsqrte", "f16",
5890 v4f16, v4f16, int_arm_neon_vrsqrte>,
5891 Requires<[HasNEON, HasFullFP16]>;
5892 def VRSQRTEhq : N2VQInt<0b11, 0b11, 0b01, 0b11, 0b01011, 0,
5893 IIC_VUNAQ, "vrsqrte", "f16",
5894 v8f16, v8f16, int_arm_neon_vrsqrte>,
5895 Requires<[HasNEON, HasFullFP16]>;
5897 // VRSQRTS : Vector Reciprocal Square Root Step
5898 def VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
5899 IIC_VRECSD, "vrsqrts", "f32",
5900 v2f32, v2f32, int_arm_neon_vrsqrts, 1>;
5901 def VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
5902 IIC_VRECSQ, "vrsqrts", "f32",
5903 v4f32, v4f32, int_arm_neon_vrsqrts, 1>;
5904 def VRSQRTShd : N3VDInt<0, 0, 0b11, 0b1111, 1, N3RegFrm,
5905 IIC_VRECSD, "vrsqrts", "f16",
5906 v4f16, v4f16, int_arm_neon_vrsqrts, 1>,
5907 Requires<[HasNEON, HasFullFP16]>;
5908 def VRSQRTShq : N3VQInt<0, 0, 0b11, 0b1111, 1, N3RegFrm,
5909 IIC_VRECSQ, "vrsqrts", "f16",
5910 v8f16, v8f16, int_arm_neon_vrsqrts, 1>,
5911 Requires<[HasNEON, HasFullFP16]>;
5915 // VSHL : Vector Shift
5916 defm VSHLs : N3VInt_QHSDSh<0, 0, 0b0100, 0, N3RegVShFrm,
5917 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
5918 "vshl", "s", int_arm_neon_vshifts>;
5919 defm VSHLu : N3VInt_QHSDSh<1, 0, 0b0100, 0, N3RegVShFrm,
5920 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
5921 "vshl", "u", int_arm_neon_vshiftu>;
5923 let Predicates = [HasNEON] in {
5924 def : Pat<(v8i8 (ARMvshls (v8i8 DPR:$Dn), (v8i8 DPR:$Dm))),
5925 (VSHLsv8i8 DPR:$Dn, DPR:$Dm)>;
5926 def : Pat<(v4i16 (ARMvshls (v4i16 DPR:$Dn), (v4i16 DPR:$Dm))),
5927 (VSHLsv4i16 DPR:$Dn, DPR:$Dm)>;
5928 def : Pat<(v2i32 (ARMvshls (v2i32 DPR:$Dn), (v2i32 DPR:$Dm))),
5929 (VSHLsv2i32 DPR:$Dn, DPR:$Dm)>;
5930 def : Pat<(v1i64 (ARMvshls (v1i64 DPR:$Dn), (v1i64 DPR:$Dm))),
5931 (VSHLsv1i64 DPR:$Dn, DPR:$Dm)>;
5932 def : Pat<(v16i8 (ARMvshls (v16i8 QPR:$Dn), (v16i8 QPR:$Dm))),
5933 (VSHLsv16i8 QPR:$Dn, QPR:$Dm)>;
5934 def : Pat<(v8i16 (ARMvshls (v8i16 QPR:$Dn), (v8i16 QPR:$Dm))),
5935 (VSHLsv8i16 QPR:$Dn, QPR:$Dm)>;
5936 def : Pat<(v4i32 (ARMvshls (v4i32 QPR:$Dn), (v4i32 QPR:$Dm))),
5937 (VSHLsv4i32 QPR:$Dn, QPR:$Dm)>;
5938 def : Pat<(v2i64 (ARMvshls (v2i64 QPR:$Dn), (v2i64 QPR:$Dm))),
5939 (VSHLsv2i64 QPR:$Dn, QPR:$Dm)>;
5941 def : Pat<(v8i8 (ARMvshlu (v8i8 DPR:$Dn), (v8i8 DPR:$Dm))),
5942 (VSHLuv8i8 DPR:$Dn, DPR:$Dm)>;
5943 def : Pat<(v4i16 (ARMvshlu (v4i16 DPR:$Dn), (v4i16 DPR:$Dm))),
5944 (VSHLuv4i16 DPR:$Dn, DPR:$Dm)>;
5945 def : Pat<(v2i32 (ARMvshlu (v2i32 DPR:$Dn), (v2i32 DPR:$Dm))),
5946 (VSHLuv2i32 DPR:$Dn, DPR:$Dm)>;
5947 def : Pat<(v1i64 (ARMvshlu (v1i64 DPR:$Dn), (v1i64 DPR:$Dm))),
5948 (VSHLuv1i64 DPR:$Dn, DPR:$Dm)>;
5949 def : Pat<(v16i8 (ARMvshlu (v16i8 QPR:$Dn), (v16i8 QPR:$Dm))),
5950 (VSHLuv16i8 QPR:$Dn, QPR:$Dm)>;
5951 def : Pat<(v8i16 (ARMvshlu (v8i16 QPR:$Dn), (v8i16 QPR:$Dm))),
5952 (VSHLuv8i16 QPR:$Dn, QPR:$Dm)>;
5953 def : Pat<(v4i32 (ARMvshlu (v4i32 QPR:$Dn), (v4i32 QPR:$Dm))),
5954 (VSHLuv4i32 QPR:$Dn, QPR:$Dm)>;
5955 def : Pat<(v2i64 (ARMvshlu (v2i64 QPR:$Dn), (v2i64 QPR:$Dm))),
5956 (VSHLuv2i64 QPR:$Dn, QPR:$Dm)>;
5960 // VSHL : Vector Shift Left (Immediate)
5961 defm VSHLi : N2VShL_QHSD<0, 1, 0b0101, 1, IIC_VSHLiD, "vshl", "i", ARMvshlImm>;
5963 // VSHR : Vector Shift Right (Immediate)
5964 defm VSHRs : N2VShR_QHSD<0, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "s",
5966 defm VSHRu : N2VShR_QHSD<1, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "u",
5969 // VSHLL : Vector Shift Left Long
5970 defm VSHLLs : N2VLSh_QHS<0, 1, 0b1010, 0, 0, 1, "vshll", "s",
5971 PatFrag<(ops node:$LHS, node:$RHS), (ARMvshlImm (sext node:$LHS), node:$RHS)>>;
5972 defm VSHLLu : N2VLSh_QHS<1, 1, 0b1010, 0, 0, 1, "vshll", "u",
5973 PatFrag<(ops node:$LHS, node:$RHS), (ARMvshlImm (zext node:$LHS), node:$RHS)>>;
5975 // VSHLL : Vector Shift Left Long (with maximum shift count)
5976 class N2VLShMax<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
5977 bit op6, bit op4, string OpcodeStr, string Dt, ValueType ResTy,
5978 ValueType OpTy, Operand ImmTy>
5979 : N2VLSh<op24, op23, op11_8, op7, op6, op4, OpcodeStr, Dt,
5980 ResTy, OpTy, ImmTy, null_frag> {
5981 let Inst{21-16} = op21_16;
5982 let DecoderMethod = "DecodeVSHLMaxInstruction";
5984 def VSHLLi8 : N2VLShMax<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll", "i8",
5986 def VSHLLi16 : N2VLShMax<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll", "i16",
5987 v4i32, v4i16, imm16>;
5988 def VSHLLi32 : N2VLShMax<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll", "i32",
5989 v2i64, v2i32, imm32>;
5991 let Predicates = [HasNEON] in {
5992 def : Pat<(v8i16 (ARMvshlImm (zext (v8i8 DPR:$Rn)), (i32 8))),
5993 (VSHLLi8 DPR:$Rn, 8)>;
5994 def : Pat<(v4i32 (ARMvshlImm (zext (v4i16 DPR:$Rn)), (i32 16))),
5995 (VSHLLi16 DPR:$Rn, 16)>;
5996 def : Pat<(v2i64 (ARMvshlImm (zext (v2i32 DPR:$Rn)), (i32 32))),
5997 (VSHLLi32 DPR:$Rn, 32)>;
5998 def : Pat<(v8i16 (ARMvshlImm (sext (v8i8 DPR:$Rn)), (i32 8))),
5999 (VSHLLi8 DPR:$Rn, 8)>;
6000 def : Pat<(v4i32 (ARMvshlImm (sext (v4i16 DPR:$Rn)), (i32 16))),
6001 (VSHLLi16 DPR:$Rn, 16)>;
6002 def : Pat<(v2i64 (ARMvshlImm (sext (v2i32 DPR:$Rn)), (i32 32))),
6003 (VSHLLi32 DPR:$Rn, 32)>;
6004 def : Pat<(v8i16 (ARMvshlImm (anyext (v8i8 DPR:$Rn)), (i32 8))),
6005 (VSHLLi8 DPR:$Rn, 8)>;
6006 def : Pat<(v4i32 (ARMvshlImm (anyext (v4i16 DPR:$Rn)), (i32 16))),
6007 (VSHLLi16 DPR:$Rn, 16)>;
6008 def : Pat<(v2i64 (ARMvshlImm (anyext (v2i32 DPR:$Rn)), (i32 32))),
6009 (VSHLLi32 DPR:$Rn, 32)>;
6012 // VSHRN : Vector Shift Right and Narrow
6013 defm VSHRN : N2VNSh_HSD<0,1,0b1000,0,0,1, IIC_VSHLiD, "vshrn", "i",
6014 PatFrag<(ops node:$Rn, node:$amt),
6015 (trunc (ARMvshrsImm node:$Rn, node:$amt))>>;
6017 let Predicates = [HasNEON] in {
6018 def : Pat<(v8i8 (trunc (ARMvshruImm (v8i16 QPR:$Vn), shr_imm8:$amt))),
6019 (VSHRNv8i8 QPR:$Vn, shr_imm8:$amt)>;
6020 def : Pat<(v4i16 (trunc (ARMvshruImm (v4i32 QPR:$Vn), shr_imm16:$amt))),
6021 (VSHRNv4i16 QPR:$Vn, shr_imm16:$amt)>;
6022 def : Pat<(v2i32 (trunc (ARMvshruImm (v2i64 QPR:$Vn), shr_imm32:$amt))),
6023 (VSHRNv2i32 QPR:$Vn, shr_imm32:$amt)>;
6026 // VRSHL : Vector Rounding Shift
6027 defm VRSHLs : N3VInt_QHSDSh<0, 0, 0b0101, 0, N3RegVShFrm,
6028 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
6029 "vrshl", "s", int_arm_neon_vrshifts>;
6030 defm VRSHLu : N3VInt_QHSDSh<1, 0, 0b0101, 0, N3RegVShFrm,
6031 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
6032 "vrshl", "u", int_arm_neon_vrshiftu>;
6033 // VRSHR : Vector Rounding Shift Right
6034 defm VRSHRs : N2VShR_QHSD<0,1,0b0010,1, IIC_VSHLi4D, "vrshr", "s",
6036 defm VRSHRu : N2VShR_QHSD<1,1,0b0010,1, IIC_VSHLi4D, "vrshr", "u",
6039 // VRSHRN : Vector Rounding Shift Right and Narrow
6040 defm VRSHRN : N2VNSh_HSD<0, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vrshrn", "i",
6043 // VQSHL : Vector Saturating Shift
6044 defm VQSHLs : N3VInt_QHSDSh<0, 0, 0b0100, 1, N3RegVShFrm,
6045 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
6046 "vqshl", "s", int_arm_neon_vqshifts>;
6047 defm VQSHLu : N3VInt_QHSDSh<1, 0, 0b0100, 1, N3RegVShFrm,
6048 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
6049 "vqshl", "u", int_arm_neon_vqshiftu>;
6050 // VQSHL : Vector Saturating Shift Left (Immediate)
6051 defm VQSHLsi : N2VShL_QHSD<0,1,0b0111,1, IIC_VSHLi4D, "vqshl", "s",NEONvqshlsImm>;
6052 defm VQSHLui : N2VShL_QHSD<1,1,0b0111,1, IIC_VSHLi4D, "vqshl", "u",NEONvqshluImm>;
6054 // VQSHLU : Vector Saturating Shift Left (Immediate, Unsigned)
6055 defm VQSHLsu : N2VShL_QHSD<1,1,0b0110,1, IIC_VSHLi4D,"vqshlu","s",NEONvqshlsuImm>;
6057 // VQSHRN : Vector Saturating Shift Right and Narrow
6058 defm VQSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "s",
6060 defm VQSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "u",
6063 // VQSHRUN : Vector Saturating Shift Right and Narrow (Unsigned)
6064 defm VQSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 0, 1, IIC_VSHLi4D, "vqshrun", "s",
6067 // VQRSHL : Vector Saturating Rounding Shift
6068 defm VQRSHLs : N3VInt_QHSDSh<0, 0, 0b0101, 1, N3RegVShFrm,
6069 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
6070 "vqrshl", "s", int_arm_neon_vqrshifts>;
6071 defm VQRSHLu : N3VInt_QHSDSh<1, 0, 0b0101, 1, N3RegVShFrm,
6072 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
6073 "vqrshl", "u", int_arm_neon_vqrshiftu>;
6075 // VQRSHRN : Vector Saturating Rounding Shift Right and Narrow
6076 defm VQRSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "s",
6078 defm VQRSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "u",
6081 // VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned)
6082 defm VQRSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vqrshrun", "s",
6085 // VSRA : Vector Shift Right and Accumulate
6086 defm VSRAs : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra", "s", ARMvshrsImm>;
6087 defm VSRAu : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra", "u", ARMvshruImm>;
6088 // VRSRA : Vector Rounding Shift Right and Accumulate
6089 defm VRSRAs : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra", "s", NEONvrshrsImm>;
6090 defm VRSRAu : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra", "u", NEONvrshruImm>;
6092 // VSLI : Vector Shift Left and Insert
6093 defm VSLI : N2VShInsL_QHSD<1, 1, 0b0101, 1, "vsli">;
6095 // VSRI : Vector Shift Right and Insert
6096 defm VSRI : N2VShInsR_QHSD<1, 1, 0b0100, 1, "vsri">;
6098 // Vector Absolute and Saturating Absolute.
6100 // VABS : Vector Absolute Value
6101 defm VABS : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0,
6102 IIC_VUNAiD, IIC_VUNAiQ, "vabs", "s", abs>;
6103 def VABSfd : N2VD<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
6105 v2f32, v2f32, fabs>;
6106 def VABSfq : N2VQ<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
6108 v4f32, v4f32, fabs>;
6109 def VABShd : N2VD<0b11, 0b11, 0b01, 0b01, 0b01110, 0,
6111 v4f16, v4f16, fabs>,
6112 Requires<[HasNEON, HasFullFP16]>;
6113 def VABShq : N2VQ<0b11, 0b11, 0b01, 0b01, 0b01110, 0,
6115 v8f16, v8f16, fabs>,
6116 Requires<[HasNEON, HasFullFP16]>;
6118 // VQABS : Vector Saturating Absolute Value
6119 defm VQABS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0,
6120 IIC_VQUNAiD, IIC_VQUNAiQ, "vqabs", "s",
6121 int_arm_neon_vqabs>;
6125 def vnegd : PatFrag<(ops node:$in),
6126 (sub ARMimmAllZerosD, node:$in)>;
6127 def vnegq : PatFrag<(ops node:$in),
6128 (sub ARMimmAllZerosV, node:$in)>;
6130 class VNEGD<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
6131 : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$Vd), (ins DPR:$Vm),
6132 IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
6133 [(set DPR:$Vd, (Ty (vnegd DPR:$Vm)))]>;
6134 class VNEGQ<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
6135 : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$Vd), (ins QPR:$Vm),
6136 IIC_VSHLiQ, OpcodeStr, Dt, "$Vd, $Vm", "",
6137 [(set QPR:$Vd, (Ty (vnegq QPR:$Vm)))]>;
6139 // VNEG : Vector Negate (integer)
6140 def VNEGs8d : VNEGD<0b00, "vneg", "s8", v8i8>;
6141 def VNEGs16d : VNEGD<0b01, "vneg", "s16", v4i16>;
6142 def VNEGs32d : VNEGD<0b10, "vneg", "s32", v2i32>;
6143 def VNEGs8q : VNEGQ<0b00, "vneg", "s8", v16i8>;
6144 def VNEGs16q : VNEGQ<0b01, "vneg", "s16", v8i16>;
6145 def VNEGs32q : VNEGQ<0b10, "vneg", "s32", v4i32>;
6147 // VNEG : Vector Negate (floating-point)
6148 def VNEGfd : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
6149 (outs DPR:$Vd), (ins DPR:$Vm), IIC_VUNAD,
6150 "vneg", "f32", "$Vd, $Vm", "",
6151 [(set DPR:$Vd, (v2f32 (fneg DPR:$Vm)))]>;
6152 def VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0,
6153 (outs QPR:$Vd), (ins QPR:$Vm), IIC_VUNAQ,
6154 "vneg", "f32", "$Vd, $Vm", "",
6155 [(set QPR:$Vd, (v4f32 (fneg QPR:$Vm)))]>;
6156 def VNEGhd : N2V<0b11, 0b11, 0b01, 0b01, 0b01111, 0, 0,
6157 (outs DPR:$Vd), (ins DPR:$Vm), IIC_VUNAD,
6158 "vneg", "f16", "$Vd, $Vm", "",
6159 [(set DPR:$Vd, (v4f16 (fneg DPR:$Vm)))]>,
6160 Requires<[HasNEON, HasFullFP16]>;
6161 def VNEGhq : N2V<0b11, 0b11, 0b01, 0b01, 0b01111, 1, 0,
6162 (outs QPR:$Vd), (ins QPR:$Vm), IIC_VUNAQ,
6163 "vneg", "f16", "$Vd, $Vm", "",
6164 [(set QPR:$Vd, (v8f16 (fneg QPR:$Vm)))]>,
6165 Requires<[HasNEON, HasFullFP16]>;
6167 let Predicates = [HasNEON] in {
6168 def : Pat<(v8i8 (vnegd DPR:$src)), (VNEGs8d DPR:$src)>;
6169 def : Pat<(v4i16 (vnegd DPR:$src)), (VNEGs16d DPR:$src)>;
6170 def : Pat<(v2i32 (vnegd DPR:$src)), (VNEGs32d DPR:$src)>;
6171 def : Pat<(v16i8 (vnegq QPR:$src)), (VNEGs8q QPR:$src)>;
6172 def : Pat<(v8i16 (vnegq QPR:$src)), (VNEGs16q QPR:$src)>;
6173 def : Pat<(v4i32 (vnegq QPR:$src)), (VNEGs32q QPR:$src)>;
6176 // VQNEG : Vector Saturating Negate
6177 defm VQNEG : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0,
6178 IIC_VQUNAiD, IIC_VQUNAiQ, "vqneg", "s",
6179 int_arm_neon_vqneg>;
6181 // Vector Bit Counting Operations.
6183 // VCLS : Vector Count Leading Sign Bits
6184 defm VCLS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0,
6185 IIC_VCNTiD, IIC_VCNTiQ, "vcls", "s",
6187 // VCLZ : Vector Count Leading Zeros
6188 defm VCLZ : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0,
6189 IIC_VCNTiD, IIC_VCNTiQ, "vclz", "i",
6191 // VCNT : Vector Count One Bits
6192 def VCNTd : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
6193 IIC_VCNTiD, "vcnt", "8",
6195 def VCNTq : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
6196 IIC_VCNTiQ, "vcnt", "8",
6197 v16i8, v16i8, ctpop>;
6200 def VSWPd : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 0, 0,
6201 (outs DPR:$Vd, DPR:$Vm), (ins DPR:$in1, DPR:$in2),
6202 NoItinerary, "vswp", "$Vd, $Vm", "$in1 = $Vd, $in2 = $Vm",
6204 def VSWPq : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 1, 0,
6205 (outs QPR:$Vd, QPR:$Vm), (ins QPR:$in1, QPR:$in2),
6206 NoItinerary, "vswp", "$Vd, $Vm", "$in1 = $Vd, $in2 = $Vm",
6209 // Vector Move Operations.
6211 // VMOV : Vector Move (Register)
6212 def : NEONInstAlias<"vmov${p} $Vd, $Vm",
6213 (VORRd DPR:$Vd, DPR:$Vm, DPR:$Vm, pred:$p)>;
6214 def : NEONInstAlias<"vmov${p} $Vd, $Vm",
6215 (VORRq QPR:$Vd, QPR:$Vm, QPR:$Vm, pred:$p)>;
6217 // VMOV : Vector Move (Immediate)
6219 // Although VMOVs are not strictly speaking cheap, they are as expensive
6220 // as their copies counterpart (VORR), so we should prefer rematerialization
6221 // over splitting when it applies.
6222 let isReMaterializable = 1, isAsCheapAsAMove=1 in {
6223 def VMOVv8i8 : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$Vd),
6224 (ins nImmSplatI8:$SIMM), IIC_VMOVImm,
6225 "vmov", "i8", "$Vd, $SIMM", "",
6226 [(set DPR:$Vd, (v8i8 (ARMvmovImm timm:$SIMM)))]>;
6227 def VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$Vd),
6228 (ins nImmSplatI8:$SIMM), IIC_VMOVImm,
6229 "vmov", "i8", "$Vd, $SIMM", "",
6230 [(set QPR:$Vd, (v16i8 (ARMvmovImm timm:$SIMM)))]>;
6232 def VMOVv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 0, 1, (outs DPR:$Vd),
6233 (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
6234 "vmov", "i16", "$Vd, $SIMM", "",
6235 [(set DPR:$Vd, (v4i16 (ARMvmovImm timm:$SIMM)))]> {
6236 let Inst{9} = SIMM{9};
6239 def VMOVv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 0, 1, (outs QPR:$Vd),
6240 (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
6241 "vmov", "i16", "$Vd, $SIMM", "",
6242 [(set QPR:$Vd, (v8i16 (ARMvmovImm timm:$SIMM)))]> {
6243 let Inst{9} = SIMM{9};
6246 def VMOVv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 0, 1, (outs DPR:$Vd),
6247 (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
6248 "vmov", "i32", "$Vd, $SIMM", "",
6249 [(set DPR:$Vd, (v2i32 (ARMvmovImm timm:$SIMM)))]> {
6250 let Inst{11-8} = SIMM{11-8};
6253 def VMOVv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 0, 1, (outs QPR:$Vd),
6254 (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
6255 "vmov", "i32", "$Vd, $SIMM", "",
6256 [(set QPR:$Vd, (v4i32 (ARMvmovImm timm:$SIMM)))]> {
6257 let Inst{11-8} = SIMM{11-8};
6260 def VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$Vd),
6261 (ins nImmSplatI64:$SIMM), IIC_VMOVImm,
6262 "vmov", "i64", "$Vd, $SIMM", "",
6263 [(set DPR:$Vd, (v1i64 (ARMvmovImm timm:$SIMM)))]>;
6264 def VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$Vd),
6265 (ins nImmSplatI64:$SIMM), IIC_VMOVImm,
6266 "vmov", "i64", "$Vd, $SIMM", "",
6267 [(set QPR:$Vd, (v2i64 (ARMvmovImm timm:$SIMM)))]>;
6269 def VMOVv2f32 : N1ModImm<1, 0b000, 0b1111, 0, 0, 0, 1, (outs DPR:$Vd),
6270 (ins nImmVMOVF32:$SIMM), IIC_VMOVImm,
6271 "vmov", "f32", "$Vd, $SIMM", "",
6272 [(set DPR:$Vd, (v2f32 (ARMvmovFPImm timm:$SIMM)))]>;
6273 def VMOVv4f32 : N1ModImm<1, 0b000, 0b1111, 0, 1, 0, 1, (outs QPR:$Vd),
6274 (ins nImmVMOVF32:$SIMM), IIC_VMOVImm,
6275 "vmov", "f32", "$Vd, $SIMM", "",
6276 [(set QPR:$Vd, (v4f32 (ARMvmovFPImm timm:$SIMM)))]>;
6277 } // isReMaterializable, isAsCheapAsAMove
6279 // Add support for bytes replication feature, so it could be GAS compatible.
6280 multiclass NEONImmReplicateI8InstAlias<ValueType To> {
6281 // E.g. instructions below:
6282 // "vmov.i32 d0, #0xffffffff"
6283 // "vmov.i32 d0, #0xabababab"
6284 // "vmov.i16 d0, #0xabab"
6285 // are incorrect, but we could deal with such cases.
6286 // For last two instructions, for example, it should emit:
6287 // "vmov.i8 d0, #0xab"
6288 def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
6289 (VMOVv8i8 DPR:$Vd, nImmVMOVIReplicate<i8, To>:$Vm, pred:$p)>;
6290 def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
6291 (VMOVv16i8 QPR:$Vd, nImmVMOVIReplicate<i8, To>:$Vm, pred:$p)>;
6292 // Also add same support for VMVN instructions. So instruction:
6293 // "vmvn.i32 d0, #0xabababab"
6295 // "vmov.i8 d0, #0x54"
6296 def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
6297 (VMOVv8i8 DPR:$Vd, nImmVINVIReplicate<i8, To>:$Vm, pred:$p)>;
6298 def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
6299 (VMOVv16i8 QPR:$Vd, nImmVINVIReplicate<i8, To>:$Vm, pred:$p)>;
6302 defm : NEONImmReplicateI8InstAlias<i16>;
6303 defm : NEONImmReplicateI8InstAlias<i32>;
6304 defm : NEONImmReplicateI8InstAlias<i64>;
6306 // Similar to above for types other than i8, e.g.:
6307 // "vmov.i32 d0, #0xab00ab00" -> "vmov.i16 d0, #0xab00"
6308 // "vmvn.i64 q0, #0xab000000ab000000" -> "vmvn.i32 q0, #0xab000000"
6309 // In this case we do not canonicalize VMVN to VMOV
6310 multiclass NEONImmReplicateInstAlias<ValueType From, NeonI V8, NeonI V16,
6311 NeonI NV8, NeonI NV16, ValueType To> {
6312 def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
6313 (V8 DPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
6314 def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
6315 (V16 QPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
6316 def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
6317 (NV8 DPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
6318 def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
6319 (NV16 QPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
6322 defm : NEONImmReplicateInstAlias<i16, VMOVv4i16, VMOVv8i16,
6323 VMVNv4i16, VMVNv8i16, i32>;
6324 defm : NEONImmReplicateInstAlias<i16, VMOVv4i16, VMOVv8i16,
6325 VMVNv4i16, VMVNv8i16, i64>;
6326 defm : NEONImmReplicateInstAlias<i32, VMOVv2i32, VMOVv4i32,
6327 VMVNv2i32, VMVNv4i32, i64>;
6328 // TODO: add "VMOV <-> VMVN" conversion for cases like
6329 // "vmov.i32 d0, #0xffaaffaa" -> "vmvn.i16 d0, #0x55"
6330 // "vmvn.i32 d0, #0xaaffaaff" -> "vmov.i16 d0, #0xff00"
6332 // On some CPUs the two instructions "vmov.i32 dD, #0" and "vmov.i32 qD, #0"
6333 // require zero cycles to execute so they should be used wherever possible for
6334 // setting a register to zero.
6336 // Even without these pseudo-insts we would probably end up with the correct
6337 // instruction, but we could not mark the general ones with "isAsCheapAsAMove"
6338 // since they are sometimes rather expensive (in general).
6340 let AddedComplexity = 50, isAsCheapAsAMove = 1, isReMaterializable = 1 in {
6341 def VMOVD0 : ARMPseudoExpand<(outs DPR:$Vd), (ins), 4, IIC_VMOVImm,
6342 [(set DPR:$Vd, (v2i32 ARMimmAllZerosD))],
6343 (VMOVv2i32 DPR:$Vd, 0, (ops 14, zero_reg))>,
6345 def VMOVQ0 : ARMPseudoExpand<(outs QPR:$Vd), (ins), 4, IIC_VMOVImm,
6346 [(set QPR:$Vd, (v4i32 ARMimmAllZerosV))],
6347 (VMOVv4i32 QPR:$Vd, 0, (ops 14, zero_reg))>,
6351 // VMOV : Vector Get Lane (move scalar to ARM core register)
6353 def VGETLNs8 : NVGetLane<{1,1,1,0,0,1,?,1}, 0b1011, {?,?},
6354 (outs GPR:$R), (ins DPR:$V, VectorIndex8:$lane),
6355 IIC_VMOVSI, "vmov", "s8", "$R, $V$lane",
6356 [(set GPR:$R, (ARMvgetlanes (v8i8 DPR:$V),
6358 let Inst{21} = lane{2};
6359 let Inst{6-5} = lane{1-0};
6361 def VGETLNs16 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, {?,1},
6362 (outs GPR:$R), (ins DPR:$V, VectorIndex16:$lane),
6363 IIC_VMOVSI, "vmov", "s16", "$R, $V$lane",
6364 [(set GPR:$R, (ARMvgetlanes (v4i16 DPR:$V),
6366 let Inst{21} = lane{1};
6367 let Inst{6} = lane{0};
6369 def VGETLNu8 : NVGetLane<{1,1,1,0,1,1,?,1}, 0b1011, {?,?},
6370 (outs GPR:$R), (ins DPR:$V, VectorIndex8:$lane),
6371 IIC_VMOVSI, "vmov", "u8", "$R, $V$lane",
6372 [(set GPR:$R, (ARMvgetlaneu (v8i8 DPR:$V),
6374 let Inst{21} = lane{2};
6375 let Inst{6-5} = lane{1-0};
6377 def VGETLNu16 : NVGetLane<{1,1,1,0,1,0,?,1}, 0b1011, {?,1},
6378 (outs GPR:$R), (ins DPR:$V, VectorIndex16:$lane),
6379 IIC_VMOVSI, "vmov", "u16", "$R, $V$lane",
6380 [(set GPR:$R, (ARMvgetlaneu (v4i16 DPR:$V),
6382 let Inst{21} = lane{1};
6383 let Inst{6} = lane{0};
6385 def VGETLNi32 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, 0b00,
6386 (outs GPR:$R), (ins DPR:$V, VectorIndex32:$lane),
6387 IIC_VMOVSI, "vmov", "32", "$R, $V$lane",
6388 [(set GPR:$R, (extractelt (v2i32 DPR:$V),
6390 Requires<[HasFPRegs, HasFastVGETLNi32]> {
6391 let Inst{21} = lane{0};
6393 // VGETLNi32 is also legal as just vmov r0,d0[0] without the .32 suffix
6394 def : InstAlias<"vmov${p} $R, $V$lane",
6395 (VGETLNi32 GPR:$R, DPR:$V, VectorIndex32:$lane, pred:$p), 0>,
6396 Requires<VGETLNi32.Predicates>;
6397 let Predicates = [HasNEON] in {
6398 // def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
6399 def : Pat<(ARMvgetlanes (v16i8 QPR:$src), imm:$lane),
6400 (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
6401 (DSubReg_i8_reg imm:$lane))),
6402 (SubReg_i8_lane imm:$lane))>;
6403 def : Pat<(ARMvgetlanes (v8i16 QPR:$src), imm:$lane),
6404 (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
6405 (DSubReg_i16_reg imm:$lane))),
6406 (SubReg_i16_lane imm:$lane))>;
6407 def : Pat<(ARMvgetlaneu (v16i8 QPR:$src), imm:$lane),
6408 (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
6409 (DSubReg_i8_reg imm:$lane))),
6410 (SubReg_i8_lane imm:$lane))>;
6411 def : Pat<(ARMvgetlaneu (v8i16 QPR:$src), imm:$lane),
6412 (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
6413 (DSubReg_i16_reg imm:$lane))),
6414 (SubReg_i16_lane imm:$lane))>;
6415 def : Pat<(ARMvgetlaneu (v8f16 QPR:$src), imm:$lane),
6416 (VGETLNu16 (v4f16 (EXTRACT_SUBREG QPR:$src,
6417 (DSubReg_i16_reg imm:$lane))),
6418 (SubReg_i16_lane imm:$lane))>;
6419 def : Pat<(ARMvgetlaneu (v4f16 DPR:$src), imm:$lane),
6420 (VGETLNu16 (v4f16 DPR:$src), imm:$lane)>;
6421 def : Pat<(ARMvgetlaneu (v8bf16 QPR:$src), imm:$lane),
6422 (VGETLNu16 (v4bf16 (EXTRACT_SUBREG QPR:$src,
6423 (DSubReg_i16_reg imm:$lane))),
6424 (SubReg_i16_lane imm:$lane))>;
6425 def : Pat<(ARMvgetlaneu (v4bf16 DPR:$src), imm:$lane),
6426 (VGETLNu16 (v4bf16 DPR:$src), imm:$lane)>;
6428 def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
6429 (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
6430 (DSubReg_i32_reg imm:$lane))),
6431 (SubReg_i32_lane imm:$lane))>,
6432 Requires<[HasNEON, HasFastVGETLNi32]>;
6433 def : Pat<(extractelt (v2i32 DPR:$src), imm:$lane),
6435 (i32 (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane))), GPR)>,
6436 Requires<[HasNEON, HasSlowVGETLNi32]>;
6437 def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
6439 (i32 (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane))), GPR)>,
6440 Requires<[HasNEON, HasSlowVGETLNi32]>;
6441 let Predicates = [HasNEON] in {
6442 def : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2),
6443 (EXTRACT_SUBREG (v2f32 (COPY_TO_REGCLASS (v2f32 DPR:$src1),DPR_VFP2)),
6444 (SSubReg_f32_reg imm:$src2))>;
6445 def : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
6446 (EXTRACT_SUBREG (v4f32 (COPY_TO_REGCLASS (v4f32 QPR:$src1),QPR_VFP2)),
6447 (SSubReg_f32_reg imm:$src2))>;
6448 //def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
6449 // (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
6450 def : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
6451 (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
6454 multiclass ExtractEltEvenF16<ValueType VT4, ValueType VT8> {
6455 def : Pat<(extractelt (VT4 DPR:$src), imm_even:$lane),
6457 (v2f32 (COPY_TO_REGCLASS (VT4 DPR:$src), DPR_VFP2)),
6458 (SSubReg_f16_reg imm_even:$lane))>;
6459 def : Pat<(extractelt (VT8 QPR:$src), imm_even:$lane),
6461 (v4f32 (COPY_TO_REGCLASS (VT8 QPR:$src), QPR_VFP2)),
6462 (SSubReg_f16_reg imm_even:$lane))>;
6465 multiclass ExtractEltOddF16VMOVH<ValueType VT4, ValueType VT8> {
6466 def : Pat<(extractelt (VT4 DPR:$src), imm_odd:$lane),
6468 (VMOVH (EXTRACT_SUBREG
6469 (v2f32 (COPY_TO_REGCLASS (VT4 DPR:$src), DPR_VFP2)),
6470 (SSubReg_f16_reg imm_odd:$lane))),
6472 def : Pat<(extractelt (VT8 QPR:$src), imm_odd:$lane),
6474 (VMOVH (EXTRACT_SUBREG
6475 (v4f32 (COPY_TO_REGCLASS (VT8 QPR:$src), QPR_VFP2)),
6476 (SSubReg_f16_reg imm_odd:$lane))),
6480 let Predicates = [HasNEON] in {
6481 defm : ExtractEltEvenF16<v4f16, v8f16>;
6482 defm : ExtractEltOddF16VMOVH<v4f16, v8f16>;
6485 let AddedComplexity = 1, Predicates = [HasNEON, HasBF16, HasFullFP16] in {
6486 // If VMOVH (vmovx.f16) is available use it to extract BF16 from the odd lanes
6487 defm : ExtractEltOddF16VMOVH<v4bf16, v8bf16>;
6490 let Predicates = [HasBF16, HasNEON] in {
6491 defm : ExtractEltEvenF16<v4bf16, v8bf16>;
6493 // Otherwise, if VMOVH is not available resort to extracting the odd lane
6494 // into a GPR and then moving to HPR
6495 def : Pat<(extractelt (v4bf16 DPR:$src), imm_odd:$lane),
6497 (VGETLNu16 (v4bf16 DPR:$src), imm:$lane),
6500 def : Pat<(extractelt (v8bf16 QPR:$src), imm_odd:$lane),
6502 (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
6503 (DSubReg_i16_reg imm:$lane))),
6504 (SubReg_i16_lane imm:$lane)),
6508 // VMOV : Vector Set Lane (move ARM core register to scalar)
6510 let Constraints = "$src1 = $V" in {
6511 def VSETLNi8 : NVSetLane<{1,1,1,0,0,1,?,0}, 0b1011, {?,?}, (outs DPR:$V),
6512 (ins DPR:$src1, GPR:$R, VectorIndex8:$lane),
6513 IIC_VMOVISL, "vmov", "8", "$V$lane, $R",
6514 [(set DPR:$V, (vector_insert (v8i8 DPR:$src1),
6515 GPR:$R, imm:$lane))]> {
6516 let Inst{21} = lane{2};
6517 let Inst{6-5} = lane{1-0};
6519 def VSETLNi16 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, {?,1}, (outs DPR:$V),
6520 (ins DPR:$src1, GPR:$R, VectorIndex16:$lane),
6521 IIC_VMOVISL, "vmov", "16", "$V$lane, $R",
6522 [(set DPR:$V, (vector_insert (v4i16 DPR:$src1),
6523 GPR:$R, imm:$lane))]> {
6524 let Inst{21} = lane{1};
6525 let Inst{6} = lane{0};
6527 def VSETLNi32 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, 0b00, (outs DPR:$V),
6528 (ins DPR:$src1, GPR:$R, VectorIndex32:$lane),
6529 IIC_VMOVISL, "vmov", "32", "$V$lane, $R",
6530 [(set DPR:$V, (insertelt (v2i32 DPR:$src1),
6531 GPR:$R, imm:$lane))]>,
6532 Requires<[HasVFP2]> {
6533 let Inst{21} = lane{0};
6534 // This instruction is equivalent as
6535 // $V = INSERT_SUBREG $src1, $R, translateImmToSubIdx($imm)
6536 let isInsertSubreg = 1;
6539 // VSETLNi32 is also legal as just vmov d0[0],r0 without the .32 suffix
6540 def : InstAlias<"vmov${p} $V$lane, $R",
6541 (VSETLNi32 DPR:$V, GPR:$R, VectorIndex32:$lane, pred:$p), 0>,
6542 Requires<VSETLNi32.Predicates>;
6544 // TODO: for odd lanes we could optimize this a bit by using the VINS
6545 // FullFP16 instruction when it is available
6546 multiclass InsertEltF16<ValueType VTScalar, ValueType VT4, ValueType VT8> {
6547 def : Pat<(insertelt (VT4 DPR:$src1), (VTScalar HPR:$src2), imm:$lane),
6548 (VT4 (VSETLNi16 DPR:$src1,
6549 (COPY_TO_REGCLASS HPR:$src2, GPR), imm:$lane))>;
6550 def : Pat<(insertelt (VT8 QPR:$src1), (VTScalar HPR:$src2), imm:$lane),
6551 (VT8 (INSERT_SUBREG QPR:$src1,
6552 (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
6553 (DSubReg_i16_reg imm:$lane))),
6554 (COPY_TO_REGCLASS HPR:$src2, GPR),
6555 (SubReg_i16_lane imm:$lane))),
6556 (DSubReg_i16_reg imm:$lane)))>;
6559 let Predicates = [HasNEON] in {
6560 def : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
6561 (v16i8 (INSERT_SUBREG QPR:$src1,
6562 (v8i8 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
6563 (DSubReg_i8_reg imm:$lane))),
6564 GPR:$src2, (SubReg_i8_lane imm:$lane))),
6565 (DSubReg_i8_reg imm:$lane)))>;
6566 def : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
6567 (v8i16 (INSERT_SUBREG QPR:$src1,
6568 (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
6569 (DSubReg_i16_reg imm:$lane))),
6570 GPR:$src2, (SubReg_i16_lane imm:$lane))),
6571 (DSubReg_i16_reg imm:$lane)))>;
6572 def : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
6573 (v4i32 (INSERT_SUBREG QPR:$src1,
6574 (v2i32 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
6575 (DSubReg_i32_reg imm:$lane))),
6576 GPR:$src2, (SubReg_i32_lane imm:$lane))),
6577 (DSubReg_i32_reg imm:$lane)))>;
6579 def : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)),
6580 (INSERT_SUBREG (v2f32 (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2)),
6581 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
6582 def : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
6583 (INSERT_SUBREG (v4f32 (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2)),
6584 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
6586 defm : InsertEltF16<f16, v4f16, v8f16>;
6588 def : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
6589 (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
6591 def : Pat<(v2f32 (scalar_to_vector SPR:$src)),
6592 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
6593 def : Pat<(v2f64 (scalar_to_vector (f64 DPR:$src))),
6594 (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
6595 def : Pat<(v4f32 (scalar_to_vector SPR:$src)),
6596 (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
6598 def : Pat<(v4f16 (scalar_to_vector (f16 HPR:$src))),
6599 (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), HPR:$src, ssub_0)>;
6600 def : Pat<(v8f16 (scalar_to_vector (f16 HPR:$src))),
6601 (INSERT_SUBREG (v8f16 (IMPLICIT_DEF)), HPR:$src, ssub_0)>;
6603 def : Pat<(v8i8 (scalar_to_vector GPR:$src)),
6604 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
6605 def : Pat<(v4i16 (scalar_to_vector GPR:$src)),
6606 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
6607 def : Pat<(v2i32 (scalar_to_vector GPR:$src)),
6608 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
6610 def : Pat<(v16i8 (scalar_to_vector GPR:$src)),
6611 (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)),
6612 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
6614 def : Pat<(v8i16 (scalar_to_vector GPR:$src)),
6615 (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)),
6616 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
6618 def : Pat<(v4i32 (scalar_to_vector GPR:$src)),
6619 (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
6620 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
6624 let Predicates = [HasNEON, HasBF16] in
6625 defm : InsertEltF16<bf16, v4bf16, v8bf16>;
6627 // VDUP : Vector Duplicate (from ARM core register to all elements)
6629 class VDUPD<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
6630 : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$V), (ins GPR:$R),
6631 IIC_VMOVIS, "vdup", Dt, "$V, $R",
6632 [(set DPR:$V, (Ty (ARMvdup (i32 GPR:$R))))]>;
6633 class VDUPQ<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
6634 : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$V), (ins GPR:$R),
6635 IIC_VMOVIS, "vdup", Dt, "$V, $R",
6636 [(set QPR:$V, (Ty (ARMvdup (i32 GPR:$R))))]>;
6638 def VDUP8d : VDUPD<0b11101100, 0b00, "8", v8i8>;
6639 def VDUP16d : VDUPD<0b11101000, 0b01, "16", v4i16>;
6640 def VDUP32d : VDUPD<0b11101000, 0b00, "32", v2i32>,
6641 Requires<[HasNEON, HasFastVDUP32]>;
6642 def VDUP8q : VDUPQ<0b11101110, 0b00, "8", v16i8>;
6643 def VDUP16q : VDUPQ<0b11101010, 0b01, "16", v8i16>;
6644 def VDUP32q : VDUPQ<0b11101010, 0b00, "32", v4i32>;
6646 // ARMvdup patterns for uarchs with fast VDUP.32.
6647 def : Pat<(v2f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VDUP32d GPR:$R)>,
6648 Requires<[HasNEON,HasFastVDUP32]>;
6649 def : Pat<(v4f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VDUP32q GPR:$R)>,
6650 Requires<[HasNEON]>;
6652 // ARMvdup patterns for uarchs with slow VDUP.32 - use VMOVDRR instead.
6653 def : Pat<(v2i32 (ARMvdup (i32 GPR:$R))), (VMOVDRR GPR:$R, GPR:$R)>,
6654 Requires<[HasNEON,HasSlowVDUP32]>;
6655 def : Pat<(v2f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VMOVDRR GPR:$R, GPR:$R)>,
6656 Requires<[HasNEON,HasSlowVDUP32]>;
6658 // VDUP : Vector Duplicate Lane (from scalar to all elements)
6660 class VDUPLND<bits<4> op19_16, string OpcodeStr, string Dt,
6661 ValueType Ty, Operand IdxTy>
6662 : NVDupLane<op19_16, 0, (outs DPR:$Vd), (ins DPR:$Vm, IdxTy:$lane),
6663 IIC_VMOVD, OpcodeStr, Dt, "$Vd, $Vm$lane",
6664 [(set DPR:$Vd, (Ty (ARMvduplane (Ty DPR:$Vm), imm:$lane)))]>;
6666 class VDUPLNQ<bits<4> op19_16, string OpcodeStr, string Dt,
6667 ValueType ResTy, ValueType OpTy, Operand IdxTy>
6668 : NVDupLane<op19_16, 1, (outs QPR:$Vd), (ins DPR:$Vm, IdxTy:$lane),
6669 IIC_VMOVQ, OpcodeStr, Dt, "$Vd, $Vm$lane",
6670 [(set QPR:$Vd, (ResTy (ARMvduplane (OpTy DPR:$Vm),
6671 VectorIndex32:$lane)))]>;
6673 // Inst{19-16} is partially specified depending on the element size.
6675 def VDUPLN8d : VDUPLND<{?,?,?,1}, "vdup", "8", v8i8, VectorIndex8> {
6677 let Inst{19-17} = lane{2-0};
6679 def VDUPLN16d : VDUPLND<{?,?,1,0}, "vdup", "16", v4i16, VectorIndex16> {
6681 let Inst{19-18} = lane{1-0};
6683 def VDUPLN32d : VDUPLND<{?,1,0,0}, "vdup", "32", v2i32, VectorIndex32> {
6685 let Inst{19} = lane{0};
6687 def VDUPLN8q : VDUPLNQ<{?,?,?,1}, "vdup", "8", v16i8, v8i8, VectorIndex8> {
6689 let Inst{19-17} = lane{2-0};
6691 def VDUPLN16q : VDUPLNQ<{?,?,1,0}, "vdup", "16", v8i16, v4i16, VectorIndex16> {
6693 let Inst{19-18} = lane{1-0};
6695 def VDUPLN32q : VDUPLNQ<{?,1,0,0}, "vdup", "32", v4i32, v2i32, VectorIndex32> {
6697 let Inst{19} = lane{0};
6700 let Predicates = [HasNEON] in {
6701 def : Pat<(v4f16 (ARMvduplane (v4f16 DPR:$Vm), imm:$lane)),
6702 (VDUPLN16d DPR:$Vm, imm:$lane)>;
6704 def : Pat<(v2f32 (ARMvduplane (v2f32 DPR:$Vm), imm:$lane)),
6705 (VDUPLN32d DPR:$Vm, imm:$lane)>;
6707 def : Pat<(v4f32 (ARMvduplane (v2f32 DPR:$Vm), imm:$lane)),
6708 (VDUPLN32q DPR:$Vm, imm:$lane)>;
6710 def : Pat<(v16i8 (ARMvduplane (v16i8 QPR:$src), imm:$lane)),
6711 (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src,
6712 (DSubReg_i8_reg imm:$lane))),
6713 (SubReg_i8_lane imm:$lane)))>;
6714 def : Pat<(v8i16 (ARMvduplane (v8i16 QPR:$src), imm:$lane)),
6715 (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src,
6716 (DSubReg_i16_reg imm:$lane))),
6717 (SubReg_i16_lane imm:$lane)))>;
6718 def : Pat<(v8f16 (ARMvduplane (v8f16 QPR:$src), imm:$lane)),
6719 (v8f16 (VDUPLN16q (v4f16 (EXTRACT_SUBREG QPR:$src,
6720 (DSubReg_i16_reg imm:$lane))),
6721 (SubReg_i16_lane imm:$lane)))>;
6722 def : Pat<(v4i32 (ARMvduplane (v4i32 QPR:$src), imm:$lane)),
6723 (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src,
6724 (DSubReg_i32_reg imm:$lane))),
6725 (SubReg_i32_lane imm:$lane)))>;
6726 def : Pat<(v4f32 (ARMvduplane (v4f32 QPR:$src), imm:$lane)),
6727 (v4f32 (VDUPLN32q (v2f32 (EXTRACT_SUBREG QPR:$src,
6728 (DSubReg_i32_reg imm:$lane))),
6729 (SubReg_i32_lane imm:$lane)))>;
6731 def : Pat<(v4f16 (ARMvdup (f16 HPR:$src))),
6732 (v4f16 (VDUPLN16d (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)),
6733 (f16 HPR:$src), ssub_0), (i32 0)))>;
6734 def : Pat<(v2f32 (ARMvdup (f32 SPR:$src))),
6735 (v2f32 (VDUPLN32d (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
6736 SPR:$src, ssub_0), (i32 0)))>;
6737 def : Pat<(v4f32 (ARMvdup (f32 SPR:$src))),
6738 (v4f32 (VDUPLN32q (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
6739 SPR:$src, ssub_0), (i32 0)))>;
6740 def : Pat<(v8f16 (ARMvdup (f16 HPR:$src))),
6741 (v8f16 (VDUPLN16q (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)),
6742 (f16 HPR:$src), ssub_0), (i32 0)))>;
6745 let Predicates = [HasNEON, HasBF16] in {
6746 def : Pat<(v4bf16 (ARMvduplane (v4bf16 DPR:$Vm), imm:$lane)),
6747 (VDUPLN16d DPR:$Vm, imm:$lane)>;
6749 def : Pat<(v8bf16 (ARMvduplane (v8bf16 QPR:$src), imm:$lane)),
6750 (v8bf16 (VDUPLN16q (v4bf16 (EXTRACT_SUBREG QPR:$src,
6751 (DSubReg_i16_reg imm:$lane))),
6752 (SubReg_i16_lane imm:$lane)))>;
6754 def : Pat<(v4bf16 (ARMvdup (bf16 HPR:$src))),
6755 (v4bf16 (VDUPLN16d (INSERT_SUBREG (v4bf16 (IMPLICIT_DEF)),
6756 (bf16 HPR:$src), ssub_0), (i32 0)))>;
6757 def : Pat<(v8bf16 (ARMvdup (bf16 HPR:$src))),
6758 (v8bf16 (VDUPLN16q (INSERT_SUBREG (v4bf16 (IMPLICIT_DEF)),
6759 (bf16 HPR:$src), ssub_0), (i32 0)))>;
6762 // VMOVN : Vector Narrowing Move
6763 defm VMOVN : N2VN_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVN,
6764 "vmovn", "i", trunc>;
6765 // VQMOVN : Vector Saturating Narrowing Move
6766 defm VQMOVNs : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD,
6767 "vqmovn", "s", int_arm_neon_vqmovns>;
6768 defm VQMOVNu : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD,
6769 "vqmovn", "u", int_arm_neon_vqmovnu>;
6770 defm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD,
6771 "vqmovun", "s", int_arm_neon_vqmovnsu>;
6772 // VMOVL : Vector Lengthening Move
6773 defm VMOVLs : N2VL_QHS<0b01,0b10100,0,1, "vmovl", "s", sext>;
6774 defm VMOVLu : N2VL_QHS<0b11,0b10100,0,1, "vmovl", "u", zext>;
6776 let Predicates = [HasNEON] in {
6777 def : Pat<(v8i16 (anyext (v8i8 DPR:$Vm))), (VMOVLuv8i16 DPR:$Vm)>;
6778 def : Pat<(v4i32 (anyext (v4i16 DPR:$Vm))), (VMOVLuv4i32 DPR:$Vm)>;
6779 def : Pat<(v2i64 (anyext (v2i32 DPR:$Vm))), (VMOVLuv2i64 DPR:$Vm)>;
6782 // Vector Conversions.
6784 // VCVT : Vector Convert Between Floating-Point and Integers
6785 def VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
6786 v2i32, v2f32, fp_to_sint>;
6787 def VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
6788 v2i32, v2f32, fp_to_uint>;
6789 def VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
6790 v2f32, v2i32, sint_to_fp>;
6791 def VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
6792 v2f32, v2i32, uint_to_fp>;
6794 def VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
6795 v4i32, v4f32, fp_to_sint>;
6796 def VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
6797 v4i32, v4f32, fp_to_uint>;
6798 def VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
6799 v4f32, v4i32, sint_to_fp>;
6800 def VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
6801 v4f32, v4i32, uint_to_fp>;
6803 def VCVTh2sd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01110, 0, "vcvt", "s16.f16",
6804 v4i16, v4f16, fp_to_sint>,
6805 Requires<[HasNEON, HasFullFP16]>;
6806 def VCVTh2ud : N2VD<0b11, 0b11, 0b01, 0b11, 0b01111, 0, "vcvt", "u16.f16",
6807 v4i16, v4f16, fp_to_uint>,
6808 Requires<[HasNEON, HasFullFP16]>;
6809 def VCVTs2hd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01100, 0, "vcvt", "f16.s16",
6810 v4f16, v4i16, sint_to_fp>,
6811 Requires<[HasNEON, HasFullFP16]>;
6812 def VCVTu2hd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01101, 0, "vcvt", "f16.u16",
6813 v4f16, v4i16, uint_to_fp>,
6814 Requires<[HasNEON, HasFullFP16]>;
6816 def VCVTh2sq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01110, 0, "vcvt", "s16.f16",
6817 v8i16, v8f16, fp_to_sint>,
6818 Requires<[HasNEON, HasFullFP16]>;
6819 def VCVTh2uq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01111, 0, "vcvt", "u16.f16",
6820 v8i16, v8f16, fp_to_uint>,
6821 Requires<[HasNEON, HasFullFP16]>;
6822 def VCVTs2hq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01100, 0, "vcvt", "f16.s16",
6823 v8f16, v8i16, sint_to_fp>,
6824 Requires<[HasNEON, HasFullFP16]>;
6825 def VCVTu2hq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01101, 0, "vcvt", "f16.u16",
6826 v8f16, v8i16, uint_to_fp>,
6827 Requires<[HasNEON, HasFullFP16]>;
6830 multiclass VCVT_FPI<string op, bits<3> op10_8, SDPatternOperator IntS,
6831 SDPatternOperator IntU> {
6832 let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
6833 def SDf : N2VDIntnp<0b10, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
6834 "s32.f32", v2i32, v2f32, IntS>, Requires<[HasV8, HasNEON]>;
6835 def SQf : N2VQIntnp<0b10, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
6836 "s32.f32", v4i32, v4f32, IntS>, Requires<[HasV8, HasNEON]>;
6837 def UDf : N2VDIntnp<0b10, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
6838 "u32.f32", v2i32, v2f32, IntU>, Requires<[HasV8, HasNEON]>;
6839 def UQf : N2VQIntnp<0b10, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
6840 "u32.f32", v4i32, v4f32, IntU>, Requires<[HasV8, HasNEON]>;
6841 def SDh : N2VDIntnp<0b01, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
6842 "s16.f16", v4i16, v4f16, IntS>,
6843 Requires<[HasV8, HasNEON, HasFullFP16]>;
6844 def SQh : N2VQIntnp<0b01, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
6845 "s16.f16", v8i16, v8f16, IntS>,
6846 Requires<[HasV8, HasNEON, HasFullFP16]>;
6847 def UDh : N2VDIntnp<0b01, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
6848 "u16.f16", v4i16, v4f16, IntU>,
6849 Requires<[HasV8, HasNEON, HasFullFP16]>;
6850 def UQh : N2VQIntnp<0b01, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
6851 "u16.f16", v8i16, v8f16, IntU>,
6852 Requires<[HasV8, HasNEON, HasFullFP16]>;
6856 defm VCVTAN : VCVT_FPI<"a", 0b000, int_arm_neon_vcvtas, int_arm_neon_vcvtau>;
6857 defm VCVTNN : VCVT_FPI<"n", 0b001, int_arm_neon_vcvtns, int_arm_neon_vcvtnu>;
6858 defm VCVTPN : VCVT_FPI<"p", 0b010, int_arm_neon_vcvtps, int_arm_neon_vcvtpu>;
6859 defm VCVTMN : VCVT_FPI<"m", 0b011, int_arm_neon_vcvtms, int_arm_neon_vcvtmu>;
6861 // VCVT : Vector Convert Between Floating-Point and Fixed-Point.
6862 let DecoderMethod = "DecodeVCVTD" in {
6863 def VCVTf2xsd : N2VCvtD<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
6864 v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
6865 def VCVTf2xud : N2VCvtD<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
6866 v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
6867 def VCVTxs2fd : N2VCvtD<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
6868 v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
6869 def VCVTxu2fd : N2VCvtD<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
6870 v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
6871 let Predicates = [HasNEON, HasFullFP16] in {
6872 def VCVTh2xsd : N2VCvtD<0, 1, 0b1101, 0, 1, "vcvt", "s16.f16",
6873 v4i16, v4f16, int_arm_neon_vcvtfp2fxs>;
6874 def VCVTh2xud : N2VCvtD<1, 1, 0b1101, 0, 1, "vcvt", "u16.f16",
6875 v4i16, v4f16, int_arm_neon_vcvtfp2fxu>;
6876 def VCVTxs2hd : N2VCvtD<0, 1, 0b1100, 0, 1, "vcvt", "f16.s16",
6877 v4f16, v4i16, int_arm_neon_vcvtfxs2fp>;
6878 def VCVTxu2hd : N2VCvtD<1, 1, 0b1100, 0, 1, "vcvt", "f16.u16",
6879 v4f16, v4i16, int_arm_neon_vcvtfxu2fp>;
6880 } // Predicates = [HasNEON, HasFullFP16]
6883 let DecoderMethod = "DecodeVCVTQ" in {
6884 def VCVTf2xsq : N2VCvtQ<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
6885 v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
6886 def VCVTf2xuq : N2VCvtQ<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
6887 v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
6888 def VCVTxs2fq : N2VCvtQ<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
6889 v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
6890 def VCVTxu2fq : N2VCvtQ<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
6891 v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
6892 let Predicates = [HasNEON, HasFullFP16] in {
6893 def VCVTh2xsq : N2VCvtQ<0, 1, 0b1101, 0, 1, "vcvt", "s16.f16",
6894 v8i16, v8f16, int_arm_neon_vcvtfp2fxs>;
6895 def VCVTh2xuq : N2VCvtQ<1, 1, 0b1101, 0, 1, "vcvt", "u16.f16",
6896 v8i16, v8f16, int_arm_neon_vcvtfp2fxu>;
6897 def VCVTxs2hq : N2VCvtQ<0, 1, 0b1100, 0, 1, "vcvt", "f16.s16",
6898 v8f16, v8i16, int_arm_neon_vcvtfxs2fp>;
6899 def VCVTxu2hq : N2VCvtQ<1, 1, 0b1100, 0, 1, "vcvt", "f16.u16",
6900 v8f16, v8i16, int_arm_neon_vcvtfxu2fp>;
6901 } // Predicates = [HasNEON, HasFullFP16]
6904 def : NEONInstAlias<"vcvt${p}.s32.f32 $Dd, $Dm, #0",
6905 (VCVTf2sd DPR:$Dd, DPR:$Dm, pred:$p)>;
6906 def : NEONInstAlias<"vcvt${p}.u32.f32 $Dd, $Dm, #0",
6907 (VCVTf2ud DPR:$Dd, DPR:$Dm, pred:$p)>;
6908 def : NEONInstAlias<"vcvt${p}.f32.s32 $Dd, $Dm, #0",
6909 (VCVTs2fd DPR:$Dd, DPR:$Dm, pred:$p)>;
6910 def : NEONInstAlias<"vcvt${p}.f32.u32 $Dd, $Dm, #0",
6911 (VCVTu2fd DPR:$Dd, DPR:$Dm, pred:$p)>;
6913 def : NEONInstAlias<"vcvt${p}.s32.f32 $Qd, $Qm, #0",
6914 (VCVTf2sq QPR:$Qd, QPR:$Qm, pred:$p)>;
6915 def : NEONInstAlias<"vcvt${p}.u32.f32 $Qd, $Qm, #0",
6916 (VCVTf2uq QPR:$Qd, QPR:$Qm, pred:$p)>;
6917 def : NEONInstAlias<"vcvt${p}.f32.s32 $Qd, $Qm, #0",
6918 (VCVTs2fq QPR:$Qd, QPR:$Qm, pred:$p)>;
6919 def : NEONInstAlias<"vcvt${p}.f32.u32 $Qd, $Qm, #0",
6920 (VCVTu2fq QPR:$Qd, QPR:$Qm, pred:$p)>;
6922 def : NEONInstAlias<"vcvt${p}.s16.f16 $Dd, $Dm, #0",
6923 (VCVTh2sd DPR:$Dd, DPR:$Dm, pred:$p)>;
6924 def : NEONInstAlias<"vcvt${p}.u16.f16 $Dd, $Dm, #0",
6925 (VCVTh2ud DPR:$Dd, DPR:$Dm, pred:$p)>;
6926 def : NEONInstAlias<"vcvt${p}.f16.s16 $Dd, $Dm, #0",
6927 (VCVTs2hd DPR:$Dd, DPR:$Dm, pred:$p)>;
6928 def : NEONInstAlias<"vcvt${p}.f16.u16 $Dd, $Dm, #0",
6929 (VCVTu2hd DPR:$Dd, DPR:$Dm, pred:$p)>;
6931 def : NEONInstAlias<"vcvt${p}.s16.f16 $Qd, $Qm, #0",
6932 (VCVTh2sq QPR:$Qd, QPR:$Qm, pred:$p)>;
6933 def : NEONInstAlias<"vcvt${p}.u16.f16 $Qd, $Qm, #0",
6934 (VCVTh2uq QPR:$Qd, QPR:$Qm, pred:$p)>;
6935 def : NEONInstAlias<"vcvt${p}.f16.s16 $Qd, $Qm, #0",
6936 (VCVTs2hq QPR:$Qd, QPR:$Qm, pred:$p)>;
6937 def : NEONInstAlias<"vcvt${p}.f16.u16 $Qd, $Qm, #0",
6938 (VCVTu2hq QPR:$Qd, QPR:$Qm, pred:$p)>;
6941 // VCVT : Vector Convert Between Half-Precision and Single-Precision.
6942 def VCVTf2h : N2VNInt<0b11, 0b11, 0b01, 0b10, 0b01100, 0, 0,
6943 IIC_VUNAQ, "vcvt", "f16.f32",
6944 v4i16, v4f32, int_arm_neon_vcvtfp2hf>,
6945 Requires<[HasNEON, HasFP16]>;
6946 def VCVTh2f : N2VLInt<0b11, 0b11, 0b01, 0b10, 0b01110, 0, 0,
6947 IIC_VUNAQ, "vcvt", "f32.f16",
6948 v4f32, v4i16, int_arm_neon_vcvthf2fp>,
6949 Requires<[HasNEON, HasFP16]>;
6951 def : Pat<(v4f16 (fpround (v4f32 QPR:$src))), (VCVTf2h QPR:$src)>;
6952 def : Pat<(v4f32 (fpextend (v4f16 DPR:$src))), (VCVTh2f DPR:$src)>;
6956 // VREV64 : Vector Reverse elements within 64-bit doublewords
6958 class VREV64D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
6959 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$Vd),
6960 (ins DPR:$Vm), IIC_VMOVD,
6961 OpcodeStr, Dt, "$Vd, $Vm", "",
6962 [(set DPR:$Vd, (Ty (ARMvrev64 (Ty DPR:$Vm))))]>;
6963 class VREV64Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
6964 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$Vd),
6965 (ins QPR:$Vm), IIC_VMOVQ,
6966 OpcodeStr, Dt, "$Vd, $Vm", "",
6967 [(set QPR:$Vd, (Ty (ARMvrev64 (Ty QPR:$Vm))))]>;
6969 def VREV64d8 : VREV64D<0b00, "vrev64", "8", v8i8>;
6970 def VREV64d16 : VREV64D<0b01, "vrev64", "16", v4i16>;
6971 def VREV64d32 : VREV64D<0b10, "vrev64", "32", v2i32>;
6972 let Predicates = [HasNEON] in {
6973 def : Pat<(v2f32 (ARMvrev64 (v2f32 DPR:$Vm))), (VREV64d32 DPR:$Vm)>;
6976 def VREV64q8 : VREV64Q<0b00, "vrev64", "8", v16i8>;
6977 def VREV64q16 : VREV64Q<0b01, "vrev64", "16", v8i16>;
6978 def VREV64q32 : VREV64Q<0b10, "vrev64", "32", v4i32>;
6980 let Predicates = [HasNEON] in {
6981 def : Pat<(v4f32 (ARMvrev64 (v4f32 QPR:$Vm))),
6982 (VREV64q32 QPR:$Vm)>;
6983 def : Pat<(v8f16 (ARMvrev64 (v8f16 QPR:$Vm))),
6984 (VREV64q16 QPR:$Vm)>;
6985 def : Pat<(v4f16 (ARMvrev64 (v4f16 DPR:$Vm))),
6986 (VREV64d16 DPR:$Vm)>;
6987 def : Pat<(v8bf16 (ARMvrev64 (v8bf16 QPR:$Vm))),
6988 (VREV64q16 QPR:$Vm)>;
6989 def : Pat<(v4bf16 (ARMvrev64 (v4bf16 DPR:$Vm))),
6990 (VREV64d16 DPR:$Vm)>;
6993 // VREV32 : Vector Reverse elements within 32-bit words
6995 class VREV32D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
6996 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$Vd),
6997 (ins DPR:$Vm), IIC_VMOVD,
6998 OpcodeStr, Dt, "$Vd, $Vm", "",
6999 [(set DPR:$Vd, (Ty (ARMvrev32 (Ty DPR:$Vm))))]>;
7000 class VREV32Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
7001 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$Vd),
7002 (ins QPR:$Vm), IIC_VMOVQ,
7003 OpcodeStr, Dt, "$Vd, $Vm", "",
7004 [(set QPR:$Vd, (Ty (ARMvrev32 (Ty QPR:$Vm))))]>;
7006 def VREV32d8 : VREV32D<0b00, "vrev32", "8", v8i8>;
7007 def VREV32d16 : VREV32D<0b01, "vrev32", "16", v4i16>;
7009 def VREV32q8 : VREV32Q<0b00, "vrev32", "8", v16i8>;
7010 def VREV32q16 : VREV32Q<0b01, "vrev32", "16", v8i16>;
7012 let Predicates = [HasNEON] in {
7013 def : Pat<(v8f16 (ARMvrev32 (v8f16 QPR:$Vm))),
7014 (VREV32q16 QPR:$Vm)>;
7015 def : Pat<(v4f16 (ARMvrev32 (v4f16 DPR:$Vm))),
7016 (VREV32d16 DPR:$Vm)>;
7017 def : Pat<(v8bf16 (ARMvrev32 (v8bf16 QPR:$Vm))),
7018 (VREV32q16 QPR:$Vm)>;
7019 def : Pat<(v4bf16 (ARMvrev32 (v4bf16 DPR:$Vm))),
7020 (VREV32d16 DPR:$Vm)>;
7023 // VREV16 : Vector Reverse elements within 16-bit halfwords
7025 class VREV16D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
7026 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$Vd),
7027 (ins DPR:$Vm), IIC_VMOVD,
7028 OpcodeStr, Dt, "$Vd, $Vm", "",
7029 [(set DPR:$Vd, (Ty (ARMvrev16 (Ty DPR:$Vm))))]>;
7030 class VREV16Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
7031 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$Vd),
7032 (ins QPR:$Vm), IIC_VMOVQ,
7033 OpcodeStr, Dt, "$Vd, $Vm", "",
7034 [(set QPR:$Vd, (Ty (ARMvrev16 (Ty QPR:$Vm))))]>;
7036 def VREV16d8 : VREV16D<0b00, "vrev16", "8", v8i8>;
7037 def VREV16q8 : VREV16Q<0b00, "vrev16", "8", v16i8>;
7039 // Other Vector Shuffles.
7041 // Aligned extractions: really just dropping registers
7043 class AlignedVEXTq<ValueType DestTy, ValueType SrcTy, SDNodeXForm LaneCVT>
7044 : Pat<(DestTy (vector_extract_subvec (SrcTy QPR:$src), (i32 imm:$start))),
7045 (EXTRACT_SUBREG (SrcTy QPR:$src), (LaneCVT imm:$start))>,
7046 Requires<[HasNEON]>;
7048 def : AlignedVEXTq<v8i8, v16i8, DSubReg_i8_reg>;
7049 def : AlignedVEXTq<v4i16, v8i16, DSubReg_i16_reg>;
7050 def : AlignedVEXTq<v2i32, v4i32, DSubReg_i32_reg>;
7051 def : AlignedVEXTq<v1i64, v2i64, DSubReg_f64_reg>;
7052 def : AlignedVEXTq<v2f32, v4f32, DSubReg_i32_reg>;
7053 def : AlignedVEXTq<v4f16, v8f16, DSubReg_i16_reg>;
7054 def : AlignedVEXTq<v4bf16, v8bf16, DSubReg_i16_reg>;
7057 // VEXT : Vector Extract
7059 // All of these have a two-operand InstAlias.
7060 let TwoOperandAliasConstraint = "$Vn = $Vd" in {
7061 class VEXTd<string OpcodeStr, string Dt, ValueType Ty, Operand immTy>
7062 : N3V<0,1,0b11,{?,?,?,?},0,0, (outs DPR:$Vd),
7063 (ins DPR:$Vn, DPR:$Vm, immTy:$index), NVExtFrm,
7064 IIC_VEXTD, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
7065 [(set DPR:$Vd, (Ty (NEONvext (Ty DPR:$Vn),
7066 (Ty DPR:$Vm), imm:$index)))]> {
7069 let Inst{10-8} = index{2-0};
7072 class VEXTq<string OpcodeStr, string Dt, ValueType Ty, Operand immTy>
7073 : N3V<0,1,0b11,{?,?,?,?},1,0, (outs QPR:$Vd),
7074 (ins QPR:$Vn, QPR:$Vm, immTy:$index), NVExtFrm,
7075 IIC_VEXTQ, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
7076 [(set QPR:$Vd, (Ty (NEONvext (Ty QPR:$Vn),
7077 (Ty QPR:$Vm), imm:$index)))]> {
7079 let Inst{11-8} = index{3-0};
7083 def VEXTd8 : VEXTd<"vext", "8", v8i8, imm0_7> {
7084 let Inst{10-8} = index{2-0};
7086 def VEXTd16 : VEXTd<"vext", "16", v4i16, imm0_3> {
7087 let Inst{10-9} = index{1-0};
7090 let Predicates = [HasNEON] in {
7091 def : Pat<(v4f16 (NEONvext (v4f16 DPR:$Vn), (v4f16 DPR:$Vm), (i32 imm:$index))),
7092 (VEXTd16 DPR:$Vn, DPR:$Vm, imm:$index)>;
7093 def : Pat<(v4bf16 (NEONvext (v4bf16 DPR:$Vn), (v4bf16 DPR:$Vm), (i32 imm:$index))),
7094 (VEXTd16 DPR:$Vn, DPR:$Vm, imm:$index)>;
7097 def VEXTd32 : VEXTd<"vext", "32", v2i32, imm0_1> {
7098 let Inst{10} = index{0};
7099 let Inst{9-8} = 0b00;
7101 let Predicates = [HasNEON] in {
7102 def : Pat<(v2f32 (NEONvext (v2f32 DPR:$Vn), (v2f32 DPR:$Vm), (i32 imm:$index))),
7103 (VEXTd32 DPR:$Vn, DPR:$Vm, imm:$index)>;
7106 def VEXTq8 : VEXTq<"vext", "8", v16i8, imm0_15> {
7107 let Inst{11-8} = index{3-0};
7109 def VEXTq16 : VEXTq<"vext", "16", v8i16, imm0_7> {
7110 let Inst{11-9} = index{2-0};
7113 let Predicates = [HasNEON] in {
7114 def : Pat<(v8f16 (NEONvext (v8f16 QPR:$Vn), (v8f16 QPR:$Vm), (i32 imm:$index))),
7115 (VEXTq16 QPR:$Vn, QPR:$Vm, imm:$index)>;
7116 def : Pat<(v8bf16 (NEONvext (v8bf16 QPR:$Vn), (v8bf16 QPR:$Vm), (i32 imm:$index))),
7117 (VEXTq16 QPR:$Vn, QPR:$Vm, imm:$index)>;
7120 def VEXTq32 : VEXTq<"vext", "32", v4i32, imm0_3> {
7121 let Inst{11-10} = index{1-0};
7122 let Inst{9-8} = 0b00;
7124 def VEXTq64 : VEXTq<"vext", "64", v2i64, imm0_1> {
7125 let Inst{11} = index{0};
7126 let Inst{10-8} = 0b000;
7128 let Predicates = [HasNEON] in {
7129 def : Pat<(v4f32 (NEONvext (v4f32 QPR:$Vn), (v4f32 QPR:$Vm), (i32 imm:$index))),
7130 (VEXTq32 QPR:$Vn, QPR:$Vm, imm:$index)>;
7133 // VTRN : Vector Transpose
7135 def VTRNd8 : N2VDShuffle<0b00, 0b00001, "vtrn", "8">;
7136 def VTRNd16 : N2VDShuffle<0b01, 0b00001, "vtrn", "16">;
7137 def VTRNd32 : N2VDShuffle<0b10, 0b00001, "vtrn", "32">;
7139 def VTRNq8 : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn", "8">;
7140 def VTRNq16 : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn", "16">;
7141 def VTRNq32 : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn", "32">;
7143 // VUZP : Vector Unzip (Deinterleave)
7145 def VUZPd8 : N2VDShuffle<0b00, 0b00010, "vuzp", "8">;
7146 def VUZPd16 : N2VDShuffle<0b01, 0b00010, "vuzp", "16">;
7147 // vuzp.32 Dd, Dm is a pseudo-instruction expanded to vtrn.32 Dd, Dm.
7148 def : NEONInstAlias<"vuzp${p}.32 $Dd, $Dm",
7149 (VTRNd32 DPR:$Dd, DPR:$Dm, pred:$p)>;
7151 def VUZPq8 : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp", "8">;
7152 def VUZPq16 : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp", "16">;
7153 def VUZPq32 : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp", "32">;
7155 // VZIP : Vector Zip (Interleave)
7157 def VZIPd8 : N2VDShuffle<0b00, 0b00011, "vzip", "8">;
7158 def VZIPd16 : N2VDShuffle<0b01, 0b00011, "vzip", "16">;
7159 // vzip.32 Dd, Dm is a pseudo-instruction expanded to vtrn.32 Dd, Dm.
7160 def : NEONInstAlias<"vzip${p}.32 $Dd, $Dm",
7161 (VTRNd32 DPR:$Dd, DPR:$Dm, pred:$p)>;
7163 def VZIPq8 : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip", "8">;
7164 def VZIPq16 : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip", "16">;
7165 def VZIPq32 : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip", "32">;
7167 // Vector Table Lookup and Table Extension.
7169 // VTBL : Vector Table Lookup
7170 let DecoderMethod = "DecodeTBLInstruction" in {
7172 : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$Vd),
7173 (ins VecListOneD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB1,
7174 "vtbl", "8", "$Vd, $Vn, $Vm", "",
7175 [(set DPR:$Vd, (v8i8 (NEONvtbl1 VecListOneD:$Vn, DPR:$Vm)))]>;
7177 let hasExtraSrcRegAllocReq = 1 in {
7179 : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$Vd),
7180 (ins VecListDPair:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB2,
7181 "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
7183 : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$Vd),
7184 (ins VecListThreeD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB3,
7185 "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
7187 : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$Vd),
7188 (ins VecListFourD:$Vn, DPR:$Vm),
7190 "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
7191 } // hasExtraSrcRegAllocReq = 1
7194 : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB3, "", []>;
7196 : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB4, "", []>;
7198 // VTBX : Vector Table Extension
7200 : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$Vd),
7201 (ins DPR:$orig, VecListOneD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX1,
7202 "vtbx", "8", "$Vd, $Vn, $Vm", "$orig = $Vd",
7203 [(set DPR:$Vd, (v8i8 (int_arm_neon_vtbx1
7204 DPR:$orig, VecListOneD:$Vn, DPR:$Vm)))]>;
7205 let hasExtraSrcRegAllocReq = 1 in {
7207 : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$Vd),
7208 (ins DPR:$orig, VecListDPair:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX2,
7209 "vtbx", "8", "$Vd, $Vn, $Vm", "$orig = $Vd", []>;
7211 : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$Vd),
7212 (ins DPR:$orig, VecListThreeD:$Vn, DPR:$Vm),
7213 NVTBLFrm, IIC_VTBX3,
7214 "vtbx", "8", "$Vd, $Vn, $Vm",
7217 : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$Vd),
7218 (ins DPR:$orig, VecListFourD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX4,
7219 "vtbx", "8", "$Vd, $Vn, $Vm",
7221 } // hasExtraSrcRegAllocReq = 1
7224 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
7225 IIC_VTBX3, "$orig = $dst", []>;
7227 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
7228 IIC_VTBX4, "$orig = $dst", []>;
7229 } // DecoderMethod = "DecodeTBLInstruction"
7231 let Predicates = [HasNEON] in {
7232 def : Pat<(v8i8 (NEONvtbl2 v8i8:$Vn0, v8i8:$Vn1, v8i8:$Vm)),
7233 (v8i8 (VTBL2 (REG_SEQUENCE DPair, v8i8:$Vn0, dsub_0,
7236 def : Pat<(v8i8 (int_arm_neon_vtbx2 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
7238 (v8i8 (VTBX2 v8i8:$orig,
7239 (REG_SEQUENCE DPair, v8i8:$Vn0, dsub_0,
7243 def : Pat<(v8i8 (int_arm_neon_vtbl3 v8i8:$Vn0, v8i8:$Vn1,
7244 v8i8:$Vn2, v8i8:$Vm)),
7245 (v8i8 (VTBL3Pseudo (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
7248 (v8i8 (IMPLICIT_DEF)), dsub_3),
7250 def : Pat<(v8i8 (int_arm_neon_vtbx3 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
7251 v8i8:$Vn2, v8i8:$Vm)),
7252 (v8i8 (VTBX3Pseudo v8i8:$orig,
7253 (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
7256 (v8i8 (IMPLICIT_DEF)), dsub_3),
7259 def : Pat<(v8i8 (int_arm_neon_vtbl4 v8i8:$Vn0, v8i8:$Vn1,
7260 v8i8:$Vn2, v8i8:$Vn3, v8i8:$Vm)),
7261 (v8i8 (VTBL4Pseudo (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
7266 def : Pat<(v8i8 (int_arm_neon_vtbx4 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
7267 v8i8:$Vn2, v8i8:$Vn3, v8i8:$Vm)),
7268 (v8i8 (VTBX4Pseudo v8i8:$orig,
7269 (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
7276 // VRINT : Vector Rounding
7277 multiclass VRINT_FPI<string op, bits<3> op9_7, SDPatternOperator Int> {
7278 let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
7279 def Df : N2VDIntnp<0b10, 0b10, 0b100, 0, NoItinerary,
7280 !strconcat("vrint", op), "f32",
7281 v2f32, v2f32, Int>, Requires<[HasV8, HasNEON]> {
7282 let Inst{9-7} = op9_7;
7284 def Qf : N2VQIntnp<0b10, 0b10, 0b100, 0, NoItinerary,
7285 !strconcat("vrint", op), "f32",
7286 v4f32, v4f32, Int>, Requires<[HasV8, HasNEON]> {
7287 let Inst{9-7} = op9_7;
7289 def Dh : N2VDIntnp<0b01, 0b10, 0b100, 0, NoItinerary,
7290 !strconcat("vrint", op), "f16",
7292 Requires<[HasV8, HasNEON, HasFullFP16]> {
7293 let Inst{9-7} = op9_7;
7295 def Qh : N2VQIntnp<0b01, 0b10, 0b100, 0, NoItinerary,
7296 !strconcat("vrint", op), "f16",
7298 Requires<[HasV8, HasNEON, HasFullFP16]> {
7299 let Inst{9-7} = op9_7;
7303 def : NEONInstAlias<!strconcat("vrint", op, ".f32.f32\t$Dd, $Dm"),
7304 (!cast<Instruction>(NAME#"Df") DPR:$Dd, DPR:$Dm)>;
7305 def : NEONInstAlias<!strconcat("vrint", op, ".f32.f32\t$Qd, $Qm"),
7306 (!cast<Instruction>(NAME#"Qf") QPR:$Qd, QPR:$Qm)>;
7307 let Predicates = [HasNEON, HasFullFP16] in {
7308 def : NEONInstAlias<!strconcat("vrint", op, ".f16.f16\t$Dd, $Dm"),
7309 (!cast<Instruction>(NAME#"Dh") DPR:$Dd, DPR:$Dm)>;
7310 def : NEONInstAlias<!strconcat("vrint", op, ".f16.f16\t$Qd, $Qm"),
7311 (!cast<Instruction>(NAME#"Qh") QPR:$Qd, QPR:$Qm)>;
7315 defm VRINTNN : VRINT_FPI<"n", 0b000, int_arm_neon_vrintn>;
7316 defm VRINTXN : VRINT_FPI<"x", 0b001, int_arm_neon_vrintx>;
7317 defm VRINTAN : VRINT_FPI<"a", 0b010, int_arm_neon_vrinta>;
7318 defm VRINTZN : VRINT_FPI<"z", 0b011, int_arm_neon_vrintz>;
7319 defm VRINTMN : VRINT_FPI<"m", 0b101, int_arm_neon_vrintm>;
7320 defm VRINTPN : VRINT_FPI<"p", 0b111, int_arm_neon_vrintp>;
7322 // Cryptography instructions
7323 let PostEncoderMethod = "NEONThumb2DataIPostEncoder",
7324 DecoderNamespace = "v8Crypto", hasSideEffects = 0 in {
7325 class AES<string op, bit op7, bit op6, SDPatternOperator Int>
7326 : N2VQIntXnp<0b00, 0b00, 0b011, op6, op7, NoItinerary,
7327 !strconcat("aes", op), "8", v16i8, v16i8, Int>;
7328 class AES2Op<string op, bit op7, bit op6, SDPatternOperator Int>
7329 : N2VQIntX2np<0b00, 0b00, 0b011, op6, op7, NoItinerary,
7330 !strconcat("aes", op), "8", v16i8, v16i8, Int>;
7331 class N2SHA<string op, bits<2> op17_16, bits<3> op10_8, bit op7, bit op6,
7332 SDPatternOperator Int>
7333 : N2VQIntXnp<0b10, op17_16, op10_8, op6, op7, NoItinerary,
7334 !strconcat("sha", op), "32", v4i32, v4i32, Int>;
7335 class N2SHA2Op<string op, bits<2> op17_16, bits<3> op10_8, bit op7, bit op6,
7336 SDPatternOperator Int>
7337 : N2VQIntX2np<0b10, op17_16, op10_8, op6, op7, NoItinerary,
7338 !strconcat("sha", op), "32", v4i32, v4i32, Int>;
7339 class N3SHA3Op<string op, bits<5> op27_23, bits<2> op21_20, SDPatternOperator Int>
7340 : N3VQInt3np<op27_23, op21_20, 0b1100, 1, 0, N3RegFrm, NoItinerary,
7341 !strconcat("sha", op), "32", v4i32, v4i32, Int>;
7344 let Predicates = [HasV8, HasAES] in {
7345 let isCommutable = 1 in {
7346 def AESD : AES2Op<"d", 0, 1, int_arm_neon_aesd>;
7347 def AESE : AES2Op<"e", 0, 0, int_arm_neon_aese>;
7349 def AESIMC : AES<"imc", 1, 1, int_arm_neon_aesimc>;
7350 def AESMC : AES<"mc", 1, 0, int_arm_neon_aesmc>;
7353 let Predicates = [HasV8, HasSHA2] in {
7354 def SHA1H : N2SHA<"1h", 0b01, 0b010, 1, 1, null_frag>;
7355 def SHA1SU1 : N2SHA2Op<"1su1", 0b10, 0b011, 1, 0, int_arm_neon_sha1su1>;
7356 def SHA256SU0 : N2SHA2Op<"256su0", 0b10, 0b011, 1, 1, int_arm_neon_sha256su0>;
7357 def SHA1C : N3SHA3Op<"1c", 0b00100, 0b00, null_frag>;
7358 def SHA1M : N3SHA3Op<"1m", 0b00100, 0b10, null_frag>;
7359 def SHA1P : N3SHA3Op<"1p", 0b00100, 0b01, null_frag>;
7360 def SHA1SU0 : N3SHA3Op<"1su0", 0b00100, 0b11, int_arm_neon_sha1su0>;
7361 def SHA256H : N3SHA3Op<"256h", 0b00110, 0b00, int_arm_neon_sha256h>;
7362 def SHA256H2 : N3SHA3Op<"256h2", 0b00110, 0b01, int_arm_neon_sha256h2>;
7363 def SHA256SU1 : N3SHA3Op<"256su1", 0b00110, 0b10, int_arm_neon_sha256su1>;
7366 let Predicates = [HasNEON] in {
7367 def : Pat<(i32 (int_arm_neon_sha1h i32:$Rn)),
7368 (COPY_TO_REGCLASS (f32 (EXTRACT_SUBREG
7369 (SHA1H (SUBREG_TO_REG (i64 0),
7370 (f32 (COPY_TO_REGCLASS i32:$Rn, SPR)),
7374 def : Pat<(v4i32 (int_arm_neon_sha1c v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
7375 (SHA1C v4i32:$hash_abcd,
7376 (SUBREG_TO_REG (i64 0),
7377 (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
7381 def : Pat<(v4i32 (int_arm_neon_sha1m v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
7382 (SHA1M v4i32:$hash_abcd,
7383 (SUBREG_TO_REG (i64 0),
7384 (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
7388 def : Pat<(v4i32 (int_arm_neon_sha1p v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
7389 (SHA1P v4i32:$hash_abcd,
7390 (SUBREG_TO_REG (i64 0),
7391 (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
7396 //===----------------------------------------------------------------------===//
7397 // NEON instructions for single-precision FP math
7398 //===----------------------------------------------------------------------===//
7400 class N2VSPat<SDNode OpNode, NeonI Inst>
7401 : NEONFPPat<(f32 (OpNode SPR:$a)),
7403 (v2f32 (COPY_TO_REGCLASS (Inst
7405 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
7406 SPR:$a, ssub_0)), DPR_VFP2)), ssub_0)>;
7408 class N3VSPat<SDNode OpNode, NeonI Inst>
7409 : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
7411 (v2f32 (COPY_TO_REGCLASS (Inst
7413 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
7416 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
7417 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
7419 class N3VSPatFP16<SDNode OpNode, NeonI Inst>
7420 : NEONFPPat<(f16 (OpNode HPR:$a, HPR:$b)),
7422 (v4f16 (COPY_TO_REGCLASS (Inst
7424 (v4f16 (COPY_TO_REGCLASS (v4f16 (IMPLICIT_DEF)), DPR_VFP2)),
7427 (v4f16 (COPY_TO_REGCLASS (v4f16 (IMPLICIT_DEF)), DPR_VFP2)),
7428 HPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
7430 class N3VSMulOpPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
7431 : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
7433 (v2f32 (COPY_TO_REGCLASS (Inst
7435 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
7438 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
7441 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
7442 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
7444 class NVCVTIFPat<SDNode OpNode, NeonI Inst>
7445 : NEONFPPat<(f32 (OpNode GPR:$a)),
7446 (f32 (EXTRACT_SUBREG
7449 (v2f32 (IMPLICIT_DEF)),
7450 (i32 (COPY_TO_REGCLASS GPR:$a, SPR)), ssub_0))),
7452 class NVCVTFIPat<SDNode OpNode, NeonI Inst>
7453 : NEONFPPat<(i32 (OpNode SPR:$a)),
7454 (i32 (EXTRACT_SUBREG
7455 (v2f32 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
7459 def : N3VSPat<fadd, VADDfd>;
7460 def : N3VSPat<fsub, VSUBfd>;
7461 def : N3VSPat<fmul, VMULfd>;
7462 def : N3VSMulOpPat<fmul, fadd, VMLAfd>,
7463 Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
7464 def : N3VSMulOpPat<fmul, fsub, VMLSfd>,
7465 Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
7466 def : N3VSMulOpPat<fmul, fadd, VFMAfd>,
7467 Requires<[HasVFP4, UseNEONForFP, UseFusedMAC]>;
7468 def : N3VSMulOpPat<fmul, fsub, VFMSfd>,
7469 Requires<[HasVFP4, UseNEONForFP, UseFusedMAC]>;
7470 def : N2VSPat<fabs, VABSfd>;
7471 def : N2VSPat<fneg, VNEGfd>;
7472 def : N3VSPatFP16<fmaximum, VMAXhd>, Requires<[HasFullFP16]>;
7473 def : N3VSPatFP16<fminimum, VMINhd>, Requires<[HasFullFP16]>;
7474 def : N3VSPat<fmaximum, VMAXfd>, Requires<[HasNEON]>;
7475 def : N3VSPat<fminimum, VMINfd>, Requires<[HasNEON]>;
7476 def : NVCVTFIPat<fp_to_sint, VCVTf2sd>;
7477 def : NVCVTFIPat<fp_to_uint, VCVTf2ud>;
7478 def : NVCVTIFPat<sint_to_fp, VCVTs2fd>;
7479 def : NVCVTIFPat<uint_to_fp, VCVTu2fd>;
7481 // NEON doesn't have any f64 conversions, so provide patterns to make
7482 // sure the VFP conversions match when extracting from a vector.
7483 def : VFPPat<(f64 (sint_to_fp (extractelt (v2i32 DPR:$src), imm:$lane))),
7484 (VSITOD (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>;
7485 def : VFPPat<(f64 (sint_to_fp (extractelt (v4i32 QPR:$src), imm:$lane))),
7486 (VSITOD (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane)))>;
7487 def : VFPPat<(f64 (uint_to_fp (extractelt (v2i32 DPR:$src), imm:$lane))),
7488 (VUITOD (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>;
7489 def : VFPPat<(f64 (uint_to_fp (extractelt (v4i32 QPR:$src), imm:$lane))),
7490 (VUITOD (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane)))>;
7493 // Prefer VMOVDRR for i32 -> f32 bitcasts, it can write all DPR registers.
7494 def : Pat<(f32 (bitconvert GPR:$a)),
7495 (EXTRACT_SUBREG (VMOVDRR GPR:$a, GPR:$a), ssub_0)>,
7496 Requires<[HasNEON, DontUseVMOVSR]>;
7497 def : Pat<(arm_vmovsr GPR:$a),
7498 (EXTRACT_SUBREG (VMOVDRR GPR:$a, GPR:$a), ssub_0)>,
7499 Requires<[HasNEON, DontUseVMOVSR]>;
7501 //===----------------------------------------------------------------------===//
7502 // Non-Instruction Patterns or Endianess - Revert Patterns
7503 //===----------------------------------------------------------------------===//
7506 // 64 bit conversions
7507 let Predicates = [HasNEON] in {
7508 def : Pat<(f64 (bitconvert (v1i64 DPR:$src))), (f64 DPR:$src)>;
7509 def : Pat<(v1i64 (bitconvert (f64 DPR:$src))), (v1i64 DPR:$src)>;
7511 def : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
7512 def : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
7514 def : Pat<(v4i16 (bitconvert (v4f16 DPR:$src))), (v4i16 DPR:$src)>;
7515 def : Pat<(v4f16 (bitconvert (v4i16 DPR:$src))), (v4f16 DPR:$src)>;
7517 def : Pat<(v4i16 (bitconvert (v4bf16 DPR:$src))), (v4i16 DPR:$src)>;
7518 def : Pat<(v4bf16 (bitconvert (v4i16 DPR:$src))), (v4bf16 DPR:$src)>;
7520 // 128 bit conversions
7521 def : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
7522 def : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
7524 def : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
7525 def : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
7527 def : Pat<(v8i16 (bitconvert (v8f16 QPR:$src))), (v8i16 QPR:$src)>;
7528 def : Pat<(v8f16 (bitconvert (v8i16 QPR:$src))), (v8f16 QPR:$src)>;
7530 def : Pat<(v8i16 (bitconvert (v8bf16 QPR:$src))), (v8i16 QPR:$src)>;
7531 def : Pat<(v8bf16 (bitconvert (v8i16 QPR:$src))), (v8bf16 QPR:$src)>;
7534 let Predicates = [IsLE,HasNEON] in {
7535 // 64 bit conversions
7536 def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (f64 DPR:$src)>;
7537 def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (f64 DPR:$src)>;
7538 def : Pat<(f64 (bitconvert (v4f16 DPR:$src))), (f64 DPR:$src)>;
7539 def : Pat<(f64 (bitconvert (v4bf16 DPR:$src))), (f64 DPR:$src)>;
7540 def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (f64 DPR:$src)>;
7541 def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (f64 DPR:$src)>;
7543 def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
7544 def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
7545 def : Pat<(v1i64 (bitconvert (v4f16 DPR:$src))), (v1i64 DPR:$src)>;
7546 def : Pat<(v1i64 (bitconvert (v4bf16 DPR:$src))), (v1i64 DPR:$src)>;
7547 def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
7548 def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (v1i64 DPR:$src)>;
7550 def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (v2f32 DPR:$src)>;
7551 def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
7552 def : Pat<(v2f32 (bitconvert (v4f16 DPR:$src))), (v2f32 DPR:$src)>;
7553 def : Pat<(v2f32 (bitconvert (v4bf16 DPR:$src))), (v2f32 DPR:$src)>;
7554 def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
7555 def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (v2f32 DPR:$src)>;
7557 def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (v2i32 DPR:$src)>;
7558 def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
7559 def : Pat<(v2i32 (bitconvert (v4f16 DPR:$src))), (v2i32 DPR:$src)>;
7560 def : Pat<(v2i32 (bitconvert (v4bf16 DPR:$src))), (v2i32 DPR:$src)>;
7561 def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
7562 def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (v2i32 DPR:$src)>;
7564 def : Pat<(v4f16 (bitconvert (f64 DPR:$src))), (v4f16 DPR:$src)>;
7565 def : Pat<(v4f16 (bitconvert (v1i64 DPR:$src))), (v4f16 DPR:$src)>;
7566 def : Pat<(v4f16 (bitconvert (v2f32 DPR:$src))), (v4f16 DPR:$src)>;
7567 def : Pat<(v4f16 (bitconvert (v2i32 DPR:$src))), (v4f16 DPR:$src)>;
7568 def : Pat<(v4f16 (bitconvert (v8i8 DPR:$src))), (v4f16 DPR:$src)>;
7570 def : Pat<(v4bf16 (bitconvert (f64 DPR:$src))), (v4bf16 DPR:$src)>;
7571 def : Pat<(v4bf16 (bitconvert (v1i64 DPR:$src))), (v4bf16 DPR:$src)>;
7572 def : Pat<(v4bf16 (bitconvert (v2f32 DPR:$src))), (v4bf16 DPR:$src)>;
7573 def : Pat<(v4bf16 (bitconvert (v2i32 DPR:$src))), (v4bf16 DPR:$src)>;
7574 def : Pat<(v4bf16 (bitconvert (v8i8 DPR:$src))), (v4bf16 DPR:$src)>;
7576 def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (v4i16 DPR:$src)>;
7577 def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
7578 def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
7579 def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
7580 def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (v4i16 DPR:$src)>;
7582 def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (v8i8 DPR:$src)>;
7583 def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (v8i8 DPR:$src)>;
7584 def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (v8i8 DPR:$src)>;
7585 def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (v8i8 DPR:$src)>;
7586 def : Pat<(v8i8 (bitconvert (v4f16 DPR:$src))), (v8i8 DPR:$src)>;
7587 def : Pat<(v8i8 (bitconvert (v4bf16 DPR:$src))), (v8i8 DPR:$src)>;
7588 def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (v8i8 DPR:$src)>;
7590 // 128 bit conversions
7591 def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;
7592 def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
7593 def : Pat<(v2f64 (bitconvert (v8f16 QPR:$src))), (v2f64 QPR:$src)>;
7594 def : Pat<(v2f64 (bitconvert (v8bf16 QPR:$src))), (v2f64 QPR:$src)>;
7595 def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
7596 def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
7598 def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
7599 def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
7600 def : Pat<(v2i64 (bitconvert (v8f16 QPR:$src))), (v2i64 QPR:$src)>;
7601 def : Pat<(v2i64 (bitconvert (v8bf16 QPR:$src))), (v2i64 QPR:$src)>;
7602 def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
7603 def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
7605 def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
7606 def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
7607 def : Pat<(v4f32 (bitconvert (v8f16 QPR:$src))), (v4f32 QPR:$src)>;
7608 def : Pat<(v4f32 (bitconvert (v8bf16 QPR:$src))), (v4f32 QPR:$src)>;
7609 def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
7610 def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
7612 def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
7613 def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
7614 def : Pat<(v4i32 (bitconvert (v8f16 QPR:$src))), (v4i32 QPR:$src)>;
7615 def : Pat<(v4i32 (bitconvert (v8bf16 QPR:$src))), (v4i32 QPR:$src)>;
7616 def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
7617 def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
7619 def : Pat<(v8f16 (bitconvert (v2f64 QPR:$src))), (v8f16 QPR:$src)>;
7620 def : Pat<(v8f16 (bitconvert (v2i64 QPR:$src))), (v8f16 QPR:$src)>;
7621 def : Pat<(v8f16 (bitconvert (v4f32 QPR:$src))), (v8f16 QPR:$src)>;
7622 def : Pat<(v8f16 (bitconvert (v4i32 QPR:$src))), (v8f16 QPR:$src)>;
7623 def : Pat<(v8f16 (bitconvert (v16i8 QPR:$src))), (v8f16 QPR:$src)>;
7625 def : Pat<(v8bf16 (bitconvert (v2f64 QPR:$src))), (v8bf16 QPR:$src)>;
7626 def : Pat<(v8bf16 (bitconvert (v2i64 QPR:$src))), (v8bf16 QPR:$src)>;
7627 def : Pat<(v8bf16 (bitconvert (v4f32 QPR:$src))), (v8bf16 QPR:$src)>;
7628 def : Pat<(v8bf16 (bitconvert (v4i32 QPR:$src))), (v8bf16 QPR:$src)>;
7629 def : Pat<(v8bf16 (bitconvert (v16i8 QPR:$src))), (v8bf16 QPR:$src)>;
7631 def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
7632 def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
7633 def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
7634 def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
7635 def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
7637 def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
7638 def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
7639 def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
7640 def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
7641 def : Pat<(v16i8 (bitconvert (v8f16 QPR:$src))), (v16i8 QPR:$src)>;
7642 def : Pat<(v16i8 (bitconvert (v8bf16 QPR:$src))), (v16i8 QPR:$src)>;
7643 def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
7646 let Predicates = [IsBE,HasNEON] in {
7647 // 64 bit conversions
7648 def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (VREV64d32 DPR:$src)>;
7649 def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (VREV64d32 DPR:$src)>;
7650 def : Pat<(f64 (bitconvert (v4f16 DPR:$src))), (VREV64d16 DPR:$src)>;
7651 def : Pat<(f64 (bitconvert (v4bf16 DPR:$src))), (VREV64d16 DPR:$src)>;
7652 def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (VREV64d16 DPR:$src)>;
7653 def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (VREV64d8 DPR:$src)>;
7655 def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (VREV64d32 DPR:$src)>;
7656 def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (VREV64d32 DPR:$src)>;
7657 def : Pat<(v1i64 (bitconvert (v4f16 DPR:$src))), (VREV64d16 DPR:$src)>;
7658 def : Pat<(v1i64 (bitconvert (v4bf16 DPR:$src))), (VREV64d16 DPR:$src)>;
7659 def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (VREV64d16 DPR:$src)>;
7660 def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (VREV64d8 DPR:$src)>;
7662 def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (VREV64d32 DPR:$src)>;
7663 def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (VREV64d32 DPR:$src)>;
7664 def : Pat<(v2f32 (bitconvert (v4f16 DPR:$src))), (VREV32d16 DPR:$src)>;
7665 def : Pat<(v2f32 (bitconvert (v4bf16 DPR:$src))), (VREV32d16 DPR:$src)>;
7666 def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (VREV32d16 DPR:$src)>;
7667 def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (VREV32d8 DPR:$src)>;
7669 def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (VREV64d32 DPR:$src)>;
7670 def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (VREV64d32 DPR:$src)>;
7671 def : Pat<(v2i32 (bitconvert (v4f16 DPR:$src))), (VREV32d16 DPR:$src)>;
7672 def : Pat<(v2i32 (bitconvert (v4bf16 DPR:$src))), (VREV32d16 DPR:$src)>;
7673 def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (VREV32d16 DPR:$src)>;
7674 def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (VREV32d8 DPR:$src)>;
7676 def : Pat<(v4f16 (bitconvert (f64 DPR:$src))), (VREV64d16 DPR:$src)>;
7677 def : Pat<(v4f16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
7678 def : Pat<(v4f16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
7679 def : Pat<(v4f16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
7680 def : Pat<(v4f16 (bitconvert (v8i8 DPR:$src))), (VREV16d8 DPR:$src)>;
7682 def : Pat<(v4bf16 (bitconvert (f64 DPR:$src))), (VREV64d16 DPR:$src)>;
7683 def : Pat<(v4bf16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
7684 def : Pat<(v4bf16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
7685 def : Pat<(v4bf16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
7686 def : Pat<(v4bf16 (bitconvert (v8i8 DPR:$src))), (VREV16d8 DPR:$src)>;
7688 def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (VREV64d16 DPR:$src)>;
7689 def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
7690 def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
7691 def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
7692 def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (VREV16d8 DPR:$src)>;
7694 def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (VREV64d8 DPR:$src)>;
7695 def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (VREV64d8 DPR:$src)>;
7696 def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (VREV32d8 DPR:$src)>;
7697 def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (VREV32d8 DPR:$src)>;
7698 def : Pat<(v8i8 (bitconvert (v4f16 DPR:$src))), (VREV16d8 DPR:$src)>;
7699 def : Pat<(v8i8 (bitconvert (v4bf16 DPR:$src))), (VREV16d8 DPR:$src)>;
7700 def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (VREV16d8 DPR:$src)>;
7702 // 128 bit conversions
7703 def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (VREV64q32 QPR:$src)>;
7704 def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (VREV64q32 QPR:$src)>;
7705 def : Pat<(v2f64 (bitconvert (v8f16 QPR:$src))), (VREV64q16 QPR:$src)>;
7706 def : Pat<(v2f64 (bitconvert (v8bf16 QPR:$src))), (VREV64q16 QPR:$src)>;
7707 def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (VREV64q16 QPR:$src)>;
7708 def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (VREV64q8 QPR:$src)>;
7710 def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (VREV64q32 QPR:$src)>;
7711 def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (VREV64q32 QPR:$src)>;
7712 def : Pat<(v2i64 (bitconvert (v8f16 QPR:$src))), (VREV64q16 QPR:$src)>;
7713 def : Pat<(v2i64 (bitconvert (v8bf16 QPR:$src))), (VREV64q16 QPR:$src)>;
7714 def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (VREV64q16 QPR:$src)>;
7715 def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (VREV64q8 QPR:$src)>;
7717 def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (VREV64q32 QPR:$src)>;
7718 def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (VREV64q32 QPR:$src)>;
7719 def : Pat<(v4f32 (bitconvert (v8f16 QPR:$src))), (VREV32q16 QPR:$src)>;
7720 def : Pat<(v4f32 (bitconvert (v8bf16 QPR:$src))), (VREV32q16 QPR:$src)>;
7721 def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (VREV32q16 QPR:$src)>;
7722 def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (VREV32q8 QPR:$src)>;
7724 def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (VREV64q32 QPR:$src)>;
7725 def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (VREV64q32 QPR:$src)>;
7726 def : Pat<(v4i32 (bitconvert (v8f16 QPR:$src))), (VREV32q16 QPR:$src)>;
7727 def : Pat<(v4i32 (bitconvert (v8bf16 QPR:$src))), (VREV32q16 QPR:$src)>;
7728 def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (VREV32q16 QPR:$src)>;
7729 def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (VREV32q8 QPR:$src)>;
7731 def : Pat<(v8f16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
7732 def : Pat<(v8f16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
7733 def : Pat<(v8f16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
7734 def : Pat<(v8f16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
7735 def : Pat<(v8f16 (bitconvert (v16i8 QPR:$src))), (VREV16q8 QPR:$src)>;
7737 def : Pat<(v8bf16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
7738 def : Pat<(v8bf16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
7739 def : Pat<(v8bf16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
7740 def : Pat<(v8bf16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
7741 def : Pat<(v8bf16 (bitconvert (v16i8 QPR:$src))), (VREV16q8 QPR:$src)>;
7743 def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
7744 def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
7745 def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
7746 def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
7747 def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (VREV16q8 QPR:$src)>;
7749 def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (VREV64q8 QPR:$src)>;
7750 def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (VREV64q8 QPR:$src)>;
7751 def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (VREV32q8 QPR:$src)>;
7752 def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (VREV32q8 QPR:$src)>;
7753 def : Pat<(v16i8 (bitconvert (v8f16 QPR:$src))), (VREV16q8 QPR:$src)>;
7754 def : Pat<(v16i8 (bitconvert (v8bf16 QPR:$src))), (VREV16q8 QPR:$src)>;
7755 def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (VREV16q8 QPR:$src)>;
7758 let Predicates = [HasNEON] in {
7759 // Here we match the specific SDNode type 'ARMVectorRegCastImpl'
7760 // rather than the more general 'ARMVectorRegCast' which would also
7761 // match some bitconverts. If we use the latter in cases where the
7762 // input and output types are the same, the bitconvert gets elided
7763 // and we end up generating a nonsense match of nothing.
7765 foreach VT = [ v16i8, v8i16, v8f16, v8bf16, v4i32, v4f32, v2i64, v2f64 ] in
7766 foreach VT2 = [ v16i8, v8i16, v8f16, v8bf16, v4i32, v4f32, v2i64, v2f64 ] in
7767 def : Pat<(VT (ARMVectorRegCastImpl (VT2 QPR:$src))), (VT QPR:$src)>;
7769 foreach VT = [ v8i8, v4i16, v4f16, v4bf16, v2i32, v2f32, v1i64, f64 ] in
7770 foreach VT2 = [ v8i8, v4i16, v4f16, v4bf16, v2i32, v2f32, v1i64, f64 ] in
7771 def : Pat<(VT (ARMVectorRegCastImpl (VT2 DPR:$src))), (VT DPR:$src)>;
7774 // Use VLD1/VST1 + VREV for non-word-aligned v2f64 load/store on Big Endian
7775 let Predicates = [IsBE,HasNEON] in {
7776 def : Pat<(v2f64 (byte_alignedload addrmode6:$addr)),
7777 (VREV64q8 (VLD1q8 addrmode6:$addr))>;
7778 def : Pat<(byte_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
7779 (VST1q8 addrmode6:$addr, (VREV64q8 QPR:$value))>;
7780 def : Pat<(v2f64 (hword_alignedload addrmode6:$addr)),
7781 (VREV64q16 (VLD1q16 addrmode6:$addr))>;
7782 def : Pat<(hword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
7783 (VST1q16 addrmode6:$addr, (VREV64q16 QPR:$value))>;
7786 // Fold extracting an element out of a v2i32 into a vfp register.
7787 def : Pat<(f32 (bitconvert (i32 (extractelt (v2i32 DPR:$src), imm:$lane)))),
7788 (f32 (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>,
7789 Requires<[HasNEON]>;
7791 // Vector lengthening move with load, matching extending loads.
7793 // extload, zextload and sextload for a standard lengthening load. Example:
7794 // Lengthen_Single<"8", "i16", "8"> =
7795 // Pat<(v8i16 (extloadvi8 addrmode6:$addr))
7796 // (VMOVLuv8i16 (VLD1d8 addrmode6:$addr,
7797 // (f64 (IMPLICIT_DEF)), (i32 0)))>;
7798 multiclass Lengthen_Single<string DestLanes, string DestTy, string SrcTy> {
7799 let AddedComplexity = 10 in {
7800 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7801 (!cast<PatFrag>("extloadvi" # SrcTy) addrmode6:$addr)),
7802 (!cast<Instruction>("VMOVLuv" # DestLanes # DestTy)
7803 (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
7804 Requires<[HasNEON]>;
7806 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7807 (!cast<PatFrag>("zextloadvi" # SrcTy) addrmode6:$addr)),
7808 (!cast<Instruction>("VMOVLuv" # DestLanes # DestTy)
7809 (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
7810 Requires<[HasNEON]>;
7812 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7813 (!cast<PatFrag>("sextloadvi" # SrcTy) addrmode6:$addr)),
7814 (!cast<Instruction>("VMOVLsv" # DestLanes # DestTy)
7815 (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
7816 Requires<[HasNEON]>;
7820 // extload, zextload and sextload for a lengthening load which only uses
7821 // half the lanes available. Example:
7822 // Lengthen_HalfSingle<"4", "i16", "8", "i16", "i8"> =
7823 // Pat<(v4i16 (extloadvi8 addrmode6oneL32:$addr)),
7824 // (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd32 addrmode6oneL32:$addr,
7825 // (f64 (IMPLICIT_DEF)), (i32 0))),
7827 multiclass Lengthen_HalfSingle<string DestLanes, string DestTy, string SrcTy,
7828 string InsnLanes, string InsnTy> {
7829 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7830 (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
7831 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
7832 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7834 Requires<[HasNEON]>;
7835 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7836 (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
7837 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
7838 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7840 Requires<[HasNEON]>;
7841 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7842 (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
7843 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # InsnLanes # InsnTy)
7844 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7846 Requires<[HasNEON]>;
7849 // The following class definition is basically a copy of the
7850 // Lengthen_HalfSingle definition above, however with an additional parameter
7851 // "RevLanes" to select the correct VREV32dXX instruction. This is to convert
7852 // data loaded by VLD1LN into proper vector format in big endian mode.
7853 multiclass Lengthen_HalfSingle_Big_Endian<string DestLanes, string DestTy, string SrcTy,
7854 string InsnLanes, string InsnTy, string RevLanes> {
7855 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7856 (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
7857 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
7858 (!cast<Instruction>("VREV32d" # RevLanes)
7859 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
7861 Requires<[HasNEON]>;
7862 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7863 (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
7864 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
7865 (!cast<Instruction>("VREV32d" # RevLanes)
7866 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
7868 Requires<[HasNEON]>;
7869 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7870 (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
7871 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # InsnLanes # InsnTy)
7872 (!cast<Instruction>("VREV32d" # RevLanes)
7873 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
7875 Requires<[HasNEON]>;
7878 // extload, zextload and sextload for a lengthening load followed by another
7879 // lengthening load, to quadruple the initial length.
7881 // Lengthen_Double<"4", "i32", "i8", "8", "i16", "4", "i32"> =
7882 // Pat<(v4i32 (extloadvi8 addrmode6oneL32:$addr))
7883 // (EXTRACT_SUBREG (VMOVLuv4i32
7884 // (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd32 addrmode6oneL32:$addr,
7885 // (f64 (IMPLICIT_DEF)),
7889 multiclass Lengthen_Double<string DestLanes, string DestTy, string SrcTy,
7890 string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
7892 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7893 (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
7894 (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7895 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7896 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7898 Requires<[HasNEON]>;
7899 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7900 (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
7901 (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7902 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7903 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7905 Requires<[HasNEON]>;
7906 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7907 (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
7908 (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
7909 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
7910 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7912 Requires<[HasNEON]>;
7915 // The following class definition is basically a copy of the
7916 // Lengthen_Double definition above, however with an additional parameter
7917 // "RevLanes" to select the correct VREV32dXX instruction. This is to convert
7918 // data loaded by VLD1LN into proper vector format in big endian mode.
7919 multiclass Lengthen_Double_Big_Endian<string DestLanes, string DestTy, string SrcTy,
7920 string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
7921 string Insn2Ty, string RevLanes> {
7922 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7923 (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
7924 (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7925 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7926 (!cast<Instruction>("VREV32d" # RevLanes)
7927 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
7929 Requires<[HasNEON]>;
7930 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7931 (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
7932 (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7933 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7934 (!cast<Instruction>("VREV32d" # RevLanes)
7935 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
7937 Requires<[HasNEON]>;
7938 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7939 (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
7940 (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
7941 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
7942 (!cast<Instruction>("VREV32d" # RevLanes)
7943 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
7945 Requires<[HasNEON]>;
7948 // extload, zextload and sextload for a lengthening load followed by another
7949 // lengthening load, to quadruple the initial length, but which ends up only
7950 // requiring half the available lanes (a 64-bit outcome instead of a 128-bit).
7952 // Lengthen_HalfDouble<"2", "i32", "i8", "8", "i16", "4", "i32"> =
7953 // Pat<(v2i32 (extloadvi8 addrmode6:$addr))
7954 // (EXTRACT_SUBREG (VMOVLuv4i32
7955 // (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd16 addrmode6:$addr,
7956 // (f64 (IMPLICIT_DEF)), (i32 0))),
7959 multiclass Lengthen_HalfDouble<string DestLanes, string DestTy, string SrcTy,
7960 string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
7962 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7963 (!cast<PatFrag>("extloadv" # SrcTy) addrmode6:$addr)),
7964 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7965 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7966 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7969 Requires<[HasNEON]>;
7970 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7971 (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6:$addr)),
7972 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7973 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7974 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7977 Requires<[HasNEON]>;
7978 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7979 (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6:$addr)),
7980 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
7981 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
7982 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7985 Requires<[HasNEON]>;
7988 // The following class definition is basically a copy of the
7989 // Lengthen_HalfDouble definition above, however with an additional VREV16d8
7990 // instruction to convert data loaded by VLD1LN into proper vector format
7991 // in big endian mode.
7992 multiclass Lengthen_HalfDouble_Big_Endian<string DestLanes, string DestTy, string SrcTy,
7993 string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
7995 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7996 (!cast<PatFrag>("extloadv" # SrcTy) addrmode6:$addr)),
7997 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7998 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7999 (VREV16d8 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
8002 Requires<[HasNEON]>;
8003 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
8004 (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6:$addr)),
8005 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
8006 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
8007 (VREV16d8 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
8010 Requires<[HasNEON]>;
8011 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
8012 (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6:$addr)),
8013 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
8014 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
8015 (VREV16d8 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
8018 Requires<[HasNEON]>;
8021 defm : Lengthen_Single<"8", "i16", "8">; // v8i8 -> v8i16
8022 defm : Lengthen_Single<"4", "i32", "16">; // v4i16 -> v4i32
8023 defm : Lengthen_Single<"2", "i64", "32">; // v2i32 -> v2i64
8025 let Predicates = [HasNEON,IsLE] in {
8026 defm : Lengthen_HalfSingle<"4", "i16", "i8", "8", "i16">; // v4i8 -> v4i16
8027 defm : Lengthen_HalfSingle<"2", "i32", "i16", "4", "i32">; // v2i16 -> v2i32
8029 // Double lengthening - v4i8 -> v4i16 -> v4i32
8030 defm : Lengthen_Double<"4", "i32", "i8", "8", "i16", "4", "i32">;
8031 // v2i8 -> v2i16 -> v2i32
8032 defm : Lengthen_HalfDouble<"2", "i32", "i8", "8", "i16", "4", "i32">;
8033 // v2i16 -> v2i32 -> v2i64
8034 defm : Lengthen_Double<"2", "i64", "i16", "4", "i32", "2", "i64">;
8037 let Predicates = [HasNEON,IsBE] in {
8038 defm : Lengthen_HalfSingle_Big_Endian<"4", "i16", "i8", "8", "i16", "8">; // v4i8 -> v4i16
8039 defm : Lengthen_HalfSingle_Big_Endian<"2", "i32", "i16", "4", "i32", "16">; // v2i16 -> v2i32
8041 // Double lengthening - v4i8 -> v4i16 -> v4i32
8042 defm : Lengthen_Double_Big_Endian<"4", "i32", "i8", "8", "i16", "4", "i32", "8">;
8043 // v2i8 -> v2i16 -> v2i32
8044 defm : Lengthen_HalfDouble_Big_Endian<"2", "i32", "i8", "8", "i16", "4", "i32">;
8045 // v2i16 -> v2i32 -> v2i64
8046 defm : Lengthen_Double_Big_Endian<"2", "i64", "i16", "4", "i32", "2", "i64", "16">;
8049 // Triple lengthening - v2i8 -> v2i16 -> v2i32 -> v2i64
8050 let Predicates = [HasNEON,IsLE] in {
8051 def : Pat<(v2i64 (extloadvi8 addrmode6:$addr)),
8052 (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
8053 (VLD1LNd16 addrmode6:$addr,
8054 (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>;
8055 def : Pat<(v2i64 (zextloadvi8 addrmode6:$addr)),
8056 (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
8057 (VLD1LNd16 addrmode6:$addr,
8058 (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>;
8059 def : Pat<(v2i64 (sextloadvi8 addrmode6:$addr)),
8060 (VMOVLsv2i64 (EXTRACT_SUBREG (VMOVLsv4i32 (EXTRACT_SUBREG (VMOVLsv8i16
8061 (VLD1LNd16 addrmode6:$addr,
8062 (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>;
8064 // The following patterns are basically a copy of the patterns above,
8065 // however with an additional VREV16d instruction to convert data
8066 // loaded by VLD1LN into proper vector format in big endian mode.
8067 let Predicates = [HasNEON,IsBE] in {
8068 def : Pat<(v2i64 (extloadvi8 addrmode6:$addr)),
8069 (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
8071 (VLD1LNd16 addrmode6:$addr,
8072 (f64 (IMPLICIT_DEF)), (i32 0)))), dsub_0)), dsub_0))>;
8073 def : Pat<(v2i64 (zextloadvi8 addrmode6:$addr)),
8074 (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
8076 (VLD1LNd16 addrmode6:$addr,
8077 (f64 (IMPLICIT_DEF)), (i32 0)))), dsub_0)), dsub_0))>;
8078 def : Pat<(v2i64 (sextloadvi8 addrmode6:$addr)),
8079 (VMOVLsv2i64 (EXTRACT_SUBREG (VMOVLsv4i32 (EXTRACT_SUBREG (VMOVLsv8i16
8081 (VLD1LNd16 addrmode6:$addr,
8082 (f64 (IMPLICIT_DEF)), (i32 0)))), dsub_0)), dsub_0))>;
8085 let Predicates = [HasNEON] in {
8086 def : Pat<(v2i64 (concat_vectors DPR:$Dn, DPR:$Dm)),
8087 (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
8088 def : Pat<(v4i32 (concat_vectors DPR:$Dn, DPR:$Dm)),
8089 (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
8090 def : Pat<(v8i16 (concat_vectors DPR:$Dn, DPR:$Dm)),
8091 (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
8092 def : Pat<(v16i8 (concat_vectors DPR:$Dn, DPR:$Dm)),
8093 (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
8094 def : Pat<(v4f32 (concat_vectors DPR:$Dn, DPR:$Dm)),
8095 (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
8096 def : Pat<(v8f16 (concat_vectors DPR:$Dn, DPR:$Dm)),
8097 (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
8098 def : Pat<(v8bf16 (concat_vectors DPR:$Dn, DPR:$Dm)),
8099 (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
8102 //===----------------------------------------------------------------------===//
8103 // Assembler aliases
8106 def : VFP2InstAlias<"fmdhr${p} $Dd, $Rn",
8107 (VSETLNi32 DPR:$Dd, GPR:$Rn, 1, pred:$p)>;
8108 def : VFP2InstAlias<"fmdlr${p} $Dd, $Rn",
8109 (VSETLNi32 DPR:$Dd, GPR:$Rn, 0, pred:$p)>;
8111 // VAND/VBIC/VEOR/VORR accept but do not require a type suffix.
8112 defm : NEONDTAnyInstAlias<"vand${p}", "$Vd, $Vn, $Vm",
8113 (VANDd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
8114 defm : NEONDTAnyInstAlias<"vand${p}", "$Vd, $Vn, $Vm",
8115 (VANDq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
8116 defm : NEONDTAnyInstAlias<"vbic${p}", "$Vd, $Vn, $Vm",
8117 (VBICd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
8118 defm : NEONDTAnyInstAlias<"vbic${p}", "$Vd, $Vn, $Vm",
8119 (VBICq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
8120 defm : NEONDTAnyInstAlias<"veor${p}", "$Vd, $Vn, $Vm",
8121 (VEORd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
8122 defm : NEONDTAnyInstAlias<"veor${p}", "$Vd, $Vn, $Vm",
8123 (VEORq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
8124 defm : NEONDTAnyInstAlias<"vorr${p}", "$Vd, $Vn, $Vm",
8125 (VORRd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
8126 defm : NEONDTAnyInstAlias<"vorr${p}", "$Vd, $Vn, $Vm",
8127 (VORRq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
8128 // ... two-operand aliases
8129 defm : NEONDTAnyInstAlias<"vand${p}", "$Vdn, $Vm",
8130 (VANDd DPR:$Vdn, DPR:$Vdn, DPR:$Vm, pred:$p)>;
8131 defm : NEONDTAnyInstAlias<"vand${p}", "$Vdn, $Vm",
8132 (VANDq QPR:$Vdn, QPR:$Vdn, QPR:$Vm, pred:$p)>;
8133 defm : NEONDTAnyInstAlias<"veor${p}", "$Vdn, $Vm",
8134 (VEORd DPR:$Vdn, DPR:$Vdn, DPR:$Vm, pred:$p)>;
8135 defm : NEONDTAnyInstAlias<"veor${p}", "$Vdn, $Vm",
8136 (VEORq QPR:$Vdn, QPR:$Vdn, QPR:$Vm, pred:$p)>;
8137 defm : NEONDTAnyInstAlias<"vorr${p}", "$Vdn, $Vm",
8138 (VORRd DPR:$Vdn, DPR:$Vdn, DPR:$Vm, pred:$p)>;
8139 defm : NEONDTAnyInstAlias<"vorr${p}", "$Vdn, $Vm",
8140 (VORRq QPR:$Vdn, QPR:$Vdn, QPR:$Vm, pred:$p)>;
8142 def : NEONInstAlias<"vand${p}.i16 $Vd, $imm",
8143 (VBICiv4i16 DPR:$Vd, nImmSplatNotI16:$imm, pred:$p)>;
8144 def : NEONInstAlias<"vand${p}.i32 $Vd, $imm",
8145 (VBICiv2i32 DPR:$Vd, nImmSplatNotI32:$imm, pred:$p)>;
8146 def : NEONInstAlias<"vand${p}.i16 $Vd, $imm",
8147 (VBICiv8i16 QPR:$Vd, nImmSplatNotI16:$imm, pred:$p)>;
8148 def : NEONInstAlias<"vand${p}.i32 $Vd, $imm",
8149 (VBICiv4i32 QPR:$Vd, nImmSplatNotI32:$imm, pred:$p)>;
8152 // VLD1 single-lane pseudo-instructions. These need special handling for
8153 // the lane index that an InstAlias can't handle, so we use these instead.
8154 def VLD1LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld1${p}", ".8", "$list, $addr",
8155 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
8157 def VLD1LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld1${p}", ".16", "$list, $addr",
8158 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
8160 def VLD1LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld1${p}", ".32", "$list, $addr",
8161 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
8164 def VLD1LNdWB_fixed_Asm_8 :
8165 NEONDataTypeAsmPseudoInst<"vld1${p}", ".8", "$list, $addr!",
8166 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
8168 def VLD1LNdWB_fixed_Asm_16 :
8169 NEONDataTypeAsmPseudoInst<"vld1${p}", ".16", "$list, $addr!",
8170 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
8172 def VLD1LNdWB_fixed_Asm_32 :
8173 NEONDataTypeAsmPseudoInst<"vld1${p}", ".32", "$list, $addr!",
8174 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
8176 def VLD1LNdWB_register_Asm_8 :
8177 NEONDataTypeAsmPseudoInst<"vld1${p}", ".8", "$list, $addr, $Rm",
8178 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
8179 rGPR:$Rm, pred:$p)>;
8180 def VLD1LNdWB_register_Asm_16 :
8181 NEONDataTypeAsmPseudoInst<"vld1${p}", ".16", "$list, $addr, $Rm",
8182 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
8183 rGPR:$Rm, pred:$p)>;
8184 def VLD1LNdWB_register_Asm_32 :
8185 NEONDataTypeAsmPseudoInst<"vld1${p}", ".32", "$list, $addr, $Rm",
8186 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
8187 rGPR:$Rm, pred:$p)>;
8190 // VST1 single-lane pseudo-instructions. These need special handling for
8191 // the lane index that an InstAlias can't handle, so we use these instead.
8192 def VST1LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst1${p}", ".8", "$list, $addr",
8193 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
8195 def VST1LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst1${p}", ".16", "$list, $addr",
8196 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
8198 def VST1LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst1${p}", ".32", "$list, $addr",
8199 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
8202 def VST1LNdWB_fixed_Asm_8 :
8203 NEONDataTypeAsmPseudoInst<"vst1${p}", ".8", "$list, $addr!",
8204 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
8206 def VST1LNdWB_fixed_Asm_16 :
8207 NEONDataTypeAsmPseudoInst<"vst1${p}", ".16", "$list, $addr!",
8208 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
8210 def VST1LNdWB_fixed_Asm_32 :
8211 NEONDataTypeAsmPseudoInst<"vst1${p}", ".32", "$list, $addr!",
8212 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
8214 def VST1LNdWB_register_Asm_8 :
8215 NEONDataTypeAsmPseudoInst<"vst1${p}", ".8", "$list, $addr, $Rm",
8216 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
8217 rGPR:$Rm, pred:$p)>;
8218 def VST1LNdWB_register_Asm_16 :
8219 NEONDataTypeAsmPseudoInst<"vst1${p}", ".16", "$list, $addr, $Rm",
8220 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
8221 rGPR:$Rm, pred:$p)>;
8222 def VST1LNdWB_register_Asm_32 :
8223 NEONDataTypeAsmPseudoInst<"vst1${p}", ".32", "$list, $addr, $Rm",
8224 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
8225 rGPR:$Rm, pred:$p)>;
8227 // VLD2 single-lane pseudo-instructions. These need special handling for
8228 // the lane index that an InstAlias can't handle, so we use these instead.
8229 def VLD2LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".8", "$list, $addr",
8230 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
8232 def VLD2LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr",
8233 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
8235 def VLD2LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr",
8236 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr, pred:$p)>;
8237 def VLD2LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr",
8238 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
8240 def VLD2LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr",
8241 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
8244 def VLD2LNdWB_fixed_Asm_8 :
8245 NEONDataTypeAsmPseudoInst<"vld2${p}", ".8", "$list, $addr!",
8246 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
8248 def VLD2LNdWB_fixed_Asm_16 :
8249 NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr!",
8250 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
8252 def VLD2LNdWB_fixed_Asm_32 :
8253 NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr!",
8254 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
8256 def VLD2LNqWB_fixed_Asm_16 :
8257 NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr!",
8258 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
8260 def VLD2LNqWB_fixed_Asm_32 :
8261 NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr!",
8262 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
8264 def VLD2LNdWB_register_Asm_8 :
8265 NEONDataTypeAsmPseudoInst<"vld2${p}", ".8", "$list, $addr, $Rm",
8266 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
8267 rGPR:$Rm, pred:$p)>;
8268 def VLD2LNdWB_register_Asm_16 :
8269 NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr, $Rm",
8270 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
8271 rGPR:$Rm, pred:$p)>;
8272 def VLD2LNdWB_register_Asm_32 :
8273 NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr, $Rm",
8274 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
8275 rGPR:$Rm, pred:$p)>;
8276 def VLD2LNqWB_register_Asm_16 :
8277 NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr, $Rm",
8278 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
8279 rGPR:$Rm, pred:$p)>;
8280 def VLD2LNqWB_register_Asm_32 :
8281 NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr, $Rm",
8282 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
8283 rGPR:$Rm, pred:$p)>;
8286 // VST2 single-lane pseudo-instructions. These need special handling for
8287 // the lane index that an InstAlias can't handle, so we use these instead.
8288 def VST2LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".8", "$list, $addr",
8289 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
8291 def VST2LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr",
8292 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
8294 def VST2LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr",
8295 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
8297 def VST2LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr",
8298 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
8300 def VST2LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr",
8301 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
8304 def VST2LNdWB_fixed_Asm_8 :
8305 NEONDataTypeAsmPseudoInst<"vst2${p}", ".8", "$list, $addr!",
8306 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
8308 def VST2LNdWB_fixed_Asm_16 :
8309 NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr!",
8310 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
8312 def VST2LNdWB_fixed_Asm_32 :
8313 NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr!",
8314 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
8316 def VST2LNqWB_fixed_Asm_16 :
8317 NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr!",
8318 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
8320 def VST2LNqWB_fixed_Asm_32 :
8321 NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr!",
8322 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
8324 def VST2LNdWB_register_Asm_8 :
8325 NEONDataTypeAsmPseudoInst<"vst2${p}", ".8", "$list, $addr, $Rm",
8326 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
8327 rGPR:$Rm, pred:$p)>;
8328 def VST2LNdWB_register_Asm_16 :
8329 NEONDataTypeAsmPseudoInst<"vst2${p}", ".16","$list, $addr, $Rm",
8330 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
8331 rGPR:$Rm, pred:$p)>;
8332 def VST2LNdWB_register_Asm_32 :
8333 NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr, $Rm",
8334 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
8335 rGPR:$Rm, pred:$p)>;
8336 def VST2LNqWB_register_Asm_16 :
8337 NEONDataTypeAsmPseudoInst<"vst2${p}", ".16","$list, $addr, $Rm",
8338 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
8339 rGPR:$Rm, pred:$p)>;
8340 def VST2LNqWB_register_Asm_32 :
8341 NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr, $Rm",
8342 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
8343 rGPR:$Rm, pred:$p)>;
8345 // VLD3 all-lanes pseudo-instructions. These need special handling for
8346 // the lane index that an InstAlias can't handle, so we use these instead.
8347 def VLD3DUPdAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
8348 (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
8350 def VLD3DUPdAsm_16: NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
8351 (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
8353 def VLD3DUPdAsm_32: NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
8354 (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
8356 def VLD3DUPqAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
8357 (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
8359 def VLD3DUPqAsm_16: NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
8360 (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
8362 def VLD3DUPqAsm_32: NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
8363 (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
8366 def VLD3DUPdWB_fixed_Asm_8 :
8367 NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
8368 (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
8370 def VLD3DUPdWB_fixed_Asm_16 :
8371 NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
8372 (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
8374 def VLD3DUPdWB_fixed_Asm_32 :
8375 NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
8376 (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
8378 def VLD3DUPqWB_fixed_Asm_8 :
8379 NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
8380 (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
8382 def VLD3DUPqWB_fixed_Asm_16 :
8383 NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
8384 (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
8386 def VLD3DUPqWB_fixed_Asm_32 :
8387 NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
8388 (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
8390 def VLD3DUPdWB_register_Asm_8 :
8391 NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
8392 (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
8393 rGPR:$Rm, pred:$p)>;
8394 def VLD3DUPdWB_register_Asm_16 :
8395 NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
8396 (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
8397 rGPR:$Rm, pred:$p)>;
8398 def VLD3DUPdWB_register_Asm_32 :
8399 NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
8400 (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
8401 rGPR:$Rm, pred:$p)>;
8402 def VLD3DUPqWB_register_Asm_8 :
8403 NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
8404 (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
8405 rGPR:$Rm, pred:$p)>;
8406 def VLD3DUPqWB_register_Asm_16 :
8407 NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
8408 (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
8409 rGPR:$Rm, pred:$p)>;
8410 def VLD3DUPqWB_register_Asm_32 :
8411 NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
8412 (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
8413 rGPR:$Rm, pred:$p)>;
8416 // VLD3 single-lane pseudo-instructions. These need special handling for
8417 // the lane index that an InstAlias can't handle, so we use these instead.
8418 def VLD3LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
8419 (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
8421 def VLD3LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
8422 (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
8424 def VLD3LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
8425 (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
8427 def VLD3LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
8428 (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
8430 def VLD3LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
8431 (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
8434 def VLD3LNdWB_fixed_Asm_8 :
8435 NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
8436 (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
8438 def VLD3LNdWB_fixed_Asm_16 :
8439 NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
8440 (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
8442 def VLD3LNdWB_fixed_Asm_32 :
8443 NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
8444 (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
8446 def VLD3LNqWB_fixed_Asm_16 :
8447 NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
8448 (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
8450 def VLD3LNqWB_fixed_Asm_32 :
8451 NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
8452 (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
8454 def VLD3LNdWB_register_Asm_8 :
8455 NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
8456 (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
8457 rGPR:$Rm, pred:$p)>;
8458 def VLD3LNdWB_register_Asm_16 :
8459 NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
8460 (ins VecListThreeDHWordIndexed:$list,
8461 addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
8462 def VLD3LNdWB_register_Asm_32 :
8463 NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
8464 (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
8465 rGPR:$Rm, pred:$p)>;
8466 def VLD3LNqWB_register_Asm_16 :
8467 NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
8468 (ins VecListThreeQHWordIndexed:$list,
8469 addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
8470 def VLD3LNqWB_register_Asm_32 :
8471 NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
8472 (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
8473 rGPR:$Rm, pred:$p)>;
8475 // VLD3 multiple structure pseudo-instructions. These need special handling for
8476 // the vector operands that the normal instructions don't yet model.
8477 // FIXME: Remove these when the register classes and instructions are updated.
8478 def VLD3dAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
8479 (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
8480 def VLD3dAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
8481 (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
8482 def VLD3dAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
8483 (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
8484 def VLD3qAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
8485 (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
8486 def VLD3qAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
8487 (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
8488 def VLD3qAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
8489 (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
8491 def VLD3dWB_fixed_Asm_8 :
8492 NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
8493 (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
8494 def VLD3dWB_fixed_Asm_16 :
8495 NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
8496 (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
8497 def VLD3dWB_fixed_Asm_32 :
8498 NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
8499 (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
8500 def VLD3qWB_fixed_Asm_8 :
8501 NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
8502 (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
8503 def VLD3qWB_fixed_Asm_16 :
8504 NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
8505 (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
8506 def VLD3qWB_fixed_Asm_32 :
8507 NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
8508 (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
8509 def VLD3dWB_register_Asm_8 :
8510 NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
8511 (ins VecListThreeD:$list, addrmode6align64:$addr,
8512 rGPR:$Rm, pred:$p)>;
8513 def VLD3dWB_register_Asm_16 :
8514 NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
8515 (ins VecListThreeD:$list, addrmode6align64:$addr,
8516 rGPR:$Rm, pred:$p)>;
8517 def VLD3dWB_register_Asm_32 :
8518 NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
8519 (ins VecListThreeD:$list, addrmode6align64:$addr,
8520 rGPR:$Rm, pred:$p)>;
8521 def VLD3qWB_register_Asm_8 :
8522 NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
8523 (ins VecListThreeQ:$list, addrmode6align64:$addr,
8524 rGPR:$Rm, pred:$p)>;
8525 def VLD3qWB_register_Asm_16 :
8526 NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
8527 (ins VecListThreeQ:$list, addrmode6align64:$addr,
8528 rGPR:$Rm, pred:$p)>;
8529 def VLD3qWB_register_Asm_32 :
8530 NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
8531 (ins VecListThreeQ:$list, addrmode6align64:$addr,
8532 rGPR:$Rm, pred:$p)>;
8534 // VST3 single-lane pseudo-instructions. These need special handling for
8535 // the lane index that an InstAlias can't handle, so we use these instead.
8536 def VST3LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr",
8537 (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
8539 def VST3LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
8540 (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
8542 def VST3LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
8543 (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
8545 def VST3LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
8546 (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
8548 def VST3LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
8549 (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
8552 def VST3LNdWB_fixed_Asm_8 :
8553 NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr!",
8554 (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
8556 def VST3LNdWB_fixed_Asm_16 :
8557 NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
8558 (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
8560 def VST3LNdWB_fixed_Asm_32 :
8561 NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
8562 (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
8564 def VST3LNqWB_fixed_Asm_16 :
8565 NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
8566 (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
8568 def VST3LNqWB_fixed_Asm_32 :
8569 NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
8570 (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
8572 def VST3LNdWB_register_Asm_8 :
8573 NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr, $Rm",
8574 (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
8575 rGPR:$Rm, pred:$p)>;
8576 def VST3LNdWB_register_Asm_16 :
8577 NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
8578 (ins VecListThreeDHWordIndexed:$list,
8579 addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
8580 def VST3LNdWB_register_Asm_32 :
8581 NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
8582 (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
8583 rGPR:$Rm, pred:$p)>;
8584 def VST3LNqWB_register_Asm_16 :
8585 NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
8586 (ins VecListThreeQHWordIndexed:$list,
8587 addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
8588 def VST3LNqWB_register_Asm_32 :
8589 NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
8590 (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
8591 rGPR:$Rm, pred:$p)>;
8594 // VST3 multiple structure pseudo-instructions. These need special handling for
8595 // the vector operands that the normal instructions don't yet model.
8596 // FIXME: Remove these when the register classes and instructions are updated.
8597 def VST3dAsm_8 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr",
8598 (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
8599 def VST3dAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
8600 (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
8601 def VST3dAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
8602 (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
8603 def VST3qAsm_8 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr",
8604 (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
8605 def VST3qAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
8606 (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
8607 def VST3qAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
8608 (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
8610 def VST3dWB_fixed_Asm_8 :
8611 NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr!",
8612 (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
8613 def VST3dWB_fixed_Asm_16 :
8614 NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
8615 (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
8616 def VST3dWB_fixed_Asm_32 :
8617 NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
8618 (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
8619 def VST3qWB_fixed_Asm_8 :
8620 NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr!",
8621 (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
8622 def VST3qWB_fixed_Asm_16 :
8623 NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
8624 (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
8625 def VST3qWB_fixed_Asm_32 :
8626 NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
8627 (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
8628 def VST3dWB_register_Asm_8 :
8629 NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr, $Rm",
8630 (ins VecListThreeD:$list, addrmode6align64:$addr,
8631 rGPR:$Rm, pred:$p)>;
8632 def VST3dWB_register_Asm_16 :
8633 NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
8634 (ins VecListThreeD:$list, addrmode6align64:$addr,
8635 rGPR:$Rm, pred:$p)>;
8636 def VST3dWB_register_Asm_32 :
8637 NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
8638 (ins VecListThreeD:$list, addrmode6align64:$addr,
8639 rGPR:$Rm, pred:$p)>;
8640 def VST3qWB_register_Asm_8 :
8641 NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr, $Rm",
8642 (ins VecListThreeQ:$list, addrmode6align64:$addr,
8643 rGPR:$Rm, pred:$p)>;
8644 def VST3qWB_register_Asm_16 :
8645 NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
8646 (ins VecListThreeQ:$list, addrmode6align64:$addr,
8647 rGPR:$Rm, pred:$p)>;
8648 def VST3qWB_register_Asm_32 :
8649 NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
8650 (ins VecListThreeQ:$list, addrmode6align64:$addr,
8651 rGPR:$Rm, pred:$p)>;
8653 // VLD4 all-lanes pseudo-instructions. These need special handling for
8654 // the lane index that an InstAlias can't handle, so we use these instead.
8655 def VLD4DUPdAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
8656 (ins VecListFourDAllLanes:$list, addrmode6dupalign32:$addr,
8658 def VLD4DUPdAsm_16: NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
8659 (ins VecListFourDAllLanes:$list, addrmode6dupalign64:$addr,
8661 def VLD4DUPdAsm_32: NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
8662 (ins VecListFourDAllLanes:$list, addrmode6dupalign64or128:$addr,
8664 def VLD4DUPqAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
8665 (ins VecListFourQAllLanes:$list, addrmode6dupalign32:$addr,
8667 def VLD4DUPqAsm_16: NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
8668 (ins VecListFourQAllLanes:$list, addrmode6dupalign64:$addr,
8670 def VLD4DUPqAsm_32: NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
8671 (ins VecListFourQAllLanes:$list, addrmode6dupalign64or128:$addr,
8674 def VLD4DUPdWB_fixed_Asm_8 :
8675 NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
8676 (ins VecListFourDAllLanes:$list, addrmode6dupalign32:$addr,
8678 def VLD4DUPdWB_fixed_Asm_16 :
8679 NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
8680 (ins VecListFourDAllLanes:$list, addrmode6dupalign64:$addr,
8682 def VLD4DUPdWB_fixed_Asm_32 :
8683 NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
8684 (ins VecListFourDAllLanes:$list, addrmode6dupalign64or128:$addr,
8686 def VLD4DUPqWB_fixed_Asm_8 :
8687 NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
8688 (ins VecListFourQAllLanes:$list, addrmode6dupalign32:$addr,
8690 def VLD4DUPqWB_fixed_Asm_16 :
8691 NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
8692 (ins VecListFourQAllLanes:$list, addrmode6dupalign64:$addr,
8694 def VLD4DUPqWB_fixed_Asm_32 :
8695 NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
8696 (ins VecListFourQAllLanes:$list, addrmode6dupalign64or128:$addr,
8698 def VLD4DUPdWB_register_Asm_8 :
8699 NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
8700 (ins VecListFourDAllLanes:$list, addrmode6dupalign32:$addr,
8701 rGPR:$Rm, pred:$p)>;
8702 def VLD4DUPdWB_register_Asm_16 :
8703 NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
8704 (ins VecListFourDAllLanes:$list, addrmode6dupalign64:$addr,
8705 rGPR:$Rm, pred:$p)>;
8706 def VLD4DUPdWB_register_Asm_32 :
8707 NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
8708 (ins VecListFourDAllLanes:$list,
8709 addrmode6dupalign64or128:$addr, rGPR:$Rm, pred:$p)>;
8710 def VLD4DUPqWB_register_Asm_8 :
8711 NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
8712 (ins VecListFourQAllLanes:$list, addrmode6dupalign32:$addr,
8713 rGPR:$Rm, pred:$p)>;
8714 def VLD4DUPqWB_register_Asm_16 :
8715 NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
8716 (ins VecListFourQAllLanes:$list, addrmode6dupalign64:$addr,
8717 rGPR:$Rm, pred:$p)>;
8718 def VLD4DUPqWB_register_Asm_32 :
8719 NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
8720 (ins VecListFourQAllLanes:$list,
8721 addrmode6dupalign64or128:$addr, rGPR:$Rm, pred:$p)>;
8724 // VLD4 single-lane pseudo-instructions. These need special handling for
8725 // the lane index that an InstAlias can't handle, so we use these instead.
8726 def VLD4LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
8727 (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
8729 def VLD4LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
8730 (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
8732 def VLD4LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
8733 (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
8735 def VLD4LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
8736 (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
8738 def VLD4LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
8739 (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
8742 def VLD4LNdWB_fixed_Asm_8 :
8743 NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
8744 (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
8746 def VLD4LNdWB_fixed_Asm_16 :
8747 NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
8748 (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
8750 def VLD4LNdWB_fixed_Asm_32 :
8751 NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
8752 (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
8754 def VLD4LNqWB_fixed_Asm_16 :
8755 NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
8756 (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
8758 def VLD4LNqWB_fixed_Asm_32 :
8759 NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
8760 (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
8762 def VLD4LNdWB_register_Asm_8 :
8763 NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
8764 (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
8765 rGPR:$Rm, pred:$p)>;
8766 def VLD4LNdWB_register_Asm_16 :
8767 NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
8768 (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
8769 rGPR:$Rm, pred:$p)>;
8770 def VLD4LNdWB_register_Asm_32 :
8771 NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
8772 (ins VecListFourDWordIndexed:$list,
8773 addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
8774 def VLD4LNqWB_register_Asm_16 :
8775 NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
8776 (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
8777 rGPR:$Rm, pred:$p)>;
8778 def VLD4LNqWB_register_Asm_32 :
8779 NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
8780 (ins VecListFourQWordIndexed:$list,
8781 addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
8785 // VLD4 multiple structure pseudo-instructions. These need special handling for
8786 // the vector operands that the normal instructions don't yet model.
8787 // FIXME: Remove these when the register classes and instructions are updated.
8788 def VLD4dAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
8789 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8791 def VLD4dAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
8792 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8794 def VLD4dAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
8795 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8797 def VLD4qAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
8798 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8800 def VLD4qAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
8801 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8803 def VLD4qAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
8804 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8807 def VLD4dWB_fixed_Asm_8 :
8808 NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
8809 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8811 def VLD4dWB_fixed_Asm_16 :
8812 NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
8813 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8815 def VLD4dWB_fixed_Asm_32 :
8816 NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
8817 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8819 def VLD4qWB_fixed_Asm_8 :
8820 NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
8821 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8823 def VLD4qWB_fixed_Asm_16 :
8824 NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
8825 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8827 def VLD4qWB_fixed_Asm_32 :
8828 NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
8829 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8831 def VLD4dWB_register_Asm_8 :
8832 NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
8833 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8834 rGPR:$Rm, pred:$p)>;
8835 def VLD4dWB_register_Asm_16 :
8836 NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
8837 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8838 rGPR:$Rm, pred:$p)>;
8839 def VLD4dWB_register_Asm_32 :
8840 NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
8841 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8842 rGPR:$Rm, pred:$p)>;
8843 def VLD4qWB_register_Asm_8 :
8844 NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
8845 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8846 rGPR:$Rm, pred:$p)>;
8847 def VLD4qWB_register_Asm_16 :
8848 NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
8849 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8850 rGPR:$Rm, pred:$p)>;
8851 def VLD4qWB_register_Asm_32 :
8852 NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
8853 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8854 rGPR:$Rm, pred:$p)>;
8856 // VST4 single-lane pseudo-instructions. These need special handling for
8857 // the lane index that an InstAlias can't handle, so we use these instead.
8858 def VST4LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr",
8859 (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
8861 def VST4LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
8862 (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
8864 def VST4LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
8865 (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
8867 def VST4LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
8868 (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
8870 def VST4LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
8871 (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
8874 def VST4LNdWB_fixed_Asm_8 :
8875 NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr!",
8876 (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
8878 def VST4LNdWB_fixed_Asm_16 :
8879 NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
8880 (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
8882 def VST4LNdWB_fixed_Asm_32 :
8883 NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
8884 (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
8886 def VST4LNqWB_fixed_Asm_16 :
8887 NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
8888 (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
8890 def VST4LNqWB_fixed_Asm_32 :
8891 NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
8892 (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
8894 def VST4LNdWB_register_Asm_8 :
8895 NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr, $Rm",
8896 (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
8897 rGPR:$Rm, pred:$p)>;
8898 def VST4LNdWB_register_Asm_16 :
8899 NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
8900 (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
8901 rGPR:$Rm, pred:$p)>;
8902 def VST4LNdWB_register_Asm_32 :
8903 NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
8904 (ins VecListFourDWordIndexed:$list,
8905 addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
8906 def VST4LNqWB_register_Asm_16 :
8907 NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
8908 (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
8909 rGPR:$Rm, pred:$p)>;
8910 def VST4LNqWB_register_Asm_32 :
8911 NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
8912 (ins VecListFourQWordIndexed:$list,
8913 addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
8916 // VST4 multiple structure pseudo-instructions. These need special handling for
8917 // the vector operands that the normal instructions don't yet model.
8918 // FIXME: Remove these when the register classes and instructions are updated.
8919 def VST4dAsm_8 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr",
8920 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8922 def VST4dAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
8923 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8925 def VST4dAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
8926 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8928 def VST4qAsm_8 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr",
8929 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8931 def VST4qAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
8932 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8934 def VST4qAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
8935 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8938 def VST4dWB_fixed_Asm_8 :
8939 NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr!",
8940 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8942 def VST4dWB_fixed_Asm_16 :
8943 NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
8944 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8946 def VST4dWB_fixed_Asm_32 :
8947 NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
8948 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8950 def VST4qWB_fixed_Asm_8 :
8951 NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr!",
8952 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8954 def VST4qWB_fixed_Asm_16 :
8955 NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
8956 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8958 def VST4qWB_fixed_Asm_32 :
8959 NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
8960 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8962 def VST4dWB_register_Asm_8 :
8963 NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr, $Rm",
8964 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8965 rGPR:$Rm, pred:$p)>;
8966 def VST4dWB_register_Asm_16 :
8967 NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
8968 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8969 rGPR:$Rm, pred:$p)>;
8970 def VST4dWB_register_Asm_32 :
8971 NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
8972 (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
8973 rGPR:$Rm, pred:$p)>;
8974 def VST4qWB_register_Asm_8 :
8975 NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr, $Rm",
8976 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8977 rGPR:$Rm, pred:$p)>;
8978 def VST4qWB_register_Asm_16 :
8979 NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
8980 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8981 rGPR:$Rm, pred:$p)>;
8982 def VST4qWB_register_Asm_32 :
8983 NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
8984 (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
8985 rGPR:$Rm, pred:$p)>;
8987 // VMOV/VMVN takes an optional datatype suffix
8988 defm : NEONDTAnyInstAlias<"vmov${p}", "$Vd, $Vm",
8989 (VORRd DPR:$Vd, DPR:$Vm, DPR:$Vm, pred:$p)>;
8990 defm : NEONDTAnyInstAlias<"vmov${p}", "$Vd, $Vm",
8991 (VORRq QPR:$Vd, QPR:$Vm, QPR:$Vm, pred:$p)>;
8993 defm : NEONDTAnyInstAlias<"vmvn${p}", "$Vd, $Vm",
8994 (VMVNd DPR:$Vd, DPR:$Vm, pred:$p)>;
8995 defm : NEONDTAnyInstAlias<"vmvn${p}", "$Vd, $Vm",
8996 (VMVNq QPR:$Vd, QPR:$Vm, pred:$p)>;
8998 // VCLT (register) is an assembler alias for VCGT w/ the operands reversed.
8999 // D-register versions.
9000 def : NEONInstAlias<"vcle${p}.s8 $Dd, $Dn, $Dm",
9001 (VCGEsv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9002 def : NEONInstAlias<"vcle${p}.s16 $Dd, $Dn, $Dm",
9003 (VCGEsv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9004 def : NEONInstAlias<"vcle${p}.s32 $Dd, $Dn, $Dm",
9005 (VCGEsv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9006 def : NEONInstAlias<"vcle${p}.u8 $Dd, $Dn, $Dm",
9007 (VCGEuv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9008 def : NEONInstAlias<"vcle${p}.u16 $Dd, $Dn, $Dm",
9009 (VCGEuv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9010 def : NEONInstAlias<"vcle${p}.u32 $Dd, $Dn, $Dm",
9011 (VCGEuv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9012 def : NEONInstAlias<"vcle${p}.f32 $Dd, $Dn, $Dm",
9013 (VCGEfd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9014 let Predicates = [HasNEON, HasFullFP16] in
9015 def : NEONInstAlias<"vcle${p}.f16 $Dd, $Dn, $Dm",
9016 (VCGEhd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9017 // Q-register versions.
9018 def : NEONInstAlias<"vcle${p}.s8 $Qd, $Qn, $Qm",
9019 (VCGEsv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9020 def : NEONInstAlias<"vcle${p}.s16 $Qd, $Qn, $Qm",
9021 (VCGEsv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9022 def : NEONInstAlias<"vcle${p}.s32 $Qd, $Qn, $Qm",
9023 (VCGEsv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9024 def : NEONInstAlias<"vcle${p}.u8 $Qd, $Qn, $Qm",
9025 (VCGEuv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9026 def : NEONInstAlias<"vcle${p}.u16 $Qd, $Qn, $Qm",
9027 (VCGEuv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9028 def : NEONInstAlias<"vcle${p}.u32 $Qd, $Qn, $Qm",
9029 (VCGEuv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9030 def : NEONInstAlias<"vcle${p}.f32 $Qd, $Qn, $Qm",
9031 (VCGEfq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9032 let Predicates = [HasNEON, HasFullFP16] in
9033 def : NEONInstAlias<"vcle${p}.f16 $Qd, $Qn, $Qm",
9034 (VCGEhq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9036 // VCLT (register) is an assembler alias for VCGT w/ the operands reversed.
9037 // D-register versions.
9038 def : NEONInstAlias<"vclt${p}.s8 $Dd, $Dn, $Dm",
9039 (VCGTsv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9040 def : NEONInstAlias<"vclt${p}.s16 $Dd, $Dn, $Dm",
9041 (VCGTsv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9042 def : NEONInstAlias<"vclt${p}.s32 $Dd, $Dn, $Dm",
9043 (VCGTsv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9044 def : NEONInstAlias<"vclt${p}.u8 $Dd, $Dn, $Dm",
9045 (VCGTuv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9046 def : NEONInstAlias<"vclt${p}.u16 $Dd, $Dn, $Dm",
9047 (VCGTuv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9048 def : NEONInstAlias<"vclt${p}.u32 $Dd, $Dn, $Dm",
9049 (VCGTuv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9050 def : NEONInstAlias<"vclt${p}.f32 $Dd, $Dn, $Dm",
9051 (VCGTfd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9052 let Predicates = [HasNEON, HasFullFP16] in
9053 def : NEONInstAlias<"vclt${p}.f16 $Dd, $Dn, $Dm",
9054 (VCGThd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
9055 // Q-register versions.
9056 def : NEONInstAlias<"vclt${p}.s8 $Qd, $Qn, $Qm",
9057 (VCGTsv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9058 def : NEONInstAlias<"vclt${p}.s16 $Qd, $Qn, $Qm",
9059 (VCGTsv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9060 def : NEONInstAlias<"vclt${p}.s32 $Qd, $Qn, $Qm",
9061 (VCGTsv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9062 def : NEONInstAlias<"vclt${p}.u8 $Qd, $Qn, $Qm",
9063 (VCGTuv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9064 def : NEONInstAlias<"vclt${p}.u16 $Qd, $Qn, $Qm",
9065 (VCGTuv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9066 def : NEONInstAlias<"vclt${p}.u32 $Qd, $Qn, $Qm",
9067 (VCGTuv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9068 def : NEONInstAlias<"vclt${p}.f32 $Qd, $Qn, $Qm",
9069 (VCGTfq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9070 let Predicates = [HasNEON, HasFullFP16] in
9071 def : NEONInstAlias<"vclt${p}.f16 $Qd, $Qn, $Qm",
9072 (VCGThq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
9074 // VSWP allows, but does not require, a type suffix.
9075 defm : NEONDTAnyInstAlias<"vswp${p}", "$Vd, $Vm",
9076 (VSWPd DPR:$Vd, DPR:$Vm, pred:$p)>;
9077 defm : NEONDTAnyInstAlias<"vswp${p}", "$Vd, $Vm",
9078 (VSWPq QPR:$Vd, QPR:$Vm, pred:$p)>;
9080 // VBIF, VBIT, and VBSL allow, but do not require, a type suffix.
9081 defm : NEONDTAnyInstAlias<"vbif${p}", "$Vd, $Vn, $Vm",
9082 (VBIFd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
9083 defm : NEONDTAnyInstAlias<"vbit${p}", "$Vd, $Vn, $Vm",
9084 (VBITd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
9085 defm : NEONDTAnyInstAlias<"vbsl${p}", "$Vd, $Vn, $Vm",
9086 (VBSLd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
9087 defm : NEONDTAnyInstAlias<"vbif${p}", "$Vd, $Vn, $Vm",
9088 (VBIFq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
9089 defm : NEONDTAnyInstAlias<"vbit${p}", "$Vd, $Vn, $Vm",
9090 (VBITq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
9091 defm : NEONDTAnyInstAlias<"vbsl${p}", "$Vd, $Vn, $Vm",
9092 (VBSLq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
9094 // "vmov Rd, #-imm" can be handled via "vmvn".
9095 def : NEONInstAlias<"vmov${p}.i32 $Vd, $imm",
9096 (VMVNv2i32 DPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
9097 def : NEONInstAlias<"vmov${p}.i32 $Vd, $imm",
9098 (VMVNv4i32 QPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
9099 def : NEONInstAlias<"vmvn${p}.i32 $Vd, $imm",
9100 (VMOVv2i32 DPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
9101 def : NEONInstAlias<"vmvn${p}.i32 $Vd, $imm",
9102 (VMOVv4i32 QPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
9104 // 'gas' compatibility aliases for quad-word instructions. Strictly speaking,
9105 // these should restrict to just the Q register variants, but the register
9106 // classes are enough to match correctly regardless, so we keep it simple
9107 // and just use MnemonicAlias.
9108 def : NEONMnemonicAlias<"vbicq", "vbic">;
9109 def : NEONMnemonicAlias<"vandq", "vand">;
9110 def : NEONMnemonicAlias<"veorq", "veor">;
9111 def : NEONMnemonicAlias<"vorrq", "vorr">;
9113 def : NEONMnemonicAlias<"vmovq", "vmov">;
9114 def : NEONMnemonicAlias<"vmvnq", "vmvn">;
9115 // Explicit versions for floating point so that the FPImm variants get
9116 // handled early. The parser gets confused otherwise.
9117 def : NEONMnemonicAlias<"vmovq.f32", "vmov.f32">;
9118 def : NEONMnemonicAlias<"vmovq.f64", "vmov.f64">;
9120 def : NEONMnemonicAlias<"vaddq", "vadd">;
9121 def : NEONMnemonicAlias<"vsubq", "vsub">;
9123 def : NEONMnemonicAlias<"vminq", "vmin">;
9124 def : NEONMnemonicAlias<"vmaxq", "vmax">;
9126 def : NEONMnemonicAlias<"vmulq", "vmul">;
9128 def : NEONMnemonicAlias<"vabsq", "vabs">;
9130 def : NEONMnemonicAlias<"vshlq", "vshl">;
9131 def : NEONMnemonicAlias<"vshrq", "vshr">;
9133 def : NEONMnemonicAlias<"vcvtq", "vcvt">;
9135 def : NEONMnemonicAlias<"vcleq", "vcle">;
9136 def : NEONMnemonicAlias<"vceqq", "vceq">;
9138 def : NEONMnemonicAlias<"vzipq", "vzip">;
9139 def : NEONMnemonicAlias<"vswpq", "vswp">;
9141 def : NEONMnemonicAlias<"vrecpeq.f32", "vrecpe.f32">;
9142 def : NEONMnemonicAlias<"vrecpeq.u32", "vrecpe.u32">;
9145 // Alias for loading floating point immediates that aren't representable
9146 // using the vmov.f32 encoding but the bitpattern is representable using
9147 // the .i32 encoding.
9148 def : NEONInstAlias<"vmov${p}.f32 $Vd, $imm",
9149 (VMOVv4i32 QPR:$Vd, nImmVMOVI32:$imm, pred:$p)>;
9150 def : NEONInstAlias<"vmov${p}.f32 $Vd, $imm",
9151 (VMOVv2i32 DPR:$Vd, nImmVMOVI32:$imm, pred:$p)>;
9153 // ARMv8.6a BFloat16 instructions.
9154 let Predicates = [HasBF16, HasNEON] in {
9155 class BF16VDOT<bits<5> op27_23, bits<2> op21_20, bit op6,
9156 dag oops, dag iops, list<dag> pattern>
9157 : N3Vnp<op27_23, op21_20, 0b1101, op6, 0, oops, iops,
9158 N3RegFrm, IIC_VDOTPROD, "", "", pattern>
9160 let DecoderNamespace = "VFPV8";
9163 class BF16VDOTS<bit Q, RegisterClass RegTy, string opc, ValueType AccumTy, ValueType InputTy>
9164 : BF16VDOT<0b11000, 0b00, Q, (outs RegTy:$dst),
9165 (ins RegTy:$Vd, RegTy:$Vn, RegTy:$Vm),
9166 [(set (AccumTy RegTy:$dst),
9167 (int_arm_neon_bfdot (AccumTy RegTy:$Vd),
9168 (InputTy RegTy:$Vn),
9169 (InputTy RegTy:$Vm)))]> {
9170 let Constraints = "$dst = $Vd";
9171 let AsmString = !strconcat(opc, ".bf16", "\t$Vd, $Vn, $Vm");
9172 let DecoderNamespace = "VFPV8";
9175 multiclass BF16VDOTI<bit Q, RegisterClass RegTy, string opc, ValueType AccumTy,
9176 ValueType InputTy, dag RHS> {
9178 def "" : BF16VDOT<0b11100, 0b00, Q, (outs RegTy:$dst),
9179 (ins RegTy:$Vd, RegTy:$Vn,
9180 DPR_VFP2:$Vm, VectorIndex32:$lane), []> {
9183 let Constraints = "$dst = $Vd";
9184 let AsmString = !strconcat(opc, ".bf16", "\t$Vd, $Vn, $Vm$lane");
9185 let DecoderNamespace = "VFPV8";
9189 (AccumTy (int_arm_neon_bfdot (AccumTy RegTy:$Vd),
9190 (InputTy RegTy:$Vn),
9191 (InputTy (bitconvert (AccumTy
9192 (ARMvduplane (AccumTy RegTy:$Vm),
9193 VectorIndex32:$lane)))))),
9194 (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
9197 def BF16VDOTS_VDOTD : BF16VDOTS<0, DPR, "vdot", v2f32, v4bf16>;
9198 def BF16VDOTS_VDOTQ : BF16VDOTS<1, QPR, "vdot", v4f32, v8bf16>;
9200 defm BF16VDOTI_VDOTD : BF16VDOTI<0, DPR, "vdot", v2f32, v4bf16, (v2f32 DPR_VFP2:$Vm)>;
9201 defm BF16VDOTI_VDOTQ : BF16VDOTI<1, QPR, "vdot", v4f32, v8bf16, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
9203 class BF16MM<bit Q, RegisterClass RegTy,
9205 : N3Vnp<0b11000, 0b00, 0b1100, Q, 0,
9206 (outs RegTy:$dst), (ins RegTy:$Vd, RegTy:$Vn, RegTy:$Vm),
9207 N3RegFrm, IIC_VDOTPROD, "", "",
9208 [(set (v4f32 QPR:$dst), (int_arm_neon_bfmmla (v4f32 QPR:$Vd),
9210 (v8bf16 QPR:$Vm)))]> {
9211 let Constraints = "$dst = $Vd";
9212 let AsmString = !strconcat(opc, ".bf16", "\t$Vd, $Vn, $Vm");
9213 let DecoderNamespace = "VFPV8";
9216 def VMMLA : BF16MM<1, QPR, "vmmla">;
9218 class VBF16MALQ<bit T, string suffix, SDPatternOperator OpNode>
9219 : N3VCP8<0b00, 0b11, T, 1,
9220 (outs QPR:$dst), (ins QPR:$Vd, QPR:$Vn, QPR:$Vm),
9221 NoItinerary, "vfma" # suffix, "bf16", "$Vd, $Vn, $Vm", "",
9222 [(set (v4f32 QPR:$dst),
9223 (OpNode (v4f32 QPR:$Vd),
9225 (v8bf16 QPR:$Vm)))]> {
9226 let Constraints = "$dst = $Vd";
9227 let DecoderNamespace = "VFPV8";
9230 def VBF16MALTQ: VBF16MALQ<1, "t", int_arm_neon_bfmlalt>;
9231 def VBF16MALBQ: VBF16MALQ<0, "b", int_arm_neon_bfmlalb>;
9233 multiclass VBF16MALQI<bit T, string suffix, SDPatternOperator OpNode> {
9234 def "" : N3VLaneCP8<0, 0b11, T, 1, (outs QPR:$dst),
9235 (ins QPR:$Vd, QPR:$Vn, DPR_8:$Vm, VectorIndex16:$idx),
9236 IIC_VMACD, "vfma" # suffix, "bf16", "$Vd, $Vn, $Vm$idx", "", []> {
9238 let Inst{5} = idx{1};
9239 let Inst{3} = idx{0};
9240 let Constraints = "$dst = $Vd";
9241 let DecoderNamespace = "VFPV8";
9245 (v4f32 (OpNode (v4f32 QPR:$Vd),
9247 (v8bf16 (ARMvduplane (v8bf16 QPR:$Vm),
9248 VectorIndex16:$lane)))),
9249 (!cast<Instruction>(NAME) QPR:$Vd,
9251 (EXTRACT_SUBREG QPR:$Vm,
9252 (DSubReg_i16_reg VectorIndex16:$lane)),
9253 (SubReg_i16_lane VectorIndex16:$lane))>;
9256 defm VBF16MALTQI: VBF16MALQI<1, "t", int_arm_neon_bfmlalt>;
9257 defm VBF16MALBQI: VBF16MALQI<0, "b", int_arm_neon_bfmlalb>;
9259 def BF16_VCVT : N2V<0b11, 0b11, 0b01, 0b10, 0b01100, 1, 0,
9260 (outs DPR:$Vd), (ins QPR:$Vm),
9261 NoItinerary, "vcvt", "bf16.f32", "$Vd, $Vm", "", []>;
9263 // End of BFloat16 instructions