blob: fb07ed0818b03c3fb8b5bd1f5658a1d7b4b4089a [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>;
24def MRMSrcMem : Format<6>;
25def MRM0r : Format<16>; def MRM1r : Format<17>; def MRM2r : Format<18>;
26def MRM3r : Format<19>; def MRM4r : Format<20>; def MRM5r : Format<21>;
27def MRM6r : Format<22>; def MRM7r : Format<23>;
28def MRM0m : Format<24>; def MRM1m : Format<25>; def MRM2m : Format<26>;
29def MRM3m : Format<27>; def MRM4m : Format<28>; def MRM5m : Format<29>;
30def MRM6m : Format<30>; def MRM7m : Format<31>;
31def MRMInitReg : Format<32>;
Chris Lattnerf7477e52010-02-12 02:06:33 +000032def MRM_C1 : Format<33>;
Chris Lattner140caa72010-02-13 00:41:14 +000033def MRM_C2 : Format<34>;
34def MRM_C3 : Format<35>;
35def MRM_C4 : Format<36>;
36def MRM_C8 : Format<37>;
37def MRM_C9 : Format<38>;
Michael Liao95d944032013-04-11 04:52:28 +000038def MRM_CA : Format<39>;
39def MRM_CB : Format<40>;
40def MRM_E8 : Format<41>;
41def MRM_F0 : Format<42>;
Chris Lattnercea0a8d2010-09-17 18:02:29 +000042def RawFrmImm8 : Format<43>;
43def RawFrmImm16 : Format<44>;
Michael Liao95d944032013-04-11 04:52:28 +000044def MRM_F8 : Format<45>;
45def MRM_F9 : Format<46>;
46def MRM_D0 : Format<47>;
47def MRM_D1 : Format<48>;
48def MRM_D4 : Format<49>;
49def MRM_D5 : Format<50>;
50def MRM_D6 : Format<51>;
51def MRM_D8 : Format<52>;
52def MRM_D9 : Format<53>;
53def MRM_DA : Format<54>;
54def MRM_DB : Format<55>;
55def MRM_DC : Format<56>;
56def MRM_DD : Format<57>;
57def MRM_DE : Format<58>;
58def MRM_DF : Format<59>;
Evan Cheng12c6be82007-07-31 08:04:03 +000059
60// ImmType - This specifies the immediate type used by an instruction. This is
61// part of the ad-hoc solution used to emit machine instruction encodings by our
62// machine code emitter.
63class ImmType<bits<3> val> {
64 bits<3> Value = val;
65}
Chris Lattner12455ca2010-02-12 22:27:07 +000066def NoImm : ImmType<0>;
67def Imm8 : ImmType<1>;
68def Imm8PCRel : ImmType<2>;
69def Imm16 : ImmType<3>;
Chris Lattnerac588122010-07-07 22:27:31 +000070def Imm16PCRel : ImmType<4>;
71def Imm32 : ImmType<5>;
72def Imm32PCRel : ImmType<6>;
73def Imm64 : ImmType<7>;
Evan Cheng12c6be82007-07-31 08:04:03 +000074
75// FPFormat - This specifies what form this FP instruction has. This is used by
76// the Floating-Point stackifier pass.
77class FPFormat<bits<3> val> {
78 bits<3> Value = val;
79}
80def NotFP : FPFormat<0>;
81def ZeroArgFP : FPFormat<1>;
82def OneArgFP : FPFormat<2>;
83def OneArgFPRW : FPFormat<3>;
84def TwoArgFP : FPFormat<4>;
85def CompareFP : FPFormat<5>;
86def CondMovFP : FPFormat<6>;
87def SpecialFP : FPFormat<7>;
88
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +000089// Class specifying the SSE execution domain, used by the SSEDomainFix pass.
Jakob Stoklund Olesendbff4e82010-03-30 22:46:53 +000090// Keep in sync with tables in X86InstrInfo.cpp.
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +000091class Domain<bits<2> val> {
92 bits<2> Value = val;
93}
94def GenericDomain : Domain<0>;
Jakob Stoklund Olesendbff4e82010-03-30 22:46:53 +000095def SSEPackedSingle : Domain<1>;
96def SSEPackedDouble : Domain<2>;
97def SSEPackedInt : Domain<3>;
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +000098
Elena Demikhovsky003e7d72013-07-28 08:28:38 +000099// Class specifying the vector form of the decompressed
100// displacement of 8-bit.
101class CD8VForm<bits<3> val> {
102 bits<3> Value = val;
103}
104def CD8VF : CD8VForm<0>; // v := VL
105def CD8VH : CD8VForm<1>; // v := VL/2
106def CD8VQ : CD8VForm<2>; // v := VL/4
107def CD8VO : CD8VForm<3>; // v := VL/8
108def CD8VT1 : CD8VForm<4>; // v := 1
109def CD8VT2 : CD8VForm<5>; // v := 2
110def CD8VT4 : CD8VForm<6>; // v := 4
111def CD8VT8 : CD8VForm<7>; // v := 8
112
Evan Cheng12c6be82007-07-31 08:04:03 +0000113// Prefix byte classes which are used to indicate to the ad-hoc machine code
114// emitter that various prefix bytes are required.
115class OpSize { bit hasOpSizePrefix = 1; }
116class AdSize { bit hasAdSizePrefix = 1; }
117class REX_W { bit hasREX_WPrefix = 1; }
Andrew Lenharth0070dd12008-03-01 13:37:02 +0000118class LOCK { bit hasLockPrefix = 1; }
Anton Korobeynikov25897772008-10-11 19:09:15 +0000119class SegFS { bits<2> SegOvrBits = 1; }
120class SegGS { bits<2> SegOvrBits = 2; }
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; }
Bruno Cardoso Lopes1a890f92010-06-22 22:38:56 +0000142class VEX { bit hasVEXPrefix = 1; }
Bruno Cardoso Lopes05166742010-07-01 01:20:06 +0000143class VEX_W { bit hasVEX_WPrefix = 1; }
Bruno Cardoso Lopes1a890f92010-06-22 22:38:56 +0000144class VEX_4V : VEX { bit hasVEX_4VPrefix = 1; }
Craig Topperaea148c2011-10-16 07:55:05 +0000145class VEX_4VOp3 : VEX { bit hasVEX_4VOp3Prefix = 1; }
Bruno Cardoso Lopese2bd0582010-07-06 22:36:24 +0000146class VEX_I8IMM { bit hasVEX_i8ImmReg = 1; }
Bruno Cardoso Lopesfd8bfcd2010-07-13 21:07:28 +0000147class VEX_L { bit hasVEX_L = 1; }
Craig Topperf18c8962011-10-04 06:30:42 +0000148class VEX_LIG { bit ignoresVEX_L = 1; }
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000149class EVEX : VEX { bit hasEVEXPrefix = 1; }
150class EVEX_4V : VEX_4V { bit hasEVEXPrefix = 1; }
151class EVEX_K { bit hasEVEX_K = 1; }
152class EVEX_KZ : EVEX_K { bit hasEVEX_Z = 1; }
153class EVEX_B { bit hasEVEX_B = 1; }
154class EVEX_V512 { bit hasEVEX_L2 = 1; bit hasVEX_L = 0; }
155class EVEX_CD8<int esize, CD8VForm form> {
156 bits<2> EVEX_CD8E = !if(!eq(esize, 8), 0b00,
157 !if(!eq(esize, 16), 0b01,
158 !if(!eq(esize, 32), 0b10,
159 !if(!eq(esize, 64), 0b11, ?))));
160 bits<3> EVEX_CD8V = form.Value;
161}
Chris Lattner45270db2010-10-03 18:08:05 +0000162class Has3DNow0F0FOpcode { bit has3DNow0F0FOpcode = 1; }
Craig Toppercd93de92011-12-30 04:48:54 +0000163class MemOp4 { bit hasMemOp4Prefix = 1; }
Jan Sjödin6dd24882011-12-12 19:12:26 +0000164class XOP { bit hasXOP_Prefix = 1; }
Evan Cheng12c6be82007-07-31 08:04:03 +0000165class X86Inst<bits<8> opcod, Format f, ImmType i, dag outs, dag ins,
Andrew Trick8523b162012-02-01 23:20:51 +0000166 string AsmStr,
167 InstrItinClass itin,
168 Domain d = GenericDomain>
Evan Cheng12c6be82007-07-31 08:04:03 +0000169 : Instruction {
170 let Namespace = "X86";
171
172 bits<8> Opcode = opcod;
173 Format Form = f;
174 bits<6> FormBits = Form.Value;
175 ImmType ImmT = i;
Evan Cheng12c6be82007-07-31 08:04:03 +0000176
177 dag OutOperandList = outs;
178 dag InOperandList = ins;
179 string AsmString = AsmStr;
180
Chris Lattner7ff33462010-10-31 19:22:57 +0000181 // If this is a pseudo instruction, mark it isCodeGenOnly.
182 let isCodeGenOnly = !eq(!cast<string>(f), "Pseudo");
183
Andrew Trick8523b162012-02-01 23:20:51 +0000184 let Itinerary = itin;
185
Evan Cheng12c6be82007-07-31 08:04:03 +0000186 //
187 // Attributes specific to X86 instructions...
188 //
189 bit hasOpSizePrefix = 0; // Does this inst have a 0x66 prefix?
190 bit hasAdSizePrefix = 0; // Does this inst have a 0x67 prefix?
191
Joerg Sonnenbergercc53d992011-04-04 15:58:30 +0000192 bits<5> Prefix = 0; // Which prefix byte does this inst have?
Eric Christopher3a8ae232010-11-30 09:11:54 +0000193 bit hasREX_WPrefix = 0; // Does this inst require the REX.W prefix?
Jakob Stoklund Olesenf8d7eda2010-03-25 18:52:01 +0000194 FPFormat FPForm = NotFP; // What flavor of FP instruction is this?
Dan Gohmana21bdda2008-08-20 13:46:21 +0000195 bit hasLockPrefix = 0; // Does this inst have a 0xF0 prefix?
Anton Korobeynikov25897772008-10-11 19:09:15 +0000196 bits<2> SegOvrBits = 0; // Segment override prefix.
Jakob Stoklund Olesenf8d7eda2010-03-25 18:52:01 +0000197 Domain ExeDomain = d;
Eric Christopher3a8ae232010-11-30 09:11:54 +0000198 bit hasVEXPrefix = 0; // Does this inst require a VEX prefix?
Bruno Cardoso Lopes05166742010-07-01 01:20:06 +0000199 bit hasVEX_WPrefix = 0; // Does this inst set the VEX_W field?
Eric Christopher3a8ae232010-11-30 09:11:54 +0000200 bit hasVEX_4VPrefix = 0; // Does this inst require the VEX.VVVV field?
Craig Topperaea148c2011-10-16 07:55:05 +0000201 bit hasVEX_4VOp3Prefix = 0; // Does this inst require the VEX.VVVV field to
202 // encode the third operand?
Eric Christopher3a8ae232010-11-30 09:11:54 +0000203 bit hasVEX_i8ImmReg = 0; // Does this inst require the last source register
Bruno Cardoso Lopese2bd0582010-07-06 22:36:24 +0000204 // to be encoded in a immediate field?
Eric Christopher3a8ae232010-11-30 09:11:54 +0000205 bit hasVEX_L = 0; // Does this inst use large (256-bit) registers?
Craig Topperf18c8962011-10-04 06:30:42 +0000206 bit ignoresVEX_L = 0; // Does this instruction ignore the L-bit
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000207 bit hasEVEXPrefix = 0; // Does this inst require EVEX form?
208 bit hasEVEX_K = 0; // Does this inst require masking?
209 bit hasEVEX_Z = 0; // Does this inst set the EVEX_Z field?
210 bit hasEVEX_L2 = 0; // Does this inst set the EVEX_L2 field?
211 bit hasEVEX_B = 0; // Does this inst set the EVEX_B field?
212 bits<2> EVEX_CD8E = 0; // Compressed disp8 form - element-size.
213 bits<3> EVEX_CD8V = 0; // Compressed disp8 form - vector-width.
Chris Lattner45270db2010-10-03 18:08:05 +0000214 bit has3DNow0F0FOpcode =0;// Wacky 3dNow! encoding?
Craig Toppercd93de92011-12-30 04:48:54 +0000215 bit hasMemOp4Prefix = 0; // Same bit as VEX_W, but used for swapping operands
Jan Sjödin6dd24882011-12-12 19:12:26 +0000216 bit hasXOP_Prefix = 0; // Does this inst require an XOP prefix?
Jakob Stoklund Olesenb93331f2010-04-05 03:10:20 +0000217
218 // TSFlags layout should be kept in sync with X86InstrInfo.h.
219 let TSFlags{5-0} = FormBits;
220 let TSFlags{6} = hasOpSizePrefix;
221 let TSFlags{7} = hasAdSizePrefix;
Joerg Sonnenbergercc53d992011-04-04 15:58:30 +0000222 let TSFlags{12-8} = Prefix;
223 let TSFlags{13} = hasREX_WPrefix;
224 let TSFlags{16-14} = ImmT.Value;
225 let TSFlags{19-17} = FPForm.Value;
226 let TSFlags{20} = hasLockPrefix;
227 let TSFlags{22-21} = SegOvrBits;
228 let TSFlags{24-23} = ExeDomain.Value;
229 let TSFlags{32-25} = Opcode;
230 let TSFlags{33} = hasVEXPrefix;
231 let TSFlags{34} = hasVEX_WPrefix;
232 let TSFlags{35} = hasVEX_4VPrefix;
Craig Topperaea148c2011-10-16 07:55:05 +0000233 let TSFlags{36} = hasVEX_4VOp3Prefix;
234 let TSFlags{37} = hasVEX_i8ImmReg;
235 let TSFlags{38} = hasVEX_L;
236 let TSFlags{39} = ignoresVEX_L;
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000237 let TSFlags{40} = hasEVEXPrefix;
238 let TSFlags{41} = hasEVEX_K;
239 let TSFlags{42} = hasEVEX_Z;
240 let TSFlags{43} = hasEVEX_L2;
241 let TSFlags{44} = hasEVEX_B;
242 let TSFlags{46-45} = EVEX_CD8E;
243 let TSFlags{49-47} = EVEX_CD8V;
244 let TSFlags{50} = has3DNow0F0FOpcode;
245 let TSFlags{51} = hasMemOp4Prefix;
246 let TSFlags{52} = hasXOP_Prefix;
Evan Cheng12c6be82007-07-31 08:04:03 +0000247}
248
Eric Christopheref62f572010-11-30 08:57:23 +0000249class PseudoI<dag oops, dag iops, list<dag> pattern>
Andrew Trick8523b162012-02-01 23:20:51 +0000250 : X86Inst<0, Pseudo, NoImm, oops, iops, "", NoItinerary> {
Eric Christopheref62f572010-11-30 08:57:23 +0000251 let Pattern = pattern;
252}
253
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +0000254class I<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000255 list<dag> pattern, InstrItinClass itin = NoItinerary,
Andrew Trick8523b162012-02-01 23:20:51 +0000256 Domain d = GenericDomain>
257 : X86Inst<o, f, NoImm, outs, ins, asm, itin, d> {
Evan Cheng12c6be82007-07-31 08:04:03 +0000258 let Pattern = pattern;
259 let CodeSize = 3;
260}
Sean Callanan04d8cb72009-12-18 00:01:26 +0000261class Ii8 <bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000262 list<dag> pattern, InstrItinClass itin = NoItinerary,
Andrew Trick8523b162012-02-01 23:20:51 +0000263 Domain d = GenericDomain>
264 : X86Inst<o, f, Imm8, outs, ins, asm, itin, d> {
Evan Cheng12c6be82007-07-31 08:04:03 +0000265 let Pattern = pattern;
266 let CodeSize = 3;
267}
Chris Lattner12455ca2010-02-12 22:27:07 +0000268class Ii8PCRel<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000269 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000270 : X86Inst<o, f, Imm8PCRel, outs, ins, asm, itin> {
Chris Lattner12455ca2010-02-12 22:27:07 +0000271 let Pattern = pattern;
272 let CodeSize = 3;
273}
Sean Callanan04d8cb72009-12-18 00:01:26 +0000274class Ii16<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000275 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000276 : X86Inst<o, f, Imm16, outs, ins, asm, itin> {
Evan Cheng12c6be82007-07-31 08:04:03 +0000277 let Pattern = pattern;
278 let CodeSize = 3;
279}
Sean Callanan04d8cb72009-12-18 00:01:26 +0000280class Ii32<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000281 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000282 : X86Inst<o, f, Imm32, outs, ins, asm, itin> {
Evan Cheng12c6be82007-07-31 08:04:03 +0000283 let Pattern = pattern;
284 let CodeSize = 3;
285}
286
Chris Lattnerac588122010-07-07 22:27:31 +0000287class Ii16PCRel<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000288 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000289 : X86Inst<o, f, Imm16PCRel, outs, ins, asm, itin> {
Chris Lattnerac588122010-07-07 22:27:31 +0000290 let Pattern = pattern;
291 let CodeSize = 3;
292}
293
Chris Lattner12455ca2010-02-12 22:27:07 +0000294class Ii32PCRel<bits<8> o, Format f, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000295 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000296 : X86Inst<o, f, Imm32PCRel, outs, ins, asm, itin> {
Chris Lattner12455ca2010-02-12 22:27:07 +0000297 let Pattern = pattern;
298 let CodeSize = 3;
299}
300
Evan Cheng12c6be82007-07-31 08:04:03 +0000301// FPStack Instruction Templates:
302// FPI - Floating Point Instruction template.
Preston Gurdfa3f6cb2012-05-02 16:03:35 +0000303class FPI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000304 InstrItinClass itin = NoItinerary>
Preston Gurdfa3f6cb2012-05-02 16:03:35 +0000305 : I<o, F, outs, ins, asm, [], itin> {}
Evan Cheng12c6be82007-07-31 08:04:03 +0000306
Bob Wilsona967c422010-08-26 18:08:11 +0000307// FpI_ - Floating Point Pseudo Instruction template. Not Predicated.
Andrew Trick8523b162012-02-01 23:20:51 +0000308class FpI_<dag outs, dag ins, FPFormat fp, list<dag> pattern,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000309 InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000310 : X86Inst<0, Pseudo, NoImm, outs, ins, "", itin> {
Jakob Stoklund Olesenf8d7eda2010-03-25 18:52:01 +0000311 let FPForm = fp;
Evan Cheng12c6be82007-07-31 08:04:03 +0000312 let Pattern = pattern;
313}
314
Sean Callanan050e0cd2009-09-15 00:35:17 +0000315// Templates for instructions that use a 16- or 32-bit segmented address as
316// their only operand: lcall (FAR CALL) and ljmp (FAR JMP)
317//
318// Iseg16 - 16-bit segment selector, 16-bit offset
319// Iseg32 - 16-bit segment selector, 32-bit offset
320
321class Iseg16 <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 : X86Inst<o, f, Imm16, outs, ins, asm, itin> {
Sean Callanan050e0cd2009-09-15 00:35:17 +0000324 let Pattern = pattern;
325 let CodeSize = 3;
326}
327
328class Iseg32 <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 : X86Inst<o, f, Imm32, outs, ins, asm, itin> {
Sean Callanan050e0cd2009-09-15 00:35:17 +0000331 let Pattern = pattern;
332 let CodeSize = 3;
333}
334
Michael Liaobbd10792012-08-30 16:54:46 +0000335def __xs : XS;
Elena Demikhovskyfad02922013-05-21 12:04:22 +0000336def __xd : XD;
Michael Liaobbd10792012-08-30 16:54:46 +0000337
Bruno Cardoso Lopes6b98f712010-06-17 23:05:30 +0000338// SI - SSE 1 & 2 scalar instructions
Andrew Trick8523b162012-02-01 23:20:51 +0000339class SI<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 : I<o, F, outs, ins, asm, pattern, itin> {
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000342 let Predicates = !if(hasEVEXPrefix /* EVEX */, [HasAVX512],
343 !if(hasVEXPrefix /* VEX */, [UseAVX],
Elena Demikhovskyfad02922013-05-21 12:04:22 +0000344 !if(!eq(Prefix, __xs.Prefix), [UseSSE1],
345 !if(!eq(Prefix, __xd.Prefix), [UseSSE2],
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000346 !if(hasOpSizePrefix, [UseSSE2], [UseSSE1])))));
Bruno Cardoso Lopes6b98f712010-06-17 23:05:30 +0000347
348 // AVX instructions have a 'v' prefix in the mnemonic
Bruno Cardoso Lopes1a890f92010-06-22 22:38:56 +0000349 let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm);
Bruno Cardoso Lopes6b98f712010-06-17 23:05:30 +0000350}
351
Bruno Cardoso Lopes191a1cd2010-06-24 00:32:06 +0000352// SIi8 - SSE 1 & 2 scalar instructions
353class SIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000354 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000355 : Ii8<o, F, outs, ins, asm, pattern, itin> {
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000356 let Predicates = !if(hasEVEXPrefix /* EVEX */, [HasAVX512],
357 !if(hasVEXPrefix /* VEX */, [UseAVX],
358 !if(!eq(Prefix, __xs.Prefix), [UseSSE1], [UseSSE2])));
Bruno Cardoso Lopes191a1cd2010-06-24 00:32:06 +0000359
360 // AVX instructions have a 'v' prefix in the mnemonic
361 let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm);
362}
363
Bruno Cardoso Lopes2bfad412010-06-18 23:13:35 +0000364// PI - SSE 1 & 2 packed instructions
365class PI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern,
Andrew Trick8523b162012-02-01 23:20:51 +0000366 InstrItinClass itin, Domain d>
367 : I<o, F, outs, ins, asm, pattern, itin, d> {
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000368 let Predicates = !if(hasEVEXPrefix /* EVEX */, [HasAVX512],
369 !if(hasVEXPrefix /* VEX */, [HasAVX],
370 !if(hasOpSizePrefix /* OpSize */, [UseSSE2], [UseSSE1])));
Bruno Cardoso Lopes2bfad412010-06-18 23:13:35 +0000371
372 // AVX instructions have a 'v' prefix in the mnemonic
Bruno Cardoso Lopes1a890f92010-06-22 22:38:56 +0000373 let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm);
Bruno Cardoso Lopes2bfad412010-06-18 23:13:35 +0000374}
375
Michael Liaobbd10792012-08-30 16:54:46 +0000376// MMXPI - SSE 1 & 2 packed instructions with MMX operands
377class MMXPI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern,
378 InstrItinClass itin, Domain d>
379 : I<o, F, outs, ins, asm, pattern, itin, d> {
380 let Predicates = !if(hasOpSizePrefix /* OpSize */, [HasSSE2], [HasSSE1]);
381}
382
Bruno Cardoso Lopes1e13c172010-06-22 23:37:59 +0000383// PIi8 - SSE 1 & 2 packed instructions with immediate
384class PIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Andrew Trick8523b162012-02-01 23:20:51 +0000385 list<dag> pattern, InstrItinClass itin, Domain d>
386 : Ii8<o, F, outs, ins, asm, pattern, itin, d> {
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000387 let Predicates = !if(hasEVEXPrefix /* EVEX */, [HasAVX512],
388 !if(hasVEXPrefix /* VEX */, [HasAVX],
389 !if(hasOpSizePrefix /* OpSize */, [UseSSE2], [UseSSE1])));
Bruno Cardoso Lopes1e13c172010-06-22 23:37:59 +0000390
391 // AVX instructions have a 'v' prefix in the mnemonic
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000392 let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm);
Bruno Cardoso Lopes1e13c172010-06-22 23:37:59 +0000393}
394
Evan Cheng12c6be82007-07-31 08:04:03 +0000395// SSE1 Instruction Templates:
396//
397// SSI - SSE1 instructions with XS prefix.
398// PSI - SSE1 instructions with TB prefix.
399// PSIi8 - SSE1 instructions with ImmT == Imm8 and TB prefix.
Bruno Cardoso Lopesc2f87b72010-06-08 22:51:23 +0000400// VSSI - SSE1 instructions with XS prefix in AVX form.
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000401// VPSI - SSE1 instructions with TB prefix in AVX form, packed single.
Evan Cheng12c6be82007-07-31 08:04:03 +0000402
Andrew Trick8523b162012-02-01 23:20:51 +0000403class SSI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000404 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000405 : I<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[UseSSE1]>;
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +0000406class SSIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000407 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000408 : Ii8<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[UseSSE1]>;
Andrew Trick8523b162012-02-01 23:20:51 +0000409class PSI<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, SSEPackedSingle>, TB,
Michael Liaobbd10792012-08-30 16:54:46 +0000412 Requires<[UseSSE1]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000413class PSIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000414 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000415 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, TB,
Michael Liaobbd10792012-08-30 16:54:46 +0000416 Requires<[UseSSE1]>;
Bruno Cardoso Lopesc2f87b72010-06-08 22:51:23 +0000417class VSSI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000418 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000419 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, XS,
Bruno Cardoso Lopes77a3c442010-07-13 00:38:47 +0000420 Requires<[HasAVX]>;
Bruno Cardoso Lopesb06f54b2010-06-12 01:23:26 +0000421class VPSI<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, !strconcat("v", asm), pattern, itin, SSEPackedSingle>, TB,
Bruno Cardoso Lopes77a3c442010-07-13 00:38:47 +0000424 Requires<[HasAVX]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000425
426// SSE2 Instruction Templates:
427//
Bill Wendling76105a42008-08-27 21:32:04 +0000428// SDI - SSE2 instructions with XD prefix.
429// SDIi8 - SSE2 instructions with ImmT == Imm8 and XD prefix.
Craig Topperf881d382012-07-30 02:14:02 +0000430// S2SI - SSE2 instructions with XS prefix.
Bill Wendling76105a42008-08-27 21:32:04 +0000431// SSDIi8 - SSE2 instructions with ImmT == Imm8 and XS prefix.
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000432// PDI - SSE2 instructions with TB and OpSize prefixes, packed double domain.
Bill Wendling76105a42008-08-27 21:32:04 +0000433// PDIi8 - SSE2 instructions with ImmT == Imm8 and TB and OpSize prefixes.
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000434// VSDI - SSE2 scalar instructions with XD prefix in AVX form.
435// VPDI - SSE2 vector instructions with TB and OpSize prefixes in AVX form,
436// packed double domain.
437// VS2I - SSE2 scalar instructions with TB and OpSize prefixes in AVX form.
438// S2I - SSE2 scalar instructions with TB and OpSize prefixes.
Michael Liaobbd10792012-08-30 16:54:46 +0000439// MMXSDIi8 - SSE2 instructions with ImmT == Imm8 and XD prefix as well as
440// MMX operands.
441// MMXSSDIi8 - SSE2 instructions with ImmT == Imm8 and XS prefix as well as
442// MMX operands.
Evan Cheng12c6be82007-07-31 08:04:03 +0000443
Andrew Trick8523b162012-02-01 23:20:51 +0000444class SDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000445 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000446 : I<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[UseSSE2]>;
Evan Cheng01c7c192007-12-20 19:57:09 +0000447class SDIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000448 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000449 : Ii8<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[UseSSE2]>;
Craig Topperf881d382012-07-30 02:14:02 +0000450class S2SI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000451 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000452 : I<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[UseSSE2]>;
Craig Topperf881d382012-07-30 02:14:02 +0000453class S2SIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000454 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000455 : Ii8<o, F, outs, ins, asm, pattern>, XS, Requires<[UseSSE2]>;
Andrew Trick8523b162012-02-01 23:20:51 +0000456class PDI<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>
Andrew Trick8523b162012-02-01 23:20:51 +0000458 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, TB, OpSize,
Michael Liaobbd10792012-08-30 16:54:46 +0000459 Requires<[UseSSE2]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000460class PDIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000461 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000462 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, TB, OpSize,
Michael Liaobbd10792012-08-30 16:54:46 +0000463 Requires<[UseSSE2]>;
Bruno Cardoso Lopesc2f87b72010-06-08 22:51:23 +0000464class VSDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000465 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000466 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, XD,
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000467 Requires<[UseAVX]>;
Craig Topperf881d382012-07-30 02:14:02 +0000468class VS2SI<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 Topperf881d382012-07-30 02:14:02 +0000470 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, XS,
471 Requires<[HasAVX]>;
Bruno Cardoso Lopesb06f54b2010-06-12 01:23:26 +0000472class VPDI<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>
Andrew Trick8523b162012-02-01 23:20:51 +0000474 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin, SSEPackedDouble>, TB,
Bruno Cardoso Lopes77a3c442010-07-13 00:38:47 +0000475 OpSize, Requires<[HasAVX]>;
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000476class VS2I<bits<8> o, Format F, dag outs, dag ins, string asm,
477 list<dag> pattern, InstrItinClass itin = NoItinerary>
478 : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, TB,
Elena Demikhovsky3ce8dbb2013-08-18 13:08:57 +0000479 OpSize, Requires<[UseAVX]>;
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000480class S2I<bits<8> o, Format F, dag outs, dag ins, string asm,
481 list<dag> pattern, InstrItinClass itin = NoItinerary>
482 : I<o, F, outs, ins, asm, pattern, itin>, TB,
483 OpSize, Requires<[UseSSE2]>;
Michael Liaobbd10792012-08-30 16:54:46 +0000484class MMXSDIi8<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>
Michael Liaobbd10792012-08-30 16:54:46 +0000486 : Ii8<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[HasSSE2]>;
487class MMXS2SIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000488 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000489 : Ii8<o, F, outs, ins, asm, pattern>, XS, Requires<[HasSSE2]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000490
491// SSE3 Instruction Templates:
492//
493// S3I - SSE3 instructions with TB and OpSize prefixes.
494// S3SI - SSE3 instructions with XS prefix.
495// S3DI - SSE3 instructions with XD prefix.
496
Sean Callanan04d8cb72009-12-18 00:01:26 +0000497class S3SI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000498 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000499 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, XS,
Michael Liaobbd10792012-08-30 16:54:46 +0000500 Requires<[UseSSE3]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000501class S3DI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000502 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000503 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, XD,
Michael Liaobbd10792012-08-30 16:54:46 +0000504 Requires<[UseSSE3]>;
Andrew Trick8523b162012-02-01 23:20:51 +0000505class S3I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000506 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000507 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, TB, OpSize,
Michael Liaobbd10792012-08-30 16:54:46 +0000508 Requires<[UseSSE3]>;
Evan Cheng12c6be82007-07-31 08:04:03 +0000509
510
Nate Begeman8ef50212008-02-12 22:51:28 +0000511// SSSE3 Instruction Templates:
512//
513// SS38I - SSSE3 instructions with T8 prefix.
514// SS3AI - SSSE3 instructions with TA prefix.
Michael Liaobbd10792012-08-30 16:54:46 +0000515// MMXSS38I - SSSE3 instructions with T8 prefix and MMX operands.
516// MMXSS3AI - SSSE3 instructions with TA prefix and MMX operands.
Nate Begeman8ef50212008-02-12 22:51:28 +0000517//
518// Note: SSSE3 instructions have 64-bit and 128-bit versions. The 64-bit version
Craig Topper744f6312012-01-09 00:11:29 +0000519// uses the MMX registers. The 64-bit versions are grouped with the MMX
520// classes. They need to be enabled even if AVX is enabled.
Nate Begeman8ef50212008-02-12 22:51:28 +0000521
522class SS38I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000523 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000524 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8,
Michael Liaobbd10792012-08-30 16:54:46 +0000525 Requires<[UseSSSE3]>;
Nate Begeman8ef50212008-02-12 22:51:28 +0000526class SS3AI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000527 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000528 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
Michael Liaobbd10792012-08-30 16:54:46 +0000529 Requires<[UseSSSE3]>;
530class MMXSS38I<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 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8,
533 Requires<[HasSSSE3]>;
534class MMXSS3AI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000535 list<dag> pattern, InstrItinClass itin = NoItinerary>
Michael Liaobbd10792012-08-30 16:54:46 +0000536 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +0000537 Requires<[HasSSSE3]>;
Nate Begeman8ef50212008-02-12 22:51:28 +0000538
539// SSE4.1 Instruction Templates:
540//
541// SS48I - SSE 4.1 instructions with T8 prefix.
Evan Cheng96bdbd62008-03-14 07:39:27 +0000542// SS41AIi8 - SSE 4.1 instructions with TA prefix and ImmT == Imm8.
Nate Begeman8ef50212008-02-12 22:51:28 +0000543//
544class SS48I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000545 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000546 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8,
Michael Liaobbd10792012-08-30 16:54:46 +0000547 Requires<[UseSSE41]>;
Evan Cheng96bdbd62008-03-14 07:39:27 +0000548class SS4AIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000549 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000550 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
Michael Liaobbd10792012-08-30 16:54:46 +0000551 Requires<[UseSSE41]>;
Nate Begeman8ef50212008-02-12 22:51:28 +0000552
Nate Begeman55b7bec2008-07-17 16:51:19 +0000553// SSE4.2 Instruction Templates:
554//
555// SS428I - SSE 4.2 instructions with T8 prefix.
556class SS428I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000557 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000558 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8,
Michael Liaobbd10792012-08-30 16:54:46 +0000559 Requires<[UseSSE42]>;
Nate Begeman8ef50212008-02-12 22:51:28 +0000560
Craig Topper96fa5972011-10-16 16:50:08 +0000561// SS42FI - SSE 4.2 instructions with T8XD prefix.
Michael Liaobbd10792012-08-30 16:54:46 +0000562// NOTE: 'HasSSE42' is used as SS42FI is only used for CRC32 insns.
Eric Christopher7dfa9f22009-08-08 21:55:08 +0000563class SS42FI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000564 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000565 : I<o, F, outs, ins, asm, pattern, itin>, T8XD, Requires<[HasSSE42]>;
Craig Topperb9109842012-01-01 19:51:58 +0000566
Eric Christopher9fe912d2009-08-18 22:50:32 +0000567// SS42AI = SSE 4.2 instructions with TA prefix
568class SS42AI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000569 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000570 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
Michael Liaobbd10792012-08-30 16:54:46 +0000571 Requires<[UseSSE42]>;
Eric Christopher9fe912d2009-08-18 22:50:32 +0000572
Bruno Cardoso Lopes14c5fd42010-07-20 00:11:13 +0000573// AVX Instruction Templates:
574// Instructions introduced in AVX (no SSE equivalent forms)
575//
576// AVX8I - AVX instructions with T8 and OpSize prefix.
Bruno Cardoso Lopes3b505842010-07-20 19:44:51 +0000577// AVXAIi8 - AVX instructions with TA, OpSize prefix and ImmT = Imm8.
Bruno Cardoso Lopes14c5fd42010-07-20 00:11:13 +0000578class AVX8I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000579 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000580 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8, OpSize,
Bruno Cardoso Lopes14c5fd42010-07-20 00:11:13 +0000581 Requires<[HasAVX]>;
Bruno Cardoso Lopes3b505842010-07-20 19:44:51 +0000582class AVXAIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000583 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000584 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA, OpSize,
Bruno Cardoso Lopes3b505842010-07-20 19:44:51 +0000585 Requires<[HasAVX]>;
Bruno Cardoso Lopes14c5fd42010-07-20 00:11:13 +0000586
Craig Topper05d1cb92011-11-06 06:12:20 +0000587// AVX2 Instruction Templates:
588// Instructions introduced in AVX2 (no SSE equivalent forms)
589//
590// AVX28I - AVX2 instructions with T8 and OpSize prefix.
591// AVX2AIi8 - AVX2 instructions with TA, OpSize prefix and ImmT = Imm8.
592class AVX28I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000593 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000594 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8, OpSize,
Craig Topper05d1cb92011-11-06 06:12:20 +0000595 Requires<[HasAVX2]>;
Craig Topperf01f1b52011-11-06 23:04:08 +0000596class AVX2AIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000597 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000598 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA, OpSize,
Craig Topper05d1cb92011-11-06 06:12:20 +0000599 Requires<[HasAVX2]>;
600
Elena Demikhovsky003e7d72013-07-28 08:28:38 +0000601
602// AVX-512 Instruction Templates:
603// Instructions introduced in AVX-512 (no SSE equivalent forms)
604//
605// AVX5128I - AVX-512 instructions with T8 and OpSize prefix.
606// AVX512AIi8 - AVX-512 instructions with TA, OpSize prefix and ImmT = Imm8.
607// AVX512PDI - AVX-512 instructions with TB, OpSize, double packed.
608// AVX512PSI - AVX-512 instructions with TB, single packed.
609// AVX512XS8I - AVX-512 instructions with T8 and XS prefixes.
610// AVX512XSI - AVX-512 instructions with XS prefix, generic domain.
611// AVX512BI - AVX-512 instructions with TB, OpSize, int packed domain.
612// AVX512SI - AVX-512 scalar instructions with TB and OpSize prefixes.
613
614class AVX5128I<bits<8> o, Format F, dag outs, dag ins, string asm,
615 list<dag> pattern, InstrItinClass itin = NoItinerary>
616 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8, OpSize,
617 Requires<[HasAVX512]>;
618class AVX512XS8I<bits<8> o, Format F, dag outs, dag ins, string asm,
619 list<dag> pattern, InstrItinClass itin = NoItinerary>
620 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8XS,
621 Requires<[HasAVX512]>;
622class AVX512XSI<bits<8> o, Format F, dag outs, dag ins, string asm,
623 list<dag> pattern, InstrItinClass itin = NoItinerary>
624 : I<o, F, outs, ins, asm, pattern, itin>, XS,
625 Requires<[HasAVX512]>;
626class AVX512XDI<bits<8> o, Format F, dag outs, dag ins, string asm,
627 list<dag> pattern, InstrItinClass itin = NoItinerary>
628 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, XD,
629 Requires<[HasAVX512]>;
630class AVX512BI<bits<8> o, Format F, dag outs, dag ins, string asm,
631 list<dag> pattern, InstrItinClass itin = NoItinerary>
632 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TB, OpSize,
633 Requires<[HasAVX512]>;
634class AVX512BIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
635 list<dag> pattern, InstrItinClass itin = NoItinerary>
636 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TB, OpSize,
637 Requires<[HasAVX512]>;
638class AVX512SI<bits<8> o, Format F, dag outs, dag ins, string asm,
639 list<dag> pattern, InstrItinClass itin = NoItinerary>
640 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TB, OpSize,
641 Requires<[HasAVX512]>;
642class AVX512AIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
643 list<dag> pattern, InstrItinClass itin = NoItinerary>
644 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA, OpSize,
645 Requires<[HasAVX512]>;
646class AVX512Ii8<bits<8> o, Format F, dag outs, dag ins, string asm,
647 list<dag> pattern, InstrItinClass itin = NoItinerary>
648 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>,
649 Requires<[HasAVX512]>;
650class AVX512PDI<bits<8> o, Format F, dag outs, dag ins, string asm,
651 list<dag> pattern, InstrItinClass itin = NoItinerary>
652 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, TB,
653 OpSize, Requires<[HasAVX512]>;
654class AVX512PSI<bits<8> o, Format F, dag outs, dag ins, string asm,
655 list<dag> pattern, InstrItinClass itin = NoItinerary>
656 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, TB,
657 Requires<[HasAVX512]>;
658class AVX512PIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
659 list<dag> pattern, Domain d, InstrItinClass itin = NoItinerary>
660 : Ii8<o, F, outs, ins, asm, pattern, itin, d>, Requires<[HasAVX512]>;
661class AVX512PI<bits<8> o, Format F, dag outs, dag ins, string asm,
662 list<dag> pattern, Domain d, InstrItinClass itin = NoItinerary>
663 : I<o, F, outs, ins, asm, pattern, itin, d>, Requires<[HasAVX512]>;
664class AVX512FMA3<bits<8> o, Format F, dag outs, dag ins, string asm,
665 list<dag>pattern, InstrItinClass itin = NoItinerary>
666 : I<o, F, outs, ins, asm, pattern, itin>, T8,
667 OpSize, EVEX_4V, Requires<[HasAVX512]>;
668
Eric Christopher2ef63182010-04-02 21:54:27 +0000669// AES Instruction Templates:
670//
671// AES8I
Eric Christopher1290fa02010-04-05 21:14:32 +0000672// These use the same encoding as the SSE4.2 T8 and TA encodings.
Eric Christopher2ef63182010-04-02 21:54:27 +0000673class AES8I<bits<8> o, Format F, dag outs, dag ins, string asm,
Preston Gurd3fe264d2013-09-13 19:23:28 +0000674 list<dag>pattern, InstrItinClass itin = IIC_AES>
Andrew Trick8523b162012-02-01 23:20:51 +0000675 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8,
Craig Topperc0cef322012-05-01 05:35:02 +0000676 Requires<[HasAES]>;
Eric Christopher2ef63182010-04-02 21:54:27 +0000677
678class AESAI<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>
Andrew Trick8523b162012-02-01 23:20:51 +0000680 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
Craig Topperc0cef322012-05-01 05:35:02 +0000681 Requires<[HasAES]>;
Eric Christopher2ef63182010-04-02 21:54:27 +0000682
Benjamin Kramera0396e42012-05-31 14:34:17 +0000683// PCLMUL Instruction Templates
684class PCLMULIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000685 list<dag>pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000686 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
Benjamin Kramera0396e42012-05-31 14:34:17 +0000687 OpSize, Requires<[HasPCLMUL]>;
Eli Friedman415412e2011-07-05 18:21:20 +0000688
Benjamin Kramera0396e42012-05-31 14:34:17 +0000689class AVXPCLMULIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000690 list<dag>pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000691 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
Benjamin Kramera0396e42012-05-31 14:34:17 +0000692 OpSize, VEX_4V, Requires<[HasAVX, HasPCLMUL]>;
Bruno Cardoso Lopesea0e05a2010-07-23 18:41:12 +0000693
Bruno Cardoso Lopesacd92302010-07-23 00:54:35 +0000694// FMA3 Instruction Templates
695class FMA3<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000696 list<dag>pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000697 : I<o, F, outs, ins, asm, pattern, itin>, T8,
Nadav Rotemff8c4552013-03-28 22:54:45 +0000698 OpSize, VEX_4V, FMASC, Requires<[HasFMA]>;
Bruno Cardoso Lopesacd92302010-07-23 00:54:35 +0000699
Bruno Cardoso Lopes0f9a1f52011-11-25 19:33:42 +0000700// FMA4 Instruction Templates
701class FMA4<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000702 list<dag>pattern, InstrItinClass itin = NoItinerary>
Benjamin Kramerfee7d212013-01-22 18:05:59 +0000703 : Ii8<o, F, outs, ins, asm, pattern, itin>, TA,
Nadav Rotemff8c4552013-03-28 22:54:45 +0000704 OpSize, VEX_4V, VEX_I8IMM, FMASC, Requires<[HasFMA4]>;
Bruno Cardoso Lopes0f9a1f52011-11-25 19:33:42 +0000705
Jan Sjödin7c0face2011-12-12 19:37:49 +0000706// XOP 2, 3 and 4 Operand Instruction Template
707class IXOP<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000708 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000709 : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>,
Jan Sjödin7c0face2011-12-12 19:37:49 +0000710 XOP, XOP9, Requires<[HasXOP]>;
711
712// XOP 2, 3 and 4 Operand Instruction Templates with imm byte
713class IXOPi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000714 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000715 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>,
Jan Sjödin7c0face2011-12-12 19:37:49 +0000716 XOP, XOP8, Requires<[HasXOP]>;
717
718// XOP 5 operand instruction (VEX encoding!)
719class IXOP5<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000720 list<dag>pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000721 : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
Jan Sjödin7c0face2011-12-12 19:37:49 +0000722 OpSize, VEX_4V, VEX_I8IMM, Requires<[HasXOP]>;
723
Evan Cheng12c6be82007-07-31 08:04:03 +0000724// X86-64 Instruction templates...
725//
726
Andrew Trick8523b162012-02-01 23:20:51 +0000727class RI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000728 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000729 : I<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000730class RIi8 <bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000731 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000732 : Ii8<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000733class RIi32 <bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000734 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000735 : Ii32<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000736
737class RIi64<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 : X86Inst<o, f, Imm64, outs, ins, asm, itin>, REX_W {
Evan Cheng12c6be82007-07-31 08:04:03 +0000740 let Pattern = pattern;
741 let CodeSize = 3;
742}
743
Kevin Enderby285da022013-07-22 21:25:31 +0000744class RIi64_NOREX<bits<8> o, Format f, dag outs, dag ins, string asm,
745 list<dag> pattern, InstrItinClass itin = NoItinerary>
746 : X86Inst<o, f, Imm64, outs, ins, asm, itin> {
747 let Pattern = pattern;
748 let CodeSize = 3;
749}
750
Evan Cheng12c6be82007-07-31 08:04:03 +0000751class RSSI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000752 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000753 : SSI<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000754class RSDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000755 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000756 : SDI<o, F, outs, ins, asm, pattern, itin>, REX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000757class RPDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000758 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000759 : PDI<o, F, outs, ins, asm, pattern, itin>, REX_W;
Bruno Cardoso Lopes123dff02011-07-25 23:05:25 +0000760class VRPDI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000761 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000762 : VPDI<o, F, outs, ins, asm, pattern, itin>, VEX_W;
Elena Demikhovsky89703c02013-06-09 07:37:10 +0000763class RS2I<bits<8> o, Format F, dag outs, dag ins, string asm,
764 list<dag> pattern, InstrItinClass itin = NoItinerary>
765 : S2I<o, F, outs, ins, asm, pattern, itin>, REX_W;
766class VRS2I<bits<8> o, Format F, dag outs, dag ins, string asm,
767 list<dag> pattern, InstrItinClass itin = NoItinerary>
768 : VS2I<o, F, outs, ins, asm, pattern, itin>, VEX_W;
Evan Cheng12c6be82007-07-31 08:04:03 +0000769
770// MMX Instruction templates
771//
772
773// MMXI - MMX instructions with TB prefix.
Anton Korobeynikov31099512008-08-23 15:53:19 +0000774// MMXI64 - MMX instructions with TB prefix valid only in 64 bit mode.
Evan Cheng12c6be82007-07-31 08:04:03 +0000775// MMX2I - MMX / SSE2 instructions with TB and OpSize prefixes.
776// MMXIi8 - MMX instructions with ImmT == Imm8 and TB prefix.
777// MMXIi8 - MMX instructions with ImmT == Imm8 and TB prefix.
778// MMXID - MMX instructions with XD prefix.
779// MMXIS - MMX instructions with XS prefix.
Sean Callanan04d8cb72009-12-18 00:01:26 +0000780class MMXI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000781 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000782 : I<o, F, outs, ins, asm, pattern, itin>, TB, Requires<[HasMMX]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000783class MMXI64<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000784 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000785 : I<o, F, outs, ins, asm, pattern, itin>, TB, Requires<[HasMMX,In64BitMode]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000786class MMXRI<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000787 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000788 : I<o, F, outs, ins, asm, pattern, itin>, TB, REX_W, Requires<[HasMMX]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000789class MMX2I<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000790 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000791 : I<o, F, outs, ins, asm, pattern, itin>, TB, OpSize, Requires<[HasMMX]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000792class MMXIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000793 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000794 : Ii8<o, F, outs, ins, asm, pattern, itin>, TB, Requires<[HasMMX]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000795class MMXID<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000796 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000797 : Ii8<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[HasMMX]>;
Sean Callanan04d8cb72009-12-18 00:01:26 +0000798class MMXIS<bits<8> o, Format F, dag outs, dag ins, string asm,
Jakob Stoklund Olesen4d39e812013-03-25 23:12:41 +0000799 list<dag> pattern, InstrItinClass itin = NoItinerary>
Andrew Trick8523b162012-02-01 23:20:51 +0000800 : Ii8<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[HasMMX]>;