blob: e05a97548ec9cab9f9e6d0417935306da35c9c0a [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 Chencaa608e2010-03-20 00:17:00 +000067
Evan Cheng34a0fa32009-07-08 01:46:35 +000068// Misc flags.
69
Evan Chengedda31c2008-11-05 18:35:52 +000070// the instruction has a Rn register operand.
Evan Cheng34a0fa32009-07-08 01:46:35 +000071// UnaryDP - Indicates this is a unary data processing instruction, i.e.
72// it doesn't have a Rn operand.
73class UnaryDP { bit isUnaryDataProc = 1; }
74
75// Xform16Bit - Indicates this Thumb2 instruction may be transformed into
76// a 16-bit Thumb instruction if certain conditions are met.
77class Xform16Bit { bit canXformTo16Bit = 1; }
Evan Cheng37f25d92008-08-28 23:39:26 +000078
Evan Cheng37f25d92008-08-28 23:39:26 +000079//===----------------------------------------------------------------------===//
Bob Wilson50622ce2010-03-18 23:57:57 +000080// ARM Instruction flags. These need to match ARMBaseInstrInfo.h.
Evan Cheng055b0312009-06-29 07:51:04 +000081//
82
83// Addressing mode.
84class AddrMode<bits<4> val> {
85 bits<4> Value = val;
86}
87def AddrModeNone : AddrMode<0>;
88def AddrMode1 : AddrMode<1>;
89def AddrMode2 : AddrMode<2>;
90def AddrMode3 : AddrMode<3>;
91def AddrMode4 : AddrMode<4>;
92def AddrMode5 : AddrMode<5>;
Bob Wilson8b024a52009-07-01 23:16:05 +000093def AddrMode6 : AddrMode<6>;
94def AddrModeT1_1 : AddrMode<7>;
95def AddrModeT1_2 : AddrMode<8>;
96def AddrModeT1_4 : AddrMode<9>;
97def AddrModeT1_s : AddrMode<10>;
David Goodwine1e52ed2009-07-22 22:24:31 +000098def AddrModeT2_i12: AddrMode<11>;
Bob Wilson8b024a52009-07-01 23:16:05 +000099def AddrModeT2_i8 : AddrMode<12>;
100def AddrModeT2_so : AddrMode<13>;
101def AddrModeT2_pc : AddrMode<14>;
102def AddrModeT2_i8s4 : AddrMode<15>;
Evan Cheng055b0312009-06-29 07:51:04 +0000103
104// Instruction size.
105class SizeFlagVal<bits<3> val> {
106 bits<3> Value = val;
107}
108def SizeInvalid : SizeFlagVal<0>; // Unset.
109def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
110def Size8Bytes : SizeFlagVal<2>;
111def Size4Bytes : SizeFlagVal<3>;
112def Size2Bytes : SizeFlagVal<4>;
113
114// Load / store index mode.
115class IndexMode<bits<2> val> {
116 bits<2> Value = val;
117}
118def IndexModeNone : IndexMode<0>;
119def IndexModePre : IndexMode<1>;
120def IndexModePost : IndexMode<2>;
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000121def IndexModeUpd : IndexMode<3>;
Evan Cheng055b0312009-06-29 07:51:04 +0000122
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000123// Instruction execution domain.
124class Domain<bits<2> val> {
125 bits<2> Value = val;
126}
127def GenericDomain : Domain<0>;
128def VFPDomain : Domain<1>; // Instructions in VFP domain only
129def NeonDomain : Domain<2>; // Instructions in Neon domain only
130def VFPNeonDomain : Domain<3>; // Instructions in both VFP & Neon domains
131
Evan Cheng055b0312009-06-29 07:51:04 +0000132//===----------------------------------------------------------------------===//
Evan Cheng37f25d92008-08-28 23:39:26 +0000133
Evan Cheng446c4282009-07-11 06:43:01 +0000134// ARM special operands.
135//
136
137// ARM Predicate operand. Default to 14 = always (AL). Second part is CC
138// register whose default is 0 (no register).
139def pred : PredicateOperand<OtherVT, (ops i32imm, CCR),
140 (ops (i32 14), (i32 zero_reg))> {
141 let PrintMethod = "printPredicateOperand";
142}
143
144// Conditional code result for instructions whose 's' bit is set, e.g. subs.
145def cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 zero_reg))> {
146 let PrintMethod = "printSBitModifierOperand";
147}
148
149// Same as cc_out except it defaults to setting CPSR.
150def s_cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 CPSR))> {
151 let PrintMethod = "printSBitModifierOperand";
152}
153
Johnny Chendd0f3cf2010-03-10 18:59:38 +0000154// ARM special operands for disassembly only.
155//
156
157def cps_opt : Operand<i32> {
158 let PrintMethod = "printCPSOptionOperand";
159}
160
161def msr_mask : Operand<i32> {
162 let PrintMethod = "printMSRMaskOperand";
163}
164
165// A8.6.117, A8.6.118. Different instructions are generated for #0 and #-0.
166// The neg_zero operand translates -0 to -1, -1 to -2, ..., etc.
167def neg_zero : Operand<i32> {
168 let PrintMethod = "printNegZeroOperand";
169}
170
Evan Cheng446c4282009-07-11 06:43:01 +0000171//===----------------------------------------------------------------------===//
172
Evan Cheng37f25d92008-08-28 23:39:26 +0000173// ARM Instruction templates.
174//
175
Johnny Chend68e1192009-12-15 17:24:14 +0000176class InstTemplate<AddrMode am, SizeFlagVal sz, IndexMode im,
177 Format f, Domain d, string cstr, InstrItinClass itin>
Evan Cheng37f25d92008-08-28 23:39:26 +0000178 : Instruction {
179 let Namespace = "ARM";
180
Evan Chengedda31c2008-11-05 18:35:52 +0000181 // TSFlagsFields
Evan Cheng37f25d92008-08-28 23:39:26 +0000182 AddrMode AM = am;
183 bits<4> AddrModeBits = AM.Value;
Bob Wilson01135592010-03-23 17:23:59 +0000184
Evan Cheng37f25d92008-08-28 23:39:26 +0000185 SizeFlagVal SZ = sz;
186 bits<3> SizeFlag = SZ.Value;
187
188 IndexMode IM = im;
189 bits<2> IndexModeBits = IM.Value;
Bob Wilson01135592010-03-23 17:23:59 +0000190
Evan Cheng37f25d92008-08-28 23:39:26 +0000191 Format F = f;
Bob Wilson89ef7b72010-03-17 21:13:43 +0000192 bits<6> Form = F.Value;
Evan Chengedda31c2008-11-05 18:35:52 +0000193
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000194 Domain D = d;
195 bits<2> Dom = D.Value;
196
Evan Chengedda31c2008-11-05 18:35:52 +0000197 //
198 // Attributes specific to ARM instructions...
199 //
200 bit isUnaryDataProc = 0;
Evan Cheng34a0fa32009-07-08 01:46:35 +0000201 bit canXformTo16Bit = 0;
Bob Wilson01135592010-03-23 17:23:59 +0000202
Evan Cheng37f25d92008-08-28 23:39:26 +0000203 let Constraints = cstr;
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000204 let Itinerary = itin;
Evan Cheng37f25d92008-08-28 23:39:26 +0000205}
206
Johnny Chend68e1192009-12-15 17:24:14 +0000207class Encoding {
208 field bits<32> Inst;
209}
210
211class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
212 Format f, Domain d, string cstr, InstrItinClass itin>
213 : InstTemplate<am, sz, im, f, d, cstr, itin>, Encoding;
214
215// This Encoding-less class is used by Thumb1 to specify the encoding bits later
216// on by adding flavors to specific instructions.
217class InstThumb<AddrMode am, SizeFlagVal sz, IndexMode im,
218 Format f, Domain d, string cstr, InstrItinClass itin>
219 : InstTemplate<am, sz, im, f, d, cstr, itin>;
220
Bob Wilson01135592010-03-23 17:23:59 +0000221class PseudoInst<dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000222 string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +0000223 : InstARM<AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, GenericDomain,
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000224 "", itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000225 let OutOperandList = oops;
226 let InOperandList = iops;
227 let AsmString = asm;
228 let Pattern = pattern;
229}
230
231// Almost all ARM instructions are predicable.
Evan Chengd87293c2008-11-06 08:47:38 +0000232class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000233 IndexMode im, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000234 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000235 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000236 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000237 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000238 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng37f25d92008-08-28 23:39:26 +0000239 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
240 let Pattern = pattern;
241 list<Predicate> Predicates = [IsARM];
242}
Jim Grosbachf6b28622009-12-14 18:31:20 +0000243// A few are not predicable
244class InoP<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000245 IndexMode im, Format f, InstrItinClass itin,
246 string opc, string asm, string cstr,
247 list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000248 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
249 let OutOperandList = oops;
250 let InOperandList = iops;
251 let AsmString = !strconcat(opc, asm);
252 let Pattern = pattern;
253 let isPredicable = 0;
254 list<Predicate> Predicates = [IsARM];
255}
Evan Cheng37f25d92008-08-28 23:39:26 +0000256
257// Same as I except it can optionally modify CPSR. Note it's modeled as
258// an input operand since by default it's a zero register. It will
259// become an implicit def once it's "flipped".
Evan Chengd87293c2008-11-06 08:47:38 +0000260class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000261 IndexMode im, Format f, InstrItinClass itin,
262 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000263 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000264 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000265 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000266 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Evan Cheng37f25d92008-08-28 23:39:26 +0000267 let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm));
268 let Pattern = pattern;
269 list<Predicate> Predicates = [IsARM];
270}
271
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000272// Special cases
Evan Chengd87293c2008-11-06 08:47:38 +0000273class XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000274 IndexMode im, Format f, InstrItinClass itin,
275 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000276 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000277 let OutOperandList = oops;
278 let InOperandList = iops;
279 let AsmString = asm;
280 let Pattern = pattern;
281 list<Predicate> Predicates = [IsARM];
282}
283
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000284class AI<dag oops, dag iops, Format f, InstrItinClass itin,
285 string opc, string asm, list<dag> pattern>
286 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
287 opc, asm, "", pattern>;
288class AsI<dag oops, dag iops, Format f, InstrItinClass itin,
289 string opc, string asm, list<dag> pattern>
290 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
291 opc, asm, "", pattern>;
292class AXI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000293 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000294 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng97f48c32008-11-06 22:15:19 +0000295 asm, "", pattern>;
Jim Grosbachf6b28622009-12-14 18:31:20 +0000296class AInoP<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +0000297 string opc, string asm, list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000298 : InoP<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Bob Wilson01135592010-03-23 17:23:59 +0000299 opc, asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000300
301// Ctrl flow instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000302class ABI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
303 string opc, string asm, list<dag> pattern>
304 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
305 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000306 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000307}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000308class ABXI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
309 string asm, list<dag> pattern>
310 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
311 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000312 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000313}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000314class ABXIx2<dag oops, dag iops, InstrItinClass itin,
315 string asm, list<dag> pattern>
316 : XI<oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, BrMiscFrm, itin,
317 asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000318
319// BR_JT instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000320class JTI<dag oops, dag iops, InstrItinClass itin,
321 string asm, list<dag> pattern>
322 : XI<oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BrMiscFrm, itin,
Evan Cheng4df60f52008-11-07 09:06:08 +0000323 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000324
Jim Grosbach5278eb82009-12-11 01:42:04 +0000325
326// Atomic load/store instructions
327
328class AIldrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
329 string opc, string asm, list<dag> pattern>
330 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
331 opc, asm, "", pattern> {
332 let Inst{27-23} = 0b00011;
333 let Inst{22-21} = opcod;
334 let Inst{20} = 1;
335 let Inst{11-0} = 0b111110011111;
336}
337class AIstrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
338 string opc, string asm, list<dag> pattern>
339 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
340 opc, asm, "", pattern> {
341 let Inst{27-23} = 0b00011;
342 let Inst{22-21} = opcod;
343 let Inst{20} = 0;
Johnny Chen0291d7e2009-12-11 19:37:26 +0000344 let Inst{11-4} = 0b11111001;
Jim Grosbach5278eb82009-12-11 01:42:04 +0000345}
346
Evan Cheng0d14fc82008-09-01 01:51:14 +0000347// addrmode1 instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000348class AI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
349 string opc, string asm, list<dag> pattern>
350 : I<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
351 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000352 let Inst{24-21} = opcod;
353 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000354}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000355class AsI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
356 string opc, string asm, list<dag> pattern>
357 : sI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
358 opc, asm, "", pattern> {
359 let Inst{24-21} = opcod;
360 let Inst{27-26} = {0,0};
361}
362class AXI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000363 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000364 : XI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng612b79e2008-08-29 07:40:52 +0000365 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000366 let Inst{24-21} = opcod;
367 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000368}
Bob Wilson01135592010-03-23 17:23:59 +0000369class AI1x2<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000370 string opc, string asm, list<dag> pattern>
371 : I<oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, itin,
372 opc, asm, "", pattern>;
Evan Cheng17222df2008-08-31 19:02:21 +0000373
Evan Cheng0d14fc82008-09-01 01:51:14 +0000374
375// addrmode2 loads and stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000376class AI2<dag oops, dag iops, Format f, InstrItinClass itin,
377 string opc, string asm, list<dag> pattern>
378 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
379 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000380 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000381}
Evan Cheng93912732008-09-01 01:27:33 +0000382
383// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000384class AI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
385 string opc, string asm, list<dag> pattern>
386 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
387 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000388 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000389 let Inst{21} = 0; // W bit
390 let Inst{22} = 0; // B bit
391 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000392 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000393}
Bob Wilson01135592010-03-23 17:23:59 +0000394class AXI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000395 string asm, list<dag> pattern>
396 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000397 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000398 let Inst{20} = 1; // L bit
399 let Inst{21} = 0; // W bit
400 let Inst{22} = 0; // B bit
401 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000402 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000403}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000404class AI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
405 string opc, string asm, list<dag> pattern>
406 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
407 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000408 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000409 let Inst{21} = 0; // W bit
410 let Inst{22} = 1; // B bit
411 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000412 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000413}
Bob Wilson01135592010-03-23 17:23:59 +0000414class AXI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000415 string asm, list<dag> pattern>
416 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000417 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000418 let Inst{20} = 1; // L bit
419 let Inst{21} = 0; // W bit
420 let Inst{22} = 1; // B bit
421 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000422 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000423}
Evan Cheng17222df2008-08-31 19:02:21 +0000424
Evan Cheng93912732008-09-01 01:27:33 +0000425// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000426class AI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
427 string opc, string asm, list<dag> pattern>
428 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
429 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000430 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000431 let Inst{21} = 0; // W bit
432 let Inst{22} = 0; // B bit
433 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000434 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000435}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000436class AXI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
437 string asm, list<dag> pattern>
438 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000439 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000440 let Inst{20} = 0; // L bit
441 let Inst{21} = 0; // W bit
442 let Inst{22} = 0; // B bit
443 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000444 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000445}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000446class AI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
447 string opc, string asm, list<dag> pattern>
448 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
449 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000450 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000451 let Inst{21} = 0; // W bit
452 let Inst{22} = 1; // B bit
453 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000454 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000455}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000456class AXI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
457 string asm, list<dag> pattern>
458 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000459 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000460 let Inst{20} = 0; // L bit
461 let Inst{21} = 0; // W bit
462 let Inst{22} = 1; // B bit
463 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000464 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000465}
Evan Cheng93912732008-09-01 01:27:33 +0000466
Evan Cheng840917b2008-09-01 07:00:14 +0000467// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000468class AI2ldwpr<dag oops, dag iops, Format f, InstrItinClass itin,
469 string opc, string asm, string cstr, list<dag> pattern>
470 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
471 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000472 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000473 let Inst{21} = 1; // W bit
474 let Inst{22} = 0; // B bit
475 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000476 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000477}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000478class AI2ldbpr<dag oops, dag iops, Format f, InstrItinClass itin,
479 string opc, string asm, string cstr, list<dag> pattern>
480 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
481 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000482 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000483 let Inst{21} = 1; // W bit
484 let Inst{22} = 1; // B bit
485 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000486 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000487}
488
Evan Cheng840917b2008-09-01 07:00:14 +0000489// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000490class AI2stwpr<dag oops, dag iops, Format f, InstrItinClass itin,
491 string opc, string asm, string cstr, list<dag> pattern>
492 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
493 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000494 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000495 let Inst{21} = 1; // W bit
496 let Inst{22} = 0; // B bit
497 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000498 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000499}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000500class AI2stbpr<dag oops, dag iops, Format f, InstrItinClass itin,
501 string opc, string asm, string cstr, list<dag> pattern>
502 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
503 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000504 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000505 let Inst{21} = 1; // W bit
506 let Inst{22} = 1; // B bit
507 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000508 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000509}
510
Evan Cheng840917b2008-09-01 07:00:14 +0000511// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000512class AI2ldwpo<dag oops, dag iops, Format f, InstrItinClass itin,
513 string opc, string asm, string cstr, list<dag> pattern>
514 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
515 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000516 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000517 let Inst{21} = 0; // W bit
518 let Inst{22} = 0; // B bit
519 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000520 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000521}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000522class AI2ldbpo<dag oops, dag iops, Format f, InstrItinClass itin,
523 string opc, string asm, string cstr, list<dag> pattern>
524 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
525 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000526 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000527 let Inst{21} = 0; // W bit
528 let Inst{22} = 1; // B bit
529 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000530 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000531}
532
Evan Cheng840917b2008-09-01 07:00:14 +0000533// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000534class AI2stwpo<dag oops, dag iops, Format f, InstrItinClass itin,
535 string opc, string asm, string cstr, list<dag> pattern>
536 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
537 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000538 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000539 let Inst{21} = 0; // W bit
540 let Inst{22} = 0; // B bit
541 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000542 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000543}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000544class AI2stbpo<dag oops, dag iops, Format f, InstrItinClass itin,
545 string opc, string asm, string cstr, list<dag> pattern>
546 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
547 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000548 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000549 let Inst{21} = 0; // W bit
550 let Inst{22} = 1; // B bit
551 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000552 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000553}
554
Evan Cheng0d14fc82008-09-01 01:51:14 +0000555// addrmode3 instructions
Bob Wilson01135592010-03-23 17:23:59 +0000556class AI3<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000557 string opc, string asm, list<dag> pattern>
558 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
559 opc, asm, "", pattern>;
560class AXI3<dag oops, dag iops, Format f, InstrItinClass itin,
561 string asm, list<dag> pattern>
562 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
563 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000564
Evan Cheng840917b2008-09-01 07:00:14 +0000565// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000566class AI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
567 string opc, string asm, list<dag> pattern>
568 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
569 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000570 let Inst{4} = 1;
571 let Inst{5} = 1; // H bit
572 let Inst{6} = 0; // S bit
573 let Inst{7} = 1;
574 let Inst{20} = 1; // L bit
575 let Inst{21} = 0; // W bit
576 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000577 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000578}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000579class AXI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
580 string asm, list<dag> pattern>
581 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000582 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000583 let Inst{4} = 1;
584 let Inst{5} = 1; // H bit
585 let Inst{6} = 0; // S bit
586 let Inst{7} = 1;
587 let Inst{20} = 1; // L bit
588 let Inst{21} = 0; // W bit
589 let Inst{24} = 1; // P bit
590}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000591class AI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
592 string opc, string asm, list<dag> pattern>
593 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
594 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000595 let Inst{4} = 1;
596 let Inst{5} = 1; // H bit
597 let Inst{6} = 1; // S bit
598 let Inst{7} = 1;
599 let Inst{20} = 1; // L bit
600 let Inst{21} = 0; // W bit
601 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000602 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000603}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000604class AXI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
605 string asm, list<dag> pattern>
606 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000607 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000608 let Inst{4} = 1;
609 let Inst{5} = 1; // H bit
610 let Inst{6} = 1; // S bit
611 let Inst{7} = 1;
612 let Inst{20} = 1; // L bit
613 let Inst{21} = 0; // W bit
614 let Inst{24} = 1; // P bit
615}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000616class AI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
617 string opc, string asm, list<dag> pattern>
618 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
619 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000620 let Inst{4} = 1;
621 let Inst{5} = 0; // H bit
622 let Inst{6} = 1; // S bit
623 let Inst{7} = 1;
624 let Inst{20} = 1; // L bit
625 let Inst{21} = 0; // W bit
626 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000627 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000628}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000629class AXI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
630 string asm, list<dag> pattern>
631 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000632 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000633 let Inst{4} = 1;
634 let Inst{5} = 0; // H bit
635 let Inst{6} = 1; // S bit
636 let Inst{7} = 1;
637 let Inst{20} = 1; // L bit
638 let Inst{21} = 0; // W bit
639 let Inst{24} = 1; // P bit
640}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000641class AI3ldd<dag oops, dag iops, Format f, InstrItinClass itin,
642 string opc, string asm, list<dag> pattern>
643 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
644 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000645 let Inst{4} = 1;
646 let Inst{5} = 0; // H bit
647 let Inst{6} = 1; // S bit
648 let Inst{7} = 1;
649 let Inst{20} = 0; // L bit
650 let Inst{21} = 0; // W bit
651 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000652 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000653}
654
655// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000656class AI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
657 string opc, string asm, list<dag> pattern>
658 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
659 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000660 let Inst{4} = 1;
661 let Inst{5} = 1; // H bit
662 let Inst{6} = 0; // S bit
663 let Inst{7} = 1;
664 let Inst{20} = 0; // L bit
665 let Inst{21} = 0; // W bit
666 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000667 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000668}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000669class AXI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
670 string asm, list<dag> pattern>
671 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000672 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000673 let Inst{4} = 1;
674 let Inst{5} = 1; // H bit
675 let Inst{6} = 0; // S bit
676 let Inst{7} = 1;
677 let Inst{20} = 0; // L bit
678 let Inst{21} = 0; // W bit
679 let Inst{24} = 1; // P bit
680}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000681class AI3std<dag oops, dag iops, Format f, InstrItinClass itin,
682 string opc, string asm, list<dag> pattern>
683 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
684 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000685 let Inst{4} = 1;
686 let Inst{5} = 1; // H bit
687 let Inst{6} = 1; // S bit
688 let Inst{7} = 1;
689 let Inst{20} = 0; // L bit
690 let Inst{21} = 0; // W bit
691 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000692 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000693}
694
695// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000696class AI3ldhpr<dag oops, dag iops, Format f, InstrItinClass itin,
697 string opc, string asm, string cstr, list<dag> pattern>
698 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
699 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000700 let Inst{4} = 1;
701 let Inst{5} = 1; // H bit
702 let Inst{6} = 0; // S bit
703 let Inst{7} = 1;
704 let Inst{20} = 1; // L bit
705 let Inst{21} = 1; // W bit
706 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000707 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000708}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000709class AI3ldshpr<dag oops, dag iops, Format f, InstrItinClass itin,
710 string opc, string asm, string cstr, list<dag> pattern>
711 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
712 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000713 let Inst{4} = 1;
714 let Inst{5} = 1; // H bit
715 let Inst{6} = 1; // S bit
716 let Inst{7} = 1;
717 let Inst{20} = 1; // L bit
718 let Inst{21} = 1; // W bit
719 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000720 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000721}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000722class AI3ldsbpr<dag oops, dag iops, Format f, InstrItinClass itin,
723 string opc, string asm, string cstr, list<dag> pattern>
724 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
725 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000726 let Inst{4} = 1;
727 let Inst{5} = 0; // H bit
728 let Inst{6} = 1; // S bit
729 let Inst{7} = 1;
730 let Inst{20} = 1; // L bit
731 let Inst{21} = 1; // W bit
732 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000733 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000734}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000735class AI3lddpr<dag oops, dag iops, Format f, InstrItinClass itin,
736 string opc, string asm, string cstr, list<dag> pattern>
737 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
738 opc, asm, cstr, pattern> {
739 let Inst{4} = 1;
740 let Inst{5} = 0; // H bit
741 let Inst{6} = 1; // S bit
742 let Inst{7} = 1;
743 let Inst{20} = 0; // L bit
744 let Inst{21} = 1; // W bit
745 let Inst{24} = 1; // P bit
746 let Inst{27-25} = 0b000;
747}
748
Evan Cheng840917b2008-09-01 07:00:14 +0000749
750// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000751class AI3sthpr<dag oops, dag iops, Format f, InstrItinClass itin,
752 string opc, string asm, string cstr, list<dag> pattern>
753 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
754 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000755 let Inst{4} = 1;
756 let Inst{5} = 1; // H bit
757 let Inst{6} = 0; // S bit
758 let Inst{7} = 1;
759 let Inst{20} = 0; // L bit
760 let Inst{21} = 1; // W bit
761 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000762 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000763}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000764class AI3stdpr<dag oops, dag iops, Format f, InstrItinClass itin,
765 string opc, string asm, string cstr, list<dag> pattern>
766 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
767 opc, asm, cstr, pattern> {
768 let Inst{4} = 1;
769 let Inst{5} = 1; // H bit
770 let Inst{6} = 1; // S bit
771 let Inst{7} = 1;
772 let Inst{20} = 0; // L bit
773 let Inst{21} = 1; // W bit
774 let Inst{24} = 1; // P bit
775 let Inst{27-25} = 0b000;
776}
Evan Cheng840917b2008-09-01 07:00:14 +0000777
778// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000779class AI3ldhpo<dag oops, dag iops, Format f, InstrItinClass itin,
780 string opc, string asm, string cstr, list<dag> pattern>
781 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
782 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000783 let Inst{4} = 1;
784 let Inst{5} = 1; // H bit
785 let Inst{6} = 0; // S bit
786 let Inst{7} = 1;
787 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000788 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000789 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000790 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000791}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000792class AI3ldshpo<dag oops, dag iops, Format f, InstrItinClass itin,
793 string opc, string asm, string cstr, list<dag> pattern>
794 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
795 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000796 let Inst{4} = 1;
797 let Inst{5} = 1; // H bit
798 let Inst{6} = 1; // S bit
799 let Inst{7} = 1;
800 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000801 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000802 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000803 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000804}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000805class AI3ldsbpo<dag oops, dag iops, Format f, InstrItinClass itin,
806 string opc, string asm, string cstr, list<dag> pattern>
807 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
808 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000809 let Inst{4} = 1;
810 let Inst{5} = 0; // H bit
811 let Inst{6} = 1; // S bit
812 let Inst{7} = 1;
813 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000814 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000815 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000816 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000817}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000818class AI3lddpo<dag oops, dag iops, Format f, InstrItinClass itin,
819 string opc, string asm, string cstr, list<dag> pattern>
820 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
821 opc, asm, cstr, pattern> {
822 let Inst{4} = 1;
823 let Inst{5} = 0; // H bit
824 let Inst{6} = 1; // S bit
825 let Inst{7} = 1;
826 let Inst{20} = 0; // L bit
827 let Inst{21} = 0; // W bit
828 let Inst{24} = 0; // P bit
829 let Inst{27-25} = 0b000;
830}
Evan Cheng840917b2008-09-01 07:00:14 +0000831
832// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000833class AI3sthpo<dag oops, dag iops, Format f, InstrItinClass itin,
834 string opc, string asm, string cstr, list<dag> pattern>
835 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
836 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000837 let Inst{4} = 1;
838 let Inst{5} = 1; // H bit
839 let Inst{6} = 0; // S bit
840 let Inst{7} = 1;
841 let Inst{20} = 0; // L bit
Johnny Chenad4df4c2010-03-01 19:22:00 +0000842 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000843 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000844 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000845}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000846class AI3stdpo<dag oops, dag iops, Format f, InstrItinClass itin,
847 string opc, string asm, string cstr, list<dag> pattern>
848 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
849 opc, asm, cstr, pattern> {
850 let Inst{4} = 1;
851 let Inst{5} = 1; // H bit
852 let Inst{6} = 1; // S bit
853 let Inst{7} = 1;
854 let Inst{20} = 0; // L bit
855 let Inst{21} = 0; // W bit
856 let Inst{24} = 0; // P bit
857 let Inst{27-25} = 0b000;
858}
Evan Cheng840917b2008-09-01 07:00:14 +0000859
Evan Cheng0d14fc82008-09-01 01:51:14 +0000860// addrmode4 instructions
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000861class AXI4ld<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000862 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000863 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000864 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000865 let Inst{20} = 1; // L bit
866 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000867 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000868}
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000869class AXI4st<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000870 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000871 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000872 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000873 let Inst{20} = 0; // L bit
874 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000875 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000876}
Evan Cheng37f25d92008-08-28 23:39:26 +0000877
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000878// Unsigned multiply, multiply-accumulate instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000879class AMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
880 string opc, string asm, list<dag> pattern>
881 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
882 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000883 let Inst{7-4} = 0b1001;
Evan Chengfbc9d412008-11-06 01:21:28 +0000884 let Inst{20} = 0; // S bit
Evan Chengd87293c2008-11-06 08:47:38 +0000885 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000886}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000887class AsMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
888 string opc, string asm, list<dag> pattern>
889 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
890 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000891 let Inst{7-4} = 0b1001;
Evan Chengd87293c2008-11-06 08:47:38 +0000892 let Inst{27-21} = opcod;
Evan Chengfbc9d412008-11-06 01:21:28 +0000893}
894
895// Most significant word multiply
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000896class AMul2I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
897 string opc, string asm, list<dag> pattern>
898 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
899 opc, asm, "", pattern> {
Evan Chengfbc9d412008-11-06 01:21:28 +0000900 let Inst{7-4} = 0b1001;
901 let Inst{20} = 1;
Evan Chengd87293c2008-11-06 08:47:38 +0000902 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000903}
Evan Cheng37f25d92008-08-28 23:39:26 +0000904
Evan Chengeb4f52e2008-11-06 03:35:07 +0000905// SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000906class AMulxyI<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
907 string opc, string asm, list<dag> pattern>
908 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
909 opc, asm, "", pattern> {
Evan Chengeb4f52e2008-11-06 03:35:07 +0000910 let Inst{4} = 0;
911 let Inst{7} = 1;
912 let Inst{20} = 0;
Evan Chengd87293c2008-11-06 08:47:38 +0000913 let Inst{27-21} = opcod;
Evan Chengeb4f52e2008-11-06 03:35:07 +0000914}
915
Evan Cheng97f48c32008-11-06 22:15:19 +0000916// Extend instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000917class AExtI<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
918 string opc, string asm, list<dag> pattern>
919 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ExtFrm, itin,
920 opc, asm, "", pattern> {
Evan Cheng97f48c32008-11-06 22:15:19 +0000921 let Inst{7-4} = 0b0111;
922 let Inst{27-20} = opcod;
923}
924
Evan Cheng8b59db32008-11-07 01:41:35 +0000925// Misc Arithmetic instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000926class AMiscA1I<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
927 string opc, string asm, list<dag> pattern>
928 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ArithMiscFrm, itin,
929 opc, asm, "", pattern> {
Evan Cheng8b59db32008-11-07 01:41:35 +0000930 let Inst{27-20} = opcod;
931}
932
Evan Cheng37f25d92008-08-28 23:39:26 +0000933//===----------------------------------------------------------------------===//
934
935// ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
936class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
937 list<Predicate> Predicates = [IsARM];
938}
939class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
940 list<Predicate> Predicates = [IsARM, HasV5TE];
941}
942class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
943 list<Predicate> Predicates = [IsARM, HasV6];
944}
Evan Cheng13096642008-08-29 06:41:12 +0000945
946//===----------------------------------------------------------------------===//
947//
948// Thumb Instruction Format Definitions.
949//
950
Evan Cheng13096642008-08-29 06:41:12 +0000951// TI - Thumb instruction.
952
Evan Cheng446c4282009-07-11 06:43:01 +0000953class ThumbI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000954 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000955 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000956 let OutOperandList = oops;
957 let InOperandList = iops;
Evan Cheng13096642008-08-29 06:41:12 +0000958 let AsmString = asm;
959 let Pattern = pattern;
960 list<Predicate> Predicates = [IsThumb];
961}
962
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000963class TI<dag oops, dag iops, InstrItinClass itin, string asm, list<dag> pattern>
964 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000965
Evan Cheng35d6c412009-08-04 23:47:55 +0000966// Two-address instructions
Bob Wilson01135592010-03-23 17:23:59 +0000967class TIt<dag oops, dag iops, InstrItinClass itin, string asm,
968 list<dag> pattern>
969 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "$lhs = $dst",
970 pattern>;
Evan Cheng35d6c412009-08-04 23:47:55 +0000971
Johnny Chend68e1192009-12-15 17:24:14 +0000972// tBL, tBX 32-bit instructions
973class TIx2<bits<5> opcod1, bits<2> opcod2, bit opcod3,
Bob Wilson01135592010-03-23 17:23:59 +0000974 dag oops, dag iops, InstrItinClass itin, string asm,
975 list<dag> pattern>
976 : ThumbI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>,
977 Encoding {
Johnny Chend68e1192009-12-15 17:24:14 +0000978 let Inst{31-27} = opcod1;
979 let Inst{15-14} = opcod2;
980 let Inst{12} = opcod3;
981}
Evan Cheng13096642008-08-29 06:41:12 +0000982
983// BR_JT instructions
Bob Wilson01135592010-03-23 17:23:59 +0000984class TJTI<dag oops, dag iops, InstrItinClass itin, string asm,
985 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000986 : ThumbI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000987
Evan Cheng09c39fc2009-06-23 19:38:13 +0000988// Thumb1 only
Evan Cheng446c4282009-07-11 06:43:01 +0000989class Thumb1I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000990 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000991 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000992 let OutOperandList = oops;
993 let InOperandList = iops;
Evan Cheng09c39fc2009-06-23 19:38:13 +0000994 let AsmString = asm;
995 let Pattern = pattern;
996 list<Predicate> Predicates = [IsThumb1Only];
997}
998
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000999class T1I<dag oops, dag iops, InstrItinClass itin,
1000 string asm, list<dag> pattern>
1001 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
1002class T1Ix2<dag oops, dag iops, InstrItinClass itin,
1003 string asm, list<dag> pattern>
1004 : Thumb1I<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1005class T1JTI<dag oops, dag iops, InstrItinClass itin,
1006 string asm, list<dag> pattern>
Johnny Chenbbc71b22009-12-16 02:32:54 +00001007 : Thumb1I<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001008
1009// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001010class T1It<dag oops, dag iops, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001011 string asm, string cstr, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001012 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001013 asm, cstr, pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001014
1015// Thumb1 instruction that can either be predicated or set CPSR.
1016class Thumb1sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001017 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001018 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001019 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Chris Lattnerb7d52262010-03-18 21:06:54 +00001020 let OutOperandList = !con(oops, (outs s_cc_out:$s));
1021 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001022 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1023 let Pattern = pattern;
1024 list<Predicate> Predicates = [IsThumb1Only];
1025}
1026
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001027class T1sI<dag oops, dag iops, InstrItinClass itin,
1028 string opc, string asm, list<dag> pattern>
1029 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001030
1031// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001032class T1sIt<dag oops, dag iops, InstrItinClass itin,
1033 string opc, string asm, list<dag> pattern>
1034 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001035 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001036
1037// Thumb1 instruction that can be predicated.
1038class Thumb1pI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001039 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001040 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001041 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +00001042 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001043 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001044 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1045 let Pattern = pattern;
1046 list<Predicate> Predicates = [IsThumb1Only];
1047}
1048
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001049class T1pI<dag oops, dag iops, InstrItinClass itin,
1050 string opc, string asm, list<dag> pattern>
1051 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001052
1053// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001054class T1pIt<dag oops, dag iops, InstrItinClass itin,
1055 string opc, string asm, list<dag> pattern>
1056 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001057 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001058
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001059class T1pI1<dag oops, dag iops, InstrItinClass itin,
1060 string opc, string asm, list<dag> pattern>
1061 : Thumb1pI<oops, iops, AddrModeT1_1, Size2Bytes, itin, opc, asm, "", pattern>;
1062class T1pI2<dag oops, dag iops, InstrItinClass itin,
1063 string opc, string asm, list<dag> pattern>
1064 : Thumb1pI<oops, iops, AddrModeT1_2, Size2Bytes, itin, opc, asm, "", pattern>;
1065class T1pI4<dag oops, dag iops, InstrItinClass itin,
1066 string opc, string asm, list<dag> pattern>
1067 : Thumb1pI<oops, iops, AddrModeT1_4, Size2Bytes, itin, opc, asm, "", pattern>;
Bob Wilson01135592010-03-23 17:23:59 +00001068class T1pIs<dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001069 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1070 : Thumb1pI<oops, iops, AddrModeT1_s, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001071
Johnny Chenbbc71b22009-12-16 02:32:54 +00001072class Encoding16 : Encoding {
1073 let Inst{31-16} = 0x0000;
1074}
1075
Johnny Chend68e1192009-12-15 17:24:14 +00001076// A6.2 16-bit Thumb instruction encoding
Johnny Chenbbc71b22009-12-16 02:32:54 +00001077class T1Encoding<bits<6> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001078 let Inst{15-10} = opcode;
1079}
1080
1081// A6.2.1 Shift (immediate), add, subtract, move, and compare encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001082class T1General<bits<5> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001083 let Inst{15-14} = 0b00;
1084 let Inst{13-9} = opcode;
1085}
1086
1087// A6.2.2 Data-processing encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001088class T1DataProcessing<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001089 let Inst{15-10} = 0b010000;
1090 let Inst{9-6} = opcode;
1091}
1092
1093// A6.2.3 Special data instructions and branch and exchange encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001094class T1Special<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001095 let Inst{15-10} = 0b010001;
1096 let Inst{9-6} = opcode;
1097}
1098
1099// A6.2.4 Load/store single data item encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001100class T1LoadStore<bits<4> opA, bits<3> opB> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001101 let Inst{15-12} = opA;
1102 let Inst{11-9} = opB;
1103}
1104class T1LdSt<bits<3> opB> : T1LoadStore<0b0101, opB>;
1105class T1LdSt4Imm<bits<3> opB> : T1LoadStore<0b0110, opB>; // Immediate, 4 bytes
1106class T1LdSt1Imm<bits<3> opB> : T1LoadStore<0b0111, opB>; // Immediate, 1 byte
1107class T1LdSt2Imm<bits<3> opB> : T1LoadStore<0b1000, opB>; // Immediate, 2 bytes
1108class T1LdStSP<bits<3> opB> : T1LoadStore<0b1001, opB>; // SP relative
1109
1110// A6.2.5 Miscellaneous 16-bit instructions encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001111class T1Misc<bits<7> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001112 let Inst{15-12} = 0b1011;
1113 let Inst{11-5} = opcode;
1114}
1115
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001116// Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
1117class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001118 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001119 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001120 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001121 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001122 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001123 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1124 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001125 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001126}
1127
1128// Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as
1129// an input operand since by default it's a zero register. It will
1130// become an implicit def once it's "flipped".
1131// FIXME: This uses unified syntax so {s} comes before {p}. We should make it
1132// more consistent.
1133class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001134 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001135 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001136 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001137 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001138 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001139 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1140 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001141 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001142}
1143
1144// Special cases
1145class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001146 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001147 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001148 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001149 let OutOperandList = oops;
1150 let InOperandList = iops;
Evan Chengf49810c2009-06-23 17:48:47 +00001151 let AsmString = asm;
1152 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001153 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001154}
1155
Jim Grosbachd1228742009-12-01 18:10:36 +00001156class ThumbXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +00001157 InstrItinClass itin,
1158 string asm, string cstr, list<dag> pattern>
Jim Grosbachd1228742009-12-01 18:10:36 +00001159 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1160 let OutOperandList = oops;
1161 let InOperandList = iops;
1162 let AsmString = asm;
1163 let Pattern = pattern;
1164 list<Predicate> Predicates = [IsThumb1Only];
1165}
1166
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001167class T2I<dag oops, dag iops, InstrItinClass itin,
1168 string opc, string asm, list<dag> pattern>
1169 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
1170class T2Ii12<dag oops, dag iops, InstrItinClass itin,
1171 string opc, string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001172 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, itin, opc, asm, "",pattern>;
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001173class T2Ii8<dag oops, dag iops, InstrItinClass itin,
1174 string opc, string asm, list<dag> pattern>
1175 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, itin, opc, asm, "", pattern>;
1176class T2Iso<dag oops, dag iops, InstrItinClass itin,
1177 string opc, string asm, list<dag> pattern>
1178 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, itin, opc, asm, "", pattern>;
1179class T2Ipc<dag oops, dag iops, InstrItinClass itin,
1180 string opc, string asm, list<dag> pattern>
1181 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, itin, opc, asm, "", pattern>;
Johnny Chend68e1192009-12-15 17:24:14 +00001182class T2Ii8s4<bit P, bit W, bit load, dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001183 string opc, string asm, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001184 : Thumb2I<oops, iops, AddrModeT2_i8s4, Size4Bytes, itin, opc, asm, "",
1185 pattern> {
1186 let Inst{31-27} = 0b11101;
1187 let Inst{26-25} = 0b00;
1188 let Inst{24} = P;
1189 let Inst{23} = ?; // The U bit.
1190 let Inst{22} = 1;
1191 let Inst{21} = W;
1192 let Inst{20} = load;
1193}
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001194
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001195class T2sI<dag oops, dag iops, InstrItinClass itin,
1196 string opc, string asm, list<dag> pattern>
1197 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001198
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001199class T2XI<dag oops, dag iops, InstrItinClass itin,
1200 string asm, list<dag> pattern>
1201 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1202class T2JTI<dag oops, dag iops, InstrItinClass itin,
1203 string asm, list<dag> pattern>
1204 : Thumb2XI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Chengf49810c2009-06-23 17:48:47 +00001205
Evan Cheng5adb66a2009-09-28 09:14:39 +00001206class T2Ix2<dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001207 string opc, string asm, list<dag> pattern>
Evan Cheng5adb66a2009-09-28 09:14:39 +00001208 : Thumb2I<oops, iops, AddrModeNone, Size8Bytes, itin, opc, asm, "", pattern>;
1209
Bob Wilson815baeb2010-03-13 01:08:20 +00001210// Two-address instructions
1211class T2XIt<dag oops, dag iops, InstrItinClass itin,
1212 string asm, string cstr, list<dag> pattern>
1213 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, cstr, pattern>;
Evan Cheng5adb66a2009-09-28 09:14:39 +00001214
Evan Chenge88d5ce2009-07-02 07:28:31 +00001215// T2Iidxldst - Thumb2 indexed load / store instructions.
Johnny Chend68e1192009-12-15 17:24:14 +00001216class T2Iidxldst<bit signed, bits<2> opcod, bit load, bit pre,
1217 dag oops, dag iops,
1218 AddrMode am, IndexMode im, InstrItinClass itin,
Evan Chenge88d5ce2009-07-02 07:28:31 +00001219 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001220 : InstARM<am, Size4Bytes, im, ThumbFrm, GenericDomain, cstr, itin> {
Evan Chenge88d5ce2009-07-02 07:28:31 +00001221 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001222 let InOperandList = !con(iops, (ins pred:$p));
Evan Chenge88d5ce2009-07-02 07:28:31 +00001223 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1224 let Pattern = pattern;
1225 list<Predicate> Predicates = [IsThumb2];
Johnny Chend68e1192009-12-15 17:24:14 +00001226 let Inst{31-27} = 0b11111;
1227 let Inst{26-25} = 0b00;
1228 let Inst{24} = signed;
1229 let Inst{23} = 0;
1230 let Inst{22-21} = opcod;
1231 let Inst{20} = load;
1232 let Inst{11} = 1;
1233 // (P, W) = (1, 1) Pre-indexed or (0, 1) Post-indexed
1234 let Inst{10} = pre; // The P bit.
1235 let Inst{8} = 1; // The W bit.
Evan Chenge88d5ce2009-07-02 07:28:31 +00001236}
1237
Johnny Chenadc77332010-02-26 22:04:29 +00001238// Helper class for disassembly only
1239// A6.3.16 & A6.3.17
1240// T2Imac - Thumb2 multiply [accumulate, and absolute difference] instructions.
1241class T2I_mac<bit long, bits<3> op22_20, bits<4> op7_4, dag oops, dag iops,
1242 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1243 : T2I<oops, iops, itin, opc, asm, pattern> {
1244 let Inst{31-27} = 0b11111;
1245 let Inst{26-24} = 0b011;
1246 let Inst{23} = long;
1247 let Inst{22-20} = op22_20;
1248 let Inst{7-4} = op7_4;
1249}
1250
David Goodwinc9d138f2009-07-27 19:59:26 +00001251// Tv5Pat - Same as Pat<>, but requires V5T Thumb mode.
1252class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
1253 list<Predicate> Predicates = [IsThumb1Only, HasV5T];
1254}
1255
1256// T1Pat - Same as Pat<>, but requires that the compiler be in Thumb1 mode.
1257class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
1258 list<Predicate> Predicates = [IsThumb1Only];
1259}
Evan Chenge88d5ce2009-07-02 07:28:31 +00001260
Evan Cheng9cb9e672009-06-27 02:26:13 +00001261// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
1262class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Chengd770d9e2009-07-02 06:38:40 +00001263 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001264}
1265
Evan Cheng13096642008-08-29 06:41:12 +00001266//===----------------------------------------------------------------------===//
1267
Evan Cheng96581d32008-11-11 02:11:05 +00001268//===----------------------------------------------------------------------===//
1269// ARM VFP Instruction templates.
1270//
1271
David Goodwin3ca524e2009-07-10 17:03:29 +00001272// Almost all VFP instructions are predicable.
1273class VFPI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001274 IndexMode im, Format f, InstrItinClass itin,
1275 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001276 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001277 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001278 let InOperandList = !con(iops, (ins pred:$p));
David Goodwin3ca524e2009-07-10 17:03:29 +00001279 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1280 let Pattern = pattern;
1281 list<Predicate> Predicates = [HasVFP2];
1282}
1283
1284// Special cases
1285class VFPXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001286 IndexMode im, Format f, InstrItinClass itin,
1287 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001288 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001289 let OutOperandList = oops;
1290 let InOperandList = iops;
1291 let AsmString = asm;
1292 let Pattern = pattern;
1293 list<Predicate> Predicates = [HasVFP2];
1294}
1295
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001296class VFPAI<dag oops, dag iops, Format f, InstrItinClass itin,
1297 string opc, string asm, list<dag> pattern>
1298 : VFPI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
1299 opc, asm, "", pattern>;
David Goodwin3ca524e2009-07-10 17:03:29 +00001300
Evan Chengcd8e66a2008-11-11 21:48:44 +00001301// ARM VFP addrmode5 loads and stores
1302class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001303 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001304 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001305 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001306 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001307 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001308 let Inst{27-24} = opcod1;
1309 let Inst{21-20} = opcod2;
1310 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001311
1312 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1313 let Dom = VFPNeonDomain.Value;
Evan Cheng96581d32008-11-11 02:11:05 +00001314}
1315
Evan Chengcd8e66a2008-11-11 21:48:44 +00001316class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001317 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001318 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001319 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001320 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001321 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001322 let Inst{27-24} = opcod1;
1323 let Inst{21-20} = opcod2;
1324 let Inst{11-8} = 0b1010;
Evan Cheng96581d32008-11-11 02:11:05 +00001325}
1326
Evan Chengcd8e66a2008-11-11 21:48:44 +00001327// Load / store multiple
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001328class AXDI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001329 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001330 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001331 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001332 // TODO: Mark the instructions with the appropriate subtarget info.
1333 let Inst{27-25} = 0b110;
1334 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001335
1336 // 64-bit loads & stores operate on both NEON and VFP pipelines.
1337 let Dom = VFPNeonDomain.Value;
Evan Chengcd8e66a2008-11-11 21:48:44 +00001338}
1339
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001340class AXSI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001341 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001342 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001343 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001344 // TODO: Mark the instructions with the appropriate subtarget info.
1345 let Inst{27-25} = 0b110;
1346 let Inst{11-8} = 0b1010;
1347}
1348
Evan Cheng96581d32008-11-11 02:11:05 +00001349// Double precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001350class ADuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1351 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1352 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001353 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001354 let Inst{27-23} = opcod1;
1355 let Inst{21-20} = opcod2;
1356 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001357 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001358 let Inst{7-6} = opcod4;
1359 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001360}
1361
1362// Double precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001363class ADbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001364 dag iops, InstrItinClass itin, string opc, string asm,
1365 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001366 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001367 let Inst{27-23} = opcod1;
1368 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001369 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001370 let Inst{6} = op6;
1371 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001372}
1373
Jim Grosbach26767372010-03-24 22:31:46 +00001374// Double precision, binary, VML[AS] (for additional predicate)
1375class ADbI_vmlX<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
1376 dag iops, InstrItinClass itin, string opc, string asm,
1377 list<dag> pattern>
1378 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
1379 let Inst{27-23} = opcod1;
1380 let Inst{21-20} = opcod2;
1381 let Inst{11-8} = 0b1011;
1382 let Inst{6} = op6;
1383 let Inst{4} = op4;
1384 list<Predicate> Predicates = [HasVFP2, UseVMLx];
1385}
1386
1387
Evan Cheng96581d32008-11-11 02:11:05 +00001388// Single precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001389class ASuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1390 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1391 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001392 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001393 let Inst{27-23} = opcod1;
1394 let Inst{21-20} = opcod2;
1395 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001396 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001397 let Inst{7-6} = opcod4;
1398 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001399}
1400
David Goodwin338268c2009-08-10 22:17:39 +00001401// Single precision unary, if no NEON
David Goodwin53e44712009-08-04 20:39:05 +00001402// Same as ASuI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001403class ASuIn<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1404 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1405 string asm, list<dag> pattern>
1406 : ASuI<opcod1, opcod2, opcod3, opcod4, opcod5, oops, iops, itin, opc, asm,
1407 pattern> {
David Goodwin53e44712009-08-04 20:39:05 +00001408 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1409}
1410
Evan Cheng96581d32008-11-11 02:11:05 +00001411// Single precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001412class ASbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops, dag iops,
1413 InstrItinClass itin, string opc, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001414 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001415 let Inst{27-23} = opcod1;
1416 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001417 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001418 let Inst{6} = op6;
1419 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001420}
1421
David Goodwin338268c2009-08-10 22:17:39 +00001422// Single precision binary, if no NEON
David Goodwin42a83f22009-08-04 17:53:06 +00001423// Same as ASbI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001424class ASbIn<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001425 dag iops, InstrItinClass itin, string opc, string asm,
1426 list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001427 : ASbI<opcod1, opcod2, op6, op4, oops, iops, itin, opc, asm, pattern> {
David Goodwin42a83f22009-08-04 17:53:06 +00001428 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1429}
1430
Evan Cheng80a11982008-11-12 06:41:41 +00001431// VFP conversion instructions
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001432class AVConv1I<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
1433 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1434 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001435 : VFPAI<oops, iops, VFPConv1Frm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001436 let Inst{27-23} = opcod1;
1437 let Inst{21-20} = opcod2;
1438 let Inst{19-16} = opcod3;
1439 let Inst{11-8} = opcod4;
Evan Cheng80a11982008-11-12 06:41:41 +00001440 let Inst{6} = 1;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001441 let Inst{4} = 0;
Evan Cheng80a11982008-11-12 06:41:41 +00001442}
1443
Johnny Chen811663f2010-02-11 18:47:03 +00001444// VFP conversion between floating-point and fixed-point
1445class AVConv1XI<bits<5> op1, bits<2> op2, bits<4> op3, bits<4> op4, bit op5,
Bob Wilson01135592010-03-23 17:23:59 +00001446 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1447 list<dag> pattern>
Johnny Chen811663f2010-02-11 18:47:03 +00001448 : AVConv1I<op1, op2, op3, op4, oops, iops, itin, opc, asm, pattern> {
1449 // size (fixed-point number): sx == 0 ? 16 : 32
1450 let Inst{7} = op5; // sx
1451}
1452
David Goodwin338268c2009-08-10 22:17:39 +00001453// VFP conversion instructions, if no NEON
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001454class AVConv1In<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
David Goodwin338268c2009-08-10 22:17:39 +00001455 dag oops, dag iops, InstrItinClass itin,
1456 string opc, string asm, list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001457 : AVConv1I<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
1458 pattern> {
David Goodwin338268c2009-08-10 22:17:39 +00001459 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1460}
1461
Evan Cheng80a11982008-11-12 06:41:41 +00001462class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001463 InstrItinClass itin,
1464 string opc, string asm, list<dag> pattern>
1465 : VFPAI<oops, iops, f, itin, opc, asm, pattern> {
Evan Cheng80a11982008-11-12 06:41:41 +00001466 let Inst{27-20} = opcod1;
Evan Cheng78be83d2008-11-11 19:40:26 +00001467 let Inst{11-8} = opcod2;
1468 let Inst{4} = 1;
1469}
1470
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001471class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1472 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1473 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, itin, opc, asm, pattern>;
Evan Cheng0a0ab132008-11-11 22:46:12 +00001474
Bob Wilson01135592010-03-23 17:23:59 +00001475class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001476 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1477 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001478
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001479class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1480 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1481 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001482
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001483class AVConv5I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1484 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1485 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv5Frm, itin, opc, asm, pattern>;
Evan Cheng78be83d2008-11-11 19:40:26 +00001486
Evan Cheng96581d32008-11-11 02:11:05 +00001487//===----------------------------------------------------------------------===//
1488
Bob Wilson5bafff32009-06-22 23:27:02 +00001489//===----------------------------------------------------------------------===//
1490// ARM NEON Instruction templates.
1491//
Evan Cheng13096642008-08-29 06:41:12 +00001492
Johnny Chencaa608e2010-03-20 00:17:00 +00001493class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1494 InstrItinClass itin, string opc, string dt, string asm, string cstr,
1495 list<dag> pattern>
1496 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Evan Chengf81bf152009-11-23 21:57:23 +00001497 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001498 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001499 let AsmString = !strconcat(
1500 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1501 !strconcat("\t", asm));
1502 let Pattern = pattern;
1503 list<Predicate> Predicates = [HasNEON];
1504}
1505
1506// Same as NeonI except it does not have a "data type" specifier.
Johnny Chen927b88f2010-03-23 20:40:44 +00001507class NeonXI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1508 InstrItinClass itin, string opc, string asm, string cstr,
1509 list<dag> pattern>
1510 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001511 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001512 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001513 let AsmString = !strconcat(!strconcat(opc, "${p}"), !strconcat("\t", asm));
Bob Wilson5bafff32009-06-22 23:27:02 +00001514 let Pattern = pattern;
1515 list<Predicate> Predicates = [HasNEON];
Evan Cheng13096642008-08-29 06:41:12 +00001516}
1517
Evan Chengac0869d2009-11-21 06:21:52 +00001518class NI<dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1519 list<dag> pattern>
Johnny Chen927b88f2010-03-23 20:40:44 +00001520 : NeonXI<oops, iops, AddrModeNone, IndexModeNone, NEONFrm, itin, opc, asm, "",
Bob Wilson01135592010-03-23 17:23:59 +00001521 pattern> {
Evan Cheng13096642008-08-29 06:41:12 +00001522}
Bob Wilson5bafff32009-06-22 23:27:02 +00001523
Bob Wilsonb07c1712009-10-07 21:53:04 +00001524class NLdSt<bit op23, bits<2> op21_20, bits<4> op11_8, bits<4> op7_4,
1525 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001526 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chencaa608e2010-03-20 00:17:00 +00001527 : NeonI<oops, iops, AddrMode6, IndexModeNone, NLdStFrm, itin, opc, dt, asm,
1528 cstr, pattern> {
Bob Wilson205a5ca2009-07-08 18:11:30 +00001529 let Inst{31-24} = 0b11110100;
Jim Grosbach780d2072009-10-20 00:19:08 +00001530 let Inst{23} = op23;
1531 let Inst{21-20} = op21_20;
1532 let Inst{11-8} = op11_8;
1533 let Inst{7-4} = op7_4;
Bob Wilson205a5ca2009-07-08 18:11:30 +00001534}
1535
Johnny Chen785516a2010-03-23 16:43:47 +00001536class NDataI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001537 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chen785516a2010-03-23 16:43:47 +00001538 : NeonI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, dt, asm, cstr,
1539 pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001540 let Inst{31-25} = 0b1111001;
1541}
1542
Johnny Chen927b88f2010-03-23 20:40:44 +00001543class NDataXI<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001544 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chen927b88f2010-03-23 20:40:44 +00001545 : NeonXI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001546 cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001547 let Inst{31-25} = 0b1111001;
1548}
1549
1550// NEON "one register and a modified immediate" format.
1551class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1552 bit op5, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001553 dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001554 string opc, string dt, string asm, string cstr,
1555 list<dag> pattern>
Johnny Chena2711742010-03-23 23:09:14 +00001556 : NDataI<oops, iops, N1RegModImmFrm, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001557 let Inst{23} = op23;
1558 let Inst{21-19} = op21_19;
1559 let Inst{11-8} = op11_8;
1560 let Inst{7} = op7;
1561 let Inst{6} = op6;
1562 let Inst{5} = op5;
1563 let Inst{4} = op4;
1564}
1565
1566// NEON 2 vector register format.
1567class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1568 bits<5> op11_7, bit op6, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001569 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001570 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001571 : NDataI<oops, iops, N2RegFrm, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001572 let Inst{24-23} = op24_23;
1573 let Inst{21-20} = op21_20;
1574 let Inst{19-18} = op19_18;
1575 let Inst{17-16} = op17_16;
1576 let Inst{11-7} = op11_7;
1577 let Inst{6} = op6;
1578 let Inst{4} = op4;
1579}
1580
1581// Same as N2V except it doesn't have a datatype suffix.
1582class N2VX<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
Bob Wilson01135592010-03-23 17:23:59 +00001583 bits<5> op11_7, bit op6, bit op4,
1584 dag oops, dag iops, InstrItinClass itin,
1585 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001586 : NDataXI<oops, iops, N2RegFrm, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001587 let Inst{24-23} = op24_23;
1588 let Inst{21-20} = op21_20;
1589 let Inst{19-18} = op19_18;
1590 let Inst{17-16} = op17_16;
1591 let Inst{11-7} = op11_7;
1592 let Inst{6} = op6;
1593 let Inst{4} = op4;
1594}
1595
1596// NEON 2 vector register with immediate.
Bob Wilson507df402009-10-21 02:15:46 +00001597class N2VImm<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
Johnny Chenfa80bec2010-03-25 20:39:04 +00001598 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001599 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenfa80bec2010-03-25 20:39:04 +00001600 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001601 let Inst{24} = op24;
1602 let Inst{23} = op23;
Bob Wilson5bafff32009-06-22 23:27:02 +00001603 let Inst{11-8} = op11_8;
1604 let Inst{7} = op7;
1605 let Inst{6} = op6;
1606 let Inst{4} = op4;
1607}
1608
1609// NEON 3 vector register format.
1610class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001611 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001612 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chen785516a2010-03-23 16:43:47 +00001613 : NDataI<oops, iops, NEONFrm, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001614 let Inst{24} = op24;
1615 let Inst{23} = op23;
1616 let Inst{21-20} = op21_20;
1617 let Inst{11-8} = op11_8;
1618 let Inst{6} = op6;
1619 let Inst{4} = op4;
1620}
1621
Johnny Chen841e8282010-03-23 21:35:03 +00001622// Same as N3V except it doesn't have a data type suffix.
Bob Wilson01135592010-03-23 17:23:59 +00001623class N3VX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
1624 bit op4,
1625 dag oops, dag iops, InstrItinClass itin,
1626 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chen927b88f2010-03-23 20:40:44 +00001627 : NDataXI<oops, iops, NEONFrm, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001628 let Inst{24} = op24;
1629 let Inst{23} = op23;
1630 let Inst{21-20} = op21_20;
1631 let Inst{11-8} = op11_8;
1632 let Inst{6} = op6;
1633 let Inst{4} = op4;
1634}
1635
1636// NEON VMOVs between scalar and core registers.
1637class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001638 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001639 string opc, string dt, string asm, list<dag> pattern>
1640 : InstARM<AddrModeNone, Size4Bytes, IndexModeNone, f, GenericDomain,
Bob Wilson01135592010-03-23 17:23:59 +00001641 "", itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001642 let Inst{27-20} = opcod1;
1643 let Inst{11-8} = opcod2;
1644 let Inst{6-5} = opcod3;
1645 let Inst{4} = 1;
Evan Chengf81bf152009-11-23 21:57:23 +00001646
1647 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001648 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001649 let AsmString = !strconcat(
1650 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1651 !strconcat("\t", asm));
1652 let Pattern = pattern;
Bob Wilson5bafff32009-06-22 23:27:02 +00001653 list<Predicate> Predicates = [HasNEON];
1654}
1655class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001656 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001657 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001658 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONGetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001659 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001660class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001661 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001662 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001663 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONSetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001664 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001665class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001666 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001667 string opc, string dt, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001668 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONDupFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001669 opc, dt, asm, pattern>;
David Goodwin42a83f22009-08-04 17:53:06 +00001670
Johnny Chene4614f72010-03-25 17:01:27 +00001671// Vector Duplicate Lane (from scalar to all elements)
1672class NVDupLane<bits<4> op19_16, bit op6, dag oops, dag iops,
1673 InstrItinClass itin, string opc, string dt, string asm,
1674 list<dag> pattern>
Johnny Chen2d2898e2010-03-25 21:49:12 +00001675 : NDataI<oops, iops, NVDupLnFrm, itin, opc, dt, asm, "", pattern> {
Johnny Chene4614f72010-03-25 17:01:27 +00001676 let Inst{24-23} = 0b11;
1677 let Inst{21-20} = 0b11;
1678 let Inst{19-16} = op19_16;
1679 let Inst{11-7} = 0b11000;
1680 let Inst{6} = op6;
1681 let Inst{4} = 0;
1682}
1683
David Goodwin42a83f22009-08-04 17:53:06 +00001684// NEONFPPat - Same as Pat<>, but requires that the compiler be using NEON
1685// for single-precision FP.
1686class NEONFPPat<dag pattern, dag result> : Pat<pattern, result> {
1687 list<Predicate> Predicates = [HasNEON,UseNEONForFP];
1688}