blob: f49e38fb2ceedc3508c7d9167782e5327704e437 [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>;
Evan Cheng6fc534c2009-06-23 19:38:13 +0000804
805// Two-address instructions
806class T1It<dag outs, dag ins, string asm, list<dag> pattern>
807 : Thumb1I<outs, ins, AddrModeNone, Size2Bytes, asm, "$lhs = $dst", pattern>;
808
Evan Cheng19bb7c72009-06-27 02:26:13 +0000809class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Cheng6fc534c2009-06-23 19:38:13 +0000810 list<Predicate> Predicates = [IsThumb1Only];
811}
812
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000813// Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
814class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
815 string opc, string asm, string cstr, list<dag> pattern>
Evan Cheng36173712009-06-23 17:48:47 +0000816 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000817 let OutOperandList = oops;
818 let InOperandList = !con(iops, (ops pred:$p));
819 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
820 let Pattern = pattern;
821 list<Predicate> Predicates = [IsThumb, HasThumb2];
822}
823
824// Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as
825// an input operand since by default it's a zero register. It will
826// become an implicit def once it's "flipped".
827// FIXME: This uses unified syntax so {s} comes before {p}. We should make it
828// more consistent.
829class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
830 string opc, string asm, string cstr, list<dag> pattern>
831 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
832 let OutOperandList = oops;
833 let InOperandList = !con(iops, (ops pred:$p, cc_out:$s));
834 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
835 let Pattern = pattern;
836 list<Predicate> Predicates = [IsThumb, HasThumb2];
837}
838
839// Special cases
840class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
841 string asm, string cstr, list<dag> pattern>
842 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
843 let OutOperandList = oops;
844 let InOperandList = iops;
Evan Cheng36173712009-06-23 17:48:47 +0000845 let AsmString = asm;
846 let Pattern = pattern;
847 list<Predicate> Predicates = [IsThumb, HasThumb2];
848}
849
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000850class T2I<dag oops, dag iops, string opc, string asm, list<dag> pattern>
851 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, opc, asm, "", pattern>;
Evan Cheng532cdc52009-06-29 07:51:04 +0000852class T2Ii12<dag oops, dag iops, string opc, string asm, list<dag> pattern>
853 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, opc, asm, "", pattern>;
854class T2Ii8<dag oops, dag iops, string opc, string asm, list<dag> pattern>
855 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, opc, asm, "", pattern>;
856class T2Iso<dag oops, dag iops, string opc, string asm, list<dag> pattern>
857 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, opc, asm, "", pattern>;
858class T2Ipc<dag oops, dag iops, string opc, string asm, list<dag> pattern>
859 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, opc, asm, "", pattern>;
Evan Cheng503be112009-06-30 02:15:48 +0000860class T2Ii8s4<dag oops, dag iops, string opc, string asm, list<dag> pattern>
861 : Thumb2I<oops, iops, AddrModeT2_i8s4, Size4Bytes, opc, asm, "", pattern>;
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000862
863class T2sI<dag oops, dag iops, string opc, string asm, list<dag> pattern>
864 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, opc, asm, "", pattern>;
865
866class T2XI<dag oops, dag iops, string asm, list<dag> pattern>
867 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, asm, "", pattern>;
Evan Cheng36173712009-06-23 17:48:47 +0000868
Evan Cheng19bb7c72009-06-27 02:26:13 +0000869// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
870class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Cheng36173712009-06-23 17:48:47 +0000871 list<Predicate> Predicates = [IsThumb, HasThumb2];
872}
873
Evan Cheng34a46e12008-08-29 06:41:12 +0000874//===----------------------------------------------------------------------===//
875
Evan Chengc63e15e2008-11-11 02:11:05 +0000876//===----------------------------------------------------------------------===//
877// ARM VFP Instruction templates.
878//
879
Evan Chengbb786b32008-11-11 21:48:44 +0000880// ARM VFP addrmode5 loads and stores
881class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
882 string opc, string asm, list<dag> pattern>
Evan Chengc63e15e2008-11-11 02:11:05 +0000883 : I<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Evan Chengbb786b32008-11-11 21:48:44 +0000884 VFPLdStFrm, opc, asm, "", pattern> {
Evan Chengc63e15e2008-11-11 02:11:05 +0000885 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengbb786b32008-11-11 21:48:44 +0000886 let Inst{27-24} = opcod1;
887 let Inst{21-20} = opcod2;
888 let Inst{11-8} = 0b1011;
Evan Chengc63e15e2008-11-11 02:11:05 +0000889}
890
Evan Chengbb786b32008-11-11 21:48:44 +0000891class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
892 string opc, string asm, list<dag> pattern>
Evan Chengc63e15e2008-11-11 02:11:05 +0000893 : I<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Evan Chengbb786b32008-11-11 21:48:44 +0000894 VFPLdStFrm, opc, asm, "", pattern> {
Evan Chengc63e15e2008-11-11 02:11:05 +0000895 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengbb786b32008-11-11 21:48:44 +0000896 let Inst{27-24} = opcod1;
897 let Inst{21-20} = opcod2;
898 let Inst{11-8} = 0b1010;
Evan Chengc63e15e2008-11-11 02:11:05 +0000899}
900
Evan Chengbb786b32008-11-11 21:48:44 +0000901// Load / store multiple
902class AXSI5<dag oops, dag iops, string asm, list<dag> pattern>
903 : XI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
904 VFPLdStMulFrm, asm, "", pattern> {
905 // TODO: Mark the instructions with the appropriate subtarget info.
906 let Inst{27-25} = 0b110;
907 let Inst{11-8} = 0b1011;
908}
909
910class AXDI5<dag oops, dag iops, string asm, list<dag> pattern>
911 : XI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
912 VFPLdStMulFrm, asm, "", pattern> {
913 // TODO: Mark the instructions with the appropriate subtarget info.
914 let Inst{27-25} = 0b110;
915 let Inst{11-8} = 0b1010;
916}
917
918
Evan Chengc63e15e2008-11-11 02:11:05 +0000919// Double precision, unary
920class ADuI<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3, dag oops, dag iops,
921 string opc, string asm, list<dag> pattern>
922 : AI<oops, iops, VFPUnaryFrm, opc, asm, pattern> {
923 let Inst{27-20} = opcod1;
924 let Inst{19-16} = opcod2;
925 let Inst{11-8} = 0b1011;
926 let Inst{7-4} = opcod3;
927}
928
929// Double precision, binary
930class ADbI<bits<8> opcod, dag oops, dag iops, string opc,
931 string asm, list<dag> pattern>
932 : AI<oops, iops, VFPBinaryFrm, opc, asm, pattern> {
933 let Inst{27-20} = opcod;
934 let Inst{11-8} = 0b1011;
935}
936
937// Single precision, unary
938class ASuI<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3, dag oops, dag iops,
939 string opc, string asm, list<dag> pattern>
940 : AI<oops, iops, VFPUnaryFrm, opc, asm, pattern> {
941 // Bits 22 (D bit) and 5 (M bit) will be changed during instruction encoding.
942 let Inst{27-20} = opcod1;
943 let Inst{19-16} = opcod2;
944 let Inst{11-8} = 0b1010;
945 let Inst{7-4} = opcod3;
946}
947
948// Single precision, binary
949class ASbI<bits<8> opcod, dag oops, dag iops, string opc,
950 string asm, list<dag> pattern>
951 : AI<oops, iops, VFPBinaryFrm, opc, asm, pattern> {
952 // Bit 22 (D bit) can be changed during instruction encoding.
953 let Inst{27-20} = opcod;
954 let Inst{11-8} = 0b1010;
955}
956
Evan Cheng74273382008-11-12 06:41:41 +0000957// VFP conversion instructions
958class AVConv1I<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3,
959 dag oops, dag iops, string opc, string asm, list<dag> pattern>
Evan Cheng9d3cc182008-11-11 19:40:26 +0000960 : AI<oops, iops, VFPConv1Frm, opc, asm, pattern> {
961 let Inst{27-20} = opcod1;
Evan Cheng74273382008-11-12 06:41:41 +0000962 let Inst{19-16} = opcod2;
963 let Inst{11-8} = opcod3;
964 let Inst{6} = 1;
965}
966
967class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
968 string opc, string asm, list<dag> pattern>
969 : AI<oops, iops, f, opc, asm, pattern> {
970 let Inst{27-20} = opcod1;
Evan Cheng9d3cc182008-11-11 19:40:26 +0000971 let Inst{11-8} = opcod2;
972 let Inst{4} = 1;
973}
974
Evan Cheng828ccdc2008-11-11 22:46:12 +0000975class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
Evan Cheng74273382008-11-12 06:41:41 +0000976 string asm, list<dag> pattern>
977 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, opc, asm, pattern>;
Evan Cheng828ccdc2008-11-11 22:46:12 +0000978
Evan Cheng74273382008-11-12 06:41:41 +0000979class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
980 string asm, list<dag> pattern>
981 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, opc, asm, pattern>;
982
983class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
984 string asm, list<dag> pattern>
985 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, opc, asm, pattern>;
986
987class AVConv5I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
988 string asm, list<dag> pattern>
989 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv5Frm, opc, asm, pattern>;
Evan Cheng9d3cc182008-11-11 19:40:26 +0000990
Evan Chengc63e15e2008-11-11 02:11:05 +0000991//===----------------------------------------------------------------------===//
992
Bob Wilsone60fee02009-06-22 23:27:02 +0000993//===----------------------------------------------------------------------===//
994// ARM NEON Instruction templates.
995//
Evan Cheng34a46e12008-08-29 06:41:12 +0000996
Bob Wilsone60fee02009-06-22 23:27:02 +0000997class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, string asm,
998 string cstr, list<dag> pattern>
999 : InstARM<am, Size4Bytes, im, NEONFrm, cstr> {
1000 let OutOperandList = oops;
1001 let InOperandList = iops;
1002 let AsmString = asm;
1003 let Pattern = pattern;
1004 list<Predicate> Predicates = [HasNEON];
Evan Cheng34a46e12008-08-29 06:41:12 +00001005}
1006
Bob Wilsone60fee02009-06-22 23:27:02 +00001007class NI<dag oops, dag iops, string asm, list<dag> pattern>
1008 : NeonI<oops, iops, AddrModeNone, IndexModeNone, asm, "", pattern> {
Evan Cheng34a46e12008-08-29 06:41:12 +00001009}
Bob Wilsone60fee02009-06-22 23:27:02 +00001010
1011class NDataI<dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1012 : NeonI<oops, iops, AddrModeNone, IndexModeNone, asm, cstr, pattern> {
1013 let Inst{31-25} = 0b1111001;
1014}
1015
1016// NEON "one register and a modified immediate" format.
1017class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1018 bit op5, bit op4,
1019 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1020 : NDataI<oops, iops, asm, cstr, pattern> {
1021 let Inst{23} = op23;
1022 let Inst{21-19} = op21_19;
1023 let Inst{11-8} = op11_8;
1024 let Inst{7} = op7;
1025 let Inst{6} = op6;
1026 let Inst{5} = op5;
1027 let Inst{4} = op4;
1028}
1029
1030// NEON 2 vector register format.
1031class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1032 bits<5> op11_7, bit op6, bit op4,
1033 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1034 : NDataI<oops, iops, asm, cstr, pattern> {
1035 let Inst{24-23} = op24_23;
1036 let Inst{21-20} = op21_20;
1037 let Inst{19-18} = op19_18;
1038 let Inst{17-16} = op17_16;
1039 let Inst{11-7} = op11_7;
1040 let Inst{6} = op6;
1041 let Inst{4} = op4;
1042}
1043
1044// NEON 2 vector register with immediate.
1045class N2VImm<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
1046 bit op6, bit op4,
1047 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1048 : NDataI<oops, iops, asm, cstr, pattern> {
1049 let Inst{24} = op24;
1050 let Inst{23} = op23;
1051 let Inst{21-16} = op21_16;
1052 let Inst{11-8} = op11_8;
1053 let Inst{7} = op7;
1054 let Inst{6} = op6;
1055 let Inst{4} = op4;
1056}
1057
1058// NEON 3 vector register format.
1059class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
1060 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1061 : NDataI<oops, iops, asm, cstr, pattern> {
1062 let Inst{24} = op24;
1063 let Inst{23} = op23;
1064 let Inst{21-20} = op21_20;
1065 let Inst{11-8} = op11_8;
1066 let Inst{6} = op6;
1067 let Inst{4} = op4;
1068}
1069
1070// NEON VMOVs between scalar and core registers.
1071class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1072 dag oops, dag iops, Format f, string opc, string asm,
1073 list<dag> pattern>
1074 : AI<oops, iops, f, opc, asm, pattern> {
1075 let Inst{27-20} = opcod1;
1076 let Inst{11-8} = opcod2;
1077 let Inst{6-5} = opcod3;
1078 let Inst{4} = 1;
1079 list<Predicate> Predicates = [HasNEON];
1080}
1081class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1082 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1083 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONGetLnFrm, opc, asm,
1084 pattern>;
1085class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1086 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1087 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONSetLnFrm, opc, asm,
1088 pattern>;
1089class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1090 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1091 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONDupFrm, opc, asm, pattern>;