| Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- X86InstrSystem.td - System Instructions ------------*- tablegen -*-===// | 
|  | 2 | // | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 3 | //                     The LLVM Compiler Infrastructure | 
|  | 4 | // | 
|  | 5 | // This file is distributed under the University of Illinois Open Source | 
|  | 6 | // License. See LICENSE.TXT for details. | 
| Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 7 | // | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// | 
|  | 9 | // | 
|  | 10 | // This file describes the X86 instructions that are generally used in | 
|  | 11 | // privileged modes.  These are not typically used by the compiler, but are | 
|  | 12 | // supported for the assembler and disassembler. | 
|  | 13 | // | 
|  | 14 | //===----------------------------------------------------------------------===// | 
|  | 15 |  | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 16 | let SchedRW = [WriteSystem] in { | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 17 | let Defs = [RAX, RDX] in | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 18 | def RDTSC : I<0x31, RawFrm, (outs), (ins), "rdtsc", [(X86rdtsc)], IIC_RDTSC>, | 
|  | 19 | TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 20 |  | 
|  | 21 | let Defs = [RAX, RCX, RDX] in | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 22 | def RDTSCP : I<0x01, MRM_F9, (outs), (ins), "rdtscp", []>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 23 |  | 
|  | 24 | // CPU flow control instructions | 
|  | 25 |  | 
| Kevin Enderby | 5e7cb5f | 2010-10-27 20:46:49 +0000 | [diff] [blame] | 26 | let isTerminator = 1, isBarrier = 1, hasCtrlDep = 1 in { | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 27 | def TRAP    : I<0x0B, RawFrm, (outs), (ins), "ud2", [(trap)]>, TB; | 
| Kevin Enderby | 5e7cb5f | 2010-10-27 20:46:49 +0000 | [diff] [blame] | 28 | def UD2B    : I<0xB9, RawFrm, (outs), (ins), "ud2b", []>, TB; | 
|  | 29 | } | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 30 |  | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 31 | def HLT : I<0xF4, RawFrm, (outs), (ins), "hlt", [], IIC_HLT>; | 
|  | 32 | def RSM : I<0xAA, RawFrm, (outs), (ins), "rsm", [], IIC_RSM>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 33 |  | 
|  | 34 | // Interrupt and SysCall Instructions. | 
|  | 35 | let Uses = [EFLAGS] in | 
|  | 36 | def INTO : I<0xce, RawFrm, (outs), (ins), "into", []>; | 
|  | 37 | def INT3 : I<0xcc, RawFrm, (outs), (ins), "int3", | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 38 | [(int_x86_int (i8 3))], IIC_INT3>; | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 39 | } // SchedRW | 
| Chris Lattner | fc4fe00 | 2011-04-09 19:41:05 +0000 | [diff] [blame] | 40 |  | 
| Dan Gohman | 164fe18 | 2012-05-14 18:58:10 +0000 | [diff] [blame] | 41 | def : Pat<(debugtrap), | 
| Dan Gohman | dfab443 | 2012-05-11 00:19:32 +0000 | [diff] [blame] | 42 | (INT3)>; | 
|  | 43 |  | 
| Chris Lattner | fc4fe00 | 2011-04-09 19:41:05 +0000 | [diff] [blame] | 44 | // The long form of "int $3" turns into int3 as a size optimization. | 
|  | 45 | // FIXME: This doesn't work because InstAlias can't match immediate constants. | 
|  | 46 | //def : InstAlias<"int\t$3", (INT3)>; | 
|  | 47 |  | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 48 | let SchedRW = [WriteSystem] in { | 
| Chris Lattner | fc4fe00 | 2011-04-09 19:41:05 +0000 | [diff] [blame] | 49 |  | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 50 | def INT : Ii8<0xcd, RawFrm, (outs), (ins i8imm:$trap), "int\t$trap", | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 51 | [(int_x86_int imm:$trap)], IIC_INT>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 52 |  | 
| Chris Lattner | fc4fe00 | 2011-04-09 19:41:05 +0000 | [diff] [blame] | 53 |  | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 54 | def SYSCALL  : I<0x05, RawFrm, (outs), (ins), "syscall", [], IIC_SYSCALL>, TB; | 
|  | 55 | def SYSRET   : I<0x07, RawFrm, (outs), (ins), "sysret{l}", [], IIC_SYSCALL>, TB; | 
|  | 56 | def SYSRET64 :RI<0x07, RawFrm, (outs), (ins), "sysret{q}", [], IIC_SYSCALL>, TB, | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 57 | Requires<[In64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 58 |  | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 59 | def SYSENTER : I<0x34, RawFrm, (outs), (ins), "sysenter", [], | 
|  | 60 | IIC_SYS_ENTER_EXIT>, TB; | 
|  | 61 |  | 
|  | 62 | def SYSEXIT   : I<0x35, RawFrm, (outs), (ins), "sysexit{l}", [], | 
|  | 63 | IIC_SYS_ENTER_EXIT>, TB; | 
| Bill Wendling | ebb10df | 2012-03-10 07:37:27 +0000 | [diff] [blame] | 64 | def SYSEXIT64 :RI<0x35, RawFrm, (outs), (ins), "sysexit{q}", []>, TB, | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 65 | Requires<[In64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 66 |  | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 67 | def IRET16 : I<0xcf, RawFrm, (outs), (ins), "iret{w}", [], IIC_IRET>, OpSize; | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 68 | def IRET32 : I<0xcf, RawFrm, (outs), (ins), "iret{l|d}", [], IIC_IRET>, | 
|  | 69 | OpSize16; | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 70 | def IRET64 : RI<0xcf, RawFrm, (outs), (ins), "iretq", [], IIC_IRET>, | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 71 | Requires<[In64BitMode]>; | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 72 | } // SchedRW | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 73 |  | 
|  | 74 |  | 
|  | 75 | //===----------------------------------------------------------------------===// | 
|  | 76 | //  Input/Output Instructions. | 
|  | 77 | // | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 78 | let SchedRW = [WriteSystem] in { | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 79 | let Defs = [AL], Uses = [DX] in | 
|  | 80 | def IN8rr  : I<0xEC, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 81 | "in{b}\t{%dx, %al|al, dx}", [], IIC_IN_RR>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 82 | let Defs = [AX], Uses = [DX] in | 
|  | 83 | def IN16rr : I<0xED, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 84 | "in{w}\t{%dx, %ax|ax, dx}", [], IIC_IN_RR>,  OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 85 | let Defs = [EAX], Uses = [DX] in | 
|  | 86 | def IN32rr : I<0xED, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 87 | "in{l}\t{%dx, %eax|eax, dx}", [], IIC_IN_RR>, OpSize16; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 88 |  | 
|  | 89 | let Defs = [AL] in | 
|  | 90 | def IN8ri  : Ii8<0xE4, RawFrm, (outs), (ins i8imm:$port), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 91 | "in{b}\t{$port, %al|al, $port}", [], IIC_IN_RI>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 92 | let Defs = [AX] in | 
|  | 93 | def IN16ri : Ii8<0xE5, RawFrm, (outs), (ins i8imm:$port), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 94 | "in{w}\t{$port, %ax|ax, $port}", [], IIC_IN_RI>, OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 95 | let Defs = [EAX] in | 
|  | 96 | def IN32ri : Ii8<0xE5, RawFrm, (outs), (ins i8imm:$port), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 97 | "in{l}\t{$port, %eax|eax, $port}", [], IIC_IN_RI>, OpSize16; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 98 |  | 
|  | 99 | let Uses = [DX, AL] in | 
|  | 100 | def OUT8rr  : I<0xEE, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 101 | "out{b}\t{%al, %dx|dx, al}", [], IIC_OUT_RR>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 102 | let Uses = [DX, AX] in | 
|  | 103 | def OUT16rr : I<0xEF, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 104 | "out{w}\t{%ax, %dx|dx, ax}", [], IIC_OUT_RR>, OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 105 | let Uses = [DX, EAX] in | 
|  | 106 | def OUT32rr : I<0xEF, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 107 | "out{l}\t{%eax, %dx|dx, eax}", [], IIC_OUT_RR>, OpSize16; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 108 |  | 
|  | 109 | let Uses = [AL] in | 
|  | 110 | def OUT8ir  : Ii8<0xE6, RawFrm, (outs), (ins i8imm:$port), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 111 | "out{b}\t{%al, $port|$port, al}", [], IIC_OUT_IR>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 112 | let Uses = [AX] in | 
|  | 113 | def OUT16ir : Ii8<0xE7, RawFrm, (outs), (ins i8imm:$port), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 114 | "out{w}\t{%ax, $port|$port, ax}", [], IIC_OUT_IR>, OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 115 | let Uses = [EAX] in | 
|  | 116 | def OUT32ir : Ii8<0xE7, RawFrm, (outs), (ins i8imm:$port), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 117 | "out{l}\t{%eax, $port|$port, eax}", [], IIC_OUT_IR>, OpSize16; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 118 |  | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 119 | def IN8  : I<0x6C, RawFrm, (outs), (ins), "ins{b}", [], IIC_INS>; | 
|  | 120 | def IN16 : I<0x6D, RawFrm, (outs), (ins), "ins{w}", [], IIC_INS>,  OpSize; | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 121 | def IN32 : I<0x6D, RawFrm, (outs), (ins), "ins{l}", [], IIC_INS>, OpSize16; | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 122 | } // SchedRW | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 123 |  | 
|  | 124 | //===----------------------------------------------------------------------===// | 
|  | 125 | // Moves to and from debug registers | 
|  | 126 |  | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 127 | let SchedRW = [WriteSystem] in { | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 128 | def MOV32rd : I<0x21, MRMDestReg, (outs GR32:$dst), (ins DEBUG_REG:$src), | 
| Craig Topper | bc281ad8 | 2014-01-04 22:29:41 +0000 | [diff] [blame] | 129 | "mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_DR>, TB, | 
|  | 130 | Requires<[Not64BitMode]>; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 131 | def MOV64rd : I<0x21, MRMDestReg, (outs GR64:$dst), (ins DEBUG_REG:$src), | 
| Craig Topper | bc281ad8 | 2014-01-04 22:29:41 +0000 | [diff] [blame] | 132 | "mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_DR>, TB, | 
|  | 133 | Requires<[In64BitMode]>; | 
|  | 134 |  | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 135 | def MOV32dr : I<0x23, MRMSrcReg, (outs DEBUG_REG:$dst), (ins GR32:$src), | 
| Craig Topper | bc281ad8 | 2014-01-04 22:29:41 +0000 | [diff] [blame] | 136 | "mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_DR_REG>, TB, | 
|  | 137 | Requires<[Not64BitMode]>; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 138 | def MOV64dr : I<0x23, MRMSrcReg, (outs DEBUG_REG:$dst), (ins GR64:$src), | 
| Craig Topper | bc281ad8 | 2014-01-04 22:29:41 +0000 | [diff] [blame] | 139 | "mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_DR_REG>, TB, | 
|  | 140 | Requires<[In64BitMode]>; | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 141 | } // SchedRW | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 142 |  | 
|  | 143 | //===----------------------------------------------------------------------===// | 
|  | 144 | // Moves to and from control registers | 
|  | 145 |  | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 146 | let SchedRW = [WriteSystem] in { | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 147 | def MOV32rc : I<0x20, MRMDestReg, (outs GR32:$dst), (ins CONTROL_REG:$src), | 
| Craig Topper | bc281ad8 | 2014-01-04 22:29:41 +0000 | [diff] [blame] | 148 | "mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_CR>, TB, | 
|  | 149 | Requires<[Not64BitMode]>; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 150 | def MOV64rc : I<0x20, MRMDestReg, (outs GR64:$dst), (ins CONTROL_REG:$src), | 
| Craig Topper | bc281ad8 | 2014-01-04 22:29:41 +0000 | [diff] [blame] | 151 | "mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_CR>, TB, | 
|  | 152 | Requires<[In64BitMode]>; | 
|  | 153 |  | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 154 | def MOV32cr : I<0x22, MRMSrcReg, (outs CONTROL_REG:$dst), (ins GR32:$src), | 
| Craig Topper | bc281ad8 | 2014-01-04 22:29:41 +0000 | [diff] [blame] | 155 | "mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_CR_REG>, TB, | 
|  | 156 | Requires<[Not64BitMode]>; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 157 | def MOV64cr : I<0x22, MRMSrcReg, (outs CONTROL_REG:$dst), (ins GR64:$src), | 
| Craig Topper | bc281ad8 | 2014-01-04 22:29:41 +0000 | [diff] [blame] | 158 | "mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_CR_REG>, TB, | 
|  | 159 | Requires<[In64BitMode]>; | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 160 | } // SchedRW | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 161 |  | 
|  | 162 | //===----------------------------------------------------------------------===// | 
|  | 163 | // Segment override instruction prefixes | 
|  | 164 |  | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 165 | def CS_PREFIX : I<0x2E, RawFrm, (outs), (ins), "cs", []>; | 
|  | 166 | def SS_PREFIX : I<0x36, RawFrm, (outs), (ins), "ss", []>; | 
|  | 167 | def DS_PREFIX : I<0x3E, RawFrm, (outs), (ins), "ds", []>; | 
|  | 168 | def ES_PREFIX : I<0x26, RawFrm, (outs), (ins), "es", []>; | 
|  | 169 | def FS_PREFIX : I<0x64, RawFrm, (outs), (ins), "fs", []>; | 
|  | 170 | def GS_PREFIX : I<0x65, RawFrm, (outs), (ins), "gs", []>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 171 |  | 
|  | 172 |  | 
|  | 173 | //===----------------------------------------------------------------------===// | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 174 | // Moves to and from segment registers. | 
|  | 175 | // | 
|  | 176 |  | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 177 | let SchedRW = [WriteMove] in { | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 178 | def MOV16rs : I<0x8C, MRMDestReg, (outs GR16:$dst), (ins SEGMENT_REG:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 179 | "mov{w}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_SR>, OpSize; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 180 | def MOV32rs : I<0x8C, MRMDestReg, (outs GR32:$dst), (ins SEGMENT_REG:$src), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 181 | "mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_SR>, OpSize16; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 182 | def MOV64rs : RI<0x8C, MRMDestReg, (outs GR64:$dst), (ins SEGMENT_REG:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 183 | "mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_SR>; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 184 |  | 
|  | 185 | def MOV16ms : I<0x8C, MRMDestMem, (outs i16mem:$dst), (ins SEGMENT_REG:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 186 | "mov{w}\t{$src, $dst|$dst, $src}", [], IIC_MOV_MEM_SR>, OpSize; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 187 | def MOV32ms : I<0x8C, MRMDestMem, (outs i32mem:$dst), (ins SEGMENT_REG:$src), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 188 | "mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_MEM_SR>, OpSize16; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 189 | def MOV64ms : RI<0x8C, MRMDestMem, (outs i64mem:$dst), (ins SEGMENT_REG:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 190 | "mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_MEM_SR>; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 191 |  | 
|  | 192 | def MOV16sr : I<0x8E, MRMSrcReg, (outs SEGMENT_REG:$dst), (ins GR16:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 193 | "mov{w}\t{$src, $dst|$dst, $src}", [], IIC_MOV_SR_REG>, OpSize; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 194 | def MOV32sr : I<0x8E, MRMSrcReg, (outs SEGMENT_REG:$dst), (ins GR32:$src), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 195 | "mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_SR_REG>, OpSize16; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 196 | def MOV64sr : RI<0x8E, MRMSrcReg, (outs SEGMENT_REG:$dst), (ins GR64:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 197 | "mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_SR_REG>; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 198 |  | 
|  | 199 | def MOV16sm : I<0x8E, MRMSrcMem, (outs SEGMENT_REG:$dst), (ins i16mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 200 | "mov{w}\t{$src, $dst|$dst, $src}", [], IIC_MOV_SR_MEM>, OpSize; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 201 | def MOV32sm : I<0x8E, MRMSrcMem, (outs SEGMENT_REG:$dst), (ins i32mem:$src), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 202 | "mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_SR_MEM>, OpSize16; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 203 | def MOV64sm : RI<0x8E, MRMSrcMem, (outs SEGMENT_REG:$dst), (ins i64mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 204 | "mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_SR_MEM>; | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 205 | } // SchedRW | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 206 |  | 
|  | 207 | //===----------------------------------------------------------------------===// | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 208 | // Segmentation support instructions. | 
|  | 209 |  | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 210 | let SchedRW = [WriteSystem] in { | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 211 | def SWAPGS : I<0x01, MRM_F8, (outs), (ins), "swapgs", [], IIC_SWAPGS>, TB; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 212 |  | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 213 | def LAR16rm : I<0x02, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 214 | "lar{w}\t{$src, $dst|$dst, $src}", [], IIC_LAR_RM>, TB, OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 215 | def LAR16rr : I<0x02, MRMSrcReg, (outs GR16:$dst), (ins GR16:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 216 | "lar{w}\t{$src, $dst|$dst, $src}", [], IIC_LAR_RR>, TB, OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 217 |  | 
|  | 218 | // i16mem operand in LAR32rm and GR32 operand in LAR32rr is not a typo. | 
|  | 219 | def LAR32rm : I<0x02, MRMSrcMem, (outs GR32:$dst), (ins i16mem:$src), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 220 | "lar{l}\t{$src, $dst|$dst, $src}", [], IIC_LAR_RM>, TB, | 
|  | 221 | OpSize16; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 222 | def LAR32rr : I<0x02, MRMSrcReg, (outs GR32:$dst), (ins GR32:$src), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 223 | "lar{l}\t{$src, $dst|$dst, $src}", [], IIC_LAR_RR>, TB, | 
|  | 224 | OpSize16; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 225 | // i16mem operand in LAR64rm and GR32 operand in LAR32rr is not a typo. | 
|  | 226 | def LAR64rm : RI<0x02, MRMSrcMem, (outs GR64:$dst), (ins i16mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 227 | "lar{q}\t{$src, $dst|$dst, $src}", [], IIC_LAR_RM>, TB; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 228 | def LAR64rr : RI<0x02, MRMSrcReg, (outs GR64:$dst), (ins GR32:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 229 | "lar{q}\t{$src, $dst|$dst, $src}", [], IIC_LAR_RR>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 230 |  | 
|  | 231 | def LSL16rm : I<0x03, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 232 | "lsl{w}\t{$src, $dst|$dst, $src}", [], IIC_LSL_RM>, TB, OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 233 | def LSL16rr : I<0x03, MRMSrcReg, (outs GR16:$dst), (ins GR16:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 234 | "lsl{w}\t{$src, $dst|$dst, $src}", [], IIC_LSL_RR>, TB, OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 235 | def LSL32rm : I<0x03, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$src), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 236 | "lsl{l}\t{$src, $dst|$dst, $src}", [], IIC_LSL_RM>, TB, | 
|  | 237 | OpSize16; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 238 | def LSL32rr : I<0x03, MRMSrcReg, (outs GR32:$dst), (ins GR32:$src), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 239 | "lsl{l}\t{$src, $dst|$dst, $src}", [], IIC_LSL_RR>, TB, | 
|  | 240 | OpSize16; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 241 | def LSL64rm : RI<0x03, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 242 | "lsl{q}\t{$src, $dst|$dst, $src}", [], IIC_LSL_RM>, TB; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 243 | def LSL64rr : RI<0x03, MRMSrcReg, (outs GR64:$dst), (ins GR64:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 244 | "lsl{q}\t{$src, $dst|$dst, $src}", [], IIC_LSL_RR>, TB; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 245 |  | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 246 | def INVLPG : I<0x01, MRM7m, (outs), (ins i8mem:$addr), "invlpg\t$addr", | 
|  | 247 | [], IIC_INVLPG>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 248 |  | 
| Eli Friedman | f63614a | 2011-03-04 00:10:17 +0000 | [diff] [blame] | 249 | def STR16r : I<0x00, MRM1r, (outs GR16:$dst), (ins), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 250 | "str{w}\t$dst", [], IIC_STR>, TB, OpSize; | 
| Eli Friedman | f63614a | 2011-03-04 00:10:17 +0000 | [diff] [blame] | 251 | def STR32r : I<0x00, MRM1r, (outs GR32:$dst), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 252 | "str{l}\t$dst", [], IIC_STR>, TB, OpSize16; | 
| Eli Friedman | f63614a | 2011-03-04 00:10:17 +0000 | [diff] [blame] | 253 | def STR64r : RI<0x00, MRM1r, (outs GR64:$dst), (ins), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 254 | "str{q}\t$dst", [], IIC_STR>, TB; | 
| Eli Friedman | f63614a | 2011-03-04 00:10:17 +0000 | [diff] [blame] | 255 | def STRm   : I<0x00, MRM1m, (outs i16mem:$dst), (ins), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 256 | "str{w}\t$dst", [], IIC_STR>, TB; | 
| Eli Friedman | f63614a | 2011-03-04 00:10:17 +0000 | [diff] [blame] | 257 |  | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 258 | def LTRr : I<0x00, MRM3r, (outs), (ins GR16:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 259 | "ltr{w}\t$src", [], IIC_LTR>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 260 | def LTRm : I<0x00, MRM3m, (outs), (ins i16mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 261 | "ltr{w}\t$src", [], IIC_LTR>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 262 |  | 
|  | 263 | def PUSHCS16 : I<0x0E, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 264 | "push{w}\t{%cs|cs}", [], IIC_PUSH_SR>, | 
|  | 265 | OpSize, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 266 | def PUSHCS32 : I<0x0E, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 267 | "push{l}\t{%cs|cs}", [], IIC_PUSH_CS>, | 
|  | 268 | OpSize16, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 269 | def PUSHSS16 : I<0x16, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 270 | "push{w}\t{%ss|ss}", [], IIC_PUSH_SR>, | 
|  | 271 | OpSize, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 272 | def PUSHSS32 : I<0x16, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 273 | "push{l}\t{%ss|ss}", [], IIC_PUSH_SR>, | 
|  | 274 | OpSize16, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 275 | def PUSHDS16 : I<0x1E, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 276 | "push{w}\t{%ds|ds}", [], IIC_PUSH_SR>, | 
|  | 277 | OpSize, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 278 | def PUSHDS32 : I<0x1E, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 279 | "push{l}\t{%ds|ds}", [], IIC_PUSH_SR>, | 
|  | 280 | OpSize16, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 281 | def PUSHES16 : I<0x06, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 282 | "push{w}\t{%es|es}", [], IIC_PUSH_SR>, | 
|  | 283 | OpSize, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 284 | def PUSHES32 : I<0x06, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 285 | "push{l}\t{%es|es}", [], IIC_PUSH_SR>, | 
|  | 286 | OpSize16, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 287 | def PUSHFS16 : I<0xa0, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 288 | "push{w}\t{%fs|fs}", [], IIC_PUSH_SR>, OpSize, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 289 | def PUSHFS32 : I<0xa0, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 290 | "push{l}\t{%fs|fs}", [], IIC_PUSH_SR>, TB, | 
|  | 291 | OpSize16, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 292 | def PUSHGS16 : I<0xa8, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 293 | "push{w}\t{%gs|gs}", [], IIC_PUSH_SR>, OpSize, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 294 | def PUSHGS32 : I<0xa8, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 295 | "push{l}\t{%gs|gs}", [], IIC_PUSH_SR>, TB, | 
|  | 296 | OpSize16, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 297 | def PUSHFS64 : I<0xa0, RawFrm, (outs), (ins), | 
| Craig Topper | eabdbcb | 2014-01-02 18:20:48 +0000 | [diff] [blame] | 298 | "push{q}\t{%fs|fs}", [], IIC_PUSH_SR>, TB, Requires<[In64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 299 | def PUSHGS64 : I<0xa8, RawFrm, (outs), (ins), | 
| Craig Topper | eabdbcb | 2014-01-02 18:20:48 +0000 | [diff] [blame] | 300 | "push{q}\t{%gs|gs}", [], IIC_PUSH_SR>, TB, Requires<[In64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 301 |  | 
|  | 302 | // No "pop cs" instruction. | 
|  | 303 | def POPSS16 : I<0x17, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 304 | "pop{w}\t{%ss|ss}", [], IIC_POP_SR_SS>, | 
| Eric Christopher | c0a5aae | 2013-12-20 02:04:49 +0000 | [diff] [blame] | 305 | OpSize, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 306 | def POPSS32 : I<0x17, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 307 | "pop{l}\t{%ss|ss}", [], IIC_POP_SR_SS>, | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 308 | OpSize16, Requires<[Not64BitMode]>; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 309 |  | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 310 | def POPDS16 : I<0x1F, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 311 | "pop{w}\t{%ds|ds}", [], IIC_POP_SR>, | 
| Eric Christopher | c0a5aae | 2013-12-20 02:04:49 +0000 | [diff] [blame] | 312 | OpSize, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 313 | def POPDS32 : I<0x1F, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 314 | "pop{l}\t{%ds|ds}", [], IIC_POP_SR>, | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 315 | OpSize16, Requires<[Not64BitMode]>; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 316 |  | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 317 | def POPES16 : I<0x07, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 318 | "pop{w}\t{%es|es}", [], IIC_POP_SR>, | 
| Eric Christopher | c0a5aae | 2013-12-20 02:04:49 +0000 | [diff] [blame] | 319 | OpSize, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 320 | def POPES32 : I<0x07, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 321 | "pop{l}\t{%es|es}", [], IIC_POP_SR>, | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 322 | OpSize16, Requires<[Not64BitMode]>; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 323 |  | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 324 | def POPFS16 : I<0xa1, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 325 | "pop{w}\t{%fs|fs}", [], IIC_POP_SR>, OpSize, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 326 | def POPFS32 : I<0xa1, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 327 | "pop{l}\t{%fs|fs}", [], IIC_POP_SR>, TB, | 
|  | 328 | OpSize16, Requires<[Not64BitMode]>; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 329 | def POPFS64 : I<0xa1, RawFrm, (outs), (ins), | 
| Craig Topper | eabdbcb | 2014-01-02 18:20:48 +0000 | [diff] [blame] | 330 | "pop{q}\t{%fs|fs}", [], IIC_POP_SR>, TB, Requires<[In64BitMode]>; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 331 |  | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 332 | def POPGS16 : I<0xa9, RawFrm, (outs), (ins), | 
| Craig Topper | efd67d4 | 2013-07-31 02:47:52 +0000 | [diff] [blame] | 333 | "pop{w}\t{%gs|gs}", [], IIC_POP_SR>, OpSize, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 334 | def POPGS32 : I<0xa9, RawFrm, (outs), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 335 | "pop{l}\t{%gs|gs}", [], IIC_POP_SR>, TB, | 
|  | 336 | OpSize16, Requires<[Not64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 337 | def POPGS64 : I<0xa9, RawFrm, (outs), (ins), | 
| Craig Topper | eabdbcb | 2014-01-02 18:20:48 +0000 | [diff] [blame] | 338 | "pop{q}\t{%gs|gs}", [], IIC_POP_SR>, TB, Requires<[In64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 339 |  | 
|  | 340 |  | 
|  | 341 | def LDS16rm : I<0xc5, MRMSrcMem, (outs GR16:$dst), (ins opaque32mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 342 | "lds{w}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 343 | def LDS32rm : I<0xc5, MRMSrcMem, (outs GR32:$dst), (ins opaque48mem:$src), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 344 | "lds{l}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, OpSize16; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 345 |  | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 346 | def LSS16rm : I<0xb2, MRMSrcMem, (outs GR16:$dst), (ins opaque32mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 347 | "lss{w}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB, OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 348 | def LSS32rm : I<0xb2, MRMSrcMem, (outs GR32:$dst), (ins opaque48mem:$src), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 349 | "lss{l}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB, OpSize16; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 350 | def LSS64rm : RI<0xb2, MRMSrcMem, (outs GR64:$dst), (ins opaque80mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 351 | "lss{q}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 352 |  | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 353 | def LES16rm : I<0xc4, MRMSrcMem, (outs GR16:$dst), (ins opaque32mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 354 | "les{w}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 355 | def LES32rm : I<0xc4, MRMSrcMem, (outs GR32:$dst), (ins opaque48mem:$src), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 356 | "les{l}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, OpSize16; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 357 |  | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 358 | def LFS16rm : I<0xb4, MRMSrcMem, (outs GR16:$dst), (ins opaque32mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 359 | "lfs{w}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB, OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 360 | def LFS32rm : I<0xb4, MRMSrcMem, (outs GR32:$dst), (ins opaque48mem:$src), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 361 | "lfs{l}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB, OpSize16; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 362 | def LFS64rm : RI<0xb4, MRMSrcMem, (outs GR64:$dst), (ins opaque80mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 363 | "lfs{q}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 364 |  | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 365 | def LGS16rm : I<0xb5, MRMSrcMem, (outs GR16:$dst), (ins opaque32mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 366 | "lgs{w}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB, OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 367 | def LGS32rm : I<0xb5, MRMSrcMem, (outs GR32:$dst), (ins opaque48mem:$src), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 368 | "lgs{l}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB, OpSize16; | 
| Chris Lattner | ae33f5d | 2010-10-05 06:04:14 +0000 | [diff] [blame] | 369 |  | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 370 | def LGS64rm : RI<0xb5, MRMSrcMem, (outs GR64:$dst), (ins opaque80mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 371 | "lgs{q}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 372 |  | 
|  | 373 |  | 
|  | 374 | def VERRr : I<0x00, MRM4r, (outs), (ins GR16:$seg), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 375 | "verr\t$seg", [], IIC_VERR>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 376 | def VERRm : I<0x00, MRM4m, (outs), (ins i16mem:$seg), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 377 | "verr\t$seg", [], IIC_VERR>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 378 | def VERWr : I<0x00, MRM5r, (outs), (ins GR16:$seg), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 379 | "verw\t$seg", [], IIC_VERW_MEM>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 380 | def VERWm : I<0x00, MRM5m, (outs), (ins i16mem:$seg), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 381 | "verw\t$seg", [], IIC_VERW_REG>, TB; | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 382 | } // SchedRW | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 383 |  | 
|  | 384 | //===----------------------------------------------------------------------===// | 
|  | 385 | // Descriptor-table support instructions | 
|  | 386 |  | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 387 | let SchedRW = [WriteSystem] in { | 
| Kevin Enderby | 49843c0 | 2010-10-19 00:01:44 +0000 | [diff] [blame] | 388 | def SGDT16m : I<0x01, MRM0m, (outs opaque48mem:$dst), (ins), | 
| Eric Christopher | c0a5aae | 2013-12-20 02:04:49 +0000 | [diff] [blame] | 389 | "sgdt{w}\t$dst", [], IIC_SGDT>, TB, OpSize, Requires<[Not64BitMode]>; | 
| David Woodhouse | c178fbe | 2014-01-08 12:57:55 +0000 | [diff] [blame] | 390 | def SGDT32m : I<0x01, MRM0m, (outs opaque48mem:$dst), (ins), | 
|  | 391 | "sgdt{l}\t$dst", [], IIC_SGDT>, OpSize16, TB, Requires <[Not64BitMode]>; | 
|  | 392 | def SGDT64m : I<0x01, MRM0m, (outs opaque80mem:$dst), (ins), | 
|  | 393 | "sgdt{q}\t$dst", [], IIC_SGDT>, TB, Requires <[In64BitMode]>; | 
| Kevin Enderby | 49843c0 | 2010-10-19 00:01:44 +0000 | [diff] [blame] | 394 | def SIDT16m : I<0x01, MRM1m, (outs opaque48mem:$dst), (ins), | 
| Eric Christopher | c0a5aae | 2013-12-20 02:04:49 +0000 | [diff] [blame] | 395 | "sidt{w}\t$dst", [], IIC_SIDT>, TB, OpSize, Requires<[Not64BitMode]>; | 
| David Woodhouse | c178fbe | 2014-01-08 12:57:55 +0000 | [diff] [blame] | 396 | def SIDT32m : I<0x01, MRM1m, (outs opaque48mem:$dst), (ins), | 
|  | 397 | "sidt{l}\t$dst", []>, OpSize16, TB, Requires <[Not64BitMode]>; | 
|  | 398 | def SIDT64m : I<0x01, MRM1m, (outs opaque80mem:$dst), (ins), | 
|  | 399 | "sidt{q}\t$dst", []>, TB, Requires <[In64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 400 | def SLDT16r : I<0x00, MRM0r, (outs GR16:$dst), (ins), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 401 | "sldt{w}\t$dst", [], IIC_SLDT>, TB, OpSize; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 402 | def SLDT16m : I<0x00, MRM0m, (outs i16mem:$dst), (ins), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 403 | "sldt{w}\t$dst", [], IIC_SLDT>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 404 | def SLDT32r : I<0x00, MRM0r, (outs GR32:$dst), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 405 | "sldt{l}\t$dst", [], IIC_SLDT>, OpSize16, TB; | 
| Chris Lattner | c184a57 | 2010-10-05 06:22:35 +0000 | [diff] [blame] | 406 |  | 
|  | 407 | // LLDT is not interpreted specially in 64-bit mode because there is no sign | 
|  | 408 | //   extension. | 
|  | 409 | def SLDT64r : RI<0x00, MRM0r, (outs GR64:$dst), (ins), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 410 | "sldt{q}\t$dst", [], IIC_SLDT>, TB; | 
| Chris Lattner | c184a57 | 2010-10-05 06:22:35 +0000 | [diff] [blame] | 411 | def SLDT64m : RI<0x00, MRM0m, (outs i16mem:$dst), (ins), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 412 | "sldt{q}\t$dst", [], IIC_SLDT>, TB; | 
| Chris Lattner | c184a57 | 2010-10-05 06:22:35 +0000 | [diff] [blame] | 413 |  | 
| Kevin Enderby | 49843c0 | 2010-10-19 00:01:44 +0000 | [diff] [blame] | 414 | def LGDT16m : I<0x01, MRM2m, (outs), (ins opaque48mem:$src), | 
| Eric Christopher | c0a5aae | 2013-12-20 02:04:49 +0000 | [diff] [blame] | 415 | "lgdt{w}\t$src", [], IIC_LGDT>, TB, OpSize, Requires<[Not64BitMode]>; | 
| David Woodhouse | c178fbe | 2014-01-08 12:57:55 +0000 | [diff] [blame] | 416 | def LGDT32m : I<0x01, MRM2m, (outs), (ins opaque48mem:$src), | 
|  | 417 | "lgdt{l}\t$src", [], IIC_LGDT>, OpSize16, TB, Requires<[Not64BitMode]>; | 
|  | 418 | def LGDT64m : I<0x01, MRM2m, (outs), (ins opaque80mem:$src), | 
|  | 419 | "lgdt{q}\t$src", [], IIC_LGDT>, TB, Requires<[In64BitMode]>; | 
| Kevin Enderby | 49843c0 | 2010-10-19 00:01:44 +0000 | [diff] [blame] | 420 | def LIDT16m : I<0x01, MRM3m, (outs), (ins opaque48mem:$src), | 
| Eric Christopher | c0a5aae | 2013-12-20 02:04:49 +0000 | [diff] [blame] | 421 | "lidt{w}\t$src", [], IIC_LIDT>, TB, OpSize, Requires<[Not64BitMode]>; | 
| David Woodhouse | c178fbe | 2014-01-08 12:57:55 +0000 | [diff] [blame] | 422 | def LIDT32m : I<0x01, MRM3m, (outs), (ins opaque48mem:$src), | 
|  | 423 | "lidt{l}\t$src", [], IIC_LIDT>, OpSize16, TB, Requires<[Not64BitMode]>; | 
|  | 424 | def LIDT64m : I<0x01, MRM3m, (outs), (ins opaque80mem:$src), | 
|  | 425 | "lidt{q}\t$src", [], IIC_LIDT>, TB, Requires<[In64BitMode]>; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 426 | def LLDT16r : I<0x00, MRM2r, (outs), (ins GR16:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 427 | "lldt{w}\t$src", [], IIC_LLDT_REG>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 428 | def LLDT16m : I<0x00, MRM2m, (outs), (ins i16mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 429 | "lldt{w}\t$src", [], IIC_LLDT_MEM>, TB; | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 430 | } // SchedRW | 
|  | 431 |  | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 432 | //===----------------------------------------------------------------------===// | 
|  | 433 | // Specialized register support | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 434 | let SchedRW = [WriteSystem] in { | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 435 | def WRMSR : I<0x30, RawFrm, (outs), (ins), "wrmsr", [], IIC_WRMSR>, TB; | 
|  | 436 | def RDMSR : I<0x32, RawFrm, (outs), (ins), "rdmsr", [], IIC_RDMSR>, TB; | 
|  | 437 | def RDPMC : I<0x33, RawFrm, (outs), (ins), "rdpmc", [], IIC_RDPMC>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 438 |  | 
|  | 439 | def SMSW16r : I<0x01, MRM4r, (outs GR16:$dst), (ins), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 440 | "smsw{w}\t$dst", [], IIC_SMSW>, OpSize, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 441 | def SMSW32r : I<0x01, MRM4r, (outs GR32:$dst), (ins), | 
| David Woodhouse | 956965c | 2014-01-08 12:57:40 +0000 | [diff] [blame] | 442 | "smsw{l}\t$dst", [], IIC_SMSW>, OpSize16, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 443 | // no m form encodable; use SMSW16m | 
|  | 444 | def SMSW64r : RI<0x01, MRM4r, (outs GR64:$dst), (ins), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 445 | "smsw{q}\t$dst", [], IIC_SMSW>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 446 |  | 
|  | 447 | // For memory operands, there is only a 16-bit form | 
|  | 448 | def SMSW16m : I<0x01, MRM4m, (outs i16mem:$dst), (ins), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 449 | "smsw{w}\t$dst", [], IIC_SMSW>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 450 |  | 
|  | 451 | def LMSW16r : I<0x01, MRM6r, (outs), (ins GR16:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 452 | "lmsw{w}\t$src", [], IIC_LMSW_MEM>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 453 | def LMSW16m : I<0x01, MRM6m, (outs), (ins i16mem:$src), | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 454 | "lmsw{w}\t$src", [], IIC_LMSW_REG>, TB; | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 455 |  | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 456 | def CPUID : I<0xA2, RawFrm, (outs), (ins), "cpuid", [], IIC_CPUID>, TB; | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 457 | } // SchedRW | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 458 |  | 
|  | 459 | //===----------------------------------------------------------------------===// | 
|  | 460 | // Cache instructions | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 461 | let SchedRW = [WriteSystem] in { | 
| Preston Gurd | d6c440c | 2012-05-04 19:26:37 +0000 | [diff] [blame] | 462 | def INVD : I<0x08, RawFrm, (outs), (ins), "invd", [], IIC_INVD>, TB; | 
|  | 463 | def WBINVD : I<0x09, RawFrm, (outs), (ins), "wbinvd", [], IIC_INVD>, TB; | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 464 | } // SchedRW | 
| Chris Lattner | dec85b8 | 2010-10-05 05:32:15 +0000 | [diff] [blame] | 465 |  | 
| Craig Topper | d9cfddc | 2011-10-07 07:02:24 +0000 | [diff] [blame] | 466 | //===----------------------------------------------------------------------===// | 
|  | 467 | // XSAVE instructions | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 468 | let SchedRW = [WriteSystem] in { | 
| Rafael Espindola | e390621 | 2011-02-22 00:35:18 +0000 | [diff] [blame] | 469 | let Defs = [RDX, RAX], Uses = [RCX] in | 
|  | 470 | def XGETBV : I<0x01, MRM_D0, (outs), (ins), "xgetbv", []>, TB; | 
|  | 471 |  | 
|  | 472 | let Uses = [RDX, RAX, RCX] in | 
|  | 473 | def XSETBV : I<0x01, MRM_D1, (outs), (ins), "xsetbv", []>, TB; | 
| Joerg Sonnenberger | fc4789d | 2011-04-04 16:58:13 +0000 | [diff] [blame] | 474 |  | 
| Craig Topper | bf13676 | 2011-10-07 05:53:50 +0000 | [diff] [blame] | 475 | let Uses = [RDX, RAX] in { | 
|  | 476 | def XSAVE : I<0xAE, MRM4m, (outs opaque512mem:$dst), (ins), | 
|  | 477 | "xsave\t$dst", []>, TB; | 
|  | 478 | def XSAVE64 : I<0xAE, MRM4m, (outs opaque512mem:$dst), (ins), | 
| Kay Tiong Khoo | 394bf14 | 2013-04-10 21:52:25 +0000 | [diff] [blame] | 479 | "xsave{q|64}\t$dst", []>, TB, REX_W, Requires<[In64BitMode]>; | 
| Craig Topper | bf13676 | 2011-10-07 05:53:50 +0000 | [diff] [blame] | 480 | def XRSTOR : I<0xAE, MRM5m, (outs), (ins opaque512mem:$dst), | 
|  | 481 | "xrstor\t$dst", []>, TB; | 
|  | 482 | def XRSTOR64 : I<0xAE, MRM5m, (outs), (ins opaque512mem:$dst), | 
| Kay Tiong Khoo | 394bf14 | 2013-04-10 21:52:25 +0000 | [diff] [blame] | 483 | "xrstor{q|64}\t$dst", []>, TB, REX_W, Requires<[In64BitMode]>; | 
| Craig Topper | bf13676 | 2011-10-07 05:53:50 +0000 | [diff] [blame] | 484 | def XSAVEOPT : I<0xAE, MRM6m, (outs opaque512mem:$dst), (ins), | 
|  | 485 | "xsaveopt\t$dst", []>, TB; | 
|  | 486 | def XSAVEOPT64 : I<0xAE, MRM6m, (outs opaque512mem:$dst), (ins), | 
| Kay Tiong Khoo | 394bf14 | 2013-04-10 21:52:25 +0000 | [diff] [blame] | 487 | "xsaveopt{q|64}\t$dst", []>, TB, REX_W, Requires<[In64BitMode]>; | 
| Craig Topper | bf13676 | 2011-10-07 05:53:50 +0000 | [diff] [blame] | 488 | } | 
| Jakob Stoklund Olesen | 5b535c9 | 2013-03-20 23:09:50 +0000 | [diff] [blame] | 489 | } // SchedRW | 
| Craig Topper | bf13676 | 2011-10-07 05:53:50 +0000 | [diff] [blame] | 490 |  | 
| Joerg Sonnenberger | fc4789d | 2011-04-04 16:58:13 +0000 | [diff] [blame] | 491 | //===----------------------------------------------------------------------===// | 
|  | 492 | // VIA PadLock crypto instructions | 
|  | 493 | let Defs = [RAX, RDI], Uses = [RDX, RDI] in | 
|  | 494 | def XSTORE : I<0xc0, RawFrm, (outs), (ins), "xstore", []>, A7; | 
|  | 495 |  | 
| Joerg Sonnenberger | 91e5662 | 2011-06-30 01:38:03 +0000 | [diff] [blame] | 496 | def : InstAlias<"xstorerng", (XSTORE)>; | 
|  | 497 |  | 
| Joerg Sonnenberger | fc4789d | 2011-04-04 16:58:13 +0000 | [diff] [blame] | 498 | let Defs = [RSI, RDI], Uses = [RBX, RDX, RSI, RDI] in { | 
|  | 499 | def XCRYPTECB : I<0xc8, RawFrm, (outs), (ins), "xcryptecb", []>, A7; | 
|  | 500 | def XCRYPTCBC : I<0xd0, RawFrm, (outs), (ins), "xcryptcbc", []>, A7; | 
|  | 501 | def XCRYPTCTR : I<0xd8, RawFrm, (outs), (ins), "xcryptctr", []>, A7; | 
|  | 502 | def XCRYPTCFB : I<0xe0, RawFrm, (outs), (ins), "xcryptcfb", []>, A7; | 
|  | 503 | def XCRYPTOFB : I<0xe8, RawFrm, (outs), (ins), "xcryptofb", []>, A7; | 
|  | 504 | } | 
|  | 505 |  | 
|  | 506 | let Defs = [RAX, RSI, RDI], Uses = [RAX, RSI, RDI] in { | 
|  | 507 | def XSHA1 : I<0xc8, RawFrm, (outs), (ins), "xsha1", []>, A6; | 
|  | 508 | def XSHA256 : I<0xd0, RawFrm, (outs), (ins), "xsha256", []>, A6; | 
|  | 509 | } | 
|  | 510 | let Defs = [RAX, RDX, RSI], Uses = [RAX, RSI] in | 
|  | 511 | def MONTMUL : I<0xc0, RawFrm, (outs), (ins), "montmul", []>, A6; | 
| Craig Topper | d9cfddc | 2011-10-07 07:02:24 +0000 | [diff] [blame] | 512 |  | 
|  | 513 | //===----------------------------------------------------------------------===// | 
|  | 514 | // FS/GS Base Instructions | 
| Craig Topper | 228d913 | 2011-10-30 19:57:21 +0000 | [diff] [blame] | 515 | let Predicates = [HasFSGSBase, In64BitMode] in { | 
| Craig Topper | d9cfddc | 2011-10-07 07:02:24 +0000 | [diff] [blame] | 516 | def RDFSBASE : I<0xAE, MRM0r, (outs GR32:$dst), (ins), | 
| Craig Topper | 228d913 | 2011-10-30 19:57:21 +0000 | [diff] [blame] | 517 | "rdfsbase{l}\t$dst", | 
|  | 518 | [(set GR32:$dst, (int_x86_rdfsbase_32))]>, TB, XS; | 
| Craig Topper | d9cfddc | 2011-10-07 07:02:24 +0000 | [diff] [blame] | 519 | def RDFSBASE64 : RI<0xAE, MRM0r, (outs GR64:$dst), (ins), | 
| Craig Topper | 228d913 | 2011-10-30 19:57:21 +0000 | [diff] [blame] | 520 | "rdfsbase{q}\t$dst", | 
|  | 521 | [(set GR64:$dst, (int_x86_rdfsbase_64))]>, TB, XS; | 
| Craig Topper | d9cfddc | 2011-10-07 07:02:24 +0000 | [diff] [blame] | 522 | def RDGSBASE : I<0xAE, MRM1r, (outs GR32:$dst), (ins), | 
| Craig Topper | 228d913 | 2011-10-30 19:57:21 +0000 | [diff] [blame] | 523 | "rdgsbase{l}\t$dst", | 
|  | 524 | [(set GR32:$dst, (int_x86_rdgsbase_32))]>, TB, XS; | 
| Craig Topper | d9cfddc | 2011-10-07 07:02:24 +0000 | [diff] [blame] | 525 | def RDGSBASE64 : RI<0xAE, MRM1r, (outs GR64:$dst), (ins), | 
| Craig Topper | 228d913 | 2011-10-30 19:57:21 +0000 | [diff] [blame] | 526 | "rdgsbase{q}\t$dst", | 
|  | 527 | [(set GR64:$dst, (int_x86_rdgsbase_64))]>, TB, XS; | 
|  | 528 | def WRFSBASE : I<0xAE, MRM2r, (outs), (ins GR32:$src), | 
|  | 529 | "wrfsbase{l}\t$src", | 
|  | 530 | [(int_x86_wrfsbase_32 GR32:$src)]>, TB, XS; | 
|  | 531 | def WRFSBASE64 : RI<0xAE, MRM2r, (outs), (ins GR64:$src), | 
|  | 532 | "wrfsbase{q}\t$src", | 
|  | 533 | [(int_x86_wrfsbase_64 GR64:$src)]>, TB, XS; | 
|  | 534 | def WRGSBASE : I<0xAE, MRM3r, (outs), (ins GR32:$src), | 
|  | 535 | "wrgsbase{l}\t$src", | 
|  | 536 | [(int_x86_wrgsbase_32 GR32:$src)]>, TB, XS; | 
|  | 537 | def WRGSBASE64 : RI<0xAE, MRM3r, (outs), (ins GR64:$src), | 
|  | 538 | "wrgsbase{q}\t$src", | 
|  | 539 | [(int_x86_wrgsbase_64 GR64:$src)]>, TB, XS; | 
| Craig Topper | d9cfddc | 2011-10-07 07:02:24 +0000 | [diff] [blame] | 540 | } | 
| Craig Topper | 0ae8d4d | 2011-10-16 07:05:40 +0000 | [diff] [blame] | 541 |  | 
|  | 542 | //===----------------------------------------------------------------------===// | 
|  | 543 | // INVPCID Instruction | 
|  | 544 | def INVPCID32 : I<0x82, MRMSrcMem, (outs), (ins GR32:$src1, i128mem:$src2), | 
| Kay Tiong Khoo | 6f76c21 | 2013-04-10 21:17:58 +0000 | [diff] [blame] | 545 | "invpcid\t{$src2, $src1|$src1, $src2}", []>, OpSize, T8, | 
| Eric Christopher | c0a5aae | 2013-12-20 02:04:49 +0000 | [diff] [blame] | 546 | Requires<[Not64BitMode]>; | 
| Craig Topper | 0ae8d4d | 2011-10-16 07:05:40 +0000 | [diff] [blame] | 547 | def INVPCID64 : I<0x82, MRMSrcMem, (outs), (ins GR64:$src1, i128mem:$src2), | 
| Kay Tiong Khoo | 6f76c21 | 2013-04-10 21:17:58 +0000 | [diff] [blame] | 548 | "invpcid\t{$src2, $src1|$src1, $src2}", []>, OpSize, T8, | 
| Craig Topper | 0ae8d4d | 2011-10-16 07:05:40 +0000 | [diff] [blame] | 549 | Requires<[In64BitMode]>; | 
| Michael Liao | 95d94403 | 2013-04-11 04:52:28 +0000 | [diff] [blame] | 550 |  | 
|  | 551 | //===----------------------------------------------------------------------===// | 
|  | 552 | // SMAP Instruction | 
|  | 553 | let Defs = [EFLAGS], Uses = [EFLAGS] in { | 
|  | 554 | def CLAC : I<0x01, MRM_CA, (outs), (ins), "clac", []>, TB; | 
|  | 555 | def STAC : I<0x01, MRM_CB, (outs), (ins), "stac", []>, TB; | 
|  | 556 | } |