blob: d7b02c3a4ecae1a698995b48033ce2b65134be3c [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>;
Bob Wilson970a10d2009-07-01 23:16:05 +000075def AddrMode6 : AddrMode<6>;
76def AddrModeT1_1 : AddrMode<7>;
77def AddrModeT1_2 : AddrMode<8>;
78def AddrModeT1_4 : AddrMode<9>;
79def AddrModeT1_s : AddrMode<10>;
80def AddrModeT2_i12: AddrMode<12>;
81def AddrModeT2_i8 : AddrMode<12>;
82def AddrModeT2_so : AddrMode<13>;
83def AddrModeT2_pc : AddrMode<14>;
84def AddrModeT2_i8s4 : AddrMode<15>;
Evan Cheng532cdc52009-06-29 07:51:04 +000085
86// Instruction size.
87class SizeFlagVal<bits<3> val> {
88 bits<3> Value = val;
89}
90def SizeInvalid : SizeFlagVal<0>; // Unset.
91def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
92def Size8Bytes : SizeFlagVal<2>;
93def Size4Bytes : SizeFlagVal<3>;
94def Size2Bytes : SizeFlagVal<4>;
95
96// Load / store index mode.
97class IndexMode<bits<2> val> {
98 bits<2> Value = val;
99}
100def IndexModeNone : IndexMode<0>;
101def IndexModePre : IndexMode<1>;
102def IndexModePost : IndexMode<2>;
103
104//===----------------------------------------------------------------------===//
Evan Cheng7b0249b2008-08-28 23:39:26 +0000105
106// ARM Instruction templates.
107//
108
Evan Chengbe998242008-11-06 08:47:38 +0000109class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000110 Format f, string cstr>
111 : Instruction {
Evan Chengd0750352008-08-29 07:40:52 +0000112 field bits<32> Inst;
113
Evan Cheng7b0249b2008-08-28 23:39:26 +0000114 let Namespace = "ARM";
115
Evan Cheng86a926a2008-11-05 18:35:52 +0000116 // TSFlagsFields
Evan Cheng7b0249b2008-08-28 23:39:26 +0000117 AddrMode AM = am;
118 bits<4> AddrModeBits = AM.Value;
119
120 SizeFlagVal SZ = sz;
121 bits<3> SizeFlag = SZ.Value;
122
123 IndexMode IM = im;
124 bits<2> IndexModeBits = IM.Value;
125
126 Format F = f;
127 bits<5> Form = F.Value;
Evan Cheng86a926a2008-11-05 18:35:52 +0000128
129 //
130 // Attributes specific to ARM instructions...
131 //
132 bit isUnaryDataProc = 0;
Evan Cheng7b0249b2008-08-28 23:39:26 +0000133
134 let Constraints = cstr;
135}
136
137class PseudoInst<dag oops, dag iops, string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000138 : InstARM<AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, ""> {
Evan Cheng7b0249b2008-08-28 23:39:26 +0000139 let OutOperandList = oops;
140 let InOperandList = iops;
141 let AsmString = asm;
142 let Pattern = pattern;
143}
144
145// Almost all ARM instructions are predicable.
Evan Chengbe998242008-11-06 08:47:38 +0000146class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000147 IndexMode im, Format f, string opc, string asm, string cstr,
148 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000149 : InstARM<am, sz, im, f, cstr> {
Evan Cheng7b0249b2008-08-28 23:39:26 +0000150 let OutOperandList = oops;
151 let InOperandList = !con(iops, (ops pred:$p));
152 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
153 let Pattern = pattern;
154 list<Predicate> Predicates = [IsARM];
155}
156
157// Same as I except it can optionally modify CPSR. Note it's modeled as
158// an input operand since by default it's a zero register. It will
159// become an implicit def once it's "flipped".
Evan Chengbe998242008-11-06 08:47:38 +0000160class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000161 IndexMode im, Format f, string opc, string asm, string cstr,
162 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000163 : InstARM<am, sz, im, f, cstr> {
Evan Cheng7b0249b2008-08-28 23:39:26 +0000164 let OutOperandList = oops;
165 let InOperandList = !con(iops, (ops pred:$p, cc_out:$s));
166 let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm));
167 let Pattern = pattern;
168 list<Predicate> Predicates = [IsARM];
169}
170
Evan Chengc5409a82008-09-01 07:19:00 +0000171// Special cases
Evan Chengbe998242008-11-06 08:47:38 +0000172class XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
Evan Chengc5409a82008-09-01 07:19:00 +0000173 IndexMode im, Format f, string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000174 : InstARM<am, sz, im, f, cstr> {
Evan Chengc5409a82008-09-01 07:19:00 +0000175 let OutOperandList = oops;
176 let InOperandList = iops;
177 let AsmString = asm;
178 let Pattern = pattern;
179 list<Predicate> Predicates = [IsARM];
180}
181
Evan Chengbe998242008-11-06 08:47:38 +0000182class AI<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000183 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000184 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000185 asm, "", pattern>;
Evan Chengbe998242008-11-06 08:47:38 +0000186class AsI<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000187 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000188 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000189 asm, "", pattern>;
Evan Chengbe998242008-11-06 08:47:38 +0000190class AXI<dag oops, dag iops, Format f, string asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000191 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000192 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000193 "", pattern>;
Evan Cheng10a9eb82008-09-01 08:25:56 +0000194
195// Ctrl flow instructions
Evan Chengf8e8b622008-11-06 17:48:05 +0000196class ABI<bits<4> opcod, dag oops, dag iops, string opc,
Evan Cheng10a9eb82008-09-01 08:25:56 +0000197 string asm, list<dag> pattern>
Evan Chengf8e8b622008-11-06 17:48:05 +0000198 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000199 asm, "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000200 let Inst{27-24} = opcod;
Evan Cheng10a9eb82008-09-01 08:25:56 +0000201}
Evan Chengf8e8b622008-11-06 17:48:05 +0000202class ABXI<bits<4> opcod, dag oops, dag iops, string asm, list<dag> pattern>
203 : XI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, BrFrm, asm,
Evan Cheng10a9eb82008-09-01 08:25:56 +0000204 "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000205 let Inst{27-24} = opcod;
Evan Cheng10a9eb82008-09-01 08:25:56 +0000206}
Evan Chengf8e8b622008-11-06 17:48:05 +0000207class ABXIx2<dag oops, dag iops, string asm, list<dag> pattern>
208 : XI<oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, BrMiscFrm, asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000209 "", pattern>;
Evan Cheng10a9eb82008-09-01 08:25:56 +0000210
211// BR_JT instructions
Evan Cheng0f63ae12008-11-07 09:06:08 +0000212class JTI<dag oops, dag iops, string asm, list<dag> pattern>
Evan Chengf8e8b622008-11-06 17:48:05 +0000213 : XI<oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BrMiscFrm,
Evan Cheng0f63ae12008-11-07 09:06:08 +0000214 asm, "", pattern>;
Evan Cheng2e62b662008-09-01 01:51:14 +0000215
216// addrmode1 instructions
Evan Cheng7b0249b2008-08-28 23:39:26 +0000217class AI1<bits<4> opcod, dag oops, dag iops, Format f, string opc,
218 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000219 : I<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc,
Evan Chengd0750352008-08-29 07:40:52 +0000220 asm, "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000221 let Inst{24-21} = opcod;
222 let Inst{27-26} = {0,0};
Evan Chengd0750352008-08-29 07:40:52 +0000223}
Evan Cheng7b0249b2008-08-28 23:39:26 +0000224class AsI1<bits<4> opcod, dag oops, dag iops, Format f, string opc,
225 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000226 : sI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc,
Evan Chengd0750352008-08-29 07:40:52 +0000227 asm, "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000228 let Inst{24-21} = opcod;
229 let Inst{27-26} = {0,0};
Evan Chengd0750352008-08-29 07:40:52 +0000230}
Evan Chengc5409a82008-09-01 07:19:00 +0000231class AXI1<bits<4> opcod, dag oops, dag iops, Format f, string asm,
232 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000233 : XI<oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000234 "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000235 let Inst{24-21} = opcod;
236 let Inst{27-26} = {0,0};
Evan Chengc5409a82008-09-01 07:19:00 +0000237}
Evan Chengbe998242008-11-06 08:47:38 +0000238class AI1x2<dag oops, dag iops, Format f, string opc,
Evan Cheng2e62b662008-09-01 01:51:14 +0000239 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000240 : I<oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, opc,
Evan Cheng2e62b662008-09-01 01:51:14 +0000241 asm, "", pattern>;
Evan Chengda020022008-08-31 19:02:21 +0000242
Evan Cheng2e62b662008-09-01 01:51:14 +0000243
244// addrmode2 loads and stores
Evan Chengbe998242008-11-06 08:47:38 +0000245class AI2<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000246 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000247 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengda020022008-08-31 19:02:21 +0000248 asm, "", pattern> {
Jim Grosbach88c246f2008-10-14 20:36:24 +0000249 let Inst{27-26} = {0,1};
Evan Chengda020022008-08-31 19:02:21 +0000250}
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000251
252// loads
Evan Chengbe998242008-11-06 08:47:38 +0000253class AI2ldw<dag oops, dag iops, Format f, string opc,
Evan Chengda020022008-08-31 19:02:21 +0000254 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000255 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengc41fb3152008-11-05 23:22:34 +0000256 asm, "", pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000257 let Inst{20} = 1; // L bit
Evan Chengda020022008-08-31 19:02:21 +0000258 let Inst{21} = 0; // W bit
259 let Inst{22} = 0; // B bit
260 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000261 let Inst{27-26} = {0,1};
Evan Chengda020022008-08-31 19:02:21 +0000262}
Evan Chengbe998242008-11-06 08:47:38 +0000263class AXI2ldw<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000264 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000265 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000266 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000267 let Inst{20} = 1; // L bit
268 let Inst{21} = 0; // W bit
269 let Inst{22} = 0; // B bit
270 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000271 let Inst{27-26} = {0,1};
Evan Chengae7b1d72008-09-01 07:34:13 +0000272}
Evan Chengbe998242008-11-06 08:47:38 +0000273class AI2ldb<dag oops, dag iops, Format f, string opc,
Evan Chengda020022008-08-31 19:02:21 +0000274 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000275 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengc41fb3152008-11-05 23:22:34 +0000276 asm, "", pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000277 let Inst{20} = 1; // L bit
Evan Chengda020022008-08-31 19:02:21 +0000278 let Inst{21} = 0; // W bit
279 let Inst{22} = 1; // B bit
280 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000281 let Inst{27-26} = {0,1};
Evan Chengda020022008-08-31 19:02:21 +0000282}
Evan Chengbe998242008-11-06 08:47:38 +0000283class AXI2ldb<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000284 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000285 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000286 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000287 let Inst{20} = 1; // L bit
288 let Inst{21} = 0; // W bit
289 let Inst{22} = 1; // B bit
290 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000291 let Inst{27-26} = {0,1};
Evan Chengae7b1d72008-09-01 07:34:13 +0000292}
Evan Chengda020022008-08-31 19:02:21 +0000293
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000294// stores
Evan Chengbe998242008-11-06 08:47:38 +0000295class AI2stw<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000296 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000297 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengc41fb3152008-11-05 23:22:34 +0000298 asm, "", pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000299 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000300 let Inst{21} = 0; // W bit
301 let Inst{22} = 0; // B bit
302 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000303 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000304}
Evan Chengbe998242008-11-06 08:47:38 +0000305class AXI2stw<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000306 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000307 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000308 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000309 let Inst{20} = 0; // L bit
310 let Inst{21} = 0; // W bit
311 let Inst{22} = 0; // B bit
312 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000313 let Inst{27-26} = {0,1};
Evan Chengae7b1d72008-09-01 07:34:13 +0000314}
Evan Chengbe998242008-11-06 08:47:38 +0000315class AI2stb<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000316 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000317 : I<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
Evan Chengc41fb3152008-11-05 23:22:34 +0000318 asm, "", pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000319 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000320 let Inst{21} = 0; // W bit
321 let Inst{22} = 1; // B bit
322 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000323 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000324}
Evan Chengbe998242008-11-06 08:47:38 +0000325class AXI2stb<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000326 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000327 : XI<oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000328 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000329 let Inst{20} = 0; // L bit
330 let Inst{21} = 0; // W bit
331 let Inst{22} = 1; // B bit
332 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000333 let Inst{27-26} = {0,1};
Evan Chengae7b1d72008-09-01 07:34:13 +0000334}
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000335
Evan Chengac92c3f2008-09-01 07:00:14 +0000336// Pre-indexed loads
Evan Chengbe998242008-11-06 08:47:38 +0000337class AI2ldwpr<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000338 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000339 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000340 asm, cstr, pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000341 let Inst{20} = 1; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000342 let Inst{21} = 1; // W bit
343 let Inst{22} = 0; // B bit
344 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000345 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000346}
Evan Chengbe998242008-11-06 08:47:38 +0000347class AI2ldbpr<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000348 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000349 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000350 asm, cstr, pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000351 let Inst{20} = 1; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000352 let Inst{21} = 1; // W bit
353 let Inst{22} = 1; // B bit
354 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000355 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000356}
357
Evan Chengac92c3f2008-09-01 07:00:14 +0000358// Pre-indexed stores
Evan Chengbe998242008-11-06 08:47:38 +0000359class AI2stwpr<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000360 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000361 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000362 asm, cstr, pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000363 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000364 let Inst{21} = 1; // W bit
365 let Inst{22} = 0; // B bit
366 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000367 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000368}
Evan Chengbe998242008-11-06 08:47:38 +0000369class AI2stbpr<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000370 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000371 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000372 asm, cstr, pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000373 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000374 let Inst{21} = 1; // W bit
375 let Inst{22} = 1; // B bit
376 let Inst{24} = 1; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000377 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000378}
379
Evan Chengac92c3f2008-09-01 07:00:14 +0000380// Post-indexed loads
Evan Chengbe998242008-11-06 08:47:38 +0000381class AI2ldwpo<dag oops, dag iops, Format f, string opc,
Evan Cheng7b0249b2008-08-28 23:39:26 +0000382 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000383 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000384 asm, cstr,pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000385 let Inst{20} = 1; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000386 let Inst{21} = 0; // W bit
387 let Inst{22} = 0; // B bit
388 let Inst{24} = 0; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000389 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000390}
Evan Chengbe998242008-11-06 08:47:38 +0000391class AI2ldbpo<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000392 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000393 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000394 asm, cstr,pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000395 let Inst{20} = 1; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000396 let Inst{21} = 0; // W bit
397 let Inst{22} = 1; // B bit
398 let Inst{24} = 0; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000399 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000400}
401
Evan Chengac92c3f2008-09-01 07:00:14 +0000402// Post-indexed stores
Evan Chengbe998242008-11-06 08:47:38 +0000403class AI2stwpo<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000404 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000405 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000406 asm, cstr,pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000407 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000408 let Inst{21} = 0; // W bit
409 let Inst{22} = 0; // B bit
410 let Inst{24} = 0; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000411 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000412}
Evan Chengbe998242008-11-06 08:47:38 +0000413class AI2stbpo<dag oops, dag iops, Format f, string opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000414 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000415 : I<oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000416 asm, cstr,pattern> {
Evan Chengac92c3f2008-09-01 07:00:14 +0000417 let Inst{20} = 0; // L bit
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000418 let Inst{21} = 0; // W bit
419 let Inst{22} = 1; // B bit
420 let Inst{24} = 0; // P bit
Evan Chengc41fb3152008-11-05 23:22:34 +0000421 let Inst{27-26} = {0,1};
Evan Cheng1a7c1cc2008-09-01 01:27:33 +0000422}
423
Evan Cheng2e62b662008-09-01 01:51:14 +0000424// addrmode3 instructions
Evan Chengbe998242008-11-06 08:47:38 +0000425class AI3<dag oops, dag iops, Format f, string opc,
Evan Cheng2e62b662008-09-01 01:51:14 +0000426 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000427 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Cheng2e62b662008-09-01 01:51:14 +0000428 asm, "", pattern>;
Evan Chengbe998242008-11-06 08:47:38 +0000429class AXI3<dag oops, dag iops, Format f, string asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000430 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000431 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm,
Evan Chengc5409a82008-09-01 07:19:00 +0000432 "", pattern>;
Evan Cheng2e62b662008-09-01 01:51:14 +0000433
Evan Chengac92c3f2008-09-01 07:00:14 +0000434// loads
Evan Chengbe998242008-11-06 08:47:38 +0000435class AI3ldh<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000436 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000437 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000438 asm, "", pattern> {
439 let Inst{4} = 1;
440 let Inst{5} = 1; // H bit
441 let Inst{6} = 0; // S bit
442 let Inst{7} = 1;
443 let Inst{20} = 1; // L bit
444 let Inst{21} = 0; // W bit
445 let Inst{24} = 1; // P bit
446}
Evan Chengbe998242008-11-06 08:47:38 +0000447class AXI3ldh<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000448 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000449 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000450 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000451 let Inst{4} = 1;
452 let Inst{5} = 1; // H bit
453 let Inst{6} = 0; // S bit
454 let Inst{7} = 1;
455 let Inst{20} = 1; // L bit
456 let Inst{21} = 0; // W bit
457 let Inst{24} = 1; // P bit
458}
Evan Chengbe998242008-11-06 08:47:38 +0000459class AI3ldsh<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000460 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000461 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000462 asm, "", pattern> {
463 let Inst{4} = 1;
464 let Inst{5} = 1; // H bit
465 let Inst{6} = 1; // S bit
466 let Inst{7} = 1;
467 let Inst{20} = 1; // L bit
468 let Inst{21} = 0; // W bit
469 let Inst{24} = 1; // P bit
470}
Evan Chengbe998242008-11-06 08:47:38 +0000471class AXI3ldsh<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000472 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000473 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000474 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000475 let Inst{4} = 1;
476 let Inst{5} = 1; // H bit
477 let Inst{6} = 1; // S bit
478 let Inst{7} = 1;
479 let Inst{20} = 1; // L bit
480 let Inst{21} = 0; // W bit
481 let Inst{24} = 1; // P bit
482}
Evan Chengbe998242008-11-06 08:47:38 +0000483class AI3ldsb<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000484 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000485 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000486 asm, "", pattern> {
487 let Inst{4} = 1;
488 let Inst{5} = 0; // H bit
489 let Inst{6} = 1; // S bit
490 let Inst{7} = 1;
491 let Inst{20} = 1; // L bit
492 let Inst{21} = 0; // W bit
493 let Inst{24} = 1; // P bit
494}
Evan Chengbe998242008-11-06 08:47:38 +0000495class AXI3ldsb<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000496 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000497 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000498 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000499 let Inst{4} = 1;
500 let Inst{5} = 0; // H bit
501 let Inst{6} = 1; // S bit
502 let Inst{7} = 1;
503 let Inst{20} = 1; // L bit
504 let Inst{21} = 0; // W bit
505 let Inst{24} = 1; // P bit
506}
Evan Chengbe998242008-11-06 08:47:38 +0000507class AI3ldd<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000508 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000509 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000510 asm, "", pattern> {
511 let Inst{4} = 1;
512 let Inst{5} = 0; // H bit
513 let Inst{6} = 1; // S bit
514 let Inst{7} = 1;
515 let Inst{20} = 0; // L bit
516 let Inst{21} = 0; // W bit
517 let Inst{24} = 1; // P bit
518}
519
520// stores
Evan Chengbe998242008-11-06 08:47:38 +0000521class AI3sth<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000522 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000523 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000524 asm, "", pattern> {
525 let Inst{4} = 1;
526 let Inst{5} = 1; // H bit
527 let Inst{6} = 0; // S bit
528 let Inst{7} = 1;
529 let Inst{20} = 0; // L bit
530 let Inst{21} = 0; // W bit
531 let Inst{24} = 1; // P bit
532}
Evan Chengbe998242008-11-06 08:47:38 +0000533class AXI3sth<dag oops, dag iops, Format f, string asm,
Evan Chengae7b1d72008-09-01 07:34:13 +0000534 list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000535 : XI<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f,
Evan Chengc41fb3152008-11-05 23:22:34 +0000536 asm, "", pattern> {
Evan Chengae7b1d72008-09-01 07:34:13 +0000537 let Inst{4} = 1;
538 let Inst{5} = 1; // H bit
539 let Inst{6} = 0; // S bit
540 let Inst{7} = 1;
541 let Inst{20} = 0; // L bit
542 let Inst{21} = 0; // W bit
543 let Inst{24} = 1; // P bit
544}
Evan Chengbe998242008-11-06 08:47:38 +0000545class AI3std<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000546 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000547 : I<oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000548 asm, "", pattern> {
549 let Inst{4} = 1;
550 let Inst{5} = 1; // H bit
551 let Inst{6} = 1; // S bit
552 let Inst{7} = 1;
553 let Inst{20} = 0; // L bit
554 let Inst{21} = 0; // W bit
555 let Inst{24} = 1; // P bit
556}
557
558// Pre-indexed loads
Evan Chengbe998242008-11-06 08:47:38 +0000559class AI3ldhpr<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000560 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000561 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000562 asm, cstr, pattern> {
563 let Inst{4} = 1;
564 let Inst{5} = 1; // H bit
565 let Inst{6} = 0; // S bit
566 let Inst{7} = 1;
567 let Inst{20} = 1; // L bit
568 let Inst{21} = 1; // W bit
569 let Inst{24} = 1; // P bit
570}
Evan Chengbe998242008-11-06 08:47:38 +0000571class AI3ldshpr<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000572 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000573 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000574 asm, cstr, pattern> {
575 let Inst{4} = 1;
576 let Inst{5} = 1; // H bit
577 let Inst{6} = 1; // S bit
578 let Inst{7} = 1;
579 let Inst{20} = 1; // L bit
580 let Inst{21} = 1; // W bit
581 let Inst{24} = 1; // P bit
582}
Evan Chengbe998242008-11-06 08:47:38 +0000583class AI3ldsbpr<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000584 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000585 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000586 asm, cstr, pattern> {
587 let Inst{4} = 1;
588 let Inst{5} = 0; // H bit
589 let Inst{6} = 1; // S bit
590 let Inst{7} = 1;
591 let Inst{20} = 1; // L bit
592 let Inst{21} = 1; // W bit
593 let Inst{24} = 1; // P bit
594}
595
596// Pre-indexed stores
Evan Chengbe998242008-11-06 08:47:38 +0000597class AI3sthpr<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000598 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000599 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000600 asm, cstr, pattern> {
601 let Inst{4} = 1;
602 let Inst{5} = 1; // H bit
603 let Inst{6} = 0; // S bit
604 let Inst{7} = 1;
605 let Inst{20} = 0; // L bit
606 let Inst{21} = 1; // W bit
607 let Inst{24} = 1; // P bit
608}
609
610// Post-indexed loads
Evan Chengbe998242008-11-06 08:47:38 +0000611class AI3ldhpo<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000612 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000613 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000614 asm, cstr,pattern> {
615 let Inst{4} = 1;
616 let Inst{5} = 1; // H bit
617 let Inst{6} = 0; // S bit
618 let Inst{7} = 1;
619 let Inst{20} = 1; // L bit
620 let Inst{21} = 1; // W bit
621 let Inst{24} = 0; // P bit
622}
Evan Chengbe998242008-11-06 08:47:38 +0000623class AI3ldshpo<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000624 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000625 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000626 asm, cstr,pattern> {
627 let Inst{4} = 1;
628 let Inst{5} = 1; // H bit
629 let Inst{6} = 1; // S bit
630 let Inst{7} = 1;
631 let Inst{20} = 1; // L bit
632 let Inst{21} = 1; // W bit
633 let Inst{24} = 0; // P bit
634}
Evan Chengbe998242008-11-06 08:47:38 +0000635class AI3ldsbpo<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000636 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000637 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000638 asm, cstr,pattern> {
639 let Inst{4} = 1;
640 let Inst{5} = 0; // H bit
641 let Inst{6} = 1; // S bit
642 let Inst{7} = 1;
643 let Inst{20} = 1; // L bit
644 let Inst{21} = 1; // W bit
645 let Inst{24} = 0; // P bit
646}
647
648// Post-indexed stores
Evan Chengbe998242008-11-06 08:47:38 +0000649class AI3sthpo<dag oops, dag iops, Format f, string opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000650 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000651 : I<oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
Evan Chengac92c3f2008-09-01 07:00:14 +0000652 asm, cstr,pattern> {
653 let Inst{4} = 1;
654 let Inst{5} = 1; // H bit
655 let Inst{6} = 0; // S bit
656 let Inst{7} = 1;
657 let Inst{20} = 0; // L bit
658 let Inst{21} = 1; // W bit
659 let Inst{24} = 0; // P bit
660}
661
662
Evan Cheng2e62b662008-09-01 01:51:14 +0000663// addrmode4 instructions
Evan Chengf8e8b622008-11-06 17:48:05 +0000664class AXI4ld<dag oops, dag iops, Format f, string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000665 : XI<oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm,
Evan Chengd36b01c2008-09-01 07:48:18 +0000666 "", pattern> {
667 let Inst{20} = 1; // L bit
668 let Inst{22} = 0; // S bit
Jim Grosbach88c246f2008-10-14 20:36:24 +0000669 let Inst{27-25} = 0b100;
Evan Chengd36b01c2008-09-01 07:48:18 +0000670}
Evan Chengf8e8b622008-11-06 17:48:05 +0000671class AXI4st<dag oops, dag iops, Format f, string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000672 : XI<oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm,
Evan Chengd36b01c2008-09-01 07:48:18 +0000673 "", pattern> {
674 let Inst{20} = 0; // L bit
675 let Inst{22} = 0; // S bit
Jim Grosbach88c246f2008-10-14 20:36:24 +0000676 let Inst{27-25} = 0b100;
Evan Chengd36b01c2008-09-01 07:48:18 +0000677}
Evan Cheng7b0249b2008-08-28 23:39:26 +0000678
Jim Grosbach1feed042008-11-03 18:38:31 +0000679// Unsigned multiply, multiply-accumulate instructions.
Evan Chengbe998242008-11-06 08:47:38 +0000680class AMul1I<bits<7> opcod, dag oops, dag iops, string opc,
Jim Grosbach1feed042008-11-03 18:38:31 +0000681 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000682 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000683 asm, "", pattern> {
Jim Grosbach1feed042008-11-03 18:38:31 +0000684 let Inst{7-4} = 0b1001;
Evan Chengee80fb72008-11-06 01:21:28 +0000685 let Inst{20} = 0; // S bit
Evan Chengbe998242008-11-06 08:47:38 +0000686 let Inst{27-21} = opcod;
Jim Grosbach1feed042008-11-03 18:38:31 +0000687}
Evan Chengbe998242008-11-06 08:47:38 +0000688class AsMul1I<bits<7> opcod, dag oops, dag iops, string opc,
Jim Grosbach1feed042008-11-03 18:38:31 +0000689 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000690 : sI<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000691 asm, "", pattern> {
Jim Grosbach1feed042008-11-03 18:38:31 +0000692 let Inst{7-4} = 0b1001;
Evan Chengbe998242008-11-06 08:47:38 +0000693 let Inst{27-21} = opcod;
Evan Chengee80fb72008-11-06 01:21:28 +0000694}
695
696// Most significant word multiply
Evan Chengbe998242008-11-06 08:47:38 +0000697class AMul2I<bits<7> opcod, dag oops, dag iops, string opc,
Evan Chengee80fb72008-11-06 01:21:28 +0000698 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000699 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000700 asm, "", pattern> {
Evan Chengee80fb72008-11-06 01:21:28 +0000701 let Inst{7-4} = 0b1001;
702 let Inst{20} = 1;
Evan Chengbe998242008-11-06 08:47:38 +0000703 let Inst{27-21} = opcod;
Jim Grosbach1feed042008-11-03 18:38:31 +0000704}
Evan Cheng7b0249b2008-08-28 23:39:26 +0000705
Evan Cheng38396be2008-11-06 03:35:07 +0000706// SMUL<x><y> / SMULW<y> / SMLA<x><y> / SMLAW<x><y>
Evan Chengbe998242008-11-06 08:47:38 +0000707class AMulxyI<bits<7> opcod, dag oops, dag iops, string opc,
Evan Cheng38396be2008-11-06 03:35:07 +0000708 string asm, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000709 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, MulFrm, opc,
Evan Cheng37afa432008-11-06 22:15:19 +0000710 asm, "", pattern> {
Evan Cheng38396be2008-11-06 03:35:07 +0000711 let Inst{4} = 0;
712 let Inst{7} = 1;
713 let Inst{20} = 0;
Evan Chengbe998242008-11-06 08:47:38 +0000714 let Inst{27-21} = opcod;
Evan Cheng38396be2008-11-06 03:35:07 +0000715}
716
Evan Cheng37afa432008-11-06 22:15:19 +0000717// Extend instructions.
718class AExtI<bits<8> opcod, dag oops, dag iops, string opc,
719 string asm, list<dag> pattern>
720 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ExtFrm, opc,
721 asm, "", pattern> {
722 let Inst{7-4} = 0b0111;
723 let Inst{27-20} = opcod;
724}
725
Evan Chengc2121a22008-11-07 01:41:35 +0000726// Misc Arithmetic instructions.
727class AMiscA1I<bits<8> opcod, dag oops, dag iops, string opc,
728 string asm, list<dag> pattern>
729 : I<oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, ArithMiscFrm, opc,
730 asm, "", pattern> {
731 let Inst{27-20} = opcod;
732}
733
Evan Cheng7b0249b2008-08-28 23:39:26 +0000734//===----------------------------------------------------------------------===//
735
736// ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
737class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
738 list<Predicate> Predicates = [IsARM];
739}
740class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
741 list<Predicate> Predicates = [IsARM, HasV5TE];
742}
743class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
744 list<Predicate> Predicates = [IsARM, HasV6];
745}
Evan Cheng34a46e12008-08-29 06:41:12 +0000746
747//===----------------------------------------------------------------------===//
748//
749// Thumb Instruction Format Definitions.
750//
751
Evan Cheng34a46e12008-08-29 06:41:12 +0000752// TI - Thumb instruction.
753
754class ThumbI<dag outs, dag ins, AddrMode am, SizeFlagVal sz,
755 string asm, string cstr, list<dag> pattern>
Evan Chengbe998242008-11-06 08:47:38 +0000756 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
Evan Cheng34a46e12008-08-29 06:41:12 +0000757 let OutOperandList = outs;
758 let InOperandList = ins;
759 let AsmString = asm;
760 let Pattern = pattern;
761 list<Predicate> Predicates = [IsThumb];
762}
763
764class TI<dag outs, dag ins, string asm, list<dag> pattern>
765 : ThumbI<outs, ins, AddrModeNone, Size2Bytes, asm, "", pattern>;
Evan Cheng34a46e12008-08-29 06:41:12 +0000766
767// BL, BLX(1) are translated by assembler into two instructions
768class TIx2<dag outs, dag ins, string asm, list<dag> pattern>
769 : ThumbI<outs, ins, AddrModeNone, Size4Bytes, asm, "", pattern>;
770
771// BR_JT instructions
772class TJTI<dag outs, dag ins, string asm, list<dag> pattern>
773 : ThumbI<outs, ins, AddrModeNone, SizeSpecial, asm, "", pattern>;
774
Evan Cheng19bb7c72009-06-27 02:26:13 +0000775// TPat - Same as Pat<>, but requires that the compiler be in Thumb mode.
776class TPat<dag pattern, dag result> : Pat<pattern, result> {
Bob Wilsone60fee02009-06-22 23:27:02 +0000777 list<Predicate> Predicates = [IsThumb];
778}
779
Evan Cheng19bb7c72009-06-27 02:26:13 +0000780class Tv5Pat<dag pattern, dag result> : Pat<pattern, result> {
Bob Wilsone60fee02009-06-22 23:27:02 +0000781 list<Predicate> Predicates = [IsThumb, HasV5T];
782}
Evan Cheng34a46e12008-08-29 06:41:12 +0000783
Evan Cheng6fc534c2009-06-23 19:38:13 +0000784// Thumb1 only
785class Thumb1I<dag outs, dag ins, AddrMode am, SizeFlagVal sz,
786 string asm, string cstr, list<dag> pattern>
787 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
788 let OutOperandList = outs;
789 let InOperandList = ins;
790 let AsmString = asm;
791 let Pattern = pattern;
792 list<Predicate> Predicates = [IsThumb1Only];
793}
794
795class T1I<dag outs, dag ins, string asm, list<dag> pattern>
796 : Thumb1I<outs, ins, AddrModeNone, Size2Bytes, asm, "", pattern>;
Evan Cheng532cdc52009-06-29 07:51:04 +0000797class T1I1<dag outs, dag ins, string asm, list<dag> pattern>
798 : Thumb1I<outs, ins, AddrModeT1_1, Size2Bytes, asm, "", pattern>;
799class T1I2<dag outs, dag ins, string asm, list<dag> pattern>
800 : Thumb1I<outs, ins, AddrModeT1_2, Size2Bytes, asm, "", pattern>;
801class T1I4<dag outs, dag ins, string asm, list<dag> pattern>
802 : Thumb1I<outs, ins, AddrModeT1_4, Size2Bytes, asm, "", pattern>;
803class T1Is<dag outs, dag ins, string asm, list<dag> pattern>
804 : Thumb1I<outs, ins, AddrModeT1_s, Size2Bytes, asm, "", pattern>;
David Goodwinf6154702009-06-30 18:04:13 +0000805class T1Ix2<dag outs, dag ins, string asm, list<dag> pattern>
806 : Thumb1I<outs, ins, AddrModeNone, Size4Bytes, asm, "", pattern>;
807class T1JTI<dag outs, dag ins, string asm, list<dag> pattern>
808 : Thumb1I<outs, ins, AddrModeNone, SizeSpecial, asm, "", pattern>;
Evan Cheng6fc534c2009-06-23 19:38:13 +0000809
810// Two-address instructions
811class T1It<dag outs, dag ins, string asm, list<dag> pattern>
812 : Thumb1I<outs, ins, AddrModeNone, Size2Bytes, asm, "$lhs = $dst", pattern>;
813
Evan Cheng19bb7c72009-06-27 02:26:13 +0000814class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Cheng6fc534c2009-06-23 19:38:13 +0000815 list<Predicate> Predicates = [IsThumb1Only];
816}
817
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000818// Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
819class Thumb2I<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
820 string opc, string asm, string cstr, list<dag> pattern>
Evan Cheng36173712009-06-23 17:48:47 +0000821 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000822 let OutOperandList = oops;
823 let InOperandList = !con(iops, (ops pred:$p));
824 let AsmString = !strconcat(opc, !strconcat("${p}", asm));
825 let Pattern = pattern;
Evan Chengb1b2abc2009-07-02 06:38:40 +0000826 list<Predicate> Predicates = [IsThumb2];
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000827}
828
829// Same as Thumb2I except it can optionally modify CPSR. Note it's modeled as
830// an input operand since by default it's a zero register. It will
831// become an implicit def once it's "flipped".
832// FIXME: This uses unified syntax so {s} comes before {p}. We should make it
833// more consistent.
834class Thumb2sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
835 string opc, string asm, string cstr, list<dag> pattern>
836 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
837 let OutOperandList = oops;
838 let InOperandList = !con(iops, (ops pred:$p, cc_out:$s));
839 let AsmString = !strconcat(opc, !strconcat("${s}${p}", asm));
840 let Pattern = pattern;
Evan Chengb1b2abc2009-07-02 06:38:40 +0000841 list<Predicate> Predicates = [IsThumb2];
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000842}
843
844// Special cases
845class Thumb2XI<dag oops, dag iops, AddrMode am, SizeFlagVal sz,
846 string asm, string cstr, list<dag> pattern>
847 : InstARM<am, sz, IndexModeNone, ThumbFrm, cstr> {
848 let OutOperandList = oops;
849 let InOperandList = iops;
Evan Cheng36173712009-06-23 17:48:47 +0000850 let AsmString = asm;
851 let Pattern = pattern;
Evan Chengb1b2abc2009-07-02 06:38:40 +0000852 list<Predicate> Predicates = [IsThumb2];
Evan Cheng36173712009-06-23 17:48:47 +0000853}
854
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000855class T2I<dag oops, dag iops, string opc, string asm, list<dag> pattern>
856 : Thumb2I<oops, iops, AddrModeNone, Size4Bytes, opc, asm, "", pattern>;
Evan Cheng532cdc52009-06-29 07:51:04 +0000857class T2Ii12<dag oops, dag iops, string opc, string asm, list<dag> pattern>
858 : Thumb2I<oops, iops, AddrModeT2_i12, Size4Bytes, opc, asm, "", pattern>;
859class T2Ii8<dag oops, dag iops, string opc, string asm, list<dag> pattern>
860 : Thumb2I<oops, iops, AddrModeT2_i8, Size4Bytes, opc, asm, "", pattern>;
861class T2Iso<dag oops, dag iops, string opc, string asm, list<dag> pattern>
862 : Thumb2I<oops, iops, AddrModeT2_so, Size4Bytes, opc, asm, "", pattern>;
863class T2Ipc<dag oops, dag iops, string opc, string asm, list<dag> pattern>
864 : Thumb2I<oops, iops, AddrModeT2_pc, Size4Bytes, opc, asm, "", pattern>;
Evan Cheng503be112009-06-30 02:15:48 +0000865class T2Ii8s4<dag oops, dag iops, string opc, string asm, list<dag> pattern>
866 : Thumb2I<oops, iops, AddrModeT2_i8s4, Size4Bytes, opc, asm, "", pattern>;
Evan Cheng3d92dfd2009-06-25 02:08:06 +0000867
868class T2sI<dag oops, dag iops, string opc, string asm, list<dag> pattern>
869 : Thumb2sI<oops, iops, AddrModeNone, Size4Bytes, opc, asm, "", pattern>;
870
871class T2XI<dag oops, dag iops, string asm, list<dag> pattern>
872 : Thumb2XI<oops, iops, AddrModeNone, Size4Bytes, asm, "", pattern>;
David Goodwinf6154702009-06-30 18:04:13 +0000873class T2JTI<dag oops, dag iops, string asm, list<dag> pattern>
874 : Thumb2XI<oops, iops, AddrModeNone, SizeSpecial, asm, "", pattern>;
Evan Cheng36173712009-06-23 17:48:47 +0000875
Evan Cheng19bb7c72009-06-27 02:26:13 +0000876// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
877class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
Evan Chengb1b2abc2009-07-02 06:38:40 +0000878 list<Predicate> Predicates = [IsThumb2];
Evan Cheng36173712009-06-23 17:48:47 +0000879}
880
Evan Cheng34a46e12008-08-29 06:41:12 +0000881//===----------------------------------------------------------------------===//
882
Evan Chengc63e15e2008-11-11 02:11:05 +0000883//===----------------------------------------------------------------------===//
884// ARM VFP Instruction templates.
885//
886
Evan Chengbb786b32008-11-11 21:48:44 +0000887// ARM VFP addrmode5 loads and stores
888class ADI5<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} = 0b1011;
Evan Chengc63e15e2008-11-11 02:11:05 +0000896}
897
Evan Chengbb786b32008-11-11 21:48:44 +0000898class ASI5<bits<4> opcod1, bits<2> opcod2, dag oops, dag iops,
899 string opc, string asm, list<dag> pattern>
Evan Chengc63e15e2008-11-11 02:11:05 +0000900 : I<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
Evan Chengbb786b32008-11-11 21:48:44 +0000901 VFPLdStFrm, opc, asm, "", pattern> {
Evan Chengc63e15e2008-11-11 02:11:05 +0000902 // TODO: Mark the instructions with the appropriate subtarget info.
Evan Chengbb786b32008-11-11 21:48:44 +0000903 let Inst{27-24} = opcod1;
904 let Inst{21-20} = opcod2;
905 let Inst{11-8} = 0b1010;
Evan Chengc63e15e2008-11-11 02:11:05 +0000906}
907
Evan Chengbb786b32008-11-11 21:48:44 +0000908// Load / store multiple
909class AXSI5<dag oops, dag iops, string asm, list<dag> pattern>
910 : XI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
911 VFPLdStMulFrm, asm, "", pattern> {
912 // TODO: Mark the instructions with the appropriate subtarget info.
913 let Inst{27-25} = 0b110;
914 let Inst{11-8} = 0b1011;
915}
916
917class AXDI5<dag oops, dag iops, string asm, list<dag> pattern>
918 : XI<oops, iops, AddrMode5, Size4Bytes, IndexModeNone,
919 VFPLdStMulFrm, asm, "", pattern> {
920 // TODO: Mark the instructions with the appropriate subtarget info.
921 let Inst{27-25} = 0b110;
922 let Inst{11-8} = 0b1010;
923}
924
925
Evan Chengc63e15e2008-11-11 02:11:05 +0000926// Double precision, unary
927class ADuI<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3, dag oops, dag iops,
928 string opc, string asm, list<dag> pattern>
929 : AI<oops, iops, VFPUnaryFrm, opc, asm, pattern> {
930 let Inst{27-20} = opcod1;
931 let Inst{19-16} = opcod2;
932 let Inst{11-8} = 0b1011;
933 let Inst{7-4} = opcod3;
934}
935
936// Double precision, binary
937class ADbI<bits<8> opcod, dag oops, dag iops, string opc,
938 string asm, list<dag> pattern>
939 : AI<oops, iops, VFPBinaryFrm, opc, asm, pattern> {
940 let Inst{27-20} = opcod;
941 let Inst{11-8} = 0b1011;
942}
943
944// Single precision, unary
945class ASuI<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3, dag oops, dag iops,
946 string opc, string asm, list<dag> pattern>
947 : AI<oops, iops, VFPUnaryFrm, opc, asm, pattern> {
948 // Bits 22 (D bit) and 5 (M bit) will be changed during instruction encoding.
949 let Inst{27-20} = opcod1;
950 let Inst{19-16} = opcod2;
951 let Inst{11-8} = 0b1010;
952 let Inst{7-4} = opcod3;
953}
954
955// Single precision, binary
956class ASbI<bits<8> opcod, dag oops, dag iops, string opc,
957 string asm, list<dag> pattern>
958 : AI<oops, iops, VFPBinaryFrm, opc, asm, pattern> {
959 // Bit 22 (D bit) can be changed during instruction encoding.
960 let Inst{27-20} = opcod;
961 let Inst{11-8} = 0b1010;
962}
963
Evan Cheng74273382008-11-12 06:41:41 +0000964// VFP conversion instructions
965class AVConv1I<bits<8> opcod1, bits<4> opcod2, bits<4> opcod3,
966 dag oops, dag iops, string opc, string asm, list<dag> pattern>
Evan Cheng9d3cc182008-11-11 19:40:26 +0000967 : AI<oops, iops, VFPConv1Frm, opc, asm, pattern> {
968 let Inst{27-20} = opcod1;
Evan Cheng74273382008-11-12 06:41:41 +0000969 let Inst{19-16} = opcod2;
970 let Inst{11-8} = opcod3;
971 let Inst{6} = 1;
972}
973
974class AVConvXI<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, Format f,
975 string opc, string asm, list<dag> pattern>
976 : AI<oops, iops, f, opc, asm, pattern> {
977 let Inst{27-20} = opcod1;
Evan Cheng9d3cc182008-11-11 19:40:26 +0000978 let Inst{11-8} = opcod2;
979 let Inst{4} = 1;
980}
981
Evan Cheng828ccdc2008-11-11 22:46:12 +0000982class AVConv2I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
Evan Cheng74273382008-11-12 06:41:41 +0000983 string asm, list<dag> pattern>
984 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv2Frm, opc, asm, pattern>;
Evan Cheng828ccdc2008-11-11 22:46:12 +0000985
Evan Cheng74273382008-11-12 06:41:41 +0000986class AVConv3I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
987 string asm, list<dag> pattern>
988 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv3Frm, opc, asm, pattern>;
989
990class AVConv4I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
991 string asm, list<dag> pattern>
992 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv4Frm, opc, asm, pattern>;
993
994class AVConv5I<bits<8> opcod1, bits<4> opcod2, dag oops, dag iops, string opc,
995 string asm, list<dag> pattern>
996 : AVConvXI<opcod1, opcod2, oops, iops, VFPConv5Frm, opc, asm, pattern>;
Evan Cheng9d3cc182008-11-11 19:40:26 +0000997
Evan Chengc63e15e2008-11-11 02:11:05 +0000998//===----------------------------------------------------------------------===//
999
Bob Wilsone60fee02009-06-22 23:27:02 +00001000//===----------------------------------------------------------------------===//
1001// ARM NEON Instruction templates.
1002//
Evan Cheng34a46e12008-08-29 06:41:12 +00001003
Bob Wilsone60fee02009-06-22 23:27:02 +00001004class NeonI<dag oops, dag iops, AddrMode am, IndexMode im, string asm,
1005 string cstr, list<dag> pattern>
1006 : InstARM<am, Size4Bytes, im, NEONFrm, cstr> {
1007 let OutOperandList = oops;
1008 let InOperandList = iops;
1009 let AsmString = asm;
1010 let Pattern = pattern;
1011 list<Predicate> Predicates = [HasNEON];
Evan Cheng34a46e12008-08-29 06:41:12 +00001012}
1013
Bob Wilsone60fee02009-06-22 23:27:02 +00001014class NI<dag oops, dag iops, string asm, list<dag> pattern>
1015 : NeonI<oops, iops, AddrModeNone, IndexModeNone, asm, "", pattern> {
Evan Cheng34a46e12008-08-29 06:41:12 +00001016}
Bob Wilsone60fee02009-06-22 23:27:02 +00001017
1018class NDataI<dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1019 : NeonI<oops, iops, AddrModeNone, IndexModeNone, asm, cstr, pattern> {
1020 let Inst{31-25} = 0b1111001;
1021}
1022
1023// NEON "one register and a modified immediate" format.
1024class N1ModImm<bit op23, bits<3> op21_19, bits<4> op11_8, bit op7, bit op6,
1025 bit op5, bit op4,
1026 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1027 : NDataI<oops, iops, asm, cstr, pattern> {
1028 let Inst{23} = op23;
1029 let Inst{21-19} = op21_19;
1030 let Inst{11-8} = op11_8;
1031 let Inst{7} = op7;
1032 let Inst{6} = op6;
1033 let Inst{5} = op5;
1034 let Inst{4} = op4;
1035}
1036
1037// NEON 2 vector register format.
1038class N2V<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16,
1039 bits<5> op11_7, bit op6, bit op4,
1040 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1041 : NDataI<oops, iops, asm, cstr, pattern> {
1042 let Inst{24-23} = op24_23;
1043 let Inst{21-20} = op21_20;
1044 let Inst{19-18} = op19_18;
1045 let Inst{17-16} = op17_16;
1046 let Inst{11-7} = op11_7;
1047 let Inst{6} = op6;
1048 let Inst{4} = op4;
1049}
1050
1051// NEON 2 vector register with immediate.
1052class N2VImm<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
1053 bit op6, bit op4,
1054 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1055 : NDataI<oops, iops, asm, cstr, pattern> {
1056 let Inst{24} = op24;
1057 let Inst{23} = op23;
1058 let Inst{21-16} = op21_16;
1059 let Inst{11-8} = op11_8;
1060 let Inst{7} = op7;
1061 let Inst{6} = op6;
1062 let Inst{4} = op4;
1063}
1064
1065// NEON 3 vector register format.
1066class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
1067 dag oops, dag iops, string asm, string cstr, list<dag> pattern>
1068 : NDataI<oops, iops, asm, cstr, pattern> {
1069 let Inst{24} = op24;
1070 let Inst{23} = op23;
1071 let Inst{21-20} = op21_20;
1072 let Inst{11-8} = op11_8;
1073 let Inst{6} = op6;
1074 let Inst{4} = op4;
1075}
1076
1077// NEON VMOVs between scalar and core registers.
1078class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1079 dag oops, dag iops, Format f, string opc, string asm,
1080 list<dag> pattern>
1081 : AI<oops, iops, f, opc, asm, pattern> {
1082 let Inst{27-20} = opcod1;
1083 let Inst{11-8} = opcod2;
1084 let Inst{6-5} = opcod3;
1085 let Inst{4} = 1;
1086 list<Predicate> Predicates = [HasNEON];
1087}
1088class NVGetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1089 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1090 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONGetLnFrm, opc, asm,
1091 pattern>;
1092class NVSetLane<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1093 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1094 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONSetLnFrm, opc, asm,
1095 pattern>;
1096class NVDup<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
1097 dag oops, dag iops, string opc, string asm, list<dag> pattern>
1098 : NVLaneOp<opcod1, opcod2, opcod3, oops, iops, NEONDupFrm, opc, asm, pattern>;