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)->getAlignment() >= 8;
444 def dword_alignedstore : PatFrag<(ops node:$val, node:$ptr),
445 (store node:$val, node:$ptr), [{
446 return cast<StoreSDNode>(N)->getAlignment() >= 8;
448 def word_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
449 return cast<LoadSDNode>(N)->getAlignment() == 4;
451 def word_alignedstore : PatFrag<(ops node:$val, node:$ptr),
452 (store node:$val, node:$ptr), [{
453 return cast<StoreSDNode>(N)->getAlignment() == 4;
455 def hword_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
456 return cast<LoadSDNode>(N)->getAlignment() == 2;
458 def hword_alignedstore : PatFrag<(ops node:$val, node:$ptr),
459 (store node:$val, node:$ptr), [{
460 return cast<StoreSDNode>(N)->getAlignment() == 2;
462 def byte_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
463 return cast<LoadSDNode>(N)->getAlignment() == 1;
465 def byte_alignedstore : PatFrag<(ops node:$val, node:$ptr),
466 (store node:$val, node:$ptr), [{
467 return cast<StoreSDNode>(N)->getAlignment() == 1;
469 def non_word_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
470 return cast<LoadSDNode>(N)->getAlignment() < 4;
472 def non_word_alignedstore : PatFrag<(ops node:$val, node:$ptr),
473 (store node:$val, node:$ptr), [{
474 return cast<StoreSDNode>(N)->getAlignment() < 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 def VLD2DUPq8EvenPseudo : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1495 def VLD2DUPq8OddPseudo : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1496 def VLD2DUPq16EvenPseudo : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1497 def VLD2DUPq16OddPseudo : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1498 def VLD2DUPq32EvenPseudo : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1499 def VLD2DUPq32OddPseudo : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1501 // ...with address register writeback:
1502 multiclass VLD2DUPWB<bits<4> op7_4, string Dt, RegisterOperand VdTy,
1504 def _fixed : NLdSt<1, 0b10, 0b1101, op7_4,
1505 (outs VdTy:$Vd, GPR:$wb),
1506 (ins AddrMode:$Rn), IIC_VLD2dupu,
1507 "vld2", Dt, "$Vd, $Rn!",
1508 "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
1509 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1510 let Inst{4} = Rn{4};
1511 let DecoderMethod = "DecodeVLD2DupInstruction";
1513 def _register : NLdSt<1, 0b10, 0b1101, op7_4,
1514 (outs VdTy:$Vd, GPR:$wb),
1515 (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD2dupu,
1516 "vld2", Dt, "$Vd, $Rn, $Rm",
1517 "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
1518 let Inst{4} = Rn{4};
1519 let DecoderMethod = "DecodeVLD2DupInstruction";
1523 defm VLD2DUPd8wb : VLD2DUPWB<{0,0,0,0}, "8", VecListDPairAllLanes,
1524 addrmode6dupalign16>;
1525 defm VLD2DUPd16wb : VLD2DUPWB<{0,1,0,?}, "16", VecListDPairAllLanes,
1526 addrmode6dupalign32>;
1527 defm VLD2DUPd32wb : VLD2DUPWB<{1,0,0,?}, "32", VecListDPairAllLanes,
1528 addrmode6dupalign64>;
1530 defm VLD2DUPd8x2wb : VLD2DUPWB<{0,0,1,0}, "8", VecListDPairSpacedAllLanes,
1531 addrmode6dupalign16>;
1532 defm VLD2DUPd16x2wb : VLD2DUPWB<{0,1,1,?}, "16", VecListDPairSpacedAllLanes,
1533 addrmode6dupalign32>;
1534 defm VLD2DUPd32x2wb : VLD2DUPWB<{1,0,1,?}, "32", VecListDPairSpacedAllLanes,
1535 addrmode6dupalign64>;
1537 def VLD2DUPq8OddPseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1538 def VLD2DUPq16OddPseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1539 def VLD2DUPq32OddPseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1540 def VLD2DUPq8OddPseudoWB_register : VLDQQWBPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1541 def VLD2DUPq16OddPseudoWB_register : VLDQQWBPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1542 def VLD2DUPq32OddPseudoWB_register : VLDQQWBPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1544 // VLD3DUP : Vector Load (single 3-element structure to all lanes)
1545 class VLD3DUP<bits<4> op7_4, string Dt>
1546 : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
1547 (ins addrmode6dup:$Rn), IIC_VLD3dup,
1548 "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn", "", []>,
1549 Sched<[WriteVLD2]> {
1552 let DecoderMethod = "DecodeVLD3DupInstruction";
1555 def VLD3DUPd8 : VLD3DUP<{0,0,0,?}, "8">;
1556 def VLD3DUPd16 : VLD3DUP<{0,1,0,?}, "16">;
1557 def VLD3DUPd32 : VLD3DUP<{1,0,0,?}, "32">;
1559 def VLD3DUPd8Pseudo : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1560 def VLD3DUPd16Pseudo : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1561 def VLD3DUPd32Pseudo : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1563 // ...with double-spaced registers (not used for codegen):
1564 def VLD3DUPq8 : VLD3DUP<{0,0,1,?}, "8">;
1565 def VLD3DUPq16 : VLD3DUP<{0,1,1,?}, "16">;
1566 def VLD3DUPq32 : VLD3DUP<{1,0,1,?}, "32">;
1568 def VLD3DUPq8EvenPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1569 def VLD3DUPq8OddPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1570 def VLD3DUPq16EvenPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1571 def VLD3DUPq16OddPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1572 def VLD3DUPq32EvenPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1573 def VLD3DUPq32OddPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
1575 // ...with address register writeback:
1576 class VLD3DUPWB<bits<4> op7_4, string Dt, Operand AddrMode>
1577 : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
1578 (ins AddrMode:$Rn, am6offset:$Rm), IIC_VLD3dupu,
1579 "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn$Rm",
1580 "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
1582 let DecoderMethod = "DecodeVLD3DupInstruction";
1585 def VLD3DUPd8_UPD : VLD3DUPWB<{0,0,0,0}, "8", addrmode6dupalign64>;
1586 def VLD3DUPd16_UPD : VLD3DUPWB<{0,1,0,?}, "16", addrmode6dupalign64>;
1587 def VLD3DUPd32_UPD : VLD3DUPWB<{1,0,0,?}, "32", addrmode6dupalign64>;
1589 def VLD3DUPq8_UPD : VLD3DUPWB<{0,0,1,0}, "8", addrmode6dupalign64>;
1590 def VLD3DUPq16_UPD : VLD3DUPWB<{0,1,1,?}, "16", addrmode6dupalign64>;
1591 def VLD3DUPq32_UPD : VLD3DUPWB<{1,0,1,?}, "32", addrmode6dupalign64>;
1593 def VLD3DUPd8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1594 def VLD3DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1595 def VLD3DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1597 def VLD3DUPq8OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1598 def VLD3DUPq16OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1599 def VLD3DUPq32OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1601 // VLD4DUP : Vector Load (single 4-element structure to all lanes)
1602 class VLD4DUP<bits<4> op7_4, string Dt>
1603 : NLdSt<1, 0b10, 0b1111, op7_4,
1604 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
1605 (ins addrmode6dup:$Rn), IIC_VLD4dup,
1606 "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn", "", []> {
1608 let Inst{4} = Rn{4};
1609 let DecoderMethod = "DecodeVLD4DupInstruction";
1612 def VLD4DUPd8 : VLD4DUP<{0,0,0,?}, "8">;
1613 def VLD4DUPd16 : VLD4DUP<{0,1,0,?}, "16">;
1614 def VLD4DUPd32 : VLD4DUP<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
1616 def VLD4DUPd8Pseudo : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1617 def VLD4DUPd16Pseudo : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1618 def VLD4DUPd32Pseudo : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1620 // ...with double-spaced registers (not used for codegen):
1621 def VLD4DUPq8 : VLD4DUP<{0,0,1,?}, "8">;
1622 def VLD4DUPq16 : VLD4DUP<{0,1,1,?}, "16">;
1623 def VLD4DUPq32 : VLD4DUP<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
1625 def VLD4DUPq8EvenPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1626 def VLD4DUPq8OddPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1627 def VLD4DUPq16EvenPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1628 def VLD4DUPq16OddPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1629 def VLD4DUPq32EvenPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1630 def VLD4DUPq32OddPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
1632 // ...with address register writeback:
1633 class VLD4DUPWB<bits<4> op7_4, string Dt>
1634 : NLdSt<1, 0b10, 0b1111, op7_4,
1635 (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
1636 (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD4dupu,
1637 "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn$Rm",
1638 "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
1639 let Inst{4} = Rn{4};
1640 let DecoderMethod = "DecodeVLD4DupInstruction";
1643 def VLD4DUPd8_UPD : VLD4DUPWB<{0,0,0,0}, "8">;
1644 def VLD4DUPd16_UPD : VLD4DUPWB<{0,1,0,?}, "16">;
1645 def VLD4DUPd32_UPD : VLD4DUPWB<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
1647 def VLD4DUPq8_UPD : VLD4DUPWB<{0,0,1,0}, "8">;
1648 def VLD4DUPq16_UPD : VLD4DUPWB<{0,1,1,?}, "16">;
1649 def VLD4DUPq32_UPD : VLD4DUPWB<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
1651 def VLD4DUPd8Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1652 def VLD4DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1653 def VLD4DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1655 def VLD4DUPq8OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1656 def VLD4DUPq16OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1657 def VLD4DUPq32OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1659 } // mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1
1661 let mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1 in {
1663 // Classes for VST* pseudo-instructions with multi-register operands.
1664 // These are expanded to real instructions after register allocation.
1665 class VSTQPseudo<InstrItinClass itin>
1666 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src), itin, "">;
1667 class VSTQWBPseudo<InstrItinClass itin>
1668 : PseudoNLdSt<(outs GPR:$wb),
1669 (ins addrmode6:$addr, am6offset:$offset, QPR:$src), itin,
1670 "$addr.addr = $wb">;
1671 class VSTQWBfixedPseudo<InstrItinClass itin>
1672 : PseudoNLdSt<(outs GPR:$wb),
1673 (ins addrmode6:$addr, QPR:$src), itin,
1674 "$addr.addr = $wb">;
1675 class VSTQWBregisterPseudo<InstrItinClass itin>
1676 : PseudoNLdSt<(outs GPR:$wb),
1677 (ins addrmode6:$addr, rGPR:$offset, QPR:$src), itin,
1678 "$addr.addr = $wb">;
1679 class VSTQQPseudo<InstrItinClass itin>
1680 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src), itin, "">;
1681 class VSTQQWBPseudo<InstrItinClass itin>
1682 : PseudoNLdSt<(outs GPR:$wb),
1683 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src), itin,
1684 "$addr.addr = $wb">;
1685 class VSTQQWBfixedPseudo<InstrItinClass itin>
1686 : PseudoNLdSt<(outs GPR:$wb),
1687 (ins addrmode6:$addr, QQPR:$src), itin,
1688 "$addr.addr = $wb">;
1689 class VSTQQWBregisterPseudo<InstrItinClass itin>
1690 : PseudoNLdSt<(outs GPR:$wb),
1691 (ins addrmode6:$addr, rGPR:$offset, QQPR:$src), itin,
1692 "$addr.addr = $wb">;
1694 class VSTQQQQPseudo<InstrItinClass itin>
1695 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src), itin, "">;
1696 class VSTQQQQWBPseudo<InstrItinClass itin>
1697 : PseudoNLdSt<(outs GPR:$wb),
1698 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
1699 "$addr.addr = $wb">;
1701 // VST1 : Vector Store (multiple single elements)
1702 class VST1D<bits<4> op7_4, string Dt, Operand AddrMode>
1703 : NLdSt<0,0b00,0b0111,op7_4, (outs), (ins AddrMode:$Rn, VecListOneD:$Vd),
1704 IIC_VST1, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST1]> {
1706 let Inst{4} = Rn{4};
1707 let DecoderMethod = "DecodeVLDST1Instruction";
1709 class VST1Q<bits<4> op7_4, string Dt, Operand AddrMode>
1710 : NLdSt<0,0b00,0b1010,op7_4, (outs), (ins AddrMode:$Rn, VecListDPair:$Vd),
1711 IIC_VST1x2, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST2]> {
1713 let Inst{5-4} = Rn{5-4};
1714 let DecoderMethod = "DecodeVLDST1Instruction";
1717 def VST1d8 : VST1D<{0,0,0,?}, "8", addrmode6align64>;
1718 def VST1d16 : VST1D<{0,1,0,?}, "16", addrmode6align64>;
1719 def VST1d32 : VST1D<{1,0,0,?}, "32", addrmode6align64>;
1720 def VST1d64 : VST1D<{1,1,0,?}, "64", addrmode6align64>;
1722 def VST1q8 : VST1Q<{0,0,?,?}, "8", addrmode6align64or128>;
1723 def VST1q16 : VST1Q<{0,1,?,?}, "16", addrmode6align64or128>;
1724 def VST1q32 : VST1Q<{1,0,?,?}, "32", addrmode6align64or128>;
1725 def VST1q64 : VST1Q<{1,1,?,?}, "64", addrmode6align64or128>;
1727 // ...with address register writeback:
1728 multiclass VST1DWB<bits<4> op7_4, string Dt, Operand AddrMode> {
1729 def _fixed : NLdSt<0,0b00, 0b0111,op7_4, (outs GPR:$wb),
1730 (ins AddrMode:$Rn, VecListOneD:$Vd), IIC_VLD1u,
1731 "vst1", Dt, "$Vd, $Rn!",
1732 "$Rn.addr = $wb", []>, Sched<[WriteVST1]> {
1733 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1734 let Inst{4} = Rn{4};
1735 let DecoderMethod = "DecodeVLDST1Instruction";
1737 def _register : NLdSt<0,0b00,0b0111,op7_4, (outs GPR:$wb),
1738 (ins AddrMode:$Rn, rGPR:$Rm, VecListOneD:$Vd),
1740 "vst1", Dt, "$Vd, $Rn, $Rm",
1741 "$Rn.addr = $wb", []>, Sched<[WriteVST1]> {
1742 let Inst{4} = Rn{4};
1743 let DecoderMethod = "DecodeVLDST1Instruction";
1746 multiclass VST1QWB<bits<4> op7_4, string Dt, Operand AddrMode> {
1747 def _fixed : NLdSt<0,0b00,0b1010,op7_4, (outs GPR:$wb),
1748 (ins AddrMode:$Rn, VecListDPair:$Vd), IIC_VLD1x2u,
1749 "vst1", Dt, "$Vd, $Rn!",
1750 "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
1751 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1752 let Inst{5-4} = Rn{5-4};
1753 let DecoderMethod = "DecodeVLDST1Instruction";
1755 def _register : NLdSt<0,0b00,0b1010,op7_4, (outs GPR:$wb),
1756 (ins AddrMode:$Rn, rGPR:$Rm, VecListDPair:$Vd),
1758 "vst1", Dt, "$Vd, $Rn, $Rm",
1759 "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
1760 let Inst{5-4} = Rn{5-4};
1761 let DecoderMethod = "DecodeVLDST1Instruction";
1765 defm VST1d8wb : VST1DWB<{0,0,0,?}, "8", addrmode6align64>;
1766 defm VST1d16wb : VST1DWB<{0,1,0,?}, "16", addrmode6align64>;
1767 defm VST1d32wb : VST1DWB<{1,0,0,?}, "32", addrmode6align64>;
1768 defm VST1d64wb : VST1DWB<{1,1,0,?}, "64", addrmode6align64>;
1770 defm VST1q8wb : VST1QWB<{0,0,?,?}, "8", addrmode6align64or128>;
1771 defm VST1q16wb : VST1QWB<{0,1,?,?}, "16", addrmode6align64or128>;
1772 defm VST1q32wb : VST1QWB<{1,0,?,?}, "32", addrmode6align64or128>;
1773 defm VST1q64wb : VST1QWB<{1,1,?,?}, "64", addrmode6align64or128>;
1775 // ...with 3 registers
1776 class VST1D3<bits<4> op7_4, string Dt, Operand AddrMode>
1777 : NLdSt<0, 0b00, 0b0110, op7_4, (outs),
1778 (ins AddrMode:$Rn, VecListThreeD:$Vd),
1779 IIC_VST1x3, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST3]> {
1781 let Inst{4} = Rn{4};
1782 let DecoderMethod = "DecodeVLDST1Instruction";
1784 multiclass VST1D3WB<bits<4> op7_4, string Dt, Operand AddrMode> {
1785 def _fixed : NLdSt<0,0b00,0b0110,op7_4, (outs GPR:$wb),
1786 (ins AddrMode:$Rn, VecListThreeD:$Vd), IIC_VLD1x3u,
1787 "vst1", Dt, "$Vd, $Rn!",
1788 "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
1789 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1790 let Inst{5-4} = Rn{5-4};
1791 let DecoderMethod = "DecodeVLDST1Instruction";
1793 def _register : NLdSt<0,0b00,0b0110,op7_4, (outs GPR:$wb),
1794 (ins AddrMode:$Rn, rGPR:$Rm, VecListThreeD:$Vd),
1796 "vst1", Dt, "$Vd, $Rn, $Rm",
1797 "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
1798 let Inst{5-4} = Rn{5-4};
1799 let DecoderMethod = "DecodeVLDST1Instruction";
1803 def VST1d8T : VST1D3<{0,0,0,?}, "8", addrmode6align64>;
1804 def VST1d16T : VST1D3<{0,1,0,?}, "16", addrmode6align64>;
1805 def VST1d32T : VST1D3<{1,0,0,?}, "32", addrmode6align64>;
1806 def VST1d64T : VST1D3<{1,1,0,?}, "64", addrmode6align64>;
1808 defm VST1d8Twb : VST1D3WB<{0,0,0,?}, "8", addrmode6align64>;
1809 defm VST1d16Twb : VST1D3WB<{0,1,0,?}, "16", addrmode6align64>;
1810 defm VST1d32Twb : VST1D3WB<{1,0,0,?}, "32", addrmode6align64>;
1811 defm VST1d64Twb : VST1D3WB<{1,1,0,?}, "64", addrmode6align64>;
1813 def VST1d8TPseudo : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1814 def VST1d8TPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1815 def VST1d8TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1816 def VST1d16TPseudo : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1817 def VST1d16TPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1818 def VST1d16TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1819 def VST1d32TPseudo : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1820 def VST1d32TPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1821 def VST1d32TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1822 def VST1d64TPseudo : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1823 def VST1d64TPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1824 def VST1d64TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1826 def VST1q8HighTPseudo : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1827 def VST1q16HighTPseudo : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1828 def VST1q32HighTPseudo : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1829 def VST1q64HighTPseudo : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1831 def VST1q8HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1832 def VST1q16HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1833 def VST1q32HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1834 def VST1q64HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1836 def VST1q8LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1837 def VST1q16LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1838 def VST1q32LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1839 def VST1q64LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1841 // ...with 4 registers
1842 class VST1D4<bits<4> op7_4, string Dt, Operand AddrMode>
1843 : NLdSt<0, 0b00, 0b0010, op7_4, (outs),
1844 (ins AddrMode:$Rn, VecListFourD:$Vd),
1845 IIC_VST1x4, "vst1", Dt, "$Vd, $Rn", "",
1846 []>, Sched<[WriteVST4]> {
1848 let Inst{5-4} = Rn{5-4};
1849 let DecoderMethod = "DecodeVLDST1Instruction";
1851 multiclass VST1D4WB<bits<4> op7_4, string Dt, Operand AddrMode> {
1852 def _fixed : NLdSt<0,0b00,0b0010,op7_4, (outs GPR:$wb),
1853 (ins AddrMode:$Rn, VecListFourD:$Vd), IIC_VLD1x4u,
1854 "vst1", Dt, "$Vd, $Rn!",
1855 "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
1856 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1857 let Inst{5-4} = Rn{5-4};
1858 let DecoderMethod = "DecodeVLDST1Instruction";
1860 def _register : NLdSt<0,0b00,0b0010,op7_4, (outs GPR:$wb),
1861 (ins AddrMode:$Rn, rGPR:$Rm, VecListFourD:$Vd),
1863 "vst1", Dt, "$Vd, $Rn, $Rm",
1864 "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
1865 let Inst{5-4} = Rn{5-4};
1866 let DecoderMethod = "DecodeVLDST1Instruction";
1870 def VST1d8Q : VST1D4<{0,0,?,?}, "8", addrmode6align64or128or256>;
1871 def VST1d16Q : VST1D4<{0,1,?,?}, "16", addrmode6align64or128or256>;
1872 def VST1d32Q : VST1D4<{1,0,?,?}, "32", addrmode6align64or128or256>;
1873 def VST1d64Q : VST1D4<{1,1,?,?}, "64", addrmode6align64or128or256>;
1875 defm VST1d8Qwb : VST1D4WB<{0,0,?,?}, "8", addrmode6align64or128or256>;
1876 defm VST1d16Qwb : VST1D4WB<{0,1,?,?}, "16", addrmode6align64or128or256>;
1877 defm VST1d32Qwb : VST1D4WB<{1,0,?,?}, "32", addrmode6align64or128or256>;
1878 defm VST1d64Qwb : VST1D4WB<{1,1,?,?}, "64", addrmode6align64or128or256>;
1880 def VST1d8QPseudo : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1881 def VST1d8QPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1882 def VST1d8QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1883 def VST1d16QPseudo : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1884 def VST1d16QPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1885 def VST1d16QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1886 def VST1d32QPseudo : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1887 def VST1d32QPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1888 def VST1d32QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1889 def VST1d64QPseudo : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1890 def VST1d64QPseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1891 def VST1d64QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1893 def VST1q8HighQPseudo : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1894 def VST1q16HighQPseudo : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1895 def VST1q32HighQPseudo : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1896 def VST1q64HighQPseudo : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1898 def VST1q8HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1899 def VST1q16HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1900 def VST1q32HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1901 def VST1q64HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1903 def VST1q8LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1904 def VST1q16LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1905 def VST1q32LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1906 def VST1q64LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1908 // VST2 : Vector Store (multiple 2-element structures)
1909 class VST2<bits<4> op11_8, bits<4> op7_4, string Dt, RegisterOperand VdTy,
1910 InstrItinClass itin, Operand AddrMode>
1911 : NLdSt<0, 0b00, op11_8, op7_4, (outs), (ins AddrMode:$Rn, VdTy:$Vd),
1912 itin, "vst2", Dt, "$Vd, $Rn", "", []> {
1914 let Inst{5-4} = Rn{5-4};
1915 let DecoderMethod = "DecodeVLDST2Instruction";
1918 def VST2d8 : VST2<0b1000, {0,0,?,?}, "8", VecListDPair, IIC_VST2,
1919 addrmode6align64or128>, Sched<[WriteVST2]>;
1920 def VST2d16 : VST2<0b1000, {0,1,?,?}, "16", VecListDPair, IIC_VST2,
1921 addrmode6align64or128>, Sched<[WriteVST2]>;
1922 def VST2d32 : VST2<0b1000, {1,0,?,?}, "32", VecListDPair, IIC_VST2,
1923 addrmode6align64or128>, Sched<[WriteVST2]>;
1925 def VST2q8 : VST2<0b0011, {0,0,?,?}, "8", VecListFourD, IIC_VST2x2,
1926 addrmode6align64or128or256>, Sched<[WriteVST4]>;
1927 def VST2q16 : VST2<0b0011, {0,1,?,?}, "16", VecListFourD, IIC_VST2x2,
1928 addrmode6align64or128or256>, Sched<[WriteVST4]>;
1929 def VST2q32 : VST2<0b0011, {1,0,?,?}, "32", VecListFourD, IIC_VST2x2,
1930 addrmode6align64or128or256>, Sched<[WriteVST4]>;
1932 def VST2q8Pseudo : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
1933 def VST2q16Pseudo : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
1934 def VST2q32Pseudo : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
1936 // ...with address register writeback:
1937 multiclass VST2DWB<bits<4> op11_8, bits<4> op7_4, string Dt,
1938 RegisterOperand VdTy, Operand AddrMode> {
1939 def _fixed : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1940 (ins AddrMode:$Rn, VdTy:$Vd), IIC_VLD1u,
1941 "vst2", Dt, "$Vd, $Rn!",
1942 "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
1943 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1944 let Inst{5-4} = Rn{5-4};
1945 let DecoderMethod = "DecodeVLDST2Instruction";
1947 def _register : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
1948 (ins AddrMode:$Rn, rGPR:$Rm, VdTy:$Vd), IIC_VLD1u,
1949 "vst2", Dt, "$Vd, $Rn, $Rm",
1950 "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
1951 let Inst{5-4} = Rn{5-4};
1952 let DecoderMethod = "DecodeVLDST2Instruction";
1955 multiclass VST2QWB<bits<4> op7_4, string Dt, Operand AddrMode> {
1956 def _fixed : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
1957 (ins AddrMode:$Rn, VecListFourD:$Vd), IIC_VLD1u,
1958 "vst2", Dt, "$Vd, $Rn!",
1959 "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
1960 let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
1961 let Inst{5-4} = Rn{5-4};
1962 let DecoderMethod = "DecodeVLDST2Instruction";
1964 def _register : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
1965 (ins AddrMode:$Rn, rGPR:$Rm, VecListFourD:$Vd),
1967 "vst2", Dt, "$Vd, $Rn, $Rm",
1968 "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
1969 let Inst{5-4} = Rn{5-4};
1970 let DecoderMethod = "DecodeVLDST2Instruction";
1974 defm VST2d8wb : VST2DWB<0b1000, {0,0,?,?}, "8", VecListDPair,
1975 addrmode6align64or128>;
1976 defm VST2d16wb : VST2DWB<0b1000, {0,1,?,?}, "16", VecListDPair,
1977 addrmode6align64or128>;
1978 defm VST2d32wb : VST2DWB<0b1000, {1,0,?,?}, "32", VecListDPair,
1979 addrmode6align64or128>;
1981 defm VST2q8wb : VST2QWB<{0,0,?,?}, "8", addrmode6align64or128or256>;
1982 defm VST2q16wb : VST2QWB<{0,1,?,?}, "16", addrmode6align64or128or256>;
1983 defm VST2q32wb : VST2QWB<{1,0,?,?}, "32", addrmode6align64or128or256>;
1985 def VST2q8PseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
1986 def VST2q16PseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
1987 def VST2q32PseudoWB_fixed : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
1988 def VST2q8PseudoWB_register : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
1989 def VST2q16PseudoWB_register : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
1990 def VST2q32PseudoWB_register : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
1992 // ...with double-spaced registers
1993 def VST2b8 : VST2<0b1001, {0,0,?,?}, "8", VecListDPairSpaced, IIC_VST2,
1994 addrmode6align64or128>;
1995 def VST2b16 : VST2<0b1001, {0,1,?,?}, "16", VecListDPairSpaced, IIC_VST2,
1996 addrmode6align64or128>;
1997 def VST2b32 : VST2<0b1001, {1,0,?,?}, "32", VecListDPairSpaced, IIC_VST2,
1998 addrmode6align64or128>;
1999 defm VST2b8wb : VST2DWB<0b1001, {0,0,?,?}, "8", VecListDPairSpaced,
2000 addrmode6align64or128>;
2001 defm VST2b16wb : VST2DWB<0b1001, {0,1,?,?}, "16", VecListDPairSpaced,
2002 addrmode6align64or128>;
2003 defm VST2b32wb : VST2DWB<0b1001, {1,0,?,?}, "32", VecListDPairSpaced,
2004 addrmode6align64or128>;
2006 // VST3 : Vector Store (multiple 3-element structures)
2007 class VST3D<bits<4> op11_8, bits<4> op7_4, string Dt>
2008 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
2009 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3,
2010 "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn", "", []>, Sched<[WriteVST3]> {
2012 let Inst{4} = Rn{4};
2013 let DecoderMethod = "DecodeVLDST3Instruction";
2016 def VST3d8 : VST3D<0b0100, {0,0,0,?}, "8">;
2017 def VST3d16 : VST3D<0b0100, {0,1,0,?}, "16">;
2018 def VST3d32 : VST3D<0b0100, {1,0,0,?}, "32">;
2020 def VST3d8Pseudo : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
2021 def VST3d16Pseudo : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
2022 def VST3d32Pseudo : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
2024 // ...with address register writeback:
2025 class VST3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
2026 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
2027 (ins addrmode6:$Rn, am6offset:$Rm,
2028 DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3u,
2029 "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn$Rm",
2030 "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
2031 let Inst{4} = Rn{4};
2032 let DecoderMethod = "DecodeVLDST3Instruction";
2035 def VST3d8_UPD : VST3DWB<0b0100, {0,0,0,?}, "8">;
2036 def VST3d16_UPD : VST3DWB<0b0100, {0,1,0,?}, "16">;
2037 def VST3d32_UPD : VST3DWB<0b0100, {1,0,0,?}, "32">;
2039 def VST3d8Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2040 def VST3d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2041 def VST3d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2043 // ...with double-spaced registers:
2044 def VST3q8 : VST3D<0b0101, {0,0,0,?}, "8">;
2045 def VST3q16 : VST3D<0b0101, {0,1,0,?}, "16">;
2046 def VST3q32 : VST3D<0b0101, {1,0,0,?}, "32">;
2047 def VST3q8_UPD : VST3DWB<0b0101, {0,0,0,?}, "8">;
2048 def VST3q16_UPD : VST3DWB<0b0101, {0,1,0,?}, "16">;
2049 def VST3q32_UPD : VST3DWB<0b0101, {1,0,0,?}, "32">;
2051 def VST3q8Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2052 def VST3q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2053 def VST3q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2055 // ...alternate versions to be allocated odd register numbers:
2056 def VST3q8oddPseudo : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
2057 def VST3q16oddPseudo : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
2058 def VST3q32oddPseudo : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
2060 def VST3q8oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2061 def VST3q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2062 def VST3q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
2064 // VST4 : Vector Store (multiple 4-element structures)
2065 class VST4D<bits<4> op11_8, bits<4> op7_4, string Dt>
2066 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
2067 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
2068 IIC_VST4, "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn",
2069 "", []>, Sched<[WriteVST4]> {
2071 let Inst{5-4} = Rn{5-4};
2072 let DecoderMethod = "DecodeVLDST4Instruction";
2075 def VST4d8 : VST4D<0b0000, {0,0,?,?}, "8">;
2076 def VST4d16 : VST4D<0b0000, {0,1,?,?}, "16">;
2077 def VST4d32 : VST4D<0b0000, {1,0,?,?}, "32">;
2079 def VST4d8Pseudo : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
2080 def VST4d16Pseudo : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
2081 def VST4d32Pseudo : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
2083 // ...with address register writeback:
2084 class VST4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
2085 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
2086 (ins addrmode6:$Rn, am6offset:$Rm,
2087 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST4u,
2088 "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
2089 "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
2090 let Inst{5-4} = Rn{5-4};
2091 let DecoderMethod = "DecodeVLDST4Instruction";
2094 def VST4d8_UPD : VST4DWB<0b0000, {0,0,?,?}, "8">;
2095 def VST4d16_UPD : VST4DWB<0b0000, {0,1,?,?}, "16">;
2096 def VST4d32_UPD : VST4DWB<0b0000, {1,0,?,?}, "32">;
2098 def VST4d8Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2099 def VST4d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2100 def VST4d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2102 // ...with double-spaced registers:
2103 def VST4q8 : VST4D<0b0001, {0,0,?,?}, "8">;
2104 def VST4q16 : VST4D<0b0001, {0,1,?,?}, "16">;
2105 def VST4q32 : VST4D<0b0001, {1,0,?,?}, "32">;
2106 def VST4q8_UPD : VST4DWB<0b0001, {0,0,?,?}, "8">;
2107 def VST4q16_UPD : VST4DWB<0b0001, {0,1,?,?}, "16">;
2108 def VST4q32_UPD : VST4DWB<0b0001, {1,0,?,?}, "32">;
2110 def VST4q8Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2111 def VST4q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2112 def VST4q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2114 // ...alternate versions to be allocated odd register numbers:
2115 def VST4q8oddPseudo : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
2116 def VST4q16oddPseudo : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
2117 def VST4q32oddPseudo : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
2119 def VST4q8oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2120 def VST4q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2121 def VST4q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
2123 } // mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1
2125 // Classes for VST*LN pseudo-instructions with multi-register operands.
2126 // These are expanded to real instructions after register allocation.
2127 class VSTQLNPseudo<InstrItinClass itin>
2128 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
2130 class VSTQLNWBPseudo<InstrItinClass itin>
2131 : PseudoNLdSt<(outs GPR:$wb),
2132 (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
2133 nohash_imm:$lane), itin, "$addr.addr = $wb">;
2134 class VSTQQLNPseudo<InstrItinClass itin>
2135 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
2137 class VSTQQLNWBPseudo<InstrItinClass itin>
2138 : PseudoNLdSt<(outs GPR:$wb),
2139 (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
2140 nohash_imm:$lane), itin, "$addr.addr = $wb">;
2141 class VSTQQQQLNPseudo<InstrItinClass itin>
2142 : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
2144 class VSTQQQQLNWBPseudo<InstrItinClass itin>
2145 : PseudoNLdSt<(outs GPR:$wb),
2146 (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
2147 nohash_imm:$lane), itin, "$addr.addr = $wb">;
2149 // VST1LN : Vector Store (single element from one lane)
2150 class VST1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
2151 PatFrag StoreOp, SDNode ExtractOp, Operand AddrMode>
2152 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
2153 (ins AddrMode:$Rn, DPR:$Vd, nohash_imm:$lane),
2154 IIC_VST1ln, "vst1", Dt, "\\{$Vd[$lane]\\}, $Rn", "",
2155 [(StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane), AddrMode:$Rn)]>,
2156 Sched<[WriteVST1]> {
2158 let DecoderMethod = "DecodeVST1LN";
2160 class VST1QLNPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
2161 : VSTQLNPseudo<IIC_VST1ln>, Sched<[WriteVST1]> {
2162 let Pattern = [(StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
2166 def VST1LNd8 : VST1LN<0b0000, {?,?,?,0}, "8", v8i8, truncstorei8,
2167 ARMvgetlaneu, addrmode6> {
2168 let Inst{7-5} = lane{2-0};
2170 def VST1LNd16 : VST1LN<0b0100, {?,?,0,?}, "16", v4i16, truncstorei16,
2171 ARMvgetlaneu, addrmode6> {
2172 let Inst{7-6} = lane{1-0};
2173 let Inst{4} = Rn{4};
2176 def VST1LNd32 : VST1LN<0b1000, {?,0,?,?}, "32", v2i32, store, extractelt,
2178 let Inst{7} = lane{0};
2179 let Inst{5-4} = Rn{5-4};
2182 def VST1LNq8Pseudo : VST1QLNPseudo<v16i8, truncstorei8, ARMvgetlaneu>;
2183 def VST1LNq16Pseudo : VST1QLNPseudo<v8i16, truncstorei16, ARMvgetlaneu>;
2184 def VST1LNq32Pseudo : VST1QLNPseudo<v4i32, store, extractelt>;
2186 let Predicates = [HasNEON] in {
2187 def : Pat<(store (extractelt (v2f32 DPR:$src), imm:$lane), addrmode6:$addr),
2188 (VST1LNd32 addrmode6:$addr, DPR:$src, imm:$lane)>;
2189 def : Pat<(store (extractelt (v4f32 QPR:$src), imm:$lane), addrmode6:$addr),
2190 (VST1LNq32Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
2192 def : Pat<(store (extractelt (v4f16 DPR:$src), imm:$lane), addrmode6:$addr),
2193 (VST1LNd16 addrmode6:$addr, DPR:$src, imm:$lane)>;
2194 def : Pat<(store (extractelt (v8f16 QPR:$src), imm:$lane), addrmode6:$addr),
2195 (VST1LNq16Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
2198 // ...with address register writeback:
2199 class VST1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
2200 PatFrag StoreOp, SDNode ExtractOp, Operand AdrMode>
2201 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
2202 (ins AdrMode:$Rn, am6offset:$Rm,
2203 DPR:$Vd, nohash_imm:$lane), IIC_VST1lnu, "vst1", Dt,
2204 "\\{$Vd[$lane]\\}, $Rn$Rm",
2206 [(set GPR:$wb, (StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane),
2207 AdrMode:$Rn, am6offset:$Rm))]>,
2208 Sched<[WriteVST1]> {
2209 let DecoderMethod = "DecodeVST1LN";
2211 class VST1QLNWBPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
2212 : VSTQLNWBPseudo<IIC_VST1lnu>, Sched<[WriteVST1]> {
2213 let Pattern = [(set GPR:$wb, (StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
2214 addrmode6:$addr, am6offset:$offset))];
2217 def VST1LNd8_UPD : VST1LNWB<0b0000, {?,?,?,0}, "8", v8i8, post_truncsti8,
2218 ARMvgetlaneu, addrmode6> {
2219 let Inst{7-5} = lane{2-0};
2221 def VST1LNd16_UPD : VST1LNWB<0b0100, {?,?,0,?}, "16", v4i16, post_truncsti16,
2222 ARMvgetlaneu, addrmode6> {
2223 let Inst{7-6} = lane{1-0};
2224 let Inst{4} = Rn{4};
2226 def VST1LNd32_UPD : VST1LNWB<0b1000, {?,0,?,?}, "32", v2i32, post_store,
2227 extractelt, addrmode6oneL32> {
2228 let Inst{7} = lane{0};
2229 let Inst{5-4} = Rn{5-4};
2232 def VST1LNq8Pseudo_UPD : VST1QLNWBPseudo<v16i8, post_truncsti8, ARMvgetlaneu>;
2233 def VST1LNq16Pseudo_UPD : VST1QLNWBPseudo<v8i16, post_truncsti16,ARMvgetlaneu>;
2234 def VST1LNq32Pseudo_UPD : VST1QLNWBPseudo<v4i32, post_store, extractelt>;
2236 let mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1 in {
2238 // VST2LN : Vector Store (single 2-element structure from one lane)
2239 class VST2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
2240 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
2241 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, nohash_imm:$lane),
2242 IIC_VST2ln, "vst2", Dt, "\\{$Vd[$lane], $src2[$lane]\\}, $Rn",
2243 "", []>, Sched<[WriteVST1]> {
2245 let Inst{4} = Rn{4};
2246 let DecoderMethod = "DecodeVST2LN";
2249 def VST2LNd8 : VST2LN<0b0001, {?,?,?,?}, "8"> {
2250 let Inst{7-5} = lane{2-0};
2252 def VST2LNd16 : VST2LN<0b0101, {?,?,0,?}, "16"> {
2253 let Inst{7-6} = lane{1-0};
2255 def VST2LNd32 : VST2LN<0b1001, {?,0,0,?}, "32"> {
2256 let Inst{7} = lane{0};
2259 def VST2LNd8Pseudo : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
2260 def VST2LNd16Pseudo : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
2261 def VST2LNd32Pseudo : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
2263 // ...with double-spaced registers:
2264 def VST2LNq16 : VST2LN<0b0101, {?,?,1,?}, "16"> {
2265 let Inst{7-6} = lane{1-0};
2266 let Inst{4} = Rn{4};
2268 def VST2LNq32 : VST2LN<0b1001, {?,1,0,?}, "32"> {
2269 let Inst{7} = lane{0};
2270 let Inst{4} = Rn{4};
2273 def VST2LNq16Pseudo : VSTQQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
2274 def VST2LNq32Pseudo : VSTQQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
2276 // ...with address register writeback:
2277 class VST2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
2278 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
2279 (ins addrmode6:$Rn, am6offset:$Rm,
2280 DPR:$Vd, DPR:$src2, nohash_imm:$lane), IIC_VST2lnu, "vst2", Dt,
2281 "\\{$Vd[$lane], $src2[$lane]\\}, $Rn$Rm",
2282 "$Rn.addr = $wb", []> {
2283 let Inst{4} = Rn{4};
2284 let DecoderMethod = "DecodeVST2LN";
2287 def VST2LNd8_UPD : VST2LNWB<0b0001, {?,?,?,?}, "8"> {
2288 let Inst{7-5} = lane{2-0};
2290 def VST2LNd16_UPD : VST2LNWB<0b0101, {?,?,0,?}, "16"> {
2291 let Inst{7-6} = lane{1-0};
2293 def VST2LNd32_UPD : VST2LNWB<0b1001, {?,0,0,?}, "32"> {
2294 let Inst{7} = lane{0};
2297 def VST2LNd8Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
2298 def VST2LNd16Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
2299 def VST2LNd32Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
2301 def VST2LNq16_UPD : VST2LNWB<0b0101, {?,?,1,?}, "16"> {
2302 let Inst{7-6} = lane{1-0};
2304 def VST2LNq32_UPD : VST2LNWB<0b1001, {?,1,0,?}, "32"> {
2305 let Inst{7} = lane{0};
2308 def VST2LNq16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
2309 def VST2LNq32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
2311 // VST3LN : Vector Store (single 3-element structure from one lane)
2312 class VST3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
2313 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
2314 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3,
2315 nohash_imm:$lane), IIC_VST3ln, "vst3", Dt,
2316 "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn", "", []>,
2317 Sched<[WriteVST2]> {
2319 let DecoderMethod = "DecodeVST3LN";
2322 def VST3LNd8 : VST3LN<0b0010, {?,?,?,0}, "8"> {
2323 let Inst{7-5} = lane{2-0};
2325 def VST3LNd16 : VST3LN<0b0110, {?,?,0,0}, "16"> {
2326 let Inst{7-6} = lane{1-0};
2328 def VST3LNd32 : VST3LN<0b1010, {?,0,0,0}, "32"> {
2329 let Inst{7} = lane{0};
2332 def VST3LNd8Pseudo : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
2333 def VST3LNd16Pseudo : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
2334 def VST3LNd32Pseudo : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
2336 // ...with double-spaced registers:
2337 def VST3LNq16 : VST3LN<0b0110, {?,?,1,0}, "16"> {
2338 let Inst{7-6} = lane{1-0};
2340 def VST3LNq32 : VST3LN<0b1010, {?,1,0,0}, "32"> {
2341 let Inst{7} = lane{0};
2344 def VST3LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
2345 def VST3LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
2347 // ...with address register writeback:
2348 class VST3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
2349 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
2350 (ins addrmode6:$Rn, am6offset:$Rm,
2351 DPR:$Vd, DPR:$src2, DPR:$src3, nohash_imm:$lane),
2352 IIC_VST3lnu, "vst3", Dt,
2353 "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn$Rm",
2354 "$Rn.addr = $wb", []> {
2355 let DecoderMethod = "DecodeVST3LN";
2358 def VST3LNd8_UPD : VST3LNWB<0b0010, {?,?,?,0}, "8"> {
2359 let Inst{7-5} = lane{2-0};
2361 def VST3LNd16_UPD : VST3LNWB<0b0110, {?,?,0,0}, "16"> {
2362 let Inst{7-6} = lane{1-0};
2364 def VST3LNd32_UPD : VST3LNWB<0b1010, {?,0,0,0}, "32"> {
2365 let Inst{7} = lane{0};
2368 def VST3LNd8Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
2369 def VST3LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
2370 def VST3LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
2372 def VST3LNq16_UPD : VST3LNWB<0b0110, {?,?,1,0}, "16"> {
2373 let Inst{7-6} = lane{1-0};
2375 def VST3LNq32_UPD : VST3LNWB<0b1010, {?,1,0,0}, "32"> {
2376 let Inst{7} = lane{0};
2379 def VST3LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
2380 def VST3LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
2382 // VST4LN : Vector Store (single 4-element structure from one lane)
2383 class VST4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
2384 : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
2385 (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4,
2386 nohash_imm:$lane), IIC_VST4ln, "vst4", Dt,
2387 "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn",
2388 "", []>, Sched<[WriteVST2]> {
2390 let Inst{4} = Rn{4};
2391 let DecoderMethod = "DecodeVST4LN";
2394 def VST4LNd8 : VST4LN<0b0011, {?,?,?,?}, "8"> {
2395 let Inst{7-5} = lane{2-0};
2397 def VST4LNd16 : VST4LN<0b0111, {?,?,0,?}, "16"> {
2398 let Inst{7-6} = lane{1-0};
2400 def VST4LNd32 : VST4LN<0b1011, {?,0,?,?}, "32"> {
2401 let Inst{7} = lane{0};
2402 let Inst{5} = Rn{5};
2405 def VST4LNd8Pseudo : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
2406 def VST4LNd16Pseudo : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
2407 def VST4LNd32Pseudo : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
2409 // ...with double-spaced registers:
2410 def VST4LNq16 : VST4LN<0b0111, {?,?,1,?}, "16"> {
2411 let Inst{7-6} = lane{1-0};
2413 def VST4LNq32 : VST4LN<0b1011, {?,1,?,?}, "32"> {
2414 let Inst{7} = lane{0};
2415 let Inst{5} = Rn{5};
2418 def VST4LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
2419 def VST4LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
2421 // ...with address register writeback:
2422 class VST4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
2423 : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
2424 (ins addrmode6:$Rn, am6offset:$Rm,
2425 DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
2426 IIC_VST4lnu, "vst4", Dt,
2427 "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn$Rm",
2428 "$Rn.addr = $wb", []> {
2429 let Inst{4} = Rn{4};
2430 let DecoderMethod = "DecodeVST4LN";
2433 def VST4LNd8_UPD : VST4LNWB<0b0011, {?,?,?,?}, "8"> {
2434 let Inst{7-5} = lane{2-0};
2436 def VST4LNd16_UPD : VST4LNWB<0b0111, {?,?,0,?}, "16"> {
2437 let Inst{7-6} = lane{1-0};
2439 def VST4LNd32_UPD : VST4LNWB<0b1011, {?,0,?,?}, "32"> {
2440 let Inst{7} = lane{0};
2441 let Inst{5} = Rn{5};
2444 def VST4LNd8Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
2445 def VST4LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
2446 def VST4LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
2448 def VST4LNq16_UPD : VST4LNWB<0b0111, {?,?,1,?}, "16"> {
2449 let Inst{7-6} = lane{1-0};
2451 def VST4LNq32_UPD : VST4LNWB<0b1011, {?,1,?,?}, "32"> {
2452 let Inst{7} = lane{0};
2453 let Inst{5} = Rn{5};
2456 def VST4LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
2457 def VST4LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
2459 } // mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1
2461 // Use vld1/vst1 for unaligned f64 load / store
2462 let Predicates = [IsLE,HasNEON] in {
2463 def : Pat<(f64 (hword_alignedload addrmode6:$addr)),
2464 (VLD1d16 addrmode6:$addr)>;
2465 def : Pat<(hword_alignedstore (f64 DPR:$value), addrmode6:$addr),
2466 (VST1d16 addrmode6:$addr, DPR:$value)>;
2467 def : Pat<(f64 (byte_alignedload addrmode6:$addr)),
2468 (VLD1d8 addrmode6:$addr)>;
2469 def : Pat<(byte_alignedstore (f64 DPR:$value), addrmode6:$addr),
2470 (VST1d8 addrmode6:$addr, DPR:$value)>;
2472 let Predicates = [IsBE,HasNEON] in {
2473 def : Pat<(f64 (non_word_alignedload addrmode6:$addr)),
2474 (VLD1d64 addrmode6:$addr)>;
2475 def : Pat<(non_word_alignedstore (f64 DPR:$value), addrmode6:$addr),
2476 (VST1d64 addrmode6:$addr, DPR:$value)>;
2479 // Use vld1/vst1 for Q and QQ. Also use them for unaligned v2f64
2480 // load / store if it's legal.
2481 let Predicates = [HasNEON] in {
2482 def : Pat<(v2f64 (dword_alignedload addrmode6:$addr)),
2483 (VLD1q64 addrmode6:$addr)>;
2484 def : Pat<(dword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
2485 (VST1q64 addrmode6:$addr, QPR:$value)>;
2487 let Predicates = [IsLE,HasNEON] in {
2488 def : Pat<(v2f64 (word_alignedload addrmode6:$addr)),
2489 (VLD1q32 addrmode6:$addr)>;
2490 def : Pat<(word_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
2491 (VST1q32 addrmode6:$addr, QPR:$value)>;
2492 def : Pat<(v2f64 (hword_alignedload addrmode6:$addr)),
2493 (VLD1q16 addrmode6:$addr)>;
2494 def : Pat<(hword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
2495 (VST1q16 addrmode6:$addr, QPR:$value)>;
2496 def : Pat<(v2f64 (byte_alignedload addrmode6:$addr)),
2497 (VLD1q8 addrmode6:$addr)>;
2498 def : Pat<(byte_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
2499 (VST1q8 addrmode6:$addr, QPR:$value)>;
2502 //===----------------------------------------------------------------------===//
2503 // Instruction Classes
2504 //===----------------------------------------------------------------------===//
2506 // Basic 2-register operations: double- and quad-register.
2507 class N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2508 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
2509 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
2510 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
2511 (ins DPR:$Vm), IIC_VUNAD, OpcodeStr, Dt,"$Vd, $Vm", "",
2512 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm))))]>;
2513 class N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2514 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
2515 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
2516 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
2517 (ins QPR:$Vm), IIC_VUNAQ, OpcodeStr, Dt,"$Vd, $Vm", "",
2518 [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm))))]>;
2520 // Basic 2-register intrinsics, both double- and quad-register.
2521 class N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2522 bits<2> op17_16, bits<5> op11_7, bit op4,
2523 InstrItinClass itin, string OpcodeStr, string Dt,
2524 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2525 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
2526 (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
2527 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
2528 class N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2529 bits<2> op17_16, bits<5> op11_7, bit op4,
2530 InstrItinClass itin, string OpcodeStr, string Dt,
2531 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2532 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
2533 (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
2534 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
2536 // Same as above, but not predicated.
2537 class N2VDIntnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op7,
2538 InstrItinClass itin, string OpcodeStr, string Dt,
2539 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2540 : N2Vnp<op19_18, op17_16, op10_8, op7, 0, (outs DPR:$Vd), (ins DPR:$Vm),
2541 itin, OpcodeStr, Dt,
2542 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
2544 class N2VQIntnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op7,
2545 InstrItinClass itin, string OpcodeStr, string Dt,
2546 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2547 : N2Vnp<op19_18, op17_16, op10_8, op7, 1, (outs QPR:$Vd), (ins QPR:$Vm),
2548 itin, OpcodeStr, Dt,
2549 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
2551 // Similar to NV2VQIntnp with some more encoding bits exposed (crypto).
2552 class N2VQIntXnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op6,
2553 bit op7, InstrItinClass itin, string OpcodeStr, string Dt,
2554 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2555 : N2Vnp<op19_18, op17_16, op10_8, op7, op6, (outs QPR:$Vd), (ins QPR:$Vm),
2556 itin, OpcodeStr, Dt,
2557 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
2559 // Same as N2VQIntXnp but with Vd as a src register.
2560 class N2VQIntX2np<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op6,
2561 bit op7, InstrItinClass itin, string OpcodeStr, string Dt,
2562 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2563 : N2Vnp<op19_18, op17_16, op10_8, op7, op6,
2564 (outs QPR:$Vd), (ins QPR:$src, QPR:$Vm),
2565 itin, OpcodeStr, Dt,
2566 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src), (OpTy QPR:$Vm))))]> {
2567 let Constraints = "$src = $Vd";
2570 // Narrow 2-register operations.
2571 class N2VN<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2572 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
2573 InstrItinClass itin, string OpcodeStr, string Dt,
2574 ValueType TyD, ValueType TyQ, SDNode OpNode>
2575 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
2576 (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
2577 [(set DPR:$Vd, (TyD (OpNode (TyQ QPR:$Vm))))]>;
2579 // Narrow 2-register intrinsics.
2580 class N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2581 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
2582 InstrItinClass itin, string OpcodeStr, string Dt,
2583 ValueType TyD, ValueType TyQ, SDPatternOperator IntOp>
2584 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
2585 (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
2586 [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vm))))]>;
2588 // Long 2-register operations (currently only used for VMOVL).
2589 class N2VL<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2590 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
2591 InstrItinClass itin, string OpcodeStr, string Dt,
2592 ValueType TyQ, ValueType TyD, SDNode OpNode>
2593 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
2594 (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
2595 [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vm))))]>;
2597 // Long 2-register intrinsics.
2598 class N2VLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
2599 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
2600 InstrItinClass itin, string OpcodeStr, string Dt,
2601 ValueType TyQ, ValueType TyD, SDPatternOperator IntOp>
2602 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
2603 (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
2604 [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vm))))]>;
2606 // 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
2607 class N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr, string Dt>
2608 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$Vd, DPR:$Vm),
2609 (ins DPR:$src1, DPR:$src2), IIC_VPERMD,
2610 OpcodeStr, Dt, "$Vd, $Vm",
2611 "$src1 = $Vd, $src2 = $Vm", []>;
2612 class N2VQShuffle<bits<2> op19_18, bits<5> op11_7,
2613 InstrItinClass itin, string OpcodeStr, string Dt>
2614 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$Vd, QPR:$Vm),
2615 (ins QPR:$src1, QPR:$src2), itin, OpcodeStr, Dt, "$Vd, $Vm",
2616 "$src1 = $Vd, $src2 = $Vm", []>;
2618 // Basic 3-register operations: double- and quad-register.
2619 class N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2620 InstrItinClass itin, string OpcodeStr, string Dt,
2621 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
2622 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2623 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2624 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2625 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
2626 // All of these have a two-operand InstAlias.
2627 let TwoOperandAliasConstraint = "$Vn = $Vd";
2628 let isCommutable = Commutable;
2630 // Same as N3VD but no data type.
2631 class N3VDX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2632 InstrItinClass itin, string OpcodeStr,
2633 ValueType ResTy, ValueType OpTy,
2634 SDNode OpNode, bit Commutable>
2635 : N3VX<op24, op23, op21_20, op11_8, 0, op4,
2636 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2637 OpcodeStr, "$Vd, $Vn, $Vm", "",
2638 [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>{
2639 // All of these have a two-operand InstAlias.
2640 let TwoOperandAliasConstraint = "$Vn = $Vd";
2641 let isCommutable = Commutable;
2644 class N3VDSL<bits<2> op21_20, bits<4> op11_8,
2645 InstrItinClass itin, string OpcodeStr, string Dt,
2646 ValueType Ty, SDNode ShOp>
2647 : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
2648 (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2649 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
2651 (Ty (ShOp (Ty DPR:$Vn),
2652 (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),imm:$lane)))))]> {
2653 // All of these have a two-operand InstAlias.
2654 let TwoOperandAliasConstraint = "$Vn = $Vd";
2655 let isCommutable = 0;
2657 class N3VDSL16<bits<2> op21_20, bits<4> op11_8,
2658 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
2659 : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
2660 (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
2661 NVMulSLFrm, IIC_VMULi16D, OpcodeStr, Dt,"$Vd, $Vn, $Vm$lane","",
2663 (Ty (ShOp (Ty DPR:$Vn),
2664 (Ty (ARMvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
2665 // All of these have a two-operand InstAlias.
2666 let TwoOperandAliasConstraint = "$Vn = $Vd";
2667 let isCommutable = 0;
2670 class N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2671 InstrItinClass itin, string OpcodeStr, string Dt,
2672 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
2673 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2674 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2675 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2676 [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
2677 // All of these have a two-operand InstAlias.
2678 let TwoOperandAliasConstraint = "$Vn = $Vd";
2679 let isCommutable = Commutable;
2681 class N3VQX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2682 InstrItinClass itin, string OpcodeStr,
2683 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
2684 : N3VX<op24, op23, op21_20, op11_8, 1, op4,
2685 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2686 OpcodeStr, "$Vd, $Vn, $Vm", "",
2687 [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>{
2688 // All of these have a two-operand InstAlias.
2689 let TwoOperandAliasConstraint = "$Vn = $Vd";
2690 let isCommutable = Commutable;
2692 class N3VQSL<bits<2> op21_20, bits<4> op11_8,
2693 InstrItinClass itin, string OpcodeStr, string Dt,
2694 ValueType ResTy, ValueType OpTy, SDNode ShOp>
2695 : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
2696 (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2697 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
2698 [(set (ResTy QPR:$Vd),
2699 (ResTy (ShOp (ResTy QPR:$Vn),
2700 (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
2702 // All of these have a two-operand InstAlias.
2703 let TwoOperandAliasConstraint = "$Vn = $Vd";
2704 let isCommutable = 0;
2706 class N3VQSL16<bits<2> op21_20, bits<4> op11_8, string OpcodeStr, string Dt,
2707 ValueType ResTy, ValueType OpTy, SDNode ShOp>
2708 : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
2709 (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
2710 NVMulSLFrm, IIC_VMULi16Q, OpcodeStr, Dt,"$Vd, $Vn, $Vm$lane", "",
2711 [(set (ResTy QPR:$Vd),
2712 (ResTy (ShOp (ResTy QPR:$Vn),
2713 (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
2715 // All of these have a two-operand InstAlias.
2716 let TwoOperandAliasConstraint = "$Vn = $Vd";
2717 let isCommutable = 0;
2720 // Basic 3-register intrinsics, both double- and quad-register.
2721 class N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2722 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
2723 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp, bit Commutable>
2724 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2725 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), f, itin,
2726 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2727 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
2728 // All of these have a two-operand InstAlias.
2729 let TwoOperandAliasConstraint = "$Vn = $Vd";
2730 let isCommutable = Commutable;
2733 class N3VDIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
2734 bit op4, Format f, InstrItinClass itin, string OpcodeStr,
2735 string Dt, ValueType ResTy, ValueType OpTy,
2736 SDPatternOperator IntOp, bit Commutable>
2737 : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
2738 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin, OpcodeStr, Dt,
2739 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>;
2741 class N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2742 string OpcodeStr, string Dt, ValueType Ty, SDPatternOperator IntOp>
2743 : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
2744 (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2745 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
2747 (Ty (IntOp (Ty DPR:$Vn),
2748 (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),
2750 let isCommutable = 0;
2753 class N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2754 string OpcodeStr, string Dt, ValueType Ty, SDPatternOperator IntOp>
2755 : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
2756 (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
2757 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
2759 (Ty (IntOp (Ty DPR:$Vn),
2760 (Ty (ARMvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
2761 let isCommutable = 0;
2763 class N3VDIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2764 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
2765 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2766 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2767 (outs DPR:$Vd), (ins DPR:$Vm, DPR:$Vn), f, itin,
2768 OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
2769 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (OpTy DPR:$Vn))))]> {
2770 let TwoOperandAliasConstraint = "$Vm = $Vd";
2771 let isCommutable = 0;
2774 class N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2775 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
2776 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp, bit Commutable>
2777 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2778 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin,
2779 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
2780 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
2781 // All of these have a two-operand InstAlias.
2782 let TwoOperandAliasConstraint = "$Vn = $Vd";
2783 let isCommutable = Commutable;
2786 class N3VQIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
2787 bit op4, Format f, InstrItinClass itin, string OpcodeStr,
2788 string Dt, ValueType ResTy, ValueType OpTy,
2789 SDPatternOperator IntOp, bit Commutable>
2790 : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
2791 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin, OpcodeStr, Dt,
2792 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>;
2794 // Same as N3VQIntnp but with Vd as a src register.
2795 class N3VQInt3np<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
2796 bit op4, Format f, InstrItinClass itin, string OpcodeStr,
2797 string Dt, ValueType ResTy, ValueType OpTy,
2798 SDPatternOperator IntOp, bit Commutable>
2799 : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
2800 (outs QPR:$Vd), (ins QPR:$src, QPR:$Vn, QPR:$Vm),
2801 f, itin, OpcodeStr, Dt,
2802 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src), (OpTy QPR:$Vn),
2803 (OpTy QPR:$Vm))))]> {
2804 let Constraints = "$src = $Vd";
2807 class N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2808 string OpcodeStr, string Dt,
2809 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2810 : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
2811 (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2812 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
2813 [(set (ResTy QPR:$Vd),
2814 (ResTy (IntOp (ResTy QPR:$Vn),
2815 (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
2817 let isCommutable = 0;
2819 class N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2820 string OpcodeStr, string Dt,
2821 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2822 : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
2823 (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
2824 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
2825 [(set (ResTy QPR:$Vd),
2826 (ResTy (IntOp (ResTy QPR:$Vn),
2827 (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
2829 let isCommutable = 0;
2831 class N3VQIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2832 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
2833 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2834 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2835 (outs QPR:$Vd), (ins QPR:$Vm, QPR:$Vn), f, itin,
2836 OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
2837 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (OpTy QPR:$Vn))))]> {
2838 let TwoOperandAliasConstraint = "$Vm = $Vd";
2839 let isCommutable = 0;
2842 // Multiply-Add/Sub operations: double- and quad-register.
2843 class N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2844 InstrItinClass itin, string OpcodeStr, string Dt,
2845 ValueType Ty, SDPatternOperator MulOp, SDPatternOperator OpNode>
2846 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2847 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2848 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2849 [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
2850 (Ty (MulOp DPR:$Vn, DPR:$Vm)))))]>;
2852 class N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2853 string OpcodeStr, string Dt,
2854 ValueType Ty, SDPatternOperator MulOp, SDPatternOperator ShOp>
2855 : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
2857 (ins DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2859 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
2861 (Ty (ShOp (Ty DPR:$src1),
2863 (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),
2865 class N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2866 string OpcodeStr, string Dt,
2867 ValueType Ty, SDPatternOperator MulOp, SDPatternOperator ShOp>
2868 : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
2870 (ins DPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
2872 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
2874 (Ty (ShOp (Ty DPR:$src1),
2876 (Ty (ARMvduplane (Ty DPR_8:$Vm),
2879 class N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2880 InstrItinClass itin, string OpcodeStr, string Dt, ValueType Ty,
2881 SDPatternOperator MulOp, SDPatternOperator OpNode>
2882 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2883 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2884 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2885 [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
2886 (Ty (MulOp QPR:$Vn, QPR:$Vm)))))]>;
2887 class N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2888 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
2889 SDPatternOperator MulOp, SDPatternOperator ShOp>
2890 : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
2892 (ins QPR:$src1, QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2894 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
2895 [(set (ResTy QPR:$Vd),
2896 (ResTy (ShOp (ResTy QPR:$src1),
2897 (ResTy (MulOp QPR:$Vn,
2898 (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
2900 class N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
2901 string OpcodeStr, string Dt,
2902 ValueType ResTy, ValueType OpTy,
2903 SDPatternOperator MulOp, SDPatternOperator ShOp>
2904 : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
2906 (ins QPR:$src1, QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
2908 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
2909 [(set (ResTy QPR:$Vd),
2910 (ResTy (ShOp (ResTy QPR:$src1),
2911 (ResTy (MulOp QPR:$Vn,
2912 (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
2915 // Neon Intrinsic-Op instructions (VABA): double- and quad-register.
2916 class N3VDIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2917 InstrItinClass itin, string OpcodeStr, string Dt,
2918 ValueType Ty, SDPatternOperator IntOp, SDNode OpNode>
2919 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2920 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2921 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2922 [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
2923 (Ty (IntOp (Ty DPR:$Vn), (Ty DPR:$Vm))))))]>;
2924 class N3VQIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2925 InstrItinClass itin, string OpcodeStr, string Dt,
2926 ValueType Ty, SDPatternOperator IntOp, SDNode OpNode>
2927 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2928 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2929 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2930 [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
2931 (Ty (IntOp (Ty QPR:$Vn), (Ty QPR:$Vm))))))]>;
2933 // Neon 3-argument intrinsics, both double- and quad-register.
2934 // The destination register is also used as the first source operand register.
2935 class N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2936 InstrItinClass itin, string OpcodeStr, string Dt,
2937 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2938 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2939 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2940 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2941 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$src1),
2942 (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>;
2943 class N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2944 InstrItinClass itin, string OpcodeStr, string Dt,
2945 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
2946 : N3V<op24, op23, op21_20, op11_8, 1, op4,
2947 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
2948 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2949 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src1),
2950 (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>;
2952 // Long Multiply-Add/Sub operations.
2953 class N3VLMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2954 InstrItinClass itin, string OpcodeStr, string Dt,
2955 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
2956 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2957 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2958 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2959 [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
2960 (TyQ (MulOp (TyD DPR:$Vn),
2961 (TyD DPR:$Vm)))))]>;
2962 class N3VLMulOpSL<bit op24, bits<2> op21_20, bits<4> op11_8,
2963 InstrItinClass itin, string OpcodeStr, string Dt,
2964 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
2965 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
2966 (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
2968 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
2970 (OpNode (TyQ QPR:$src1),
2971 (TyQ (MulOp (TyD DPR:$Vn),
2972 (TyD (ARMvduplane (TyD DPR_VFP2:$Vm),
2974 class N3VLMulOpSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
2975 InstrItinClass itin, string OpcodeStr, string Dt,
2976 ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
2977 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
2978 (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
2980 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
2982 (OpNode (TyQ QPR:$src1),
2983 (TyQ (MulOp (TyD DPR:$Vn),
2984 (TyD (ARMvduplane (TyD DPR_8:$Vm),
2987 // Long Intrinsic-Op vector operations with explicit extend (VABAL).
2988 class N3VLIntExtOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
2989 InstrItinClass itin, string OpcodeStr, string Dt,
2990 ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, SDNode ExtOp,
2992 : N3V<op24, op23, op21_20, op11_8, 0, op4,
2993 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
2994 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
2995 [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
2996 (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
2997 (TyD DPR:$Vm)))))))]>;
2999 // Neon Long 3-argument intrinsic. The destination register is
3000 // a quad-register and is also used as the first source operand register.
3001 class N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3002 InstrItinClass itin, string OpcodeStr, string Dt,
3003 ValueType TyQ, ValueType TyD, SDPatternOperator IntOp>
3004 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3005 (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
3006 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
3008 (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$Vn), (TyD DPR:$Vm))))]>;
3009 class N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
3010 string OpcodeStr, string Dt,
3011 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3012 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
3014 (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
3016 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
3017 [(set (ResTy QPR:$Vd),
3018 (ResTy (IntOp (ResTy QPR:$src1),
3020 (OpTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
3022 class N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8,
3023 InstrItinClass itin, string OpcodeStr, string Dt,
3024 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3025 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
3027 (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
3029 OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
3030 [(set (ResTy QPR:$Vd),
3031 (ResTy (IntOp (ResTy QPR:$src1),
3033 (OpTy (ARMvduplane (OpTy DPR_8:$Vm),
3036 // Narrowing 3-register intrinsics.
3037 class N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3038 string OpcodeStr, string Dt, ValueType TyD, ValueType TyQ,
3039 SDPatternOperator IntOp, bit Commutable>
3040 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3041 (outs DPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINi4D,
3042 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3043 [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vn), (TyQ QPR:$Vm))))]> {
3044 let isCommutable = Commutable;
3047 // Long 3-register operations.
3048 class N3VL<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3049 InstrItinClass itin, string OpcodeStr, string Dt,
3050 ValueType TyQ, ValueType TyD, SDNode OpNode, bit Commutable>
3051 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3052 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
3053 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3054 [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
3055 let isCommutable = Commutable;
3058 class N3VLSL<bit op24, bits<2> op21_20, bits<4> op11_8,
3059 InstrItinClass itin, string OpcodeStr, string Dt,
3060 ValueType TyQ, ValueType TyD, SDNode OpNode>
3061 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
3062 (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
3063 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
3065 (TyQ (OpNode (TyD DPR:$Vn),
3066 (TyD (ARMvduplane (TyD DPR_VFP2:$Vm),imm:$lane)))))]>;
3067 class N3VLSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
3068 InstrItinClass itin, string OpcodeStr, string Dt,
3069 ValueType TyQ, ValueType TyD, SDNode OpNode>
3070 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
3071 (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
3072 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
3074 (TyQ (OpNode (TyD DPR:$Vn),
3075 (TyD (ARMvduplane (TyD DPR_8:$Vm), imm:$lane)))))]>;
3077 // Long 3-register operations with explicitly extended operands.
3078 class N3VLExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3079 InstrItinClass itin, string OpcodeStr, string Dt,
3080 ValueType TyQ, ValueType TyD, SDNode OpNode, SDPatternOperator ExtOp,
3082 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3083 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
3084 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3085 [(set QPR:$Vd, (OpNode (TyQ (ExtOp (TyD DPR:$Vn))),
3086 (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
3087 let isCommutable = Commutable;
3090 // Long 3-register intrinsics with explicit extend (VABDL).
3091 class N3VLIntExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3092 InstrItinClass itin, string OpcodeStr, string Dt,
3093 ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, SDNode ExtOp,
3095 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3096 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
3097 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3098 [(set QPR:$Vd, (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
3099 (TyD DPR:$Vm))))))]> {
3100 let isCommutable = Commutable;
3103 // Long 3-register intrinsics.
3104 class N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3105 InstrItinClass itin, string OpcodeStr, string Dt,
3106 ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, bit Commutable>
3107 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3108 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
3109 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3110 [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
3111 let isCommutable = Commutable;
3114 // Same as above, but not predicated.
3115 class N3VLIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
3116 bit op4, InstrItinClass itin, string OpcodeStr,
3117 string Dt, ValueType ResTy, ValueType OpTy,
3118 SDPatternOperator IntOp, bit Commutable>
3119 : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
3120 (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin, OpcodeStr, Dt,
3121 [(set QPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>;
3123 class N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
3124 string OpcodeStr, string Dt,
3125 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3126 : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
3127 (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
3128 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
3129 [(set (ResTy QPR:$Vd),
3130 (ResTy (IntOp (OpTy DPR:$Vn),
3131 (OpTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
3133 class N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
3134 InstrItinClass itin, string OpcodeStr, string Dt,
3135 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3136 : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
3137 (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
3138 NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
3139 [(set (ResTy QPR:$Vd),
3140 (ResTy (IntOp (OpTy DPR:$Vn),
3141 (OpTy (ARMvduplane (OpTy DPR_8:$Vm),
3144 // Wide 3-register operations.
3145 class N3VW<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3146 string OpcodeStr, string Dt, ValueType TyQ, ValueType TyD,
3147 SDNode OpNode, SDPatternOperator ExtOp, bit Commutable>
3148 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3149 (outs QPR:$Vd), (ins QPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VSUBiD,
3150 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3151 [(set QPR:$Vd, (OpNode (TyQ QPR:$Vn),
3152 (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
3153 // All of these have a two-operand InstAlias.
3154 let TwoOperandAliasConstraint = "$Vn = $Vd";
3155 let isCommutable = Commutable;
3158 // Pairwise long 2-register intrinsics, both double- and quad-register.
3159 class N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
3160 bits<2> op17_16, bits<5> op11_7, bit op4,
3161 string OpcodeStr, string Dt,
3162 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3163 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
3164 (ins DPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
3165 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
3166 class N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
3167 bits<2> op17_16, bits<5> op11_7, bit op4,
3168 string OpcodeStr, string Dt,
3169 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3170 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
3171 (ins QPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
3172 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
3174 // Pairwise long 2-register accumulate intrinsics,
3175 // both double- and quad-register.
3176 // The destination register is also used as the first source operand register.
3177 class N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
3178 bits<2> op17_16, bits<5> op11_7, bit op4,
3179 string OpcodeStr, string Dt,
3180 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3181 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
3182 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vm), IIC_VPALiD,
3183 OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
3184 [(set DPR:$Vd, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$Vm))))]>;
3185 class N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
3186 bits<2> op17_16, bits<5> op11_7, bit op4,
3187 string OpcodeStr, string Dt,
3188 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
3189 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
3190 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vm), IIC_VPALiQ,
3191 OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
3192 [(set QPR:$Vd, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$Vm))))]>;
3194 // Shift by immediate,
3195 // both double- and quad-register.
3196 let TwoOperandAliasConstraint = "$Vm = $Vd" in {
3197 class N2VDSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3198 Format f, InstrItinClass itin, Operand ImmTy,
3199 string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
3200 : N2VImm<op24, op23, op11_8, op7, 0, op4,
3201 (outs DPR:$Vd), (ins DPR:$Vm, ImmTy:$SIMM), f, itin,
3202 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
3203 [(set DPR:$Vd, (Ty (OpNode (Ty DPR:$Vm), (i32 imm:$SIMM))))]>;
3204 class N2VQSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3205 Format f, InstrItinClass itin, Operand ImmTy,
3206 string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
3207 : N2VImm<op24, op23, op11_8, op7, 1, op4,
3208 (outs QPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), f, itin,
3209 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
3210 [(set QPR:$Vd, (Ty (OpNode (Ty QPR:$Vm), (i32 imm:$SIMM))))]>;
3213 // Long shift by immediate.
3214 class N2VLSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
3215 string OpcodeStr, string Dt,
3216 ValueType ResTy, ValueType OpTy, Operand ImmTy,
3217 SDPatternOperator OpNode>
3218 : N2VImm<op24, op23, op11_8, op7, op6, op4,
3219 (outs QPR:$Vd), (ins DPR:$Vm, ImmTy:$SIMM), N2RegVShLFrm,
3220 IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
3221 [(set QPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm), ImmTy:$SIMM)))]>;
3223 // Narrow shift by immediate.
3224 class N2VNSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
3225 InstrItinClass itin, string OpcodeStr, string Dt,
3226 ValueType ResTy, ValueType OpTy, Operand ImmTy,
3227 SDPatternOperator OpNode>
3228 : N2VImm<op24, op23, op11_8, op7, op6, op4,
3229 (outs DPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, itin,
3230 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
3231 [(set DPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm),
3232 (i32 ImmTy:$SIMM))))]>;
3234 // Shift right by immediate and accumulate,
3235 // both double- and quad-register.
3236 let TwoOperandAliasConstraint = "$Vm = $Vd" in {
3237 class N2VDShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3238 Operand ImmTy, string OpcodeStr, string Dt,
3239 ValueType Ty, SDNode ShOp>
3240 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
3241 (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
3242 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
3243 [(set DPR:$Vd, (Ty (add DPR:$src1,
3244 (Ty (ShOp DPR:$Vm, (i32 imm:$SIMM))))))]>;
3245 class N2VQShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3246 Operand ImmTy, string OpcodeStr, string Dt,
3247 ValueType Ty, SDNode ShOp>
3248 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
3249 (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
3250 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
3251 [(set QPR:$Vd, (Ty (add QPR:$src1,
3252 (Ty (ShOp QPR:$Vm, (i32 imm:$SIMM))))))]>;
3255 // Shift by immediate and insert,
3256 // both double- and quad-register.
3257 let TwoOperandAliasConstraint = "$Vm = $Vd" in {
3258 class N2VDShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3259 Operand ImmTy, Format f, string OpcodeStr, string Dt,
3260 ValueType Ty,SDNode ShOp>
3261 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
3262 (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiD,
3263 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
3264 [(set DPR:$Vd, (Ty (ShOp DPR:$src1, DPR:$Vm, (i32 imm:$SIMM))))]>;
3265 class N2VQShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3266 Operand ImmTy, Format f, string OpcodeStr, string Dt,
3267 ValueType Ty,SDNode ShOp>
3268 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
3269 (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiQ,
3270 OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
3271 [(set QPR:$Vd, (Ty (ShOp QPR:$src1, QPR:$Vm, (i32 imm:$SIMM))))]>;
3274 // Convert, with fractional bits immediate,
3275 // both double- and quad-register.
3276 class N2VCvtD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3277 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
3278 SDPatternOperator IntOp>
3279 : N2VImm<op24, op23, op11_8, op7, 0, op4,
3280 (outs DPR:$Vd), (ins DPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
3281 IIC_VUNAD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
3282 [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (i32 imm:$SIMM))))]>;
3283 class N2VCvtQ<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
3284 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
3285 SDPatternOperator IntOp>
3286 : N2VImm<op24, op23, op11_8, op7, 1, op4,
3287 (outs QPR:$Vd), (ins QPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
3288 IIC_VUNAQ, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
3289 [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (i32 imm:$SIMM))))]>;
3291 //===----------------------------------------------------------------------===//
3293 //===----------------------------------------------------------------------===//
3295 // Abbreviations used in multiclass suffixes:
3296 // Q = quarter int (8 bit) elements
3297 // H = half int (16 bit) elements
3298 // S = single int (32 bit) elements
3299 // D = double int (64 bit) elements
3301 // Neon 2-register vector operations and intrinsics.
3303 // Neon 2-register comparisons.
3304 // source operand element sizes of 8, 16 and 32 bits:
3305 multiclass N2V_QHS_cmp<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
3306 bits<5> op11_7, bit op4, string opc, string Dt,
3307 string asm, PatFrag fc> {
3308 // 64-bit vector types.
3309 def v8i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 0, op4,
3310 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
3311 opc, !strconcat(Dt, "8"), asm, "",
3312 [(set DPR:$Vd, (v8i8 (ARMvcmpz (v8i8 DPR:$Vm), fc)))]>;
3313 def v4i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
3314 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
3315 opc, !strconcat(Dt, "16"), asm, "",
3316 [(set DPR:$Vd, (v4i16 (ARMvcmpz (v4i16 DPR:$Vm), fc)))]>;
3317 def v2i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
3318 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
3319 opc, !strconcat(Dt, "32"), asm, "",
3320 [(set DPR:$Vd, (v2i32 (ARMvcmpz (v2i32 DPR:$Vm), fc)))]>;
3321 def v2f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
3322 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
3323 opc, "f32", asm, "",
3324 [(set DPR:$Vd, (v2i32 (ARMvcmpz (v2f32 DPR:$Vm), fc)))]> {
3325 let Inst{10} = 1; // overwrite F = 1
3327 def v4f16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
3328 (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
3329 opc, "f16", asm, "",
3330 [(set DPR:$Vd, (v4i16 (ARMvcmpz (v4f16 DPR:$Vm), fc)))]>,
3331 Requires<[HasNEON,HasFullFP16]> {
3332 let Inst{10} = 1; // overwrite F = 1
3335 // 128-bit vector types.
3336 def v16i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 1, op4,
3337 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
3338 opc, !strconcat(Dt, "8"), asm, "",
3339 [(set QPR:$Vd, (v16i8 (ARMvcmpz (v16i8 QPR:$Vm), fc)))]>;
3340 def v8i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
3341 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
3342 opc, !strconcat(Dt, "16"), asm, "",
3343 [(set QPR:$Vd, (v8i16 (ARMvcmpz (v8i16 QPR:$Vm), fc)))]>;
3344 def v4i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
3345 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
3346 opc, !strconcat(Dt, "32"), asm, "",
3347 [(set QPR:$Vd, (v4i32 (ARMvcmpz (v4i32 QPR:$Vm), fc)))]>;
3348 def v4f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
3349 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
3350 opc, "f32", asm, "",
3351 [(set QPR:$Vd, (v4i32 (ARMvcmpz (v4f32 QPR:$Vm), fc)))]> {
3352 let Inst{10} = 1; // overwrite F = 1
3354 def v8f16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
3355 (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
3356 opc, "f16", asm, "",
3357 [(set QPR:$Vd, (v8i16 (ARMvcmpz (v8f16 QPR:$Vm), fc)))]>,
3358 Requires<[HasNEON,HasFullFP16]> {
3359 let Inst{10} = 1; // overwrite F = 1
3363 // Neon 3-register comparisons.
3364 class N3VQ_cmp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3365 InstrItinClass itin, string OpcodeStr, string Dt,
3366 ValueType ResTy, ValueType OpTy, PatFrag fc, bit Commutable>
3367 : N3V<op24, op23, op21_20, op11_8, 1, op4,
3368 (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
3369 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3370 [(set QPR:$Vd, (ResTy (ARMvcmp (OpTy QPR:$Vn), (OpTy QPR:$Vm), fc)))]> {
3371 // All of these have a two-operand InstAlias.
3372 let TwoOperandAliasConstraint = "$Vn = $Vd";
3373 let isCommutable = Commutable;
3376 class N3VD_cmp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
3377 InstrItinClass itin, string OpcodeStr, string Dt,
3378 ValueType ResTy, ValueType OpTy, PatFrag fc, bit Commutable>
3379 : N3V<op24, op23, op21_20, op11_8, 0, op4,
3380 (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
3381 OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3382 [(set DPR:$Vd, (ResTy (ARMvcmp (OpTy DPR:$Vn), (OpTy DPR:$Vm), fc)))]> {
3383 // All of these have a two-operand InstAlias.
3384 let TwoOperandAliasConstraint = "$Vn = $Vd";
3385 let isCommutable = Commutable;
3388 multiclass N3V_QHS_cmp<bit op24, bit op23, bits<4> op11_8, bit op4,
3389 InstrItinClass itinD16, InstrItinClass itinD32,
3390 InstrItinClass itinQ16, InstrItinClass itinQ32,
3391 string OpcodeStr, string Dt,
3392 PatFrag fc, bit Commutable = 0> {
3393 // 64-bit vector types.
3394 def v8i8 : N3VD_cmp<op24, op23, 0b00, op11_8, op4, itinD16,
3395 OpcodeStr, !strconcat(Dt, "8"),
3396 v8i8, v8i8, fc, Commutable>;
3397 def v4i16 : N3VD_cmp<op24, op23, 0b01, op11_8, op4, itinD16,
3398 OpcodeStr, !strconcat(Dt, "16"),
3399 v4i16, v4i16, fc, Commutable>;
3400 def v2i32 : N3VD_cmp<op24, op23, 0b10, op11_8, op4, itinD32,
3401 OpcodeStr, !strconcat(Dt, "32"),
3402 v2i32, v2i32, fc, Commutable>;
3404 // 128-bit vector types.
3405 def v16i8 : N3VQ_cmp<op24, op23, 0b00, op11_8, op4, itinQ16,
3406 OpcodeStr, !strconcat(Dt, "8"),
3407 v16i8, v16i8, fc, Commutable>;
3408 def v8i16 : N3VQ_cmp<op24, op23, 0b01, op11_8, op4, itinQ16,
3409 OpcodeStr, !strconcat(Dt, "16"),
3410 v8i16, v8i16, fc, Commutable>;
3411 def v4i32 : N3VQ_cmp<op24, op23, 0b10, op11_8, op4, itinQ32,
3412 OpcodeStr, !strconcat(Dt, "32"),
3413 v4i32, v4i32, fc, Commutable>;
3417 // Neon 2-register vector intrinsics,
3418 // element sizes of 8, 16 and 32 bits:
3419 multiclass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
3420 bits<5> op11_7, bit op4,
3421 InstrItinClass itinD, InstrItinClass itinQ,
3422 string OpcodeStr, string Dt, SDPatternOperator IntOp> {
3423 // 64-bit vector types.
3424 def v8i8 : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3425 itinD, OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
3426 def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3427 itinD, OpcodeStr, !strconcat(Dt, "16"),v4i16,v4i16,IntOp>;
3428 def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3429 itinD, OpcodeStr, !strconcat(Dt, "32"),v2i32,v2i32,IntOp>;
3431 // 128-bit vector types.
3432 def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3433 itinQ, OpcodeStr, !strconcat(Dt, "8"), v16i8,v16i8,IntOp>;
3434 def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3435 itinQ, OpcodeStr, !strconcat(Dt, "16"),v8i16,v8i16,IntOp>;
3436 def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3437 itinQ, OpcodeStr, !strconcat(Dt, "32"),v4i32,v4i32,IntOp>;
3441 // Neon Narrowing 2-register vector operations,
3442 // source operand element sizes of 16, 32 and 64 bits:
3443 multiclass N2VN_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
3444 bits<5> op11_7, bit op6, bit op4,
3445 InstrItinClass itin, string OpcodeStr, string Dt,
3447 def v8i8 : N2VN<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
3448 itin, OpcodeStr, !strconcat(Dt, "16"),
3449 v8i8, v8i16, OpNode>;
3450 def v4i16 : N2VN<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
3451 itin, OpcodeStr, !strconcat(Dt, "32"),
3452 v4i16, v4i32, OpNode>;
3453 def v2i32 : N2VN<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
3454 itin, OpcodeStr, !strconcat(Dt, "64"),
3455 v2i32, v2i64, OpNode>;
3458 // Neon Narrowing 2-register vector intrinsics,
3459 // source operand element sizes of 16, 32 and 64 bits:
3460 multiclass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
3461 bits<5> op11_7, bit op6, bit op4,
3462 InstrItinClass itin, string OpcodeStr, string Dt,
3463 SDPatternOperator IntOp> {
3464 def v8i8 : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
3465 itin, OpcodeStr, !strconcat(Dt, "16"),
3466 v8i8, v8i16, IntOp>;
3467 def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
3468 itin, OpcodeStr, !strconcat(Dt, "32"),
3469 v4i16, v4i32, IntOp>;
3470 def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
3471 itin, OpcodeStr, !strconcat(Dt, "64"),
3472 v2i32, v2i64, IntOp>;
3476 // Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
3477 // source operand element sizes of 16, 32 and 64 bits:
3478 multiclass N2VL_QHS<bits<2> op24_23, bits<5> op11_7, bit op6, bit op4,
3479 string OpcodeStr, string Dt, SDNode OpNode> {
3480 def v8i16 : N2VL<op24_23, 0b00, 0b10, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
3481 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode>;
3482 def v4i32 : N2VL<op24_23, 0b01, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
3483 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
3484 def v2i64 : N2VL<op24_23, 0b10, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
3485 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
3489 // Neon 3-register vector operations.
3491 // First with only element sizes of 8, 16 and 32 bits:
3492 multiclass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3493 InstrItinClass itinD16, InstrItinClass itinD32,
3494 InstrItinClass itinQ16, InstrItinClass itinQ32,
3495 string OpcodeStr, string Dt,
3496 SDNode OpNode, bit Commutable = 0> {
3497 // 64-bit vector types.
3498 def v8i8 : N3VD<op24, op23, 0b00, op11_8, op4, itinD16,
3499 OpcodeStr, !strconcat(Dt, "8"),
3500 v8i8, v8i8, OpNode, Commutable>;
3501 def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16,
3502 OpcodeStr, !strconcat(Dt, "16"),
3503 v4i16, v4i16, OpNode, Commutable>;
3504 def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32,
3505 OpcodeStr, !strconcat(Dt, "32"),
3506 v2i32, v2i32, OpNode, Commutable>;
3508 // 128-bit vector types.
3509 def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16,
3510 OpcodeStr, !strconcat(Dt, "8"),
3511 v16i8, v16i8, OpNode, Commutable>;
3512 def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16,
3513 OpcodeStr, !strconcat(Dt, "16"),
3514 v8i16, v8i16, OpNode, Commutable>;
3515 def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32,
3516 OpcodeStr, !strconcat(Dt, "32"),
3517 v4i32, v4i32, OpNode, Commutable>;
3520 multiclass N3VSL_HS<bits<4> op11_8, string OpcodeStr, SDNode ShOp> {
3521 def v4i16 : N3VDSL16<0b01, op11_8, OpcodeStr, "i16", v4i16, ShOp>;
3522 def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, OpcodeStr, "i32", v2i32, ShOp>;
3523 def v8i16 : N3VQSL16<0b01, op11_8, OpcodeStr, "i16", v8i16, v4i16, ShOp>;
3524 def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, OpcodeStr, "i32",
3525 v4i32, v2i32, ShOp>;
3528 // ....then also with element size 64 bits:
3529 multiclass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3530 InstrItinClass itinD, InstrItinClass itinQ,
3531 string OpcodeStr, string Dt,
3532 SDNode OpNode, bit Commutable = 0>
3533 : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ,
3534 OpcodeStr, Dt, OpNode, Commutable> {
3535 def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD,
3536 OpcodeStr, !strconcat(Dt, "64"),
3537 v1i64, v1i64, OpNode, Commutable>;
3538 def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ,
3539 OpcodeStr, !strconcat(Dt, "64"),
3540 v2i64, v2i64, OpNode, Commutable>;
3544 // Neon 3-register vector intrinsics.
3546 // First with only element sizes of 16 and 32 bits:
3547 multiclass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
3548 InstrItinClass itinD16, InstrItinClass itinD32,
3549 InstrItinClass itinQ16, InstrItinClass itinQ32,
3550 string OpcodeStr, string Dt,
3551 SDPatternOperator IntOp, bit Commutable = 0> {
3552 // 64-bit vector types.
3553 def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, f, itinD16,
3554 OpcodeStr, !strconcat(Dt, "16"),
3555 v4i16, v4i16, IntOp, Commutable>;
3556 def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, f, itinD32,
3557 OpcodeStr, !strconcat(Dt, "32"),
3558 v2i32, v2i32, IntOp, Commutable>;
3560 // 128-bit vector types.
3561 def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, f, itinQ16,
3562 OpcodeStr, !strconcat(Dt, "16"),
3563 v8i16, v8i16, IntOp, Commutable>;
3564 def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, f, itinQ32,
3565 OpcodeStr, !strconcat(Dt, "32"),
3566 v4i32, v4i32, IntOp, Commutable>;
3568 multiclass N3VInt_HSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
3569 InstrItinClass itinD16, InstrItinClass itinD32,
3570 InstrItinClass itinQ16, InstrItinClass itinQ32,
3571 string OpcodeStr, string Dt,
3572 SDPatternOperator IntOp> {
3573 // 64-bit vector types.
3574 def v4i16 : N3VDIntSh<op24, op23, 0b01, op11_8, op4, f, itinD16,
3575 OpcodeStr, !strconcat(Dt, "16"),
3576 v4i16, v4i16, IntOp>;
3577 def v2i32 : N3VDIntSh<op24, op23, 0b10, op11_8, op4, f, itinD32,
3578 OpcodeStr, !strconcat(Dt, "32"),
3579 v2i32, v2i32, IntOp>;
3581 // 128-bit vector types.
3582 def v8i16 : N3VQIntSh<op24, op23, 0b01, op11_8, op4, f, itinQ16,
3583 OpcodeStr, !strconcat(Dt, "16"),
3584 v8i16, v8i16, IntOp>;
3585 def v4i32 : N3VQIntSh<op24, op23, 0b10, op11_8, op4, f, itinQ32,
3586 OpcodeStr, !strconcat(Dt, "32"),
3587 v4i32, v4i32, IntOp>;
3590 multiclass N3VIntSL_HS<bits<4> op11_8,
3591 InstrItinClass itinD16, InstrItinClass itinD32,
3592 InstrItinClass itinQ16, InstrItinClass itinQ32,
3593 string OpcodeStr, string Dt, SDPatternOperator IntOp> {
3594 def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16,
3595 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp>;
3596 def v2i32 : N3VDIntSL<0b10, op11_8, itinD32,
3597 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp>;
3598 def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16,
3599 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16, IntOp>;
3600 def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32,
3601 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32, IntOp>;
3604 // ....then also with element size of 8 bits:
3605 multiclass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
3606 InstrItinClass itinD16, InstrItinClass itinD32,
3607 InstrItinClass itinQ16, InstrItinClass itinQ32,
3608 string OpcodeStr, string Dt,
3609 SDPatternOperator IntOp, bit Commutable = 0>
3610 : N3VInt_HS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
3611 OpcodeStr, Dt, IntOp, Commutable> {
3612 def v8i8 : N3VDInt<op24, op23, 0b00, op11_8, op4, f, itinD16,
3613 OpcodeStr, !strconcat(Dt, "8"),
3614 v8i8, v8i8, IntOp, Commutable>;
3615 def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, f, itinQ16,
3616 OpcodeStr, !strconcat(Dt, "8"),
3617 v16i8, v16i8, IntOp, Commutable>;
3619 multiclass N3VInt_QHSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
3620 InstrItinClass itinD16, InstrItinClass itinD32,
3621 InstrItinClass itinQ16, InstrItinClass itinQ32,
3622 string OpcodeStr, string Dt,
3623 SDPatternOperator IntOp>
3624 : N3VInt_HSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
3625 OpcodeStr, Dt, IntOp> {
3626 def v8i8 : N3VDIntSh<op24, op23, 0b00, op11_8, op4, f, itinD16,
3627 OpcodeStr, !strconcat(Dt, "8"),
3629 def v16i8 : N3VQIntSh<op24, op23, 0b00, op11_8, op4, f, itinQ16,
3630 OpcodeStr, !strconcat(Dt, "8"),
3631 v16i8, v16i8, IntOp>;
3635 // ....then also with element size of 64 bits:
3636 multiclass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
3637 InstrItinClass itinD16, InstrItinClass itinD32,
3638 InstrItinClass itinQ16, InstrItinClass itinQ32,
3639 string OpcodeStr, string Dt,
3640 SDPatternOperator IntOp, bit Commutable = 0>
3641 : N3VInt_QHS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
3642 OpcodeStr, Dt, IntOp, Commutable> {
3643 def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, f, itinD32,
3644 OpcodeStr, !strconcat(Dt, "64"),
3645 v1i64, v1i64, IntOp, Commutable>;
3646 def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, f, itinQ32,
3647 OpcodeStr, !strconcat(Dt, "64"),
3648 v2i64, v2i64, IntOp, Commutable>;
3650 multiclass N3VInt_QHSDSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
3651 InstrItinClass itinD16, InstrItinClass itinD32,
3652 InstrItinClass itinQ16, InstrItinClass itinQ32,
3653 string OpcodeStr, string Dt,
3654 SDPatternOperator IntOp>
3655 : N3VInt_QHSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
3656 OpcodeStr, Dt, IntOp> {
3657 def v1i64 : N3VDIntSh<op24, op23, 0b11, op11_8, op4, f, itinD32,
3658 OpcodeStr, !strconcat(Dt, "64"),
3659 v1i64, v1i64, IntOp>;
3660 def v2i64 : N3VQIntSh<op24, op23, 0b11, op11_8, op4, f, itinQ32,
3661 OpcodeStr, !strconcat(Dt, "64"),
3662 v2i64, v2i64, IntOp>;
3665 // Neon Narrowing 3-register vector intrinsics,
3666 // source operand element sizes of 16, 32 and 64 bits:
3667 multiclass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
3668 string OpcodeStr, string Dt,
3669 SDPatternOperator IntOp, bit Commutable = 0> {
3670 def v8i8 : N3VNInt<op24, op23, 0b00, op11_8, op4,
3671 OpcodeStr, !strconcat(Dt, "16"),
3672 v8i8, v8i16, IntOp, Commutable>;
3673 def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4,
3674 OpcodeStr, !strconcat(Dt, "32"),
3675 v4i16, v4i32, IntOp, Commutable>;
3676 def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4,
3677 OpcodeStr, !strconcat(Dt, "64"),
3678 v2i32, v2i64, IntOp, Commutable>;
3682 // Neon Long 3-register vector operations.
3684 multiclass N3VL_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3685 InstrItinClass itin16, InstrItinClass itin32,
3686 string OpcodeStr, string Dt,
3687 SDNode OpNode, bit Commutable = 0> {
3688 def v8i16 : N3VL<op24, op23, 0b00, op11_8, op4, itin16,
3689 OpcodeStr, !strconcat(Dt, "8"),
3690 v8i16, v8i8, OpNode, Commutable>;
3691 def v4i32 : N3VL<op24, op23, 0b01, op11_8, op4, itin16,
3692 OpcodeStr, !strconcat(Dt, "16"),
3693 v4i32, v4i16, OpNode, Commutable>;
3694 def v2i64 : N3VL<op24, op23, 0b10, op11_8, op4, itin32,
3695 OpcodeStr, !strconcat(Dt, "32"),
3696 v2i64, v2i32, OpNode, Commutable>;
3699 multiclass N3VLSL_HS<bit op24, bits<4> op11_8,
3700 InstrItinClass itin, string OpcodeStr, string Dt,
3702 def v4i16 : N3VLSL16<op24, 0b01, op11_8, itin, OpcodeStr,
3703 !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
3704 def v2i32 : N3VLSL<op24, 0b10, op11_8, itin, OpcodeStr,
3705 !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
3708 multiclass N3VLExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3709 InstrItinClass itin16, InstrItinClass itin32,
3710 string OpcodeStr, string Dt,
3711 SDNode OpNode, SDPatternOperator ExtOp, bit Commutable = 0> {
3712 def v8i16 : N3VLExt<op24, op23, 0b00, op11_8, op4, itin16,
3713 OpcodeStr, !strconcat(Dt, "8"),
3714 v8i16, v8i8, OpNode, ExtOp, Commutable>;
3715 def v4i32 : N3VLExt<op24, op23, 0b01, op11_8, op4, itin16,
3716 OpcodeStr, !strconcat(Dt, "16"),
3717 v4i32, v4i16, OpNode, ExtOp, Commutable>;
3718 def v2i64 : N3VLExt<op24, op23, 0b10, op11_8, op4, itin32,
3719 OpcodeStr, !strconcat(Dt, "32"),
3720 v2i64, v2i32, OpNode, ExtOp, Commutable>;
3723 // Neon Long 3-register vector intrinsics.
3725 // First with only element sizes of 16 and 32 bits:
3726 multiclass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
3727 InstrItinClass itin16, InstrItinClass itin32,
3728 string OpcodeStr, string Dt,
3729 SDPatternOperator IntOp, bit Commutable = 0> {
3730 def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin16,
3731 OpcodeStr, !strconcat(Dt, "16"),
3732 v4i32, v4i16, IntOp, Commutable>;
3733 def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin32,
3734 OpcodeStr, !strconcat(Dt, "32"),
3735 v2i64, v2i32, IntOp, Commutable>;
3738 multiclass N3VLIntSL_HS<bit op24, bits<4> op11_8,
3739 InstrItinClass itin, string OpcodeStr, string Dt,
3740 SDPatternOperator IntOp> {
3741 def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin,
3742 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
3743 def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin,
3744 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
3747 // ....then also with element size of 8 bits:
3748 multiclass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3749 InstrItinClass itin16, InstrItinClass itin32,
3750 string OpcodeStr, string Dt,
3751 SDPatternOperator IntOp, bit Commutable = 0>
3752 : N3VLInt_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt,
3753 IntOp, Commutable> {
3754 def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin16,
3755 OpcodeStr, !strconcat(Dt, "8"),
3756 v8i16, v8i8, IntOp, Commutable>;
3759 // ....with explicit extend (VABDL).
3760 multiclass N3VLIntExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3761 InstrItinClass itin, string OpcodeStr, string Dt,
3762 SDPatternOperator IntOp, SDNode ExtOp, bit Commutable = 0> {
3763 def v8i16 : N3VLIntExt<op24, op23, 0b00, op11_8, op4, itin,
3764 OpcodeStr, !strconcat(Dt, "8"),
3765 v8i16, v8i8, IntOp, ExtOp, Commutable>;
3766 def v4i32 : N3VLIntExt<op24, op23, 0b01, op11_8, op4, itin,
3767 OpcodeStr, !strconcat(Dt, "16"),
3768 v4i32, v4i16, IntOp, ExtOp, Commutable>;
3769 def v2i64 : N3VLIntExt<op24, op23, 0b10, op11_8, op4, itin,
3770 OpcodeStr, !strconcat(Dt, "32"),
3771 v2i64, v2i32, IntOp, ExtOp, Commutable>;
3775 // Neon Wide 3-register vector intrinsics,
3776 // source operand element sizes of 8, 16 and 32 bits:
3777 multiclass N3VW_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3778 string OpcodeStr, string Dt,
3779 SDNode OpNode, SDPatternOperator ExtOp, bit Commutable = 0> {
3780 def v8i16 : N3VW<op24, op23, 0b00, op11_8, op4,
3781 OpcodeStr, !strconcat(Dt, "8"),
3782 v8i16, v8i8, OpNode, ExtOp, Commutable>;
3783 def v4i32 : N3VW<op24, op23, 0b01, op11_8, op4,
3784 OpcodeStr, !strconcat(Dt, "16"),
3785 v4i32, v4i16, OpNode, ExtOp, Commutable>;
3786 def v2i64 : N3VW<op24, op23, 0b10, op11_8, op4,
3787 OpcodeStr, !strconcat(Dt, "32"),
3788 v2i64, v2i32, OpNode, ExtOp, Commutable>;
3792 // Neon Multiply-Op vector operations,
3793 // element sizes of 8, 16 and 32 bits:
3794 multiclass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3795 InstrItinClass itinD16, InstrItinClass itinD32,
3796 InstrItinClass itinQ16, InstrItinClass itinQ32,
3797 string OpcodeStr, string Dt, SDNode OpNode> {
3798 // 64-bit vector types.
3799 def v8i8 : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16,
3800 OpcodeStr, !strconcat(Dt, "8"), v8i8, mul, OpNode>;
3801 def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16,
3802 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, OpNode>;
3803 def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32,
3804 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, OpNode>;
3806 // 128-bit vector types.
3807 def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16,
3808 OpcodeStr, !strconcat(Dt, "8"), v16i8, mul, OpNode>;
3809 def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16,
3810 OpcodeStr, !strconcat(Dt, "16"), v8i16, mul, OpNode>;
3811 def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32,
3812 OpcodeStr, !strconcat(Dt, "32"), v4i32, mul, OpNode>;
3815 multiclass N3VMulOpSL_HS<bits<4> op11_8,
3816 InstrItinClass itinD16, InstrItinClass itinD32,
3817 InstrItinClass itinQ16, InstrItinClass itinQ32,
3818 string OpcodeStr, string Dt, SDPatternOperator ShOp> {
3819 def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16,
3820 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, ShOp>;
3821 def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32,
3822 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, ShOp>;
3823 def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16,
3824 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16,
3826 def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32,
3827 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32,
3831 // Neon Intrinsic-Op vector operations,
3832 // element sizes of 8, 16 and 32 bits:
3833 multiclass N3VIntOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3834 InstrItinClass itinD, InstrItinClass itinQ,
3835 string OpcodeStr, string Dt, SDPatternOperator IntOp,
3837 // 64-bit vector types.
3838 def v8i8 : N3VDIntOp<op24, op23, 0b00, op11_8, op4, itinD,
3839 OpcodeStr, !strconcat(Dt, "8"), v8i8, IntOp, OpNode>;
3840 def v4i16 : N3VDIntOp<op24, op23, 0b01, op11_8, op4, itinD,
3841 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp, OpNode>;
3842 def v2i32 : N3VDIntOp<op24, op23, 0b10, op11_8, op4, itinD,
3843 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp, OpNode>;
3845 // 128-bit vector types.
3846 def v16i8 : N3VQIntOp<op24, op23, 0b00, op11_8, op4, itinQ,
3847 OpcodeStr, !strconcat(Dt, "8"), v16i8, IntOp, OpNode>;
3848 def v8i16 : N3VQIntOp<op24, op23, 0b01, op11_8, op4, itinQ,
3849 OpcodeStr, !strconcat(Dt, "16"), v8i16, IntOp, OpNode>;
3850 def v4i32 : N3VQIntOp<op24, op23, 0b10, op11_8, op4, itinQ,
3851 OpcodeStr, !strconcat(Dt, "32"), v4i32, IntOp, OpNode>;
3854 // Neon 3-argument intrinsics,
3855 // element sizes of 16 and 32 bits:
3856 multiclass N3VInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
3857 InstrItinClass itinD16, InstrItinClass itinD32,
3858 InstrItinClass itinQ16, InstrItinClass itinQ32,
3859 string OpcodeStr, string Dt, SDPatternOperator IntOp> {
3860 // 64-bit vector types.
3861 def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, itinD16,
3862 OpcodeStr, !strconcat(Dt, "16"), v4i16, v4i16, IntOp>;
3863 def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, itinD32,
3864 OpcodeStr, !strconcat(Dt, "32"), v2i32, v2i32, IntOp>;
3866 // 128-bit vector types.
3867 def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, itinQ16,
3868 OpcodeStr, !strconcat(Dt, "16"), v8i16, v8i16, IntOp>;
3869 def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, itinQ32,
3870 OpcodeStr, !strconcat(Dt, "32"), v4i32, v4i32, IntOp>;
3873 // element sizes of 8, 16 and 32 bits:
3874 multiclass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3875 InstrItinClass itinD16, InstrItinClass itinD32,
3876 InstrItinClass itinQ16, InstrItinClass itinQ32,
3877 string OpcodeStr, string Dt, SDPatternOperator IntOp>
3878 :N3VInt3_HS <op24, op23, op11_8, op4, itinD16, itinD32,
3879 itinQ16, itinQ32, OpcodeStr, Dt, IntOp>{
3880 // 64-bit vector types.
3881 def v8i8 : N3VDInt3<op24, op23, 0b00, op11_8, op4, itinD16,
3882 OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
3883 // 128-bit vector types.
3884 def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, itinQ16,
3885 OpcodeStr, !strconcat(Dt, "8"), v16i8, v16i8, IntOp>;
3888 // Neon Long Multiply-Op vector operations,
3889 // element sizes of 8, 16 and 32 bits:
3890 multiclass N3VLMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3891 InstrItinClass itin16, InstrItinClass itin32,
3892 string OpcodeStr, string Dt, SDNode MulOp,
3894 def v8i16 : N3VLMulOp<op24, op23, 0b00, op11_8, op4, itin16, OpcodeStr,
3895 !strconcat(Dt, "8"), v8i16, v8i8, MulOp, OpNode>;
3896 def v4i32 : N3VLMulOp<op24, op23, 0b01, op11_8, op4, itin16, OpcodeStr,
3897 !strconcat(Dt, "16"), v4i32, v4i16, MulOp, OpNode>;
3898 def v2i64 : N3VLMulOp<op24, op23, 0b10, op11_8, op4, itin32, OpcodeStr,
3899 !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
3902 multiclass N3VLMulOpSL_HS<bit op24, bits<4> op11_8, string OpcodeStr,
3903 string Dt, SDNode MulOp, SDNode OpNode> {
3904 def v4i16 : N3VLMulOpSL16<op24, 0b01, op11_8, IIC_VMACi16D, OpcodeStr,
3905 !strconcat(Dt,"16"), v4i32, v4i16, MulOp, OpNode>;
3906 def v2i32 : N3VLMulOpSL<op24, 0b10, op11_8, IIC_VMACi32D, OpcodeStr,
3907 !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
3911 // Neon Long 3-argument intrinsics.
3913 // First with only element sizes of 16 and 32 bits:
3914 multiclass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
3915 InstrItinClass itin16, InstrItinClass itin32,
3916 string OpcodeStr, string Dt, SDPatternOperator IntOp> {
3917 def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, itin16,
3918 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
3919 def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, itin32,
3920 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
3923 multiclass N3VLInt3SL_HS<bit op24, bits<4> op11_8,
3924 string OpcodeStr, string Dt, SDPatternOperator IntOp> {
3925 def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D,
3926 OpcodeStr, !strconcat(Dt,"16"), v4i32, v4i16, IntOp>;
3927 def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D,
3928 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
3931 // ....then also with element size of 8 bits:
3932 multiclass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3933 InstrItinClass itin16, InstrItinClass itin32,
3934 string OpcodeStr, string Dt, SDPatternOperator IntOp>
3935 : N3VLInt3_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt, IntOp> {
3936 def v8i16 : N3VLInt3<op24, op23, 0b00, op11_8, op4, itin16,
3937 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, IntOp>;
3940 // ....with explicit extend (VABAL).
3941 multiclass N3VLIntExtOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
3942 InstrItinClass itin, string OpcodeStr, string Dt,
3943 SDPatternOperator IntOp, SDNode ExtOp, SDNode OpNode> {
3944 def v8i16 : N3VLIntExtOp<op24, op23, 0b00, op11_8, op4, itin,
3945 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8,
3946 IntOp, ExtOp, OpNode>;
3947 def v4i32 : N3VLIntExtOp<op24, op23, 0b01, op11_8, op4, itin,
3948 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16,
3949 IntOp, ExtOp, OpNode>;
3950 def v2i64 : N3VLIntExtOp<op24, op23, 0b10, op11_8, op4, itin,
3951 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32,
3952 IntOp, ExtOp, OpNode>;
3956 // Neon Pairwise long 2-register intrinsics,
3957 // element sizes of 8, 16 and 32 bits:
3958 multiclass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
3959 bits<5> op11_7, bit op4,
3960 string OpcodeStr, string Dt, SDPatternOperator IntOp> {
3961 // 64-bit vector types.
3962 def v8i8 : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3963 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
3964 def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3965 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
3966 def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3967 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
3969 // 128-bit vector types.
3970 def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3971 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
3972 def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3973 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
3974 def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3975 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
3979 // Neon Pairwise long 2-register accumulate intrinsics,
3980 // element sizes of 8, 16 and 32 bits:
3981 multiclass N2VPLInt2_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 : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3986 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
3987 def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3988 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
3989 def v2i32 : N2VDPLInt2<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 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
3994 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
3995 def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
3996 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
3997 def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
3998 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
4002 // Neon 2-register vector shift by immediate,
4003 // with f of either N2RegVShLFrm or N2RegVShRFrm
4004 // element sizes of 8, 16, 32 and 64 bits:
4005 multiclass N2VShL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
4006 InstrItinClass itin, string OpcodeStr, string Dt,
4008 // 64-bit vector types.
4009 def v8i8 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
4010 OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
4011 let Inst{21-19} = 0b001; // imm6 = 001xxx
4013 def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
4014 OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
4015 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4017 def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
4018 OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
4019 let Inst{21} = 0b1; // imm6 = 1xxxxx
4021 def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
4022 OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
4025 // 128-bit vector types.
4026 def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
4027 OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
4028 let Inst{21-19} = 0b001; // imm6 = 001xxx
4030 def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
4031 OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
4032 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4034 def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
4035 OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
4036 let Inst{21} = 0b1; // imm6 = 1xxxxx
4038 def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
4039 OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
4042 multiclass N2VShR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
4043 InstrItinClass itin, string OpcodeStr, string Dt,
4044 string baseOpc, SDNode OpNode> {
4045 // 64-bit vector types.
4046 def v8i8 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
4047 OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
4048 let Inst{21-19} = 0b001; // imm6 = 001xxx
4050 def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
4051 OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
4052 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4054 def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
4055 OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
4056 let Inst{21} = 0b1; // imm6 = 1xxxxx
4058 def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
4059 OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
4062 // 128-bit vector types.
4063 def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
4064 OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
4065 let Inst{21-19} = 0b001; // imm6 = 001xxx
4067 def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
4068 OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
4069 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4071 def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
4072 OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
4073 let Inst{21} = 0b1; // imm6 = 1xxxxx
4075 def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
4076 OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
4080 // Neon Shift-Accumulate vector operations,
4081 // element sizes of 8, 16, 32 and 64 bits:
4082 multiclass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
4083 string OpcodeStr, string Dt, SDNode ShOp> {
4084 // 64-bit vector types.
4085 def v8i8 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
4086 OpcodeStr, !strconcat(Dt, "8"), v8i8, ShOp> {
4087 let Inst{21-19} = 0b001; // imm6 = 001xxx
4089 def v4i16 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
4090 OpcodeStr, !strconcat(Dt, "16"), v4i16, ShOp> {
4091 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4093 def v2i32 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
4094 OpcodeStr, !strconcat(Dt, "32"), v2i32, ShOp> {
4095 let Inst{21} = 0b1; // imm6 = 1xxxxx
4097 def v1i64 : N2VDShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
4098 OpcodeStr, !strconcat(Dt, "64"), v1i64, ShOp>;
4101 // 128-bit vector types.
4102 def v16i8 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
4103 OpcodeStr, !strconcat(Dt, "8"), v16i8, ShOp> {
4104 let Inst{21-19} = 0b001; // imm6 = 001xxx
4106 def v8i16 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
4107 OpcodeStr, !strconcat(Dt, "16"), v8i16, ShOp> {
4108 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4110 def v4i32 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
4111 OpcodeStr, !strconcat(Dt, "32"), v4i32, ShOp> {
4112 let Inst{21} = 0b1; // imm6 = 1xxxxx
4114 def v2i64 : N2VQShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
4115 OpcodeStr, !strconcat(Dt, "64"), v2i64, ShOp>;
4119 // Neon Shift-Insert vector operations,
4120 // with f of either N2RegVShLFrm or N2RegVShRFrm
4121 // element sizes of 8, 16, 32 and 64 bits:
4122 multiclass N2VShInsL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
4124 // 64-bit vector types.
4125 def v8i8 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
4126 N2RegVShLFrm, OpcodeStr, "8", v8i8, NEONvsliImm> {
4127 let Inst{21-19} = 0b001; // imm6 = 001xxx
4129 def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
4130 N2RegVShLFrm, OpcodeStr, "16", v4i16, NEONvsliImm> {
4131 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4133 def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
4134 N2RegVShLFrm, OpcodeStr, "32", v2i32, NEONvsliImm> {
4135 let Inst{21} = 0b1; // imm6 = 1xxxxx
4137 def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, i32imm,
4138 N2RegVShLFrm, OpcodeStr, "64", v1i64, NEONvsliImm>;
4141 // 128-bit vector types.
4142 def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
4143 N2RegVShLFrm, OpcodeStr, "8", v16i8, NEONvsliImm> {
4144 let Inst{21-19} = 0b001; // imm6 = 001xxx
4146 def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
4147 N2RegVShLFrm, OpcodeStr, "16", v8i16, NEONvsliImm> {
4148 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4150 def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
4151 N2RegVShLFrm, OpcodeStr, "32", v4i32, NEONvsliImm> {
4152 let Inst{21} = 0b1; // imm6 = 1xxxxx
4154 def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, i32imm,
4155 N2RegVShLFrm, OpcodeStr, "64", v2i64, NEONvsliImm>;
4158 multiclass N2VShInsR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
4160 // 64-bit vector types.
4161 def v8i8 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm8,
4162 N2RegVShRFrm, OpcodeStr, "8", v8i8, NEONvsriImm> {
4163 let Inst{21-19} = 0b001; // imm6 = 001xxx
4165 def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm16,
4166 N2RegVShRFrm, OpcodeStr, "16", v4i16, NEONvsriImm> {
4167 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4169 def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm32,
4170 N2RegVShRFrm, OpcodeStr, "32", v2i32, NEONvsriImm> {
4171 let Inst{21} = 0b1; // imm6 = 1xxxxx
4173 def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, shr_imm64,
4174 N2RegVShRFrm, OpcodeStr, "64", v1i64, NEONvsriImm>;
4177 // 128-bit vector types.
4178 def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm8,
4179 N2RegVShRFrm, OpcodeStr, "8", v16i8, NEONvsriImm> {
4180 let Inst{21-19} = 0b001; // imm6 = 001xxx
4182 def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm16,
4183 N2RegVShRFrm, OpcodeStr, "16", v8i16, NEONvsriImm> {
4184 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4186 def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm32,
4187 N2RegVShRFrm, OpcodeStr, "32", v4i32, NEONvsriImm> {
4188 let Inst{21} = 0b1; // imm6 = 1xxxxx
4190 def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, shr_imm64,
4191 N2RegVShRFrm, OpcodeStr, "64", v2i64, NEONvsriImm>;
4195 // Neon Shift Long operations,
4196 // element sizes of 8, 16, 32 bits:
4197 multiclass N2VLSh_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
4198 bit op4, string OpcodeStr, string Dt,
4199 SDPatternOperator OpNode> {
4200 def v8i16 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
4201 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, imm1_7, OpNode> {
4202 let Inst{21-19} = 0b001; // imm6 = 001xxx
4204 def v4i32 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
4205 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, imm1_15, OpNode> {
4206 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4208 def v2i64 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
4209 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, imm1_31, OpNode> {
4210 let Inst{21} = 0b1; // imm6 = 1xxxxx
4214 // Neon Shift Narrow operations,
4215 // element sizes of 16, 32, 64 bits:
4216 multiclass N2VNSh_HSD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
4217 bit op4, InstrItinClass itin, string OpcodeStr, string Dt,
4218 SDPatternOperator OpNode> {
4219 def v8i8 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
4220 OpcodeStr, !strconcat(Dt, "16"),
4221 v8i8, v8i16, shr_imm8, OpNode> {
4222 let Inst{21-19} = 0b001; // imm6 = 001xxx
4224 def v4i16 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
4225 OpcodeStr, !strconcat(Dt, "32"),
4226 v4i16, v4i32, shr_imm16, OpNode> {
4227 let Inst{21-20} = 0b01; // imm6 = 01xxxx
4229 def v2i32 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
4230 OpcodeStr, !strconcat(Dt, "64"),
4231 v2i32, v2i64, shr_imm32, OpNode> {
4232 let Inst{21} = 0b1; // imm6 = 1xxxxx
4236 //===----------------------------------------------------------------------===//
4237 // Instruction Definitions.
4238 //===----------------------------------------------------------------------===//
4240 // Vector Add Operations.
4242 // VADD : Vector Add (integer and floating-point)
4243 defm VADD : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd", "i",
4245 def VADDfd : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd", "f32",
4246 v2f32, v2f32, fadd, 1>;
4247 def VADDfq : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd", "f32",
4248 v4f32, v4f32, fadd, 1>;
4249 def VADDhd : N3VD<0, 0, 0b01, 0b1101, 0, IIC_VBIND, "vadd", "f16",
4250 v4f16, v4f16, fadd, 1>,
4251 Requires<[HasNEON,HasFullFP16]>;
4252 def VADDhq : N3VQ<0, 0, 0b01, 0b1101, 0, IIC_VBINQ, "vadd", "f16",
4253 v8f16, v8f16, fadd, 1>,
4254 Requires<[HasNEON,HasFullFP16]>;
4255 // VADDL : Vector Add Long (Q = D + D)
4256 defm VADDLs : N3VLExt_QHS<0,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
4257 "vaddl", "s", add, sext, 1>;
4258 defm VADDLu : N3VLExt_QHS<1,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
4259 "vaddl", "u", add, zanyext, 1>;
4260 // VADDW : Vector Add Wide (Q = Q + D)
4261 defm VADDWs : N3VW_QHS<0,1,0b0001,0, "vaddw", "s", add, sext, 0>;
4262 defm VADDWu : N3VW_QHS<1,1,0b0001,0, "vaddw", "u", add, zanyext, 0>;
4263 // VHADD : Vector Halving Add
4264 defm VHADDs : N3VInt_QHS<0, 0, 0b0000, 0, N3RegFrm,
4265 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4266 "vhadd", "s", int_arm_neon_vhadds, 1>;
4267 defm VHADDu : N3VInt_QHS<1, 0, 0b0000, 0, N3RegFrm,
4268 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4269 "vhadd", "u", int_arm_neon_vhaddu, 1>;
4270 // VRHADD : Vector Rounding Halving Add
4271 defm VRHADDs : N3VInt_QHS<0, 0, 0b0001, 0, N3RegFrm,
4272 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4273 "vrhadd", "s", int_arm_neon_vrhadds, 1>;
4274 defm VRHADDu : N3VInt_QHS<1, 0, 0b0001, 0, N3RegFrm,
4275 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4276 "vrhadd", "u", int_arm_neon_vrhaddu, 1>;
4277 // VQADD : Vector Saturating Add
4278 defm VQADDs : N3VInt_QHSD<0, 0, 0b0000, 1, N3RegFrm,
4279 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4280 "vqadd", "s", saddsat, 1>;
4281 defm VQADDu : N3VInt_QHSD<1, 0, 0b0000, 1, N3RegFrm,
4282 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4283 "vqadd", "u", uaddsat, 1>;
4284 // VADDHN : Vector Add and Narrow Returning High Half (D = Q + Q)
4285 defm VADDHN : N3VNInt_HSD<0,1,0b0100,0, "vaddhn", "i", null_frag, 1>;
4286 // VRADDHN : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
4287 defm VRADDHN : N3VNInt_HSD<1,1,0b0100,0, "vraddhn", "i",
4288 int_arm_neon_vraddhn, 1>;
4290 let Predicates = [HasNEON] in {
4291 def : Pat<(v8i8 (trunc (ARMvshruImm (add (v8i16 QPR:$Vn), QPR:$Vm), 8))),
4292 (VADDHNv8i8 QPR:$Vn, QPR:$Vm)>;
4293 def : Pat<(v4i16 (trunc (ARMvshruImm (add (v4i32 QPR:$Vn), QPR:$Vm), 16))),
4294 (VADDHNv4i16 QPR:$Vn, QPR:$Vm)>;
4295 def : Pat<(v2i32 (trunc (ARMvshruImm (add (v2i64 QPR:$Vn), QPR:$Vm), 32))),
4296 (VADDHNv2i32 QPR:$Vn, QPR:$Vm)>;
4299 // Vector Multiply Operations.
4301 // VMUL : Vector Multiply (integer, polynomial and floating-point)
4302 defm VMUL : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D,
4303 IIC_VMULi16Q, IIC_VMULi32Q, "vmul", "i", mul, 1>;
4304 def VMULpd : N3VDInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16D, "vmul",
4305 "p8", v8i8, v8i8, int_arm_neon_vmulp, 1>;
4306 def VMULpq : N3VQInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16Q, "vmul",
4307 "p8", v16i8, v16i8, int_arm_neon_vmulp, 1>;
4308 def VMULfd : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VFMULD, "vmul", "f32",
4309 v2f32, v2f32, fmul, 1>;
4310 def VMULfq : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VFMULQ, "vmul", "f32",
4311 v4f32, v4f32, fmul, 1>;
4312 def VMULhd : N3VD<1, 0, 0b01, 0b1101, 1, IIC_VFMULD, "vmul", "f16",
4313 v4f16, v4f16, fmul, 1>,
4314 Requires<[HasNEON,HasFullFP16]>;
4315 def VMULhq : N3VQ<1, 0, 0b01, 0b1101, 1, IIC_VFMULQ, "vmul", "f16",
4316 v8f16, v8f16, fmul, 1>,
4317 Requires<[HasNEON,HasFullFP16]>;
4318 defm VMULsl : N3VSL_HS<0b1000, "vmul", mul>;
4319 def VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul", "f32", v2f32, fmul>;
4320 def VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul", "f32", v4f32,
4322 def VMULslhd : N3VDSL16<0b01, 0b1001, "vmul", "f16", v4f16, fmul>,
4323 Requires<[HasNEON,HasFullFP16]>;
4324 def VMULslhq : N3VQSL16<0b01, 0b1001, "vmul", "f16", v8f16,
4326 Requires<[HasNEON,HasFullFP16]>;
4328 let Predicates = [HasNEON] in {
4329 def : Pat<(v8i16 (mul (v8i16 QPR:$src1),
4330 (v8i16 (ARMvduplane (v8i16 QPR:$src2), imm:$lane)))),
4331 (v8i16 (VMULslv8i16 (v8i16 QPR:$src1),
4332 (v4i16 (EXTRACT_SUBREG QPR:$src2,
4333 (DSubReg_i16_reg imm:$lane))),
4334 (SubReg_i16_lane imm:$lane)))>;
4335 def : Pat<(v4i32 (mul (v4i32 QPR:$src1),
4336 (v4i32 (ARMvduplane (v4i32 QPR:$src2), imm:$lane)))),
4337 (v4i32 (VMULslv4i32 (v4i32 QPR:$src1),
4338 (v2i32 (EXTRACT_SUBREG QPR:$src2,
4339 (DSubReg_i32_reg imm:$lane))),
4340 (SubReg_i32_lane imm:$lane)))>;
4341 def : Pat<(v4f32 (fmul (v4f32 QPR:$src1),
4342 (v4f32 (ARMvduplane (v4f32 QPR:$src2), imm:$lane)))),
4343 (v4f32 (VMULslfq (v4f32 QPR:$src1),
4344 (v2f32 (EXTRACT_SUBREG QPR:$src2,
4345 (DSubReg_i32_reg imm:$lane))),
4346 (SubReg_i32_lane imm:$lane)))>;
4347 def : Pat<(v8f16 (fmul (v8f16 QPR:$src1),
4348 (v8f16 (ARMvduplane (v8f16 QPR:$src2), imm:$lane)))),
4349 (v8f16 (VMULslhq(v8f16 QPR:$src1),
4350 (v4f16 (EXTRACT_SUBREG QPR:$src2,
4351 (DSubReg_i16_reg imm:$lane))),
4352 (SubReg_i16_lane imm:$lane)))>;
4354 def : Pat<(v2f32 (fmul DPR:$Rn, (ARMvdup (f32 SPR:$Rm)))),
4356 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$Rm, ssub_0),
4358 def : Pat<(v4f16 (fmul DPR:$Rn, (ARMvdup (f16 HPR:$Rm)))),
4360 (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), (f16 HPR:$Rm), ssub_0),
4362 def : Pat<(v4f32 (fmul QPR:$Rn, (ARMvdup (f32 SPR:$Rm)))),
4364 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$Rm, ssub_0),
4366 def : Pat<(v8f16 (fmul QPR:$Rn, (ARMvdup (f16 HPR:$Rm)))),
4368 (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), (f16 HPR:$Rm), ssub_0),
4372 // VQDMULH : Vector Saturating Doubling Multiply Returning High Half
4373 defm VQDMULH : N3VInt_HS<0, 0, 0b1011, 0, N3RegFrm, IIC_VMULi16D, IIC_VMULi32D,
4374 IIC_VMULi16Q, IIC_VMULi32Q,
4375 "vqdmulh", "s", int_arm_neon_vqdmulh, 1>;
4376 defm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D,
4377 IIC_VMULi16Q, IIC_VMULi32Q,
4378 "vqdmulh", "s", int_arm_neon_vqdmulh>;
4380 let Predicates = [HasNEON] in {
4381 def : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1),
4382 (v8i16 (ARMvduplane (v8i16 QPR:$src2),
4384 (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1),
4385 (v4i16 (EXTRACT_SUBREG QPR:$src2,
4386 (DSubReg_i16_reg imm:$lane))),
4387 (SubReg_i16_lane imm:$lane)))>;
4388 def : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1),
4389 (v4i32 (ARMvduplane (v4i32 QPR:$src2),
4391 (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1),
4392 (v2i32 (EXTRACT_SUBREG QPR:$src2,
4393 (DSubReg_i32_reg imm:$lane))),
4394 (SubReg_i32_lane imm:$lane)))>;
4397 // VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
4398 defm VQRDMULH : N3VInt_HS<1, 0, 0b1011, 0, N3RegFrm,
4399 IIC_VMULi16D,IIC_VMULi32D,IIC_VMULi16Q,IIC_VMULi32Q,
4400 "vqrdmulh", "s", int_arm_neon_vqrdmulh, 1>;
4401 defm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D,
4402 IIC_VMULi16Q, IIC_VMULi32Q,
4403 "vqrdmulh", "s", int_arm_neon_vqrdmulh>;
4405 let Predicates = [HasNEON] in {
4406 def : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1),
4407 (v8i16 (ARMvduplane (v8i16 QPR:$src2),
4409 (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1),
4410 (v4i16 (EXTRACT_SUBREG QPR:$src2,
4411 (DSubReg_i16_reg imm:$lane))),
4412 (SubReg_i16_lane imm:$lane)))>;
4413 def : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1),
4414 (v4i32 (ARMvduplane (v4i32 QPR:$src2),
4416 (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1),
4417 (v2i32 (EXTRACT_SUBREG QPR:$src2,
4418 (DSubReg_i32_reg imm:$lane))),
4419 (SubReg_i32_lane imm:$lane)))>;
4422 // VMULL : Vector Multiply Long (integer and polynomial) (Q = D * D)
4423 let PostEncoderMethod = "NEONThumb2DataIPostEncoder",
4424 DecoderNamespace = "NEONData" in {
4425 defm VMULLs : N3VL_QHS<0,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
4426 "vmull", "s", ARMvmulls, 1>;
4427 defm VMULLu : N3VL_QHS<1,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
4428 "vmull", "u", ARMvmullu, 1>;
4429 def VMULLp8 : N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull", "p8",
4430 v8i16, v8i8, int_arm_neon_vmullp, 1>;
4431 def VMULLp64 : N3VLIntnp<0b00101, 0b10, 0b1110, 0, 0, NoItinerary,
4432 "vmull", "p64", v2i64, v1i64, int_arm_neon_vmullp, 1>,
4433 Requires<[HasV8, HasAES]>;
4435 defm VMULLsls : N3VLSL_HS<0, 0b1010, IIC_VMULi16D, "vmull", "s", ARMvmulls>;
4436 defm VMULLslu : N3VLSL_HS<1, 0b1010, IIC_VMULi16D, "vmull", "u", ARMvmullu>;
4438 // VQDMULL : Vector Saturating Doubling Multiply Long (Q = D * D)
4439 defm VQDMULL : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, IIC_VMULi32D,
4440 "vqdmull", "s", int_arm_neon_vqdmull, 1>;
4441 defm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D,
4442 "vqdmull", "s", int_arm_neon_vqdmull>;
4444 // Vector Multiply-Accumulate and Multiply-Subtract Operations.
4446 // VMLA : Vector Multiply Accumulate (integer and floating-point)
4447 defm VMLA : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
4448 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
4449 def VMLAfd : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla", "f32",
4450 v2f32, fmul_su, fadd_mlx>,
4451 Requires<[HasNEON, UseFPVMLx]>;
4452 def VMLAfq : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla", "f32",
4453 v4f32, fmul_su, fadd_mlx>,
4454 Requires<[HasNEON, UseFPVMLx]>;
4455 def VMLAhd : N3VDMulOp<0, 0, 0b01, 0b1101, 1, IIC_VMACD, "vmla", "f16",
4456 v4f16, fmul_su, fadd_mlx>,
4457 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4458 def VMLAhq : N3VQMulOp<0, 0, 0b01, 0b1101, 1, IIC_VMACQ, "vmla", "f16",
4459 v8f16, fmul_su, fadd_mlx>,
4460 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4461 defm VMLAsl : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D,
4462 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
4463 def VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla", "f32",
4464 v2f32, fmul_su, fadd_mlx>,
4465 Requires<[HasNEON, UseFPVMLx]>;
4466 def VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla", "f32",
4467 v4f32, v2f32, fmul_su, fadd_mlx>,
4468 Requires<[HasNEON, UseFPVMLx]>;
4469 def VMLAslhd : N3VDMulOpSL16<0b01, 0b0001, IIC_VMACD, "vmla", "f16",
4471 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4472 def VMLAslhq : N3VQMulOpSL16<0b01, 0b0001, IIC_VMACQ, "vmla", "f16",
4473 v8f16, v4f16, fmul, fadd>,
4474 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4476 let Predicates = [HasNEON] in {
4477 def : Pat<(v8i16 (add (v8i16 QPR:$src1),
4478 (mul (v8i16 QPR:$src2),
4479 (v8i16 (ARMvduplane (v8i16 QPR:$src3), imm:$lane))))),
4480 (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
4481 (v4i16 (EXTRACT_SUBREG QPR:$src3,
4482 (DSubReg_i16_reg imm:$lane))),
4483 (SubReg_i16_lane imm:$lane)))>;
4485 def : Pat<(v4i32 (add (v4i32 QPR:$src1),
4486 (mul (v4i32 QPR:$src2),
4487 (v4i32 (ARMvduplane (v4i32 QPR:$src3), imm:$lane))))),
4488 (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
4489 (v2i32 (EXTRACT_SUBREG QPR:$src3,
4490 (DSubReg_i32_reg imm:$lane))),
4491 (SubReg_i32_lane imm:$lane)))>;
4494 def : Pat<(v4f32 (fadd_mlx (v4f32 QPR:$src1),
4495 (fmul_su (v4f32 QPR:$src2),
4496 (v4f32 (ARMvduplane (v4f32 QPR:$src3), imm:$lane))))),
4497 (v4f32 (VMLAslfq (v4f32 QPR:$src1),
4499 (v2f32 (EXTRACT_SUBREG QPR:$src3,
4500 (DSubReg_i32_reg imm:$lane))),
4501 (SubReg_i32_lane imm:$lane)))>,
4502 Requires<[HasNEON, UseFPVMLx]>;
4504 // VMLAL : Vector Multiply Accumulate Long (Q += D * D)
4505 defm VMLALs : N3VLMulOp_QHS<0,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
4506 "vmlal", "s", ARMvmulls, add>;
4507 defm VMLALu : N3VLMulOp_QHS<1,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
4508 "vmlal", "u", ARMvmullu, add>;
4510 defm VMLALsls : N3VLMulOpSL_HS<0, 0b0010, "vmlal", "s", ARMvmulls, add>;
4511 defm VMLALslu : N3VLMulOpSL_HS<1, 0b0010, "vmlal", "u", ARMvmullu, add>;
4513 let Predicates = [HasNEON, HasV8_1a] in {
4514 // v8.1a Neon Rounding Double Multiply-Op vector operations,
4515 // VQRDMLAH : Vector Saturating Rounding Doubling Multiply Accumulate Long
4517 defm VQRDMLAH : N3VInt3_HS<1, 0, 0b1011, 1, IIC_VMACi16D, IIC_VMACi32D,
4518 IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlah", "s",
4520 def : Pat<(v4i16 (saddsat
4522 (v4i16 (int_arm_neon_vqrdmulh (v4i16 DPR:$Vn),
4523 (v4i16 DPR:$Vm))))),
4524 (v4i16 (VQRDMLAHv4i16 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
4525 def : Pat<(v2i32 (saddsat
4527 (v2i32 (int_arm_neon_vqrdmulh (v2i32 DPR:$Vn),
4528 (v2i32 DPR:$Vm))))),
4529 (v2i32 (VQRDMLAHv2i32 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
4530 def : Pat<(v8i16 (saddsat
4532 (v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$Vn),
4533 (v8i16 QPR:$Vm))))),
4534 (v8i16 (VQRDMLAHv8i16 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
4535 def : Pat<(v4i32 (saddsat
4537 (v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$Vn),
4538 (v4i32 QPR:$Vm))))),
4539 (v4i32 (VQRDMLAHv4i32 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
4541 defm VQRDMLAHsl : N3VMulOpSL_HS<0b1110, IIC_VMACi16D, IIC_VMACi32D,
4542 IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlah", "s",
4544 def : Pat<(v4i16 (saddsat
4546 (v4i16 (int_arm_neon_vqrdmulh
4548 (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
4550 (v4i16 (VQRDMLAHslv4i16 DPR:$src1, DPR:$Vn, DPR_8:$Vm,
4552 def : Pat<(v2i32 (saddsat
4554 (v2i32 (int_arm_neon_vqrdmulh
4556 (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
4558 (v2i32 (VQRDMLAHslv2i32 DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
4560 def : Pat<(v8i16 (saddsat
4562 (v8i16 (int_arm_neon_vqrdmulh
4564 (v8i16 (ARMvduplane (v8i16 QPR:$src3),
4566 (v8i16 (VQRDMLAHslv8i16 (v8i16 QPR:$src1),
4568 (v4i16 (EXTRACT_SUBREG
4570 (DSubReg_i16_reg imm:$lane))),
4571 (SubReg_i16_lane imm:$lane)))>;
4572 def : Pat<(v4i32 (saddsat
4574 (v4i32 (int_arm_neon_vqrdmulh
4576 (v4i32 (ARMvduplane (v4i32 QPR:$src3),
4578 (v4i32 (VQRDMLAHslv4i32 (v4i32 QPR:$src1),
4580 (v2i32 (EXTRACT_SUBREG
4582 (DSubReg_i32_reg imm:$lane))),
4583 (SubReg_i32_lane imm:$lane)))>;
4585 // VQRDMLSH : Vector Saturating Rounding Doubling Multiply Subtract Long
4587 defm VQRDMLSH : N3VInt3_HS<1, 0, 0b1100, 1, IIC_VMACi16D, IIC_VMACi32D,
4588 IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlsh", "s",
4590 def : Pat<(v4i16 (ssubsat
4592 (v4i16 (int_arm_neon_vqrdmulh (v4i16 DPR:$Vn),
4593 (v4i16 DPR:$Vm))))),
4594 (v4i16 (VQRDMLSHv4i16 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
4595 def : Pat<(v2i32 (ssubsat
4597 (v2i32 (int_arm_neon_vqrdmulh (v2i32 DPR:$Vn),
4598 (v2i32 DPR:$Vm))))),
4599 (v2i32 (VQRDMLSHv2i32 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
4600 def : Pat<(v8i16 (ssubsat
4602 (v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$Vn),
4603 (v8i16 QPR:$Vm))))),
4604 (v8i16 (VQRDMLSHv8i16 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
4605 def : Pat<(v4i32 (ssubsat
4607 (v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$Vn),
4608 (v4i32 QPR:$Vm))))),
4609 (v4i32 (VQRDMLSHv4i32 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
4611 defm VQRDMLSHsl : N3VMulOpSL_HS<0b1111, IIC_VMACi16D, IIC_VMACi32D,
4612 IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlsh", "s",
4614 def : Pat<(v4i16 (ssubsat
4616 (v4i16 (int_arm_neon_vqrdmulh
4618 (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
4620 (v4i16 (VQRDMLSHslv4i16 DPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane))>;
4621 def : Pat<(v2i32 (ssubsat
4623 (v2i32 (int_arm_neon_vqrdmulh
4625 (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
4627 (v2i32 (VQRDMLSHslv2i32 DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
4629 def : Pat<(v8i16 (ssubsat
4631 (v8i16 (int_arm_neon_vqrdmulh
4633 (v8i16 (ARMvduplane (v8i16 QPR:$src3),
4635 (v8i16 (VQRDMLSHslv8i16 (v8i16 QPR:$src1),
4637 (v4i16 (EXTRACT_SUBREG
4639 (DSubReg_i16_reg imm:$lane))),
4640 (SubReg_i16_lane imm:$lane)))>;
4641 def : Pat<(v4i32 (ssubsat
4643 (v4i32 (int_arm_neon_vqrdmulh
4645 (v4i32 (ARMvduplane (v4i32 QPR:$src3),
4647 (v4i32 (VQRDMLSHslv4i32 (v4i32 QPR:$src1),
4649 (v2i32 (EXTRACT_SUBREG
4651 (DSubReg_i32_reg imm:$lane))),
4652 (SubReg_i32_lane imm:$lane)))>;
4654 // VQDMLAL : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
4655 defm VQDMLAL : N3VLInt3_HS<0, 1, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
4656 "vqdmlal", "s", null_frag>;
4657 defm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal", "s", null_frag>;
4659 let Predicates = [HasNEON] in {
4660 def : Pat<(v4i32 (saddsat (v4i32 QPR:$src1),
4661 (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
4662 (v4i16 DPR:$Vm))))),
4663 (VQDMLALv4i32 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4664 def : Pat<(v2i64 (saddsat (v2i64 QPR:$src1),
4665 (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
4666 (v2i32 DPR:$Vm))))),
4667 (VQDMLALv2i64 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4668 def : Pat<(v4i32 (saddsat (v4i32 QPR:$src1),
4669 (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
4670 (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
4672 (VQDMLALslv4i16 QPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane)>;
4673 def : Pat<(v2i64 (saddsat (v2i64 QPR:$src1),
4674 (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
4675 (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
4677 (VQDMLALslv2i32 QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, imm:$lane)>;
4680 // VMLS : Vector Multiply Subtract (integer and floating-point)
4681 defm VMLS : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
4682 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
4683 def VMLSfd : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls", "f32",
4684 v2f32, fmul_su, fsub_mlx>,
4685 Requires<[HasNEON, UseFPVMLx]>;
4686 def VMLSfq : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls", "f32",
4687 v4f32, fmul_su, fsub_mlx>,
4688 Requires<[HasNEON, UseFPVMLx]>;
4689 def VMLShd : N3VDMulOp<0, 0, 0b11, 0b1101, 1, IIC_VMACD, "vmls", "f16",
4691 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4692 def VMLShq : N3VQMulOp<0, 0, 0b11, 0b1101, 1, IIC_VMACQ, "vmls", "f16",
4694 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4695 defm VMLSsl : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D,
4696 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
4697 def VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls", "f32",
4698 v2f32, fmul_su, fsub_mlx>,
4699 Requires<[HasNEON, UseFPVMLx]>;
4700 def VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls", "f32",
4701 v4f32, v2f32, fmul_su, fsub_mlx>,
4702 Requires<[HasNEON, UseFPVMLx]>;
4703 def VMLSslhd : N3VDMulOpSL16<0b01, 0b0101, IIC_VMACD, "vmls", "f16",
4705 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4706 def VMLSslhq : N3VQMulOpSL16<0b01, 0b0101, IIC_VMACQ, "vmls", "f16",
4707 v8f16, v4f16, fmul, fsub>,
4708 Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
4710 let Predicates = [HasNEON] in {
4711 def : Pat<(v8i16 (sub (v8i16 QPR:$src1),
4712 (mul (v8i16 QPR:$src2),
4713 (v8i16 (ARMvduplane (v8i16 QPR:$src3), imm:$lane))))),
4714 (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
4715 (v4i16 (EXTRACT_SUBREG QPR:$src3,
4716 (DSubReg_i16_reg imm:$lane))),
4717 (SubReg_i16_lane imm:$lane)))>;
4719 def : Pat<(v4i32 (sub (v4i32 QPR:$src1),
4720 (mul (v4i32 QPR:$src2),
4721 (v4i32 (ARMvduplane (v4i32 QPR:$src3), imm:$lane))))),
4722 (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
4723 (v2i32 (EXTRACT_SUBREG QPR:$src3,
4724 (DSubReg_i32_reg imm:$lane))),
4725 (SubReg_i32_lane imm:$lane)))>;
4728 def : Pat<(v4f32 (fsub_mlx (v4f32 QPR:$src1),
4729 (fmul_su (v4f32 QPR:$src2),
4730 (v4f32 (ARMvduplane (v4f32 QPR:$src3), imm:$lane))))),
4731 (v4f32 (VMLSslfq (v4f32 QPR:$src1), (v4f32 QPR:$src2),
4732 (v2f32 (EXTRACT_SUBREG QPR:$src3,
4733 (DSubReg_i32_reg imm:$lane))),
4734 (SubReg_i32_lane imm:$lane)))>,
4735 Requires<[HasNEON, UseFPVMLx]>;
4737 // VMLSL : Vector Multiply Subtract Long (Q -= D * D)
4738 defm VMLSLs : N3VLMulOp_QHS<0,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
4739 "vmlsl", "s", ARMvmulls, sub>;
4740 defm VMLSLu : N3VLMulOp_QHS<1,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
4741 "vmlsl", "u", ARMvmullu, sub>;
4743 defm VMLSLsls : N3VLMulOpSL_HS<0, 0b0110, "vmlsl", "s", ARMvmulls, sub>;
4744 defm VMLSLslu : N3VLMulOpSL_HS<1, 0b0110, "vmlsl", "u", ARMvmullu, sub>;
4746 // VQDMLSL : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
4747 defm VQDMLSL : N3VLInt3_HS<0, 1, 0b1011, 0, IIC_VMACi16D, IIC_VMACi32D,
4748 "vqdmlsl", "s", null_frag>;
4749 defm VQDMLSLsl: N3VLInt3SL_HS<0, 0b0111, "vqdmlsl", "s", null_frag>;
4751 let Predicates = [HasNEON] in {
4752 def : Pat<(v4i32 (ssubsat (v4i32 QPR:$src1),
4753 (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
4754 (v4i16 DPR:$Vm))))),
4755 (VQDMLSLv4i32 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4756 def : Pat<(v2i64 (ssubsat (v2i64 QPR:$src1),
4757 (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
4758 (v2i32 DPR:$Vm))))),
4759 (VQDMLSLv2i64 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4760 def : Pat<(v4i32 (ssubsat (v4i32 QPR:$src1),
4761 (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
4762 (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
4764 (VQDMLSLslv4i16 QPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane)>;
4765 def : Pat<(v2i64 (ssubsat (v2i64 QPR:$src1),
4766 (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
4767 (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
4769 (VQDMLSLslv2i32 QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, imm:$lane)>;
4772 // Fused Vector Multiply-Accumulate and Fused Multiply-Subtract Operations.
4773 def VFMAfd : N3VDMulOp<0, 0, 0b00, 0b1100, 1, IIC_VFMACD, "vfma", "f32",
4774 v2f32, fmul_su, fadd_mlx>,
4775 Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
4777 def VFMAfq : N3VQMulOp<0, 0, 0b00, 0b1100, 1, IIC_VFMACQ, "vfma", "f32",
4778 v4f32, fmul_su, fadd_mlx>,
4779 Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
4780 def VFMAhd : N3VDMulOp<0, 0, 0b01, 0b1100, 1, IIC_VFMACD, "vfma", "f16",
4782 Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
4784 def VFMAhq : N3VQMulOp<0, 0, 0b01, 0b1100, 1, IIC_VFMACQ, "vfma", "f16",
4786 Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
4788 // Fused Vector Multiply Subtract (floating-point)
4789 def VFMSfd : N3VDMulOp<0, 0, 0b10, 0b1100, 1, IIC_VFMACD, "vfms", "f32",
4790 v2f32, fmul_su, fsub_mlx>,
4791 Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
4792 def VFMSfq : N3VQMulOp<0, 0, 0b10, 0b1100, 1, IIC_VFMACQ, "vfms", "f32",
4793 v4f32, fmul_su, fsub_mlx>,
4794 Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
4795 def VFMShd : N3VDMulOp<0, 0, 0b11, 0b1100, 1, IIC_VFMACD, "vfms", "f16",
4797 Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
4798 def VFMShq : N3VQMulOp<0, 0, 0b11, 0b1100, 1, IIC_VFMACQ, "vfms", "f16",
4800 Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
4802 // Match @llvm.fma.* intrinsics
4803 def : Pat<(v4f16 (fma DPR:$Vn, DPR:$Vm, DPR:$src1)),
4804 (VFMAhd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
4805 Requires<[HasNEON,HasFullFP16]>;
4806 def : Pat<(v8f16 (fma QPR:$Vn, QPR:$Vm, QPR:$src1)),
4807 (VFMAhq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
4808 Requires<[HasNEON,HasFullFP16]>;
4809 def : Pat<(v2f32 (fma DPR:$Vn, DPR:$Vm, DPR:$src1)),
4810 (VFMAfd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
4811 Requires<[HasNEON,HasVFP4]>;
4812 def : Pat<(v4f32 (fma QPR:$Vn, QPR:$Vm, QPR:$src1)),
4813 (VFMAfq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
4814 Requires<[HasNEON,HasVFP4]>;
4815 def : Pat<(v2f32 (fma (fneg DPR:$Vn), DPR:$Vm, DPR:$src1)),
4816 (VFMSfd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
4817 Requires<[HasNEON,HasVFP4]>;
4818 def : Pat<(v4f32 (fma (fneg QPR:$Vn), QPR:$Vm, QPR:$src1)),
4819 (VFMSfq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
4820 Requires<[HasNEON,HasVFP4]>;
4822 // ARMv8.2a dot product instructions.
4823 // We put them in the VFPV8 decoder namespace because the ARM and Thumb
4824 // encodings are the same and thus no further bit twiddling is necessary
4825 // in the disassembler.
4826 class VDOT<bit op6, bit op4, bit op23, RegisterClass RegTy, string Asm,
4827 string AsmTy, ValueType AccumTy, ValueType InputTy,
4828 SDPatternOperator OpNode> :
4829 N3Vnp<{0b1100, op23}, 0b10, 0b1101, op6, op4, (outs RegTy:$dst),
4830 (ins RegTy:$Vd, RegTy:$Vn, RegTy:$Vm), N3RegFrm, IIC_VDOTPROD,
4832 [(set (AccumTy RegTy:$dst),
4833 (OpNode (AccumTy RegTy:$Vd),
4834 (InputTy RegTy:$Vn),
4835 (InputTy RegTy:$Vm)))]> {
4836 let Predicates = [HasDotProd];
4837 let DecoderNamespace = "VFPV8";
4838 let Constraints = "$dst = $Vd";
4841 def VUDOTD : VDOT<0, 1, 0, DPR, "vudot", "u8", v2i32, v8i8, int_arm_neon_udot>;
4842 def VSDOTD : VDOT<0, 0, 0, DPR, "vsdot", "s8", v2i32, v8i8, int_arm_neon_sdot>;
4843 def VUDOTQ : VDOT<1, 1, 0, QPR, "vudot", "u8", v4i32, v16i8, int_arm_neon_udot>;
4844 def VSDOTQ : VDOT<1, 0, 0, QPR, "vsdot", "s8", v4i32, v16i8, int_arm_neon_sdot>;
4846 // Indexed dot product instructions:
4847 multiclass DOTI<string opc, string dt, bit Q, bit U, RegisterClass Ty,
4848 ValueType AccumType, ValueType InputType, SDPatternOperator OpNode,
4850 def "" : N3Vnp<0b11100, 0b10, 0b1101, Q, U, (outs Ty:$dst),
4851 (ins Ty:$Vd, Ty:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
4852 N3RegFrm, IIC_VDOTPROD, opc, dt, []> {
4855 let AsmString = !strconcat(opc, ".", dt, "\t$Vd, $Vn, $Vm$lane");
4856 let Constraints = "$dst = $Vd";
4857 let Predicates = [HasDotProd];
4858 let DecoderNamespace = "VFPV8";
4862 (AccumType (OpNode (AccumType Ty:$Vd),
4864 (InputType (bitconvert (AccumType
4865 (ARMvduplane (AccumType Ty:$Vm),
4866 VectorIndex32:$lane)))))),
4867 (!cast<Instruction>(NAME) Ty:$Vd, Ty:$Vn, RHS, VectorIndex32:$lane)>;
4870 defm VUDOTDI : DOTI<"vudot", "u8", 0b0, 0b1, DPR, v2i32, v8i8,
4871 int_arm_neon_udot, (v2i32 DPR_VFP2:$Vm)>;
4872 defm VSDOTDI : DOTI<"vsdot", "s8", 0b0, 0b0, DPR, v2i32, v8i8,
4873 int_arm_neon_sdot, (v2i32 DPR_VFP2:$Vm)>;
4874 defm VUDOTQI : DOTI<"vudot", "u8", 0b1, 0b1, QPR, v4i32, v16i8,
4875 int_arm_neon_udot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
4876 defm VSDOTQI : DOTI<"vsdot", "s8", 0b1, 0b0, QPR, v4i32, v16i8,
4877 int_arm_neon_sdot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
4879 // v8.6A matrix multiplication extension
4880 let Predicates = [HasMatMulInt8] in {
4881 class N3VMatMul<bit B, bit U, string Asm, string AsmTy,
4882 SDPatternOperator OpNode>
4883 : N3Vnp<{0b1100, B}, 0b10, 0b1100, 1, U, (outs QPR:$dst),
4884 (ins QPR:$Vd, QPR:$Vn, QPR:$Vm), N3RegFrm, NoItinerary,
4886 [(set (v4i32 QPR:$dst), (OpNode (v4i32 QPR:$Vd),
4888 (v16i8 QPR:$Vm)))]> {
4889 let DecoderNamespace = "VFPV8";
4890 let Constraints = "$dst = $Vd";
4893 multiclass N3VMixedDotLane<bit Q, bit U, string Asm, string AsmTy, RegisterClass RegTy,
4894 ValueType AccumTy, ValueType InputTy, SDPatternOperator OpNode,
4897 def "" : N3Vnp<0b11101, 0b00, 0b1101, Q, U, (outs RegTy:$dst),
4898 (ins RegTy:$Vd, RegTy:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane), N3RegFrm,
4899 NoItinerary, Asm, AsmTy, []> {
4902 let AsmString = !strconcat(Asm, ".", AsmTy, "\t$Vd, $Vn, $Vm$lane");
4903 let DecoderNamespace = "VFPV8";
4904 let Constraints = "$dst = $Vd";
4908 (AccumTy (OpNode (AccumTy RegTy:$Vd),
4909 (InputTy RegTy:$Vn),
4910 (InputTy (bitconvert (AccumTy
4911 (ARMvduplane (AccumTy RegTy:$Vm),
4912 VectorIndex32:$lane)))))),
4913 (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
4917 multiclass SUDOTLane<bit Q, RegisterClass RegTy, ValueType AccumTy, ValueType InputTy, dag RHS>
4918 : N3VMixedDotLane<Q, 1, "vsudot", "u8", RegTy, AccumTy, InputTy, null_frag, null_frag> {
4920 (AccumTy (int_arm_neon_usdot (AccumTy RegTy:$Vd),
4921 (InputTy (bitconvert (AccumTy
4922 (ARMvduplane (AccumTy RegTy:$Vm),
4923 VectorIndex32:$lane)))),
4924 (InputTy RegTy:$Vn))),
4925 (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
4928 def VSMMLA : N3VMatMul<0, 0, "vsmmla", "s8", int_arm_neon_smmla>;
4929 def VUMMLA : N3VMatMul<0, 1, "vummla", "u8", int_arm_neon_ummla>;
4930 def VUSMMLA : N3VMatMul<1, 0, "vusmmla", "s8", int_arm_neon_usmmla>;
4931 def VUSDOTD : VDOT<0, 0, 1, DPR, "vusdot", "s8", v2i32, v8i8, int_arm_neon_usdot>;
4932 def VUSDOTQ : VDOT<1, 0, 1, QPR, "vusdot", "s8", v4i32, v16i8, int_arm_neon_usdot>;
4934 defm VUSDOTDI : N3VMixedDotLane<0, 0, "vusdot", "s8", DPR, v2i32, v8i8,
4935 int_arm_neon_usdot, (v2i32 DPR_VFP2:$Vm)>;
4936 defm VUSDOTQI : N3VMixedDotLane<1, 0, "vusdot", "s8", QPR, v4i32, v16i8,
4937 int_arm_neon_usdot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
4938 defm VSUDOTDI : SUDOTLane<0, DPR, v2i32, v8i8, (v2i32 DPR_VFP2:$Vm)>;
4939 defm VSUDOTQI : SUDOTLane<1, QPR, v4i32, v16i8, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
4942 // ARMv8.3 complex operations
4943 class BaseN3VCP8ComplexTied<bit op21, bit op4, bit s, bit q,
4944 InstrItinClass itin, dag oops, dag iops,
4945 string opc, string dt, list<dag> pattern>
4946 : N3VCP8<{?,?}, {op21,s}, q, op4, oops,
4947 iops, itin, opc, dt, "$Vd, $Vn, $Vm, $rot", "$src1 = $Vd", pattern>{
4949 let Inst{24-23} = rot;
4952 class BaseN3VCP8ComplexOdd<bit op23, bit op21, bit op4, bit s, bit q,
4953 InstrItinClass itin, dag oops, dag iops, string opc,
4954 string dt, list<dag> pattern>
4955 : N3VCP8<{?,op23}, {op21,s}, q, op4, oops,
4956 iops, itin, opc, dt, "$Vd, $Vn, $Vm, $rot", "", pattern> {
4961 class BaseN3VCP8ComplexTiedLane32<bit op4, bit s, bit q, InstrItinClass itin,
4962 dag oops, dag iops, string opc, string dt,
4964 : N3VLaneCP8<s, {?,?}, q, op4, oops, iops, itin, opc, dt,
4965 "$Vd, $Vn, $Vm$lane, $rot", "$src1 = $Vd", pattern> {
4969 let Inst{21-20} = rot;
4973 class BaseN3VCP8ComplexTiedLane64<bit op4, bit s, bit q, InstrItinClass itin,
4974 dag oops, dag iops, string opc, string dt,
4976 : N3VLaneCP8<s, {?,?}, q, op4, oops, iops, itin, opc, dt,
4977 "$Vd, $Vn, $Vm$lane, $rot", "$src1 = $Vd", pattern> {
4981 let Inst{21-20} = rot;
4982 let Inst{5} = Vm{4};
4983 // This is needed because the lane operand does not have any bits in the
4984 // encoding (it only has one possible value), so we need to manually set it
4985 // to it's default value.
4986 let DecoderMethod = "DecodeNEONComplexLane64Instruction";
4989 multiclass N3VCP8ComplexTied<bit op21, bit op4,
4990 string OpcodeStr, SDPatternOperator Op> {
4991 let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
4992 def v4f16 : BaseN3VCP8ComplexTied<op21, op4, 0, 0, IIC_VMACD, (outs DPR:$Vd),
4993 (ins DPR:$src1, DPR:$Vn, DPR:$Vm, complexrotateop:$rot),
4994 OpcodeStr, "f16", []>;
4995 def v8f16 : BaseN3VCP8ComplexTied<op21, op4, 0, 1, IIC_VMACQ, (outs QPR:$Vd),
4996 (ins QPR:$src1, QPR:$Vn, QPR:$Vm, complexrotateop:$rot),
4997 OpcodeStr, "f16", []>;
4999 let Predicates = [HasNEON,HasV8_3a] in {
5000 def v2f32 : BaseN3VCP8ComplexTied<op21, op4, 1, 0, IIC_VMACD, (outs DPR:$Vd),
5001 (ins DPR:$src1, DPR:$Vn, DPR:$Vm, complexrotateop:$rot),
5002 OpcodeStr, "f32", []>;
5003 def v4f32 : BaseN3VCP8ComplexTied<op21, op4, 1, 1, IIC_VMACQ, (outs QPR:$Vd),
5004 (ins QPR:$src1, QPR:$Vn, QPR:$Vm, complexrotateop:$rot),
5005 OpcodeStr, "f32", []>;
5009 multiclass N3VCP8ComplexOdd<bit op23, bit op21, bit op4,
5010 string OpcodeStr, SDPatternOperator Op> {
5011 let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
5012 def v4f16 : BaseN3VCP8ComplexOdd<op23, op21, op4, 0, 0, IIC_VMACD,
5014 (ins DPR:$Vn, DPR:$Vm, complexrotateopodd:$rot),
5015 OpcodeStr, "f16", []>;
5016 def v8f16 : BaseN3VCP8ComplexOdd<op23, op21, op4, 0, 1, IIC_VMACQ,
5018 (ins QPR:$Vn, QPR:$Vm, complexrotateopodd:$rot),
5019 OpcodeStr, "f16", []>;
5021 let Predicates = [HasNEON,HasV8_3a] in {
5022 def v2f32 : BaseN3VCP8ComplexOdd<op23, op21, op4, 1, 0, IIC_VMACD,
5024 (ins DPR:$Vn, DPR:$Vm, complexrotateopodd:$rot),
5025 OpcodeStr, "f32", []>;
5026 def v4f32 : BaseN3VCP8ComplexOdd<op23, op21, op4, 1, 1, IIC_VMACQ,
5028 (ins QPR:$Vn, QPR:$Vm, complexrotateopodd:$rot),
5029 OpcodeStr, "f32", []>;
5033 // These instructions index by pairs of lanes, so the VectorIndexes are twice
5034 // as wide as the data types.
5035 multiclass N3VCP8ComplexTiedLane<bit op4, string OpcodeStr,
5036 SDPatternOperator Op> {
5037 let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
5038 def v4f16_indexed : BaseN3VCP8ComplexTiedLane32<op4, 0, 0, IIC_VMACD,
5040 (ins DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
5041 VectorIndex32:$lane, complexrotateop:$rot),
5042 OpcodeStr, "f16", []>;
5043 def v8f16_indexed : BaseN3VCP8ComplexTiedLane32<op4, 0, 1, IIC_VMACQ,
5045 (ins QPR:$src1, QPR:$Vn, DPR_VFP2:$Vm,
5046 VectorIndex32:$lane, complexrotateop:$rot),
5047 OpcodeStr, "f16", []>;
5049 let Predicates = [HasNEON,HasV8_3a] in {
5050 def v2f32_indexed : BaseN3VCP8ComplexTiedLane64<op4, 1, 0, IIC_VMACD,
5052 (ins DPR:$src1, DPR:$Vn, DPR:$Vm, VectorIndex64:$lane,
5053 complexrotateop:$rot),
5054 OpcodeStr, "f32", []>;
5055 def v4f32_indexed : BaseN3VCP8ComplexTiedLane64<op4, 1, 1, IIC_VMACQ,
5057 (ins QPR:$src1, QPR:$Vn, DPR:$Vm, VectorIndex64:$lane,
5058 complexrotateop:$rot),
5059 OpcodeStr, "f32", []>;
5063 defm VCMLA : N3VCP8ComplexTied<1, 0, "vcmla", null_frag>;
5064 defm VCADD : N3VCP8ComplexOdd<1, 0, 0, "vcadd", null_frag>;
5065 defm VCMLA : N3VCP8ComplexTiedLane<0, "vcmla", null_frag>;
5067 let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
5068 def : Pat<(v4f16 (int_arm_neon_vcadd_rot90 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm))),
5069 (VCADDv4f16 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm), (i32 0))>;
5070 def : Pat<(v4f16 (int_arm_neon_vcadd_rot270 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm))),
5071 (VCADDv4f16 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm), (i32 1))>;
5072 def : Pat<(v8f16 (int_arm_neon_vcadd_rot90 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm))),
5073 (VCADDv8f16 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm), (i32 0))>;
5074 def : Pat<(v8f16 (int_arm_neon_vcadd_rot270 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm))),
5075 (VCADDv8f16 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm), (i32 1))>;
5077 let Predicates = [HasNEON,HasV8_3a] in {
5078 def : Pat<(v2f32 (int_arm_neon_vcadd_rot90 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm))),
5079 (VCADDv2f32 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm), (i32 0))>;
5080 def : Pat<(v2f32 (int_arm_neon_vcadd_rot270 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm))),
5081 (VCADDv2f32 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm), (i32 1))>;
5082 def : Pat<(v4f32 (int_arm_neon_vcadd_rot90 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm))),
5083 (VCADDv4f32 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm), (i32 0))>;
5084 def : Pat<(v4f32 (int_arm_neon_vcadd_rot270 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm))),
5085 (VCADDv4f32 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm), (i32 1))>;
5088 // Vector Subtract Operations.
5090 // VSUB : Vector Subtract (integer and floating-point)
5091 defm VSUB : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ,
5092 "vsub", "i", sub, 0>;
5093 def VSUBfd : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub", "f32",
5094 v2f32, v2f32, fsub, 0>;
5095 def VSUBfq : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub", "f32",
5096 v4f32, v4f32, fsub, 0>;
5097 def VSUBhd : N3VD<0, 0, 0b11, 0b1101, 0, IIC_VBIND, "vsub", "f16",
5098 v4f16, v4f16, fsub, 0>,
5099 Requires<[HasNEON,HasFullFP16]>;
5100 def VSUBhq : N3VQ<0, 0, 0b11, 0b1101, 0, IIC_VBINQ, "vsub", "f16",
5101 v8f16, v8f16, fsub, 0>,
5102 Requires<[HasNEON,HasFullFP16]>;
5103 // VSUBL : Vector Subtract Long (Q = D - D)
5104 defm VSUBLs : N3VLExt_QHS<0,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
5105 "vsubl", "s", sub, sext, 0>;
5106 defm VSUBLu : N3VLExt_QHS<1,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
5107 "vsubl", "u", sub, zanyext, 0>;
5108 // VSUBW : Vector Subtract Wide (Q = Q - D)
5109 defm VSUBWs : N3VW_QHS<0,1,0b0011,0, "vsubw", "s", sub, sext, 0>;
5110 defm VSUBWu : N3VW_QHS<1,1,0b0011,0, "vsubw", "u", sub, zanyext, 0>;
5111 // VHSUB : Vector Halving Subtract
5112 defm VHSUBs : N3VInt_QHS<0, 0, 0b0010, 0, N3RegFrm,
5113 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5114 "vhsub", "s", int_arm_neon_vhsubs, 0>;
5115 defm VHSUBu : N3VInt_QHS<1, 0, 0b0010, 0, N3RegFrm,
5116 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5117 "vhsub", "u", int_arm_neon_vhsubu, 0>;
5118 // VQSUB : Vector Saturing Subtract
5119 defm VQSUBs : N3VInt_QHSD<0, 0, 0b0010, 1, N3RegFrm,
5120 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5121 "vqsub", "s", ssubsat, 0>;
5122 defm VQSUBu : N3VInt_QHSD<1, 0, 0b0010, 1, N3RegFrm,
5123 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5124 "vqsub", "u", usubsat, 0>;
5125 // VSUBHN : Vector Subtract and Narrow Returning High Half (D = Q - Q)
5126 defm VSUBHN : N3VNInt_HSD<0,1,0b0110,0, "vsubhn", "i", null_frag, 0>;
5127 // VRSUBHN : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
5128 defm VRSUBHN : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn", "i",
5129 int_arm_neon_vrsubhn, 0>;
5131 let Predicates = [HasNEON] in {
5132 def : Pat<(v8i8 (trunc (ARMvshruImm (sub (v8i16 QPR:$Vn), QPR:$Vm), 8))),
5133 (VSUBHNv8i8 QPR:$Vn, QPR:$Vm)>;
5134 def : Pat<(v4i16 (trunc (ARMvshruImm (sub (v4i32 QPR:$Vn), QPR:$Vm), 16))),
5135 (VSUBHNv4i16 QPR:$Vn, QPR:$Vm)>;
5136 def : Pat<(v2i32 (trunc (ARMvshruImm (sub (v2i64 QPR:$Vn), QPR:$Vm), 32))),
5137 (VSUBHNv2i32 QPR:$Vn, QPR:$Vm)>;
5140 // Vector Comparisons.
5142 // VCEQ : Vector Compare Equal
5143 defm VCEQ : N3V_QHS_cmp<1, 0, 0b1000, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5144 IIC_VSUBi4Q, "vceq", "i", ARMCCeq, 1>;
5145 def VCEQfd : N3VD_cmp<0,0,0b00,0b1110,0, IIC_VBIND, "vceq", "f32", v2i32, v2f32,
5147 def VCEQfq : N3VQ_cmp<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq", "f32", v4i32, v4f32,
5149 def VCEQhd : N3VD_cmp<0,0,0b01,0b1110,0, IIC_VBIND, "vceq", "f16", v4i16, v4f16,
5151 Requires<[HasNEON, HasFullFP16]>;
5152 def VCEQhq : N3VQ_cmp<0,0,0b01,0b1110,0, IIC_VBINQ, "vceq", "f16", v8i16, v8f16,
5154 Requires<[HasNEON, HasFullFP16]>;
5156 let TwoOperandAliasConstraint = "$Vm = $Vd" in
5157 defm VCEQz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00010, 0, "vceq", "i",
5158 "$Vd, $Vm, #0", ARMCCeq>;
5160 // VCGE : Vector Compare Greater Than or Equal
5161 defm VCGEs : N3V_QHS_cmp<0, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5162 IIC_VSUBi4Q, "vcge", "s", ARMCCge, 0>;
5163 defm VCGEu : N3V_QHS_cmp<1, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5164 IIC_VSUBi4Q, "vcge", "u", ARMCChs, 0>;
5165 def VCGEfd : N3VD_cmp<1,0,0b00,0b1110,0, IIC_VBIND, "vcge", "f32", v2i32, v2f32,
5167 def VCGEfq : N3VQ_cmp<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge", "f32", v4i32, v4f32,
5169 def VCGEhd : N3VD_cmp<1,0,0b01,0b1110,0, IIC_VBIND, "vcge", "f16", v4i16, v4f16,
5171 Requires<[HasNEON, HasFullFP16]>;
5172 def VCGEhq : N3VQ_cmp<1,0,0b01,0b1110,0, IIC_VBINQ, "vcge", "f16", v8i16, v8f16,
5174 Requires<[HasNEON, HasFullFP16]>;
5176 let TwoOperandAliasConstraint = "$Vm = $Vd" in {
5177 defm VCGEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00001, 0, "vcge", "s",
5178 "$Vd, $Vm, #0", ARMCCge>;
5179 defm VCLEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00011, 0, "vcle", "s",
5180 "$Vd, $Vm, #0", ARMCCle>;
5183 // VCGT : Vector Compare Greater Than
5184 defm VCGTs : N3V_QHS_cmp<0, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5185 IIC_VSUBi4Q, "vcgt", "s", ARMCCgt, 0>;
5186 defm VCGTu : N3V_QHS_cmp<1, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5187 IIC_VSUBi4Q, "vcgt", "u", ARMCChi, 0>;
5188 def VCGTfd : N3VD_cmp<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt", "f32", v2i32, v2f32,
5190 def VCGTfq : N3VQ_cmp<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt", "f32", v4i32, v4f32,
5192 def VCGThd : N3VD_cmp<1,0,0b11,0b1110,0, IIC_VBIND, "vcgt", "f16", v4i16, v4f16,
5194 Requires<[HasNEON, HasFullFP16]>;
5195 def VCGThq : N3VQ_cmp<1,0,0b11,0b1110,0, IIC_VBINQ, "vcgt", "f16", v8i16, v8f16,
5197 Requires<[HasNEON, HasFullFP16]>;
5199 let TwoOperandAliasConstraint = "$Vm = $Vd" in {
5200 defm VCGTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00000, 0, "vcgt", "s",
5201 "$Vd, $Vm, #0", ARMCCgt>;
5202 defm VCLTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00100, 0, "vclt", "s",
5203 "$Vd, $Vm, #0", ARMCClt>;
5206 // VACGE : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
5207 def VACGEfd : N3VDInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
5208 "f32", v2i32, v2f32, int_arm_neon_vacge, 0>;
5209 def VACGEfq : N3VQInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
5210 "f32", v4i32, v4f32, int_arm_neon_vacge, 0>;
5211 def VACGEhd : N3VDInt<1, 0, 0b01, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
5212 "f16", v4i16, v4f16, int_arm_neon_vacge, 0>,
5213 Requires<[HasNEON, HasFullFP16]>;
5214 def VACGEhq : N3VQInt<1, 0, 0b01, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
5215 "f16", v8i16, v8f16, int_arm_neon_vacge, 0>,
5216 Requires<[HasNEON, HasFullFP16]>;
5217 // VACGT : Vector Absolute Compare Greater Than (aka VCAGT)
5218 def VACGTfd : N3VDInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
5219 "f32", v2i32, v2f32, int_arm_neon_vacgt, 0>;
5220 def VACGTfq : N3VQInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
5221 "f32", v4i32, v4f32, int_arm_neon_vacgt, 0>;
5222 def VACGThd : N3VDInt<1, 0, 0b11, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
5223 "f16", v4i16, v4f16, int_arm_neon_vacgt, 0>,
5224 Requires<[HasNEON, HasFullFP16]>;
5225 def VACGThq : N3VQInt<1, 0, 0b11, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
5226 "f16", v8i16, v8f16, int_arm_neon_vacgt, 0>,
5227 Requires<[HasNEON, HasFullFP16]>;
5228 // VTST : Vector Test Bits
5229 defm VTST : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
5230 IIC_VBINi4Q, "vtst", "", NEONvtst, 1>;
5232 def: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vn, $Vm",
5233 (VACGTfd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
5234 def: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vn, $Vm",
5235 (VACGTfq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
5236 def: NEONInstAlias<"vacle${p}.f32 $Vd, $Vn, $Vm",
5237 (VACGEfd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
5238 def: NEONInstAlias<"vacle${p}.f32 $Vd, $Vn, $Vm",
5239 (VACGEfq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
5240 let Predicates = [HasNEON, HasFullFP16] in {
5241 def: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vn, $Vm",
5242 (VACGThd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
5243 def: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vn, $Vm",
5244 (VACGThq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
5245 def: NEONInstAlias<"vacle${p}.f16 $Vd, $Vn, $Vm",
5246 (VACGEhd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
5247 def: NEONInstAlias<"vacle${p}.f16 $Vd, $Vn, $Vm",
5248 (VACGEhq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
5251 // +fp16fml Floating Point Multiplication Variants
5252 let Predicates = [HasNEON, HasFP16FML], DecoderNamespace= "VFPV8" in {
5254 class N3VCP8F16Q1<string asm, RegisterClass Td, RegisterClass Tn,
5255 RegisterClass Tm, bits<2> op1, bits<2> op2, bit op3>
5256 : N3VCP8<op1, op2, 1, op3, (outs Td:$Vd), (ins Tn:$Vn, Tm:$Vm), NoItinerary,
5257 asm, "f16", "$Vd, $Vn, $Vm", "", []>;
5259 class N3VCP8F16Q0<string asm, RegisterClass Td, RegisterClass Tn,
5260 RegisterClass Tm, bits<2> op1, bits<2> op2, bit op3>
5261 : N3VCP8Q0<op1, op2, 0, op3, (outs Td:$Vd), (ins Tn:$Vn, Tm:$Vm), NoItinerary,
5262 asm, "f16", "$Vd, $Vn, $Vm", "", []>;
5264 // Vd, Vs, Vs[0-15], Idx[0-1]
5265 class VFMD<string opc, string type, bits<2> S>
5266 : N3VLaneCP8<0, S, 0, 1, (outs DPR:$Vd),
5267 (ins SPR:$Vn, SPR_8:$Vm, VectorIndex32:$idx),
5268 IIC_VMACD, opc, type, "$Vd, $Vn, $Vm$idx", "", []> {
5271 let Inst{19-16} = Vn{4-1};
5272 let Inst{7} = Vn{0};
5273 let Inst{5} = Vm{0};
5274 let Inst{2-0} = Vm{3-1};
5277 // Vq, Vd, Vd[0-7], Idx[0-3]
5278 class VFMQ<string opc, string type, bits<2> S>
5279 : N3VLaneCP8<0, S, 1, 1, (outs QPR:$Vd),
5280 (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$idx),
5281 IIC_VMACD, opc, type, "$Vd, $Vn, $Vm$idx", "", []> {
5283 let Inst{5} = idx{1};
5284 let Inst{3} = idx{0};
5288 def VFMALD : N3VCP8F16Q0<"vfmal", DPR, SPR, SPR, 0b00, 0b10, 1>;
5289 def VFMSLD : N3VCP8F16Q0<"vfmsl", DPR, SPR, SPR, 0b01, 0b10, 1>;
5290 def VFMALQ : N3VCP8F16Q1<"vfmal", QPR, DPR, DPR, 0b00, 0b10, 1>;
5291 def VFMSLQ : N3VCP8F16Q1<"vfmsl", QPR, DPR, DPR, 0b01, 0b10, 1>;
5292 def VFMALDI : VFMD<"vfmal", "f16", 0b00>;
5293 def VFMSLDI : VFMD<"vfmsl", "f16", 0b01>;
5294 def VFMALQI : VFMQ<"vfmal", "f16", 0b00>;
5295 def VFMSLQI : VFMQ<"vfmsl", "f16", 0b01>;
5296 } // HasNEON, HasFP16FML
5299 def: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vm",
5300 (VACGTfd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
5301 def: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vm",
5302 (VACGTfq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
5303 def: NEONInstAlias<"vacle${p}.f32 $Vd, $Vm",
5304 (VACGEfd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
5305 def: NEONInstAlias<"vacle${p}.f32 $Vd, $Vm",
5306 (VACGEfq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
5307 let Predicates = [HasNEON, HasFullFP16] in {
5308 def: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vm",
5309 (VACGThd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
5310 def: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vm",
5311 (VACGThq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
5312 def: NEONInstAlias<"vacle${p}.f16 $Vd, $Vm",
5313 (VACGEhd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
5314 def: NEONInstAlias<"vacle${p}.f16 $Vd, $Vm",
5315 (VACGEhq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
5318 // Vector Bitwise Operations.
5320 def vnotd : PatFrag<(ops node:$in),
5321 (xor node:$in, ARMimmAllOnesD)>;
5322 def vnotq : PatFrag<(ops node:$in),
5323 (xor node:$in, ARMimmAllOnesV)>;
5326 // VAND : Vector Bitwise AND
5327 def VANDd : N3VDX<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand",
5328 v2i32, v2i32, and, 1>;
5329 def VANDq : N3VQX<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand",
5330 v4i32, v4i32, and, 1>;
5332 // VEOR : Vector Bitwise Exclusive OR
5333 def VEORd : N3VDX<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor",
5334 v2i32, v2i32, xor, 1>;
5335 def VEORq : N3VQX<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor",
5336 v4i32, v4i32, xor, 1>;
5338 // VORR : Vector Bitwise OR
5339 def VORRd : N3VDX<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr",
5340 v2i32, v2i32, or, 1>;
5341 def VORRq : N3VQX<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr",
5342 v4i32, v4i32, or, 1>;
5344 multiclass BitwisePatterns<string Name, SDPatternOperator OpNodeD,
5345 SDPatternOperator OpNodeQ> {
5346 def : Pat<(v8i8 (OpNodeD DPR:$LHS, DPR:$RHS)),
5347 (!cast<Instruction>(Name#"d") DPR:$LHS, DPR:$RHS)>;
5348 def : Pat<(v4i16 (OpNodeD DPR:$LHS, DPR:$RHS)),
5349 (!cast<Instruction>(Name#"d") DPR:$LHS, DPR:$RHS)>;
5350 def : Pat<(v1i64 (OpNodeD DPR:$LHS, DPR:$RHS)),
5351 (!cast<Instruction>(Name#"d") DPR:$LHS, DPR:$RHS)>;
5353 def : Pat<(v16i8 (OpNodeQ QPR:$LHS, QPR:$RHS)),
5354 (!cast<Instruction>(Name#"q") QPR:$LHS, QPR:$RHS)>;
5355 def : Pat<(v8i16 (OpNodeQ QPR:$LHS, QPR:$RHS)),
5356 (!cast<Instruction>(Name#"q") QPR:$LHS, QPR:$RHS)>;
5357 def : Pat<(v2i64 (OpNodeQ QPR:$LHS, QPR:$RHS)),
5358 (!cast<Instruction>(Name#"q") QPR:$LHS, QPR:$RHS)>;
5361 let Predicates = [HasNEON] in {
5362 defm : BitwisePatterns<"VAND", and, and>;
5363 defm : BitwisePatterns<"VORR", or, or>;
5364 defm : BitwisePatterns<"VEOR", xor, xor>;
5367 def VORRiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 0, 1,
5368 (outs DPR:$Vd), (ins nImmSplatI16:$SIMM, DPR:$src),
5370 "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
5372 (v4i16 (ARMvorrImm DPR:$src, timm:$SIMM)))]> {
5373 let Inst{9} = SIMM{9};
5376 def VORRiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 0, 1,
5377 (outs DPR:$Vd), (ins nImmSplatI32:$SIMM, DPR:$src),
5379 "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
5381 (v2i32 (ARMvorrImm DPR:$src, timm:$SIMM)))]> {
5382 let Inst{10-9} = SIMM{10-9};
5385 def VORRiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 0, 1,
5386 (outs QPR:$Vd), (ins nImmSplatI16:$SIMM, QPR:$src),
5388 "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
5390 (v8i16 (ARMvorrImm QPR:$src, timm:$SIMM)))]> {
5391 let Inst{9} = SIMM{9};
5394 def VORRiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 0, 1,
5395 (outs QPR:$Vd), (ins nImmSplatI32:$SIMM, QPR:$src),
5397 "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
5399 (v4i32 (ARMvorrImm QPR:$src, timm:$SIMM)))]> {
5400 let Inst{10-9} = SIMM{10-9};
5404 // VBIC : Vector Bitwise Bit Clear (AND NOT)
5405 let TwoOperandAliasConstraint = "$Vn = $Vd" in {
5406 def VBICd : N3VX<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
5407 (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
5408 "vbic", "$Vd, $Vn, $Vm", "",
5409 [(set DPR:$Vd, (v2i32 (and DPR:$Vn,
5410 (vnotd DPR:$Vm))))]>;
5411 def VBICq : N3VX<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
5412 (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
5413 "vbic", "$Vd, $Vn, $Vm", "",
5414 [(set QPR:$Vd, (v4i32 (and QPR:$Vn,
5415 (vnotq QPR:$Vm))))]>;
5418 let Predicates = [HasNEON] in {
5419 defm : BitwisePatterns<"VBIC", BinOpFrag<(and node:$LHS, (vnotd node:$RHS))>,
5420 BinOpFrag<(and node:$LHS, (vnotq node:$RHS))>>;
5423 def VBICiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 1, 1,
5424 (outs DPR:$Vd), (ins nImmSplatI16:$SIMM, DPR:$src),
5426 "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
5428 (v4i16 (ARMvbicImm DPR:$src, timm:$SIMM)))]> {
5429 let Inst{9} = SIMM{9};
5432 def VBICiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 1, 1,
5433 (outs DPR:$Vd), (ins nImmSplatI32:$SIMM, DPR:$src),
5435 "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
5437 (v2i32 (ARMvbicImm DPR:$src, timm:$SIMM)))]> {
5438 let Inst{10-9} = SIMM{10-9};
5441 def VBICiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 1, 1,
5442 (outs QPR:$Vd), (ins nImmSplatI16:$SIMM, QPR:$src),
5444 "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
5446 (v8i16 (ARMvbicImm QPR:$src, timm:$SIMM)))]> {
5447 let Inst{9} = SIMM{9};
5450 def VBICiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 1, 1,
5451 (outs QPR:$Vd), (ins nImmSplatI32:$SIMM, QPR:$src),
5453 "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
5455 (v4i32 (ARMvbicImm QPR:$src, timm:$SIMM)))]> {
5456 let Inst{10-9} = SIMM{10-9};
5459 // VORN : Vector Bitwise OR NOT
5460 def VORNd : N3VX<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$Vd),
5461 (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
5462 "vorn", "$Vd, $Vn, $Vm", "",
5463 [(set DPR:$Vd, (v2i32 (or DPR:$Vn,
5464 (vnotd DPR:$Vm))))]>;
5465 def VORNq : N3VX<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$Vd),
5466 (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
5467 "vorn", "$Vd, $Vn, $Vm", "",
5468 [(set QPR:$Vd, (v4i32 (or QPR:$Vn,
5469 (vnotq QPR:$Vm))))]>;
5471 let Predicates = [HasNEON] in {
5472 defm : BitwisePatterns<"VORN", BinOpFrag<(or node:$LHS, (vnotd node:$RHS))>,
5473 BinOpFrag<(or node:$LHS, (vnotq node:$RHS))>>;
5476 // VMVN : Vector Bitwise NOT (Immediate)
5478 let isReMaterializable = 1 in {
5480 def VMVNv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 1, 1, (outs DPR:$Vd),
5481 (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
5482 "vmvn", "i16", "$Vd, $SIMM", "",
5483 [(set DPR:$Vd, (v4i16 (ARMvmvnImm timm:$SIMM)))]> {
5484 let Inst{9} = SIMM{9};
5487 def VMVNv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 1, 1, (outs QPR:$Vd),
5488 (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
5489 "vmvn", "i16", "$Vd, $SIMM", "",
5490 [(set QPR:$Vd, (v8i16 (ARMvmvnImm timm:$SIMM)))]> {
5491 let Inst{9} = SIMM{9};
5494 def VMVNv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 1, 1, (outs DPR:$Vd),
5495 (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
5496 "vmvn", "i32", "$Vd, $SIMM", "",
5497 [(set DPR:$Vd, (v2i32 (ARMvmvnImm timm:$SIMM)))]> {
5498 let Inst{11-8} = SIMM{11-8};
5501 def VMVNv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 1, 1, (outs QPR:$Vd),
5502 (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
5503 "vmvn", "i32", "$Vd, $SIMM", "",
5504 [(set QPR:$Vd, (v4i32 (ARMvmvnImm timm:$SIMM)))]> {
5505 let Inst{11-8} = SIMM{11-8};
5509 // VMVN : Vector Bitwise NOT
5510 def VMVNd : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
5511 (outs DPR:$Vd), (ins DPR:$Vm), IIC_VSUBiD,
5512 "vmvn", "$Vd, $Vm", "",
5513 [(set DPR:$Vd, (v2i32 (vnotd DPR:$Vm)))]>;
5514 def VMVNq : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
5515 (outs QPR:$Vd), (ins QPR:$Vm), IIC_VSUBiD,
5516 "vmvn", "$Vd, $Vm", "",
5517 [(set QPR:$Vd, (v4i32 (vnotq QPR:$Vm)))]>;
5518 let Predicates = [HasNEON] in {
5519 def : Pat<(v1i64 (vnotd DPR:$src)),
5521 def : Pat<(v4i16 (vnotd DPR:$src)),
5523 def : Pat<(v8i8 (vnotd DPR:$src)),
5525 def : Pat<(v2i64 (vnotq QPR:$src)),
5527 def : Pat<(v8i16 (vnotq QPR:$src)),
5529 def : Pat<(v16i8 (vnotq QPR:$src)),
5533 // The TwoAddress pass will not go looking for equivalent operations
5534 // with different register constraints; it just inserts copies.
5535 // That is why pseudo VBSP implemented. Is is expanded later into
5536 // VBIT/VBIF/VBSL taking into account register constraints to avoid copies.
5538 : PseudoNeonI<(outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
5541 (v2i32 (NEONvbsp DPR:$src1, DPR:$Vn, DPR:$Vm)))]>;
5542 let Predicates = [HasNEON] in {
5543 def : Pat<(v8i8 (int_arm_neon_vbsl (v8i8 DPR:$src1),
5544 (v8i8 DPR:$Vn), (v8i8 DPR:$Vm))),
5545 (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
5546 def : Pat<(v4i16 (int_arm_neon_vbsl (v4i16 DPR:$src1),
5547 (v4i16 DPR:$Vn), (v4i16 DPR:$Vm))),
5548 (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
5549 def : Pat<(v2i32 (int_arm_neon_vbsl (v2i32 DPR:$src1),
5550 (v2i32 DPR:$Vn), (v2i32 DPR:$Vm))),
5551 (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
5552 def : Pat<(v2f32 (int_arm_neon_vbsl (v2f32 DPR:$src1),
5553 (v2f32 DPR:$Vn), (v2f32 DPR:$Vm))),
5554 (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
5555 def : Pat<(v1i64 (int_arm_neon_vbsl (v1i64 DPR:$src1),
5556 (v1i64 DPR:$Vn), (v1i64 DPR:$Vm))),
5557 (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
5559 def : Pat<(v8i8 (or (and DPR:$Vn, DPR:$Vd),
5560 (and DPR:$Vm, (vnotd DPR:$Vd)))),
5561 (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
5562 def : Pat<(v4i16 (or (and DPR:$Vn, DPR:$Vd),
5563 (and DPR:$Vm, (vnotd DPR:$Vd)))),
5564 (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
5565 def : Pat<(v2i32 (or (and DPR:$Vn, DPR:$Vd),
5566 (and DPR:$Vm, (vnotd DPR:$Vd)))),
5567 (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
5568 def : Pat<(v1i64 (or (and DPR:$Vn, DPR:$Vd),
5569 (and DPR:$Vm, (vnotd DPR:$Vd)))),
5570 (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
5574 : PseudoNeonI<(outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
5577 (v4i32 (NEONvbsp QPR:$src1, QPR:$Vn, QPR:$Vm)))]>;
5578 let Predicates = [HasNEON] in {
5579 def : Pat<(v16i8 (int_arm_neon_vbsl (v16i8 QPR:$src1),
5580 (v16i8 QPR:$Vn), (v16i8 QPR:$Vm))),
5581 (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
5582 def : Pat<(v8i16 (int_arm_neon_vbsl (v8i16 QPR:$src1),
5583 (v8i16 QPR:$Vn), (v8i16 QPR:$Vm))),
5584 (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
5585 def : Pat<(v4i32 (int_arm_neon_vbsl (v4i32 QPR:$src1),
5586 (v4i32 QPR:$Vn), (v4i32 QPR:$Vm))),
5587 (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
5588 def : Pat<(v4f32 (int_arm_neon_vbsl (v4f32 QPR:$src1),
5589 (v4f32 QPR:$Vn), (v4f32 QPR:$Vm))),
5590 (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
5591 def : Pat<(v2i64 (int_arm_neon_vbsl (v2i64 QPR:$src1),
5592 (v2i64 QPR:$Vn), (v2i64 QPR:$Vm))),
5593 (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
5595 def : Pat<(v16i8 (or (and QPR:$Vn, QPR:$Vd),
5596 (and QPR:$Vm, (vnotq QPR:$Vd)))),
5597 (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
5598 def : Pat<(v8i16 (or (and QPR:$Vn, QPR:$Vd),
5599 (and QPR:$Vm, (vnotq QPR:$Vd)))),
5600 (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
5601 def : Pat<(v4i32 (or (and QPR:$Vn, QPR:$Vd),
5602 (and QPR:$Vm, (vnotq QPR:$Vd)))),
5603 (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
5604 def : Pat<(v2i64 (or (and QPR:$Vn, QPR:$Vd),
5605 (and QPR:$Vm, (vnotq QPR:$Vd)))),
5606 (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
5609 // VBSL : Vector Bitwise Select
5610 def VBSLd : N3VX<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
5611 (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
5612 N3RegFrm, IIC_VBINiD,
5613 "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5616 def VBSLq : N3VX<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
5617 (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
5618 N3RegFrm, IIC_VBINiQ,
5619 "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5622 // VBIF : Vector Bitwise Insert if False
5623 // like VBSL but with: "vbif $dst, $src3, $src1", "$src2 = $dst",
5624 def VBIFd : N3VX<1, 0, 0b11, 0b0001, 0, 1,
5625 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
5626 N3RegFrm, IIC_VBINiD,
5627 "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5629 def VBIFq : N3VX<1, 0, 0b11, 0b0001, 1, 1,
5630 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
5631 N3RegFrm, IIC_VBINiQ,
5632 "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5635 // VBIT : Vector Bitwise Insert if True
5636 // like VBSL but with: "vbit $dst, $src2, $src1", "$src3 = $dst",
5637 def VBITd : N3VX<1, 0, 0b10, 0b0001, 0, 1,
5638 (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
5639 N3RegFrm, IIC_VBINiD,
5640 "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5642 def VBITq : N3VX<1, 0, 0b10, 0b0001, 1, 1,
5643 (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
5644 N3RegFrm, IIC_VBINiQ,
5645 "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5648 // Vector Absolute Differences.
5650 // VABD : Vector Absolute Difference
5651 defm VABDs : N3VInt_QHS<0, 0, 0b0111, 0, N3RegFrm,
5652 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5653 "vabd", "s", int_arm_neon_vabds, 1>;
5654 defm VABDu : N3VInt_QHS<1, 0, 0b0111, 0, N3RegFrm,
5655 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5656 "vabd", "u", int_arm_neon_vabdu, 1>;
5657 def VABDfd : N3VDInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBIND,
5658 "vabd", "f32", v2f32, v2f32, int_arm_neon_vabds, 1>;
5659 def VABDfq : N3VQInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBINQ,
5660 "vabd", "f32", v4f32, v4f32, int_arm_neon_vabds, 1>;
5661 def VABDhd : N3VDInt<1, 0, 0b11, 0b1101, 0, N3RegFrm, IIC_VBIND,
5662 "vabd", "f16", v4f16, v4f16, int_arm_neon_vabds, 1>,
5663 Requires<[HasNEON, HasFullFP16]>;
5664 def VABDhq : N3VQInt<1, 0, 0b11, 0b1101, 0, N3RegFrm, IIC_VBINQ,
5665 "vabd", "f16", v8f16, v8f16, int_arm_neon_vabds, 1>,
5666 Requires<[HasNEON, HasFullFP16]>;
5668 // VABDL : Vector Absolute Difference Long (Q = | D - D |)
5669 defm VABDLs : N3VLIntExt_QHS<0,1,0b0111,0, IIC_VSUBi4Q,
5670 "vabdl", "s", int_arm_neon_vabds, zext, 1>;
5671 defm VABDLu : N3VLIntExt_QHS<1,1,0b0111,0, IIC_VSUBi4Q,
5672 "vabdl", "u", int_arm_neon_vabdu, zext, 1>;
5674 let Predicates = [HasNEON] in {
5675 def : Pat<(v8i16 (abs (sub (zext (v8i8 DPR:$opA)), (zext (v8i8 DPR:$opB))))),
5676 (VABDLuv8i16 DPR:$opA, DPR:$opB)>;
5677 def : Pat<(v4i32 (abs (sub (zext (v4i16 DPR:$opA)), (zext (v4i16 DPR:$opB))))),
5678 (VABDLuv4i32 DPR:$opA, DPR:$opB)>;
5681 // ISD::ABS is not legal for v2i64, so VABDL needs to be matched from the
5682 // shift/xor pattern for ABS.
5685 PatFrag<(ops node:$in1, node:$in2, node:$shift),
5686 (ARMvshrsImm (sub (zext node:$in1),
5687 (zext node:$in2)), (i32 $shift))>;
5689 let Predicates = [HasNEON] in {
5690 def : Pat<(xor (v2i64 (abd_shr (v2i32 DPR:$opA), (v2i32 DPR:$opB), 63)),
5691 (v2i64 (add (sub (zext (v2i32 DPR:$opA)),
5692 (zext (v2i32 DPR:$opB))),
5693 (abd_shr (v2i32 DPR:$opA), (v2i32 DPR:$opB), 63)))),
5694 (VABDLuv2i64 DPR:$opA, DPR:$opB)>;
5697 // VABA : Vector Absolute Difference and Accumulate
5698 defm VABAs : N3VIntOp_QHS<0,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
5699 "vaba", "s", int_arm_neon_vabds, add>;
5700 defm VABAu : N3VIntOp_QHS<1,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
5701 "vaba", "u", int_arm_neon_vabdu, add>;
5703 // VABAL : Vector Absolute Difference and Accumulate Long (Q += | D - D |)
5704 defm VABALs : N3VLIntExtOp_QHS<0,1,0b0101,0, IIC_VABAD,
5705 "vabal", "s", int_arm_neon_vabds, zext, add>;
5706 defm VABALu : N3VLIntExtOp_QHS<1,1,0b0101,0, IIC_VABAD,
5707 "vabal", "u", int_arm_neon_vabdu, zext, add>;
5709 // Vector Maximum and Minimum.
5711 // VMAX : Vector Maximum
5712 defm VMAXs : N3VInt_QHS<0, 0, 0b0110, 0, N3RegFrm,
5713 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5714 "vmax", "s", smax, 1>;
5715 defm VMAXu : N3VInt_QHS<1, 0, 0b0110, 0, N3RegFrm,
5716 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5717 "vmax", "u", umax, 1>;
5718 def VMAXfd : N3VDInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBIND,
5720 v2f32, v2f32, fmaximum, 1>;
5721 def VMAXfq : N3VQInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBINQ,
5723 v4f32, v4f32, fmaximum, 1>;
5724 def VMAXhd : N3VDInt<0, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VBIND,
5726 v4f16, v4f16, fmaximum, 1>,
5727 Requires<[HasNEON, HasFullFP16]>;
5728 def VMAXhq : N3VQInt<0, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VBINQ,
5730 v8f16, v8f16, fmaximum, 1>,
5731 Requires<[HasNEON, HasFullFP16]>;
5734 let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
5735 def NEON_VMAXNMNDf : N3VDIntnp<0b00110, 0b00, 0b1111, 0, 1,
5736 N3RegFrm, NoItinerary, "vmaxnm", "f32",
5737 v2f32, v2f32, fmaxnum, 1>,
5738 Requires<[HasV8, HasNEON]>;
5739 def NEON_VMAXNMNQf : N3VQIntnp<0b00110, 0b00, 0b1111, 1, 1,
5740 N3RegFrm, NoItinerary, "vmaxnm", "f32",
5741 v4f32, v4f32, fmaxnum, 1>,
5742 Requires<[HasV8, HasNEON]>;
5743 def NEON_VMAXNMNDh : N3VDIntnp<0b00110, 0b01, 0b1111, 0, 1,
5744 N3RegFrm, NoItinerary, "vmaxnm", "f16",
5745 v4f16, v4f16, fmaxnum, 1>,
5746 Requires<[HasV8, HasNEON, HasFullFP16]>;
5747 def NEON_VMAXNMNQh : N3VQIntnp<0b00110, 0b01, 0b1111, 1, 1,
5748 N3RegFrm, NoItinerary, "vmaxnm", "f16",
5749 v8f16, v8f16, fmaxnum, 1>,
5750 Requires<[HasV8, HasNEON, HasFullFP16]>;
5753 // VMIN : Vector Minimum
5754 defm VMINs : N3VInt_QHS<0, 0, 0b0110, 1, N3RegFrm,
5755 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5756 "vmin", "s", smin, 1>;
5757 defm VMINu : N3VInt_QHS<1, 0, 0b0110, 1, N3RegFrm,
5758 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5759 "vmin", "u", umin, 1>;
5760 def VMINfd : N3VDInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBIND,
5762 v2f32, v2f32, fminimum, 1>;
5763 def VMINfq : N3VQInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBINQ,
5765 v4f32, v4f32, fminimum, 1>;
5766 def VMINhd : N3VDInt<0, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VBIND,
5768 v4f16, v4f16, fminimum, 1>,
5769 Requires<[HasNEON, HasFullFP16]>;
5770 def VMINhq : N3VQInt<0, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VBINQ,
5772 v8f16, v8f16, fminimum, 1>,
5773 Requires<[HasNEON, HasFullFP16]>;
5776 let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
5777 def NEON_VMINNMNDf : N3VDIntnp<0b00110, 0b10, 0b1111, 0, 1,
5778 N3RegFrm, NoItinerary, "vminnm", "f32",
5779 v2f32, v2f32, fminnum, 1>,
5780 Requires<[HasV8, HasNEON]>;
5781 def NEON_VMINNMNQf : N3VQIntnp<0b00110, 0b10, 0b1111, 1, 1,
5782 N3RegFrm, NoItinerary, "vminnm", "f32",
5783 v4f32, v4f32, fminnum, 1>,
5784 Requires<[HasV8, HasNEON]>;
5785 def NEON_VMINNMNDh : N3VDIntnp<0b00110, 0b11, 0b1111, 0, 1,
5786 N3RegFrm, NoItinerary, "vminnm", "f16",
5787 v4f16, v4f16, fminnum, 1>,
5788 Requires<[HasV8, HasNEON, HasFullFP16]>;
5789 def NEON_VMINNMNQh : N3VQIntnp<0b00110, 0b11, 0b1111, 1, 1,
5790 N3RegFrm, NoItinerary, "vminnm", "f16",
5791 v8f16, v8f16, fminnum, 1>,
5792 Requires<[HasV8, HasNEON, HasFullFP16]>;
5795 // Vector Pairwise Operations.
5797 // VPADD : Vector Pairwise Add
5798 def VPADDi8 : N3VDInt<0, 0, 0b00, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
5800 v8i8, v8i8, int_arm_neon_vpadd, 0>;
5801 def VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
5803 v4i16, v4i16, int_arm_neon_vpadd, 0>;
5804 def VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
5806 v2i32, v2i32, int_arm_neon_vpadd, 0>;
5807 def VPADDf : N3VDInt<1, 0, 0b00, 0b1101, 0, N3RegFrm,
5808 IIC_VPBIND, "vpadd", "f32",
5809 v2f32, v2f32, int_arm_neon_vpadd, 0>;
5810 def VPADDh : N3VDInt<1, 0, 0b01, 0b1101, 0, N3RegFrm,
5811 IIC_VPBIND, "vpadd", "f16",
5812 v4f16, v4f16, int_arm_neon_vpadd, 0>,
5813 Requires<[HasNEON, HasFullFP16]>;
5815 // VPADDL : Vector Pairwise Add Long
5816 defm VPADDLs : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl", "s",
5817 int_arm_neon_vpaddls>;
5818 defm VPADDLu : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl", "u",
5819 int_arm_neon_vpaddlu>;
5821 // VPADAL : Vector Pairwise Add and Accumulate Long
5822 defm VPADALs : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01100, 0, "vpadal", "s",
5823 int_arm_neon_vpadals>;
5824 defm VPADALu : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01101, 0, "vpadal", "u",
5825 int_arm_neon_vpadalu>;
5827 // VPMAX : Vector Pairwise Maximum
5828 def VPMAXs8 : N3VDInt<0, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
5829 "s8", v8i8, v8i8, int_arm_neon_vpmaxs, 0>;
5830 def VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
5831 "s16", v4i16, v4i16, int_arm_neon_vpmaxs, 0>;
5832 def VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
5833 "s32", v2i32, v2i32, int_arm_neon_vpmaxs, 0>;
5834 def VPMAXu8 : N3VDInt<1, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
5835 "u8", v8i8, v8i8, int_arm_neon_vpmaxu, 0>;
5836 def VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
5837 "u16", v4i16, v4i16, int_arm_neon_vpmaxu, 0>;
5838 def VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
5839 "u32", v2i32, v2i32, int_arm_neon_vpmaxu, 0>;
5840 def VPMAXf : N3VDInt<1, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmax",
5841 "f32", v2f32, v2f32, int_arm_neon_vpmaxs, 0>;
5842 def VPMAXh : N3VDInt<1, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmax",
5843 "f16", v4f16, v4f16, int_arm_neon_vpmaxs, 0>,
5844 Requires<[HasNEON, HasFullFP16]>;
5846 // VPMIN : Vector Pairwise Minimum
5847 def VPMINs8 : N3VDInt<0, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
5848 "s8", v8i8, v8i8, int_arm_neon_vpmins, 0>;
5849 def VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
5850 "s16", v4i16, v4i16, int_arm_neon_vpmins, 0>;
5851 def VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
5852 "s32", v2i32, v2i32, int_arm_neon_vpmins, 0>;
5853 def VPMINu8 : N3VDInt<1, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
5854 "u8", v8i8, v8i8, int_arm_neon_vpminu, 0>;
5855 def VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
5856 "u16", v4i16, v4i16, int_arm_neon_vpminu, 0>;
5857 def VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
5858 "u32", v2i32, v2i32, int_arm_neon_vpminu, 0>;
5859 def VPMINf : N3VDInt<1, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmin",
5860 "f32", v2f32, v2f32, int_arm_neon_vpmins, 0>;
5861 def VPMINh : N3VDInt<1, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmin",
5862 "f16", v4f16, v4f16, int_arm_neon_vpmins, 0>,
5863 Requires<[HasNEON, HasFullFP16]>;
5865 // Vector Reciprocal and Reciprocal Square Root Estimate and Step.
5867 // VRECPE : Vector Reciprocal Estimate
5868 def VRECPEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
5869 IIC_VUNAD, "vrecpe", "u32",
5870 v2i32, v2i32, int_arm_neon_vrecpe>;
5871 def VRECPEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
5872 IIC_VUNAQ, "vrecpe", "u32",
5873 v4i32, v4i32, int_arm_neon_vrecpe>;
5874 def VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
5875 IIC_VUNAD, "vrecpe", "f32",
5876 v2f32, v2f32, int_arm_neon_vrecpe>;
5877 def VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
5878 IIC_VUNAQ, "vrecpe", "f32",
5879 v4f32, v4f32, int_arm_neon_vrecpe>;
5880 def VRECPEhd : N2VDInt<0b11, 0b11, 0b01, 0b11, 0b01010, 0,
5881 IIC_VUNAD, "vrecpe", "f16",
5882 v4f16, v4f16, int_arm_neon_vrecpe>,
5883 Requires<[HasNEON, HasFullFP16]>;
5884 def VRECPEhq : N2VQInt<0b11, 0b11, 0b01, 0b11, 0b01010, 0,
5885 IIC_VUNAQ, "vrecpe", "f16",
5886 v8f16, v8f16, int_arm_neon_vrecpe>,
5887 Requires<[HasNEON, HasFullFP16]>;
5889 // VRECPS : Vector Reciprocal Step
5890 def VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
5891 IIC_VRECSD, "vrecps", "f32",
5892 v2f32, v2f32, int_arm_neon_vrecps, 1>;
5893 def VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
5894 IIC_VRECSQ, "vrecps", "f32",
5895 v4f32, v4f32, int_arm_neon_vrecps, 1>;
5896 def VRECPShd : N3VDInt<0, 0, 0b01, 0b1111, 1, N3RegFrm,
5897 IIC_VRECSD, "vrecps", "f16",
5898 v4f16, v4f16, int_arm_neon_vrecps, 1>,
5899 Requires<[HasNEON, HasFullFP16]>;
5900 def VRECPShq : N3VQInt<0, 0, 0b01, 0b1111, 1, N3RegFrm,
5901 IIC_VRECSQ, "vrecps", "f16",
5902 v8f16, v8f16, int_arm_neon_vrecps, 1>,
5903 Requires<[HasNEON, HasFullFP16]>;
5905 // VRSQRTE : Vector Reciprocal Square Root Estimate
5906 def VRSQRTEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
5907 IIC_VUNAD, "vrsqrte", "u32",
5908 v2i32, v2i32, int_arm_neon_vrsqrte>;
5909 def VRSQRTEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
5910 IIC_VUNAQ, "vrsqrte", "u32",
5911 v4i32, v4i32, int_arm_neon_vrsqrte>;
5912 def VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
5913 IIC_VUNAD, "vrsqrte", "f32",
5914 v2f32, v2f32, int_arm_neon_vrsqrte>;
5915 def VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
5916 IIC_VUNAQ, "vrsqrte", "f32",
5917 v4f32, v4f32, int_arm_neon_vrsqrte>;
5918 def VRSQRTEhd : N2VDInt<0b11, 0b11, 0b01, 0b11, 0b01011, 0,
5919 IIC_VUNAD, "vrsqrte", "f16",
5920 v4f16, v4f16, int_arm_neon_vrsqrte>,
5921 Requires<[HasNEON, HasFullFP16]>;
5922 def VRSQRTEhq : N2VQInt<0b11, 0b11, 0b01, 0b11, 0b01011, 0,
5923 IIC_VUNAQ, "vrsqrte", "f16",
5924 v8f16, v8f16, int_arm_neon_vrsqrte>,
5925 Requires<[HasNEON, HasFullFP16]>;
5927 // VRSQRTS : Vector Reciprocal Square Root Step
5928 def VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
5929 IIC_VRECSD, "vrsqrts", "f32",
5930 v2f32, v2f32, int_arm_neon_vrsqrts, 1>;
5931 def VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
5932 IIC_VRECSQ, "vrsqrts", "f32",
5933 v4f32, v4f32, int_arm_neon_vrsqrts, 1>;
5934 def VRSQRTShd : N3VDInt<0, 0, 0b11, 0b1111, 1, N3RegFrm,
5935 IIC_VRECSD, "vrsqrts", "f16",
5936 v4f16, v4f16, int_arm_neon_vrsqrts, 1>,
5937 Requires<[HasNEON, HasFullFP16]>;
5938 def VRSQRTShq : N3VQInt<0, 0, 0b11, 0b1111, 1, N3RegFrm,
5939 IIC_VRECSQ, "vrsqrts", "f16",
5940 v8f16, v8f16, int_arm_neon_vrsqrts, 1>,
5941 Requires<[HasNEON, HasFullFP16]>;
5945 // VSHL : Vector Shift
5946 defm VSHLs : N3VInt_QHSDSh<0, 0, 0b0100, 0, N3RegVShFrm,
5947 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
5948 "vshl", "s", int_arm_neon_vshifts>;
5949 defm VSHLu : N3VInt_QHSDSh<1, 0, 0b0100, 0, N3RegVShFrm,
5950 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
5951 "vshl", "u", int_arm_neon_vshiftu>;
5953 let Predicates = [HasNEON] in {
5954 def : Pat<(v8i8 (ARMvshls (v8i8 DPR:$Dn), (v8i8 DPR:$Dm))),
5955 (VSHLsv8i8 DPR:$Dn, DPR:$Dm)>;
5956 def : Pat<(v4i16 (ARMvshls (v4i16 DPR:$Dn), (v4i16 DPR:$Dm))),
5957 (VSHLsv4i16 DPR:$Dn, DPR:$Dm)>;
5958 def : Pat<(v2i32 (ARMvshls (v2i32 DPR:$Dn), (v2i32 DPR:$Dm))),
5959 (VSHLsv2i32 DPR:$Dn, DPR:$Dm)>;
5960 def : Pat<(v1i64 (ARMvshls (v1i64 DPR:$Dn), (v1i64 DPR:$Dm))),
5961 (VSHLsv1i64 DPR:$Dn, DPR:$Dm)>;
5962 def : Pat<(v16i8 (ARMvshls (v16i8 QPR:$Dn), (v16i8 QPR:$Dm))),
5963 (VSHLsv16i8 QPR:$Dn, QPR:$Dm)>;
5964 def : Pat<(v8i16 (ARMvshls (v8i16 QPR:$Dn), (v8i16 QPR:$Dm))),
5965 (VSHLsv8i16 QPR:$Dn, QPR:$Dm)>;
5966 def : Pat<(v4i32 (ARMvshls (v4i32 QPR:$Dn), (v4i32 QPR:$Dm))),
5967 (VSHLsv4i32 QPR:$Dn, QPR:$Dm)>;
5968 def : Pat<(v2i64 (ARMvshls (v2i64 QPR:$Dn), (v2i64 QPR:$Dm))),
5969 (VSHLsv2i64 QPR:$Dn, QPR:$Dm)>;
5971 def : Pat<(v8i8 (ARMvshlu (v8i8 DPR:$Dn), (v8i8 DPR:$Dm))),
5972 (VSHLuv8i8 DPR:$Dn, DPR:$Dm)>;
5973 def : Pat<(v4i16 (ARMvshlu (v4i16 DPR:$Dn), (v4i16 DPR:$Dm))),
5974 (VSHLuv4i16 DPR:$Dn, DPR:$Dm)>;
5975 def : Pat<(v2i32 (ARMvshlu (v2i32 DPR:$Dn), (v2i32 DPR:$Dm))),
5976 (VSHLuv2i32 DPR:$Dn, DPR:$Dm)>;
5977 def : Pat<(v1i64 (ARMvshlu (v1i64 DPR:$Dn), (v1i64 DPR:$Dm))),
5978 (VSHLuv1i64 DPR:$Dn, DPR:$Dm)>;
5979 def : Pat<(v16i8 (ARMvshlu (v16i8 QPR:$Dn), (v16i8 QPR:$Dm))),
5980 (VSHLuv16i8 QPR:$Dn, QPR:$Dm)>;
5981 def : Pat<(v8i16 (ARMvshlu (v8i16 QPR:$Dn), (v8i16 QPR:$Dm))),
5982 (VSHLuv8i16 QPR:$Dn, QPR:$Dm)>;
5983 def : Pat<(v4i32 (ARMvshlu (v4i32 QPR:$Dn), (v4i32 QPR:$Dm))),
5984 (VSHLuv4i32 QPR:$Dn, QPR:$Dm)>;
5985 def : Pat<(v2i64 (ARMvshlu (v2i64 QPR:$Dn), (v2i64 QPR:$Dm))),
5986 (VSHLuv2i64 QPR:$Dn, QPR:$Dm)>;
5990 // VSHL : Vector Shift Left (Immediate)
5991 defm VSHLi : N2VShL_QHSD<0, 1, 0b0101, 1, IIC_VSHLiD, "vshl", "i", ARMvshlImm>;
5993 // VSHR : Vector Shift Right (Immediate)
5994 defm VSHRs : N2VShR_QHSD<0, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "s", "VSHRs",
5996 defm VSHRu : N2VShR_QHSD<1, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "u", "VSHRu",
5999 // VSHLL : Vector Shift Left Long
6000 defm VSHLLs : N2VLSh_QHS<0, 1, 0b1010, 0, 0, 1, "vshll", "s",
6001 PatFrag<(ops node:$LHS, node:$RHS), (ARMvshlImm (sext node:$LHS), node:$RHS)>>;
6002 defm VSHLLu : N2VLSh_QHS<1, 1, 0b1010, 0, 0, 1, "vshll", "u",
6003 PatFrag<(ops node:$LHS, node:$RHS), (ARMvshlImm (zext node:$LHS), node:$RHS)>>;
6005 // VSHLL : Vector Shift Left Long (with maximum shift count)
6006 class N2VLShMax<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
6007 bit op6, bit op4, string OpcodeStr, string Dt, ValueType ResTy,
6008 ValueType OpTy, Operand ImmTy>
6009 : N2VLSh<op24, op23, op11_8, op7, op6, op4, OpcodeStr, Dt,
6010 ResTy, OpTy, ImmTy, null_frag> {
6011 let Inst{21-16} = op21_16;
6012 let DecoderMethod = "DecodeVSHLMaxInstruction";
6014 def VSHLLi8 : N2VLShMax<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll", "i8",
6016 def VSHLLi16 : N2VLShMax<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll", "i16",
6017 v4i32, v4i16, imm16>;
6018 def VSHLLi32 : N2VLShMax<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll", "i32",
6019 v2i64, v2i32, imm32>;
6021 let Predicates = [HasNEON] in {
6022 def : Pat<(v8i16 (ARMvshlImm (zext (v8i8 DPR:$Rn)), (i32 8))),
6023 (VSHLLi8 DPR:$Rn, 8)>;
6024 def : Pat<(v4i32 (ARMvshlImm (zext (v4i16 DPR:$Rn)), (i32 16))),
6025 (VSHLLi16 DPR:$Rn, 16)>;
6026 def : Pat<(v2i64 (ARMvshlImm (zext (v2i32 DPR:$Rn)), (i32 32))),
6027 (VSHLLi32 DPR:$Rn, 32)>;
6028 def : Pat<(v8i16 (ARMvshlImm (sext (v8i8 DPR:$Rn)), (i32 8))),
6029 (VSHLLi8 DPR:$Rn, 8)>;
6030 def : Pat<(v4i32 (ARMvshlImm (sext (v4i16 DPR:$Rn)), (i32 16))),
6031 (VSHLLi16 DPR:$Rn, 16)>;
6032 def : Pat<(v2i64 (ARMvshlImm (sext (v2i32 DPR:$Rn)), (i32 32))),
6033 (VSHLLi32 DPR:$Rn, 32)>;
6034 def : Pat<(v8i16 (ARMvshlImm (anyext (v8i8 DPR:$Rn)), (i32 8))),
6035 (VSHLLi8 DPR:$Rn, 8)>;
6036 def : Pat<(v4i32 (ARMvshlImm (anyext (v4i16 DPR:$Rn)), (i32 16))),
6037 (VSHLLi16 DPR:$Rn, 16)>;
6038 def : Pat<(v2i64 (ARMvshlImm (anyext (v2i32 DPR:$Rn)), (i32 32))),
6039 (VSHLLi32 DPR:$Rn, 32)>;
6042 // VSHRN : Vector Shift Right and Narrow
6043 defm VSHRN : N2VNSh_HSD<0,1,0b1000,0,0,1, IIC_VSHLiD, "vshrn", "i",
6044 PatFrag<(ops node:$Rn, node:$amt),
6045 (trunc (ARMvshrsImm node:$Rn, node:$amt))>>;
6047 let Predicates = [HasNEON] in {
6048 def : Pat<(v8i8 (trunc (ARMvshruImm (v8i16 QPR:$Vn), shr_imm8:$amt))),
6049 (VSHRNv8i8 QPR:$Vn, shr_imm8:$amt)>;
6050 def : Pat<(v4i16 (trunc (ARMvshruImm (v4i32 QPR:$Vn), shr_imm16:$amt))),
6051 (VSHRNv4i16 QPR:$Vn, shr_imm16:$amt)>;
6052 def : Pat<(v2i32 (trunc (ARMvshruImm (v2i64 QPR:$Vn), shr_imm32:$amt))),
6053 (VSHRNv2i32 QPR:$Vn, shr_imm32:$amt)>;
6056 // VRSHL : Vector Rounding Shift
6057 defm VRSHLs : N3VInt_QHSDSh<0, 0, 0b0101, 0, N3RegVShFrm,
6058 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
6059 "vrshl", "s", int_arm_neon_vrshifts>;
6060 defm VRSHLu : N3VInt_QHSDSh<1, 0, 0b0101, 0, N3RegVShFrm,
6061 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
6062 "vrshl", "u", int_arm_neon_vrshiftu>;
6063 // VRSHR : Vector Rounding Shift Right
6064 defm VRSHRs : N2VShR_QHSD<0,1,0b0010,1, IIC_VSHLi4D, "vrshr", "s", "VRSHRs",
6066 defm VRSHRu : N2VShR_QHSD<1,1,0b0010,1, IIC_VSHLi4D, "vrshr", "u", "VRSHRu",
6069 // VRSHRN : Vector Rounding Shift Right and Narrow
6070 defm VRSHRN : N2VNSh_HSD<0, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vrshrn", "i",
6073 // VQSHL : Vector Saturating Shift
6074 defm VQSHLs : N3VInt_QHSDSh<0, 0, 0b0100, 1, N3RegVShFrm,
6075 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
6076 "vqshl", "s", int_arm_neon_vqshifts>;
6077 defm VQSHLu : N3VInt_QHSDSh<1, 0, 0b0100, 1, N3RegVShFrm,
6078 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
6079 "vqshl", "u", int_arm_neon_vqshiftu>;
6080 // VQSHL : Vector Saturating Shift Left (Immediate)
6081 defm VQSHLsi : N2VShL_QHSD<0,1,0b0111,1, IIC_VSHLi4D, "vqshl", "s",NEONvqshlsImm>;
6082 defm VQSHLui : N2VShL_QHSD<1,1,0b0111,1, IIC_VSHLi4D, "vqshl", "u",NEONvqshluImm>;
6084 // VQSHLU : Vector Saturating Shift Left (Immediate, Unsigned)
6085 defm VQSHLsu : N2VShL_QHSD<1,1,0b0110,1, IIC_VSHLi4D,"vqshlu","s",NEONvqshlsuImm>;
6087 // VQSHRN : Vector Saturating Shift Right and Narrow
6088 defm VQSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "s",
6090 defm VQSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "u",
6093 // VQSHRUN : Vector Saturating Shift Right and Narrow (Unsigned)
6094 defm VQSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 0, 1, IIC_VSHLi4D, "vqshrun", "s",
6097 // VQRSHL : Vector Saturating Rounding Shift
6098 defm VQRSHLs : N3VInt_QHSDSh<0, 0, 0b0101, 1, N3RegVShFrm,
6099 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
6100 "vqrshl", "s", int_arm_neon_vqrshifts>;
6101 defm VQRSHLu : N3VInt_QHSDSh<1, 0, 0b0101, 1, N3RegVShFrm,
6102 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
6103 "vqrshl", "u", int_arm_neon_vqrshiftu>;
6105 // VQRSHRN : Vector Saturating Rounding Shift Right and Narrow
6106 defm VQRSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "s",
6108 defm VQRSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "u",
6111 // VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned)
6112 defm VQRSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vqrshrun", "s",
6115 // VSRA : Vector Shift Right and Accumulate
6116 defm VSRAs : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra", "s", ARMvshrsImm>;
6117 defm VSRAu : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra", "u", ARMvshruImm>;
6118 // VRSRA : Vector Rounding Shift Right and Accumulate
6119 defm VRSRAs : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra", "s", NEONvrshrsImm>;
6120 defm VRSRAu : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra", "u", NEONvrshruImm>;
6122 // VSLI : Vector Shift Left and Insert
6123 defm VSLI : N2VShInsL_QHSD<1, 1, 0b0101, 1, "vsli">;
6125 // VSRI : Vector Shift Right and Insert
6126 defm VSRI : N2VShInsR_QHSD<1, 1, 0b0100, 1, "vsri">;
6128 // Vector Absolute and Saturating Absolute.
6130 // VABS : Vector Absolute Value
6131 defm VABS : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0,
6132 IIC_VUNAiD, IIC_VUNAiQ, "vabs", "s", abs>;
6133 def VABSfd : N2VD<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
6135 v2f32, v2f32, fabs>;
6136 def VABSfq : N2VQ<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
6138 v4f32, v4f32, fabs>;
6139 def VABShd : N2VD<0b11, 0b11, 0b01, 0b01, 0b01110, 0,
6141 v4f16, v4f16, fabs>,
6142 Requires<[HasNEON, HasFullFP16]>;
6143 def VABShq : N2VQ<0b11, 0b11, 0b01, 0b01, 0b01110, 0,
6145 v8f16, v8f16, fabs>,
6146 Requires<[HasNEON, HasFullFP16]>;
6148 // VQABS : Vector Saturating Absolute Value
6149 defm VQABS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0,
6150 IIC_VQUNAiD, IIC_VQUNAiQ, "vqabs", "s",
6151 int_arm_neon_vqabs>;
6155 def vnegd : PatFrag<(ops node:$in),
6156 (sub ARMimmAllZerosD, node:$in)>;
6157 def vnegq : PatFrag<(ops node:$in),
6158 (sub ARMimmAllZerosV, node:$in)>;
6160 class VNEGD<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
6161 : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$Vd), (ins DPR:$Vm),
6162 IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
6163 [(set DPR:$Vd, (Ty (vnegd DPR:$Vm)))]>;
6164 class VNEGQ<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
6165 : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$Vd), (ins QPR:$Vm),
6166 IIC_VSHLiQ, OpcodeStr, Dt, "$Vd, $Vm", "",
6167 [(set QPR:$Vd, (Ty (vnegq QPR:$Vm)))]>;
6169 // VNEG : Vector Negate (integer)
6170 def VNEGs8d : VNEGD<0b00, "vneg", "s8", v8i8>;
6171 def VNEGs16d : VNEGD<0b01, "vneg", "s16", v4i16>;
6172 def VNEGs32d : VNEGD<0b10, "vneg", "s32", v2i32>;
6173 def VNEGs8q : VNEGQ<0b00, "vneg", "s8", v16i8>;
6174 def VNEGs16q : VNEGQ<0b01, "vneg", "s16", v8i16>;
6175 def VNEGs32q : VNEGQ<0b10, "vneg", "s32", v4i32>;
6177 // VNEG : Vector Negate (floating-point)
6178 def VNEGfd : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
6179 (outs DPR:$Vd), (ins DPR:$Vm), IIC_VUNAD,
6180 "vneg", "f32", "$Vd, $Vm", "",
6181 [(set DPR:$Vd, (v2f32 (fneg DPR:$Vm)))]>;
6182 def VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0,
6183 (outs QPR:$Vd), (ins QPR:$Vm), IIC_VUNAQ,
6184 "vneg", "f32", "$Vd, $Vm", "",
6185 [(set QPR:$Vd, (v4f32 (fneg QPR:$Vm)))]>;
6186 def VNEGhd : N2V<0b11, 0b11, 0b01, 0b01, 0b01111, 0, 0,
6187 (outs DPR:$Vd), (ins DPR:$Vm), IIC_VUNAD,
6188 "vneg", "f16", "$Vd, $Vm", "",
6189 [(set DPR:$Vd, (v4f16 (fneg DPR:$Vm)))]>,
6190 Requires<[HasNEON, HasFullFP16]>;
6191 def VNEGhq : N2V<0b11, 0b11, 0b01, 0b01, 0b01111, 1, 0,
6192 (outs QPR:$Vd), (ins QPR:$Vm), IIC_VUNAQ,
6193 "vneg", "f16", "$Vd, $Vm", "",
6194 [(set QPR:$Vd, (v8f16 (fneg QPR:$Vm)))]>,
6195 Requires<[HasNEON, HasFullFP16]>;
6197 let Predicates = [HasNEON] in {
6198 def : Pat<(v8i8 (vnegd DPR:$src)), (VNEGs8d DPR:$src)>;
6199 def : Pat<(v4i16 (vnegd DPR:$src)), (VNEGs16d DPR:$src)>;
6200 def : Pat<(v2i32 (vnegd DPR:$src)), (VNEGs32d DPR:$src)>;
6201 def : Pat<(v16i8 (vnegq QPR:$src)), (VNEGs8q QPR:$src)>;
6202 def : Pat<(v8i16 (vnegq QPR:$src)), (VNEGs16q QPR:$src)>;
6203 def : Pat<(v4i32 (vnegq QPR:$src)), (VNEGs32q QPR:$src)>;
6206 // VQNEG : Vector Saturating Negate
6207 defm VQNEG : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0,
6208 IIC_VQUNAiD, IIC_VQUNAiQ, "vqneg", "s",
6209 int_arm_neon_vqneg>;
6211 // Vector Bit Counting Operations.
6213 // VCLS : Vector Count Leading Sign Bits
6214 defm VCLS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0,
6215 IIC_VCNTiD, IIC_VCNTiQ, "vcls", "s",
6217 // VCLZ : Vector Count Leading Zeros
6218 defm VCLZ : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0,
6219 IIC_VCNTiD, IIC_VCNTiQ, "vclz", "i",
6221 // VCNT : Vector Count One Bits
6222 def VCNTd : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
6223 IIC_VCNTiD, "vcnt", "8",
6225 def VCNTq : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
6226 IIC_VCNTiQ, "vcnt", "8",
6227 v16i8, v16i8, ctpop>;
6230 def VSWPd : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 0, 0,
6231 (outs DPR:$Vd, DPR:$Vm), (ins DPR:$in1, DPR:$in2),
6232 NoItinerary, "vswp", "$Vd, $Vm", "$in1 = $Vd, $in2 = $Vm",
6234 def VSWPq : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 1, 0,
6235 (outs QPR:$Vd, QPR:$Vm), (ins QPR:$in1, QPR:$in2),
6236 NoItinerary, "vswp", "$Vd, $Vm", "$in1 = $Vd, $in2 = $Vm",
6239 // Vector Move Operations.
6241 // VMOV : Vector Move (Register)
6242 def : NEONInstAlias<"vmov${p} $Vd, $Vm",
6243 (VORRd DPR:$Vd, DPR:$Vm, DPR:$Vm, pred:$p)>;
6244 def : NEONInstAlias<"vmov${p} $Vd, $Vm",
6245 (VORRq QPR:$Vd, QPR:$Vm, QPR:$Vm, pred:$p)>;
6247 // VMOV : Vector Move (Immediate)
6249 // Although VMOVs are not strictly speaking cheap, they are as expensive
6250 // as their copies counterpart (VORR), so we should prefer rematerialization
6251 // over splitting when it applies.
6252 let isReMaterializable = 1, isAsCheapAsAMove=1 in {
6253 def VMOVv8i8 : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$Vd),
6254 (ins nImmSplatI8:$SIMM), IIC_VMOVImm,
6255 "vmov", "i8", "$Vd, $SIMM", "",
6256 [(set DPR:$Vd, (v8i8 (ARMvmovImm timm:$SIMM)))]>;
6257 def VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$Vd),
6258 (ins nImmSplatI8:$SIMM), IIC_VMOVImm,
6259 "vmov", "i8", "$Vd, $SIMM", "",
6260 [(set QPR:$Vd, (v16i8 (ARMvmovImm timm:$SIMM)))]>;
6262 def VMOVv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 0, 1, (outs DPR:$Vd),
6263 (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
6264 "vmov", "i16", "$Vd, $SIMM", "",
6265 [(set DPR:$Vd, (v4i16 (ARMvmovImm timm:$SIMM)))]> {
6266 let Inst{9} = SIMM{9};
6269 def VMOVv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 0, 1, (outs QPR:$Vd),
6270 (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
6271 "vmov", "i16", "$Vd, $SIMM", "",
6272 [(set QPR:$Vd, (v8i16 (ARMvmovImm timm:$SIMM)))]> {
6273 let Inst{9} = SIMM{9};
6276 def VMOVv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 0, 1, (outs DPR:$Vd),
6277 (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
6278 "vmov", "i32", "$Vd, $SIMM", "",
6279 [(set DPR:$Vd, (v2i32 (ARMvmovImm timm:$SIMM)))]> {
6280 let Inst{11-8} = SIMM{11-8};
6283 def VMOVv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 0, 1, (outs QPR:$Vd),
6284 (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
6285 "vmov", "i32", "$Vd, $SIMM", "",
6286 [(set QPR:$Vd, (v4i32 (ARMvmovImm timm:$SIMM)))]> {
6287 let Inst{11-8} = SIMM{11-8};
6290 def VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$Vd),
6291 (ins nImmSplatI64:$SIMM), IIC_VMOVImm,
6292 "vmov", "i64", "$Vd, $SIMM", "",
6293 [(set DPR:$Vd, (v1i64 (ARMvmovImm timm:$SIMM)))]>;
6294 def VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$Vd),
6295 (ins nImmSplatI64:$SIMM), IIC_VMOVImm,
6296 "vmov", "i64", "$Vd, $SIMM", "",
6297 [(set QPR:$Vd, (v2i64 (ARMvmovImm timm:$SIMM)))]>;
6299 def VMOVv2f32 : N1ModImm<1, 0b000, 0b1111, 0, 0, 0, 1, (outs DPR:$Vd),
6300 (ins nImmVMOVF32:$SIMM), IIC_VMOVImm,
6301 "vmov", "f32", "$Vd, $SIMM", "",
6302 [(set DPR:$Vd, (v2f32 (ARMvmovFPImm timm:$SIMM)))]>;
6303 def VMOVv4f32 : N1ModImm<1, 0b000, 0b1111, 0, 1, 0, 1, (outs QPR:$Vd),
6304 (ins nImmVMOVF32:$SIMM), IIC_VMOVImm,
6305 "vmov", "f32", "$Vd, $SIMM", "",
6306 [(set QPR:$Vd, (v4f32 (ARMvmovFPImm timm:$SIMM)))]>;
6307 } // isReMaterializable, isAsCheapAsAMove
6309 // Add support for bytes replication feature, so it could be GAS compatible.
6310 multiclass NEONImmReplicateI8InstAlias<ValueType To> {
6311 // E.g. instructions below:
6312 // "vmov.i32 d0, #0xffffffff"
6313 // "vmov.i32 d0, #0xabababab"
6314 // "vmov.i16 d0, #0xabab"
6315 // are incorrect, but we could deal with such cases.
6316 // For last two instructions, for example, it should emit:
6317 // "vmov.i8 d0, #0xab"
6318 def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
6319 (VMOVv8i8 DPR:$Vd, nImmVMOVIReplicate<i8, To>:$Vm, pred:$p)>;
6320 def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
6321 (VMOVv16i8 QPR:$Vd, nImmVMOVIReplicate<i8, To>:$Vm, pred:$p)>;
6322 // Also add same support for VMVN instructions. So instruction:
6323 // "vmvn.i32 d0, #0xabababab"
6325 // "vmov.i8 d0, #0x54"
6326 def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
6327 (VMOVv8i8 DPR:$Vd, nImmVINVIReplicate<i8, To>:$Vm, pred:$p)>;
6328 def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
6329 (VMOVv16i8 QPR:$Vd, nImmVINVIReplicate<i8, To>:$Vm, pred:$p)>;
6332 defm : NEONImmReplicateI8InstAlias<i16>;
6333 defm : NEONImmReplicateI8InstAlias<i32>;
6334 defm : NEONImmReplicateI8InstAlias<i64>;
6336 // Similar to above for types other than i8, e.g.:
6337 // "vmov.i32 d0, #0xab00ab00" -> "vmov.i16 d0, #0xab00"
6338 // "vmvn.i64 q0, #0xab000000ab000000" -> "vmvn.i32 q0, #0xab000000"
6339 // In this case we do not canonicalize VMVN to VMOV
6340 multiclass NEONImmReplicateInstAlias<ValueType From, NeonI V8, NeonI V16,
6341 NeonI NV8, NeonI NV16, ValueType To> {
6342 def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
6343 (V8 DPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
6344 def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
6345 (V16 QPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
6346 def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
6347 (NV8 DPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
6348 def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
6349 (NV16 QPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
6352 defm : NEONImmReplicateInstAlias<i16, VMOVv4i16, VMOVv8i16,
6353 VMVNv4i16, VMVNv8i16, i32>;
6354 defm : NEONImmReplicateInstAlias<i16, VMOVv4i16, VMOVv8i16,
6355 VMVNv4i16, VMVNv8i16, i64>;
6356 defm : NEONImmReplicateInstAlias<i32, VMOVv2i32, VMOVv4i32,
6357 VMVNv2i32, VMVNv4i32, i64>;
6358 // TODO: add "VMOV <-> VMVN" conversion for cases like
6359 // "vmov.i32 d0, #0xffaaffaa" -> "vmvn.i16 d0, #0x55"
6360 // "vmvn.i32 d0, #0xaaffaaff" -> "vmov.i16 d0, #0xff00"
6362 // On some CPUs the two instructions "vmov.i32 dD, #0" and "vmov.i32 qD, #0"
6363 // require zero cycles to execute so they should be used wherever possible for
6364 // setting a register to zero.
6366 // Even without these pseudo-insts we would probably end up with the correct
6367 // instruction, but we could not mark the general ones with "isAsCheapAsAMove"
6368 // since they are sometimes rather expensive (in general).
6370 let AddedComplexity = 50, isAsCheapAsAMove = 1, isReMaterializable = 1 in {
6371 def VMOVD0 : ARMPseudoExpand<(outs DPR:$Vd), (ins), 4, IIC_VMOVImm,
6372 [(set DPR:$Vd, (v2i32 ARMimmAllZerosD))],
6373 (VMOVv2i32 DPR:$Vd, 0, (ops 14, zero_reg))>,
6375 def VMOVQ0 : ARMPseudoExpand<(outs QPR:$Vd), (ins), 4, IIC_VMOVImm,
6376 [(set QPR:$Vd, (v4i32 ARMimmAllZerosV))],
6377 (VMOVv4i32 QPR:$Vd, 0, (ops 14, zero_reg))>,
6381 // VMOV : Vector Get Lane (move scalar to ARM core register)
6383 def VGETLNs8 : NVGetLane<{1,1,1,0,0,1,?,1}, 0b1011, {?,?},
6384 (outs GPR:$R), (ins DPR:$V, VectorIndex8:$lane),
6385 IIC_VMOVSI, "vmov", "s8", "$R, $V$lane",
6386 [(set GPR:$R, (ARMvgetlanes (v8i8 DPR:$V),
6388 let Inst{21} = lane{2};
6389 let Inst{6-5} = lane{1-0};
6391 def VGETLNs16 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, {?,1},
6392 (outs GPR:$R), (ins DPR:$V, VectorIndex16:$lane),
6393 IIC_VMOVSI, "vmov", "s16", "$R, $V$lane",
6394 [(set GPR:$R, (ARMvgetlanes (v4i16 DPR:$V),
6396 let Inst{21} = lane{1};
6397 let Inst{6} = lane{0};
6399 def VGETLNu8 : NVGetLane<{1,1,1,0,1,1,?,1}, 0b1011, {?,?},
6400 (outs GPR:$R), (ins DPR:$V, VectorIndex8:$lane),
6401 IIC_VMOVSI, "vmov", "u8", "$R, $V$lane",
6402 [(set GPR:$R, (ARMvgetlaneu (v8i8 DPR:$V),
6404 let Inst{21} = lane{2};
6405 let Inst{6-5} = lane{1-0};
6407 def VGETLNu16 : NVGetLane<{1,1,1,0,1,0,?,1}, 0b1011, {?,1},
6408 (outs GPR:$R), (ins DPR:$V, VectorIndex16:$lane),
6409 IIC_VMOVSI, "vmov", "u16", "$R, $V$lane",
6410 [(set GPR:$R, (ARMvgetlaneu (v4i16 DPR:$V),
6412 let Inst{21} = lane{1};
6413 let Inst{6} = lane{0};
6415 def VGETLNi32 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, 0b00,
6416 (outs GPR:$R), (ins DPR:$V, VectorIndex32:$lane),
6417 IIC_VMOVSI, "vmov", "32", "$R, $V$lane",
6418 [(set GPR:$R, (extractelt (v2i32 DPR:$V),
6420 Requires<[HasFPRegs, HasFastVGETLNi32]> {
6421 let Inst{21} = lane{0};
6423 let Predicates = [HasNEON] in {
6424 // def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
6425 def : Pat<(ARMvgetlanes (v16i8 QPR:$src), imm:$lane),
6426 (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
6427 (DSubReg_i8_reg imm:$lane))),
6428 (SubReg_i8_lane imm:$lane))>;
6429 def : Pat<(ARMvgetlanes (v8i16 QPR:$src), imm:$lane),
6430 (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
6431 (DSubReg_i16_reg imm:$lane))),
6432 (SubReg_i16_lane imm:$lane))>;
6433 def : Pat<(ARMvgetlaneu (v16i8 QPR:$src), imm:$lane),
6434 (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
6435 (DSubReg_i8_reg imm:$lane))),
6436 (SubReg_i8_lane imm:$lane))>;
6437 def : Pat<(ARMvgetlaneu (v8i16 QPR:$src), imm:$lane),
6438 (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
6439 (DSubReg_i16_reg imm:$lane))),
6440 (SubReg_i16_lane imm:$lane))>;
6442 def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
6443 (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
6444 (DSubReg_i32_reg imm:$lane))),
6445 (SubReg_i32_lane imm:$lane))>,
6446 Requires<[HasNEON, HasFastVGETLNi32]>;
6447 def : Pat<(extractelt (v2i32 DPR:$src), imm:$lane),
6449 (i32 (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane))), GPR)>,
6450 Requires<[HasNEON, HasSlowVGETLNi32]>;
6451 def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
6453 (i32 (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane))), GPR)>,
6454 Requires<[HasNEON, HasSlowVGETLNi32]>;
6455 let Predicates = [HasNEON] in {
6456 def : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2),
6457 (EXTRACT_SUBREG (v2f32 (COPY_TO_REGCLASS (v2f32 DPR:$src1),DPR_VFP2)),
6458 (SSubReg_f32_reg imm:$src2))>;
6459 def : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
6460 (EXTRACT_SUBREG (v4f32 (COPY_TO_REGCLASS (v4f32 QPR:$src1),QPR_VFP2)),
6461 (SSubReg_f32_reg imm:$src2))>;
6462 //def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
6463 // (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
6464 def : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
6465 (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
6468 multiclass ExtractEltEvenF16<ValueType VT4, ValueType VT8> {
6469 def : Pat<(extractelt (VT4 DPR:$src), imm_even:$lane),
6471 (v2f32 (COPY_TO_REGCLASS (VT4 DPR:$src), DPR_VFP2)),
6472 (SSubReg_f16_reg imm_even:$lane))>;
6473 def : Pat<(extractelt (VT8 QPR:$src), imm_even:$lane),
6475 (v4f32 (COPY_TO_REGCLASS (VT8 QPR:$src), QPR_VFP2)),
6476 (SSubReg_f16_reg imm_even:$lane))>;
6479 multiclass ExtractEltOddF16VMOVH<ValueType VT4, ValueType VT8> {
6480 def : Pat<(extractelt (VT4 DPR:$src), imm_odd:$lane),
6482 (VMOVH (EXTRACT_SUBREG
6483 (v2f32 (COPY_TO_REGCLASS (VT4 DPR:$src), DPR_VFP2)),
6484 (SSubReg_f16_reg imm_odd:$lane))),
6486 def : Pat<(extractelt (VT8 QPR:$src), imm_odd:$lane),
6488 (VMOVH (EXTRACT_SUBREG
6489 (v4f32 (COPY_TO_REGCLASS (VT8 QPR:$src), QPR_VFP2)),
6490 (SSubReg_f16_reg imm_odd:$lane))),
6494 let Predicates = [HasNEON] in {
6495 defm : ExtractEltEvenF16<v4f16, v8f16>;
6496 defm : ExtractEltOddF16VMOVH<v4f16, v8f16>;
6499 let AddedComplexity = 1, Predicates = [HasNEON, HasBF16, HasFullFP16] in {
6500 // If VMOVH (vmovx.f16) is available use it to extract BF16 from the odd lanes
6501 defm : ExtractEltOddF16VMOVH<v4bf16, v8bf16>;
6504 let Predicates = [HasBF16, HasNEON] in {
6505 defm : ExtractEltEvenF16<v4bf16, v8bf16>;
6507 // Otherwise, if VMOVH is not available resort to extracting the odd lane
6508 // into a GPR and then moving to HPR
6509 def : Pat<(extractelt (v4bf16 DPR:$src), imm_odd:$lane),
6511 (VGETLNu16 (v4bf16 DPR:$src), imm:$lane),
6514 def : Pat<(extractelt (v8bf16 QPR:$src), imm_odd:$lane),
6516 (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
6517 (DSubReg_i16_reg imm:$lane))),
6518 (SubReg_i16_lane imm:$lane)),
6522 // VMOV : Vector Set Lane (move ARM core register to scalar)
6524 let Constraints = "$src1 = $V" in {
6525 def VSETLNi8 : NVSetLane<{1,1,1,0,0,1,?,0}, 0b1011, {?,?}, (outs DPR:$V),
6526 (ins DPR:$src1, GPR:$R, VectorIndex8:$lane),
6527 IIC_VMOVISL, "vmov", "8", "$V$lane, $R",
6528 [(set DPR:$V, (vector_insert (v8i8 DPR:$src1),
6529 GPR:$R, imm:$lane))]> {
6530 let Inst{21} = lane{2};
6531 let Inst{6-5} = lane{1-0};
6533 def VSETLNi16 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, {?,1}, (outs DPR:$V),
6534 (ins DPR:$src1, GPR:$R, VectorIndex16:$lane),
6535 IIC_VMOVISL, "vmov", "16", "$V$lane, $R",
6536 [(set DPR:$V, (vector_insert (v4i16 DPR:$src1),
6537 GPR:$R, imm:$lane))]> {
6538 let Inst{21} = lane{1};
6539 let Inst{6} = lane{0};
6541 def VSETLNi32 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, 0b00, (outs DPR:$V),
6542 (ins DPR:$src1, GPR:$R, VectorIndex32:$lane),
6543 IIC_VMOVISL, "vmov", "32", "$V$lane, $R",
6544 [(set DPR:$V, (insertelt (v2i32 DPR:$src1),
6545 GPR:$R, imm:$lane))]>,
6546 Requires<[HasVFP2]> {
6547 let Inst{21} = lane{0};
6548 // This instruction is equivalent as
6549 // $V = INSERT_SUBREG $src1, $R, translateImmToSubIdx($imm)
6550 let isInsertSubreg = 1;
6554 // TODO: for odd lanes we could optimize this a bit by using the VINS
6555 // FullFP16 instruction when it is available
6556 multiclass InsertEltF16<ValueType VTScalar, ValueType VT4, ValueType VT8> {
6557 def : Pat<(insertelt (VT4 DPR:$src1), (VTScalar HPR:$src2), imm:$lane),
6558 (VT4 (VSETLNi16 DPR:$src1,
6559 (COPY_TO_REGCLASS HPR:$src2, GPR), imm:$lane))>;
6560 def : Pat<(insertelt (VT8 QPR:$src1), (VTScalar HPR:$src2), imm:$lane),
6561 (VT8 (INSERT_SUBREG QPR:$src1,
6562 (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
6563 (DSubReg_i16_reg imm:$lane))),
6564 (COPY_TO_REGCLASS HPR:$src2, GPR),
6565 (SubReg_i16_lane imm:$lane))),
6566 (DSubReg_i16_reg imm:$lane)))>;
6569 let Predicates = [HasNEON] in {
6570 def : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
6571 (v16i8 (INSERT_SUBREG QPR:$src1,
6572 (v8i8 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
6573 (DSubReg_i8_reg imm:$lane))),
6574 GPR:$src2, (SubReg_i8_lane imm:$lane))),
6575 (DSubReg_i8_reg imm:$lane)))>;
6576 def : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
6577 (v8i16 (INSERT_SUBREG QPR:$src1,
6578 (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
6579 (DSubReg_i16_reg imm:$lane))),
6580 GPR:$src2, (SubReg_i16_lane imm:$lane))),
6581 (DSubReg_i16_reg imm:$lane)))>;
6582 def : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
6583 (v4i32 (INSERT_SUBREG QPR:$src1,
6584 (v2i32 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
6585 (DSubReg_i32_reg imm:$lane))),
6586 GPR:$src2, (SubReg_i32_lane imm:$lane))),
6587 (DSubReg_i32_reg imm:$lane)))>;
6589 def : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)),
6590 (INSERT_SUBREG (v2f32 (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2)),
6591 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
6592 def : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
6593 (INSERT_SUBREG (v4f32 (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2)),
6594 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
6596 defm : InsertEltF16<f16, v4f16, v8f16>;
6598 def : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
6599 (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
6601 def : Pat<(v2f32 (scalar_to_vector SPR:$src)),
6602 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
6603 def : Pat<(v2f64 (scalar_to_vector (f64 DPR:$src))),
6604 (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
6605 def : Pat<(v4f32 (scalar_to_vector SPR:$src)),
6606 (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
6608 def : Pat<(v4f16 (scalar_to_vector (f16 HPR:$src))),
6609 (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), HPR:$src, ssub_0)>;
6610 def : Pat<(v8f16 (scalar_to_vector (f16 HPR:$src))),
6611 (INSERT_SUBREG (v8f16 (IMPLICIT_DEF)), HPR:$src, ssub_0)>;
6613 def : Pat<(v8i8 (scalar_to_vector GPR:$src)),
6614 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
6615 def : Pat<(v4i16 (scalar_to_vector GPR:$src)),
6616 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
6617 def : Pat<(v2i32 (scalar_to_vector GPR:$src)),
6618 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
6620 def : Pat<(v16i8 (scalar_to_vector GPR:$src)),
6621 (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)),
6622 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
6624 def : Pat<(v8i16 (scalar_to_vector GPR:$src)),
6625 (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)),
6626 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
6628 def : Pat<(v4i32 (scalar_to_vector GPR:$src)),
6629 (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
6630 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
6634 let Predicates = [HasNEON, HasBF16] in
6635 defm : InsertEltF16<bf16, v4bf16, v8bf16>;
6637 // VDUP : Vector Duplicate (from ARM core register to all elements)
6639 class VDUPD<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
6640 : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$V), (ins GPR:$R),
6641 IIC_VMOVIS, "vdup", Dt, "$V, $R",
6642 [(set DPR:$V, (Ty (ARMvdup (i32 GPR:$R))))]>;
6643 class VDUPQ<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
6644 : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$V), (ins GPR:$R),
6645 IIC_VMOVIS, "vdup", Dt, "$V, $R",
6646 [(set QPR:$V, (Ty (ARMvdup (i32 GPR:$R))))]>;
6648 def VDUP8d : VDUPD<0b11101100, 0b00, "8", v8i8>;
6649 def VDUP16d : VDUPD<0b11101000, 0b01, "16", v4i16>;
6650 def VDUP32d : VDUPD<0b11101000, 0b00, "32", v2i32>,
6651 Requires<[HasNEON, HasFastVDUP32]>;
6652 def VDUP8q : VDUPQ<0b11101110, 0b00, "8", v16i8>;
6653 def VDUP16q : VDUPQ<0b11101010, 0b01, "16", v8i16>;
6654 def VDUP32q : VDUPQ<0b11101010, 0b00, "32", v4i32>;
6656 // ARMvdup patterns for uarchs with fast VDUP.32.
6657 def : Pat<(v2f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VDUP32d GPR:$R)>,
6658 Requires<[HasNEON,HasFastVDUP32]>;
6659 def : Pat<(v4f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VDUP32q GPR:$R)>,
6660 Requires<[HasNEON]>;
6662 // ARMvdup patterns for uarchs with slow VDUP.32 - use VMOVDRR instead.
6663 def : Pat<(v2i32 (ARMvdup (i32 GPR:$R))), (VMOVDRR GPR:$R, GPR:$R)>,
6664 Requires<[HasNEON,HasSlowVDUP32]>;
6665 def : Pat<(v2f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VMOVDRR GPR:$R, GPR:$R)>,
6666 Requires<[HasNEON,HasSlowVDUP32]>;
6668 // VDUP : Vector Duplicate Lane (from scalar to all elements)
6670 class VDUPLND<bits<4> op19_16, string OpcodeStr, string Dt,
6671 ValueType Ty, Operand IdxTy>
6672 : NVDupLane<op19_16, 0, (outs DPR:$Vd), (ins DPR:$Vm, IdxTy:$lane),
6673 IIC_VMOVD, OpcodeStr, Dt, "$Vd, $Vm$lane",
6674 [(set DPR:$Vd, (Ty (ARMvduplane (Ty DPR:$Vm), imm:$lane)))]>;
6676 class VDUPLNQ<bits<4> op19_16, string OpcodeStr, string Dt,
6677 ValueType ResTy, ValueType OpTy, Operand IdxTy>
6678 : NVDupLane<op19_16, 1, (outs QPR:$Vd), (ins DPR:$Vm, IdxTy:$lane),
6679 IIC_VMOVQ, OpcodeStr, Dt, "$Vd, $Vm$lane",
6680 [(set QPR:$Vd, (ResTy (ARMvduplane (OpTy DPR:$Vm),
6681 VectorIndex32:$lane)))]>;
6683 // Inst{19-16} is partially specified depending on the element size.
6685 def VDUPLN8d : VDUPLND<{?,?,?,1}, "vdup", "8", v8i8, VectorIndex8> {
6687 let Inst{19-17} = lane{2-0};
6689 def VDUPLN16d : VDUPLND<{?,?,1,0}, "vdup", "16", v4i16, VectorIndex16> {
6691 let Inst{19-18} = lane{1-0};
6693 def VDUPLN32d : VDUPLND<{?,1,0,0}, "vdup", "32", v2i32, VectorIndex32> {
6695 let Inst{19} = lane{0};
6697 def VDUPLN8q : VDUPLNQ<{?,?,?,1}, "vdup", "8", v16i8, v8i8, VectorIndex8> {
6699 let Inst{19-17} = lane{2-0};
6701 def VDUPLN16q : VDUPLNQ<{?,?,1,0}, "vdup", "16", v8i16, v4i16, VectorIndex16> {
6703 let Inst{19-18} = lane{1-0};
6705 def VDUPLN32q : VDUPLNQ<{?,1,0,0}, "vdup", "32", v4i32, v2i32, VectorIndex32> {
6707 let Inst{19} = lane{0};
6710 let Predicates = [HasNEON] in {
6711 def : Pat<(v4f16 (ARMvduplane (v4f16 DPR:$Vm), imm:$lane)),
6712 (VDUPLN32d DPR:$Vm, imm:$lane)>;
6714 def : Pat<(v2f32 (ARMvduplane (v2f32 DPR:$Vm), imm:$lane)),
6715 (VDUPLN32d DPR:$Vm, imm:$lane)>;
6717 def : Pat<(v4f32 (ARMvduplane (v2f32 DPR:$Vm), imm:$lane)),
6718 (VDUPLN32q DPR:$Vm, imm:$lane)>;
6720 def : Pat<(v16i8 (ARMvduplane (v16i8 QPR:$src), imm:$lane)),
6721 (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src,
6722 (DSubReg_i8_reg imm:$lane))),
6723 (SubReg_i8_lane imm:$lane)))>;
6724 def : Pat<(v8i16 (ARMvduplane (v8i16 QPR:$src), imm:$lane)),
6725 (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src,
6726 (DSubReg_i16_reg imm:$lane))),
6727 (SubReg_i16_lane imm:$lane)))>;
6728 def : Pat<(v8f16 (ARMvduplane (v8f16 QPR:$src), imm:$lane)),
6729 (v8f16 (VDUPLN16q (v4f16 (EXTRACT_SUBREG QPR:$src,
6730 (DSubReg_i16_reg imm:$lane))),
6731 (SubReg_i16_lane imm:$lane)))>;
6732 def : Pat<(v4i32 (ARMvduplane (v4i32 QPR:$src), imm:$lane)),
6733 (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src,
6734 (DSubReg_i32_reg imm:$lane))),
6735 (SubReg_i32_lane imm:$lane)))>;
6736 def : Pat<(v4f32 (ARMvduplane (v4f32 QPR:$src), imm:$lane)),
6737 (v4f32 (VDUPLN32q (v2f32 (EXTRACT_SUBREG QPR:$src,
6738 (DSubReg_i32_reg imm:$lane))),
6739 (SubReg_i32_lane imm:$lane)))>;
6741 def : Pat<(v4f16 (ARMvdup (f16 HPR:$src))),
6742 (v4f16 (VDUPLN16d (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)),
6743 (f16 HPR:$src), ssub_0), (i32 0)))>;
6744 def : Pat<(v2f32 (ARMvdup (f32 SPR:$src))),
6745 (v2f32 (VDUPLN32d (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
6746 SPR:$src, ssub_0), (i32 0)))>;
6747 def : Pat<(v4f32 (ARMvdup (f32 SPR:$src))),
6748 (v4f32 (VDUPLN32q (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
6749 SPR:$src, ssub_0), (i32 0)))>;
6750 def : Pat<(v8f16 (ARMvdup (f16 HPR:$src))),
6751 (v8f16 (VDUPLN16q (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)),
6752 (f16 HPR:$src), ssub_0), (i32 0)))>;
6755 let Predicates = [HasNEON, HasBF16] in {
6756 def : Pat<(v4bf16 (ARMvduplane (v4bf16 DPR:$Vm), imm:$lane)),
6757 (VDUPLN16d DPR:$Vm, imm:$lane)>;
6759 def : Pat<(v8bf16 (ARMvduplane (v8bf16 QPR:$src), imm:$lane)),
6760 (v8bf16 (VDUPLN16q (v4bf16 (EXTRACT_SUBREG QPR:$src,
6761 (DSubReg_i16_reg imm:$lane))),
6762 (SubReg_i16_lane imm:$lane)))>;
6764 def : Pat<(v4bf16 (ARMvdup (bf16 HPR:$src))),
6765 (v4bf16 (VDUPLN16d (INSERT_SUBREG (v4bf16 (IMPLICIT_DEF)),
6766 (bf16 HPR:$src), ssub_0), (i32 0)))>;
6767 def : Pat<(v8bf16 (ARMvdup (bf16 HPR:$src))),
6768 (v8bf16 (VDUPLN16q (INSERT_SUBREG (v4bf16 (IMPLICIT_DEF)),
6769 (bf16 HPR:$src), ssub_0), (i32 0)))>;
6772 // VMOVN : Vector Narrowing Move
6773 defm VMOVN : N2VN_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVN,
6774 "vmovn", "i", trunc>;
6775 // VQMOVN : Vector Saturating Narrowing Move
6776 defm VQMOVNs : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD,
6777 "vqmovn", "s", int_arm_neon_vqmovns>;
6778 defm VQMOVNu : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD,
6779 "vqmovn", "u", int_arm_neon_vqmovnu>;
6780 defm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD,
6781 "vqmovun", "s", int_arm_neon_vqmovnsu>;
6782 // VMOVL : Vector Lengthening Move
6783 defm VMOVLs : N2VL_QHS<0b01,0b10100,0,1, "vmovl", "s", sext>;
6784 defm VMOVLu : N2VL_QHS<0b11,0b10100,0,1, "vmovl", "u", zext>;
6786 let Predicates = [HasNEON] in {
6787 def : Pat<(v8i16 (anyext (v8i8 DPR:$Vm))), (VMOVLuv8i16 DPR:$Vm)>;
6788 def : Pat<(v4i32 (anyext (v4i16 DPR:$Vm))), (VMOVLuv4i32 DPR:$Vm)>;
6789 def : Pat<(v2i64 (anyext (v2i32 DPR:$Vm))), (VMOVLuv2i64 DPR:$Vm)>;
6792 // Vector Conversions.
6794 // VCVT : Vector Convert Between Floating-Point and Integers
6795 def VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
6796 v2i32, v2f32, fp_to_sint>;
6797 def VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
6798 v2i32, v2f32, fp_to_uint>;
6799 def VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
6800 v2f32, v2i32, sint_to_fp>;
6801 def VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
6802 v2f32, v2i32, uint_to_fp>;
6804 def VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
6805 v4i32, v4f32, fp_to_sint>;
6806 def VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
6807 v4i32, v4f32, fp_to_uint>;
6808 def VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
6809 v4f32, v4i32, sint_to_fp>;
6810 def VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
6811 v4f32, v4i32, uint_to_fp>;
6813 def VCVTh2sd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01110, 0, "vcvt", "s16.f16",
6814 v4i16, v4f16, fp_to_sint>,
6815 Requires<[HasNEON, HasFullFP16]>;
6816 def VCVTh2ud : N2VD<0b11, 0b11, 0b01, 0b11, 0b01111, 0, "vcvt", "u16.f16",
6817 v4i16, v4f16, fp_to_uint>,
6818 Requires<[HasNEON, HasFullFP16]>;
6819 def VCVTs2hd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01100, 0, "vcvt", "f16.s16",
6820 v4f16, v4i16, sint_to_fp>,
6821 Requires<[HasNEON, HasFullFP16]>;
6822 def VCVTu2hd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01101, 0, "vcvt", "f16.u16",
6823 v4f16, v4i16, uint_to_fp>,
6824 Requires<[HasNEON, HasFullFP16]>;
6826 def VCVTh2sq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01110, 0, "vcvt", "s16.f16",
6827 v8i16, v8f16, fp_to_sint>,
6828 Requires<[HasNEON, HasFullFP16]>;
6829 def VCVTh2uq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01111, 0, "vcvt", "u16.f16",
6830 v8i16, v8f16, fp_to_uint>,
6831 Requires<[HasNEON, HasFullFP16]>;
6832 def VCVTs2hq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01100, 0, "vcvt", "f16.s16",
6833 v8f16, v8i16, sint_to_fp>,
6834 Requires<[HasNEON, HasFullFP16]>;
6835 def VCVTu2hq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01101, 0, "vcvt", "f16.u16",
6836 v8f16, v8i16, uint_to_fp>,
6837 Requires<[HasNEON, HasFullFP16]>;
6840 multiclass VCVT_FPI<string op, bits<3> op10_8, SDPatternOperator IntS,
6841 SDPatternOperator IntU> {
6842 let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
6843 def SDf : N2VDIntnp<0b10, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
6844 "s32.f32", v2i32, v2f32, IntS>, Requires<[HasV8, HasNEON]>;
6845 def SQf : N2VQIntnp<0b10, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
6846 "s32.f32", v4i32, v4f32, IntS>, Requires<[HasV8, HasNEON]>;
6847 def UDf : N2VDIntnp<0b10, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
6848 "u32.f32", v2i32, v2f32, IntU>, Requires<[HasV8, HasNEON]>;
6849 def UQf : N2VQIntnp<0b10, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
6850 "u32.f32", v4i32, v4f32, IntU>, Requires<[HasV8, HasNEON]>;
6851 def SDh : N2VDIntnp<0b01, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
6852 "s16.f16", v4i16, v4f16, IntS>,
6853 Requires<[HasV8, HasNEON, HasFullFP16]>;
6854 def SQh : N2VQIntnp<0b01, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
6855 "s16.f16", v8i16, v8f16, IntS>,
6856 Requires<[HasV8, HasNEON, HasFullFP16]>;
6857 def UDh : N2VDIntnp<0b01, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
6858 "u16.f16", v4i16, v4f16, IntU>,
6859 Requires<[HasV8, HasNEON, HasFullFP16]>;
6860 def UQh : N2VQIntnp<0b01, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
6861 "u16.f16", v8i16, v8f16, IntU>,
6862 Requires<[HasV8, HasNEON, HasFullFP16]>;
6866 defm VCVTAN : VCVT_FPI<"a", 0b000, int_arm_neon_vcvtas, int_arm_neon_vcvtau>;
6867 defm VCVTNN : VCVT_FPI<"n", 0b001, int_arm_neon_vcvtns, int_arm_neon_vcvtnu>;
6868 defm VCVTPN : VCVT_FPI<"p", 0b010, int_arm_neon_vcvtps, int_arm_neon_vcvtpu>;
6869 defm VCVTMN : VCVT_FPI<"m", 0b011, int_arm_neon_vcvtms, int_arm_neon_vcvtmu>;
6871 // VCVT : Vector Convert Between Floating-Point and Fixed-Point.
6872 let DecoderMethod = "DecodeVCVTD" in {
6873 def VCVTf2xsd : N2VCvtD<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
6874 v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
6875 def VCVTf2xud : N2VCvtD<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
6876 v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
6877 def VCVTxs2fd : N2VCvtD<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
6878 v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
6879 def VCVTxu2fd : N2VCvtD<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
6880 v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
6881 let Predicates = [HasNEON, HasFullFP16] in {
6882 def VCVTh2xsd : N2VCvtD<0, 1, 0b1101, 0, 1, "vcvt", "s16.f16",
6883 v4i16, v4f16, int_arm_neon_vcvtfp2fxs>;
6884 def VCVTh2xud : N2VCvtD<1, 1, 0b1101, 0, 1, "vcvt", "u16.f16",
6885 v4i16, v4f16, int_arm_neon_vcvtfp2fxu>;
6886 def VCVTxs2hd : N2VCvtD<0, 1, 0b1100, 0, 1, "vcvt", "f16.s16",
6887 v4f16, v4i16, int_arm_neon_vcvtfxs2fp>;
6888 def VCVTxu2hd : N2VCvtD<1, 1, 0b1100, 0, 1, "vcvt", "f16.u16",
6889 v4f16, v4i16, int_arm_neon_vcvtfxu2fp>;
6890 } // Predicates = [HasNEON, HasFullFP16]
6893 let DecoderMethod = "DecodeVCVTQ" in {
6894 def VCVTf2xsq : N2VCvtQ<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
6895 v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
6896 def VCVTf2xuq : N2VCvtQ<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
6897 v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
6898 def VCVTxs2fq : N2VCvtQ<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
6899 v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
6900 def VCVTxu2fq : N2VCvtQ<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
6901 v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
6902 let Predicates = [HasNEON, HasFullFP16] in {
6903 def VCVTh2xsq : N2VCvtQ<0, 1, 0b1101, 0, 1, "vcvt", "s16.f16",
6904 v8i16, v8f16, int_arm_neon_vcvtfp2fxs>;
6905 def VCVTh2xuq : N2VCvtQ<1, 1, 0b1101, 0, 1, "vcvt", "u16.f16",
6906 v8i16, v8f16, int_arm_neon_vcvtfp2fxu>;
6907 def VCVTxs2hq : N2VCvtQ<0, 1, 0b1100, 0, 1, "vcvt", "f16.s16",
6908 v8f16, v8i16, int_arm_neon_vcvtfxs2fp>;
6909 def VCVTxu2hq : N2VCvtQ<1, 1, 0b1100, 0, 1, "vcvt", "f16.u16",
6910 v8f16, v8i16, int_arm_neon_vcvtfxu2fp>;
6911 } // Predicates = [HasNEON, HasFullFP16]
6914 def : NEONInstAlias<"vcvt${p}.s32.f32 $Dd, $Dm, #0",
6915 (VCVTf2sd DPR:$Dd, DPR:$Dm, pred:$p)>;
6916 def : NEONInstAlias<"vcvt${p}.u32.f32 $Dd, $Dm, #0",
6917 (VCVTf2ud DPR:$Dd, DPR:$Dm, pred:$p)>;
6918 def : NEONInstAlias<"vcvt${p}.f32.s32 $Dd, $Dm, #0",
6919 (VCVTs2fd DPR:$Dd, DPR:$Dm, pred:$p)>;
6920 def : NEONInstAlias<"vcvt${p}.f32.u32 $Dd, $Dm, #0",
6921 (VCVTu2fd DPR:$Dd, DPR:$Dm, pred:$p)>;
6923 def : NEONInstAlias<"vcvt${p}.s32.f32 $Qd, $Qm, #0",
6924 (VCVTf2sq QPR:$Qd, QPR:$Qm, pred:$p)>;
6925 def : NEONInstAlias<"vcvt${p}.u32.f32 $Qd, $Qm, #0",
6926 (VCVTf2uq QPR:$Qd, QPR:$Qm, pred:$p)>;
6927 def : NEONInstAlias<"vcvt${p}.f32.s32 $Qd, $Qm, #0",
6928 (VCVTs2fq QPR:$Qd, QPR:$Qm, pred:$p)>;
6929 def : NEONInstAlias<"vcvt${p}.f32.u32 $Qd, $Qm, #0",
6930 (VCVTu2fq QPR:$Qd, QPR:$Qm, pred:$p)>;
6932 def : NEONInstAlias<"vcvt${p}.s16.f16 $Dd, $Dm, #0",
6933 (VCVTh2sd DPR:$Dd, DPR:$Dm, pred:$p)>;
6934 def : NEONInstAlias<"vcvt${p}.u16.f16 $Dd, $Dm, #0",
6935 (VCVTh2ud DPR:$Dd, DPR:$Dm, pred:$p)>;
6936 def : NEONInstAlias<"vcvt${p}.f16.s16 $Dd, $Dm, #0",
6937 (VCVTs2hd DPR:$Dd, DPR:$Dm, pred:$p)>;
6938 def : NEONInstAlias<"vcvt${p}.f16.u16 $Dd, $Dm, #0",
6939 (VCVTu2hd DPR:$Dd, DPR:$Dm, pred:$p)>;
6941 def : NEONInstAlias<"vcvt${p}.s16.f16 $Qd, $Qm, #0",
6942 (VCVTh2sq QPR:$Qd, QPR:$Qm, pred:$p)>;
6943 def : NEONInstAlias<"vcvt${p}.u16.f16 $Qd, $Qm, #0",
6944 (VCVTh2uq QPR:$Qd, QPR:$Qm, pred:$p)>;
6945 def : NEONInstAlias<"vcvt${p}.f16.s16 $Qd, $Qm, #0",
6946 (VCVTs2hq QPR:$Qd, QPR:$Qm, pred:$p)>;
6947 def : NEONInstAlias<"vcvt${p}.f16.u16 $Qd, $Qm, #0",
6948 (VCVTu2hq QPR:$Qd, QPR:$Qm, pred:$p)>;
6951 // VCVT : Vector Convert Between Half-Precision and Single-Precision.
6952 def VCVTf2h : N2VNInt<0b11, 0b11, 0b01, 0b10, 0b01100, 0, 0,
6953 IIC_VUNAQ, "vcvt", "f16.f32",
6954 v4i16, v4f32, int_arm_neon_vcvtfp2hf>,
6955 Requires<[HasNEON, HasFP16]>;
6956 def VCVTh2f : N2VLInt<0b11, 0b11, 0b01, 0b10, 0b01110, 0, 0,
6957 IIC_VUNAQ, "vcvt", "f32.f16",
6958 v4f32, v4i16, int_arm_neon_vcvthf2fp>,
6959 Requires<[HasNEON, HasFP16]>;
6963 // VREV64 : Vector Reverse elements within 64-bit doublewords
6965 class VREV64D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
6966 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$Vd),
6967 (ins DPR:$Vm), IIC_VMOVD,
6968 OpcodeStr, Dt, "$Vd, $Vm", "",
6969 [(set DPR:$Vd, (Ty (ARMvrev64 (Ty DPR:$Vm))))]>;
6970 class VREV64Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
6971 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$Vd),
6972 (ins QPR:$Vm), IIC_VMOVQ,
6973 OpcodeStr, Dt, "$Vd, $Vm", "",
6974 [(set QPR:$Vd, (Ty (ARMvrev64 (Ty QPR:$Vm))))]>;
6976 def VREV64d8 : VREV64D<0b00, "vrev64", "8", v8i8>;
6977 def VREV64d16 : VREV64D<0b01, "vrev64", "16", v4i16>;
6978 def VREV64d32 : VREV64D<0b10, "vrev64", "32", v2i32>;
6979 let Predicates = [HasNEON] in {
6980 def : Pat<(v2f32 (ARMvrev64 (v2f32 DPR:$Vm))), (VREV64d32 DPR:$Vm)>;
6983 def VREV64q8 : VREV64Q<0b00, "vrev64", "8", v16i8>;
6984 def VREV64q16 : VREV64Q<0b01, "vrev64", "16", v8i16>;
6985 def VREV64q32 : VREV64Q<0b10, "vrev64", "32", v4i32>;
6987 let Predicates = [HasNEON] in {
6988 def : Pat<(v4f32 (ARMvrev64 (v4f32 QPR:$Vm))),
6989 (VREV64q32 QPR:$Vm)>;
6990 def : Pat<(v8f16 (ARMvrev64 (v8f16 QPR:$Vm))),
6991 (VREV64q16 QPR:$Vm)>;
6992 def : Pat<(v4f16 (ARMvrev64 (v4f16 DPR:$Vm))),
6993 (VREV64d16 DPR:$Vm)>;
6996 // VREV32 : Vector Reverse elements within 32-bit words
6998 class VREV32D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
6999 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$Vd),
7000 (ins DPR:$Vm), IIC_VMOVD,
7001 OpcodeStr, Dt, "$Vd, $Vm", "",
7002 [(set DPR:$Vd, (Ty (ARMvrev32 (Ty DPR:$Vm))))]>;
7003 class VREV32Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
7004 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$Vd),
7005 (ins QPR:$Vm), IIC_VMOVQ,
7006 OpcodeStr, Dt, "$Vd, $Vm", "",
7007 [(set QPR:$Vd, (Ty (ARMvrev32 (Ty QPR:$Vm))))]>;
7009 def VREV32d8 : VREV32D<0b00, "vrev32", "8", v8i8>;
7010 def VREV32d16 : VREV32D<0b01, "vrev32", "16", v4i16>;
7012 def VREV32q8 : VREV32Q<0b00, "vrev32", "8", v16i8>;
7013 def VREV32q16 : VREV32Q<0b01, "vrev32", "16", v8i16>;
7015 let Predicates = [HasNEON] in {
7016 def : Pat<(v8f16 (ARMvrev32 (v8f16 QPR:$Vm))),
7017 (VREV32q16 QPR:$Vm)>;
7018 def : Pat<(v4f16 (ARMvrev32 (v4f16 DPR:$Vm))),
7019 (VREV32d16 DPR:$Vm)>;
7022 // VREV16 : Vector Reverse elements within 16-bit halfwords
7024 class VREV16D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
7025 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$Vd),
7026 (ins DPR:$Vm), IIC_VMOVD,
7027 OpcodeStr, Dt, "$Vd, $Vm", "",
7028 [(set DPR:$Vd, (Ty (ARMvrev16 (Ty DPR:$Vm))))]>;
7029 class VREV16Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
7030 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$Vd),
7031 (ins QPR:$Vm), IIC_VMOVQ,
7032 OpcodeStr, Dt, "$Vd, $Vm", "",
7033 [(set QPR:$Vd, (Ty (ARMvrev16 (Ty QPR:$Vm))))]>;
7035 def VREV16d8 : VREV16D<0b00, "vrev16", "8", v8i8>;
7036 def VREV16q8 : VREV16Q<0b00, "vrev16", "8", v16i8>;
7038 // Other Vector Shuffles.
7040 // Aligned extractions: really just dropping registers
7042 class AlignedVEXTq<ValueType DestTy, ValueType SrcTy, SDNodeXForm LaneCVT>
7043 : Pat<(DestTy (vector_extract_subvec (SrcTy QPR:$src), (i32 imm:$start))),
7044 (EXTRACT_SUBREG (SrcTy QPR:$src), (LaneCVT imm:$start))>,
7045 Requires<[HasNEON]>;
7047 def : AlignedVEXTq<v8i8, v16i8, DSubReg_i8_reg>;
7049 def : AlignedVEXTq<v4i16, v8i16, DSubReg_i16_reg>;
7051 def : AlignedVEXTq<v2i32, v4i32, DSubReg_i32_reg>;
7053 def : AlignedVEXTq<v1i64, v2i64, DSubReg_f64_reg>;
7055 def : AlignedVEXTq<v2f32, v4f32, DSubReg_i32_reg>;
7057 def : AlignedVEXTq<v4f16, v8f16, DSubReg_i16_reg>; // v8f16 -> v4f16
7059 // VEXT : Vector Extract
7062 // All of these have a two-operand InstAlias.
7063 let TwoOperandAliasConstraint = "$Vn = $Vd" in {
7064 class VEXTd<string OpcodeStr, string Dt, ValueType Ty, Operand immTy>
7065 : N3V<0,1,0b11,{?,?,?,?},0,0, (outs DPR:$Vd),
7066 (ins DPR:$Vn, DPR:$Vm, immTy:$index), NVExtFrm,
7067 IIC_VEXTD, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
7068 [(set DPR:$Vd, (Ty (NEONvext (Ty DPR:$Vn),
7069 (Ty DPR:$Vm), imm:$index)))]> {
7072 let Inst{10-8} = index{2-0};
7075 class VEXTq<string OpcodeStr, string Dt, ValueType Ty, Operand immTy>
7076 : N3V<0,1,0b11,{?,?,?,?},1,0, (outs QPR:$Vd),
7077 (ins QPR:$Vn, QPR:$Vm, imm0_15:$index), NVExtFrm,
7078 IIC_VEXTQ, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
7079 [(set QPR:$Vd, (Ty (NEONvext (Ty QPR:$Vn),
7080 (Ty QPR:$Vm), imm:$index)))]> {
7082 let Inst{11-8} = index{3-0};
7086 def VEXTd8 : VEXTd<"vext", "8", v8i8, imm0_7> {
7087 let Inst{10-8} = index{2-0};
7089 def VEXTd16 : VEXTd<"vext", "16", v4i16, imm0_3> {
7090 let Inst{10-9} = index{1-0};
7093 let Predicates = [HasNEON] in {
7094 def : Pat<(v4f16 (NEONvext (v4f16 DPR:$Vn), (v4f16 DPR:$Vm), (i32 imm:$index))),
7095 (VEXTd16 DPR:$Vn, DPR:$Vm, imm:$index)>;
7098 def VEXTd32 : VEXTd<"vext", "32", v2i32, imm0_1> {
7099 let Inst{10} = index{0};
7100 let Inst{9-8} = 0b00;
7102 let Predicates = [HasNEON] in {
7103 def : Pat<(v2f32 (NEONvext (v2f32 DPR:$Vn), (v2f32 DPR:$Vm), (i32 imm:$index))),
7104 (VEXTd32 DPR:$Vn, DPR:$Vm, imm:$index)>;
7107 def VEXTq8 : VEXTq<"vext", "8", v16i8, imm0_15> {
7108 let Inst{11-8} = index{3-0};
7110 def VEXTq16 : VEXTq<"vext", "16", v8i16, imm0_7> {
7111 let Inst{11-9} = index{2-0};
7114 let Predicates = [HasNEON] in {
7115 def : Pat<(v8f16 (NEONvext (v8f16 QPR:$Vn), (v8f16 QPR:$Vm), (i32 imm:$index))),
7116 (VEXTq16 QPR:$Vn, QPR:$Vm, imm:$index)>;
7119 def VEXTq32 : VEXTq<"vext", "32", v4i32, imm0_3> {
7120 let Inst{11-10} = index{1-0};
7121 let Inst{9-8} = 0b00;
7123 def VEXTq64 : VEXTq<"vext", "64", v2i64, imm0_1> {
7124 let Inst{11} = index{0};
7125 let Inst{10-8} = 0b000;
7127 let Predicates = [HasNEON] in {
7128 def : Pat<(v4f32 (NEONvext (v4f32 QPR:$Vn), (v4f32 QPR:$Vm), (i32 imm:$index))),
7129 (VEXTq32 QPR:$Vn, QPR:$Vm, imm:$index)>;
7132 // VTRN : Vector Transpose
7134 def VTRNd8 : N2VDShuffle<0b00, 0b00001, "vtrn", "8">;
7135 def VTRNd16 : N2VDShuffle<0b01, 0b00001, "vtrn", "16">;
7136 def VTRNd32 : N2VDShuffle<0b10, 0b00001, "vtrn", "32">;
7138 def VTRNq8 : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn", "8">;
7139 def VTRNq16 : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn", "16">;
7140 def VTRNq32 : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn", "32">;
7142 // VUZP : Vector Unzip (Deinterleave)
7144 def VUZPd8 : N2VDShuffle<0b00, 0b00010, "vuzp", "8">;
7145 def VUZPd16 : N2VDShuffle<0b01, 0b00010, "vuzp", "16">;
7146 // vuzp.32 Dd, Dm is a pseudo-instruction expanded to vtrn.32 Dd, Dm.
7147 def : NEONInstAlias<"vuzp${p}.32 $Dd, $Dm",
7148 (VTRNd32 DPR:$Dd, DPR:$Dm, pred:$p)>;
7150 def VUZPq8 : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp", "8">;
7151 def VUZPq16 : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp", "16">;
7152 def VUZPq32 : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp", "32">;
7154 // VZIP : Vector Zip (Interleave)
7156 def VZIPd8 : N2VDShuffle<0b00, 0b00011, "vzip", "8">;
7157 def VZIPd16 : N2VDShuffle<0b01, 0b00011, "vzip", "16">;
7158 // vzip.32 Dd, Dm is a pseudo-instruction expanded to vtrn.32 Dd, Dm.
7159 def : NEONInstAlias<"vzip${p}.32 $Dd, $Dm",
7160 (VTRNd32 DPR:$Dd, DPR:$Dm, pred:$p)>;
7162 def VZIPq8 : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip", "8">;
7163 def VZIPq16 : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip", "16">;
7164 def VZIPq32 : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip", "32">;
7166 // Vector Table Lookup and Table Extension.
7168 // VTBL : Vector Table Lookup
7169 let DecoderMethod = "DecodeTBLInstruction" in {
7171 : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$Vd),
7172 (ins VecListOneD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB1,
7173 "vtbl", "8", "$Vd, $Vn, $Vm", "",
7174 [(set DPR:$Vd, (v8i8 (NEONvtbl1 VecListOneD:$Vn, DPR:$Vm)))]>;
7176 let hasExtraSrcRegAllocReq = 1 in {
7178 : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$Vd),
7179 (ins VecListDPair:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB2,
7180 "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
7182 : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$Vd),
7183 (ins VecListThreeD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB3,
7184 "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
7186 : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$Vd),
7187 (ins VecListFourD:$Vn, DPR:$Vm),
7189 "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
7190 } // hasExtraSrcRegAllocReq = 1
7193 : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB3, "", []>;
7195 : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB4, "", []>;
7197 // VTBX : Vector Table Extension
7199 : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$Vd),
7200 (ins DPR:$orig, VecListOneD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX1,
7201 "vtbx", "8", "$Vd, $Vn, $Vm", "$orig = $Vd",
7202 [(set DPR:$Vd, (v8i8 (int_arm_neon_vtbx1
7203 DPR:$orig, VecListOneD:$Vn, DPR:$Vm)))]>;
7204 let hasExtraSrcRegAllocReq = 1 in {
7206 : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$Vd),
7207 (ins DPR:$orig, VecListDPair:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX2,
7208 "vtbx", "8", "$Vd, $Vn, $Vm", "$orig = $Vd", []>;
7210 : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$Vd),
7211 (ins DPR:$orig, VecListThreeD:$Vn, DPR:$Vm),
7212 NVTBLFrm, IIC_VTBX3,
7213 "vtbx", "8", "$Vd, $Vn, $Vm",
7216 : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$Vd),
7217 (ins DPR:$orig, VecListFourD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX4,
7218 "vtbx", "8", "$Vd, $Vn, $Vm",
7220 } // hasExtraSrcRegAllocReq = 1
7223 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
7224 IIC_VTBX3, "$orig = $dst", []>;
7226 : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
7227 IIC_VTBX4, "$orig = $dst", []>;
7228 } // DecoderMethod = "DecodeTBLInstruction"
7230 let Predicates = [HasNEON] in {
7231 def : Pat<(v8i8 (NEONvtbl2 v8i8:$Vn0, v8i8:$Vn1, v8i8:$Vm)),
7232 (v8i8 (VTBL2 (REG_SEQUENCE DPair, v8i8:$Vn0, dsub_0,
7235 def : Pat<(v8i8 (int_arm_neon_vtbx2 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
7237 (v8i8 (VTBX2 v8i8:$orig,
7238 (REG_SEQUENCE DPair, v8i8:$Vn0, dsub_0,
7242 def : Pat<(v8i8 (int_arm_neon_vtbl3 v8i8:$Vn0, v8i8:$Vn1,
7243 v8i8:$Vn2, v8i8:$Vm)),
7244 (v8i8 (VTBL3Pseudo (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
7247 (v8i8 (IMPLICIT_DEF)), dsub_3),
7249 def : Pat<(v8i8 (int_arm_neon_vtbx3 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
7250 v8i8:$Vn2, v8i8:$Vm)),
7251 (v8i8 (VTBX3Pseudo v8i8:$orig,
7252 (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
7255 (v8i8 (IMPLICIT_DEF)), dsub_3),
7258 def : Pat<(v8i8 (int_arm_neon_vtbl4 v8i8:$Vn0, v8i8:$Vn1,
7259 v8i8:$Vn2, v8i8:$Vn3, v8i8:$Vm)),
7260 (v8i8 (VTBL4Pseudo (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
7265 def : Pat<(v8i8 (int_arm_neon_vtbx4 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
7266 v8i8:$Vn2, v8i8:$Vn3, v8i8:$Vm)),
7267 (v8i8 (VTBX4Pseudo v8i8:$orig,
7268 (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
7275 // VRINT : Vector Rounding
7276 multiclass VRINT_FPI<string op, bits<3> op9_7, SDPatternOperator Int> {
7277 let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
7278 def Df : N2VDIntnp<0b10, 0b10, 0b100, 0, NoItinerary,
7279 !strconcat("vrint", op), "f32",
7280 v2f32, v2f32, Int>, Requires<[HasV8, HasNEON]> {
7281 let Inst{9-7} = op9_7;
7283 def Qf : N2VQIntnp<0b10, 0b10, 0b100, 0, NoItinerary,
7284 !strconcat("vrint", op), "f32",
7285 v4f32, v4f32, Int>, Requires<[HasV8, HasNEON]> {
7286 let Inst{9-7} = op9_7;
7288 def Dh : N2VDIntnp<0b01, 0b10, 0b100, 0, NoItinerary,
7289 !strconcat("vrint", op), "f16",
7291 Requires<[HasV8, HasNEON, HasFullFP16]> {
7292 let Inst{9-7} = op9_7;
7294 def Qh : N2VQIntnp<0b01, 0b10, 0b100, 0, NoItinerary,
7295 !strconcat("vrint", op), "f16",
7297 Requires<[HasV8, HasNEON, HasFullFP16]> {
7298 let Inst{9-7} = op9_7;
7302 def : NEONInstAlias<!strconcat("vrint", op, ".f32.f32\t$Dd, $Dm"),
7303 (!cast<Instruction>(NAME#"Df") DPR:$Dd, DPR:$Dm)>;
7304 def : NEONInstAlias<!strconcat("vrint", op, ".f32.f32\t$Qd, $Qm"),
7305 (!cast<Instruction>(NAME#"Qf") QPR:$Qd, QPR:$Qm)>;
7306 let Predicates = [HasNEON, HasFullFP16] in {
7307 def : NEONInstAlias<!strconcat("vrint", op, ".f16.f16\t$Dd, $Dm"),
7308 (!cast<Instruction>(NAME#"Dh") DPR:$Dd, DPR:$Dm)>;
7309 def : NEONInstAlias<!strconcat("vrint", op, ".f16.f16\t$Qd, $Qm"),
7310 (!cast<Instruction>(NAME#"Qh") QPR:$Qd, QPR:$Qm)>;
7314 defm VRINTNN : VRINT_FPI<"n", 0b000, int_arm_neon_vrintn>;
7315 defm VRINTXN : VRINT_FPI<"x", 0b001, int_arm_neon_vrintx>;
7316 defm VRINTAN : VRINT_FPI<"a", 0b010, int_arm_neon_vrinta>;
7317 defm VRINTZN : VRINT_FPI<"z", 0b011, int_arm_neon_vrintz>;
7318 defm VRINTMN : VRINT_FPI<"m", 0b101, int_arm_neon_vrintm>;
7319 defm VRINTPN : VRINT_FPI<"p", 0b111, int_arm_neon_vrintp>;
7321 // Cryptography instructions
7322 let PostEncoderMethod = "NEONThumb2DataIPostEncoder",
7323 DecoderNamespace = "v8Crypto", hasSideEffects = 0 in {
7324 class AES<string op, bit op7, bit op6, SDPatternOperator Int>
7325 : N2VQIntXnp<0b00, 0b00, 0b011, op6, op7, NoItinerary,
7326 !strconcat("aes", op), "8", v16i8, v16i8, Int>;
7327 class AES2Op<string op, bit op7, bit op6, SDPatternOperator Int>
7328 : N2VQIntX2np<0b00, 0b00, 0b011, op6, op7, NoItinerary,
7329 !strconcat("aes", op), "8", v16i8, v16i8, Int>;
7330 class N2SHA<string op, bits<2> op17_16, bits<3> op10_8, bit op7, bit op6,
7331 SDPatternOperator Int>
7332 : N2VQIntXnp<0b10, op17_16, op10_8, op6, op7, NoItinerary,
7333 !strconcat("sha", op), "32", v4i32, v4i32, Int>;
7334 class N2SHA2Op<string op, bits<2> op17_16, bits<3> op10_8, bit op7, bit op6,
7335 SDPatternOperator Int>
7336 : N2VQIntX2np<0b10, op17_16, op10_8, op6, op7, NoItinerary,
7337 !strconcat("sha", op), "32", v4i32, v4i32, Int>;
7338 class N3SHA3Op<string op, bits<5> op27_23, bits<2> op21_20, SDPatternOperator Int>
7339 : N3VQInt3np<op27_23, op21_20, 0b1100, 1, 0, N3RegFrm, NoItinerary,
7340 !strconcat("sha", op), "32", v4i32, v4i32, Int, 0>;
7343 let Predicates = [HasV8, HasAES] in {
7344 def AESD : AES2Op<"d", 0, 1, int_arm_neon_aesd>;
7345 def AESE : AES2Op<"e", 0, 0, int_arm_neon_aese>;
7346 def AESIMC : AES<"imc", 1, 1, int_arm_neon_aesimc>;
7347 def AESMC : AES<"mc", 1, 0, int_arm_neon_aesmc>;
7350 let Predicates = [HasV8, HasSHA2] in {
7351 def SHA1H : N2SHA<"1h", 0b01, 0b010, 1, 1, null_frag>;
7352 def SHA1SU1 : N2SHA2Op<"1su1", 0b10, 0b011, 1, 0, int_arm_neon_sha1su1>;
7353 def SHA256SU0 : N2SHA2Op<"256su0", 0b10, 0b011, 1, 1, int_arm_neon_sha256su0>;
7354 def SHA1C : N3SHA3Op<"1c", 0b00100, 0b00, null_frag>;
7355 def SHA1M : N3SHA3Op<"1m", 0b00100, 0b10, null_frag>;
7356 def SHA1P : N3SHA3Op<"1p", 0b00100, 0b01, null_frag>;
7357 def SHA1SU0 : N3SHA3Op<"1su0", 0b00100, 0b11, int_arm_neon_sha1su0>;
7358 def SHA256H : N3SHA3Op<"256h", 0b00110, 0b00, int_arm_neon_sha256h>;
7359 def SHA256H2 : N3SHA3Op<"256h2", 0b00110, 0b01, int_arm_neon_sha256h2>;
7360 def SHA256SU1 : N3SHA3Op<"256su1", 0b00110, 0b10, int_arm_neon_sha256su1>;
7363 let Predicates = [HasNEON] in {
7364 def : Pat<(i32 (int_arm_neon_sha1h i32:$Rn)),
7365 (COPY_TO_REGCLASS (f32 (EXTRACT_SUBREG
7366 (SHA1H (SUBREG_TO_REG (i64 0),
7367 (f32 (COPY_TO_REGCLASS i32:$Rn, SPR)),
7371 def : Pat<(v4i32 (int_arm_neon_sha1c v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
7372 (SHA1C v4i32:$hash_abcd,
7373 (SUBREG_TO_REG (i64 0),
7374 (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
7378 def : Pat<(v4i32 (int_arm_neon_sha1m v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
7379 (SHA1M v4i32:$hash_abcd,
7380 (SUBREG_TO_REG (i64 0),
7381 (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
7385 def : Pat<(v4i32 (int_arm_neon_sha1p v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
7386 (SHA1P v4i32:$hash_abcd,
7387 (SUBREG_TO_REG (i64 0),
7388 (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
7393 //===----------------------------------------------------------------------===//
7394 // NEON instructions for single-precision FP math
7395 //===----------------------------------------------------------------------===//
7397 class N2VSPat<SDNode OpNode, NeonI Inst>
7398 : NEONFPPat<(f32 (OpNode SPR:$a)),
7400 (v2f32 (COPY_TO_REGCLASS (Inst
7402 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
7403 SPR:$a, ssub_0)), DPR_VFP2)), ssub_0)>;
7405 class N3VSPat<SDNode OpNode, NeonI Inst>
7406 : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
7408 (v2f32 (COPY_TO_REGCLASS (Inst
7410 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
7413 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
7414 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
7416 class N3VSPatFP16<SDNode OpNode, NeonI Inst>
7417 : NEONFPPat<(f16 (OpNode HPR:$a, HPR:$b)),
7419 (v4f16 (COPY_TO_REGCLASS (Inst
7421 (v4f16 (COPY_TO_REGCLASS (v4f16 (IMPLICIT_DEF)), DPR_VFP2)),
7424 (v4f16 (COPY_TO_REGCLASS (v4f16 (IMPLICIT_DEF)), DPR_VFP2)),
7425 HPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
7427 class N3VSMulOpPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
7428 : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
7430 (v2f32 (COPY_TO_REGCLASS (Inst
7432 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
7435 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
7438 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
7439 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
7441 class NVCVTIFPat<SDNode OpNode, NeonI Inst>
7442 : NEONFPPat<(f32 (OpNode GPR:$a)),
7443 (f32 (EXTRACT_SUBREG
7446 (v2f32 (IMPLICIT_DEF)),
7447 (i32 (COPY_TO_REGCLASS GPR:$a, SPR)), ssub_0))),
7449 class NVCVTFIPat<SDNode OpNode, NeonI Inst>
7450 : NEONFPPat<(i32 (OpNode SPR:$a)),
7451 (i32 (EXTRACT_SUBREG
7452 (v2f32 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
7456 def : N3VSPat<fadd, VADDfd>;
7457 def : N3VSPat<fsub, VSUBfd>;
7458 def : N3VSPat<fmul, VMULfd>;
7459 def : N3VSMulOpPat<fmul, fadd, VMLAfd>,
7460 Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
7461 def : N3VSMulOpPat<fmul, fsub, VMLSfd>,
7462 Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
7463 def : N3VSMulOpPat<fmul, fadd, VFMAfd>,
7464 Requires<[HasVFP4, UseNEONForFP, UseFusedMAC]>;
7465 def : N3VSMulOpPat<fmul, fsub, VFMSfd>,
7466 Requires<[HasVFP4, UseNEONForFP, UseFusedMAC]>;
7467 def : N2VSPat<fabs, VABSfd>;
7468 def : N2VSPat<fneg, VNEGfd>;
7469 def : N3VSPatFP16<fmaximum, VMAXhd>, Requires<[HasFullFP16]>;
7470 def : N3VSPatFP16<fminimum, VMINhd>, Requires<[HasFullFP16]>;
7471 def : N3VSPat<fmaximum, VMAXfd>, Requires<[HasNEON]>;
7472 def : N3VSPat<fminimum, VMINfd>, Requires<[HasNEON]>;
7473 def : NVCVTFIPat<fp_to_sint, VCVTf2sd>;
7474 def : NVCVTFIPat<fp_to_uint, VCVTf2ud>;
7475 def : NVCVTIFPat<sint_to_fp, VCVTs2fd>;
7476 def : NVCVTIFPat<uint_to_fp, VCVTu2fd>;
7478 // NEON doesn't have any f64 conversions, so provide patterns to make
7479 // sure the VFP conversions match when extracting from a vector.
7480 def : VFPPat<(f64 (sint_to_fp (extractelt (v2i32 DPR:$src), imm:$lane))),
7481 (VSITOD (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>;
7482 def : VFPPat<(f64 (sint_to_fp (extractelt (v4i32 QPR:$src), imm:$lane))),
7483 (VSITOD (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane)))>;
7484 def : VFPPat<(f64 (uint_to_fp (extractelt (v2i32 DPR:$src), imm:$lane))),
7485 (VUITOD (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>;
7486 def : VFPPat<(f64 (uint_to_fp (extractelt (v4i32 QPR:$src), imm:$lane))),
7487 (VUITOD (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane)))>;
7490 // Prefer VMOVDRR for i32 -> f32 bitcasts, it can write all DPR registers.
7491 def : Pat<(f32 (bitconvert GPR:$a)),
7492 (EXTRACT_SUBREG (VMOVDRR GPR:$a, GPR:$a), ssub_0)>,
7493 Requires<[HasNEON, DontUseVMOVSR]>;
7494 def : Pat<(arm_vmovsr GPR:$a),
7495 (EXTRACT_SUBREG (VMOVDRR GPR:$a, GPR:$a), ssub_0)>,
7496 Requires<[HasNEON, DontUseVMOVSR]>;
7498 //===----------------------------------------------------------------------===//
7499 // Non-Instruction Patterns or Endianess - Revert Patterns
7500 //===----------------------------------------------------------------------===//
7503 // 64 bit conversions
7504 let Predicates = [HasNEON] in {
7505 def : Pat<(f64 (bitconvert (v1i64 DPR:$src))), (f64 DPR:$src)>;
7506 def : Pat<(v1i64 (bitconvert (f64 DPR:$src))), (v1i64 DPR:$src)>;
7508 def : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
7509 def : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
7511 def : Pat<(v4i16 (bitconvert (v4f16 DPR:$src))), (v4i16 DPR:$src)>;
7512 def : Pat<(v4f16 (bitconvert (v4i16 DPR:$src))), (v4f16 DPR:$src)>;
7514 def : Pat<(v4i16 (bitconvert (v4bf16 DPR:$src))), (v4i16 DPR:$src)>;
7515 def : Pat<(v4bf16 (bitconvert (v4i16 DPR:$src))), (v4bf16 DPR:$src)>;
7517 // 128 bit conversions
7518 def : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
7519 def : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
7521 def : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
7522 def : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
7524 def : Pat<(v8i16 (bitconvert (v8f16 QPR:$src))), (v8i16 QPR:$src)>;
7525 def : Pat<(v8f16 (bitconvert (v8i16 QPR:$src))), (v8f16 QPR:$src)>;
7527 def : Pat<(v8i16 (bitconvert (v8bf16 QPR:$src))), (v8i16 QPR:$src)>;
7528 def : Pat<(v8bf16 (bitconvert (v8i16 QPR:$src))), (v8bf16 QPR:$src)>;
7531 let Predicates = [IsLE,HasNEON] in {
7532 // 64 bit conversions
7533 def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (f64 DPR:$src)>;
7534 def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (f64 DPR:$src)>;
7535 def : Pat<(f64 (bitconvert (v4f16 DPR:$src))), (f64 DPR:$src)>;
7536 def : Pat<(f64 (bitconvert (v4bf16 DPR:$src))), (f64 DPR:$src)>;
7537 def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (f64 DPR:$src)>;
7538 def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (f64 DPR:$src)>;
7540 def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
7541 def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
7542 def : Pat<(v1i64 (bitconvert (v4f16 DPR:$src))), (v1i64 DPR:$src)>;
7543 def : Pat<(v1i64 (bitconvert (v4bf16 DPR:$src))), (v1i64 DPR:$src)>;
7544 def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
7545 def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (v1i64 DPR:$src)>;
7547 def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (v2f32 DPR:$src)>;
7548 def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
7549 def : Pat<(v2f32 (bitconvert (v4f16 DPR:$src))), (v2f32 DPR:$src)>;
7550 def : Pat<(v2f32 (bitconvert (v4bf16 DPR:$src))), (v2f32 DPR:$src)>;
7551 def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
7552 def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (v2f32 DPR:$src)>;
7554 def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (v2i32 DPR:$src)>;
7555 def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
7556 def : Pat<(v2i32 (bitconvert (v4f16 DPR:$src))), (v2i32 DPR:$src)>;
7557 def : Pat<(v2i32 (bitconvert (v4bf16 DPR:$src))), (v2i32 DPR:$src)>;
7558 def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
7559 def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (v2i32 DPR:$src)>;
7561 def : Pat<(v4f16 (bitconvert (f64 DPR:$src))), (v4f16 DPR:$src)>;
7562 def : Pat<(v4f16 (bitconvert (v1i64 DPR:$src))), (v4f16 DPR:$src)>;
7563 def : Pat<(v4f16 (bitconvert (v2f32 DPR:$src))), (v4f16 DPR:$src)>;
7564 def : Pat<(v4f16 (bitconvert (v2i32 DPR:$src))), (v4f16 DPR:$src)>;
7565 def : Pat<(v4f16 (bitconvert (v8i8 DPR:$src))), (v4f16 DPR:$src)>;
7567 def : Pat<(v4bf16 (bitconvert (f64 DPR:$src))), (v4bf16 DPR:$src)>;
7568 def : Pat<(v4bf16 (bitconvert (v1i64 DPR:$src))), (v4bf16 DPR:$src)>;
7569 def : Pat<(v4bf16 (bitconvert (v2f32 DPR:$src))), (v4bf16 DPR:$src)>;
7570 def : Pat<(v4bf16 (bitconvert (v2i32 DPR:$src))), (v4bf16 DPR:$src)>;
7571 def : Pat<(v4bf16 (bitconvert (v8i8 DPR:$src))), (v4bf16 DPR:$src)>;
7573 def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (v4i16 DPR:$src)>;
7574 def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
7575 def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
7576 def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
7577 def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (v4i16 DPR:$src)>;
7579 def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (v8i8 DPR:$src)>;
7580 def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (v8i8 DPR:$src)>;
7581 def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (v8i8 DPR:$src)>;
7582 def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (v8i8 DPR:$src)>;
7583 def : Pat<(v8i8 (bitconvert (v4f16 DPR:$src))), (v8i8 DPR:$src)>;
7584 def : Pat<(v8i8 (bitconvert (v4bf16 DPR:$src))), (v8i8 DPR:$src)>;
7585 def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (v8i8 DPR:$src)>;
7587 // 128 bit conversions
7588 def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;
7589 def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
7590 def : Pat<(v2f64 (bitconvert (v8f16 QPR:$src))), (v2f64 QPR:$src)>;
7591 def : Pat<(v2f64 (bitconvert (v8bf16 QPR:$src))), (v2f64 QPR:$src)>;
7592 def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
7593 def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
7595 def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
7596 def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
7597 def : Pat<(v2i64 (bitconvert (v8f16 QPR:$src))), (v2i64 QPR:$src)>;
7598 def : Pat<(v2i64 (bitconvert (v8bf16 QPR:$src))), (v2i64 QPR:$src)>;
7599 def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
7600 def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
7602 def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
7603 def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
7604 def : Pat<(v4f32 (bitconvert (v8f16 QPR:$src))), (v4f32 QPR:$src)>;
7605 def : Pat<(v4f32 (bitconvert (v8bf16 QPR:$src))), (v4f32 QPR:$src)>;
7606 def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
7607 def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
7609 def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
7610 def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
7611 def : Pat<(v4i32 (bitconvert (v8f16 QPR:$src))), (v4i32 QPR:$src)>;
7612 def : Pat<(v4i32 (bitconvert (v8bf16 QPR:$src))), (v4i32 QPR:$src)>;
7613 def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
7614 def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
7616 def : Pat<(v8f16 (bitconvert (v2f64 QPR:$src))), (v8f16 QPR:$src)>;
7617 def : Pat<(v8f16 (bitconvert (v2i64 QPR:$src))), (v8f16 QPR:$src)>;
7618 def : Pat<(v8f16 (bitconvert (v4f32 QPR:$src))), (v8f16 QPR:$src)>;
7619 def : Pat<(v8f16 (bitconvert (v4i32 QPR:$src))), (v8f16 QPR:$src)>;
7620 def : Pat<(v8f16 (bitconvert (v16i8 QPR:$src))), (v8f16 QPR:$src)>;
7622 def : Pat<(v8bf16 (bitconvert (v2f64 QPR:$src))), (v8bf16 QPR:$src)>;
7623 def : Pat<(v8bf16 (bitconvert (v2i64 QPR:$src))), (v8bf16 QPR:$src)>;
7624 def : Pat<(v8bf16 (bitconvert (v4f32 QPR:$src))), (v8bf16 QPR:$src)>;
7625 def : Pat<(v8bf16 (bitconvert (v4i32 QPR:$src))), (v8bf16 QPR:$src)>;
7626 def : Pat<(v8bf16 (bitconvert (v16i8 QPR:$src))), (v8bf16 QPR:$src)>;
7628 def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
7629 def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
7630 def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
7631 def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
7632 def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
7634 def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
7635 def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
7636 def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
7637 def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
7638 def : Pat<(v16i8 (bitconvert (v8f16 QPR:$src))), (v16i8 QPR:$src)>;
7639 def : Pat<(v16i8 (bitconvert (v8bf16 QPR:$src))), (v16i8 QPR:$src)>;
7640 def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
7643 let Predicates = [IsBE,HasNEON] in {
7644 // 64 bit conversions
7645 def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (VREV64d32 DPR:$src)>;
7646 def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (VREV64d32 DPR:$src)>;
7647 def : Pat<(f64 (bitconvert (v4f16 DPR:$src))), (VREV64d16 DPR:$src)>;
7648 def : Pat<(f64 (bitconvert (v4bf16 DPR:$src))), (VREV64d16 DPR:$src)>;
7649 def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (VREV64d16 DPR:$src)>;
7650 def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (VREV64d8 DPR:$src)>;
7652 def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (VREV64d32 DPR:$src)>;
7653 def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (VREV64d32 DPR:$src)>;
7654 def : Pat<(v1i64 (bitconvert (v4f16 DPR:$src))), (VREV64d16 DPR:$src)>;
7655 def : Pat<(v1i64 (bitconvert (v4bf16 DPR:$src))), (VREV64d16 DPR:$src)>;
7656 def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (VREV64d16 DPR:$src)>;
7657 def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (VREV64d8 DPR:$src)>;
7659 def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (VREV64d32 DPR:$src)>;
7660 def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (VREV64d32 DPR:$src)>;
7661 def : Pat<(v2f32 (bitconvert (v4f16 DPR:$src))), (VREV32d16 DPR:$src)>;
7662 def : Pat<(v2f32 (bitconvert (v4bf16 DPR:$src))), (VREV32d16 DPR:$src)>;
7663 def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (VREV32d16 DPR:$src)>;
7664 def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (VREV32d8 DPR:$src)>;
7666 def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (VREV64d32 DPR:$src)>;
7667 def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (VREV64d32 DPR:$src)>;
7668 def : Pat<(v2i32 (bitconvert (v4f16 DPR:$src))), (VREV32d16 DPR:$src)>;
7669 def : Pat<(v2i32 (bitconvert (v4bf16 DPR:$src))), (VREV32d16 DPR:$src)>;
7670 def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (VREV32d16 DPR:$src)>;
7671 def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (VREV32d8 DPR:$src)>;
7673 def : Pat<(v4f16 (bitconvert (f64 DPR:$src))), (VREV64d16 DPR:$src)>;
7674 def : Pat<(v4f16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
7675 def : Pat<(v4f16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
7676 def : Pat<(v4f16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
7677 def : Pat<(v4f16 (bitconvert (v8i8 DPR:$src))), (VREV16d8 DPR:$src)>;
7679 def : Pat<(v4bf16 (bitconvert (f64 DPR:$src))), (VREV64d16 DPR:$src)>;
7680 def : Pat<(v4bf16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
7681 def : Pat<(v4bf16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
7682 def : Pat<(v4bf16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
7683 def : Pat<(v4bf16 (bitconvert (v8i8 DPR:$src))), (VREV16d8 DPR:$src)>;
7685 def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (VREV64d16 DPR:$src)>;
7686 def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
7687 def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
7688 def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
7689 def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (VREV16d8 DPR:$src)>;
7691 def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (VREV64d8 DPR:$src)>;
7692 def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (VREV64d8 DPR:$src)>;
7693 def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (VREV32d8 DPR:$src)>;
7694 def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (VREV32d8 DPR:$src)>;
7695 def : Pat<(v8i8 (bitconvert (v4f16 DPR:$src))), (VREV16d8 DPR:$src)>;
7696 def : Pat<(v8i8 (bitconvert (v4bf16 DPR:$src))), (VREV16d8 DPR:$src)>;
7697 def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (VREV16d8 DPR:$src)>;
7699 // 128 bit conversions
7700 def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (VREV64q32 QPR:$src)>;
7701 def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (VREV64q32 QPR:$src)>;
7702 def : Pat<(v2f64 (bitconvert (v8f16 QPR:$src))), (VREV64q16 QPR:$src)>;
7703 def : Pat<(v2f64 (bitconvert (v8bf16 QPR:$src))), (VREV64q16 QPR:$src)>;
7704 def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (VREV64q16 QPR:$src)>;
7705 def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (VREV64q8 QPR:$src)>;
7707 def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (VREV64q32 QPR:$src)>;
7708 def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (VREV64q32 QPR:$src)>;
7709 def : Pat<(v2i64 (bitconvert (v8f16 QPR:$src))), (VREV64q16 QPR:$src)>;
7710 def : Pat<(v2i64 (bitconvert (v8bf16 QPR:$src))), (VREV64q16 QPR:$src)>;
7711 def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (VREV64q16 QPR:$src)>;
7712 def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (VREV64q8 QPR:$src)>;
7714 def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (VREV64q32 QPR:$src)>;
7715 def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (VREV64q32 QPR:$src)>;
7716 def : Pat<(v4f32 (bitconvert (v8f16 QPR:$src))), (VREV32q16 QPR:$src)>;
7717 def : Pat<(v4f32 (bitconvert (v8bf16 QPR:$src))), (VREV32q16 QPR:$src)>;
7718 def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (VREV32q16 QPR:$src)>;
7719 def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (VREV32q8 QPR:$src)>;
7721 def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (VREV64q32 QPR:$src)>;
7722 def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (VREV64q32 QPR:$src)>;
7723 def : Pat<(v4i32 (bitconvert (v8f16 QPR:$src))), (VREV32q16 QPR:$src)>;
7724 def : Pat<(v4i32 (bitconvert (v8bf16 QPR:$src))), (VREV32q16 QPR:$src)>;
7725 def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (VREV32q16 QPR:$src)>;
7726 def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (VREV32q8 QPR:$src)>;
7728 def : Pat<(v8f16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
7729 def : Pat<(v8f16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
7730 def : Pat<(v8f16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
7731 def : Pat<(v8f16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
7732 def : Pat<(v8f16 (bitconvert (v16i8 QPR:$src))), (VREV16q8 QPR:$src)>;
7734 def : Pat<(v8bf16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
7735 def : Pat<(v8bf16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
7736 def : Pat<(v8bf16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
7737 def : Pat<(v8bf16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
7738 def : Pat<(v8bf16 (bitconvert (v16i8 QPR:$src))), (VREV16q8 QPR:$src)>;
7740 def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
7741 def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
7742 def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
7743 def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
7744 def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (VREV16q8 QPR:$src)>;
7746 def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (VREV64q8 QPR:$src)>;
7747 def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (VREV64q8 QPR:$src)>;
7748 def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (VREV32q8 QPR:$src)>;
7749 def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (VREV32q8 QPR:$src)>;
7750 def : Pat<(v16i8 (bitconvert (v8f16 QPR:$src))), (VREV16q8 QPR:$src)>;
7751 def : Pat<(v16i8 (bitconvert (v8bf16 QPR:$src))), (VREV16q8 QPR:$src)>;
7752 def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (VREV16q8 QPR:$src)>;
7755 let Predicates = [HasNEON] in {
7756 // Here we match the specific SDNode type 'ARMVectorRegCastImpl'
7757 // rather than the more general 'ARMVectorRegCast' which would also
7758 // match some bitconverts. If we use the latter in cases where the
7759 // input and output types are the same, the bitconvert gets elided
7760 // and we end up generating a nonsense match of nothing.
7762 foreach VT = [ v16i8, v8i16, v8f16, v8bf16, v4i32, v4f32, v2i64, v2f64 ] in
7763 foreach VT2 = [ v16i8, v8i16, v8f16, v8bf16, v4i32, v4f32, v2i64, v2f64 ] in
7764 def : Pat<(VT (ARMVectorRegCastImpl (VT2 QPR:$src))), (VT QPR:$src)>;
7766 foreach VT = [ v8i8, v4i16, v4f16, v4bf16, v2i32, v2f32, v1i64, f64 ] in
7767 foreach VT2 = [ v8i8, v4i16, v4f16, v4bf16, v2i32, v2f32, v1i64, f64 ] in
7768 def : Pat<(VT (ARMVectorRegCastImpl (VT2 DPR:$src))), (VT DPR:$src)>;
7771 // Use VLD1/VST1 + VREV for non-word-aligned v2f64 load/store on Big Endian
7772 let Predicates = [IsBE,HasNEON] in {
7773 def : Pat<(v2f64 (byte_alignedload addrmode6:$addr)),
7774 (VREV64q8 (VLD1q8 addrmode6:$addr))>;
7775 def : Pat<(byte_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
7776 (VST1q8 addrmode6:$addr, (VREV64q8 QPR:$value))>;
7777 def : Pat<(v2f64 (hword_alignedload addrmode6:$addr)),
7778 (VREV64q16 (VLD1q16 addrmode6:$addr))>;
7779 def : Pat<(hword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
7780 (VST1q16 addrmode6:$addr, (VREV64q16 QPR:$value))>;
7783 // Fold extracting an element out of a v2i32 into a vfp register.
7784 def : Pat<(f32 (bitconvert (i32 (extractelt (v2i32 DPR:$src), imm:$lane)))),
7785 (f32 (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>,
7786 Requires<[HasNEON]>;
7788 // Vector lengthening move with load, matching extending loads.
7790 // extload, zextload and sextload for a standard lengthening load. Example:
7791 // Lengthen_Single<"8", "i16", "8"> =
7792 // Pat<(v8i16 (extloadvi8 addrmode6:$addr))
7793 // (VMOVLuv8i16 (VLD1d8 addrmode6:$addr,
7794 // (f64 (IMPLICIT_DEF)), (i32 0)))>;
7795 multiclass Lengthen_Single<string DestLanes, string DestTy, string SrcTy> {
7796 let AddedComplexity = 10 in {
7797 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7798 (!cast<PatFrag>("extloadvi" # SrcTy) addrmode6:$addr)),
7799 (!cast<Instruction>("VMOVLuv" # DestLanes # DestTy)
7800 (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
7801 Requires<[HasNEON]>;
7803 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7804 (!cast<PatFrag>("zextloadvi" # SrcTy) addrmode6:$addr)),
7805 (!cast<Instruction>("VMOVLuv" # DestLanes # DestTy)
7806 (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
7807 Requires<[HasNEON]>;
7809 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7810 (!cast<PatFrag>("sextloadvi" # SrcTy) addrmode6:$addr)),
7811 (!cast<Instruction>("VMOVLsv" # DestLanes # DestTy)
7812 (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
7813 Requires<[HasNEON]>;
7817 // extload, zextload and sextload for a lengthening load which only uses
7818 // half the lanes available. Example:
7819 // Lengthen_HalfSingle<"4", "i16", "8", "i16", "i8"> =
7820 // Pat<(v4i16 (extloadvi8 addrmode6oneL32:$addr)),
7821 // (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd32 addrmode6oneL32:$addr,
7822 // (f64 (IMPLICIT_DEF)), (i32 0))),
7824 multiclass Lengthen_HalfSingle<string DestLanes, string DestTy, string SrcTy,
7825 string InsnLanes, string InsnTy> {
7826 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7827 (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
7828 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
7829 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7831 Requires<[HasNEON]>;
7832 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7833 (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
7834 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
7835 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7837 Requires<[HasNEON]>;
7838 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7839 (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
7840 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # InsnLanes # InsnTy)
7841 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7843 Requires<[HasNEON]>;
7846 // The following class definition is basically a copy of the
7847 // Lengthen_HalfSingle definition above, however with an additional parameter
7848 // "RevLanes" to select the correct VREV32dXX instruction. This is to convert
7849 // data loaded by VLD1LN into proper vector format in big endian mode.
7850 multiclass Lengthen_HalfSingle_Big_Endian<string DestLanes, string DestTy, string SrcTy,
7851 string InsnLanes, string InsnTy, string RevLanes> {
7852 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7853 (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
7854 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
7855 (!cast<Instruction>("VREV32d" # RevLanes)
7856 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
7858 Requires<[HasNEON]>;
7859 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7860 (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
7861 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
7862 (!cast<Instruction>("VREV32d" # RevLanes)
7863 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
7865 Requires<[HasNEON]>;
7866 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7867 (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
7868 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # InsnLanes # InsnTy)
7869 (!cast<Instruction>("VREV32d" # RevLanes)
7870 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
7872 Requires<[HasNEON]>;
7875 // extload, zextload and sextload for a lengthening load followed by another
7876 // lengthening load, to quadruple the initial length.
7878 // Lengthen_Double<"4", "i32", "i8", "8", "i16", "4", "i32"> =
7879 // Pat<(v4i32 (extloadvi8 addrmode6oneL32:$addr))
7880 // (EXTRACT_SUBREG (VMOVLuv4i32
7881 // (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd32 addrmode6oneL32:$addr,
7882 // (f64 (IMPLICIT_DEF)),
7886 multiclass Lengthen_Double<string DestLanes, string DestTy, string SrcTy,
7887 string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
7889 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7890 (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
7891 (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7892 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7893 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7895 Requires<[HasNEON]>;
7896 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7897 (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
7898 (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7899 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7900 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7902 Requires<[HasNEON]>;
7903 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7904 (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
7905 (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
7906 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
7907 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7909 Requires<[HasNEON]>;
7912 // The following class definition is basically a copy of the
7913 // Lengthen_Double definition above, however with an additional parameter
7914 // "RevLanes" to select the correct VREV32dXX instruction. This is to convert
7915 // data loaded by VLD1LN into proper vector format in big endian mode.
7916 multiclass Lengthen_Double_Big_Endian<string DestLanes, string DestTy, string SrcTy,
7917 string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
7918 string Insn2Ty, string RevLanes> {
7919 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7920 (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
7921 (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7922 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7923 (!cast<Instruction>("VREV32d" # RevLanes)
7924 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
7926 Requires<[HasNEON]>;
7927 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7928 (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
7929 (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7930 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7931 (!cast<Instruction>("VREV32d" # RevLanes)
7932 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
7934 Requires<[HasNEON]>;
7935 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7936 (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
7937 (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
7938 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
7939 (!cast<Instruction>("VREV32d" # RevLanes)
7940 (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
7942 Requires<[HasNEON]>;
7945 // extload, zextload and sextload for a lengthening load followed by another
7946 // lengthening load, to quadruple the initial length, but which ends up only
7947 // requiring half the available lanes (a 64-bit outcome instead of a 128-bit).
7949 // Lengthen_HalfDouble<"2", "i32", "i8", "8", "i16", "4", "i32"> =
7950 // Pat<(v2i32 (extloadvi8 addrmode6:$addr))
7951 // (EXTRACT_SUBREG (VMOVLuv4i32
7952 // (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd16 addrmode6:$addr,
7953 // (f64 (IMPLICIT_DEF)), (i32 0))),
7956 multiclass Lengthen_HalfDouble<string DestLanes, string DestTy, string SrcTy,
7957 string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
7959 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7960 (!cast<PatFrag>("extloadv" # SrcTy) addrmode6:$addr)),
7961 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7962 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7963 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7966 Requires<[HasNEON]>;
7967 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7968 (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6:$addr)),
7969 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7970 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7971 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7974 Requires<[HasNEON]>;
7975 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7976 (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6:$addr)),
7977 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
7978 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
7979 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
7982 Requires<[HasNEON]>;
7985 // The following class definition is basically a copy of the
7986 // Lengthen_HalfDouble definition above, however with an additional VREV16d8
7987 // instruction to convert data loaded by VLD1LN into proper vector format
7988 // in big endian mode.
7989 multiclass Lengthen_HalfDouble_Big_Endian<string DestLanes, string DestTy, string SrcTy,
7990 string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
7992 def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
7993 (!cast<PatFrag>("extloadv" # SrcTy) addrmode6:$addr)),
7994 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
7995 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
7996 (!cast<Instruction>("VREV16d8")
7997 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
8000 Requires<[HasNEON]>;
8001 def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
8002 (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6:$addr)),
8003 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
8004 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
8005 (!cast<Instruction>("VREV16d8")
8006 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
8009 Requires<[HasNEON]>;
8010 def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
8011 (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6:$addr)),
8012 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
8013 (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
8014 (!cast<Instruction>("VREV16d8")
8015 (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
8070 (!cast<Instruction>("VREV16d8")
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
8075 (!cast<Instruction>("VREV16d8")
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
8080 (!cast<Instruction>("VREV16d8")
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