blob: 3504d0add32eac3033b2d2a5130c5773628233ea [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 Chencaa608e2010-03-20 00:17:00 +000070
Evan Cheng34a0fa32009-07-08 01:46:35 +000071// Misc flags.
72
Evan Chengedda31c2008-11-05 18:35:52 +000073// the instruction has a Rn register operand.
Evan Cheng34a0fa32009-07-08 01:46:35 +000074// UnaryDP - Indicates this is a unary data processing instruction, i.e.
75// it doesn't have a Rn operand.
76class UnaryDP { bit isUnaryDataProc = 1; }
77
78// Xform16Bit - Indicates this Thumb2 instruction may be transformed into
79// a 16-bit Thumb instruction if certain conditions are met.
80class Xform16Bit { bit canXformTo16Bit = 1; }
Evan Cheng37f25d92008-08-28 23:39:26 +000081
Evan Cheng37f25d92008-08-28 23:39:26 +000082//===----------------------------------------------------------------------===//
Bob Wilson50622ce2010-03-18 23:57:57 +000083// ARM Instruction flags. These need to match ARMBaseInstrInfo.h.
Evan Cheng055b0312009-06-29 07:51:04 +000084//
85
86// Addressing mode.
87class AddrMode<bits<4> val> {
88 bits<4> Value = val;
89}
90def AddrModeNone : AddrMode<0>;
91def AddrMode1 : AddrMode<1>;
92def AddrMode2 : AddrMode<2>;
93def AddrMode3 : AddrMode<3>;
94def AddrMode4 : AddrMode<4>;
95def AddrMode5 : AddrMode<5>;
Bob Wilson8b024a52009-07-01 23:16:05 +000096def AddrMode6 : AddrMode<6>;
97def AddrModeT1_1 : AddrMode<7>;
98def AddrModeT1_2 : AddrMode<8>;
99def AddrModeT1_4 : AddrMode<9>;
100def AddrModeT1_s : AddrMode<10>;
David Goodwine1e52ed2009-07-22 22:24:31 +0000101def AddrModeT2_i12: AddrMode<11>;
Bob Wilson8b024a52009-07-01 23:16:05 +0000102def AddrModeT2_i8 : AddrMode<12>;
103def AddrModeT2_so : AddrMode<13>;
104def AddrModeT2_pc : AddrMode<14>;
105def AddrModeT2_i8s4 : AddrMode<15>;
Evan Cheng055b0312009-06-29 07:51:04 +0000106
107// Instruction size.
108class SizeFlagVal<bits<3> val> {
109 bits<3> Value = val;
110}
111def SizeInvalid : SizeFlagVal<0>; // Unset.
112def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
113def Size8Bytes : SizeFlagVal<2>;
114def Size4Bytes : SizeFlagVal<3>;
115def Size2Bytes : SizeFlagVal<4>;
116
117// Load / store index mode.
118class IndexMode<bits<2> val> {
119 bits<2> Value = val;
120}
121def IndexModeNone : IndexMode<0>;
122def IndexModePre : IndexMode<1>;
123def IndexModePost : IndexMode<2>;
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000124def IndexModeUpd : IndexMode<3>;
Evan Cheng055b0312009-06-29 07:51:04 +0000125
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000126// Instruction execution domain.
127class Domain<bits<2> val> {
128 bits<2> Value = val;
129}
130def GenericDomain : Domain<0>;
131def VFPDomain : Domain<1>; // Instructions in VFP domain only
132def NeonDomain : Domain<2>; // Instructions in Neon domain only
133def VFPNeonDomain : Domain<3>; // Instructions in both VFP & Neon domains
134
Evan Cheng055b0312009-06-29 07:51:04 +0000135//===----------------------------------------------------------------------===//
Evan Cheng37f25d92008-08-28 23:39:26 +0000136
Evan Cheng446c4282009-07-11 06:43:01 +0000137// ARM special operands.
138//
139
140// ARM Predicate operand. Default to 14 = always (AL). Second part is CC
141// register whose default is 0 (no register).
142def pred : PredicateOperand<OtherVT, (ops i32imm, CCR),
143 (ops (i32 14), (i32 zero_reg))> {
144 let PrintMethod = "printPredicateOperand";
145}
146
147// Conditional code result for instructions whose 's' bit is set, e.g. subs.
148def cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 zero_reg))> {
149 let PrintMethod = "printSBitModifierOperand";
150}
151
152// Same as cc_out except it defaults to setting CPSR.
153def s_cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 CPSR))> {
154 let PrintMethod = "printSBitModifierOperand";
155}
156
Johnny Chendd0f3cf2010-03-10 18:59:38 +0000157// ARM special operands for disassembly only.
158//
159
160def cps_opt : Operand<i32> {
161 let PrintMethod = "printCPSOptionOperand";
162}
163
164def msr_mask : Operand<i32> {
165 let PrintMethod = "printMSRMaskOperand";
166}
167
168// A8.6.117, A8.6.118. Different instructions are generated for #0 and #-0.
169// The neg_zero operand translates -0 to -1, -1 to -2, ..., etc.
170def neg_zero : Operand<i32> {
171 let PrintMethod = "printNegZeroOperand";
172}
173
Evan Cheng446c4282009-07-11 06:43:01 +0000174//===----------------------------------------------------------------------===//
175
Evan Cheng37f25d92008-08-28 23:39:26 +0000176// ARM Instruction templates.
177//
178
Johnny Chend68e1192009-12-15 17:24:14 +0000179class InstTemplate<AddrMode am, SizeFlagVal sz, IndexMode im,
180 Format f, Domain d, string cstr, InstrItinClass itin>
Evan Cheng37f25d92008-08-28 23:39:26 +0000181 : Instruction {
182 let Namespace = "ARM";
183
Evan Chengedda31c2008-11-05 18:35:52 +0000184 // TSFlagsFields
Evan Cheng37f25d92008-08-28 23:39:26 +0000185 AddrMode AM = am;
186 bits<4> AddrModeBits = AM.Value;
Bob Wilson01135592010-03-23 17:23:59 +0000187
Evan Cheng37f25d92008-08-28 23:39:26 +0000188 SizeFlagVal SZ = sz;
189 bits<3> SizeFlag = SZ.Value;
190
191 IndexMode IM = im;
192 bits<2> IndexModeBits = IM.Value;
Bob Wilson01135592010-03-23 17:23:59 +0000193
Evan Cheng37f25d92008-08-28 23:39:26 +0000194 Format F = f;
Bob Wilson89ef7b72010-03-17 21:13:43 +0000195 bits<6> Form = F.Value;
Evan Chengedda31c2008-11-05 18:35:52 +0000196
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000197 Domain D = d;
198 bits<2> Dom = D.Value;
199
Evan Chengedda31c2008-11-05 18:35:52 +0000200 //
201 // Attributes specific to ARM instructions...
202 //
203 bit isUnaryDataProc = 0;
Evan Cheng34a0fa32009-07-08 01:46:35 +0000204 bit canXformTo16Bit = 0;
Bob Wilson01135592010-03-23 17:23:59 +0000205
Evan Cheng37f25d92008-08-28 23:39:26 +0000206 let Constraints = cstr;
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000207 let Itinerary = itin;
Evan Cheng37f25d92008-08-28 23:39:26 +0000208}
209
Johnny Chend68e1192009-12-15 17:24:14 +0000210class Encoding {
211 field bits<32> Inst;
212}
213
214class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
215 Format f, Domain d, string cstr, InstrItinClass itin>
216 : InstTemplate<am, sz, im, f, d, cstr, itin>, Encoding;
217
218// This Encoding-less class is used by Thumb1 to specify the encoding bits later
219// on by adding flavors to specific instructions.
220class InstThumb<AddrMode am, SizeFlagVal sz, IndexMode im,
221 Format f, Domain d, string cstr, InstrItinClass itin>
222 : InstTemplate<am, sz, im, f, d, cstr, itin>;
223
Bob Wilson01135592010-03-23 17:23:59 +0000224class PseudoInst<dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000225 string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +0000226 : InstARM<AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, GenericDomain,
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000227 "", itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000228 let OutOperandList = oops;
229 let InOperandList = iops;
230 let AsmString = asm;
231 let Pattern = pattern;
232}
233
234// Almost all ARM instructions are predicable.
Evan Chengd87293c2008-11-06 08:47:38 +0000235class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000236 IndexMode im, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000237 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000238 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000239 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000240 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000241 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng37f25d92008-08-28 23:39:26 +0000242 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
243 let Pattern = pattern;
244 list<Predicate> Predicates = [IsARM];
245}
Jim Grosbachf6b28622009-12-14 18:31:20 +0000246// A few are not predicable
247class InoP<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000248 IndexMode im, Format f, InstrItinClass itin,
249 string opc, string asm, string cstr,
250 list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000251 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
252 let OutOperandList = oops;
253 let InOperandList = iops;
254 let AsmString = !strconcat(opc, asm);
255 let Pattern = pattern;
256 let isPredicable = 0;
257 list<Predicate> Predicates = [IsARM];
258}
Evan Cheng37f25d92008-08-28 23:39:26 +0000259
260// Same as I except it can optionally modify CPSR. Note it's modeled as
261// an input operand since by default it's a zero register. It will
262// become an implicit def once it's "flipped".
Evan Chengd87293c2008-11-06 08:47:38 +0000263class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000264 IndexMode im, Format f, InstrItinClass itin,
265 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000266 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000267 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000268 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000269 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Evan Cheng37f25d92008-08-28 23:39:26 +0000270 let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm));
271 let Pattern = pattern;
272 list<Predicate> Predicates = [IsARM];
273}
274
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000275// Special cases
Evan Chengd87293c2008-11-06 08:47:38 +0000276class XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000277 IndexMode im, Format f, InstrItinClass itin,
278 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000279 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000280 let OutOperandList = oops;
281 let InOperandList = iops;
282 let AsmString = asm;
283 let Pattern = pattern;
284 list<Predicate> Predicates = [IsARM];
285}
286
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000287class AI<dag oops, dag iops, Format f, InstrItinClass itin,
288 string opc, string asm, list<dag> pattern>
289 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
290 opc, asm, "", pattern>;
291class AsI<dag oops, dag iops, Format f, InstrItinClass itin,
292 string opc, string asm, list<dag> pattern>
293 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
294 opc, asm, "", pattern>;
295class AXI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000296 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000297 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng97f48c32008-11-06 22:15:19 +0000298 asm, "", pattern>;
Jim Grosbachf6b28622009-12-14 18:31:20 +0000299class AInoP<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +0000300 string opc, string asm, list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000301 : InoP<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Bob Wilson01135592010-03-23 17:23:59 +0000302 opc, asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000303
304// Ctrl flow instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000305class ABI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
306 string opc, string asm, list<dag> pattern>
307 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
308 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000309 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000310}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000311class ABXI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
312 string asm, list<dag> pattern>
313 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
314 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000315 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000316}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000317class ABXIx2<dag oops, dag iops, InstrItinClass itin,
318 string asm, list<dag> pattern>
319 : XI<oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, BrMiscFrm, itin,
320 asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000321
322// BR_JT instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000323class JTI<dag oops, dag iops, InstrItinClass itin,
324 string asm, list<dag> pattern>
325 : XI<oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BrMiscFrm, itin,
Evan Cheng4df60f52008-11-07 09:06:08 +0000326 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000327
Jim Grosbach5278eb82009-12-11 01:42:04 +0000328
329// Atomic load/store instructions
330
331class AIldrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
332 string opc, string asm, list<dag> pattern>
333 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
334 opc, asm, "", pattern> {
335 let Inst{27-23} = 0b00011;
336 let Inst{22-21} = opcod;
337 let Inst{20} = 1;
338 let Inst{11-0} = 0b111110011111;
339}
340class AIstrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
341 string opc, string asm, list<dag> pattern>
342 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
343 opc, asm, "", pattern> {
344 let Inst{27-23} = 0b00011;
345 let Inst{22-21} = opcod;
346 let Inst{20} = 0;
Johnny Chen0291d7e2009-12-11 19:37:26 +0000347 let Inst{11-4} = 0b11111001;
Jim Grosbach5278eb82009-12-11 01:42:04 +0000348}
349
Evan Cheng0d14fc82008-09-01 01:51:14 +0000350// addrmode1 instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000351class AI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
352 string opc, string asm, list<dag> pattern>
353 : I<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
354 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000355 let Inst{24-21} = opcod;
356 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000357}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000358class AsI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
359 string opc, string asm, list<dag> pattern>
360 : sI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
361 opc, asm, "", pattern> {
362 let Inst{24-21} = opcod;
363 let Inst{27-26} = {0,0};
364}
365class AXI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000366 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000367 : XI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng612b79e2008-08-29 07:40:52 +0000368 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000369 let Inst{24-21} = opcod;
370 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000371}
Bob Wilson01135592010-03-23 17:23:59 +0000372class AI1x2<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000373 string opc, string asm, list<dag> pattern>
374 : I<oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, itin,
375 opc, asm, "", pattern>;
Evan Cheng17222df2008-08-31 19:02:21 +0000376
Evan Cheng0d14fc82008-09-01 01:51:14 +0000377
378// addrmode2 loads and stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000379class AI2<dag oops, dag iops, Format f, InstrItinClass itin,
380 string opc, string asm, list<dag> pattern>
381 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
382 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000383 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000384}
Evan Cheng93912732008-09-01 01:27:33 +0000385
386// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000387class AI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
388 string opc, string asm, list<dag> pattern>
389 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
390 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000391 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000392 let Inst{21} = 0; // W bit
393 let Inst{22} = 0; // B bit
394 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000395 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000396}
Bob Wilson01135592010-03-23 17:23:59 +0000397class AXI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000398 string asm, list<dag> pattern>
399 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000400 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000401 let Inst{20} = 1; // L bit
402 let Inst{21} = 0; // W bit
403 let Inst{22} = 0; // B bit
404 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000405 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000406}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000407class AI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
408 string opc, string asm, list<dag> pattern>
409 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
410 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000411 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000412 let Inst{21} = 0; // W bit
413 let Inst{22} = 1; // B bit
414 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000415 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000416}
Bob Wilson01135592010-03-23 17:23:59 +0000417class AXI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000418 string asm, list<dag> pattern>
419 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000420 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000421 let Inst{20} = 1; // L bit
422 let Inst{21} = 0; // W bit
423 let Inst{22} = 1; // B bit
424 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000425 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000426}
Evan Cheng17222df2008-08-31 19:02:21 +0000427
Evan Cheng93912732008-09-01 01:27:33 +0000428// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000429class AI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
430 string opc, string asm, list<dag> pattern>
431 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
432 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000433 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000434 let Inst{21} = 0; // W bit
435 let Inst{22} = 0; // B bit
436 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000437 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000438}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000439class AXI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
440 string asm, list<dag> pattern>
441 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000442 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000443 let Inst{20} = 0; // L bit
444 let Inst{21} = 0; // W bit
445 let Inst{22} = 0; // B bit
446 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000447 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000448}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000449class AI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
450 string opc, string asm, list<dag> pattern>
451 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
452 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000453 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000454 let Inst{21} = 0; // W bit
455 let Inst{22} = 1; // B bit
456 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000457 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000458}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000459class AXI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
460 string asm, list<dag> pattern>
461 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000462 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000463 let Inst{20} = 0; // L bit
464 let Inst{21} = 0; // W bit
465 let Inst{22} = 1; // B bit
466 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000467 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000468}
Evan Cheng93912732008-09-01 01:27:33 +0000469
Evan Cheng840917b2008-09-01 07:00:14 +0000470// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000471class AI2ldwpr<dag oops, dag iops, Format f, InstrItinClass itin,
472 string opc, string asm, string cstr, list<dag> pattern>
473 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
474 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000475 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000476 let Inst{21} = 1; // W bit
477 let Inst{22} = 0; // B bit
478 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000479 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000480}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000481class AI2ldbpr<dag oops, dag iops, Format f, InstrItinClass itin,
482 string opc, string asm, string cstr, list<dag> pattern>
483 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
484 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000485 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000486 let Inst{21} = 1; // W bit
487 let Inst{22} = 1; // B bit
488 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000489 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000490}
491
Evan Cheng840917b2008-09-01 07:00:14 +0000492// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000493class AI2stwpr<dag oops, dag iops, Format f, InstrItinClass itin,
494 string opc, string asm, string cstr, list<dag> pattern>
495 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
496 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000497 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000498 let Inst{21} = 1; // W bit
499 let Inst{22} = 0; // B bit
500 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000501 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000502}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000503class AI2stbpr<dag oops, dag iops, Format f, InstrItinClass itin,
504 string opc, string asm, string cstr, list<dag> pattern>
505 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
506 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000507 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000508 let Inst{21} = 1; // W bit
509 let Inst{22} = 1; // B bit
510 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000511 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000512}
513
Evan Cheng840917b2008-09-01 07:00:14 +0000514// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000515class AI2ldwpo<dag oops, dag iops, Format f, InstrItinClass itin,
516 string opc, string asm, string cstr, list<dag> pattern>
517 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
518 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000519 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000520 let Inst{21} = 0; // W bit
521 let Inst{22} = 0; // B bit
522 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000523 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000524}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000525class AI2ldbpo<dag oops, dag iops, Format f, InstrItinClass itin,
526 string opc, string asm, string cstr, list<dag> pattern>
527 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
528 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000529 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000530 let Inst{21} = 0; // W bit
531 let Inst{22} = 1; // B bit
532 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000533 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000534}
535
Evan Cheng840917b2008-09-01 07:00:14 +0000536// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000537class AI2stwpo<dag oops, dag iops, Format f, InstrItinClass itin,
538 string opc, string asm, string cstr, list<dag> pattern>
539 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
540 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000541 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000542 let Inst{21} = 0; // W bit
543 let Inst{22} = 0; // B bit
544 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000545 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000546}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000547class AI2stbpo<dag oops, dag iops, Format f, InstrItinClass itin,
548 string opc, string asm, string cstr, list<dag> pattern>
549 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
550 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000551 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000552 let Inst{21} = 0; // W bit
553 let Inst{22} = 1; // B bit
554 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000555 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000556}
557
Evan Cheng0d14fc82008-09-01 01:51:14 +0000558// addrmode3 instructions
Bob Wilson01135592010-03-23 17:23:59 +0000559class AI3<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000560 string opc, string asm, list<dag> pattern>
561 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
562 opc, asm, "", pattern>;
563class AXI3<dag oops, dag iops, Format f, InstrItinClass itin,
564 string asm, list<dag> pattern>
565 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
566 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000567
Evan Cheng840917b2008-09-01 07:00:14 +0000568// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000569class AI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
570 string opc, string asm, list<dag> pattern>
571 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
572 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000573 let Inst{4} = 1;
574 let Inst{5} = 1; // H bit
575 let Inst{6} = 0; // S bit
576 let Inst{7} = 1;
577 let Inst{20} = 1; // L bit
578 let Inst{21} = 0; // W bit
579 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000580 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000581}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000582class AXI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
583 string asm, list<dag> pattern>
584 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000585 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000586 let Inst{4} = 1;
587 let Inst{5} = 1; // H bit
588 let Inst{6} = 0; // S bit
589 let Inst{7} = 1;
590 let Inst{20} = 1; // L bit
591 let Inst{21} = 0; // W bit
592 let Inst{24} = 1; // P bit
593}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000594class AI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
595 string opc, string asm, list<dag> pattern>
596 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
597 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000598 let Inst{4} = 1;
599 let Inst{5} = 1; // H bit
600 let Inst{6} = 1; // S bit
601 let Inst{7} = 1;
602 let Inst{20} = 1; // L bit
603 let Inst{21} = 0; // W bit
604 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000605 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000606}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000607class AXI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
608 string asm, list<dag> pattern>
609 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000610 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000611 let Inst{4} = 1;
612 let Inst{5} = 1; // H bit
613 let Inst{6} = 1; // S bit
614 let Inst{7} = 1;
615 let Inst{20} = 1; // L bit
616 let Inst{21} = 0; // W bit
617 let Inst{24} = 1; // P bit
618}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000619class AI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
620 string opc, string asm, list<dag> pattern>
621 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
622 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000623 let Inst{4} = 1;
624 let Inst{5} = 0; // H bit
625 let Inst{6} = 1; // S bit
626 let Inst{7} = 1;
627 let Inst{20} = 1; // L bit
628 let Inst{21} = 0; // W bit
629 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000630 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000631}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000632class AXI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
633 string asm, list<dag> pattern>
634 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000635 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000636 let Inst{4} = 1;
637 let Inst{5} = 0; // H bit
638 let Inst{6} = 1; // S bit
639 let Inst{7} = 1;
640 let Inst{20} = 1; // L bit
641 let Inst{21} = 0; // W bit
642 let Inst{24} = 1; // P bit
643}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000644class AI3ldd<dag oops, dag iops, Format f, InstrItinClass itin,
645 string opc, string asm, list<dag> pattern>
646 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
647 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000648 let Inst{4} = 1;
649 let Inst{5} = 0; // H bit
650 let Inst{6} = 1; // S bit
651 let Inst{7} = 1;
652 let Inst{20} = 0; // L bit
653 let Inst{21} = 0; // W bit
654 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000655 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000656}
657
658// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000659class AI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
660 string opc, string asm, list<dag> pattern>
661 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
662 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000663 let Inst{4} = 1;
664 let Inst{5} = 1; // H bit
665 let Inst{6} = 0; // S bit
666 let Inst{7} = 1;
667 let Inst{20} = 0; // L bit
668 let Inst{21} = 0; // W bit
669 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000670 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000671}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000672class AXI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
673 string asm, list<dag> pattern>
674 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000675 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000676 let Inst{4} = 1;
677 let Inst{5} = 1; // H bit
678 let Inst{6} = 0; // S bit
679 let Inst{7} = 1;
680 let Inst{20} = 0; // L bit
681 let Inst{21} = 0; // W bit
682 let Inst{24} = 1; // P bit
683}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000684class AI3std<dag oops, dag iops, Format f, InstrItinClass itin,
685 string opc, string asm, list<dag> pattern>
686 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
687 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000688 let Inst{4} = 1;
689 let Inst{5} = 1; // H bit
690 let Inst{6} = 1; // S bit
691 let Inst{7} = 1;
692 let Inst{20} = 0; // L bit
693 let Inst{21} = 0; // W bit
694 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000695 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000696}
697
698// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000699class AI3ldhpr<dag oops, dag iops, Format f, InstrItinClass itin,
700 string opc, string asm, string cstr, list<dag> pattern>
701 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
702 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000703 let Inst{4} = 1;
704 let Inst{5} = 1; // H bit
705 let Inst{6} = 0; // S bit
706 let Inst{7} = 1;
707 let Inst{20} = 1; // L bit
708 let Inst{21} = 1; // W bit
709 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000710 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000711}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000712class AI3ldshpr<dag oops, dag iops, Format f, InstrItinClass itin,
713 string opc, string asm, string cstr, list<dag> pattern>
714 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
715 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000716 let Inst{4} = 1;
717 let Inst{5} = 1; // H bit
718 let Inst{6} = 1; // S bit
719 let Inst{7} = 1;
720 let Inst{20} = 1; // L bit
721 let Inst{21} = 1; // W bit
722 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000723 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000724}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000725class AI3ldsbpr<dag oops, dag iops, Format f, InstrItinClass itin,
726 string opc, string asm, string cstr, list<dag> pattern>
727 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
728 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000729 let Inst{4} = 1;
730 let Inst{5} = 0; // H bit
731 let Inst{6} = 1; // S bit
732 let Inst{7} = 1;
733 let Inst{20} = 1; // L bit
734 let Inst{21} = 1; // W bit
735 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000736 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000737}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000738class AI3lddpr<dag oops, dag iops, Format f, InstrItinClass itin,
739 string opc, string asm, string cstr, list<dag> pattern>
740 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
741 opc, asm, cstr, pattern> {
742 let Inst{4} = 1;
743 let Inst{5} = 0; // H bit
744 let Inst{6} = 1; // S bit
745 let Inst{7} = 1;
746 let Inst{20} = 0; // L bit
747 let Inst{21} = 1; // W bit
748 let Inst{24} = 1; // P bit
749 let Inst{27-25} = 0b000;
750}
751
Evan Cheng840917b2008-09-01 07:00:14 +0000752
753// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000754class AI3sthpr<dag oops, dag iops, Format f, InstrItinClass itin,
755 string opc, string asm, string cstr, list<dag> pattern>
756 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
757 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000758 let Inst{4} = 1;
759 let Inst{5} = 1; // H bit
760 let Inst{6} = 0; // S bit
761 let Inst{7} = 1;
762 let Inst{20} = 0; // L bit
763 let Inst{21} = 1; // W bit
764 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000765 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000766}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000767class AI3stdpr<dag oops, dag iops, Format f, InstrItinClass itin,
768 string opc, string asm, string cstr, list<dag> pattern>
769 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
770 opc, asm, cstr, pattern> {
771 let Inst{4} = 1;
772 let Inst{5} = 1; // H bit
773 let Inst{6} = 1; // S bit
774 let Inst{7} = 1;
775 let Inst{20} = 0; // L bit
776 let Inst{21} = 1; // W bit
777 let Inst{24} = 1; // P bit
778 let Inst{27-25} = 0b000;
779}
Evan Cheng840917b2008-09-01 07:00:14 +0000780
781// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000782class AI3ldhpo<dag oops, dag iops, Format f, InstrItinClass itin,
783 string opc, string asm, string cstr, list<dag> pattern>
784 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
785 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000786 let Inst{4} = 1;
787 let Inst{5} = 1; // H bit
788 let Inst{6} = 0; // S bit
789 let Inst{7} = 1;
790 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000791 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000792 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000793 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000794}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000795class AI3ldshpo<dag oops, dag iops, Format f, InstrItinClass itin,
796 string opc, string asm, string cstr, list<dag> pattern>
797 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
798 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000799 let Inst{4} = 1;
800 let Inst{5} = 1; // H bit
801 let Inst{6} = 1; // S bit
802 let Inst{7} = 1;
803 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000804 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000805 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000806 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000807}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000808class AI3ldsbpo<dag oops, dag iops, Format f, InstrItinClass itin,
809 string opc, string asm, string cstr, list<dag> pattern>
810 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
811 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000812 let Inst{4} = 1;
813 let Inst{5} = 0; // H bit
814 let Inst{6} = 1; // S bit
815 let Inst{7} = 1;
816 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000817 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000818 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000819 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000820}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000821class AI3lddpo<dag oops, dag iops, Format f, InstrItinClass itin,
822 string opc, string asm, string cstr, list<dag> pattern>
823 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
824 opc, asm, cstr, pattern> {
825 let Inst{4} = 1;
826 let Inst{5} = 0; // H bit
827 let Inst{6} = 1; // S bit
828 let Inst{7} = 1;
829 let Inst{20} = 0; // L bit
830 let Inst{21} = 0; // W bit
831 let Inst{24} = 0; // P bit
832 let Inst{27-25} = 0b000;
833}
Evan Cheng840917b2008-09-01 07:00:14 +0000834
835// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000836class AI3sthpo<dag oops, dag iops, Format f, InstrItinClass itin,
837 string opc, string asm, string cstr, list<dag> pattern>
838 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
839 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000840 let Inst{4} = 1;
841 let Inst{5} = 1; // H bit
842 let Inst{6} = 0; // S bit
843 let Inst{7} = 1;
844 let Inst{20} = 0; // L bit
Johnny Chenad4df4c2010-03-01 19:22:00 +0000845 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000846 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000847 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000848}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000849class AI3stdpo<dag oops, dag iops, Format f, InstrItinClass itin,
850 string opc, string asm, string cstr, list<dag> pattern>
851 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
852 opc, asm, cstr, pattern> {
853 let Inst{4} = 1;
854 let Inst{5} = 1; // H bit
855 let Inst{6} = 1; // S bit
856 let Inst{7} = 1;
857 let Inst{20} = 0; // L bit
858 let Inst{21} = 0; // W bit
859 let Inst{24} = 0; // P bit
860 let Inst{27-25} = 0b000;
861}
Evan Cheng840917b2008-09-01 07:00:14 +0000862
Evan Cheng0d14fc82008-09-01 01:51:14 +0000863// addrmode4 instructions
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000864class AXI4ld<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000865 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000866 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000867 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000868 let Inst{20} = 1; // L bit
869 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000870 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000871}
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000872class AXI4st<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000873 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000874 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000875 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000876 let Inst{20} = 0; // L bit
877 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000878 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000879}
Evan Cheng37f25d92008-08-28 23:39:26 +0000880
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000881// Unsigned multiply, multiply-accumulate instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000882class AMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
883 string opc, string asm, list<dag> pattern>
884 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
885 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000886 let Inst{7-4} = 0b1001;
Evan Chengfbc9d412008-11-06 01:21:28 +0000887 let Inst{20} = 0; // S bit
Evan Chengd87293c2008-11-06 08:47:38 +0000888 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000889}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000890class AsMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
891 string opc, string asm, list<dag> pattern>
892 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
893 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000894 let Inst{7-4} = 0b1001;
Evan Chengd87293c2008-11-06 08:47:38 +0000895 let Inst{27-21} = opcod;
Evan Chengfbc9d412008-11-06 01:21:28 +0000896}
897
898// Most significant word multiply
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000899class AMul2I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
900 string opc, string asm, list<dag> pattern>
901 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
902 opc, asm, "", pattern> {
Evan Chengfbc9d412008-11-06 01:21:28 +0000903 let Inst{7-4} = 0b1001;
904 let Inst{20} = 1;
Evan Chengd87293c2008-11-06 08:47:38 +0000905 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000906}
Evan Cheng37f25d92008-08-28 23:39:26 +0000907
Evan Chengeb4f52e2008-11-06 03:35:07 +0000908// SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000909class AMulxyI<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
910 string opc, string asm, list<dag> pattern>
911 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
912 opc, asm, "", pattern> {
Evan Chengeb4f52e2008-11-06 03:35:07 +0000913 let Inst{4} = 0;
914 let Inst{7} = 1;
915 let Inst{20} = 0;
Evan Chengd87293c2008-11-06 08:47:38 +0000916 let Inst{27-21} = opcod;
Evan Chengeb4f52e2008-11-06 03:35:07 +0000917}
918
Evan Cheng97f48c32008-11-06 22:15:19 +0000919// Extend instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000920class AExtI<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
921 string opc, string asm, list<dag> pattern>
922 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ExtFrm, itin,
923 opc, asm, "", pattern> {
Evan Cheng97f48c32008-11-06 22:15:19 +0000924 let Inst{7-4} = 0b0111;
925 let Inst{27-20} = opcod;
926}
927
Evan Cheng8b59db32008-11-07 01:41:35 +0000928// Misc Arithmetic instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000929class AMiscA1I<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
930 string opc, string asm, list<dag> pattern>
931 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ArithMiscFrm, itin,
932 opc, asm, "", pattern> {
Evan Cheng8b59db32008-11-07 01:41:35 +0000933 let Inst{27-20} = opcod;
934}
935
Evan Cheng37f25d92008-08-28 23:39:26 +0000936//===----------------------------------------------------------------------===//
937
938// ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
939class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
940 list<Predicate> Predicates = [IsARM];
941}
942class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
943 list<Predicate> Predicates = [IsARM, HasV5TE];
944}
945class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
946 list<Predicate> Predicates = [IsARM, HasV6];
947}
Evan Cheng13096642008-08-29 06:41:12 +0000948
949//===----------------------------------------------------------------------===//
950//
951// Thumb Instruction Format Definitions.
952//
953
Evan Cheng13096642008-08-29 06:41:12 +0000954// TI - Thumb instruction.
955
Evan Cheng446c4282009-07-11 06:43:01 +0000956class ThumbI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000957 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000958 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000959 let OutOperandList = oops;
960 let InOperandList = iops;
Evan Cheng13096642008-08-29 06:41:12 +0000961 let AsmString = asm;
962 let Pattern = pattern;
963 list<Predicate> Predicates = [IsThumb];
964}
965
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000966class TI<dag oops, dag iops, InstrItinClass itin, string asm, list<dag> pattern>
967 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000968
Evan Cheng35d6c412009-08-04 23:47:55 +0000969// Two-address instructions
Bob Wilson01135592010-03-23 17:23:59 +0000970class TIt<dag oops, dag iops, InstrItinClass itin, string asm,
971 list<dag> pattern>
972 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "$lhs = $dst",
973 pattern>;
Evan Cheng35d6c412009-08-04 23:47:55 +0000974
Johnny Chend68e1192009-12-15 17:24:14 +0000975// tBL, tBX 32-bit instructions
976class TIx2<bits<5> opcod1, bits<2> opcod2, bit opcod3,
Bob Wilson01135592010-03-23 17:23:59 +0000977 dag oops, dag iops, InstrItinClass itin, string asm,
978 list<dag> pattern>
979 : ThumbI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>,
980 Encoding {
Johnny Chend68e1192009-12-15 17:24:14 +0000981 let Inst{31-27} = opcod1;
982 let Inst{15-14} = opcod2;
983 let Inst{12} = opcod3;
984}
Evan Cheng13096642008-08-29 06:41:12 +0000985
986// BR_JT instructions
Bob Wilson01135592010-03-23 17:23:59 +0000987class TJTI<dag oops, dag iops, InstrItinClass itin, string asm,
988 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000989 : ThumbI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000990
Evan Cheng09c39fc2009-06-23 19:38:13 +0000991// Thumb1 only
Evan Cheng446c4282009-07-11 06:43:01 +0000992class Thumb1I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000993 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000994 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000995 let OutOperandList = oops;
996 let InOperandList = iops;
Evan Cheng09c39fc2009-06-23 19:38:13 +0000997 let AsmString = asm;
998 let Pattern = pattern;
999 list<Predicate> Predicates = [IsThumb1Only];
1000}
1001
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001002class T1I<dag oops, dag iops, InstrItinClass itin,
1003 string asm, list<dag> pattern>
1004 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
1005class T1Ix2<dag oops, dag iops, InstrItinClass itin,
1006 string asm, list<dag> pattern>
1007 : Thumb1I<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1008class T1JTI<dag oops, dag iops, InstrItinClass itin,
1009 string asm, list<dag> pattern>
Johnny Chenbbc71b22009-12-16 02:32:54 +00001010 : Thumb1I<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001011
1012// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001013class T1It<dag oops, dag iops, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001014 string asm, string cstr, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001015 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001016 asm, cstr, pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001017
1018// Thumb1 instruction that can either be predicated or set CPSR.
1019class Thumb1sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001020 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001021 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001022 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Chris Lattnerb7d52262010-03-18 21:06:54 +00001023 let OutOperandList = !con(oops, (outs s_cc_out:$s));
1024 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001025 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1026 let Pattern = pattern;
1027 list<Predicate> Predicates = [IsThumb1Only];
1028}
1029
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001030class T1sI<dag oops, dag iops, InstrItinClass itin,
1031 string opc, string asm, list<dag> pattern>
1032 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001033
1034// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001035class T1sIt<dag oops, dag iops, InstrItinClass itin,
1036 string opc, string asm, list<dag> pattern>
1037 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001038 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001039
1040// Thumb1 instruction that can be predicated.
1041class Thumb1pI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001042 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001043 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001044 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +00001045 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001046 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001047 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1048 let Pattern = pattern;
1049 list<Predicate> Predicates = [IsThumb1Only];
1050}
1051
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001052class T1pI<dag oops, dag iops, InstrItinClass itin,
1053 string opc, string asm, list<dag> pattern>
1054 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001055
1056// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001057class T1pIt<dag oops, dag iops, InstrItinClass itin,
1058 string opc, string asm, list<dag> pattern>
1059 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001060 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001061
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001062class T1pI1<dag oops, dag iops, InstrItinClass itin,
1063 string opc, string asm, list<dag> pattern>
1064 : Thumb1pI<oops, iops, AddrModeT1_1, Size2Bytes, itin, opc, asm, "", pattern>;
1065class T1pI2<dag oops, dag iops, InstrItinClass itin,
1066 string opc, string asm, list<dag> pattern>
1067 : Thumb1pI<oops, iops, AddrModeT1_2, Size2Bytes, itin, opc, asm, "", pattern>;
1068class T1pI4<dag oops, dag iops, InstrItinClass itin,
1069 string opc, string asm, list<dag> pattern>
1070 : Thumb1pI<oops, iops, AddrModeT1_4, Size2Bytes, itin, opc, asm, "", pattern>;
Bob Wilson01135592010-03-23 17:23:59 +00001071class T1pIs<dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001072 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1073 : Thumb1pI<oops, iops, AddrModeT1_s, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001074
Johnny Chenbbc71b22009-12-16 02:32:54 +00001075class Encoding16 : Encoding {
1076 let Inst{31-16} = 0x0000;
1077}
1078
Johnny Chend68e1192009-12-15 17:24:14 +00001079// A6.2 16-bit Thumb instruction encoding
Johnny Chenbbc71b22009-12-16 02:32:54 +00001080class T1Encoding<bits<6> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001081 let Inst{15-10} = opcode;
1082}
1083
1084// A6.2.1 Shift (immediate), add, subtract, move, and compare encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001085class T1General<bits<5> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001086 let Inst{15-14} = 0b00;
1087 let Inst{13-9} = opcode;
1088}
1089
1090// A6.2.2 Data-processing encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001091class T1DataProcessing<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001092 let Inst{15-10} = 0b010000;
1093 let Inst{9-6} = opcode;
1094}
1095
1096// A6.2.3 Special data instructions and branch and exchange encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001097class T1Special<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001098 let Inst{15-10} = 0b010001;
1099 let Inst{9-6} = opcode;
1100}
1101
1102// A6.2.4 Load/store single data item encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001103class T1LoadStore<bits<4> opA, bits<3> opB> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001104 let Inst{15-12} = opA;
1105 let Inst{11-9} = opB;
1106}
1107class T1LdSt<bits<3> opB> : T1LoadStore<0b0101, opB>;
1108class T1LdSt4Imm<bits<3> opB> : T1LoadStore<0b0110, opB>; // Immediate, 4 bytes
1109class T1LdSt1Imm<bits<3> opB> : T1LoadStore<0b0111, opB>; // Immediate, 1 byte
1110class T1LdSt2Imm<bits<3> opB> : T1LoadStore<0b1000, opB>; // Immediate, 2 bytes
1111class T1LdStSP<bits<3> opB> : T1LoadStore<0b1001, opB>; // SP relative
1112
1113// A6.2.5 Miscellaneous 16-bit instructions encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001114class T1Misc<bits<7> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001115 let Inst{15-12} = 0b1011;
1116 let Inst{11-5} = opcode;
1117}
1118
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001119// Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
1120class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001121 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001122 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001123 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001124 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001125 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001126 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1127 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001128 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001129}
1130
1131// Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as
1132// an input operand since by default it's a zero register. It will
1133// become an implicit def once it's "flipped".
1134// FIXME: This uses unified syntax so {s} comes before {p}. We should make it
1135// more consistent.
1136class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001137 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001138 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001139 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001140 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001141 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001142 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1143 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001144 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001145}
1146
1147// Special cases
1148class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001149 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001150 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001151 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001152 let OutOperandList = oops;
1153 let InOperandList = iops;
Evan Chengf49810c2009-06-23 17:48:47 +00001154 let AsmString = asm;
1155 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001156 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001157}
1158
Jim Grosbachd1228742009-12-01 18:10:36 +00001159class ThumbXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +00001160 InstrItinClass itin,
1161 string asm, string cstr, list<dag> pattern>
Jim Grosbachd1228742009-12-01 18:10:36 +00001162 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1163 let OutOperandList = oops;
1164 let InOperandList = iops;
1165 let AsmString = asm;
1166 let Pattern = pattern;
1167 list<Predicate> Predicates = [IsThumb1Only];
1168}
1169
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001170class T2I<dag oops, dag iops, InstrItinClass itin,
1171 string opc, string asm, list<dag> pattern>
1172 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
1173class T2Ii12<dag oops, dag iops, InstrItinClass itin,
1174 string opc, string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001175 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, itin, opc, asm, "",pattern>;
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001176class T2Ii8<dag oops, dag iops, InstrItinClass itin,
1177 string opc, string asm, list<dag> pattern>
1178 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, itin, opc, asm, "", pattern>;
1179class T2Iso<dag oops, dag iops, InstrItinClass itin,
1180 string opc, string asm, list<dag> pattern>
1181 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, itin, opc, asm, "", pattern>;
1182class T2Ipc<dag oops, dag iops, InstrItinClass itin,
1183 string opc, string asm, list<dag> pattern>
1184 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, itin, opc, asm, "", pattern>;
Johnny Chend68e1192009-12-15 17:24:14 +00001185class T2Ii8s4<bit P, bit W, bit load, dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001186 string opc, string asm, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001187 : Thumb2I<oops, iops, AddrModeT2_i8s4, Size4Bytes, itin, opc, asm, "",
1188 pattern> {
1189 let Inst{31-27} = 0b11101;
1190 let Inst{26-25} = 0b00;
1191 let Inst{24} = P;
1192 let Inst{23} = ?; // The U bit.
1193 let Inst{22} = 1;
1194 let Inst{21} = W;
1195 let Inst{20} = load;
1196}
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001197
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001198class T2sI<dag oops, dag iops, InstrItinClass itin,
1199 string opc, string asm, list<dag> pattern>
1200 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001201
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001202class T2XI<dag oops, dag iops, InstrItinClass itin,
1203 string asm, list<dag> pattern>
1204 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1205class T2JTI<dag oops, dag iops, InstrItinClass itin,
1206 string asm, list<dag> pattern>
1207 : Thumb2XI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Chengf49810c2009-06-23 17:48:47 +00001208
Evan Cheng5adb66a2009-09-28 09:14:39 +00001209class T2Ix2<dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001210 string opc, string asm, list<dag> pattern>
Evan Cheng5adb66a2009-09-28 09:14:39 +00001211 : Thumb2I<oops, iops, AddrModeNone, Size8Bytes, itin, opc, asm, "", pattern>;
1212
Bob Wilson815baeb2010-03-13 01:08:20 +00001213// Two-address instructions
1214class T2XIt<dag oops, dag iops, InstrItinClass itin,
1215 string asm, string cstr, list<dag> pattern>
1216 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, cstr, pattern>;
Evan Cheng5adb66a2009-09-28 09:14:39 +00001217
Evan Chenge88d5ce2009-07-02 07:28:31 +00001218// T2Iidxldst - Thumb2 indexed load / store instructions.
Johnny Chend68e1192009-12-15 17:24:14 +00001219class T2Iidxldst<bit signed, bits<2> opcod, bit load, bit pre,
1220 dag oops, dag iops,
1221 AddrMode am, IndexMode im, InstrItinClass itin,
Evan Chenge88d5ce2009-07-02 07:28:31 +00001222 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001223 : InstARM<am, Size4Bytes, im, ThumbFrm, GenericDomain, cstr, itin> {
Evan Chenge88d5ce2009-07-02 07:28:31 +00001224 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001225 let InOperandList = !con(iops, (ins pred:$p));
Evan Chenge88d5ce2009-07-02 07:28:31 +00001226 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1227 let Pattern = pattern;
1228 list<Predicate> Predicates = [IsThumb2];
Johnny Chend68e1192009-12-15 17:24:14 +00001229 let Inst{31-27} = 0b11111;
1230 let Inst{26-25} = 0b00;
1231 let Inst{24} = signed;
1232 let Inst{23} = 0;
1233 let Inst{22-21} = opcod;
1234 let Inst{20} = load;
1235 let Inst{11} = 1;
1236 // (P, W) = (1, 1) Pre-indexed or (0, 1) Post-indexed
1237 let Inst{10} = pre; // The P bit.
1238 let Inst{8} = 1; // The W bit.
Evan Chenge88d5ce2009-07-02 07:28:31 +00001239}
1240
Johnny Chenadc77332010-02-26 22:04:29 +00001241// Helper class for disassembly only
1242// A6.3.16 & A6.3.17
1243// T2Imac - Thumb2 multiply [accumulate, and absolute difference] instructions.
1244class T2I_mac<bit long, bits<3> op22_20, bits<4> op7_4, dag oops, dag iops,
1245 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1246 : T2I<oops, iops, itin, opc, asm, pattern> {
1247 let Inst{31-27} = 0b11111;
1248 let Inst{26-24} = 0b011;
1249 let Inst{23} = long;
1250 let Inst{22-20} = op22_20;
1251 let Inst{7-4} = op7_4;
1252}
1253
David Goodwinc9d138f2009-07-27 19:59:26 +00001254// Tv5Pat - Same as Pat<>, but requires V5T Thumb mode.
1255class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
1256 list<Predicate> Predicates = [IsThumb1Only, HasV5T];
1257}
1258
1259// T1Pat - Same as Pat<>, but requires that the compiler be in Thumb1 mode.
1260class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
1261 list<Predicate> Predicates = [IsThumb1Only];
1262}
Evan Chenge88d5ce2009-07-02 07:28:31 +00001263
Evan Cheng9cb9e672009-06-27 02:26:13 +00001264// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
1265class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Chengd770d9e2009-07-02 06:38:40 +00001266 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001267}
1268
Evan Cheng13096642008-08-29 06:41:12 +00001269//===----------------------------------------------------------------------===//
1270
Evan Cheng96581d32008-11-11 02:11:05 +00001271//===----------------------------------------------------------------------===//
1272// ARM VFP Instruction templates.
1273//
1274
David Goodwin3ca524e2009-07-10 17:03:29 +00001275// Almost all VFP instructions are predicable.
1276class VFPI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001277 IndexMode im, Format f, InstrItinClass itin,
1278 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001279 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001280 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001281 let InOperandList = !con(iops, (ins pred:$p));
David Goodwin3ca524e2009-07-10 17:03:29 +00001282 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1283 let Pattern = pattern;
1284 list<Predicate> Predicates = [HasVFP2];
1285}
1286
1287// Special cases
1288class VFPXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001289 IndexMode im, Format f, InstrItinClass itin,
1290 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001291 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001292 let OutOperandList = oops;
1293 let InOperandList = iops;
1294 let AsmString = asm;
1295 let Pattern = pattern;
1296 list<Predicate> Predicates = [HasVFP2];
1297}
1298
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001299class VFPAI<dag oops, dag iops, Format f, InstrItinClass itin,
1300 string opc, string asm, list<dag> pattern>
1301 : VFPI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
1302 opc, asm, "", pattern>;
David Goodwin3ca524e2009-07-10 17:03:29 +00001303
Evan Chengcd8e66a2008-11-11 21:48:44 +00001304// ARM VFP addrmode5 loads and stores
1305class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001306 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001307 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001308 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001309 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001310 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001311 let Inst{27-24} = opcod1;
1312 let Inst{21-20} = opcod2;
1313 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001314
1315 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1316 let Dom = VFPNeonDomain.Value;
Evan Cheng96581d32008-11-11 02:11:05 +00001317}
1318
Evan Chengcd8e66a2008-11-11 21:48:44 +00001319class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001320 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001321 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001322 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001323 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001324 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001325 let Inst{27-24} = opcod1;
1326 let Inst{21-20} = opcod2;
1327 let Inst{11-8} = 0b1010;
Evan Cheng96581d32008-11-11 02:11:05 +00001328}
1329
Evan Chengcd8e66a2008-11-11 21:48:44 +00001330// Load / store multiple
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001331class AXDI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001332 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001333 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001334 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001335 // TODO: Mark the instructions with the appropriate subtarget info.
1336 let Inst{27-25} = 0b110;
1337 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001338
1339 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1340 let Dom = VFPNeonDomain.Value;
Evan Chengcd8e66a2008-11-11 21:48:44 +00001341}
1342
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001343class AXSI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001344 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001345 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001346 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001347 // TODO: Mark the instructions with the appropriate subtarget info.
1348 let Inst{27-25} = 0b110;
1349 let Inst{11-8} = 0b1010;
1350}
1351
Evan Cheng96581d32008-11-11 02:11:05 +00001352// Double precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001353class ADuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1354 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1355 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001356 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001357 let Inst{27-23} = opcod1;
1358 let Inst{21-20} = opcod2;
1359 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001360 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001361 let Inst{7-6} = opcod4;
1362 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001363}
1364
1365// Double precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001366class ADbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001367 dag iops, InstrItinClass itin, string opc, string asm,
1368 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001369 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001370 let Inst{27-23} = opcod1;
1371 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001372 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001373 let Inst{6} = op6;
1374 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001375}
1376
Jim Grosbach26767372010-03-24 22:31:46 +00001377// Double precision, binary, VML[AS] (for additional predicate)
1378class ADbI_vmlX<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
1379 dag iops, InstrItinClass itin, string opc, string asm,
1380 list<dag> pattern>
1381 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
1382 let Inst{27-23} = opcod1;
1383 let Inst{21-20} = opcod2;
1384 let Inst{11-8} = 0b1011;
1385 let Inst{6} = op6;
1386 let Inst{4} = op4;
1387 list<Predicate> Predicates = [HasVFP2, UseVMLx];
1388}
1389
1390
Evan Cheng96581d32008-11-11 02:11:05 +00001391// Single precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001392class ASuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1393 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1394 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001395 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001396 let Inst{27-23} = opcod1;
1397 let Inst{21-20} = opcod2;
1398 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001399 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001400 let Inst{7-6} = opcod4;
1401 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001402}
1403
David Goodwin338268c2009-08-10 22:17:39 +00001404// Single precision unary, if no NEON
David Goodwin53e44712009-08-04 20:39:05 +00001405// Same as ASuI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001406class ASuIn<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1407 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1408 string asm, list<dag> pattern>
1409 : ASuI<opcod1, opcod2, opcod3, opcod4, opcod5, oops, iops, itin, opc, asm,
1410 pattern> {
David Goodwin53e44712009-08-04 20:39:05 +00001411 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1412}
1413
Evan Cheng96581d32008-11-11 02:11:05 +00001414// Single precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001415class ASbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops, dag iops,
1416 InstrItinClass itin, string opc, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001417 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001418 let Inst{27-23} = opcod1;
1419 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001420 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001421 let Inst{6} = op6;
1422 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001423}
1424
David Goodwin338268c2009-08-10 22:17:39 +00001425// Single precision binary, if no NEON
David Goodwin42a83f22009-08-04 17:53:06 +00001426// Same as ASbI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001427class ASbIn<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001428 dag iops, InstrItinClass itin, string opc, string asm,
1429 list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001430 : ASbI<opcod1, opcod2, op6, op4, oops, iops, itin, opc, asm, pattern> {
David Goodwin42a83f22009-08-04 17:53:06 +00001431 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1432}
1433
Evan Cheng80a11982008-11-12 06:41:41 +00001434// VFP conversion instructions
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001435class AVConv1I<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
1436 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1437 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001438 : VFPAI<oops, iops, VFPConv1Frm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001439 let Inst{27-23} = opcod1;
1440 let Inst{21-20} = opcod2;
1441 let Inst{19-16} = opcod3;
1442 let Inst{11-8} = opcod4;
Evan Cheng80a11982008-11-12 06:41:41 +00001443 let Inst{6} = 1;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001444 let Inst{4} = 0;
Evan Cheng80a11982008-11-12 06:41:41 +00001445}
1446
Johnny Chen811663f2010-02-11 18:47:03 +00001447// VFP conversion between floating-point and fixed-point
1448class AVConv1XI<bits<5> op1, bits<2> op2, bits<4> op3, bits<4> op4, bit op5,
Bob Wilson01135592010-03-23 17:23:59 +00001449 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1450 list<dag> pattern>
Johnny Chen811663f2010-02-11 18:47:03 +00001451 : AVConv1I<op1, op2, op3, op4, oops, iops, itin, opc, asm, pattern> {
1452 // size (fixed-point number): sx == 0 ? 16 : 32
1453 let Inst{7} = op5; // sx
1454}
1455
David Goodwin338268c2009-08-10 22:17:39 +00001456// VFP conversion instructions, if no NEON
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001457class AVConv1In<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
David Goodwin338268c2009-08-10 22:17:39 +00001458 dag oops, dag iops, InstrItinClass itin,
1459 string opc, string asm, list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001460 : AVConv1I<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
1461 pattern> {
David Goodwin338268c2009-08-10 22:17:39 +00001462 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1463}
1464
Evan Cheng80a11982008-11-12 06:41:41 +00001465class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001466 InstrItinClass itin,
1467 string opc, string asm, list<dag> pattern>
1468 : VFPAI<oops, iops, f, itin, opc, asm, pattern> {
Evan Cheng80a11982008-11-12 06:41:41 +00001469 let Inst{27-20} = opcod1;
Evan Cheng78be83d2008-11-11 19:40:26 +00001470 let Inst{11-8} = opcod2;
1471 let Inst{4} = 1;
1472}
1473
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001474class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1475 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1476 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, itin, opc, asm, pattern>;
Evan Cheng0a0ab132008-11-11 22:46:12 +00001477
Bob Wilson01135592010-03-23 17:23:59 +00001478class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001479 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1480 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001481
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001482class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1483 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1484 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001485
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001486class AVConv5I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1487 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1488 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv5Frm, itin, opc, asm, pattern>;
Evan Cheng78be83d2008-11-11 19:40:26 +00001489
Evan Cheng96581d32008-11-11 02:11:05 +00001490//===----------------------------------------------------------------------===//
1491
Bob Wilson5bafff32009-06-22 23:27:02 +00001492//===----------------------------------------------------------------------===//
1493// ARM NEON Instruction templates.
1494//
Evan Cheng13096642008-08-29 06:41:12 +00001495
Johnny Chencaa608e2010-03-20 00:17:00 +00001496class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1497 InstrItinClass itin, string opc, string dt, string asm, string cstr,
1498 list<dag> pattern>
1499 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Evan Chengf81bf152009-11-23 21:57:23 +00001500 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001501 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001502 let AsmString = !strconcat(
1503 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1504 !strconcat("\t", asm));
1505 let Pattern = pattern;
1506 list<Predicate> Predicates = [HasNEON];
1507}
1508
1509// Same as NeonI except it does not have a "data type" specifier.
Johnny Chen927b88f2010-03-23 20:40:44 +00001510class NeonXI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1511 InstrItinClass itin, string opc, string asm, string cstr,
1512 list<dag> pattern>
1513 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001514 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001515 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001516 let AsmString = !strconcat(!strconcat(opc, "${p}"), !strconcat("\t", asm));
Bob Wilson5bafff32009-06-22 23:27:02 +00001517 let Pattern = pattern;
1518 list<Predicate> Predicates = [HasNEON];
Evan Cheng13096642008-08-29 06:41:12 +00001519}
1520
Bob Wilsonb07c1712009-10-07 21:53:04 +00001521class NLdSt<bit op23, bits<2> op21_20, bits<4> op11_8, bits<4> op7_4,
1522 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001523 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chencaa608e2010-03-20 00:17:00 +00001524 : NeonI<oops, iops, AddrMode6, IndexModeNone, NLdStFrm, itin, opc, dt, asm,
1525 cstr, pattern> {
Bob Wilson205a5ca2009-07-08 18:11:30 +00001526 let Inst{31-24} = 0b11110100;
Jim Grosbach780d2072009-10-20 00:19:08 +00001527 let Inst{23} = op23;
1528 let Inst{21-20} = op21_20;
1529 let Inst{11-8} = op11_8;
1530 let Inst{7-4} = op7_4;
Bob Wilson205a5ca2009-07-08 18:11:30 +00001531}
1532
Johnny Chen785516a2010-03-23 16:43:47 +00001533class NDataI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001534 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chen785516a2010-03-23 16:43:47 +00001535 : NeonI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, dt, asm, cstr,
1536 pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001537 let Inst{31-25} = 0b1111001;
1538}
1539
Johnny Chen927b88f2010-03-23 20:40:44 +00001540class NDataXI<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001541 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chen927b88f2010-03-23 20:40:44 +00001542 : NeonXI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001543 cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001544 let Inst{31-25} = 0b1111001;
1545}
1546
1547// NEON "one register and a modified immediate" format.
1548class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1549 bit op5, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001550 dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001551 string opc, string dt, string asm, string cstr,
1552 list<dag> pattern>
Johnny Chena2711742010-03-23 23:09:14 +00001553 : NDataI<oops, iops, N1RegModImmFrm, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001554 let Inst{23} = op23;
1555 let Inst{21-19} = op21_19;
1556 let Inst{11-8} = op11_8;
1557 let Inst{7} = op7;
1558 let Inst{6} = op6;
1559 let Inst{5} = op5;
1560 let Inst{4} = op4;
1561}
1562
1563// NEON 2 vector register format.
1564class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1565 bits<5> op11_7, bit op6, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001566 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001567 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001568 : NDataI<oops, iops, N2RegFrm, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001569 let Inst{24-23} = op24_23;
1570 let Inst{21-20} = op21_20;
1571 let Inst{19-18} = op19_18;
1572 let Inst{17-16} = op17_16;
1573 let Inst{11-7} = op11_7;
1574 let Inst{6} = op6;
1575 let Inst{4} = op4;
1576}
1577
1578// Same as N2V except it doesn't have a datatype suffix.
1579class N2VX<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
Bob Wilson01135592010-03-23 17:23:59 +00001580 bits<5> op11_7, bit op6, bit op4,
1581 dag oops, dag iops, InstrItinClass itin,
1582 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001583 : NDataXI<oops, iops, N2RegFrm, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001584 let Inst{24-23} = op24_23;
1585 let Inst{21-20} = op21_20;
1586 let Inst{19-18} = op19_18;
1587 let Inst{17-16} = op17_16;
1588 let Inst{11-7} = op11_7;
1589 let Inst{6} = op6;
1590 let Inst{4} = op4;
1591}
1592
1593// NEON 2 vector register with immediate.
Bob Wilson507df402009-10-21 02:15:46 +00001594class N2VImm<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
Johnny Chenfa80bec2010-03-25 20:39:04 +00001595 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001596 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenfa80bec2010-03-25 20:39:04 +00001597 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001598 let Inst{24} = op24;
1599 let Inst{23} = op23;
Bob Wilson5bafff32009-06-22 23:27:02 +00001600 let Inst{11-8} = op11_8;
1601 let Inst{7} = op7;
1602 let Inst{6} = op6;
1603 let Inst{4} = op4;
1604}
1605
1606// NEON 3 vector register format.
1607class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001608 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001609 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chen575c91c2010-03-26 18:32:20 +00001610 : NDataI<oops, iops, N3RegFrm, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001611 let Inst{24} = op24;
1612 let Inst{23} = op23;
1613 let Inst{21-20} = op21_20;
1614 let Inst{11-8} = op11_8;
1615 let Inst{6} = op6;
1616 let Inst{4} = op4;
1617}
1618
Johnny Chen841e8282010-03-23 21:35:03 +00001619// Same as N3V except it doesn't have a data type suffix.
Bob Wilson01135592010-03-23 17:23:59 +00001620class N3VX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
1621 bit op4,
1622 dag oops, dag iops, InstrItinClass itin,
1623 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chen575c91c2010-03-26 18:32:20 +00001624 : NDataXI<oops, iops, N3RegFrm, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001625 let Inst{24} = op24;
1626 let Inst{23} = op23;
1627 let Inst{21-20} = op21_20;
1628 let Inst{11-8} = op11_8;
1629 let Inst{6} = op6;
1630 let Inst{4} = op4;
1631}
1632
1633// NEON VMOVs between scalar and core registers.
1634class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001635 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001636 string opc, string dt, string asm, list<dag> pattern>
1637 : InstARM<AddrModeNone, Size4Bytes, IndexModeNone, f, GenericDomain,
Bob Wilson01135592010-03-23 17:23:59 +00001638 "", itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001639 let Inst{27-20} = opcod1;
1640 let Inst{11-8} = opcod2;
1641 let Inst{6-5} = opcod3;
1642 let Inst{4} = 1;
Evan Chengf81bf152009-11-23 21:57:23 +00001643
1644 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001645 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001646 let AsmString = !strconcat(
1647 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1648 !strconcat("\t", asm));
1649 let Pattern = pattern;
Bob Wilson5bafff32009-06-22 23:27:02 +00001650 list<Predicate> Predicates = [HasNEON];
1651}
1652class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001653 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001654 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001655 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONGetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001656 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001657class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001658 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001659 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001660 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONSetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001661 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001662class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001663 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001664 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001665 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONDupFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001666 opc, dt, asm, pattern>;
David Goodwin42a83f22009-08-04 17:53:06 +00001667
Johnny Chene4614f72010-03-25 17:01:27 +00001668// Vector Duplicate Lane (from scalar to all elements)
1669class NVDupLane<bits<4> op19_16, bit op6, dag oops, dag iops,
1670 InstrItinClass itin, string opc, string dt, string asm,
1671 list<dag> pattern>
Johnny Chen2d2898e2010-03-25 21:49:12 +00001672 : NDataI<oops, iops, NVDupLnFrm, itin, opc, dt, asm, "", pattern> {
Johnny Chene4614f72010-03-25 17:01:27 +00001673 let Inst{24-23} = 0b11;
1674 let Inst{21-20} = 0b11;
1675 let Inst{19-16} = op19_16;
1676 let Inst{11-7} = 0b11000;
1677 let Inst{6} = op6;
1678 let Inst{4} = 0;
1679}
1680
David Goodwin42a83f22009-08-04 17:53:06 +00001681// NEONFPPat - Same as Pat<>, but requires that the compiler be using NEON
1682// for single-precision FP.
1683class NEONFPPat<dag pattern, dag result> : Pat<pattern, result> {
1684 list<Predicate> Predicates = [HasNEON,UseNEONForFP];
1685}