blob: a98bf1e85676a1f122f49b9274e906a385299fed [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>;
82def AddrModeT2_pc : AddrMode<13>;
83
84// Instruction size.
85class SizeFlagVal<bits<3> val> {
86 bits<3> Value = val;
87}
88def SizeInvalid : SizeFlagVal<0>; // Unset.
89def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
90def Size8Bytes : SizeFlagVal<2>;
91def Size4Bytes : SizeFlagVal<3>;
92def Size2Bytes : SizeFlagVal<4>;
93
94// Load / store index mode.
95class IndexMode<bits<2> val> {
96 bits<2> Value = val;
97}
98def IndexModeNone : IndexMode<0>;
99def IndexModePre : IndexMode<1>;
100def IndexModePost : IndexMode<2>;
101
102//===----------------------------------------------------------------------===//
Evan Cheng7b0249b2008-08-28 23:39:26 +0000103
104// ARM Instruction templates.
105//
106
Evan Chengbe998242008-11-06 08:47:38 +0000107class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000108 Format f, string cstr>
109 : Instruction {
Evan Chengd0750352008-08-29 07:40:52 +0000110 field bits<32> Inst;
111
Evan Cheng7b0249b2008-08-28 23:39:26 +0000112 let Namespace = "ARM";
113
Evan Cheng86a926a2008-11-05 18:35:52 +0000114 // TSFlagsFields
Evan Cheng7b0249b2008-08-28 23:39:26 +0000115 AddrMode AM = am;
116 bits<4> AddrModeBits = AM.Value;
117
118 SizeFlagVal SZ = sz;
119 bits<3> SizeFlag = SZ.Value;
120
121 IndexMode IM = im;
122 bits<2> IndexModeBits = IM.Value;
123
124 Format F = f;
125 bits<5> Form = F.Value;
Evan Cheng86a926a2008-11-05 18:35:52 +0000126
127 //
128 // Attributes specific to ARM instructions...
129 //
130 bit isUnaryDataProc = 0;
Evan Cheng7b0249b2008-08-28 23:39:26 +0000131
132 let Constraints = cstr;
133}
134
135class PseudoInst<dag oops, dag iops, string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000136 : InstARM<AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, ""> {
Evan Cheng7b0249b2008-08-28 23:39:26 +0000137 let OutOperandList = oops;
138 let InOperandList = iops;
139 let AsmString = asm;
140 let Pattern = pattern;
141}
142
143// Almost all ARM instructions are predicable.
Evan Chengbe998242008-11-06 08:47:38 +0000144class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000145 IndexMode im, Format f, string opc, string asm, string cstr,
146 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000147 : InstARM<am, sz, im, f, cstr> {
Evan Cheng7b0249b2008-08-28 23:39:26 +0000148 let OutOperandList = oops;
149 let InOperandList = !con(iops, (ops pred:$p));
150 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
151 let Pattern = pattern;
152 list<Predicate> Predicates = [IsARM];
153}
154
155// Same as I except it can optionally modify CPSR. Note it's modeled as
156// an input operand since by default it's a zero register. It will
157// become an implicit def once it's "flipped".
Evan Chengbe998242008-11-06 08:47:38 +0000158class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000159 IndexMode im, Format f, string opc, string asm, string cstr,
160 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000161 : InstARM<am, sz, im, f, cstr> {
Evan Cheng7b0249b2008-08-28 23:39:26 +0000162 let OutOperandList = oops;
163 let InOperandList = !con(iops, (ops pred:$p, cc_out:$s));
164 let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm));
165 let Pattern = pattern;
166 list<Predicate> Predicates = [IsARM];
167}
168
Evan Chengc5409a82008-09-01 07:19:00 +0000169// Special cases
Evan Chengbe998242008-11-06 08:47:38 +0000170class XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Evan Chengc5409a82008-09-01 07:19:00 +0000171 IndexMode im, Format f, string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000172 : InstARM<am, sz, im, f, cstr> {
Evan Chengc5409a82008-09-01 07:19:00 +0000173 let OutOperandList = oops;
174 let InOperandList = iops;
175 let AsmString = asm;
176 let Pattern = pattern;
177 list<Predicate> Predicates = [IsARM];
178}
179
Evan Chengbe998242008-11-06 08:47:38 +0000180class AI<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000181 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000182 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000183 asm, "", pattern>;
Evan Chengbe998242008-11-06 08:47:38 +0000184class AsI<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000185 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000186 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000187 asm, "", pattern>;
Evan Chengbe998242008-11-06 08:47:38 +0000188class AXI<dag oops, dag iops, Format f, string asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000189 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000190 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000191 "", pattern>;
Evan Cheng10a9eb82008-09-01 08:25:56 +0000192
193// Ctrl flow instructions
Evan Chengf8e8b622008-11-06 17:48:05 +0000194class ABI<bits<4> opcod, dag oops, dag iops, string opc,
Evan Cheng10a9eb82008-09-01 08:25:56 +0000195 string asm, list<dag> pattern>
Evan Chengf8e8b622008-11-06 17:48:05 +0000196 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000197 asm, "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000198 let Inst{27-24} = opcod;
Evan Cheng10a9eb82008-09-01 08:25:56 +0000199}
Evan Chengf8e8b622008-11-06 17:48:05 +0000200class ABXI<bits<4> opcod, dag oops, dag iops, string asm, list<dag> pattern>
201 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, asm,
Evan Cheng10a9eb82008-09-01 08:25:56 +0000202 "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000203 let Inst{27-24} = opcod;
Evan Cheng10a9eb82008-09-01 08:25:56 +0000204}
Evan Chengf8e8b622008-11-06 17:48:05 +0000205class ABXIx2<dag oops, dag iops, string asm, list<dag> pattern>
206 : XI<oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, BrMiscFrm, asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000207 "", pattern>;
Evan Cheng10a9eb82008-09-01 08:25:56 +0000208
209// BR_JT instructions
Evan Cheng0f63ae12008-11-07 09:06:08 +0000210class JTI<dag oops, dag iops, string asm, list<dag> pattern>
Evan Chengf8e8b622008-11-06 17:48:05 +0000211 : XI<oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BrMiscFrm,
Evan Cheng0f63ae12008-11-07 09:06:08 +0000212 asm, "", pattern>;
Evan Cheng2e62b662008-09-01 01:51:14 +0000213
214// addrmode1 instructions
Evan Cheng7b0249b2008-08-28 23:39:26 +0000215class AI1<bits<4> opcod, dag oops, dag iops, Format f, string opc,
216 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000217 : I<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc,
Evan Chengd0750352008-08-29 07:40:52 +0000218 asm, "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000219 let Inst{24-21} = opcod;
220 let Inst{27-26} = {0,0};
Evan Chengd0750352008-08-29 07:40:52 +0000221}
Evan Cheng7b0249b2008-08-28 23:39:26 +0000222class AsI1<bits<4> opcod, dag oops, dag iops, Format f, string opc,
223 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000224 : sI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc,
Evan Chengd0750352008-08-29 07:40:52 +0000225 asm, "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000226 let Inst{24-21} = opcod;
227 let Inst{27-26} = {0,0};
Evan Chengd0750352008-08-29 07:40:52 +0000228}
Evan Chengc5409a82008-09-01 07:19:00 +0000229class AXI1<bits<4> opcod, dag oops, dag iops, Format f, string asm,
230 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000231 : XI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000232 "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000233 let Inst{24-21} = opcod;
234 let Inst{27-26} = {0,0};
Evan Chengc5409a82008-09-01 07:19:00 +0000235}
Evan Chengbe998242008-11-06 08:47:38 +0000236class AI1x2<dag oops, dag iops, Format f, string opc,
Evan Cheng2e62b662008-09-01 01:51:14 +0000237 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000238 : I<oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, opc,
Evan Cheng2e62b662008-09-01 01:51:14 +0000239 asm, "", pattern>;
Evan Chengda020022008-08-31 19:02:21 +0000240
Evan Cheng2e62b662008-09-01 01:51:14 +0000241
242// addrmode2 loads and stores
Evan Chengbe998242008-11-06 08:47:38 +0000243class AI2<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000244 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000245 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengda020022008-08-31 19:02:21 +0000246 asm, "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000247 let Inst{27-26} = {0,1};
Evan Chengda020022008-08-31 19:02:21 +0000248}
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000249
250// loads
Evan Chengbe998242008-11-06 08:47:38 +0000251class AI2ldw<dag oops, dag iops, Format f, string opc,
Evan Chengda020022008-08-31 19:02:21 +0000252 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000253 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengc41fb3152008-11-05 23:22:34 +0000254 asm, "", pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000255 let Inst{20} = 1; // L bit
Evan Chengda020022008-08-31 19:02:21 +0000256 let Inst{21} = 0; // W bit
257 let Inst{22} = 0; // B bit
258 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000259 let Inst{27-26} = {0,1};
Evan Chengda020022008-08-31 19:02:21 +0000260}
Evan Chengbe998242008-11-06 08:47:38 +0000261class AXI2ldw<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000262 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000263 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000264 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000265 let Inst{20} = 1; // L bit
266 let Inst{21} = 0; // W bit
267 let Inst{22} = 0; // B bit
268 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000269 let Inst{27-26} = {0,1};
Evan Chengae7b1d72008-09-01 07:34:13 +0000270}
Evan Chengbe998242008-11-06 08:47:38 +0000271class AI2ldb<dag oops, dag iops, Format f, string opc,
Evan Chengda020022008-08-31 19:02:21 +0000272 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000273 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengc41fb3152008-11-05 23:22:34 +0000274 asm, "", pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000275 let Inst{20} = 1; // L bit
Evan Chengda020022008-08-31 19:02:21 +0000276 let Inst{21} = 0; // W bit
277 let Inst{22} = 1; // B bit
278 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000279 let Inst{27-26} = {0,1};
Evan Chengda020022008-08-31 19:02:21 +0000280}
Evan Chengbe998242008-11-06 08:47:38 +0000281class AXI2ldb<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000282 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000283 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000284 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000285 let Inst{20} = 1; // L bit
286 let Inst{21} = 0; // W bit
287 let Inst{22} = 1; // B bit
288 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000289 let Inst{27-26} = {0,1};
Evan Chengae7b1d72008-09-01 07:34:13 +0000290}
Evan Chengda020022008-08-31 19:02:21 +0000291
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000292// stores
Evan Chengbe998242008-11-06 08:47:38 +0000293class AI2stw<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000294 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000295 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengc41fb3152008-11-05 23:22:34 +0000296 asm, "", pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000297 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000298 let Inst{21} = 0; // W bit
299 let Inst{22} = 0; // B bit
300 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000301 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000302}
Evan Chengbe998242008-11-06 08:47:38 +0000303class AXI2stw<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000304 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000305 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000306 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000307 let Inst{20} = 0; // L bit
308 let Inst{21} = 0; // W bit
309 let Inst{22} = 0; // B bit
310 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000311 let Inst{27-26} = {0,1};
Evan Chengae7b1d72008-09-01 07:34:13 +0000312}
Evan Chengbe998242008-11-06 08:47:38 +0000313class AI2stb<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000314 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000315 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengc41fb3152008-11-05 23:22:34 +0000316 asm, "", pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000317 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000318 let Inst{21} = 0; // W bit
319 let Inst{22} = 1; // B bit
320 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000321 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000322}
Evan Chengbe998242008-11-06 08:47:38 +0000323class AXI2stb<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000324 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000325 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000326 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000327 let Inst{20} = 0; // L bit
328 let Inst{21} = 0; // W bit
329 let Inst{22} = 1; // B bit
330 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000331 let Inst{27-26} = {0,1};
Evan Chengae7b1d72008-09-01 07:34:13 +0000332}
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000333
Evan Chengac92c3f2008-09-01 07:00:14 +0000334// Pre-indexed loads
Evan Chengbe998242008-11-06 08:47:38 +0000335class AI2ldwpr<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000336 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000337 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000338 asm, cstr, pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000339 let Inst{20} = 1; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000340 let Inst{21} = 1; // W bit
341 let Inst{22} = 0; // B bit
342 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000343 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000344}
Evan Chengbe998242008-11-06 08:47:38 +0000345class AI2ldbpr<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000346 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000347 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000348 asm, cstr, pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000349 let Inst{20} = 1; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000350 let Inst{21} = 1; // W bit
351 let Inst{22} = 1; // B bit
352 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000353 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000354}
355
Evan Chengac92c3f2008-09-01 07:00:14 +0000356// Pre-indexed stores
Evan Chengbe998242008-11-06 08:47:38 +0000357class AI2stwpr<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000358 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000359 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000360 asm, cstr, pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000361 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000362 let Inst{21} = 1; // W bit
363 let Inst{22} = 0; // B bit
364 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000365 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000366}
Evan Chengbe998242008-11-06 08:47:38 +0000367class AI2stbpr<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000368 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000369 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000370 asm, cstr, pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000371 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000372 let Inst{21} = 1; // W bit
373 let Inst{22} = 1; // B bit
374 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000375 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000376}
377
Evan Chengac92c3f2008-09-01 07:00:14 +0000378// Post-indexed loads
Evan Chengbe998242008-11-06 08:47:38 +0000379class AI2ldwpo<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000380 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000381 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000382 asm, cstr,pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000383 let Inst{20} = 1; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000384 let Inst{21} = 0; // W bit
385 let Inst{22} = 0; // B bit
386 let Inst{24} = 0; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000387 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000388}
Evan Chengbe998242008-11-06 08:47:38 +0000389class AI2ldbpo<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000390 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000391 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000392 asm, cstr,pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000393 let Inst{20} = 1; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000394 let Inst{21} = 0; // W bit
395 let Inst{22} = 1; // B bit
396 let Inst{24} = 0; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000397 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000398}
399
Evan Chengac92c3f2008-09-01 07:00:14 +0000400// Post-indexed stores
Evan Chengbe998242008-11-06 08:47:38 +0000401class AI2stwpo<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000402 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000403 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000404 asm, cstr,pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000405 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000406 let Inst{21} = 0; // W bit
407 let Inst{22} = 0; // B bit
408 let Inst{24} = 0; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000409 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000410}
Evan Chengbe998242008-11-06 08:47:38 +0000411class AI2stbpo<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000412 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000413 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000414 asm, cstr,pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000415 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000416 let Inst{21} = 0; // W bit
417 let Inst{22} = 1; // B bit
418 let Inst{24} = 0; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000419 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000420}
421
Evan Cheng2e62b662008-09-01 01:51:14 +0000422// addrmode3 instructions
Evan Chengbe998242008-11-06 08:47:38 +0000423class AI3<dag oops, dag iops, Format f, string opc,
Evan Cheng2e62b662008-09-01 01:51:14 +0000424 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000425 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Cheng2e62b662008-09-01 01:51:14 +0000426 asm, "", pattern>;
Evan Chengbe998242008-11-06 08:47:38 +0000427class AXI3<dag oops, dag iops, Format f, string asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000428 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000429 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000430 "", pattern>;
Evan Cheng2e62b662008-09-01 01:51:14 +0000431
Evan Chengac92c3f2008-09-01 07:00:14 +0000432// loads
Evan Chengbe998242008-11-06 08:47:38 +0000433class AI3ldh<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000434 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000435 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000436 asm, "", pattern> {
437 let Inst{4} = 1;
438 let Inst{5} = 1; // H bit
439 let Inst{6} = 0; // S bit
440 let Inst{7} = 1;
441 let Inst{20} = 1; // L bit
442 let Inst{21} = 0; // W bit
443 let Inst{24} = 1; // P bit
444}
Evan Chengbe998242008-11-06 08:47:38 +0000445class AXI3ldh<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000446 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000447 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000448 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000449 let Inst{4} = 1;
450 let Inst{5} = 1; // H bit
451 let Inst{6} = 0; // S bit
452 let Inst{7} = 1;
453 let Inst{20} = 1; // L bit
454 let Inst{21} = 0; // W bit
455 let Inst{24} = 1; // P bit
456}
Evan Chengbe998242008-11-06 08:47:38 +0000457class AI3ldsh<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000458 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000459 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000460 asm, "", pattern> {
461 let Inst{4} = 1;
462 let Inst{5} = 1; // H bit
463 let Inst{6} = 1; // S bit
464 let Inst{7} = 1;
465 let Inst{20} = 1; // L bit
466 let Inst{21} = 0; // W bit
467 let Inst{24} = 1; // P bit
468}
Evan Chengbe998242008-11-06 08:47:38 +0000469class AXI3ldsh<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000470 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000471 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000472 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000473 let Inst{4} = 1;
474 let Inst{5} = 1; // H bit
475 let Inst{6} = 1; // S bit
476 let Inst{7} = 1;
477 let Inst{20} = 1; // L bit
478 let Inst{21} = 0; // W bit
479 let Inst{24} = 1; // P bit
480}
Evan Chengbe998242008-11-06 08:47:38 +0000481class AI3ldsb<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000482 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000483 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000484 asm, "", pattern> {
485 let Inst{4} = 1;
486 let Inst{5} = 0; // H bit
487 let Inst{6} = 1; // S bit
488 let Inst{7} = 1;
489 let Inst{20} = 1; // L bit
490 let Inst{21} = 0; // W bit
491 let Inst{24} = 1; // P bit
492}
Evan Chengbe998242008-11-06 08:47:38 +0000493class AXI3ldsb<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000494 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000495 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000496 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000497 let Inst{4} = 1;
498 let Inst{5} = 0; // H bit
499 let Inst{6} = 1; // S bit
500 let Inst{7} = 1;
501 let Inst{20} = 1; // L bit
502 let Inst{21} = 0; // W bit
503 let Inst{24} = 1; // P bit
504}
Evan Chengbe998242008-11-06 08:47:38 +0000505class AI3ldd<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000506 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000507 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000508 asm, "", pattern> {
509 let Inst{4} = 1;
510 let Inst{5} = 0; // H bit
511 let Inst{6} = 1; // S bit
512 let Inst{7} = 1;
513 let Inst{20} = 0; // L bit
514 let Inst{21} = 0; // W bit
515 let Inst{24} = 1; // P bit
516}
517
518// stores
Evan Chengbe998242008-11-06 08:47:38 +0000519class AI3sth<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000520 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000521 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000522 asm, "", pattern> {
523 let Inst{4} = 1;
524 let Inst{5} = 1; // H bit
525 let Inst{6} = 0; // S bit
526 let Inst{7} = 1;
527 let Inst{20} = 0; // L bit
528 let Inst{21} = 0; // W bit
529 let Inst{24} = 1; // P bit
530}
Evan Chengbe998242008-11-06 08:47:38 +0000531class AXI3sth<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000532 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000533 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000534 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000535 let Inst{4} = 1;
536 let Inst{5} = 1; // H bit
537 let Inst{6} = 0; // S bit
538 let Inst{7} = 1;
539 let Inst{20} = 0; // L bit
540 let Inst{21} = 0; // W bit
541 let Inst{24} = 1; // P bit
542}
Evan Chengbe998242008-11-06 08:47:38 +0000543class AI3std<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000544 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000545 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000546 asm, "", pattern> {
547 let Inst{4} = 1;
548 let Inst{5} = 1; // H bit
549 let Inst{6} = 1; // S bit
550 let Inst{7} = 1;
551 let Inst{20} = 0; // L bit
552 let Inst{21} = 0; // W bit
553 let Inst{24} = 1; // P bit
554}
555
556// Pre-indexed loads
Evan Chengbe998242008-11-06 08:47:38 +0000557class AI3ldhpr<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000558 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000559 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000560 asm, cstr, pattern> {
561 let Inst{4} = 1;
562 let Inst{5} = 1; // H bit
563 let Inst{6} = 0; // S bit
564 let Inst{7} = 1;
565 let Inst{20} = 1; // L bit
566 let Inst{21} = 1; // W bit
567 let Inst{24} = 1; // P bit
568}
Evan Chengbe998242008-11-06 08:47:38 +0000569class AI3ldshpr<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000570 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000571 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000572 asm, cstr, pattern> {
573 let Inst{4} = 1;
574 let Inst{5} = 1; // H bit
575 let Inst{6} = 1; // S bit
576 let Inst{7} = 1;
577 let Inst{20} = 1; // L bit
578 let Inst{21} = 1; // W bit
579 let Inst{24} = 1; // P bit
580}
Evan Chengbe998242008-11-06 08:47:38 +0000581class AI3ldsbpr<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000582 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000583 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000584 asm, cstr, pattern> {
585 let Inst{4} = 1;
586 let Inst{5} = 0; // H bit
587 let Inst{6} = 1; // S bit
588 let Inst{7} = 1;
589 let Inst{20} = 1; // L bit
590 let Inst{21} = 1; // W bit
591 let Inst{24} = 1; // P bit
592}
593
594// Pre-indexed stores
Evan Chengbe998242008-11-06 08:47:38 +0000595class AI3sthpr<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000596 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000597 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000598 asm, cstr, pattern> {
599 let Inst{4} = 1;
600 let Inst{5} = 1; // H bit
601 let Inst{6} = 0; // S bit
602 let Inst{7} = 1;
603 let Inst{20} = 0; // L bit
604 let Inst{21} = 1; // W bit
605 let Inst{24} = 1; // P bit
606}
607
608// Post-indexed loads
Evan Chengbe998242008-11-06 08:47:38 +0000609class AI3ldhpo<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000610 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000611 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000612 asm, cstr,pattern> {
613 let Inst{4} = 1;
614 let Inst{5} = 1; // H bit
615 let Inst{6} = 0; // S bit
616 let Inst{7} = 1;
617 let Inst{20} = 1; // L bit
618 let Inst{21} = 1; // W bit
619 let Inst{24} = 0; // P bit
620}
Evan Chengbe998242008-11-06 08:47:38 +0000621class AI3ldshpo<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000622 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000623 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000624 asm, cstr,pattern> {
625 let Inst{4} = 1;
626 let Inst{5} = 1; // H bit
627 let Inst{6} = 1; // S bit
628 let Inst{7} = 1;
629 let Inst{20} = 1; // L bit
630 let Inst{21} = 1; // W bit
631 let Inst{24} = 0; // P bit
632}
Evan Chengbe998242008-11-06 08:47:38 +0000633class AI3ldsbpo<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000634 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000635 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000636 asm, cstr,pattern> {
637 let Inst{4} = 1;
638 let Inst{5} = 0; // H bit
639 let Inst{6} = 1; // S bit
640 let Inst{7} = 1;
641 let Inst{20} = 1; // L bit
642 let Inst{21} = 1; // W bit
643 let Inst{24} = 0; // P bit
644}
645
646// Post-indexed stores
Evan Chengbe998242008-11-06 08:47:38 +0000647class AI3sthpo<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000648 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000649 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000650 asm, cstr,pattern> {
651 let Inst{4} = 1;
652 let Inst{5} = 1; // H bit
653 let Inst{6} = 0; // S bit
654 let Inst{7} = 1;
655 let Inst{20} = 0; // L bit
656 let Inst{21} = 1; // W bit
657 let Inst{24} = 0; // P bit
658}
659
660
Evan Cheng2e62b662008-09-01 01:51:14 +0000661// addrmode4 instructions
Evan Chengf8e8b622008-11-06 17:48:05 +0000662class AXI4ld<dag oops, dag iops, Format f, string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000663 : XI<oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm,
Evan Chengd36b01c2008-09-01 07:48:18 +0000664 "", pattern> {
665 let Inst{20} = 1; // L bit
666 let Inst{22} = 0; // S bit
Jim Grosbach88c246f2008-10-14 20:36:24 +0000667 let Inst{27-25} = 0b100;
Evan Chengd36b01c2008-09-01 07:48:18 +0000668}
Evan Chengf8e8b622008-11-06 17:48:05 +0000669class AXI4st<dag oops, dag iops, Format f, string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000670 : XI<oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm,
Evan Chengd36b01c2008-09-01 07:48:18 +0000671 "", pattern> {
672 let Inst{20} = 0; // L bit
673 let Inst{22} = 0; // S bit
Jim Grosbach88c246f2008-10-14 20:36:24 +0000674 let Inst{27-25} = 0b100;
Evan Chengd36b01c2008-09-01 07:48:18 +0000675}
Evan Cheng7b0249b2008-08-28 23:39:26 +0000676
Jim Grosbach1feed042008-11-03 18:38:31 +0000677// Unsigned multiply, multiply-accumulate instructions.
Evan Chengbe998242008-11-06 08:47:38 +0000678class AMul1I<bits<7> opcod, dag oops, dag iops, string opc,
Jim Grosbach1feed042008-11-03 18:38:31 +0000679 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000680 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000681 asm, "", pattern> {
Jim Grosbach1feed042008-11-03 18:38:31 +0000682 let Inst{7-4} = 0b1001;
Evan Chengee80fb72008-11-06 01:21:28 +0000683 let Inst{20} = 0; // S bit
Evan Chengbe998242008-11-06 08:47:38 +0000684 let Inst{27-21} = opcod;
Jim Grosbach1feed042008-11-03 18:38:31 +0000685}
Evan Chengbe998242008-11-06 08:47:38 +0000686class AsMul1I<bits<7> opcod, dag oops, dag iops, string opc,
Jim Grosbach1feed042008-11-03 18:38:31 +0000687 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000688 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000689 asm, "", pattern> {
Jim Grosbach1feed042008-11-03 18:38:31 +0000690 let Inst{7-4} = 0b1001;
Evan Chengbe998242008-11-06 08:47:38 +0000691 let Inst{27-21} = opcod;
Evan Chengee80fb72008-11-06 01:21:28 +0000692}
693
694// Most significant word multiply
Evan Chengbe998242008-11-06 08:47:38 +0000695class AMul2I<bits<7> opcod, dag oops, dag iops, string opc,
Evan Chengee80fb72008-11-06 01:21:28 +0000696 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000697 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000698 asm, "", pattern> {
Evan Chengee80fb72008-11-06 01:21:28 +0000699 let Inst{7-4} = 0b1001;
700 let Inst{20} = 1;
Evan Chengbe998242008-11-06 08:47:38 +0000701 let Inst{27-21} = opcod;
Jim Grosbach1feed042008-11-03 18:38:31 +0000702}
Evan Cheng7b0249b2008-08-28 23:39:26 +0000703
Evan Cheng38396be2008-11-06 03:35:07 +0000704// SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
Evan Chengbe998242008-11-06 08:47:38 +0000705class AMulxyI<bits<7> opcod, dag oops, dag iops, string opc,
Evan Cheng38396be2008-11-06 03:35:07 +0000706 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000707 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000708 asm, "", pattern> {
Evan Cheng38396be2008-11-06 03:35:07 +0000709 let Inst{4} = 0;
710 let Inst{7} = 1;
711 let Inst{20} = 0;
Evan Chengbe998242008-11-06 08:47:38 +0000712 let Inst{27-21} = opcod;
Evan Cheng38396be2008-11-06 03:35:07 +0000713}
714
Evan Cheng37afa432008-11-06 22:15:19 +0000715// Extend instructions.
716class AExtI<bits<8> opcod, dag oops, dag iops, string opc,
717 string asm, list<dag> pattern>
718 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ExtFrm, opc,
719 asm, "", pattern> {
720 let Inst{7-4} = 0b0111;
721 let Inst{27-20} = opcod;
722}
723
Evan Chengc2121a22008-11-07 01:41:35 +0000724// Misc Arithmetic instructions.
725class AMiscA1I<bits<8> opcod, dag oops, dag iops, string opc,
726 string asm, list<dag> pattern>
727 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ArithMiscFrm, opc,
728 asm, "", pattern> {
729 let Inst{27-20} = opcod;
730}
731
Evan Cheng7b0249b2008-08-28 23:39:26 +0000732//===----------------------------------------------------------------------===//
733
734// ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
735class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
736 list<Predicate> Predicates = [IsARM];
737}
738class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
739 list<Predicate> Predicates = [IsARM, HasV5TE];
740}
741class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
742 list<Predicate> Predicates = [IsARM, HasV6];
743}
Evan Cheng34a46e12008-08-29 06:41:12 +0000744
745//===----------------------------------------------------------------------===//
746//
747// Thumb Instruction Format Definitions.
748//
749
Evan Cheng34a46e12008-08-29 06:41:12 +0000750// TI - Thumb instruction.
751
752class ThumbI<dag outs, dag ins, AddrMode am, SizeFlagVal sz,
753 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000754 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
Evan Cheng34a46e12008-08-29 06:41:12 +0000755 let OutOperandList = outs;
756 let InOperandList = ins;
757 let AsmString = asm;
758 let Pattern = pattern;
759 list<Predicate> Predicates = [IsThumb];
760}
761
762class TI<dag outs, dag ins, string asm, list<dag> pattern>
763 : ThumbI<outs, ins, AddrModeNone, Size2Bytes, asm, "", pattern>;
Evan Cheng34a46e12008-08-29 06:41:12 +0000764
765// BL, BLX(1) are translated by assembler into two instructions
766class TIx2<dag outs, dag ins, string asm, list<dag> pattern>
767 : ThumbI<outs, ins, AddrModeNone, Size4Bytes, asm, "", pattern>;
768
769// BR_JT instructions
770class TJTI<dag outs, dag ins, string asm, list<dag> pattern>
771 : ThumbI<outs, ins, AddrModeNone, SizeSpecial, asm, "", pattern>;
772
Evan Cheng19bb7c72009-06-27 02:26:13 +0000773// TPat - Same as Pat<>, but requires that the compiler be in Thumb mode.
774class TPat<dag pattern, dag result> : Pat<pattern, result> {
Bob Wilsone60fee02009-06-22 23:27:02 +0000775 list<Predicate> Predicates = [IsThumb];
776}
777
Evan Cheng19bb7c72009-06-27 02:26:13 +0000778class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
Bob Wilsone60fee02009-06-22 23:27:02 +0000779 list<Predicate> Predicates = [IsThumb, HasV5T];
780}
Evan Cheng34a46e12008-08-29 06:41:12 +0000781
Evan Cheng6fc534c2009-06-23 19:38:13 +0000782// Thumb1 only
783class Thumb1I<dag outs, dag ins, AddrMode am, SizeFlagVal sz,
784 string asm, string cstr, list<dag> pattern>
785 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
786 let OutOperandList = outs;
787 let InOperandList = ins;
788 let AsmString = asm;
789 let Pattern = pattern;
790 list<Predicate> Predicates = [IsThumb1Only];
791}
792
793class T1I<dag outs, dag ins, string asm, list<dag> pattern>
794 : Thumb1I<outs, ins, AddrModeNone, Size2Bytes, asm, "", pattern>;
Evan Cheng532cdc52009-06-29 07:51:04 +0000795class T1I1<dag outs, dag ins, string asm, list<dag> pattern>
796 : Thumb1I<outs, ins, AddrModeT1_1, Size2Bytes, asm, "", pattern>;
797class T1I2<dag outs, dag ins, string asm, list<dag> pattern>
798 : Thumb1I<outs, ins, AddrModeT1_2, Size2Bytes, asm, "", pattern>;
799class T1I4<dag outs, dag ins, string asm, list<dag> pattern>
800 : Thumb1I<outs, ins, AddrModeT1_4, Size2Bytes, asm, "", pattern>;
801class T1Is<dag outs, dag ins, string asm, list<dag> pattern>
802 : Thumb1I<outs, ins, AddrModeT1_s, Size2Bytes, asm, "", pattern>;
Evan Cheng6fc534c2009-06-23 19:38:13 +0000803
804// Two-address instructions
805class T1It<dag outs, dag ins, string asm, list<dag> pattern>
806 : Thumb1I<outs, ins, AddrModeNone, Size2Bytes, asm, "$lhs = $dst", pattern>;
807
Evan Cheng19bb7c72009-06-27 02:26:13 +0000808class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Cheng6fc534c2009-06-23 19:38:13 +0000809 list<Predicate> Predicates = [IsThumb1Only];
810}
811
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000812// Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
813class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
814 string opc, string asm, string cstr, list<dag> pattern>
Evan Cheng36173712009-06-23 17:48:47 +0000815 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000816 let OutOperandList = oops;
817 let InOperandList = !con(iops, (ops pred:$p));
818 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
819 let Pattern = pattern;
820 list<Predicate> Predicates = [IsThumb, HasThumb2];
821}
822
823// Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as
824// an input operand since by default it's a zero register. It will
825// become an implicit def once it's "flipped".
826// FIXME: This uses unified syntax so {s} comes before {p}. We should make it
827// more consistent.
828class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
829 string opc, string asm, string cstr, list<dag> pattern>
830 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
831 let OutOperandList = oops;
832 let InOperandList = !con(iops, (ops pred:$p, cc_out:$s));
833 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
834 let Pattern = pattern;
835 list<Predicate> Predicates = [IsThumb, HasThumb2];
836}
837
838// Special cases
839class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
840 string asm, string cstr, list<dag> pattern>
841 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
842 let OutOperandList = oops;
843 let InOperandList = iops;
Evan Cheng36173712009-06-23 17:48:47 +0000844 let AsmString = asm;
845 let Pattern = pattern;
846 list<Predicate> Predicates = [IsThumb, HasThumb2];
847}
848
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000849class T2I<dag oops, dag iops, string opc, string asm, list<dag> pattern>
850 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, opc, asm, "", pattern>;
Evan Cheng532cdc52009-06-29 07:51:04 +0000851class T2Ii12<dag oops, dag iops, string opc, string asm, list<dag> pattern>
852 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, opc, asm, "", pattern>;
853class T2Ii8<dag oops, dag iops, string opc, string asm, list<dag> pattern>
854 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, opc, asm, "", pattern>;
855class T2Iso<dag oops, dag iops, string opc, string asm, list<dag> pattern>
856 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, opc, asm, "", pattern>;
857class T2Ipc<dag oops, dag iops, string opc, string asm, list<dag> pattern>
858 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, opc, asm, "", pattern>;
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000859
860class T2sI<dag oops, dag iops, string opc, string asm, list<dag> pattern>
861 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, opc, asm, "", pattern>;
862
863class T2XI<dag oops, dag iops, string asm, list<dag> pattern>
864 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, asm, "", pattern>;
Evan Cheng36173712009-06-23 17:48:47 +0000865
Evan Cheng19bb7c72009-06-27 02:26:13 +0000866// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
867class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Cheng36173712009-06-23 17:48:47 +0000868 list<Predicate> Predicates = [IsThumb, HasThumb2];
869}
870
Evan Cheng34a46e12008-08-29 06:41:12 +0000871//===----------------------------------------------------------------------===//
872
Evan Chengc63e15e2008-11-11 02:11:05 +0000873//===----------------------------------------------------------------------===//
874// ARM VFP Instruction templates.
875//
876
Evan Chengbb786b32008-11-11 21:48:44 +0000877// ARM VFP addrmode5 loads and stores
878class ADI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
879 string opc, string asm, list<dag> pattern>
Evan Chengc63e15e2008-11-11 02:11:05 +0000880 : I<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Evan Chengbb786b32008-11-11 21:48:44 +0000881 VFPLdStFrm, opc, asm, "", pattern> {
Evan Chengc63e15e2008-11-11 02:11:05 +0000882 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengbb786b32008-11-11 21:48:44 +0000883 let Inst{27-24} = opcod1;
884 let Inst{21-20} = opcod2;
885 let Inst{11-8} = 0b1011;
Evan Chengc63e15e2008-11-11 02:11:05 +0000886}
887
Evan Chengbb786b32008-11-11 21:48:44 +0000888class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
889 string opc, string asm, list<dag> pattern>
Evan Chengc63e15e2008-11-11 02:11:05 +0000890 : I<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Evan Chengbb786b32008-11-11 21:48:44 +0000891 VFPLdStFrm, opc, asm, "", pattern> {
Evan Chengc63e15e2008-11-11 02:11:05 +0000892 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengbb786b32008-11-11 21:48:44 +0000893 let Inst{27-24} = opcod1;
894 let Inst{21-20} = opcod2;
895 let Inst{11-8} = 0b1010;
Evan Chengc63e15e2008-11-11 02:11:05 +0000896}
897
Evan Chengbb786b32008-11-11 21:48:44 +0000898// Load / store multiple
899class AXSI5<dag oops, dag iops, string asm, list<dag> pattern>
900 : XI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
901 VFPLdStMulFrm, asm, "", pattern> {
902 // TODO: Mark the instructions with the appropriate subtarget info.
903 let Inst{27-25} = 0b110;
904 let Inst{11-8} = 0b1011;
905}
906
907class AXDI5<dag oops, dag iops, string asm, list<dag> pattern>
908 : XI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
909 VFPLdStMulFrm, asm, "", pattern> {
910 // TODO: Mark the instructions with the appropriate subtarget info.
911 let Inst{27-25} = 0b110;
912 let Inst{11-8} = 0b1010;
913}
914
915
Evan Chengc63e15e2008-11-11 02:11:05 +0000916// Double precision, unary
917class ADuI<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3, dag oops, dag iops,
918 string opc, string asm, list<dag> pattern>
919 : AI<oops, iops, VFPUnaryFrm, opc, asm, pattern> {
920 let Inst{27-20} = opcod1;
921 let Inst{19-16} = opcod2;
922 let Inst{11-8} = 0b1011;
923 let Inst{7-4} = opcod3;
924}
925
926// Double precision, binary
927class ADbI<bits<8> opcod, dag oops, dag iops, string opc,
928 string asm, list<dag> pattern>
929 : AI<oops, iops, VFPBinaryFrm, opc, asm, pattern> {
930 let Inst{27-20} = opcod;
931 let Inst{11-8} = 0b1011;
932}
933
934// Single precision, unary
935class ASuI<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3, dag oops, dag iops,
936 string opc, string asm, list<dag> pattern>
937 : AI<oops, iops, VFPUnaryFrm, opc, asm, pattern> {
938 // Bits 22 (D bit) and 5 (M bit) will be changed during instruction encoding.
939 let Inst{27-20} = opcod1;
940 let Inst{19-16} = opcod2;
941 let Inst{11-8} = 0b1010;
942 let Inst{7-4} = opcod3;
943}
944
945// Single precision, binary
946class ASbI<bits<8> opcod, dag oops, dag iops, string opc,
947 string asm, list<dag> pattern>
948 : AI<oops, iops, VFPBinaryFrm, opc, asm, pattern> {
949 // Bit 22 (D bit) can be changed during instruction encoding.
950 let Inst{27-20} = opcod;
951 let Inst{11-8} = 0b1010;
952}
953
Evan Cheng74273382008-11-12 06:41:41 +0000954// VFP conversion instructions
955class AVConv1I<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3,
956 dag oops, dag iops, string opc, string asm, list<dag> pattern>
Evan Cheng9d3cc182008-11-11 19:40:26 +0000957 : AI<oops, iops, VFPConv1Frm, opc, asm, pattern> {
958 let Inst{27-20} = opcod1;
Evan Cheng74273382008-11-12 06:41:41 +0000959 let Inst{19-16} = opcod2;
960 let Inst{11-8} = opcod3;
961 let Inst{6} = 1;
962}
963
964class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
965 string opc, string asm, list<dag> pattern>
966 : AI<oops, iops, f, opc, asm, pattern> {
967 let Inst{27-20} = opcod1;
Evan Cheng9d3cc182008-11-11 19:40:26 +0000968 let Inst{11-8} = opcod2;
969 let Inst{4} = 1;
970}
971
Evan Cheng828ccdc2008-11-11 22:46:12 +0000972class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
Evan Cheng74273382008-11-12 06:41:41 +0000973 string asm, list<dag> pattern>
974 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, opc, asm, pattern>;
Evan Cheng828ccdc2008-11-11 22:46:12 +0000975
Evan Cheng74273382008-11-12 06:41:41 +0000976class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
977 string asm, list<dag> pattern>
978 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, opc, asm, pattern>;
979
980class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
981 string asm, list<dag> pattern>
982 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, opc, asm, pattern>;
983
984class AVConv5I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
985 string asm, list<dag> pattern>
986 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv5Frm, opc, asm, pattern>;
Evan Cheng9d3cc182008-11-11 19:40:26 +0000987
Evan Chengc63e15e2008-11-11 02:11:05 +0000988//===----------------------------------------------------------------------===//
989
Bob Wilsone60fee02009-06-22 23:27:02 +0000990//===----------------------------------------------------------------------===//
991// ARM NEON Instruction templates.
992//
Evan Cheng34a46e12008-08-29 06:41:12 +0000993
Bob Wilsone60fee02009-06-22 23:27:02 +0000994class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, string asm,
995 string cstr, list<dag> pattern>
996 : InstARM<am, Size4Bytes, im, NEONFrm, cstr> {
997 let OutOperandList = oops;
998 let InOperandList = iops;
999 let AsmString = asm;
1000 let Pattern = pattern;
1001 list<Predicate> Predicates = [HasNEON];
Evan Cheng34a46e12008-08-29 06:41:12 +00001002}
1003
Bob Wilsone60fee02009-06-22 23:27:02 +00001004class NI<dag oops, dag iops, string asm, list<dag> pattern>
1005 : NeonI<oops, iops, AddrModeNone, IndexModeNone, asm, "", pattern> {
Evan Cheng34a46e12008-08-29 06:41:12 +00001006}
Bob Wilsone60fee02009-06-22 23:27:02 +00001007
1008class NDataI<dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1009 : NeonI<oops, iops, AddrModeNone, IndexModeNone, asm, cstr, pattern> {
1010 let Inst{31-25} = 0b1111001;
1011}
1012
1013// NEON "one register and a modified immediate" format.
1014class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1015 bit op5, bit op4,
1016 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1017 : NDataI<oops, iops, asm, cstr, pattern> {
1018 let Inst{23} = op23;
1019 let Inst{21-19} = op21_19;
1020 let Inst{11-8} = op11_8;
1021 let Inst{7} = op7;
1022 let Inst{6} = op6;
1023 let Inst{5} = op5;
1024 let Inst{4} = op4;
1025}
1026
1027// NEON 2 vector register format.
1028class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1029 bits<5> op11_7, bit op6, bit op4,
1030 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1031 : NDataI<oops, iops, asm, cstr, pattern> {
1032 let Inst{24-23} = op24_23;
1033 let Inst{21-20} = op21_20;
1034 let Inst{19-18} = op19_18;
1035 let Inst{17-16} = op17_16;
1036 let Inst{11-7} = op11_7;
1037 let Inst{6} = op6;
1038 let Inst{4} = op4;
1039}
1040
1041// NEON 2 vector register with immediate.
1042class N2VImm<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
1043 bit op6, bit op4,
1044 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1045 : NDataI<oops, iops, asm, cstr, pattern> {
1046 let Inst{24} = op24;
1047 let Inst{23} = op23;
1048 let Inst{21-16} = op21_16;
1049 let Inst{11-8} = op11_8;
1050 let Inst{7} = op7;
1051 let Inst{6} = op6;
1052 let Inst{4} = op4;
1053}
1054
1055// NEON 3 vector register format.
1056class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
1057 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1058 : NDataI<oops, iops, asm, cstr, pattern> {
1059 let Inst{24} = op24;
1060 let Inst{23} = op23;
1061 let Inst{21-20} = op21_20;
1062 let Inst{11-8} = op11_8;
1063 let Inst{6} = op6;
1064 let Inst{4} = op4;
1065}
1066
1067// NEON VMOVs between scalar and core registers.
1068class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1069 dag oops, dag iops, Format f, string opc, string asm,
1070 list<dag> pattern>
1071 : AI<oops, iops, f, opc, asm, pattern> {
1072 let Inst{27-20} = opcod1;
1073 let Inst{11-8} = opcod2;
1074 let Inst{6-5} = opcod3;
1075 let Inst{4} = 1;
1076 list<Predicate> Predicates = [HasNEON];
1077}
1078class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1079 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1080 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONGetLnFrm, opc, asm,
1081 pattern>;
1082class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1083 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1084 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONSetLnFrm, opc, asm,
1085 pattern>;
1086class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1087 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1088 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONDupFrm, opc, asm, pattern>;