blob: 08ac36375cd0eacc557fdc7a0448192b9f0d6079 [file] [log] [blame]
Evan Cheng37f25d92008-08-28 23:39:26 +00001//===- ARMInstrFormats.td - ARM Instruction Formats --*- tablegen -*---------=//
Bob Wilson01135592010-03-23 17:23:59 +00002//
Evan Cheng37f25d92008-08-28 23:39:26 +00003// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Bob Wilson01135592010-03-23 17:23:59 +00007//
Evan Cheng37f25d92008-08-28 23:39:26 +00008//===----------------------------------------------------------------------===//
9
10//===----------------------------------------------------------------------===//
11//
12// ARM Instruction Format Definitions.
13//
14
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
17// code emitter.
Bob Wilson89ef7b72010-03-17 21:13:43 +000018class Format<bits<6> val> {
19 bits<6> Value = val;
Evan Cheng37f25d92008-08-28 23:39:26 +000020}
21
Evan Chengffa6d962008-11-13 23:36:57 +000022def Pseudo : Format<0>;
23def MulFrm : Format<1>;
24def BrFrm : Format<2>;
25def BrMiscFrm : Format<3>;
Evan Cheng37f25d92008-08-28 23:39:26 +000026
Evan Chengffa6d962008-11-13 23:36:57 +000027def DPFrm : Format<4>;
28def DPSoRegFrm : Format<5>;
Evan Cheng37f25d92008-08-28 23:39:26 +000029
Evan Chengffa6d962008-11-13 23:36:57 +000030def LdFrm : Format<6>;
31def StFrm : Format<7>;
32def LdMiscFrm : Format<8>;
33def StMiscFrm : Format<9>;
34def LdStMulFrm : Format<10>;
Evan Cheng37f25d92008-08-28 23:39:26 +000035
Johnny Chen81f04d52010-03-19 17:39:00 +000036def LdStExFrm : Format<11>;
Jim Grosbach5278eb82009-12-11 01:42:04 +000037
Johnny Chen81f04d52010-03-19 17:39:00 +000038def ArithMiscFrm : Format<12>;
39def ExtFrm : Format<13>;
Evan Chengcd8e66a2008-11-11 21:48:44 +000040
Johnny Chen81f04d52010-03-19 17:39:00 +000041def VFPUnaryFrm : Format<14>;
42def VFPBinaryFrm : Format<15>;
43def VFPConv1Frm : Format<16>;
44def VFPConv2Frm : Format<17>;
45def VFPConv3Frm : Format<18>;
46def VFPConv4Frm : Format<19>;
47def VFPConv5Frm : Format<20>;
48def VFPLdStFrm : Format<21>;
49def VFPLdStMulFrm : Format<22>;
50def VFPMiscFrm : Format<23>;
Evan Chengcd8e66a2008-11-11 21:48:44 +000051
Johnny Chen81f04d52010-03-19 17:39:00 +000052def ThumbFrm : Format<24>;
Evan Cheng37f25d92008-08-28 23:39:26 +000053
Johnny Chen81f04d52010-03-19 17:39:00 +000054def NEONFrm : Format<25>;
55def NEONGetLnFrm : Format<26>;
56def NEONSetLnFrm : Format<27>;
57def NEONDupFrm : Format<28>;
Bob Wilson5bafff32009-06-22 23:27:02 +000058
Johnny Chenf4d81052010-02-12 22:53:19 +000059def MiscFrm : Format<29>;
60def ThumbMiscFrm : Format<30>;
61
Johnny Chenfa80bec2010-03-25 20:39:04 +000062def NLdStFrm : Format<31>;
63def N1RegModImmFrm : Format<32>;
64def N2RegFrm : Format<33>;
65def NVCVTFrm : Format<34>;
Johnny Chen2d2898e2010-03-25 21:49:12 +000066def NVDupLnFrm : Format<35>;
Johnny Chen0a3dc102010-03-26 01:07:59 +000067def N2RegVShLFrm : Format<36>;
68def N2RegVShRFrm : Format<37>;
Johnny Chen575c91c2010-03-26 18:32:20 +000069def N3RegFrm : Format<38>;
Johnny Chenc6e704d2010-03-26 21:26:28 +000070def N3RegVShFrm : Format<39>;
Johnny Chen629c25c2010-03-26 22:28:56 +000071def NVExtFrm : Format<40>;
Johnny Chencaa608e2010-03-20 00:17:00 +000072
Evan Cheng34a0fa32009-07-08 01:46:35 +000073// Misc flags.
74
Evan Chengedda31c2008-11-05 18:35:52 +000075// the instruction has a Rn register operand.
Evan Cheng34a0fa32009-07-08 01:46:35 +000076// UnaryDP - Indicates this is a unary data processing instruction, i.e.
77// it doesn't have a Rn operand.
78class UnaryDP { bit isUnaryDataProc = 1; }
79
80// Xform16Bit - Indicates this Thumb2 instruction may be transformed into
81// a 16-bit Thumb instruction if certain conditions are met.
82class Xform16Bit { bit canXformTo16Bit = 1; }
Evan Cheng37f25d92008-08-28 23:39:26 +000083
Evan Cheng37f25d92008-08-28 23:39:26 +000084//===----------------------------------------------------------------------===//
Bob Wilson50622ce2010-03-18 23:57:57 +000085// ARM Instruction flags. These need to match ARMBaseInstrInfo.h.
Evan Cheng055b0312009-06-29 07:51:04 +000086//
87
88// Addressing mode.
89class AddrMode<bits<4> val> {
90 bits<4> Value = val;
91}
92def AddrModeNone : AddrMode<0>;
93def AddrMode1 : AddrMode<1>;
94def AddrMode2 : AddrMode<2>;
95def AddrMode3 : AddrMode<3>;
96def AddrMode4 : AddrMode<4>;
97def AddrMode5 : AddrMode<5>;
Bob Wilson8b024a52009-07-01 23:16:05 +000098def AddrMode6 : AddrMode<6>;
99def AddrModeT1_1 : AddrMode<7>;
100def AddrModeT1_2 : AddrMode<8>;
101def AddrModeT1_4 : AddrMode<9>;
102def AddrModeT1_s : AddrMode<10>;
David Goodwine1e52ed2009-07-22 22:24:31 +0000103def AddrModeT2_i12: AddrMode<11>;
Bob Wilson8b024a52009-07-01 23:16:05 +0000104def AddrModeT2_i8 : AddrMode<12>;
105def AddrModeT2_so : AddrMode<13>;
106def AddrModeT2_pc : AddrMode<14>;
107def AddrModeT2_i8s4 : AddrMode<15>;
Evan Cheng055b0312009-06-29 07:51:04 +0000108
109// Instruction size.
110class SizeFlagVal<bits<3> val> {
111 bits<3> Value = val;
112}
113def SizeInvalid : SizeFlagVal<0>; // Unset.
114def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
115def Size8Bytes : SizeFlagVal<2>;
116def Size4Bytes : SizeFlagVal<3>;
117def Size2Bytes : SizeFlagVal<4>;
118
119// Load / store index mode.
120class IndexMode<bits<2> val> {
121 bits<2> Value = val;
122}
123def IndexModeNone : IndexMode<0>;
124def IndexModePre : IndexMode<1>;
125def IndexModePost : IndexMode<2>;
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000126def IndexModeUpd : IndexMode<3>;
Evan Cheng055b0312009-06-29 07:51:04 +0000127
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000128// Instruction execution domain.
129class Domain<bits<2> val> {
130 bits<2> Value = val;
131}
132def GenericDomain : Domain<0>;
133def VFPDomain : Domain<1>; // Instructions in VFP domain only
134def NeonDomain : Domain<2>; // Instructions in Neon domain only
135def VFPNeonDomain : Domain<3>; // Instructions in both VFP & Neon domains
136
Evan Cheng055b0312009-06-29 07:51:04 +0000137//===----------------------------------------------------------------------===//
Evan Cheng37f25d92008-08-28 23:39:26 +0000138
Evan Cheng446c4282009-07-11 06:43:01 +0000139// ARM special operands.
140//
141
142// ARM Predicate operand. Default to 14 = always (AL). Second part is CC
143// register whose default is 0 (no register).
144def pred : PredicateOperand<OtherVT, (ops i32imm, CCR),
145 (ops (i32 14), (i32 zero_reg))> {
146 let PrintMethod = "printPredicateOperand";
147}
148
149// Conditional code result for instructions whose 's' bit is set, e.g. subs.
150def cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 zero_reg))> {
151 let PrintMethod = "printSBitModifierOperand";
152}
153
154// Same as cc_out except it defaults to setting CPSR.
155def s_cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 CPSR))> {
156 let PrintMethod = "printSBitModifierOperand";
157}
158
Johnny Chendd0f3cf2010-03-10 18:59:38 +0000159// ARM special operands for disassembly only.
160//
161
162def cps_opt : Operand<i32> {
163 let PrintMethod = "printCPSOptionOperand";
164}
165
166def msr_mask : Operand<i32> {
167 let PrintMethod = "printMSRMaskOperand";
168}
169
170// A8.6.117, A8.6.118. Different instructions are generated for #0 and #-0.
171// The neg_zero operand translates -0 to -1, -1 to -2, ..., etc.
172def neg_zero : Operand<i32> {
173 let PrintMethod = "printNegZeroOperand";
174}
175
Evan Cheng446c4282009-07-11 06:43:01 +0000176//===----------------------------------------------------------------------===//
177
Evan Cheng37f25d92008-08-28 23:39:26 +0000178// ARM Instruction templates.
179//
180
Johnny Chend68e1192009-12-15 17:24:14 +0000181class InstTemplate<AddrMode am, SizeFlagVal sz, IndexMode im,
182 Format f, Domain d, string cstr, InstrItinClass itin>
Evan Cheng37f25d92008-08-28 23:39:26 +0000183 : Instruction {
184 let Namespace = "ARM";
185
Evan Chengedda31c2008-11-05 18:35:52 +0000186 // TSFlagsFields
Evan Cheng37f25d92008-08-28 23:39:26 +0000187 AddrMode AM = am;
188 bits<4> AddrModeBits = AM.Value;
Bob Wilson01135592010-03-23 17:23:59 +0000189
Evan Cheng37f25d92008-08-28 23:39:26 +0000190 SizeFlagVal SZ = sz;
191 bits<3> SizeFlag = SZ.Value;
192
193 IndexMode IM = im;
194 bits<2> IndexModeBits = IM.Value;
Bob Wilson01135592010-03-23 17:23:59 +0000195
Evan Cheng37f25d92008-08-28 23:39:26 +0000196 Format F = f;
Bob Wilson89ef7b72010-03-17 21:13:43 +0000197 bits<6> Form = F.Value;
Evan Chengedda31c2008-11-05 18:35:52 +0000198
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000199 Domain D = d;
200 bits<2> Dom = D.Value;
201
Evan Chengedda31c2008-11-05 18:35:52 +0000202 //
203 // Attributes specific to ARM instructions...
204 //
205 bit isUnaryDataProc = 0;
Evan Cheng34a0fa32009-07-08 01:46:35 +0000206 bit canXformTo16Bit = 0;
Bob Wilson01135592010-03-23 17:23:59 +0000207
Evan Cheng37f25d92008-08-28 23:39:26 +0000208 let Constraints = cstr;
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000209 let Itinerary = itin;
Evan Cheng37f25d92008-08-28 23:39:26 +0000210}
211
Johnny Chend68e1192009-12-15 17:24:14 +0000212class Encoding {
213 field bits<32> Inst;
214}
215
216class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
217 Format f, Domain d, string cstr, InstrItinClass itin>
218 : InstTemplate<am, sz, im, f, d, cstr, itin>, Encoding;
219
220// This Encoding-less class is used by Thumb1 to specify the encoding bits later
221// on by adding flavors to specific instructions.
222class InstThumb<AddrMode am, SizeFlagVal sz, IndexMode im,
223 Format f, Domain d, string cstr, InstrItinClass itin>
224 : InstTemplate<am, sz, im, f, d, cstr, itin>;
225
Bob Wilson01135592010-03-23 17:23:59 +0000226class PseudoInst<dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000227 string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +0000228 : InstARM<AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, GenericDomain,
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000229 "", itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000230 let OutOperandList = oops;
231 let InOperandList = iops;
232 let AsmString = asm;
233 let Pattern = pattern;
234}
235
236// Almost all ARM instructions are predicable.
Evan Chengd87293c2008-11-06 08:47:38 +0000237class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000238 IndexMode im, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000239 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000240 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000241 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000242 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000243 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng37f25d92008-08-28 23:39:26 +0000244 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
245 let Pattern = pattern;
246 list<Predicate> Predicates = [IsARM];
247}
Jim Grosbachf6b28622009-12-14 18:31:20 +0000248// A few are not predicable
249class InoP<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000250 IndexMode im, Format f, InstrItinClass itin,
251 string opc, string asm, string cstr,
252 list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000253 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
254 let OutOperandList = oops;
255 let InOperandList = iops;
256 let AsmString = !strconcat(opc, asm);
257 let Pattern = pattern;
258 let isPredicable = 0;
259 list<Predicate> Predicates = [IsARM];
260}
Evan Cheng37f25d92008-08-28 23:39:26 +0000261
262// Same as I except it can optionally modify CPSR. Note it's modeled as
263// an input operand since by default it's a zero register. It will
264// become an implicit def once it's "flipped".
Evan Chengd87293c2008-11-06 08:47:38 +0000265class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000266 IndexMode im, Format f, InstrItinClass itin,
267 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000268 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000269 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000270 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000271 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Evan Cheng37f25d92008-08-28 23:39:26 +0000272 let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm));
273 let Pattern = pattern;
274 list<Predicate> Predicates = [IsARM];
275}
276
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000277// Special cases
Evan Chengd87293c2008-11-06 08:47:38 +0000278class XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000279 IndexMode im, Format f, InstrItinClass itin,
280 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000281 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000282 let OutOperandList = oops;
283 let InOperandList = iops;
284 let AsmString = asm;
285 let Pattern = pattern;
286 list<Predicate> Predicates = [IsARM];
287}
288
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000289class AI<dag oops, dag iops, Format f, InstrItinClass itin,
290 string opc, string asm, list<dag> pattern>
291 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
292 opc, asm, "", pattern>;
293class AsI<dag oops, dag iops, Format f, InstrItinClass itin,
294 string opc, string asm, list<dag> pattern>
295 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
296 opc, asm, "", pattern>;
297class AXI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000298 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000299 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng97f48c32008-11-06 22:15:19 +0000300 asm, "", pattern>;
Jim Grosbachf6b28622009-12-14 18:31:20 +0000301class AInoP<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +0000302 string opc, string asm, list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000303 : InoP<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Bob Wilson01135592010-03-23 17:23:59 +0000304 opc, asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000305
306// Ctrl flow instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000307class ABI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
308 string opc, string asm, list<dag> pattern>
309 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
310 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000311 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000312}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000313class ABXI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
314 string asm, list<dag> pattern>
315 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
316 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000317 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000318}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000319class ABXIx2<dag oops, dag iops, InstrItinClass itin,
320 string asm, list<dag> pattern>
321 : XI<oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, BrMiscFrm, itin,
322 asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000323
324// BR_JT instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000325class JTI<dag oops, dag iops, InstrItinClass itin,
326 string asm, list<dag> pattern>
327 : XI<oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BrMiscFrm, itin,
Evan Cheng4df60f52008-11-07 09:06:08 +0000328 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000329
Jim Grosbach5278eb82009-12-11 01:42:04 +0000330
331// Atomic load/store instructions
332
333class AIldrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
334 string opc, string asm, list<dag> pattern>
335 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
336 opc, asm, "", pattern> {
337 let Inst{27-23} = 0b00011;
338 let Inst{22-21} = opcod;
339 let Inst{20} = 1;
340 let Inst{11-0} = 0b111110011111;
341}
342class AIstrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
343 string opc, string asm, list<dag> pattern>
344 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
345 opc, asm, "", pattern> {
346 let Inst{27-23} = 0b00011;
347 let Inst{22-21} = opcod;
348 let Inst{20} = 0;
Johnny Chen0291d7e2009-12-11 19:37:26 +0000349 let Inst{11-4} = 0b11111001;
Jim Grosbach5278eb82009-12-11 01:42:04 +0000350}
351
Evan Cheng0d14fc82008-09-01 01:51:14 +0000352// addrmode1 instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000353class AI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
354 string opc, string asm, list<dag> pattern>
355 : I<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
356 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000357 let Inst{24-21} = opcod;
358 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000359}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000360class AsI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
361 string opc, string asm, list<dag> pattern>
362 : sI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
363 opc, asm, "", pattern> {
364 let Inst{24-21} = opcod;
365 let Inst{27-26} = {0,0};
366}
367class AXI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000368 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000369 : XI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng612b79e2008-08-29 07:40:52 +0000370 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000371 let Inst{24-21} = opcod;
372 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000373}
Bob Wilson01135592010-03-23 17:23:59 +0000374class AI1x2<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000375 string opc, string asm, list<dag> pattern>
376 : I<oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, itin,
377 opc, asm, "", pattern>;
Evan Cheng17222df2008-08-31 19:02:21 +0000378
Evan Cheng0d14fc82008-09-01 01:51:14 +0000379
380// addrmode2 loads and stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000381class AI2<dag oops, dag iops, Format f, InstrItinClass itin,
382 string opc, string asm, list<dag> pattern>
383 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
384 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000385 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000386}
Evan Cheng93912732008-09-01 01:27:33 +0000387
388// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000389class AI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
390 string opc, string asm, list<dag> pattern>
391 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
392 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000393 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000394 let Inst{21} = 0; // W bit
395 let Inst{22} = 0; // B bit
396 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000397 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000398}
Bob Wilson01135592010-03-23 17:23:59 +0000399class AXI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000400 string asm, list<dag> pattern>
401 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000402 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000403 let Inst{20} = 1; // L bit
404 let Inst{21} = 0; // W bit
405 let Inst{22} = 0; // B bit
406 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000407 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000408}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000409class AI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
410 string opc, string asm, list<dag> pattern>
411 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
412 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000413 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000414 let Inst{21} = 0; // W bit
415 let Inst{22} = 1; // B bit
416 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000417 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000418}
Bob Wilson01135592010-03-23 17:23:59 +0000419class AXI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000420 string asm, list<dag> pattern>
421 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000422 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000423 let Inst{20} = 1; // L bit
424 let Inst{21} = 0; // W bit
425 let Inst{22} = 1; // B bit
426 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000427 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000428}
Evan Cheng17222df2008-08-31 19:02:21 +0000429
Evan Cheng93912732008-09-01 01:27:33 +0000430// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000431class AI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
432 string opc, string asm, list<dag> pattern>
433 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
434 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000435 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000436 let Inst{21} = 0; // W bit
437 let Inst{22} = 0; // B bit
438 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000439 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000440}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000441class AXI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
442 string asm, list<dag> pattern>
443 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000444 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000445 let Inst{20} = 0; // L bit
446 let Inst{21} = 0; // W bit
447 let Inst{22} = 0; // B bit
448 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000449 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000450}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000451class AI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
452 string opc, string asm, list<dag> pattern>
453 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
454 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000455 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000456 let Inst{21} = 0; // W bit
457 let Inst{22} = 1; // B bit
458 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000459 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000460}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000461class AXI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
462 string asm, list<dag> pattern>
463 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000464 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000465 let Inst{20} = 0; // L bit
466 let Inst{21} = 0; // W bit
467 let Inst{22} = 1; // B bit
468 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000469 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000470}
Evan Cheng93912732008-09-01 01:27:33 +0000471
Evan Cheng840917b2008-09-01 07:00:14 +0000472// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000473class AI2ldwpr<dag oops, dag iops, Format f, InstrItinClass itin,
474 string opc, string asm, string cstr, list<dag> pattern>
475 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
476 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000477 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000478 let Inst{21} = 1; // W bit
479 let Inst{22} = 0; // B bit
480 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000481 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000482}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000483class AI2ldbpr<dag oops, dag iops, Format f, InstrItinClass itin,
484 string opc, string asm, string cstr, list<dag> pattern>
485 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
486 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000487 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000488 let Inst{21} = 1; // W bit
489 let Inst{22} = 1; // B bit
490 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000491 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000492}
493
Evan Cheng840917b2008-09-01 07:00:14 +0000494// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000495class AI2stwpr<dag oops, dag iops, Format f, InstrItinClass itin,
496 string opc, string asm, string cstr, list<dag> pattern>
497 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
498 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000499 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000500 let Inst{21} = 1; // W bit
501 let Inst{22} = 0; // B bit
502 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000503 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000504}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000505class AI2stbpr<dag oops, dag iops, Format f, InstrItinClass itin,
506 string opc, string asm, string cstr, list<dag> pattern>
507 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
508 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000509 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000510 let Inst{21} = 1; // W bit
511 let Inst{22} = 1; // B bit
512 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000513 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000514}
515
Evan Cheng840917b2008-09-01 07:00:14 +0000516// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000517class AI2ldwpo<dag oops, dag iops, Format f, InstrItinClass itin,
518 string opc, string asm, string cstr, list<dag> pattern>
519 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
520 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000521 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000522 let Inst{21} = 0; // W bit
523 let Inst{22} = 0; // B bit
524 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000525 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000526}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000527class AI2ldbpo<dag oops, dag iops, Format f, InstrItinClass itin,
528 string opc, string asm, string cstr, list<dag> pattern>
529 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
530 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000531 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000532 let Inst{21} = 0; // W bit
533 let Inst{22} = 1; // B bit
534 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000535 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000536}
537
Evan Cheng840917b2008-09-01 07:00:14 +0000538// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000539class AI2stwpo<dag oops, dag iops, Format f, InstrItinClass itin,
540 string opc, string asm, string cstr, list<dag> pattern>
541 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
542 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000543 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000544 let Inst{21} = 0; // W bit
545 let Inst{22} = 0; // B bit
546 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000547 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000548}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000549class AI2stbpo<dag oops, dag iops, Format f, InstrItinClass itin,
550 string opc, string asm, string cstr, list<dag> pattern>
551 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
552 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000553 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000554 let Inst{21} = 0; // W bit
555 let Inst{22} = 1; // B bit
556 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000557 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000558}
559
Evan Cheng0d14fc82008-09-01 01:51:14 +0000560// addrmode3 instructions
Bob Wilson01135592010-03-23 17:23:59 +0000561class AI3<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000562 string opc, string asm, list<dag> pattern>
563 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
564 opc, asm, "", pattern>;
565class AXI3<dag oops, dag iops, Format f, InstrItinClass itin,
566 string asm, list<dag> pattern>
567 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
568 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000569
Evan Cheng840917b2008-09-01 07:00:14 +0000570// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000571class AI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
572 string opc, string asm, list<dag> pattern>
573 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
574 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000575 let Inst{4} = 1;
576 let Inst{5} = 1; // H bit
577 let Inst{6} = 0; // S bit
578 let Inst{7} = 1;
579 let Inst{20} = 1; // L bit
580 let Inst{21} = 0; // W bit
581 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000582 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000583}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000584class AXI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
585 string asm, list<dag> pattern>
586 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000587 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000588 let Inst{4} = 1;
589 let Inst{5} = 1; // H bit
590 let Inst{6} = 0; // S bit
591 let Inst{7} = 1;
592 let Inst{20} = 1; // L bit
593 let Inst{21} = 0; // W bit
594 let Inst{24} = 1; // P bit
595}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000596class AI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
597 string opc, string asm, list<dag> pattern>
598 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
599 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000600 let Inst{4} = 1;
601 let Inst{5} = 1; // H bit
602 let Inst{6} = 1; // S bit
603 let Inst{7} = 1;
604 let Inst{20} = 1; // L bit
605 let Inst{21} = 0; // W bit
606 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000607 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000608}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000609class AXI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
610 string asm, list<dag> pattern>
611 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000612 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000613 let Inst{4} = 1;
614 let Inst{5} = 1; // H bit
615 let Inst{6} = 1; // S bit
616 let Inst{7} = 1;
617 let Inst{20} = 1; // L bit
618 let Inst{21} = 0; // W bit
619 let Inst{24} = 1; // P bit
620}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000621class AI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
622 string opc, string asm, list<dag> pattern>
623 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
624 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000625 let Inst{4} = 1;
626 let Inst{5} = 0; // H bit
627 let Inst{6} = 1; // S bit
628 let Inst{7} = 1;
629 let Inst{20} = 1; // L bit
630 let Inst{21} = 0; // W bit
631 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000632 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000633}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000634class AXI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
635 string asm, list<dag> pattern>
636 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000637 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000638 let Inst{4} = 1;
639 let Inst{5} = 0; // H bit
640 let Inst{6} = 1; // S bit
641 let Inst{7} = 1;
642 let Inst{20} = 1; // L bit
643 let Inst{21} = 0; // W bit
644 let Inst{24} = 1; // P bit
645}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000646class AI3ldd<dag oops, dag iops, Format f, InstrItinClass itin,
647 string opc, string asm, list<dag> pattern>
648 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
649 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000650 let Inst{4} = 1;
651 let Inst{5} = 0; // H bit
652 let Inst{6} = 1; // S bit
653 let Inst{7} = 1;
654 let Inst{20} = 0; // L bit
655 let Inst{21} = 0; // W bit
656 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000657 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000658}
659
660// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000661class AI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
662 string opc, string asm, list<dag> pattern>
663 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
664 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000665 let Inst{4} = 1;
666 let Inst{5} = 1; // H bit
667 let Inst{6} = 0; // S bit
668 let Inst{7} = 1;
669 let Inst{20} = 0; // L bit
670 let Inst{21} = 0; // W bit
671 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000672 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000673}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000674class AXI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
675 string asm, list<dag> pattern>
676 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000677 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000678 let Inst{4} = 1;
679 let Inst{5} = 1; // H bit
680 let Inst{6} = 0; // S bit
681 let Inst{7} = 1;
682 let Inst{20} = 0; // L bit
683 let Inst{21} = 0; // W bit
684 let Inst{24} = 1; // P bit
685}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000686class AI3std<dag oops, dag iops, Format f, InstrItinClass itin,
687 string opc, string asm, list<dag> pattern>
688 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
689 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000690 let Inst{4} = 1;
691 let Inst{5} = 1; // H bit
692 let Inst{6} = 1; // S bit
693 let Inst{7} = 1;
694 let Inst{20} = 0; // L bit
695 let Inst{21} = 0; // W bit
696 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000697 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000698}
699
700// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000701class AI3ldhpr<dag oops, dag iops, Format f, InstrItinClass itin,
702 string opc, string asm, string cstr, list<dag> pattern>
703 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
704 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000705 let Inst{4} = 1;
706 let Inst{5} = 1; // H bit
707 let Inst{6} = 0; // S bit
708 let Inst{7} = 1;
709 let Inst{20} = 1; // L bit
710 let Inst{21} = 1; // W bit
711 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000712 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000713}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000714class AI3ldshpr<dag oops, dag iops, Format f, InstrItinClass itin,
715 string opc, string asm, string cstr, list<dag> pattern>
716 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
717 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000718 let Inst{4} = 1;
719 let Inst{5} = 1; // H bit
720 let Inst{6} = 1; // S bit
721 let Inst{7} = 1;
722 let Inst{20} = 1; // L bit
723 let Inst{21} = 1; // W bit
724 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000725 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000726}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000727class AI3ldsbpr<dag oops, dag iops, Format f, InstrItinClass itin,
728 string opc, string asm, string cstr, list<dag> pattern>
729 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
730 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000731 let Inst{4} = 1;
732 let Inst{5} = 0; // H bit
733 let Inst{6} = 1; // S bit
734 let Inst{7} = 1;
735 let Inst{20} = 1; // L bit
736 let Inst{21} = 1; // W bit
737 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000738 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000739}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000740class AI3lddpr<dag oops, dag iops, Format f, InstrItinClass itin,
741 string opc, string asm, string cstr, list<dag> pattern>
742 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
743 opc, asm, cstr, pattern> {
744 let Inst{4} = 1;
745 let Inst{5} = 0; // H bit
746 let Inst{6} = 1; // S bit
747 let Inst{7} = 1;
748 let Inst{20} = 0; // L bit
749 let Inst{21} = 1; // W bit
750 let Inst{24} = 1; // P bit
751 let Inst{27-25} = 0b000;
752}
753
Evan Cheng840917b2008-09-01 07:00:14 +0000754
755// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000756class AI3sthpr<dag oops, dag iops, Format f, InstrItinClass itin,
757 string opc, string asm, string cstr, list<dag> pattern>
758 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
759 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000760 let Inst{4} = 1;
761 let Inst{5} = 1; // H bit
762 let Inst{6} = 0; // S bit
763 let Inst{7} = 1;
764 let Inst{20} = 0; // L bit
765 let Inst{21} = 1; // W bit
766 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000767 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000768}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000769class AI3stdpr<dag oops, dag iops, Format f, InstrItinClass itin,
770 string opc, string asm, string cstr, list<dag> pattern>
771 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
772 opc, asm, cstr, pattern> {
773 let Inst{4} = 1;
774 let Inst{5} = 1; // H bit
775 let Inst{6} = 1; // S bit
776 let Inst{7} = 1;
777 let Inst{20} = 0; // L bit
778 let Inst{21} = 1; // W bit
779 let Inst{24} = 1; // P bit
780 let Inst{27-25} = 0b000;
781}
Evan Cheng840917b2008-09-01 07:00:14 +0000782
783// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000784class AI3ldhpo<dag oops, dag iops, Format f, InstrItinClass itin,
785 string opc, string asm, string cstr, list<dag> pattern>
786 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
787 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000788 let Inst{4} = 1;
789 let Inst{5} = 1; // H bit
790 let Inst{6} = 0; // S bit
791 let Inst{7} = 1;
792 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000793 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000794 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000795 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000796}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000797class AI3ldshpo<dag oops, dag iops, Format f, InstrItinClass itin,
798 string opc, string asm, string cstr, list<dag> pattern>
799 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
800 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000801 let Inst{4} = 1;
802 let Inst{5} = 1; // H bit
803 let Inst{6} = 1; // S bit
804 let Inst{7} = 1;
805 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000806 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000807 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000808 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000809}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000810class AI3ldsbpo<dag oops, dag iops, Format f, InstrItinClass itin,
811 string opc, string asm, string cstr, list<dag> pattern>
812 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
813 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000814 let Inst{4} = 1;
815 let Inst{5} = 0; // H bit
816 let Inst{6} = 1; // S bit
817 let Inst{7} = 1;
818 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000819 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000820 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000821 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000822}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000823class AI3lddpo<dag oops, dag iops, Format f, InstrItinClass itin,
824 string opc, string asm, string cstr, list<dag> pattern>
825 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
826 opc, asm, cstr, pattern> {
827 let Inst{4} = 1;
828 let Inst{5} = 0; // H bit
829 let Inst{6} = 1; // S bit
830 let Inst{7} = 1;
831 let Inst{20} = 0; // L bit
832 let Inst{21} = 0; // W bit
833 let Inst{24} = 0; // P bit
834 let Inst{27-25} = 0b000;
835}
Evan Cheng840917b2008-09-01 07:00:14 +0000836
837// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000838class AI3sthpo<dag oops, dag iops, Format f, InstrItinClass itin,
839 string opc, string asm, string cstr, list<dag> pattern>
840 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
841 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000842 let Inst{4} = 1;
843 let Inst{5} = 1; // H bit
844 let Inst{6} = 0; // S bit
845 let Inst{7} = 1;
846 let Inst{20} = 0; // L bit
Johnny Chenad4df4c2010-03-01 19:22:00 +0000847 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000848 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000849 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000850}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000851class AI3stdpo<dag oops, dag iops, Format f, InstrItinClass itin,
852 string opc, string asm, string cstr, list<dag> pattern>
853 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
854 opc, asm, cstr, pattern> {
855 let Inst{4} = 1;
856 let Inst{5} = 1; // H bit
857 let Inst{6} = 1; // S bit
858 let Inst{7} = 1;
859 let Inst{20} = 0; // L bit
860 let Inst{21} = 0; // W bit
861 let Inst{24} = 0; // P bit
862 let Inst{27-25} = 0b000;
863}
Evan Cheng840917b2008-09-01 07:00:14 +0000864
Evan Cheng0d14fc82008-09-01 01:51:14 +0000865// addrmode4 instructions
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000866class AXI4ld<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000867 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000868 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000869 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000870 let Inst{20} = 1; // L bit
871 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000872 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000873}
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000874class AXI4st<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000875 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000876 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000877 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000878 let Inst{20} = 0; // L bit
879 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000880 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000881}
Evan Cheng37f25d92008-08-28 23:39:26 +0000882
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000883// Unsigned multiply, multiply-accumulate instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000884class AMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
885 string opc, string asm, list<dag> pattern>
886 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
887 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000888 let Inst{7-4} = 0b1001;
Evan Chengfbc9d412008-11-06 01:21:28 +0000889 let Inst{20} = 0; // S bit
Evan Chengd87293c2008-11-06 08:47:38 +0000890 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000891}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000892class AsMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
893 string opc, string asm, list<dag> pattern>
894 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
895 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000896 let Inst{7-4} = 0b1001;
Evan Chengd87293c2008-11-06 08:47:38 +0000897 let Inst{27-21} = opcod;
Evan Chengfbc9d412008-11-06 01:21:28 +0000898}
899
900// Most significant word multiply
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000901class AMul2I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
902 string opc, string asm, list<dag> pattern>
903 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
904 opc, asm, "", pattern> {
Evan Chengfbc9d412008-11-06 01:21:28 +0000905 let Inst{7-4} = 0b1001;
906 let Inst{20} = 1;
Evan Chengd87293c2008-11-06 08:47:38 +0000907 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000908}
Evan Cheng37f25d92008-08-28 23:39:26 +0000909
Evan Chengeb4f52e2008-11-06 03:35:07 +0000910// SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000911class AMulxyI<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
912 string opc, string asm, list<dag> pattern>
913 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
914 opc, asm, "", pattern> {
Evan Chengeb4f52e2008-11-06 03:35:07 +0000915 let Inst{4} = 0;
916 let Inst{7} = 1;
917 let Inst{20} = 0;
Evan Chengd87293c2008-11-06 08:47:38 +0000918 let Inst{27-21} = opcod;
Evan Chengeb4f52e2008-11-06 03:35:07 +0000919}
920
Evan Cheng97f48c32008-11-06 22:15:19 +0000921// Extend instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000922class AExtI<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
923 string opc, string asm, list<dag> pattern>
924 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ExtFrm, itin,
925 opc, asm, "", pattern> {
Evan Cheng97f48c32008-11-06 22:15:19 +0000926 let Inst{7-4} = 0b0111;
927 let Inst{27-20} = opcod;
928}
929
Evan Cheng8b59db32008-11-07 01:41:35 +0000930// Misc Arithmetic instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000931class AMiscA1I<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
932 string opc, string asm, list<dag> pattern>
933 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ArithMiscFrm, itin,
934 opc, asm, "", pattern> {
Evan Cheng8b59db32008-11-07 01:41:35 +0000935 let Inst{27-20} = opcod;
936}
937
Evan Cheng37f25d92008-08-28 23:39:26 +0000938//===----------------------------------------------------------------------===//
939
940// ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
941class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
942 list<Predicate> Predicates = [IsARM];
943}
944class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
945 list<Predicate> Predicates = [IsARM, HasV5TE];
946}
947class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
948 list<Predicate> Predicates = [IsARM, HasV6];
949}
Evan Cheng13096642008-08-29 06:41:12 +0000950
951//===----------------------------------------------------------------------===//
952//
953// Thumb Instruction Format Definitions.
954//
955
Evan Cheng13096642008-08-29 06:41:12 +0000956// TI - Thumb instruction.
957
Evan Cheng446c4282009-07-11 06:43:01 +0000958class ThumbI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000959 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000960 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000961 let OutOperandList = oops;
962 let InOperandList = iops;
Evan Cheng13096642008-08-29 06:41:12 +0000963 let AsmString = asm;
964 let Pattern = pattern;
965 list<Predicate> Predicates = [IsThumb];
966}
967
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000968class TI<dag oops, dag iops, InstrItinClass itin, string asm, list<dag> pattern>
969 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000970
Evan Cheng35d6c412009-08-04 23:47:55 +0000971// Two-address instructions
Bob Wilson01135592010-03-23 17:23:59 +0000972class TIt<dag oops, dag iops, InstrItinClass itin, string asm,
973 list<dag> pattern>
974 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "$lhs = $dst",
975 pattern>;
Evan Cheng35d6c412009-08-04 23:47:55 +0000976
Johnny Chend68e1192009-12-15 17:24:14 +0000977// tBL, tBX 32-bit instructions
978class TIx2<bits<5> opcod1, bits<2> opcod2, bit opcod3,
Bob Wilson01135592010-03-23 17:23:59 +0000979 dag oops, dag iops, InstrItinClass itin, string asm,
980 list<dag> pattern>
981 : ThumbI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>,
982 Encoding {
Johnny Chend68e1192009-12-15 17:24:14 +0000983 let Inst{31-27} = opcod1;
984 let Inst{15-14} = opcod2;
985 let Inst{12} = opcod3;
986}
Evan Cheng13096642008-08-29 06:41:12 +0000987
988// BR_JT instructions
Bob Wilson01135592010-03-23 17:23:59 +0000989class TJTI<dag oops, dag iops, InstrItinClass itin, string asm,
990 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000991 : ThumbI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000992
Evan Cheng09c39fc2009-06-23 19:38:13 +0000993// Thumb1 only
Evan Cheng446c4282009-07-11 06:43:01 +0000994class Thumb1I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000995 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000996 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000997 let OutOperandList = oops;
998 let InOperandList = iops;
Evan Cheng09c39fc2009-06-23 19:38:13 +0000999 let AsmString = asm;
1000 let Pattern = pattern;
1001 list<Predicate> Predicates = [IsThumb1Only];
1002}
1003
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001004class T1I<dag oops, dag iops, InstrItinClass itin,
1005 string asm, list<dag> pattern>
1006 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
1007class T1Ix2<dag oops, dag iops, InstrItinClass itin,
1008 string asm, list<dag> pattern>
1009 : Thumb1I<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1010class T1JTI<dag oops, dag iops, InstrItinClass itin,
1011 string asm, list<dag> pattern>
Johnny Chenbbc71b22009-12-16 02:32:54 +00001012 : Thumb1I<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001013
1014// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001015class T1It<dag oops, dag iops, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001016 string asm, string cstr, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001017 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001018 asm, cstr, pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001019
1020// Thumb1 instruction that can either be predicated or set CPSR.
1021class Thumb1sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001022 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001023 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001024 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Chris Lattnerb7d52262010-03-18 21:06:54 +00001025 let OutOperandList = !con(oops, (outs s_cc_out:$s));
1026 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001027 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1028 let Pattern = pattern;
1029 list<Predicate> Predicates = [IsThumb1Only];
1030}
1031
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001032class T1sI<dag oops, dag iops, InstrItinClass itin,
1033 string opc, string asm, list<dag> pattern>
1034 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001035
1036// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001037class T1sIt<dag oops, dag iops, InstrItinClass itin,
1038 string opc, string asm, list<dag> pattern>
1039 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001040 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001041
1042// Thumb1 instruction that can be predicated.
1043class Thumb1pI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001044 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001045 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001046 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +00001047 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001048 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001049 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1050 let Pattern = pattern;
1051 list<Predicate> Predicates = [IsThumb1Only];
1052}
1053
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001054class T1pI<dag oops, dag iops, InstrItinClass itin,
1055 string opc, string asm, list<dag> pattern>
1056 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001057
1058// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001059class T1pIt<dag oops, dag iops, InstrItinClass itin,
1060 string opc, string asm, list<dag> pattern>
1061 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001062 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001063
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001064class T1pI1<dag oops, dag iops, InstrItinClass itin,
1065 string opc, string asm, list<dag> pattern>
1066 : Thumb1pI<oops, iops, AddrModeT1_1, Size2Bytes, itin, opc, asm, "", pattern>;
1067class T1pI2<dag oops, dag iops, InstrItinClass itin,
1068 string opc, string asm, list<dag> pattern>
1069 : Thumb1pI<oops, iops, AddrModeT1_2, Size2Bytes, itin, opc, asm, "", pattern>;
1070class T1pI4<dag oops, dag iops, InstrItinClass itin,
1071 string opc, string asm, list<dag> pattern>
1072 : Thumb1pI<oops, iops, AddrModeT1_4, Size2Bytes, itin, opc, asm, "", pattern>;
Bob Wilson01135592010-03-23 17:23:59 +00001073class T1pIs<dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001074 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1075 : Thumb1pI<oops, iops, AddrModeT1_s, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001076
Johnny Chenbbc71b22009-12-16 02:32:54 +00001077class Encoding16 : Encoding {
1078 let Inst{31-16} = 0x0000;
1079}
1080
Johnny Chend68e1192009-12-15 17:24:14 +00001081// A6.2 16-bit Thumb instruction encoding
Johnny Chenbbc71b22009-12-16 02:32:54 +00001082class T1Encoding<bits<6> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001083 let Inst{15-10} = opcode;
1084}
1085
1086// A6.2.1 Shift (immediate), add, subtract, move, and compare encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001087class T1General<bits<5> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001088 let Inst{15-14} = 0b00;
1089 let Inst{13-9} = opcode;
1090}
1091
1092// A6.2.2 Data-processing encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001093class T1DataProcessing<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001094 let Inst{15-10} = 0b010000;
1095 let Inst{9-6} = opcode;
1096}
1097
1098// A6.2.3 Special data instructions and branch and exchange encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001099class T1Special<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001100 let Inst{15-10} = 0b010001;
1101 let Inst{9-6} = opcode;
1102}
1103
1104// A6.2.4 Load/store single data item encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001105class T1LoadStore<bits<4> opA, bits<3> opB> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001106 let Inst{15-12} = opA;
1107 let Inst{11-9} = opB;
1108}
1109class T1LdSt<bits<3> opB> : T1LoadStore<0b0101, opB>;
1110class T1LdSt4Imm<bits<3> opB> : T1LoadStore<0b0110, opB>; // Immediate, 4 bytes
1111class T1LdSt1Imm<bits<3> opB> : T1LoadStore<0b0111, opB>; // Immediate, 1 byte
1112class T1LdSt2Imm<bits<3> opB> : T1LoadStore<0b1000, opB>; // Immediate, 2 bytes
1113class T1LdStSP<bits<3> opB> : T1LoadStore<0b1001, opB>; // SP relative
1114
1115// A6.2.5 Miscellaneous 16-bit instructions encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001116class T1Misc<bits<7> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001117 let Inst{15-12} = 0b1011;
1118 let Inst{11-5} = opcode;
1119}
1120
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001121// Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
1122class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001123 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001124 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001125 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001126 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001127 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001128 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1129 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001130 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001131}
1132
1133// Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as
1134// an input operand since by default it's a zero register. It will
1135// become an implicit def once it's "flipped".
1136// FIXME: This uses unified syntax so {s} comes before {p}. We should make it
1137// more consistent.
1138class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001139 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001140 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001141 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001142 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001143 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001144 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1145 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001146 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001147}
1148
1149// Special cases
1150class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001151 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001152 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001153 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001154 let OutOperandList = oops;
1155 let InOperandList = iops;
Evan Chengf49810c2009-06-23 17:48:47 +00001156 let AsmString = asm;
1157 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001158 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001159}
1160
Jim Grosbachd1228742009-12-01 18:10:36 +00001161class ThumbXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +00001162 InstrItinClass itin,
1163 string asm, string cstr, list<dag> pattern>
Jim Grosbachd1228742009-12-01 18:10:36 +00001164 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1165 let OutOperandList = oops;
1166 let InOperandList = iops;
1167 let AsmString = asm;
1168 let Pattern = pattern;
1169 list<Predicate> Predicates = [IsThumb1Only];
1170}
1171
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001172class T2I<dag oops, dag iops, InstrItinClass itin,
1173 string opc, string asm, list<dag> pattern>
1174 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
1175class T2Ii12<dag oops, dag iops, InstrItinClass itin,
1176 string opc, string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001177 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, itin, opc, asm, "",pattern>;
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001178class T2Ii8<dag oops, dag iops, InstrItinClass itin,
1179 string opc, string asm, list<dag> pattern>
1180 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, itin, opc, asm, "", pattern>;
1181class T2Iso<dag oops, dag iops, InstrItinClass itin,
1182 string opc, string asm, list<dag> pattern>
1183 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, itin, opc, asm, "", pattern>;
1184class T2Ipc<dag oops, dag iops, InstrItinClass itin,
1185 string opc, string asm, list<dag> pattern>
1186 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, itin, opc, asm, "", pattern>;
Johnny Chend68e1192009-12-15 17:24:14 +00001187class T2Ii8s4<bit P, bit W, bit load, dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001188 string opc, string asm, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001189 : Thumb2I<oops, iops, AddrModeT2_i8s4, Size4Bytes, itin, opc, asm, "",
1190 pattern> {
1191 let Inst{31-27} = 0b11101;
1192 let Inst{26-25} = 0b00;
1193 let Inst{24} = P;
1194 let Inst{23} = ?; // The U bit.
1195 let Inst{22} = 1;
1196 let Inst{21} = W;
1197 let Inst{20} = load;
1198}
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001199
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001200class T2sI<dag oops, dag iops, InstrItinClass itin,
1201 string opc, string asm, list<dag> pattern>
1202 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001203
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001204class T2XI<dag oops, dag iops, InstrItinClass itin,
1205 string asm, list<dag> pattern>
1206 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1207class T2JTI<dag oops, dag iops, InstrItinClass itin,
1208 string asm, list<dag> pattern>
1209 : Thumb2XI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Chengf49810c2009-06-23 17:48:47 +00001210
Evan Cheng5adb66a2009-09-28 09:14:39 +00001211class T2Ix2<dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001212 string opc, string asm, list<dag> pattern>
Evan Cheng5adb66a2009-09-28 09:14:39 +00001213 : Thumb2I<oops, iops, AddrModeNone, Size8Bytes, itin, opc, asm, "", pattern>;
1214
Bob Wilson815baeb2010-03-13 01:08:20 +00001215// Two-address instructions
1216class T2XIt<dag oops, dag iops, InstrItinClass itin,
1217 string asm, string cstr, list<dag> pattern>
1218 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, cstr, pattern>;
Evan Cheng5adb66a2009-09-28 09:14:39 +00001219
Evan Chenge88d5ce2009-07-02 07:28:31 +00001220// T2Iidxldst - Thumb2 indexed load / store instructions.
Johnny Chend68e1192009-12-15 17:24:14 +00001221class T2Iidxldst<bit signed, bits<2> opcod, bit load, bit pre,
1222 dag oops, dag iops,
1223 AddrMode am, IndexMode im, InstrItinClass itin,
Evan Chenge88d5ce2009-07-02 07:28:31 +00001224 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001225 : InstARM<am, Size4Bytes, im, ThumbFrm, GenericDomain, cstr, itin> {
Evan Chenge88d5ce2009-07-02 07:28:31 +00001226 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001227 let InOperandList = !con(iops, (ins pred:$p));
Evan Chenge88d5ce2009-07-02 07:28:31 +00001228 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1229 let Pattern = pattern;
1230 list<Predicate> Predicates = [IsThumb2];
Johnny Chend68e1192009-12-15 17:24:14 +00001231 let Inst{31-27} = 0b11111;
1232 let Inst{26-25} = 0b00;
1233 let Inst{24} = signed;
1234 let Inst{23} = 0;
1235 let Inst{22-21} = opcod;
1236 let Inst{20} = load;
1237 let Inst{11} = 1;
1238 // (P, W) = (1, 1) Pre-indexed or (0, 1) Post-indexed
1239 let Inst{10} = pre; // The P bit.
1240 let Inst{8} = 1; // The W bit.
Evan Chenge88d5ce2009-07-02 07:28:31 +00001241}
1242
Johnny Chenadc77332010-02-26 22:04:29 +00001243// Helper class for disassembly only
1244// A6.3.16 & A6.3.17
1245// T2Imac - Thumb2 multiply [accumulate, and absolute difference] instructions.
1246class T2I_mac<bit long, bits<3> op22_20, bits<4> op7_4, dag oops, dag iops,
1247 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1248 : T2I<oops, iops, itin, opc, asm, pattern> {
1249 let Inst{31-27} = 0b11111;
1250 let Inst{26-24} = 0b011;
1251 let Inst{23} = long;
1252 let Inst{22-20} = op22_20;
1253 let Inst{7-4} = op7_4;
1254}
1255
David Goodwinc9d138f2009-07-27 19:59:26 +00001256// Tv5Pat - Same as Pat<>, but requires V5T Thumb mode.
1257class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
1258 list<Predicate> Predicates = [IsThumb1Only, HasV5T];
1259}
1260
1261// T1Pat - Same as Pat<>, but requires that the compiler be in Thumb1 mode.
1262class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
1263 list<Predicate> Predicates = [IsThumb1Only];
1264}
Evan Chenge88d5ce2009-07-02 07:28:31 +00001265
Evan Cheng9cb9e672009-06-27 02:26:13 +00001266// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
1267class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Chengd770d9e2009-07-02 06:38:40 +00001268 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001269}
1270
Evan Cheng13096642008-08-29 06:41:12 +00001271//===----------------------------------------------------------------------===//
1272
Evan Cheng96581d32008-11-11 02:11:05 +00001273//===----------------------------------------------------------------------===//
1274// ARM VFP Instruction templates.
1275//
1276
David Goodwin3ca524e2009-07-10 17:03:29 +00001277// Almost all VFP instructions are predicable.
1278class VFPI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001279 IndexMode im, Format f, InstrItinClass itin,
1280 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001281 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001282 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001283 let InOperandList = !con(iops, (ins pred:$p));
David Goodwin3ca524e2009-07-10 17:03:29 +00001284 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1285 let Pattern = pattern;
1286 list<Predicate> Predicates = [HasVFP2];
1287}
1288
1289// Special cases
1290class VFPXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001291 IndexMode im, Format f, InstrItinClass itin,
1292 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001293 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001294 let OutOperandList = oops;
1295 let InOperandList = iops;
1296 let AsmString = asm;
1297 let Pattern = pattern;
1298 list<Predicate> Predicates = [HasVFP2];
1299}
1300
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001301class VFPAI<dag oops, dag iops, Format f, InstrItinClass itin,
1302 string opc, string asm, list<dag> pattern>
1303 : VFPI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
1304 opc, asm, "", pattern>;
David Goodwin3ca524e2009-07-10 17:03:29 +00001305
Evan Chengcd8e66a2008-11-11 21:48:44 +00001306// ARM VFP addrmode5 loads and stores
1307class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001308 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001309 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001310 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001311 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001312 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001313 let Inst{27-24} = opcod1;
1314 let Inst{21-20} = opcod2;
1315 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001316
1317 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1318 let Dom = VFPNeonDomain.Value;
Evan Cheng96581d32008-11-11 02:11:05 +00001319}
1320
Evan Chengcd8e66a2008-11-11 21:48:44 +00001321class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001322 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001323 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001324 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001325 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001326 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001327 let Inst{27-24} = opcod1;
1328 let Inst{21-20} = opcod2;
1329 let Inst{11-8} = 0b1010;
Evan Cheng96581d32008-11-11 02:11:05 +00001330}
1331
Evan Chengcd8e66a2008-11-11 21:48:44 +00001332// Load / store multiple
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001333class AXDI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001334 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001335 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001336 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001337 // TODO: Mark the instructions with the appropriate subtarget info.
1338 let Inst{27-25} = 0b110;
1339 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001340
1341 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1342 let Dom = VFPNeonDomain.Value;
Evan Chengcd8e66a2008-11-11 21:48:44 +00001343}
1344
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001345class AXSI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001346 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001347 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001348 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001349 // TODO: Mark the instructions with the appropriate subtarget info.
1350 let Inst{27-25} = 0b110;
1351 let Inst{11-8} = 0b1010;
1352}
1353
Evan Cheng96581d32008-11-11 02:11:05 +00001354// Double precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001355class ADuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1356 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1357 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001358 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001359 let Inst{27-23} = opcod1;
1360 let Inst{21-20} = opcod2;
1361 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001362 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001363 let Inst{7-6} = opcod4;
1364 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001365}
1366
1367// Double precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001368class ADbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001369 dag iops, InstrItinClass itin, string opc, string asm,
1370 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001371 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001372 let Inst{27-23} = opcod1;
1373 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001374 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001375 let Inst{6} = op6;
1376 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001377}
1378
Jim Grosbach26767372010-03-24 22:31:46 +00001379// Double precision, binary, VML[AS] (for additional predicate)
1380class ADbI_vmlX<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
1381 dag iops, InstrItinClass itin, string opc, string asm,
1382 list<dag> pattern>
1383 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
1384 let Inst{27-23} = opcod1;
1385 let Inst{21-20} = opcod2;
1386 let Inst{11-8} = 0b1011;
1387 let Inst{6} = op6;
1388 let Inst{4} = op4;
1389 list<Predicate> Predicates = [HasVFP2, UseVMLx];
1390}
1391
1392
Evan Cheng96581d32008-11-11 02:11:05 +00001393// Single precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001394class ASuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1395 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1396 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001397 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001398 let Inst{27-23} = opcod1;
1399 let Inst{21-20} = opcod2;
1400 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001401 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001402 let Inst{7-6} = opcod4;
1403 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001404}
1405
David Goodwin338268c2009-08-10 22:17:39 +00001406// Single precision unary, if no NEON
David Goodwin53e44712009-08-04 20:39:05 +00001407// Same as ASuI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001408class ASuIn<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1409 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1410 string asm, list<dag> pattern>
1411 : ASuI<opcod1, opcod2, opcod3, opcod4, opcod5, oops, iops, itin, opc, asm,
1412 pattern> {
David Goodwin53e44712009-08-04 20:39:05 +00001413 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1414}
1415
Evan Cheng96581d32008-11-11 02:11:05 +00001416// Single precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001417class ASbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops, dag iops,
1418 InstrItinClass itin, string opc, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001419 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001420 let Inst{27-23} = opcod1;
1421 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001422 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001423 let Inst{6} = op6;
1424 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001425}
1426
David Goodwin338268c2009-08-10 22:17:39 +00001427// Single precision binary, if no NEON
David Goodwin42a83f22009-08-04 17:53:06 +00001428// Same as ASbI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001429class ASbIn<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001430 dag iops, InstrItinClass itin, string opc, string asm,
1431 list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001432 : ASbI<opcod1, opcod2, op6, op4, oops, iops, itin, opc, asm, pattern> {
David Goodwin42a83f22009-08-04 17:53:06 +00001433 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1434}
1435
Evan Cheng80a11982008-11-12 06:41:41 +00001436// VFP conversion instructions
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001437class AVConv1I<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
1438 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1439 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001440 : VFPAI<oops, iops, VFPConv1Frm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001441 let Inst{27-23} = opcod1;
1442 let Inst{21-20} = opcod2;
1443 let Inst{19-16} = opcod3;
1444 let Inst{11-8} = opcod4;
Evan Cheng80a11982008-11-12 06:41:41 +00001445 let Inst{6} = 1;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001446 let Inst{4} = 0;
Evan Cheng80a11982008-11-12 06:41:41 +00001447}
1448
Johnny Chen811663f2010-02-11 18:47:03 +00001449// VFP conversion between floating-point and fixed-point
1450class AVConv1XI<bits<5> op1, bits<2> op2, bits<4> op3, bits<4> op4, bit op5,
Bob Wilson01135592010-03-23 17:23:59 +00001451 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1452 list<dag> pattern>
Johnny Chen811663f2010-02-11 18:47:03 +00001453 : AVConv1I<op1, op2, op3, op4, oops, iops, itin, opc, asm, pattern> {
1454 // size (fixed-point number): sx == 0 ? 16 : 32
1455 let Inst{7} = op5; // sx
1456}
1457
David Goodwin338268c2009-08-10 22:17:39 +00001458// VFP conversion instructions, if no NEON
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001459class AVConv1In<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
David Goodwin338268c2009-08-10 22:17:39 +00001460 dag oops, dag iops, InstrItinClass itin,
1461 string opc, string asm, list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001462 : AVConv1I<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
1463 pattern> {
David Goodwin338268c2009-08-10 22:17:39 +00001464 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1465}
1466
Evan Cheng80a11982008-11-12 06:41:41 +00001467class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001468 InstrItinClass itin,
1469 string opc, string asm, list<dag> pattern>
1470 : VFPAI<oops, iops, f, itin, opc, asm, pattern> {
Evan Cheng80a11982008-11-12 06:41:41 +00001471 let Inst{27-20} = opcod1;
Evan Cheng78be83d2008-11-11 19:40:26 +00001472 let Inst{11-8} = opcod2;
1473 let Inst{4} = 1;
1474}
1475
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001476class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1477 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1478 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, itin, opc, asm, pattern>;
Evan Cheng0a0ab132008-11-11 22:46:12 +00001479
Bob Wilson01135592010-03-23 17:23:59 +00001480class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001481 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1482 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001483
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001484class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1485 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1486 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001487
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001488class AVConv5I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1489 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1490 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv5Frm, itin, opc, asm, pattern>;
Evan Cheng78be83d2008-11-11 19:40:26 +00001491
Evan Cheng96581d32008-11-11 02:11:05 +00001492//===----------------------------------------------------------------------===//
1493
Bob Wilson5bafff32009-06-22 23:27:02 +00001494//===----------------------------------------------------------------------===//
1495// ARM NEON Instruction templates.
1496//
Evan Cheng13096642008-08-29 06:41:12 +00001497
Johnny Chencaa608e2010-03-20 00:17:00 +00001498class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1499 InstrItinClass itin, string opc, string dt, string asm, string cstr,
1500 list<dag> pattern>
1501 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Evan Chengf81bf152009-11-23 21:57:23 +00001502 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001503 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001504 let AsmString = !strconcat(
1505 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1506 !strconcat("\t", asm));
1507 let Pattern = pattern;
1508 list<Predicate> Predicates = [HasNEON];
1509}
1510
1511// Same as NeonI except it does not have a "data type" specifier.
Johnny Chen927b88f2010-03-23 20:40:44 +00001512class NeonXI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1513 InstrItinClass itin, string opc, string asm, string cstr,
1514 list<dag> pattern>
1515 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001516 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001517 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001518 let AsmString = !strconcat(!strconcat(opc, "${p}"), !strconcat("\t", asm));
Bob Wilson5bafff32009-06-22 23:27:02 +00001519 let Pattern = pattern;
1520 list<Predicate> Predicates = [HasNEON];
Evan Cheng13096642008-08-29 06:41:12 +00001521}
1522
Bob Wilsonb07c1712009-10-07 21:53:04 +00001523class NLdSt<bit op23, bits<2> op21_20, bits<4> op11_8, bits<4> op7_4,
1524 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001525 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chencaa608e2010-03-20 00:17:00 +00001526 : NeonI<oops, iops, AddrMode6, IndexModeNone, NLdStFrm, itin, opc, dt, asm,
1527 cstr, pattern> {
Bob Wilson205a5ca2009-07-08 18:11:30 +00001528 let Inst{31-24} = 0b11110100;
Jim Grosbach780d2072009-10-20 00:19:08 +00001529 let Inst{23} = op23;
1530 let Inst{21-20} = op21_20;
1531 let Inst{11-8} = op11_8;
1532 let Inst{7-4} = op7_4;
Bob Wilson205a5ca2009-07-08 18:11:30 +00001533}
1534
Johnny Chen785516a2010-03-23 16:43:47 +00001535class NDataI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001536 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chen785516a2010-03-23 16:43:47 +00001537 : NeonI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, dt, asm, cstr,
1538 pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001539 let Inst{31-25} = 0b1111001;
1540}
1541
Johnny Chen927b88f2010-03-23 20:40:44 +00001542class NDataXI<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001543 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chen927b88f2010-03-23 20:40:44 +00001544 : NeonXI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001545 cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001546 let Inst{31-25} = 0b1111001;
1547}
1548
1549// NEON "one register and a modified immediate" format.
1550class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1551 bit op5, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001552 dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001553 string opc, string dt, string asm, string cstr,
1554 list<dag> pattern>
Johnny Chena2711742010-03-23 23:09:14 +00001555 : NDataI<oops, iops, N1RegModImmFrm, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001556 let Inst{23} = op23;
1557 let Inst{21-19} = op21_19;
1558 let Inst{11-8} = op11_8;
1559 let Inst{7} = op7;
1560 let Inst{6} = op6;
1561 let Inst{5} = op5;
1562 let Inst{4} = op4;
1563}
1564
1565// NEON 2 vector register format.
1566class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1567 bits<5> op11_7, bit op6, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001568 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001569 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001570 : NDataI<oops, iops, N2RegFrm, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001571 let Inst{24-23} = op24_23;
1572 let Inst{21-20} = op21_20;
1573 let Inst{19-18} = op19_18;
1574 let Inst{17-16} = op17_16;
1575 let Inst{11-7} = op11_7;
1576 let Inst{6} = op6;
1577 let Inst{4} = op4;
1578}
1579
1580// Same as N2V except it doesn't have a datatype suffix.
1581class N2VX<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
Bob Wilson01135592010-03-23 17:23:59 +00001582 bits<5> op11_7, bit op6, bit op4,
1583 dag oops, dag iops, InstrItinClass itin,
1584 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001585 : NDataXI<oops, iops, N2RegFrm, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001586 let Inst{24-23} = op24_23;
1587 let Inst{21-20} = op21_20;
1588 let Inst{19-18} = op19_18;
1589 let Inst{17-16} = op17_16;
1590 let Inst{11-7} = op11_7;
1591 let Inst{6} = op6;
1592 let Inst{4} = op4;
1593}
1594
1595// NEON 2 vector register with immediate.
Bob Wilson507df402009-10-21 02:15:46 +00001596class N2VImm<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
Johnny Chenfa80bec2010-03-25 20:39:04 +00001597 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001598 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenfa80bec2010-03-25 20:39:04 +00001599 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001600 let Inst{24} = op24;
1601 let Inst{23} = op23;
Bob Wilson5bafff32009-06-22 23:27:02 +00001602 let Inst{11-8} = op11_8;
1603 let Inst{7} = op7;
1604 let Inst{6} = op6;
1605 let Inst{4} = op4;
1606}
1607
Johnny Chenc6e704d2010-03-26 21:26:28 +00001608// NEON 3 vector register template, which requires a Format argument.
1609class N3Vf<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,bit op4,
1610 dag oops, dag iops, Format f, InstrItinClass itin,
1611 string opc, string dt, string asm, string cstr, list<dag> pattern>
1612 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001613 let Inst{24} = op24;
1614 let Inst{23} = op23;
1615 let Inst{21-20} = op21_20;
1616 let Inst{11-8} = op11_8;
1617 let Inst{6} = op6;
1618 let Inst{4} = op4;
1619}
1620
Johnny Chenc6e704d2010-03-26 21:26:28 +00001621// NEON 3 vector register format.
1622class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
1623 dag oops, dag iops, InstrItinClass itin,
1624 string opc, string dt, string asm, string cstr, list<dag> pattern>
1625 : N3Vf<op24, op23, op21_20, op11_8, op6, op4, oops, iops, N3RegFrm, itin,
1626 opc, dt, asm, cstr, pattern>;
1627
Johnny Chen841e8282010-03-23 21:35:03 +00001628// Same as N3V except it doesn't have a data type suffix.
Bob Wilson01135592010-03-23 17:23:59 +00001629class N3VX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
1630 bit op4,
1631 dag oops, dag iops, InstrItinClass itin,
1632 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chen575c91c2010-03-26 18:32:20 +00001633 : NDataXI<oops, iops, N3RegFrm, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001634 let Inst{24} = op24;
1635 let Inst{23} = op23;
1636 let Inst{21-20} = op21_20;
1637 let Inst{11-8} = op11_8;
1638 let Inst{6} = op6;
1639 let Inst{4} = op4;
1640}
1641
1642// NEON VMOVs between scalar and core registers.
1643class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001644 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001645 string opc, string dt, string asm, list<dag> pattern>
1646 : InstARM<AddrModeNone, Size4Bytes, IndexModeNone, f, GenericDomain,
Bob Wilson01135592010-03-23 17:23:59 +00001647 "", itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001648 let Inst{27-20} = opcod1;
1649 let Inst{11-8} = opcod2;
1650 let Inst{6-5} = opcod3;
1651 let Inst{4} = 1;
Evan Chengf81bf152009-11-23 21:57:23 +00001652
1653 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001654 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001655 let AsmString = !strconcat(
1656 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1657 !strconcat("\t", asm));
1658 let Pattern = pattern;
Bob Wilson5bafff32009-06-22 23:27:02 +00001659 list<Predicate> Predicates = [HasNEON];
1660}
1661class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001662 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001663 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001664 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONGetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001665 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001666class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001667 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001668 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001669 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONSetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001670 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001671class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001672 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001673 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001674 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONDupFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001675 opc, dt, asm, pattern>;
David Goodwin42a83f22009-08-04 17:53:06 +00001676
Johnny Chene4614f72010-03-25 17:01:27 +00001677// Vector Duplicate Lane (from scalar to all elements)
1678class NVDupLane<bits<4> op19_16, bit op6, dag oops, dag iops,
1679 InstrItinClass itin, string opc, string dt, string asm,
1680 list<dag> pattern>
Johnny Chen2d2898e2010-03-25 21:49:12 +00001681 : NDataI<oops, iops, NVDupLnFrm, itin, opc, dt, asm, "", pattern> {
Johnny Chene4614f72010-03-25 17:01:27 +00001682 let Inst{24-23} = 0b11;
1683 let Inst{21-20} = 0b11;
1684 let Inst{19-16} = op19_16;
1685 let Inst{11-7} = 0b11000;
1686 let Inst{6} = op6;
1687 let Inst{4} = 0;
1688}
1689
David Goodwin42a83f22009-08-04 17:53:06 +00001690// NEONFPPat - Same as Pat<>, but requires that the compiler be using NEON
1691// for single-precision FP.
1692class NEONFPPat<dag pattern, dag result> : Pat<pattern, result> {
1693 list<Predicate> Predicates = [HasNEON,UseNEONForFP];
1694}