blob: 1320bb4dca2af78002c7f711ff3102a80981fdfd [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 Chencaa608e2010-03-20 00:17:00 +000069
Evan Cheng34a0fa32009-07-08 01:46:35 +000070// Misc flags.
71
Evan Chengedda31c2008-11-05 18:35:52 +000072// the instruction has a Rn register operand.
Evan Cheng34a0fa32009-07-08 01:46:35 +000073// UnaryDP - Indicates this is a unary data processing instruction, i.e.
74// it doesn't have a Rn operand.
75class UnaryDP { bit isUnaryDataProc = 1; }
76
77// Xform16Bit - Indicates this Thumb2 instruction may be transformed into
78// a 16-bit Thumb instruction if certain conditions are met.
79class Xform16Bit { bit canXformTo16Bit = 1; }
Evan Cheng37f25d92008-08-28 23:39:26 +000080
Evan Cheng37f25d92008-08-28 23:39:26 +000081//===----------------------------------------------------------------------===//
Bob Wilson50622ce2010-03-18 23:57:57 +000082// ARM Instruction flags. These need to match ARMBaseInstrInfo.h.
Evan Cheng055b0312009-06-29 07:51:04 +000083//
84
85// Addressing mode.
86class AddrMode<bits<4> val> {
87 bits<4> Value = val;
88}
89def AddrModeNone : AddrMode<0>;
90def AddrMode1 : AddrMode<1>;
91def AddrMode2 : AddrMode<2>;
92def AddrMode3 : AddrMode<3>;
93def AddrMode4 : AddrMode<4>;
94def AddrMode5 : AddrMode<5>;
Bob Wilson8b024a52009-07-01 23:16:05 +000095def AddrMode6 : AddrMode<6>;
96def AddrModeT1_1 : AddrMode<7>;
97def AddrModeT1_2 : AddrMode<8>;
98def AddrModeT1_4 : AddrMode<9>;
99def AddrModeT1_s : AddrMode<10>;
David Goodwine1e52ed2009-07-22 22:24:31 +0000100def AddrModeT2_i12: AddrMode<11>;
Bob Wilson8b024a52009-07-01 23:16:05 +0000101def AddrModeT2_i8 : AddrMode<12>;
102def AddrModeT2_so : AddrMode<13>;
103def AddrModeT2_pc : AddrMode<14>;
104def AddrModeT2_i8s4 : AddrMode<15>;
Evan Cheng055b0312009-06-29 07:51:04 +0000105
106// Instruction size.
107class SizeFlagVal<bits<3> val> {
108 bits<3> Value = val;
109}
110def SizeInvalid : SizeFlagVal<0>; // Unset.
111def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
112def Size8Bytes : SizeFlagVal<2>;
113def Size4Bytes : SizeFlagVal<3>;
114def Size2Bytes : SizeFlagVal<4>;
115
116// Load / store index mode.
117class IndexMode<bits<2> val> {
118 bits<2> Value = val;
119}
120def IndexModeNone : IndexMode<0>;
121def IndexModePre : IndexMode<1>;
122def IndexModePost : IndexMode<2>;
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000123def IndexModeUpd : IndexMode<3>;
Evan Cheng055b0312009-06-29 07:51:04 +0000124
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000125// Instruction execution domain.
126class Domain<bits<2> val> {
127 bits<2> Value = val;
128}
129def GenericDomain : Domain<0>;
130def VFPDomain : Domain<1>; // Instructions in VFP domain only
131def NeonDomain : Domain<2>; // Instructions in Neon domain only
132def VFPNeonDomain : Domain<3>; // Instructions in both VFP & Neon domains
133
Evan Cheng055b0312009-06-29 07:51:04 +0000134//===----------------------------------------------------------------------===//
Evan Cheng37f25d92008-08-28 23:39:26 +0000135
Evan Cheng446c4282009-07-11 06:43:01 +0000136// ARM special operands.
137//
138
139// ARM Predicate operand. Default to 14 = always (AL). Second part is CC
140// register whose default is 0 (no register).
141def pred : PredicateOperand<OtherVT, (ops i32imm, CCR),
142 (ops (i32 14), (i32 zero_reg))> {
143 let PrintMethod = "printPredicateOperand";
144}
145
146// Conditional code result for instructions whose 's' bit is set, e.g. subs.
147def cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 zero_reg))> {
148 let PrintMethod = "printSBitModifierOperand";
149}
150
151// Same as cc_out except it defaults to setting CPSR.
152def s_cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 CPSR))> {
153 let PrintMethod = "printSBitModifierOperand";
154}
155
Johnny Chendd0f3cf2010-03-10 18:59:38 +0000156// ARM special operands for disassembly only.
157//
158
159def cps_opt : Operand<i32> {
160 let PrintMethod = "printCPSOptionOperand";
161}
162
163def msr_mask : Operand<i32> {
164 let PrintMethod = "printMSRMaskOperand";
165}
166
167// A8.6.117, A8.6.118. Different instructions are generated for #0 and #-0.
168// The neg_zero operand translates -0 to -1, -1 to -2, ..., etc.
169def neg_zero : Operand<i32> {
170 let PrintMethod = "printNegZeroOperand";
171}
172
Evan Cheng446c4282009-07-11 06:43:01 +0000173//===----------------------------------------------------------------------===//
174
Evan Cheng37f25d92008-08-28 23:39:26 +0000175// ARM Instruction templates.
176//
177
Johnny Chend68e1192009-12-15 17:24:14 +0000178class InstTemplate<AddrMode am, SizeFlagVal sz, IndexMode im,
179 Format f, Domain d, string cstr, InstrItinClass itin>
Evan Cheng37f25d92008-08-28 23:39:26 +0000180 : Instruction {
181 let Namespace = "ARM";
182
Evan Chengedda31c2008-11-05 18:35:52 +0000183 // TSFlagsFields
Evan Cheng37f25d92008-08-28 23:39:26 +0000184 AddrMode AM = am;
185 bits<4> AddrModeBits = AM.Value;
Bob Wilson01135592010-03-23 17:23:59 +0000186
Evan Cheng37f25d92008-08-28 23:39:26 +0000187 SizeFlagVal SZ = sz;
188 bits<3> SizeFlag = SZ.Value;
189
190 IndexMode IM = im;
191 bits<2> IndexModeBits = IM.Value;
Bob Wilson01135592010-03-23 17:23:59 +0000192
Evan Cheng37f25d92008-08-28 23:39:26 +0000193 Format F = f;
Bob Wilson89ef7b72010-03-17 21:13:43 +0000194 bits<6> Form = F.Value;
Evan Chengedda31c2008-11-05 18:35:52 +0000195
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000196 Domain D = d;
197 bits<2> Dom = D.Value;
198
Evan Chengedda31c2008-11-05 18:35:52 +0000199 //
200 // Attributes specific to ARM instructions...
201 //
202 bit isUnaryDataProc = 0;
Evan Cheng34a0fa32009-07-08 01:46:35 +0000203 bit canXformTo16Bit = 0;
Bob Wilson01135592010-03-23 17:23:59 +0000204
Evan Cheng37f25d92008-08-28 23:39:26 +0000205 let Constraints = cstr;
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000206 let Itinerary = itin;
Evan Cheng37f25d92008-08-28 23:39:26 +0000207}
208
Johnny Chend68e1192009-12-15 17:24:14 +0000209class Encoding {
210 field bits<32> Inst;
211}
212
213class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
214 Format f, Domain d, string cstr, InstrItinClass itin>
215 : InstTemplate<am, sz, im, f, d, cstr, itin>, Encoding;
216
217// This Encoding-less class is used by Thumb1 to specify the encoding bits later
218// on by adding flavors to specific instructions.
219class InstThumb<AddrMode am, SizeFlagVal sz, IndexMode im,
220 Format f, Domain d, string cstr, InstrItinClass itin>
221 : InstTemplate<am, sz, im, f, d, cstr, itin>;
222
Bob Wilson01135592010-03-23 17:23:59 +0000223class PseudoInst<dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000224 string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +0000225 : InstARM<AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, GenericDomain,
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000226 "", itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000227 let OutOperandList = oops;
228 let InOperandList = iops;
229 let AsmString = asm;
230 let Pattern = pattern;
231}
232
233// Almost all ARM instructions are predicable.
Evan Chengd87293c2008-11-06 08:47:38 +0000234class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000235 IndexMode im, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000236 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000237 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000238 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000239 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000240 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng37f25d92008-08-28 23:39:26 +0000241 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
242 let Pattern = pattern;
243 list<Predicate> Predicates = [IsARM];
244}
Jim Grosbachf6b28622009-12-14 18:31:20 +0000245// A few are not predicable
246class InoP<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000247 IndexMode im, Format f, InstrItinClass itin,
248 string opc, string asm, string cstr,
249 list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000250 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
251 let OutOperandList = oops;
252 let InOperandList = iops;
253 let AsmString = !strconcat(opc, asm);
254 let Pattern = pattern;
255 let isPredicable = 0;
256 list<Predicate> Predicates = [IsARM];
257}
Evan Cheng37f25d92008-08-28 23:39:26 +0000258
259// Same as I except it can optionally modify CPSR. Note it's modeled as
260// an input operand since by default it's a zero register. It will
261// become an implicit def once it's "flipped".
Evan Chengd87293c2008-11-06 08:47:38 +0000262class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000263 IndexMode im, Format f, InstrItinClass itin,
264 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000265 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000266 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000267 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000268 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Evan Cheng37f25d92008-08-28 23:39:26 +0000269 let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm));
270 let Pattern = pattern;
271 list<Predicate> Predicates = [IsARM];
272}
273
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000274// Special cases
Evan Chengd87293c2008-11-06 08:47:38 +0000275class XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000276 IndexMode im, Format f, InstrItinClass itin,
277 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000278 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000279 let OutOperandList = oops;
280 let InOperandList = iops;
281 let AsmString = asm;
282 let Pattern = pattern;
283 list<Predicate> Predicates = [IsARM];
284}
285
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000286class AI<dag oops, dag iops, Format f, InstrItinClass itin,
287 string opc, string asm, list<dag> pattern>
288 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
289 opc, asm, "", pattern>;
290class AsI<dag oops, dag iops, Format f, InstrItinClass itin,
291 string opc, string asm, list<dag> pattern>
292 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
293 opc, asm, "", pattern>;
294class AXI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000295 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000296 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng97f48c32008-11-06 22:15:19 +0000297 asm, "", pattern>;
Jim Grosbachf6b28622009-12-14 18:31:20 +0000298class AInoP<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +0000299 string opc, string asm, list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000300 : InoP<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Bob Wilson01135592010-03-23 17:23:59 +0000301 opc, asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000302
303// Ctrl flow instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000304class ABI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
305 string opc, string asm, list<dag> pattern>
306 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
307 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000308 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000309}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000310class ABXI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
311 string asm, list<dag> pattern>
312 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
313 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000314 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000315}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000316class ABXIx2<dag oops, dag iops, InstrItinClass itin,
317 string asm, list<dag> pattern>
318 : XI<oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, BrMiscFrm, itin,
319 asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000320
321// BR_JT instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000322class JTI<dag oops, dag iops, InstrItinClass itin,
323 string asm, list<dag> pattern>
324 : XI<oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BrMiscFrm, itin,
Evan Cheng4df60f52008-11-07 09:06:08 +0000325 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000326
Jim Grosbach5278eb82009-12-11 01:42:04 +0000327
328// Atomic load/store instructions
329
330class AIldrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
331 string opc, string asm, list<dag> pattern>
332 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
333 opc, asm, "", pattern> {
334 let Inst{27-23} = 0b00011;
335 let Inst{22-21} = opcod;
336 let Inst{20} = 1;
337 let Inst{11-0} = 0b111110011111;
338}
339class AIstrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
340 string opc, string asm, list<dag> pattern>
341 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
342 opc, asm, "", pattern> {
343 let Inst{27-23} = 0b00011;
344 let Inst{22-21} = opcod;
345 let Inst{20} = 0;
Johnny Chen0291d7e2009-12-11 19:37:26 +0000346 let Inst{11-4} = 0b11111001;
Jim Grosbach5278eb82009-12-11 01:42:04 +0000347}
348
Evan Cheng0d14fc82008-09-01 01:51:14 +0000349// addrmode1 instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000350class AI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
351 string opc, string asm, list<dag> pattern>
352 : I<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
353 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000354 let Inst{24-21} = opcod;
355 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000356}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000357class AsI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
358 string opc, string asm, list<dag> pattern>
359 : sI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
360 opc, asm, "", pattern> {
361 let Inst{24-21} = opcod;
362 let Inst{27-26} = {0,0};
363}
364class AXI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000365 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000366 : XI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng612b79e2008-08-29 07:40:52 +0000367 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000368 let Inst{24-21} = opcod;
369 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000370}
Bob Wilson01135592010-03-23 17:23:59 +0000371class AI1x2<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000372 string opc, string asm, list<dag> pattern>
373 : I<oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, itin,
374 opc, asm, "", pattern>;
Evan Cheng17222df2008-08-31 19:02:21 +0000375
Evan Cheng0d14fc82008-09-01 01:51:14 +0000376
377// addrmode2 loads and stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000378class AI2<dag oops, dag iops, Format f, InstrItinClass itin,
379 string opc, string asm, list<dag> pattern>
380 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
381 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000382 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000383}
Evan Cheng93912732008-09-01 01:27:33 +0000384
385// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000386class AI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
387 string opc, string asm, list<dag> pattern>
388 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
389 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000390 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000391 let Inst{21} = 0; // W bit
392 let Inst{22} = 0; // B bit
393 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000394 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000395}
Bob Wilson01135592010-03-23 17:23:59 +0000396class AXI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000397 string asm, list<dag> pattern>
398 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000399 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000400 let Inst{20} = 1; // L bit
401 let Inst{21} = 0; // W bit
402 let Inst{22} = 0; // B bit
403 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000404 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000405}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000406class AI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
407 string opc, string asm, list<dag> pattern>
408 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
409 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000410 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000411 let Inst{21} = 0; // W bit
412 let Inst{22} = 1; // B bit
413 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000414 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000415}
Bob Wilson01135592010-03-23 17:23:59 +0000416class AXI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000417 string asm, list<dag> pattern>
418 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000419 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000420 let Inst{20} = 1; // L bit
421 let Inst{21} = 0; // W bit
422 let Inst{22} = 1; // B bit
423 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000424 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000425}
Evan Cheng17222df2008-08-31 19:02:21 +0000426
Evan Cheng93912732008-09-01 01:27:33 +0000427// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000428class AI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
429 string opc, string asm, list<dag> pattern>
430 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
431 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000432 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000433 let Inst{21} = 0; // W bit
434 let Inst{22} = 0; // B bit
435 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000436 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000437}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000438class AXI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
439 string asm, list<dag> pattern>
440 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000441 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000442 let Inst{20} = 0; // L bit
443 let Inst{21} = 0; // W bit
444 let Inst{22} = 0; // B bit
445 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000446 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000447}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000448class AI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
449 string opc, string asm, list<dag> pattern>
450 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
451 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000452 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000453 let Inst{21} = 0; // W bit
454 let Inst{22} = 1; // B bit
455 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000456 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000457}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000458class AXI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
459 string asm, list<dag> pattern>
460 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000461 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000462 let Inst{20} = 0; // L bit
463 let Inst{21} = 0; // W bit
464 let Inst{22} = 1; // B bit
465 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000466 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000467}
Evan Cheng93912732008-09-01 01:27:33 +0000468
Evan Cheng840917b2008-09-01 07:00:14 +0000469// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000470class AI2ldwpr<dag oops, dag iops, Format f, InstrItinClass itin,
471 string opc, string asm, string cstr, list<dag> pattern>
472 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
473 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000474 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000475 let Inst{21} = 1; // W bit
476 let Inst{22} = 0; // B bit
477 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000478 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000479}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000480class AI2ldbpr<dag oops, dag iops, Format f, InstrItinClass itin,
481 string opc, string asm, string cstr, list<dag> pattern>
482 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
483 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000484 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000485 let Inst{21} = 1; // W bit
486 let Inst{22} = 1; // B bit
487 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000488 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000489}
490
Evan Cheng840917b2008-09-01 07:00:14 +0000491// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000492class AI2stwpr<dag oops, dag iops, Format f, InstrItinClass itin,
493 string opc, string asm, string cstr, list<dag> pattern>
494 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
495 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000496 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000497 let Inst{21} = 1; // W bit
498 let Inst{22} = 0; // B bit
499 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000500 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000501}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000502class AI2stbpr<dag oops, dag iops, Format f, InstrItinClass itin,
503 string opc, string asm, string cstr, list<dag> pattern>
504 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
505 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000506 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000507 let Inst{21} = 1; // W bit
508 let Inst{22} = 1; // B bit
509 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000510 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000511}
512
Evan Cheng840917b2008-09-01 07:00:14 +0000513// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000514class AI2ldwpo<dag oops, dag iops, Format f, InstrItinClass itin,
515 string opc, string asm, string cstr, list<dag> pattern>
516 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
517 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000518 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000519 let Inst{21} = 0; // W bit
520 let Inst{22} = 0; // B bit
521 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000522 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000523}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000524class AI2ldbpo<dag oops, dag iops, Format f, InstrItinClass itin,
525 string opc, string asm, string cstr, list<dag> pattern>
526 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
527 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000528 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000529 let Inst{21} = 0; // W bit
530 let Inst{22} = 1; // B bit
531 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000532 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000533}
534
Evan Cheng840917b2008-09-01 07:00:14 +0000535// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000536class AI2stwpo<dag oops, dag iops, Format f, InstrItinClass itin,
537 string opc, string asm, string cstr, list<dag> pattern>
538 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
539 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000540 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000541 let Inst{21} = 0; // W bit
542 let Inst{22} = 0; // B bit
543 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000544 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000545}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000546class AI2stbpo<dag oops, dag iops, Format f, InstrItinClass itin,
547 string opc, string asm, string cstr, list<dag> pattern>
548 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
549 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000550 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000551 let Inst{21} = 0; // W bit
552 let Inst{22} = 1; // B bit
553 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000554 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000555}
556
Evan Cheng0d14fc82008-09-01 01:51:14 +0000557// addrmode3 instructions
Bob Wilson01135592010-03-23 17:23:59 +0000558class AI3<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000559 string opc, string asm, list<dag> pattern>
560 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
561 opc, asm, "", pattern>;
562class AXI3<dag oops, dag iops, Format f, InstrItinClass itin,
563 string asm, list<dag> pattern>
564 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
565 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000566
Evan Cheng840917b2008-09-01 07:00:14 +0000567// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000568class AI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
569 string opc, string asm, list<dag> pattern>
570 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
571 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000572 let Inst{4} = 1;
573 let Inst{5} = 1; // H bit
574 let Inst{6} = 0; // S bit
575 let Inst{7} = 1;
576 let Inst{20} = 1; // L bit
577 let Inst{21} = 0; // W bit
578 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000579 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000580}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000581class AXI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
582 string asm, list<dag> pattern>
583 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000584 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000585 let Inst{4} = 1;
586 let Inst{5} = 1; // H bit
587 let Inst{6} = 0; // S bit
588 let Inst{7} = 1;
589 let Inst{20} = 1; // L bit
590 let Inst{21} = 0; // W bit
591 let Inst{24} = 1; // P bit
592}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000593class AI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
594 string opc, string asm, list<dag> pattern>
595 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
596 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000597 let Inst{4} = 1;
598 let Inst{5} = 1; // H bit
599 let Inst{6} = 1; // S bit
600 let Inst{7} = 1;
601 let Inst{20} = 1; // L bit
602 let Inst{21} = 0; // W bit
603 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000604 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000605}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000606class AXI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
607 string asm, list<dag> pattern>
608 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000609 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000610 let Inst{4} = 1;
611 let Inst{5} = 1; // H bit
612 let Inst{6} = 1; // S bit
613 let Inst{7} = 1;
614 let Inst{20} = 1; // L bit
615 let Inst{21} = 0; // W bit
616 let Inst{24} = 1; // P bit
617}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000618class AI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
619 string opc, string asm, list<dag> pattern>
620 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
621 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000622 let Inst{4} = 1;
623 let Inst{5} = 0; // H bit
624 let Inst{6} = 1; // S bit
625 let Inst{7} = 1;
626 let Inst{20} = 1; // L bit
627 let Inst{21} = 0; // W bit
628 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000629 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000630}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000631class AXI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
632 string asm, list<dag> pattern>
633 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000634 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000635 let Inst{4} = 1;
636 let Inst{5} = 0; // H bit
637 let Inst{6} = 1; // S bit
638 let Inst{7} = 1;
639 let Inst{20} = 1; // L bit
640 let Inst{21} = 0; // W bit
641 let Inst{24} = 1; // P bit
642}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000643class AI3ldd<dag oops, dag iops, Format f, InstrItinClass itin,
644 string opc, string asm, list<dag> pattern>
645 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
646 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000647 let Inst{4} = 1;
648 let Inst{5} = 0; // H bit
649 let Inst{6} = 1; // S bit
650 let Inst{7} = 1;
651 let Inst{20} = 0; // L bit
652 let Inst{21} = 0; // W bit
653 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000654 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000655}
656
657// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000658class AI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
659 string opc, string asm, list<dag> pattern>
660 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
661 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000662 let Inst{4} = 1;
663 let Inst{5} = 1; // H bit
664 let Inst{6} = 0; // S bit
665 let Inst{7} = 1;
666 let Inst{20} = 0; // L bit
667 let Inst{21} = 0; // W bit
668 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000669 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000670}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000671class AXI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
672 string asm, list<dag> pattern>
673 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000674 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000675 let Inst{4} = 1;
676 let Inst{5} = 1; // H bit
677 let Inst{6} = 0; // S bit
678 let Inst{7} = 1;
679 let Inst{20} = 0; // L bit
680 let Inst{21} = 0; // W bit
681 let Inst{24} = 1; // P bit
682}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000683class AI3std<dag oops, dag iops, Format f, InstrItinClass itin,
684 string opc, string asm, list<dag> pattern>
685 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
686 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000687 let Inst{4} = 1;
688 let Inst{5} = 1; // H bit
689 let Inst{6} = 1; // S bit
690 let Inst{7} = 1;
691 let Inst{20} = 0; // L bit
692 let Inst{21} = 0; // W bit
693 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000694 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000695}
696
697// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000698class AI3ldhpr<dag oops, dag iops, Format f, InstrItinClass itin,
699 string opc, string asm, string cstr, list<dag> pattern>
700 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
701 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000702 let Inst{4} = 1;
703 let Inst{5} = 1; // H bit
704 let Inst{6} = 0; // S bit
705 let Inst{7} = 1;
706 let Inst{20} = 1; // L bit
707 let Inst{21} = 1; // W bit
708 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000709 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000710}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000711class AI3ldshpr<dag oops, dag iops, Format f, InstrItinClass itin,
712 string opc, string asm, string cstr, list<dag> pattern>
713 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
714 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000715 let Inst{4} = 1;
716 let Inst{5} = 1; // H bit
717 let Inst{6} = 1; // S bit
718 let Inst{7} = 1;
719 let Inst{20} = 1; // L bit
720 let Inst{21} = 1; // W bit
721 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000722 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000723}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000724class AI3ldsbpr<dag oops, dag iops, Format f, InstrItinClass itin,
725 string opc, string asm, string cstr, list<dag> pattern>
726 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
727 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000728 let Inst{4} = 1;
729 let Inst{5} = 0; // H bit
730 let Inst{6} = 1; // S bit
731 let Inst{7} = 1;
732 let Inst{20} = 1; // L bit
733 let Inst{21} = 1; // W bit
734 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000735 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000736}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000737class AI3lddpr<dag oops, dag iops, Format f, InstrItinClass itin,
738 string opc, string asm, string cstr, list<dag> pattern>
739 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
740 opc, asm, cstr, pattern> {
741 let Inst{4} = 1;
742 let Inst{5} = 0; // H bit
743 let Inst{6} = 1; // S bit
744 let Inst{7} = 1;
745 let Inst{20} = 0; // L bit
746 let Inst{21} = 1; // W bit
747 let Inst{24} = 1; // P bit
748 let Inst{27-25} = 0b000;
749}
750
Evan Cheng840917b2008-09-01 07:00:14 +0000751
752// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000753class AI3sthpr<dag oops, dag iops, Format f, InstrItinClass itin,
754 string opc, string asm, string cstr, list<dag> pattern>
755 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
756 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000757 let Inst{4} = 1;
758 let Inst{5} = 1; // H bit
759 let Inst{6} = 0; // S bit
760 let Inst{7} = 1;
761 let Inst{20} = 0; // L bit
762 let Inst{21} = 1; // W bit
763 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000764 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000765}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000766class AI3stdpr<dag oops, dag iops, Format f, InstrItinClass itin,
767 string opc, string asm, string cstr, list<dag> pattern>
768 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
769 opc, asm, cstr, pattern> {
770 let Inst{4} = 1;
771 let Inst{5} = 1; // H bit
772 let Inst{6} = 1; // S bit
773 let Inst{7} = 1;
774 let Inst{20} = 0; // L bit
775 let Inst{21} = 1; // W bit
776 let Inst{24} = 1; // P bit
777 let Inst{27-25} = 0b000;
778}
Evan Cheng840917b2008-09-01 07:00:14 +0000779
780// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000781class AI3ldhpo<dag oops, dag iops, Format f, InstrItinClass itin,
782 string opc, string asm, string cstr, list<dag> pattern>
783 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
784 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000785 let Inst{4} = 1;
786 let Inst{5} = 1; // H bit
787 let Inst{6} = 0; // S bit
788 let Inst{7} = 1;
789 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000790 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000791 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000792 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000793}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000794class AI3ldshpo<dag oops, dag iops, Format f, InstrItinClass itin,
795 string opc, string asm, string cstr, list<dag> pattern>
796 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
797 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000798 let Inst{4} = 1;
799 let Inst{5} = 1; // H bit
800 let Inst{6} = 1; // S bit
801 let Inst{7} = 1;
802 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000803 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000804 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000805 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000806}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000807class AI3ldsbpo<dag oops, dag iops, Format f, InstrItinClass itin,
808 string opc, string asm, string cstr, list<dag> pattern>
809 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
810 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000811 let Inst{4} = 1;
812 let Inst{5} = 0; // H bit
813 let Inst{6} = 1; // S bit
814 let Inst{7} = 1;
815 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000816 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000817 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000818 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000819}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000820class AI3lddpo<dag oops, dag iops, Format f, InstrItinClass itin,
821 string opc, string asm, string cstr, list<dag> pattern>
822 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
823 opc, asm, cstr, pattern> {
824 let Inst{4} = 1;
825 let Inst{5} = 0; // H bit
826 let Inst{6} = 1; // S bit
827 let Inst{7} = 1;
828 let Inst{20} = 0; // L bit
829 let Inst{21} = 0; // W bit
830 let Inst{24} = 0; // P bit
831 let Inst{27-25} = 0b000;
832}
Evan Cheng840917b2008-09-01 07:00:14 +0000833
834// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000835class AI3sthpo<dag oops, dag iops, Format f, InstrItinClass itin,
836 string opc, string asm, string cstr, list<dag> pattern>
837 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
838 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000839 let Inst{4} = 1;
840 let Inst{5} = 1; // H bit
841 let Inst{6} = 0; // S bit
842 let Inst{7} = 1;
843 let Inst{20} = 0; // L bit
Johnny Chenad4df4c2010-03-01 19:22:00 +0000844 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000845 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000846 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000847}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000848class AI3stdpo<dag oops, dag iops, Format f, InstrItinClass itin,
849 string opc, string asm, string cstr, list<dag> pattern>
850 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
851 opc, asm, cstr, pattern> {
852 let Inst{4} = 1;
853 let Inst{5} = 1; // H bit
854 let Inst{6} = 1; // S bit
855 let Inst{7} = 1;
856 let Inst{20} = 0; // L bit
857 let Inst{21} = 0; // W bit
858 let Inst{24} = 0; // P bit
859 let Inst{27-25} = 0b000;
860}
Evan Cheng840917b2008-09-01 07:00:14 +0000861
Evan Cheng0d14fc82008-09-01 01:51:14 +0000862// addrmode4 instructions
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000863class AXI4ld<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000864 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000865 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000866 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000867 let Inst{20} = 1; // L bit
868 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000869 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000870}
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000871class AXI4st<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000872 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000873 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000874 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000875 let Inst{20} = 0; // L bit
876 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000877 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000878}
Evan Cheng37f25d92008-08-28 23:39:26 +0000879
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000880// Unsigned multiply, multiply-accumulate instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000881class AMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
882 string opc, string asm, list<dag> pattern>
883 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
884 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000885 let Inst{7-4} = 0b1001;
Evan Chengfbc9d412008-11-06 01:21:28 +0000886 let Inst{20} = 0; // S bit
Evan Chengd87293c2008-11-06 08:47:38 +0000887 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000888}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000889class AsMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
890 string opc, string asm, list<dag> pattern>
891 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
892 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000893 let Inst{7-4} = 0b1001;
Evan Chengd87293c2008-11-06 08:47:38 +0000894 let Inst{27-21} = opcod;
Evan Chengfbc9d412008-11-06 01:21:28 +0000895}
896
897// Most significant word multiply
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000898class AMul2I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
899 string opc, string asm, list<dag> pattern>
900 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
901 opc, asm, "", pattern> {
Evan Chengfbc9d412008-11-06 01:21:28 +0000902 let Inst{7-4} = 0b1001;
903 let Inst{20} = 1;
Evan Chengd87293c2008-11-06 08:47:38 +0000904 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000905}
Evan Cheng37f25d92008-08-28 23:39:26 +0000906
Evan Chengeb4f52e2008-11-06 03:35:07 +0000907// SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000908class AMulxyI<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
909 string opc, string asm, list<dag> pattern>
910 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
911 opc, asm, "", pattern> {
Evan Chengeb4f52e2008-11-06 03:35:07 +0000912 let Inst{4} = 0;
913 let Inst{7} = 1;
914 let Inst{20} = 0;
Evan Chengd87293c2008-11-06 08:47:38 +0000915 let Inst{27-21} = opcod;
Evan Chengeb4f52e2008-11-06 03:35:07 +0000916}
917
Evan Cheng97f48c32008-11-06 22:15:19 +0000918// Extend instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000919class AExtI<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
920 string opc, string asm, list<dag> pattern>
921 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ExtFrm, itin,
922 opc, asm, "", pattern> {
Evan Cheng97f48c32008-11-06 22:15:19 +0000923 let Inst{7-4} = 0b0111;
924 let Inst{27-20} = opcod;
925}
926
Evan Cheng8b59db32008-11-07 01:41:35 +0000927// Misc Arithmetic instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000928class AMiscA1I<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
929 string opc, string asm, list<dag> pattern>
930 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ArithMiscFrm, itin,
931 opc, asm, "", pattern> {
Evan Cheng8b59db32008-11-07 01:41:35 +0000932 let Inst{27-20} = opcod;
933}
934
Evan Cheng37f25d92008-08-28 23:39:26 +0000935//===----------------------------------------------------------------------===//
936
937// ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
938class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
939 list<Predicate> Predicates = [IsARM];
940}
941class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
942 list<Predicate> Predicates = [IsARM, HasV5TE];
943}
944class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
945 list<Predicate> Predicates = [IsARM, HasV6];
946}
Evan Cheng13096642008-08-29 06:41:12 +0000947
948//===----------------------------------------------------------------------===//
949//
950// Thumb Instruction Format Definitions.
951//
952
Evan Cheng13096642008-08-29 06:41:12 +0000953// TI - Thumb instruction.
954
Evan Cheng446c4282009-07-11 06:43:01 +0000955class ThumbI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000956 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000957 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000958 let OutOperandList = oops;
959 let InOperandList = iops;
Evan Cheng13096642008-08-29 06:41:12 +0000960 let AsmString = asm;
961 let Pattern = pattern;
962 list<Predicate> Predicates = [IsThumb];
963}
964
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000965class TI<dag oops, dag iops, InstrItinClass itin, string asm, list<dag> pattern>
966 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000967
Evan Cheng35d6c412009-08-04 23:47:55 +0000968// Two-address instructions
Bob Wilson01135592010-03-23 17:23:59 +0000969class TIt<dag oops, dag iops, InstrItinClass itin, string asm,
970 list<dag> pattern>
971 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "$lhs = $dst",
972 pattern>;
Evan Cheng35d6c412009-08-04 23:47:55 +0000973
Johnny Chend68e1192009-12-15 17:24:14 +0000974// tBL, tBX 32-bit instructions
975class TIx2<bits<5> opcod1, bits<2> opcod2, bit opcod3,
Bob Wilson01135592010-03-23 17:23:59 +0000976 dag oops, dag iops, InstrItinClass itin, string asm,
977 list<dag> pattern>
978 : ThumbI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>,
979 Encoding {
Johnny Chend68e1192009-12-15 17:24:14 +0000980 let Inst{31-27} = opcod1;
981 let Inst{15-14} = opcod2;
982 let Inst{12} = opcod3;
983}
Evan Cheng13096642008-08-29 06:41:12 +0000984
985// BR_JT instructions
Bob Wilson01135592010-03-23 17:23:59 +0000986class TJTI<dag oops, dag iops, InstrItinClass itin, string asm,
987 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000988 : ThumbI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000989
Evan Cheng09c39fc2009-06-23 19:38:13 +0000990// Thumb1 only
Evan Cheng446c4282009-07-11 06:43:01 +0000991class Thumb1I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000992 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000993 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000994 let OutOperandList = oops;
995 let InOperandList = iops;
Evan Cheng09c39fc2009-06-23 19:38:13 +0000996 let AsmString = asm;
997 let Pattern = pattern;
998 list<Predicate> Predicates = [IsThumb1Only];
999}
1000
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001001class T1I<dag oops, dag iops, InstrItinClass itin,
1002 string asm, list<dag> pattern>
1003 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
1004class T1Ix2<dag oops, dag iops, InstrItinClass itin,
1005 string asm, list<dag> pattern>
1006 : Thumb1I<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1007class T1JTI<dag oops, dag iops, InstrItinClass itin,
1008 string asm, list<dag> pattern>
Johnny Chenbbc71b22009-12-16 02:32:54 +00001009 : Thumb1I<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001010
1011// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001012class T1It<dag oops, dag iops, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001013 string asm, string cstr, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001014 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001015 asm, cstr, pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001016
1017// Thumb1 instruction that can either be predicated or set CPSR.
1018class Thumb1sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001019 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001020 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001021 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Chris Lattnerb7d52262010-03-18 21:06:54 +00001022 let OutOperandList = !con(oops, (outs s_cc_out:$s));
1023 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001024 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1025 let Pattern = pattern;
1026 list<Predicate> Predicates = [IsThumb1Only];
1027}
1028
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001029class T1sI<dag oops, dag iops, InstrItinClass itin,
1030 string opc, string asm, list<dag> pattern>
1031 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001032
1033// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001034class T1sIt<dag oops, dag iops, InstrItinClass itin,
1035 string opc, string asm, list<dag> pattern>
1036 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001037 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001038
1039// Thumb1 instruction that can be predicated.
1040class Thumb1pI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001041 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001042 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001043 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +00001044 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001045 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001046 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1047 let Pattern = pattern;
1048 list<Predicate> Predicates = [IsThumb1Only];
1049}
1050
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001051class T1pI<dag oops, dag iops, InstrItinClass itin,
1052 string opc, string asm, list<dag> pattern>
1053 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001054
1055// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001056class T1pIt<dag oops, dag iops, InstrItinClass itin,
1057 string opc, string asm, list<dag> pattern>
1058 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001059 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001060
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001061class T1pI1<dag oops, dag iops, InstrItinClass itin,
1062 string opc, string asm, list<dag> pattern>
1063 : Thumb1pI<oops, iops, AddrModeT1_1, Size2Bytes, itin, opc, asm, "", pattern>;
1064class T1pI2<dag oops, dag iops, InstrItinClass itin,
1065 string opc, string asm, list<dag> pattern>
1066 : Thumb1pI<oops, iops, AddrModeT1_2, Size2Bytes, itin, opc, asm, "", pattern>;
1067class T1pI4<dag oops, dag iops, InstrItinClass itin,
1068 string opc, string asm, list<dag> pattern>
1069 : Thumb1pI<oops, iops, AddrModeT1_4, Size2Bytes, itin, opc, asm, "", pattern>;
Bob Wilson01135592010-03-23 17:23:59 +00001070class T1pIs<dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001071 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1072 : Thumb1pI<oops, iops, AddrModeT1_s, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001073
Johnny Chenbbc71b22009-12-16 02:32:54 +00001074class Encoding16 : Encoding {
1075 let Inst{31-16} = 0x0000;
1076}
1077
Johnny Chend68e1192009-12-15 17:24:14 +00001078// A6.2 16-bit Thumb instruction encoding
Johnny Chenbbc71b22009-12-16 02:32:54 +00001079class T1Encoding<bits<6> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001080 let Inst{15-10} = opcode;
1081}
1082
1083// A6.2.1 Shift (immediate), add, subtract, move, and compare encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001084class T1General<bits<5> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001085 let Inst{15-14} = 0b00;
1086 let Inst{13-9} = opcode;
1087}
1088
1089// A6.2.2 Data-processing encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001090class T1DataProcessing<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001091 let Inst{15-10} = 0b010000;
1092 let Inst{9-6} = opcode;
1093}
1094
1095// A6.2.3 Special data instructions and branch and exchange encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001096class T1Special<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001097 let Inst{15-10} = 0b010001;
1098 let Inst{9-6} = opcode;
1099}
1100
1101// A6.2.4 Load/store single data item encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001102class T1LoadStore<bits<4> opA, bits<3> opB> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001103 let Inst{15-12} = opA;
1104 let Inst{11-9} = opB;
1105}
1106class T1LdSt<bits<3> opB> : T1LoadStore<0b0101, opB>;
1107class T1LdSt4Imm<bits<3> opB> : T1LoadStore<0b0110, opB>; // Immediate, 4 bytes
1108class T1LdSt1Imm<bits<3> opB> : T1LoadStore<0b0111, opB>; // Immediate, 1 byte
1109class T1LdSt2Imm<bits<3> opB> : T1LoadStore<0b1000, opB>; // Immediate, 2 bytes
1110class T1LdStSP<bits<3> opB> : T1LoadStore<0b1001, opB>; // SP relative
1111
1112// A6.2.5 Miscellaneous 16-bit instructions encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001113class T1Misc<bits<7> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001114 let Inst{15-12} = 0b1011;
1115 let Inst{11-5} = opcode;
1116}
1117
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001118// Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
1119class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001120 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001121 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001122 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001123 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001124 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001125 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1126 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001127 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001128}
1129
1130// Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as
1131// an input operand since by default it's a zero register. It will
1132// become an implicit def once it's "flipped".
1133// FIXME: This uses unified syntax so {s} comes before {p}. We should make it
1134// more consistent.
1135class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001136 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001137 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001138 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001139 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001140 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001141 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1142 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001143 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001144}
1145
1146// Special cases
1147class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001148 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001149 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001150 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001151 let OutOperandList = oops;
1152 let InOperandList = iops;
Evan Chengf49810c2009-06-23 17:48:47 +00001153 let AsmString = asm;
1154 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001155 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001156}
1157
Jim Grosbachd1228742009-12-01 18:10:36 +00001158class ThumbXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +00001159 InstrItinClass itin,
1160 string asm, string cstr, list<dag> pattern>
Jim Grosbachd1228742009-12-01 18:10:36 +00001161 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1162 let OutOperandList = oops;
1163 let InOperandList = iops;
1164 let AsmString = asm;
1165 let Pattern = pattern;
1166 list<Predicate> Predicates = [IsThumb1Only];
1167}
1168
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001169class T2I<dag oops, dag iops, InstrItinClass itin,
1170 string opc, string asm, list<dag> pattern>
1171 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
1172class T2Ii12<dag oops, dag iops, InstrItinClass itin,
1173 string opc, string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001174 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, itin, opc, asm, "",pattern>;
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001175class T2Ii8<dag oops, dag iops, InstrItinClass itin,
1176 string opc, string asm, list<dag> pattern>
1177 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, itin, opc, asm, "", pattern>;
1178class T2Iso<dag oops, dag iops, InstrItinClass itin,
1179 string opc, string asm, list<dag> pattern>
1180 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, itin, opc, asm, "", pattern>;
1181class T2Ipc<dag oops, dag iops, InstrItinClass itin,
1182 string opc, string asm, list<dag> pattern>
1183 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, itin, opc, asm, "", pattern>;
Johnny Chend68e1192009-12-15 17:24:14 +00001184class T2Ii8s4<bit P, bit W, bit load, dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001185 string opc, string asm, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001186 : Thumb2I<oops, iops, AddrModeT2_i8s4, Size4Bytes, itin, opc, asm, "",
1187 pattern> {
1188 let Inst{31-27} = 0b11101;
1189 let Inst{26-25} = 0b00;
1190 let Inst{24} = P;
1191 let Inst{23} = ?; // The U bit.
1192 let Inst{22} = 1;
1193 let Inst{21} = W;
1194 let Inst{20} = load;
1195}
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001196
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001197class T2sI<dag oops, dag iops, InstrItinClass itin,
1198 string opc, string asm, list<dag> pattern>
1199 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001200
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001201class T2XI<dag oops, dag iops, InstrItinClass itin,
1202 string asm, list<dag> pattern>
1203 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1204class T2JTI<dag oops, dag iops, InstrItinClass itin,
1205 string asm, list<dag> pattern>
1206 : Thumb2XI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Chengf49810c2009-06-23 17:48:47 +00001207
Evan Cheng5adb66a2009-09-28 09:14:39 +00001208class T2Ix2<dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001209 string opc, string asm, list<dag> pattern>
Evan Cheng5adb66a2009-09-28 09:14:39 +00001210 : Thumb2I<oops, iops, AddrModeNone, Size8Bytes, itin, opc, asm, "", pattern>;
1211
Bob Wilson815baeb2010-03-13 01:08:20 +00001212// Two-address instructions
1213class T2XIt<dag oops, dag iops, InstrItinClass itin,
1214 string asm, string cstr, list<dag> pattern>
1215 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, cstr, pattern>;
Evan Cheng5adb66a2009-09-28 09:14:39 +00001216
Evan Chenge88d5ce2009-07-02 07:28:31 +00001217// T2Iidxldst - Thumb2 indexed load / store instructions.
Johnny Chend68e1192009-12-15 17:24:14 +00001218class T2Iidxldst<bit signed, bits<2> opcod, bit load, bit pre,
1219 dag oops, dag iops,
1220 AddrMode am, IndexMode im, InstrItinClass itin,
Evan Chenge88d5ce2009-07-02 07:28:31 +00001221 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001222 : InstARM<am, Size4Bytes, im, ThumbFrm, GenericDomain, cstr, itin> {
Evan Chenge88d5ce2009-07-02 07:28:31 +00001223 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001224 let InOperandList = !con(iops, (ins pred:$p));
Evan Chenge88d5ce2009-07-02 07:28:31 +00001225 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1226 let Pattern = pattern;
1227 list<Predicate> Predicates = [IsThumb2];
Johnny Chend68e1192009-12-15 17:24:14 +00001228 let Inst{31-27} = 0b11111;
1229 let Inst{26-25} = 0b00;
1230 let Inst{24} = signed;
1231 let Inst{23} = 0;
1232 let Inst{22-21} = opcod;
1233 let Inst{20} = load;
1234 let Inst{11} = 1;
1235 // (P, W) = (1, 1) Pre-indexed or (0, 1) Post-indexed
1236 let Inst{10} = pre; // The P bit.
1237 let Inst{8} = 1; // The W bit.
Evan Chenge88d5ce2009-07-02 07:28:31 +00001238}
1239
Johnny Chenadc77332010-02-26 22:04:29 +00001240// Helper class for disassembly only
1241// A6.3.16 & A6.3.17
1242// T2Imac - Thumb2 multiply [accumulate, and absolute difference] instructions.
1243class T2I_mac<bit long, bits<3> op22_20, bits<4> op7_4, dag oops, dag iops,
1244 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1245 : T2I<oops, iops, itin, opc, asm, pattern> {
1246 let Inst{31-27} = 0b11111;
1247 let Inst{26-24} = 0b011;
1248 let Inst{23} = long;
1249 let Inst{22-20} = op22_20;
1250 let Inst{7-4} = op7_4;
1251}
1252
David Goodwinc9d138f2009-07-27 19:59:26 +00001253// Tv5Pat - Same as Pat<>, but requires V5T Thumb mode.
1254class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
1255 list<Predicate> Predicates = [IsThumb1Only, HasV5T];
1256}
1257
1258// T1Pat - Same as Pat<>, but requires that the compiler be in Thumb1 mode.
1259class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
1260 list<Predicate> Predicates = [IsThumb1Only];
1261}
Evan Chenge88d5ce2009-07-02 07:28:31 +00001262
Evan Cheng9cb9e672009-06-27 02:26:13 +00001263// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
1264class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Chengd770d9e2009-07-02 06:38:40 +00001265 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001266}
1267
Evan Cheng13096642008-08-29 06:41:12 +00001268//===----------------------------------------------------------------------===//
1269
Evan Cheng96581d32008-11-11 02:11:05 +00001270//===----------------------------------------------------------------------===//
1271// ARM VFP Instruction templates.
1272//
1273
David Goodwin3ca524e2009-07-10 17:03:29 +00001274// Almost all VFP instructions are predicable.
1275class VFPI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001276 IndexMode im, Format f, InstrItinClass itin,
1277 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001278 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001279 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001280 let InOperandList = !con(iops, (ins pred:$p));
David Goodwin3ca524e2009-07-10 17:03:29 +00001281 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1282 let Pattern = pattern;
1283 list<Predicate> Predicates = [HasVFP2];
1284}
1285
1286// Special cases
1287class VFPXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001288 IndexMode im, Format f, InstrItinClass itin,
1289 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001290 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001291 let OutOperandList = oops;
1292 let InOperandList = iops;
1293 let AsmString = asm;
1294 let Pattern = pattern;
1295 list<Predicate> Predicates = [HasVFP2];
1296}
1297
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001298class VFPAI<dag oops, dag iops, Format f, InstrItinClass itin,
1299 string opc, string asm, list<dag> pattern>
1300 : VFPI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
1301 opc, asm, "", pattern>;
David Goodwin3ca524e2009-07-10 17:03:29 +00001302
Evan Chengcd8e66a2008-11-11 21:48:44 +00001303// ARM VFP addrmode5 loads and stores
1304class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001305 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001306 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001307 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001308 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001309 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001310 let Inst{27-24} = opcod1;
1311 let Inst{21-20} = opcod2;
1312 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001313
1314 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1315 let Dom = VFPNeonDomain.Value;
Evan Cheng96581d32008-11-11 02:11:05 +00001316}
1317
Evan Chengcd8e66a2008-11-11 21:48:44 +00001318class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001319 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001320 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001321 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001322 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001323 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001324 let Inst{27-24} = opcod1;
1325 let Inst{21-20} = opcod2;
1326 let Inst{11-8} = 0b1010;
Evan Cheng96581d32008-11-11 02:11:05 +00001327}
1328
Evan Chengcd8e66a2008-11-11 21:48:44 +00001329// Load / store multiple
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001330class AXDI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001331 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001332 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001333 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001334 // TODO: Mark the instructions with the appropriate subtarget info.
1335 let Inst{27-25} = 0b110;
1336 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001337
1338 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1339 let Dom = VFPNeonDomain.Value;
Evan Chengcd8e66a2008-11-11 21:48:44 +00001340}
1341
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001342class AXSI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001343 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001344 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001345 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001346 // TODO: Mark the instructions with the appropriate subtarget info.
1347 let Inst{27-25} = 0b110;
1348 let Inst{11-8} = 0b1010;
1349}
1350
Evan Cheng96581d32008-11-11 02:11:05 +00001351// Double precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001352class ADuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1353 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1354 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001355 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001356 let Inst{27-23} = opcod1;
1357 let Inst{21-20} = opcod2;
1358 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001359 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001360 let Inst{7-6} = opcod4;
1361 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001362}
1363
1364// Double precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001365class ADbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001366 dag iops, InstrItinClass itin, string opc, string asm,
1367 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001368 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001369 let Inst{27-23} = opcod1;
1370 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001371 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001372 let Inst{6} = op6;
1373 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001374}
1375
Jim Grosbach26767372010-03-24 22:31:46 +00001376// Double precision, binary, VML[AS] (for additional predicate)
1377class ADbI_vmlX<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
1378 dag iops, InstrItinClass itin, string opc, string asm,
1379 list<dag> pattern>
1380 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
1381 let Inst{27-23} = opcod1;
1382 let Inst{21-20} = opcod2;
1383 let Inst{11-8} = 0b1011;
1384 let Inst{6} = op6;
1385 let Inst{4} = op4;
1386 list<Predicate> Predicates = [HasVFP2, UseVMLx];
1387}
1388
1389
Evan Cheng96581d32008-11-11 02:11:05 +00001390// Single precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001391class ASuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1392 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1393 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001394 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001395 let Inst{27-23} = opcod1;
1396 let Inst{21-20} = opcod2;
1397 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001398 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001399 let Inst{7-6} = opcod4;
1400 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001401}
1402
David Goodwin338268c2009-08-10 22:17:39 +00001403// Single precision unary, if no NEON
David Goodwin53e44712009-08-04 20:39:05 +00001404// Same as ASuI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001405class ASuIn<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1406 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1407 string asm, list<dag> pattern>
1408 : ASuI<opcod1, opcod2, opcod3, opcod4, opcod5, oops, iops, itin, opc, asm,
1409 pattern> {
David Goodwin53e44712009-08-04 20:39:05 +00001410 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1411}
1412
Evan Cheng96581d32008-11-11 02:11:05 +00001413// Single precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001414class ASbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops, dag iops,
1415 InstrItinClass itin, string opc, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001416 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001417 let Inst{27-23} = opcod1;
1418 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001419 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001420 let Inst{6} = op6;
1421 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001422}
1423
David Goodwin338268c2009-08-10 22:17:39 +00001424// Single precision binary, if no NEON
David Goodwin42a83f22009-08-04 17:53:06 +00001425// Same as ASbI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001426class ASbIn<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001427 dag iops, InstrItinClass itin, string opc, string asm,
1428 list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001429 : ASbI<opcod1, opcod2, op6, op4, oops, iops, itin, opc, asm, pattern> {
David Goodwin42a83f22009-08-04 17:53:06 +00001430 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1431}
1432
Evan Cheng80a11982008-11-12 06:41:41 +00001433// VFP conversion instructions
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001434class AVConv1I<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
1435 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1436 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001437 : VFPAI<oops, iops, VFPConv1Frm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001438 let Inst{27-23} = opcod1;
1439 let Inst{21-20} = opcod2;
1440 let Inst{19-16} = opcod3;
1441 let Inst{11-8} = opcod4;
Evan Cheng80a11982008-11-12 06:41:41 +00001442 let Inst{6} = 1;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001443 let Inst{4} = 0;
Evan Cheng80a11982008-11-12 06:41:41 +00001444}
1445
Johnny Chen811663f2010-02-11 18:47:03 +00001446// VFP conversion between floating-point and fixed-point
1447class AVConv1XI<bits<5> op1, bits<2> op2, bits<4> op3, bits<4> op4, bit op5,
Bob Wilson01135592010-03-23 17:23:59 +00001448 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1449 list<dag> pattern>
Johnny Chen811663f2010-02-11 18:47:03 +00001450 : AVConv1I<op1, op2, op3, op4, oops, iops, itin, opc, asm, pattern> {
1451 // size (fixed-point number): sx == 0 ? 16 : 32
1452 let Inst{7} = op5; // sx
1453}
1454
David Goodwin338268c2009-08-10 22:17:39 +00001455// VFP conversion instructions, if no NEON
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001456class AVConv1In<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
David Goodwin338268c2009-08-10 22:17:39 +00001457 dag oops, dag iops, InstrItinClass itin,
1458 string opc, string asm, list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001459 : AVConv1I<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
1460 pattern> {
David Goodwin338268c2009-08-10 22:17:39 +00001461 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1462}
1463
Evan Cheng80a11982008-11-12 06:41:41 +00001464class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001465 InstrItinClass itin,
1466 string opc, string asm, list<dag> pattern>
1467 : VFPAI<oops, iops, f, itin, opc, asm, pattern> {
Evan Cheng80a11982008-11-12 06:41:41 +00001468 let Inst{27-20} = opcod1;
Evan Cheng78be83d2008-11-11 19:40:26 +00001469 let Inst{11-8} = opcod2;
1470 let Inst{4} = 1;
1471}
1472
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001473class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1474 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1475 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, itin, opc, asm, pattern>;
Evan Cheng0a0ab132008-11-11 22:46:12 +00001476
Bob Wilson01135592010-03-23 17:23:59 +00001477class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001478 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1479 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001480
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001481class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1482 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1483 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001484
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001485class AVConv5I<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, VFPConv5Frm, itin, opc, asm, pattern>;
Evan Cheng78be83d2008-11-11 19:40:26 +00001488
Evan Cheng96581d32008-11-11 02:11:05 +00001489//===----------------------------------------------------------------------===//
1490
Bob Wilson5bafff32009-06-22 23:27:02 +00001491//===----------------------------------------------------------------------===//
1492// ARM NEON Instruction templates.
1493//
Evan Cheng13096642008-08-29 06:41:12 +00001494
Johnny Chencaa608e2010-03-20 00:17:00 +00001495class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1496 InstrItinClass itin, string opc, string dt, string asm, string cstr,
1497 list<dag> pattern>
1498 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Evan Chengf81bf152009-11-23 21:57:23 +00001499 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001500 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001501 let AsmString = !strconcat(
1502 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1503 !strconcat("\t", asm));
1504 let Pattern = pattern;
1505 list<Predicate> Predicates = [HasNEON];
1506}
1507
1508// Same as NeonI except it does not have a "data type" specifier.
Johnny Chen927b88f2010-03-23 20:40:44 +00001509class NeonXI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1510 InstrItinClass itin, string opc, string asm, string cstr,
1511 list<dag> pattern>
1512 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001513 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001514 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001515 let AsmString = !strconcat(!strconcat(opc, "${p}"), !strconcat("\t", asm));
Bob Wilson5bafff32009-06-22 23:27:02 +00001516 let Pattern = pattern;
1517 list<Predicate> Predicates = [HasNEON];
Evan Cheng13096642008-08-29 06:41:12 +00001518}
1519
Bob Wilsonb07c1712009-10-07 21:53:04 +00001520class NLdSt<bit op23, bits<2> op21_20, bits<4> op11_8, bits<4> op7_4,
1521 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001522 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chencaa608e2010-03-20 00:17:00 +00001523 : NeonI<oops, iops, AddrMode6, IndexModeNone, NLdStFrm, itin, opc, dt, asm,
1524 cstr, pattern> {
Bob Wilson205a5ca2009-07-08 18:11:30 +00001525 let Inst{31-24} = 0b11110100;
Jim Grosbach780d2072009-10-20 00:19:08 +00001526 let Inst{23} = op23;
1527 let Inst{21-20} = op21_20;
1528 let Inst{11-8} = op11_8;
1529 let Inst{7-4} = op7_4;
Bob Wilson205a5ca2009-07-08 18:11:30 +00001530}
1531
Johnny Chen785516a2010-03-23 16:43:47 +00001532class NDataI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001533 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chen785516a2010-03-23 16:43:47 +00001534 : NeonI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, dt, asm, cstr,
1535 pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001536 let Inst{31-25} = 0b1111001;
1537}
1538
Johnny Chen927b88f2010-03-23 20:40:44 +00001539class NDataXI<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001540 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chen927b88f2010-03-23 20:40:44 +00001541 : NeonXI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001542 cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001543 let Inst{31-25} = 0b1111001;
1544}
1545
1546// NEON "one register and a modified immediate" format.
1547class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1548 bit op5, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001549 dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001550 string opc, string dt, string asm, string cstr,
1551 list<dag> pattern>
Johnny Chena2711742010-03-23 23:09:14 +00001552 : NDataI<oops, iops, N1RegModImmFrm, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001553 let Inst{23} = op23;
1554 let Inst{21-19} = op21_19;
1555 let Inst{11-8} = op11_8;
1556 let Inst{7} = op7;
1557 let Inst{6} = op6;
1558 let Inst{5} = op5;
1559 let Inst{4} = op4;
1560}
1561
1562// NEON 2 vector register format.
1563class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1564 bits<5> op11_7, bit op6, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001565 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001566 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001567 : NDataI<oops, iops, N2RegFrm, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001568 let Inst{24-23} = op24_23;
1569 let Inst{21-20} = op21_20;
1570 let Inst{19-18} = op19_18;
1571 let Inst{17-16} = op17_16;
1572 let Inst{11-7} = op11_7;
1573 let Inst{6} = op6;
1574 let Inst{4} = op4;
1575}
1576
1577// Same as N2V except it doesn't have a datatype suffix.
1578class N2VX<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
Bob Wilson01135592010-03-23 17:23:59 +00001579 bits<5> op11_7, bit op6, bit op4,
1580 dag oops, dag iops, InstrItinClass itin,
1581 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001582 : NDataXI<oops, iops, N2RegFrm, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001583 let Inst{24-23} = op24_23;
1584 let Inst{21-20} = op21_20;
1585 let Inst{19-18} = op19_18;
1586 let Inst{17-16} = op17_16;
1587 let Inst{11-7} = op11_7;
1588 let Inst{6} = op6;
1589 let Inst{4} = op4;
1590}
1591
1592// NEON 2 vector register with immediate.
Bob Wilson507df402009-10-21 02:15:46 +00001593class N2VImm<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
Johnny Chenfa80bec2010-03-25 20:39:04 +00001594 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001595 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenfa80bec2010-03-25 20:39:04 +00001596 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001597 let Inst{24} = op24;
1598 let Inst{23} = op23;
Bob Wilson5bafff32009-06-22 23:27:02 +00001599 let Inst{11-8} = op11_8;
1600 let Inst{7} = op7;
1601 let Inst{6} = op6;
1602 let Inst{4} = op4;
1603}
1604
1605// NEON 3 vector register format.
1606class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001607 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001608 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chen785516a2010-03-23 16:43:47 +00001609 : NDataI<oops, iops, NEONFrm, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001610 let Inst{24} = op24;
1611 let Inst{23} = op23;
1612 let Inst{21-20} = op21_20;
1613 let Inst{11-8} = op11_8;
1614 let Inst{6} = op6;
1615 let Inst{4} = op4;
1616}
1617
Johnny Chen841e8282010-03-23 21:35:03 +00001618// Same as N3V except it doesn't have a data type suffix.
Bob Wilson01135592010-03-23 17:23:59 +00001619class N3VX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
1620 bit op4,
1621 dag oops, dag iops, InstrItinClass itin,
1622 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chen927b88f2010-03-23 20:40:44 +00001623 : NDataXI<oops, iops, NEONFrm, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001624 let Inst{24} = op24;
1625 let Inst{23} = op23;
1626 let Inst{21-20} = op21_20;
1627 let Inst{11-8} = op11_8;
1628 let Inst{6} = op6;
1629 let Inst{4} = op4;
1630}
1631
1632// NEON VMOVs between scalar and core registers.
1633class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001634 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001635 string opc, string dt, string asm, list<dag> pattern>
1636 : InstARM<AddrModeNone, Size4Bytes, IndexModeNone, f, GenericDomain,
Bob Wilson01135592010-03-23 17:23:59 +00001637 "", itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001638 let Inst{27-20} = opcod1;
1639 let Inst{11-8} = opcod2;
1640 let Inst{6-5} = opcod3;
1641 let Inst{4} = 1;
Evan Chengf81bf152009-11-23 21:57:23 +00001642
1643 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001644 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001645 let AsmString = !strconcat(
1646 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1647 !strconcat("\t", asm));
1648 let Pattern = pattern;
Bob Wilson5bafff32009-06-22 23:27:02 +00001649 list<Predicate> Predicates = [HasNEON];
1650}
1651class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001652 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001653 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001654 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONGetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001655 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001656class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001657 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001658 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001659 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONSetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001660 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001661class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001662 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001663 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001664 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONDupFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001665 opc, dt, asm, pattern>;
David Goodwin42a83f22009-08-04 17:53:06 +00001666
Johnny Chene4614f72010-03-25 17:01:27 +00001667// Vector Duplicate Lane (from scalar to all elements)
1668class NVDupLane<bits<4> op19_16, bit op6, dag oops, dag iops,
1669 InstrItinClass itin, string opc, string dt, string asm,
1670 list<dag> pattern>
Johnny Chen2d2898e2010-03-25 21:49:12 +00001671 : NDataI<oops, iops, NVDupLnFrm, itin, opc, dt, asm, "", pattern> {
Johnny Chene4614f72010-03-25 17:01:27 +00001672 let Inst{24-23} = 0b11;
1673 let Inst{21-20} = 0b11;
1674 let Inst{19-16} = op19_16;
1675 let Inst{11-7} = 0b11000;
1676 let Inst{6} = op6;
1677 let Inst{4} = 0;
1678}
1679
David Goodwin42a83f22009-08-04 17:53:06 +00001680// NEONFPPat - Same as Pat<>, but requires that the compiler be using NEON
1681// for single-precision FP.
1682class NEONFPPat<dag pattern, dag result> : Pat<pattern, result> {
1683 list<Predicate> Predicates = [HasNEON,UseNEONForFP];
1684}