| Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- X86InstrFormats.td - X86 Instruction Formats -------*- tablegen -*-===// | 
|  | 2 | // | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 3 | //                     The LLVM Compiler Infrastructure | 
|  | 4 | // | 
| Chris Lattner | f3ebc3f | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source | 
|  | 6 | // License. See LICENSE.TXT for details. | 
| Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 7 | // | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// | 
|  | 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. | 
|  | 17 | class Format<bits<6> val> { | 
|  | 18 | bits<6> Value = val; | 
|  | 19 | } | 
|  | 20 |  | 
|  | 21 | def Pseudo     : Format<0>; def RawFrm     : Format<1>; | 
|  | 22 | def AddRegFrm  : Format<2>; def MRMDestReg : Format<3>; | 
|  | 23 | def MRMDestMem : Format<4>; def MRMSrcReg  : Format<5>; | 
|  | 24 | def MRMSrcMem  : Format<6>; | 
|  | 25 | def MRM0r  : Format<16>; def MRM1r  : Format<17>; def MRM2r  : Format<18>; | 
|  | 26 | def MRM3r  : Format<19>; def MRM4r  : Format<20>; def MRM5r  : Format<21>; | 
|  | 27 | def MRM6r  : Format<22>; def MRM7r  : Format<23>; | 
|  | 28 | def MRM0m  : Format<24>; def MRM1m  : Format<25>; def MRM2m  : Format<26>; | 
|  | 29 | def MRM3m  : Format<27>; def MRM4m  : Format<28>; def MRM5m  : Format<29>; | 
|  | 30 | def MRM6m  : Format<30>; def MRM7m  : Format<31>; | 
|  | 31 | def MRMInitReg : Format<32>; | 
| Chris Lattner | f7477e5 | 2010-02-12 02:06:33 +0000 | [diff] [blame] | 32 | def MRM_C1 : Format<33>; | 
| Chris Lattner | 140caa7 | 2010-02-13 00:41:14 +0000 | [diff] [blame] | 33 | def MRM_C2 : Format<34>; | 
|  | 34 | def MRM_C3 : Format<35>; | 
|  | 35 | def MRM_C4 : Format<36>; | 
|  | 36 | def MRM_C8 : Format<37>; | 
|  | 37 | def MRM_C9 : Format<38>; | 
|  | 38 | def MRM_E8 : Format<39>; | 
|  | 39 | def MRM_F0 : Format<40>; | 
|  | 40 | def MRM_F8 : Format<41>; | 
| Sean Callanan | 4d804d7 | 2010-02-13 02:06:11 +0000 | [diff] [blame] | 41 | def MRM_F9 : Format<42>; | 
| Chris Lattner | cea0a8d | 2010-09-17 18:02:29 +0000 | [diff] [blame] | 42 | def RawFrmImm8 : Format<43>; | 
|  | 43 | def RawFrmImm16 : Format<44>; | 
| Rafael Espindola | e390621 | 2011-02-22 00:35:18 +0000 | [diff] [blame] | 44 | def MRM_D0 : Format<45>; | 
|  | 45 | def MRM_D1 : Format<46>; | 
| Craig Topper | 66a3597 | 2012-02-19 01:39:49 +0000 | [diff] [blame] | 46 | def MRM_D4 : Format<47>; | 
| Michael Liao | 73cffdd | 2012-11-08 07:28:54 +0000 | [diff] [blame] | 47 | def MRM_D5 : Format<48>; | 
| Dave Zarzycki | 656e851 | 2013-03-25 18:59:43 +0000 | [diff] [blame^] | 48 | def MRM_D6 : Format<49>; | 
|  | 49 | def MRM_D8 : Format<50>; | 
|  | 50 | def MRM_D9 : Format<51>; | 
|  | 51 | def MRM_DA : Format<52>; | 
|  | 52 | def MRM_DB : Format<53>; | 
|  | 53 | def MRM_DC : Format<54>; | 
|  | 54 | def MRM_DD : Format<55>; | 
|  | 55 | def MRM_DE : Format<56>; | 
|  | 56 | def MRM_DF : Format<57>; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 57 |  | 
|  | 58 | // ImmType - This specifies the immediate type used by an instruction. This is | 
|  | 59 | // part of the ad-hoc solution used to emit machine instruction encodings by our | 
|  | 60 | // machine code emitter. | 
|  | 61 | class ImmType<bits<3> val> { | 
|  | 62 | bits<3> Value = val; | 
|  | 63 | } | 
| Chris Lattner | 12455ca | 2010-02-12 22:27:07 +0000 | [diff] [blame] | 64 | def NoImm      : ImmType<0>; | 
|  | 65 | def Imm8       : ImmType<1>; | 
|  | 66 | def Imm8PCRel  : ImmType<2>; | 
|  | 67 | def Imm16      : ImmType<3>; | 
| Chris Lattner | ac58812 | 2010-07-07 22:27:31 +0000 | [diff] [blame] | 68 | def Imm16PCRel : ImmType<4>; | 
|  | 69 | def Imm32      : ImmType<5>; | 
|  | 70 | def Imm32PCRel : ImmType<6>; | 
|  | 71 | def Imm64      : ImmType<7>; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 72 |  | 
|  | 73 | // FPFormat - This specifies what form this FP instruction has.  This is used by | 
|  | 74 | // the Floating-Point stackifier pass. | 
|  | 75 | class FPFormat<bits<3> val> { | 
|  | 76 | bits<3> Value = val; | 
|  | 77 | } | 
|  | 78 | def NotFP      : FPFormat<0>; | 
|  | 79 | def ZeroArgFP  : FPFormat<1>; | 
|  | 80 | def OneArgFP   : FPFormat<2>; | 
|  | 81 | def OneArgFPRW : FPFormat<3>; | 
|  | 82 | def TwoArgFP   : FPFormat<4>; | 
|  | 83 | def CompareFP  : FPFormat<5>; | 
|  | 84 | def CondMovFP  : FPFormat<6>; | 
|  | 85 | def SpecialFP  : FPFormat<7>; | 
|  | 86 |  | 
| Jakob Stoklund Olesen | 49e121d | 2010-03-25 17:25:00 +0000 | [diff] [blame] | 87 | // Class specifying the SSE execution domain, used by the SSEDomainFix pass. | 
| Jakob Stoklund Olesen | dbff4e8 | 2010-03-30 22:46:53 +0000 | [diff] [blame] | 88 | // Keep in sync with tables in X86InstrInfo.cpp. | 
| Jakob Stoklund Olesen | 49e121d | 2010-03-25 17:25:00 +0000 | [diff] [blame] | 89 | class Domain<bits<2> val> { | 
|  | 90 | bits<2> Value = val; | 
|  | 91 | } | 
|  | 92 | def GenericDomain   : Domain<0>; | 
| Jakob Stoklund Olesen | dbff4e8 | 2010-03-30 22:46:53 +0000 | [diff] [blame] | 93 | def SSEPackedSingle : Domain<1>; | 
|  | 94 | def SSEPackedDouble : Domain<2>; | 
|  | 95 | def SSEPackedInt    : Domain<3>; | 
| Jakob Stoklund Olesen | 49e121d | 2010-03-25 17:25:00 +0000 | [diff] [blame] | 96 |  | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 97 | // Prefix byte classes which are used to indicate to the ad-hoc machine code | 
|  | 98 | // emitter that various prefix bytes are required. | 
|  | 99 | class OpSize { bit hasOpSizePrefix = 1; } | 
|  | 100 | class AdSize { bit hasAdSizePrefix = 1; } | 
|  | 101 | class REX_W  { bit hasREX_WPrefix = 1; } | 
| Andrew Lenharth | 0070dd1 | 2008-03-01 13:37:02 +0000 | [diff] [blame] | 102 | class LOCK   { bit hasLockPrefix = 1; } | 
| Anton Korobeynikov | 2589777 | 2008-10-11 19:09:15 +0000 | [diff] [blame] | 103 | class SegFS  { bits<2> SegOvrBits = 1; } | 
|  | 104 | class SegGS  { bits<2> SegOvrBits = 2; } | 
| Joerg Sonnenberger | cc53d99 | 2011-04-04 15:58:30 +0000 | [diff] [blame] | 105 | class TB     { bits<5> Prefix = 1; } | 
|  | 106 | class REP    { bits<5> Prefix = 2; } | 
|  | 107 | class D8     { bits<5> Prefix = 3; } | 
|  | 108 | class D9     { bits<5> Prefix = 4; } | 
|  | 109 | class DA     { bits<5> Prefix = 5; } | 
|  | 110 | class DB     { bits<5> Prefix = 6; } | 
|  | 111 | class DC     { bits<5> Prefix = 7; } | 
|  | 112 | class DD     { bits<5> Prefix = 8; } | 
|  | 113 | class DE     { bits<5> Prefix = 9; } | 
|  | 114 | class DF     { bits<5> Prefix = 10; } | 
|  | 115 | class XD     { bits<5> Prefix = 11; } | 
|  | 116 | class XS     { bits<5> Prefix = 12; } | 
|  | 117 | class T8     { bits<5> Prefix = 13; } | 
|  | 118 | class TA     { bits<5> Prefix = 14; } | 
| Joerg Sonnenberger | fc4789d | 2011-04-04 16:58:13 +0000 | [diff] [blame] | 119 | class A6     { bits<5> Prefix = 15; } | 
|  | 120 | class A7     { bits<5> Prefix = 16; } | 
| Craig Topper | 96fa597 | 2011-10-16 16:50:08 +0000 | [diff] [blame] | 121 | class T8XD   { bits<5> Prefix = 17; } | 
|  | 122 | class T8XS   { bits<5> Prefix = 18; } | 
| Craig Topper | 980d598 | 2011-10-23 07:34:00 +0000 | [diff] [blame] | 123 | class TAXD   { bits<5> Prefix = 19; } | 
| Jan Sjödin | 6dd2488 | 2011-12-12 19:12:26 +0000 | [diff] [blame] | 124 | class XOP8   { bits<5> Prefix = 20; } | 
|  | 125 | class XOP9   { bits<5> Prefix = 21; } | 
| Bruno Cardoso Lopes | 1a890f9 | 2010-06-22 22:38:56 +0000 | [diff] [blame] | 126 | class VEX    { bit hasVEXPrefix = 1; } | 
| Bruno Cardoso Lopes | 0516674 | 2010-07-01 01:20:06 +0000 | [diff] [blame] | 127 | class VEX_W  { bit hasVEX_WPrefix = 1; } | 
| Bruno Cardoso Lopes | 1a890f9 | 2010-06-22 22:38:56 +0000 | [diff] [blame] | 128 | class VEX_4V : VEX { bit hasVEX_4VPrefix = 1; } | 
| Craig Topper | aea148c | 2011-10-16 07:55:05 +0000 | [diff] [blame] | 129 | class VEX_4VOp3 : VEX { bit hasVEX_4VOp3Prefix = 1; } | 
| Bruno Cardoso Lopes | e2bd058 | 2010-07-06 22:36:24 +0000 | [diff] [blame] | 130 | class VEX_I8IMM { bit hasVEX_i8ImmReg = 1; } | 
| Bruno Cardoso Lopes | fd8bfcd | 2010-07-13 21:07:28 +0000 | [diff] [blame] | 131 | class VEX_L  { bit hasVEX_L = 1; } | 
| Craig Topper | f18c896 | 2011-10-04 06:30:42 +0000 | [diff] [blame] | 132 | class VEX_LIG { bit ignoresVEX_L = 1; } | 
| Chris Lattner | 45270db | 2010-10-03 18:08:05 +0000 | [diff] [blame] | 133 | class Has3DNow0F0FOpcode  { bit has3DNow0F0FOpcode = 1; } | 
| Craig Topper | cd93de9 | 2011-12-30 04:48:54 +0000 | [diff] [blame] | 134 | class MemOp4 { bit hasMemOp4Prefix = 1; } | 
| Jan Sjödin | 6dd2488 | 2011-12-12 19:12:26 +0000 | [diff] [blame] | 135 | class XOP { bit hasXOP_Prefix = 1; } | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 136 | class X86Inst<bits<8> opcod, Format f, ImmType i, dag outs, dag ins, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 137 | string AsmStr, | 
|  | 138 | InstrItinClass itin, | 
|  | 139 | Domain d = GenericDomain> | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 140 | : Instruction { | 
|  | 141 | let Namespace = "X86"; | 
|  | 142 |  | 
|  | 143 | bits<8> Opcode = opcod; | 
|  | 144 | Format Form = f; | 
|  | 145 | bits<6> FormBits = Form.Value; | 
|  | 146 | ImmType ImmT = i; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 147 |  | 
|  | 148 | dag OutOperandList = outs; | 
|  | 149 | dag InOperandList = ins; | 
|  | 150 | string AsmString = AsmStr; | 
|  | 151 |  | 
| Chris Lattner | 7ff3346 | 2010-10-31 19:22:57 +0000 | [diff] [blame] | 152 | // If this is a pseudo instruction, mark it isCodeGenOnly. | 
|  | 153 | let isCodeGenOnly = !eq(!cast<string>(f), "Pseudo"); | 
|  | 154 |  | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 155 | let Itinerary = itin; | 
|  | 156 |  | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 157 | // | 
|  | 158 | // Attributes specific to X86 instructions... | 
|  | 159 | // | 
|  | 160 | bit hasOpSizePrefix = 0;  // Does this inst have a 0x66 prefix? | 
|  | 161 | bit hasAdSizePrefix = 0;  // Does this inst have a 0x67 prefix? | 
|  | 162 |  | 
| Joerg Sonnenberger | cc53d99 | 2011-04-04 15:58:30 +0000 | [diff] [blame] | 163 | bits<5> Prefix = 0;       // Which prefix byte does this inst have? | 
| Eric Christopher | 3a8ae23 | 2010-11-30 09:11:54 +0000 | [diff] [blame] | 164 | bit hasREX_WPrefix  = 0;  // Does this inst require the REX.W prefix? | 
| Jakob Stoklund Olesen | f8d7eda | 2010-03-25 18:52:01 +0000 | [diff] [blame] | 165 | FPFormat FPForm = NotFP;  // What flavor of FP instruction is this? | 
| Dan Gohman | a21bdda | 2008-08-20 13:46:21 +0000 | [diff] [blame] | 166 | bit hasLockPrefix = 0;    // Does this inst have a 0xF0 prefix? | 
| Anton Korobeynikov | 2589777 | 2008-10-11 19:09:15 +0000 | [diff] [blame] | 167 | bits<2> SegOvrBits = 0;   // Segment override prefix. | 
| Jakob Stoklund Olesen | f8d7eda | 2010-03-25 18:52:01 +0000 | [diff] [blame] | 168 | Domain ExeDomain = d; | 
| Eric Christopher | 3a8ae23 | 2010-11-30 09:11:54 +0000 | [diff] [blame] | 169 | bit hasVEXPrefix = 0;     // Does this inst require a VEX prefix? | 
| Bruno Cardoso Lopes | 0516674 | 2010-07-01 01:20:06 +0000 | [diff] [blame] | 170 | bit hasVEX_WPrefix = 0;   // Does this inst set the VEX_W field? | 
| Eric Christopher | 3a8ae23 | 2010-11-30 09:11:54 +0000 | [diff] [blame] | 171 | bit hasVEX_4VPrefix = 0;  // Does this inst require the VEX.VVVV field? | 
| Craig Topper | aea148c | 2011-10-16 07:55:05 +0000 | [diff] [blame] | 172 | bit hasVEX_4VOp3Prefix = 0;  // Does this inst require the VEX.VVVV field to | 
|  | 173 | // encode the third operand? | 
| Eric Christopher | 3a8ae23 | 2010-11-30 09:11:54 +0000 | [diff] [blame] | 174 | bit hasVEX_i8ImmReg = 0;  // Does this inst require the last source register | 
| Bruno Cardoso Lopes | e2bd058 | 2010-07-06 22:36:24 +0000 | [diff] [blame] | 175 | // to be encoded in a immediate field? | 
| Eric Christopher | 3a8ae23 | 2010-11-30 09:11:54 +0000 | [diff] [blame] | 176 | bit hasVEX_L = 0;         // Does this inst use large (256-bit) registers? | 
| Craig Topper | f18c896 | 2011-10-04 06:30:42 +0000 | [diff] [blame] | 177 | bit ignoresVEX_L = 0;     // Does this instruction ignore the L-bit | 
| Chris Lattner | 45270db | 2010-10-03 18:08:05 +0000 | [diff] [blame] | 178 | bit has3DNow0F0FOpcode =0;// Wacky 3dNow! encoding? | 
| Craig Topper | cd93de9 | 2011-12-30 04:48:54 +0000 | [diff] [blame] | 179 | bit hasMemOp4Prefix = 0;  // Same bit as VEX_W, but used for swapping operands | 
| Jan Sjödin | 6dd2488 | 2011-12-12 19:12:26 +0000 | [diff] [blame] | 180 | bit hasXOP_Prefix = 0;    // Does this inst require an XOP prefix? | 
| Jakob Stoklund Olesen | b93331f | 2010-04-05 03:10:20 +0000 | [diff] [blame] | 181 |  | 
|  | 182 | // TSFlags layout should be kept in sync with X86InstrInfo.h. | 
|  | 183 | let TSFlags{5-0}   = FormBits; | 
|  | 184 | let TSFlags{6}     = hasOpSizePrefix; | 
|  | 185 | let TSFlags{7}     = hasAdSizePrefix; | 
| Joerg Sonnenberger | cc53d99 | 2011-04-04 15:58:30 +0000 | [diff] [blame] | 186 | let TSFlags{12-8}  = Prefix; | 
|  | 187 | let TSFlags{13}    = hasREX_WPrefix; | 
|  | 188 | let TSFlags{16-14} = ImmT.Value; | 
|  | 189 | let TSFlags{19-17} = FPForm.Value; | 
|  | 190 | let TSFlags{20}    = hasLockPrefix; | 
|  | 191 | let TSFlags{22-21} = SegOvrBits; | 
|  | 192 | let TSFlags{24-23} = ExeDomain.Value; | 
|  | 193 | let TSFlags{32-25} = Opcode; | 
|  | 194 | let TSFlags{33}    = hasVEXPrefix; | 
|  | 195 | let TSFlags{34}    = hasVEX_WPrefix; | 
|  | 196 | let TSFlags{35}    = hasVEX_4VPrefix; | 
| Craig Topper | aea148c | 2011-10-16 07:55:05 +0000 | [diff] [blame] | 197 | let TSFlags{36}    = hasVEX_4VOp3Prefix; | 
|  | 198 | let TSFlags{37}    = hasVEX_i8ImmReg; | 
|  | 199 | let TSFlags{38}    = hasVEX_L; | 
|  | 200 | let TSFlags{39}    = ignoresVEX_L; | 
|  | 201 | let TSFlags{40}    = has3DNow0F0FOpcode; | 
| Craig Topper | cd93de9 | 2011-12-30 04:48:54 +0000 | [diff] [blame] | 202 | let TSFlags{41}    = hasMemOp4Prefix; | 
| Jan Sjödin | 6dd2488 | 2011-12-12 19:12:26 +0000 | [diff] [blame] | 203 | let TSFlags{42}    = hasXOP_Prefix; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 204 | } | 
|  | 205 |  | 
| Eric Christopher | ef62f57 | 2010-11-30 08:57:23 +0000 | [diff] [blame] | 206 | class PseudoI<dag oops, dag iops, list<dag> pattern> | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 207 | : X86Inst<0, Pseudo, NoImm, oops, iops, "", NoItinerary> { | 
| Eric Christopher | ef62f57 | 2010-11-30 08:57:23 +0000 | [diff] [blame] | 208 | let Pattern = pattern; | 
|  | 209 | } | 
|  | 210 |  | 
| Jakob Stoklund Olesen | 49e121d | 2010-03-25 17:25:00 +0000 | [diff] [blame] | 211 | class I<bits<8> o, Format f, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 212 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT, | 
|  | 213 | Domain d = GenericDomain> | 
|  | 214 | : X86Inst<o, f, NoImm, outs, ins, asm, itin, d> { | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 215 | let Pattern = pattern; | 
|  | 216 | let CodeSize = 3; | 
|  | 217 | } | 
| Sean Callanan | 04d8cb7 | 2009-12-18 00:01:26 +0000 | [diff] [blame] | 218 | class Ii8 <bits<8> o, Format f, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 219 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT, | 
|  | 220 | Domain d = GenericDomain> | 
|  | 221 | : X86Inst<o, f, Imm8, outs, ins, asm, itin, d> { | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 222 | let Pattern = pattern; | 
|  | 223 | let CodeSize = 3; | 
|  | 224 | } | 
| Chris Lattner | 12455ca | 2010-02-12 22:27:07 +0000 | [diff] [blame] | 225 | class Ii8PCRel<bits<8> o, Format f, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 226 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 227 | : X86Inst<o, f, Imm8PCRel, outs, ins, asm, itin> { | 
| Chris Lattner | 12455ca | 2010-02-12 22:27:07 +0000 | [diff] [blame] | 228 | let Pattern = pattern; | 
|  | 229 | let CodeSize = 3; | 
|  | 230 | } | 
| Sean Callanan | 04d8cb7 | 2009-12-18 00:01:26 +0000 | [diff] [blame] | 231 | class Ii16<bits<8> o, Format f, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 232 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 233 | : X86Inst<o, f, Imm16, outs, ins, asm, itin> { | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 234 | let Pattern = pattern; | 
|  | 235 | let CodeSize = 3; | 
|  | 236 | } | 
| Sean Callanan | 04d8cb7 | 2009-12-18 00:01:26 +0000 | [diff] [blame] | 237 | class Ii32<bits<8> o, Format f, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 238 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 239 | : X86Inst<o, f, Imm32, outs, ins, asm, itin> { | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 240 | let Pattern = pattern; | 
|  | 241 | let CodeSize = 3; | 
|  | 242 | } | 
|  | 243 |  | 
| Chris Lattner | ac58812 | 2010-07-07 22:27:31 +0000 | [diff] [blame] | 244 | class Ii16PCRel<bits<8> o, Format f, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 245 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 246 | : X86Inst<o, f, Imm16PCRel, outs, ins, asm, itin> { | 
| Chris Lattner | ac58812 | 2010-07-07 22:27:31 +0000 | [diff] [blame] | 247 | let Pattern = pattern; | 
|  | 248 | let CodeSize = 3; | 
|  | 249 | } | 
|  | 250 |  | 
| Chris Lattner | 12455ca | 2010-02-12 22:27:07 +0000 | [diff] [blame] | 251 | class Ii32PCRel<bits<8> o, Format f, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 252 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 253 | : X86Inst<o, f, Imm32PCRel, outs, ins, asm, itin> { | 
| Chris Lattner | 12455ca | 2010-02-12 22:27:07 +0000 | [diff] [blame] | 254 | let Pattern = pattern; | 
|  | 255 | let CodeSize = 3; | 
|  | 256 | } | 
|  | 257 |  | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 258 | // FPStack Instruction Templates: | 
|  | 259 | // FPI - Floating Point Instruction template. | 
| Preston Gurd | fa3f6cb | 2012-05-02 16:03:35 +0000 | [diff] [blame] | 260 | class FPI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 261 | InstrItinClass itin = IIC_DEFAULT> | 
|  | 262 | : I<o, F, outs, ins, asm, [], itin> {} | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 263 |  | 
| Bob Wilson | a967c42 | 2010-08-26 18:08:11 +0000 | [diff] [blame] | 264 | // FpI_ - Floating Point Pseudo Instruction template. Not Predicated. | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 265 | class FpI_<dag outs, dag ins, FPFormat fp, list<dag> pattern, | 
|  | 266 | InstrItinClass itin = IIC_DEFAULT> | 
|  | 267 | : X86Inst<0, Pseudo, NoImm, outs, ins, "", itin> { | 
| Jakob Stoklund Olesen | f8d7eda | 2010-03-25 18:52:01 +0000 | [diff] [blame] | 268 | let FPForm = fp; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 269 | let Pattern = pattern; | 
|  | 270 | } | 
|  | 271 |  | 
| Sean Callanan | 050e0cd | 2009-09-15 00:35:17 +0000 | [diff] [blame] | 272 | // Templates for instructions that use a 16- or 32-bit segmented address as | 
|  | 273 | //  their only operand: lcall (FAR CALL) and ljmp (FAR JMP) | 
|  | 274 | // | 
|  | 275 | //   Iseg16 - 16-bit segment selector, 16-bit offset | 
|  | 276 | //   Iseg32 - 16-bit segment selector, 32-bit offset | 
|  | 277 |  | 
|  | 278 | class Iseg16 <bits<8> o, Format f, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 279 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 280 | : X86Inst<o, f, Imm16, outs, ins, asm, itin> { | 
| Sean Callanan | 050e0cd | 2009-09-15 00:35:17 +0000 | [diff] [blame] | 281 | let Pattern = pattern; | 
|  | 282 | let CodeSize = 3; | 
|  | 283 | } | 
|  | 284 |  | 
|  | 285 | class Iseg32 <bits<8> o, Format f, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 286 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 287 | : X86Inst<o, f, Imm32, outs, ins, asm, itin> { | 
| Sean Callanan | 050e0cd | 2009-09-15 00:35:17 +0000 | [diff] [blame] | 288 | let Pattern = pattern; | 
|  | 289 | let CodeSize = 3; | 
|  | 290 | } | 
|  | 291 |  | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 292 | def __xs : XS; | 
|  | 293 |  | 
| Bruno Cardoso Lopes | 6b98f71 | 2010-06-17 23:05:30 +0000 | [diff] [blame] | 294 | // SI - SSE 1 & 2 scalar instructions | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 295 | class SI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 296 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 297 | : I<o, F, outs, ins, asm, pattern, itin> { | 
| Bruno Cardoso Lopes | 77a3c44 | 2010-07-13 00:38:47 +0000 | [diff] [blame] | 298 | let Predicates = !if(hasVEXPrefix /* VEX */, [HasAVX], | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 299 | !if(!eq(Prefix, __xs.Prefix), [UseSSE1], [UseSSE2])); | 
| Bruno Cardoso Lopes | 6b98f71 | 2010-06-17 23:05:30 +0000 | [diff] [blame] | 300 |  | 
|  | 301 | // AVX instructions have a 'v' prefix in the mnemonic | 
| Bruno Cardoso Lopes | 1a890f9 | 2010-06-22 22:38:56 +0000 | [diff] [blame] | 302 | let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm); | 
| Bruno Cardoso Lopes | 6b98f71 | 2010-06-17 23:05:30 +0000 | [diff] [blame] | 303 | } | 
|  | 304 |  | 
| Bruno Cardoso Lopes | 191a1cd | 2010-06-24 00:32:06 +0000 | [diff] [blame] | 305 | // SIi8 - SSE 1 & 2 scalar instructions | 
|  | 306 | class SIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 307 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 308 | : Ii8<o, F, outs, ins, asm, pattern, itin> { | 
| Bruno Cardoso Lopes | 77a3c44 | 2010-07-13 00:38:47 +0000 | [diff] [blame] | 309 | let Predicates = !if(hasVEXPrefix /* VEX */, [HasAVX], | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 310 | !if(!eq(Prefix, __xs.Prefix), [UseSSE1], [UseSSE2])); | 
| Bruno Cardoso Lopes | 191a1cd | 2010-06-24 00:32:06 +0000 | [diff] [blame] | 311 |  | 
|  | 312 | // AVX instructions have a 'v' prefix in the mnemonic | 
|  | 313 | let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm); | 
|  | 314 | } | 
|  | 315 |  | 
| Bruno Cardoso Lopes | 2bfad41 | 2010-06-18 23:13:35 +0000 | [diff] [blame] | 316 | // PI - SSE 1 & 2 packed instructions | 
|  | 317 | class PI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 318 | InstrItinClass itin, Domain d> | 
|  | 319 | : I<o, F, outs, ins, asm, pattern, itin, d> { | 
| Bruno Cardoso Lopes | 77a3c44 | 2010-07-13 00:38:47 +0000 | [diff] [blame] | 320 | let Predicates = !if(hasVEXPrefix /* VEX */, [HasAVX], | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 321 | !if(hasOpSizePrefix /* OpSize */, [UseSSE2], [UseSSE1])); | 
| Bruno Cardoso Lopes | 2bfad41 | 2010-06-18 23:13:35 +0000 | [diff] [blame] | 322 |  | 
|  | 323 | // AVX instructions have a 'v' prefix in the mnemonic | 
| Bruno Cardoso Lopes | 1a890f9 | 2010-06-22 22:38:56 +0000 | [diff] [blame] | 324 | let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm); | 
| Bruno Cardoso Lopes | 2bfad41 | 2010-06-18 23:13:35 +0000 | [diff] [blame] | 325 | } | 
|  | 326 |  | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 327 | // MMXPI - SSE 1 & 2 packed instructions with MMX operands | 
|  | 328 | class MMXPI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern, | 
|  | 329 | InstrItinClass itin, Domain d> | 
|  | 330 | : I<o, F, outs, ins, asm, pattern, itin, d> { | 
|  | 331 | let Predicates = !if(hasOpSizePrefix /* OpSize */, [HasSSE2], [HasSSE1]); | 
|  | 332 | } | 
|  | 333 |  | 
| Bruno Cardoso Lopes | 1e13c17 | 2010-06-22 23:37:59 +0000 | [diff] [blame] | 334 | // PIi8 - SSE 1 & 2 packed instructions with immediate | 
|  | 335 | class PIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 336 | list<dag> pattern, InstrItinClass itin, Domain d> | 
|  | 337 | : Ii8<o, F, outs, ins, asm, pattern, itin, d> { | 
| Bruno Cardoso Lopes | 77a3c44 | 2010-07-13 00:38:47 +0000 | [diff] [blame] | 338 | let Predicates = !if(hasVEX_4VPrefix /* VEX */, [HasAVX], | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 339 | !if(hasOpSizePrefix /* OpSize */, [UseSSE2], [UseSSE1])); | 
| Bruno Cardoso Lopes | 1e13c17 | 2010-06-22 23:37:59 +0000 | [diff] [blame] | 340 |  | 
|  | 341 | // AVX instructions have a 'v' prefix in the mnemonic | 
|  | 342 | let AsmString = !if(hasVEX_4VPrefix, !strconcat("v", asm), asm); | 
|  | 343 | } | 
|  | 344 |  | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 345 | // SSE1 Instruction Templates: | 
|  | 346 | // | 
|  | 347 | //   SSI   - SSE1 instructions with XS prefix. | 
|  | 348 | //   PSI   - SSE1 instructions with TB prefix. | 
|  | 349 | //   PSIi8 - SSE1 instructions with ImmT == Imm8 and TB prefix. | 
| Bruno Cardoso Lopes | c2f87b7 | 2010-06-08 22:51:23 +0000 | [diff] [blame] | 350 | //   VSSI  - SSE1 instructions with XS prefix in AVX form. | 
| Bruno Cardoso Lopes | b06f54b | 2010-06-12 01:23:26 +0000 | [diff] [blame] | 351 | //   VPSI  - SSE1 instructions with TB prefix in AVX form. | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 352 |  | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 353 | class SSI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 354 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 355 | : I<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[UseSSE1]>; | 
| Jakob Stoklund Olesen | 49e121d | 2010-03-25 17:25:00 +0000 | [diff] [blame] | 356 | class SSIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 357 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 358 | : Ii8<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[UseSSE1]>; | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 359 | class PSI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 360 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 361 | : I<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, TB, | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 362 | Requires<[UseSSE1]>; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 363 | class PSIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 364 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 365 | : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, TB, | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 366 | Requires<[UseSSE1]>; | 
| Bruno Cardoso Lopes | c2f87b7 | 2010-06-08 22:51:23 +0000 | [diff] [blame] | 367 | class VSSI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 368 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 369 | : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, XS, | 
| Bruno Cardoso Lopes | 77a3c44 | 2010-07-13 00:38:47 +0000 | [diff] [blame] | 370 | Requires<[HasAVX]>; | 
| Bruno Cardoso Lopes | b06f54b | 2010-06-12 01:23:26 +0000 | [diff] [blame] | 371 | class VPSI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 372 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 373 | : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin, SSEPackedSingle>, TB, | 
| Bruno Cardoso Lopes | 77a3c44 | 2010-07-13 00:38:47 +0000 | [diff] [blame] | 374 | Requires<[HasAVX]>; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 375 |  | 
|  | 376 | // SSE2 Instruction Templates: | 
|  | 377 | // | 
| Bill Wendling | 76105a4 | 2008-08-27 21:32:04 +0000 | [diff] [blame] | 378 | //   SDI    - SSE2 instructions with XD prefix. | 
|  | 379 | //   SDIi8  - SSE2 instructions with ImmT == Imm8 and XD prefix. | 
| Craig Topper | f881d38 | 2012-07-30 02:14:02 +0000 | [diff] [blame] | 380 | //   S2SI   - SSE2 instructions with XS prefix. | 
| Bill Wendling | 76105a4 | 2008-08-27 21:32:04 +0000 | [diff] [blame] | 381 | //   SSDIi8 - SSE2 instructions with ImmT == Imm8 and XS prefix. | 
|  | 382 | //   PDI    - SSE2 instructions with TB and OpSize prefixes. | 
|  | 383 | //   PDIi8  - SSE2 instructions with ImmT == Imm8 and TB and OpSize prefixes. | 
| Bruno Cardoso Lopes | c2f87b7 | 2010-06-08 22:51:23 +0000 | [diff] [blame] | 384 | //   VSDI   - SSE2 instructions with XD prefix in AVX form. | 
| Bruno Cardoso Lopes | b06f54b | 2010-06-12 01:23:26 +0000 | [diff] [blame] | 385 | //   VPDI   - SSE2 instructions with TB and OpSize prefixes in AVX form. | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 386 | //   MMXSDIi8  - SSE2 instructions with ImmT == Imm8 and XD prefix as well as | 
|  | 387 | //               MMX operands. | 
|  | 388 | //   MMXSSDIi8 - SSE2 instructions with ImmT == Imm8 and XS prefix as well as | 
|  | 389 | //               MMX operands. | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 390 |  | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 391 | class SDI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 392 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 393 | : I<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[UseSSE2]>; | 
| Evan Cheng | 01c7c19 | 2007-12-20 19:57:09 +0000 | [diff] [blame] | 394 | class SDIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 395 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 396 | : Ii8<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[UseSSE2]>; | 
| Craig Topper | f881d38 | 2012-07-30 02:14:02 +0000 | [diff] [blame] | 397 | class S2SI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 398 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 399 | : I<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[UseSSE2]>; | 
| Craig Topper | f881d38 | 2012-07-30 02:14:02 +0000 | [diff] [blame] | 400 | class S2SIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Preston Gurd | 09de6ae | 2012-05-11 14:27:12 +0000 | [diff] [blame] | 401 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 402 | : Ii8<o, F, outs, ins, asm, pattern>, XS, Requires<[UseSSE2]>; | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 403 | class PDI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 404 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 405 | : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, TB, OpSize, | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 406 | Requires<[UseSSE2]>; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 407 | class PDIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 408 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 409 | : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, TB, OpSize, | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 410 | Requires<[UseSSE2]>; | 
| Bruno Cardoso Lopes | c2f87b7 | 2010-06-08 22:51:23 +0000 | [diff] [blame] | 411 | class VSDI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 412 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 413 | : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, XD, | 
| Bruno Cardoso Lopes | 77a3c44 | 2010-07-13 00:38:47 +0000 | [diff] [blame] | 414 | Requires<[HasAVX]>; | 
| Craig Topper | f881d38 | 2012-07-30 02:14:02 +0000 | [diff] [blame] | 415 | class VS2SI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 416 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 417 | : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin>, XS, | 
|  | 418 | Requires<[HasAVX]>; | 
| Bruno Cardoso Lopes | b06f54b | 2010-06-12 01:23:26 +0000 | [diff] [blame] | 419 | class VPDI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 420 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 421 | : I<o, F, outs, ins, !strconcat("v", asm), pattern, itin, SSEPackedDouble>, TB, | 
| Bruno Cardoso Lopes | 77a3c44 | 2010-07-13 00:38:47 +0000 | [diff] [blame] | 422 | OpSize, Requires<[HasAVX]>; | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 423 | class MMXSDIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 424 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 425 | : Ii8<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[HasSSE2]>; | 
|  | 426 | class MMXS2SIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 427 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 428 | : Ii8<o, F, outs, ins, asm, pattern>, XS, Requires<[HasSSE2]>; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 429 |  | 
|  | 430 | // SSE3 Instruction Templates: | 
|  | 431 | // | 
|  | 432 | //   S3I   - SSE3 instructions with TB and OpSize prefixes. | 
|  | 433 | //   S3SI  - SSE3 instructions with XS prefix. | 
|  | 434 | //   S3DI  - SSE3 instructions with XD prefix. | 
|  | 435 |  | 
| Sean Callanan | 04d8cb7 | 2009-12-18 00:01:26 +0000 | [diff] [blame] | 436 | class S3SI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 437 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 438 | : I<o, F, outs, ins, asm, pattern, itin, SSEPackedSingle>, XS, | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 439 | Requires<[UseSSE3]>; | 
| Sean Callanan | 04d8cb7 | 2009-12-18 00:01:26 +0000 | [diff] [blame] | 440 | class S3DI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 441 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 442 | : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, XD, | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 443 | Requires<[UseSSE3]>; | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 444 | class S3I<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 445 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 446 | : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, TB, OpSize, | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 447 | Requires<[UseSSE3]>; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 448 |  | 
|  | 449 |  | 
| Nate Begeman | 8ef5021 | 2008-02-12 22:51:28 +0000 | [diff] [blame] | 450 | // SSSE3 Instruction Templates: | 
|  | 451 | // | 
|  | 452 | //   SS38I - SSSE3 instructions with T8 prefix. | 
|  | 453 | //   SS3AI - SSSE3 instructions with TA prefix. | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 454 | //   MMXSS38I - SSSE3 instructions with T8 prefix and MMX operands. | 
|  | 455 | //   MMXSS3AI - SSSE3 instructions with TA prefix and MMX operands. | 
| Nate Begeman | 8ef5021 | 2008-02-12 22:51:28 +0000 | [diff] [blame] | 456 | // | 
|  | 457 | // Note: SSSE3 instructions have 64-bit and 128-bit versions. The 64-bit version | 
| Craig Topper | 744f631 | 2012-01-09 00:11:29 +0000 | [diff] [blame] | 458 | // uses the MMX registers. The 64-bit versions are grouped with the MMX | 
|  | 459 | // classes. They need to be enabled even if AVX is enabled. | 
| Nate Begeman | 8ef5021 | 2008-02-12 22:51:28 +0000 | [diff] [blame] | 460 |  | 
|  | 461 | class SS38I<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 462 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 463 | : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8, | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 464 | Requires<[UseSSSE3]>; | 
| Nate Begeman | 8ef5021 | 2008-02-12 22:51:28 +0000 | [diff] [blame] | 465 | class SS3AI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 466 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 467 | : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA, | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 468 | Requires<[UseSSSE3]>; | 
|  | 469 | class MMXSS38I<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 470 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 471 | : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8, | 
|  | 472 | Requires<[HasSSSE3]>; | 
|  | 473 | class MMXSS3AI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 474 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 475 | : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA, | 
| Jakob Stoklund Olesen | 49e121d | 2010-03-25 17:25:00 +0000 | [diff] [blame] | 476 | Requires<[HasSSSE3]>; | 
| Nate Begeman | 8ef5021 | 2008-02-12 22:51:28 +0000 | [diff] [blame] | 477 |  | 
|  | 478 | // SSE4.1 Instruction Templates: | 
|  | 479 | // | 
|  | 480 | //   SS48I - SSE 4.1 instructions with T8 prefix. | 
| Evan Cheng | 96bdbd6 | 2008-03-14 07:39:27 +0000 | [diff] [blame] | 481 | //   SS41AIi8 - SSE 4.1 instructions with TA prefix and ImmT == Imm8. | 
| Nate Begeman | 8ef5021 | 2008-02-12 22:51:28 +0000 | [diff] [blame] | 482 | // | 
|  | 483 | class SS48I<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 484 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 485 | : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8, | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 486 | Requires<[UseSSE41]>; | 
| Evan Cheng | 96bdbd6 | 2008-03-14 07:39:27 +0000 | [diff] [blame] | 487 | class SS4AIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 488 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 489 | : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA, | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 490 | Requires<[UseSSE41]>; | 
| Nate Begeman | 8ef5021 | 2008-02-12 22:51:28 +0000 | [diff] [blame] | 491 |  | 
| Nate Begeman | 55b7bec | 2008-07-17 16:51:19 +0000 | [diff] [blame] | 492 | // SSE4.2 Instruction Templates: | 
|  | 493 | // | 
|  | 494 | //   SS428I - SSE 4.2 instructions with T8 prefix. | 
|  | 495 | class SS428I<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 496 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 497 | : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8, | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 498 | Requires<[UseSSE42]>; | 
| Nate Begeman | 8ef5021 | 2008-02-12 22:51:28 +0000 | [diff] [blame] | 499 |  | 
| Craig Topper | 96fa597 | 2011-10-16 16:50:08 +0000 | [diff] [blame] | 500 | //   SS42FI - SSE 4.2 instructions with T8XD prefix. | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 501 | // NOTE: 'HasSSE42' is used as SS42FI is only used for CRC32 insns. | 
| Eric Christopher | 7dfa9f2 | 2009-08-08 21:55:08 +0000 | [diff] [blame] | 502 | class SS42FI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 503 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 504 | : I<o, F, outs, ins, asm, pattern, itin>, T8XD, Requires<[HasSSE42]>; | 
| Craig Topper | b910984 | 2012-01-01 19:51:58 +0000 | [diff] [blame] | 505 |  | 
| Eric Christopher | 9fe912d | 2009-08-18 22:50:32 +0000 | [diff] [blame] | 506 | //   SS42AI = SSE 4.2 instructions with TA prefix | 
|  | 507 | class SS42AI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 508 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 509 | : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA, | 
| Michael Liao | bbd1079 | 2012-08-30 16:54:46 +0000 | [diff] [blame] | 510 | Requires<[UseSSE42]>; | 
| Eric Christopher | 9fe912d | 2009-08-18 22:50:32 +0000 | [diff] [blame] | 511 |  | 
| Bruno Cardoso Lopes | 14c5fd4 | 2010-07-20 00:11:13 +0000 | [diff] [blame] | 512 | // AVX Instruction Templates: | 
|  | 513 | //   Instructions introduced in AVX (no SSE equivalent forms) | 
|  | 514 | // | 
|  | 515 | //   AVX8I - AVX instructions with T8 and OpSize prefix. | 
| Bruno Cardoso Lopes | 3b50584 | 2010-07-20 19:44:51 +0000 | [diff] [blame] | 516 | //   AVXAIi8 - AVX instructions with TA, OpSize prefix and ImmT = Imm8. | 
| Bruno Cardoso Lopes | 14c5fd4 | 2010-07-20 00:11:13 +0000 | [diff] [blame] | 517 | class AVX8I<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 518 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 519 | : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8, OpSize, | 
| Bruno Cardoso Lopes | 14c5fd4 | 2010-07-20 00:11:13 +0000 | [diff] [blame] | 520 | Requires<[HasAVX]>; | 
| Bruno Cardoso Lopes | 3b50584 | 2010-07-20 19:44:51 +0000 | [diff] [blame] | 521 | class AVXAIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 522 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 523 | : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA, OpSize, | 
| Bruno Cardoso Lopes | 3b50584 | 2010-07-20 19:44:51 +0000 | [diff] [blame] | 524 | Requires<[HasAVX]>; | 
| Bruno Cardoso Lopes | 14c5fd4 | 2010-07-20 00:11:13 +0000 | [diff] [blame] | 525 |  | 
| Craig Topper | 05d1cb9 | 2011-11-06 06:12:20 +0000 | [diff] [blame] | 526 | // AVX2 Instruction Templates: | 
|  | 527 | //   Instructions introduced in AVX2 (no SSE equivalent forms) | 
|  | 528 | // | 
|  | 529 | //   AVX28I - AVX2 instructions with T8 and OpSize prefix. | 
|  | 530 | //   AVX2AIi8 - AVX2 instructions with TA, OpSize prefix and ImmT = Imm8. | 
|  | 531 | class AVX28I<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 532 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 533 | : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8, OpSize, | 
| Craig Topper | 05d1cb9 | 2011-11-06 06:12:20 +0000 | [diff] [blame] | 534 | Requires<[HasAVX2]>; | 
| Craig Topper | f01f1b5 | 2011-11-06 23:04:08 +0000 | [diff] [blame] | 535 | class AVX2AIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 536 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 537 | : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA, OpSize, | 
| Craig Topper | 05d1cb9 | 2011-11-06 06:12:20 +0000 | [diff] [blame] | 538 | Requires<[HasAVX2]>; | 
|  | 539 |  | 
| Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 540 | // AES Instruction Templates: | 
|  | 541 | // | 
|  | 542 | // AES8I | 
| Eric Christopher | 1290fa0 | 2010-04-05 21:14:32 +0000 | [diff] [blame] | 543 | // These use the same encoding as the SSE4.2 T8 and TA encodings. | 
| Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 544 | class AES8I<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 545 | list<dag>pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 546 | : I<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, T8, | 
| Craig Topper | c0cef32 | 2012-05-01 05:35:02 +0000 | [diff] [blame] | 547 | Requires<[HasAES]>; | 
| Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 548 |  | 
|  | 549 | class AESAI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 550 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 551 | : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA, | 
| Craig Topper | c0cef32 | 2012-05-01 05:35:02 +0000 | [diff] [blame] | 552 | Requires<[HasAES]>; | 
| Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 553 |  | 
| Benjamin Kramer | a0396e4 | 2012-05-31 14:34:17 +0000 | [diff] [blame] | 554 | // PCLMUL Instruction Templates | 
|  | 555 | class PCLMULIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 556 | list<dag>pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 557 | : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA, | 
| Benjamin Kramer | a0396e4 | 2012-05-31 14:34:17 +0000 | [diff] [blame] | 558 | OpSize, Requires<[HasPCLMUL]>; | 
| Eli Friedman | 415412e | 2011-07-05 18:21:20 +0000 | [diff] [blame] | 559 |  | 
| Benjamin Kramer | a0396e4 | 2012-05-31 14:34:17 +0000 | [diff] [blame] | 560 | class AVXPCLMULIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 561 | list<dag>pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 562 | : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA, | 
| Benjamin Kramer | a0396e4 | 2012-05-31 14:34:17 +0000 | [diff] [blame] | 563 | OpSize, VEX_4V, Requires<[HasAVX, HasPCLMUL]>; | 
| Bruno Cardoso Lopes | ea0e05a | 2010-07-23 18:41:12 +0000 | [diff] [blame] | 564 |  | 
| Bruno Cardoso Lopes | acd9230 | 2010-07-23 00:54:35 +0000 | [diff] [blame] | 565 | // FMA3 Instruction Templates | 
|  | 566 | class FMA3<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 567 | list<dag>pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 568 | : I<o, F, outs, ins, asm, pattern, itin>, T8, | 
| Craig Topper | 79dbb0c | 2012-06-03 18:58:46 +0000 | [diff] [blame] | 569 | OpSize, VEX_4V, Requires<[HasFMA]>; | 
| Bruno Cardoso Lopes | acd9230 | 2010-07-23 00:54:35 +0000 | [diff] [blame] | 570 |  | 
| Bruno Cardoso Lopes | 0f9a1f5 | 2011-11-25 19:33:42 +0000 | [diff] [blame] | 571 | // FMA4 Instruction Templates | 
|  | 572 | class FMA4<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 573 | list<dag>pattern, InstrItinClass itin = IIC_DEFAULT> | 
| Benjamin Kramer | fee7d21 | 2013-01-22 18:05:59 +0000 | [diff] [blame] | 574 | : Ii8<o, F, outs, ins, asm, pattern, itin>, TA, | 
| Bruno Cardoso Lopes | 0f9a1f5 | 2011-11-25 19:33:42 +0000 | [diff] [blame] | 575 | OpSize, VEX_4V, VEX_I8IMM, Requires<[HasFMA4]>; | 
|  | 576 |  | 
| Jan Sjödin | 7c0face | 2011-12-12 19:37:49 +0000 | [diff] [blame] | 577 | // XOP 2, 3 and 4 Operand Instruction Template | 
|  | 578 | class IXOP<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 579 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 580 | : I<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, | 
| Jan Sjödin | 7c0face | 2011-12-12 19:37:49 +0000 | [diff] [blame] | 581 | XOP, XOP9, Requires<[HasXOP]>; | 
|  | 582 |  | 
|  | 583 | // XOP 2, 3 and 4 Operand Instruction Templates with imm byte | 
|  | 584 | class IXOPi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 585 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 586 | : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedDouble>, | 
| Jan Sjödin | 7c0face | 2011-12-12 19:37:49 +0000 | [diff] [blame] | 587 | XOP, XOP8, Requires<[HasXOP]>; | 
|  | 588 |  | 
|  | 589 | //  XOP 5 operand instruction (VEX encoding!) | 
|  | 590 | class IXOP5<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 591 | list<dag>pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 592 | : Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA, | 
| Jan Sjödin | 7c0face | 2011-12-12 19:37:49 +0000 | [diff] [blame] | 593 | OpSize, VEX_4V, VEX_I8IMM, Requires<[HasXOP]>; | 
|  | 594 |  | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 595 | // X86-64 Instruction templates... | 
|  | 596 | // | 
|  | 597 |  | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 598 | class RI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
|  | 599 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 600 | : I<o, F, outs, ins, asm, pattern, itin>, REX_W; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 601 | class RIi8 <bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 602 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 603 | : Ii8<o, F, outs, ins, asm, pattern, itin>, REX_W; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 604 | class RIi32 <bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 605 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 606 | : Ii32<o, F, outs, ins, asm, pattern, itin>, REX_W; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 607 |  | 
|  | 608 | class RIi64<bits<8> o, Format f, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 609 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 610 | : X86Inst<o, f, Imm64, outs, ins, asm, itin>, REX_W { | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 611 | let Pattern = pattern; | 
|  | 612 | let CodeSize = 3; | 
|  | 613 | } | 
|  | 614 |  | 
|  | 615 | class RSSI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 616 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 617 | : SSI<o, F, outs, ins, asm, pattern, itin>, REX_W; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 618 | class RSDI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 619 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 620 | : SDI<o, F, outs, ins, asm, pattern, itin>, REX_W; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 621 | class RPDI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 622 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 623 | : PDI<o, F, outs, ins, asm, pattern, itin>, REX_W; | 
| Bruno Cardoso Lopes | 123dff0 | 2011-07-25 23:05:25 +0000 | [diff] [blame] | 624 | class VRPDI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 625 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 626 | : VPDI<o, F, outs, ins, asm, pattern, itin>, VEX_W; | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 627 |  | 
|  | 628 | // MMX Instruction templates | 
|  | 629 | // | 
|  | 630 |  | 
|  | 631 | // MMXI   - MMX instructions with TB prefix. | 
| Anton Korobeynikov | 3109951 | 2008-08-23 15:53:19 +0000 | [diff] [blame] | 632 | // MMXI64 - MMX instructions with TB prefix valid only in 64 bit mode. | 
| Evan Cheng | 12c6be8 | 2007-07-31 08:04:03 +0000 | [diff] [blame] | 633 | // MMX2I  - MMX / SSE2 instructions with TB and OpSize prefixes. | 
|  | 634 | // MMXIi8 - MMX instructions with ImmT == Imm8 and TB prefix. | 
|  | 635 | // MMXIi8 - MMX instructions with ImmT == Imm8 and TB prefix. | 
|  | 636 | // MMXID  - MMX instructions with XD prefix. | 
|  | 637 | // MMXIS  - MMX instructions with XS prefix. | 
| Sean Callanan | 04d8cb7 | 2009-12-18 00:01:26 +0000 | [diff] [blame] | 638 | class MMXI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 639 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 640 | : I<o, F, outs, ins, asm, pattern, itin>, TB, Requires<[HasMMX]>; | 
| Sean Callanan | 04d8cb7 | 2009-12-18 00:01:26 +0000 | [diff] [blame] | 641 | class MMXI64<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 642 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 643 | : I<o, F, outs, ins, asm, pattern, itin>, TB, Requires<[HasMMX,In64BitMode]>; | 
| Sean Callanan | 04d8cb7 | 2009-12-18 00:01:26 +0000 | [diff] [blame] | 644 | class MMXRI<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 645 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 646 | : I<o, F, outs, ins, asm, pattern, itin>, TB, REX_W, Requires<[HasMMX]>; | 
| Sean Callanan | 04d8cb7 | 2009-12-18 00:01:26 +0000 | [diff] [blame] | 647 | class MMX2I<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 648 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 649 | : I<o, F, outs, ins, asm, pattern, itin>, TB, OpSize, Requires<[HasMMX]>; | 
| Sean Callanan | 04d8cb7 | 2009-12-18 00:01:26 +0000 | [diff] [blame] | 650 | class MMXIi8<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 651 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 652 | : Ii8<o, F, outs, ins, asm, pattern, itin>, TB, Requires<[HasMMX]>; | 
| Sean Callanan | 04d8cb7 | 2009-12-18 00:01:26 +0000 | [diff] [blame] | 653 | class MMXID<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 654 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 655 | : Ii8<o, F, outs, ins, asm, pattern, itin>, XD, Requires<[HasMMX]>; | 
| Sean Callanan | 04d8cb7 | 2009-12-18 00:01:26 +0000 | [diff] [blame] | 656 | class MMXIS<bits<8> o, Format F, dag outs, dag ins, string asm, | 
| Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 657 | list<dag> pattern, InstrItinClass itin = IIC_DEFAULT> | 
|  | 658 | : Ii8<o, F, outs, ins, asm, pattern, itin>, XS, Requires<[HasMMX]>; |