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<5> 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 ArithMiscFrm : Format<11>;
37 def ExtFrm : Format<12>;
39 def VFPUnaryFrm : Format<13>;
40 def VFPBinaryFrm : Format<14>;
41 def VFPConv1Frm : Format<15>;
42 def VFPConv2Frm : Format<16>;
43 def VFPConv3Frm : Format<17>;
44 def VFPConv4Frm : Format<18>;
45 def VFPConv5Frm : Format<19>;
46 def VFPLdStFrm : Format<20>;
47 def VFPLdStMulFrm : Format<21>;
48 def VFPMiscFrm : Format<22>;
50 def ThumbFrm : Format<23>;
52 def NEONFrm : Format<24>;
53 def NEONGetLnFrm : Format<25>;
54 def NEONSetLnFrm : Format<26>;
55 def NEONDupFrm : Format<27>;
59 // the instruction has a Rn register operand.
60 // UnaryDP - Indicates this is a unary data processing instruction, i.e.
61 // it doesn't have a Rn operand.
62 class UnaryDP { bit isUnaryDataProc = 1; }
64 // Xform16Bit - Indicates this Thumb2 instruction may be transformed into
65 // a 16-bit Thumb instruction if certain conditions are met.
66 class Xform16Bit { bit canXformTo16Bit = 1; }
68 //===----------------------------------------------------------------------===//
69 // ARM Instruction flags. These need to match ARMInstrInfo.h.
73 class AddrMode<bits<4> val> {
76 def AddrModeNone : AddrMode<0>;
77 def AddrMode1 : AddrMode<1>;
78 def AddrMode2 : AddrMode<2>;
79 def AddrMode3 : AddrMode<3>;
80 def AddrMode4 : AddrMode<4>;
81 def AddrMode5 : AddrMode<5>;
82 def AddrMode6 : AddrMode<6>;
83 def AddrModeT1_1 : AddrMode<7>;
84 def AddrModeT1_2 : AddrMode<8>;
85 def AddrModeT1_4 : AddrMode<9>;
86 def AddrModeT1_s : AddrMode<10>;
87 def AddrModeT2_i12: AddrMode<11>;
88 def AddrModeT2_i8 : AddrMode<12>;
89 def AddrModeT2_so : AddrMode<13>;
90 def AddrModeT2_pc : AddrMode<14>;
91 def AddrModeT2_i8s4 : AddrMode<15>;
94 class SizeFlagVal<bits<3> val> {
97 def SizeInvalid : SizeFlagVal<0>; // Unset.
98 def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
99 def Size8Bytes : SizeFlagVal<2>;
100 def Size4Bytes : SizeFlagVal<3>;
101 def Size2Bytes : SizeFlagVal<4>;
103 // Load / store index mode.
104 class IndexMode<bits<2> val> {
107 def IndexModeNone : IndexMode<0>;
108 def IndexModePre : IndexMode<1>;
109 def IndexModePost : IndexMode<2>;
111 //===----------------------------------------------------------------------===//
113 // ARM special operands.
116 // ARM Predicate operand. Default to 14 = always (AL). Second part is CC
117 // register whose default is 0 (no register).
118 def pred : PredicateOperand<OtherVT, (ops i32imm, CCR),
119 (ops (i32 14), (i32 zero_reg))> {
120 let PrintMethod = "printPredicateOperand";
123 // Conditional code result for instructions whose 's' bit is set, e.g. subs.
124 def cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 zero_reg))> {
125 let PrintMethod = "printSBitModifierOperand";
128 // Same as cc_out except it defaults to setting CPSR.
129 def s_cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 CPSR))> {
130 let PrintMethod = "printSBitModifierOperand";
133 //===----------------------------------------------------------------------===//
135 // ARM Instruction templates.
138 class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
139 Format f, string cstr>
143 let Namespace = "ARM";
147 bits<4> AddrModeBits = AM.Value;
150 bits<3> SizeFlag = SZ.Value;
153 bits<2> IndexModeBits = IM.Value;
156 bits<5> Form = F.Value;
159 // Attributes specific to ARM instructions...
161 bit isUnaryDataProc = 0;
162 bit canXformTo16Bit = 0;
164 let Constraints = cstr;
167 class PseudoInst<dag oops, dag iops, string asm, list<dag> pattern>
168 : InstARM<AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, ""> {
169 let OutOperandList = oops;
170 let InOperandList = iops;
172 let Pattern = pattern;
175 // Almost all ARM instructions are predicable.
176 class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
177 IndexMode im, Format f, string opc, string asm, string cstr,
179 : InstARM<am, sz, im, f, cstr> {
180 let OutOperandList = oops;
181 let InOperandList = !con(iops, (ops pred:$p));
182 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
183 let Pattern = pattern;
184 list<Predicate> Predicates = [IsARM];
187 // Same as I except it can optionally modify CPSR. Note it's modeled as
188 // an input operand since by default it's a zero register. It will
189 // become an implicit def once it's "flipped".
190 class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
191 IndexMode im, Format f, string opc, string asm, string cstr,
193 : InstARM<am, sz, im, f, cstr> {
194 let OutOperandList = oops;
195 let InOperandList = !con(iops, (ops pred:$p, cc_out:$s));
196 let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm));
197 let Pattern = pattern;
198 list<Predicate> Predicates = [IsARM];
202 class XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
203 IndexMode im, Format f, string asm, string cstr, list<dag> pattern>
204 : InstARM<am, sz, im, f, cstr> {
205 let OutOperandList = oops;
206 let InOperandList = iops;
208 let Pattern = pattern;
209 list<Predicate> Predicates = [IsARM];
212 class AI<dag oops, dag iops, Format f, string opc,
213 string asm, list<dag> pattern>
214 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc,
216 class AsI<dag oops, dag iops, Format f, string opc,
217 string asm, list<dag> pattern>
218 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc,
220 class AXI<dag oops, dag iops, Format f, string asm,
222 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, asm,
225 // Ctrl flow instructions
226 class ABI<bits<4> opcod, dag oops, dag iops, string opc,
227 string asm, list<dag> pattern>
228 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, opc,
230 let Inst{27-24} = opcod;
232 class ABXI<bits<4> opcod, dag oops, dag iops, string asm, list<dag> pattern>
233 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, asm,
235 let Inst{27-24} = opcod;
237 class ABXIx2<dag oops, dag iops, string asm, list<dag> pattern>
238 : XI<oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, BrMiscFrm, asm,
241 // BR_JT instructions
242 class JTI<dag oops, dag iops, string asm, list<dag> pattern>
243 : XI<oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BrMiscFrm,
246 // addrmode1 instructions
247 class AI1<bits<4> opcod, dag oops, dag iops, Format f, string opc,
248 string asm, list<dag> pattern>
249 : I<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc,
251 let Inst{24-21} = opcod;
252 let Inst{27-26} = {0,0};
254 class AsI1<bits<4> opcod, dag oops, dag iops, Format f, string opc,
255 string asm, list<dag> pattern>
256 : sI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc,
258 let Inst{24-21} = opcod;
259 let Inst{27-26} = {0,0};
261 class AXI1<bits<4> opcod, dag oops, dag iops, Format f, string asm,
263 : XI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, asm,
265 let Inst{24-21} = opcod;
266 let Inst{27-26} = {0,0};
268 class AI1x2<dag oops, dag iops, Format f, string opc,
269 string asm, list<dag> pattern>
270 : I<oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, opc,
274 // addrmode2 loads and stores
275 class AI2<dag oops, dag iops, Format f, string opc,
276 string asm, list<dag> pattern>
277 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
279 let Inst{27-26} = {0,1};
283 class AI2ldw<dag oops, dag iops, Format f, string opc,
284 string asm, list<dag> pattern>
285 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
287 let Inst{20} = 1; // L bit
288 let Inst{21} = 0; // W bit
289 let Inst{22} = 0; // B bit
290 let Inst{24} = 1; // P bit
291 let Inst{27-26} = {0,1};
293 class AXI2ldw<dag oops, dag iops, Format f, string asm,
295 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
297 let Inst{20} = 1; // L bit
298 let Inst{21} = 0; // W bit
299 let Inst{22} = 0; // B bit
300 let Inst{24} = 1; // P bit
301 let Inst{27-26} = {0,1};
303 class AI2ldb<dag oops, dag iops, Format f, string opc,
304 string asm, list<dag> pattern>
305 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
307 let Inst{20} = 1; // L bit
308 let Inst{21} = 0; // W bit
309 let Inst{22} = 1; // B bit
310 let Inst{24} = 1; // P bit
311 let Inst{27-26} = {0,1};
313 class AXI2ldb<dag oops, dag iops, Format f, string asm,
315 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
317 let Inst{20} = 1; // L bit
318 let Inst{21} = 0; // W bit
319 let Inst{22} = 1; // B bit
320 let Inst{24} = 1; // P bit
321 let Inst{27-26} = {0,1};
325 class AI2stw<dag oops, dag iops, Format f, string opc,
326 string asm, list<dag> pattern>
327 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
329 let Inst{20} = 0; // L bit
330 let Inst{21} = 0; // W bit
331 let Inst{22} = 0; // B bit
332 let Inst{24} = 1; // P bit
333 let Inst{27-26} = {0,1};
335 class AXI2stw<dag oops, dag iops, Format f, string asm,
337 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
339 let Inst{20} = 0; // L bit
340 let Inst{21} = 0; // W bit
341 let Inst{22} = 0; // B bit
342 let Inst{24} = 1; // P bit
343 let Inst{27-26} = {0,1};
345 class AI2stb<dag oops, dag iops, Format f, string opc,
346 string asm, list<dag> pattern>
347 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
349 let Inst{20} = 0; // L bit
350 let Inst{21} = 0; // W bit
351 let Inst{22} = 1; // B bit
352 let Inst{24} = 1; // P bit
353 let Inst{27-26} = {0,1};
355 class AXI2stb<dag oops, dag iops, Format f, string asm,
357 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
359 let Inst{20} = 0; // L bit
360 let Inst{21} = 0; // W bit
361 let Inst{22} = 1; // B bit
362 let Inst{24} = 1; // P bit
363 let Inst{27-26} = {0,1};
367 class AI2ldwpr<dag oops, dag iops, Format f, string opc,
368 string asm, string cstr, list<dag> pattern>
369 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
370 asm, cstr, pattern> {
371 let Inst{20} = 1; // L bit
372 let Inst{21} = 1; // W bit
373 let Inst{22} = 0; // B bit
374 let Inst{24} = 1; // P bit
375 let Inst{27-26} = {0,1};
377 class AI2ldbpr<dag oops, dag iops, Format f, string opc,
378 string asm, string cstr, list<dag> pattern>
379 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
380 asm, cstr, pattern> {
381 let Inst{20} = 1; // L bit
382 let Inst{21} = 1; // W bit
383 let Inst{22} = 1; // B bit
384 let Inst{24} = 1; // P bit
385 let Inst{27-26} = {0,1};
388 // Pre-indexed stores
389 class AI2stwpr<dag oops, dag iops, Format f, string opc,
390 string asm, string cstr, list<dag> pattern>
391 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
392 asm, cstr, pattern> {
393 let Inst{20} = 0; // L bit
394 let Inst{21} = 1; // W bit
395 let Inst{22} = 0; // B bit
396 let Inst{24} = 1; // P bit
397 let Inst{27-26} = {0,1};
399 class AI2stbpr<dag oops, dag iops, Format f, string opc,
400 string asm, string cstr, list<dag> pattern>
401 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
402 asm, cstr, pattern> {
403 let Inst{20} = 0; // L bit
404 let Inst{21} = 1; // W bit
405 let Inst{22} = 1; // B bit
406 let Inst{24} = 1; // P bit
407 let Inst{27-26} = {0,1};
410 // Post-indexed loads
411 class AI2ldwpo<dag oops, dag iops, Format f, string opc,
412 string asm, string cstr, list<dag> pattern>
413 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
415 let Inst{20} = 1; // L bit
416 let Inst{21} = 0; // W bit
417 let Inst{22} = 0; // B bit
418 let Inst{24} = 0; // P bit
419 let Inst{27-26} = {0,1};
421 class AI2ldbpo<dag oops, dag iops, Format f, string opc,
422 string asm, string cstr, list<dag> pattern>
423 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
425 let Inst{20} = 1; // L bit
426 let Inst{21} = 0; // W bit
427 let Inst{22} = 1; // B bit
428 let Inst{24} = 0; // P bit
429 let Inst{27-26} = {0,1};
432 // Post-indexed stores
433 class AI2stwpo<dag oops, dag iops, Format f, string opc,
434 string asm, string cstr, list<dag> pattern>
435 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
437 let Inst{20} = 0; // L bit
438 let Inst{21} = 0; // W bit
439 let Inst{22} = 0; // B bit
440 let Inst{24} = 0; // P bit
441 let Inst{27-26} = {0,1};
443 class AI2stbpo<dag oops, dag iops, Format f, string opc,
444 string asm, string cstr, list<dag> pattern>
445 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
447 let Inst{20} = 0; // L bit
448 let Inst{21} = 0; // W bit
449 let Inst{22} = 1; // B bit
450 let Inst{24} = 0; // P bit
451 let Inst{27-26} = {0,1};
454 // addrmode3 instructions
455 class AI3<dag oops, dag iops, Format f, string opc,
456 string asm, list<dag> pattern>
457 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
459 class AXI3<dag oops, dag iops, Format f, string asm,
461 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm,
465 class AI3ldh<dag oops, dag iops, Format f, string opc,
466 string asm, list<dag> pattern>
467 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
470 let Inst{5} = 1; // H bit
471 let Inst{6} = 0; // S bit
473 let Inst{20} = 1; // L bit
474 let Inst{21} = 0; // W bit
475 let Inst{24} = 1; // P bit
476 let Inst{27-25} = 0b000;
478 class AXI3ldh<dag oops, dag iops, Format f, string asm,
480 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
483 let Inst{5} = 1; // H bit
484 let Inst{6} = 0; // S bit
486 let Inst{20} = 1; // L bit
487 let Inst{21} = 0; // W bit
488 let Inst{24} = 1; // P bit
490 class AI3ldsh<dag oops, dag iops, Format f, string opc,
491 string asm, list<dag> pattern>
492 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
495 let Inst{5} = 1; // H bit
496 let Inst{6} = 1; // S bit
498 let Inst{20} = 1; // L bit
499 let Inst{21} = 0; // W bit
500 let Inst{24} = 1; // P bit
501 let Inst{27-25} = 0b000;
503 class AXI3ldsh<dag oops, dag iops, Format f, string asm,
505 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
508 let Inst{5} = 1; // H bit
509 let Inst{6} = 1; // S bit
511 let Inst{20} = 1; // L bit
512 let Inst{21} = 0; // W bit
513 let Inst{24} = 1; // P bit
515 class AI3ldsb<dag oops, dag iops, Format f, string opc,
516 string asm, list<dag> pattern>
517 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
520 let Inst{5} = 0; // H bit
521 let Inst{6} = 1; // S bit
523 let Inst{20} = 1; // L bit
524 let Inst{21} = 0; // W bit
525 let Inst{24} = 1; // P bit
526 let Inst{27-25} = 0b000;
528 class AXI3ldsb<dag oops, dag iops, Format f, string asm,
530 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
533 let Inst{5} = 0; // H bit
534 let Inst{6} = 1; // S bit
536 let Inst{20} = 1; // L bit
537 let Inst{21} = 0; // W bit
538 let Inst{24} = 1; // P bit
540 class AI3ldd<dag oops, dag iops, Format f, string opc,
541 string asm, list<dag> pattern>
542 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
545 let Inst{5} = 0; // H bit
546 let Inst{6} = 1; // S bit
548 let Inst{20} = 0; // L bit
549 let Inst{21} = 0; // W bit
550 let Inst{24} = 1; // P bit
551 let Inst{27-25} = 0b000;
555 class AI3sth<dag oops, dag iops, Format f, string opc,
556 string asm, list<dag> pattern>
557 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
560 let Inst{5} = 1; // H bit
561 let Inst{6} = 0; // S bit
563 let Inst{20} = 0; // L bit
564 let Inst{21} = 0; // W bit
565 let Inst{24} = 1; // P bit
566 let Inst{27-25} = 0b000;
568 class AXI3sth<dag oops, dag iops, Format f, string asm,
570 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
573 let Inst{5} = 1; // H bit
574 let Inst{6} = 0; // S bit
576 let Inst{20} = 0; // L bit
577 let Inst{21} = 0; // W bit
578 let Inst{24} = 1; // P bit
580 class AI3std<dag oops, dag iops, Format f, string opc,
581 string asm, list<dag> pattern>
582 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
585 let Inst{5} = 1; // H bit
586 let Inst{6} = 1; // S bit
588 let Inst{20} = 0; // L bit
589 let Inst{21} = 0; // W bit
590 let Inst{24} = 1; // P bit
591 let Inst{27-25} = 0b000;
595 class AI3ldhpr<dag oops, dag iops, Format f, string opc,
596 string asm, string cstr, list<dag> pattern>
597 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
598 asm, cstr, pattern> {
600 let Inst{5} = 1; // H bit
601 let Inst{6} = 0; // S bit
603 let Inst{20} = 1; // L bit
604 let Inst{21} = 1; // W bit
605 let Inst{24} = 1; // P bit
606 let Inst{27-25} = 0b000;
608 class AI3ldshpr<dag oops, dag iops, Format f, string opc,
609 string asm, string cstr, list<dag> pattern>
610 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
611 asm, cstr, pattern> {
613 let Inst{5} = 1; // H bit
614 let Inst{6} = 1; // S bit
616 let Inst{20} = 1; // L bit
617 let Inst{21} = 1; // W bit
618 let Inst{24} = 1; // P bit
619 let Inst{27-25} = 0b000;
621 class AI3ldsbpr<dag oops, dag iops, Format f, string opc,
622 string asm, string cstr, list<dag> pattern>
623 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
624 asm, cstr, pattern> {
626 let Inst{5} = 0; // H bit
627 let Inst{6} = 1; // S bit
629 let Inst{20} = 1; // L bit
630 let Inst{21} = 1; // W bit
631 let Inst{24} = 1; // P bit
632 let Inst{27-25} = 0b000;
635 // Pre-indexed stores
636 class AI3sthpr<dag oops, dag iops, Format f, string opc,
637 string asm, string cstr, list<dag> pattern>
638 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
639 asm, cstr, pattern> {
641 let Inst{5} = 1; // H bit
642 let Inst{6} = 0; // S bit
644 let Inst{20} = 0; // L bit
645 let Inst{21} = 1; // W bit
646 let Inst{24} = 1; // P bit
647 let Inst{27-25} = 0b000;
650 // Post-indexed loads
651 class AI3ldhpo<dag oops, dag iops, Format f, string opc,
652 string asm, string cstr, list<dag> pattern>
653 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
656 let Inst{5} = 1; // H bit
657 let Inst{6} = 0; // S bit
659 let Inst{20} = 1; // L bit
660 let Inst{21} = 1; // W bit
661 let Inst{24} = 0; // P bit
662 let Inst{27-25} = 0b000;
664 class AI3ldshpo<dag oops, dag iops, Format f, string opc,
665 string asm, string cstr, list<dag> pattern>
666 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
669 let Inst{5} = 1; // H bit
670 let Inst{6} = 1; // S bit
672 let Inst{20} = 1; // L bit
673 let Inst{21} = 1; // W bit
674 let Inst{24} = 0; // P bit
675 let Inst{27-25} = 0b000;
677 class AI3ldsbpo<dag oops, dag iops, Format f, string opc,
678 string asm, string cstr, list<dag> pattern>
679 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
682 let Inst{5} = 0; // H bit
683 let Inst{6} = 1; // S bit
685 let Inst{20} = 1; // L bit
686 let Inst{21} = 1; // W bit
687 let Inst{24} = 0; // P bit
688 let Inst{27-25} = 0b000;
691 // Post-indexed stores
692 class AI3sthpo<dag oops, dag iops, Format f, string opc,
693 string asm, string cstr, list<dag> pattern>
694 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
697 let Inst{5} = 1; // H bit
698 let Inst{6} = 0; // S bit
700 let Inst{20} = 0; // L bit
701 let Inst{21} = 1; // W bit
702 let Inst{24} = 0; // P bit
703 let Inst{27-25} = 0b000;
707 // addrmode4 instructions
708 class AXI4ld<dag oops, dag iops, Format f, string asm, list<dag> pattern>
709 : XI<oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm,
711 let Inst{20} = 1; // L bit
712 let Inst{22} = 0; // S bit
713 let Inst{27-25} = 0b100;
715 class AXI4st<dag oops, dag iops, Format f, string asm, list<dag> pattern>
716 : XI<oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm,
718 let Inst{20} = 0; // L bit
719 let Inst{22} = 0; // S bit
720 let Inst{27-25} = 0b100;
723 // Unsigned multiply, multiply-accumulate instructions.
724 class AMul1I<bits<7> opcod, dag oops, dag iops, string opc,
725 string asm, list<dag> pattern>
726 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
728 let Inst{7-4} = 0b1001;
729 let Inst{20} = 0; // S bit
730 let Inst{27-21} = opcod;
732 class AsMul1I<bits<7> opcod, dag oops, dag iops, string opc,
733 string asm, list<dag> pattern>
734 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
736 let Inst{7-4} = 0b1001;
737 let Inst{27-21} = opcod;
740 // Most significant word multiply
741 class AMul2I<bits<7> opcod, dag oops, dag iops, string opc,
742 string asm, list<dag> pattern>
743 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
745 let Inst{7-4} = 0b1001;
747 let Inst{27-21} = opcod;
750 // SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
751 class AMulxyI<bits<7> opcod, dag oops, dag iops, string opc,
752 string asm, list<dag> pattern>
753 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
758 let Inst{27-21} = opcod;
761 // Extend instructions.
762 class AExtI<bits<8> opcod, dag oops, dag iops, string opc,
763 string asm, list<dag> pattern>
764 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ExtFrm, opc,
766 let Inst{7-4} = 0b0111;
767 let Inst{27-20} = opcod;
770 // Misc Arithmetic instructions.
771 class AMiscA1I<bits<8> opcod, dag oops, dag iops, string opc,
772 string asm, list<dag> pattern>
773 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ArithMiscFrm, opc,
775 let Inst{27-20} = opcod;
778 //===----------------------------------------------------------------------===//
780 // ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
781 class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
782 list<Predicate> Predicates = [IsARM];
784 class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
785 list<Predicate> Predicates = [IsARM, HasV5TE];
787 class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
788 list<Predicate> Predicates = [IsARM, HasV6];
791 //===----------------------------------------------------------------------===//
793 // Thumb Instruction Format Definitions.
796 // TI - Thumb instruction.
798 class ThumbI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
799 string asm, string cstr, list<dag> pattern>
800 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
801 let OutOperandList = oops;
802 let InOperandList = iops;
804 let Pattern = pattern;
805 list<Predicate> Predicates = [IsThumb];
808 class TI<dag oops, dag iops, string asm, list<dag> pattern>
809 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, asm, "", pattern>;
811 // Two-address instructions
812 class TIt<dag oops, dag iops, string asm, list<dag> pattern>
813 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, asm, "$lhs = $dst", pattern>;
815 // tBL, tBX instructions
816 class TIx2<dag oops, dag iops, string asm, list<dag> pattern>
817 : ThumbI<oops, iops, AddrModeNone, Size4Bytes, asm, "", pattern>;
819 // BR_JT instructions
820 class TJTI<dag oops, dag iops, string asm, list<dag> pattern>
821 : ThumbI<oops, iops, AddrModeNone, SizeSpecial, asm, "", pattern>;
824 class Thumb1I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
825 string asm, string cstr, list<dag> pattern>
826 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
827 let OutOperandList = oops;
828 let InOperandList = iops;
830 let Pattern = pattern;
831 list<Predicate> Predicates = [IsThumb1Only];
834 class T1I<dag oops, dag iops, string asm, list<dag> pattern>
835 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, asm, "", pattern>;
836 class T1Ix2<dag oops, dag iops, string asm, list<dag> pattern>
837 : Thumb1I<oops, iops, AddrModeNone, Size4Bytes, asm, "", pattern>;
838 class T1JTI<dag oops, dag iops, string asm, list<dag> pattern>
839 : Thumb1I<oops, iops, AddrModeNone, SizeSpecial, asm, "", pattern>;
841 // Two-address instructions
842 class T1It<dag oops, dag iops, string asm, list<dag> pattern>
843 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, asm, "$lhs = $dst", pattern>;
845 // Thumb1 instruction that can either be predicated or set CPSR.
846 class Thumb1sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
847 string opc, string asm, string cstr, list<dag> pattern>
848 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
849 let OutOperandList = !con(oops, (ops s_cc_out:$s));
850 let InOperandList = !con(iops, (ops pred:$p));
851 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
852 let Pattern = pattern;
853 list<Predicate> Predicates = [IsThumb1Only];
856 class T1sI<dag oops, dag iops, string opc, string asm, list<dag> pattern>
857 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, opc, asm, "", pattern>;
859 // Two-address instructions
860 class T1sIt<dag oops, dag iops, string opc, string asm, list<dag> pattern>
861 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, opc, asm,
862 "$lhs = $dst", pattern>;
864 // Thumb1 instruction that can be predicated.
865 class Thumb1pI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
866 string opc, string asm, string cstr, list<dag> pattern>
867 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
868 let OutOperandList = oops;
869 let InOperandList = !con(iops, (ops pred:$p));
870 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
871 let Pattern = pattern;
872 list<Predicate> Predicates = [IsThumb1Only];
875 class T1pI<dag oops, dag iops, string opc, string asm, list<dag> pattern>
876 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, opc, asm, "", pattern>;
878 // Two-address instructions
879 class T1pIt<dag oops, dag iops, string opc, string asm, list<dag> pattern>
880 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, opc, asm,
881 "$lhs = $dst", pattern>;
883 class T1pI1<dag oops, dag iops, string opc, string asm, list<dag> pattern>
884 : Thumb1pI<oops, iops, AddrModeT1_1, Size2Bytes, opc, asm, "", pattern>;
885 class T1pI2<dag oops, dag iops, string opc, string asm, list<dag> pattern>
886 : Thumb1pI<oops, iops, AddrModeT1_2, Size2Bytes, opc, asm, "", pattern>;
887 class T1pI4<dag oops, dag iops, string opc, string asm, list<dag> pattern>
888 : Thumb1pI<oops, iops, AddrModeT1_4, Size2Bytes, opc, asm, "", pattern>;
889 class T1pIs<dag oops, dag iops, string opc, string asm, list<dag> pattern>
890 : Thumb1pI<oops, iops, AddrModeT1_s, Size2Bytes, opc, asm, "", pattern>;
892 // Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
893 class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
894 string opc, string asm, string cstr, list<dag> pattern>
895 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
896 let OutOperandList = oops;
897 let InOperandList = !con(iops, (ops pred:$p));
898 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
899 let Pattern = pattern;
900 list<Predicate> Predicates = [IsThumb2];
903 // Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as
904 // an input operand since by default it's a zero register. It will
905 // become an implicit def once it's "flipped".
906 // FIXME: This uses unified syntax so {s} comes before {p}. We should make it
908 class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
909 string opc, string asm, string cstr, list<dag> pattern>
910 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
911 let OutOperandList = oops;
912 let InOperandList = !con(iops, (ops pred:$p, cc_out:$s));
913 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
914 let Pattern = pattern;
915 list<Predicate> Predicates = [IsThumb2];
919 class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
920 string asm, string cstr, list<dag> pattern>
921 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
922 let OutOperandList = oops;
923 let InOperandList = iops;
925 let Pattern = pattern;
926 list<Predicate> Predicates = [IsThumb2];
929 class T2I<dag oops, dag iops, string opc, string asm, list<dag> pattern>
930 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, opc, asm, "", pattern>;
931 class T2Ii12<dag oops, dag iops, string opc, string asm, list<dag> pattern>
932 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, opc, asm, "", pattern>;
933 class T2Ii8<dag oops, dag iops, string opc, string asm, list<dag> pattern>
934 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, opc, asm, "", pattern>;
935 class T2Iso<dag oops, dag iops, string opc, string asm, list<dag> pattern>
936 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, opc, asm, "", pattern>;
937 class T2Ipc<dag oops, dag iops, string opc, string asm, list<dag> pattern>
938 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, opc, asm, "", pattern>;
939 class T2Ii8s4<dag oops, dag iops, string opc, string asm, list<dag> pattern>
940 : Thumb2I<oops, iops, AddrModeT2_i8s4, Size4Bytes, opc, asm, "", pattern>;
942 class T2sI<dag oops, dag iops, string opc, string asm, list<dag> pattern>
943 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, opc, asm, "", pattern>;
945 class T2XI<dag oops, dag iops, string asm, list<dag> pattern>
946 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, asm, "", pattern>;
947 class T2JTI<dag oops, dag iops, string asm, list<dag> pattern>
948 : Thumb2XI<oops, iops, AddrModeNone, SizeSpecial, asm, "", pattern>;
950 // T2Iidxldst - Thumb2 indexed load / store instructions.
951 class T2Iidxldst<dag oops, dag iops, AddrMode am, IndexMode im,
952 string opc, string asm, string cstr, list<dag> pattern>
953 : InstARM<am, Size4Bytes, im, ThumbFrm, cstr> {
954 let OutOperandList = oops;
955 let InOperandList = !con(iops, (ops pred:$p));
956 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
957 let Pattern = pattern;
958 list<Predicate> Predicates = [IsThumb2];
961 // Tv5Pat - Same as Pat<>, but requires V5T Thumb mode.
962 class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
963 list<Predicate> Predicates = [IsThumb1Only, HasV5T];
966 // T1Pat - Same as Pat<>, but requires that the compiler be in Thumb1 mode.
967 class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
968 list<Predicate> Predicates = [IsThumb1Only];
971 // T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
972 class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
973 list<Predicate> Predicates = [IsThumb2];
976 //===----------------------------------------------------------------------===//
978 //===----------------------------------------------------------------------===//
979 // ARM VFP Instruction templates.
982 // Almost all VFP instructions are predicable.
983 class VFPI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
984 IndexMode im, Format f, string opc, string asm, string cstr,
986 : InstARM<am, sz, im, f, cstr> {
987 let OutOperandList = oops;
988 let InOperandList = !con(iops, (ops pred:$p));
989 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
990 let Pattern = pattern;
991 list<Predicate> Predicates = [HasVFP2];
995 class VFPXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
996 IndexMode im, Format f, string asm, string cstr, list<dag> pattern>
997 : InstARM<am, sz, im, f, cstr> {
998 let OutOperandList = oops;
999 let InOperandList = iops;
1000 let AsmString = asm;
1001 let Pattern = pattern;
1002 list<Predicate> Predicates = [HasVFP2];
1005 class VFPAI<dag oops, dag iops, Format f, string opc,
1006 string asm, list<dag> pattern>
1007 : VFPI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc,
1010 // ARM VFP addrmode5 loads and stores
1011 class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
1012 string opc, string asm, list<dag> pattern>
1013 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
1014 VFPLdStFrm, opc, asm, "", pattern> {
1015 // TODO: Mark the instructions with the appropriate subtarget info.
1016 let Inst{27-24} = opcod1;
1017 let Inst{21-20} = opcod2;
1018 let Inst{11-8} = 0b1011;
1021 class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
1022 string opc, string asm, list<dag> pattern>
1023 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
1024 VFPLdStFrm, opc, asm, "", pattern> {
1025 // TODO: Mark the instructions with the appropriate subtarget info.
1026 let Inst{27-24} = opcod1;
1027 let Inst{21-20} = opcod2;
1028 let Inst{11-8} = 0b1010;
1031 // Load / store multiple
1032 class AXSI5<dag oops, dag iops, string asm, list<dag> pattern>
1033 : VFPXI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
1034 VFPLdStMulFrm, asm, "", pattern> {
1035 // TODO: Mark the instructions with the appropriate subtarget info.
1036 let Inst{27-25} = 0b110;
1037 let Inst{11-8} = 0b1011;
1040 class AXDI5<dag oops, dag iops, string asm, list<dag> pattern>
1041 : VFPXI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
1042 VFPLdStMulFrm, asm, "", pattern> {
1043 // TODO: Mark the instructions with the appropriate subtarget info.
1044 let Inst{27-25} = 0b110;
1045 let Inst{11-8} = 0b1010;
1049 // Double precision, unary
1050 class ADuI<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3, dag oops, dag iops,
1051 string opc, string asm, list<dag> pattern>
1052 : VFPAI<oops, iops, VFPUnaryFrm, opc, asm, pattern> {
1053 let Inst{27-20} = opcod1;
1054 let Inst{19-16} = opcod2;
1055 let Inst{11-8} = 0b1011;
1056 let Inst{7-4} = opcod3;
1059 // Double precision, binary
1060 class ADbI<bits<8> opcod, dag oops, dag iops, string opc,
1061 string asm, list<dag> pattern>
1062 : VFPAI<oops, iops, VFPBinaryFrm, opc, asm, pattern> {
1063 let Inst{27-20} = opcod;
1064 let Inst{11-8} = 0b1011;
1067 // Single precision, unary
1068 class ASuI<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3, dag oops, dag iops,
1069 string opc, string asm, list<dag> pattern>
1070 : VFPAI<oops, iops, VFPUnaryFrm, opc, asm, pattern> {
1071 // Bits 22 (D bit) and 5 (M bit) will be changed during instruction encoding.
1072 let Inst{27-20} = opcod1;
1073 let Inst{19-16} = opcod2;
1074 let Inst{11-8} = 0b1010;
1075 let Inst{7-4} = opcod3;
1078 // Single precision, unary if no NEON
1079 // Same as ASuI except not available if NEON is enabled
1080 class ASuIn<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3, dag oops, dag iops,
1081 string opc, string asm, list<dag> pattern>
1082 : ASuI<opcod1, opcod2, opcod2, oops, iops, opc, asm, pattern> {
1083 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1086 // Single precision, binary
1087 class ASbI<bits<8> opcod, dag oops, dag iops, string opc,
1088 string asm, list<dag> pattern>
1089 : VFPAI<oops, iops, VFPBinaryFrm, opc, asm, pattern> {
1090 // Bit 22 (D bit) can be changed during instruction encoding.
1091 let Inst{27-20} = opcod;
1092 let Inst{11-8} = 0b1010;
1095 // Single precision, binary if no NEON
1096 // Same as ASbI except not available if NEON is enabled
1097 class ASbIn<bits<8> opcod, dag oops, dag iops, string opc,
1098 string asm, list<dag> pattern>
1099 : ASbI<opcod, oops, iops, opc, asm, pattern> {
1100 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1103 // VFP conversion instructions
1104 class AVConv1I<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3,
1105 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1106 : VFPAI<oops, iops, VFPConv1Frm, opc, asm, pattern> {
1107 let Inst{27-20} = opcod1;
1108 let Inst{19-16} = opcod2;
1109 let Inst{11-8} = opcod3;
1113 class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
1114 string opc, string asm, list<dag> pattern>
1115 : VFPAI<oops, iops, f, opc, asm, pattern> {
1116 let Inst{27-20} = opcod1;
1117 let Inst{11-8} = opcod2;
1121 class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
1122 string asm, list<dag> pattern>
1123 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, opc, asm, pattern>;
1125 class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
1126 string asm, list<dag> pattern>
1127 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, opc, asm, pattern>;
1129 class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
1130 string asm, list<dag> pattern>
1131 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, opc, asm, pattern>;
1133 class AVConv5I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
1134 string asm, list<dag> pattern>
1135 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv5Frm, opc, asm, pattern>;
1137 //===----------------------------------------------------------------------===//
1139 //===----------------------------------------------------------------------===//
1140 // ARM NEON Instruction templates.
1143 class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, string asm,
1144 string cstr, list<dag> pattern>
1145 : InstARM<am, Size4Bytes, im, NEONFrm, cstr> {
1146 let OutOperandList = oops;
1147 let InOperandList = iops;
1148 let AsmString = asm;
1149 let Pattern = pattern;
1150 list<Predicate> Predicates = [HasNEON];
1153 class NI<dag oops, dag iops, string asm, list<dag> pattern>
1154 : NeonI<oops, iops, AddrModeNone, IndexModeNone, asm, "", pattern> {
1157 class NLdSt<dag oops, dag iops, string asm, list<dag> pattern>
1158 : NeonI<oops, iops, AddrMode6, IndexModeNone, asm, "", pattern> {
1159 let Inst{31-24} = 0b11110100;
1162 class NDataI<dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1163 : NeonI<oops, iops, AddrModeNone, IndexModeNone, asm, cstr, pattern> {
1164 let Inst{31-25} = 0b1111001;
1167 // NEON "one register and a modified immediate" format.
1168 class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1170 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1171 : NDataI<oops, iops, asm, cstr, pattern> {
1172 let Inst{23} = op23;
1173 let Inst{21-19} = op21_19;
1174 let Inst{11-8} = op11_8;
1181 // NEON 2 vector register format.
1182 class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1183 bits<5> op11_7, bit op6, bit op4,
1184 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1185 : NDataI<oops, iops, asm, cstr, pattern> {
1186 let Inst{24-23} = op24_23;
1187 let Inst{21-20} = op21_20;
1188 let Inst{19-18} = op19_18;
1189 let Inst{17-16} = op17_16;
1190 let Inst{11-7} = op11_7;
1195 // NEON 2 vector register with immediate.
1196 class N2VImm<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
1198 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1199 : NDataI<oops, iops, asm, cstr, pattern> {
1200 let Inst{24} = op24;
1201 let Inst{23} = op23;
1202 let Inst{21-16} = op21_16;
1203 let Inst{11-8} = op11_8;
1209 // NEON 3 vector register format.
1210 class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
1211 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1212 : NDataI<oops, iops, asm, cstr, pattern> {
1213 let Inst{24} = op24;
1214 let Inst{23} = op23;
1215 let Inst{21-20} = op21_20;
1216 let Inst{11-8} = op11_8;
1221 // NEON VMOVs between scalar and core registers.
1222 class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1223 dag oops, dag iops, Format f, string opc, string asm,
1225 : AI<oops, iops, f, opc, asm, pattern> {
1226 let Inst{27-20} = opcod1;
1227 let Inst{11-8} = opcod2;
1228 let Inst{6-5} = opcod3;
1230 list<Predicate> Predicates = [HasNEON];
1232 class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1233 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1234 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONGetLnFrm, opc, asm,
1236 class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1237 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1238 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONSetLnFrm, opc, asm,
1240 class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1241 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1242 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONDupFrm, opc, asm, pattern>;
1244 // NEONFPPat - Same as Pat<>, but requires that the compiler be using NEON
1245 // for single-precision FP.
1246 class NEONFPPat<dag pattern, dag result> : Pat<pattern, result> {
1247 list<Predicate> Predicates = [HasNEON,UseNEONForFP];