blob: a9c66a5506d63046323134562cdcae9e5e2cd84b [file] [log] [blame]
Evan Cheng7b0249b2008-08-28 23:39:26 +00001//===- ARMInstrFormats.td - ARM Instruction Formats --*- tablegen -*---------=//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
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.
18class Format<bits<5> val> {
19 bits<5> Value = val;
20}
21
Evan Cheng9d2c9232008-11-13 23:36:57 +000022def Pseudo : Format<0>;
23def MulFrm : Format<1>;
24def BrFrm : Format<2>;
25def BrMiscFrm : Format<3>;
Evan Cheng7b0249b2008-08-28 23:39:26 +000026
Evan Cheng9d2c9232008-11-13 23:36:57 +000027def DPFrm : Format<4>;
28def DPSoRegFrm : Format<5>;
Evan Cheng7b0249b2008-08-28 23:39:26 +000029
Evan Cheng9d2c9232008-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 Cheng7b0249b2008-08-28 23:39:26 +000035
Evan Cheng9d2c9232008-11-13 23:36:57 +000036def ArithMiscFrm : Format<11>;
37def ExtFrm : Format<12>;
Evan Chengbb786b32008-11-11 21:48:44 +000038
Evan Cheng9d2c9232008-11-13 23:36:57 +000039def VFPUnaryFrm : Format<13>;
40def VFPBinaryFrm : Format<14>;
41def VFPConv1Frm : Format<15>;
42def VFPConv2Frm : Format<16>;
43def VFPConv3Frm : Format<17>;
44def VFPConv4Frm : Format<18>;
45def VFPConv5Frm : Format<19>;
46def VFPLdStFrm : Format<20>;
47def VFPLdStMulFrm : Format<21>;
48def VFPMiscFrm : Format<22>;
Evan Chengbb786b32008-11-11 21:48:44 +000049
Evan Cheng9d2c9232008-11-13 23:36:57 +000050def ThumbFrm : Format<23>;
Evan Cheng7b0249b2008-08-28 23:39:26 +000051
Bob Wilsone60fee02009-06-22 23:27:02 +000052def NEONFrm : Format<24>;
53def NEONGetLnFrm : Format<25>;
54def NEONSetLnFrm : Format<26>;
55def NEONDupFrm : Format<27>;
56
Evan Cheng86a926a2008-11-05 18:35:52 +000057// Misc flag for data processing instructions that indicates whether
58// the instruction has a Rn register operand.
59class UnaryDP { bit isUnaryDataProc = 1; }
Evan Cheng7b0249b2008-08-28 23:39:26 +000060
Evan Cheng7b0249b2008-08-28 23:39:26 +000061//===----------------------------------------------------------------------===//
Evan Cheng532cdc52009-06-29 07:51:04 +000062// ARM Instruction flags. These need to match ARMInstrInfo.h.
63//
64
65// Addressing mode.
66class AddrMode<bits<4> val> {
67 bits<4> Value = val;
68}
69def AddrModeNone : AddrMode<0>;
70def AddrMode1 : AddrMode<1>;
71def AddrMode2 : AddrMode<2>;
72def AddrMode3 : AddrMode<3>;
73def AddrMode4 : AddrMode<4>;
74def AddrMode5 : AddrMode<5>;
75def AddrModeT1_1 : AddrMode<6>;
76def AddrModeT1_2 : AddrMode<7>;
77def AddrModeT1_4 : AddrMode<8>;
78def AddrModeT1_s : AddrMode<9>;
79def AddrModeT2_i12: AddrMode<10>;
80def AddrModeT2_i8 : AddrMode<11>;
81def AddrModeT2_so : AddrMode<12>;
Evan Cheng503be112009-06-30 02:15:48 +000082def AddrModeT2_pc : AddrMode<13>;
83def AddrModeT2_i8s4 : AddrMode<14>;
Evan Cheng532cdc52009-06-29 07:51:04 +000084
85// Instruction size.
86class SizeFlagVal<bits<3> val> {
87 bits<3> Value = val;
88}
89def SizeInvalid : SizeFlagVal<0>; // Unset.
90def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
91def Size8Bytes : SizeFlagVal<2>;
92def Size4Bytes : SizeFlagVal<3>;
93def Size2Bytes : SizeFlagVal<4>;
94
95// Load / store index mode.
96class IndexMode<bits<2> val> {
97 bits<2> Value = val;
98}
99def IndexModeNone : IndexMode<0>;
100def IndexModePre : IndexMode<1>;
101def IndexModePost : IndexMode<2>;
102
103//===----------------------------------------------------------------------===//
Evan Cheng7b0249b2008-08-28 23:39:26 +0000104
105// ARM Instruction templates.
106//
107
Evan Chengbe998242008-11-06 08:47:38 +0000108class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000109 Format f, string cstr>
110 : Instruction {
Evan Chengd0750352008-08-29 07:40:52 +0000111 field bits<32> Inst;
112
Evan Cheng7b0249b2008-08-28 23:39:26 +0000113 let Namespace = "ARM";
114
Evan Cheng86a926a2008-11-05 18:35:52 +0000115 // TSFlagsFields
Evan Cheng7b0249b2008-08-28 23:39:26 +0000116 AddrMode AM = am;
117 bits<4> AddrModeBits = AM.Value;
118
119 SizeFlagVal SZ = sz;
120 bits<3> SizeFlag = SZ.Value;
121
122 IndexMode IM = im;
123 bits<2> IndexModeBits = IM.Value;
124
125 Format F = f;
126 bits<5> Form = F.Value;
Evan Cheng86a926a2008-11-05 18:35:52 +0000127
128 //
129 // Attributes specific to ARM instructions...
130 //
131 bit isUnaryDataProc = 0;
Evan Cheng7b0249b2008-08-28 23:39:26 +0000132
133 let Constraints = cstr;
134}
135
136class PseudoInst<dag oops, dag iops, string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000137 : InstARM<AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, ""> {
Evan Cheng7b0249b2008-08-28 23:39:26 +0000138 let OutOperandList = oops;
139 let InOperandList = iops;
140 let AsmString = asm;
141 let Pattern = pattern;
142}
143
144// Almost all ARM instructions are predicable.
Evan Chengbe998242008-11-06 08:47:38 +0000145class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000146 IndexMode im, Format f, string opc, string asm, string cstr,
147 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000148 : InstARM<am, sz, im, f, cstr> {
Evan Cheng7b0249b2008-08-28 23:39:26 +0000149 let OutOperandList = oops;
150 let InOperandList = !con(iops, (ops pred:$p));
151 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
152 let Pattern = pattern;
153 list<Predicate> Predicates = [IsARM];
154}
155
156// Same as I except it can optionally modify CPSR. Note it's modeled as
157// an input operand since by default it's a zero register. It will
158// become an implicit def once it's "flipped".
Evan Chengbe998242008-11-06 08:47:38 +0000159class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000160 IndexMode im, Format f, string opc, string asm, string cstr,
161 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000162 : InstARM<am, sz, im, f, cstr> {
Evan Cheng7b0249b2008-08-28 23:39:26 +0000163 let OutOperandList = oops;
164 let InOperandList = !con(iops, (ops pred:$p, cc_out:$s));
165 let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm));
166 let Pattern = pattern;
167 list<Predicate> Predicates = [IsARM];
168}
169
Evan Chengc5409a82008-09-01 07:19:00 +0000170// Special cases
Evan Chengbe998242008-11-06 08:47:38 +0000171class XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Evan Chengc5409a82008-09-01 07:19:00 +0000172 IndexMode im, Format f, string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000173 : InstARM<am, sz, im, f, cstr> {
Evan Chengc5409a82008-09-01 07:19:00 +0000174 let OutOperandList = oops;
175 let InOperandList = iops;
176 let AsmString = asm;
177 let Pattern = pattern;
178 list<Predicate> Predicates = [IsARM];
179}
180
Evan Chengbe998242008-11-06 08:47:38 +0000181class AI<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000182 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000183 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000184 asm, "", pattern>;
Evan Chengbe998242008-11-06 08:47:38 +0000185class AsI<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000186 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000187 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000188 asm, "", pattern>;
Evan Chengbe998242008-11-06 08:47:38 +0000189class AXI<dag oops, dag iops, Format f, string asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000190 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000191 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000192 "", pattern>;
Evan Cheng10a9eb82008-09-01 08:25:56 +0000193
194// Ctrl flow instructions
Evan Chengf8e8b622008-11-06 17:48:05 +0000195class ABI<bits<4> opcod, dag oops, dag iops, string opc,
Evan Cheng10a9eb82008-09-01 08:25:56 +0000196 string asm, list<dag> pattern>
Evan Chengf8e8b622008-11-06 17:48:05 +0000197 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000198 asm, "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000199 let Inst{27-24} = opcod;
Evan Cheng10a9eb82008-09-01 08:25:56 +0000200}
Evan Chengf8e8b622008-11-06 17:48:05 +0000201class ABXI<bits<4> opcod, dag oops, dag iops, string asm, list<dag> pattern>
202 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, asm,
Evan Cheng10a9eb82008-09-01 08:25:56 +0000203 "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000204 let Inst{27-24} = opcod;
Evan Cheng10a9eb82008-09-01 08:25:56 +0000205}
Evan Chengf8e8b622008-11-06 17:48:05 +0000206class ABXIx2<dag oops, dag iops, string asm, list<dag> pattern>
207 : XI<oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, BrMiscFrm, asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000208 "", pattern>;
Evan Cheng10a9eb82008-09-01 08:25:56 +0000209
210// BR_JT instructions
Evan Cheng0f63ae12008-11-07 09:06:08 +0000211class JTI<dag oops, dag iops, string asm, list<dag> pattern>
Evan Chengf8e8b622008-11-06 17:48:05 +0000212 : XI<oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BrMiscFrm,
Evan Cheng0f63ae12008-11-07 09:06:08 +0000213 asm, "", pattern>;
Evan Cheng2e62b662008-09-01 01:51:14 +0000214
215// addrmode1 instructions
Evan Cheng7b0249b2008-08-28 23:39:26 +0000216class AI1<bits<4> opcod, dag oops, dag iops, Format f, string opc,
217 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000218 : I<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc,
Evan Chengd0750352008-08-29 07:40:52 +0000219 asm, "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000220 let Inst{24-21} = opcod;
221 let Inst{27-26} = {0,0};
Evan Chengd0750352008-08-29 07:40:52 +0000222}
Evan Cheng7b0249b2008-08-28 23:39:26 +0000223class AsI1<bits<4> opcod, dag oops, dag iops, Format f, string opc,
224 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000225 : sI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc,
Evan Chengd0750352008-08-29 07:40:52 +0000226 asm, "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000227 let Inst{24-21} = opcod;
228 let Inst{27-26} = {0,0};
Evan Chengd0750352008-08-29 07:40:52 +0000229}
Evan Chengc5409a82008-09-01 07:19:00 +0000230class AXI1<bits<4> opcod, dag oops, dag iops, Format f, string asm,
231 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000232 : XI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000233 "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000234 let Inst{24-21} = opcod;
235 let Inst{27-26} = {0,0};
Evan Chengc5409a82008-09-01 07:19:00 +0000236}
Evan Chengbe998242008-11-06 08:47:38 +0000237class AI1x2<dag oops, dag iops, Format f, string opc,
Evan Cheng2e62b662008-09-01 01:51:14 +0000238 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000239 : I<oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, opc,
Evan Cheng2e62b662008-09-01 01:51:14 +0000240 asm, "", pattern>;
Evan Chengda020022008-08-31 19:02:21 +0000241
Evan Cheng2e62b662008-09-01 01:51:14 +0000242
243// addrmode2 loads and stores
Evan Chengbe998242008-11-06 08:47:38 +0000244class AI2<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000245 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000246 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengda020022008-08-31 19:02:21 +0000247 asm, "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000248 let Inst{27-26} = {0,1};
Evan Chengda020022008-08-31 19:02:21 +0000249}
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000250
251// loads
Evan Chengbe998242008-11-06 08:47:38 +0000252class AI2ldw<dag oops, dag iops, Format f, string opc,
Evan Chengda020022008-08-31 19:02:21 +0000253 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000254 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengc41fb3152008-11-05 23:22:34 +0000255 asm, "", pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000256 let Inst{20} = 1; // L bit
Evan Chengda020022008-08-31 19:02:21 +0000257 let Inst{21} = 0; // W bit
258 let Inst{22} = 0; // B bit
259 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000260 let Inst{27-26} = {0,1};
Evan Chengda020022008-08-31 19:02:21 +0000261}
Evan Chengbe998242008-11-06 08:47:38 +0000262class AXI2ldw<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000263 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000264 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000265 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000266 let Inst{20} = 1; // L bit
267 let Inst{21} = 0; // W bit
268 let Inst{22} = 0; // B bit
269 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000270 let Inst{27-26} = {0,1};
Evan Chengae7b1d72008-09-01 07:34:13 +0000271}
Evan Chengbe998242008-11-06 08:47:38 +0000272class AI2ldb<dag oops, dag iops, Format f, string opc,
Evan Chengda020022008-08-31 19:02:21 +0000273 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000274 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengc41fb3152008-11-05 23:22:34 +0000275 asm, "", pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000276 let Inst{20} = 1; // L bit
Evan Chengda020022008-08-31 19:02:21 +0000277 let Inst{21} = 0; // W bit
278 let Inst{22} = 1; // B bit
279 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000280 let Inst{27-26} = {0,1};
Evan Chengda020022008-08-31 19:02:21 +0000281}
Evan Chengbe998242008-11-06 08:47:38 +0000282class AXI2ldb<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000283 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000284 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000285 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000286 let Inst{20} = 1; // L bit
287 let Inst{21} = 0; // W bit
288 let Inst{22} = 1; // B bit
289 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000290 let Inst{27-26} = {0,1};
Evan Chengae7b1d72008-09-01 07:34:13 +0000291}
Evan Chengda020022008-08-31 19:02:21 +0000292
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000293// stores
Evan Chengbe998242008-11-06 08:47:38 +0000294class AI2stw<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000295 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000296 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengc41fb3152008-11-05 23:22:34 +0000297 asm, "", pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000298 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000299 let Inst{21} = 0; // W bit
300 let Inst{22} = 0; // B bit
301 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000302 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000303}
Evan Chengbe998242008-11-06 08:47:38 +0000304class AXI2stw<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000305 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000306 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000307 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000308 let Inst{20} = 0; // L bit
309 let Inst{21} = 0; // W bit
310 let Inst{22} = 0; // B bit
311 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000312 let Inst{27-26} = {0,1};
Evan Chengae7b1d72008-09-01 07:34:13 +0000313}
Evan Chengbe998242008-11-06 08:47:38 +0000314class AI2stb<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000315 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000316 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengc41fb3152008-11-05 23:22:34 +0000317 asm, "", pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000318 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000319 let Inst{21} = 0; // W bit
320 let Inst{22} = 1; // B bit
321 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000322 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000323}
Evan Chengbe998242008-11-06 08:47:38 +0000324class AXI2stb<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000325 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000326 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000327 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000328 let Inst{20} = 0; // L bit
329 let Inst{21} = 0; // W bit
330 let Inst{22} = 1; // B bit
331 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000332 let Inst{27-26} = {0,1};
Evan Chengae7b1d72008-09-01 07:34:13 +0000333}
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000334
Evan Chengac92c3f2008-09-01 07:00:14 +0000335// Pre-indexed loads
Evan Chengbe998242008-11-06 08:47:38 +0000336class AI2ldwpr<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000337 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000338 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000339 asm, cstr, pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000340 let Inst{20} = 1; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000341 let Inst{21} = 1; // W bit
342 let Inst{22} = 0; // B bit
343 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000344 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000345}
Evan Chengbe998242008-11-06 08:47:38 +0000346class AI2ldbpr<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000347 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000348 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000349 asm, cstr, pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000350 let Inst{20} = 1; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000351 let Inst{21} = 1; // W bit
352 let Inst{22} = 1; // B bit
353 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000354 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000355}
356
Evan Chengac92c3f2008-09-01 07:00:14 +0000357// Pre-indexed stores
Evan Chengbe998242008-11-06 08:47:38 +0000358class AI2stwpr<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000359 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000360 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000361 asm, cstr, pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000362 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000363 let Inst{21} = 1; // W bit
364 let Inst{22} = 0; // B bit
365 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000366 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000367}
Evan Chengbe998242008-11-06 08:47:38 +0000368class AI2stbpr<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000369 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000370 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000371 asm, cstr, pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000372 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000373 let Inst{21} = 1; // W bit
374 let Inst{22} = 1; // B bit
375 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000376 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000377}
378
Evan Chengac92c3f2008-09-01 07:00:14 +0000379// Post-indexed loads
Evan Chengbe998242008-11-06 08:47:38 +0000380class AI2ldwpo<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000381 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000382 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000383 asm, cstr,pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000384 let Inst{20} = 1; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000385 let Inst{21} = 0; // W bit
386 let Inst{22} = 0; // B bit
387 let Inst{24} = 0; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000388 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000389}
Evan Chengbe998242008-11-06 08:47:38 +0000390class AI2ldbpo<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000391 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000392 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000393 asm, cstr,pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000394 let Inst{20} = 1; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000395 let Inst{21} = 0; // W bit
396 let Inst{22} = 1; // B bit
397 let Inst{24} = 0; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000398 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000399}
400
Evan Chengac92c3f2008-09-01 07:00:14 +0000401// Post-indexed stores
Evan Chengbe998242008-11-06 08:47:38 +0000402class AI2stwpo<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000403 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000404 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000405 asm, cstr,pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000406 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000407 let Inst{21} = 0; // W bit
408 let Inst{22} = 0; // B bit
409 let Inst{24} = 0; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000410 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000411}
Evan Chengbe998242008-11-06 08:47:38 +0000412class AI2stbpo<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000413 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000414 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000415 asm, cstr,pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000416 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000417 let Inst{21} = 0; // W bit
418 let Inst{22} = 1; // B bit
419 let Inst{24} = 0; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000420 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000421}
422
Evan Cheng2e62b662008-09-01 01:51:14 +0000423// addrmode3 instructions
Evan Chengbe998242008-11-06 08:47:38 +0000424class AI3<dag oops, dag iops, Format f, string opc,
Evan Cheng2e62b662008-09-01 01:51:14 +0000425 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000426 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Cheng2e62b662008-09-01 01:51:14 +0000427 asm, "", pattern>;
Evan Chengbe998242008-11-06 08:47:38 +0000428class AXI3<dag oops, dag iops, Format f, string asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000429 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000430 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000431 "", pattern>;
Evan Cheng2e62b662008-09-01 01:51:14 +0000432
Evan Chengac92c3f2008-09-01 07:00:14 +0000433// loads
Evan Chengbe998242008-11-06 08:47:38 +0000434class AI3ldh<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000435 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000436 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000437 asm, "", pattern> {
438 let Inst{4} = 1;
439 let Inst{5} = 1; // H bit
440 let Inst{6} = 0; // S bit
441 let Inst{7} = 1;
442 let Inst{20} = 1; // L bit
443 let Inst{21} = 0; // W bit
444 let Inst{24} = 1; // P bit
445}
Evan Chengbe998242008-11-06 08:47:38 +0000446class AXI3ldh<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000447 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000448 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000449 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000450 let Inst{4} = 1;
451 let Inst{5} = 1; // H bit
452 let Inst{6} = 0; // S bit
453 let Inst{7} = 1;
454 let Inst{20} = 1; // L bit
455 let Inst{21} = 0; // W bit
456 let Inst{24} = 1; // P bit
457}
Evan Chengbe998242008-11-06 08:47:38 +0000458class AI3ldsh<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000459 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000460 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000461 asm, "", pattern> {
462 let Inst{4} = 1;
463 let Inst{5} = 1; // H bit
464 let Inst{6} = 1; // S bit
465 let Inst{7} = 1;
466 let Inst{20} = 1; // L bit
467 let Inst{21} = 0; // W bit
468 let Inst{24} = 1; // P bit
469}
Evan Chengbe998242008-11-06 08:47:38 +0000470class AXI3ldsh<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000471 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000472 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000473 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000474 let Inst{4} = 1;
475 let Inst{5} = 1; // H bit
476 let Inst{6} = 1; // S bit
477 let Inst{7} = 1;
478 let Inst{20} = 1; // L bit
479 let Inst{21} = 0; // W bit
480 let Inst{24} = 1; // P bit
481}
Evan Chengbe998242008-11-06 08:47:38 +0000482class AI3ldsb<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000483 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000484 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000485 asm, "", pattern> {
486 let Inst{4} = 1;
487 let Inst{5} = 0; // H bit
488 let Inst{6} = 1; // S bit
489 let Inst{7} = 1;
490 let Inst{20} = 1; // L bit
491 let Inst{21} = 0; // W bit
492 let Inst{24} = 1; // P bit
493}
Evan Chengbe998242008-11-06 08:47:38 +0000494class AXI3ldsb<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000495 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000496 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000497 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000498 let Inst{4} = 1;
499 let Inst{5} = 0; // H bit
500 let Inst{6} = 1; // S bit
501 let Inst{7} = 1;
502 let Inst{20} = 1; // L bit
503 let Inst{21} = 0; // W bit
504 let Inst{24} = 1; // P bit
505}
Evan Chengbe998242008-11-06 08:47:38 +0000506class AI3ldd<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000507 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000508 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000509 asm, "", pattern> {
510 let Inst{4} = 1;
511 let Inst{5} = 0; // H bit
512 let Inst{6} = 1; // S bit
513 let Inst{7} = 1;
514 let Inst{20} = 0; // L bit
515 let Inst{21} = 0; // W bit
516 let Inst{24} = 1; // P bit
517}
518
519// stores
Evan Chengbe998242008-11-06 08:47:38 +0000520class AI3sth<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000521 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000522 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000523 asm, "", pattern> {
524 let Inst{4} = 1;
525 let Inst{5} = 1; // H bit
526 let Inst{6} = 0; // S bit
527 let Inst{7} = 1;
528 let Inst{20} = 0; // L bit
529 let Inst{21} = 0; // W bit
530 let Inst{24} = 1; // P bit
531}
Evan Chengbe998242008-11-06 08:47:38 +0000532class AXI3sth<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000533 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000534 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000535 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000536 let Inst{4} = 1;
537 let Inst{5} = 1; // H bit
538 let Inst{6} = 0; // S bit
539 let Inst{7} = 1;
540 let Inst{20} = 0; // L bit
541 let Inst{21} = 0; // W bit
542 let Inst{24} = 1; // P bit
543}
Evan Chengbe998242008-11-06 08:47:38 +0000544class AI3std<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000545 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000546 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000547 asm, "", pattern> {
548 let Inst{4} = 1;
549 let Inst{5} = 1; // H bit
550 let Inst{6} = 1; // S bit
551 let Inst{7} = 1;
552 let Inst{20} = 0; // L bit
553 let Inst{21} = 0; // W bit
554 let Inst{24} = 1; // P bit
555}
556
557// Pre-indexed loads
Evan Chengbe998242008-11-06 08:47:38 +0000558class AI3ldhpr<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000559 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000560 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000561 asm, cstr, pattern> {
562 let Inst{4} = 1;
563 let Inst{5} = 1; // H bit
564 let Inst{6} = 0; // S bit
565 let Inst{7} = 1;
566 let Inst{20} = 1; // L bit
567 let Inst{21} = 1; // W bit
568 let Inst{24} = 1; // P bit
569}
Evan Chengbe998242008-11-06 08:47:38 +0000570class AI3ldshpr<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000571 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000572 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000573 asm, cstr, pattern> {
574 let Inst{4} = 1;
575 let Inst{5} = 1; // H bit
576 let Inst{6} = 1; // S bit
577 let Inst{7} = 1;
578 let Inst{20} = 1; // L bit
579 let Inst{21} = 1; // W bit
580 let Inst{24} = 1; // P bit
581}
Evan Chengbe998242008-11-06 08:47:38 +0000582class AI3ldsbpr<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000583 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000584 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000585 asm, cstr, pattern> {
586 let Inst{4} = 1;
587 let Inst{5} = 0; // H bit
588 let Inst{6} = 1; // S bit
589 let Inst{7} = 1;
590 let Inst{20} = 1; // L bit
591 let Inst{21} = 1; // W bit
592 let Inst{24} = 1; // P bit
593}
594
595// Pre-indexed stores
Evan Chengbe998242008-11-06 08:47:38 +0000596class AI3sthpr<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000597 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000598 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000599 asm, cstr, pattern> {
600 let Inst{4} = 1;
601 let Inst{5} = 1; // H bit
602 let Inst{6} = 0; // S bit
603 let Inst{7} = 1;
604 let Inst{20} = 0; // L bit
605 let Inst{21} = 1; // W bit
606 let Inst{24} = 1; // P bit
607}
608
609// Post-indexed loads
Evan Chengbe998242008-11-06 08:47:38 +0000610class AI3ldhpo<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000611 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000612 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000613 asm, cstr,pattern> {
614 let Inst{4} = 1;
615 let Inst{5} = 1; // H bit
616 let Inst{6} = 0; // S bit
617 let Inst{7} = 1;
618 let Inst{20} = 1; // L bit
619 let Inst{21} = 1; // W bit
620 let Inst{24} = 0; // P bit
621}
Evan Chengbe998242008-11-06 08:47:38 +0000622class AI3ldshpo<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000623 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000624 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000625 asm, cstr,pattern> {
626 let Inst{4} = 1;
627 let Inst{5} = 1; // H bit
628 let Inst{6} = 1; // S bit
629 let Inst{7} = 1;
630 let Inst{20} = 1; // L bit
631 let Inst{21} = 1; // W bit
632 let Inst{24} = 0; // P bit
633}
Evan Chengbe998242008-11-06 08:47:38 +0000634class AI3ldsbpo<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000635 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000636 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000637 asm, cstr,pattern> {
638 let Inst{4} = 1;
639 let Inst{5} = 0; // H bit
640 let Inst{6} = 1; // S bit
641 let Inst{7} = 1;
642 let Inst{20} = 1; // L bit
643 let Inst{21} = 1; // W bit
644 let Inst{24} = 0; // P bit
645}
646
647// Post-indexed stores
Evan Chengbe998242008-11-06 08:47:38 +0000648class AI3sthpo<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000649 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000650 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000651 asm, cstr,pattern> {
652 let Inst{4} = 1;
653 let Inst{5} = 1; // H bit
654 let Inst{6} = 0; // S bit
655 let Inst{7} = 1;
656 let Inst{20} = 0; // L bit
657 let Inst{21} = 1; // W bit
658 let Inst{24} = 0; // P bit
659}
660
661
Evan Cheng2e62b662008-09-01 01:51:14 +0000662// addrmode4 instructions
Evan Chengf8e8b622008-11-06 17:48:05 +0000663class AXI4ld<dag oops, dag iops, Format f, string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000664 : XI<oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm,
Evan Chengd36b01c2008-09-01 07:48:18 +0000665 "", pattern> {
666 let Inst{20} = 1; // L bit
667 let Inst{22} = 0; // S bit
Jim Grosbach88c246f2008-10-14 20:36:24 +0000668 let Inst{27-25} = 0b100;
Evan Chengd36b01c2008-09-01 07:48:18 +0000669}
Evan Chengf8e8b622008-11-06 17:48:05 +0000670class AXI4st<dag oops, dag iops, Format f, string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000671 : XI<oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm,
Evan Chengd36b01c2008-09-01 07:48:18 +0000672 "", pattern> {
673 let Inst{20} = 0; // L bit
674 let Inst{22} = 0; // S bit
Jim Grosbach88c246f2008-10-14 20:36:24 +0000675 let Inst{27-25} = 0b100;
Evan Chengd36b01c2008-09-01 07:48:18 +0000676}
Evan Cheng7b0249b2008-08-28 23:39:26 +0000677
Jim Grosbach1feed042008-11-03 18:38:31 +0000678// Unsigned multiply, multiply-accumulate instructions.
Evan Chengbe998242008-11-06 08:47:38 +0000679class AMul1I<bits<7> opcod, dag oops, dag iops, string opc,
Jim Grosbach1feed042008-11-03 18:38:31 +0000680 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000681 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000682 asm, "", pattern> {
Jim Grosbach1feed042008-11-03 18:38:31 +0000683 let Inst{7-4} = 0b1001;
Evan Chengee80fb72008-11-06 01:21:28 +0000684 let Inst{20} = 0; // S bit
Evan Chengbe998242008-11-06 08:47:38 +0000685 let Inst{27-21} = opcod;
Jim Grosbach1feed042008-11-03 18:38:31 +0000686}
Evan Chengbe998242008-11-06 08:47:38 +0000687class AsMul1I<bits<7> opcod, dag oops, dag iops, string opc,
Jim Grosbach1feed042008-11-03 18:38:31 +0000688 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000689 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000690 asm, "", pattern> {
Jim Grosbach1feed042008-11-03 18:38:31 +0000691 let Inst{7-4} = 0b1001;
Evan Chengbe998242008-11-06 08:47:38 +0000692 let Inst{27-21} = opcod;
Evan Chengee80fb72008-11-06 01:21:28 +0000693}
694
695// Most significant word multiply
Evan Chengbe998242008-11-06 08:47:38 +0000696class AMul2I<bits<7> opcod, dag oops, dag iops, string opc,
Evan Chengee80fb72008-11-06 01:21:28 +0000697 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000698 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000699 asm, "", pattern> {
Evan Chengee80fb72008-11-06 01:21:28 +0000700 let Inst{7-4} = 0b1001;
701 let Inst{20} = 1;
Evan Chengbe998242008-11-06 08:47:38 +0000702 let Inst{27-21} = opcod;
Jim Grosbach1feed042008-11-03 18:38:31 +0000703}
Evan Cheng7b0249b2008-08-28 23:39:26 +0000704
Evan Cheng38396be2008-11-06 03:35:07 +0000705// SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
Evan Chengbe998242008-11-06 08:47:38 +0000706class AMulxyI<bits<7> opcod, dag oops, dag iops, string opc,
Evan Cheng38396be2008-11-06 03:35:07 +0000707 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000708 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000709 asm, "", pattern> {
Evan Cheng38396be2008-11-06 03:35:07 +0000710 let Inst{4} = 0;
711 let Inst{7} = 1;
712 let Inst{20} = 0;
Evan Chengbe998242008-11-06 08:47:38 +0000713 let Inst{27-21} = opcod;
Evan Cheng38396be2008-11-06 03:35:07 +0000714}
715
Evan Cheng37afa432008-11-06 22:15:19 +0000716// Extend instructions.
717class AExtI<bits<8> opcod, dag oops, dag iops, string opc,
718 string asm, list<dag> pattern>
719 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ExtFrm, opc,
720 asm, "", pattern> {
721 let Inst{7-4} = 0b0111;
722 let Inst{27-20} = opcod;
723}
724
Evan Chengc2121a22008-11-07 01:41:35 +0000725// Misc Arithmetic instructions.
726class AMiscA1I<bits<8> opcod, dag oops, dag iops, string opc,
727 string asm, list<dag> pattern>
728 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ArithMiscFrm, opc,
729 asm, "", pattern> {
730 let Inst{27-20} = opcod;
731}
732
Evan Cheng7b0249b2008-08-28 23:39:26 +0000733//===----------------------------------------------------------------------===//
734
735// ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
736class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
737 list<Predicate> Predicates = [IsARM];
738}
739class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
740 list<Predicate> Predicates = [IsARM, HasV5TE];
741}
742class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
743 list<Predicate> Predicates = [IsARM, HasV6];
744}
Evan Cheng34a46e12008-08-29 06:41:12 +0000745
746//===----------------------------------------------------------------------===//
747//
748// Thumb Instruction Format Definitions.
749//
750
Evan Cheng34a46e12008-08-29 06:41:12 +0000751// TI - Thumb instruction.
752
753class ThumbI<dag outs, dag ins, AddrMode am, SizeFlagVal sz,
754 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000755 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
Evan Cheng34a46e12008-08-29 06:41:12 +0000756 let OutOperandList = outs;
757 let InOperandList = ins;
758 let AsmString = asm;
759 let Pattern = pattern;
760 list<Predicate> Predicates = [IsThumb];
761}
762
763class TI<dag outs, dag ins, string asm, list<dag> pattern>
764 : ThumbI<outs, ins, AddrModeNone, Size2Bytes, asm, "", pattern>;
Evan Cheng34a46e12008-08-29 06:41:12 +0000765
766// BL, BLX(1) are translated by assembler into two instructions
767class TIx2<dag outs, dag ins, string asm, list<dag> pattern>
768 : ThumbI<outs, ins, AddrModeNone, Size4Bytes, asm, "", pattern>;
769
770// BR_JT instructions
771class TJTI<dag outs, dag ins, string asm, list<dag> pattern>
772 : ThumbI<outs, ins, AddrModeNone, SizeSpecial, asm, "", pattern>;
773
Evan Cheng19bb7c72009-06-27 02:26:13 +0000774// TPat - Same as Pat<>, but requires that the compiler be in Thumb mode.
775class TPat<dag pattern, dag result> : Pat<pattern, result> {
Bob Wilsone60fee02009-06-22 23:27:02 +0000776 list<Predicate> Predicates = [IsThumb];
777}
778
Evan Cheng19bb7c72009-06-27 02:26:13 +0000779class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
Bob Wilsone60fee02009-06-22 23:27:02 +0000780 list<Predicate> Predicates = [IsThumb, HasV5T];
781}
Evan Cheng34a46e12008-08-29 06:41:12 +0000782
Evan Cheng6fc534c2009-06-23 19:38:13 +0000783// Thumb1 only
784class Thumb1I<dag outs, dag ins, AddrMode am, SizeFlagVal sz,
785 string asm, string cstr, list<dag> pattern>
786 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
787 let OutOperandList = outs;
788 let InOperandList = ins;
789 let AsmString = asm;
790 let Pattern = pattern;
791 list<Predicate> Predicates = [IsThumb1Only];
792}
793
794class T1I<dag outs, dag ins, string asm, list<dag> pattern>
795 : Thumb1I<outs, ins, AddrModeNone, Size2Bytes, asm, "", pattern>;
Evan Cheng532cdc52009-06-29 07:51:04 +0000796class T1I1<dag outs, dag ins, string asm, list<dag> pattern>
797 : Thumb1I<outs, ins, AddrModeT1_1, Size2Bytes, asm, "", pattern>;
798class T1I2<dag outs, dag ins, string asm, list<dag> pattern>
799 : Thumb1I<outs, ins, AddrModeT1_2, Size2Bytes, asm, "", pattern>;
800class T1I4<dag outs, dag ins, string asm, list<dag> pattern>
801 : Thumb1I<outs, ins, AddrModeT1_4, Size2Bytes, asm, "", pattern>;
802class T1Is<dag outs, dag ins, string asm, list<dag> pattern>
803 : Thumb1I<outs, ins, AddrModeT1_s, Size2Bytes, asm, "", pattern>;
David Goodwinf6154702009-06-30 18:04:13 +0000804class T1Ix2<dag outs, dag ins, string asm, list<dag> pattern>
805 : Thumb1I<outs, ins, AddrModeNone, Size4Bytes, asm, "", pattern>;
806class T1JTI<dag outs, dag ins, string asm, list<dag> pattern>
807 : Thumb1I<outs, ins, AddrModeNone, SizeSpecial, asm, "", pattern>;
Evan Cheng6fc534c2009-06-23 19:38:13 +0000808
809// Two-address instructions
810class T1It<dag outs, dag ins, string asm, list<dag> pattern>
811 : Thumb1I<outs, ins, AddrModeNone, Size2Bytes, asm, "$lhs = $dst", pattern>;
812
Evan Cheng19bb7c72009-06-27 02:26:13 +0000813class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Cheng6fc534c2009-06-23 19:38:13 +0000814 list<Predicate> Predicates = [IsThumb1Only];
815}
816
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000817// Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
818class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
819 string opc, string asm, string cstr, list<dag> pattern>
Evan Cheng36173712009-06-23 17:48:47 +0000820 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000821 let OutOperandList = oops;
822 let InOperandList = !con(iops, (ops pred:$p));
823 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
824 let Pattern = pattern;
825 list<Predicate> Predicates = [IsThumb, HasThumb2];
826}
827
828// Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as
829// an input operand since by default it's a zero register. It will
830// become an implicit def once it's "flipped".
831// FIXME: This uses unified syntax so {s} comes before {p}. We should make it
832// more consistent.
833class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
834 string opc, string asm, string cstr, list<dag> pattern>
835 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
836 let OutOperandList = oops;
837 let InOperandList = !con(iops, (ops pred:$p, cc_out:$s));
838 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
839 let Pattern = pattern;
840 list<Predicate> Predicates = [IsThumb, HasThumb2];
841}
842
843// Special cases
844class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
845 string asm, string cstr, list<dag> pattern>
846 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
847 let OutOperandList = oops;
848 let InOperandList = iops;
Evan Cheng36173712009-06-23 17:48:47 +0000849 let AsmString = asm;
850 let Pattern = pattern;
851 list<Predicate> Predicates = [IsThumb, HasThumb2];
852}
853
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000854class T2I<dag oops, dag iops, string opc, string asm, list<dag> pattern>
855 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, opc, asm, "", pattern>;
Evan Cheng532cdc52009-06-29 07:51:04 +0000856class T2Ii12<dag oops, dag iops, string opc, string asm, list<dag> pattern>
857 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, opc, asm, "", pattern>;
858class T2Ii8<dag oops, dag iops, string opc, string asm, list<dag> pattern>
859 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, opc, asm, "", pattern>;
860class T2Iso<dag oops, dag iops, string opc, string asm, list<dag> pattern>
861 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, opc, asm, "", pattern>;
862class T2Ipc<dag oops, dag iops, string opc, string asm, list<dag> pattern>
863 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, opc, asm, "", pattern>;
Evan Cheng503be112009-06-30 02:15:48 +0000864class T2Ii8s4<dag oops, dag iops, string opc, string asm, list<dag> pattern>
865 : Thumb2I<oops, iops, AddrModeT2_i8s4, Size4Bytes, opc, asm, "", pattern>;
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000866
867class T2sI<dag oops, dag iops, string opc, string asm, list<dag> pattern>
868 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, opc, asm, "", pattern>;
869
870class T2XI<dag oops, dag iops, string asm, list<dag> pattern>
871 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, asm, "", pattern>;
David Goodwinf6154702009-06-30 18:04:13 +0000872class T2JTI<dag oops, dag iops, string asm, list<dag> pattern>
873 : Thumb2XI<oops, iops, AddrModeNone, SizeSpecial, asm, "", pattern>;
Evan Cheng36173712009-06-23 17:48:47 +0000874
Evan Cheng19bb7c72009-06-27 02:26:13 +0000875// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
876class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Cheng36173712009-06-23 17:48:47 +0000877 list<Predicate> Predicates = [IsThumb, HasThumb2];
878}
879
Evan Cheng34a46e12008-08-29 06:41:12 +0000880//===----------------------------------------------------------------------===//
881
Evan Chengc63e15e2008-11-11 02:11:05 +0000882//===----------------------------------------------------------------------===//
883// ARM VFP Instruction templates.
884//
885
Evan Chengbb786b32008-11-11 21:48:44 +0000886// ARM VFP addrmode5 loads and stores
887class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
888 string opc, string asm, list<dag> pattern>
Evan Chengc63e15e2008-11-11 02:11:05 +0000889 : I<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Evan Chengbb786b32008-11-11 21:48:44 +0000890 VFPLdStFrm, opc, asm, "", pattern> {
Evan Chengc63e15e2008-11-11 02:11:05 +0000891 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengbb786b32008-11-11 21:48:44 +0000892 let Inst{27-24} = opcod1;
893 let Inst{21-20} = opcod2;
894 let Inst{11-8} = 0b1011;
Evan Chengc63e15e2008-11-11 02:11:05 +0000895}
896
Evan Chengbb786b32008-11-11 21:48:44 +0000897class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
898 string opc, string asm, list<dag> pattern>
Evan Chengc63e15e2008-11-11 02:11:05 +0000899 : I<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Evan Chengbb786b32008-11-11 21:48:44 +0000900 VFPLdStFrm, opc, asm, "", pattern> {
Evan Chengc63e15e2008-11-11 02:11:05 +0000901 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengbb786b32008-11-11 21:48:44 +0000902 let Inst{27-24} = opcod1;
903 let Inst{21-20} = opcod2;
904 let Inst{11-8} = 0b1010;
Evan Chengc63e15e2008-11-11 02:11:05 +0000905}
906
Evan Chengbb786b32008-11-11 21:48:44 +0000907// Load / store multiple
908class AXSI5<dag oops, dag iops, string asm, list<dag> pattern>
909 : XI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
910 VFPLdStMulFrm, asm, "", pattern> {
911 // TODO: Mark the instructions with the appropriate subtarget info.
912 let Inst{27-25} = 0b110;
913 let Inst{11-8} = 0b1011;
914}
915
916class AXDI5<dag oops, dag iops, string asm, list<dag> pattern>
917 : XI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
918 VFPLdStMulFrm, asm, "", pattern> {
919 // TODO: Mark the instructions with the appropriate subtarget info.
920 let Inst{27-25} = 0b110;
921 let Inst{11-8} = 0b1010;
922}
923
924
Evan Chengc63e15e2008-11-11 02:11:05 +0000925// Double precision, unary
926class ADuI<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3, dag oops, dag iops,
927 string opc, string asm, list<dag> pattern>
928 : AI<oops, iops, VFPUnaryFrm, opc, asm, pattern> {
929 let Inst{27-20} = opcod1;
930 let Inst{19-16} = opcod2;
931 let Inst{11-8} = 0b1011;
932 let Inst{7-4} = opcod3;
933}
934
935// Double precision, binary
936class ADbI<bits<8> opcod, dag oops, dag iops, string opc,
937 string asm, list<dag> pattern>
938 : AI<oops, iops, VFPBinaryFrm, opc, asm, pattern> {
939 let Inst{27-20} = opcod;
940 let Inst{11-8} = 0b1011;
941}
942
943// Single precision, unary
944class ASuI<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3, dag oops, dag iops,
945 string opc, string asm, list<dag> pattern>
946 : AI<oops, iops, VFPUnaryFrm, opc, asm, pattern> {
947 // Bits 22 (D bit) and 5 (M bit) will be changed during instruction encoding.
948 let Inst{27-20} = opcod1;
949 let Inst{19-16} = opcod2;
950 let Inst{11-8} = 0b1010;
951 let Inst{7-4} = opcod3;
952}
953
954// Single precision, binary
955class ASbI<bits<8> opcod, dag oops, dag iops, string opc,
956 string asm, list<dag> pattern>
957 : AI<oops, iops, VFPBinaryFrm, opc, asm, pattern> {
958 // Bit 22 (D bit) can be changed during instruction encoding.
959 let Inst{27-20} = opcod;
960 let Inst{11-8} = 0b1010;
961}
962
Evan Cheng74273382008-11-12 06:41:41 +0000963// VFP conversion instructions
964class AVConv1I<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3,
965 dag oops, dag iops, string opc, string asm, list<dag> pattern>
Evan Cheng9d3cc182008-11-11 19:40:26 +0000966 : AI<oops, iops, VFPConv1Frm, opc, asm, pattern> {
967 let Inst{27-20} = opcod1;
Evan Cheng74273382008-11-12 06:41:41 +0000968 let Inst{19-16} = opcod2;
969 let Inst{11-8} = opcod3;
970 let Inst{6} = 1;
971}
972
973class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
974 string opc, string asm, list<dag> pattern>
975 : AI<oops, iops, f, opc, asm, pattern> {
976 let Inst{27-20} = opcod1;
Evan Cheng9d3cc182008-11-11 19:40:26 +0000977 let Inst{11-8} = opcod2;
978 let Inst{4} = 1;
979}
980
Evan Cheng828ccdc2008-11-11 22:46:12 +0000981class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
Evan Cheng74273382008-11-12 06:41:41 +0000982 string asm, list<dag> pattern>
983 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, opc, asm, pattern>;
Evan Cheng828ccdc2008-11-11 22:46:12 +0000984
Evan Cheng74273382008-11-12 06:41:41 +0000985class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
986 string asm, list<dag> pattern>
987 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, opc, asm, pattern>;
988
989class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
990 string asm, list<dag> pattern>
991 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, opc, asm, pattern>;
992
993class AVConv5I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
994 string asm, list<dag> pattern>
995 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv5Frm, opc, asm, pattern>;
Evan Cheng9d3cc182008-11-11 19:40:26 +0000996
Evan Chengc63e15e2008-11-11 02:11:05 +0000997//===----------------------------------------------------------------------===//
998
Bob Wilsone60fee02009-06-22 23:27:02 +0000999//===----------------------------------------------------------------------===//
1000// ARM NEON Instruction templates.
1001//
Evan Cheng34a46e12008-08-29 06:41:12 +00001002
Bob Wilsone60fee02009-06-22 23:27:02 +00001003class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, string asm,
1004 string cstr, list<dag> pattern>
1005 : InstARM<am, Size4Bytes, im, NEONFrm, cstr> {
1006 let OutOperandList = oops;
1007 let InOperandList = iops;
1008 let AsmString = asm;
1009 let Pattern = pattern;
1010 list<Predicate> Predicates = [HasNEON];
Evan Cheng34a46e12008-08-29 06:41:12 +00001011}
1012
Bob Wilsone60fee02009-06-22 23:27:02 +00001013class NI<dag oops, dag iops, string asm, list<dag> pattern>
1014 : NeonI<oops, iops, AddrModeNone, IndexModeNone, asm, "", pattern> {
Evan Cheng34a46e12008-08-29 06:41:12 +00001015}
Bob Wilsone60fee02009-06-22 23:27:02 +00001016
1017class NDataI<dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1018 : NeonI<oops, iops, AddrModeNone, IndexModeNone, asm, cstr, pattern> {
1019 let Inst{31-25} = 0b1111001;
1020}
1021
1022// NEON "one register and a modified immediate" format.
1023class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1024 bit op5, bit op4,
1025 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1026 : NDataI<oops, iops, asm, cstr, pattern> {
1027 let Inst{23} = op23;
1028 let Inst{21-19} = op21_19;
1029 let Inst{11-8} = op11_8;
1030 let Inst{7} = op7;
1031 let Inst{6} = op6;
1032 let Inst{5} = op5;
1033 let Inst{4} = op4;
1034}
1035
1036// NEON 2 vector register format.
1037class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1038 bits<5> op11_7, bit op6, bit op4,
1039 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1040 : NDataI<oops, iops, asm, cstr, pattern> {
1041 let Inst{24-23} = op24_23;
1042 let Inst{21-20} = op21_20;
1043 let Inst{19-18} = op19_18;
1044 let Inst{17-16} = op17_16;
1045 let Inst{11-7} = op11_7;
1046 let Inst{6} = op6;
1047 let Inst{4} = op4;
1048}
1049
1050// NEON 2 vector register with immediate.
1051class N2VImm<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
1052 bit op6, bit op4,
1053 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1054 : NDataI<oops, iops, asm, cstr, pattern> {
1055 let Inst{24} = op24;
1056 let Inst{23} = op23;
1057 let Inst{21-16} = op21_16;
1058 let Inst{11-8} = op11_8;
1059 let Inst{7} = op7;
1060 let Inst{6} = op6;
1061 let Inst{4} = op4;
1062}
1063
1064// NEON 3 vector register format.
1065class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
1066 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1067 : NDataI<oops, iops, asm, cstr, pattern> {
1068 let Inst{24} = op24;
1069 let Inst{23} = op23;
1070 let Inst{21-20} = op21_20;
1071 let Inst{11-8} = op11_8;
1072 let Inst{6} = op6;
1073 let Inst{4} = op4;
1074}
1075
1076// NEON VMOVs between scalar and core registers.
1077class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1078 dag oops, dag iops, Format f, string opc, string asm,
1079 list<dag> pattern>
1080 : AI<oops, iops, f, opc, asm, pattern> {
1081 let Inst{27-20} = opcod1;
1082 let Inst{11-8} = opcod2;
1083 let Inst{6-5} = opcod3;
1084 let Inst{4} = 1;
1085 list<Predicate> Predicates = [HasNEON];
1086}
1087class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1088 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1089 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONGetLnFrm, opc, asm,
1090 pattern>;
1091class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1092 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1093 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONSetLnFrm, opc, asm,
1094 pattern>;
1095class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1096 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1097 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONDupFrm, opc, asm, pattern>;