blob: 971bc158f1bcebe209b162ef18c7de8c303652c6 [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 Chenc5f413a2010-03-24 00:57:50 +000062def NLdStFrm : Format<31>;
63def N1RegModImmFrm : Format<32>;
64def N2RegFrm : Format<33>;
Johnny Chencaa608e2010-03-20 00:17:00 +000065
Evan Cheng34a0fa32009-07-08 01:46:35 +000066// Misc flags.
67
Evan Chengedda31c2008-11-05 18:35:52 +000068// the instruction has a Rn register operand.
Evan Cheng34a0fa32009-07-08 01:46:35 +000069// UnaryDP - Indicates this is a unary data processing instruction, i.e.
70// it doesn't have a Rn operand.
71class UnaryDP { bit isUnaryDataProc = 1; }
72
73// Xform16Bit - Indicates this Thumb2 instruction may be transformed into
74// a 16-bit Thumb instruction if certain conditions are met.
75class Xform16Bit { bit canXformTo16Bit = 1; }
Evan Cheng37f25d92008-08-28 23:39:26 +000076
Evan Cheng37f25d92008-08-28 23:39:26 +000077//===----------------------------------------------------------------------===//
Bob Wilson50622ce2010-03-18 23:57:57 +000078// ARM Instruction flags. These need to match ARMBaseInstrInfo.h.
Evan Cheng055b0312009-06-29 07:51:04 +000079//
80
81// Addressing mode.
82class AddrMode<bits<4> val> {
83 bits<4> Value = val;
84}
85def AddrModeNone : AddrMode<0>;
86def AddrMode1 : AddrMode<1>;
87def AddrMode2 : AddrMode<2>;
88def AddrMode3 : AddrMode<3>;
89def AddrMode4 : AddrMode<4>;
90def AddrMode5 : AddrMode<5>;
Bob Wilson8b024a52009-07-01 23:16:05 +000091def AddrMode6 : AddrMode<6>;
92def AddrModeT1_1 : AddrMode<7>;
93def AddrModeT1_2 : AddrMode<8>;
94def AddrModeT1_4 : AddrMode<9>;
95def AddrModeT1_s : AddrMode<10>;
David Goodwine1e52ed2009-07-22 22:24:31 +000096def AddrModeT2_i12: AddrMode<11>;
Bob Wilson8b024a52009-07-01 23:16:05 +000097def AddrModeT2_i8 : AddrMode<12>;
98def AddrModeT2_so : AddrMode<13>;
99def AddrModeT2_pc : AddrMode<14>;
100def AddrModeT2_i8s4 : AddrMode<15>;
Evan Cheng055b0312009-06-29 07:51:04 +0000101
102// Instruction size.
103class SizeFlagVal<bits<3> val> {
104 bits<3> Value = val;
105}
106def SizeInvalid : SizeFlagVal<0>; // Unset.
107def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
108def Size8Bytes : SizeFlagVal<2>;
109def Size4Bytes : SizeFlagVal<3>;
110def Size2Bytes : SizeFlagVal<4>;
111
112// Load / store index mode.
113class IndexMode<bits<2> val> {
114 bits<2> Value = val;
115}
116def IndexModeNone : IndexMode<0>;
117def IndexModePre : IndexMode<1>;
118def IndexModePost : IndexMode<2>;
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000119def IndexModeUpd : IndexMode<3>;
Evan Cheng055b0312009-06-29 07:51:04 +0000120
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000121// Instruction execution domain.
122class Domain<bits<2> val> {
123 bits<2> Value = val;
124}
125def GenericDomain : Domain<0>;
126def VFPDomain : Domain<1>; // Instructions in VFP domain only
127def NeonDomain : Domain<2>; // Instructions in Neon domain only
128def VFPNeonDomain : Domain<3>; // Instructions in both VFP & Neon domains
129
Evan Cheng055b0312009-06-29 07:51:04 +0000130//===----------------------------------------------------------------------===//
Evan Cheng37f25d92008-08-28 23:39:26 +0000131
Evan Cheng446c4282009-07-11 06:43:01 +0000132// ARM special operands.
133//
134
135// ARM Predicate operand. Default to 14 = always (AL). Second part is CC
136// register whose default is 0 (no register).
137def pred : PredicateOperand<OtherVT, (ops i32imm, CCR),
138 (ops (i32 14), (i32 zero_reg))> {
139 let PrintMethod = "printPredicateOperand";
140}
141
142// Conditional code result for instructions whose 's' bit is set, e.g. subs.
143def cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 zero_reg))> {
144 let PrintMethod = "printSBitModifierOperand";
145}
146
147// Same as cc_out except it defaults to setting CPSR.
148def s_cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 CPSR))> {
149 let PrintMethod = "printSBitModifierOperand";
150}
151
Johnny Chendd0f3cf2010-03-10 18:59:38 +0000152// ARM special operands for disassembly only.
153//
154
155def cps_opt : Operand<i32> {
156 let PrintMethod = "printCPSOptionOperand";
157}
158
159def msr_mask : Operand<i32> {
160 let PrintMethod = "printMSRMaskOperand";
161}
162
163// A8.6.117, A8.6.118. Different instructions are generated for #0 and #-0.
164// The neg_zero operand translates -0 to -1, -1 to -2, ..., etc.
165def neg_zero : Operand<i32> {
166 let PrintMethod = "printNegZeroOperand";
167}
168
Evan Cheng446c4282009-07-11 06:43:01 +0000169//===----------------------------------------------------------------------===//
170
Evan Cheng37f25d92008-08-28 23:39:26 +0000171// ARM Instruction templates.
172//
173
Johnny Chend68e1192009-12-15 17:24:14 +0000174class InstTemplate<AddrMode am, SizeFlagVal sz, IndexMode im,
175 Format f, Domain d, string cstr, InstrItinClass itin>
Evan Cheng37f25d92008-08-28 23:39:26 +0000176 : Instruction {
177 let Namespace = "ARM";
178
Evan Chengedda31c2008-11-05 18:35:52 +0000179 // TSFlagsFields
Evan Cheng37f25d92008-08-28 23:39:26 +0000180 AddrMode AM = am;
181 bits<4> AddrModeBits = AM.Value;
Bob Wilson01135592010-03-23 17:23:59 +0000182
Evan Cheng37f25d92008-08-28 23:39:26 +0000183 SizeFlagVal SZ = sz;
184 bits<3> SizeFlag = SZ.Value;
185
186 IndexMode IM = im;
187 bits<2> IndexModeBits = IM.Value;
Bob Wilson01135592010-03-23 17:23:59 +0000188
Evan Cheng37f25d92008-08-28 23:39:26 +0000189 Format F = f;
Bob Wilson89ef7b72010-03-17 21:13:43 +0000190 bits<6> Form = F.Value;
Evan Chengedda31c2008-11-05 18:35:52 +0000191
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000192 Domain D = d;
193 bits<2> Dom = D.Value;
194
Evan Chengedda31c2008-11-05 18:35:52 +0000195 //
196 // Attributes specific to ARM instructions...
197 //
198 bit isUnaryDataProc = 0;
Evan Cheng34a0fa32009-07-08 01:46:35 +0000199 bit canXformTo16Bit = 0;
Bob Wilson01135592010-03-23 17:23:59 +0000200
Evan Cheng37f25d92008-08-28 23:39:26 +0000201 let Constraints = cstr;
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000202 let Itinerary = itin;
Evan Cheng37f25d92008-08-28 23:39:26 +0000203}
204
Johnny Chend68e1192009-12-15 17:24:14 +0000205class Encoding {
206 field bits<32> Inst;
207}
208
209class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
210 Format f, Domain d, string cstr, InstrItinClass itin>
211 : InstTemplate<am, sz, im, f, d, cstr, itin>, Encoding;
212
213// This Encoding-less class is used by Thumb1 to specify the encoding bits later
214// on by adding flavors to specific instructions.
215class InstThumb<AddrMode am, SizeFlagVal sz, IndexMode im,
216 Format f, Domain d, string cstr, InstrItinClass itin>
217 : InstTemplate<am, sz, im, f, d, cstr, itin>;
218
Bob Wilson01135592010-03-23 17:23:59 +0000219class PseudoInst<dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000220 string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +0000221 : InstARM<AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, GenericDomain,
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000222 "", itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000223 let OutOperandList = oops;
224 let InOperandList = iops;
225 let AsmString = asm;
226 let Pattern = pattern;
227}
228
229// Almost all ARM instructions are predicable.
Evan Chengd87293c2008-11-06 08:47:38 +0000230class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000231 IndexMode im, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000232 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000233 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000234 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000235 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000236 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng37f25d92008-08-28 23:39:26 +0000237 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
238 let Pattern = pattern;
239 list<Predicate> Predicates = [IsARM];
240}
Jim Grosbachf6b28622009-12-14 18:31:20 +0000241// A few are not predicable
242class InoP<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000243 IndexMode im, Format f, InstrItinClass itin,
244 string opc, string asm, string cstr,
245 list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000246 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
247 let OutOperandList = oops;
248 let InOperandList = iops;
249 let AsmString = !strconcat(opc, asm);
250 let Pattern = pattern;
251 let isPredicable = 0;
252 list<Predicate> Predicates = [IsARM];
253}
Evan Cheng37f25d92008-08-28 23:39:26 +0000254
255// Same as I except it can optionally modify CPSR. Note it's modeled as
256// an input operand since by default it's a zero register. It will
257// become an implicit def once it's "flipped".
Evan Chengd87293c2008-11-06 08:47:38 +0000258class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000259 IndexMode im, Format f, InstrItinClass itin,
260 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000261 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000262 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000263 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000264 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Evan Cheng37f25d92008-08-28 23:39:26 +0000265 let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm));
266 let Pattern = pattern;
267 list<Predicate> Predicates = [IsARM];
268}
269
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000270// Special cases
Evan Chengd87293c2008-11-06 08:47:38 +0000271class XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000272 IndexMode im, Format f, InstrItinClass itin,
273 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000274 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000275 let OutOperandList = oops;
276 let InOperandList = iops;
277 let AsmString = asm;
278 let Pattern = pattern;
279 list<Predicate> Predicates = [IsARM];
280}
281
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000282class AI<dag oops, dag iops, Format f, InstrItinClass itin,
283 string opc, string asm, list<dag> pattern>
284 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
285 opc, asm, "", pattern>;
286class AsI<dag oops, dag iops, Format f, InstrItinClass itin,
287 string opc, string asm, list<dag> pattern>
288 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
289 opc, asm, "", pattern>;
290class AXI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000291 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000292 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng97f48c32008-11-06 22:15:19 +0000293 asm, "", pattern>;
Jim Grosbachf6b28622009-12-14 18:31:20 +0000294class AInoP<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +0000295 string opc, string asm, list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000296 : InoP<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Bob Wilson01135592010-03-23 17:23:59 +0000297 opc, asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000298
299// Ctrl flow instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000300class ABI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
301 string opc, string asm, list<dag> pattern>
302 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
303 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000304 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000305}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000306class ABXI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
307 string asm, list<dag> pattern>
308 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
309 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000310 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000311}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000312class ABXIx2<dag oops, dag iops, InstrItinClass itin,
313 string asm, list<dag> pattern>
314 : XI<oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, BrMiscFrm, itin,
315 asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000316
317// BR_JT instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000318class JTI<dag oops, dag iops, InstrItinClass itin,
319 string asm, list<dag> pattern>
320 : XI<oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BrMiscFrm, itin,
Evan Cheng4df60f52008-11-07 09:06:08 +0000321 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000322
Jim Grosbach5278eb82009-12-11 01:42:04 +0000323
324// Atomic load/store instructions
325
326class AIldrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
327 string opc, string asm, list<dag> pattern>
328 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
329 opc, asm, "", pattern> {
330 let Inst{27-23} = 0b00011;
331 let Inst{22-21} = opcod;
332 let Inst{20} = 1;
333 let Inst{11-0} = 0b111110011111;
334}
335class AIstrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
336 string opc, string asm, list<dag> pattern>
337 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
338 opc, asm, "", pattern> {
339 let Inst{27-23} = 0b00011;
340 let Inst{22-21} = opcod;
341 let Inst{20} = 0;
Johnny Chen0291d7e2009-12-11 19:37:26 +0000342 let Inst{11-4} = 0b11111001;
Jim Grosbach5278eb82009-12-11 01:42:04 +0000343}
344
Evan Cheng0d14fc82008-09-01 01:51:14 +0000345// addrmode1 instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000346class AI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
347 string opc, string asm, list<dag> pattern>
348 : I<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
349 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000350 let Inst{24-21} = opcod;
351 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000352}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000353class AsI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
354 string opc, string asm, list<dag> pattern>
355 : sI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
356 opc, asm, "", pattern> {
357 let Inst{24-21} = opcod;
358 let Inst{27-26} = {0,0};
359}
360class AXI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000361 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000362 : XI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng612b79e2008-08-29 07:40:52 +0000363 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000364 let Inst{24-21} = opcod;
365 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000366}
Bob Wilson01135592010-03-23 17:23:59 +0000367class AI1x2<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000368 string opc, string asm, list<dag> pattern>
369 : I<oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, itin,
370 opc, asm, "", pattern>;
Evan Cheng17222df2008-08-31 19:02:21 +0000371
Evan Cheng0d14fc82008-09-01 01:51:14 +0000372
373// addrmode2 loads and stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000374class AI2<dag oops, dag iops, Format f, InstrItinClass itin,
375 string opc, string asm, list<dag> pattern>
376 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
377 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000378 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000379}
Evan Cheng93912732008-09-01 01:27:33 +0000380
381// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000382class AI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
383 string opc, string asm, list<dag> pattern>
384 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
385 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000386 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000387 let Inst{21} = 0; // W bit
388 let Inst{22} = 0; // B bit
389 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000390 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000391}
Bob Wilson01135592010-03-23 17:23:59 +0000392class AXI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000393 string asm, list<dag> pattern>
394 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000395 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000396 let Inst{20} = 1; // L bit
397 let Inst{21} = 0; // W bit
398 let Inst{22} = 0; // B bit
399 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000400 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000401}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000402class AI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
403 string opc, string asm, list<dag> pattern>
404 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
405 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000406 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000407 let Inst{21} = 0; // W bit
408 let Inst{22} = 1; // B bit
409 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000410 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000411}
Bob Wilson01135592010-03-23 17:23:59 +0000412class AXI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000413 string asm, list<dag> pattern>
414 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000415 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000416 let Inst{20} = 1; // L bit
417 let Inst{21} = 0; // W bit
418 let Inst{22} = 1; // B bit
419 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000420 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000421}
Evan Cheng17222df2008-08-31 19:02:21 +0000422
Evan Cheng93912732008-09-01 01:27:33 +0000423// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000424class AI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
425 string opc, string asm, list<dag> pattern>
426 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
427 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000428 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000429 let Inst{21} = 0; // W bit
430 let Inst{22} = 0; // B bit
431 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000432 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000433}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000434class AXI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
435 string asm, list<dag> pattern>
436 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000437 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000438 let Inst{20} = 0; // L bit
439 let Inst{21} = 0; // W bit
440 let Inst{22} = 0; // B bit
441 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000442 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000443}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000444class AI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
445 string opc, string asm, list<dag> pattern>
446 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
447 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000448 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000449 let Inst{21} = 0; // W bit
450 let Inst{22} = 1; // B bit
451 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000452 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000453}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000454class AXI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
455 string asm, list<dag> pattern>
456 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000457 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000458 let Inst{20} = 0; // L bit
459 let Inst{21} = 0; // W bit
460 let Inst{22} = 1; // B bit
461 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000462 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000463}
Evan Cheng93912732008-09-01 01:27:33 +0000464
Evan Cheng840917b2008-09-01 07:00:14 +0000465// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000466class AI2ldwpr<dag oops, dag iops, Format f, InstrItinClass itin,
467 string opc, string asm, string cstr, list<dag> pattern>
468 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
469 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000470 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000471 let Inst{21} = 1; // W bit
472 let Inst{22} = 0; // B bit
473 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000474 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000475}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000476class AI2ldbpr<dag oops, dag iops, Format f, InstrItinClass itin,
477 string opc, string asm, string cstr, list<dag> pattern>
478 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
479 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000480 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000481 let Inst{21} = 1; // W bit
482 let Inst{22} = 1; // B bit
483 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000484 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000485}
486
Evan Cheng840917b2008-09-01 07:00:14 +0000487// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000488class AI2stwpr<dag oops, dag iops, Format f, InstrItinClass itin,
489 string opc, string asm, string cstr, list<dag> pattern>
490 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
491 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000492 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000493 let Inst{21} = 1; // W bit
494 let Inst{22} = 0; // B bit
495 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000496 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000497}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000498class AI2stbpr<dag oops, dag iops, Format f, InstrItinClass itin,
499 string opc, string asm, string cstr, list<dag> pattern>
500 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
501 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000502 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000503 let Inst{21} = 1; // W bit
504 let Inst{22} = 1; // B bit
505 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000506 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000507}
508
Evan Cheng840917b2008-09-01 07:00:14 +0000509// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000510class AI2ldwpo<dag oops, dag iops, Format f, InstrItinClass itin,
511 string opc, string asm, string cstr, list<dag> pattern>
512 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
513 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000514 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000515 let Inst{21} = 0; // W bit
516 let Inst{22} = 0; // B bit
517 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000518 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000519}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000520class AI2ldbpo<dag oops, dag iops, Format f, InstrItinClass itin,
521 string opc, string asm, string cstr, list<dag> pattern>
522 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
523 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000524 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000525 let Inst{21} = 0; // W bit
526 let Inst{22} = 1; // B bit
527 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000528 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000529}
530
Evan Cheng840917b2008-09-01 07:00:14 +0000531// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000532class AI2stwpo<dag oops, dag iops, Format f, InstrItinClass itin,
533 string opc, string asm, string cstr, list<dag> pattern>
534 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
535 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000536 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000537 let Inst{21} = 0; // W bit
538 let Inst{22} = 0; // B bit
539 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000540 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000541}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000542class AI2stbpo<dag oops, dag iops, Format f, InstrItinClass itin,
543 string opc, string asm, string cstr, list<dag> pattern>
544 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
545 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000546 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000547 let Inst{21} = 0; // W bit
548 let Inst{22} = 1; // B bit
549 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000550 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000551}
552
Evan Cheng0d14fc82008-09-01 01:51:14 +0000553// addrmode3 instructions
Bob Wilson01135592010-03-23 17:23:59 +0000554class AI3<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000555 string opc, string asm, list<dag> pattern>
556 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
557 opc, asm, "", pattern>;
558class AXI3<dag oops, dag iops, Format f, InstrItinClass itin,
559 string asm, list<dag> pattern>
560 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
561 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000562
Evan Cheng840917b2008-09-01 07:00:14 +0000563// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000564class AI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
565 string opc, string asm, list<dag> pattern>
566 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
567 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000568 let Inst{4} = 1;
569 let Inst{5} = 1; // H bit
570 let Inst{6} = 0; // S bit
571 let Inst{7} = 1;
572 let Inst{20} = 1; // L bit
573 let Inst{21} = 0; // W bit
574 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000575 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000576}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000577class AXI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
578 string asm, list<dag> pattern>
579 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000580 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000581 let Inst{4} = 1;
582 let Inst{5} = 1; // H bit
583 let Inst{6} = 0; // S bit
584 let Inst{7} = 1;
585 let Inst{20} = 1; // L bit
586 let Inst{21} = 0; // W bit
587 let Inst{24} = 1; // P bit
588}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000589class AI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
590 string opc, string asm, list<dag> pattern>
591 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
592 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000593 let Inst{4} = 1;
594 let Inst{5} = 1; // H bit
595 let Inst{6} = 1; // S bit
596 let Inst{7} = 1;
597 let Inst{20} = 1; // L bit
598 let Inst{21} = 0; // W bit
599 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000600 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000601}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000602class AXI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
603 string asm, list<dag> pattern>
604 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000605 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000606 let Inst{4} = 1;
607 let Inst{5} = 1; // H bit
608 let Inst{6} = 1; // S bit
609 let Inst{7} = 1;
610 let Inst{20} = 1; // L bit
611 let Inst{21} = 0; // W bit
612 let Inst{24} = 1; // P bit
613}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000614class AI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
615 string opc, string asm, list<dag> pattern>
616 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
617 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000618 let Inst{4} = 1;
619 let Inst{5} = 0; // H bit
620 let Inst{6} = 1; // S bit
621 let Inst{7} = 1;
622 let Inst{20} = 1; // L bit
623 let Inst{21} = 0; // W bit
624 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000625 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000626}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000627class AXI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
628 string asm, list<dag> pattern>
629 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000630 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000631 let Inst{4} = 1;
632 let Inst{5} = 0; // H bit
633 let Inst{6} = 1; // S bit
634 let Inst{7} = 1;
635 let Inst{20} = 1; // L bit
636 let Inst{21} = 0; // W bit
637 let Inst{24} = 1; // P bit
638}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000639class AI3ldd<dag oops, dag iops, Format f, InstrItinClass itin,
640 string opc, string asm, list<dag> pattern>
641 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
642 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000643 let Inst{4} = 1;
644 let Inst{5} = 0; // H bit
645 let Inst{6} = 1; // S bit
646 let Inst{7} = 1;
647 let Inst{20} = 0; // L bit
648 let Inst{21} = 0; // W bit
649 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000650 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000651}
652
653// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000654class AI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
655 string opc, string asm, list<dag> pattern>
656 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
657 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000658 let Inst{4} = 1;
659 let Inst{5} = 1; // H bit
660 let Inst{6} = 0; // S bit
661 let Inst{7} = 1;
662 let Inst{20} = 0; // L bit
663 let Inst{21} = 0; // W bit
664 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000665 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000666}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000667class AXI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
668 string asm, list<dag> pattern>
669 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000670 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000671 let Inst{4} = 1;
672 let Inst{5} = 1; // H bit
673 let Inst{6} = 0; // S bit
674 let Inst{7} = 1;
675 let Inst{20} = 0; // L bit
676 let Inst{21} = 0; // W bit
677 let Inst{24} = 1; // P bit
678}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000679class AI3std<dag oops, dag iops, Format f, InstrItinClass itin,
680 string opc, string asm, list<dag> pattern>
681 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
682 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000683 let Inst{4} = 1;
684 let Inst{5} = 1; // H bit
685 let Inst{6} = 1; // S bit
686 let Inst{7} = 1;
687 let Inst{20} = 0; // L bit
688 let Inst{21} = 0; // W bit
689 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000690 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000691}
692
693// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000694class AI3ldhpr<dag oops, dag iops, Format f, InstrItinClass itin,
695 string opc, string asm, string cstr, list<dag> pattern>
696 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
697 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000698 let Inst{4} = 1;
699 let Inst{5} = 1; // H bit
700 let Inst{6} = 0; // S bit
701 let Inst{7} = 1;
702 let Inst{20} = 1; // L bit
703 let Inst{21} = 1; // W bit
704 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000705 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000706}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000707class AI3ldshpr<dag oops, dag iops, Format f, InstrItinClass itin,
708 string opc, string asm, string cstr, list<dag> pattern>
709 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
710 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000711 let Inst{4} = 1;
712 let Inst{5} = 1; // H bit
713 let Inst{6} = 1; // S bit
714 let Inst{7} = 1;
715 let Inst{20} = 1; // L bit
716 let Inst{21} = 1; // W bit
717 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000718 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000719}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000720class AI3ldsbpr<dag oops, dag iops, Format f, InstrItinClass itin,
721 string opc, string asm, string cstr, list<dag> pattern>
722 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
723 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000724 let Inst{4} = 1;
725 let Inst{5} = 0; // H bit
726 let Inst{6} = 1; // S bit
727 let Inst{7} = 1;
728 let Inst{20} = 1; // L bit
729 let Inst{21} = 1; // W bit
730 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000731 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000732}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000733class AI3lddpr<dag oops, dag iops, Format f, InstrItinClass itin,
734 string opc, string asm, string cstr, list<dag> pattern>
735 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
736 opc, asm, cstr, pattern> {
737 let Inst{4} = 1;
738 let Inst{5} = 0; // H bit
739 let Inst{6} = 1; // S bit
740 let Inst{7} = 1;
741 let Inst{20} = 0; // L bit
742 let Inst{21} = 1; // W bit
743 let Inst{24} = 1; // P bit
744 let Inst{27-25} = 0b000;
745}
746
Evan Cheng840917b2008-09-01 07:00:14 +0000747
748// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000749class AI3sthpr<dag oops, dag iops, Format f, InstrItinClass itin,
750 string opc, string asm, string cstr, list<dag> pattern>
751 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
752 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000753 let Inst{4} = 1;
754 let Inst{5} = 1; // H bit
755 let Inst{6} = 0; // S bit
756 let Inst{7} = 1;
757 let Inst{20} = 0; // L bit
758 let Inst{21} = 1; // W bit
759 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000760 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000761}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000762class AI3stdpr<dag oops, dag iops, Format f, InstrItinClass itin,
763 string opc, string asm, string cstr, list<dag> pattern>
764 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
765 opc, asm, cstr, pattern> {
766 let Inst{4} = 1;
767 let Inst{5} = 1; // H bit
768 let Inst{6} = 1; // S bit
769 let Inst{7} = 1;
770 let Inst{20} = 0; // L bit
771 let Inst{21} = 1; // W bit
772 let Inst{24} = 1; // P bit
773 let Inst{27-25} = 0b000;
774}
Evan Cheng840917b2008-09-01 07:00:14 +0000775
776// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000777class AI3ldhpo<dag oops, dag iops, Format f, InstrItinClass itin,
778 string opc, string asm, string cstr, list<dag> pattern>
779 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
780 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000781 let Inst{4} = 1;
782 let Inst{5} = 1; // H bit
783 let Inst{6} = 0; // S bit
784 let Inst{7} = 1;
785 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000786 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000787 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000788 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000789}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000790class AI3ldshpo<dag oops, dag iops, Format f, InstrItinClass itin,
791 string opc, string asm, string cstr, list<dag> pattern>
792 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
793 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000794 let Inst{4} = 1;
795 let Inst{5} = 1; // H bit
796 let Inst{6} = 1; // S bit
797 let Inst{7} = 1;
798 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000799 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000800 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000801 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000802}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000803class AI3ldsbpo<dag oops, dag iops, Format f, InstrItinClass itin,
804 string opc, string asm, string cstr, list<dag> pattern>
805 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
806 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000807 let Inst{4} = 1;
808 let Inst{5} = 0; // H bit
809 let Inst{6} = 1; // S bit
810 let Inst{7} = 1;
811 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000812 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000813 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000814 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000815}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000816class AI3lddpo<dag oops, dag iops, Format f, InstrItinClass itin,
817 string opc, string asm, string cstr, list<dag> pattern>
818 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
819 opc, asm, cstr, pattern> {
820 let Inst{4} = 1;
821 let Inst{5} = 0; // H bit
822 let Inst{6} = 1; // S bit
823 let Inst{7} = 1;
824 let Inst{20} = 0; // L bit
825 let Inst{21} = 0; // W bit
826 let Inst{24} = 0; // P bit
827 let Inst{27-25} = 0b000;
828}
Evan Cheng840917b2008-09-01 07:00:14 +0000829
830// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000831class AI3sthpo<dag oops, dag iops, Format f, InstrItinClass itin,
832 string opc, string asm, string cstr, list<dag> pattern>
833 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
834 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000835 let Inst{4} = 1;
836 let Inst{5} = 1; // H bit
837 let Inst{6} = 0; // S bit
838 let Inst{7} = 1;
839 let Inst{20} = 0; // L bit
Johnny Chenad4df4c2010-03-01 19:22:00 +0000840 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000841 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000842 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000843}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000844class AI3stdpo<dag oops, dag iops, Format f, InstrItinClass itin,
845 string opc, string asm, string cstr, list<dag> pattern>
846 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
847 opc, asm, cstr, pattern> {
848 let Inst{4} = 1;
849 let Inst{5} = 1; // H bit
850 let Inst{6} = 1; // S bit
851 let Inst{7} = 1;
852 let Inst{20} = 0; // L bit
853 let Inst{21} = 0; // W bit
854 let Inst{24} = 0; // P bit
855 let Inst{27-25} = 0b000;
856}
Evan Cheng840917b2008-09-01 07:00:14 +0000857
Evan Cheng0d14fc82008-09-01 01:51:14 +0000858// addrmode4 instructions
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000859class AXI4ld<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000860 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000861 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000862 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000863 let Inst{20} = 1; // L bit
864 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000865 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000866}
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000867class AXI4st<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000868 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000869 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000870 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000871 let Inst{20} = 0; // L bit
872 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000873 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000874}
Evan Cheng37f25d92008-08-28 23:39:26 +0000875
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000876// Unsigned multiply, multiply-accumulate instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000877class AMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
878 string opc, string asm, list<dag> pattern>
879 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
880 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000881 let Inst{7-4} = 0b1001;
Evan Chengfbc9d412008-11-06 01:21:28 +0000882 let Inst{20} = 0; // S bit
Evan Chengd87293c2008-11-06 08:47:38 +0000883 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000884}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000885class AsMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
886 string opc, string asm, list<dag> pattern>
887 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
888 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000889 let Inst{7-4} = 0b1001;
Evan Chengd87293c2008-11-06 08:47:38 +0000890 let Inst{27-21} = opcod;
Evan Chengfbc9d412008-11-06 01:21:28 +0000891}
892
893// Most significant word multiply
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000894class AMul2I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
895 string opc, string asm, list<dag> pattern>
896 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
897 opc, asm, "", pattern> {
Evan Chengfbc9d412008-11-06 01:21:28 +0000898 let Inst{7-4} = 0b1001;
899 let Inst{20} = 1;
Evan Chengd87293c2008-11-06 08:47:38 +0000900 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000901}
Evan Cheng37f25d92008-08-28 23:39:26 +0000902
Evan Chengeb4f52e2008-11-06 03:35:07 +0000903// SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000904class AMulxyI<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
905 string opc, string asm, list<dag> pattern>
906 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
907 opc, asm, "", pattern> {
Evan Chengeb4f52e2008-11-06 03:35:07 +0000908 let Inst{4} = 0;
909 let Inst{7} = 1;
910 let Inst{20} = 0;
Evan Chengd87293c2008-11-06 08:47:38 +0000911 let Inst{27-21} = opcod;
Evan Chengeb4f52e2008-11-06 03:35:07 +0000912}
913
Evan Cheng97f48c32008-11-06 22:15:19 +0000914// Extend instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000915class AExtI<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
916 string opc, string asm, list<dag> pattern>
917 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ExtFrm, itin,
918 opc, asm, "", pattern> {
Evan Cheng97f48c32008-11-06 22:15:19 +0000919 let Inst{7-4} = 0b0111;
920 let Inst{27-20} = opcod;
921}
922
Evan Cheng8b59db32008-11-07 01:41:35 +0000923// Misc Arithmetic instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000924class AMiscA1I<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
925 string opc, string asm, list<dag> pattern>
926 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ArithMiscFrm, itin,
927 opc, asm, "", pattern> {
Evan Cheng8b59db32008-11-07 01:41:35 +0000928 let Inst{27-20} = opcod;
929}
930
Evan Cheng37f25d92008-08-28 23:39:26 +0000931//===----------------------------------------------------------------------===//
932
933// ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
934class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
935 list<Predicate> Predicates = [IsARM];
936}
937class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
938 list<Predicate> Predicates = [IsARM, HasV5TE];
939}
940class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
941 list<Predicate> Predicates = [IsARM, HasV6];
942}
Evan Cheng13096642008-08-29 06:41:12 +0000943
944//===----------------------------------------------------------------------===//
945//
946// Thumb Instruction Format Definitions.
947//
948
Evan Cheng13096642008-08-29 06:41:12 +0000949// TI - Thumb instruction.
950
Evan Cheng446c4282009-07-11 06:43:01 +0000951class ThumbI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000952 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000953 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000954 let OutOperandList = oops;
955 let InOperandList = iops;
Evan Cheng13096642008-08-29 06:41:12 +0000956 let AsmString = asm;
957 let Pattern = pattern;
958 list<Predicate> Predicates = [IsThumb];
959}
960
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000961class TI<dag oops, dag iops, InstrItinClass itin, string asm, list<dag> pattern>
962 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000963
Evan Cheng35d6c412009-08-04 23:47:55 +0000964// Two-address instructions
Bob Wilson01135592010-03-23 17:23:59 +0000965class TIt<dag oops, dag iops, InstrItinClass itin, string asm,
966 list<dag> pattern>
967 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "$lhs = $dst",
968 pattern>;
Evan Cheng35d6c412009-08-04 23:47:55 +0000969
Johnny Chend68e1192009-12-15 17:24:14 +0000970// tBL, tBX 32-bit instructions
971class TIx2<bits<5> opcod1, bits<2> opcod2, bit opcod3,
Bob Wilson01135592010-03-23 17:23:59 +0000972 dag oops, dag iops, InstrItinClass itin, string asm,
973 list<dag> pattern>
974 : ThumbI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>,
975 Encoding {
Johnny Chend68e1192009-12-15 17:24:14 +0000976 let Inst{31-27} = opcod1;
977 let Inst{15-14} = opcod2;
978 let Inst{12} = opcod3;
979}
Evan Cheng13096642008-08-29 06:41:12 +0000980
981// BR_JT instructions
Bob Wilson01135592010-03-23 17:23:59 +0000982class TJTI<dag oops, dag iops, InstrItinClass itin, string asm,
983 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000984 : ThumbI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000985
Evan Cheng09c39fc2009-06-23 19:38:13 +0000986// Thumb1 only
Evan Cheng446c4282009-07-11 06:43:01 +0000987class Thumb1I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000988 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000989 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000990 let OutOperandList = oops;
991 let InOperandList = iops;
Evan Cheng09c39fc2009-06-23 19:38:13 +0000992 let AsmString = asm;
993 let Pattern = pattern;
994 list<Predicate> Predicates = [IsThumb1Only];
995}
996
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000997class T1I<dag oops, dag iops, InstrItinClass itin,
998 string asm, list<dag> pattern>
999 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
1000class T1Ix2<dag oops, dag iops, InstrItinClass itin,
1001 string asm, list<dag> pattern>
1002 : Thumb1I<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1003class T1JTI<dag oops, dag iops, InstrItinClass itin,
1004 string asm, list<dag> pattern>
Johnny Chenbbc71b22009-12-16 02:32:54 +00001005 : Thumb1I<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001006
1007// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001008class T1It<dag oops, dag iops, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001009 string asm, string cstr, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001010 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001011 asm, cstr, pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001012
1013// Thumb1 instruction that can either be predicated or set CPSR.
1014class Thumb1sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001015 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001016 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001017 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Chris Lattnerb7d52262010-03-18 21:06:54 +00001018 let OutOperandList = !con(oops, (outs s_cc_out:$s));
1019 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001020 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1021 let Pattern = pattern;
1022 list<Predicate> Predicates = [IsThumb1Only];
1023}
1024
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001025class T1sI<dag oops, dag iops, InstrItinClass itin,
1026 string opc, string asm, list<dag> pattern>
1027 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001028
1029// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001030class T1sIt<dag oops, dag iops, InstrItinClass itin,
1031 string opc, string asm, list<dag> pattern>
1032 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001033 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001034
1035// Thumb1 instruction that can be predicated.
1036class Thumb1pI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001037 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001038 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001039 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +00001040 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001041 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001042 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1043 let Pattern = pattern;
1044 list<Predicate> Predicates = [IsThumb1Only];
1045}
1046
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001047class T1pI<dag oops, dag iops, InstrItinClass itin,
1048 string opc, string asm, list<dag> pattern>
1049 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001050
1051// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001052class T1pIt<dag oops, dag iops, InstrItinClass itin,
1053 string opc, string asm, list<dag> pattern>
1054 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001055 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001056
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001057class T1pI1<dag oops, dag iops, InstrItinClass itin,
1058 string opc, string asm, list<dag> pattern>
1059 : Thumb1pI<oops, iops, AddrModeT1_1, Size2Bytes, itin, opc, asm, "", pattern>;
1060class T1pI2<dag oops, dag iops, InstrItinClass itin,
1061 string opc, string asm, list<dag> pattern>
1062 : Thumb1pI<oops, iops, AddrModeT1_2, Size2Bytes, itin, opc, asm, "", pattern>;
1063class T1pI4<dag oops, dag iops, InstrItinClass itin,
1064 string opc, string asm, list<dag> pattern>
1065 : Thumb1pI<oops, iops, AddrModeT1_4, Size2Bytes, itin, opc, asm, "", pattern>;
Bob Wilson01135592010-03-23 17:23:59 +00001066class T1pIs<dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001067 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1068 : Thumb1pI<oops, iops, AddrModeT1_s, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001069
Johnny Chenbbc71b22009-12-16 02:32:54 +00001070class Encoding16 : Encoding {
1071 let Inst{31-16} = 0x0000;
1072}
1073
Johnny Chend68e1192009-12-15 17:24:14 +00001074// A6.2 16-bit Thumb instruction encoding
Johnny Chenbbc71b22009-12-16 02:32:54 +00001075class T1Encoding<bits<6> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001076 let Inst{15-10} = opcode;
1077}
1078
1079// A6.2.1 Shift (immediate), add, subtract, move, and compare encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001080class T1General<bits<5> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001081 let Inst{15-14} = 0b00;
1082 let Inst{13-9} = opcode;
1083}
1084
1085// A6.2.2 Data-processing encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001086class T1DataProcessing<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001087 let Inst{15-10} = 0b010000;
1088 let Inst{9-6} = opcode;
1089}
1090
1091// A6.2.3 Special data instructions and branch and exchange encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001092class T1Special<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001093 let Inst{15-10} = 0b010001;
1094 let Inst{9-6} = opcode;
1095}
1096
1097// A6.2.4 Load/store single data item encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001098class T1LoadStore<bits<4> opA, bits<3> opB> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001099 let Inst{15-12} = opA;
1100 let Inst{11-9} = opB;
1101}
1102class T1LdSt<bits<3> opB> : T1LoadStore<0b0101, opB>;
1103class T1LdSt4Imm<bits<3> opB> : T1LoadStore<0b0110, opB>; // Immediate, 4 bytes
1104class T1LdSt1Imm<bits<3> opB> : T1LoadStore<0b0111, opB>; // Immediate, 1 byte
1105class T1LdSt2Imm<bits<3> opB> : T1LoadStore<0b1000, opB>; // Immediate, 2 bytes
1106class T1LdStSP<bits<3> opB> : T1LoadStore<0b1001, opB>; // SP relative
1107
1108// A6.2.5 Miscellaneous 16-bit instructions encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001109class T1Misc<bits<7> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001110 let Inst{15-12} = 0b1011;
1111 let Inst{11-5} = opcode;
1112}
1113
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001114// Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
1115class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001116 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001117 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001118 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001119 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001120 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001121 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1122 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001123 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001124}
1125
1126// Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as
1127// an input operand since by default it's a zero register. It will
1128// become an implicit def once it's "flipped".
1129// FIXME: This uses unified syntax so {s} comes before {p}. We should make it
1130// more consistent.
1131class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001132 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001133 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001134 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001135 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001136 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001137 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1138 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001139 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001140}
1141
1142// Special cases
1143class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001144 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001145 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001146 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001147 let OutOperandList = oops;
1148 let InOperandList = iops;
Evan Chengf49810c2009-06-23 17:48:47 +00001149 let AsmString = asm;
1150 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001151 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001152}
1153
Jim Grosbachd1228742009-12-01 18:10:36 +00001154class ThumbXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +00001155 InstrItinClass itin,
1156 string asm, string cstr, list<dag> pattern>
Jim Grosbachd1228742009-12-01 18:10:36 +00001157 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1158 let OutOperandList = oops;
1159 let InOperandList = iops;
1160 let AsmString = asm;
1161 let Pattern = pattern;
1162 list<Predicate> Predicates = [IsThumb1Only];
1163}
1164
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001165class T2I<dag oops, dag iops, InstrItinClass itin,
1166 string opc, string asm, list<dag> pattern>
1167 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
1168class T2Ii12<dag oops, dag iops, InstrItinClass itin,
1169 string opc, string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001170 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, itin, opc, asm, "",pattern>;
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001171class T2Ii8<dag oops, dag iops, InstrItinClass itin,
1172 string opc, string asm, list<dag> pattern>
1173 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, itin, opc, asm, "", pattern>;
1174class T2Iso<dag oops, dag iops, InstrItinClass itin,
1175 string opc, string asm, list<dag> pattern>
1176 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, itin, opc, asm, "", pattern>;
1177class T2Ipc<dag oops, dag iops, InstrItinClass itin,
1178 string opc, string asm, list<dag> pattern>
1179 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, itin, opc, asm, "", pattern>;
Johnny Chend68e1192009-12-15 17:24:14 +00001180class T2Ii8s4<bit P, bit W, bit load, dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001181 string opc, string asm, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001182 : Thumb2I<oops, iops, AddrModeT2_i8s4, Size4Bytes, itin, opc, asm, "",
1183 pattern> {
1184 let Inst{31-27} = 0b11101;
1185 let Inst{26-25} = 0b00;
1186 let Inst{24} = P;
1187 let Inst{23} = ?; // The U bit.
1188 let Inst{22} = 1;
1189 let Inst{21} = W;
1190 let Inst{20} = load;
1191}
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001192
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001193class T2sI<dag oops, dag iops, InstrItinClass itin,
1194 string opc, string asm, list<dag> pattern>
1195 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001196
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001197class T2XI<dag oops, dag iops, InstrItinClass itin,
1198 string asm, list<dag> pattern>
1199 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1200class T2JTI<dag oops, dag iops, InstrItinClass itin,
1201 string asm, list<dag> pattern>
1202 : Thumb2XI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Chengf49810c2009-06-23 17:48:47 +00001203
Evan Cheng5adb66a2009-09-28 09:14:39 +00001204class T2Ix2<dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001205 string opc, string asm, list<dag> pattern>
Evan Cheng5adb66a2009-09-28 09:14:39 +00001206 : Thumb2I<oops, iops, AddrModeNone, Size8Bytes, itin, opc, asm, "", pattern>;
1207
Bob Wilson815baeb2010-03-13 01:08:20 +00001208// Two-address instructions
1209class T2XIt<dag oops, dag iops, InstrItinClass itin,
1210 string asm, string cstr, list<dag> pattern>
1211 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, cstr, pattern>;
Evan Cheng5adb66a2009-09-28 09:14:39 +00001212
Evan Chenge88d5ce2009-07-02 07:28:31 +00001213// T2Iidxldst - Thumb2 indexed load / store instructions.
Johnny Chend68e1192009-12-15 17:24:14 +00001214class T2Iidxldst<bit signed, bits<2> opcod, bit load, bit pre,
1215 dag oops, dag iops,
1216 AddrMode am, IndexMode im, InstrItinClass itin,
Evan Chenge88d5ce2009-07-02 07:28:31 +00001217 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001218 : InstARM<am, Size4Bytes, im, ThumbFrm, GenericDomain, cstr, itin> {
Evan Chenge88d5ce2009-07-02 07:28:31 +00001219 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001220 let InOperandList = !con(iops, (ins pred:$p));
Evan Chenge88d5ce2009-07-02 07:28:31 +00001221 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1222 let Pattern = pattern;
1223 list<Predicate> Predicates = [IsThumb2];
Johnny Chend68e1192009-12-15 17:24:14 +00001224 let Inst{31-27} = 0b11111;
1225 let Inst{26-25} = 0b00;
1226 let Inst{24} = signed;
1227 let Inst{23} = 0;
1228 let Inst{22-21} = opcod;
1229 let Inst{20} = load;
1230 let Inst{11} = 1;
1231 // (P, W) = (1, 1) Pre-indexed or (0, 1) Post-indexed
1232 let Inst{10} = pre; // The P bit.
1233 let Inst{8} = 1; // The W bit.
Evan Chenge88d5ce2009-07-02 07:28:31 +00001234}
1235
Johnny Chenadc77332010-02-26 22:04:29 +00001236// Helper class for disassembly only
1237// A6.3.16 & A6.3.17
1238// T2Imac - Thumb2 multiply [accumulate, and absolute difference] instructions.
1239class T2I_mac<bit long, bits<3> op22_20, bits<4> op7_4, dag oops, dag iops,
1240 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1241 : T2I<oops, iops, itin, opc, asm, pattern> {
1242 let Inst{31-27} = 0b11111;
1243 let Inst{26-24} = 0b011;
1244 let Inst{23} = long;
1245 let Inst{22-20} = op22_20;
1246 let Inst{7-4} = op7_4;
1247}
1248
David Goodwinc9d138f2009-07-27 19:59:26 +00001249// Tv5Pat - Same as Pat<>, but requires V5T Thumb mode.
1250class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
1251 list<Predicate> Predicates = [IsThumb1Only, HasV5T];
1252}
1253
1254// T1Pat - Same as Pat<>, but requires that the compiler be in Thumb1 mode.
1255class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
1256 list<Predicate> Predicates = [IsThumb1Only];
1257}
Evan Chenge88d5ce2009-07-02 07:28:31 +00001258
Evan Cheng9cb9e672009-06-27 02:26:13 +00001259// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
1260class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Chengd770d9e2009-07-02 06:38:40 +00001261 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001262}
1263
Evan Cheng13096642008-08-29 06:41:12 +00001264//===----------------------------------------------------------------------===//
1265
Evan Cheng96581d32008-11-11 02:11:05 +00001266//===----------------------------------------------------------------------===//
1267// ARM VFP Instruction templates.
1268//
1269
David Goodwin3ca524e2009-07-10 17:03:29 +00001270// Almost all VFP instructions are predicable.
1271class VFPI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001272 IndexMode im, Format f, InstrItinClass itin,
1273 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001274 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001275 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001276 let InOperandList = !con(iops, (ins pred:$p));
David Goodwin3ca524e2009-07-10 17:03:29 +00001277 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1278 let Pattern = pattern;
1279 list<Predicate> Predicates = [HasVFP2];
1280}
1281
1282// Special cases
1283class VFPXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001284 IndexMode im, Format f, InstrItinClass itin,
1285 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001286 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001287 let OutOperandList = oops;
1288 let InOperandList = iops;
1289 let AsmString = asm;
1290 let Pattern = pattern;
1291 list<Predicate> Predicates = [HasVFP2];
1292}
1293
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001294class VFPAI<dag oops, dag iops, Format f, InstrItinClass itin,
1295 string opc, string asm, list<dag> pattern>
1296 : VFPI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
1297 opc, asm, "", pattern>;
David Goodwin3ca524e2009-07-10 17:03:29 +00001298
Evan Chengcd8e66a2008-11-11 21:48:44 +00001299// ARM VFP addrmode5 loads and stores
1300class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001301 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001302 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001303 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001304 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001305 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001306 let Inst{27-24} = opcod1;
1307 let Inst{21-20} = opcod2;
1308 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001309
1310 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1311 let Dom = VFPNeonDomain.Value;
Evan Cheng96581d32008-11-11 02:11:05 +00001312}
1313
Evan Chengcd8e66a2008-11-11 21:48:44 +00001314class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001315 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001316 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001317 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001318 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001319 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001320 let Inst{27-24} = opcod1;
1321 let Inst{21-20} = opcod2;
1322 let Inst{11-8} = 0b1010;
Evan Cheng96581d32008-11-11 02:11:05 +00001323}
1324
Evan Chengcd8e66a2008-11-11 21:48:44 +00001325// Load / store multiple
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001326class AXDI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001327 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001328 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001329 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001330 // TODO: Mark the instructions with the appropriate subtarget info.
1331 let Inst{27-25} = 0b110;
1332 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001333
1334 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1335 let Dom = VFPNeonDomain.Value;
Evan Chengcd8e66a2008-11-11 21:48:44 +00001336}
1337
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001338class AXSI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001339 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001340 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001341 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001342 // TODO: Mark the instructions with the appropriate subtarget info.
1343 let Inst{27-25} = 0b110;
1344 let Inst{11-8} = 0b1010;
1345}
1346
Evan Cheng96581d32008-11-11 02:11:05 +00001347// Double precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001348class ADuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1349 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1350 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001351 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001352 let Inst{27-23} = opcod1;
1353 let Inst{21-20} = opcod2;
1354 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001355 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001356 let Inst{7-6} = opcod4;
1357 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001358}
1359
1360// Double precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001361class ADbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001362 dag iops, InstrItinClass itin, string opc, string asm,
1363 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001364 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001365 let Inst{27-23} = opcod1;
1366 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001367 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001368 let Inst{6} = op6;
1369 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001370}
1371
Jim Grosbach26767372010-03-24 22:31:46 +00001372// Double precision, binary, VML[AS] (for additional predicate)
1373class ADbI_vmlX<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
1374 dag iops, InstrItinClass itin, string opc, string asm,
1375 list<dag> pattern>
1376 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
1377 let Inst{27-23} = opcod1;
1378 let Inst{21-20} = opcod2;
1379 let Inst{11-8} = 0b1011;
1380 let Inst{6} = op6;
1381 let Inst{4} = op4;
1382 list<Predicate> Predicates = [HasVFP2, UseVMLx];
1383}
1384
1385
Evan Cheng96581d32008-11-11 02:11:05 +00001386// Single precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001387class ASuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1388 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1389 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001390 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001391 let Inst{27-23} = opcod1;
1392 let Inst{21-20} = opcod2;
1393 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001394 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001395 let Inst{7-6} = opcod4;
1396 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001397}
1398
David Goodwin338268c2009-08-10 22:17:39 +00001399// Single precision unary, if no NEON
David Goodwin53e44712009-08-04 20:39:05 +00001400// Same as ASuI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001401class ASuIn<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1402 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1403 string asm, list<dag> pattern>
1404 : ASuI<opcod1, opcod2, opcod3, opcod4, opcod5, oops, iops, itin, opc, asm,
1405 pattern> {
David Goodwin53e44712009-08-04 20:39:05 +00001406 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1407}
1408
Evan Cheng96581d32008-11-11 02:11:05 +00001409// Single precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001410class ASbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops, dag iops,
1411 InstrItinClass itin, string opc, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001412 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001413 let Inst{27-23} = opcod1;
1414 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001415 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001416 let Inst{6} = op6;
1417 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001418}
1419
David Goodwin338268c2009-08-10 22:17:39 +00001420// Single precision binary, if no NEON
David Goodwin42a83f22009-08-04 17:53:06 +00001421// Same as ASbI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001422class ASbIn<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001423 dag iops, InstrItinClass itin, string opc, string asm,
1424 list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001425 : ASbI<opcod1, opcod2, op6, op4, oops, iops, itin, opc, asm, pattern> {
David Goodwin42a83f22009-08-04 17:53:06 +00001426 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1427}
1428
Evan Cheng80a11982008-11-12 06:41:41 +00001429// VFP conversion instructions
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001430class AVConv1I<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
1431 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1432 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001433 : VFPAI<oops, iops, VFPConv1Frm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001434 let Inst{27-23} = opcod1;
1435 let Inst{21-20} = opcod2;
1436 let Inst{19-16} = opcod3;
1437 let Inst{11-8} = opcod4;
Evan Cheng80a11982008-11-12 06:41:41 +00001438 let Inst{6} = 1;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001439 let Inst{4} = 0;
Evan Cheng80a11982008-11-12 06:41:41 +00001440}
1441
Johnny Chen811663f2010-02-11 18:47:03 +00001442// VFP conversion between floating-point and fixed-point
1443class AVConv1XI<bits<5> op1, bits<2> op2, bits<4> op3, bits<4> op4, bit op5,
Bob Wilson01135592010-03-23 17:23:59 +00001444 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1445 list<dag> pattern>
Johnny Chen811663f2010-02-11 18:47:03 +00001446 : AVConv1I<op1, op2, op3, op4, oops, iops, itin, opc, asm, pattern> {
1447 // size (fixed-point number): sx == 0 ? 16 : 32
1448 let Inst{7} = op5; // sx
1449}
1450
David Goodwin338268c2009-08-10 22:17:39 +00001451// VFP conversion instructions, if no NEON
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001452class AVConv1In<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
David Goodwin338268c2009-08-10 22:17:39 +00001453 dag oops, dag iops, InstrItinClass itin,
1454 string opc, string asm, list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001455 : AVConv1I<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
1456 pattern> {
David Goodwin338268c2009-08-10 22:17:39 +00001457 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1458}
1459
Evan Cheng80a11982008-11-12 06:41:41 +00001460class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001461 InstrItinClass itin,
1462 string opc, string asm, list<dag> pattern>
1463 : VFPAI<oops, iops, f, itin, opc, asm, pattern> {
Evan Cheng80a11982008-11-12 06:41:41 +00001464 let Inst{27-20} = opcod1;
Evan Cheng78be83d2008-11-11 19:40:26 +00001465 let Inst{11-8} = opcod2;
1466 let Inst{4} = 1;
1467}
1468
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001469class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1470 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1471 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, itin, opc, asm, pattern>;
Evan Cheng0a0ab132008-11-11 22:46:12 +00001472
Bob Wilson01135592010-03-23 17:23:59 +00001473class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001474 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1475 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001476
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001477class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1478 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1479 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001480
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001481class AVConv5I<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, VFPConv5Frm, itin, opc, asm, pattern>;
Evan Cheng78be83d2008-11-11 19:40:26 +00001484
Evan Cheng96581d32008-11-11 02:11:05 +00001485//===----------------------------------------------------------------------===//
1486
Bob Wilson5bafff32009-06-22 23:27:02 +00001487//===----------------------------------------------------------------------===//
1488// ARM NEON Instruction templates.
1489//
Evan Cheng13096642008-08-29 06:41:12 +00001490
Johnny Chencaa608e2010-03-20 00:17:00 +00001491class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1492 InstrItinClass itin, string opc, string dt, string asm, string cstr,
1493 list<dag> pattern>
1494 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Evan Chengf81bf152009-11-23 21:57:23 +00001495 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001496 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001497 let AsmString = !strconcat(
1498 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1499 !strconcat("\t", asm));
1500 let Pattern = pattern;
1501 list<Predicate> Predicates = [HasNEON];
1502}
1503
1504// Same as NeonI except it does not have a "data type" specifier.
Johnny Chen927b88f2010-03-23 20:40:44 +00001505class NeonXI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1506 InstrItinClass itin, string opc, string asm, string cstr,
1507 list<dag> pattern>
1508 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001509 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001510 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001511 let AsmString = !strconcat(!strconcat(opc, "${p}"), !strconcat("\t", asm));
Bob Wilson5bafff32009-06-22 23:27:02 +00001512 let Pattern = pattern;
1513 list<Predicate> Predicates = [HasNEON];
Evan Cheng13096642008-08-29 06:41:12 +00001514}
1515
Evan Chengac0869d2009-11-21 06:21:52 +00001516class NI<dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1517 list<dag> pattern>
Johnny Chen927b88f2010-03-23 20:40:44 +00001518 : NeonXI<oops, iops, AddrModeNone, IndexModeNone, NEONFrm, itin, opc, asm, "",
Bob Wilson01135592010-03-23 17:23:59 +00001519 pattern> {
Evan Cheng13096642008-08-29 06:41:12 +00001520}
Bob Wilson5bafff32009-06-22 23:27:02 +00001521
Bob Wilsonb07c1712009-10-07 21:53:04 +00001522class NLdSt<bit op23, bits<2> op21_20, bits<4> op11_8, bits<4> op7_4,
1523 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001524 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chencaa608e2010-03-20 00:17:00 +00001525 : NeonI<oops, iops, AddrMode6, IndexModeNone, NLdStFrm, itin, opc, dt, asm,
1526 cstr, pattern> {
Bob Wilson205a5ca2009-07-08 18:11:30 +00001527 let Inst{31-24} = 0b11110100;
Jim Grosbach780d2072009-10-20 00:19:08 +00001528 let Inst{23} = op23;
1529 let Inst{21-20} = op21_20;
1530 let Inst{11-8} = op11_8;
1531 let Inst{7-4} = op7_4;
Bob Wilson205a5ca2009-07-08 18:11:30 +00001532}
1533
Johnny Chen785516a2010-03-23 16:43:47 +00001534class NDataI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001535 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chen785516a2010-03-23 16:43:47 +00001536 : NeonI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, dt, asm, cstr,
1537 pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001538 let Inst{31-25} = 0b1111001;
1539}
1540
Johnny Chen927b88f2010-03-23 20:40:44 +00001541class NDataXI<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001542 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chen927b88f2010-03-23 20:40:44 +00001543 : NeonXI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001544 cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001545 let Inst{31-25} = 0b1111001;
1546}
1547
1548// NEON "one register and a modified immediate" format.
1549class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1550 bit op5, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001551 dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001552 string opc, string dt, string asm, string cstr,
1553 list<dag> pattern>
Johnny Chena2711742010-03-23 23:09:14 +00001554 : NDataI<oops, iops, N1RegModImmFrm, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001555 let Inst{23} = op23;
1556 let Inst{21-19} = op21_19;
1557 let Inst{11-8} = op11_8;
1558 let Inst{7} = op7;
1559 let Inst{6} = op6;
1560 let Inst{5} = op5;
1561 let Inst{4} = op4;
1562}
1563
1564// NEON 2 vector register format.
1565class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1566 bits<5> op11_7, bit op6, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001567 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001568 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001569 : NDataI<oops, iops, N2RegFrm, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001570 let Inst{24-23} = op24_23;
1571 let Inst{21-20} = op21_20;
1572 let Inst{19-18} = op19_18;
1573 let Inst{17-16} = op17_16;
1574 let Inst{11-7} = op11_7;
1575 let Inst{6} = op6;
1576 let Inst{4} = op4;
1577}
1578
1579// Same as N2V except it doesn't have a datatype suffix.
1580class N2VX<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
Bob Wilson01135592010-03-23 17:23:59 +00001581 bits<5> op11_7, bit op6, bit op4,
1582 dag oops, dag iops, InstrItinClass itin,
1583 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001584 : NDataXI<oops, iops, N2RegFrm, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001585 let Inst{24-23} = op24_23;
1586 let Inst{21-20} = op21_20;
1587 let Inst{19-18} = op19_18;
1588 let Inst{17-16} = op17_16;
1589 let Inst{11-7} = op11_7;
1590 let Inst{6} = op6;
1591 let Inst{4} = op4;
1592}
1593
1594// NEON 2 vector register with immediate.
Bob Wilson507df402009-10-21 02:15:46 +00001595class N2VImm<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001596 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001597 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chen785516a2010-03-23 16:43:47 +00001598 : NDataI<oops, iops, NEONFrm, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001599 let Inst{24} = op24;
1600 let Inst{23} = op23;
Bob Wilson5bafff32009-06-22 23:27:02 +00001601 let Inst{11-8} = op11_8;
1602 let Inst{7} = op7;
1603 let Inst{6} = op6;
1604 let Inst{4} = op4;
1605}
1606
1607// NEON 3 vector register format.
1608class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001609 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001610 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chen785516a2010-03-23 16:43:47 +00001611 : NDataI<oops, iops, NEONFrm, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001612 let Inst{24} = op24;
1613 let Inst{23} = op23;
1614 let Inst{21-20} = op21_20;
1615 let Inst{11-8} = op11_8;
1616 let Inst{6} = op6;
1617 let Inst{4} = op4;
1618}
1619
Johnny Chen841e8282010-03-23 21:35:03 +00001620// Same as N3V except it doesn't have a data type suffix.
Bob Wilson01135592010-03-23 17:23:59 +00001621class N3VX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
1622 bit op4,
1623 dag oops, dag iops, InstrItinClass itin,
1624 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chen927b88f2010-03-23 20:40:44 +00001625 : NDataXI<oops, iops, NEONFrm, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001626 let Inst{24} = op24;
1627 let Inst{23} = op23;
1628 let Inst{21-20} = op21_20;
1629 let Inst{11-8} = op11_8;
1630 let Inst{6} = op6;
1631 let Inst{4} = op4;
1632}
1633
1634// NEON VMOVs between scalar and core registers.
1635class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001636 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001637 string opc, string dt, string asm, list<dag> pattern>
1638 : InstARM<AddrModeNone, Size4Bytes, IndexModeNone, f, GenericDomain,
Bob Wilson01135592010-03-23 17:23:59 +00001639 "", itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001640 let Inst{27-20} = opcod1;
1641 let Inst{11-8} = opcod2;
1642 let Inst{6-5} = opcod3;
1643 let Inst{4} = 1;
Evan Chengf81bf152009-11-23 21:57:23 +00001644
1645 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001646 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001647 let AsmString = !strconcat(
1648 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1649 !strconcat("\t", asm));
1650 let Pattern = pattern;
Bob Wilson5bafff32009-06-22 23:27:02 +00001651 list<Predicate> Predicates = [HasNEON];
1652}
1653class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001654 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001655 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001656 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONGetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001657 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001658class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001659 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001660 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001661 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONSetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001662 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001663class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001664 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001665 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001666 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONDupFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001667 opc, dt, asm, pattern>;
David Goodwin42a83f22009-08-04 17:53:06 +00001668
Johnny Chene4614f72010-03-25 17:01:27 +00001669// Vector Duplicate Lane (from scalar to all elements)
1670class NVDupLane<bits<4> op19_16, bit op6, dag oops, dag iops,
1671 InstrItinClass itin, string opc, string dt, string asm,
1672 list<dag> pattern>
1673 : NDataI<oops, iops, NEONFrm, itin, opc, dt, asm, "", pattern> {
1674 let Inst{24-23} = 0b11;
1675 let Inst{21-20} = 0b11;
1676 let Inst{19-16} = op19_16;
1677 let Inst{11-7} = 0b11000;
1678 let Inst{6} = op6;
1679 let Inst{4} = 0;
1680}
1681
David Goodwin42a83f22009-08-04 17:53:06 +00001682// NEONFPPat - Same as Pat<>, but requires that the compiler be using NEON
1683// for single-precision FP.
1684class NEONFPPat<dag pattern, dag result> : Pat<pattern, result> {
1685 list<Predicate> Predicates = [HasNEON,UseNEONForFP];
1686}