blob: adc24e23182c7eecd41430b314dcf0e4ceb64adc [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>;
Evan Cheng12c6be82007-07-31 08:04:03 +000027def MRM0r : Format<16>; def MRM1r : Format<17>; def MRM2r : Format<18>;
28def MRM3r : Format<19>; def MRM4r : Format<20>; def MRM5r : Format<21>;
29def MRM6r : Format<22>; def MRM7r : Format<23>;
30def MRM0m : Format<24>; def MRM1m : Format<25>; def MRM2m : Format<26>;
31def MRM3m : Format<27>; def MRM4m : Format<28>; def MRM5m : Format<29>;
32def MRM6m : Format<30>; def MRM7m : Format<31>;
Chris Lattnerf7477e52010-02-12 02:06:33 +000033def MRM_C1 : Format<33>;
Chris Lattner140caa72010-02-13 00:41:14 +000034def MRM_C2 : Format<34>;
35def MRM_C3 : Format<35>;
36def MRM_C4 : Format<36>;
37def MRM_C8 : Format<37>;
38def MRM_C9 : Format<38>;
Michael Liao95d944032013-04-11 04:52:28 +000039def MRM_CA : Format<39>;
40def MRM_CB : Format<40>;
41def MRM_E8 : Format<41>;
42def MRM_F0 : Format<42>;
Chris Lattnercea0a8d2010-09-17 18:02:29 +000043def RawFrmImm8 : Format<43>;
44def RawFrmImm16 : Format<44>;
Michael Liao95d944032013-04-11 04:52:28 +000045def MRM_F8 : Format<45>;
46def MRM_F9 : Format<46>;
47def MRM_D0 : Format<47>;
48def MRM_D1 : Format<48>;
49def MRM_D4 : Format<49>;
50def MRM_D5 : Format<50>;
51def MRM_D6 : Format<51>;
52def MRM_D8 : Format<52>;
53def MRM_D9 : Format<53>;
54def MRM_DA : Format<54>;
55def MRM_DB : Format<55>;
56def MRM_DC : Format<56>;
57def MRM_DD : Format<57>;
58def MRM_DE : Format<58>;
59def MRM_DF : Format<59>;
Evan Cheng12c6be82007-07-31 08:04:03 +000060
61// ImmType - This specifies the immediate type used by an instruction. This is
62// part of the ad-hoc solution used to emit machine instruction encodings by our
63// machine code emitter.
64class ImmType<bits<3> val> {
65 bits<3> Value = val;
66}
Chris Lattner12455ca2010-02-12 22:27:07 +000067def NoImm : ImmType<0>;
68def Imm8 : ImmType<1>;
69def Imm8PCRel : ImmType<2>;
70def Imm16 : ImmType<3>;
Chris Lattnerac588122010-07-07 22:27:31 +000071def Imm16PCRel : ImmType<4>;
72def Imm32 : ImmType<5>;
73def Imm32PCRel : ImmType<6>;
74def Imm64 : ImmType<7>;
Evan Cheng12c6be82007-07-31 08:04:03 +000075
76// FPFormat - This specifies what form this FP instruction has. This is used by
77// the Floating-Point stackifier pass.
78class FPFormat<bits<3> val> {
79 bits<3> Value = val;
80}
81def NotFP : FPFormat<0>;
82def ZeroArgFP : FPFormat<1>;
83def OneArgFP : FPFormat<2>;
84def OneArgFPRW : FPFormat<3>;
85def TwoArgFP : FPFormat<4>;
86def CompareFP : FPFormat<5>;
87def CondMovFP : FPFormat<6>;
88def SpecialFP : FPFormat<7>;
89
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +000090// Class specifying the SSE execution domain, used by the SSEDomainFix pass.
Jakob Stoklund Olesendbff4e82010-03-30 22:46:53 +000091// Keep in sync with tables in X86InstrInfo.cpp.
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +000092class Domain<bits<2> val> {
93 bits<2> Value = val;
94}
95def GenericDomain : Domain<0>;
Jakob Stoklund Olesendbff4e82010-03-30 22:46:53 +000096def SSEPackedSingle : Domain<1>;
97def SSEPackedDouble : Domain<2>;
98def SSEPackedInt : Domain<3>;
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +000099
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000100// Class specifying the vector form of the decompressed
101// displacement of 8-bit.
102class CD8VForm<bits<3> val> {
103 bits<3> Value = val;
104}
105def CD8VF : CD8VForm<0>; // v := VL
106def CD8VH : CD8VForm<1>; // v := VL/2
107def CD8VQ : CD8VForm<2>; // v := VL/4
108def CD8VO : CD8VForm<3>; // v := VL/8
109def CD8VT1 : CD8VForm<4>; // v := 1
110def CD8VT2 : CD8VForm<5>; // v := 2
111def CD8VT4 : CD8VForm<6>; // v := 4
112def CD8VT8 : CD8VForm<7>; // v := 8
113
Evan Cheng12c6be82007-07-31 08:04:03 +0000114// Prefix byte classes which are used to indicate to the ad-hoc machine code
115// emitter that various prefix bytes are required.
116class OpSize { bit hasOpSizePrefix = 1; }
Craig Topper7ceb54a2014-01-06 06:02:58 +0000117class OpSize16 { bit hasOpSize16Prefix = 1; }
Evan Cheng12c6be82007-07-31 08:04:03 +0000118class AdSize { bit hasAdSizePrefix = 1; }
119class REX_W { bit hasREX_WPrefix = 1; }
Andrew Lenharth0070dd12008-03-01 13:37:02 +0000120class LOCK { bit hasLockPrefix = 1; }
Joerg Sonnenbergercc53d992011-04-04 15:58:30 +0000121class TB { bits<5> Prefix = 1; }
122class REP { bits<5> Prefix = 2; }
123class D8 { bits<5> Prefix = 3; }
124class D9 { bits<5> Prefix = 4; }
125class DA { bits<5> Prefix = 5; }
126class DB { bits<5> Prefix = 6; }
127class DC { bits<5> Prefix = 7; }
128class DD { bits<5> Prefix = 8; }
129class DE { bits<5> Prefix = 9; }
130class DF { bits<5> Prefix = 10; }
131class XD { bits<5> Prefix = 11; }
132class XS { bits<5> Prefix = 12; }
133class T8 { bits<5> Prefix = 13; }
134class TA { bits<5> Prefix = 14; }
Joerg Sonnenbergerfc4789d2011-04-04 16:58:13 +0000135class A6 { bits<5> Prefix = 15; }
136class A7 { bits<5> Prefix = 16; }
Craig Topper96fa5972011-10-16 16:50:08 +0000137class T8XD { bits<5> Prefix = 17; }
138class T8XS { bits<5> Prefix = 18; }
Craig Topper980d5982011-10-23 07:34:00 +0000139class TAXD { bits<5> Prefix = 19; }
Jan Sjödin6dd24882011-12-12 19:12:26 +0000140class XOP8 { bits<5> Prefix = 20; }
141class XOP9 { bits<5> Prefix = 21; }
Yunzhong Gaob8bbcbf2013-09-27 18:38:42 +0000142class XOPA { bits<5> Prefix = 22; }
Craig Topperae11aed2014-01-14 07:41:20 +0000143class PD { bits<5> Prefix = 23; }
144class T8PD { bits<5> Prefix = 24; }
145class TAPD { bits<5> Prefix = 25; }
Bruno Cardoso Lopes1a890f92010-06-22 22:38:56 +0000146class VEX { bit hasVEXPrefix = 1; }
Bruno Cardoso Lopes05166742010-07-01 01:20:06 +0000147class VEX_W { bit hasVEX_WPrefix = 1; }
Bruno Cardoso Lopes1a890f92010-06-22 22:38:56 +0000148class VEX_4V : VEX { bit hasVEX_4VPrefix = 1; }
Craig Topperaea148c2011-10-16 07:55:05 +0000149class VEX_4VOp3 : VEX { bit hasVEX_4VOp3Prefix = 1; }
Bruno Cardoso Lopese2bd0582010-07-06 22:36:24 +0000150class VEX_I8IMM { bit hasVEX_i8ImmReg = 1; }
Bruno Cardoso Lopesfd8bfcd2010-07-13 21:07:28 +0000151class VEX_L { bit hasVEX_L = 1; }
Craig Topperf18c8962011-10-04 06:30:42 +0000152class VEX_LIG { bit ignoresVEX_L = 1; }
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000153class EVEX : VEX { bit hasEVEXPrefix = 1; }
154class EVEX_4V : VEX_4V { bit hasEVEXPrefix = 1; }
155class EVEX_K { bit hasEVEX_K = 1; }
156class EVEX_KZ : EVEX_K { bit hasEVEX_Z = 1; }
157class EVEX_B { bit hasEVEX_B = 1; }
Elena Demikhovskyb19c9dc2014-01-13 12:55:03 +0000158class EVEX_RC { bit hasEVEX_RC = 1; }
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000159class EVEX_V512 { bit hasEVEX_L2 = 1; bit hasVEX_L = 0; }
160class EVEX_CD8<int esize, CD8VForm form> {
161 bits<2> EVEX_CD8E = !if(!eq(esize, 8), 0b00,
162 !if(!eq(esize, 16), 0b01,
163 !if(!eq(esize, 32), 0b10,
164 !if(!eq(esize, 64), 0b11, ?))));
165 bits<3> EVEX_CD8V = form.Value;
166}
Chris Lattner45270db2010-10-03 18:08:05 +0000167class Has3DNow0F0FOpcode { bit has3DNow0F0FOpcode = 1; }
Craig Toppercd93de92011-12-30 04:48:54 +0000168class MemOp4 { bit hasMemOp4Prefix = 1; }
Jan Sjödin6dd24882011-12-12 19:12:26 +0000169class XOP { bit hasXOP_Prefix = 1; }
Evan Cheng12c6be82007-07-31 08:04:03 +0000170class X86Inst<bits<8> opcod, Format f, ImmType i, dag outs, dag ins,
Andrew Trick8523b162012-02-01 23:20:51 +0000171 string AsmStr,
172 InstrItinClass itin,
173 Domain d = GenericDomain>
Evan Cheng12c6be82007-07-31 08:04:03 +0000174 : Instruction {
175 let Namespace = "X86";
176
177 bits<8> Opcode = opcod;
178 Format Form = f;
179 bits<6> FormBits = Form.Value;
180 ImmType ImmT = i;
Evan Cheng12c6be82007-07-31 08:04:03 +0000181
182 dag OutOperandList = outs;
183 dag InOperandList = ins;
184 string AsmString = AsmStr;
185
Chris Lattner7ff33462010-10-31 19:22:57 +0000186 // If this is a pseudo instruction, mark it isCodeGenOnly.
187 let isCodeGenOnly = !eq(!cast<string>(f), "Pseudo");
188
Andrew Trick8523b162012-02-01 23:20:51 +0000189 let Itinerary = itin;
190
Evan Cheng12c6be82007-07-31 08:04:03 +0000191 //
192 // Attributes specific to X86 instructions...
193 //
Craig Topper3484fc22014-01-05 04:17:28 +0000194 bit ForceDisassemble = 0; // Force instruction to disassemble even though it's
195 // isCodeGenonly. Needed to hide an ambiguous
196 // AsmString from the parser, but still disassemble.
197
Evan Cheng12c6be82007-07-31 08:04:03 +0000198 bit hasOpSizePrefix = 0; // Does this inst have a 0x66 prefix?
Craig Topper7ceb54a2014-01-06 06:02:58 +0000199 bit hasOpSize16Prefix = 0;// Does this inst have a 0x66 prefix in 16-bit mode?
Evan Cheng12c6be82007-07-31 08:04:03 +0000200 bit hasAdSizePrefix = 0; // Does this inst have a 0x67 prefix?
201
Joerg Sonnenbergercc53d992011-04-04 15:58:30 +0000202 bits<5> Prefix = 0; // Which prefix byte does this inst have?
Eric Christopher3a8ae232010-11-30 09:11:54 +0000203 bit hasREX_WPrefix = 0; // Does this inst require the REX.W prefix?
Jakob Stoklund Olesenf8d7eda2010-03-25 18:52:01 +0000204 FPFormat FPForm = NotFP; // What flavor of FP instruction is this?
Dan Gohmana21bdda2008-08-20 13:46:21 +0000205 bit hasLockPrefix = 0; // Does this inst have a 0xF0 prefix?
Jakob Stoklund Olesenf8d7eda2010-03-25 18:52:01 +0000206 Domain ExeDomain = d;
Eric Christopher3a8ae232010-11-30 09:11:54 +0000207 bit hasVEXPrefix = 0; // Does this inst require a VEX prefix?
Bruno Cardoso Lopes05166742010-07-01 01:20:06 +0000208 bit hasVEX_WPrefix = 0; // Does this inst set the VEX_W field?
Eric Christopher3a8ae232010-11-30 09:11:54 +0000209 bit hasVEX_4VPrefix = 0; // Does this inst require the VEX.VVVV field?
Craig Topperaea148c2011-10-16 07:55:05 +0000210 bit hasVEX_4VOp3Prefix = 0; // Does this inst require the VEX.VVVV field to
211 // encode the third operand?
Eric Christopher3a8ae232010-11-30 09:11:54 +0000212 bit hasVEX_i8ImmReg = 0; // Does this inst require the last source register
Bruno Cardoso Lopese2bd0582010-07-06 22:36:24 +0000213 // to be encoded in a immediate field?
Eric Christopher3a8ae232010-11-30 09:11:54 +0000214 bit hasVEX_L = 0; // Does this inst use large (256-bit) registers?
Craig Topperf18c8962011-10-04 06:30:42 +0000215 bit ignoresVEX_L = 0; // Does this instruction ignore the L-bit
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000216 bit hasEVEXPrefix = 0; // Does this inst require EVEX form?
217 bit hasEVEX_K = 0; // Does this inst require masking?
218 bit hasEVEX_Z = 0; // Does this inst set the EVEX_Z field?
219 bit hasEVEX_L2 = 0; // Does this inst set the EVEX_L2 field?
220 bit hasEVEX_B = 0; // Does this inst set the EVEX_B field?
221 bits<2> EVEX_CD8E = 0; // Compressed disp8 form - element-size.
222 bits<3> EVEX_CD8V = 0; // Compressed disp8 form - vector-width.
Chris Lattner45270db2010-10-03 18:08:05 +0000223 bit has3DNow0F0FOpcode =0;// Wacky 3dNow! encoding?
Craig Toppercd93de92011-12-30 04:48:54 +0000224 bit hasMemOp4Prefix = 0; // Same bit as VEX_W, but used for swapping operands
Jan Sjödin6dd24882011-12-12 19:12:26 +0000225 bit hasXOP_Prefix = 0; // Does this inst require an XOP prefix?
Elena Demikhovskyb19c9dc2014-01-13 12:55:03 +0000226 bit hasEVEX_RC = 0; // Explicitly specified rounding control in FP instruction.
Jakob Stoklund Olesenb93331f2010-04-05 03:10:20 +0000227
228 // TSFlags layout should be kept in sync with X86InstrInfo.h.
229 let TSFlags{5-0} = FormBits;
230 let TSFlags{6} = hasOpSizePrefix;
Craig Topper7ceb54a2014-01-06 06:02:58 +0000231 let TSFlags{7} = hasOpSize16Prefix;
232 let TSFlags{8} = hasAdSizePrefix;
233 let TSFlags{13-9} = Prefix;
234 let TSFlags{14} = hasREX_WPrefix;
235 let TSFlags{17-15} = ImmT.Value;
236 let TSFlags{20-18} = FPForm.Value;
237 let TSFlags{21} = hasLockPrefix;
Craig Topper7c6baa72014-01-06 06:51:58 +0000238 let TSFlags{23-22} = ExeDomain.Value;
239 let TSFlags{31-24} = Opcode;
240 let TSFlags{32} = hasVEXPrefix;
241 let TSFlags{33} = hasVEX_WPrefix;
242 let TSFlags{34} = hasVEX_4VPrefix;
243 let TSFlags{35} = hasVEX_4VOp3Prefix;
244 let TSFlags{36} = hasVEX_i8ImmReg;
245 let TSFlags{37} = hasVEX_L;
246 let TSFlags{38} = ignoresVEX_L;
247 let TSFlags{39} = hasEVEXPrefix;
248 let TSFlags{40} = hasEVEX_K;
249 let TSFlags{41} = hasEVEX_Z;
250 let TSFlags{42} = hasEVEX_L2;
251 let TSFlags{43} = hasEVEX_B;
252 let TSFlags{45-44} = EVEX_CD8E;
253 let TSFlags{48-46} = EVEX_CD8V;
254 let TSFlags{49} = has3DNow0F0FOpcode;
255 let TSFlags{50} = hasMemOp4Prefix;
256 let TSFlags{51} = hasXOP_Prefix;
Elena Demikhovskyb19c9dc2014-01-13 12:55:03 +0000257 let TSFlags{52} = hasEVEX_RC;
Evan Cheng12c6be82007-07-31 08:04:03 +0000258}
259
Eric Christopheref62f572010-11-30 08:57:23 +0000260class PseudoI<dag oops, dag iops, list<dag> pattern>
Andrew Trick8523b162012-02-01 23:20:51 +0000261 : X86Inst<0, Pseudo, NoImm, oops, iops, "", NoItinerary> {
Eric Christopheref62f572010-11-30 08:57:23 +0000262 let Pattern = pattern;
263}
264
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +0000265class I<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000266 list<dag> pattern, InstrItinClass itin = NoItinerary,
Andrew Trick8523b162012-02-01 23:20:51 +0000267 Domain d = GenericDomain>
268 : X86Inst<o, f, NoImm, outs, ins, asm, itin, d> {
Evan Cheng12c6be82007-07-31 08:04:03 +0000269 let Pattern = pattern;
270 let CodeSize = 3;
271}
Sean Callanan04d8cb72009-12-18 00:01:26 +0000272class Ii8 <bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000273 list<dag> pattern, InstrItinClass itin = NoItinerary,
Andrew Trick8523b162012-02-01 23:20:51 +0000274 Domain d = GenericDomain>
275 : X86Inst<o, f, Imm8, outs, ins, asm, itin, d> {
Evan Cheng12c6be82007-07-31 08:04:03 +0000276 let Pattern = pattern;
277 let CodeSize = 3;
278}
Chris Lattner12455ca2010-02-12 22:27:07 +0000279class Ii8PCRel<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000280 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000281 : X86Inst<o, f, Imm8PCRel, outs, ins, asm, itin> {
Chris Lattner12455ca2010-02-12 22:27:07 +0000282 let Pattern = pattern;
283 let CodeSize = 3;
284}
Sean Callanan04d8cb72009-12-18 00:01:26 +0000285class Ii16<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000286 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000287 : X86Inst<o, f, Imm16, outs, ins, asm, itin> {
Evan Cheng12c6be82007-07-31 08:04:03 +0000288 let Pattern = pattern;
289 let CodeSize = 3;
290}
Sean Callanan04d8cb72009-12-18 00:01:26 +0000291class Ii32<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000292 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000293 : X86Inst<o, f, Imm32, outs, ins, asm, itin> {
Evan Cheng12c6be82007-07-31 08:04:03 +0000294 let Pattern = pattern;
295 let CodeSize = 3;
296}
297
Chris Lattnerac588122010-07-07 22:27:31 +0000298class Ii16PCRel<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000299 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000300 : X86Inst<o, f, Imm16PCRel, outs, ins, asm, itin> {
Chris Lattnerac588122010-07-07 22:27:31 +0000301 let Pattern = pattern;
302 let CodeSize = 3;
303}
304
Chris Lattner12455ca2010-02-12 22:27:07 +0000305class Ii32PCRel<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000306 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000307 : X86Inst<o, f, Imm32PCRel, outs, ins, asm, itin> {
Chris Lattner12455ca2010-02-12 22:27:07 +0000308 let Pattern = pattern;
309 let CodeSize = 3;
310}
311
Evan Cheng12c6be82007-07-31 08:04:03 +0000312// FPStack Instruction Templates:
313// FPI - Floating Point Instruction template.
Preston Gurdfa3f6cb2012-05-02 16:03:35 +0000314class FPI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000315 InstrItinClass itin = NoItinerary>
Preston Gurdfa3f6cb2012-05-02 16:03:35 +0000316 : I<o, F, outs, ins, asm, [], itin> {}
Evan Cheng12c6be82007-07-31 08:04:03 +0000317
Bob Wilsona967c422010-08-26 18:08:11 +0000318// FpI_ - Floating Point Pseudo Instruction template. Not Predicated.
Andrew Trick8523b162012-02-01 23:20:51 +0000319class FpI_<dag outs, dag ins, FPFormat fp, list<dag> pattern,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000320 InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000321 : X86Inst<0, Pseudo, NoImm, outs, ins, "", itin> {
Jakob Stoklund Olesenf8d7eda2010-03-25 18:52:01 +0000322 let FPForm = fp;
Evan Cheng12c6be82007-07-31 08:04:03 +0000323 let Pattern = pattern;
324}
325
Sean Callanan050e0cd2009-09-15 00:35:17 +0000326// Templates for instructions that use a 16- or 32-bit segmented address as
327// their only operand: lcall (FAR CALL) and ljmp (FAR JMP)
328//
329// Iseg16 - 16-bit segment selector, 16-bit offset
330// Iseg32 - 16-bit segment selector, 32-bit offset
331
332class Iseg16 <bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000333 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000334 : X86Inst<o, f, Imm16, outs, ins, asm, itin> {
Sean Callanan050e0cd2009-09-15 00:35:17 +0000335 let Pattern = pattern;
336 let CodeSize = 3;
337}
338
339class Iseg32 <bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000340 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000341 : X86Inst<o, f, Imm32, outs, ins, asm, itin> {
Sean Callanan050e0cd2009-09-15 00:35:17 +0000342 let Pattern = pattern;
343 let CodeSize = 3;
344}
345
Michael Liaobbd10792012-08-30 16:54:46 +0000346def __xs : XS;
Elena Demikhovskyfad02922013-05-21 12:04:22 +0000347def __xd : XD;
Craig Topperae11aed2014-01-14 07:41:20 +0000348def __pd : PD;
Michael Liaobbd10792012-08-30 16:54:46 +0000349
Bruno Cardoso Lopes6b98f712010-06-17 23:05:30 +0000350// SI - SSE 1 & 2 scalar instructions
Andrew Trick8523b162012-02-01 23:20:51 +0000351class SI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000352 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000353 : I<o, F, outs, ins, asm, pattern, itin> {
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000354 let Predicates = !if(hasEVEXPrefix /* EVEX */, [HasAVX512],
355 !if(hasVEXPrefix /* VEX */, [UseAVX],
Elena Demikhovskyfad02922013-05-21 12:04:22 +0000356 !if(!eq(Prefix, __xs.Prefix), [UseSSE1],
357 !if(!eq(Prefix, __xd.Prefix), [UseSSE2],
Craig Topperae11aed2014-01-14 07:41:20 +0000358 !if(!eq(Prefix, __pd.Prefix), [UseSSE2], [UseSSE1])))));
Bruno Cardoso Lopes6b98f712010-06-17 23:05:30 +0000359
360 // AVX instructions have a 'v' prefix in the mnemonic
Bruno Cardoso Lopes1a890f92010-06-22 22:38:56 +0000361 let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm);
Bruno Cardoso Lopes6b98f712010-06-17 23:05:30 +0000362}
363
Bruno Cardoso Lopes191a1cd2010-06-24 00:32:06 +0000364// SIi8 - SSE 1 & 2 scalar instructions
365class SIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000366 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000367 : Ii8<o, F, outs, ins, asm, pattern, itin> {
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000368 let Predicates = !if(hasEVEXPrefix /* EVEX */, [HasAVX512],
369 !if(hasVEXPrefix /* VEX */, [UseAVX],
370 !if(!eq(Prefix, __xs.Prefix), [UseSSE1], [UseSSE2])));
Bruno Cardoso Lopes191a1cd2010-06-24 00:32:06 +0000371
372 // AVX instructions have a 'v' prefix in the mnemonic
373 let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm);
374}
375
Bruno Cardoso Lopes2bfad412010-06-18 23:13:35 +0000376// PI - SSE 1 & 2 packed instructions
377class PI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern,
Andrew Trick8523b162012-02-01 23:20:51 +0000378 InstrItinClass itin, Domain d>
379 : I<o, F, outs, ins, asm, pattern, itin, d> {
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000380 let Predicates = !if(hasEVEXPrefix /* EVEX */, [HasAVX512],
381 !if(hasVEXPrefix /* VEX */, [HasAVX],
Craig Topperae11aed2014-01-14 07:41:20 +0000382 !if(!eq(Prefix, __pd.Prefix), [UseSSE2], [UseSSE1])));
Bruno Cardoso Lopes2bfad412010-06-18 23:13:35 +0000383
384 // AVX instructions have a 'v' prefix in the mnemonic
Bruno Cardoso Lopes1a890f92010-06-22 22:38:56 +0000385 let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm);
Bruno Cardoso Lopes2bfad412010-06-18 23:13:35 +0000386}
387
Michael Liaobbd10792012-08-30 16:54:46 +0000388// MMXPI - SSE 1 & 2 packed instructions with MMX operands
389class MMXPI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern,
390 InstrItinClass itin, Domain d>
391 : I<o, F, outs, ins, asm, pattern, itin, d> {
Craig Topperae11aed2014-01-14 07:41:20 +0000392 let Predicates = !if(!eq(Prefix, __pd.Prefix), [HasSSE2], [HasSSE1]);
Michael Liaobbd10792012-08-30 16:54:46 +0000393}
394
Bruno Cardoso Lopes1e13c172010-06-22 23:37:59 +0000395// PIi8 - SSE 1 & 2 packed instructions with immediate
396class PIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Andrew Trick8523b162012-02-01 23:20:51 +0000397 list<dag> pattern, InstrItinClass itin, Domain d>
398 : Ii8<o, F, outs, ins, asm, pattern, itin, d> {
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000399 let Predicates = !if(hasEVEXPrefix /* EVEX */, [HasAVX512],
400 !if(hasVEXPrefix /* VEX */, [HasAVX],
Craig Topperae11aed2014-01-14 07:41:20 +0000401 !if(!eq(Prefix, __pd.Prefix), [UseSSE2], [UseSSE1])));
Bruno Cardoso Lopes1e13c172010-06-22 23:37:59 +0000402
403 // AVX instructions have a 'v' prefix in the mnemonic
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000404 let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm);
Bruno Cardoso Lopes1e13c172010-06-22 23:37:59 +0000405}
406
Evan Cheng12c6be82007-07-31 08:04:03 +0000407// SSE1 Instruction Templates:
408//
409// SSI - SSE1 instructions with XS prefix.
410// PSI - SSE1 instructions with TB prefix.
411// PSIi8 - SSE1 instructions with ImmT == Imm8 and TB prefix.
Bruno Cardoso Lopesc2f87b72010-06-08 22:51:23 +0000412// VSSI - SSE1 instructions with XS prefix in AVX form.
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000413// VPSI - SSE1 instructions with TB prefix in AVX form, packed single.
Evan Cheng12c6be82007-07-31 08:04:03 +0000414
Andrew Trick8523b162012-02-01 23:20:51 +0000415class SSI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000416 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000417 : I<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[UseSSE1]>;
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +0000418class SSIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000419 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000420 : Ii8<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[UseSSE1]>;
Andrew Trick8523b162012-02-01 23:20:51 +0000421class PSI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000422 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000423 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, TB,
Michael Liaobbd10792012-08-30 16:54:46 +0000424 Requires<[UseSSE1]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000425class PSIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000426 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000427 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, TB,
Michael Liaobbd10792012-08-30 16:54:46 +0000428 Requires<[UseSSE1]>;
Bruno Cardoso Lopesc2f87b72010-06-08 22:51:23 +0000429class VSSI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000430 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000431 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, XS,
Bruno Cardoso Lopes77a3c442010-07-13 00:38:47 +0000432 Requires<[HasAVX]>;
Bruno Cardoso Lopesb06f54b2010-06-12 01:23:26 +0000433class VPSI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000434 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000435 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin, SSEPackedSingle>, TB,
Bruno Cardoso Lopes77a3c442010-07-13 00:38:47 +0000436 Requires<[HasAVX]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000437
438// SSE2 Instruction Templates:
439//
Bill Wendling76105a42008-08-27 21:32:04 +0000440// SDI - SSE2 instructions with XD prefix.
441// SDIi8 - SSE2 instructions with ImmT == Imm8 and XD prefix.
Craig Topperf881d382012-07-30 02:14:02 +0000442// S2SI - SSE2 instructions with XS prefix.
Bill Wendling76105a42008-08-27 21:32:04 +0000443// SSDIi8 - SSE2 instructions with ImmT == Imm8 and XS prefix.
Craig Topperae11aed2014-01-14 07:41:20 +0000444// PDI - SSE2 instructions with PD prefix, packed double domain.
445// PDIi8 - SSE2 instructions with ImmT == Imm8 and PD prefix.
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000446// VSDI - SSE2 scalar instructions with XD prefix in AVX form.
Craig Topperae11aed2014-01-14 07:41:20 +0000447// VPDI - SSE2 vector instructions with PD prefix in AVX form,
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000448// packed double domain.
Craig Topperae11aed2014-01-14 07:41:20 +0000449// VS2I - SSE2 scalar instructions with PD prefix in AVX form.
450// S2I - SSE2 scalar instructions with PD prefix.
Michael Liaobbd10792012-08-30 16:54:46 +0000451// MMXSDIi8 - SSE2 instructions with ImmT == Imm8 and XD prefix as well as
452// MMX operands.
453// MMXSSDIi8 - SSE2 instructions with ImmT == Imm8 and XS prefix as well as
454// MMX operands.
Evan Cheng12c6be82007-07-31 08:04:03 +0000455
Andrew Trick8523b162012-02-01 23:20:51 +0000456class SDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000457 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000458 : I<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[UseSSE2]>;
Evan Cheng01c7c192007-12-20 19:57:09 +0000459class SDIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000460 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000461 : Ii8<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[UseSSE2]>;
Craig Topperf881d382012-07-30 02:14:02 +0000462class S2SI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000463 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000464 : I<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[UseSSE2]>;
Craig Topperf881d382012-07-30 02:14:02 +0000465class S2SIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000466 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000467 : Ii8<o, F, outs, ins, asm, pattern>, XS, Requires<[UseSSE2]>;
Andrew Trick8523b162012-02-01 23:20:51 +0000468class PDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000469 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000470 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, PD,
Michael Liaobbd10792012-08-30 16:54:46 +0000471 Requires<[UseSSE2]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000472class PDIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000473 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000474 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, PD,
Michael Liaobbd10792012-08-30 16:54:46 +0000475 Requires<[UseSSE2]>;
Bruno Cardoso Lopesc2f87b72010-06-08 22:51:23 +0000476class VSDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000477 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000478 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, XD,
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000479 Requires<[UseAVX]>;
Craig Topperf881d382012-07-30 02:14:02 +0000480class VS2SI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000481 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperf881d382012-07-30 02:14:02 +0000482 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, XS,
483 Requires<[HasAVX]>;
Bruno Cardoso Lopesb06f54b2010-06-12 01:23:26 +0000484class VPDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000485 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000486 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin, SSEPackedDouble>,
487 PD, Requires<[HasAVX]>;
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000488class VS2I<bits<8> o, Format F, dag outs, dag ins, string asm,
489 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000490 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, PD,
491 Requires<[UseAVX]>;
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000492class S2I<bits<8> o, Format F, dag outs, dag ins, string asm,
493 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000494 : I<o, F, outs, ins, asm, pattern, itin>, PD, Requires<[UseSSE2]>;
Michael Liaobbd10792012-08-30 16:54:46 +0000495class MMXSDIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000496 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000497 : Ii8<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[HasSSE2]>;
498class MMXS2SIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000499 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000500 : Ii8<o, F, outs, ins, asm, pattern>, XS, Requires<[HasSSE2]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000501
502// SSE3 Instruction Templates:
503//
Craig Topperae11aed2014-01-14 07:41:20 +0000504// S3I - SSE3 instructions with PD prefixes.
Evan Cheng12c6be82007-07-31 08:04:03 +0000505// S3SI - SSE3 instructions with XS prefix.
506// S3DI - SSE3 instructions with XD prefix.
507
Sean Callanan04d8cb72009-12-18 00:01:26 +0000508class S3SI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000509 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000510 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, XS,
Michael Liaobbd10792012-08-30 16:54:46 +0000511 Requires<[UseSSE3]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000512class S3DI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000513 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000514 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, XD,
Michael Liaobbd10792012-08-30 16:54:46 +0000515 Requires<[UseSSE3]>;
Andrew Trick8523b162012-02-01 23:20:51 +0000516class S3I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000517 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000518 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, PD,
Michael Liaobbd10792012-08-30 16:54:46 +0000519 Requires<[UseSSE3]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000520
521
Nate Begeman8ef50212008-02-12 22:51:28 +0000522// SSSE3 Instruction Templates:
523//
524// SS38I - SSSE3 instructions with T8 prefix.
525// SS3AI - SSSE3 instructions with TA prefix.
Michael Liaobbd10792012-08-30 16:54:46 +0000526// MMXSS38I - SSSE3 instructions with T8 prefix and MMX operands.
527// MMXSS3AI - SSSE3 instructions with TA prefix and MMX operands.
Nate Begeman8ef50212008-02-12 22:51:28 +0000528//
529// Note: SSSE3 instructions have 64-bit and 128-bit versions. The 64-bit version
Craig Topper744f6312012-01-09 00:11:29 +0000530// uses the MMX registers. The 64-bit versions are grouped with the MMX
531// classes. They need to be enabled even if AVX is enabled.
Nate Begeman8ef50212008-02-12 22:51:28 +0000532
533class SS38I<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>
Craig Topperae11aed2014-01-14 07:41:20 +0000535 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8PD,
Michael Liaobbd10792012-08-30 16:54:46 +0000536 Requires<[UseSSSE3]>;
Nate Begeman8ef50212008-02-12 22:51:28 +0000537class SS3AI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000538 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000539 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Michael Liaobbd10792012-08-30 16:54:46 +0000540 Requires<[UseSSSE3]>;
541class MMXSS38I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000542 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000543 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8,
544 Requires<[HasSSSE3]>;
545class MMXSS3AI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000546 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000547 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +0000548 Requires<[HasSSSE3]>;
Nate Begeman8ef50212008-02-12 22:51:28 +0000549
550// SSE4.1 Instruction Templates:
551//
552// SS48I - SSE 4.1 instructions with T8 prefix.
Evan Cheng96bdbd62008-03-14 07:39:27 +0000553// SS41AIi8 - SSE 4.1 instructions with TA prefix and ImmT == Imm8.
Nate Begeman8ef50212008-02-12 22:51:28 +0000554//
555class SS48I<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, asm, pattern, itin, SSEPackedInt>, T8PD,
Michael Liaobbd10792012-08-30 16:54:46 +0000558 Requires<[UseSSE41]>;
Evan Cheng96bdbd62008-03-14 07:39:27 +0000559class SS4AIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000560 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000561 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Michael Liaobbd10792012-08-30 16:54:46 +0000562 Requires<[UseSSE41]>;
Nate Begeman8ef50212008-02-12 22:51:28 +0000563
Nate Begeman55b7bec2008-07-17 16:51:19 +0000564// SSE4.2 Instruction Templates:
565//
566// SS428I - SSE 4.2 instructions with T8 prefix.
567class SS428I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000568 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000569 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8PD,
Michael Liaobbd10792012-08-30 16:54:46 +0000570 Requires<[UseSSE42]>;
Nate Begeman8ef50212008-02-12 22:51:28 +0000571
Craig Topper96fa5972011-10-16 16:50:08 +0000572// SS42FI - SSE 4.2 instructions with T8XD prefix.
Michael Liaobbd10792012-08-30 16:54:46 +0000573// NOTE: 'HasSSE42' is used as SS42FI is only used for CRC32 insns.
Eric Christopher7dfa9f22009-08-08 21:55:08 +0000574class SS42FI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000575 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000576 : I<o, F, outs, ins, asm, pattern, itin>, T8XD, Requires<[HasSSE42]>;
Craig Topperb9109842012-01-01 19:51:58 +0000577
Eric Christopher9fe912d2009-08-18 22:50:32 +0000578// SS42AI = SSE 4.2 instructions with TA prefix
579class SS42AI<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>
Craig Topperae11aed2014-01-14 07:41:20 +0000581 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Michael Liaobbd10792012-08-30 16:54:46 +0000582 Requires<[UseSSE42]>;
Eric Christopher9fe912d2009-08-18 22:50:32 +0000583
Bruno Cardoso Lopes14c5fd42010-07-20 00:11:13 +0000584// AVX Instruction Templates:
585// Instructions introduced in AVX (no SSE equivalent forms)
586//
Craig Topperae11aed2014-01-14 07:41:20 +0000587// AVX8I - AVX instructions with T8PD prefix.
588// AVXAIi8 - AVX instructions with TAPD prefix and ImmT = Imm8.
Bruno Cardoso Lopes14c5fd42010-07-20 00:11:13 +0000589class AVX8I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000590 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000591 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8PD,
Bruno Cardoso Lopes14c5fd42010-07-20 00:11:13 +0000592 Requires<[HasAVX]>;
Bruno Cardoso Lopes3b505842010-07-20 19:44:51 +0000593class AVXAIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000594 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000595 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Bruno Cardoso Lopes3b505842010-07-20 19:44:51 +0000596 Requires<[HasAVX]>;
Bruno Cardoso Lopes14c5fd42010-07-20 00:11:13 +0000597
Craig Topper05d1cb92011-11-06 06:12:20 +0000598// AVX2 Instruction Templates:
599// Instructions introduced in AVX2 (no SSE equivalent forms)
600//
Craig Topperae11aed2014-01-14 07:41:20 +0000601// AVX28I - AVX2 instructions with T8PD prefix.
602// AVX2AIi8 - AVX2 instructions with TAPD prefix and ImmT = Imm8.
Craig Topper05d1cb92011-11-06 06:12:20 +0000603class AVX28I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000604 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000605 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8PD,
Craig Topper05d1cb92011-11-06 06:12:20 +0000606 Requires<[HasAVX2]>;
Craig Topperf01f1b52011-11-06 23:04:08 +0000607class AVX2AIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000608 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000609 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Craig Topper05d1cb92011-11-06 06:12:20 +0000610 Requires<[HasAVX2]>;
611
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000612
613// AVX-512 Instruction Templates:
614// Instructions introduced in AVX-512 (no SSE equivalent forms)
615//
Craig Topperae11aed2014-01-14 07:41:20 +0000616// AVX5128I - AVX-512 instructions with T8PD prefix.
617// AVX512AIi8 - AVX-512 instructions with TAPD prefix and ImmT = Imm8.
618// AVX512PDI - AVX-512 instructions with PD, double packed.
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000619// AVX512PSI - AVX-512 instructions with TB, single packed.
620// AVX512XS8I - AVX-512 instructions with T8 and XS prefixes.
621// AVX512XSI - AVX-512 instructions with XS prefix, generic domain.
Craig Topperae11aed2014-01-14 07:41:20 +0000622// AVX512BI - AVX-512 instructions with PD, int packed domain.
623// AVX512SI - AVX-512 scalar instructions with PD prefix.
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000624
625class AVX5128I<bits<8> o, Format F, dag outs, dag ins, string asm,
626 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000627 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8PD,
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000628 Requires<[HasAVX512]>;
629class AVX512XS8I<bits<8> o, Format F, dag outs, dag ins, string asm,
630 list<dag> pattern, InstrItinClass itin = NoItinerary>
631 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8XS,
632 Requires<[HasAVX512]>;
633class AVX512XSI<bits<8> o, Format F, dag outs, dag ins, string asm,
634 list<dag> pattern, InstrItinClass itin = NoItinerary>
635 : I<o, F, outs, ins, asm, pattern, itin>, XS,
636 Requires<[HasAVX512]>;
637class AVX512XDI<bits<8> o, Format F, dag outs, dag ins, string asm,
638 list<dag> pattern, InstrItinClass itin = NoItinerary>
639 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, XD,
640 Requires<[HasAVX512]>;
641class AVX512BI<bits<8> o, Format F, dag outs, dag ins, string asm,
642 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000643 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, PD,
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000644 Requires<[HasAVX512]>;
645class AVX512BIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
646 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000647 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, PD,
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000648 Requires<[HasAVX512]>;
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000649class AVX512AIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
650 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000651 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000652 Requires<[HasAVX512]>;
653class AVX512Ii8<bits<8> o, Format F, dag outs, dag ins, string asm,
654 list<dag> pattern, InstrItinClass itin = NoItinerary>
Elena Demikhovskyb30371c2013-10-02 06:39:07 +0000655 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TB,
Craig Topperae11aed2014-01-14 07:41:20 +0000656 Requires<[HasAVX512]>;
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000657class AVX512PDI<bits<8> o, Format F, dag outs, dag ins, string asm,
658 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000659 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, PD,
660 Requires<[HasAVX512]>;
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000661class AVX512PSI<bits<8> o, Format F, dag outs, dag ins, string asm,
662 list<dag> pattern, InstrItinClass itin = NoItinerary>
663 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, TB,
664 Requires<[HasAVX512]>;
665class AVX512PIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
666 list<dag> pattern, Domain d, InstrItinClass itin = NoItinerary>
Elena Demikhovskyb30371c2013-10-02 06:39:07 +0000667 : Ii8<o, F, outs, ins, asm, pattern, itin, d>, TB, Requires<[HasAVX512]>;
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000668class AVX512PI<bits<8> o, Format F, dag outs, dag ins, string asm,
669 list<dag> pattern, Domain d, InstrItinClass itin = NoItinerary>
Elena Demikhovskyb30371c2013-10-02 06:39:07 +0000670 : I<o, F, outs, ins, asm, pattern, itin, d>, TB, Requires<[HasAVX512]>;
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000671class AVX512FMA3<bits<8> o, Format F, dag outs, dag ins, string asm,
672 list<dag>pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000673 : I<o, F, outs, ins, asm, pattern, itin>, T8PD,
674 EVEX_4V, Requires<[HasAVX512]>;
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000675
Eric Christopher2ef63182010-04-02 21:54:27 +0000676// AES Instruction Templates:
677//
678// AES8I
Eric Christopher1290fa02010-04-05 21:14:32 +0000679// These use the same encoding as the SSE4.2 T8 and TA encodings.
Eric Christopher2ef63182010-04-02 21:54:27 +0000680class AES8I<bits<8> o, Format F, dag outs, dag ins, string asm,
Preston Gurd3fe264d2013-09-13 19:23:28 +0000681 list<dag>pattern, InstrItinClass itin = IIC_AES>
Craig Topperae11aed2014-01-14 07:41:20 +0000682 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8PD,
Craig Topperc0cef322012-05-01 05:35:02 +0000683 Requires<[HasAES]>;
Eric Christopher2ef63182010-04-02 21:54:27 +0000684
685class AESAI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000686 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000687 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
Craig Topperc0cef322012-05-01 05:35:02 +0000688 Requires<[HasAES]>;
Eric Christopher2ef63182010-04-02 21:54:27 +0000689
Benjamin Kramera0396e42012-05-31 14:34:17 +0000690// PCLMUL Instruction Templates
691class PCLMULIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000692 list<dag>pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000693 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
694 Requires<[HasPCLMUL]>;
Eli Friedman415412e2011-07-05 18:21:20 +0000695
Benjamin Kramera0396e42012-05-31 14:34:17 +0000696class AVXPCLMULIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000697 list<dag>pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000698 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
699 VEX_4V, Requires<[HasAVX, HasPCLMUL]>;
Bruno Cardoso Lopesea0e05a2010-07-23 18:41:12 +0000700
Bruno Cardoso Lopesacd92302010-07-23 00:54:35 +0000701// FMA3 Instruction Templates
702class FMA3<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000703 list<dag>pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000704 : I<o, F, outs, ins, asm, pattern, itin>, T8PD,
705 VEX_4V, FMASC, Requires<[HasFMA]>;
Bruno Cardoso Lopesacd92302010-07-23 00:54:35 +0000706
Bruno Cardoso Lopes0f9a1f52011-11-25 19:33:42 +0000707// FMA4 Instruction Templates
708class FMA4<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000709 list<dag>pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000710 : Ii8<o, F, outs, ins, asm, pattern, itin>, TAPD,
711 VEX_4V, VEX_I8IMM, FMASC, Requires<[HasFMA4]>;
Bruno Cardoso Lopes0f9a1f52011-11-25 19:33:42 +0000712
Jan Sjödin7c0face2011-12-12 19:37:49 +0000713// XOP 2, 3 and 4 Operand Instruction Template
714class IXOP<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000715 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000716 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>,
Jan Sjödin7c0face2011-12-12 19:37:49 +0000717 XOP, XOP9, Requires<[HasXOP]>;
718
719// XOP 2, 3 and 4 Operand Instruction Templates with imm byte
720class IXOPi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000721 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000722 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>,
Jan Sjödin7c0face2011-12-12 19:37:49 +0000723 XOP, XOP8, Requires<[HasXOP]>;
724
725// XOP 5 operand instruction (VEX encoding!)
726class IXOP5<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000727 list<dag>pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000728 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TAPD,
729 VEX_4V, VEX_I8IMM, Requires<[HasXOP]>;
Jan Sjödin7c0face2011-12-12 19:37:49 +0000730
Evan Cheng12c6be82007-07-31 08:04:03 +0000731// X86-64 Instruction templates...
732//
733
Andrew Trick8523b162012-02-01 23:20:51 +0000734class RI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000735 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000736 : I<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000737class RIi8 <bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000738 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000739 : Ii8<o, F, outs, ins, asm, pattern, itin>, REX_W;
David Woodhouse4e033b02014-01-13 14:05:59 +0000740class RIi16 <bits<8> o, Format F, dag outs, dag ins, string asm,
741 list<dag> pattern, InstrItinClass itin = NoItinerary>
742 : Ii16<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000743class RIi32 <bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000744 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000745 : Ii32<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000746
747class RIi64<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000748 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000749 : X86Inst<o, f, Imm64, outs, ins, asm, itin>, REX_W {
Evan Cheng12c6be82007-07-31 08:04:03 +0000750 let Pattern = pattern;
751 let CodeSize = 3;
752}
753
Kevin Enderby285da022013-07-22 21:25:31 +0000754class RIi64_NOREX<bits<8> o, Format f, dag outs, dag ins, string asm,
755 list<dag> pattern, InstrItinClass itin = NoItinerary>
756 : X86Inst<o, f, Imm64, outs, ins, asm, itin> {
757 let Pattern = pattern;
758 let CodeSize = 3;
759}
760
Evan Cheng12c6be82007-07-31 08:04:03 +0000761class RSSI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000762 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000763 : SSI<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000764class RSDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000765 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000766 : SDI<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000767class RPDI<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>
Andrew Trick8523b162012-02-01 23:20:51 +0000769 : PDI<o, F, outs, ins, asm, pattern, itin>, REX_W;
Bruno Cardoso Lopes123dff02011-07-25 23:05:25 +0000770class VRPDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000771 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000772 : VPDI<o, F, outs, ins, asm, pattern, itin>, VEX_W;
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000773class RS2I<bits<8> o, Format F, dag outs, dag ins, string asm,
774 list<dag> pattern, InstrItinClass itin = NoItinerary>
775 : S2I<o, F, outs, ins, asm, pattern, itin>, REX_W;
776class VRS2I<bits<8> o, Format F, dag outs, dag ins, string asm,
777 list<dag> pattern, InstrItinClass itin = NoItinerary>
778 : VS2I<o, F, outs, ins, asm, pattern, itin>, VEX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000779
780// MMX Instruction templates
781//
782
783// MMXI - MMX instructions with TB prefix.
Craig Topperbc749db2013-10-09 02:18:34 +0000784// MMXI32 - MMX instructions with TB prefix valid only in 32 bit mode.
Anton Korobeynikov31099512008-08-23 15:53:19 +0000785// MMXI64 - MMX instructions with TB prefix valid only in 64 bit mode.
Craig Topperae11aed2014-01-14 07:41:20 +0000786// MMX2I - MMX / SSE2 instructions with PD prefix.
Evan Cheng12c6be82007-07-31 08:04:03 +0000787// MMXIi8 - MMX instructions with ImmT == Imm8 and TB prefix.
788// MMXIi8 - MMX instructions with ImmT == Imm8 and TB prefix.
789// MMXID - MMX instructions with XD prefix.
790// MMXIS - MMX instructions with XS prefix.
Sean Callanan04d8cb72009-12-18 00:01:26 +0000791class MMXI<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 : I<o, F, outs, ins, asm, pattern, itin>, TB, Requires<[HasMMX]>;
Craig Topperbc749db2013-10-09 02:18:34 +0000794class MMXI32<bits<8> o, Format F, dag outs, dag ins, string asm,
795 list<dag> pattern, InstrItinClass itin = NoItinerary>
Eric Christopherc0a5aae2013-12-20 02:04:49 +0000796 : I<o, F, outs, ins, asm, pattern, itin>, TB, Requires<[HasMMX,Not64BitMode]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000797class MMXI64<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>
Andrew Trick8523b162012-02-01 23:20:51 +0000799 : I<o, F, outs, ins, asm, pattern, itin>, TB, Requires<[HasMMX,In64BitMode]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000800class MMXRI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000801 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000802 : I<o, F, outs, ins, asm, pattern, itin>, TB, REX_W, Requires<[HasMMX]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000803class MMX2I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000804 list<dag> pattern, InstrItinClass itin = NoItinerary>
Craig Topperae11aed2014-01-14 07:41:20 +0000805 : I<o, F, outs, ins, asm, pattern, itin>, PD, Requires<[HasMMX]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000806class MMXIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000807 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000808 : Ii8<o, F, outs, ins, asm, pattern, itin>, TB, Requires<[HasMMX]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000809class MMXID<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000810 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000811 : Ii8<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[HasMMX]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000812class MMXIS<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000813 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000814 : Ii8<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[HasMMX]>;