1 //===- ARMInstrFormats.td - ARM Instruction Formats --*- tablegen -*---------=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 //===----------------------------------------------------------------------===//
12 // ARM Instruction Format Definitions.
15 // Format specifies the encoding used by the instruction. This is part of the
16 // ad-hoc solution used to emit machine instruction encodings by our machine
18 class Format<bits<6> val> {
22 def Pseudo : Format<0>;
23 def MulFrm : Format<1>;
24 def BrFrm : Format<2>;
25 def BrMiscFrm : Format<3>;
27 def DPFrm : Format<4>;
28 def DPSoRegFrm : Format<5>;
30 def LdFrm : Format<6>;
31 def StFrm : Format<7>;
32 def LdMiscFrm : Format<8>;
33 def StMiscFrm : Format<9>;
34 def LdStMulFrm : Format<10>;
36 def LdStExFrm : Format<11>;
38 def ArithMiscFrm : Format<12>;
39 def SatFrm : Format<13>;
40 def ExtFrm : Format<14>;
42 def VFPUnaryFrm : Format<15>;
43 def VFPBinaryFrm : Format<16>;
44 def VFPConv1Frm : Format<17>;
45 def VFPConv2Frm : Format<18>;
46 def VFPConv3Frm : Format<19>;
47 def VFPConv4Frm : Format<20>;
48 def VFPConv5Frm : Format<21>;
49 def VFPLdStFrm : Format<22>;
50 def VFPLdStMulFrm : Format<23>;
51 def VFPMiscFrm : Format<24>;
53 def ThumbFrm : Format<25>;
54 def MiscFrm : Format<26>;
56 def NGetLnFrm : Format<27>;
57 def NSetLnFrm : Format<28>;
58 def NDupFrm : Format<29>;
59 def NLdStFrm : Format<30>;
60 def N1RegModImmFrm: Format<31>;
61 def N2RegFrm : Format<32>;
62 def NVCVTFrm : Format<33>;
63 def NVDupLnFrm : Format<34>;
64 def N2RegVShLFrm : Format<35>;
65 def N2RegVShRFrm : Format<36>;
66 def N3RegFrm : Format<37>;
67 def N3RegVShFrm : Format<38>;
68 def NVExtFrm : Format<39>;
69 def NVMulSLFrm : Format<40>;
70 def NVTBLFrm : Format<41>;
74 // the instruction has a Rn register operand.
75 // UnaryDP - Indicates this is a unary data processing instruction, i.e.
76 // it doesn't have a Rn operand.
77 class UnaryDP { bit isUnaryDataProc = 1; }
79 // Xform16Bit - Indicates this Thumb2 instruction may be transformed into
80 // a 16-bit Thumb instruction if certain conditions are met.
81 class Xform16Bit { bit canXformTo16Bit = 1; }
83 //===----------------------------------------------------------------------===//
84 // ARM Instruction flags. These need to match ARMBaseInstrInfo.h.
88 class AddrMode<bits<5> val> {
91 def AddrModeNone : AddrMode<0>;
92 def AddrMode1 : AddrMode<1>;
93 def AddrMode2 : AddrMode<2>;
94 def AddrMode3 : AddrMode<3>;
95 def AddrMode4 : AddrMode<4>;
96 def AddrMode5 : AddrMode<5>;
97 def AddrMode6 : AddrMode<6>;
98 def AddrModeT1_1 : AddrMode<7>;
99 def AddrModeT1_2 : AddrMode<8>;
100 def AddrModeT1_4 : AddrMode<9>;
101 def AddrModeT1_s : AddrMode<10>;
102 def AddrModeT2_i12 : AddrMode<11>;
103 def AddrModeT2_i8 : AddrMode<12>;
104 def AddrModeT2_so : AddrMode<13>;
105 def AddrModeT2_pc : AddrMode<14>;
106 def AddrModeT2_i8s4 : AddrMode<15>;
109 class SizeFlagVal<bits<3> val> {
112 def SizeInvalid : SizeFlagVal<0>; // Unset.
113 def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
114 def Size8Bytes : SizeFlagVal<2>;
115 def Size4Bytes : SizeFlagVal<3>;
116 def Size2Bytes : SizeFlagVal<4>;
118 // Load / store index mode.
119 class IndexMode<bits<2> val> {
122 def IndexModeNone : IndexMode<0>;
123 def IndexModePre : IndexMode<1>;
124 def IndexModePost : IndexMode<2>;
125 def IndexModeUpd : IndexMode<3>;
127 // Instruction execution domain.
128 class Domain<bits<2> val> {
131 def GenericDomain : Domain<0>;
132 def VFPDomain : Domain<1>; // Instructions in VFP domain only
133 def NeonDomain : Domain<2>; // Instructions in Neon domain only
134 def VFPNeonDomain : Domain<3>; // Instructions in both VFP & Neon domains
136 //===----------------------------------------------------------------------===//
138 // ARM special operands.
141 def CondCodeOperand : AsmOperandClass {
142 let Name = "CondCode";
143 let SuperClasses = [];
146 // ARM Predicate operand. Default to 14 = always (AL). Second part is CC
147 // register whose default is 0 (no register).
148 def pred : PredicateOperand<OtherVT, (ops i32imm, CCR),
149 (ops (i32 14), (i32 zero_reg))> {
150 let PrintMethod = "printPredicateOperand";
151 let ParserMatchClass = CondCodeOperand;
154 // Conditional code result for instructions whose 's' bit is set, e.g. subs.
155 def cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 zero_reg))> {
156 let PrintMethod = "printSBitModifierOperand";
159 // Same as cc_out except it defaults to setting CPSR.
160 def s_cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 CPSR))> {
161 let PrintMethod = "printSBitModifierOperand";
164 // ARM special operands for disassembly only.
167 def cps_opt : Operand<i32> {
168 let PrintMethod = "printCPSOptionOperand";
171 def msr_mask : Operand<i32> {
172 let PrintMethod = "printMSRMaskOperand";
175 // A8.6.117, A8.6.118. Different instructions are generated for #0 and #-0.
176 // The neg_zero operand translates -0 to -1, -1 to -2, ..., etc.
177 def neg_zero : Operand<i32> {
178 let PrintMethod = "printNegZeroOperand";
181 //===----------------------------------------------------------------------===//
183 // ARM Instruction templates.
186 class InstTemplate<AddrMode am, SizeFlagVal sz, IndexMode im,
187 Format f, Domain d, string cstr, InstrItinClass itin>
189 let Namespace = "ARM";
194 bits<2> IndexModeBits = IM.Value;
196 bits<6> Form = F.Value;
198 bit isUnaryDataProc = 0;
199 bit canXformTo16Bit = 0;
201 // The layout of TSFlags should be kept in sync with ARMBaseInstrInfo.h.
202 let TSFlags{4-0} = AM.Value;
203 let TSFlags{7-5} = SZ.Value;
204 let TSFlags{9-8} = IndexModeBits;
205 let TSFlags{15-10} = Form;
206 let TSFlags{16} = isUnaryDataProc;
207 let TSFlags{17} = canXformTo16Bit;
208 let TSFlags{19-18} = D.Value;
210 let Constraints = cstr;
211 let Itinerary = itin;
218 class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
219 Format f, Domain d, string cstr, InstrItinClass itin>
220 : InstTemplate<am, sz, im, f, d, cstr, itin>, Encoding;
222 // This Encoding-less class is used by Thumb1 to specify the encoding bits later
223 // on by adding flavors to specific instructions.
224 class InstThumb<AddrMode am, SizeFlagVal sz, IndexMode im,
225 Format f, Domain d, string cstr, InstrItinClass itin>
226 : InstTemplate<am, sz, im, f, d, cstr, itin>;
228 class PseudoInst<dag oops, dag iops, InstrItinClass itin,
229 string asm, list<dag> pattern>
230 : InstARM<AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, GenericDomain,
232 let OutOperandList = oops;
233 let InOperandList = iops;
235 let Pattern = pattern;
238 // Almost all ARM instructions are predicable.
239 class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
240 IndexMode im, Format f, InstrItinClass itin,
241 string opc, string asm, string cstr,
243 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
246 let OutOperandList = oops;
247 let InOperandList = !con(iops, (ins pred:$p));
248 let AsmString = !strconcat(opc, "${p}", asm);
249 let Pattern = pattern;
250 list<Predicate> Predicates = [IsARM];
253 // A few are not predicable
254 class InoP<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
255 IndexMode im, Format f, InstrItinClass itin,
256 string opc, string asm, string cstr,
258 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
259 let OutOperandList = oops;
260 let InOperandList = iops;
261 let AsmString = !strconcat(opc, asm);
262 let Pattern = pattern;
263 let isPredicable = 0;
264 list<Predicate> Predicates = [IsARM];
267 // Same as I except it can optionally modify CPSR. Note it's modeled as an input
268 // operand since by default it's a zero register. It will become an implicit def
269 // once it's "flipped".
270 class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
271 IndexMode im, Format f, InstrItinClass itin,
272 string opc, string asm, string cstr,
274 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
275 bits<4> p; // Predicate operand
277 // FIXME: The 's' operand needs to be handled, but the current generic
278 // get-value handlers don't know how to deal with it.
280 let OutOperandList = oops;
281 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
282 let AsmString = !strconcat(opc, "${p}${s}", asm);
283 let Pattern = pattern;
284 list<Predicate> Predicates = [IsARM];
288 class XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
289 IndexMode im, Format f, InstrItinClass itin,
290 string asm, string cstr, list<dag> pattern>
291 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
292 let OutOperandList = oops;
293 let InOperandList = iops;
295 let Pattern = pattern;
296 list<Predicate> Predicates = [IsARM];
299 class AI<dag oops, dag iops, Format f, InstrItinClass itin,
300 string opc, string asm, list<dag> pattern>
301 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
302 opc, asm, "", pattern>;
303 class AsI<dag oops, dag iops, Format f, InstrItinClass itin,
304 string opc, string asm, list<dag> pattern>
305 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
306 opc, asm, "", pattern>;
307 class AXI<dag oops, dag iops, Format f, InstrItinClass itin,
308 string asm, list<dag> pattern>
309 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
311 class AInoP<dag oops, dag iops, Format f, InstrItinClass itin,
312 string opc, string asm, list<dag> pattern>
313 : InoP<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
314 opc, asm, "", pattern>;
316 // Ctrl flow instructions
317 class ABI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
318 string opc, string asm, list<dag> pattern>
319 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
320 opc, asm, "", pattern> {
321 let Inst{27-24} = opcod;
323 class ABXI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
324 string asm, list<dag> pattern>
325 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
327 let Inst{27-24} = opcod;
329 class ABXIx2<dag oops, dag iops, InstrItinClass itin,
330 string asm, list<dag> pattern>
331 : XI<oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, Pseudo, itin,
334 // BR_JT instructions
335 class JTI<dag oops, dag iops, InstrItinClass itin,
336 string asm, list<dag> pattern>
337 : XI<oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BrMiscFrm, itin,
340 // Atomic load/store instructions
341 class AIldrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
342 string opc, string asm, list<dag> pattern>
343 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
344 opc, asm, "", pattern> {
345 let Inst{27-23} = 0b00011;
346 let Inst{22-21} = opcod;
348 let Inst{11-0} = 0b111110011111;
350 class AIstrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
351 string opc, string asm, list<dag> pattern>
352 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
353 opc, asm, "", pattern> {
354 let Inst{27-23} = 0b00011;
355 let Inst{22-21} = opcod;
357 let Inst{11-4} = 0b11111001;
360 // addrmode1 instructions
361 class AI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
362 string opc, string asm, list<dag> pattern>
363 : I<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
364 opc, asm, "", pattern> {
365 let Inst{24-21} = opcod;
366 let Inst{27-26} = 0b00;
368 class AsI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
369 string opc, string asm, list<dag> pattern>
370 : sI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
371 opc, asm, "", pattern> {
372 let Inst{24-21} = opcod;
373 let Inst{27-26} = 0b00;
375 class AXI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
376 string asm, list<dag> pattern>
377 : XI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
379 let Inst{24-21} = opcod;
380 let Inst{27-26} = 0b00;
382 class AI1x2<dag oops, dag iops, Format f, InstrItinClass itin,
383 string opc, string asm, list<dag> pattern>
384 : I<oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, itin,
385 opc, asm, "", pattern>;
388 // addrmode2 loads and stores
389 class AI2<dag oops, dag iops, Format f, InstrItinClass itin,
390 string opc, string asm, list<dag> pattern>
391 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
392 opc, asm, "", pattern> {
393 let Inst{27-26} = 0b01;
397 class AI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
398 string opc, string asm, list<dag> pattern>
399 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
400 opc, asm, "", pattern> {
401 let Inst{20} = 1; // L bit
402 let Inst{21} = 0; // W bit
403 let Inst{22} = 0; // B bit
404 let Inst{24} = 1; // P bit
405 let Inst{27-26} = 0b01;
407 class AXI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
408 string asm, list<dag> pattern>
409 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
411 let Inst{20} = 1; // L bit
412 let Inst{21} = 0; // W bit
413 let Inst{22} = 0; // B bit
414 let Inst{24} = 1; // P bit
415 let Inst{27-26} = 0b01;
417 class AI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
418 string opc, string asm, list<dag> pattern>
419 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
420 opc, asm, "", pattern> {
421 let Inst{20} = 1; // L bit
422 let Inst{21} = 0; // W bit
423 let Inst{22} = 1; // B bit
424 let Inst{24} = 1; // P bit
425 let Inst{27-26} = 0b01;
427 class AXI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
428 string asm, list<dag> pattern>
429 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
431 let Inst{20} = 1; // L bit
432 let Inst{21} = 0; // W bit
433 let Inst{22} = 1; // B bit
434 let Inst{24} = 1; // P bit
435 let Inst{27-26} = 0b01;
439 class AI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
440 string opc, string asm, list<dag> pattern>
441 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
442 opc, asm, "", pattern> {
443 let Inst{20} = 0; // L bit
444 let Inst{21} = 0; // W bit
445 let Inst{22} = 0; // B bit
446 let Inst{24} = 1; // P bit
447 let Inst{27-26} = 0b01;
449 class AXI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
450 string asm, list<dag> pattern>
451 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
453 let Inst{20} = 0; // L bit
454 let Inst{21} = 0; // W bit
455 let Inst{22} = 0; // B bit
456 let Inst{24} = 1; // P bit
457 let Inst{27-26} = 0b01;
459 class AI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
460 string opc, string asm, list<dag> pattern>
461 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
462 opc, asm, "", pattern> {
463 let Inst{20} = 0; // L bit
464 let Inst{21} = 0; // W bit
465 let Inst{22} = 1; // B bit
466 let Inst{24} = 1; // P bit
467 let Inst{27-26} = 0b01;
469 class AXI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
470 string asm, list<dag> pattern>
471 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
473 let Inst{20} = 0; // L bit
474 let Inst{21} = 0; // W bit
475 let Inst{22} = 1; // B bit
476 let Inst{24} = 1; // P bit
477 let Inst{27-26} = 0b01;
481 class AI2ldwpr<dag oops, dag iops, Format f, InstrItinClass itin,
482 string opc, string asm, string cstr, list<dag> pattern>
483 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
484 opc, asm, cstr, pattern> {
485 let Inst{20} = 1; // L bit
486 let Inst{21} = 1; // W bit
487 let Inst{22} = 0; // B bit
488 let Inst{24} = 1; // P bit
489 let Inst{27-26} = 0b01;
491 class AI2ldbpr<dag oops, dag iops, Format f, InstrItinClass itin,
492 string opc, string asm, string cstr, list<dag> pattern>
493 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
494 opc, asm, cstr, pattern> {
495 let Inst{20} = 1; // L bit
496 let Inst{21} = 1; // W bit
497 let Inst{22} = 1; // B bit
498 let Inst{24} = 1; // P bit
499 let Inst{27-26} = 0b01;
502 // Pre-indexed stores
503 class AI2stwpr<dag oops, dag iops, Format f, InstrItinClass itin,
504 string opc, string asm, string cstr, list<dag> pattern>
505 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
506 opc, asm, cstr, pattern> {
507 let Inst{20} = 0; // L bit
508 let Inst{21} = 1; // W bit
509 let Inst{22} = 0; // B bit
510 let Inst{24} = 1; // P bit
511 let Inst{27-26} = 0b01;
513 class AI2stbpr<dag oops, dag iops, Format f, InstrItinClass itin,
514 string opc, string asm, string cstr, list<dag> pattern>
515 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
516 opc, asm, cstr, pattern> {
517 let Inst{20} = 0; // L bit
518 let Inst{21} = 1; // W bit
519 let Inst{22} = 1; // B bit
520 let Inst{24} = 1; // P bit
521 let Inst{27-26} = 0b01;
524 // Post-indexed loads
525 class AI2ldwpo<dag oops, dag iops, Format f, InstrItinClass itin,
526 string opc, string asm, string cstr, list<dag> pattern>
527 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
528 opc, asm, cstr,pattern> {
529 let Inst{20} = 1; // L bit
530 let Inst{21} = 0; // W bit
531 let Inst{22} = 0; // B bit
532 let Inst{24} = 0; // P bit
533 let Inst{27-26} = 0b01;
535 class AI2ldbpo<dag oops, dag iops, Format f, InstrItinClass itin,
536 string opc, string asm, string cstr, list<dag> pattern>
537 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
538 opc, asm, cstr,pattern> {
539 let Inst{20} = 1; // L bit
540 let Inst{21} = 0; // W bit
541 let Inst{22} = 1; // B bit
542 let Inst{24} = 0; // P bit
543 let Inst{27-26} = 0b01;
546 // Post-indexed stores
547 class AI2stwpo<dag oops, dag iops, Format f, InstrItinClass itin,
548 string opc, string asm, string cstr, list<dag> pattern>
549 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
550 opc, asm, cstr,pattern> {
551 let Inst{20} = 0; // L bit
552 let Inst{21} = 0; // W bit
553 let Inst{22} = 0; // B bit
554 let Inst{24} = 0; // P bit
555 let Inst{27-26} = 0b01;
557 class AI2stbpo<dag oops, dag iops, Format f, InstrItinClass itin,
558 string opc, string asm, string cstr, list<dag> pattern>
559 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
560 opc, asm, cstr,pattern> {
561 let Inst{20} = 0; // L bit
562 let Inst{21} = 0; // W bit
563 let Inst{22} = 1; // B bit
564 let Inst{24} = 0; // P bit
565 let Inst{27-26} = 0b01;
568 // addrmode3 instructions
569 class AI3<dag oops, dag iops, Format f, InstrItinClass itin,
570 string opc, string asm, list<dag> pattern>
571 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
572 opc, asm, "", pattern>;
573 class AXI3<dag oops, dag iops, Format f, InstrItinClass itin,
574 string asm, list<dag> pattern>
575 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
579 class AI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
580 string opc, string asm, list<dag> pattern>
581 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
582 opc, asm, "", pattern> {
584 let Inst{5} = 1; // H bit
585 let Inst{6} = 0; // S bit
587 let Inst{20} = 1; // L bit
588 let Inst{21} = 0; // W bit
589 let Inst{24} = 1; // P bit
590 let Inst{27-25} = 0b000;
592 class AXI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
593 string asm, list<dag> pattern>
594 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
597 let Inst{5} = 1; // H bit
598 let Inst{6} = 0; // S bit
600 let Inst{20} = 1; // L bit
601 let Inst{21} = 0; // W bit
602 let Inst{24} = 1; // P bit
604 class AI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
605 string opc, string asm, list<dag> pattern>
606 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
607 opc, asm, "", pattern> {
609 let Inst{5} = 1; // H bit
610 let Inst{6} = 1; // S bit
612 let Inst{20} = 1; // L bit
613 let Inst{21} = 0; // W bit
614 let Inst{24} = 1; // P bit
615 let Inst{27-25} = 0b000;
617 class AXI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
618 string asm, list<dag> pattern>
619 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
622 let Inst{5} = 1; // H bit
623 let Inst{6} = 1; // S bit
625 let Inst{20} = 1; // L bit
626 let Inst{21} = 0; // W bit
627 let Inst{24} = 1; // P bit
629 class AI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
630 string opc, string asm, list<dag> pattern>
631 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
632 opc, asm, "", pattern> {
634 let Inst{5} = 0; // H bit
635 let Inst{6} = 1; // S bit
637 let Inst{20} = 1; // L bit
638 let Inst{21} = 0; // W bit
639 let Inst{24} = 1; // P bit
640 let Inst{27-25} = 0b000;
642 class AXI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
643 string asm, list<dag> pattern>
644 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
647 let Inst{5} = 0; // H bit
648 let Inst{6} = 1; // S bit
650 let Inst{20} = 1; // L bit
651 let Inst{21} = 0; // W bit
652 let Inst{24} = 1; // P bit
654 class AI3ldd<dag oops, dag iops, Format f, InstrItinClass itin,
655 string opc, string asm, list<dag> pattern>
656 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
657 opc, asm, "", pattern> {
659 let Inst{5} = 0; // H bit
660 let Inst{6} = 1; // S bit
662 let Inst{20} = 0; // L bit
663 let Inst{21} = 0; // W bit
664 let Inst{24} = 1; // P bit
665 let Inst{27-25} = 0b000;
669 class AI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
670 string opc, string asm, list<dag> pattern>
671 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
672 opc, asm, "", pattern> {
674 let Inst{5} = 1; // H bit
675 let Inst{6} = 0; // S bit
677 let Inst{20} = 0; // L bit
678 let Inst{21} = 0; // W bit
679 let Inst{24} = 1; // P bit
680 let Inst{27-25} = 0b000;
682 class AXI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
683 string asm, list<dag> pattern>
684 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
687 let Inst{5} = 1; // H bit
688 let Inst{6} = 0; // S bit
690 let Inst{20} = 0; // L bit
691 let Inst{21} = 0; // W bit
692 let Inst{24} = 1; // P bit
694 class AI3std<dag oops, dag iops, Format f, InstrItinClass itin,
695 string opc, string asm, list<dag> pattern>
696 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
697 opc, asm, "", pattern> {
699 let Inst{5} = 1; // H bit
700 let Inst{6} = 1; // S bit
702 let Inst{20} = 0; // L bit
703 let Inst{21} = 0; // W bit
704 let Inst{24} = 1; // P bit
705 let Inst{27-25} = 0b000;
709 class AI3ldhpr<dag oops, dag iops, Format f, InstrItinClass itin,
710 string opc, string asm, string cstr, list<dag> pattern>
711 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
712 opc, asm, cstr, pattern> {
714 let Inst{5} = 1; // H bit
715 let Inst{6} = 0; // S bit
717 let Inst{20} = 1; // L bit
718 let Inst{21} = 1; // W bit
719 let Inst{24} = 1; // P bit
720 let Inst{27-25} = 0b000;
722 class AI3ldshpr<dag oops, dag iops, Format f, InstrItinClass itin,
723 string opc, string asm, string cstr, list<dag> pattern>
724 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
725 opc, asm, cstr, pattern> {
727 let Inst{5} = 1; // H bit
728 let Inst{6} = 1; // S bit
730 let Inst{20} = 1; // L bit
731 let Inst{21} = 1; // W bit
732 let Inst{24} = 1; // P bit
733 let Inst{27-25} = 0b000;
735 class AI3ldsbpr<dag oops, dag iops, Format f, InstrItinClass itin,
736 string opc, string asm, string cstr, list<dag> pattern>
737 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
738 opc, asm, cstr, pattern> {
740 let Inst{5} = 0; // H bit
741 let Inst{6} = 1; // S bit
743 let Inst{20} = 1; // L bit
744 let Inst{21} = 1; // W bit
745 let Inst{24} = 1; // P bit
746 let Inst{27-25} = 0b000;
748 class AI3lddpr<dag oops, dag iops, Format f, InstrItinClass itin,
749 string opc, string asm, string cstr, list<dag> pattern>
750 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
751 opc, asm, cstr, pattern> {
753 let Inst{5} = 0; // H bit
754 let Inst{6} = 1; // S bit
756 let Inst{20} = 0; // L bit
757 let Inst{21} = 1; // W bit
758 let Inst{24} = 1; // P bit
759 let Inst{27-25} = 0b000;
763 // Pre-indexed stores
764 class AI3sthpr<dag oops, dag iops, Format f, InstrItinClass itin,
765 string opc, string asm, string cstr, list<dag> pattern>
766 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
767 opc, asm, cstr, pattern> {
769 let Inst{5} = 1; // H bit
770 let Inst{6} = 0; // S bit
772 let Inst{20} = 0; // L bit
773 let Inst{21} = 1; // W bit
774 let Inst{24} = 1; // P bit
775 let Inst{27-25} = 0b000;
777 class AI3stdpr<dag oops, dag iops, Format f, InstrItinClass itin,
778 string opc, string asm, string cstr, list<dag> pattern>
779 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
780 opc, asm, cstr, pattern> {
782 let Inst{5} = 1; // H bit
783 let Inst{6} = 1; // S bit
785 let Inst{20} = 0; // L bit
786 let Inst{21} = 1; // W bit
787 let Inst{24} = 1; // P bit
788 let Inst{27-25} = 0b000;
791 // Post-indexed loads
792 class AI3ldhpo<dag oops, dag iops, Format f, InstrItinClass itin,
793 string opc, string asm, string cstr, list<dag> pattern>
794 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
795 opc, asm, cstr,pattern> {
797 let Inst{5} = 1; // H bit
798 let Inst{6} = 0; // S bit
800 let Inst{20} = 1; // L bit
801 let Inst{21} = 0; // W bit
802 let Inst{24} = 0; // P bit
803 let Inst{27-25} = 0b000;
805 class AI3ldshpo<dag oops, dag iops, Format f, InstrItinClass itin,
806 string opc, string asm, string cstr, list<dag> pattern>
807 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
808 opc, asm, cstr,pattern> {
810 let Inst{5} = 1; // H bit
811 let Inst{6} = 1; // S bit
813 let Inst{20} = 1; // L bit
814 let Inst{21} = 0; // W bit
815 let Inst{24} = 0; // P bit
816 let Inst{27-25} = 0b000;
818 class AI3ldsbpo<dag oops, dag iops, Format f, InstrItinClass itin,
819 string opc, string asm, string cstr, list<dag> pattern>
820 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
821 opc, asm, cstr,pattern> {
823 let Inst{5} = 0; // H bit
824 let Inst{6} = 1; // S bit
826 let Inst{20} = 1; // L bit
827 let Inst{21} = 0; // W bit
828 let Inst{24} = 0; // P bit
829 let Inst{27-25} = 0b000;
831 class AI3lddpo<dag oops, dag iops, Format f, InstrItinClass itin,
832 string opc, string asm, string cstr, list<dag> pattern>
833 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
834 opc, asm, cstr, pattern> {
836 let Inst{5} = 0; // H bit
837 let Inst{6} = 1; // S bit
839 let Inst{20} = 0; // L bit
840 let Inst{21} = 0; // W bit
841 let Inst{24} = 0; // P bit
842 let Inst{27-25} = 0b000;
845 // Post-indexed stores
846 class AI3sthpo<dag oops, dag iops, Format f, InstrItinClass itin,
847 string opc, string asm, string cstr, list<dag> pattern>
848 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
849 opc, asm, cstr,pattern> {
851 let Inst{5} = 1; // H bit
852 let Inst{6} = 0; // S bit
854 let Inst{20} = 0; // L bit
855 let Inst{21} = 0; // W bit
856 let Inst{24} = 0; // P bit
857 let Inst{27-25} = 0b000;
859 class AI3stdpo<dag oops, dag iops, Format f, InstrItinClass itin,
860 string opc, string asm, string cstr, list<dag> pattern>
861 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
862 opc, asm, cstr, pattern> {
864 let Inst{5} = 1; // H bit
865 let Inst{6} = 1; // S bit
867 let Inst{20} = 0; // L bit
868 let Inst{21} = 0; // W bit
869 let Inst{24} = 0; // P bit
870 let Inst{27-25} = 0b000;
873 // addrmode4 instructions
874 class AXI4ld<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
875 string asm, string cstr, list<dag> pattern>
876 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
877 asm, cstr, pattern> {
878 let Inst{20} = 1; // L bit
879 let Inst{22} = 0; // S bit
880 let Inst{27-25} = 0b100;
882 class AXI4st<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
883 string asm, string cstr, list<dag> pattern>
884 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
885 asm, cstr, pattern> {
886 let Inst{20} = 0; // L bit
887 let Inst{22} = 0; // S bit
888 let Inst{27-25} = 0b100;
891 // Unsigned multiply, multiply-accumulate instructions.
892 class AMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
893 string opc, string asm, list<dag> pattern>
894 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
895 opc, asm, "", pattern> {
896 let Inst{7-4} = 0b1001;
897 let Inst{20} = 0; // S bit
898 let Inst{27-21} = opcod;
900 class AsMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
901 string opc, string asm, list<dag> pattern>
902 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
903 opc, asm, "", pattern> {
904 let Inst{7-4} = 0b1001;
905 let Inst{27-21} = opcod;
908 // Most significant word multiply
909 class AMul2I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
910 string opc, string asm, list<dag> pattern>
911 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
912 opc, asm, "", pattern> {
913 let Inst{7-4} = 0b1001;
915 let Inst{27-21} = opcod;
918 // SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
919 class AMulxyI<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
920 string opc, string asm, list<dag> pattern>
921 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
922 opc, asm, "", pattern> {
926 let Inst{27-21} = opcod;
929 // Extend instructions.
930 class AExtI<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
931 string opc, string asm, list<dag> pattern>
932 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ExtFrm, itin,
933 opc, asm, "", pattern> {
934 let Inst{7-4} = 0b0111;
935 let Inst{27-20} = opcod;
938 // Misc Arithmetic instructions.
939 class AMiscA1I<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
940 string opc, string asm, list<dag> pattern>
941 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ArithMiscFrm, itin,
942 opc, asm, "", pattern> {
943 let Inst{27-20} = opcod;
946 //===----------------------------------------------------------------------===//
948 // ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
949 class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
950 list<Predicate> Predicates = [IsARM];
952 class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
953 list<Predicate> Predicates = [IsARM, HasV5TE];
955 class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
956 list<Predicate> Predicates = [IsARM, HasV6];
959 //===----------------------------------------------------------------------===//
961 // Thumb Instruction Format Definitions.
964 // TI - Thumb instruction.
966 class ThumbI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
967 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
968 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
969 let OutOperandList = oops;
970 let InOperandList = iops;
972 let Pattern = pattern;
973 list<Predicate> Predicates = [IsThumb];
976 class TI<dag oops, dag iops, InstrItinClass itin, string asm, list<dag> pattern>
977 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
979 // Two-address instructions
980 class TIt<dag oops, dag iops, InstrItinClass itin, string asm,
982 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "$lhs = $dst",
985 // tBL, tBX 32-bit instructions
986 class TIx2<bits<5> opcod1, bits<2> opcod2, bit opcod3,
987 dag oops, dag iops, InstrItinClass itin, string asm,
989 : ThumbI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>,
991 let Inst{31-27} = opcod1;
992 let Inst{15-14} = opcod2;
993 let Inst{12} = opcod3;
996 // BR_JT instructions
997 class TJTI<dag oops, dag iops, InstrItinClass itin, string asm,
999 : ThumbI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
1002 class Thumb1I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
1003 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
1004 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1005 let OutOperandList = oops;
1006 let InOperandList = iops;
1007 let AsmString = asm;
1008 let Pattern = pattern;
1009 list<Predicate> Predicates = [IsThumb1Only];
1012 class T1I<dag oops, dag iops, InstrItinClass itin,
1013 string asm, list<dag> pattern>
1014 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
1015 class T1Ix2<dag oops, dag iops, InstrItinClass itin,
1016 string asm, list<dag> pattern>
1017 : Thumb1I<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1018 class T1JTI<dag oops, dag iops, InstrItinClass itin,
1019 string asm, list<dag> pattern>
1020 : Thumb1I<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
1022 // Two-address instructions
1023 class T1It<dag oops, dag iops, InstrItinClass itin,
1024 string asm, string cstr, list<dag> pattern>
1025 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin,
1026 asm, cstr, pattern>;
1028 // Thumb1 instruction that can either be predicated or set CPSR.
1029 class Thumb1sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
1030 InstrItinClass itin,
1031 string opc, string asm, string cstr, list<dag> pattern>
1032 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1033 let OutOperandList = !con(oops, (outs s_cc_out:$s));
1034 let InOperandList = !con(iops, (ins pred:$p));
1035 let AsmString = !strconcat(opc, "${s}${p}", asm);
1036 let Pattern = pattern;
1037 list<Predicate> Predicates = [IsThumb1Only];
1040 class T1sI<dag oops, dag iops, InstrItinClass itin,
1041 string opc, string asm, list<dag> pattern>
1042 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
1044 // Two-address instructions
1045 class T1sIt<dag oops, dag iops, InstrItinClass itin,
1046 string opc, string asm, list<dag> pattern>
1047 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
1048 "$lhs = $dst", pattern>;
1050 // Thumb1 instruction that can be predicated.
1051 class Thumb1pI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
1052 InstrItinClass itin,
1053 string opc, string asm, string cstr, list<dag> pattern>
1054 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1055 let OutOperandList = oops;
1056 let InOperandList = !con(iops, (ins pred:$p));
1057 let AsmString = !strconcat(opc, "${p}", asm);
1058 let Pattern = pattern;
1059 list<Predicate> Predicates = [IsThumb1Only];
1062 class T1pI<dag oops, dag iops, InstrItinClass itin,
1063 string opc, string asm, list<dag> pattern>
1064 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
1066 // Two-address instructions
1067 class T1pIt<dag oops, dag iops, InstrItinClass itin,
1068 string opc, string asm, list<dag> pattern>
1069 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
1070 "$lhs = $dst", pattern>;
1072 class T1pI1<dag oops, dag iops, InstrItinClass itin,
1073 string opc, string asm, list<dag> pattern>
1074 : Thumb1pI<oops, iops, AddrModeT1_1, Size2Bytes, itin, opc, asm, "", pattern>;
1075 class T1pI2<dag oops, dag iops, InstrItinClass itin,
1076 string opc, string asm, list<dag> pattern>
1077 : Thumb1pI<oops, iops, AddrModeT1_2, Size2Bytes, itin, opc, asm, "", pattern>;
1078 class T1pI4<dag oops, dag iops, InstrItinClass itin,
1079 string opc, string asm, list<dag> pattern>
1080 : Thumb1pI<oops, iops, AddrModeT1_4, Size2Bytes, itin, opc, asm, "", pattern>;
1081 class T1pIs<dag oops, dag iops,
1082 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1083 : Thumb1pI<oops, iops, AddrModeT1_s, Size2Bytes, itin, opc, asm, "", pattern>;
1085 class Encoding16 : Encoding {
1086 let Inst{31-16} = 0x0000;
1089 // A6.2 16-bit Thumb instruction encoding
1090 class T1Encoding<bits<6> opcode> : Encoding16 {
1091 let Inst{15-10} = opcode;
1094 // A6.2.1 Shift (immediate), add, subtract, move, and compare encoding.
1095 class T1General<bits<5> opcode> : Encoding16 {
1096 let Inst{15-14} = 0b00;
1097 let Inst{13-9} = opcode;
1100 // A6.2.2 Data-processing encoding.
1101 class T1DataProcessing<bits<4> opcode> : Encoding16 {
1102 let Inst{15-10} = 0b010000;
1103 let Inst{9-6} = opcode;
1106 // A6.2.3 Special data instructions and branch and exchange encoding.
1107 class T1Special<bits<4> opcode> : Encoding16 {
1108 let Inst{15-10} = 0b010001;
1109 let Inst{9-6} = opcode;
1112 // A6.2.4 Load/store single data item encoding.
1113 class T1LoadStore<bits<4> opA, bits<3> opB> : Encoding16 {
1114 let Inst{15-12} = opA;
1115 let Inst{11-9} = opB;
1117 class T1LdSt<bits<3> opB> : T1LoadStore<0b0101, opB>;
1118 class T1LdSt4Imm<bits<3> opB> : T1LoadStore<0b0110, opB>; // Immediate, 4 bytes
1119 class T1LdSt1Imm<bits<3> opB> : T1LoadStore<0b0111, opB>; // Immediate, 1 byte
1120 class T1LdSt2Imm<bits<3> opB> : T1LoadStore<0b1000, opB>; // Immediate, 2 bytes
1121 class T1LdStSP<bits<3> opB> : T1LoadStore<0b1001, opB>; // SP relative
1123 // A6.2.5 Miscellaneous 16-bit instructions encoding.
1124 class T1Misc<bits<7> opcode> : Encoding16 {
1125 let Inst{15-12} = 0b1011;
1126 let Inst{11-5} = opcode;
1129 // Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
1130 class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
1131 InstrItinClass itin,
1132 string opc, string asm, string cstr, list<dag> pattern>
1133 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1134 let OutOperandList = oops;
1135 let InOperandList = !con(iops, (ins pred:$p));
1136 let AsmString = !strconcat(opc, "${p}", asm);
1137 let Pattern = pattern;
1138 list<Predicate> Predicates = [IsThumb2];
1141 // Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as an
1142 // input operand since by default it's a zero register. It will become an
1143 // implicit def once it's "flipped".
1145 // FIXME: This uses unified syntax so {s} comes before {p}. We should make it
1147 class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
1148 InstrItinClass itin,
1149 string opc, string asm, string cstr, list<dag> pattern>
1150 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1151 let OutOperandList = oops;
1152 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
1153 let AsmString = !strconcat(opc, "${s}${p}", asm);
1154 let Pattern = pattern;
1155 list<Predicate> Predicates = [IsThumb2];
1159 class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
1160 InstrItinClass itin,
1161 string asm, string cstr, list<dag> pattern>
1162 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1163 let OutOperandList = oops;
1164 let InOperandList = iops;
1165 let AsmString = asm;
1166 let Pattern = pattern;
1167 list<Predicate> Predicates = [IsThumb2];
1170 class ThumbXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
1171 InstrItinClass itin,
1172 string asm, string cstr, list<dag> pattern>
1173 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1174 let OutOperandList = oops;
1175 let InOperandList = iops;
1176 let AsmString = asm;
1177 let Pattern = pattern;
1178 list<Predicate> Predicates = [IsThumb1Only];
1181 class T2I<dag oops, dag iops, InstrItinClass itin,
1182 string opc, string asm, list<dag> pattern>
1183 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
1184 class T2Ii12<dag oops, dag iops, InstrItinClass itin,
1185 string opc, string asm, list<dag> pattern>
1186 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, itin, opc, asm, "",pattern>;
1187 class T2Ii8<dag oops, dag iops, InstrItinClass itin,
1188 string opc, string asm, list<dag> pattern>
1189 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, itin, opc, asm, "", pattern>;
1190 class T2Iso<dag oops, dag iops, InstrItinClass itin,
1191 string opc, string asm, list<dag> pattern>
1192 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, itin, opc, asm, "", pattern>;
1193 class T2Ipc<dag oops, dag iops, InstrItinClass itin,
1194 string opc, string asm, list<dag> pattern>
1195 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, itin, opc, asm, "", pattern>;
1196 class T2Ii8s4<bit P, bit W, bit load, dag oops, dag iops, InstrItinClass itin,
1197 string opc, string asm, list<dag> pattern>
1198 : Thumb2I<oops, iops, AddrModeT2_i8s4, Size4Bytes, itin, opc, asm, "",
1200 let Inst{31-27} = 0b11101;
1201 let Inst{26-25} = 0b00;
1203 let Inst{23} = ?; // The U bit.
1206 let Inst{20} = load;
1209 class T2sI<dag oops, dag iops, InstrItinClass itin,
1210 string opc, string asm, list<dag> pattern>
1211 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
1213 class T2XI<dag oops, dag iops, InstrItinClass itin,
1214 string asm, list<dag> pattern>
1215 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1216 class T2JTI<dag oops, dag iops, InstrItinClass itin,
1217 string asm, list<dag> pattern>
1218 : Thumb2XI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
1220 class T2Ix2<dag oops, dag iops, InstrItinClass itin,
1221 string opc, string asm, list<dag> pattern>
1222 : Thumb2I<oops, iops, AddrModeNone, Size8Bytes, itin, opc, asm, "", pattern>;
1224 // Two-address instructions
1225 class T2XIt<dag oops, dag iops, InstrItinClass itin,
1226 string asm, string cstr, list<dag> pattern>
1227 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, cstr, pattern>;
1229 // T2Iidxldst - Thumb2 indexed load / store instructions.
1230 class T2Iidxldst<bit signed, bits<2> opcod, bit load, bit pre,
1232 AddrMode am, IndexMode im, InstrItinClass itin,
1233 string opc, string asm, string cstr, list<dag> pattern>
1234 : InstARM<am, Size4Bytes, im, ThumbFrm, GenericDomain, cstr, itin> {
1235 let OutOperandList = oops;
1236 let InOperandList = !con(iops, (ins pred:$p));
1237 let AsmString = !strconcat(opc, "${p}", asm);
1238 let Pattern = pattern;
1239 list<Predicate> Predicates = [IsThumb2];
1240 let Inst{31-27} = 0b11111;
1241 let Inst{26-25} = 0b00;
1242 let Inst{24} = signed;
1244 let Inst{22-21} = opcod;
1245 let Inst{20} = load;
1247 // (P, W) = (1, 1) Pre-indexed or (0, 1) Post-indexed
1248 let Inst{10} = pre; // The P bit.
1249 let Inst{8} = 1; // The W bit.
1252 // Helper class for disassembly only
1253 // A6.3.16 & A6.3.17
1254 // T2Imac - Thumb2 multiply [accumulate, and absolute difference] instructions.
1255 class T2I_mac<bit long, bits<3> op22_20, bits<4> op7_4, dag oops, dag iops,
1256 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1257 : T2I<oops, iops, itin, opc, asm, pattern> {
1258 let Inst{31-27} = 0b11111;
1259 let Inst{26-24} = 0b011;
1260 let Inst{23} = long;
1261 let Inst{22-20} = op22_20;
1262 let Inst{7-4} = op7_4;
1265 // Tv5Pat - Same as Pat<>, but requires V5T Thumb mode.
1266 class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
1267 list<Predicate> Predicates = [IsThumb1Only, HasV5T];
1270 // T1Pat - Same as Pat<>, but requires that the compiler be in Thumb1 mode.
1271 class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
1272 list<Predicate> Predicates = [IsThumb1Only];
1275 // T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
1276 class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
1277 list<Predicate> Predicates = [IsThumb2];
1280 //===----------------------------------------------------------------------===//
1282 //===----------------------------------------------------------------------===//
1283 // ARM VFP Instruction templates.
1286 // Almost all VFP instructions are predicable.
1287 class VFPI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
1288 IndexMode im, Format f, InstrItinClass itin,
1289 string opc, string asm, string cstr, list<dag> pattern>
1290 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
1292 let Inst{31-28} = p;
1293 let OutOperandList = oops;
1294 let InOperandList = !con(iops, (ins pred:$p));
1295 let AsmString = !strconcat(opc, "${p}", asm);
1296 let Pattern = pattern;
1297 list<Predicate> Predicates = [HasVFP2];
1301 class VFPXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
1302 IndexMode im, Format f, InstrItinClass itin,
1303 string asm, string cstr, list<dag> pattern>
1304 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
1305 let OutOperandList = oops;
1306 let InOperandList = iops;
1307 let AsmString = asm;
1308 let Pattern = pattern;
1309 list<Predicate> Predicates = [HasVFP2];
1312 class VFPAI<dag oops, dag iops, Format f, InstrItinClass itin,
1313 string opc, string asm, list<dag> pattern>
1314 : VFPI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
1315 opc, asm, "", pattern>;
1317 // ARM VFP addrmode5 loads and stores
1318 class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
1319 InstrItinClass itin,
1320 string opc, string asm, list<dag> pattern>
1321 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
1322 VFPLdStFrm, itin, opc, asm, "", pattern> {
1323 // TODO: Mark the instructions with the appropriate subtarget info.
1324 let Inst{27-24} = opcod1;
1325 let Inst{21-20} = opcod2;
1326 let Inst{11-9} = 0b101;
1327 let Inst{8} = 1; // Double precision
1329 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1330 let D = VFPNeonDomain;
1333 class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
1334 InstrItinClass itin,
1335 string opc, string asm, list<dag> pattern>
1336 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
1337 VFPLdStFrm, itin, opc, asm, "", pattern> {
1338 // TODO: Mark the instructions with the appropriate subtarget info.
1339 let Inst{27-24} = opcod1;
1340 let Inst{21-20} = opcod2;
1341 let Inst{11-9} = 0b101;
1342 let Inst{8} = 0; // Single precision
1345 // VFP Load / store multiple pseudo instructions.
1346 class PseudoVFPLdStM<dag oops, dag iops, InstrItinClass itin, string cstr,
1348 : InstARM<AddrMode4, Size4Bytes, IndexModeNone, Pseudo, VFPNeonDomain,
1350 let OutOperandList = oops;
1351 let InOperandList = !con(iops, (ins pred:$p));
1352 let Pattern = pattern;
1353 list<Predicate> Predicates = [HasVFP2];
1356 // Load / store multiple
1357 class AXDI4<dag oops, dag iops, IndexMode im, InstrItinClass itin,
1358 string asm, string cstr, list<dag> pattern>
1359 : VFPXI<oops, iops, AddrMode4, Size4Bytes, im,
1360 VFPLdStMulFrm, itin, asm, cstr, pattern> {
1361 // TODO: Mark the instructions with the appropriate subtarget info.
1362 let Inst{27-25} = 0b110;
1363 let Inst{11-9} = 0b101;
1364 let Inst{8} = 1; // Double precision
1366 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1367 let D = VFPNeonDomain;
1370 class AXSI4<dag oops, dag iops, IndexMode im, InstrItinClass itin,
1371 string asm, string cstr, list<dag> pattern>
1372 : VFPXI<oops, iops, AddrMode4, Size4Bytes, im,
1373 VFPLdStMulFrm, itin, asm, cstr, pattern> {
1374 // TODO: Mark the instructions with the appropriate subtarget info.
1375 let Inst{27-25} = 0b110;
1376 let Inst{11-9} = 0b101;
1377 let Inst{8} = 0; // Single precision
1380 // Double precision, unary
1381 class ADuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1382 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1383 string asm, list<dag> pattern>
1384 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
1385 let Inst{27-23} = opcod1;
1386 let Inst{21-20} = opcod2;
1387 let Inst{19-16} = opcod3;
1388 let Inst{11-9} = 0b101;
1389 let Inst{8} = 1; // Double precision
1390 let Inst{7-6} = opcod4;
1391 let Inst{4} = opcod5;
1394 // Double precision, binary
1395 class ADbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
1396 dag iops, InstrItinClass itin, string opc, string asm,
1398 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
1399 let Inst{27-23} = opcod1;
1400 let Inst{21-20} = opcod2;
1401 let Inst{11-9} = 0b101;
1402 let Inst{8} = 1; // Double precision
1407 // Double precision, binary, VML[AS] (for additional predicate)
1408 class ADbI_vmlX<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
1409 dag iops, InstrItinClass itin, string opc, string asm,
1411 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
1412 let Inst{27-23} = opcod1;
1413 let Inst{21-20} = opcod2;
1414 let Inst{11-9} = 0b101;
1415 let Inst{8} = 1; // Double precision
1418 list<Predicate> Predicates = [HasVFP2, UseVMLx];
1421 // Single precision, unary
1422 class ASuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1423 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1424 string asm, list<dag> pattern>
1425 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
1426 let Inst{27-23} = opcod1;
1427 let Inst{21-20} = opcod2;
1428 let Inst{19-16} = opcod3;
1429 let Inst{11-9} = 0b101;
1430 let Inst{8} = 0; // Single precision
1431 let Inst{7-6} = opcod4;
1432 let Inst{4} = opcod5;
1435 // Single precision unary, if no NEON
1436 // Same as ASuI except not available if NEON is enabled
1437 class ASuIn<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1438 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1439 string asm, list<dag> pattern>
1440 : ASuI<opcod1, opcod2, opcod3, opcod4, opcod5, oops, iops, itin, opc, asm,
1442 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1445 // Single precision, binary
1446 class ASbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops, dag iops,
1447 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1448 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
1449 let Inst{27-23} = opcod1;
1450 let Inst{21-20} = opcod2;
1451 let Inst{11-9} = 0b101;
1452 let Inst{8} = 0; // Single precision
1457 // Single precision binary, if no NEON
1458 // Same as ASbI except not available if NEON is enabled
1459 class ASbIn<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
1460 dag iops, InstrItinClass itin, string opc, string asm,
1462 : ASbI<opcod1, opcod2, op6, op4, oops, iops, itin, opc, asm, pattern> {
1463 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1466 // VFP conversion instructions
1467 class AVConv1I<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
1468 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1470 : VFPAI<oops, iops, VFPConv1Frm, itin, opc, asm, pattern> {
1471 let Inst{27-23} = opcod1;
1472 let Inst{21-20} = opcod2;
1473 let Inst{19-16} = opcod3;
1474 let Inst{11-8} = opcod4;
1479 // VFP conversion between floating-point and fixed-point
1480 class AVConv1XI<bits<5> op1, bits<2> op2, bits<4> op3, bits<4> op4, bit op5,
1481 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1483 : AVConv1I<op1, op2, op3, op4, oops, iops, itin, opc, asm, pattern> {
1484 // size (fixed-point number): sx == 0 ? 16 : 32
1485 let Inst{7} = op5; // sx
1488 // VFP conversion instructions, if no NEON
1489 class AVConv1In<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
1490 dag oops, dag iops, InstrItinClass itin,
1491 string opc, string asm, list<dag> pattern>
1492 : AVConv1I<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
1494 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1497 class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
1498 InstrItinClass itin,
1499 string opc, string asm, list<dag> pattern>
1500 : VFPAI<oops, iops, f, itin, opc, asm, pattern> {
1501 let Inst{27-20} = opcod1;
1502 let Inst{11-8} = opcod2;
1506 class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1507 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1508 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, itin, opc, asm, pattern>;
1510 class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1511 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1512 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, itin, opc, asm, pattern>;
1514 class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1515 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1516 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, itin, opc, asm, pattern>;
1518 class AVConv5I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1519 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1520 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv5Frm, itin, opc, asm, pattern>;
1522 //===----------------------------------------------------------------------===//
1524 //===----------------------------------------------------------------------===//
1525 // ARM NEON Instruction templates.
1528 class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1529 InstrItinClass itin, string opc, string dt, string asm, string cstr,
1531 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
1532 let OutOperandList = oops;
1533 let InOperandList = !con(iops, (ins pred:$p));
1534 let AsmString = !strconcat(opc, "${p}", ".", dt, "\t", asm);
1535 let Pattern = pattern;
1536 list<Predicate> Predicates = [HasNEON];
1539 // Same as NeonI except it does not have a "data type" specifier.
1540 class NeonXI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1541 InstrItinClass itin, string opc, string asm, string cstr,
1543 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
1544 let OutOperandList = oops;
1545 let InOperandList = !con(iops, (ins pred:$p));
1546 let AsmString = !strconcat(opc, "${p}", "\t", asm);
1547 let Pattern = pattern;
1548 list<Predicate> Predicates = [HasNEON];
1551 class NLdSt<bit op23, bits<2> op21_20, bits<4> op11_8, bits<4> op7_4,
1552 dag oops, dag iops, InstrItinClass itin,
1553 string opc, string dt, string asm, string cstr, list<dag> pattern>
1554 : NeonI<oops, iops, AddrMode6, IndexModeNone, NLdStFrm, itin, opc, dt, asm,
1556 let Inst{31-24} = 0b11110100;
1557 let Inst{23} = op23;
1558 let Inst{21-20} = op21_20;
1559 let Inst{11-8} = op11_8;
1560 let Inst{7-4} = op7_4;
1563 class PseudoNLdSt<dag oops, dag iops, InstrItinClass itin, string cstr>
1564 : InstARM<AddrMode6, Size4Bytes, IndexModeNone, Pseudo, NeonDomain, cstr,
1566 let OutOperandList = oops;
1567 let InOperandList = !con(iops, (ins pred:$p));
1568 list<Predicate> Predicates = [HasNEON];
1571 class PseudoNeonI<dag oops, dag iops, InstrItinClass itin, string cstr,
1573 : InstARM<AddrModeNone, Size4Bytes, IndexModeNone, Pseudo, NeonDomain, cstr,
1575 let OutOperandList = oops;
1576 let InOperandList = !con(iops, (ins pred:$p));
1577 let Pattern = pattern;
1578 list<Predicate> Predicates = [HasNEON];
1581 class NDataI<dag oops, dag iops, Format f, InstrItinClass itin,
1582 string opc, string dt, string asm, string cstr, list<dag> pattern>
1583 : NeonI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, dt, asm, cstr,
1585 let Inst{31-25} = 0b1111001;
1588 class NDataXI<dag oops, dag iops, Format f, InstrItinClass itin,
1589 string opc, string asm, string cstr, list<dag> pattern>
1590 : NeonXI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, asm,
1592 let Inst{31-25} = 0b1111001;
1595 // NEON "one register and a modified immediate" format.
1596 class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1598 dag oops, dag iops, InstrItinClass itin,
1599 string opc, string dt, string asm, string cstr,
1601 : NDataI<oops, iops, N1RegModImmFrm, itin, opc, dt, asm, cstr, pattern> {
1602 let Inst{23} = op23;
1603 let Inst{21-19} = op21_19;
1604 let Inst{11-8} = op11_8;
1611 // NEON 2 vector register format.
1612 class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1613 bits<5> op11_7, bit op6, bit op4,
1614 dag oops, dag iops, InstrItinClass itin,
1615 string opc, string dt, string asm, string cstr, list<dag> pattern>
1616 : NDataI<oops, iops, N2RegFrm, itin, opc, dt, asm, cstr, pattern> {
1617 let Inst{24-23} = op24_23;
1618 let Inst{21-20} = op21_20;
1619 let Inst{19-18} = op19_18;
1620 let Inst{17-16} = op17_16;
1621 let Inst{11-7} = op11_7;
1626 // Same as N2V except it doesn't have a datatype suffix.
1627 class N2VX<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1628 bits<5> op11_7, bit op6, bit op4,
1629 dag oops, dag iops, InstrItinClass itin,
1630 string opc, string asm, string cstr, list<dag> pattern>
1631 : NDataXI<oops, iops, N2RegFrm, itin, opc, asm, cstr, pattern> {
1632 let Inst{24-23} = op24_23;
1633 let Inst{21-20} = op21_20;
1634 let Inst{19-18} = op19_18;
1635 let Inst{17-16} = op17_16;
1636 let Inst{11-7} = op11_7;
1641 // NEON 2 vector register with immediate.
1642 class N2VImm<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
1643 dag oops, dag iops, Format f, InstrItinClass itin,
1644 string opc, string dt, string asm, string cstr, list<dag> pattern>
1645 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
1646 let Inst{24} = op24;
1647 let Inst{23} = op23;
1648 let Inst{11-8} = op11_8;
1654 // NEON 3 vector register format.
1655 class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
1656 dag oops, dag iops, Format f, InstrItinClass itin,
1657 string opc, string dt, string asm, string cstr, list<dag> pattern>
1658 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
1659 let Inst{24} = op24;
1660 let Inst{23} = op23;
1661 let Inst{21-20} = op21_20;
1662 let Inst{11-8} = op11_8;
1667 // Same as N3V except it doesn't have a data type suffix.
1668 class N3VX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
1670 dag oops, dag iops, Format f, InstrItinClass itin,
1671 string opc, string asm, string cstr, list<dag> pattern>
1672 : NDataXI<oops, iops, f, itin, opc, asm, cstr, pattern> {
1673 let Inst{24} = op24;
1674 let Inst{23} = op23;
1675 let Inst{21-20} = op21_20;
1676 let Inst{11-8} = op11_8;
1681 // NEON VMOVs between scalar and core registers.
1682 class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1683 dag oops, dag iops, Format f, InstrItinClass itin,
1684 string opc, string dt, string asm, list<dag> pattern>
1685 : InstARM<AddrModeNone, Size4Bytes, IndexModeNone, f, GenericDomain,
1687 let Inst{27-20} = opcod1;
1688 let Inst{11-8} = opcod2;
1689 let Inst{6-5} = opcod3;
1692 let OutOperandList = oops;
1693 let InOperandList = !con(iops, (ins pred:$p));
1694 let AsmString = !strconcat(opc, "${p}", ".", dt, "\t", asm);
1695 let Pattern = pattern;
1696 list<Predicate> Predicates = [HasNEON];
1698 class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1699 dag oops, dag iops, InstrItinClass itin,
1700 string opc, string dt, string asm, list<dag> pattern>
1701 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NGetLnFrm, itin,
1702 opc, dt, asm, pattern>;
1703 class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1704 dag oops, dag iops, InstrItinClass itin,
1705 string opc, string dt, string asm, list<dag> pattern>
1706 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NSetLnFrm, itin,
1707 opc, dt, asm, pattern>;
1708 class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1709 dag oops, dag iops, InstrItinClass itin,
1710 string opc, string dt, string asm, list<dag> pattern>
1711 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NDupFrm, itin,
1712 opc, dt, asm, pattern>;
1714 // Vector Duplicate Lane (from scalar to all elements)
1715 class NVDupLane<bits<4> op19_16, bit op6, dag oops, dag iops,
1716 InstrItinClass itin, string opc, string dt, string asm,
1718 : NDataI<oops, iops, NVDupLnFrm, itin, opc, dt, asm, "", pattern> {
1719 let Inst{24-23} = 0b11;
1720 let Inst{21-20} = 0b11;
1721 let Inst{19-16} = op19_16;
1722 let Inst{11-7} = 0b11000;
1727 // NEONFPPat - Same as Pat<>, but requires that the compiler be using NEON
1728 // for single-precision FP.
1729 class NEONFPPat<dag pattern, dag result> : Pat<pattern, result> {
1730 list<Predicate> Predicates = [HasNEON,UseNEONForFP];