blob: 25c94331a4c3466d2381c4adfcdfdc91991c955c [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>;
Bob Wilson9a1c1892010-08-11 00:01:18 +000039def SatFrm : Format<13>;
40def ExtFrm : Format<14>;
Evan Chengcd8e66a2008-11-11 21:48:44 +000041
Bob Wilson9a1c1892010-08-11 00:01:18 +000042def VFPUnaryFrm : Format<15>;
43def VFPBinaryFrm : Format<16>;
44def VFPConv1Frm : Format<17>;
45def VFPConv2Frm : Format<18>;
46def VFPConv3Frm : Format<19>;
47def VFPConv4Frm : Format<20>;
48def VFPConv5Frm : Format<21>;
49def VFPLdStFrm : Format<22>;
50def VFPLdStMulFrm : Format<23>;
51def VFPMiscFrm : Format<24>;
Evan Chengcd8e66a2008-11-11 21:48:44 +000052
Bob Wilson9a1c1892010-08-11 00:01:18 +000053def ThumbFrm : Format<25>;
54def MiscFrm : Format<26>;
Evan Cheng37f25d92008-08-28 23:39:26 +000055
Bob Wilson9a1c1892010-08-11 00:01:18 +000056def NGetLnFrm : Format<27>;
57def NSetLnFrm : Format<28>;
58def NDupFrm : Format<29>;
59def NLdStFrm : Format<30>;
60def N1RegModImmFrm: Format<31>;
61def N2RegFrm : Format<32>;
62def NVCVTFrm : Format<33>;
63def NVDupLnFrm : Format<34>;
64def N2RegVShLFrm : Format<35>;
65def N2RegVShRFrm : Format<36>;
66def N3RegFrm : Format<37>;
67def N3RegVShFrm : Format<38>;
68def NVExtFrm : Format<39>;
69def NVMulSLFrm : Format<40>;
70def NVTBLFrm : Format<41>;
Johnny Chencaa608e2010-03-20 00:17:00 +000071
Evan Cheng34a0fa32009-07-08 01:46:35 +000072// Misc flags.
73
Evan Chengedda31c2008-11-05 18:35:52 +000074// the instruction has a Rn register operand.
Evan Cheng34a0fa32009-07-08 01:46:35 +000075// UnaryDP - Indicates this is a unary data processing instruction, i.e.
76// it doesn't have a Rn operand.
77class UnaryDP { bit isUnaryDataProc = 1; }
78
79// Xform16Bit - Indicates this Thumb2 instruction may be transformed into
80// a 16-bit Thumb instruction if certain conditions are met.
81class Xform16Bit { bit canXformTo16Bit = 1; }
Evan Cheng37f25d92008-08-28 23:39:26 +000082
Evan Cheng37f25d92008-08-28 23:39:26 +000083//===----------------------------------------------------------------------===//
Bob Wilson50622ce2010-03-18 23:57:57 +000084// ARM Instruction flags. These need to match ARMBaseInstrInfo.h.
Evan Cheng055b0312009-06-29 07:51:04 +000085//
86
87// Addressing mode.
88class AddrMode<bits<4> val> {
89 bits<4> Value = val;
90}
91def AddrModeNone : AddrMode<0>;
92def AddrMode1 : AddrMode<1>;
93def AddrMode2 : AddrMode<2>;
94def AddrMode3 : AddrMode<3>;
95def AddrMode4 : AddrMode<4>;
96def AddrMode5 : AddrMode<5>;
Bob Wilson8b024a52009-07-01 23:16:05 +000097def AddrMode6 : AddrMode<6>;
98def AddrModeT1_1 : AddrMode<7>;
99def AddrModeT1_2 : AddrMode<8>;
100def AddrModeT1_4 : AddrMode<9>;
101def AddrModeT1_s : AddrMode<10>;
David Goodwine1e52ed2009-07-22 22:24:31 +0000102def AddrModeT2_i12: AddrMode<11>;
Bob Wilson8b024a52009-07-01 23:16:05 +0000103def AddrModeT2_i8 : AddrMode<12>;
104def AddrModeT2_so : AddrMode<13>;
105def AddrModeT2_pc : AddrMode<14>;
106def AddrModeT2_i8s4 : AddrMode<15>;
Evan Cheng055b0312009-06-29 07:51:04 +0000107
108// Instruction size.
109class SizeFlagVal<bits<3> val> {
110 bits<3> Value = val;
111}
112def SizeInvalid : SizeFlagVal<0>; // Unset.
113def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
114def Size8Bytes : SizeFlagVal<2>;
115def Size4Bytes : SizeFlagVal<3>;
116def Size2Bytes : SizeFlagVal<4>;
117
118// Load / store index mode.
119class IndexMode<bits<2> val> {
120 bits<2> Value = val;
121}
122def IndexModeNone : IndexMode<0>;
123def IndexModePre : IndexMode<1>;
124def IndexModePost : IndexMode<2>;
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000125def IndexModeUpd : IndexMode<3>;
Evan Cheng055b0312009-06-29 07:51:04 +0000126
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000127// Instruction execution domain.
128class Domain<bits<2> val> {
129 bits<2> Value = val;
130}
131def GenericDomain : Domain<0>;
132def VFPDomain : Domain<1>; // Instructions in VFP domain only
133def NeonDomain : Domain<2>; // Instructions in Neon domain only
134def VFPNeonDomain : Domain<3>; // Instructions in both VFP & Neon domains
135
Evan Cheng055b0312009-06-29 07:51:04 +0000136//===----------------------------------------------------------------------===//
Evan Cheng37f25d92008-08-28 23:39:26 +0000137
Evan Cheng446c4282009-07-11 06:43:01 +0000138// ARM special operands.
139//
140
Daniel Dunbar8462b302010-08-11 06:36:53 +0000141def CondCodeOperand : AsmOperandClass {
142 let Name = "CondCode";
143 let SuperClasses = [];
144}
145
Evan Cheng446c4282009-07-11 06:43:01 +0000146// ARM Predicate operand. Default to 14 = always (AL). Second part is CC
147// register whose default is 0 (no register).
148def pred : PredicateOperand<OtherVT, (ops i32imm, CCR),
149 (ops (i32 14), (i32 zero_reg))> {
150 let PrintMethod = "printPredicateOperand";
Daniel Dunbar8462b302010-08-11 06:36:53 +0000151 let ParserMatchClass = CondCodeOperand;
Evan Cheng446c4282009-07-11 06:43:01 +0000152}
153
154// Conditional code result for instructions whose 's' bit is set, e.g. subs.
155def cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 zero_reg))> {
156 let PrintMethod = "printSBitModifierOperand";
157}
158
159// Same as cc_out except it defaults to setting CPSR.
160def s_cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 CPSR))> {
161 let PrintMethod = "printSBitModifierOperand";
162}
163
Johnny Chendd0f3cf2010-03-10 18:59:38 +0000164// ARM special operands for disassembly only.
165//
166
167def cps_opt : Operand<i32> {
168 let PrintMethod = "printCPSOptionOperand";
169}
170
171def msr_mask : Operand<i32> {
172 let PrintMethod = "printMSRMaskOperand";
173}
174
175// A8.6.117, A8.6.118. Different instructions are generated for #0 and #-0.
176// The neg_zero operand translates -0 to -1, -1 to -2, ..., etc.
177def neg_zero : Operand<i32> {
178 let PrintMethod = "printNegZeroOperand";
179}
180
Evan Cheng446c4282009-07-11 06:43:01 +0000181//===----------------------------------------------------------------------===//
182
Evan Cheng37f25d92008-08-28 23:39:26 +0000183// ARM Instruction templates.
184//
185
Johnny Chend68e1192009-12-15 17:24:14 +0000186class InstTemplate<AddrMode am, SizeFlagVal sz, IndexMode im,
187 Format f, Domain d, string cstr, InstrItinClass itin>
Evan Cheng37f25d92008-08-28 23:39:26 +0000188 : Instruction {
189 let Namespace = "ARM";
190
Evan Cheng37f25d92008-08-28 23:39:26 +0000191 AddrMode AM = am;
Evan Cheng37f25d92008-08-28 23:39:26 +0000192 SizeFlagVal SZ = sz;
Evan Cheng37f25d92008-08-28 23:39:26 +0000193 IndexMode IM = im;
194 bits<2> IndexModeBits = IM.Value;
Evan Cheng37f25d92008-08-28 23:39:26 +0000195 Format F = f;
Bob Wilson89ef7b72010-03-17 21:13:43 +0000196 bits<6> Form = F.Value;
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000197 Domain D = d;
Evan Chengedda31c2008-11-05 18:35:52 +0000198 bit isUnaryDataProc = 0;
Evan Cheng34a0fa32009-07-08 01:46:35 +0000199 bit canXformTo16Bit = 0;
Bob Wilson01135592010-03-23 17:23:59 +0000200
Jakob Stoklund Olesenfddb7662010-04-05 03:10:20 +0000201 // The layout of TSFlags should be kept in sync with ARMBaseInstrInfo.h.
202 let TSFlags{3-0} = AM.Value;
203 let TSFlags{6-4} = SZ.Value;
204 let TSFlags{8-7} = IndexModeBits;
205 let TSFlags{14-9} = Form;
206 let TSFlags{15} = isUnaryDataProc;
207 let TSFlags{16} = canXformTo16Bit;
208 let TSFlags{18-17} = D.Value;
209
Evan Cheng37f25d92008-08-28 23:39:26 +0000210 let Constraints = cstr;
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000211 let Itinerary = itin;
Evan Cheng37f25d92008-08-28 23:39:26 +0000212}
213
Johnny Chend68e1192009-12-15 17:24:14 +0000214class Encoding {
215 field bits<32> Inst;
216}
217
218class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
219 Format f, Domain d, string cstr, InstrItinClass itin>
220 : InstTemplate<am, sz, im, f, d, cstr, itin>, Encoding;
221
222// This Encoding-less class is used by Thumb1 to specify the encoding bits later
223// on by adding flavors to specific instructions.
224class InstThumb<AddrMode am, SizeFlagVal sz, IndexMode im,
225 Format f, Domain d, string cstr, InstrItinClass itin>
226 : InstTemplate<am, sz, im, f, d, cstr, itin>;
227
Bob Wilson01135592010-03-23 17:23:59 +0000228class PseudoInst<dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000229 string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +0000230 : InstARM<AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, GenericDomain,
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000231 "", itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000232 let OutOperandList = oops;
233 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +0000234 let AsmString = asm;
Evan Cheng37f25d92008-08-28 23:39:26 +0000235 let Pattern = pattern;
236}
237
238// Almost all ARM instructions are predicable.
Evan Chengd87293c2008-11-06 08:47:38 +0000239class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000240 IndexMode im, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000241 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000242 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000243 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000244 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000245 let InOperandList = !con(iops, (ins pred:$p));
Bob Wilsond3038462010-05-24 20:08:34 +0000246 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
Evan Cheng37f25d92008-08-28 23:39:26 +0000247 let Pattern = pattern;
248 list<Predicate> Predicates = [IsARM];
249}
Jim Grosbachf6b28622009-12-14 18:31:20 +0000250// A few are not predicable
251class InoP<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000252 IndexMode im, Format f, InstrItinClass itin,
253 string opc, string asm, string cstr,
254 list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000255 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
256 let OutOperandList = oops;
257 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +0000258 let AsmString = !strconcat(opc, asm);
Jim Grosbachf6b28622009-12-14 18:31:20 +0000259 let Pattern = pattern;
260 let isPredicable = 0;
261 list<Predicate> Predicates = [IsARM];
262}
Evan Cheng37f25d92008-08-28 23:39:26 +0000263
264// Same as I except it can optionally modify CPSR. Note it's modeled as
265// an input operand since by default it's a zero register. It will
266// become an implicit def once it's "flipped".
Evan Chengd87293c2008-11-06 08:47:38 +0000267class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000268 IndexMode im, Format f, InstrItinClass itin,
269 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000270 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000271 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000272 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000273 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Bob Wilsond3038462010-05-24 20:08:34 +0000274 let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm));
Evan Cheng37f25d92008-08-28 23:39:26 +0000275 let Pattern = pattern;
276 list<Predicate> Predicates = [IsARM];
277}
278
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000279// Special cases
Evan Chengd87293c2008-11-06 08:47:38 +0000280class XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000281 IndexMode im, Format f, InstrItinClass itin,
282 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000283 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000284 let OutOperandList = oops;
285 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +0000286 let AsmString = asm;
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000287 let Pattern = pattern;
288 list<Predicate> Predicates = [IsARM];
289}
290
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000291class AI<dag oops, dag iops, Format f, InstrItinClass itin,
292 string opc, string asm, list<dag> pattern>
293 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
294 opc, asm, "", pattern>;
295class AsI<dag oops, dag iops, Format f, InstrItinClass itin,
296 string opc, string asm, list<dag> pattern>
297 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
298 opc, asm, "", pattern>;
299class AXI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000300 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000301 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng97f48c32008-11-06 22:15:19 +0000302 asm, "", pattern>;
Jim Grosbachf6b28622009-12-14 18:31:20 +0000303class AInoP<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +0000304 string opc, string asm, list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000305 : InoP<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Bob Wilson01135592010-03-23 17:23:59 +0000306 opc, asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000307
308// Ctrl flow instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000309class ABI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
310 string opc, string asm, list<dag> pattern>
311 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
312 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000313 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000314}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000315class ABXI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
316 string asm, list<dag> pattern>
317 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
318 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000319 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000320}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000321class ABXIx2<dag oops, dag iops, InstrItinClass itin,
322 string asm, list<dag> pattern>
Xerxes Ranby99ccffe2010-07-22 17:28:34 +0000323 : XI<oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, Pseudo, itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000324 asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000325
326// BR_JT instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000327class JTI<dag oops, dag iops, InstrItinClass itin,
328 string asm, list<dag> pattern>
329 : XI<oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BrMiscFrm, itin,
Evan Cheng4df60f52008-11-07 09:06:08 +0000330 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000331
Jim Grosbach5278eb82009-12-11 01:42:04 +0000332
333// Atomic load/store instructions
334
335class AIldrex<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} = 1;
342 let Inst{11-0} = 0b111110011111;
343}
344class AIstrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
345 string opc, string asm, list<dag> pattern>
346 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
347 opc, asm, "", pattern> {
348 let Inst{27-23} = 0b00011;
349 let Inst{22-21} = opcod;
350 let Inst{20} = 0;
Johnny Chen0291d7e2009-12-11 19:37:26 +0000351 let Inst{11-4} = 0b11111001;
Jim Grosbach5278eb82009-12-11 01:42:04 +0000352}
353
Evan Cheng0d14fc82008-09-01 01:51:14 +0000354// addrmode1 instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000355class AI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
356 string opc, string asm, list<dag> pattern>
357 : I<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
358 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000359 let Inst{24-21} = opcod;
360 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000361}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000362class AsI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
363 string opc, string asm, list<dag> pattern>
364 : sI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
365 opc, asm, "", pattern> {
366 let Inst{24-21} = opcod;
367 let Inst{27-26} = {0,0};
368}
369class AXI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000370 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000371 : XI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng612b79e2008-08-29 07:40:52 +0000372 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000373 let Inst{24-21} = opcod;
374 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000375}
Bob Wilson01135592010-03-23 17:23:59 +0000376class AI1x2<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000377 string opc, string asm, list<dag> pattern>
378 : I<oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, itin,
379 opc, asm, "", pattern>;
Evan Cheng17222df2008-08-31 19:02:21 +0000380
Evan Cheng0d14fc82008-09-01 01:51:14 +0000381
382// addrmode2 loads and stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000383class AI2<dag oops, dag iops, Format f, InstrItinClass itin,
384 string opc, string asm, list<dag> pattern>
385 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
386 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000387 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000388}
Evan Cheng93912732008-09-01 01:27:33 +0000389
390// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000391class AI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
392 string opc, string asm, list<dag> pattern>
393 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
394 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000395 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000396 let Inst{21} = 0; // W bit
397 let Inst{22} = 0; // B bit
398 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000399 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000400}
Bob Wilson01135592010-03-23 17:23:59 +0000401class AXI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000402 string asm, list<dag> pattern>
403 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000404 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000405 let Inst{20} = 1; // L bit
406 let Inst{21} = 0; // W bit
407 let Inst{22} = 0; // B bit
408 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000409 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000410}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000411class AI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
412 string opc, string asm, list<dag> pattern>
413 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
414 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000415 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000416 let Inst{21} = 0; // W bit
417 let Inst{22} = 1; // B bit
418 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000419 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000420}
Bob Wilson01135592010-03-23 17:23:59 +0000421class AXI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000422 string asm, list<dag> pattern>
423 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000424 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000425 let Inst{20} = 1; // L bit
426 let Inst{21} = 0; // W bit
427 let Inst{22} = 1; // B bit
428 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000429 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000430}
Evan Cheng17222df2008-08-31 19:02:21 +0000431
Evan Cheng93912732008-09-01 01:27:33 +0000432// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000433class AI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
434 string opc, string asm, list<dag> pattern>
435 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
436 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000437 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000438 let Inst{21} = 0; // W bit
439 let Inst{22} = 0; // B bit
440 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000441 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000442}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000443class AXI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
444 string asm, list<dag> pattern>
445 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000446 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000447 let Inst{20} = 0; // L bit
448 let Inst{21} = 0; // W bit
449 let Inst{22} = 0; // B bit
450 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000451 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000452}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000453class AI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
454 string opc, string asm, list<dag> pattern>
455 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
456 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000457 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000458 let Inst{21} = 0; // W bit
459 let Inst{22} = 1; // B bit
460 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000461 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000462}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000463class AXI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
464 string asm, list<dag> pattern>
465 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000466 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000467 let Inst{20} = 0; // L bit
468 let Inst{21} = 0; // W bit
469 let Inst{22} = 1; // B bit
470 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000471 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000472}
Evan Cheng93912732008-09-01 01:27:33 +0000473
Evan Cheng840917b2008-09-01 07:00:14 +0000474// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000475class AI2ldwpr<dag oops, dag iops, Format f, InstrItinClass itin,
476 string opc, string asm, string cstr, list<dag> pattern>
477 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
478 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000479 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000480 let Inst{21} = 1; // W bit
481 let Inst{22} = 0; // B bit
482 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000483 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000484}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000485class AI2ldbpr<dag oops, dag iops, Format f, InstrItinClass itin,
486 string opc, string asm, string cstr, list<dag> pattern>
487 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
488 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000489 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000490 let Inst{21} = 1; // W bit
491 let Inst{22} = 1; // B bit
492 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000493 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000494}
495
Evan Cheng840917b2008-09-01 07:00:14 +0000496// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000497class AI2stwpr<dag oops, dag iops, Format f, InstrItinClass itin,
498 string opc, string asm, string cstr, list<dag> pattern>
499 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
500 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000501 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000502 let Inst{21} = 1; // W bit
503 let Inst{22} = 0; // B bit
504 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000505 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000506}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000507class AI2stbpr<dag oops, dag iops, Format f, InstrItinClass itin,
508 string opc, string asm, string cstr, list<dag> pattern>
509 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
510 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000511 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000512 let Inst{21} = 1; // W bit
513 let Inst{22} = 1; // B bit
514 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000515 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000516}
517
Evan Cheng840917b2008-09-01 07:00:14 +0000518// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000519class AI2ldwpo<dag oops, dag iops, Format f, InstrItinClass itin,
520 string opc, string asm, string cstr, list<dag> pattern>
521 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
522 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000523 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000524 let Inst{21} = 0; // W bit
525 let Inst{22} = 0; // B bit
526 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000527 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000528}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000529class AI2ldbpo<dag oops, dag iops, Format f, InstrItinClass itin,
530 string opc, string asm, string cstr, list<dag> pattern>
531 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
532 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000533 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000534 let Inst{21} = 0; // W bit
535 let Inst{22} = 1; // B bit
536 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000537 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000538}
539
Evan Cheng840917b2008-09-01 07:00:14 +0000540// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000541class AI2stwpo<dag oops, dag iops, Format f, InstrItinClass itin,
542 string opc, string asm, string cstr, list<dag> pattern>
543 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
544 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000545 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000546 let Inst{21} = 0; // W bit
547 let Inst{22} = 0; // B bit
548 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000549 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000550}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000551class AI2stbpo<dag oops, dag iops, Format f, InstrItinClass itin,
552 string opc, string asm, string cstr, list<dag> pattern>
553 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
554 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000555 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000556 let Inst{21} = 0; // W bit
557 let Inst{22} = 1; // B bit
558 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000559 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000560}
561
Evan Cheng0d14fc82008-09-01 01:51:14 +0000562// addrmode3 instructions
Bob Wilson01135592010-03-23 17:23:59 +0000563class AI3<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000564 string opc, string asm, list<dag> pattern>
565 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
566 opc, asm, "", pattern>;
567class AXI3<dag oops, dag iops, Format f, InstrItinClass itin,
568 string asm, list<dag> pattern>
569 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
570 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000571
Evan Cheng840917b2008-09-01 07:00:14 +0000572// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000573class AI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
574 string opc, string asm, list<dag> pattern>
575 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
576 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000577 let Inst{4} = 1;
578 let Inst{5} = 1; // H bit
579 let Inst{6} = 0; // S bit
580 let Inst{7} = 1;
581 let Inst{20} = 1; // L bit
582 let Inst{21} = 0; // W bit
583 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000584 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000585}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000586class AXI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
587 string asm, list<dag> pattern>
588 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000589 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000590 let Inst{4} = 1;
591 let Inst{5} = 1; // H bit
592 let Inst{6} = 0; // S bit
593 let Inst{7} = 1;
594 let Inst{20} = 1; // L bit
595 let Inst{21} = 0; // W bit
596 let Inst{24} = 1; // P bit
597}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000598class AI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
599 string opc, string asm, list<dag> pattern>
600 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
601 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000602 let Inst{4} = 1;
603 let Inst{5} = 1; // H bit
604 let Inst{6} = 1; // S bit
605 let Inst{7} = 1;
606 let Inst{20} = 1; // L bit
607 let Inst{21} = 0; // W bit
608 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000609 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000610}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000611class AXI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
612 string asm, list<dag> pattern>
613 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000614 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000615 let Inst{4} = 1;
616 let Inst{5} = 1; // H bit
617 let Inst{6} = 1; // S bit
618 let Inst{7} = 1;
619 let Inst{20} = 1; // L bit
620 let Inst{21} = 0; // W bit
621 let Inst{24} = 1; // P bit
622}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000623class AI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
624 string opc, string asm, list<dag> pattern>
625 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
626 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000627 let Inst{4} = 1;
628 let Inst{5} = 0; // H bit
629 let Inst{6} = 1; // S bit
630 let Inst{7} = 1;
631 let Inst{20} = 1; // L bit
632 let Inst{21} = 0; // W bit
633 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000634 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000635}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000636class AXI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
637 string asm, list<dag> pattern>
638 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000639 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000640 let Inst{4} = 1;
641 let Inst{5} = 0; // H bit
642 let Inst{6} = 1; // S bit
643 let Inst{7} = 1;
644 let Inst{20} = 1; // L bit
645 let Inst{21} = 0; // W bit
646 let Inst{24} = 1; // P bit
647}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000648class AI3ldd<dag oops, dag iops, Format f, InstrItinClass itin,
649 string opc, string asm, list<dag> pattern>
650 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
651 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000652 let Inst{4} = 1;
653 let Inst{5} = 0; // H bit
654 let Inst{6} = 1; // S bit
655 let Inst{7} = 1;
656 let Inst{20} = 0; // L bit
657 let Inst{21} = 0; // W bit
658 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000659 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000660}
661
662// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000663class AI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
664 string opc, string asm, list<dag> pattern>
665 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
666 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000667 let Inst{4} = 1;
668 let Inst{5} = 1; // H bit
669 let Inst{6} = 0; // S bit
670 let Inst{7} = 1;
671 let Inst{20} = 0; // L bit
672 let Inst{21} = 0; // W bit
673 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000674 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000675}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000676class AXI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
677 string asm, list<dag> pattern>
678 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000679 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000680 let Inst{4} = 1;
681 let Inst{5} = 1; // H bit
682 let Inst{6} = 0; // S bit
683 let Inst{7} = 1;
684 let Inst{20} = 0; // L bit
685 let Inst{21} = 0; // W bit
686 let Inst{24} = 1; // P bit
687}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000688class AI3std<dag oops, dag iops, Format f, InstrItinClass itin,
689 string opc, string asm, list<dag> pattern>
690 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
691 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000692 let Inst{4} = 1;
693 let Inst{5} = 1; // H bit
694 let Inst{6} = 1; // S bit
695 let Inst{7} = 1;
696 let Inst{20} = 0; // L bit
697 let Inst{21} = 0; // W bit
698 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000699 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000700}
701
702// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000703class AI3ldhpr<dag oops, dag iops, Format f, InstrItinClass itin,
704 string opc, string asm, string cstr, list<dag> pattern>
705 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
706 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000707 let Inst{4} = 1;
708 let Inst{5} = 1; // H bit
709 let Inst{6} = 0; // S bit
710 let Inst{7} = 1;
711 let Inst{20} = 1; // L bit
712 let Inst{21} = 1; // W bit
713 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000714 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000715}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000716class AI3ldshpr<dag oops, dag iops, Format f, InstrItinClass itin,
717 string opc, string asm, string cstr, list<dag> pattern>
718 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
719 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000720 let Inst{4} = 1;
721 let Inst{5} = 1; // H bit
722 let Inst{6} = 1; // S bit
723 let Inst{7} = 1;
724 let Inst{20} = 1; // L bit
725 let Inst{21} = 1; // W bit
726 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000727 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000728}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000729class AI3ldsbpr<dag oops, dag iops, Format f, InstrItinClass itin,
730 string opc, string asm, string cstr, list<dag> pattern>
731 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
732 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000733 let Inst{4} = 1;
734 let Inst{5} = 0; // H bit
735 let Inst{6} = 1; // S bit
736 let Inst{7} = 1;
737 let Inst{20} = 1; // L bit
738 let Inst{21} = 1; // W bit
739 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000740 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000741}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000742class AI3lddpr<dag oops, dag iops, Format f, InstrItinClass itin,
743 string opc, string asm, string cstr, list<dag> pattern>
744 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
745 opc, asm, cstr, pattern> {
746 let Inst{4} = 1;
747 let Inst{5} = 0; // H bit
748 let Inst{6} = 1; // S bit
749 let Inst{7} = 1;
750 let Inst{20} = 0; // L bit
751 let Inst{21} = 1; // W bit
752 let Inst{24} = 1; // P bit
753 let Inst{27-25} = 0b000;
754}
755
Evan Cheng840917b2008-09-01 07:00:14 +0000756
757// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000758class AI3sthpr<dag oops, dag iops, Format f, InstrItinClass itin,
759 string opc, string asm, string cstr, list<dag> pattern>
760 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
761 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000762 let Inst{4} = 1;
763 let Inst{5} = 1; // H bit
764 let Inst{6} = 0; // S bit
765 let Inst{7} = 1;
766 let Inst{20} = 0; // L bit
767 let Inst{21} = 1; // W bit
768 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000769 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000770}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000771class AI3stdpr<dag oops, dag iops, Format f, InstrItinClass itin,
772 string opc, string asm, string cstr, list<dag> pattern>
773 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
774 opc, asm, cstr, pattern> {
775 let Inst{4} = 1;
776 let Inst{5} = 1; // H bit
777 let Inst{6} = 1; // S bit
778 let Inst{7} = 1;
779 let Inst{20} = 0; // L bit
780 let Inst{21} = 1; // W bit
781 let Inst{24} = 1; // P bit
782 let Inst{27-25} = 0b000;
783}
Evan Cheng840917b2008-09-01 07:00:14 +0000784
785// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000786class AI3ldhpo<dag oops, dag iops, Format f, InstrItinClass itin,
787 string opc, string asm, string cstr, list<dag> pattern>
788 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
789 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000790 let Inst{4} = 1;
791 let Inst{5} = 1; // H bit
792 let Inst{6} = 0; // S bit
793 let Inst{7} = 1;
794 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000795 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000796 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000797 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000798}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000799class AI3ldshpo<dag oops, dag iops, Format f, InstrItinClass itin,
800 string opc, string asm, string cstr, list<dag> pattern>
801 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
802 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000803 let Inst{4} = 1;
804 let Inst{5} = 1; // H bit
805 let Inst{6} = 1; // S bit
806 let Inst{7} = 1;
807 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000808 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000809 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000810 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000811}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000812class AI3ldsbpo<dag oops, dag iops, Format f, InstrItinClass itin,
813 string opc, string asm, string cstr, list<dag> pattern>
814 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
815 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000816 let Inst{4} = 1;
817 let Inst{5} = 0; // H bit
818 let Inst{6} = 1; // S bit
819 let Inst{7} = 1;
820 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000821 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000822 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000823 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000824}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000825class AI3lddpo<dag oops, dag iops, Format f, InstrItinClass itin,
826 string opc, string asm, string cstr, list<dag> pattern>
827 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
828 opc, asm, cstr, pattern> {
829 let Inst{4} = 1;
830 let Inst{5} = 0; // H bit
831 let Inst{6} = 1; // S bit
832 let Inst{7} = 1;
833 let Inst{20} = 0; // L bit
834 let Inst{21} = 0; // W bit
835 let Inst{24} = 0; // P bit
836 let Inst{27-25} = 0b000;
837}
Evan Cheng840917b2008-09-01 07:00:14 +0000838
839// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000840class AI3sthpo<dag oops, dag iops, Format f, InstrItinClass itin,
841 string opc, string asm, string cstr, list<dag> pattern>
842 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
843 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000844 let Inst{4} = 1;
845 let Inst{5} = 1; // H bit
846 let Inst{6} = 0; // S bit
847 let Inst{7} = 1;
848 let Inst{20} = 0; // L bit
Johnny Chenad4df4c2010-03-01 19:22:00 +0000849 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000850 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000851 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000852}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000853class AI3stdpo<dag oops, dag iops, Format f, InstrItinClass itin,
854 string opc, string asm, string cstr, list<dag> pattern>
855 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
856 opc, asm, cstr, pattern> {
857 let Inst{4} = 1;
858 let Inst{5} = 1; // H bit
859 let Inst{6} = 1; // S bit
860 let Inst{7} = 1;
861 let Inst{20} = 0; // L bit
862 let Inst{21} = 0; // W bit
863 let Inst{24} = 0; // P bit
864 let Inst{27-25} = 0b000;
865}
Evan Cheng840917b2008-09-01 07:00:14 +0000866
Evan Cheng0d14fc82008-09-01 01:51:14 +0000867// addrmode4 instructions
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000868class AXI4ld<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000869 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000870 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000871 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000872 let Inst{20} = 1; // L bit
873 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000874 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000875}
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000876class AXI4st<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000877 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000878 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000879 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000880 let Inst{20} = 0; // L bit
881 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000882 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000883}
Evan Cheng37f25d92008-08-28 23:39:26 +0000884
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000885// Unsigned multiply, multiply-accumulate instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000886class AMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
887 string opc, string asm, list<dag> pattern>
888 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
889 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000890 let Inst{7-4} = 0b1001;
Evan Chengfbc9d412008-11-06 01:21:28 +0000891 let Inst{20} = 0; // S bit
Evan Chengd87293c2008-11-06 08:47:38 +0000892 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000893}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000894class AsMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
895 string opc, string asm, list<dag> pattern>
896 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
897 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000898 let Inst{7-4} = 0b1001;
Evan Chengd87293c2008-11-06 08:47:38 +0000899 let Inst{27-21} = opcod;
Evan Chengfbc9d412008-11-06 01:21:28 +0000900}
901
902// Most significant word multiply
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000903class AMul2I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
904 string opc, string asm, list<dag> pattern>
905 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
906 opc, asm, "", pattern> {
Evan Chengfbc9d412008-11-06 01:21:28 +0000907 let Inst{7-4} = 0b1001;
908 let Inst{20} = 1;
Evan Chengd87293c2008-11-06 08:47:38 +0000909 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000910}
Evan Cheng37f25d92008-08-28 23:39:26 +0000911
Evan Chengeb4f52e2008-11-06 03:35:07 +0000912// SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000913class AMulxyI<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
914 string opc, string asm, list<dag> pattern>
915 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
916 opc, asm, "", pattern> {
Evan Chengeb4f52e2008-11-06 03:35:07 +0000917 let Inst{4} = 0;
918 let Inst{7} = 1;
919 let Inst{20} = 0;
Evan Chengd87293c2008-11-06 08:47:38 +0000920 let Inst{27-21} = opcod;
Evan Chengeb4f52e2008-11-06 03:35:07 +0000921}
922
Evan Cheng97f48c32008-11-06 22:15:19 +0000923// Extend instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000924class AExtI<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
925 string opc, string asm, list<dag> pattern>
926 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ExtFrm, itin,
927 opc, asm, "", pattern> {
Evan Cheng97f48c32008-11-06 22:15:19 +0000928 let Inst{7-4} = 0b0111;
929 let Inst{27-20} = opcod;
930}
931
Evan Cheng8b59db32008-11-07 01:41:35 +0000932// Misc Arithmetic instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000933class AMiscA1I<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
934 string opc, string asm, list<dag> pattern>
935 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ArithMiscFrm, itin,
936 opc, asm, "", pattern> {
Evan Cheng8b59db32008-11-07 01:41:35 +0000937 let Inst{27-20} = opcod;
938}
939
Evan Cheng37f25d92008-08-28 23:39:26 +0000940//===----------------------------------------------------------------------===//
941
942// ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
943class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
944 list<Predicate> Predicates = [IsARM];
945}
946class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
947 list<Predicate> Predicates = [IsARM, HasV5TE];
948}
949class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
950 list<Predicate> Predicates = [IsARM, HasV6];
951}
Evan Cheng13096642008-08-29 06:41:12 +0000952
953//===----------------------------------------------------------------------===//
954//
955// Thumb Instruction Format Definitions.
956//
957
Evan Cheng13096642008-08-29 06:41:12 +0000958// TI - Thumb instruction.
959
Evan Cheng446c4282009-07-11 06:43:01 +0000960class ThumbI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000961 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000962 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000963 let OutOperandList = oops;
964 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +0000965 let AsmString = asm;
Evan Cheng13096642008-08-29 06:41:12 +0000966 let Pattern = pattern;
967 list<Predicate> Predicates = [IsThumb];
968}
969
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000970class TI<dag oops, dag iops, InstrItinClass itin, string asm, list<dag> pattern>
971 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000972
Evan Cheng35d6c412009-08-04 23:47:55 +0000973// Two-address instructions
Bob Wilson01135592010-03-23 17:23:59 +0000974class TIt<dag oops, dag iops, InstrItinClass itin, string asm,
975 list<dag> pattern>
976 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "$lhs = $dst",
977 pattern>;
Evan Cheng35d6c412009-08-04 23:47:55 +0000978
Johnny Chend68e1192009-12-15 17:24:14 +0000979// tBL, tBX 32-bit instructions
980class TIx2<bits<5> opcod1, bits<2> opcod2, bit opcod3,
Bob Wilson01135592010-03-23 17:23:59 +0000981 dag oops, dag iops, InstrItinClass itin, string asm,
982 list<dag> pattern>
983 : ThumbI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>,
984 Encoding {
Johnny Chend68e1192009-12-15 17:24:14 +0000985 let Inst{31-27} = opcod1;
986 let Inst{15-14} = opcod2;
987 let Inst{12} = opcod3;
988}
Evan Cheng13096642008-08-29 06:41:12 +0000989
990// BR_JT instructions
Bob Wilson01135592010-03-23 17:23:59 +0000991class TJTI<dag oops, dag iops, InstrItinClass itin, string asm,
992 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000993 : ThumbI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000994
Evan Cheng09c39fc2009-06-23 19:38:13 +0000995// Thumb1 only
Evan Cheng446c4282009-07-11 06:43:01 +0000996class Thumb1I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000997 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000998 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000999 let OutOperandList = oops;
1000 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +00001001 let AsmString = asm;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001002 let Pattern = pattern;
1003 list<Predicate> Predicates = [IsThumb1Only];
1004}
1005
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001006class T1I<dag oops, dag iops, InstrItinClass itin,
1007 string asm, list<dag> pattern>
1008 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
1009class T1Ix2<dag oops, dag iops, InstrItinClass itin,
1010 string asm, list<dag> pattern>
1011 : Thumb1I<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1012class T1JTI<dag oops, dag iops, InstrItinClass itin,
1013 string asm, list<dag> pattern>
Johnny Chenbbc71b22009-12-16 02:32:54 +00001014 : Thumb1I<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001015
1016// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001017class T1It<dag oops, dag iops, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001018 string asm, string cstr, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001019 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001020 asm, cstr, pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001021
1022// Thumb1 instruction that can either be predicated or set CPSR.
1023class Thumb1sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001024 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001025 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001026 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Chris Lattnerb7d52262010-03-18 21:06:54 +00001027 let OutOperandList = !con(oops, (outs s_cc_out:$s));
1028 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001029 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1030 let Pattern = pattern;
1031 list<Predicate> Predicates = [IsThumb1Only];
1032}
1033
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001034class T1sI<dag oops, dag iops, InstrItinClass itin,
1035 string opc, string asm, list<dag> pattern>
1036 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001037
1038// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001039class T1sIt<dag oops, dag iops, InstrItinClass itin,
1040 string opc, string asm, list<dag> pattern>
1041 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001042 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001043
1044// Thumb1 instruction that can be predicated.
1045class Thumb1pI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001046 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001047 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001048 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +00001049 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001050 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001051 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1052 let Pattern = pattern;
1053 list<Predicate> Predicates = [IsThumb1Only];
1054}
1055
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001056class T1pI<dag oops, dag iops, InstrItinClass itin,
1057 string opc, string asm, list<dag> pattern>
1058 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001059
1060// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001061class T1pIt<dag oops, dag iops, InstrItinClass itin,
1062 string opc, string asm, list<dag> pattern>
1063 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001064 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001065
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001066class T1pI1<dag oops, dag iops, InstrItinClass itin,
1067 string opc, string asm, list<dag> pattern>
1068 : Thumb1pI<oops, iops, AddrModeT1_1, Size2Bytes, itin, opc, asm, "", pattern>;
1069class T1pI2<dag oops, dag iops, InstrItinClass itin,
1070 string opc, string asm, list<dag> pattern>
1071 : Thumb1pI<oops, iops, AddrModeT1_2, Size2Bytes, itin, opc, asm, "", pattern>;
1072class T1pI4<dag oops, dag iops, InstrItinClass itin,
1073 string opc, string asm, list<dag> pattern>
1074 : Thumb1pI<oops, iops, AddrModeT1_4, Size2Bytes, itin, opc, asm, "", pattern>;
Bob Wilson01135592010-03-23 17:23:59 +00001075class T1pIs<dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001076 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1077 : Thumb1pI<oops, iops, AddrModeT1_s, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001078
Johnny Chenbbc71b22009-12-16 02:32:54 +00001079class Encoding16 : Encoding {
1080 let Inst{31-16} = 0x0000;
1081}
1082
Johnny Chend68e1192009-12-15 17:24:14 +00001083// A6.2 16-bit Thumb instruction encoding
Johnny Chenbbc71b22009-12-16 02:32:54 +00001084class T1Encoding<bits<6> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001085 let Inst{15-10} = opcode;
1086}
1087
1088// A6.2.1 Shift (immediate), add, subtract, move, and compare encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001089class T1General<bits<5> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001090 let Inst{15-14} = 0b00;
1091 let Inst{13-9} = opcode;
1092}
1093
1094// A6.2.2 Data-processing encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001095class T1DataProcessing<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001096 let Inst{15-10} = 0b010000;
1097 let Inst{9-6} = opcode;
1098}
1099
1100// A6.2.3 Special data instructions and branch and exchange encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001101class T1Special<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001102 let Inst{15-10} = 0b010001;
1103 let Inst{9-6} = opcode;
1104}
1105
1106// A6.2.4 Load/store single data item encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001107class T1LoadStore<bits<4> opA, bits<3> opB> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001108 let Inst{15-12} = opA;
1109 let Inst{11-9} = opB;
1110}
1111class T1LdSt<bits<3> opB> : T1LoadStore<0b0101, opB>;
1112class T1LdSt4Imm<bits<3> opB> : T1LoadStore<0b0110, opB>; // Immediate, 4 bytes
1113class T1LdSt1Imm<bits<3> opB> : T1LoadStore<0b0111, opB>; // Immediate, 1 byte
1114class T1LdSt2Imm<bits<3> opB> : T1LoadStore<0b1000, opB>; // Immediate, 2 bytes
1115class T1LdStSP<bits<3> opB> : T1LoadStore<0b1001, opB>; // SP relative
1116
1117// A6.2.5 Miscellaneous 16-bit instructions encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001118class T1Misc<bits<7> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001119 let Inst{15-12} = 0b1011;
1120 let Inst{11-5} = opcode;
1121}
1122
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001123// Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
1124class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001125 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001126 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001127 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001128 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001129 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001130 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1131 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001132 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001133}
1134
1135// Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as
1136// an input operand since by default it's a zero register. It will
1137// become an implicit def once it's "flipped".
1138// FIXME: This uses unified syntax so {s} comes before {p}. We should make it
1139// more consistent.
1140class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001141 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001142 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001143 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001144 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001145 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Bob Wilsond3038462010-05-24 20:08:34 +00001146 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001147 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001148 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001149}
1150
1151// Special cases
1152class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001153 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001154 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001155 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001156 let OutOperandList = oops;
1157 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +00001158 let AsmString = asm;
Evan Chengf49810c2009-06-23 17:48:47 +00001159 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001160 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001161}
1162
Jim Grosbachd1228742009-12-01 18:10:36 +00001163class ThumbXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +00001164 InstrItinClass itin,
1165 string asm, string cstr, list<dag> pattern>
Jim Grosbachd1228742009-12-01 18:10:36 +00001166 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1167 let OutOperandList = oops;
1168 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +00001169 let AsmString = asm;
Jim Grosbachd1228742009-12-01 18:10:36 +00001170 let Pattern = pattern;
1171 list<Predicate> Predicates = [IsThumb1Only];
1172}
1173
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001174class T2I<dag oops, dag iops, InstrItinClass itin,
1175 string opc, string asm, list<dag> pattern>
1176 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
1177class T2Ii12<dag oops, dag iops, InstrItinClass itin,
1178 string opc, string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001179 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, itin, opc, asm, "",pattern>;
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001180class T2Ii8<dag oops, dag iops, InstrItinClass itin,
1181 string opc, string asm, list<dag> pattern>
1182 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, itin, opc, asm, "", pattern>;
1183class T2Iso<dag oops, dag iops, InstrItinClass itin,
1184 string opc, string asm, list<dag> pattern>
1185 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, itin, opc, asm, "", pattern>;
1186class T2Ipc<dag oops, dag iops, InstrItinClass itin,
1187 string opc, string asm, list<dag> pattern>
1188 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, itin, opc, asm, "", pattern>;
Johnny Chend68e1192009-12-15 17:24:14 +00001189class T2Ii8s4<bit P, bit W, bit load, dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001190 string opc, string asm, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001191 : Thumb2I<oops, iops, AddrModeT2_i8s4, Size4Bytes, itin, opc, asm, "",
1192 pattern> {
1193 let Inst{31-27} = 0b11101;
1194 let Inst{26-25} = 0b00;
1195 let Inst{24} = P;
1196 let Inst{23} = ?; // The U bit.
1197 let Inst{22} = 1;
1198 let Inst{21} = W;
1199 let Inst{20} = load;
1200}
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001201
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001202class T2sI<dag oops, dag iops, InstrItinClass itin,
1203 string opc, string asm, list<dag> pattern>
1204 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001205
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001206class T2XI<dag oops, dag iops, InstrItinClass itin,
1207 string asm, list<dag> pattern>
1208 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1209class T2JTI<dag oops, dag iops, InstrItinClass itin,
1210 string asm, list<dag> pattern>
1211 : Thumb2XI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Chengf49810c2009-06-23 17:48:47 +00001212
Evan Cheng5adb66a2009-09-28 09:14:39 +00001213class T2Ix2<dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001214 string opc, string asm, list<dag> pattern>
Evan Cheng5adb66a2009-09-28 09:14:39 +00001215 : Thumb2I<oops, iops, AddrModeNone, Size8Bytes, itin, opc, asm, "", pattern>;
1216
Bob Wilson815baeb2010-03-13 01:08:20 +00001217// Two-address instructions
1218class T2XIt<dag oops, dag iops, InstrItinClass itin,
1219 string asm, string cstr, list<dag> pattern>
1220 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, cstr, pattern>;
Evan Cheng5adb66a2009-09-28 09:14:39 +00001221
Evan Chenge88d5ce2009-07-02 07:28:31 +00001222// T2Iidxldst - Thumb2 indexed load / store instructions.
Johnny Chend68e1192009-12-15 17:24:14 +00001223class T2Iidxldst<bit signed, bits<2> opcod, bit load, bit pre,
1224 dag oops, dag iops,
1225 AddrMode am, IndexMode im, InstrItinClass itin,
Evan Chenge88d5ce2009-07-02 07:28:31 +00001226 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001227 : InstARM<am, Size4Bytes, im, ThumbFrm, GenericDomain, cstr, itin> {
Evan Chenge88d5ce2009-07-02 07:28:31 +00001228 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001229 let InOperandList = !con(iops, (ins pred:$p));
Evan Chenge88d5ce2009-07-02 07:28:31 +00001230 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1231 let Pattern = pattern;
1232 list<Predicate> Predicates = [IsThumb2];
Johnny Chend68e1192009-12-15 17:24:14 +00001233 let Inst{31-27} = 0b11111;
1234 let Inst{26-25} = 0b00;
1235 let Inst{24} = signed;
1236 let Inst{23} = 0;
1237 let Inst{22-21} = opcod;
1238 let Inst{20} = load;
1239 let Inst{11} = 1;
1240 // (P, W) = (1, 1) Pre-indexed or (0, 1) Post-indexed
1241 let Inst{10} = pre; // The P bit.
1242 let Inst{8} = 1; // The W bit.
Evan Chenge88d5ce2009-07-02 07:28:31 +00001243}
1244
Johnny Chenadc77332010-02-26 22:04:29 +00001245// Helper class for disassembly only
1246// A6.3.16 & A6.3.17
1247// T2Imac - Thumb2 multiply [accumulate, and absolute difference] instructions.
1248class T2I_mac<bit long, bits<3> op22_20, bits<4> op7_4, dag oops, dag iops,
1249 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1250 : T2I<oops, iops, itin, opc, asm, pattern> {
1251 let Inst{31-27} = 0b11111;
1252 let Inst{26-24} = 0b011;
1253 let Inst{23} = long;
1254 let Inst{22-20} = op22_20;
1255 let Inst{7-4} = op7_4;
1256}
1257
David Goodwinc9d138f2009-07-27 19:59:26 +00001258// Tv5Pat - Same as Pat<>, but requires V5T Thumb mode.
1259class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
1260 list<Predicate> Predicates = [IsThumb1Only, HasV5T];
1261}
1262
1263// T1Pat - Same as Pat<>, but requires that the compiler be in Thumb1 mode.
1264class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
1265 list<Predicate> Predicates = [IsThumb1Only];
1266}
Evan Chenge88d5ce2009-07-02 07:28:31 +00001267
Evan Cheng9cb9e672009-06-27 02:26:13 +00001268// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
1269class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Chengd770d9e2009-07-02 06:38:40 +00001270 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001271}
1272
Evan Cheng13096642008-08-29 06:41:12 +00001273//===----------------------------------------------------------------------===//
1274
Evan Cheng96581d32008-11-11 02:11:05 +00001275//===----------------------------------------------------------------------===//
1276// ARM VFP Instruction templates.
1277//
1278
David Goodwin3ca524e2009-07-10 17:03:29 +00001279// Almost all VFP instructions are predicable.
1280class VFPI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001281 IndexMode im, Format f, InstrItinClass itin,
1282 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001283 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001284 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001285 let InOperandList = !con(iops, (ins pred:$p));
Bob Wilsond3038462010-05-24 20:08:34 +00001286 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
David Goodwin3ca524e2009-07-10 17:03:29 +00001287 let Pattern = pattern;
1288 list<Predicate> Predicates = [HasVFP2];
1289}
1290
1291// Special cases
1292class VFPXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001293 IndexMode im, Format f, InstrItinClass itin,
1294 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001295 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001296 let OutOperandList = oops;
1297 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +00001298 let AsmString = asm;
David Goodwin3ca524e2009-07-10 17:03:29 +00001299 let Pattern = pattern;
1300 list<Predicate> Predicates = [HasVFP2];
1301}
1302
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001303class VFPAI<dag oops, dag iops, Format f, InstrItinClass itin,
1304 string opc, string asm, list<dag> pattern>
1305 : VFPI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
1306 opc, asm, "", pattern>;
David Goodwin3ca524e2009-07-10 17:03:29 +00001307
Evan Chengcd8e66a2008-11-11 21:48:44 +00001308// ARM VFP addrmode5 loads and stores
1309class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001310 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001311 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001312 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001313 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001314 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001315 let Inst{27-24} = opcod1;
1316 let Inst{21-20} = opcod2;
1317 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001318
1319 // 64-bit loads & stores operate on both NEON and VFP pipelines.
Jakob Stoklund Olesenfddb7662010-04-05 03:10:20 +00001320 let D = VFPNeonDomain;
Evan Cheng96581d32008-11-11 02:11:05 +00001321}
1322
Evan Chengcd8e66a2008-11-11 21:48:44 +00001323class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001324 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001325 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001326 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001327 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001328 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001329 let Inst{27-24} = opcod1;
1330 let Inst{21-20} = opcod2;
1331 let Inst{11-8} = 0b1010;
Evan Cheng96581d32008-11-11 02:11:05 +00001332}
1333
Evan Chengcd8e66a2008-11-11 21:48:44 +00001334// Load / store multiple
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001335class AXDI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001336 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001337 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001338 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001339 // TODO: Mark the instructions with the appropriate subtarget info.
1340 let Inst{27-25} = 0b110;
1341 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001342
1343 // 64-bit loads & stores operate on both NEON and VFP pipelines.
Jakob Stoklund Olesenfddb7662010-04-05 03:10:20 +00001344 let D = VFPNeonDomain;
Evan Chengcd8e66a2008-11-11 21:48:44 +00001345}
1346
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001347class AXSI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001348 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001349 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001350 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001351 // TODO: Mark the instructions with the appropriate subtarget info.
1352 let Inst{27-25} = 0b110;
1353 let Inst{11-8} = 0b1010;
1354}
1355
Evan Cheng96581d32008-11-11 02:11:05 +00001356// Double precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001357class ADuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1358 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1359 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001360 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001361 let Inst{27-23} = opcod1;
1362 let Inst{21-20} = opcod2;
1363 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001364 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001365 let Inst{7-6} = opcod4;
1366 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001367}
1368
1369// Double precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001370class ADbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001371 dag iops, InstrItinClass itin, string opc, string asm,
1372 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001373 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001374 let Inst{27-23} = opcod1;
1375 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001376 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001377 let Inst{6} = op6;
1378 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001379}
1380
Jim Grosbach26767372010-03-24 22:31:46 +00001381// Double precision, binary, VML[AS] (for additional predicate)
1382class ADbI_vmlX<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
1383 dag iops, InstrItinClass itin, string opc, string asm,
1384 list<dag> pattern>
1385 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
1386 let Inst{27-23} = opcod1;
1387 let Inst{21-20} = opcod2;
1388 let Inst{11-8} = 0b1011;
1389 let Inst{6} = op6;
1390 let Inst{4} = op4;
1391 list<Predicate> Predicates = [HasVFP2, UseVMLx];
1392}
1393
1394
Evan Cheng96581d32008-11-11 02:11:05 +00001395// Single precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001396class ASuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1397 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1398 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001399 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001400 let Inst{27-23} = opcod1;
1401 let Inst{21-20} = opcod2;
1402 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001403 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001404 let Inst{7-6} = opcod4;
1405 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001406}
1407
David Goodwin338268c2009-08-10 22:17:39 +00001408// Single precision unary, if no NEON
David Goodwin53e44712009-08-04 20:39:05 +00001409// Same as ASuI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001410class ASuIn<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1411 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1412 string asm, list<dag> pattern>
1413 : ASuI<opcod1, opcod2, opcod3, opcod4, opcod5, oops, iops, itin, opc, asm,
1414 pattern> {
David Goodwin53e44712009-08-04 20:39:05 +00001415 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1416}
1417
Evan Cheng96581d32008-11-11 02:11:05 +00001418// Single precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001419class ASbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops, dag iops,
1420 InstrItinClass itin, string opc, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001421 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001422 let Inst{27-23} = opcod1;
1423 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001424 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001425 let Inst{6} = op6;
1426 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001427}
1428
David Goodwin338268c2009-08-10 22:17:39 +00001429// Single precision binary, if no NEON
David Goodwin42a83f22009-08-04 17:53:06 +00001430// Same as ASbI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001431class ASbIn<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001432 dag iops, InstrItinClass itin, string opc, string asm,
1433 list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001434 : ASbI<opcod1, opcod2, op6, op4, oops, iops, itin, opc, asm, pattern> {
David Goodwin42a83f22009-08-04 17:53:06 +00001435 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1436}
1437
Evan Cheng80a11982008-11-12 06:41:41 +00001438// VFP conversion instructions
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001439class AVConv1I<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
1440 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1441 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001442 : VFPAI<oops, iops, VFPConv1Frm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001443 let Inst{27-23} = opcod1;
1444 let Inst{21-20} = opcod2;
1445 let Inst{19-16} = opcod3;
1446 let Inst{11-8} = opcod4;
Evan Cheng80a11982008-11-12 06:41:41 +00001447 let Inst{6} = 1;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001448 let Inst{4} = 0;
Evan Cheng80a11982008-11-12 06:41:41 +00001449}
1450
Johnny Chen811663f2010-02-11 18:47:03 +00001451// VFP conversion between floating-point and fixed-point
1452class AVConv1XI<bits<5> op1, bits<2> op2, bits<4> op3, bits<4> op4, bit op5,
Bob Wilson01135592010-03-23 17:23:59 +00001453 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1454 list<dag> pattern>
Johnny Chen811663f2010-02-11 18:47:03 +00001455 : AVConv1I<op1, op2, op3, op4, oops, iops, itin, opc, asm, pattern> {
1456 // size (fixed-point number): sx == 0 ? 16 : 32
1457 let Inst{7} = op5; // sx
1458}
1459
David Goodwin338268c2009-08-10 22:17:39 +00001460// VFP conversion instructions, if no NEON
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001461class AVConv1In<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
David Goodwin338268c2009-08-10 22:17:39 +00001462 dag oops, dag iops, InstrItinClass itin,
1463 string opc, string asm, list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001464 : AVConv1I<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
1465 pattern> {
David Goodwin338268c2009-08-10 22:17:39 +00001466 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1467}
1468
Evan Cheng80a11982008-11-12 06:41:41 +00001469class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001470 InstrItinClass itin,
1471 string opc, string asm, list<dag> pattern>
1472 : VFPAI<oops, iops, f, itin, opc, asm, pattern> {
Evan Cheng80a11982008-11-12 06:41:41 +00001473 let Inst{27-20} = opcod1;
Evan Cheng78be83d2008-11-11 19:40:26 +00001474 let Inst{11-8} = opcod2;
1475 let Inst{4} = 1;
1476}
1477
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001478class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1479 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1480 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, itin, opc, asm, pattern>;
Evan Cheng0a0ab132008-11-11 22:46:12 +00001481
Bob Wilson01135592010-03-23 17:23:59 +00001482class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001483 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1484 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001485
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001486class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1487 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1488 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001489
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001490class AVConv5I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1491 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1492 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv5Frm, itin, opc, asm, pattern>;
Evan Cheng78be83d2008-11-11 19:40:26 +00001493
Evan Cheng96581d32008-11-11 02:11:05 +00001494//===----------------------------------------------------------------------===//
1495
Bob Wilson5bafff32009-06-22 23:27:02 +00001496//===----------------------------------------------------------------------===//
1497// ARM NEON Instruction templates.
1498//
Evan Cheng13096642008-08-29 06:41:12 +00001499
Johnny Chencaa608e2010-03-20 00:17:00 +00001500class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1501 InstrItinClass itin, string opc, string dt, string asm, string cstr,
1502 list<dag> pattern>
1503 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Evan Chengf81bf152009-11-23 21:57:23 +00001504 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001505 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001506 let AsmString = !strconcat(
1507 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1508 !strconcat("\t", asm));
1509 let Pattern = pattern;
1510 list<Predicate> Predicates = [HasNEON];
1511}
1512
1513// Same as NeonI except it does not have a "data type" specifier.
Johnny Chen927b88f2010-03-23 20:40:44 +00001514class NeonXI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1515 InstrItinClass itin, string opc, string asm, string cstr,
1516 list<dag> pattern>
1517 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001518 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001519 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001520 let AsmString = !strconcat(!strconcat(opc, "${p}"), !strconcat("\t", asm));
Bob Wilson5bafff32009-06-22 23:27:02 +00001521 let Pattern = pattern;
1522 list<Predicate> Predicates = [HasNEON];
Evan Cheng13096642008-08-29 06:41:12 +00001523}
1524
Bob Wilsonb07c1712009-10-07 21:53:04 +00001525class NLdSt<bit op23, bits<2> op21_20, bits<4> op11_8, bits<4> op7_4,
1526 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001527 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chencaa608e2010-03-20 00:17:00 +00001528 : NeonI<oops, iops, AddrMode6, IndexModeNone, NLdStFrm, itin, opc, dt, asm,
1529 cstr, pattern> {
Bob Wilson205a5ca2009-07-08 18:11:30 +00001530 let Inst{31-24} = 0b11110100;
Jim Grosbach780d2072009-10-20 00:19:08 +00001531 let Inst{23} = op23;
1532 let Inst{21-20} = op21_20;
1533 let Inst{11-8} = op11_8;
1534 let Inst{7-4} = op7_4;
Bob Wilson205a5ca2009-07-08 18:11:30 +00001535}
1536
Johnny Chen785516a2010-03-23 16:43:47 +00001537class NDataI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001538 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chen785516a2010-03-23 16:43:47 +00001539 : NeonI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, dt, asm, cstr,
1540 pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001541 let Inst{31-25} = 0b1111001;
1542}
1543
Johnny Chen927b88f2010-03-23 20:40:44 +00001544class NDataXI<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001545 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chen927b88f2010-03-23 20:40:44 +00001546 : NeonXI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001547 cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001548 let Inst{31-25} = 0b1111001;
1549}
1550
1551// NEON "one register and a modified immediate" format.
1552class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1553 bit op5, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001554 dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001555 string opc, string dt, string asm, string cstr,
1556 list<dag> pattern>
Johnny Chena2711742010-03-23 23:09:14 +00001557 : NDataI<oops, iops, N1RegModImmFrm, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001558 let Inst{23} = op23;
1559 let Inst{21-19} = op21_19;
1560 let Inst{11-8} = op11_8;
1561 let Inst{7} = op7;
1562 let Inst{6} = op6;
1563 let Inst{5} = op5;
1564 let Inst{4} = op4;
1565}
1566
1567// NEON 2 vector register format.
1568class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1569 bits<5> op11_7, bit op6, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001570 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001571 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001572 : NDataI<oops, iops, N2RegFrm, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001573 let Inst{24-23} = op24_23;
1574 let Inst{21-20} = op21_20;
1575 let Inst{19-18} = op19_18;
1576 let Inst{17-16} = op17_16;
1577 let Inst{11-7} = op11_7;
1578 let Inst{6} = op6;
1579 let Inst{4} = op4;
1580}
1581
1582// Same as N2V except it doesn't have a datatype suffix.
1583class N2VX<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
Bob Wilson01135592010-03-23 17:23:59 +00001584 bits<5> op11_7, bit op6, bit op4,
1585 dag oops, dag iops, InstrItinClass itin,
1586 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001587 : NDataXI<oops, iops, N2RegFrm, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001588 let Inst{24-23} = op24_23;
1589 let Inst{21-20} = op21_20;
1590 let Inst{19-18} = op19_18;
1591 let Inst{17-16} = op17_16;
1592 let Inst{11-7} = op11_7;
1593 let Inst{6} = op6;
1594 let Inst{4} = op4;
1595}
1596
1597// NEON 2 vector register with immediate.
Bob Wilson507df402009-10-21 02:15:46 +00001598class N2VImm<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
Johnny Chenfa80bec2010-03-25 20:39:04 +00001599 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001600 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenfa80bec2010-03-25 20:39:04 +00001601 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001602 let Inst{24} = op24;
1603 let Inst{23} = op23;
Bob Wilson5bafff32009-06-22 23:27:02 +00001604 let Inst{11-8} = op11_8;
1605 let Inst{7} = op7;
1606 let Inst{6} = op6;
1607 let Inst{4} = op4;
1608}
1609
Bob Wilson10bc69c2010-03-27 03:56:52 +00001610// NEON 3 vector register format.
1611class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
1612 dag oops, dag iops, Format f, InstrItinClass itin,
1613 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenc6e704d2010-03-26 21:26:28 +00001614 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001615 let Inst{24} = op24;
1616 let Inst{23} = op23;
1617 let Inst{21-20} = op21_20;
1618 let Inst{11-8} = op11_8;
1619 let Inst{6} = op6;
1620 let Inst{4} = op4;
1621}
1622
Johnny Chen841e8282010-03-23 21:35:03 +00001623// Same as N3V except it doesn't have a data type suffix.
Bob Wilson01135592010-03-23 17:23:59 +00001624class N3VX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
1625 bit op4,
Bob Wilson10bc69c2010-03-27 03:56:52 +00001626 dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001627 string opc, string asm, string cstr, list<dag> pattern>
Bob Wilson10bc69c2010-03-27 03:56:52 +00001628 : NDataXI<oops, iops, f, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001629 let Inst{24} = op24;
1630 let Inst{23} = op23;
1631 let Inst{21-20} = op21_20;
1632 let Inst{11-8} = op11_8;
1633 let Inst{6} = op6;
1634 let Inst{4} = op4;
1635}
1636
1637// NEON VMOVs between scalar and core registers.
1638class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001639 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001640 string opc, string dt, string asm, list<dag> pattern>
1641 : InstARM<AddrModeNone, Size4Bytes, IndexModeNone, f, GenericDomain,
Bob Wilson01135592010-03-23 17:23:59 +00001642 "", itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001643 let Inst{27-20} = opcod1;
1644 let Inst{11-8} = opcod2;
1645 let Inst{6-5} = opcod3;
1646 let Inst{4} = 1;
Evan Chengf81bf152009-11-23 21:57:23 +00001647
1648 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001649 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001650 let AsmString = !strconcat(
1651 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1652 !strconcat("\t", asm));
1653 let Pattern = pattern;
Bob Wilson5bafff32009-06-22 23:27:02 +00001654 list<Predicate> Predicates = [HasNEON];
1655}
1656class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001657 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001658 string opc, string dt, string asm, list<dag> pattern>
Bob Wilson184723d2010-06-25 23:56:05 +00001659 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NGetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001660 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001661class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001662 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001663 string opc, string dt, string asm, list<dag> pattern>
Bob Wilson184723d2010-06-25 23:56:05 +00001664 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NSetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001665 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001666class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001667 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001668 string opc, string dt, string asm, list<dag> pattern>
Bob Wilson184723d2010-06-25 23:56:05 +00001669 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NDupFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001670 opc, dt, asm, pattern>;
David Goodwin42a83f22009-08-04 17:53:06 +00001671
Johnny Chene4614f72010-03-25 17:01:27 +00001672// Vector Duplicate Lane (from scalar to all elements)
1673class NVDupLane<bits<4> op19_16, bit op6, dag oops, dag iops,
1674 InstrItinClass itin, string opc, string dt, string asm,
1675 list<dag> pattern>
Johnny Chen2d2898e2010-03-25 21:49:12 +00001676 : NDataI<oops, iops, NVDupLnFrm, itin, opc, dt, asm, "", pattern> {
Johnny Chene4614f72010-03-25 17:01:27 +00001677 let Inst{24-23} = 0b11;
1678 let Inst{21-20} = 0b11;
1679 let Inst{19-16} = op19_16;
1680 let Inst{11-7} = 0b11000;
1681 let Inst{6} = op6;
1682 let Inst{4} = 0;
1683}
1684
David Goodwin42a83f22009-08-04 17:53:06 +00001685// NEONFPPat - Same as Pat<>, but requires that the compiler be using NEON
1686// for single-precision FP.
1687class NEONFPPat<dag pattern, dag result> : Pat<pattern, result> {
1688 list<Predicate> Predicates = [HasNEON,UseNEONForFP];
1689}