blob: 0738ac469dff3b886a5733c1fa43399831ad0a84 [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- X86InstrFormats.td - X86 Instruction Formats -------*- tablegen -*-===//
2//
Evan Cheng12c6be82007-07-31 08:04:03 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Jia Liub22310f2012-02-18 12:03:15 +00007//
Evan Cheng12c6be82007-07-31 08:04:03 +00008//===----------------------------------------------------------------------===//
9
10//===----------------------------------------------------------------------===//
11// X86 Instruction Format Definitions.
12//
13
14// Format specifies the encoding used by the instruction. This is part of the
15// ad-hoc solution used to emit machine instruction encodings by our machine
16// code emitter.
17class Format<bits<6> val> {
18 bits<6> Value = val;
19}
20
21def Pseudo : Format<0>; def RawFrm : Format<1>;
22def AddRegFrm : Format<2>; def MRMDestReg : Format<3>;
23def MRMDestMem : Format<4>; def MRMSrcReg : Format<5>;
Craig Topper35da3d12014-01-16 07:36:58 +000024def MRMSrcMem : Format<6>; def RawFrmMemOffs : Format<7>;
David Woodhouseb33c2ef2014-01-22 15:08:21 +000025def RawFrmSrc : Format<8>; def RawFrmDst : Format<9>;
David Woodhouse9bbf7ca2014-01-22 15:08:36 +000026def RawFrmDstSrc: Format<10>;
Craig Toppera0869dc2014-02-10 06:55:41 +000027def MRMXr : Format<14>; def MRMXm : Format<15>;
Evan Cheng12c6be82007-07-31 08:04:03 +000028def MRM0r : Format<16>; def MRM1r : Format<17>; def MRM2r : Format<18>;
29def MRM3r : Format<19>; def MRM4r : Format<20>; def MRM5r : Format<21>;
30def MRM6r : Format<22>; def MRM7r : Format<23>;
31def MRM0m : Format<24>; def MRM1m : Format<25>; def MRM2m : Format<26>;
32def MRM3m : Format<27>; def MRM4m : Format<28>; def MRM5m : Format<29>;
33def MRM6m : Format<30>; def MRM7m : Format<31>;
Chris Lattnerf7477e52010-02-12 02:06:33 +000034def MRM_C1 : Format<33>;
Chris Lattner140caa72010-02-13 00:41:14 +000035def MRM_C2 : Format<34>;
36def MRM_C3 : Format<35>;
37def MRM_C4 : Format<36>;
38def MRM_C8 : Format<37>;
39def MRM_C9 : Format<38>;
Michael Liao95d944032013-04-11 04:52:28 +000040def MRM_CA : Format<39>;
41def MRM_CB : Format<40>;
42def MRM_E8 : Format<41>;
43def MRM_F0 : Format<42>;
Chris Lattnercea0a8d2010-09-17 18:02:29 +000044def RawFrmImm8 : Format<43>;
45def RawFrmImm16 : Format<44>;
Michael Liao95d944032013-04-11 04:52:28 +000046def MRM_F8 : Format<45>;
47def MRM_F9 : Format<46>;
48def MRM_D0 : Format<47>;
49def MRM_D1 : Format<48>;
50def MRM_D4 : Format<49>;
51def MRM_D5 : Format<50>;
52def MRM_D6 : Format<51>;
53def MRM_D8 : Format<52>;
54def MRM_D9 : Format<53>;
55def MRM_DA : Format<54>;
56def MRM_DB : Format<55>;
57def MRM_DC : Format<56>;
58def MRM_DD : Format<57>;
59def MRM_DE : Format<58>;
60def MRM_DF : Format<59>;
Evan Cheng12c6be82007-07-31 08:04:03 +000061
62// ImmType - This specifies the immediate type used by an instruction. This is
63// part of the ad-hoc solution used to emit machine instruction encodings by our
64// machine code emitter.
David Woodhouse0b6c9492014-01-30 22:20:41 +000065class ImmType<bits<4> val> {
66 bits<4> Value = val;
Evan Cheng12c6be82007-07-31 08:04:03 +000067}
Chris Lattner12455ca2010-02-12 22:27:07 +000068def NoImm : ImmType<0>;
69def Imm8 : ImmType<1>;
70def Imm8PCRel : ImmType<2>;
71def Imm16 : ImmType<3>;
Chris Lattnerac588122010-07-07 22:27:31 +000072def Imm16PCRel : ImmType<4>;
73def Imm32 : ImmType<5>;
74def Imm32PCRel : ImmType<6>;
David Woodhouse0b6c9492014-01-30 22:20:41 +000075def Imm32S : ImmType<7>;
76def Imm64 : ImmType<8>;
Evan Cheng12c6be82007-07-31 08:04:03 +000077
78// FPFormat - This specifies what form this FP instruction has. This is used by
79// the Floating-Point stackifier pass.
80class FPFormat<bits<3> val> {
81 bits<3> Value = val;
82}
83def NotFP : FPFormat<0>;
84def ZeroArgFP : FPFormat<1>;
85def OneArgFP : FPFormat<2>;
86def OneArgFPRW : FPFormat<3>;
87def TwoArgFP : FPFormat<4>;
88def CompareFP : FPFormat<5>;
89def CondMovFP : FPFormat<6>;
90def SpecialFP : FPFormat<7>;
91
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +000092// Class specifying the SSE execution domain, used by the SSEDomainFix pass.
Jakob Stoklund Olesendbff4e82010-03-30 22:46:53 +000093// Keep in sync with tables in X86InstrInfo.cpp.
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +000094class Domain<bits<2> val> {
95 bits<2> Value = val;
96}
97def GenericDomain : Domain<0>;
Jakob Stoklund Olesendbff4e82010-03-30 22:46:53 +000098def SSEPackedSingle : Domain<1>;
99def SSEPackedDouble : Domain<2>;
100def SSEPackedInt : Domain<3>;
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +0000101
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000102// Class specifying the vector form of the decompressed
103// displacement of 8-bit.
104class CD8VForm<bits<3> val> {
105 bits<3> Value = val;
106}
107def CD8VF : CD8VForm<0>; // v := VL
108def CD8VH : CD8VForm<1>; // v := VL/2
109def CD8VQ : CD8VForm<2>; // v := VL/4
110def CD8VO : CD8VForm<3>; // v := VL/8
111def CD8VT1 : CD8VForm<4>; // v := 1
112def CD8VT2 : CD8VForm<5>; // v := 2
113def CD8VT4 : CD8VForm<6>; // v := 4
114def CD8VT8 : CD8VForm<7>; // v := 8
115
Craig Topper10243c82014-01-31 08:47:06 +0000116// Class specifying the prefix used an opcode extension.
Craig Topper5ccb6172014-02-18 00:21:49 +0000117class Prefix<bits<3> val> {
118 bits<3> Value = val;
Craig Topper10243c82014-01-31 08:47:06 +0000119}
120def NoPrfx : Prefix<0>;
Craig Topper5ccb6172014-02-18 00:21:49 +0000121def PS : Prefix<1>;
122def PD : Prefix<2>;
123def XS : Prefix<3>;
124def XD : Prefix<4>;
Craig Topper10243c82014-01-31 08:47:06 +0000125
126// Class specifying the opcode map.
127class Map<bits<5> val> {
128 bits<5> Value = val;
129}
130def OB : Map<0>;
131def TB : Map<1>;
132def T8 : Map<2>;
133def TA : Map<3>;
134def XOP8 : Map<4>;
135def XOP9 : Map<5>;
136def XOPA : Map<6>;
137def D8 : Map<7>;
138def D9 : Map<8>;
139def DA : Map<9>;
140def DB : Map<10>;
141def DC : Map<11>;
142def DD : Map<12>;
143def DE : Map<13>;
144def DF : Map<14>;
145def A6 : Map<15>;
146def A7 : Map<16>;
147
Craig Topperd402df32014-02-02 07:08:01 +0000148// Class specifying the encoding
149class Encoding<bits<2> val> {
150 bits<2> Value = val;
151}
152def EncNormal : Encoding<0>;
153def EncVEX : Encoding<1>;
154def EncXOP : Encoding<2>;
155def EncEVEX : Encoding<3>;
156
Craig Topperfa6298a2014-02-02 09:25:09 +0000157// Operand size for encodings that change based on mode.
158class OperandSize<bits<2> val> {
159 bits<2> Value = val;
160}
161def OpSizeFixed : OperandSize<0>; // Never needs a 0x66 prefix.
162def OpSize16 : OperandSize<1>; // Needs 0x66 prefix in 32-bit mode.
163def OpSize32 : OperandSize<2>; // Needs 0x66 prefix in 16-bit mode.
164
Evan Cheng12c6be82007-07-31 08:04:03 +0000165// Prefix byte classes which are used to indicate to the ad-hoc machine code
166// emitter that various prefix bytes are required.
Craig Topperfa6298a2014-02-02 09:25:09 +0000167class OpSize16 { OperandSize OpSize = OpSize16; }
168class OpSize32 { OperandSize OpSize = OpSize32; }
Evan Cheng12c6be82007-07-31 08:04:03 +0000169class AdSize { bit hasAdSizePrefix = 1; }
170class REX_W { bit hasREX_WPrefix = 1; }
Andrew Lenharth0070dd12008-03-01 13:37:02 +0000171class LOCK { bit hasLockPrefix = 1; }
Craig Topperec688662014-01-31 07:00:55 +0000172class REP { bit hasREPPrefix = 1; }
Craig Topperda7160d2014-02-01 08:17:56 +0000173class TB { Map OpMap = TB; }
Craig Topper10243c82014-01-31 08:47:06 +0000174class D8 { Map OpMap = D8; }
175class D9 { Map OpMap = D9; }
176class DA { Map OpMap = DA; }
177class DB { Map OpMap = DB; }
178class DC { Map OpMap = DC; }
179class DD { Map OpMap = DD; }
180class DE { Map OpMap = DE; }
181class DF { Map OpMap = DF; }
Craig Topper10243c82014-01-31 08:47:06 +0000182class T8 { Map OpMap = T8; }
183class TA { Map OpMap = TA; }
184class A6 { Map OpMap = A6; }
185class A7 { Map OpMap = A7; }
Craig Topper5ccb6172014-02-18 00:21:49 +0000186class XOP8 { Map OpMap = XOP8; Prefix OpPrefix = PS; }
187class XOP9 { Map OpMap = XOP9; Prefix OpPrefix = PS; }
188class XOPA { Map OpMap = XOPA; Prefix OpPrefix = PS; }
189class PS : TB { Prefix OpPrefix = PS; }
Craig Topperda7160d2014-02-01 08:17:56 +0000190class PD : TB { Prefix OpPrefix = PD; }
191class XD : TB { Prefix OpPrefix = XD; }
192class XS : TB { Prefix OpPrefix = XS; }
Craig Topper5ccb6172014-02-18 00:21:49 +0000193class T8PS : T8 { Prefix OpPrefix = PS; }
Craig Topperda7160d2014-02-01 08:17:56 +0000194class T8PD : T8 { Prefix OpPrefix = PD; }
195class T8XD : T8 { Prefix OpPrefix = XD; }
196class T8XS : T8 { Prefix OpPrefix = XS; }
Craig Topper5ccb6172014-02-18 00:21:49 +0000197class TAPS : TA { Prefix OpPrefix = PS; }
Craig Topperda7160d2014-02-01 08:17:56 +0000198class TAPD : TA { Prefix OpPrefix = PD; }
199class TAXD : TA { Prefix OpPrefix = XD; }
Craig Topperd402df32014-02-02 07:08:01 +0000200class VEX { Encoding OpEnc = EncVEX; }
Bruno Cardoso Lopes05166742010-07-01 01:20:06 +0000201class VEX_W { bit hasVEX_WPrefix = 1; }
Craig Topperd402df32014-02-02 07:08:01 +0000202class VEX_4V : VEX { bit hasVEX_4V = 1; }
203class VEX_4VOp3 : VEX { bit hasVEX_4VOp3 = 1; }
Bruno Cardoso Lopese2bd0582010-07-06 22:36:24 +0000204class VEX_I8IMM { bit hasVEX_i8ImmReg = 1; }
Bruno Cardoso Lopesfd8bfcd2010-07-13 21:07:28 +0000205class VEX_L { bit hasVEX_L = 1; }
Craig Topperf18c8962011-10-04 06:30:42 +0000206class VEX_LIG { bit ignoresVEX_L = 1; }
Craig Topperd402df32014-02-02 07:08:01 +0000207class EVEX : VEX { Encoding OpEnc = EncEVEX; }
208class EVEX_4V : VEX_4V { Encoding OpEnc = EncEVEX; }
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000209class EVEX_K { bit hasEVEX_K = 1; }
210class EVEX_KZ : EVEX_K { bit hasEVEX_Z = 1; }
211class EVEX_B { bit hasEVEX_B = 1; }
Elena Demikhovskyb19c9dc2014-01-13 12:55:03 +0000212class EVEX_RC { bit hasEVEX_RC = 1; }
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000213class EVEX_V512 { bit hasEVEX_L2 = 1; bit hasVEX_L = 0; }
214class EVEX_CD8<int esize, CD8VForm form> {
215 bits<2> EVEX_CD8E = !if(!eq(esize, 8), 0b00,
216 !if(!eq(esize, 16), 0b01,
217 !if(!eq(esize, 32), 0b10,
218 !if(!eq(esize, 64), 0b11, ?))));
219 bits<3> EVEX_CD8V = form.Value;
220}
Chris Lattner45270db2010-10-03 18:08:05 +0000221class Has3DNow0F0FOpcode { bit has3DNow0F0FOpcode = 1; }
Craig Toppercd93de92011-12-30 04:48:54 +0000222class MemOp4 { bit hasMemOp4Prefix = 1; }
Craig Topperd402df32014-02-02 07:08:01 +0000223class XOP { Encoding OpEnc = EncXOP; }
224class XOP_4V : XOP { bit hasVEX_4V = 1; }
225class XOP_4VOp3 : XOP { bit hasVEX_4VOp3 = 1; }
226
Evan Cheng12c6be82007-07-31 08:04:03 +0000227class X86Inst<bits<8> opcod, Format f, ImmType i, dag outs, dag ins,
Andrew Trick8523b162012-02-01 23:20:51 +0000228 string AsmStr,
229 InstrItinClass itin,
230 Domain d = GenericDomain>
Evan Cheng12c6be82007-07-31 08:04:03 +0000231 : Instruction {
232 let Namespace = "X86";
233
234 bits<8> Opcode = opcod;
235 Format Form = f;
236 bits<6> FormBits = Form.Value;
237 ImmType ImmT = i;
Evan Cheng12c6be82007-07-31 08:04:03 +0000238
239 dag OutOperandList = outs;
240 dag InOperandList = ins;
241 string AsmString = AsmStr;
242
Chris Lattner7ff33462010-10-31 19:22:57 +0000243 // If this is a pseudo instruction, mark it isCodeGenOnly.
244 let isCodeGenOnly = !eq(!cast<string>(f), "Pseudo");
245
Andrew Trick8523b162012-02-01 23:20:51 +0000246 let Itinerary = itin;
247
Evan Cheng12c6be82007-07-31 08:04:03 +0000248 //
249 // Attributes specific to X86 instructions...
250 //
Craig Topper3484fc22014-01-05 04:17:28 +0000251 bit ForceDisassemble = 0; // Force instruction to disassemble even though it's
252 // isCodeGenonly. Needed to hide an ambiguous
253 // AsmString from the parser, but still disassemble.
254
Craig Topperfa6298a2014-02-02 09:25:09 +0000255 OperandSize OpSize = OpSizeFixed; // Does this instruction's encoding change
256 // based on operand size of the mode
Evan Cheng12c6be82007-07-31 08:04:03 +0000257 bit hasAdSizePrefix = 0; // Does this inst have a 0x67 prefix?
258
Craig Topper10243c82014-01-31 08:47:06 +0000259 Prefix OpPrefix = NoPrfx; // Which prefix byte does this inst have?
260 Map OpMap = OB; // Which opcode map does this inst have?
Eric Christopher3a8ae232010-11-30 09:11:54 +0000261 bit hasREX_WPrefix = 0; // Does this inst require the REX.W prefix?
Jakob Stoklund Olesenf8d7eda2010-03-25 18:52:01 +0000262 FPFormat FPForm = NotFP; // What flavor of FP instruction is this?
Dan Gohmana21bdda2008-08-20 13:46:21 +0000263 bit hasLockPrefix = 0; // Does this inst have a 0xF0 prefix?
Jakob Stoklund Olesenf8d7eda2010-03-25 18:52:01 +0000264 Domain ExeDomain = d;
Craig Topperec688662014-01-31 07:00:55 +0000265 bit hasREPPrefix = 0; // Does this inst have a REP prefix?
Craig Topperd402df32014-02-02 07:08:01 +0000266 Encoding OpEnc = EncNormal; // Encoding used by this instruction
Bruno Cardoso Lopes05166742010-07-01 01:20:06 +0000267 bit hasVEX_WPrefix = 0; // Does this inst set the VEX_W field?
Craig Topperd402df32014-02-02 07:08:01 +0000268 bit hasVEX_4V = 0; // Does this inst require the VEX.VVVV field?
269 bit hasVEX_4VOp3 = 0; // Does this inst require the VEX.VVVV field to
270 // encode the third operand?
Eric Christopher3a8ae232010-11-30 09:11:54 +0000271 bit hasVEX_i8ImmReg = 0; // Does this inst require the last source register
Bruno Cardoso Lopese2bd0582010-07-06 22:36:24 +0000272 // to be encoded in a immediate field?
Eric Christopher3a8ae232010-11-30 09:11:54 +0000273 bit hasVEX_L = 0; // Does this inst use large (256-bit) registers?
Craig Topperf18c8962011-10-04 06:30:42 +0000274 bit ignoresVEX_L = 0; // Does this instruction ignore the L-bit
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000275 bit hasEVEX_K = 0; // Does this inst require masking?
276 bit hasEVEX_Z = 0; // Does this inst set the EVEX_Z field?
277 bit hasEVEX_L2 = 0; // Does this inst set the EVEX_L2 field?
278 bit hasEVEX_B = 0; // Does this inst set the EVEX_B field?
279 bits<2> EVEX_CD8E = 0; // Compressed disp8 form - element-size.
280 bits<3> EVEX_CD8V = 0; // Compressed disp8 form - vector-width.
Chris Lattner45270db2010-10-03 18:08:05 +0000281 bit has3DNow0F0FOpcode =0;// Wacky 3dNow! encoding?
Craig Toppercd93de92011-12-30 04:48:54 +0000282 bit hasMemOp4Prefix = 0; // Same bit as VEX_W, but used for swapping operands
Elena Demikhovskyb19c9dc2014-01-13 12:55:03 +0000283 bit hasEVEX_RC = 0; // Explicitly specified rounding control in FP instruction.
Jakob Stoklund Olesenb93331f2010-04-05 03:10:20 +0000284
285 // TSFlags layout should be kept in sync with X86InstrInfo.h.
286 let TSFlags{5-0} = FormBits;
Craig Topperfa6298a2014-02-02 09:25:09 +0000287 let TSFlags{7-6} = OpSize.Value;
Craig Topper7ceb54a2014-01-06 06:02:58 +0000288 let TSFlags{8} = hasAdSizePrefix;
Craig Topper5ccb6172014-02-18 00:21:49 +0000289 let TSFlags{11-9} = OpPrefix.Value;
290 let TSFlags{16-12} = OpMap.Value;
291 let TSFlags{17} = hasREX_WPrefix;
292 let TSFlags{21-18} = ImmT.Value;
293 let TSFlags{24-22} = FPForm.Value;
294 let TSFlags{25} = hasLockPrefix;
295 let TSFlags{26} = hasREPPrefix;
296 let TSFlags{28-27} = ExeDomain.Value;
297 let TSFlags{30-29} = OpEnc.Value;
298 let TSFlags{38-31} = Opcode;
299 let TSFlags{39} = hasVEX_WPrefix;
300 let TSFlags{40} = hasVEX_4V;
301 let TSFlags{41} = hasVEX_4VOp3;
302 let TSFlags{42} = hasVEX_i8ImmReg;
303 let TSFlags{43} = hasVEX_L;
304 let TSFlags{44} = ignoresVEX_L;
305 let TSFlags{45} = hasEVEX_K;
306 let TSFlags{46} = hasEVEX_Z;
307 let TSFlags{47} = hasEVEX_L2;
308 let TSFlags{48} = hasEVEX_B;
309 let TSFlags{50-49} = EVEX_CD8E;
310 let TSFlags{53-51} = EVEX_CD8V;
311 let TSFlags{54} = has3DNow0F0FOpcode;
312 let TSFlags{55} = hasMemOp4Prefix;
313 let TSFlags{56} = hasEVEX_RC;
Evan Cheng12c6be82007-07-31 08:04:03 +0000314}
315
Eric Christopheref62f572010-11-30 08:57:23 +0000316class PseudoI<dag oops, dag iops, list<dag> pattern>
Andrew Trick8523b162012-02-01 23:20:51 +0000317 : X86Inst<0, Pseudo, NoImm, oops, iops, "", NoItinerary> {
Eric Christopheref62f572010-11-30 08:57:23 +0000318 let Pattern = pattern;
319}
320
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +0000321class I<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000322 list<dag> pattern, InstrItinClass itin = NoItinerary,
Andrew Trick8523b162012-02-01 23:20:51 +0000323 Domain d = GenericDomain>
324 : X86Inst<o, f, NoImm, outs, ins, asm, itin, d> {
Evan Cheng12c6be82007-07-31 08:04:03 +0000325 let Pattern = pattern;
326 let CodeSize = 3;
327}
Sean Callanan04d8cb72009-12-18 00:01:26 +0000328class Ii8 <bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000329 list<dag> pattern, InstrItinClass itin = NoItinerary,
Andrew Trick8523b162012-02-01 23:20:51 +0000330 Domain d = GenericDomain>
331 : X86Inst<o, f, Imm8, outs, ins, asm, itin, d> {
Evan Cheng12c6be82007-07-31 08:04:03 +0000332 let Pattern = pattern;
333 let CodeSize = 3;
334}
Chris Lattner12455ca2010-02-12 22:27:07 +0000335class Ii8PCRel<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000336 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000337 : X86Inst<o, f, Imm8PCRel, outs, ins, asm, itin> {
Chris Lattner12455ca2010-02-12 22:27:07 +0000338 let Pattern = pattern;
339 let CodeSize = 3;
340}
Sean Callanan04d8cb72009-12-18 00:01:26 +0000341class Ii16<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000342 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000343 : X86Inst<o, f, Imm16, outs, ins, asm, itin> {
Evan Cheng12c6be82007-07-31 08:04:03 +0000344 let Pattern = pattern;
345 let CodeSize = 3;
346}
Sean Callanan04d8cb72009-12-18 00:01:26 +0000347class Ii32<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000348 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000349 : X86Inst<o, f, Imm32, outs, ins, asm, itin> {
Evan Cheng12c6be82007-07-31 08:04:03 +0000350 let Pattern = pattern;
351 let CodeSize = 3;
352}
David Woodhouse0b6c9492014-01-30 22:20:41 +0000353class Ii32S<bits<8> o, Format f, dag outs, dag ins, string asm,
354 list<dag> pattern, InstrItinClass itin = NoItinerary>
355 : X86Inst<o, f, Imm32S, outs, ins, asm, itin> {
356 let Pattern = pattern;
357 let CodeSize = 3;
358}
Evan Cheng12c6be82007-07-31 08:04:03 +0000359
Chris Lattnerac588122010-07-07 22:27:31 +0000360class Ii16PCRel<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000361 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000362 : X86Inst<o, f, Imm16PCRel, outs, ins, asm, itin> {
Chris Lattnerac588122010-07-07 22:27:31 +0000363 let Pattern = pattern;
364 let CodeSize = 3;
365}
366
Chris Lattner12455ca2010-02-12 22:27:07 +0000367class Ii32PCRel<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000368 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000369 : X86Inst<o, f, Imm32PCRel, outs, ins, asm, itin> {
Chris Lattner12455ca2010-02-12 22:27:07 +0000370 let Pattern = pattern;
371 let CodeSize = 3;
372}
373
Evan Cheng12c6be82007-07-31 08:04:03 +0000374// FPStack Instruction Templates:
375// FPI - Floating Point Instruction template.
Preston Gurdfa3f6cb2012-05-02 16:03:35 +0000376class FPI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000377 InstrItinClass itin = NoItinerary>
Preston Gurdfa3f6cb2012-05-02 16:03:35 +0000378 : I<o, F, outs, ins, asm, [], itin> {}
Evan Cheng12c6be82007-07-31 08:04:03 +0000379
Bob Wilsona967c422010-08-26 18:08:11 +0000380// FpI_ - Floating Point Pseudo Instruction template. Not Predicated.
Andrew Trick8523b162012-02-01 23:20:51 +0000381class FpI_<dag outs, dag ins, FPFormat fp, list<dag> pattern,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000382 InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000383 : X86Inst<0, Pseudo, NoImm, outs, ins, "", itin> {
Jakob Stoklund Olesenf8d7eda2010-03-25 18:52:01 +0000384 let FPForm = fp;
Evan Cheng12c6be82007-07-31 08:04:03 +0000385 let Pattern = pattern;
386}
387
Sean Callanan050e0cd2009-09-15 00:35:17 +0000388// Templates for instructions that use a 16- or 32-bit segmented address as
389// their only operand: lcall (FAR CALL) and ljmp (FAR JMP)
390//
391// Iseg16 - 16-bit segment selector, 16-bit offset
392// Iseg32 - 16-bit segment selector, 32-bit offset
393
394class Iseg16 <bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000395 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000396 : X86Inst<o, f, Imm16, outs, ins, asm, itin> {
Sean Callanan050e0cd2009-09-15 00:35:17 +0000397 let Pattern = pattern;
398 let CodeSize = 3;
399}
400
401class Iseg32 <bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000402 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000403 : X86Inst<o, f, Imm32, outs, ins, asm, itin> {
Sean Callanan050e0cd2009-09-15 00:35:17 +0000404 let Pattern = pattern;
405 let CodeSize = 3;
406}
407
Bruno Cardoso Lopes6b98f712010-06-17 23:05:30 +0000408// SI - SSE 1 & 2 scalar instructions
Andrew Trick8523b162012-02-01 23:20:51 +0000409class SI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000410 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000411 : I<o, F, outs, ins, asm, pattern, itin> {
Craig Topperd402df32014-02-02 07:08:01 +0000412 let Predicates = !if(!eq(OpEnc.Value, EncEVEX.Value), [HasAVX512],
413 !if(!eq(OpEnc.Value, EncVEX.Value), [UseAVX],
414 !if(!eq(OpPrefix.Value, XS.Value), [UseSSE1],
415 !if(!eq(OpPrefix.Value, XD.Value), [UseSSE2],
416 !if(!eq(OpPrefix.Value, PD.Value), [UseSSE2],
Craig Topper10243c82014-01-31 08:47:06 +0000417 [UseSSE1])))));
Bruno Cardoso Lopes6b98f712010-06-17 23:05:30 +0000418
419 // AVX instructions have a 'v' prefix in the mnemonic
Craig Topperd402df32014-02-02 07:08:01 +0000420 let AsmString = !if(!eq(OpEnc.Value, EncEVEX.Value), !strconcat("v", asm),
421 !if(!eq(OpEnc.Value, EncVEX.Value), !strconcat("v", asm),
422 asm));
Bruno Cardoso Lopes6b98f712010-06-17 23:05:30 +0000423}
424
Bruno Cardoso Lopes191a1cd2010-06-24 00:32:06 +0000425// SIi8 - SSE 1 & 2 scalar instructions
426class SIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000427 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000428 : Ii8<o, F, outs, ins, asm, pattern, itin> {
Craig Topperd402df32014-02-02 07:08:01 +0000429 let Predicates = !if(!eq(OpEnc.Value, EncEVEX.Value), [HasAVX512],
430 !if(!eq(OpEnc.Value, EncVEX.Value), [UseAVX],
431 !if(!eq(OpPrefix.Value, XS.Value), [UseSSE1],
Craig Topper10243c82014-01-31 08:47:06 +0000432 [UseSSE2])));
Bruno Cardoso Lopes191a1cd2010-06-24 00:32:06 +0000433
434 // AVX instructions have a 'v' prefix in the mnemonic
Craig Topperd402df32014-02-02 07:08:01 +0000435 let AsmString = !if(!eq(OpEnc.Value, EncEVEX.Value), !strconcat("v", asm),
436 !if(!eq(OpEnc.Value, EncVEX.Value), !strconcat("v", asm),
437 asm));
Bruno Cardoso Lopes191a1cd2010-06-24 00:32:06 +0000438}
439
Bruno Cardoso Lopes2bfad412010-06-18 23:13:35 +0000440// PI - SSE 1 & 2 packed instructions
441class PI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern,
Andrew Trick8523b162012-02-01 23:20:51 +0000442 InstrItinClass itin, Domain d>
443 : I<o, F, outs, ins, asm, pattern, itin, d> {
Craig Topperd402df32014-02-02 07:08:01 +0000444 let Predicates = !if(!eq(OpEnc.Value, EncEVEX.Value), [HasAVX512],
445 !if(!eq(OpEnc.Value, EncVEX.Value), [HasAVX],
446 !if(!eq(OpPrefix.Value, PD.Value), [UseSSE2],
Craig Topper10243c82014-01-31 08:47:06 +0000447 [UseSSE1])));
Bruno Cardoso Lopes2bfad412010-06-18 23:13:35 +0000448
449 // AVX instructions have a 'v' prefix in the mnemonic
Craig Topperd402df32014-02-02 07:08:01 +0000450 let AsmString = !if(!eq(OpEnc.Value, EncEVEX.Value), !strconcat("v", asm),
451 !if(!eq(OpEnc.Value, EncVEX.Value), !strconcat("v", asm),
452 asm));
Bruno Cardoso Lopes2bfad412010-06-18 23:13:35 +0000453}
454
Michael Liaobbd10792012-08-30 16:54:46 +0000455// MMXPI - SSE 1 & 2 packed instructions with MMX operands
456class MMXPI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern,
457 InstrItinClass itin, Domain d>
458 : I<o, F, outs, ins, asm, pattern, itin, d> {
Craig Topperd402df32014-02-02 07:08:01 +0000459 let Predicates = !if(!eq(OpPrefix.Value, PD.Value), [HasSSE2],
Craig Topper10243c82014-01-31 08:47:06 +0000460 [HasSSE1]);
Michael Liaobbd10792012-08-30 16:54:46 +0000461}
462
Bruno Cardoso Lopes1e13c172010-06-22 23:37:59 +0000463// PIi8 - SSE 1 & 2 packed instructions with immediate
464class PIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Andrew Trick8523b162012-02-01 23:20:51 +0000465 list<dag> pattern, InstrItinClass itin, Domain d>
466 : Ii8<o, F, outs, ins, asm, pattern, itin, d> {
Craig Topperd402df32014-02-02 07:08:01 +0000467 let Predicates = !if(!eq(OpEnc.Value, EncEVEX.Value), [HasAVX512],
468 !if(!eq(OpEnc.Value, EncVEX.Value), [HasAVX],
469 !if(!eq(OpPrefix.Value, PD.Value), [UseSSE2],
Craig Topper10243c82014-01-31 08:47:06 +0000470 [UseSSE1])));
Bruno Cardoso Lopes1e13c172010-06-22 23:37:59 +0000471
472 // AVX instructions have a 'v' prefix in the mnemonic
Craig Topperd402df32014-02-02 07:08:01 +0000473 let AsmString = !if(!eq(OpEnc.Value, EncEVEX.Value), !strconcat("v", asm),
474 !if(!eq(OpEnc.Value, EncVEX.Value), !strconcat("v", asm),
475 asm));
Bruno Cardoso Lopes1e13c172010-06-22 23:37:59 +0000476}
477
Evan Cheng12c6be82007-07-31 08:04:03 +0000478// SSE1 Instruction Templates:
479//
480// SSI - SSE1 instructions with XS prefix.
Craig Topper5ccb6172014-02-18 00:21:49 +0000481// PSI - SSE1 instructions with PS prefix.
482// PSIi8 - SSE1 instructions with ImmT == Imm8 and PS prefix.
Bruno Cardoso Lopesc2f87b72010-06-08 22:51:23 +0000483// VSSI - SSE1 instructions with XS prefix in AVX form.
Craig Topper5ccb6172014-02-18 00:21:49 +0000484// VPSI - SSE1 instructions with PS prefix in AVX form, packed single.
Evan Cheng12c6be82007-07-31 08:04:03 +0000485
Andrew Trick8523b162012-02-01 23:20:51 +0000486class SSI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000487 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000488 : I<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[UseSSE1]>;
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +0000489class SSIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000490 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000491 : Ii8<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[UseSSE1]>;
Andrew Trick8523b162012-02-01 23:20:51 +0000492class PSI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000493 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topper5ccb6172014-02-18 00:21:49 +0000494 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, PS,
Michael Liaobbd10792012-08-30 16:54:46 +0000495 Requires<[UseSSE1]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000496class PSIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000497 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topper5ccb6172014-02-18 00:21:49 +0000498 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, PS,
Michael Liaobbd10792012-08-30 16:54:46 +0000499 Requires<[UseSSE1]>;
Bruno Cardoso Lopesc2f87b72010-06-08 22:51:23 +0000500class VSSI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000501 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000502 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, XS,
Bruno Cardoso Lopes77a3c442010-07-13 00:38:47 +0000503 Requires<[HasAVX]>;
Bruno Cardoso Lopesb06f54b2010-06-12 01:23:26 +0000504class VPSI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000505 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topper5ccb6172014-02-18 00:21:49 +0000506 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin, SSEPackedSingle>, PS,
Bruno Cardoso Lopes77a3c442010-07-13 00:38:47 +0000507 Requires<[HasAVX]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000508
509// SSE2 Instruction Templates:
510//
Bill Wendling76105a42008-08-27 21:32:04 +0000511// SDI - SSE2 instructions with XD prefix.
512// SDIi8 - SSE2 instructions with ImmT == Imm8 and XD prefix.
Craig Topperf881d382012-07-30 02:14:02 +0000513// S2SI - SSE2 instructions with XS prefix.
Bill Wendling76105a42008-08-27 21:32:04 +0000514// SSDIi8 - SSE2 instructions with ImmT == Imm8 and XS prefix.
Craig Topperae11aed2014-01-14 07:41:20 +0000515// PDI - SSE2 instructions with PD prefix, packed double domain.
516// PDIi8 - SSE2 instructions with ImmT == Imm8 and PD prefix.
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000517// VSDI - SSE2 scalar instructions with XD prefix in AVX form.
Craig Topperae11aed2014-01-14 07:41:20 +0000518// VPDI - SSE2 vector instructions with PD prefix in AVX form,
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000519// packed double domain.
Craig Topperae11aed2014-01-14 07:41:20 +0000520// VS2I - SSE2 scalar instructions with PD prefix in AVX form.
521// S2I - SSE2 scalar instructions with PD prefix.
Michael Liaobbd10792012-08-30 16:54:46 +0000522// MMXSDIi8 - SSE2 instructions with ImmT == Imm8 and XD prefix as well as
523// MMX operands.
524// MMXSSDIi8 - SSE2 instructions with ImmT == Imm8 and XS prefix as well as
525// MMX operands.
Evan Cheng12c6be82007-07-31 08:04:03 +0000526
Andrew Trick8523b162012-02-01 23:20:51 +0000527class SDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000528 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000529 : I<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[UseSSE2]>;
Evan Cheng01c7c192007-12-20 19:57:09 +0000530class SDIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000531 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000532 : Ii8<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[UseSSE2]>;
Craig Topperf881d382012-07-30 02:14:02 +0000533class S2SI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000534 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000535 : I<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[UseSSE2]>;
Craig Topperf881d382012-07-30 02:14:02 +0000536class S2SIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000537 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000538 : Ii8<o, F, outs, ins, asm, pattern>, XS, Requires<[UseSSE2]>;
Andrew Trick8523b162012-02-01 23:20:51 +0000539class PDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000540 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000541 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, PD,
Michael Liaobbd10792012-08-30 16:54:46 +0000542 Requires<[UseSSE2]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000543class PDIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000544 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000545 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, PD,
Michael Liaobbd10792012-08-30 16:54:46 +0000546 Requires<[UseSSE2]>;
Bruno Cardoso Lopesc2f87b72010-06-08 22:51:23 +0000547class VSDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000548 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000549 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, XD,
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000550 Requires<[UseAVX]>;
Craig Topperf881d382012-07-30 02:14:02 +0000551class VS2SI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000552 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperf881d382012-07-30 02:14:02 +0000553 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, XS,
554 Requires<[HasAVX]>;
Bruno Cardoso Lopesb06f54b2010-06-12 01:23:26 +0000555class VPDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000556 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000557 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin, SSEPackedDouble>,
558 PD, Requires<[HasAVX]>;
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000559class VS2I<bits<8> o, Format F, dag outs, dag ins, string asm,
560 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000561 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, PD,
562 Requires<[UseAVX]>;
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000563class S2I<bits<8> o, Format F, dag outs, dag ins, string asm,
564 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000565 : I<o, F, outs, ins, asm, pattern, itin>, PD, Requires<[UseSSE2]>;
Michael Liaobbd10792012-08-30 16:54:46 +0000566class MMXSDIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000567 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000568 : Ii8<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[HasSSE2]>;
569class MMXS2SIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000570 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000571 : Ii8<o, F, outs, ins, asm, pattern>, XS, Requires<[HasSSE2]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000572
573// SSE3 Instruction Templates:
574//
Craig Topperae11aed2014-01-14 07:41:20 +0000575// S3I - SSE3 instructions with PD prefixes.
Evan Cheng12c6be82007-07-31 08:04:03 +0000576// S3SI - SSE3 instructions with XS prefix.
577// S3DI - SSE3 instructions with XD prefix.
578
Sean Callanan04d8cb72009-12-18 00:01:26 +0000579class S3SI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000580 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000581 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, XS,
Michael Liaobbd10792012-08-30 16:54:46 +0000582 Requires<[UseSSE3]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000583class S3DI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000584 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000585 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, XD,
Michael Liaobbd10792012-08-30 16:54:46 +0000586 Requires<[UseSSE3]>;
Andrew Trick8523b162012-02-01 23:20:51 +0000587class S3I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000588 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000589 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, PD,
Michael Liaobbd10792012-08-30 16:54:46 +0000590 Requires<[UseSSE3]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000591
592
Nate Begeman8ef50212008-02-12 22:51:28 +0000593// SSSE3 Instruction Templates:
594//
595// SS38I - SSSE3 instructions with T8 prefix.
596// SS3AI - SSSE3 instructions with TA prefix.
Michael Liaobbd10792012-08-30 16:54:46 +0000597// MMXSS38I - SSSE3 instructions with T8 prefix and MMX operands.
598// MMXSS3AI - SSSE3 instructions with TA prefix and MMX operands.
Nate Begeman8ef50212008-02-12 22:51:28 +0000599//
600// Note: SSSE3 instructions have 64-bit and 128-bit versions. The 64-bit version
Craig Topper744f6312012-01-09 00:11:29 +0000601// uses the MMX registers. The 64-bit versions are grouped with the MMX
602// classes. They need to be enabled even if AVX is enabled.
Nate Begeman8ef50212008-02-12 22:51:28 +0000603
604class SS38I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000605 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000606 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8PD,
Michael Liaobbd10792012-08-30 16:54:46 +0000607 Requires<[UseSSSE3]>;
Nate Begeman8ef50212008-02-12 22:51:28 +0000608class SS3AI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000609 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000610 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Michael Liaobbd10792012-08-30 16:54:46 +0000611 Requires<[UseSSSE3]>;
612class MMXSS38I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000613 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000614 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8,
615 Requires<[HasSSSE3]>;
616class MMXSS3AI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000617 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000618 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +0000619 Requires<[HasSSSE3]>;
Nate Begeman8ef50212008-02-12 22:51:28 +0000620
621// SSE4.1 Instruction Templates:
622//
623// SS48I - SSE 4.1 instructions with T8 prefix.
Evan Cheng96bdbd62008-03-14 07:39:27 +0000624// SS41AIi8 - SSE 4.1 instructions with TA prefix and ImmT == Imm8.
Nate Begeman8ef50212008-02-12 22:51:28 +0000625//
626class SS48I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000627 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000628 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8PD,
Michael Liaobbd10792012-08-30 16:54:46 +0000629 Requires<[UseSSE41]>;
Evan Cheng96bdbd62008-03-14 07:39:27 +0000630class SS4AIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000631 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000632 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Michael Liaobbd10792012-08-30 16:54:46 +0000633 Requires<[UseSSE41]>;
Nate Begeman8ef50212008-02-12 22:51:28 +0000634
Nate Begeman55b7bec2008-07-17 16:51:19 +0000635// SSE4.2 Instruction Templates:
636//
637// SS428I - SSE 4.2 instructions with T8 prefix.
638class SS428I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000639 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000640 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8PD,
Michael Liaobbd10792012-08-30 16:54:46 +0000641 Requires<[UseSSE42]>;
Nate Begeman8ef50212008-02-12 22:51:28 +0000642
Craig Topper96fa5972011-10-16 16:50:08 +0000643// SS42FI - SSE 4.2 instructions with T8XD prefix.
Michael Liaobbd10792012-08-30 16:54:46 +0000644// NOTE: 'HasSSE42' is used as SS42FI is only used for CRC32 insns.
Eric Christopher7dfa9f22009-08-08 21:55:08 +0000645class SS42FI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000646 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000647 : I<o, F, outs, ins, asm, pattern, itin>, T8XD, Requires<[HasSSE42]>;
Craig Topperb9109842012-01-01 19:51:58 +0000648
Eric Christopher9fe912d2009-08-18 22:50:32 +0000649// SS42AI = SSE 4.2 instructions with TA prefix
650class SS42AI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000651 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000652 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Michael Liaobbd10792012-08-30 16:54:46 +0000653 Requires<[UseSSE42]>;
Eric Christopher9fe912d2009-08-18 22:50:32 +0000654
Bruno Cardoso Lopes14c5fd42010-07-20 00:11:13 +0000655// AVX Instruction Templates:
656// Instructions introduced in AVX (no SSE equivalent forms)
657//
Craig Topperae11aed2014-01-14 07:41:20 +0000658// AVX8I - AVX instructions with T8PD prefix.
659// AVXAIi8 - AVX instructions with TAPD prefix and ImmT = Imm8.
Bruno Cardoso Lopes14c5fd42010-07-20 00:11:13 +0000660class AVX8I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000661 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000662 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8PD,
Bruno Cardoso Lopes14c5fd42010-07-20 00:11:13 +0000663 Requires<[HasAVX]>;
Bruno Cardoso Lopes3b505842010-07-20 19:44:51 +0000664class AVXAIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000665 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000666 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Bruno Cardoso Lopes3b505842010-07-20 19:44:51 +0000667 Requires<[HasAVX]>;
Bruno Cardoso Lopes14c5fd42010-07-20 00:11:13 +0000668
Craig Topper05d1cb92011-11-06 06:12:20 +0000669// AVX2 Instruction Templates:
670// Instructions introduced in AVX2 (no SSE equivalent forms)
671//
Craig Topperae11aed2014-01-14 07:41:20 +0000672// AVX28I - AVX2 instructions with T8PD prefix.
673// AVX2AIi8 - AVX2 instructions with TAPD prefix and ImmT = Imm8.
Craig Topper05d1cb92011-11-06 06:12:20 +0000674class AVX28I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000675 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000676 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8PD,
Craig Topper05d1cb92011-11-06 06:12:20 +0000677 Requires<[HasAVX2]>;
Craig Topperf01f1b52011-11-06 23:04:08 +0000678class AVX2AIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000679 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000680 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Craig Topper05d1cb92011-11-06 06:12:20 +0000681 Requires<[HasAVX2]>;
682
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000683
684// AVX-512 Instruction Templates:
685// Instructions introduced in AVX-512 (no SSE equivalent forms)
686//
Craig Topperae11aed2014-01-14 07:41:20 +0000687// AVX5128I - AVX-512 instructions with T8PD prefix.
688// AVX512AIi8 - AVX-512 instructions with TAPD prefix and ImmT = Imm8.
689// AVX512PDI - AVX-512 instructions with PD, double packed.
Craig Topper5ccb6172014-02-18 00:21:49 +0000690// AVX512PSI - AVX-512 instructions with PS, single packed.
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000691// AVX512XS8I - AVX-512 instructions with T8 and XS prefixes.
692// AVX512XSI - AVX-512 instructions with XS prefix, generic domain.
Craig Topperae11aed2014-01-14 07:41:20 +0000693// AVX512BI - AVX-512 instructions with PD, int packed domain.
694// AVX512SI - AVX-512 scalar instructions with PD prefix.
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000695
696class AVX5128I<bits<8> o, Format F, dag outs, dag ins, string asm,
697 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000698 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8PD,
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000699 Requires<[HasAVX512]>;
700class AVX512XS8I<bits<8> o, Format F, dag outs, dag ins, string asm,
701 list<dag> pattern, InstrItinClass itin = NoItinerary>
702 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8XS,
703 Requires<[HasAVX512]>;
704class AVX512XSI<bits<8> o, Format F, dag outs, dag ins, string asm,
705 list<dag> pattern, InstrItinClass itin = NoItinerary>
706 : I<o, F, outs, ins, asm, pattern, itin>, XS,
707 Requires<[HasAVX512]>;
708class AVX512XDI<bits<8> o, Format F, dag outs, dag ins, string asm,
709 list<dag> pattern, InstrItinClass itin = NoItinerary>
710 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, XD,
711 Requires<[HasAVX512]>;
712class AVX512BI<bits<8> o, Format F, dag outs, dag ins, string asm,
713 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000714 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, PD,
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000715 Requires<[HasAVX512]>;
716class AVX512BIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
717 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000718 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, PD,
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000719 Requires<[HasAVX512]>;
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000720class AVX512AIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
721 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000722 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000723 Requires<[HasAVX512]>;
724class AVX512Ii8<bits<8> o, Format F, dag outs, dag ins, string asm,
725 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperda7160d2014-02-01 08:17:56 +0000726 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>,
Craig Topperae11aed2014-01-14 07:41:20 +0000727 Requires<[HasAVX512]>;
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000728class AVX512PDI<bits<8> o, Format F, dag outs, dag ins, string asm,
729 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000730 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, PD,
731 Requires<[HasAVX512]>;
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000732class AVX512PSI<bits<8> o, Format F, dag outs, dag ins, string asm,
733 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topper5ccb6172014-02-18 00:21:49 +0000734 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, PS,
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000735 Requires<[HasAVX512]>;
736class AVX512PIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
737 list<dag> pattern, Domain d, InstrItinClass itin = NoItinerary>
Craig Topperda7160d2014-02-01 08:17:56 +0000738 : Ii8<o, F, outs, ins, asm, pattern, itin, d>, Requires<[HasAVX512]>;
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000739class AVX512PI<bits<8> o, Format F, dag outs, dag ins, string asm,
740 list<dag> pattern, Domain d, InstrItinClass itin = NoItinerary>
Craig Topperda7160d2014-02-01 08:17:56 +0000741 : I<o, F, outs, ins, asm, pattern, itin, d>, Requires<[HasAVX512]>;
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000742class AVX512FMA3<bits<8> o, Format F, dag outs, dag ins, string asm,
743 list<dag>pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000744 : I<o, F, outs, ins, asm, pattern, itin>, T8PD,
745 EVEX_4V, Requires<[HasAVX512]>;
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000746
Eric Christopher2ef63182010-04-02 21:54:27 +0000747// AES Instruction Templates:
748//
749// AES8I
Eric Christopher1290fa02010-04-05 21:14:32 +0000750// These use the same encoding as the SSE4.2 T8 and TA encodings.
Eric Christopher2ef63182010-04-02 21:54:27 +0000751class AES8I<bits<8> o, Format F, dag outs, dag ins, string asm,
Preston Gurd3fe264d2013-09-13 19:23:28 +0000752 list<dag>pattern, InstrItinClass itin = IIC_AES>
Craig Topperae11aed2014-01-14 07:41:20 +0000753 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8PD,
Craig Topperc0cef322012-05-01 05:35:02 +0000754 Requires<[HasAES]>;
Eric Christopher2ef63182010-04-02 21:54:27 +0000755
756class AESAI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000757 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000758 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Craig Topperc0cef322012-05-01 05:35:02 +0000759 Requires<[HasAES]>;
Eric Christopher2ef63182010-04-02 21:54:27 +0000760
Benjamin Kramera0396e42012-05-31 14:34:17 +0000761// PCLMUL Instruction Templates
762class PCLMULIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000763 list<dag>pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000764 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
765 Requires<[HasPCLMUL]>;
Eli Friedman415412e2011-07-05 18:21:20 +0000766
Benjamin Kramera0396e42012-05-31 14:34:17 +0000767class AVXPCLMULIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000768 list<dag>pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000769 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
770 VEX_4V, Requires<[HasAVX, HasPCLMUL]>;
Bruno Cardoso Lopesea0e05a2010-07-23 18:41:12 +0000771
Bruno Cardoso Lopesacd92302010-07-23 00:54:35 +0000772// FMA3 Instruction Templates
773class FMA3<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000774 list<dag>pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000775 : I<o, F, outs, ins, asm, pattern, itin>, T8PD,
776 VEX_4V, FMASC, Requires<[HasFMA]>;
Bruno Cardoso Lopesacd92302010-07-23 00:54:35 +0000777
Bruno Cardoso Lopes0f9a1f52011-11-25 19:33:42 +0000778// FMA4 Instruction Templates
779class FMA4<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000780 list<dag>pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000781 : Ii8<o, F, outs, ins, asm, pattern, itin>, TAPD,
782 VEX_4V, VEX_I8IMM, FMASC, Requires<[HasFMA4]>;
Bruno Cardoso Lopes0f9a1f52011-11-25 19:33:42 +0000783
Jan Sjödin7c0face2011-12-12 19:37:49 +0000784// XOP 2, 3 and 4 Operand Instruction Template
785class IXOP<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000786 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000787 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>,
Craig Topperd402df32014-02-02 07:08:01 +0000788 XOP9, Requires<[HasXOP]>;
Jan Sjödin7c0face2011-12-12 19:37:49 +0000789
790// XOP 2, 3 and 4 Operand Instruction Templates with imm byte
791class IXOPi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000792 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000793 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>,
Craig Topperd402df32014-02-02 07:08:01 +0000794 XOP8, Requires<[HasXOP]>;
Jan Sjödin7c0face2011-12-12 19:37:49 +0000795
796// XOP 5 operand instruction (VEX encoding!)
797class IXOP5<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000798 list<dag>pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000799 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
800 VEX_4V, VEX_I8IMM, Requires<[HasXOP]>;
Jan Sjödin7c0face2011-12-12 19:37:49 +0000801
Evan Cheng12c6be82007-07-31 08:04:03 +0000802// X86-64 Instruction templates...
803//
804
Andrew Trick8523b162012-02-01 23:20:51 +0000805class RI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000806 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000807 : I<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000808class RIi8 <bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000809 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000810 : Ii8<o, F, outs, ins, asm, pattern, itin>, REX_W;
David Woodhouse4e033b02014-01-13 14:05:59 +0000811class RIi16 <bits<8> o, Format F, dag outs, dag ins, string asm,
812 list<dag> pattern, InstrItinClass itin = NoItinerary>
813 : Ii16<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000814class RIi32 <bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000815 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000816 : Ii32<o, F, outs, ins, asm, pattern, itin>, REX_W;
David Woodhouse0b6c9492014-01-30 22:20:41 +0000817class RIi32S <bits<8> o, Format F, dag outs, dag ins, string asm,
818 list<dag> pattern, InstrItinClass itin = NoItinerary>
819 : Ii32S<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000820
821class RIi64<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000822 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000823 : X86Inst<o, f, Imm64, outs, ins, asm, itin>, REX_W {
Evan Cheng12c6be82007-07-31 08:04:03 +0000824 let Pattern = pattern;
825 let CodeSize = 3;
826}
827
Kevin Enderby285da022013-07-22 21:25:31 +0000828class RIi64_NOREX<bits<8> o, Format f, dag outs, dag ins, string asm,
829 list<dag> pattern, InstrItinClass itin = NoItinerary>
830 : X86Inst<o, f, Imm64, outs, ins, asm, itin> {
831 let Pattern = pattern;
832 let CodeSize = 3;
833}
834
Evan Cheng12c6be82007-07-31 08:04:03 +0000835class RSSI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000836 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000837 : SSI<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000838class RSDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000839 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000840 : SDI<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000841class RPDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000842 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000843 : PDI<o, F, outs, ins, asm, pattern, itin>, REX_W;
Bruno Cardoso Lopes123dff02011-07-25 23:05:25 +0000844class VRPDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000845 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000846 : VPDI<o, F, outs, ins, asm, pattern, itin>, VEX_W;
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000847class RS2I<bits<8> o, Format F, dag outs, dag ins, string asm,
848 list<dag> pattern, InstrItinClass itin = NoItinerary>
849 : S2I<o, F, outs, ins, asm, pattern, itin>, REX_W;
850class VRS2I<bits<8> o, Format F, dag outs, dag ins, string asm,
851 list<dag> pattern, InstrItinClass itin = NoItinerary>
852 : VS2I<o, F, outs, ins, asm, pattern, itin>, VEX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000853
854// MMX Instruction templates
855//
856
857// MMXI - MMX instructions with TB prefix.
Craig Topperbc749db2013-10-09 02:18:34 +0000858// MMXI32 - MMX instructions with TB prefix valid only in 32 bit mode.
Anton Korobeynikov31099512008-08-23 15:53:19 +0000859// MMXI64 - MMX instructions with TB prefix valid only in 64 bit mode.
Craig Topperae11aed2014-01-14 07:41:20 +0000860// MMX2I - MMX / SSE2 instructions with PD prefix.
Craig Topper5ccb6172014-02-18 00:21:49 +0000861// MMXIi8 - MMX instructions with ImmT == Imm8 and PS prefix.
862// MMXIi8 - MMX instructions with ImmT == Imm8 and PS prefix.
Evan Cheng12c6be82007-07-31 08:04:03 +0000863// MMXID - MMX instructions with XD prefix.
864// MMXIS - MMX instructions with XS prefix.
Sean Callanan04d8cb72009-12-18 00:01:26 +0000865class MMXI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000866 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topper5ccb6172014-02-18 00:21:49 +0000867 : I<o, F, outs, ins, asm, pattern, itin>, PS, Requires<[HasMMX]>;
Craig Topperbc749db2013-10-09 02:18:34 +0000868class MMXI32<bits<8> o, Format F, dag outs, dag ins, string asm,
869 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topper5ccb6172014-02-18 00:21:49 +0000870 : I<o, F, outs, ins, asm, pattern, itin>, PS, Requires<[HasMMX,Not64BitMode]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000871class MMXI64<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000872 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topper5ccb6172014-02-18 00:21:49 +0000873 : I<o, F, outs, ins, asm, pattern, itin>, PS, Requires<[HasMMX,In64BitMode]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000874class MMXRI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000875 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topper5ccb6172014-02-18 00:21:49 +0000876 : I<o, F, outs, ins, asm, pattern, itin>, PS, REX_W, Requires<[HasMMX]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000877class MMX2I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000878 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000879 : I<o, F, outs, ins, asm, pattern, itin>, PD, Requires<[HasMMX]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000880class MMXIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000881 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topper5ccb6172014-02-18 00:21:49 +0000882 : Ii8<o, F, outs, ins, asm, pattern, itin>, PS, Requires<[HasMMX]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000883class MMXID<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000884 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000885 : Ii8<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[HasMMX]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000886class MMXIS<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000887 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000888 : Ii8<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[HasMMX]>;