blob: a0f887b41d2b4876cdf7ceaa171f2375d5fb927f [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
141// ARM Predicate operand. Default to 14 = always (AL). Second part is CC
142// register whose default is 0 (no register).
143def pred : PredicateOperand<OtherVT, (ops i32imm, CCR),
144 (ops (i32 14), (i32 zero_reg))> {
145 let PrintMethod = "printPredicateOperand";
146}
147
148// Conditional code result for instructions whose 's' bit is set, e.g. subs.
149def cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 zero_reg))> {
150 let PrintMethod = "printSBitModifierOperand";
151}
152
153// Same as cc_out except it defaults to setting CPSR.
154def s_cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 CPSR))> {
155 let PrintMethod = "printSBitModifierOperand";
156}
157
Johnny Chendd0f3cf2010-03-10 18:59:38 +0000158// ARM special operands for disassembly only.
159//
160
161def cps_opt : Operand<i32> {
162 let PrintMethod = "printCPSOptionOperand";
163}
164
165def msr_mask : Operand<i32> {
166 let PrintMethod = "printMSRMaskOperand";
167}
168
169// A8.6.117, A8.6.118. Different instructions are generated for #0 and #-0.
170// The neg_zero operand translates -0 to -1, -1 to -2, ..., etc.
171def neg_zero : Operand<i32> {
172 let PrintMethod = "printNegZeroOperand";
173}
174
Evan Cheng446c4282009-07-11 06:43:01 +0000175//===----------------------------------------------------------------------===//
176
Evan Cheng37f25d92008-08-28 23:39:26 +0000177// ARM Instruction templates.
178//
179
Johnny Chend68e1192009-12-15 17:24:14 +0000180class InstTemplate<AddrMode am, SizeFlagVal sz, IndexMode im,
181 Format f, Domain d, string cstr, InstrItinClass itin>
Evan Cheng37f25d92008-08-28 23:39:26 +0000182 : Instruction {
183 let Namespace = "ARM";
184
Evan Cheng37f25d92008-08-28 23:39:26 +0000185 AddrMode AM = am;
Evan Cheng37f25d92008-08-28 23:39:26 +0000186 SizeFlagVal SZ = sz;
Evan Cheng37f25d92008-08-28 23:39:26 +0000187 IndexMode IM = im;
188 bits<2> IndexModeBits = IM.Value;
Evan Cheng37f25d92008-08-28 23:39:26 +0000189 Format F = f;
Bob Wilson89ef7b72010-03-17 21:13:43 +0000190 bits<6> Form = F.Value;
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000191 Domain D = d;
Evan Chengedda31c2008-11-05 18:35:52 +0000192 bit isUnaryDataProc = 0;
Evan Cheng34a0fa32009-07-08 01:46:35 +0000193 bit canXformTo16Bit = 0;
Bob Wilson01135592010-03-23 17:23:59 +0000194
Jakob Stoklund Olesenfddb7662010-04-05 03:10:20 +0000195 // The layout of TSFlags should be kept in sync with ARMBaseInstrInfo.h.
196 let TSFlags{3-0} = AM.Value;
197 let TSFlags{6-4} = SZ.Value;
198 let TSFlags{8-7} = IndexModeBits;
199 let TSFlags{14-9} = Form;
200 let TSFlags{15} = isUnaryDataProc;
201 let TSFlags{16} = canXformTo16Bit;
202 let TSFlags{18-17} = D.Value;
203
Evan Cheng37f25d92008-08-28 23:39:26 +0000204 let Constraints = cstr;
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000205 let Itinerary = itin;
Evan Cheng37f25d92008-08-28 23:39:26 +0000206}
207
Johnny Chend68e1192009-12-15 17:24:14 +0000208class Encoding {
209 field bits<32> Inst;
210}
211
212class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
213 Format f, Domain d, string cstr, InstrItinClass itin>
214 : InstTemplate<am, sz, im, f, d, cstr, itin>, Encoding;
215
216// This Encoding-less class is used by Thumb1 to specify the encoding bits later
217// on by adding flavors to specific instructions.
218class InstThumb<AddrMode am, SizeFlagVal sz, IndexMode im,
219 Format f, Domain d, string cstr, InstrItinClass itin>
220 : InstTemplate<am, sz, im, f, d, cstr, itin>;
221
Bob Wilson01135592010-03-23 17:23:59 +0000222class PseudoInst<dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000223 string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +0000224 : InstARM<AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, GenericDomain,
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000225 "", itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000226 let OutOperandList = oops;
227 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +0000228 let AsmString = asm;
Evan Cheng37f25d92008-08-28 23:39:26 +0000229 let Pattern = pattern;
230}
231
232// Almost all ARM instructions are predicable.
Evan Chengd87293c2008-11-06 08:47:38 +0000233class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000234 IndexMode im, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000235 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000236 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000237 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000238 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000239 let InOperandList = !con(iops, (ins pred:$p));
Bob Wilsond3038462010-05-24 20:08:34 +0000240 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
Evan Cheng37f25d92008-08-28 23:39:26 +0000241 let Pattern = pattern;
242 list<Predicate> Predicates = [IsARM];
243}
Jim Grosbachf6b28622009-12-14 18:31:20 +0000244// A few are not predicable
245class InoP<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +0000246 IndexMode im, Format f, InstrItinClass itin,
247 string opc, string asm, string cstr,
248 list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000249 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
250 let OutOperandList = oops;
251 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +0000252 let AsmString = !strconcat(opc, asm);
Jim Grosbachf6b28622009-12-14 18:31:20 +0000253 let Pattern = pattern;
254 let isPredicable = 0;
255 list<Predicate> Predicates = [IsARM];
256}
Evan Cheng37f25d92008-08-28 23:39:26 +0000257
258// Same as I except it can optionally modify CPSR. Note it's modeled as
259// an input operand since by default it's a zero register. It will
260// become an implicit def once it's "flipped".
Evan Chengd87293c2008-11-06 08:47:38 +0000261class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000262 IndexMode im, Format f, InstrItinClass itin,
263 string opc, string asm, string cstr,
Evan Cheng37f25d92008-08-28 23:39:26 +0000264 list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000265 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng37f25d92008-08-28 23:39:26 +0000266 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +0000267 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Bob Wilsond3038462010-05-24 20:08:34 +0000268 let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm));
Evan Cheng37f25d92008-08-28 23:39:26 +0000269 let Pattern = pattern;
270 list<Predicate> Predicates = [IsARM];
271}
272
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000273// Special cases
Evan Chengd87293c2008-11-06 08:47:38 +0000274class XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000275 IndexMode im, Format f, InstrItinClass itin,
276 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000277 : InstARM<am, sz, im, f, GenericDomain, cstr, itin> {
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000278 let OutOperandList = oops;
279 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +0000280 let AsmString = asm;
Evan Cheng4bbd5f82008-09-01 07:19:00 +0000281 let Pattern = pattern;
282 list<Predicate> Predicates = [IsARM];
283}
284
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000285class AI<dag oops, dag iops, Format f, InstrItinClass itin,
286 string opc, string asm, list<dag> pattern>
287 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
288 opc, asm, "", pattern>;
289class AsI<dag oops, dag iops, Format f, InstrItinClass itin,
290 string opc, string asm, list<dag> pattern>
291 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
292 opc, asm, "", pattern>;
293class AXI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000294 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000295 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng97f48c32008-11-06 22:15:19 +0000296 asm, "", pattern>;
Jim Grosbachf6b28622009-12-14 18:31:20 +0000297class AInoP<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +0000298 string opc, string asm, list<dag> pattern>
Jim Grosbachf6b28622009-12-14 18:31:20 +0000299 : InoP<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
Bob Wilson01135592010-03-23 17:23:59 +0000300 opc, asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000301
302// Ctrl flow instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000303class ABI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
304 string opc, string asm, list<dag> pattern>
305 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
306 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000307 let Inst{27-24} = opcod;
Evan Cheng3aac7882008-09-01 08:25:56 +0000308}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000309class ABXI<bits<4> opcod, dag oops, dag iops, InstrItinClass itin,
310 string asm, list<dag> pattern>
311 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, itin,
312 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 ABXIx2<dag oops, dag iops, InstrItinClass itin,
316 string asm, list<dag> pattern>
Xerxes Ranby99ccffe2010-07-22 17:28:34 +0000317 : XI<oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, Pseudo, itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000318 asm, "", pattern>;
Evan Cheng3aac7882008-09-01 08:25:56 +0000319
320// BR_JT instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000321class JTI<dag oops, dag iops, InstrItinClass itin,
322 string asm, list<dag> pattern>
323 : XI<oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BrMiscFrm, itin,
Evan Cheng4df60f52008-11-07 09:06:08 +0000324 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000325
Jim Grosbach5278eb82009-12-11 01:42:04 +0000326
327// Atomic load/store instructions
328
329class AIldrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
330 string opc, string asm, list<dag> pattern>
331 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
332 opc, asm, "", pattern> {
333 let Inst{27-23} = 0b00011;
334 let Inst{22-21} = opcod;
335 let Inst{20} = 1;
336 let Inst{11-0} = 0b111110011111;
337}
338class AIstrex<bits<2> opcod, dag oops, dag iops, InstrItinClass itin,
339 string opc, string asm, list<dag> pattern>
340 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, LdStExFrm, itin,
341 opc, asm, "", pattern> {
342 let Inst{27-23} = 0b00011;
343 let Inst{22-21} = opcod;
344 let Inst{20} = 0;
Johnny Chen0291d7e2009-12-11 19:37:26 +0000345 let Inst{11-4} = 0b11111001;
Jim Grosbach5278eb82009-12-11 01:42:04 +0000346}
347
Evan Cheng0d14fc82008-09-01 01:51:14 +0000348// addrmode1 instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000349class AI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
350 string opc, string asm, list<dag> pattern>
351 : I<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
352 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000353 let Inst{24-21} = opcod;
354 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000355}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000356class AsI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
357 string opc, string asm, list<dag> pattern>
358 : sI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
359 opc, asm, "", pattern> {
360 let Inst{24-21} = opcod;
361 let Inst{27-26} = {0,0};
362}
363class AXI1<bits<4> opcod, dag oops, dag iops, Format f, InstrItinClass itin,
Evan Cheng37f25d92008-08-28 23:39:26 +0000364 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000365 : XI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng612b79e2008-08-29 07:40:52 +0000366 asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000367 let Inst{24-21} = opcod;
368 let Inst{27-26} = {0,0};
Evan Cheng612b79e2008-08-29 07:40:52 +0000369}
Bob Wilson01135592010-03-23 17:23:59 +0000370class AI1x2<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000371 string opc, string asm, list<dag> pattern>
372 : I<oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, itin,
373 opc, asm, "", pattern>;
Evan Cheng17222df2008-08-31 19:02:21 +0000374
Evan Cheng0d14fc82008-09-01 01:51:14 +0000375
376// addrmode2 loads and stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000377class AI2<dag oops, dag iops, Format f, InstrItinClass itin,
378 string opc, string asm, list<dag> pattern>
379 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
380 opc, asm, "", pattern> {
Jim Grosbach26421962008-10-14 20:36:24 +0000381 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000382}
Evan Cheng93912732008-09-01 01:27:33 +0000383
384// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000385class AI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
386 string opc, string asm, list<dag> pattern>
387 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
388 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000389 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000390 let Inst{21} = 0; // W bit
391 let Inst{22} = 0; // B bit
392 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000393 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000394}
Bob Wilson01135592010-03-23 17:23:59 +0000395class AXI2ldw<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000396 string asm, list<dag> pattern>
397 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000398 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000399 let Inst{20} = 1; // L bit
400 let Inst{21} = 0; // W bit
401 let Inst{22} = 0; // B bit
402 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000403 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000404}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000405class AI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
406 string opc, string asm, list<dag> pattern>
407 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
408 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000409 let Inst{20} = 1; // L bit
Evan Cheng17222df2008-08-31 19:02:21 +0000410 let Inst{21} = 0; // W bit
411 let Inst{22} = 1; // B bit
412 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000413 let Inst{27-26} = {0,1};
Evan Cheng17222df2008-08-31 19:02:21 +0000414}
Bob Wilson01135592010-03-23 17:23:59 +0000415class AXI2ldb<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000416 string asm, list<dag> pattern>
417 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000418 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000419 let Inst{20} = 1; // L bit
420 let Inst{21} = 0; // W bit
421 let Inst{22} = 1; // B bit
422 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000423 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000424}
Evan Cheng17222df2008-08-31 19:02:21 +0000425
Evan Cheng93912732008-09-01 01:27:33 +0000426// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000427class AI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
428 string opc, string asm, list<dag> pattern>
429 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
430 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000431 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000432 let Inst{21} = 0; // W bit
433 let Inst{22} = 0; // B bit
434 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000435 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000436}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000437class AXI2stw<dag oops, dag iops, Format f, InstrItinClass itin,
438 string asm, list<dag> pattern>
439 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000440 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000441 let Inst{20} = 0; // L bit
442 let Inst{21} = 0; // W bit
443 let Inst{22} = 0; // B bit
444 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000445 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000446}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000447class AI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
448 string opc, string asm, list<dag> pattern>
449 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
450 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000451 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000452 let Inst{21} = 0; // W bit
453 let Inst{22} = 1; // B bit
454 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000455 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000456}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000457class AXI2stb<dag oops, dag iops, Format f, InstrItinClass itin,
458 string asm, list<dag> pattern>
459 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000460 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000461 let Inst{20} = 0; // L bit
462 let Inst{21} = 0; // W bit
463 let Inst{22} = 1; // B bit
464 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000465 let Inst{27-26} = {0,1};
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000466}
Evan Cheng93912732008-09-01 01:27:33 +0000467
Evan Cheng840917b2008-09-01 07:00:14 +0000468// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000469class AI2ldwpr<dag oops, dag iops, Format f, InstrItinClass itin,
470 string opc, string asm, string cstr, list<dag> pattern>
471 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
472 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000473 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000474 let Inst{21} = 1; // W bit
475 let Inst{22} = 0; // B bit
476 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000477 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000478}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000479class AI2ldbpr<dag oops, dag iops, Format f, InstrItinClass itin,
480 string opc, string asm, string cstr, list<dag> pattern>
481 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
482 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000483 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000484 let Inst{21} = 1; // W bit
485 let Inst{22} = 1; // B bit
486 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000487 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000488}
489
Evan Cheng840917b2008-09-01 07:00:14 +0000490// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000491class AI2stwpr<dag oops, dag iops, Format f, InstrItinClass itin,
492 string opc, string asm, string cstr, list<dag> pattern>
493 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
494 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000495 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000496 let Inst{21} = 1; // W bit
497 let Inst{22} = 0; // B bit
498 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000499 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000500}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000501class AI2stbpr<dag oops, dag iops, Format f, InstrItinClass itin,
502 string opc, string asm, string cstr, list<dag> pattern>
503 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, itin,
504 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000505 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000506 let Inst{21} = 1; // W bit
507 let Inst{22} = 1; // B bit
508 let Inst{24} = 1; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000509 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000510}
511
Evan Cheng840917b2008-09-01 07:00:14 +0000512// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000513class AI2ldwpo<dag oops, dag iops, Format f, InstrItinClass itin,
514 string opc, string asm, string cstr, list<dag> pattern>
515 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
516 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000517 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000518 let Inst{21} = 0; // W bit
519 let Inst{22} = 0; // B bit
520 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000521 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000522}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000523class AI2ldbpo<dag oops, dag iops, Format f, InstrItinClass itin,
524 string opc, string asm, string cstr, list<dag> pattern>
525 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
526 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000527 let Inst{20} = 1; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000528 let Inst{21} = 0; // W bit
529 let Inst{22} = 1; // B bit
530 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000531 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000532}
533
Evan Cheng840917b2008-09-01 07:00:14 +0000534// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000535class AI2stwpo<dag oops, dag iops, Format f, InstrItinClass itin,
536 string opc, string asm, string cstr, list<dag> pattern>
537 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
538 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000539 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000540 let Inst{21} = 0; // W bit
541 let Inst{22} = 0; // B bit
542 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000543 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000544}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000545class AI2stbpo<dag oops, dag iops, Format f, InstrItinClass itin,
546 string opc, string asm, string cstr, list<dag> pattern>
547 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, itin,
548 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000549 let Inst{20} = 0; // L bit
Evan Cheng93912732008-09-01 01:27:33 +0000550 let Inst{21} = 0; // W bit
551 let Inst{22} = 1; // B bit
552 let Inst{24} = 0; // P bit
Evan Cheng83b5cf02008-11-05 23:22:34 +0000553 let Inst{27-26} = {0,1};
Evan Cheng93912732008-09-01 01:27:33 +0000554}
555
Evan Cheng0d14fc82008-09-01 01:51:14 +0000556// addrmode3 instructions
Bob Wilson01135592010-03-23 17:23:59 +0000557class AI3<dag oops, dag iops, Format f, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000558 string opc, string asm, list<dag> pattern>
559 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
560 opc, asm, "", pattern>;
561class AXI3<dag oops, dag iops, Format f, InstrItinClass itin,
562 string asm, list<dag> pattern>
563 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
564 asm, "", pattern>;
Evan Cheng0d14fc82008-09-01 01:51:14 +0000565
Evan Cheng840917b2008-09-01 07:00:14 +0000566// loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000567class AI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
568 string opc, string asm, list<dag> pattern>
569 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
570 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000571 let Inst{4} = 1;
572 let Inst{5} = 1; // H bit
573 let Inst{6} = 0; // S bit
574 let Inst{7} = 1;
575 let Inst{20} = 1; // L bit
576 let Inst{21} = 0; // W bit
577 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000578 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000579}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000580class AXI3ldh<dag oops, dag iops, Format f, InstrItinClass itin,
581 string asm, list<dag> pattern>
582 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000583 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000584 let Inst{4} = 1;
585 let Inst{5} = 1; // H bit
586 let Inst{6} = 0; // S bit
587 let Inst{7} = 1;
588 let Inst{20} = 1; // L bit
589 let Inst{21} = 0; // W bit
590 let Inst{24} = 1; // P bit
591}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000592class AI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
593 string opc, string asm, list<dag> pattern>
594 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
595 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000596 let Inst{4} = 1;
597 let Inst{5} = 1; // H bit
598 let Inst{6} = 1; // S bit
599 let Inst{7} = 1;
600 let Inst{20} = 1; // L bit
601 let Inst{21} = 0; // W bit
602 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000603 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000604}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000605class AXI3ldsh<dag oops, dag iops, Format f, InstrItinClass itin,
606 string asm, list<dag> pattern>
607 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000608 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000609 let Inst{4} = 1;
610 let Inst{5} = 1; // H bit
611 let Inst{6} = 1; // S bit
612 let Inst{7} = 1;
613 let Inst{20} = 1; // L bit
614 let Inst{21} = 0; // W bit
615 let Inst{24} = 1; // P bit
616}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000617class AI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
618 string opc, string asm, list<dag> pattern>
619 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
620 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000621 let Inst{4} = 1;
622 let Inst{5} = 0; // H bit
623 let Inst{6} = 1; // S bit
624 let Inst{7} = 1;
625 let Inst{20} = 1; // L bit
626 let Inst{21} = 0; // W bit
627 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000628 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000629}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000630class AXI3ldsb<dag oops, dag iops, Format f, InstrItinClass itin,
631 string asm, list<dag> pattern>
632 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000633 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000634 let Inst{4} = 1;
635 let Inst{5} = 0; // H bit
636 let Inst{6} = 1; // S bit
637 let Inst{7} = 1;
638 let Inst{20} = 1; // L bit
639 let Inst{21} = 0; // W bit
640 let Inst{24} = 1; // P bit
641}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000642class AI3ldd<dag oops, dag iops, Format f, InstrItinClass itin,
643 string opc, string asm, list<dag> pattern>
644 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
645 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000646 let Inst{4} = 1;
647 let Inst{5} = 0; // H bit
648 let Inst{6} = 1; // S bit
649 let Inst{7} = 1;
650 let Inst{20} = 0; // L bit
651 let Inst{21} = 0; // W bit
652 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000653 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000654}
655
656// stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000657class AI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
658 string opc, string asm, list<dag> pattern>
659 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
660 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000661 let Inst{4} = 1;
662 let Inst{5} = 1; // H bit
663 let Inst{6} = 0; // S bit
664 let Inst{7} = 1;
665 let Inst{20} = 0; // L bit
666 let Inst{21} = 0; // W bit
667 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000668 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000669}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000670class AXI3sth<dag oops, dag iops, Format f, InstrItinClass itin,
671 string asm, list<dag> pattern>
672 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
Evan Cheng83b5cf02008-11-05 23:22:34 +0000673 asm, "", pattern> {
Evan Cheng5d2c1cf2008-09-01 07:34:13 +0000674 let Inst{4} = 1;
675 let Inst{5} = 1; // H bit
676 let Inst{6} = 0; // S bit
677 let Inst{7} = 1;
678 let Inst{20} = 0; // L bit
679 let Inst{21} = 0; // W bit
680 let Inst{24} = 1; // P bit
681}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000682class AI3std<dag oops, dag iops, Format f, InstrItinClass itin,
683 string opc, string asm, list<dag> pattern>
684 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, itin,
685 opc, asm, "", pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000686 let Inst{4} = 1;
687 let Inst{5} = 1; // H bit
688 let Inst{6} = 1; // S bit
689 let Inst{7} = 1;
690 let Inst{20} = 0; // L bit
691 let Inst{21} = 0; // W bit
692 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000693 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000694}
695
696// Pre-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000697class AI3ldhpr<dag oops, dag iops, Format f, InstrItinClass itin,
698 string opc, string asm, string cstr, list<dag> pattern>
699 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
700 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000701 let Inst{4} = 1;
702 let Inst{5} = 1; // H bit
703 let Inst{6} = 0; // S bit
704 let Inst{7} = 1;
705 let Inst{20} = 1; // L bit
706 let Inst{21} = 1; // W bit
707 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000708 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000709}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000710class AI3ldshpr<dag oops, dag iops, Format f, InstrItinClass itin,
711 string opc, string asm, string cstr, list<dag> pattern>
712 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
713 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000714 let Inst{4} = 1;
715 let Inst{5} = 1; // H bit
716 let Inst{6} = 1; // S bit
717 let Inst{7} = 1;
718 let Inst{20} = 1; // L bit
719 let Inst{21} = 1; // W bit
720 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000721 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000722}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000723class AI3ldsbpr<dag oops, dag iops, Format f, InstrItinClass itin,
724 string opc, string asm, string cstr, list<dag> pattern>
725 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
726 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000727 let Inst{4} = 1;
728 let Inst{5} = 0; // H bit
729 let Inst{6} = 1; // S bit
730 let Inst{7} = 1;
731 let Inst{20} = 1; // L bit
732 let Inst{21} = 1; // W bit
733 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000734 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000735}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000736class AI3lddpr<dag oops, dag iops, Format f, InstrItinClass itin,
737 string opc, string asm, string cstr, list<dag> pattern>
738 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
739 opc, asm, cstr, pattern> {
740 let Inst{4} = 1;
741 let Inst{5} = 0; // H bit
742 let Inst{6} = 1; // S bit
743 let Inst{7} = 1;
744 let Inst{20} = 0; // L bit
745 let Inst{21} = 1; // W bit
746 let Inst{24} = 1; // P bit
747 let Inst{27-25} = 0b000;
748}
749
Evan Cheng840917b2008-09-01 07:00:14 +0000750
751// Pre-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000752class AI3sthpr<dag oops, dag iops, Format f, InstrItinClass itin,
753 string opc, string asm, string cstr, list<dag> pattern>
754 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
755 opc, asm, cstr, pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000756 let Inst{4} = 1;
757 let Inst{5} = 1; // H bit
758 let Inst{6} = 0; // S bit
759 let Inst{7} = 1;
760 let Inst{20} = 0; // L bit
761 let Inst{21} = 1; // W bit
762 let Inst{24} = 1; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000763 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000764}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000765class AI3stdpr<dag oops, dag iops, Format f, InstrItinClass itin,
766 string opc, string asm, string cstr, list<dag> pattern>
767 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, itin,
768 opc, asm, cstr, pattern> {
769 let Inst{4} = 1;
770 let Inst{5} = 1; // H bit
771 let Inst{6} = 1; // S bit
772 let Inst{7} = 1;
773 let Inst{20} = 0; // L bit
774 let Inst{21} = 1; // W bit
775 let Inst{24} = 1; // P bit
776 let Inst{27-25} = 0b000;
777}
Evan Cheng840917b2008-09-01 07:00:14 +0000778
779// Post-indexed loads
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000780class AI3ldhpo<dag oops, dag iops, Format f, InstrItinClass itin,
781 string opc, string asm, string cstr, list<dag> pattern>
782 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
783 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000784 let Inst{4} = 1;
785 let Inst{5} = 1; // H bit
786 let Inst{6} = 0; // S bit
787 let Inst{7} = 1;
788 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000789 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000790 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000791 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000792}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000793class AI3ldshpo<dag oops, dag iops, Format f, InstrItinClass itin,
794 string opc, string asm, string cstr, list<dag> pattern>
795 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
796 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000797 let Inst{4} = 1;
798 let Inst{5} = 1; // H bit
799 let Inst{6} = 1; // S bit
800 let Inst{7} = 1;
801 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000802 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000803 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000804 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000805}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000806class AI3ldsbpo<dag oops, dag iops, Format f, InstrItinClass itin,
807 string opc, string asm, string cstr, list<dag> pattern>
808 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
809 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000810 let Inst{4} = 1;
811 let Inst{5} = 0; // H bit
812 let Inst{6} = 1; // S bit
813 let Inst{7} = 1;
814 let Inst{20} = 1; // L bit
Johnny Chenadb561d2010-02-18 03:27:42 +0000815 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000816 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000817 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000818}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000819class AI3lddpo<dag oops, dag iops, Format f, InstrItinClass itin,
820 string opc, string asm, string cstr, list<dag> pattern>
821 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
822 opc, asm, cstr, pattern> {
823 let Inst{4} = 1;
824 let Inst{5} = 0; // H bit
825 let Inst{6} = 1; // S bit
826 let Inst{7} = 1;
827 let Inst{20} = 0; // L bit
828 let Inst{21} = 0; // W bit
829 let Inst{24} = 0; // P bit
830 let Inst{27-25} = 0b000;
831}
Evan Cheng840917b2008-09-01 07:00:14 +0000832
833// Post-indexed stores
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000834class AI3sthpo<dag oops, dag iops, Format f, InstrItinClass itin,
835 string opc, string asm, string cstr, list<dag> pattern>
836 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
837 opc, asm, cstr,pattern> {
Evan Cheng840917b2008-09-01 07:00:14 +0000838 let Inst{4} = 1;
839 let Inst{5} = 1; // H bit
840 let Inst{6} = 0; // S bit
841 let Inst{7} = 1;
842 let Inst{20} = 0; // L bit
Johnny Chenad4df4c2010-03-01 19:22:00 +0000843 let Inst{21} = 0; // W bit
Evan Cheng840917b2008-09-01 07:00:14 +0000844 let Inst{24} = 0; // P bit
Evan Chengdda0f4c2009-07-08 22:51:32 +0000845 let Inst{27-25} = 0b000;
Evan Cheng840917b2008-09-01 07:00:14 +0000846}
Johnny Chen39a4bb32010-02-18 22:31:18 +0000847class AI3stdpo<dag oops, dag iops, Format f, InstrItinClass itin,
848 string opc, string asm, string cstr, list<dag> pattern>
849 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, itin,
850 opc, asm, cstr, pattern> {
851 let Inst{4} = 1;
852 let Inst{5} = 1; // H bit
853 let Inst{6} = 1; // S bit
854 let Inst{7} = 1;
855 let Inst{20} = 0; // L bit
856 let Inst{21} = 0; // W bit
857 let Inst{24} = 0; // P bit
858 let Inst{27-25} = 0b000;
859}
Evan Cheng840917b2008-09-01 07:00:14 +0000860
Evan Cheng0d14fc82008-09-01 01:51:14 +0000861// addrmode4 instructions
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000862class AXI4ld<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000863 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000864 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000865 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000866 let Inst{20} = 1; // L bit
867 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000868 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000869}
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000870class AXI4st<dag oops, dag iops, IndexMode im, Format f, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000871 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +0000872 : XI<oops, iops, AddrMode4, Size4Bytes, im, f, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +0000873 asm, cstr, pattern> {
Evan Cheng3c2ee492008-09-01 07:48:18 +0000874 let Inst{20} = 0; // L bit
875 let Inst{22} = 0; // S bit
Jim Grosbach26421962008-10-14 20:36:24 +0000876 let Inst{27-25} = 0b100;
Evan Cheng3c2ee492008-09-01 07:48:18 +0000877}
Evan Cheng37f25d92008-08-28 23:39:26 +0000878
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000879// Unsigned multiply, multiply-accumulate instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000880class AMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
881 string opc, string asm, list<dag> pattern>
882 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
883 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000884 let Inst{7-4} = 0b1001;
Evan Chengfbc9d412008-11-06 01:21:28 +0000885 let Inst{20} = 0; // S bit
Evan Chengd87293c2008-11-06 08:47:38 +0000886 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000887}
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000888class AsMul1I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
889 string opc, string asm, list<dag> pattern>
890 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
891 opc, asm, "", pattern> {
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000892 let Inst{7-4} = 0b1001;
Evan Chengd87293c2008-11-06 08:47:38 +0000893 let Inst{27-21} = opcod;
Evan Chengfbc9d412008-11-06 01:21:28 +0000894}
895
896// Most significant word multiply
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000897class AMul2I<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
898 string opc, string asm, list<dag> pattern>
899 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
900 opc, asm, "", pattern> {
Evan Chengfbc9d412008-11-06 01:21:28 +0000901 let Inst{7-4} = 0b1001;
902 let Inst{20} = 1;
Evan Chengd87293c2008-11-06 08:47:38 +0000903 let Inst{27-21} = opcod;
Jim Grosbach0a4b9dc2008-11-03 18:38:31 +0000904}
Evan Cheng37f25d92008-08-28 23:39:26 +0000905
Evan Chengeb4f52e2008-11-06 03:35:07 +0000906// SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000907class AMulxyI<bits<7> opcod, dag oops, dag iops, InstrItinClass itin,
908 string opc, string asm, list<dag> pattern>
909 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, itin,
910 opc, asm, "", pattern> {
Evan Chengeb4f52e2008-11-06 03:35:07 +0000911 let Inst{4} = 0;
912 let Inst{7} = 1;
913 let Inst{20} = 0;
Evan Chengd87293c2008-11-06 08:47:38 +0000914 let Inst{27-21} = opcod;
Evan Chengeb4f52e2008-11-06 03:35:07 +0000915}
916
Evan Cheng97f48c32008-11-06 22:15:19 +0000917// Extend instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000918class AExtI<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
919 string opc, string asm, list<dag> pattern>
920 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ExtFrm, itin,
921 opc, asm, "", pattern> {
Evan Cheng97f48c32008-11-06 22:15:19 +0000922 let Inst{7-4} = 0b0111;
923 let Inst{27-20} = opcod;
924}
925
Evan Cheng8b59db32008-11-07 01:41:35 +0000926// Misc Arithmetic instructions.
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000927class AMiscA1I<bits<8> opcod, dag oops, dag iops, InstrItinClass itin,
928 string opc, string asm, list<dag> pattern>
929 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ArithMiscFrm, itin,
930 opc, asm, "", pattern> {
Evan Cheng8b59db32008-11-07 01:41:35 +0000931 let Inst{27-20} = opcod;
932}
933
Evan Cheng37f25d92008-08-28 23:39:26 +0000934//===----------------------------------------------------------------------===//
935
936// ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
937class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
938 list<Predicate> Predicates = [IsARM];
939}
940class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
941 list<Predicate> Predicates = [IsARM, HasV5TE];
942}
943class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
944 list<Predicate> Predicates = [IsARM, HasV6];
945}
Evan Cheng13096642008-08-29 06:41:12 +0000946
947//===----------------------------------------------------------------------===//
948//
949// Thumb Instruction Format Definitions.
950//
951
Evan Cheng13096642008-08-29 06:41:12 +0000952// TI - Thumb instruction.
953
Evan Cheng446c4282009-07-11 06:43:01 +0000954class ThumbI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000955 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000956 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000957 let OutOperandList = oops;
958 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +0000959 let AsmString = asm;
Evan Cheng13096642008-08-29 06:41:12 +0000960 let Pattern = pattern;
961 list<Predicate> Predicates = [IsThumb];
962}
963
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000964class TI<dag oops, dag iops, InstrItinClass itin, string asm, list<dag> pattern>
965 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000966
Evan Cheng35d6c412009-08-04 23:47:55 +0000967// Two-address instructions
Bob Wilson01135592010-03-23 17:23:59 +0000968class TIt<dag oops, dag iops, InstrItinClass itin, string asm,
969 list<dag> pattern>
970 : ThumbI<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "$lhs = $dst",
971 pattern>;
Evan Cheng35d6c412009-08-04 23:47:55 +0000972
Johnny Chend68e1192009-12-15 17:24:14 +0000973// tBL, tBX 32-bit instructions
974class TIx2<bits<5> opcod1, bits<2> opcod2, bit opcod3,
Bob Wilson01135592010-03-23 17:23:59 +0000975 dag oops, dag iops, InstrItinClass itin, string asm,
976 list<dag> pattern>
977 : ThumbI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>,
978 Encoding {
Johnny Chend68e1192009-12-15 17:24:14 +0000979 let Inst{31-27} = opcod1;
980 let Inst{15-14} = opcod2;
981 let Inst{12} = opcod3;
982}
Evan Cheng13096642008-08-29 06:41:12 +0000983
984// BR_JT instructions
Bob Wilson01135592010-03-23 17:23:59 +0000985class TJTI<dag oops, dag iops, InstrItinClass itin, string asm,
986 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000987 : ThumbI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng13096642008-08-29 06:41:12 +0000988
Evan Cheng09c39fc2009-06-23 19:38:13 +0000989// Thumb1 only
Evan Cheng446c4282009-07-11 06:43:01 +0000990class Thumb1I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +0000991 InstrItinClass itin, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +0000992 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +0000993 let OutOperandList = oops;
994 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +0000995 let AsmString = asm;
Evan Cheng09c39fc2009-06-23 19:38:13 +0000996 let Pattern = pattern;
997 list<Predicate> Predicates = [IsThumb1Only];
998}
999
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001000class T1I<dag oops, dag iops, InstrItinClass itin,
1001 string asm, list<dag> pattern>
1002 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin, asm, "", pattern>;
1003class T1Ix2<dag oops, dag iops, InstrItinClass itin,
1004 string asm, list<dag> pattern>
1005 : Thumb1I<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1006class T1JTI<dag oops, dag iops, InstrItinClass itin,
1007 string asm, list<dag> pattern>
Johnny Chenbbc71b22009-12-16 02:32:54 +00001008 : Thumb1I<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001009
1010// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001011class T1It<dag oops, dag iops, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001012 string asm, string cstr, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001013 : Thumb1I<oops, iops, AddrModeNone, Size2Bytes, itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001014 asm, cstr, pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001015
1016// Thumb1 instruction that can either be predicated or set CPSR.
1017class Thumb1sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001018 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001019 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001020 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Chris Lattnerb7d52262010-03-18 21:06:54 +00001021 let OutOperandList = !con(oops, (outs s_cc_out:$s));
1022 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001023 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
1024 let Pattern = pattern;
1025 list<Predicate> Predicates = [IsThumb1Only];
1026}
1027
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001028class T1sI<dag oops, dag iops, InstrItinClass itin,
1029 string opc, string asm, list<dag> pattern>
1030 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001031
1032// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001033class T1sIt<dag oops, dag iops, InstrItinClass itin,
1034 string opc, string asm, list<dag> pattern>
1035 : Thumb1sI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001036 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001037
1038// Thumb1 instruction that can be predicated.
1039class Thumb1pI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001040 InstrItinClass itin,
Evan Cheng446c4282009-07-11 06:43:01 +00001041 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001042 : InstThumb<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng446c4282009-07-11 06:43:01 +00001043 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001044 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng446c4282009-07-11 06:43:01 +00001045 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1046 let Pattern = pattern;
1047 list<Predicate> Predicates = [IsThumb1Only];
1048}
1049
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001050class T1pI<dag oops, dag iops, InstrItinClass itin,
1051 string opc, string asm, list<dag> pattern>
1052 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001053
1054// Two-address instructions
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001055class T1pIt<dag oops, dag iops, InstrItinClass itin,
1056 string opc, string asm, list<dag> pattern>
1057 : Thumb1pI<oops, iops, AddrModeNone, Size2Bytes, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001058 "$lhs = $dst", pattern>;
Evan Cheng446c4282009-07-11 06:43:01 +00001059
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001060class T1pI1<dag oops, dag iops, InstrItinClass itin,
1061 string opc, string asm, list<dag> pattern>
1062 : Thumb1pI<oops, iops, AddrModeT1_1, Size2Bytes, itin, opc, asm, "", pattern>;
1063class T1pI2<dag oops, dag iops, InstrItinClass itin,
1064 string opc, string asm, list<dag> pattern>
1065 : Thumb1pI<oops, iops, AddrModeT1_2, Size2Bytes, itin, opc, asm, "", pattern>;
1066class T1pI4<dag oops, dag iops, InstrItinClass itin,
1067 string opc, string asm, list<dag> pattern>
1068 : Thumb1pI<oops, iops, AddrModeT1_4, Size2Bytes, itin, opc, asm, "", pattern>;
Bob Wilson01135592010-03-23 17:23:59 +00001069class T1pIs<dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001070 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1071 : Thumb1pI<oops, iops, AddrModeT1_s, Size2Bytes, itin, opc, asm, "", pattern>;
Evan Cheng09c39fc2009-06-23 19:38:13 +00001072
Johnny Chenbbc71b22009-12-16 02:32:54 +00001073class Encoding16 : Encoding {
1074 let Inst{31-16} = 0x0000;
1075}
1076
Johnny Chend68e1192009-12-15 17:24:14 +00001077// A6.2 16-bit Thumb instruction encoding
Johnny Chenbbc71b22009-12-16 02:32:54 +00001078class T1Encoding<bits<6> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001079 let Inst{15-10} = opcode;
1080}
1081
1082// A6.2.1 Shift (immediate), add, subtract, move, and compare encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001083class T1General<bits<5> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001084 let Inst{15-14} = 0b00;
1085 let Inst{13-9} = opcode;
1086}
1087
1088// A6.2.2 Data-processing encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001089class T1DataProcessing<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001090 let Inst{15-10} = 0b010000;
1091 let Inst{9-6} = opcode;
1092}
1093
1094// A6.2.3 Special data instructions and branch and exchange encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001095class T1Special<bits<4> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001096 let Inst{15-10} = 0b010001;
1097 let Inst{9-6} = opcode;
1098}
1099
1100// A6.2.4 Load/store single data item encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001101class T1LoadStore<bits<4> opA, bits<3> opB> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001102 let Inst{15-12} = opA;
1103 let Inst{11-9} = opB;
1104}
1105class T1LdSt<bits<3> opB> : T1LoadStore<0b0101, opB>;
1106class T1LdSt4Imm<bits<3> opB> : T1LoadStore<0b0110, opB>; // Immediate, 4 bytes
1107class T1LdSt1Imm<bits<3> opB> : T1LoadStore<0b0111, opB>; // Immediate, 1 byte
1108class T1LdSt2Imm<bits<3> opB> : T1LoadStore<0b1000, opB>; // Immediate, 2 bytes
1109class T1LdStSP<bits<3> opB> : T1LoadStore<0b1001, opB>; // SP relative
1110
1111// A6.2.5 Miscellaneous 16-bit instructions encoding.
Johnny Chenbbc71b22009-12-16 02:32:54 +00001112class T1Misc<bits<7> opcode> : Encoding16 {
Johnny Chend68e1192009-12-15 17:24:14 +00001113 let Inst{15-12} = 0b1011;
1114 let Inst{11-5} = opcode;
1115}
1116
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001117// Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
1118class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001119 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001120 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001121 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001122 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001123 let InOperandList = !con(iops, (ins pred:$p));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001124 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1125 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001126 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001127}
1128
1129// Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as
1130// an input operand since by default it's a zero register. It will
1131// become an implicit def once it's "flipped".
1132// FIXME: This uses unified syntax so {s} comes before {p}. We should make it
1133// more consistent.
1134class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001135 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001136 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001137 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001138 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001139 let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
Bob Wilsond3038462010-05-24 20:08:34 +00001140 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001141 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001142 list<Predicate> Predicates = [IsThumb2];
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001143}
1144
1145// Special cases
1146class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001147 InstrItinClass itin,
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001148 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001149 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001150 let OutOperandList = oops;
1151 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +00001152 let AsmString = asm;
Evan Chengf49810c2009-06-23 17:48:47 +00001153 let Pattern = pattern;
Evan Chengd770d9e2009-07-02 06:38:40 +00001154 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001155}
1156
Jim Grosbachd1228742009-12-01 18:10:36 +00001157class ThumbXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Bob Wilson01135592010-03-23 17:23:59 +00001158 InstrItinClass itin,
1159 string asm, string cstr, list<dag> pattern>
Jim Grosbachd1228742009-12-01 18:10:36 +00001160 : InstARM<am, sz, IndexModeNone, ThumbFrm, GenericDomain, cstr, itin> {
1161 let OutOperandList = oops;
1162 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +00001163 let AsmString = asm;
Jim Grosbachd1228742009-12-01 18:10:36 +00001164 let Pattern = pattern;
1165 list<Predicate> Predicates = [IsThumb1Only];
1166}
1167
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001168class T2I<dag oops, dag iops, InstrItinClass itin,
1169 string opc, string asm, list<dag> pattern>
1170 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
1171class T2Ii12<dag oops, dag iops, InstrItinClass itin,
1172 string opc, string asm, list<dag> pattern>
Bob Wilson01135592010-03-23 17:23:59 +00001173 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, itin, opc, asm, "",pattern>;
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001174class T2Ii8<dag oops, dag iops, InstrItinClass itin,
1175 string opc, string asm, list<dag> pattern>
1176 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, itin, opc, asm, "", pattern>;
1177class T2Iso<dag oops, dag iops, InstrItinClass itin,
1178 string opc, string asm, list<dag> pattern>
1179 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, itin, opc, asm, "", pattern>;
1180class T2Ipc<dag oops, dag iops, InstrItinClass itin,
1181 string opc, string asm, list<dag> pattern>
1182 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, itin, opc, asm, "", pattern>;
Johnny Chend68e1192009-12-15 17:24:14 +00001183class T2Ii8s4<bit P, bit W, bit load, dag oops, dag iops, InstrItinClass itin,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001184 string opc, string asm, list<dag> pattern>
Johnny Chend68e1192009-12-15 17:24:14 +00001185 : Thumb2I<oops, iops, AddrModeT2_i8s4, Size4Bytes, itin, opc, asm, "",
1186 pattern> {
1187 let Inst{31-27} = 0b11101;
1188 let Inst{26-25} = 0b00;
1189 let Inst{24} = P;
1190 let Inst{23} = ?; // The U bit.
1191 let Inst{22} = 1;
1192 let Inst{21} = W;
1193 let Inst{20} = load;
1194}
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001195
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001196class T2sI<dag oops, dag iops, InstrItinClass itin,
1197 string opc, string asm, list<dag> pattern>
1198 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, itin, opc, asm, "", pattern>;
Evan Cheng0aa1d8c2009-06-25 02:08:06 +00001199
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001200class T2XI<dag oops, dag iops, InstrItinClass itin,
1201 string asm, list<dag> pattern>
1202 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, "", pattern>;
1203class T2JTI<dag oops, dag iops, InstrItinClass itin,
1204 string asm, list<dag> pattern>
1205 : Thumb2XI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
Evan Chengf49810c2009-06-23 17:48:47 +00001206
Evan Cheng5adb66a2009-09-28 09:14:39 +00001207class T2Ix2<dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001208 string opc, string asm, list<dag> pattern>
Evan Cheng5adb66a2009-09-28 09:14:39 +00001209 : Thumb2I<oops, iops, AddrModeNone, Size8Bytes, itin, opc, asm, "", pattern>;
1210
Bob Wilson815baeb2010-03-13 01:08:20 +00001211// Two-address instructions
1212class T2XIt<dag oops, dag iops, InstrItinClass itin,
1213 string asm, string cstr, list<dag> pattern>
1214 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, itin, asm, cstr, pattern>;
Evan Cheng5adb66a2009-09-28 09:14:39 +00001215
Evan Chenge88d5ce2009-07-02 07:28:31 +00001216// T2Iidxldst - Thumb2 indexed load / store instructions.
Johnny Chend68e1192009-12-15 17:24:14 +00001217class T2Iidxldst<bit signed, bits<2> opcod, bit load, bit pre,
1218 dag oops, dag iops,
1219 AddrMode am, IndexMode im, InstrItinClass itin,
Evan Chenge88d5ce2009-07-02 07:28:31 +00001220 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001221 : InstARM<am, Size4Bytes, im, ThumbFrm, GenericDomain, cstr, itin> {
Evan Chenge88d5ce2009-07-02 07:28:31 +00001222 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001223 let InOperandList = !con(iops, (ins pred:$p));
Evan Chenge88d5ce2009-07-02 07:28:31 +00001224 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
1225 let Pattern = pattern;
1226 list<Predicate> Predicates = [IsThumb2];
Johnny Chend68e1192009-12-15 17:24:14 +00001227 let Inst{31-27} = 0b11111;
1228 let Inst{26-25} = 0b00;
1229 let Inst{24} = signed;
1230 let Inst{23} = 0;
1231 let Inst{22-21} = opcod;
1232 let Inst{20} = load;
1233 let Inst{11} = 1;
1234 // (P, W) = (1, 1) Pre-indexed or (0, 1) Post-indexed
1235 let Inst{10} = pre; // The P bit.
1236 let Inst{8} = 1; // The W bit.
Evan Chenge88d5ce2009-07-02 07:28:31 +00001237}
1238
Johnny Chenadc77332010-02-26 22:04:29 +00001239// Helper class for disassembly only
1240// A6.3.16 & A6.3.17
1241// T2Imac - Thumb2 multiply [accumulate, and absolute difference] instructions.
1242class T2I_mac<bit long, bits<3> op22_20, bits<4> op7_4, dag oops, dag iops,
1243 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1244 : T2I<oops, iops, itin, opc, asm, pattern> {
1245 let Inst{31-27} = 0b11111;
1246 let Inst{26-24} = 0b011;
1247 let Inst{23} = long;
1248 let Inst{22-20} = op22_20;
1249 let Inst{7-4} = op7_4;
1250}
1251
David Goodwinc9d138f2009-07-27 19:59:26 +00001252// Tv5Pat - Same as Pat<>, but requires V5T Thumb mode.
1253class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
1254 list<Predicate> Predicates = [IsThumb1Only, HasV5T];
1255}
1256
1257// T1Pat - Same as Pat<>, but requires that the compiler be in Thumb1 mode.
1258class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
1259 list<Predicate> Predicates = [IsThumb1Only];
1260}
Evan Chenge88d5ce2009-07-02 07:28:31 +00001261
Evan Cheng9cb9e672009-06-27 02:26:13 +00001262// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
1263class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Chengd770d9e2009-07-02 06:38:40 +00001264 list<Predicate> Predicates = [IsThumb2];
Evan Chengf49810c2009-06-23 17:48:47 +00001265}
1266
Evan Cheng13096642008-08-29 06:41:12 +00001267//===----------------------------------------------------------------------===//
1268
Evan Cheng96581d32008-11-11 02:11:05 +00001269//===----------------------------------------------------------------------===//
1270// ARM VFP Instruction templates.
1271//
1272
David Goodwin3ca524e2009-07-10 17:03:29 +00001273// Almost all VFP instructions are predicable.
1274class VFPI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001275 IndexMode im, Format f, InstrItinClass itin,
1276 string opc, string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001277 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001278 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001279 let InOperandList = !con(iops, (ins pred:$p));
Bob Wilsond3038462010-05-24 20:08:34 +00001280 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
David Goodwin3ca524e2009-07-10 17:03:29 +00001281 let Pattern = pattern;
1282 list<Predicate> Predicates = [HasVFP2];
1283}
1284
1285// Special cases
1286class VFPXI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001287 IndexMode im, Format f, InstrItinClass itin,
1288 string asm, string cstr, list<dag> pattern>
Anton Korobeynikovf95215f2009-11-02 00:10:38 +00001289 : InstARM<am, sz, im, f, VFPDomain, cstr, itin> {
David Goodwin3ca524e2009-07-10 17:03:29 +00001290 let OutOperandList = oops;
1291 let InOperandList = iops;
Bob Wilsond3038462010-05-24 20:08:34 +00001292 let AsmString = asm;
David Goodwin3ca524e2009-07-10 17:03:29 +00001293 let Pattern = pattern;
1294 list<Predicate> Predicates = [HasVFP2];
1295}
1296
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001297class VFPAI<dag oops, dag iops, Format f, InstrItinClass itin,
1298 string opc, string asm, list<dag> pattern>
1299 : VFPI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, itin,
1300 opc, asm, "", pattern>;
David Goodwin3ca524e2009-07-10 17:03:29 +00001301
Evan Chengcd8e66a2008-11-11 21:48:44 +00001302// ARM VFP addrmode5 loads and stores
1303class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001304 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001305 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001306 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001307 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001308 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001309 let Inst{27-24} = opcod1;
1310 let Inst{21-20} = opcod2;
1311 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001312
1313 // 64-bit loads & stores operate on both NEON and VFP pipelines.
Jakob Stoklund Olesenfddb7662010-04-05 03:10:20 +00001314 let D = VFPNeonDomain;
Evan Cheng96581d32008-11-11 02:11:05 +00001315}
1316
Evan Chengcd8e66a2008-11-11 21:48:44 +00001317class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001318 InstrItinClass itin,
Evan Chengcd8e66a2008-11-11 21:48:44 +00001319 string opc, string asm, list<dag> pattern>
David Goodwin3ca524e2009-07-10 17:03:29 +00001320 : VFPI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Bob Wilson01135592010-03-23 17:23:59 +00001321 VFPLdStFrm, itin, opc, asm, "", pattern> {
Evan Cheng96581d32008-11-11 02:11:05 +00001322 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengcd8e66a2008-11-11 21:48:44 +00001323 let Inst{27-24} = opcod1;
1324 let Inst{21-20} = opcod2;
1325 let Inst{11-8} = 0b1010;
Evan Cheng96581d32008-11-11 02:11:05 +00001326}
1327
Evan Chengcd8e66a2008-11-11 21:48:44 +00001328// Load / store multiple
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001329class AXDI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001330 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001331 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001332 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001333 // TODO: Mark the instructions with the appropriate subtarget info.
1334 let Inst{27-25} = 0b110;
1335 let Inst{11-8} = 0b1011;
Anton Korobeynikov2e1da9f2009-11-02 00:11:06 +00001336
1337 // 64-bit loads & stores operate on both NEON and VFP pipelines.
Jakob Stoklund Olesenfddb7662010-04-05 03:10:20 +00001338 let D = VFPNeonDomain;
Evan Chengcd8e66a2008-11-11 21:48:44 +00001339}
1340
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001341class AXSI5<dag oops, dag iops, IndexMode im, InstrItinClass itin,
Bob Wilson815baeb2010-03-13 01:08:20 +00001342 string asm, string cstr, list<dag> pattern>
Bob Wilsonbffb5b32010-03-13 07:34:35 +00001343 : VFPXI<oops, iops, AddrMode5, Size4Bytes, im,
Bob Wilson01135592010-03-23 17:23:59 +00001344 VFPLdStMulFrm, itin, asm, cstr, pattern> {
Evan Chengcd8e66a2008-11-11 21:48:44 +00001345 // TODO: Mark the instructions with the appropriate subtarget info.
1346 let Inst{27-25} = 0b110;
1347 let Inst{11-8} = 0b1010;
1348}
1349
Evan Cheng96581d32008-11-11 02:11:05 +00001350// Double precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001351class ADuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1352 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1353 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001354 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001355 let Inst{27-23} = opcod1;
1356 let Inst{21-20} = opcod2;
1357 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001358 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001359 let Inst{7-6} = opcod4;
1360 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001361}
1362
1363// Double precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001364class ADbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001365 dag iops, InstrItinClass itin, string opc, string asm,
1366 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001367 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001368 let Inst{27-23} = opcod1;
1369 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001370 let Inst{11-8} = 0b1011;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001371 let Inst{6} = op6;
1372 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001373}
1374
Jim Grosbach26767372010-03-24 22:31:46 +00001375// Double precision, binary, VML[AS] (for additional predicate)
1376class ADbI_vmlX<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
1377 dag iops, InstrItinClass itin, string opc, string asm,
1378 list<dag> pattern>
1379 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
1380 let Inst{27-23} = opcod1;
1381 let Inst{21-20} = opcod2;
1382 let Inst{11-8} = 0b1011;
1383 let Inst{6} = op6;
1384 let Inst{4} = op4;
1385 list<Predicate> Predicates = [HasVFP2, UseVMLx];
1386}
1387
1388
Evan Cheng96581d32008-11-11 02:11:05 +00001389// Single precision, unary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001390class ASuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1391 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1392 string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001393 : VFPAI<oops, iops, VFPUnaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001394 let Inst{27-23} = opcod1;
1395 let Inst{21-20} = opcod2;
1396 let Inst{19-16} = opcod3;
Evan Cheng96581d32008-11-11 02:11:05 +00001397 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001398 let Inst{7-6} = opcod4;
1399 let Inst{4} = opcod5;
Evan Cheng96581d32008-11-11 02:11:05 +00001400}
1401
David Goodwin338268c2009-08-10 22:17:39 +00001402// Single precision unary, if no NEON
David Goodwin53e44712009-08-04 20:39:05 +00001403// Same as ASuI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001404class ASuIn<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
1405 bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,
1406 string asm, list<dag> pattern>
1407 : ASuI<opcod1, opcod2, opcod3, opcod4, opcod5, oops, iops, itin, opc, asm,
1408 pattern> {
David Goodwin53e44712009-08-04 20:39:05 +00001409 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1410}
1411
Evan Cheng96581d32008-11-11 02:11:05 +00001412// Single precision, binary
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001413class ASbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops, dag iops,
1414 InstrItinClass itin, string opc, string asm, list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001415 : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001416 let Inst{27-23} = opcod1;
1417 let Inst{21-20} = opcod2;
Evan Cheng96581d32008-11-11 02:11:05 +00001418 let Inst{11-8} = 0b1010;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001419 let Inst{6} = op6;
1420 let Inst{4} = op4;
Evan Cheng96581d32008-11-11 02:11:05 +00001421}
1422
David Goodwin338268c2009-08-10 22:17:39 +00001423// Single precision binary, if no NEON
David Goodwin42a83f22009-08-04 17:53:06 +00001424// Same as ASbI except not available if NEON is enabled
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001425class ASbIn<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
Bob Wilson01135592010-03-23 17:23:59 +00001426 dag iops, InstrItinClass itin, string opc, string asm,
1427 list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001428 : ASbI<opcod1, opcod2, op6, op4, oops, iops, itin, opc, asm, pattern> {
David Goodwin42a83f22009-08-04 17:53:06 +00001429 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1430}
1431
Evan Cheng80a11982008-11-12 06:41:41 +00001432// VFP conversion instructions
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001433class AVConv1I<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
1434 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1435 list<dag> pattern>
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001436 : VFPAI<oops, iops, VFPConv1Frm, itin, opc, asm, pattern> {
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001437 let Inst{27-23} = opcod1;
1438 let Inst{21-20} = opcod2;
1439 let Inst{19-16} = opcod3;
1440 let Inst{11-8} = opcod4;
Evan Cheng80a11982008-11-12 06:41:41 +00001441 let Inst{6} = 1;
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001442 let Inst{4} = 0;
Evan Cheng80a11982008-11-12 06:41:41 +00001443}
1444
Johnny Chen811663f2010-02-11 18:47:03 +00001445// VFP conversion between floating-point and fixed-point
1446class AVConv1XI<bits<5> op1, bits<2> op2, bits<4> op3, bits<4> op4, bit op5,
Bob Wilson01135592010-03-23 17:23:59 +00001447 dag oops, dag iops, InstrItinClass itin, string opc, string asm,
1448 list<dag> pattern>
Johnny Chen811663f2010-02-11 18:47:03 +00001449 : AVConv1I<op1, op2, op3, op4, oops, iops, itin, opc, asm, pattern> {
1450 // size (fixed-point number): sx == 0 ? 16 : 32
1451 let Inst{7} = op5; // sx
1452}
1453
David Goodwin338268c2009-08-10 22:17:39 +00001454// VFP conversion instructions, if no NEON
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001455class AVConv1In<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<4> opcod4,
David Goodwin338268c2009-08-10 22:17:39 +00001456 dag oops, dag iops, InstrItinClass itin,
1457 string opc, string asm, list<dag> pattern>
Johnny Chen69a8c7f2010-01-29 23:21:10 +00001458 : AVConv1I<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
1459 pattern> {
David Goodwin338268c2009-08-10 22:17:39 +00001460 list<Predicate> Predicates = [HasVFP2,DontUseNEONForFP];
1461}
1462
Evan Cheng80a11982008-11-12 06:41:41 +00001463class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001464 InstrItinClass itin,
1465 string opc, string asm, list<dag> pattern>
1466 : VFPAI<oops, iops, f, itin, opc, asm, pattern> {
Evan Cheng80a11982008-11-12 06:41:41 +00001467 let Inst{27-20} = opcod1;
Evan Cheng78be83d2008-11-11 19:40:26 +00001468 let Inst{11-8} = opcod2;
1469 let Inst{4} = 1;
1470}
1471
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001472class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1473 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1474 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, itin, opc, asm, pattern>;
Evan Cheng0a0ab132008-11-11 22:46:12 +00001475
Bob Wilson01135592010-03-23 17:23:59 +00001476class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001477 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1478 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001479
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001480class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1481 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1482 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, itin, opc, asm, pattern>;
Evan Cheng80a11982008-11-12 06:41:41 +00001483
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001484class AVConv5I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops,
1485 InstrItinClass itin, string opc, string asm, list<dag> pattern>
1486 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv5Frm, itin, opc, asm, pattern>;
Evan Cheng78be83d2008-11-11 19:40:26 +00001487
Evan Cheng96581d32008-11-11 02:11:05 +00001488//===----------------------------------------------------------------------===//
1489
Bob Wilson5bafff32009-06-22 23:27:02 +00001490//===----------------------------------------------------------------------===//
1491// ARM NEON Instruction templates.
1492//
Evan Cheng13096642008-08-29 06:41:12 +00001493
Johnny Chencaa608e2010-03-20 00:17:00 +00001494class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1495 InstrItinClass itin, string opc, string dt, string asm, string cstr,
1496 list<dag> pattern>
1497 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Evan Chengf81bf152009-11-23 21:57:23 +00001498 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001499 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001500 let AsmString = !strconcat(
1501 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1502 !strconcat("\t", asm));
1503 let Pattern = pattern;
1504 list<Predicate> Predicates = [HasNEON];
1505}
1506
1507// Same as NeonI except it does not have a "data type" specifier.
Johnny Chen927b88f2010-03-23 20:40:44 +00001508class NeonXI<dag oops, dag iops, AddrMode am, IndexMode im, Format f,
1509 InstrItinClass itin, string opc, string asm, string cstr,
1510 list<dag> pattern>
1511 : InstARM<am, Size4Bytes, im, f, NeonDomain, cstr, itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001512 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001513 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001514 let AsmString = !strconcat(!strconcat(opc, "${p}"), !strconcat("\t", asm));
Bob Wilson5bafff32009-06-22 23:27:02 +00001515 let Pattern = pattern;
1516 list<Predicate> Predicates = [HasNEON];
Evan Cheng13096642008-08-29 06:41:12 +00001517}
1518
Bob Wilsonb07c1712009-10-07 21:53:04 +00001519class NLdSt<bit op23, bits<2> op21_20, bits<4> op11_8, bits<4> op7_4,
1520 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001521 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chencaa608e2010-03-20 00:17:00 +00001522 : NeonI<oops, iops, AddrMode6, IndexModeNone, NLdStFrm, itin, opc, dt, asm,
1523 cstr, pattern> {
Bob Wilson205a5ca2009-07-08 18:11:30 +00001524 let Inst{31-24} = 0b11110100;
Jim Grosbach780d2072009-10-20 00:19:08 +00001525 let Inst{23} = op23;
1526 let Inst{21-20} = op21_20;
1527 let Inst{11-8} = op11_8;
1528 let Inst{7-4} = op7_4;
Bob Wilson205a5ca2009-07-08 18:11:30 +00001529}
1530
Johnny Chen785516a2010-03-23 16:43:47 +00001531class NDataI<dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001532 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chen785516a2010-03-23 16:43:47 +00001533 : NeonI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, dt, asm, cstr,
1534 pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001535 let Inst{31-25} = 0b1111001;
1536}
1537
Johnny Chen927b88f2010-03-23 20:40:44 +00001538class NDataXI<dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001539 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chen927b88f2010-03-23 20:40:44 +00001540 : NeonXI<oops, iops, AddrModeNone, IndexModeNone, f, itin, opc, asm,
Bob Wilson01135592010-03-23 17:23:59 +00001541 cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001542 let Inst{31-25} = 0b1111001;
1543}
1544
1545// NEON "one register and a modified immediate" format.
1546class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1547 bit op5, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001548 dag oops, dag iops, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001549 string opc, string dt, string asm, string cstr,
1550 list<dag> pattern>
Johnny Chena2711742010-03-23 23:09:14 +00001551 : NDataI<oops, iops, N1RegModImmFrm, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001552 let Inst{23} = op23;
1553 let Inst{21-19} = op21_19;
1554 let Inst{11-8} = op11_8;
1555 let Inst{7} = op7;
1556 let Inst{6} = op6;
1557 let Inst{5} = op5;
1558 let Inst{4} = op4;
1559}
1560
1561// NEON 2 vector register format.
1562class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1563 bits<5> op11_7, bit op6, bit op4,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001564 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001565 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001566 : NDataI<oops, iops, N2RegFrm, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001567 let Inst{24-23} = op24_23;
1568 let Inst{21-20} = op21_20;
1569 let Inst{19-18} = op19_18;
1570 let Inst{17-16} = op17_16;
1571 let Inst{11-7} = op11_7;
1572 let Inst{6} = op6;
1573 let Inst{4} = op4;
1574}
1575
1576// Same as N2V except it doesn't have a datatype suffix.
1577class N2VX<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
Bob Wilson01135592010-03-23 17:23:59 +00001578 bits<5> op11_7, bit op6, bit op4,
1579 dag oops, dag iops, InstrItinClass itin,
1580 string opc, string asm, string cstr, list<dag> pattern>
Johnny Chenc5f413a2010-03-24 00:57:50 +00001581 : NDataXI<oops, iops, N2RegFrm, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001582 let Inst{24-23} = op24_23;
1583 let Inst{21-20} = op21_20;
1584 let Inst{19-18} = op19_18;
1585 let Inst{17-16} = op17_16;
1586 let Inst{11-7} = op11_7;
1587 let Inst{6} = op6;
1588 let Inst{4} = op4;
1589}
1590
1591// NEON 2 vector register with immediate.
Bob Wilson507df402009-10-21 02:15:46 +00001592class N2VImm<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
Johnny Chenfa80bec2010-03-25 20:39:04 +00001593 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001594 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenfa80bec2010-03-25 20:39:04 +00001595 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001596 let Inst{24} = op24;
1597 let Inst{23} = op23;
Bob Wilson5bafff32009-06-22 23:27:02 +00001598 let Inst{11-8} = op11_8;
1599 let Inst{7} = op7;
1600 let Inst{6} = op6;
1601 let Inst{4} = op4;
1602}
1603
Bob Wilson10bc69c2010-03-27 03:56:52 +00001604// NEON 3 vector register format.
1605class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
1606 dag oops, dag iops, Format f, InstrItinClass itin,
1607 string opc, string dt, string asm, string cstr, list<dag> pattern>
Johnny Chenc6e704d2010-03-26 21:26:28 +00001608 : NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
Evan Chengf81bf152009-11-23 21:57:23 +00001609 let Inst{24} = op24;
1610 let Inst{23} = op23;
1611 let Inst{21-20} = op21_20;
1612 let Inst{11-8} = op11_8;
1613 let Inst{6} = op6;
1614 let Inst{4} = op4;
1615}
1616
Johnny Chen841e8282010-03-23 21:35:03 +00001617// Same as N3V except it doesn't have a data type suffix.
Bob Wilson01135592010-03-23 17:23:59 +00001618class N3VX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
1619 bit op4,
Bob Wilson10bc69c2010-03-27 03:56:52 +00001620 dag oops, dag iops, Format f, InstrItinClass itin,
Bob Wilson01135592010-03-23 17:23:59 +00001621 string opc, string asm, string cstr, list<dag> pattern>
Bob Wilson10bc69c2010-03-27 03:56:52 +00001622 : NDataXI<oops, iops, f, itin, opc, asm, cstr, pattern> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001623 let Inst{24} = op24;
1624 let Inst{23} = op23;
1625 let Inst{21-20} = op21_20;
1626 let Inst{11-8} = op11_8;
1627 let Inst{6} = op6;
1628 let Inst{4} = op4;
1629}
1630
1631// NEON VMOVs between scalar and core registers.
1632class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001633 dag oops, dag iops, Format f, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001634 string opc, string dt, string asm, list<dag> pattern>
1635 : InstARM<AddrModeNone, Size4Bytes, IndexModeNone, f, GenericDomain,
Bob Wilson01135592010-03-23 17:23:59 +00001636 "", itin> {
Bob Wilson5bafff32009-06-22 23:27:02 +00001637 let Inst{27-20} = opcod1;
1638 let Inst{11-8} = opcod2;
1639 let Inst{6-5} = opcod3;
1640 let Inst{4} = 1;
Evan Chengf81bf152009-11-23 21:57:23 +00001641
1642 let OutOperandList = oops;
Chris Lattnerb7d52262010-03-18 21:06:54 +00001643 let InOperandList = !con(iops, (ins pred:$p));
Evan Chengf81bf152009-11-23 21:57:23 +00001644 let AsmString = !strconcat(
1645 !strconcat(!strconcat(opc, "${p}"), !strconcat(".", dt)),
1646 !strconcat("\t", asm));
1647 let Pattern = pattern;
Bob Wilson5bafff32009-06-22 23:27:02 +00001648 list<Predicate> Predicates = [HasNEON];
1649}
1650class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001651 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001652 string opc, string dt, string asm, list<dag> pattern>
Bob Wilson184723d2010-06-25 23:56:05 +00001653 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NGetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001654 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001655class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001656 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001657 string opc, string dt, string asm, list<dag> pattern>
Bob Wilson184723d2010-06-25 23:56:05 +00001658 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NSetLnFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001659 opc, dt, asm, pattern>;
Bob Wilson5bafff32009-06-22 23:27:02 +00001660class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
David Goodwin8b7d7ad2009-08-06 16:52:47 +00001661 dag oops, dag iops, InstrItinClass itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001662 string opc, string dt, string asm, list<dag> pattern>
Bob Wilson184723d2010-06-25 23:56:05 +00001663 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NDupFrm, itin,
Evan Chengf81bf152009-11-23 21:57:23 +00001664 opc, dt, asm, pattern>;
David Goodwin42a83f22009-08-04 17:53:06 +00001665
Johnny Chene4614f72010-03-25 17:01:27 +00001666// Vector Duplicate Lane (from scalar to all elements)
1667class NVDupLane<bits<4> op19_16, bit op6, dag oops, dag iops,
1668 InstrItinClass itin, string opc, string dt, string asm,
1669 list<dag> pattern>
Johnny Chen2d2898e2010-03-25 21:49:12 +00001670 : NDataI<oops, iops, NVDupLnFrm, itin, opc, dt, asm, "", pattern> {
Johnny Chene4614f72010-03-25 17:01:27 +00001671 let Inst{24-23} = 0b11;
1672 let Inst{21-20} = 0b11;
1673 let Inst{19-16} = op19_16;
1674 let Inst{11-7} = 0b11000;
1675 let Inst{6} = op6;
1676 let Inst{4} = 0;
1677}
1678
David Goodwin42a83f22009-08-04 17:53:06 +00001679// NEONFPPat - Same as Pat<>, but requires that the compiler be using NEON
1680// for single-precision FP.
1681class NEONFPPat<dag pattern, dag result> : Pat<pattern, result> {
1682 list<Predicate> Predicates = [HasNEON,UseNEONForFP];
1683}