blob: b398b1f785fed1ca19451234a5fa57eca34b49ba [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 Chen897dd0c2010-03-27 01:03:13 +000072def NVMulSLFrm : Format<41>;
Johnny Chencaa608e2010-03-20 00:17:00 +000073
Evan Cheng34a0fa32009-07-08 01:46:35 +000074// Misc flags.
75
Evan Chengedda31c2008-11-05 18:35:52 +000076// the instruction has a Rn register operand.
Evan Cheng34a0fa32009-07-08 01:46:35 +000077// UnaryDP - Indicates this is a unary data processing instruction, i.e.
78// it doesn't have a Rn operand.
79class UnaryDP { bit isUnaryDataProc = 1; }
80
81// Xform16Bit - Indicates this Thumb2 instruction may be transformed into
82// a 16-bit Thumb instruction if certain conditions are met.
83class Xform16Bit { bit canXformTo16Bit = 1; }
Evan Cheng37f25d92008-08-28 23:39:26 +000084
Evan Cheng37f25d92008-08-28 23:39:26 +000085//===----------------------------------------------------------------------===//
Bob Wilson50622ce2010-03-18 23:57:57 +000086// ARM Instruction flags. These need to match ARMBaseInstrInfo.h.
Evan Cheng055b0312009-06-29 07:51:04 +000087//
88
89// Addressing mode.
90class AddrMode<bits<4> val> {
91 bits<4> Value = val;
92}
93def AddrModeNone : AddrMode<0>;
94def AddrMode1 : AddrMode<1>;
95def AddrMode2 : AddrMode<2>;
96def AddrMode3 : AddrMode<3>;
97def AddrMode4 : AddrMode<4>;
98def AddrMode5 : AddrMode<5>;
Bob Wilson8b024a52009-07-01 23:16:05 +000099def AddrMode6 : AddrMode<6>;
100def AddrModeT1_1 : AddrMode<7>;
101def AddrModeT1_2 : AddrMode<8>;
102def AddrModeT1_4 : AddrMode<9>;
103def AddrModeT1_s : AddrMode<10>;
David Goodwine1e52ed2009-07-22 22:24:31 +0000104def AddrModeT2_i12: AddrMode<11>;
Bob Wilson8b024a52009-07-01 23:16:05 +0000105def AddrModeT2_i8 : AddrMode<12>;
106def AddrModeT2_so : AddrMode<13>;
107def AddrModeT2_pc : AddrMode<14>;
108def AddrModeT2_i8s4 : AddrMode<15>;
Evan Cheng055b0312009-06-29 07:51:04 +0000109
110// Instruction size.
111class SizeFlagVal<bits<3> val> {
112 bits<3> Value = val;
113}
114def SizeInvalid : SizeFlagVal<0>; // Unset.
115def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
116def Size8Bytes : SizeFlagVal<2>;
117def Size4Bytes : SizeFlagVal<3>;
118def Size2Bytes : SizeFlagVal<4>;
119
120// Load / store index mode.
121class IndexMode<bits<2> val> {
122 bits<2> Value = val;
123}
124def IndexModeNone : IndexMode<0>;
125def IndexModePre : IndexMode<1>;
126def IndexModePost : IndexMode<2>;
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000127def IndexModeUpd : IndexMode<3>;
Evan Cheng055b0312009-06-29 07:51:04 +0000128
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000129// Instruction execution domain.
130class Domain<bits<2> val> {
131 bits<2> Value = val;
132}
133def GenericDomain : Domain<0>;
134def VFPDomain : Domain<1>; // Instructions in VFP domain only
135def NeonDomain : Domain<2>; // Instructions in Neon domain only
136def VFPNeonDomain : Domain<3>; // Instructions in both VFP & Neon domains
137
Evan Cheng055b0312009-06-29 07:51:04 +0000138//===----------------------------------------------------------------------===//
Evan Cheng37f25d92008-08-28 23:39:26 +0000139
Evan Cheng446c4282009-07-11 06:43:01 +0000140// ARM special operands.
141//
142
143// ARM Predicate operand. Default to 14 = always (AL). Second part is CC
144// register whose default is 0 (no register).
145def pred : PredicateOperand<OtherVT, (ops i32imm, CCR),
146 (ops (i32 14), (i32 zero_reg))> {
147 let PrintMethod = "printPredicateOperand";
148}
149
150// Conditional code result for instructions whose 's' bit is set, e.g. subs.
151def cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 zero_reg))> {
152 let PrintMethod = "printSBitModifierOperand";
153}
154
155// Same as cc_out except it defaults to setting CPSR.
156def s_cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 CPSR))> {
157 let PrintMethod = "printSBitModifierOperand";
158}
159
Johnny Chendd0f3cf2010-03-10 18:59:38 +0000160// ARM special operands for disassembly only.
161//
162
163def cps_opt : Operand<i32> {
164 let PrintMethod = "printCPSOptionOperand";
165}
166
167def msr_mask : Operand<i32> {
168 let PrintMethod = "printMSRMaskOperand";
169}
170
171// A8.6.117, A8.6.118. Different instructions are generated for #0 and #-0.
172// The neg_zero operand translates -0 to -1, -1 to -2, ..., etc.
173def neg_zero : Operand<i32> {
174 let PrintMethod = "printNegZeroOperand";
175}
176
Evan Cheng446c4282009-07-11 06:43:01 +0000177//===----------------------------------------------------------------------===//
178
Evan Cheng37f25d92008-08-28 23:39:26 +0000179// ARM Instruction templates.
180//
181
Johnny Chend68e1192009-12-15 17:24:14 +0000182class InstTemplate<AddrMode am, SizeFlagVal sz, IndexMode im,
183 Format f, Domain d, string cstr, InstrItinClass itin>
Evan Cheng37f25d92008-08-28 23:39:26 +0000184 : Instruction {
185 let Namespace = "ARM";
186
Evan Chengedda31c2008-11-05 18:35:52 +0000187 // TSFlagsFields
Evan Cheng37f25d92008-08-28 23:39:26 +0000188 AddrMode AM = am;
189 bits<4> AddrModeBits = AM.Value;
Bob Wilson01135592010-03-23 17:23:59 +0000190
Evan Cheng37f25d92008-08-28 23:39:26 +0000191 SizeFlagVal SZ = sz;
192 bits<3> SizeFlag = SZ.Value;
193
194 IndexMode IM = im;
195 bits<2> IndexModeBits = IM.Value;
Bob Wilson01135592010-03-23 17:23:59 +0000196
Evan Cheng37f25d92008-08-28 23:39:26 +0000197 Format F = f;
Bob Wilson89ef7b72010-03-17 21:13:43 +0000198 bits<6> Form = F.Value;
Evan Chengedda31c2008-11-05 18:35:52 +0000199
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000200 Domain D = d;
201 bits<2> Dom = D.Value;
202
Evan Chengedda31c2008-11-05 18:35:52 +0000203 //
204 // Attributes specific to ARM instructions...
205 //
206 bit isUnaryDataProc = 0;
Evan Cheng34a0fa32009-07-08 01:46:35 +0000207 bit canXformTo16Bit = 0;
Bob Wilson01135592010-03-23 17:23:59 +0000208
Evan Cheng37f25d92008-08-28 23:39:26 +0000209 let Constraints = cstr;
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000210 let Itinerary = itin;
Evan Cheng37f25d92008-08-28 23:39:26 +0000211}
212
Johnny Chend68e1192009-12-15 17:24:14 +0000213class Encoding {
214 field bits<32> Inst;
215}
216
217class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
218 Format f, Domain d, string cstr, InstrItinClass itin>
219 : InstTemplate<am, sz, im, f, d, cstr, itin>, Encoding;
220
221// This Encoding-less class is used by Thumb1 to specify the encoding bits later
222// on by adding flavors to specific instructions.
223class InstThumb<AddrMode am, SizeFlagVal sz, IndexMode im,
224 Format f, Domain d, string cstr, InstrItinClass itin>
225 : InstTemplate<am, sz, im, f, d, cstr, itin>;
226
Bob Wilson01135592010-03-23 17:23:59 +0000227class PseudoInst<dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000228 string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +0000229 : InstARM<AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, GenericDomain,
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000230 "", itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000231 let OutOperandList = oops;
232 let InOperandList = iops;
233 let AsmString = asm;
234 let Pattern = pattern;
235}
236
237// Almost all ARM instructions are predicable.
Evan Chengd87293c2008-11-06 08:47:38 +0000238class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000239 IndexMode im, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000240 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000241 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000242 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000243 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000244 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng37f25d92008-08-28 23:39:26 +0000245 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
246 let Pattern = pattern;
247 list<Predicate> Predicates = [IsARM];
248}
Jim Grosbachf6b28622009-12-14 18:31:20 +0000249// A few are not predicable
250class InoP<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000251 IndexMode im, Format f, InstrItinClass itin,
252 string opc, string asm, string cstr,
253 list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000254 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
255 let OutOperandList = oops;
256 let InOperandList = iops;
257 let AsmString = !strconcat(opc, asm);
258 let Pattern = pattern;
259 let isPredicable = 0;
260 list<Predicate> Predicates = [IsARM];
261}
Evan Cheng37f25d92008-08-28 23:39:26 +0000262
263// Same as I except it can optionally modify CPSR. Note it's modeled as
264// an input operand since by default it's a zero register. It will
265// become an implicit def once it's "flipped".
Evan Chengd87293c2008-11-06 08:47:38 +0000266class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000267 IndexMode im, Format f, InstrItinClass itin,
268 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000269 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000270 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000271 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000272 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Evan Cheng37f25d92008-08-28 23:39:26 +0000273 let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm));
274 let Pattern = pattern;
275 list<Predicate> Predicates = [IsARM];
276}
277
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000278// Special cases
Evan Chengd87293c2008-11-06 08:47:38 +0000279class XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000280 IndexMode im, Format f, InstrItinClass itin,
281 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000282 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000283 let OutOperandList = oops;
284 let InOperandList = iops;
285 let AsmString = asm;
286 let Pattern = pattern;
287 list<Predicate> Predicates = [IsARM];
288}
289
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000290class AI<dag oops, dag iops, Format f, InstrItinClass itin,
291 string opc, string asm, list<dag> pattern>
292 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
293 opc, asm, "", pattern>;
294class AsI<dag oops, dag iops, Format f, InstrItinClass itin,
295 string opc, string asm, list<dag> pattern>
296 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
297 opc, asm, "", pattern>;
298class AXI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000299 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000300 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng97f48c32008-11-06 22:15:19 +0000301 asm, "", pattern>;
Jim Grosbachf6b28622009-12-14 18:31:20 +0000302class AInoP<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +0000303 string opc, string asm, list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000304 : InoP<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Bob Wilson01135592010-03-23 17:23:59 +0000305 opc, asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000306
307// Ctrl flow instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000308class ABI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
309 string opc, string asm, list<dag> pattern>
310 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
311 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000312 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000313}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000314class ABXI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
315 string asm, list<dag> pattern>
316 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
317 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000318 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000319}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000320class ABXIx2<dag oops, dag iops, InstrItinClass itin,
321 string asm, list<dag> pattern>
322 : XI<oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, BrMiscFrm, itin,
323 asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000324
325// BR_JT instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000326class JTI<dag oops, dag iops, InstrItinClass itin,
327 string asm, list<dag> pattern>
328 : XI<oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BrMiscFrm, itin,
Evan Cheng4df60f52008-11-07 09:06:08 +0000329 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000330
Jim Grosbach5278eb82009-12-11 01:42:04 +0000331
332// Atomic load/store instructions
333
334class AIldrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
335 string opc, string asm, list<dag> pattern>
336 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
337 opc, asm, "", pattern> {
338 let Inst{27-23} = 0b00011;
339 let Inst{22-21} = opcod;
340 let Inst{20} = 1;
341 let Inst{11-0} = 0b111110011111;
342}
343class AIstrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
344 string opc, string asm, list<dag> pattern>
345 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
346 opc, asm, "", pattern> {
347 let Inst{27-23} = 0b00011;
348 let Inst{22-21} = opcod;
349 let Inst{20} = 0;
Johnny Chen0291d7e2009-12-11 19:37:26 +0000350 let Inst{11-4} = 0b11111001;
Jim Grosbach5278eb82009-12-11 01:42:04 +0000351}
352
Evan Cheng0d14fc82008-09-01 01:51:14 +0000353// addrmode1 instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000354class AI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
355 string opc, string asm, list<dag> pattern>
356 : I<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
357 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000358 let Inst{24-21} = opcod;
359 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000360}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000361class AsI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
362 string opc, string asm, list<dag> pattern>
363 : sI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
364 opc, asm, "", pattern> {
365 let Inst{24-21} = opcod;
366 let Inst{27-26} = {0,0};
367}
368class AXI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000369 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000370 : XI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng612b79e2008-08-29 07:40:52 +0000371 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000372 let Inst{24-21} = opcod;
373 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000374}
Bob Wilson01135592010-03-23 17:23:59 +0000375class AI1x2<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000376 string opc, string asm, list<dag> pattern>
377 : I<oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, itin,
378 opc, asm, "", pattern>;
Evan Cheng17222df2008-08-31 19:02:21 +0000379
Evan Cheng0d14fc82008-09-01 01:51:14 +0000380
381// addrmode2 loads and stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000382class AI2<dag oops, dag iops, Format f, InstrItinClass itin,
383 string opc, string asm, list<dag> pattern>
384 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
385 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000386 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000387}
Evan Cheng93912732008-09-01 01:27:33 +0000388
389// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000390class AI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
391 string opc, string asm, list<dag> pattern>
392 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
393 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000394 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000395 let Inst{21} = 0; // W bit
396 let Inst{22} = 0; // B bit
397 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000398 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000399}
Bob Wilson01135592010-03-23 17:23:59 +0000400class AXI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000401 string asm, list<dag> pattern>
402 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000403 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000404 let Inst{20} = 1; // L bit
405 let Inst{21} = 0; // W bit
406 let Inst{22} = 0; // B bit
407 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000408 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000409}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000410class AI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
411 string opc, string asm, list<dag> pattern>
412 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
413 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000414 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000415 let Inst{21} = 0; // W bit
416 let Inst{22} = 1; // B bit
417 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000418 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000419}
Bob Wilson01135592010-03-23 17:23:59 +0000420class AXI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000421 string asm, list<dag> pattern>
422 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000423 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000424 let Inst{20} = 1; // L bit
425 let Inst{21} = 0; // W bit
426 let Inst{22} = 1; // B bit
427 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000428 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000429}
Evan Cheng17222df2008-08-31 19:02:21 +0000430
Evan Cheng93912732008-09-01 01:27:33 +0000431// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000432class AI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
433 string opc, string asm, list<dag> pattern>
434 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
435 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000436 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000437 let Inst{21} = 0; // W bit
438 let Inst{22} = 0; // B bit
439 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000440 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000441}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000442class AXI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
443 string asm, list<dag> pattern>
444 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000445 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000446 let Inst{20} = 0; // L bit
447 let Inst{21} = 0; // W bit
448 let Inst{22} = 0; // B bit
449 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000450 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000451}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000452class AI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
453 string opc, string asm, list<dag> pattern>
454 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
455 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000456 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000457 let Inst{21} = 0; // W bit
458 let Inst{22} = 1; // B bit
459 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000460 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000461}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000462class AXI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
463 string asm, list<dag> pattern>
464 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000465 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000466 let Inst{20} = 0; // L bit
467 let Inst{21} = 0; // W bit
468 let Inst{22} = 1; // B bit
469 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000470 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000471}
Evan Cheng93912732008-09-01 01:27:33 +0000472
Evan Cheng840917b2008-09-01 07:00:14 +0000473// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000474class AI2ldwpr<dag oops, dag iops, Format f, InstrItinClass itin,
475 string opc, string asm, string cstr, list<dag> pattern>
476 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
477 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000478 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000479 let Inst{21} = 1; // W bit
480 let Inst{22} = 0; // B bit
481 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000482 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000483}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000484class AI2ldbpr<dag oops, dag iops, Format f, InstrItinClass itin,
485 string opc, string asm, string cstr, list<dag> pattern>
486 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
487 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000488 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000489 let Inst{21} = 1; // W bit
490 let Inst{22} = 1; // B bit
491 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000492 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000493}
494
Evan Cheng840917b2008-09-01 07:00:14 +0000495// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000496class AI2stwpr<dag oops, dag iops, Format f, InstrItinClass itin,
497 string opc, string asm, string cstr, list<dag> pattern>
498 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
499 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000500 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000501 let Inst{21} = 1; // W bit
502 let Inst{22} = 0; // B bit
503 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000504 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000505}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000506class AI2stbpr<dag oops, dag iops, Format f, InstrItinClass itin,
507 string opc, string asm, string cstr, list<dag> pattern>
508 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
509 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000510 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000511 let Inst{21} = 1; // W bit
512 let Inst{22} = 1; // B bit
513 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000514 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000515}
516
Evan Cheng840917b2008-09-01 07:00:14 +0000517// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000518class AI2ldwpo<dag oops, dag iops, Format f, InstrItinClass itin,
519 string opc, string asm, string cstr, list<dag> pattern>
520 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
521 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000522 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000523 let Inst{21} = 0; // W bit
524 let Inst{22} = 0; // B bit
525 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000526 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000527}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000528class AI2ldbpo<dag oops, dag iops, Format f, InstrItinClass itin,
529 string opc, string asm, string cstr, list<dag> pattern>
530 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
531 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000532 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000533 let Inst{21} = 0; // W bit
534 let Inst{22} = 1; // B bit
535 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000536 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000537}
538
Evan Cheng840917b2008-09-01 07:00:14 +0000539// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000540class AI2stwpo<dag oops, dag iops, Format f, InstrItinClass itin,
541 string opc, string asm, string cstr, list<dag> pattern>
542 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
543 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000544 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000545 let Inst{21} = 0; // W bit
546 let Inst{22} = 0; // B bit
547 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000548 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000549}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000550class AI2stbpo<dag oops, dag iops, Format f, InstrItinClass itin,
551 string opc, string asm, string cstr, list<dag> pattern>
552 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
553 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000554 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000555 let Inst{21} = 0; // W bit
556 let Inst{22} = 1; // B bit
557 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000558 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000559}
560
Evan Cheng0d14fc82008-09-01 01:51:14 +0000561// addrmode3 instructions
Bob Wilson01135592010-03-23 17:23:59 +0000562class AI3<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000563 string opc, string asm, list<dag> pattern>
564 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
565 opc, asm, "", pattern>;
566class AXI3<dag oops, dag iops, Format f, InstrItinClass itin,
567 string asm, list<dag> pattern>
568 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
569 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000570
Evan Cheng840917b2008-09-01 07:00:14 +0000571// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000572class AI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
573 string opc, string asm, list<dag> pattern>
574 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
575 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000576 let Inst{4} = 1;
577 let Inst{5} = 1; // H bit
578 let Inst{6} = 0; // S bit
579 let Inst{7} = 1;
580 let Inst{20} = 1; // L bit
581 let Inst{21} = 0; // W bit
582 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000583 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000584}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000585class AXI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
586 string asm, list<dag> pattern>
587 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000588 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000589 let Inst{4} = 1;
590 let Inst{5} = 1; // H bit
591 let Inst{6} = 0; // S bit
592 let Inst{7} = 1;
593 let Inst{20} = 1; // L bit
594 let Inst{21} = 0; // W bit
595 let Inst{24} = 1; // P bit
596}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000597class AI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
598 string opc, string asm, list<dag> pattern>
599 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
600 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000601 let Inst{4} = 1;
602 let Inst{5} = 1; // H bit
603 let Inst{6} = 1; // S bit
604 let Inst{7} = 1;
605 let Inst{20} = 1; // L bit
606 let Inst{21} = 0; // W bit
607 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000608 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000609}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000610class AXI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
611 string asm, list<dag> pattern>
612 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000613 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000614 let Inst{4} = 1;
615 let Inst{5} = 1; // H bit
616 let Inst{6} = 1; // S bit
617 let Inst{7} = 1;
618 let Inst{20} = 1; // L bit
619 let Inst{21} = 0; // W bit
620 let Inst{24} = 1; // P bit
621}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000622class AI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
623 string opc, string asm, list<dag> pattern>
624 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
625 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000626 let Inst{4} = 1;
627 let Inst{5} = 0; // H bit
628 let Inst{6} = 1; // S bit
629 let Inst{7} = 1;
630 let Inst{20} = 1; // L bit
631 let Inst{21} = 0; // W bit
632 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000633 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000634}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000635class AXI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
636 string asm, list<dag> pattern>
637 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000638 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000639 let Inst{4} = 1;
640 let Inst{5} = 0; // H bit
641 let Inst{6} = 1; // S bit
642 let Inst{7} = 1;
643 let Inst{20} = 1; // L bit
644 let Inst{21} = 0; // W bit
645 let Inst{24} = 1; // P bit
646}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000647class AI3ldd<dag oops, dag iops, Format f, InstrItinClass itin,
648 string opc, string asm, list<dag> pattern>
649 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
650 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000651 let Inst{4} = 1;
652 let Inst{5} = 0; // H bit
653 let Inst{6} = 1; // S bit
654 let Inst{7} = 1;
655 let Inst{20} = 0; // L bit
656 let Inst{21} = 0; // W bit
657 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000658 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000659}
660
661// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000662class AI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
663 string opc, string asm, list<dag> pattern>
664 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
665 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000666 let Inst{4} = 1;
667 let Inst{5} = 1; // H bit
668 let Inst{6} = 0; // S bit
669 let Inst{7} = 1;
670 let Inst{20} = 0; // L bit
671 let Inst{21} = 0; // W bit
672 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000673 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000674}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000675class AXI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
676 string asm, list<dag> pattern>
677 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000678 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000679 let Inst{4} = 1;
680 let Inst{5} = 1; // H bit
681 let Inst{6} = 0; // S bit
682 let Inst{7} = 1;
683 let Inst{20} = 0; // L bit
684 let Inst{21} = 0; // W bit
685 let Inst{24} = 1; // P bit
686}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000687class AI3std<dag oops, dag iops, Format f, InstrItinClass itin,
688 string opc, string asm, list<dag> pattern>
689 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
690 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000691 let Inst{4} = 1;
692 let Inst{5} = 1; // H bit
693 let Inst{6} = 1; // S bit
694 let Inst{7} = 1;
695 let Inst{20} = 0; // L bit
696 let Inst{21} = 0; // W bit
697 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000698 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000699}
700
701// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000702class AI3ldhpr<dag oops, dag iops, Format f, InstrItinClass itin,
703 string opc, string asm, string cstr, list<dag> pattern>
704 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
705 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000706 let Inst{4} = 1;
707 let Inst{5} = 1; // H bit
708 let Inst{6} = 0; // S bit
709 let Inst{7} = 1;
710 let Inst{20} = 1; // L bit
711 let Inst{21} = 1; // W bit
712 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000713 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000714}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000715class AI3ldshpr<dag oops, dag iops, Format f, InstrItinClass itin,
716 string opc, string asm, string cstr, list<dag> pattern>
717 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
718 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000719 let Inst{4} = 1;
720 let Inst{5} = 1; // H bit
721 let Inst{6} = 1; // S bit
722 let Inst{7} = 1;
723 let Inst{20} = 1; // L bit
724 let Inst{21} = 1; // W bit
725 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000726 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000727}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000728class AI3ldsbpr<dag oops, dag iops, Format f, InstrItinClass itin,
729 string opc, string asm, string cstr, list<dag> pattern>
730 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
731 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000732 let Inst{4} = 1;
733 let Inst{5} = 0; // H bit
734 let Inst{6} = 1; // S bit
735 let Inst{7} = 1;
736 let Inst{20} = 1; // L bit
737 let Inst{21} = 1; // W bit
738 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000739 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000740}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000741class AI3lddpr<dag oops, dag iops, Format f, InstrItinClass itin,
742 string opc, string asm, string cstr, list<dag> pattern>
743 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
744 opc, asm, cstr, pattern> {
745 let Inst{4} = 1;
746 let Inst{5} = 0; // H bit
747 let Inst{6} = 1; // S bit
748 let Inst{7} = 1;
749 let Inst{20} = 0; // L bit
750 let Inst{21} = 1; // W bit
751 let Inst{24} = 1; // P bit
752 let Inst{27-25} = 0b000;
753}
754
Evan Cheng840917b2008-09-01 07:00:14 +0000755
756// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000757class AI3sthpr<dag oops, dag iops, Format f, InstrItinClass itin,
758 string opc, string asm, string cstr, list<dag> pattern>
759 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
760 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000761 let Inst{4} = 1;
762 let Inst{5} = 1; // H bit
763 let Inst{6} = 0; // S bit
764 let Inst{7} = 1;
765 let Inst{20} = 0; // L bit
766 let Inst{21} = 1; // W bit
767 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000768 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000769}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000770class AI3stdpr<dag oops, dag iops, Format f, InstrItinClass itin,
771 string opc, string asm, string cstr, list<dag> pattern>
772 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
773 opc, asm, cstr, pattern> {
774 let Inst{4} = 1;
775 let Inst{5} = 1; // H bit
776 let Inst{6} = 1; // S bit
777 let Inst{7} = 1;
778 let Inst{20} = 0; // L bit
779 let Inst{21} = 1; // W bit
780 let Inst{24} = 1; // P bit
781 let Inst{27-25} = 0b000;
782}
Evan Cheng840917b2008-09-01 07:00:14 +0000783
784// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000785class AI3ldhpo<dag oops, dag iops, Format f, InstrItinClass itin,
786 string opc, string asm, string cstr, list<dag> pattern>
787 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
788 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000789 let Inst{4} = 1;
790 let Inst{5} = 1; // H bit
791 let Inst{6} = 0; // S bit
792 let Inst{7} = 1;
793 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000794 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000795 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000796 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000797}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000798class AI3ldshpo<dag oops, dag iops, Format f, InstrItinClass itin,
799 string opc, string asm, string cstr, list<dag> pattern>
800 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
801 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000802 let Inst{4} = 1;
803 let Inst{5} = 1; // H bit
804 let Inst{6} = 1; // S bit
805 let Inst{7} = 1;
806 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000807 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000808 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000809 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000810}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000811class AI3ldsbpo<dag oops, dag iops, Format f, InstrItinClass itin,
812 string opc, string asm, string cstr, list<dag> pattern>
813 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
814 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000815 let Inst{4} = 1;
816 let Inst{5} = 0; // H bit
817 let Inst{6} = 1; // S bit
818 let Inst{7} = 1;
819 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000820 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000821 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000822 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000823}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000824class AI3lddpo<dag oops, dag iops, Format f, InstrItinClass itin,
825 string opc, string asm, string cstr, list<dag> pattern>
826 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
827 opc, asm, cstr, pattern> {
828 let Inst{4} = 1;
829 let Inst{5} = 0; // H bit
830 let Inst{6} = 1; // S bit
831 let Inst{7} = 1;
832 let Inst{20} = 0; // L bit
833 let Inst{21} = 0; // W bit
834 let Inst{24} = 0; // P bit
835 let Inst{27-25} = 0b000;
836}
Evan Cheng840917b2008-09-01 07:00:14 +0000837
838// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000839class AI3sthpo<dag oops, dag iops, Format f, InstrItinClass itin,
840 string opc, string asm, string cstr, list<dag> pattern>
841 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
842 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000843 let Inst{4} = 1;
844 let Inst{5} = 1; // H bit
845 let Inst{6} = 0; // S bit
846 let Inst{7} = 1;
847 let Inst{20} = 0; // L bit
Johnny Chenad4df4c2010-03-01 19:22:00 +0000848 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000849 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000850 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000851}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000852class AI3stdpo<dag oops, dag iops, Format f, InstrItinClass itin,
853 string opc, string asm, string cstr, list<dag> pattern>
854 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
855 opc, asm, cstr, pattern> {
856 let Inst{4} = 1;
857 let Inst{5} = 1; // H bit
858 let Inst{6} = 1; // S bit
859 let Inst{7} = 1;
860 let Inst{20} = 0; // L bit
861 let Inst{21} = 0; // W bit
862 let Inst{24} = 0; // P bit
863 let Inst{27-25} = 0b000;
864}
Evan Cheng840917b2008-09-01 07:00:14 +0000865
Evan Cheng0d14fc82008-09-01 01:51:14 +0000866// addrmode4 instructions
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000867class AXI4ld<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000868 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000869 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000870 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000871 let Inst{20} = 1; // L bit
872 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000873 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000874}
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000875class AXI4st<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000876 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000877 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000878 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000879 let Inst{20} = 0; // L bit
880 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000881 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000882}
Evan Cheng37f25d92008-08-28 23:39:26 +0000883
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000884// Unsigned multiply, multiply-accumulate instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000885class AMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
886 string opc, string asm, list<dag> pattern>
887 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
888 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000889 let Inst{7-4} = 0b1001;
Evan Chengfbc9d412008-11-06 01:21:28 +0000890 let Inst{20} = 0; // S bit
Evan Chengd87293c2008-11-06 08:47:38 +0000891 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000892}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000893class AsMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
894 string opc, string asm, list<dag> pattern>
895 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
896 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000897 let Inst{7-4} = 0b1001;
Evan Chengd87293c2008-11-06 08:47:38 +0000898 let Inst{27-21} = opcod;
Evan Chengfbc9d412008-11-06 01:21:28 +0000899}
900
901// Most significant word multiply
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000902class AMul2I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
903 string opc, string asm, list<dag> pattern>
904 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
905 opc, asm, "", pattern> {
Evan Chengfbc9d412008-11-06 01:21:28 +0000906 let Inst{7-4} = 0b1001;
907 let Inst{20} = 1;
Evan Chengd87293c2008-11-06 08:47:38 +0000908 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000909}
Evan Cheng37f25d92008-08-28 23:39:26 +0000910
Evan Chengeb4f52e2008-11-06 03:35:07 +0000911// SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000912class AMulxyI<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
913 string opc, string asm, list<dag> pattern>
914 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
915 opc, asm, "", pattern> {
Evan Chengeb4f52e2008-11-06 03:35:07 +0000916 let Inst{4} = 0;
917 let Inst{7} = 1;
918 let Inst{20} = 0;
Evan Chengd87293c2008-11-06 08:47:38 +0000919 let Inst{27-21} = opcod;
Evan Chengeb4f52e2008-11-06 03:35:07 +0000920}
921
Evan Cheng97f48c32008-11-06 22:15:19 +0000922// Extend instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000923class AExtI<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
924 string opc, string asm, list<dag> pattern>
925 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ExtFrm, itin,
926 opc, asm, "", pattern> {
Evan Cheng97f48c32008-11-06 22:15:19 +0000927 let Inst{7-4} = 0b0111;
928 let Inst{27-20} = opcod;
929}
930
Evan Cheng8b59db32008-11-07 01:41:35 +0000931// Misc Arithmetic instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000932class AMiscA1I<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
933 string opc, string asm, list<dag> pattern>
934 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ArithMiscFrm, itin,
935 opc, asm, "", pattern> {
Evan Cheng8b59db32008-11-07 01:41:35 +0000936 let Inst{27-20} = opcod;
937}
938
Evan Cheng37f25d92008-08-28 23:39:26 +0000939//===----------------------------------------------------------------------===//
940
941// ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
942class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
943 list<Predicate> Predicates = [IsARM];
944}
945class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
946 list<Predicate> Predicates = [IsARM, HasV5TE];
947}
948class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
949 list<Predicate> Predicates = [IsARM, HasV6];
950}
Evan Cheng13096642008-08-29 06:41:12 +0000951
952//===----------------------------------------------------------------------===//
953//
954// Thumb Instruction Format Definitions.
955//
956
Evan Cheng13096642008-08-29 06:41:12 +0000957// TI - Thumb instruction.
958
Evan Cheng446c4282009-07-11 06:43:01 +0000959class ThumbI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000960 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000961 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000962 let OutOperandList = oops;
963 let InOperandList = iops;
Evan Cheng13096642008-08-29 06:41:12 +0000964 let AsmString = asm;
965 let Pattern = pattern;
966 list<Predicate> Predicates = [IsThumb];
967}
968
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000969class TI<dag oops, dag iops, InstrItinClass itin, string asm, list<dag> pattern>
970 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000971
Evan Cheng35d6c412009-08-04 23:47:55 +0000972// Two-address instructions
Bob Wilson01135592010-03-23 17:23:59 +0000973class TIt<dag oops, dag iops, InstrItinClass itin, string asm,
974 list<dag> pattern>
975 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "$lhs = $dst",
976 pattern>;
Evan Cheng35d6c412009-08-04 23:47:55 +0000977
Johnny Chend68e1192009-12-15 17:24:14 +0000978// tBL, tBX 32-bit instructions
979class TIx2<bits<5> opcod1, bits<2> opcod2, bit opcod3,
Bob Wilson01135592010-03-23 17:23:59 +0000980 dag oops, dag iops, InstrItinClass itin, string asm,
981 list<dag> pattern>
982 : ThumbI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>,
983 Encoding {
Johnny Chend68e1192009-12-15 17:24:14 +0000984 let Inst{31-27} = opcod1;
985 let Inst{15-14} = opcod2;
986 let Inst{12} = opcod3;
987}
Evan Cheng13096642008-08-29 06:41:12 +0000988
989// BR_JT instructions
Bob Wilson01135592010-03-23 17:23:59 +0000990class TJTI<dag oops, dag iops, InstrItinClass itin, string asm,
991 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000992 : ThumbI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000993
Evan Cheng09c39fc2009-06-23 19:38:13 +0000994// Thumb1 only
Evan Cheng446c4282009-07-11 06:43:01 +0000995class Thumb1I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000996 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000997 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000998 let OutOperandList = oops;
999 let InOperandList = iops;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001000 let AsmString = asm;
1001 let Pattern = pattern;
1002 list<Predicate> Predicates = [IsThumb1Only];
1003}
1004
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001005class T1I<dag oops, dag iops, InstrItinClass itin,
1006 string asm, list<dag> pattern>
1007 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
1008class T1Ix2<dag oops, dag iops, InstrItinClass itin,
1009 string asm, list<dag> pattern>
1010 : Thumb1I<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1011class T1JTI<dag oops, dag iops, InstrItinClass itin,
1012 string asm, list<dag> pattern>
Johnny Chenbbc71b22009-12-16 02:32:54 +00001013 : Thumb1I<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001014
1015// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001016class T1It<dag oops, dag iops, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001017 string asm, string cstr, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001018 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001019 asm, cstr, pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001020
1021// Thumb1 instruction that can either be predicated or set CPSR.
1022class Thumb1sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001023 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001024 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001025 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Chris Lattnerb7d52262010-03-18 21:06:54 +00001026 let OutOperandList = !con(oops, (outs s_cc_out:$s));
1027 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001028 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1029 let Pattern = pattern;
1030 list<Predicate> Predicates = [IsThumb1Only];
1031}
1032
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001033class T1sI<dag oops, dag iops, InstrItinClass itin,
1034 string opc, string asm, list<dag> pattern>
1035 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001036
1037// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001038class T1sIt<dag oops, dag iops, InstrItinClass itin,
1039 string opc, string asm, list<dag> pattern>
1040 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001041 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001042
1043// Thumb1 instruction that can be predicated.
1044class Thumb1pI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001045 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001046 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001047 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +00001048 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001049 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001050 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1051 let Pattern = pattern;
1052 list<Predicate> Predicates = [IsThumb1Only];
1053}
1054
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001055class T1pI<dag oops, dag iops, InstrItinClass itin,
1056 string opc, string asm, list<dag> pattern>
1057 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001058
1059// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001060class T1pIt<dag oops, dag iops, InstrItinClass itin,
1061 string opc, string asm, list<dag> pattern>
1062 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001063 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001064
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001065class T1pI1<dag oops, dag iops, InstrItinClass itin,
1066 string opc, string asm, list<dag> pattern>
1067 : Thumb1pI<oops, iops, AddrModeT1_1, Size2Bytes, itin, opc, asm, "", pattern>;
1068class T1pI2<dag oops, dag iops, InstrItinClass itin,
1069 string opc, string asm, list<dag> pattern>
1070 : Thumb1pI<oops, iops, AddrModeT1_2, Size2Bytes, itin, opc, asm, "", pattern>;
1071class T1pI4<dag oops, dag iops, InstrItinClass itin,
1072 string opc, string asm, list<dag> pattern>
1073 : Thumb1pI<oops, iops, AddrModeT1_4, Size2Bytes, itin, opc, asm, "", pattern>;
Bob Wilson01135592010-03-23 17:23:59 +00001074class T1pIs<dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001075 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1076 : Thumb1pI<oops, iops, AddrModeT1_s, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001077
Johnny Chenbbc71b22009-12-16 02:32:54 +00001078class Encoding16 : Encoding {
1079 let Inst{31-16} = 0x0000;
1080}
1081
Johnny Chend68e1192009-12-15 17:24:14 +00001082// A6.2 16-bit Thumb instruction encoding
Johnny Chenbbc71b22009-12-16 02:32:54 +00001083class T1Encoding<bits<6> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001084 let Inst{15-10} = opcode;
1085}
1086
1087// A6.2.1 Shift (immediate), add, subtract, move, and compare encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001088class T1General<bits<5> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001089 let Inst{15-14} = 0b00;
1090 let Inst{13-9} = opcode;
1091}
1092
1093// A6.2.2 Data-processing encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001094class T1DataProcessing<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001095 let Inst{15-10} = 0b010000;
1096 let Inst{9-6} = opcode;
1097}
1098
1099// A6.2.3 Special data instructions and branch and exchange encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001100class T1Special<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001101 let Inst{15-10} = 0b010001;
1102 let Inst{9-6} = opcode;
1103}
1104
1105// A6.2.4 Load/store single data item encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001106class T1LoadStore<bits<4> opA, bits<3> opB> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001107 let Inst{15-12} = opA;
1108 let Inst{11-9} = opB;
1109}
1110class T1LdSt<bits<3> opB> : T1LoadStore<0b0101, opB>;
1111class T1LdSt4Imm<bits<3> opB> : T1LoadStore<0b0110, opB>; // Immediate, 4 bytes
1112class T1LdSt1Imm<bits<3> opB> : T1LoadStore<0b0111, opB>; // Immediate, 1 byte
1113class T1LdSt2Imm<bits<3> opB> : T1LoadStore<0b1000, opB>; // Immediate, 2 bytes
1114class T1LdStSP<bits<3> opB> : T1LoadStore<0b1001, opB>; // SP relative
1115
1116// A6.2.5 Miscellaneous 16-bit instructions encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001117class T1Misc<bits<7> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001118 let Inst{15-12} = 0b1011;
1119 let Inst{11-5} = opcode;
1120}
1121
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001122// Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
1123class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001124 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001125 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001126 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001127 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001128 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001129 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1130 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001131 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001132}
1133
1134// Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as
1135// an input operand since by default it's a zero register. It will
1136// become an implicit def once it's "flipped".
1137// FIXME: This uses unified syntax so {s} comes before {p}. We should make it
1138// more consistent.
1139class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001140 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001141 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001142 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001143 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001144 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001145 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1146 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001147 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001148}
1149
1150// Special cases
1151class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001152 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001153 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001154 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001155 let OutOperandList = oops;
1156 let InOperandList = iops;
Evan Chengf49810c2009-06-23 17:48:47 +00001157 let AsmString = asm;
1158 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001159 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001160}
1161
Jim Grosbachd1228742009-12-01 18:10:36 +00001162class ThumbXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +00001163 InstrItinClass itin,
1164 string asm, string cstr, list<dag> pattern>
Jim Grosbachd1228742009-12-01 18:10:36 +00001165 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1166 let OutOperandList = oops;
1167 let InOperandList = iops;
1168 let AsmString = asm;
1169 let Pattern = pattern;
1170 list<Predicate> Predicates = [IsThumb1Only];
1171}
1172
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001173class T2I<dag oops, dag iops, InstrItinClass itin,
1174 string opc, string asm, list<dag> pattern>
1175 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
1176class T2Ii12<dag oops, dag iops, InstrItinClass itin,
1177 string opc, string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001178 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, itin, opc, asm, "",pattern>;
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001179class T2Ii8<dag oops, dag iops, InstrItinClass itin,
1180 string opc, string asm, list<dag> pattern>
1181 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, itin, opc, asm, "", pattern>;
1182class T2Iso<dag oops, dag iops, InstrItinClass itin,
1183 string opc, string asm, list<dag> pattern>
1184 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, itin, opc, asm, "", pattern>;
1185class T2Ipc<dag oops, dag iops, InstrItinClass itin,
1186 string opc, string asm, list<dag> pattern>
1187 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, itin, opc, asm, "", pattern>;
Johnny Chend68e1192009-12-15 17:24:14 +00001188class T2Ii8s4<bit P, bit W, bit load, dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001189 string opc, string asm, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001190 : Thumb2I<oops, iops, AddrModeT2_i8s4, Size4Bytes, itin, opc, asm, "",
1191 pattern> {
1192 let Inst{31-27} = 0b11101;
1193 let Inst{26-25} = 0b00;
1194 let Inst{24} = P;
1195 let Inst{23} = ?; // The U bit.
1196 let Inst{22} = 1;
1197 let Inst{21} = W;
1198 let Inst{20} = load;
1199}
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001200
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001201class T2sI<dag oops, dag iops, InstrItinClass itin,
1202 string opc, string asm, list<dag> pattern>
1203 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001204
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001205class T2XI<dag oops, dag iops, InstrItinClass itin,
1206 string asm, list<dag> pattern>
1207 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1208class T2JTI<dag oops, dag iops, InstrItinClass itin,
1209 string asm, list<dag> pattern>
1210 : Thumb2XI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Chengf49810c2009-06-23 17:48:47 +00001211
Evan Cheng5adb66a2009-09-28 09:14:39 +00001212class T2Ix2<dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001213 string opc, string asm, list<dag> pattern>
Evan Cheng5adb66a2009-09-28 09:14:39 +00001214 : Thumb2I<oops, iops, AddrModeNone, Size8Bytes, itin, opc, asm, "", pattern>;
1215
Bob Wilson815baeb2010-03-13 01:08:20 +00001216// Two-address instructions
1217class T2XIt<dag oops, dag iops, InstrItinClass itin,
1218 string asm, string cstr, list<dag> pattern>
1219 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, cstr, pattern>;
Evan Cheng5adb66a2009-09-28 09:14:39 +00001220
Evan Chenge88d5ce2009-07-02 07:28:31 +00001221// T2Iidxldst - Thumb2 indexed load / store instructions.
Johnny Chend68e1192009-12-15 17:24:14 +00001222class T2Iidxldst<bit signed, bits<2> opcod, bit load, bit pre,
1223 dag oops, dag iops,
1224 AddrMode am, IndexMode im, InstrItinClass itin,
Evan Chenge88d5ce2009-07-02 07:28:31 +00001225 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001226 : InstARM<am, Size4Bytes, im, ThumbFrm, GenericDomain, cstr, itin> {
Evan Chenge88d5ce2009-07-02 07:28:31 +00001227 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001228 let InOperandList = !con(iops, (ins pred:$p));
Evan Chenge88d5ce2009-07-02 07:28:31 +00001229 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1230 let Pattern = pattern;
1231 list<Predicate> Predicates = [IsThumb2];
Johnny Chend68e1192009-12-15 17:24:14 +00001232 let Inst{31-27} = 0b11111;
1233 let Inst{26-25} = 0b00;
1234 let Inst{24} = signed;
1235 let Inst{23} = 0;
1236 let Inst{22-21} = opcod;
1237 let Inst{20} = load;
1238 let Inst{11} = 1;
1239 // (P, W) = (1, 1) Pre-indexed or (0, 1) Post-indexed
1240 let Inst{10} = pre; // The P bit.
1241 let Inst{8} = 1; // The W bit.
Evan Chenge88d5ce2009-07-02 07:28:31 +00001242}
1243
Johnny Chenadc77332010-02-26 22:04:29 +00001244// Helper class for disassembly only
1245// A6.3.16 & A6.3.17
1246// T2Imac - Thumb2 multiply [accumulate, and absolute difference] instructions.
1247class T2I_mac<bit long, bits<3> op22_20, bits<4> op7_4, dag oops, dag iops,
1248 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1249 : T2I<oops, iops, itin, opc, asm, pattern> {
1250 let Inst{31-27} = 0b11111;
1251 let Inst{26-24} = 0b011;
1252 let Inst{23} = long;
1253 let Inst{22-20} = op22_20;
1254 let Inst{7-4} = op7_4;
1255}
1256
David Goodwinc9d138f2009-07-27 19:59:26 +00001257// Tv5Pat - Same as Pat<>, but requires V5T Thumb mode.
1258class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
1259 list<Predicate> Predicates = [IsThumb1Only, HasV5T];
1260}
1261
1262// T1Pat - Same as Pat<>, but requires that the compiler be in Thumb1 mode.
1263class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
1264 list<Predicate> Predicates = [IsThumb1Only];
1265}
Evan Chenge88d5ce2009-07-02 07:28:31 +00001266
Evan Cheng9cb9e672009-06-27 02:26:13 +00001267// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
1268class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Chengd770d9e2009-07-02 06:38:40 +00001269 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001270}
1271
Evan Cheng13096642008-08-29 06:41:12 +00001272//===----------------------------------------------------------------------===//
1273
Evan Cheng96581d32008-11-11 02:11:05 +00001274//===----------------------------------------------------------------------===//
1275// ARM VFP Instruction templates.
1276//
1277
David Goodwin3ca524e2009-07-10 17:03:29 +00001278// Almost all VFP instructions are predicable.
1279class VFPI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001280 IndexMode im, Format f, InstrItinClass itin,
1281 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001282 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001283 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001284 let InOperandList = !con(iops, (ins pred:$p));
David Goodwin3ca524e2009-07-10 17:03:29 +00001285 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1286 let Pattern = pattern;
1287 list<Predicate> Predicates = [HasVFP2];
1288}
1289
1290// Special cases
1291class VFPXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001292 IndexMode im, Format f, InstrItinClass itin,
1293 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001294 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001295 let OutOperandList = oops;
1296 let InOperandList = iops;
1297 let AsmString = asm;
1298 let Pattern = pattern;
1299 list<Predicate> Predicates = [HasVFP2];
1300}
1301
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001302class VFPAI<dag oops, dag iops, Format f, InstrItinClass itin,
1303 string opc, string asm, list<dag> pattern>
1304 : VFPI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
1305 opc, asm, "", pattern>;
David Goodwin3ca524e2009-07-10 17:03:29 +00001306
Evan Chengcd8e66a2008-11-11 21:48:44 +00001307// ARM VFP addrmode5 loads and stores
1308class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001309 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001310 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001311 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001312 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001313 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001314 let Inst{27-24} = opcod1;
1315 let Inst{21-20} = opcod2;
1316 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001317
1318 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1319 let Dom = VFPNeonDomain.Value;
Evan Cheng96581d32008-11-11 02:11:05 +00001320}
1321
Evan Chengcd8e66a2008-11-11 21:48:44 +00001322class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001323 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001324 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001325 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001326 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001327 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001328 let Inst{27-24} = opcod1;
1329 let Inst{21-20} = opcod2;
1330 let Inst{11-8} = 0b1010;
Evan Cheng96581d32008-11-11 02:11:05 +00001331}
1332
Evan Chengcd8e66a2008-11-11 21:48:44 +00001333// Load / store multiple
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001334class AXDI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001335 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001336 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001337 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001338 // TODO: Mark the instructions with the appropriate subtarget info.
1339 let Inst{27-25} = 0b110;
1340 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001341
1342 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1343 let Dom = VFPNeonDomain.Value;
Evan Chengcd8e66a2008-11-11 21:48:44 +00001344}
1345
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001346class AXSI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001347 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001348 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001349 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001350 // TODO: Mark the instructions with the appropriate subtarget info.
1351 let Inst{27-25} = 0b110;
1352 let Inst{11-8} = 0b1010;
1353}
1354
Evan Cheng96581d32008-11-11 02:11:05 +00001355// Double precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001356class ADuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1357 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1358 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001359 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001360 let Inst{27-23} = opcod1;
1361 let Inst{21-20} = opcod2;
1362 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001363 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001364 let Inst{7-6} = opcod4;
1365 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001366}
1367
1368// Double precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001369class ADbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001370 dag iops, InstrItinClass itin, string opc, string asm,
1371 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001372 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001373 let Inst{27-23} = opcod1;
1374 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001375 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001376 let Inst{6} = op6;
1377 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001378}
1379
Jim Grosbach26767372010-03-24 22:31:46 +00001380// Double precision, binary, VML[AS] (for additional predicate)
1381class ADbI_vmlX<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
1382 dag iops, InstrItinClass itin, string opc, string asm,
1383 list<dag> pattern>
1384 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
1385 let Inst{27-23} = opcod1;
1386 let Inst{21-20} = opcod2;
1387 let Inst{11-8} = 0b1011;
1388 let Inst{6} = op6;
1389 let Inst{4} = op4;
1390 list<Predicate> Predicates = [HasVFP2, UseVMLx];
1391}
1392
1393
Evan Cheng96581d32008-11-11 02:11:05 +00001394// Single precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001395class ASuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1396 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1397 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001398 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001399 let Inst{27-23} = opcod1;
1400 let Inst{21-20} = opcod2;
1401 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001402 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001403 let Inst{7-6} = opcod4;
1404 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001405}
1406
David Goodwin338268c2009-08-10 22:17:39 +00001407// Single precision unary, if no NEON
David Goodwin53e44712009-08-04 20:39:05 +00001408// Same as ASuI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001409class ASuIn<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1410 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1411 string asm, list<dag> pattern>
1412 : ASuI<opcod1, opcod2, opcod3, opcod4, opcod5, oops, iops, itin, opc, asm,
1413 pattern> {
David Goodwin53e44712009-08-04 20:39:05 +00001414 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1415}
1416
Evan Cheng96581d32008-11-11 02:11:05 +00001417// Single precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001418class ASbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops, dag iops,
1419 InstrItinClass itin, string opc, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001420 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001421 let Inst{27-23} = opcod1;
1422 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001423 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001424 let Inst{6} = op6;
1425 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001426}
1427
David Goodwin338268c2009-08-10 22:17:39 +00001428// Single precision binary, if no NEON
David Goodwin42a83f22009-08-04 17:53:06 +00001429// Same as ASbI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001430class ASbIn<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001431 dag iops, InstrItinClass itin, string opc, string asm,
1432 list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001433 : ASbI<opcod1, opcod2, op6, op4, oops, iops, itin, opc, asm, pattern> {
David Goodwin42a83f22009-08-04 17:53:06 +00001434 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1435}
1436
Evan Cheng80a11982008-11-12 06:41:41 +00001437// VFP conversion instructions
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001438class AVConv1I<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
1439 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1440 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001441 : VFPAI<oops, iops, VFPConv1Frm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001442 let Inst{27-23} = opcod1;
1443 let Inst{21-20} = opcod2;
1444 let Inst{19-16} = opcod3;
1445 let Inst{11-8} = opcod4;
Evan Cheng80a11982008-11-12 06:41:41 +00001446 let Inst{6} = 1;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001447 let Inst{4} = 0;
Evan Cheng80a11982008-11-12 06:41:41 +00001448}
1449
Johnny Chen811663f2010-02-11 18:47:03 +00001450// VFP conversion between floating-point and fixed-point
1451class AVConv1XI<bits<5> op1, bits<2> op2, bits<4> op3, bits<4> op4, bit op5,
Bob Wilson01135592010-03-23 17:23:59 +00001452 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1453 list<dag> pattern>
Johnny Chen811663f2010-02-11 18:47:03 +00001454 : AVConv1I<op1, op2, op3, op4, oops, iops, itin, opc, asm, pattern> {
1455 // size (fixed-point number): sx == 0 ? 16 : 32
1456 let Inst{7} = op5; // sx
1457}
1458
David Goodwin338268c2009-08-10 22:17:39 +00001459// VFP conversion instructions, if no NEON
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001460class AVConv1In<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
David Goodwin338268c2009-08-10 22:17:39 +00001461 dag oops, dag iops, InstrItinClass itin,
1462 string opc, string asm, list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001463 : AVConv1I<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
1464 pattern> {
David Goodwin338268c2009-08-10 22:17:39 +00001465 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1466}
1467
Evan Cheng80a11982008-11-12 06:41:41 +00001468class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001469 InstrItinClass itin,
1470 string opc, string asm, list<dag> pattern>
1471 : VFPAI<oops, iops, f, itin, opc, asm, pattern> {
Evan Cheng80a11982008-11-12 06:41:41 +00001472 let Inst{27-20} = opcod1;
Evan Cheng78be83d2008-11-11 19:40:26 +00001473 let Inst{11-8} = opcod2;
1474 let Inst{4} = 1;
1475}
1476
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001477class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1478 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1479 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, itin, opc, asm, pattern>;
Evan Cheng0a0ab132008-11-11 22:46:12 +00001480
Bob Wilson01135592010-03-23 17:23:59 +00001481class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001482 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1483 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001484
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001485class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1486 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1487 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001488
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001489class AVConv5I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1490 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1491 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv5Frm, itin, opc, asm, pattern>;
Evan Cheng78be83d2008-11-11 19:40:26 +00001492
Evan Cheng96581d32008-11-11 02:11:05 +00001493//===----------------------------------------------------------------------===//
1494
Bob Wilson5bafff32009-06-22 23:27:02 +00001495//===----------------------------------------------------------------------===//
1496// ARM NEON Instruction templates.
1497//
Evan Cheng13096642008-08-29 06:41:12 +00001498
Johnny Chencaa608e2010-03-20 00:17:00 +00001499class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1500 InstrItinClass itin, string opc, string dt, string asm, string cstr,
1501 list<dag> pattern>
1502 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Evan Chengf81bf152009-11-23 21:57:23 +00001503 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001504 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001505 let AsmString = !strconcat(
1506 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1507 !strconcat("\t", asm));
1508 let Pattern = pattern;
1509 list<Predicate> Predicates = [HasNEON];
1510}
1511
1512// Same as NeonI except it does not have a "data type" specifier.
Johnny Chen927b88f2010-03-23 20:40:44 +00001513class NeonXI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1514 InstrItinClass itin, string opc, string asm, string cstr,
1515 list<dag> pattern>
1516 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001517 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001518 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001519 let AsmString = !strconcat(!strconcat(opc, "${p}"), !strconcat("\t", asm));
Bob Wilson5bafff32009-06-22 23:27:02 +00001520 let Pattern = pattern;
1521 list<Predicate> Predicates = [HasNEON];
Evan Cheng13096642008-08-29 06:41:12 +00001522}
1523
Bob Wilsonb07c1712009-10-07 21:53:04 +00001524class NLdSt<bit op23, bits<2> op21_20, bits<4> op11_8, bits<4> op7_4,
1525 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001526 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chencaa608e2010-03-20 00:17:00 +00001527 : NeonI<oops, iops, AddrMode6, IndexModeNone, NLdStFrm, itin, opc, dt, asm,
1528 cstr, pattern> {
Bob Wilson205a5ca2009-07-08 18:11:30 +00001529 let Inst{31-24} = 0b11110100;
Jim Grosbach780d2072009-10-20 00:19:08 +00001530 let Inst{23} = op23;
1531 let Inst{21-20} = op21_20;
1532 let Inst{11-8} = op11_8;
1533 let Inst{7-4} = op7_4;
Bob Wilson205a5ca2009-07-08 18:11:30 +00001534}
1535
Johnny Chen785516a2010-03-23 16:43:47 +00001536class NDataI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001537 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chen785516a2010-03-23 16:43:47 +00001538 : NeonI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, dt, asm, cstr,
1539 pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001540 let Inst{31-25} = 0b1111001;
1541}
1542
Johnny Chen927b88f2010-03-23 20:40:44 +00001543class NDataXI<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001544 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chen927b88f2010-03-23 20:40:44 +00001545 : NeonXI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001546 cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001547 let Inst{31-25} = 0b1111001;
1548}
1549
1550// NEON "one register and a modified immediate" format.
1551class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1552 bit op5, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001553 dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001554 string opc, string dt, string asm, string cstr,
1555 list<dag> pattern>
Johnny Chena2711742010-03-23 23:09:14 +00001556 : NDataI<oops, iops, N1RegModImmFrm, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001557 let Inst{23} = op23;
1558 let Inst{21-19} = op21_19;
1559 let Inst{11-8} = op11_8;
1560 let Inst{7} = op7;
1561 let Inst{6} = op6;
1562 let Inst{5} = op5;
1563 let Inst{4} = op4;
1564}
1565
1566// NEON 2 vector register format.
1567class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1568 bits<5> op11_7, bit op6, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001569 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001570 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001571 : NDataI<oops, iops, N2RegFrm, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001572 let Inst{24-23} = op24_23;
1573 let Inst{21-20} = op21_20;
1574 let Inst{19-18} = op19_18;
1575 let Inst{17-16} = op17_16;
1576 let Inst{11-7} = op11_7;
1577 let Inst{6} = op6;
1578 let Inst{4} = op4;
1579}
1580
1581// Same as N2V except it doesn't have a datatype suffix.
1582class N2VX<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
Bob Wilson01135592010-03-23 17:23:59 +00001583 bits<5> op11_7, bit op6, bit op4,
1584 dag oops, dag iops, InstrItinClass itin,
1585 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001586 : NDataXI<oops, iops, N2RegFrm, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001587 let Inst{24-23} = op24_23;
1588 let Inst{21-20} = op21_20;
1589 let Inst{19-18} = op19_18;
1590 let Inst{17-16} = op17_16;
1591 let Inst{11-7} = op11_7;
1592 let Inst{6} = op6;
1593 let Inst{4} = op4;
1594}
1595
1596// NEON 2 vector register with immediate.
Bob Wilson507df402009-10-21 02:15:46 +00001597class N2VImm<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
Johnny Chenfa80bec2010-03-25 20:39:04 +00001598 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001599 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenfa80bec2010-03-25 20:39:04 +00001600 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001601 let Inst{24} = op24;
1602 let Inst{23} = op23;
Bob Wilson5bafff32009-06-22 23:27:02 +00001603 let Inst{11-8} = op11_8;
1604 let Inst{7} = op7;
1605 let Inst{6} = op6;
1606 let Inst{4} = op4;
1607}
1608
Bob Wilson10bc69c2010-03-27 03:56:52 +00001609// NEON 3 vector register format.
1610class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
1611 dag oops, dag iops, Format f, InstrItinClass itin,
1612 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenc6e704d2010-03-26 21:26:28 +00001613 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001614 let Inst{24} = op24;
1615 let Inst{23} = op23;
1616 let Inst{21-20} = op21_20;
1617 let Inst{11-8} = op11_8;
1618 let Inst{6} = op6;
1619 let Inst{4} = op4;
1620}
1621
Johnny Chen841e8282010-03-23 21:35:03 +00001622// Same as N3V except it doesn't have a data type suffix.
Bob Wilson01135592010-03-23 17:23:59 +00001623class N3VX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
1624 bit op4,
Bob Wilson10bc69c2010-03-27 03:56:52 +00001625 dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001626 string opc, string asm, string cstr, list<dag> pattern>
Bob Wilson10bc69c2010-03-27 03:56:52 +00001627 : NDataXI<oops, iops, f, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001628 let Inst{24} = op24;
1629 let Inst{23} = op23;
1630 let Inst{21-20} = op21_20;
1631 let Inst{11-8} = op11_8;
1632 let Inst{6} = op6;
1633 let Inst{4} = op4;
1634}
1635
1636// NEON VMOVs between scalar and core registers.
1637class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001638 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001639 string opc, string dt, string asm, list<dag> pattern>
1640 : InstARM<AddrModeNone, Size4Bytes, IndexModeNone, f, GenericDomain,
Bob Wilson01135592010-03-23 17:23:59 +00001641 "", itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001642 let Inst{27-20} = opcod1;
1643 let Inst{11-8} = opcod2;
1644 let Inst{6-5} = opcod3;
1645 let Inst{4} = 1;
Evan Chengf81bf152009-11-23 21:57:23 +00001646
1647 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001648 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001649 let AsmString = !strconcat(
1650 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1651 !strconcat("\t", asm));
1652 let Pattern = pattern;
Bob Wilson5bafff32009-06-22 23:27:02 +00001653 list<Predicate> Predicates = [HasNEON];
1654}
1655class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001656 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001657 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001658 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONGetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001659 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001660class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001661 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001662 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001663 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONSetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001664 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001665class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001666 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001667 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001668 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONDupFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001669 opc, dt, asm, pattern>;
David Goodwin42a83f22009-08-04 17:53:06 +00001670
Johnny Chene4614f72010-03-25 17:01:27 +00001671// Vector Duplicate Lane (from scalar to all elements)
1672class NVDupLane<bits<4> op19_16, bit op6, dag oops, dag iops,
1673 InstrItinClass itin, string opc, string dt, string asm,
1674 list<dag> pattern>
Johnny Chen2d2898e2010-03-25 21:49:12 +00001675 : NDataI<oops, iops, NVDupLnFrm, itin, opc, dt, asm, "", pattern> {
Johnny Chene4614f72010-03-25 17:01:27 +00001676 let Inst{24-23} = 0b11;
1677 let Inst{21-20} = 0b11;
1678 let Inst{19-16} = op19_16;
1679 let Inst{11-7} = 0b11000;
1680 let Inst{6} = op6;
1681 let Inst{4} = 0;
1682}
1683
David Goodwin42a83f22009-08-04 17:53:06 +00001684// NEONFPPat - Same as Pat<>, but requires that the compiler be using NEON
1685// for single-precision FP.
1686class NEONFPPat<dag pattern, dag result> : Pat<pattern, result> {
1687 list<Predicate> Predicates = [HasNEON,UseNEONForFP];
1688}