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 DPSoRegRegFrm : 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>;
71 def DPSoRegImmFrm : Format<42>;
75 // The instruction has an Rn register operand.
76 // UnaryDP - Indicates this is a unary data processing instruction, i.e.
77 // it doesn't have a Rn operand.
78 class UnaryDP { bit isUnaryDataProc = 1; }
80 // Xform16Bit - Indicates this Thumb2 instruction may be transformed into
81 // a 16-bit Thumb instruction if certain conditions are met.
82 class Xform16Bit { bit canXformTo16Bit = 1; }
84 //===----------------------------------------------------------------------===//
85 // ARM Instruction flags. These need to match ARMBaseInstrInfo.h.
88 // FIXME: Once the JIT is MC-ized, these can go away.
90 class AddrMode<bits<5> val> {
93 def AddrModeNone : AddrMode<0>;
94 def AddrMode1 : AddrMode<1>;
95 def AddrMode2 : AddrMode<2>;
96 def AddrMode3 : AddrMode<3>;
97 def AddrMode4 : AddrMode<4>;
98 def AddrMode5 : AddrMode<5>;
99 def AddrMode6 : AddrMode<6>;
100 def AddrModeT1_1 : AddrMode<7>;
101 def AddrModeT1_2 : AddrMode<8>;
102 def AddrModeT1_4 : AddrMode<9>;
103 def AddrModeT1_s : AddrMode<10>;
104 def AddrModeT2_i12 : AddrMode<11>;
105 def AddrModeT2_i8 : AddrMode<12>;
106 def AddrModeT2_so : AddrMode<13>;
107 def AddrModeT2_pc : AddrMode<14>;
108 def AddrModeT2_i8s4 : AddrMode<15>;
109 def AddrMode_i12 : AddrMode<16>;
111 // Load / store index mode.
112 class IndexMode<bits<2> val> {
115 def IndexModeNone : IndexMode<0>;
116 def IndexModePre : IndexMode<1>;
117 def IndexModePost : IndexMode<2>;
118 def IndexModeUpd : IndexMode<3>;
120 // Instruction execution domain.
121 class Domain<bits<3> val> {
124 def GenericDomain : Domain<0>;
125 def VFPDomain : Domain<1>; // Instructions in VFP domain only
126 def NeonDomain : Domain<2>; // Instructions in Neon domain only
127 def VFPNeonDomain : Domain<3>; // Instructions in both VFP & Neon domains
128 def VFPNeonA8Domain : Domain<5>; // Instructions in VFP & Neon under A8
130 //===----------------------------------------------------------------------===//
131 // ARM special operands.
134 // ARM imod and iflag operands, used only by the CPS instruction.
135 def imod_op : Operand<i32> {
136 let PrintMethod = "printCPSIMod";
139 def ProcIFlagsOperand : AsmOperandClass {
140 let Name = "ProcIFlags";
141 let ParserMethod = "parseProcIFlagsOperand";
143 def iflags_op : Operand<i32> {
144 let PrintMethod = "printCPSIFlag";
145 let ParserMatchClass = ProcIFlagsOperand;
148 // ARM Predicate operand. Default to 14 = always (AL). Second part is CC
149 // register whose default is 0 (no register).
150 def CondCodeOperand : AsmOperandClass { let Name = "CondCode"; }
151 def pred : PredicateOperand<OtherVT, (ops i32imm, CCR),
152 (ops (i32 14), (i32 zero_reg))> {
153 let PrintMethod = "printPredicateOperand";
154 let ParserMatchClass = CondCodeOperand;
155 let DecoderMethod = "DecodePredicateOperand";
158 // Conditional code result for instructions whose 's' bit is set, e.g. subs.
159 def CCOutOperand : AsmOperandClass { let Name = "CCOut"; }
160 def cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 zero_reg))> {
161 let EncoderMethod = "getCCOutOpValue";
162 let PrintMethod = "printSBitModifierOperand";
163 let ParserMatchClass = CCOutOperand;
164 let DecoderMethod = "DecodeCCOutOperand";
167 // Same as cc_out except it defaults to setting CPSR.
168 def s_cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 CPSR))> {
169 let EncoderMethod = "getCCOutOpValue";
170 let PrintMethod = "printSBitModifierOperand";
171 let ParserMatchClass = CCOutOperand;
172 let DecoderMethod = "DecodeCCOutOperand";
175 // ARM special operands for disassembly only.
177 def SetEndAsmOperand : AsmOperandClass {
178 let Name = "SetEndImm";
179 let ParserMethod = "parseSetEndImm";
181 def setend_op : Operand<i32> {
182 let PrintMethod = "printSetendOperand";
183 let ParserMatchClass = SetEndAsmOperand;
186 def MSRMaskOperand : AsmOperandClass {
187 let Name = "MSRMask";
188 let ParserMethod = "parseMSRMaskOperand";
190 def msr_mask : Operand<i32> {
191 let PrintMethod = "printMSRMaskOperand";
192 let DecoderMethod = "DecodeMSRMask";
193 let ParserMatchClass = MSRMaskOperand;
196 // Shift Right Immediate - A shift right immediate is encoded differently from
197 // other shift immediates. The imm6 field is encoded like so:
200 // 8 imm6<5:3> = '001', 8 - <imm> is encoded in imm6<2:0>
201 // 16 imm6<5:4> = '01', 16 - <imm> is encoded in imm6<3:0>
202 // 32 imm6<5> = '1', 32 - <imm> is encoded in imm6<4:0>
203 // 64 64 - <imm> is encoded in imm6<5:0>
204 def shr_imm8 : Operand<i32> {
205 let EncoderMethod = "getShiftRight8Imm";
206 let DecoderMethod = "DecodeShiftRight8Imm";
208 def shr_imm16 : Operand<i32> {
209 let EncoderMethod = "getShiftRight16Imm";
210 let DecoderMethod = "DecodeShiftRight16Imm";
212 def shr_imm32 : Operand<i32> {
213 let EncoderMethod = "getShiftRight32Imm";
214 let DecoderMethod = "DecodeShiftRight32Imm";
216 def shr_imm64 : Operand<i32> {
217 let EncoderMethod = "getShiftRight64Imm";
218 let DecoderMethod = "DecodeShiftRight64Imm";
221 //===----------------------------------------------------------------------===//
222 // ARM Instruction templates.
225 class InstTemplate<AddrMode am, int sz, IndexMode im,
226 Format f, Domain d, string cstr, InstrItinClass itin>
228 let Namespace = "ARM";
233 bits<2> IndexModeBits = IM.Value;
235 bits<6> Form = F.Value;
237 bit isUnaryDataProc = 0;
238 bit canXformTo16Bit = 0;
240 // If this is a pseudo instruction, mark it isCodeGenOnly.
241 let isCodeGenOnly = !eq(!cast<string>(f), "Pseudo");
243 // The layout of TSFlags should be kept in sync with ARMBaseInfo.h.
244 let TSFlags{4-0} = AM.Value;
245 let TSFlags{6-5} = IndexModeBits;
246 let TSFlags{12-7} = Form;
247 let TSFlags{13} = isUnaryDataProc;
248 let TSFlags{14} = canXformTo16Bit;
249 let TSFlags{17-15} = D.Value;
251 let Constraints = cstr;
252 let Itinerary = itin;
259 class InstARM<AddrMode am, int sz, IndexMode im,
260 Format f, Domain d, string cstr, InstrItinClass itin>
261 : InstTemplate<am, sz, im, f, d, cstr, itin>, Encoding {
262 let DecoderNamespace = "ARM";
265 // This Encoding-less class is used by Thumb1 to specify the encoding bits later
266 // on by adding flavors to specific instructions.
267 class InstThumb<AddrMode am, int sz, IndexMode im,
268 Format f, Domain d, string cstr, InstrItinClass itin>
269 : InstTemplate<am, sz, im, f, d, cstr, itin> {
270 let DecoderNamespace = "Thumb";
273 class PseudoInst<dag oops, dag iops, InstrItinClass itin, list<dag> pattern>
274 : InstTemplate<AddrModeNone, 0, IndexModeNone, Pseudo,
275 GenericDomain, "", itin> {
276 let OutOperandList = oops;
277 let InOperandList = iops;
278 let Pattern = pattern;
279 let isCodeGenOnly = 1;
283 // PseudoInst that's ARM-mode only.
284 class ARMPseudoInst<dag oops, dag iops, int sz, InstrItinClass itin,
286 : PseudoInst<oops, iops, itin, pattern> {
288 list<Predicate> Predicates = [IsARM];
291 // PseudoInst that's Thumb-mode only.
292 class tPseudoInst<dag oops, dag iops, int sz, InstrItinClass itin,
294 : PseudoInst<oops, iops, itin, pattern> {
296 list<Predicate> Predicates = [IsThumb];
299 // PseudoInst that's Thumb2-mode only.
300 class t2PseudoInst<dag oops, dag iops, int sz, InstrItinClass itin,
302 : PseudoInst<oops, iops, itin, pattern> {
304 list<Predicate> Predicates = [IsThumb2];
307 class ARMPseudoExpand<dag oops, dag iops, int sz,
308 InstrItinClass itin, list<dag> pattern,
310 : ARMPseudoInst<oops, iops, sz, itin, pattern>,
311 PseudoInstExpansion<Result>;
313 class tPseudoExpand<dag oops, dag iops, int sz,
314 InstrItinClass itin, list<dag> pattern,
316 : tPseudoInst<oops, iops, sz, itin, pattern>,
317 PseudoInstExpansion<Result>;
319 class t2PseudoExpand<dag oops, dag iops, int sz,
320 InstrItinClass itin, list<dag> pattern,
322 : t2PseudoInst<oops, iops, sz, itin, pattern>,
323 PseudoInstExpansion<Result>;
325 // Almost all ARM instructions are predicable.
326 class I<dag oops, dag iops, AddrMode am, int sz,
327 IndexMode im, Format f, InstrItinClass itin,
328 string opc, string asm, string cstr,
330 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
333 let OutOperandList = oops;
334 let InOperandList = !con(iops, (ins pred:$p));
335 let AsmString = !strconcat(opc, "${p}", asm);
336 let Pattern = pattern;
337 list<Predicate> Predicates = [IsARM];
340 // A few are not predicable
341 class InoP<dag oops, dag iops, AddrMode am, int sz,
342 IndexMode im, Format f, InstrItinClass itin,
343 string opc, string asm, string cstr,
345 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
346 let OutOperandList = oops;
347 let InOperandList = iops;
348 let AsmString = !strconcat(opc, asm);
349 let Pattern = pattern;
350 let isPredicable = 0;
351 list<Predicate> Predicates = [IsARM];
354 // Same as I except it can optionally modify CPSR. Note it's modeled as an input
355 // operand since by default it's a zero register. It will become an implicit def
356 // once it's "flipped".
357 class sI<dag oops, dag iops, AddrMode am, int sz,
358 IndexMode im, Format f, InstrItinClass itin,
359 string opc, string asm, string cstr,
361 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
362 bits<4> p; // Predicate operand
363 bits<1> s; // condition-code set flag ('1' if the insn should set the flags)
367 let OutOperandList = oops;
368 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
369 let AsmString = !strconcat(opc, "${s}${p}", asm);
370 let Pattern = pattern;
371 list<Predicate> Predicates = [IsARM];
375 class XI<dag oops, dag iops, AddrMode am, int sz,
376 IndexMode im, Format f, InstrItinClass itin,
377 string asm, string cstr, list<dag> pattern>
378 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
379 let OutOperandList = oops;
380 let InOperandList = iops;
382 let Pattern = pattern;
383 list<Predicate> Predicates = [IsARM];
386 class AI<dag oops, dag iops, Format f, InstrItinClass itin,
387 string opc, string asm, list<dag> pattern>
388 : I<oops, iops, AddrModeNone, 4, IndexModeNone, f, itin,
389 opc, asm, "", pattern>;
390 class AsI<dag oops, dag iops, Format f, InstrItinClass itin,
391 string opc, string asm, list<dag> pattern>
392 : sI<oops, iops, AddrModeNone, 4, IndexModeNone, f, itin,
393 opc, asm, "", pattern>;
394 class AXI<dag oops, dag iops, Format f, InstrItinClass itin,
395 string asm, list<dag> pattern>
396 : XI<oops, iops, AddrModeNone, 4, IndexModeNone, f, itin,
398 class AInoP<dag oops, dag iops, Format f, InstrItinClass itin,
399 string opc, string asm, list<dag> pattern>
400 : InoP<oops, iops, AddrModeNone, 4, IndexModeNone, f, itin,
401 opc, asm, "", pattern>;
403 // Ctrl flow instructions
404 class ABI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
405 string opc, string asm, list<dag> pattern>
406 : I<oops, iops, AddrModeNone, 4, IndexModeNone, BrFrm, itin,
407 opc, asm, "", pattern> {
408 let Inst{27-24} = opcod;
410 class ABXI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
411 string asm, list<dag> pattern>
412 : XI<oops, iops, AddrModeNone, 4, IndexModeNone, BrFrm, itin,
414 let Inst{27-24} = opcod;
417 // BR_JT instructions
418 class JTI<dag oops, dag iops, InstrItinClass itin,
419 string asm, list<dag> pattern>
420 : XI<oops, iops, AddrModeNone, 0, IndexModeNone, BrMiscFrm, itin,
423 // Atomic load/store instructions
424 class AIldrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
425 string opc, string asm, list<dag> pattern>
426 : I<oops, iops, AddrModeNone, 4, IndexModeNone, LdStExFrm, itin,
427 opc, asm, "", pattern> {
430 let Inst{27-23} = 0b00011;
431 let Inst{22-21} = opcod;
433 let Inst{19-16} = addr;
434 let Inst{15-12} = Rt;
435 let Inst{11-0} = 0b111110011111;
437 class AIstrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
438 string opc, string asm, list<dag> pattern>
439 : I<oops, iops, AddrModeNone, 4, IndexModeNone, LdStExFrm, itin,
440 opc, asm, "", pattern> {
444 let Inst{27-23} = 0b00011;
445 let Inst{22-21} = opcod;
447 let Inst{19-16} = addr;
448 let Inst{15-12} = Rd;
449 let Inst{11-4} = 0b11111001;
452 class AIswp<bit b, dag oops, dag iops, string opc, list<dag> pattern>
453 : AI<oops, iops, MiscFrm, NoItinerary, opc, "\t$Rt, $Rt2, $addr", pattern> {
457 let Inst{27-23} = 0b00010;
459 let Inst{21-20} = 0b00;
460 let Inst{19-16} = addr;
461 let Inst{15-12} = Rt;
462 let Inst{11-4} = 0b00001001;
466 // addrmode1 instructions
467 class AI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
468 string opc, string asm, list<dag> pattern>
469 : I<oops, iops, AddrMode1, 4, IndexModeNone, f, itin,
470 opc, asm, "", pattern> {
471 let Inst{24-21} = opcod;
472 let Inst{27-26} = 0b00;
474 class AsI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
475 string opc, string asm, list<dag> pattern>
476 : sI<oops, iops, AddrMode1, 4, IndexModeNone, f, itin,
477 opc, asm, "", pattern> {
478 let Inst{24-21} = opcod;
479 let Inst{27-26} = 0b00;
481 class AXI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
482 string asm, list<dag> pattern>
483 : XI<oops, iops, AddrMode1, 4, IndexModeNone, f, itin,
485 let Inst{24-21} = opcod;
486 let Inst{27-26} = 0b00;
491 // LDR/LDRB/STR/STRB/...
492 class AI2ldst<bits<3> op, bit isLd, bit isByte, dag oops, dag iops, AddrMode am,
493 Format f, InstrItinClass itin, string opc, string asm,
495 : I<oops, iops, am, 4, IndexModeNone, f, itin, opc, asm,
497 let Inst{27-25} = op;
498 let Inst{24} = 1; // 24 == P
500 let Inst{22} = isByte;
501 let Inst{21} = 0; // 21 == W
504 // Indexed load/stores
505 class AI2ldstidx<bit isLd, bit isByte, bit isPre, dag oops, dag iops,
506 IndexMode im, Format f, InstrItinClass itin, string opc,
507 string asm, string cstr, list<dag> pattern>
508 : I<oops, iops, AddrMode2, 4, im, f, itin,
509 opc, asm, cstr, pattern> {
511 let Inst{27-26} = 0b01;
512 let Inst{24} = isPre; // P bit
513 let Inst{22} = isByte; // B bit
514 let Inst{21} = isPre; // W bit
515 let Inst{20} = isLd; // L bit
516 let Inst{15-12} = Rt;
518 class AI2stridx_reg<bit isByte, bit isPre, dag oops, dag iops,
519 IndexMode im, Format f, InstrItinClass itin, string opc,
520 string asm, string cstr, list<dag> pattern>
521 : AI2ldstidx<0, isByte, isPre, oops, iops, im, f, itin, opc, asm, cstr,
523 // AM2 store w/ two operands: (GPR, am2offset)
529 let Inst{23} = offset{12};
530 let Inst{19-16} = Rn;
531 let Inst{11-5} = offset{11-5};
533 let Inst{3-0} = offset{3-0};
536 class AI2stridx_imm<bit isByte, bit isPre, dag oops, dag iops,
537 IndexMode im, Format f, InstrItinClass itin, string opc,
538 string asm, string cstr, list<dag> pattern>
539 : AI2ldstidx<0, isByte, isPre, oops, iops, im, f, itin, opc, asm, cstr,
541 // AM2 store w/ two operands: (GPR, am2offset)
547 let Inst{23} = offset{12};
548 let Inst{19-16} = Rn;
549 let Inst{11-0} = offset{11-0};
553 // FIXME: Merge with the above class when addrmode2 gets used for STR, STRB
554 // but for now use this class for STRT and STRBT.
555 class AI2stridxT<bit isByte, bit isPre, dag oops, dag iops,
556 IndexMode im, Format f, InstrItinClass itin, string opc,
557 string asm, string cstr, list<dag> pattern>
558 : AI2ldstidx<0, isByte, isPre, oops, iops, im, f, itin, opc, asm, cstr,
560 // AM2 store w/ two operands: (GPR, am2offset)
562 // {13} 1 == Rm, 0 == imm12
566 let Inst{25} = addr{13};
567 let Inst{23} = addr{12};
568 let Inst{19-16} = addr{17-14};
569 let Inst{11-0} = addr{11-0};
572 // addrmode3 instructions
573 class AI3ld<bits<4> op, bit op20, dag oops, dag iops, Format f,
574 InstrItinClass itin, string opc, string asm, list<dag> pattern>
575 : I<oops, iops, AddrMode3, 4, IndexModeNone, f, itin,
576 opc, asm, "", pattern> {
579 let Inst{27-25} = 0b000;
580 let Inst{24} = 1; // P bit
581 let Inst{23} = addr{8}; // U bit
582 let Inst{22} = addr{13}; // 1 == imm8, 0 == Rm
583 let Inst{21} = 0; // W bit
584 let Inst{20} = op20; // L bit
585 let Inst{19-16} = addr{12-9}; // Rn
586 let Inst{15-12} = Rt; // Rt
587 let Inst{11-8} = addr{7-4}; // imm7_4/zero
589 let Inst{3-0} = addr{3-0}; // imm3_0/Rm
591 let DecoderMethod = "DecodeAddrMode3Instruction";
594 class AI3ldstidx<bits<4> op, bit op20, bit isPre, dag oops, dag iops,
595 IndexMode im, Format f, InstrItinClass itin, string opc,
596 string asm, string cstr, list<dag> pattern>
597 : I<oops, iops, AddrMode3, 4, im, f, itin,
598 opc, asm, cstr, pattern> {
600 let Inst{27-25} = 0b000;
601 let Inst{24} = isPre; // P bit
602 let Inst{21} = isPre; // W bit
603 let Inst{20} = op20; // L bit
604 let Inst{15-12} = Rt; // Rt
608 // FIXME: Merge with the above class when addrmode2 gets used for LDR, LDRB
609 // but for now use this class for LDRSBT, LDRHT, LDSHT.
610 class AI3ldstidxT<bits<4> op, bit isLoad, dag oops, dag iops,
611 IndexMode im, Format f, InstrItinClass itin, string opc,
612 string asm, string cstr, list<dag> pattern>
613 : I<oops, iops, AddrMode3, 4, im, f, itin, opc, asm, cstr, pattern> {
614 // {13} 1 == imm8, 0 == Rm
621 let Inst{27-25} = 0b000;
622 let Inst{24} = 0; // P bit
624 let Inst{20} = isLoad; // L bit
625 let Inst{19-16} = addr; // Rn
626 let Inst{15-12} = Rt; // Rt
631 class AI3str<bits<4> op, dag oops, dag iops, Format f, InstrItinClass itin,
632 string opc, string asm, list<dag> pattern>
633 : I<oops, iops, AddrMode3, 4, IndexModeNone, f, itin,
634 opc, asm, "", pattern> {
637 let Inst{27-25} = 0b000;
638 let Inst{24} = 1; // P bit
639 let Inst{23} = addr{8}; // U bit
640 let Inst{22} = addr{13}; // 1 == imm8, 0 == Rm
641 let Inst{21} = 0; // W bit
642 let Inst{20} = 0; // L bit
643 let Inst{19-16} = addr{12-9}; // Rn
644 let Inst{15-12} = Rt; // Rt
645 let Inst{11-8} = addr{7-4}; // imm7_4/zero
647 let Inst{3-0} = addr{3-0}; // imm3_0/Rm
648 let DecoderMethod = "DecodeAddrMode3Instruction";
651 // addrmode4 instructions
652 class AXI4<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
653 string asm, string cstr, list<dag> pattern>
654 : XI<oops, iops, AddrMode4, 4, im, f, itin, asm, cstr, pattern> {
659 let Inst{27-25} = 0b100;
660 let Inst{22} = 0; // S bit
661 let Inst{19-16} = Rn;
662 let Inst{15-0} = regs;
665 // Unsigned multiply, multiply-accumulate instructions.
666 class AMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
667 string opc, string asm, list<dag> pattern>
668 : I<oops, iops, AddrModeNone, 4, IndexModeNone, MulFrm, itin,
669 opc, asm, "", pattern> {
670 let Inst{7-4} = 0b1001;
671 let Inst{20} = 0; // S bit
672 let Inst{27-21} = opcod;
674 class AsMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
675 string opc, string asm, list<dag> pattern>
676 : sI<oops, iops, AddrModeNone, 4, IndexModeNone, MulFrm, itin,
677 opc, asm, "", pattern> {
678 let Inst{7-4} = 0b1001;
679 let Inst{27-21} = opcod;
682 // Most significant word multiply
683 class AMul2I<bits<7> opcod, bits<4> opc7_4, dag oops, dag iops,
684 InstrItinClass itin, string opc, string asm, list<dag> pattern>
685 : I<oops, iops, AddrModeNone, 4, IndexModeNone, MulFrm, itin,
686 opc, asm, "", pattern> {
690 let Inst{7-4} = opc7_4;
692 let Inst{27-21} = opcod;
693 let Inst{19-16} = Rd;
697 // MSW multiple w/ Ra operand
698 class AMul2Ia<bits<7> opcod, bits<4> opc7_4, dag oops, dag iops,
699 InstrItinClass itin, string opc, string asm, list<dag> pattern>
700 : AMul2I<opcod, opc7_4, oops, iops, itin, opc, asm, pattern> {
702 let Inst{15-12} = Ra;
705 // SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
706 class AMulxyIbase<bits<7> opcod, bits<2> bit6_5, dag oops, dag iops,
707 InstrItinClass itin, string opc, string asm, list<dag> pattern>
708 : I<oops, iops, AddrModeNone, 4, IndexModeNone, MulFrm, itin,
709 opc, asm, "", pattern> {
715 let Inst{27-21} = opcod;
716 let Inst{6-5} = bit6_5;
720 class AMulxyI<bits<7> opcod, bits<2> bit6_5, dag oops, dag iops,
721 InstrItinClass itin, string opc, string asm, list<dag> pattern>
722 : AMulxyIbase<opcod, bit6_5, oops, iops, itin, opc, asm, pattern> {
724 let Inst{19-16} = Rd;
727 // AMulxyI with Ra operand
728 class AMulxyIa<bits<7> opcod, bits<2> bit6_5, dag oops, dag iops,
729 InstrItinClass itin, string opc, string asm, list<dag> pattern>
730 : AMulxyI<opcod, bit6_5, oops, iops, itin, opc, asm, pattern> {
732 let Inst{15-12} = Ra;
735 class AMulxyI64<bits<7> opcod, bits<2> bit6_5, dag oops, dag iops,
736 InstrItinClass itin, string opc, string asm, list<dag> pattern>
737 : AMulxyIbase<opcod, bit6_5, oops, iops, itin, opc, asm, pattern> {
740 let Inst{19-16} = RdHi;
741 let Inst{15-12} = RdLo;
744 // Extend instructions.
745 class AExtI<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
746 string opc, string asm, list<dag> pattern>
747 : I<oops, iops, AddrModeNone, 4, IndexModeNone, ExtFrm, itin,
748 opc, asm, "", pattern> {
749 // All AExtI instructions have Rd and Rm register operands.
752 let Inst{15-12} = Rd;
754 let Inst{7-4} = 0b0111;
755 let Inst{9-8} = 0b00;
756 let Inst{27-20} = opcod;
759 // Misc Arithmetic instructions.
760 class AMiscA1I<bits<8> opcod, bits<4> opc7_4, dag oops, dag iops,
761 InstrItinClass itin, string opc, string asm, list<dag> pattern>
762 : I<oops, iops, AddrModeNone, 4, IndexModeNone, ArithMiscFrm, itin,
763 opc, asm, "", pattern> {
766 let Inst{27-20} = opcod;
767 let Inst{19-16} = 0b1111;
768 let Inst{15-12} = Rd;
769 let Inst{11-8} = 0b1111;
770 let Inst{7-4} = opc7_4;
775 def PKHLSLAsmOperand : AsmOperandClass {
776 let Name = "PKHLSLImm";
777 let ParserMethod = "parsePKHLSLImm";
779 def pkh_lsl_amt: Operand<i32>, ImmLeaf<i32, [{ return Imm >= 0 && Imm < 32; }]>{
780 let PrintMethod = "printPKHLSLShiftImm";
781 let ParserMatchClass = PKHLSLAsmOperand;
783 def PKHASRAsmOperand : AsmOperandClass {
784 let Name = "PKHASRImm";
785 let ParserMethod = "parsePKHASRImm";
787 def pkh_asr_amt: Operand<i32>, ImmLeaf<i32, [{ return Imm > 0 && Imm <= 32; }]>{
788 let PrintMethod = "printPKHASRShiftImm";
789 let ParserMatchClass = PKHASRAsmOperand;
792 class APKHI<bits<8> opcod, bit tb, dag oops, dag iops, InstrItinClass itin,
793 string opc, string asm, list<dag> pattern>
794 : I<oops, iops, AddrModeNone, 4, IndexModeNone, ArithMiscFrm, itin,
795 opc, asm, "", pattern> {
800 let Inst{27-20} = opcod;
801 let Inst{19-16} = Rn;
802 let Inst{15-12} = Rd;
805 let Inst{5-4} = 0b01;
809 //===----------------------------------------------------------------------===//
811 // ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
812 class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
813 list<Predicate> Predicates = [IsARM];
815 class ARMV5TPat<dag pattern, dag result> : Pat<pattern, result> {
816 list<Predicate> Predicates = [IsARM, HasV5T];
818 class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
819 list<Predicate> Predicates = [IsARM, HasV5TE];
821 class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
822 list<Predicate> Predicates = [IsARM, HasV6];
825 //===----------------------------------------------------------------------===//
826 // Thumb Instruction Format Definitions.
829 class ThumbI<dag oops, dag iops, AddrMode am, int sz,
830 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
831 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
832 let OutOperandList = oops;
833 let InOperandList = iops;
835 let Pattern = pattern;
836 list<Predicate> Predicates = [IsThumb];
839 // TI - Thumb instruction.
840 class TI<dag oops, dag iops, InstrItinClass itin, string asm, list<dag> pattern>
841 : ThumbI<oops, iops, AddrModeNone, 2, itin, asm, "", pattern>;
843 // Two-address instructions
844 class TIt<dag oops, dag iops, InstrItinClass itin, string asm,
846 : ThumbI<oops, iops, AddrModeNone, 2, itin, asm, "$lhs = $dst",
849 // tBL, tBX 32-bit instructions
850 class TIx2<bits<5> opcod1, bits<2> opcod2, bit opcod3,
851 dag oops, dag iops, InstrItinClass itin, string asm,
853 : ThumbI<oops, iops, AddrModeNone, 4, itin, asm, "", pattern>,
855 let Inst{31-27} = opcod1;
856 let Inst{15-14} = opcod2;
857 let Inst{12} = opcod3;
860 // BR_JT instructions
861 class TJTI<dag oops, dag iops, InstrItinClass itin, string asm,
863 : ThumbI<oops, iops, AddrModeNone, 0, itin, asm, "", pattern>;
866 class Thumb1I<dag oops, dag iops, AddrMode am, int sz,
867 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
868 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
869 let OutOperandList = oops;
870 let InOperandList = iops;
872 let Pattern = pattern;
873 list<Predicate> Predicates = [IsThumb, IsThumb1Only];
876 class T1I<dag oops, dag iops, InstrItinClass itin,
877 string asm, list<dag> pattern>
878 : Thumb1I<oops, iops, AddrModeNone, 2, itin, asm, "", pattern>;
879 class T1Ix2<dag oops, dag iops, InstrItinClass itin,
880 string asm, list<dag> pattern>
881 : Thumb1I<oops, iops, AddrModeNone, 4, itin, asm, "", pattern>;
883 // Two-address instructions
884 class T1It<dag oops, dag iops, InstrItinClass itin,
885 string asm, string cstr, list<dag> pattern>
886 : Thumb1I<oops, iops, AddrModeNone, 2, itin,
889 // Thumb1 instruction that can either be predicated or set CPSR.
890 class Thumb1sI<dag oops, dag iops, AddrMode am, int sz,
892 string opc, string asm, string cstr, list<dag> pattern>
893 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
894 let OutOperandList = !con(oops, (outs s_cc_out:$s));
895 let InOperandList = !con(iops, (ins pred:$p));
896 let AsmString = !strconcat(opc, "${s}${p}", asm);
897 let Pattern = pattern;
898 list<Predicate> Predicates = [IsThumb, IsThumb1Only];
901 class T1sI<dag oops, dag iops, InstrItinClass itin,
902 string opc, string asm, list<dag> pattern>
903 : Thumb1sI<oops, iops, AddrModeNone, 2, itin, opc, asm, "", pattern>;
905 // Two-address instructions
906 class T1sIt<dag oops, dag iops, InstrItinClass itin,
907 string opc, string asm, list<dag> pattern>
908 : Thumb1sI<oops, iops, AddrModeNone, 2, itin, opc, asm,
909 "$Rn = $Rdn", pattern>;
911 // Thumb1 instruction that can be predicated.
912 class Thumb1pI<dag oops, dag iops, AddrMode am, int sz,
914 string opc, string asm, string cstr, list<dag> pattern>
915 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
916 let OutOperandList = oops;
917 let InOperandList = !con(iops, (ins pred:$p));
918 let AsmString = !strconcat(opc, "${p}", asm);
919 let Pattern = pattern;
920 list<Predicate> Predicates = [IsThumb, IsThumb1Only];
923 class T1pI<dag oops, dag iops, InstrItinClass itin,
924 string opc, string asm, list<dag> pattern>
925 : Thumb1pI<oops, iops, AddrModeNone, 2, itin, opc, asm, "", pattern>;
927 // Two-address instructions
928 class T1pIt<dag oops, dag iops, InstrItinClass itin,
929 string opc, string asm, list<dag> pattern>
930 : Thumb1pI<oops, iops, AddrModeNone, 2, itin, opc, asm,
931 "$Rn = $Rdn", pattern>;
933 class T1pIs<dag oops, dag iops,
934 InstrItinClass itin, string opc, string asm, list<dag> pattern>
935 : Thumb1pI<oops, iops, AddrModeT1_s, 2, itin, opc, asm, "", pattern>;
937 class Encoding16 : Encoding {
938 let Inst{31-16} = 0x0000;
941 // A6.2 16-bit Thumb instruction encoding
942 class T1Encoding<bits<6> opcode> : Encoding16 {
943 let Inst{15-10} = opcode;
946 // A6.2.1 Shift (immediate), add, subtract, move, and compare encoding.
947 class T1General<bits<5> opcode> : Encoding16 {
948 let Inst{15-14} = 0b00;
949 let Inst{13-9} = opcode;
952 // A6.2.2 Data-processing encoding.
953 class T1DataProcessing<bits<4> opcode> : Encoding16 {
954 let Inst{15-10} = 0b010000;
955 let Inst{9-6} = opcode;
958 // A6.2.3 Special data instructions and branch and exchange encoding.
959 class T1Special<bits<4> opcode> : Encoding16 {
960 let Inst{15-10} = 0b010001;
961 let Inst{9-6} = opcode;
964 // A6.2.4 Load/store single data item encoding.
965 class T1LoadStore<bits<4> opA, bits<3> opB> : Encoding16 {
966 let Inst{15-12} = opA;
967 let Inst{11-9} = opB;
969 class T1LdStSP<bits<3> opB> : T1LoadStore<0b1001, opB>; // SP relative
971 class T1BranchCond<bits<4> opcode> : Encoding16 {
972 let Inst{15-12} = opcode;
975 // Helper classes to encode Thumb1 loads and stores. For immediates, the
976 // following bits are used for "opA" (see A6.2.4):
978 // 0b0110 => Immediate, 4 bytes
979 // 0b1000 => Immediate, 2 bytes
980 // 0b0111 => Immediate, 1 byte
981 class T1pILdStEncode<bits<3> opcode, dag oops, dag iops, AddrMode am,
982 InstrItinClass itin, string opc, string asm,
984 : Thumb1pI<oops, iops, am, 2, itin, opc, asm, "", pattern>,
985 T1LoadStore<0b0101, opcode> {
988 let Inst{8-6} = addr{5-3}; // Rm
989 let Inst{5-3} = addr{2-0}; // Rn
992 class T1pILdStEncodeImm<bits<4> opA, bit opB, dag oops, dag iops, AddrMode am,
993 InstrItinClass itin, string opc, string asm,
995 : Thumb1pI<oops, iops, am, 2, itin, opc, asm, "", pattern>,
996 T1LoadStore<opA, {opB,?,?}> {
999 let Inst{10-6} = addr{7-3}; // imm5
1000 let Inst{5-3} = addr{2-0}; // Rn
1004 // A6.2.5 Miscellaneous 16-bit instructions encoding.
1005 class T1Misc<bits<7> opcode> : Encoding16 {
1006 let Inst{15-12} = 0b1011;
1007 let Inst{11-5} = opcode;
1010 // Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
1011 class Thumb2I<dag oops, dag iops, AddrMode am, int sz,
1012 InstrItinClass itin,
1013 string opc, string asm, string cstr, list<dag> pattern>
1014 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1015 let OutOperandList = oops;
1016 let InOperandList = !con(iops, (ins pred:$p));
1017 let AsmString = !strconcat(opc, "${p}", asm);
1018 let Pattern = pattern;
1019 list<Predicate> Predicates = [IsThumb2];
1020 let DecoderNamespace = "Thumb2";
1023 // Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as an
1024 // input operand since by default it's a zero register. It will become an
1025 // implicit def once it's "flipped".
1027 // FIXME: This uses unified syntax so {s} comes before {p}. We should make it
1029 class Thumb2sI<dag oops, dag iops, AddrMode am, int sz,
1030 InstrItinClass itin,
1031 string opc, string asm, string cstr, list<dag> pattern>
1032 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1033 bits<1> s; // condition-code set flag ('1' if the insn should set the flags)
1036 let OutOperandList = oops;
1037 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
1038 let AsmString = !strconcat(opc, "${s}${p}", asm);
1039 let Pattern = pattern;
1040 list<Predicate> Predicates = [IsThumb2];
1041 let DecoderNamespace = "Thumb2";
1045 class Thumb2XI<dag oops, dag iops, AddrMode am, int sz,
1046 InstrItinClass itin,
1047 string asm, string cstr, list<dag> pattern>
1048 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1049 let OutOperandList = oops;
1050 let InOperandList = iops;
1051 let AsmString = asm;
1052 let Pattern = pattern;
1053 list<Predicate> Predicates = [IsThumb2];
1054 let DecoderNamespace = "Thumb2";
1057 class ThumbXI<dag oops, dag iops, AddrMode am, int sz,
1058 InstrItinClass itin,
1059 string asm, string cstr, list<dag> pattern>
1060 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1061 let OutOperandList = oops;
1062 let InOperandList = iops;
1063 let AsmString = asm;
1064 let Pattern = pattern;
1065 list<Predicate> Predicates = [IsThumb, IsThumb1Only];
1066 let DecoderNamespace = "Thumb";
1069 class T2I<dag oops, dag iops, InstrItinClass itin,
1070 string opc, string asm, list<dag> pattern>
1071 : Thumb2I<oops, iops, AddrModeNone, 4, itin, opc, asm, "", pattern>;
1072 class T2Ii12<dag oops, dag iops, InstrItinClass itin,
1073 string opc, string asm, list<dag> pattern>
1074 : Thumb2I<oops, iops, AddrModeT2_i12, 4, itin, opc, asm, "",pattern>;
1075 class T2Ii8<dag oops, dag iops, InstrItinClass itin,
1076 string opc, string asm, list<dag> pattern>
1077 : Thumb2I<oops, iops, AddrModeT2_i8, 4, itin, opc, asm, "", pattern>;
1078 class T2Iso<dag oops, dag iops, InstrItinClass itin,
1079 string opc, string asm, list<dag> pattern>
1080 : Thumb2I<oops, iops, AddrModeT2_so, 4, itin, opc, asm, "", pattern>;
1081 class T2Ipc<dag oops, dag iops, InstrItinClass itin,
1082 string opc, string asm, list<dag> pattern>
1083 : Thumb2I<oops, iops, AddrModeT2_pc, 4, itin, opc, asm, "", pattern>;
1084 class T2Ii8s4<bit P, bit W, bit isLoad, dag oops, dag iops, InstrItinClass itin,
1085 string opc, string asm, list<dag> pattern>
1086 : Thumb2I<oops, iops, AddrModeT2_i8s4, 4, itin, opc, asm, "",
1091 let Inst{31-25} = 0b1110100;
1093 let Inst{23} = addr{8};
1096 let Inst{20} = isLoad;
1097 let Inst{19-16} = addr{12-9};
1098 let Inst{15-12} = Rt{3-0};
1099 let Inst{11-8} = Rt2{3-0};
1100 let Inst{7-0} = addr{7-0};
1103 class T2Ii8s4Tied<bit P, bit W, bit isLoad, dag oops, dag iops, InstrItinClass itin,
1104 string opc, string asm, list<dag> pattern>
1105 : Thumb2I<oops, iops, AddrModeT2_i8s4, 4, itin, opc, asm, "$base = $wb",
1111 let Inst{31-25} = 0b1110100;
1113 let Inst{23} = imm{8};
1116 let Inst{20} = isLoad;
1117 let Inst{19-16} = base{3-0};
1118 let Inst{15-12} = Rt{3-0};
1119 let Inst{11-8} = Rt2{3-0};
1120 let Inst{7-0} = imm{7-0};
1124 class T2sI<dag oops, dag iops, InstrItinClass itin,
1125 string opc, string asm, list<dag> pattern>
1126 : Thumb2sI<oops, iops, AddrModeNone, 4, itin, opc, asm, "", pattern>;
1128 class T2XI<dag oops, dag iops, InstrItinClass itin,
1129 string asm, list<dag> pattern>
1130 : Thumb2XI<oops, iops, AddrModeNone, 4, itin, asm, "", pattern>;
1131 class T2JTI<dag oops, dag iops, InstrItinClass itin,
1132 string asm, list<dag> pattern>
1133 : Thumb2XI<oops, iops, AddrModeNone, 0, itin, asm, "", pattern>;
1135 // Move to/from coprocessor instructions
1136 class T2Cop<bits<4> opc, dag oops, dag iops, string asm, list<dag> pattern>
1137 : T2XI <oops, iops, NoItinerary, asm, pattern>, Requires<[IsThumb2]> {
1138 let Inst{31-28} = opc;
1141 // Two-address instructions
1142 class T2XIt<dag oops, dag iops, InstrItinClass itin,
1143 string asm, string cstr, list<dag> pattern>
1144 : Thumb2XI<oops, iops, AddrModeNone, 4, itin, asm, cstr, pattern>;
1146 // T2Iidxldst - Thumb2 indexed load / store instructions.
1147 class T2Iidxldst<bit signed, bits<2> opcod, bit load, bit pre,
1149 AddrMode am, IndexMode im, InstrItinClass itin,
1150 string opc, string asm, string cstr, list<dag> pattern>
1151 : InstARM<am, 4, im, ThumbFrm, GenericDomain, cstr, itin> {
1152 let OutOperandList = oops;
1153 let InOperandList = !con(iops, (ins pred:$p));
1154 let AsmString = !strconcat(opc, "${p}", asm);
1155 let Pattern = pattern;
1156 list<Predicate> Predicates = [IsThumb2];
1157 let DecoderNamespace = "Thumb2";
1158 let Inst{31-27} = 0b11111;
1159 let Inst{26-25} = 0b00;
1160 let Inst{24} = signed;
1162 let Inst{22-21} = opcod;
1163 let Inst{20} = load;
1165 // (P, W) = (1, 1) Pre-indexed or (0, 1) Post-indexed
1166 let Inst{10} = pre; // The P bit.
1167 let Inst{8} = 1; // The W bit.
1170 let Inst{7-0} = addr{7-0};
1171 let Inst{9} = addr{8}; // Sign bit
1175 let Inst{15-12} = Rt{3-0};
1176 let Inst{19-16} = Rn{3-0};
1179 // Tv5Pat - Same as Pat<>, but requires V5T Thumb mode.
1180 class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
1181 list<Predicate> Predicates = [IsThumb, IsThumb1Only, HasV5T];
1184 // T1Pat - Same as Pat<>, but requires that the compiler be in Thumb1 mode.
1185 class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
1186 list<Predicate> Predicates = [IsThumb, IsThumb1Only];
1189 // T2v6Pat - Same as Pat<>, but requires V6T2 Thumb2 mode.
1190 class T2v6Pat<dag pattern, dag result> : Pat<pattern, result> {
1191 list<Predicate> Predicates = [IsThumb2, HasV6T2];
1194 // T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
1195 class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
1196 list<Predicate> Predicates = [IsThumb2];
1199 //===----------------------------------------------------------------------===//
1201 //===----------------------------------------------------------------------===//
1202 // ARM VFP Instruction templates.
1205 // Almost all VFP instructions are predicable.
1206 class VFPI<dag oops, dag iops, AddrMode am, int sz,
1207 IndexMode im, Format f, InstrItinClass itin,
1208 string opc, string asm, string cstr, list<dag> pattern>
1209 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
1211 let Inst{31-28} = p;
1212 let OutOperandList = oops;
1213 let InOperandList = !con(iops, (ins pred:$p));
1214 let AsmString = !strconcat(opc, "${p}", asm);
1215 let Pattern = pattern;
1216 let PostEncoderMethod = "VFPThumb2PostEncoder";
1217 let DecoderNamespace = "VFP";
1218 list<Predicate> Predicates = [HasVFP2];
1222 class VFPXI<dag oops, dag iops, AddrMode am, int sz,
1223 IndexMode im, Format f, InstrItinClass itin,
1224 string asm, string cstr, list<dag> pattern>
1225 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
1227 let Inst{31-28} = p;
1228 let OutOperandList = oops;
1229 let InOperandList = iops;
1230 let AsmString = asm;
1231 let Pattern = pattern;
1232 let PostEncoderMethod = "VFPThumb2PostEncoder";
1233 let DecoderNamespace = "VFP";
1234 list<Predicate> Predicates = [HasVFP2];
1237 class VFPAI<dag oops, dag iops, Format f, InstrItinClass itin,
1238 string opc, string asm, list<dag> pattern>
1239 : VFPI<oops, iops, AddrModeNone, 4, IndexModeNone, f, itin,
1240 opc, asm, "", pattern> {
1241 let PostEncoderMethod = "VFPThumb2PostEncoder";
1244 // ARM VFP addrmode5 loads and stores
1245 class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
1246 InstrItinClass itin,
1247 string opc, string asm, list<dag> pattern>
1248 : VFPI<oops, iops, AddrMode5, 4, IndexModeNone,
1249 VFPLdStFrm, itin, opc, asm, "", pattern> {
1250 // Instruction operands.
1254 // Encode instruction operands.
1255 let Inst{23} = addr{8}; // U (add = (U == '1'))
1256 let Inst{22} = Dd{4};
1257 let Inst{19-16} = addr{12-9}; // Rn
1258 let Inst{15-12} = Dd{3-0};
1259 let Inst{7-0} = addr{7-0}; // imm8
1261 // TODO: Mark the instructions with the appropriate subtarget info.
1262 let Inst{27-24} = opcod1;
1263 let Inst{21-20} = opcod2;
1264 let Inst{11-9} = 0b101;
1265 let Inst{8} = 1; // Double precision
1267 // Loads & stores operate on both NEON and VFP pipelines.
1268 let D = VFPNeonDomain;
1271 class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
1272 InstrItinClass itin,
1273 string opc, string asm, list<dag> pattern>
1274 : VFPI<oops, iops, AddrMode5, 4, IndexModeNone,
1275 VFPLdStFrm, itin, opc, asm, "", pattern> {
1276 // Instruction operands.
1280 // Encode instruction operands.
1281 let Inst{23} = addr{8}; // U (add = (U == '1'))
1282 let Inst{22} = Sd{0};
1283 let Inst{19-16} = addr{12-9}; // Rn
1284 let Inst{15-12} = Sd{4-1};
1285 let Inst{7-0} = addr{7-0}; // imm8
1287 // TODO: Mark the instructions with the appropriate subtarget info.
1288 let Inst{27-24} = opcod1;
1289 let Inst{21-20} = opcod2;
1290 let Inst{11-9} = 0b101;
1291 let Inst{8} = 0; // Single precision
1293 // Loads & stores operate on both NEON and VFP pipelines.
1294 let D = VFPNeonDomain;
1297 // VFP Load / store multiple pseudo instructions.
1298 class PseudoVFPLdStM<dag oops, dag iops, InstrItinClass itin, string cstr,
1300 : InstARM<AddrMode4, 4, IndexModeNone, Pseudo, VFPNeonDomain,
1302 let OutOperandList = oops;
1303 let InOperandList = !con(iops, (ins pred:$p));
1304 let Pattern = pattern;
1305 list<Predicate> Predicates = [HasVFP2];
1308 // Load / store multiple
1309 class AXDI4<dag oops, dag iops, IndexMode im, InstrItinClass itin,
1310 string asm, string cstr, list<dag> pattern>
1311 : VFPXI<oops, iops, AddrMode4, 4, im,
1312 VFPLdStMulFrm, itin, asm, cstr, pattern> {
1313 // Instruction operands.
1317 // Encode instruction operands.
1318 let Inst{19-16} = Rn;
1319 let Inst{22} = regs{12};
1320 let Inst{15-12} = regs{11-8};
1321 let Inst{7-0} = regs{7-0};
1323 // TODO: Mark the instructions with the appropriate subtarget info.
1324 let Inst{27-25} = 0b110;
1325 let Inst{11-9} = 0b101;
1326 let Inst{8} = 1; // Double precision
1329 class AXSI4<dag oops, dag iops, IndexMode im, InstrItinClass itin,
1330 string asm, string cstr, list<dag> pattern>
1331 : VFPXI<oops, iops, AddrMode4, 4, im,
1332 VFPLdStMulFrm, itin, asm, cstr, pattern> {
1333 // Instruction operands.
1337 // Encode instruction operands.
1338 let Inst{19-16} = Rn;
1339 let Inst{22} = regs{8};
1340 let Inst{15-12} = regs{12-9};
1341 let Inst{7-0} = regs{7-0};
1343 // TODO: Mark the instructions with the appropriate subtarget info.
1344 let Inst{27-25} = 0b110;
1345 let Inst{11-9} = 0b101;
1346 let Inst{8} = 0; // Single precision
1349 // Double precision, unary
1350 class ADuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1351 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1352 string asm, list<dag> pattern>
1353 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
1354 // Instruction operands.
1358 // Encode instruction operands.
1359 let Inst{3-0} = Dm{3-0};
1360 let Inst{5} = Dm{4};
1361 let Inst{15-12} = Dd{3-0};
1362 let Inst{22} = Dd{4};
1364 let Inst{27-23} = opcod1;
1365 let Inst{21-20} = opcod2;
1366 let Inst{19-16} = opcod3;
1367 let Inst{11-9} = 0b101;
1368 let Inst{8} = 1; // Double precision
1369 let Inst{7-6} = opcod4;
1370 let Inst{4} = opcod5;
1373 // Double precision, binary
1374 class ADbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
1375 dag iops, InstrItinClass itin, string opc, string asm,
1377 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
1378 // Instruction operands.
1383 // Encode instruction operands.
1384 let Inst{3-0} = Dm{3-0};
1385 let Inst{5} = Dm{4};
1386 let Inst{19-16} = Dn{3-0};
1387 let Inst{7} = Dn{4};
1388 let Inst{15-12} = Dd{3-0};
1389 let Inst{22} = Dd{4};
1391 let Inst{27-23} = opcod1;
1392 let Inst{21-20} = opcod2;
1393 let Inst{11-9} = 0b101;
1394 let Inst{8} = 1; // Double precision
1399 // Single precision, unary
1400 class ASuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1401 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1402 string asm, list<dag> pattern>
1403 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
1404 // Instruction operands.
1408 // Encode instruction operands.
1409 let Inst{3-0} = Sm{4-1};
1410 let Inst{5} = Sm{0};
1411 let Inst{15-12} = Sd{4-1};
1412 let Inst{22} = Sd{0};
1414 let Inst{27-23} = opcod1;
1415 let Inst{21-20} = opcod2;
1416 let Inst{19-16} = opcod3;
1417 let Inst{11-9} = 0b101;
1418 let Inst{8} = 0; // Single precision
1419 let Inst{7-6} = opcod4;
1420 let Inst{4} = opcod5;
1423 // Single precision unary, if no NEON. Same as ASuI except not available if
1425 class ASuIn<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1426 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1427 string asm, list<dag> pattern>
1428 : ASuI<opcod1, opcod2, opcod3, opcod4, opcod5, oops, iops, itin, opc, asm,
1430 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1433 // Single precision, binary
1434 class ASbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops, dag iops,
1435 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1436 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
1437 // Instruction operands.
1442 // Encode instruction operands.
1443 let Inst{3-0} = Sm{4-1};
1444 let Inst{5} = Sm{0};
1445 let Inst{19-16} = Sn{4-1};
1446 let Inst{7} = Sn{0};
1447 let Inst{15-12} = Sd{4-1};
1448 let Inst{22} = Sd{0};
1450 let Inst{27-23} = opcod1;
1451 let Inst{21-20} = opcod2;
1452 let Inst{11-9} = 0b101;
1453 let Inst{8} = 0; // Single precision
1458 // Single precision binary, if no NEON. Same as ASbI except not available if
1460 class ASbIn<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
1461 dag iops, InstrItinClass itin, string opc, string asm,
1463 : ASbI<opcod1, opcod2, op6, op4, oops, iops, itin, opc, asm, pattern> {
1464 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1466 // Instruction operands.
1471 // Encode instruction operands.
1472 let Inst{3-0} = Sm{4-1};
1473 let Inst{5} = Sm{0};
1474 let Inst{19-16} = Sn{4-1};
1475 let Inst{7} = Sn{0};
1476 let Inst{15-12} = Sd{4-1};
1477 let Inst{22} = Sd{0};
1480 // VFP conversion instructions
1481 class AVConv1I<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
1482 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1484 : VFPAI<oops, iops, VFPConv1Frm, itin, opc, asm, pattern> {
1485 let Inst{27-23} = opcod1;
1486 let Inst{21-20} = opcod2;
1487 let Inst{19-16} = opcod3;
1488 let Inst{11-8} = opcod4;
1493 // VFP conversion between floating-point and fixed-point
1494 class AVConv1XI<bits<5> op1, bits<2> op2, bits<4> op3, bits<4> op4, bit op5,
1495 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1497 : AVConv1I<op1, op2, op3, op4, oops, iops, itin, opc, asm, pattern> {
1498 // size (fixed-point number): sx == 0 ? 16 : 32
1499 let Inst{7} = op5; // sx
1502 // VFP conversion instructions, if no NEON
1503 class AVConv1In<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
1504 dag oops, dag iops, InstrItinClass itin,
1505 string opc, string asm, list<dag> pattern>
1506 : AVConv1I<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
1508 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1511 class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
1512 InstrItinClass itin,
1513 string opc, string asm, list<dag> pattern>
1514 : VFPAI<oops, iops, f, itin, opc, asm, pattern> {
1515 let Inst{27-20} = opcod1;
1516 let Inst{11-8} = opcod2;
1520 class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1521 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1522 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, itin, opc, asm, pattern>;
1524 class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1525 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1526 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, itin, opc, asm, pattern>;
1528 class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1529 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1530 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, itin, opc, asm, pattern>;
1532 class AVConv5I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1533 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1534 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv5Frm, itin, opc, asm, pattern>;
1536 //===----------------------------------------------------------------------===//
1538 //===----------------------------------------------------------------------===//
1539 // ARM NEON Instruction templates.
1542 class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1543 InstrItinClass itin, string opc, string dt, string asm, string cstr,
1545 : InstARM<am, 4, im, f, NeonDomain, cstr, itin> {
1546 let OutOperandList = oops;
1547 let InOperandList = !con(iops, (ins pred:$p));
1548 let AsmString = !strconcat(opc, "${p}", ".", dt, "\t", asm);
1549 let Pattern = pattern;
1550 list<Predicate> Predicates = [HasNEON];
1551 let DecoderNamespace = "NEON";
1554 // Same as NeonI except it does not have a "data type" specifier.
1555 class NeonXI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1556 InstrItinClass itin, string opc, string asm, string cstr,
1558 : InstARM<am, 4, im, f, NeonDomain, cstr, itin> {
1559 let OutOperandList = oops;
1560 let InOperandList = !con(iops, (ins pred:$p));
1561 let AsmString = !strconcat(opc, "${p}", "\t", asm);
1562 let Pattern = pattern;
1563 list<Predicate> Predicates = [HasNEON];
1564 let DecoderNamespace = "NEON";
1567 class NLdSt<bit op23, bits<2> op21_20, bits<4> op11_8, bits<4> op7_4,
1568 dag oops, dag iops, InstrItinClass itin,
1569 string opc, string dt, string asm, string cstr, list<dag> pattern>
1570 : NeonI<oops, iops, AddrMode6, IndexModeNone, NLdStFrm, itin, opc, dt, asm,
1572 let Inst{31-24} = 0b11110100;
1573 let Inst{23} = op23;
1574 let Inst{21-20} = op21_20;
1575 let Inst{11-8} = op11_8;
1576 let Inst{7-4} = op7_4;
1578 let PostEncoderMethod = "NEONThumb2LoadStorePostEncoder";
1579 let DecoderNamespace = "NEONLoadStore";
1585 let Inst{22} = Vd{4};
1586 let Inst{15-12} = Vd{3-0};
1587 let Inst{19-16} = Rn{3-0};
1588 let Inst{3-0} = Rm{3-0};
1591 class NLdStLn<bit op23, bits<2> op21_20, bits<4> op11_8, bits<4> op7_4,
1592 dag oops, dag iops, InstrItinClass itin,
1593 string opc, string dt, string asm, string cstr, list<dag> pattern>
1594 : NLdSt<op23, op21_20, op11_8, op7_4, oops, iops, itin, opc,
1595 dt, asm, cstr, pattern> {
1599 class PseudoNLdSt<dag oops, dag iops, InstrItinClass itin, string cstr>
1600 : InstARM<AddrMode6, 4, IndexModeNone, Pseudo, NeonDomain, cstr,
1602 let OutOperandList = oops;
1603 let InOperandList = !con(iops, (ins pred:$p));
1604 list<Predicate> Predicates = [HasNEON];
1607 class PseudoNeonI<dag oops, dag iops, InstrItinClass itin, string cstr,
1609 : InstARM<AddrModeNone, 4, IndexModeNone, Pseudo, NeonDomain, cstr,
1611 let OutOperandList = oops;
1612 let InOperandList = !con(iops, (ins pred:$p));
1613 let Pattern = pattern;
1614 list<Predicate> Predicates = [HasNEON];
1617 class NDataI<dag oops, dag iops, Format f, InstrItinClass itin,
1618 string opc, string dt, string asm, string cstr, list<dag> pattern>
1619 : NeonI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, dt, asm, cstr,
1621 let Inst{31-25} = 0b1111001;
1622 let PostEncoderMethod = "NEONThumb2DataIPostEncoder";
1623 let DecoderNamespace = "NEONData";
1626 class NDataXI<dag oops, dag iops, Format f, InstrItinClass itin,
1627 string opc, string asm, string cstr, list<dag> pattern>
1628 : NeonXI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, asm,
1630 let Inst{31-25} = 0b1111001;
1631 let PostEncoderMethod = "NEONThumb2DataIPostEncoder";
1632 let DecoderNamespace = "NEONData";
1635 // NEON "one register and a modified immediate" format.
1636 class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1638 dag oops, dag iops, InstrItinClass itin,
1639 string opc, string dt, string asm, string cstr,
1641 : NDataI<oops, iops, N1RegModImmFrm, itin, opc, dt, asm, cstr, pattern> {
1642 let Inst{23} = op23;
1643 let Inst{21-19} = op21_19;
1644 let Inst{11-8} = op11_8;
1650 // Instruction operands.
1654 let Inst{15-12} = Vd{3-0};
1655 let Inst{22} = Vd{4};
1656 let Inst{24} = SIMM{7};
1657 let Inst{18-16} = SIMM{6-4};
1658 let Inst{3-0} = SIMM{3-0};
1659 let DecoderMethod = "DecodeNEONModImmInstruction";
1662 // NEON 2 vector register format.
1663 class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1664 bits<5> op11_7, bit op6, bit op4,
1665 dag oops, dag iops, InstrItinClass itin,
1666 string opc, string dt, string asm, string cstr, list<dag> pattern>
1667 : NDataI<oops, iops, N2RegFrm, itin, opc, dt, asm, cstr, pattern> {
1668 let Inst{24-23} = op24_23;
1669 let Inst{21-20} = op21_20;
1670 let Inst{19-18} = op19_18;
1671 let Inst{17-16} = op17_16;
1672 let Inst{11-7} = op11_7;
1676 // Instruction operands.
1680 let Inst{15-12} = Vd{3-0};
1681 let Inst{22} = Vd{4};
1682 let Inst{3-0} = Vm{3-0};
1683 let Inst{5} = Vm{4};
1686 // Same as N2V except it doesn't have a datatype suffix.
1687 class N2VX<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1688 bits<5> op11_7, bit op6, bit op4,
1689 dag oops, dag iops, InstrItinClass itin,
1690 string opc, string asm, string cstr, list<dag> pattern>
1691 : NDataXI<oops, iops, N2RegFrm, itin, opc, asm, cstr, pattern> {
1692 let Inst{24-23} = op24_23;
1693 let Inst{21-20} = op21_20;
1694 let Inst{19-18} = op19_18;
1695 let Inst{17-16} = op17_16;
1696 let Inst{11-7} = op11_7;
1700 // Instruction operands.
1704 let Inst{15-12} = Vd{3-0};
1705 let Inst{22} = Vd{4};
1706 let Inst{3-0} = Vm{3-0};
1707 let Inst{5} = Vm{4};
1710 // NEON 2 vector register with immediate.
1711 class N2VImm<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
1712 dag oops, dag iops, Format f, InstrItinClass itin,
1713 string opc, string dt, string asm, string cstr, list<dag> pattern>
1714 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
1715 let Inst{24} = op24;
1716 let Inst{23} = op23;
1717 let Inst{11-8} = op11_8;
1722 // Instruction operands.
1727 let Inst{15-12} = Vd{3-0};
1728 let Inst{22} = Vd{4};
1729 let Inst{3-0} = Vm{3-0};
1730 let Inst{5} = Vm{4};
1731 let Inst{21-16} = SIMM{5-0};
1734 // NEON 3 vector register format.
1736 class N3VCommon<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
1737 bit op4, dag oops, dag iops, Format f, InstrItinClass itin,
1738 string opc, string dt, string asm, string cstr,
1740 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
1741 let Inst{24} = op24;
1742 let Inst{23} = op23;
1743 let Inst{21-20} = op21_20;
1744 let Inst{11-8} = op11_8;
1749 class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
1750 dag oops, dag iops, Format f, InstrItinClass itin,
1751 string opc, string dt, string asm, string cstr, list<dag> pattern>
1752 : N3VCommon<op24, op23, op21_20, op11_8, op6, op4,
1753 oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
1755 // Instruction operands.
1760 let Inst{15-12} = Vd{3-0};
1761 let Inst{22} = Vd{4};
1762 let Inst{19-16} = Vn{3-0};
1763 let Inst{7} = Vn{4};
1764 let Inst{3-0} = Vm{3-0};
1765 let Inst{5} = Vm{4};
1768 class N3VLane32<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
1769 bit op4, dag oops, dag iops, Format f, InstrItinClass itin,
1770 string opc, string dt, string asm, string cstr,
1772 : N3VCommon<op24, op23, op21_20, op11_8, op6, op4,
1773 oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
1775 // Instruction operands.
1781 let Inst{15-12} = Vd{3-0};
1782 let Inst{22} = Vd{4};
1783 let Inst{19-16} = Vn{3-0};
1784 let Inst{7} = Vn{4};
1785 let Inst{3-0} = Vm{3-0};
1789 class N3VLane16<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
1790 bit op4, dag oops, dag iops, Format f, InstrItinClass itin,
1791 string opc, string dt, string asm, string cstr,
1793 : N3VCommon<op24, op23, op21_20, op11_8, op6, op4,
1794 oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
1796 // Instruction operands.
1802 let Inst{15-12} = Vd{3-0};
1803 let Inst{22} = Vd{4};
1804 let Inst{19-16} = Vn{3-0};
1805 let Inst{7} = Vn{4};
1806 let Inst{2-0} = Vm{2-0};
1807 let Inst{5} = lane{1};
1808 let Inst{3} = lane{0};
1811 // Same as N3V except it doesn't have a data type suffix.
1812 class N3VX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
1814 dag oops, dag iops, Format f, InstrItinClass itin,
1815 string opc, string asm, string cstr, list<dag> pattern>
1816 : NDataXI<oops, iops, f, itin, opc, asm, cstr, pattern> {
1817 let Inst{24} = op24;
1818 let Inst{23} = op23;
1819 let Inst{21-20} = op21_20;
1820 let Inst{11-8} = op11_8;
1824 // Instruction operands.
1829 let Inst{15-12} = Vd{3-0};
1830 let Inst{22} = Vd{4};
1831 let Inst{19-16} = Vn{3-0};
1832 let Inst{7} = Vn{4};
1833 let Inst{3-0} = Vm{3-0};
1834 let Inst{5} = Vm{4};
1837 // NEON VMOVs between scalar and core registers.
1838 class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1839 dag oops, dag iops, Format f, InstrItinClass itin,
1840 string opc, string dt, string asm, list<dag> pattern>
1841 : InstARM<AddrModeNone, 4, IndexModeNone, f, NeonDomain,
1843 let Inst{27-20} = opcod1;
1844 let Inst{11-8} = opcod2;
1845 let Inst{6-5} = opcod3;
1847 // A8.6.303, A8.6.328, A8.6.329
1848 let Inst{3-0} = 0b0000;
1850 let OutOperandList = oops;
1851 let InOperandList = !con(iops, (ins pred:$p));
1852 let AsmString = !strconcat(opc, "${p}", ".", dt, "\t", asm);
1853 let Pattern = pattern;
1854 list<Predicate> Predicates = [HasNEON];
1856 let PostEncoderMethod = "NEONThumb2DupPostEncoder";
1857 let DecoderNamespace = "NEONDup";
1864 let Inst{31-28} = p{3-0};
1866 let Inst{19-16} = V{3-0};
1867 let Inst{15-12} = R{3-0};
1869 class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1870 dag oops, dag iops, InstrItinClass itin,
1871 string opc, string dt, string asm, list<dag> pattern>
1872 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NGetLnFrm, itin,
1873 opc, dt, asm, pattern>;
1874 class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1875 dag oops, dag iops, InstrItinClass itin,
1876 string opc, string dt, string asm, list<dag> pattern>
1877 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NSetLnFrm, itin,
1878 opc, dt, asm, pattern>;
1879 class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1880 dag oops, dag iops, InstrItinClass itin,
1881 string opc, string dt, string asm, list<dag> pattern>
1882 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NDupFrm, itin,
1883 opc, dt, asm, pattern>;
1885 // Vector Duplicate Lane (from scalar to all elements)
1886 class NVDupLane<bits<4> op19_16, bit op6, dag oops, dag iops,
1887 InstrItinClass itin, string opc, string dt, string asm,
1889 : NDataI<oops, iops, NVDupLnFrm, itin, opc, dt, asm, "", pattern> {
1890 let Inst{24-23} = 0b11;
1891 let Inst{21-20} = 0b11;
1892 let Inst{19-16} = op19_16;
1893 let Inst{11-7} = 0b11000;
1901 let Inst{22} = Vd{4};
1902 let Inst{15-12} = Vd{3-0};
1903 let Inst{5} = Vm{4};
1904 let Inst{3-0} = Vm{3-0};
1907 // NEONFPPat - Same as Pat<>, but requires that the compiler be using NEON
1908 // for single-precision FP.
1909 class NEONFPPat<dag pattern, dag result> : Pat<pattern, result> {
1910 list<Predicate> Predicates = [HasNEON,UseNEONForFP];