2012-02-18 20:03:15 +08:00
|
|
|
//===-- X86InstrSystem.td - System Instructions ------------*- tablegen -*-===//
|
|
|
|
//
|
2010-10-05 13:32:15 +08:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2012-02-18 20:03:15 +08:00
|
|
|
//
|
2010-10-05 13:32:15 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file describes the X86 instructions that are generally used in
|
|
|
|
// privileged modes. These are not typically used by the compiler, but are
|
|
|
|
// supported for the assembler and disassembler.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2013-03-21 07:09:50 +08:00
|
|
|
let SchedRW = [WriteSystem] in {
|
2010-10-05 13:32:15 +08:00
|
|
|
let Defs = [RAX, RDX] in
|
2012-05-05 03:26:37 +08:00
|
|
|
def RDTSC : I<0x31, RawFrm, (outs), (ins), "rdtsc", [(X86rdtsc)], IIC_RDTSC>,
|
|
|
|
TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
let Defs = [RAX, RCX, RDX] in
|
2014-04-25 01:18:27 +08:00
|
|
|
def RDTSCP : I<0x01, MRM_F9, (outs), (ins), "rdtscp", [(X86rdtscp)]>, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
// CPU flow control instructions
|
|
|
|
|
2016-08-10 01:55:12 +08:00
|
|
|
let mayLoad = 1, mayStore = 0, hasSideEffects = 1 in {
|
2010-10-05 14:04:14 +08:00
|
|
|
def TRAP : I<0x0B, RawFrm, (outs), (ins), "ud2", [(trap)]>, TB;
|
2010-10-28 04:46:49 +08:00
|
|
|
def UD2B : I<0xB9, RawFrm, (outs), (ins), "ud2b", []>, TB;
|
|
|
|
}
|
2010-10-05 13:32:15 +08:00
|
|
|
|
2012-05-05 03:26:37 +08:00
|
|
|
def HLT : I<0xF4, RawFrm, (outs), (ins), "hlt", [], IIC_HLT>;
|
|
|
|
def RSM : I<0xAA, RawFrm, (outs), (ins), "rsm", [], IIC_RSM>, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
// Interrupt and SysCall Instructions.
|
|
|
|
let Uses = [EFLAGS] in
|
2017-09-20 16:17:17 +08:00
|
|
|
def INTO : I<0xce, RawFrm, (outs), (ins), "into", []>, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def INT3 : I<0xcc, RawFrm, (outs), (ins), "int3",
|
2012-05-05 03:26:37 +08:00
|
|
|
[(int_x86_int (i8 3))], IIC_INT3>;
|
2013-03-21 07:09:50 +08:00
|
|
|
} // SchedRW
|
2011-04-10 03:41:05 +08:00
|
|
|
|
|
|
|
// The long form of "int $3" turns into int3 as a size optimization.
|
|
|
|
// FIXME: This doesn't work because InstAlias can't match immediate constants.
|
|
|
|
//def : InstAlias<"int\t$3", (INT3)>;
|
|
|
|
|
2013-03-21 07:09:50 +08:00
|
|
|
let SchedRW = [WriteSystem] in {
|
2011-04-10 03:41:05 +08:00
|
|
|
|
2015-10-12 02:27:24 +08:00
|
|
|
def INT : Ii8<0xcd, RawFrm, (outs), (ins u8imm:$trap), "int\t$trap",
|
2012-05-05 03:26:37 +08:00
|
|
|
[(int_x86_int imm:$trap)], IIC_INT>;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
2011-04-10 03:41:05 +08:00
|
|
|
|
2012-05-05 03:26:37 +08:00
|
|
|
def SYSCALL : I<0x05, RawFrm, (outs), (ins), "syscall", [], IIC_SYSCALL>, TB;
|
|
|
|
def SYSRET : I<0x07, RawFrm, (outs), (ins), "sysret{l}", [], IIC_SYSCALL>, TB;
|
|
|
|
def SYSRET64 :RI<0x07, RawFrm, (outs), (ins), "sysret{q}", [], IIC_SYSCALL>, TB,
|
2010-10-05 14:04:14 +08:00
|
|
|
Requires<[In64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
2012-05-05 03:26:37 +08:00
|
|
|
def SYSENTER : I<0x34, RawFrm, (outs), (ins), "sysenter", [],
|
|
|
|
IIC_SYS_ENTER_EXIT>, TB;
|
|
|
|
|
|
|
|
def SYSEXIT : I<0x35, RawFrm, (outs), (ins), "sysexit{l}", [],
|
|
|
|
IIC_SYS_ENTER_EXIT>, TB;
|
2014-02-26 14:50:27 +08:00
|
|
|
def SYSEXIT64 :RI<0x35, RawFrm, (outs), (ins), "sysexit{q}", [],
|
|
|
|
IIC_SYS_ENTER_EXIT>, TB, Requires<[In64BitMode]>;
|
2013-03-21 07:09:50 +08:00
|
|
|
} // SchedRW
|
2010-10-05 13:32:15 +08:00
|
|
|
|
2015-01-27 03:09:27 +08:00
|
|
|
def : Pat<(debugtrap),
|
|
|
|
(INT3)>, Requires<[NotPS4]>;
|
|
|
|
def : Pat<(debugtrap),
|
|
|
|
(INT (i8 0x41))>, Requires<[IsPS4]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Input/Output Instructions.
|
|
|
|
//
|
2013-03-21 07:09:50 +08:00
|
|
|
let SchedRW = [WriteSystem] in {
|
2010-10-05 13:32:15 +08:00
|
|
|
let Defs = [AL], Uses = [DX] in
|
|
|
|
def IN8rr : I<0xEC, RawFrm, (outs), (ins),
|
2013-07-31 10:47:52 +08:00
|
|
|
"in{b}\t{%dx, %al|al, dx}", [], IIC_IN_RR>;
|
2010-10-05 13:32:15 +08:00
|
|
|
let Defs = [AX], Uses = [DX] in
|
|
|
|
def IN16rr : I<0xED, RawFrm, (outs), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"in{w}\t{%dx, %ax|ax, dx}", [], IIC_IN_RR>, OpSize16;
|
2010-10-05 13:32:15 +08:00
|
|
|
let Defs = [EAX], Uses = [DX] in
|
|
|
|
def IN32rr : I<0xED, RawFrm, (outs), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"in{l}\t{%dx, %eax|eax, dx}", [], IIC_IN_RR>, OpSize32;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
let Defs = [AL] in
|
2015-10-12 12:17:55 +08:00
|
|
|
def IN8ri : Ii8<0xE4, RawFrm, (outs), (ins u8imm:$port),
|
2013-07-31 10:47:52 +08:00
|
|
|
"in{b}\t{$port, %al|al, $port}", [], IIC_IN_RI>;
|
2010-10-05 13:32:15 +08:00
|
|
|
let Defs = [AX] in
|
2015-10-12 12:17:55 +08:00
|
|
|
def IN16ri : Ii8<0xE5, RawFrm, (outs), (ins u8imm:$port),
|
2014-02-02 17:25:09 +08:00
|
|
|
"in{w}\t{$port, %ax|ax, $port}", [], IIC_IN_RI>, OpSize16;
|
2010-10-05 13:32:15 +08:00
|
|
|
let Defs = [EAX] in
|
2015-10-12 12:17:55 +08:00
|
|
|
def IN32ri : Ii8<0xE5, RawFrm, (outs), (ins u8imm:$port),
|
2014-02-02 17:25:09 +08:00
|
|
|
"in{l}\t{$port, %eax|eax, $port}", [], IIC_IN_RI>, OpSize32;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
let Uses = [DX, AL] in
|
|
|
|
def OUT8rr : I<0xEE, RawFrm, (outs), (ins),
|
2013-07-31 10:47:52 +08:00
|
|
|
"out{b}\t{%al, %dx|dx, al}", [], IIC_OUT_RR>;
|
2010-10-05 13:32:15 +08:00
|
|
|
let Uses = [DX, AX] in
|
|
|
|
def OUT16rr : I<0xEF, RawFrm, (outs), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"out{w}\t{%ax, %dx|dx, ax}", [], IIC_OUT_RR>, OpSize16;
|
2010-10-05 13:32:15 +08:00
|
|
|
let Uses = [DX, EAX] in
|
|
|
|
def OUT32rr : I<0xEF, RawFrm, (outs), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"out{l}\t{%eax, %dx|dx, eax}", [], IIC_OUT_RR>, OpSize32;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
let Uses = [AL] in
|
2015-10-12 12:17:55 +08:00
|
|
|
def OUT8ir : Ii8<0xE6, RawFrm, (outs), (ins u8imm:$port),
|
2013-07-31 10:47:52 +08:00
|
|
|
"out{b}\t{%al, $port|$port, al}", [], IIC_OUT_IR>;
|
2010-10-05 13:32:15 +08:00
|
|
|
let Uses = [AX] in
|
2015-10-12 12:17:55 +08:00
|
|
|
def OUT16ir : Ii8<0xE7, RawFrm, (outs), (ins u8imm:$port),
|
2014-02-02 17:25:09 +08:00
|
|
|
"out{w}\t{%ax, $port|$port, ax}", [], IIC_OUT_IR>, OpSize16;
|
2010-10-05 13:32:15 +08:00
|
|
|
let Uses = [EAX] in
|
2015-10-12 12:17:55 +08:00
|
|
|
def OUT32ir : Ii8<0xE7, RawFrm, (outs), (ins u8imm:$port),
|
2014-02-02 17:25:09 +08:00
|
|
|
"out{l}\t{%eax, $port|$port, eax}", [], IIC_OUT_IR>, OpSize32;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
2013-03-21 07:09:50 +08:00
|
|
|
} // SchedRW
|
2010-10-05 14:04:14 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Moves to and from debug registers
|
|
|
|
|
2013-03-21 07:09:50 +08:00
|
|
|
let SchedRW = [WriteSystem] in {
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV32rd : I<0x21, MRMDestReg, (outs GR32:$dst), (ins DEBUG_REG:$src),
|
2014-01-05 06:29:41 +08:00
|
|
|
"mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_DR>, TB,
|
|
|
|
Requires<[Not64BitMode]>;
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV64rd : I<0x21, MRMDestReg, (outs GR64:$dst), (ins DEBUG_REG:$src),
|
2014-01-05 06:29:41 +08:00
|
|
|
"mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_DR>, TB,
|
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV32dr : I<0x23, MRMSrcReg, (outs DEBUG_REG:$dst), (ins GR32:$src),
|
2014-01-05 06:29:41 +08:00
|
|
|
"mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_DR_REG>, TB,
|
|
|
|
Requires<[Not64BitMode]>;
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV64dr : I<0x23, MRMSrcReg, (outs DEBUG_REG:$dst), (ins GR64:$src),
|
2014-01-05 06:29:41 +08:00
|
|
|
"mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_DR_REG>, TB,
|
|
|
|
Requires<[In64BitMode]>;
|
2013-03-21 07:09:50 +08:00
|
|
|
} // SchedRW
|
2010-10-05 14:04:14 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Moves to and from control registers
|
|
|
|
|
2013-03-21 07:09:50 +08:00
|
|
|
let SchedRW = [WriteSystem] in {
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV32rc : I<0x20, MRMDestReg, (outs GR32:$dst), (ins CONTROL_REG:$src),
|
2014-01-05 06:29:41 +08:00
|
|
|
"mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_CR>, TB,
|
|
|
|
Requires<[Not64BitMode]>;
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV64rc : I<0x20, MRMDestReg, (outs GR64:$dst), (ins CONTROL_REG:$src),
|
2014-01-05 06:29:41 +08:00
|
|
|
"mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_CR>, TB,
|
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV32cr : I<0x22, MRMSrcReg, (outs CONTROL_REG:$dst), (ins GR32:$src),
|
2014-01-05 06:29:41 +08:00
|
|
|
"mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_CR_REG>, TB,
|
|
|
|
Requires<[Not64BitMode]>;
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV64cr : I<0x22, MRMSrcReg, (outs CONTROL_REG:$dst), (ins GR64:$src),
|
2014-01-05 06:29:41 +08:00
|
|
|
"mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_CR_REG>, TB,
|
|
|
|
Requires<[In64BitMode]>;
|
2013-03-21 07:09:50 +08:00
|
|
|
} // SchedRW
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Segment override instruction prefixes
|
|
|
|
|
2010-10-05 14:04:14 +08:00
|
|
|
def CS_PREFIX : I<0x2E, RawFrm, (outs), (ins), "cs", []>;
|
|
|
|
def SS_PREFIX : I<0x36, RawFrm, (outs), (ins), "ss", []>;
|
|
|
|
def DS_PREFIX : I<0x3E, RawFrm, (outs), (ins), "ds", []>;
|
|
|
|
def ES_PREFIX : I<0x26, RawFrm, (outs), (ins), "es", []>;
|
|
|
|
def FS_PREFIX : I<0x64, RawFrm, (outs), (ins), "fs", []>;
|
|
|
|
def GS_PREFIX : I<0x65, RawFrm, (outs), (ins), "gs", []>;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
|
2010-10-05 14:04:14 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Moves to and from segment registers.
|
|
|
|
//
|
|
|
|
|
2013-03-21 07:09:50 +08:00
|
|
|
let SchedRW = [WriteMove] in {
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV16rs : I<0x8C, MRMDestReg, (outs GR16:$dst), (ins SEGMENT_REG:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"mov{w}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_SR>, OpSize16;
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV32rs : I<0x8C, MRMDestReg, (outs GR32:$dst), (ins SEGMENT_REG:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_SR>, OpSize32;
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV64rs : RI<0x8C, MRMDestReg, (outs GR64:$dst), (ins SEGMENT_REG:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_REG_SR>;
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayStore = 1 in {
|
2016-03-13 10:56:31 +08:00
|
|
|
def MOV16ms : I<0x8C, MRMDestMem, (outs), (ins i16mem:$dst, SEGMENT_REG:$src),
|
2017-11-22 03:28:13 +08:00
|
|
|
"mov{w}\t{$src, $dst|$dst, $src}", [], IIC_MOV_MEM_SR>, OpSizeIgnore;
|
2017-04-13 18:03:45 +08:00
|
|
|
}
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV16sr : I<0x8E, MRMSrcReg, (outs SEGMENT_REG:$dst), (ins GR16:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"mov{w}\t{$src, $dst|$dst, $src}", [], IIC_MOV_SR_REG>, OpSize16;
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV32sr : I<0x8E, MRMSrcReg, (outs SEGMENT_REG:$dst), (ins GR32:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV_SR_REG>, OpSize32;
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV64sr : RI<0x8E, MRMSrcReg, (outs SEGMENT_REG:$dst), (ins GR64:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"mov{q}\t{$src, $dst|$dst, $src}", [], IIC_MOV_SR_REG>;
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayLoad = 1 in {
|
2010-10-05 14:04:14 +08:00
|
|
|
def MOV16sm : I<0x8E, MRMSrcMem, (outs SEGMENT_REG:$dst), (ins i16mem:$src),
|
2017-11-22 03:28:13 +08:00
|
|
|
"mov{w}\t{$src, $dst|$dst, $src}", [], IIC_MOV_SR_MEM>, OpSizeIgnore;
|
2017-04-13 18:03:45 +08:00
|
|
|
}
|
2013-03-21 07:09:50 +08:00
|
|
|
} // SchedRW
|
2010-10-05 14:04:14 +08:00
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Segmentation support instructions.
|
|
|
|
|
2013-03-21 07:09:50 +08:00
|
|
|
let SchedRW = [WriteSystem] in {
|
2012-05-05 03:26:37 +08:00
|
|
|
def SWAPGS : I<0x01, MRM_F8, (outs), (ins), "swapgs", [], IIC_SWAPGS>, TB;
|
2010-10-05 14:04:14 +08:00
|
|
|
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayLoad = 1 in
|
2014-12-04 13:20:33 +08:00
|
|
|
def LAR16rm : I<0x02, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lar{w}\t{$src, $dst|$dst, $src}", [], IIC_LAR_RM>, TB,
|
|
|
|
OpSize16;
|
2010-10-05 13:32:15 +08:00
|
|
|
def LAR16rr : I<0x02, MRMSrcReg, (outs GR16:$dst), (ins GR16:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lar{w}\t{$src, $dst|$dst, $src}", [], IIC_LAR_RR>, TB,
|
|
|
|
OpSize16;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
// i16mem operand in LAR32rm and GR32 operand in LAR32rr is not a typo.
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayLoad = 1 in
|
2014-12-04 13:20:33 +08:00
|
|
|
def LAR32rm : I<0x02, MRMSrcMem, (outs GR32:$dst), (ins i16mem:$src),
|
2014-01-08 20:57:40 +08:00
|
|
|
"lar{l}\t{$src, $dst|$dst, $src}", [], IIC_LAR_RM>, TB,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32;
|
2010-10-05 13:32:15 +08:00
|
|
|
def LAR32rr : I<0x02, MRMSrcReg, (outs GR32:$dst), (ins GR32:$src),
|
2014-01-08 20:57:40 +08:00
|
|
|
"lar{l}\t{$src, $dst|$dst, $src}", [], IIC_LAR_RR>, TB,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32;
|
2010-10-05 14:04:14 +08:00
|
|
|
// i16mem operand in LAR64rm and GR32 operand in LAR32rr is not a typo.
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayLoad = 1 in
|
2014-12-04 13:20:33 +08:00
|
|
|
def LAR64rm : RI<0x02, MRMSrcMem, (outs GR64:$dst), (ins i16mem:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"lar{q}\t{$src, $dst|$dst, $src}", [], IIC_LAR_RM>, TB;
|
2010-10-05 14:04:14 +08:00
|
|
|
def LAR64rr : RI<0x02, MRMSrcReg, (outs GR64:$dst), (ins GR32:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"lar{q}\t{$src, $dst|$dst, $src}", [], IIC_LAR_RR>, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayLoad = 1 in
|
2010-10-05 13:32:15 +08:00
|
|
|
def LSL16rm : I<0x03, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lsl{w}\t{$src, $dst|$dst, $src}", [], IIC_LSL_RM>, TB,
|
|
|
|
OpSize16;
|
2010-10-05 13:32:15 +08:00
|
|
|
def LSL16rr : I<0x03, MRMSrcReg, (outs GR16:$dst), (ins GR16:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lsl{w}\t{$src, $dst|$dst, $src}", [], IIC_LSL_RR>, TB,
|
|
|
|
OpSize16;
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayLoad = 1 in
|
2010-10-05 13:32:15 +08:00
|
|
|
def LSL32rm : I<0x03, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$src),
|
2014-01-08 20:57:40 +08:00
|
|
|
"lsl{l}\t{$src, $dst|$dst, $src}", [], IIC_LSL_RM>, TB,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32;
|
2010-10-05 13:32:15 +08:00
|
|
|
def LSL32rr : I<0x03, MRMSrcReg, (outs GR32:$dst), (ins GR32:$src),
|
2014-01-08 20:57:40 +08:00
|
|
|
"lsl{l}\t{$src, $dst|$dst, $src}", [], IIC_LSL_RR>, TB,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32;
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayLoad = 1 in
|
2010-10-05 14:04:14 +08:00
|
|
|
def LSL64rm : RI<0x03, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$src),
|
2014-12-04 13:20:33 +08:00
|
|
|
"lsl{q}\t{$src, $dst|$dst, $src}", [], IIC_LSL_RM>, TB;
|
2010-10-05 14:04:14 +08:00
|
|
|
def LSL64rr : RI<0x03, MRMSrcReg, (outs GR64:$dst), (ins GR64:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"lsl{q}\t{$src, $dst|$dst, $src}", [], IIC_LSL_RR>, TB;
|
2010-10-05 14:04:14 +08:00
|
|
|
|
2012-05-05 03:26:37 +08:00
|
|
|
def INVLPG : I<0x01, MRM7m, (outs), (ins i8mem:$addr), "invlpg\t$addr",
|
|
|
|
[], IIC_INVLPG>, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
2011-03-04 08:10:17 +08:00
|
|
|
def STR16r : I<0x00, MRM1r, (outs GR16:$dst), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"str{w}\t$dst", [], IIC_STR>, TB, OpSize16;
|
2011-03-04 08:10:17 +08:00
|
|
|
def STR32r : I<0x00, MRM1r, (outs GR32:$dst), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"str{l}\t$dst", [], IIC_STR>, TB, OpSize32;
|
2011-03-04 08:10:17 +08:00
|
|
|
def STR64r : RI<0x00, MRM1r, (outs GR64:$dst), (ins),
|
2012-05-05 03:26:37 +08:00
|
|
|
"str{q}\t$dst", [], IIC_STR>, TB;
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayStore = 1 in
|
2016-03-13 10:56:31 +08:00
|
|
|
def STRm : I<0x00, MRM1m, (outs), (ins i16mem:$dst),
|
2012-05-05 03:26:37 +08:00
|
|
|
"str{w}\t$dst", [], IIC_STR>, TB;
|
2011-03-04 08:10:17 +08:00
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
def LTRr : I<0x00, MRM3r, (outs), (ins GR16:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"ltr{w}\t$src", [], IIC_LTR>, TB;
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayLoad = 1 in
|
2010-10-05 13:32:15 +08:00
|
|
|
def LTRm : I<0x00, MRM3m, (outs), (ins i16mem:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"ltr{w}\t$src", [], IIC_LTR>, TB;
|
2014-12-04 13:20:33 +08:00
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHCS16 : I<0x0E, RawFrm, (outs), (ins),
|
2014-01-08 20:57:40 +08:00
|
|
|
"push{w}\t{%cs|cs}", [], IIC_PUSH_SR>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize16, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHCS32 : I<0x0E, RawFrm, (outs), (ins),
|
2014-01-08 20:57:40 +08:00
|
|
|
"push{l}\t{%cs|cs}", [], IIC_PUSH_CS>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHSS16 : I<0x16, RawFrm, (outs), (ins),
|
2014-01-08 20:57:40 +08:00
|
|
|
"push{w}\t{%ss|ss}", [], IIC_PUSH_SR>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize16, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHSS32 : I<0x16, RawFrm, (outs), (ins),
|
2014-01-08 20:57:40 +08:00
|
|
|
"push{l}\t{%ss|ss}", [], IIC_PUSH_SR>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHDS16 : I<0x1E, RawFrm, (outs), (ins),
|
2014-01-08 20:57:40 +08:00
|
|
|
"push{w}\t{%ds|ds}", [], IIC_PUSH_SR>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize16, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHDS32 : I<0x1E, RawFrm, (outs), (ins),
|
2014-01-08 20:57:40 +08:00
|
|
|
"push{l}\t{%ds|ds}", [], IIC_PUSH_SR>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHES16 : I<0x06, RawFrm, (outs), (ins),
|
2014-01-08 20:57:40 +08:00
|
|
|
"push{w}\t{%es|es}", [], IIC_PUSH_SR>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize16, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHES32 : I<0x06, RawFrm, (outs), (ins),
|
2014-01-08 20:57:40 +08:00
|
|
|
"push{l}\t{%es|es}", [], IIC_PUSH_SR>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHFS16 : I<0xa0, RawFrm, (outs), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"push{w}\t{%fs|fs}", [], IIC_PUSH_SR>, OpSize16, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHFS32 : I<0xa0, RawFrm, (outs), (ins),
|
2014-01-08 20:57:40 +08:00
|
|
|
"push{l}\t{%fs|fs}", [], IIC_PUSH_SR>, TB,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHGS16 : I<0xa8, RawFrm, (outs), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"push{w}\t{%gs|gs}", [], IIC_PUSH_SR>, OpSize16, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHGS32 : I<0xa8, RawFrm, (outs), (ins),
|
2014-01-08 20:57:40 +08:00
|
|
|
"push{l}\t{%gs|gs}", [], IIC_PUSH_SR>, TB,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHFS64 : I<0xa0, RawFrm, (outs), (ins),
|
2014-02-18 16:18:29 +08:00
|
|
|
"push{q}\t{%fs|fs}", [], IIC_PUSH_SR>, TB,
|
|
|
|
OpSize32, Requires<[In64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def PUSHGS64 : I<0xa8, RawFrm, (outs), (ins),
|
2014-02-18 16:18:29 +08:00
|
|
|
"push{q}\t{%gs|gs}", [], IIC_PUSH_SR>, TB,
|
|
|
|
OpSize32, Requires<[In64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
// No "pop cs" instruction.
|
|
|
|
def POPSS16 : I<0x17, RawFrm, (outs), (ins),
|
2013-07-31 10:47:52 +08:00
|
|
|
"pop{w}\t{%ss|ss}", [], IIC_POP_SR_SS>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize16, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def POPSS32 : I<0x17, RawFrm, (outs), (ins),
|
2013-07-31 10:47:52 +08:00
|
|
|
"pop{l}\t{%ss|ss}", [], IIC_POP_SR_SS>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32, Requires<[Not64BitMode]>;
|
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
def POPDS16 : I<0x1F, RawFrm, (outs), (ins),
|
2013-07-31 10:47:52 +08:00
|
|
|
"pop{w}\t{%ds|ds}", [], IIC_POP_SR>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize16, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def POPDS32 : I<0x1F, RawFrm, (outs), (ins),
|
2013-07-31 10:47:52 +08:00
|
|
|
"pop{l}\t{%ds|ds}", [], IIC_POP_SR>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32, Requires<[Not64BitMode]>;
|
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
def POPES16 : I<0x07, RawFrm, (outs), (ins),
|
2013-07-31 10:47:52 +08:00
|
|
|
"pop{w}\t{%es|es}", [], IIC_POP_SR>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize16, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def POPES32 : I<0x07, RawFrm, (outs), (ins),
|
2013-07-31 10:47:52 +08:00
|
|
|
"pop{l}\t{%es|es}", [], IIC_POP_SR>,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32, Requires<[Not64BitMode]>;
|
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
def POPFS16 : I<0xa1, RawFrm, (outs), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"pop{w}\t{%fs|fs}", [], IIC_POP_SR>, OpSize16, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
def POPFS32 : I<0xa1, RawFrm, (outs), (ins),
|
2014-01-08 20:57:40 +08:00
|
|
|
"pop{l}\t{%fs|fs}", [], IIC_POP_SR>, TB,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32, Requires<[Not64BitMode]>;
|
2010-10-05 14:04:14 +08:00
|
|
|
def POPFS64 : I<0xa1, RawFrm, (outs), (ins),
|
2014-02-18 16:18:29 +08:00
|
|
|
"pop{q}\t{%fs|fs}", [], IIC_POP_SR>, TB,
|
|
|
|
OpSize32, Requires<[In64BitMode]>;
|
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
def POPGS16 : I<0xa9, RawFrm, (outs), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"pop{w}\t{%gs|gs}", [], IIC_POP_SR>, OpSize16, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
def POPGS32 : I<0xa9, RawFrm, (outs), (ins),
|
2014-01-08 20:57:40 +08:00
|
|
|
"pop{l}\t{%gs|gs}", [], IIC_POP_SR>, TB,
|
2014-02-02 17:25:09 +08:00
|
|
|
OpSize32, Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def POPGS64 : I<0xa9, RawFrm, (outs), (ins),
|
2014-02-18 16:18:29 +08:00
|
|
|
"pop{q}\t{%gs|gs}", [], IIC_POP_SR>, TB,
|
|
|
|
OpSize32, Requires<[In64BitMode]>;
|
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
def LDS16rm : I<0xc5, MRMSrcMem, (outs GR16:$dst), (ins opaque32mem:$src),
|
2016-01-26 14:10:15 +08:00
|
|
|
"lds{w}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, OpSize16,
|
|
|
|
Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def LDS32rm : I<0xc5, MRMSrcMem, (outs GR32:$dst), (ins opaque48mem:$src),
|
2016-01-26 14:10:15 +08:00
|
|
|
"lds{l}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, OpSize32,
|
|
|
|
Requires<[Not64BitMode]>;
|
2014-12-04 13:20:33 +08:00
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
def LSS16rm : I<0xb2, MRMSrcMem, (outs GR16:$dst), (ins opaque32mem:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lss{w}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB, OpSize16;
|
2010-10-05 13:32:15 +08:00
|
|
|
def LSS32rm : I<0xb2, MRMSrcMem, (outs GR32:$dst), (ins opaque48mem:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lss{l}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB, OpSize32;
|
2010-10-05 14:04:14 +08:00
|
|
|
def LSS64rm : RI<0xb2, MRMSrcMem, (outs GR64:$dst), (ins opaque80mem:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"lss{q}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB;
|
2014-12-04 13:20:33 +08:00
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
def LES16rm : I<0xc4, MRMSrcMem, (outs GR16:$dst), (ins opaque32mem:$src),
|
2016-01-26 14:10:15 +08:00
|
|
|
"les{w}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, OpSize16,
|
|
|
|
Requires<[Not64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def LES32rm : I<0xc4, MRMSrcMem, (outs GR32:$dst), (ins opaque48mem:$src),
|
2016-01-26 14:10:15 +08:00
|
|
|
"les{l}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, OpSize32,
|
|
|
|
Requires<[Not64BitMode]>;
|
2014-12-04 13:20:33 +08:00
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
def LFS16rm : I<0xb4, MRMSrcMem, (outs GR16:$dst), (ins opaque32mem:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lfs{w}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB, OpSize16;
|
2010-10-05 13:32:15 +08:00
|
|
|
def LFS32rm : I<0xb4, MRMSrcMem, (outs GR32:$dst), (ins opaque48mem:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lfs{l}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB, OpSize32;
|
2010-10-05 14:04:14 +08:00
|
|
|
def LFS64rm : RI<0xb4, MRMSrcMem, (outs GR64:$dst), (ins opaque80mem:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"lfs{q}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB;
|
2014-12-04 13:20:33 +08:00
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
def LGS16rm : I<0xb5, MRMSrcMem, (outs GR16:$dst), (ins opaque32mem:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lgs{w}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB, OpSize16;
|
2010-10-05 13:32:15 +08:00
|
|
|
def LGS32rm : I<0xb5, MRMSrcMem, (outs GR32:$dst), (ins opaque48mem:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lgs{l}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB, OpSize32;
|
2014-12-04 13:20:33 +08:00
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
def LGS64rm : RI<0xb5, MRMSrcMem, (outs GR64:$dst), (ins opaque80mem:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"lgs{q}\t{$src, $dst|$dst, $src}", [], IIC_LXS>, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
def VERRr : I<0x00, MRM4r, (outs), (ins GR16:$seg),
|
2012-05-05 03:26:37 +08:00
|
|
|
"verr\t$seg", [], IIC_VERR>, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
def VERWr : I<0x00, MRM5r, (outs), (ins GR16:$seg),
|
2012-05-05 03:26:37 +08:00
|
|
|
"verw\t$seg", [], IIC_VERW_MEM>, TB;
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayLoad = 1 in {
|
|
|
|
def VERRm : I<0x00, MRM4m, (outs), (ins i16mem:$seg),
|
|
|
|
"verr\t$seg", [], IIC_VERR>, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
def VERWm : I<0x00, MRM5m, (outs), (ins i16mem:$seg),
|
2012-05-05 03:26:37 +08:00
|
|
|
"verw\t$seg", [], IIC_VERW_REG>, TB;
|
2017-04-13 18:03:45 +08:00
|
|
|
}
|
2013-03-21 07:09:50 +08:00
|
|
|
} // SchedRW
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Descriptor-table support instructions
|
|
|
|
|
2013-03-21 07:09:50 +08:00
|
|
|
let SchedRW = [WriteSystem] in {
|
2016-03-13 10:56:31 +08:00
|
|
|
def SGDT16m : I<0x01, MRM0m, (outs), (ins opaque48mem:$dst),
|
2014-02-02 17:25:09 +08:00
|
|
|
"sgdt{w}\t$dst", [], IIC_SGDT>, TB, OpSize16, Requires<[Not64BitMode]>;
|
2016-03-13 10:56:31 +08:00
|
|
|
def SGDT32m : I<0x01, MRM0m, (outs), (ins opaque48mem:$dst),
|
2014-02-02 17:25:09 +08:00
|
|
|
"sgdt{l}\t$dst", [], IIC_SGDT>, OpSize32, TB, Requires <[Not64BitMode]>;
|
2016-03-13 10:56:31 +08:00
|
|
|
def SGDT64m : I<0x01, MRM0m, (outs), (ins opaque80mem:$dst),
|
2014-01-08 20:57:55 +08:00
|
|
|
"sgdt{q}\t$dst", [], IIC_SGDT>, TB, Requires <[In64BitMode]>;
|
2016-03-13 10:56:31 +08:00
|
|
|
def SIDT16m : I<0x01, MRM1m, (outs), (ins opaque48mem:$dst),
|
2014-02-02 17:25:09 +08:00
|
|
|
"sidt{w}\t$dst", [], IIC_SIDT>, TB, OpSize16, Requires<[Not64BitMode]>;
|
2016-03-13 10:56:31 +08:00
|
|
|
def SIDT32m : I<0x01, MRM1m, (outs), (ins opaque48mem:$dst),
|
2014-02-02 17:25:09 +08:00
|
|
|
"sidt{l}\t$dst", []>, OpSize32, TB, Requires <[Not64BitMode]>;
|
2016-03-13 10:56:31 +08:00
|
|
|
def SIDT64m : I<0x01, MRM1m, (outs), (ins opaque80mem:$dst),
|
2014-01-08 20:57:55 +08:00
|
|
|
"sidt{q}\t$dst", []>, TB, Requires <[In64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def SLDT16r : I<0x00, MRM0r, (outs GR16:$dst), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"sldt{w}\t$dst", [], IIC_SLDT>, TB, OpSize16;
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayStore = 1 in
|
2016-03-13 10:56:31 +08:00
|
|
|
def SLDT16m : I<0x00, MRM0m, (outs), (ins i16mem:$dst),
|
2012-05-05 03:26:37 +08:00
|
|
|
"sldt{w}\t$dst", [], IIC_SLDT>, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
def SLDT32r : I<0x00, MRM0r, (outs GR32:$dst), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"sldt{l}\t$dst", [], IIC_SLDT>, OpSize32, TB;
|
2014-12-04 13:20:33 +08:00
|
|
|
|
2010-10-05 14:22:35 +08:00
|
|
|
// LLDT is not interpreted specially in 64-bit mode because there is no sign
|
|
|
|
// extension.
|
|
|
|
def SLDT64r : RI<0x00, MRM0r, (outs GR64:$dst), (ins),
|
2012-05-05 03:26:37 +08:00
|
|
|
"sldt{q}\t$dst", [], IIC_SLDT>, TB;
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayStore = 1 in
|
2016-03-13 10:56:31 +08:00
|
|
|
def SLDT64m : RI<0x00, MRM0m, (outs), (ins i16mem:$dst),
|
2012-05-05 03:26:37 +08:00
|
|
|
"sldt{q}\t$dst", [], IIC_SLDT>, TB;
|
2010-10-05 14:22:35 +08:00
|
|
|
|
2010-10-19 08:01:44 +08:00
|
|
|
def LGDT16m : I<0x01, MRM2m, (outs), (ins opaque48mem:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lgdt{w}\t$src", [], IIC_LGDT>, TB, OpSize16, Requires<[Not64BitMode]>;
|
2014-01-08 20:57:55 +08:00
|
|
|
def LGDT32m : I<0x01, MRM2m, (outs), (ins opaque48mem:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lgdt{l}\t$src", [], IIC_LGDT>, OpSize32, TB, Requires<[Not64BitMode]>;
|
2014-01-08 20:57:55 +08:00
|
|
|
def LGDT64m : I<0x01, MRM2m, (outs), (ins opaque80mem:$src),
|
|
|
|
"lgdt{q}\t$src", [], IIC_LGDT>, TB, Requires<[In64BitMode]>;
|
2010-10-19 08:01:44 +08:00
|
|
|
def LIDT16m : I<0x01, MRM3m, (outs), (ins opaque48mem:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lidt{w}\t$src", [], IIC_LIDT>, TB, OpSize16, Requires<[Not64BitMode]>;
|
2014-01-08 20:57:55 +08:00
|
|
|
def LIDT32m : I<0x01, MRM3m, (outs), (ins opaque48mem:$src),
|
2014-02-02 17:25:09 +08:00
|
|
|
"lidt{l}\t$src", [], IIC_LIDT>, OpSize32, TB, Requires<[Not64BitMode]>;
|
2014-01-08 20:57:55 +08:00
|
|
|
def LIDT64m : I<0x01, MRM3m, (outs), (ins opaque80mem:$src),
|
|
|
|
"lidt{q}\t$src", [], IIC_LIDT>, TB, Requires<[In64BitMode]>;
|
2010-10-05 13:32:15 +08:00
|
|
|
def LLDT16r : I<0x00, MRM2r, (outs), (ins GR16:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"lldt{w}\t$src", [], IIC_LLDT_REG>, TB;
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayLoad = 1 in
|
2010-10-05 13:32:15 +08:00
|
|
|
def LLDT16m : I<0x00, MRM2m, (outs), (ins i16mem:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"lldt{w}\t$src", [], IIC_LLDT_MEM>, TB;
|
2013-03-21 07:09:50 +08:00
|
|
|
} // SchedRW
|
|
|
|
|
2010-10-05 13:32:15 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Specialized register support
|
2013-03-21 07:09:50 +08:00
|
|
|
let SchedRW = [WriteSystem] in {
|
2015-02-08 07:36:51 +08:00
|
|
|
let Uses = [EAX, ECX, EDX] in
|
2012-05-05 03:26:37 +08:00
|
|
|
def WRMSR : I<0x30, RawFrm, (outs), (ins), "wrmsr", [], IIC_WRMSR>, TB;
|
2015-02-08 07:36:51 +08:00
|
|
|
let Defs = [EAX, EDX], Uses = [ECX] in
|
2012-05-05 03:26:37 +08:00
|
|
|
def RDMSR : I<0x32, RawFrm, (outs), (ins), "rdmsr", [], IIC_RDMSR>, TB;
|
2014-07-01 01:14:21 +08:00
|
|
|
|
|
|
|
let Defs = [RAX, RDX], Uses = [ECX] in
|
|
|
|
def RDPMC : I<0x33, RawFrm, (outs), (ins), "rdpmc", [(X86rdpmc)], IIC_RDPMC>,
|
|
|
|
TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
2014-12-04 13:20:33 +08:00
|
|
|
def SMSW16r : I<0x01, MRM4r, (outs GR16:$dst), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"smsw{w}\t$dst", [], IIC_SMSW>, OpSize16, TB;
|
2014-12-04 13:20:33 +08:00
|
|
|
def SMSW32r : I<0x01, MRM4r, (outs GR32:$dst), (ins),
|
2014-02-02 17:25:09 +08:00
|
|
|
"smsw{l}\t$dst", [], IIC_SMSW>, OpSize32, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
// no m form encodable; use SMSW16m
|
2014-12-04 13:20:33 +08:00
|
|
|
def SMSW64r : RI<0x01, MRM4r, (outs GR64:$dst), (ins),
|
2012-05-05 03:26:37 +08:00
|
|
|
"smsw{q}\t$dst", [], IIC_SMSW>, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
// For memory operands, there is only a 16-bit form
|
2016-03-13 10:56:31 +08:00
|
|
|
def SMSW16m : I<0x01, MRM4m, (outs), (ins i16mem:$dst),
|
2012-05-05 03:26:37 +08:00
|
|
|
"smsw{w}\t$dst", [], IIC_SMSW>, TB;
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
def LMSW16r : I<0x01, MRM6r, (outs), (ins GR16:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"lmsw{w}\t$src", [], IIC_LMSW_MEM>, TB;
|
2017-04-13 18:03:45 +08:00
|
|
|
let mayLoad = 1 in
|
2010-10-05 13:32:15 +08:00
|
|
|
def LMSW16m : I<0x01, MRM6m, (outs), (ins i16mem:$src),
|
2012-05-05 03:26:37 +08:00
|
|
|
"lmsw{w}\t$src", [], IIC_LMSW_REG>, TB;
|
2014-01-28 10:08:22 +08:00
|
|
|
|
|
|
|
let Defs = [EAX, EBX, ECX, EDX], Uses = [EAX, ECX] in
|
2014-09-05 00:58:25 +08:00
|
|
|
def CPUID : I<0xA2, RawFrm, (outs), (ins), "cpuid", [], IIC_CPUID>, TB;
|
2013-03-21 07:09:50 +08:00
|
|
|
} // SchedRW
|
2010-10-05 13:32:15 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Cache instructions
|
2013-03-21 07:09:50 +08:00
|
|
|
let SchedRW = [WriteSystem] in {
|
2012-05-05 03:26:37 +08:00
|
|
|
def INVD : I<0x08, RawFrm, (outs), (ins), "invd", [], IIC_INVD>, TB;
|
|
|
|
def WBINVD : I<0x09, RawFrm, (outs), (ins), "wbinvd", [], IIC_INVD>, TB;
|
2013-03-21 07:09:50 +08:00
|
|
|
} // SchedRW
|
2010-10-05 13:32:15 +08:00
|
|
|
|
2017-11-26 21:02:45 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// CET instructions
|
|
|
|
let SchedRW = [WriteSystem], Predicates = [HasSHSTK] in{
|
|
|
|
let Uses = [SSP] in {
|
|
|
|
let Defs = [SSP] in {
|
|
|
|
def INCSSPD : I<0xAE, MRM5r, (outs), (ins GR32:$src), "incsspd\t$src",
|
|
|
|
[(int_x86_incsspd GR32:$src)]>, XS;
|
|
|
|
def INCSSPQ : RI<0xAE, MRM5r, (outs), (ins GR64:$src), "incsspq\t$src",
|
|
|
|
[(int_x86_incsspq GR64:$src)]>, XS,
|
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
} // Defs SSP
|
|
|
|
|
|
|
|
let Constraints = "$src = $dst" in {
|
|
|
|
def RDSSPD : I<0x1E, MRM1r, (outs GR32:$dst), (ins GR32:$src),
|
|
|
|
"rdsspd\t$dst",
|
|
|
|
[(set GR32:$dst, (int_x86_rdsspd GR32:$src))]>, XS;
|
|
|
|
def RDSSPQ : RI<0x1E, MRM1r, (outs GR64:$dst), (ins GR64:$src),
|
|
|
|
"rdsspq\t$dst",
|
|
|
|
[(set GR64:$dst, (int_x86_rdsspq GR64:$src))]>, XS,
|
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let Defs = [SSP] in {
|
|
|
|
def SAVEPREVSSP : I<0x01, MRM_EA, (outs), (ins), "saveprevssp",
|
|
|
|
[(int_x86_saveprevssp)]>, XS;
|
|
|
|
def RSTORSSP : I<0x01, MRM5m, (outs), (ins i32mem:$src),
|
|
|
|
"rstorssp\t$src",
|
|
|
|
[(int_x86_rstorssp addr:$src)]>, XS;
|
|
|
|
} // Defs SSP
|
|
|
|
} // Uses SSP
|
|
|
|
|
|
|
|
def WRSSD : I<0xF6, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src),
|
|
|
|
"wrssd\t{$src, $dst|$dst, $src}",
|
|
|
|
[(int_x86_wrssd GR32:$src, addr:$dst)]>, T8;
|
|
|
|
def WRSSQ : RI<0xF6, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src),
|
|
|
|
"wrssq\t{$src, $dst|$dst, $src}",
|
|
|
|
[(int_x86_wrssq GR64:$src, addr:$dst)]>, T8,
|
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
def WRUSSD : I<0xF5, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src),
|
|
|
|
"wrussd\t{$src, $dst|$dst, $src}",
|
|
|
|
[(int_x86_wrussd GR32:$src, addr:$dst)]>, T8PD;
|
|
|
|
def WRUSSQ : RI<0xF5, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src),
|
|
|
|
"wrussq\t{$src, $dst|$dst, $src}",
|
|
|
|
[(int_x86_wrussq GR64:$src, addr:$dst)]>, T8PD,
|
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
|
|
|
|
let Defs = [SSP] in {
|
|
|
|
let Uses = [SSP] in {
|
|
|
|
def SETSSBSY : I<0x01, MRM_E8, (outs), (ins), "setssbsy",
|
|
|
|
[(int_x86_setssbsy)]>, XS;
|
|
|
|
} // Uses SSP
|
|
|
|
|
|
|
|
def CLRSSBSY : I<0xAE, MRM6m, (outs), (ins i32mem:$src),
|
|
|
|
"clrssbsy\t$src",
|
|
|
|
[(int_x86_clrssbsy addr:$src)]>, XS;
|
|
|
|
} // Defs SSP
|
|
|
|
} // SchedRW && HasSHSTK
|
|
|
|
|
2011-10-07 15:02:24 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// XSAVE instructions
|
2013-03-21 07:09:50 +08:00
|
|
|
let SchedRW = [WriteSystem] in {
|
2015-10-12 19:47:46 +08:00
|
|
|
let Predicates = [HasXSAVE] in {
|
2014-09-05 00:58:25 +08:00
|
|
|
let Defs = [EDX, EAX], Uses = [ECX] in
|
2011-02-22 08:35:18 +08:00
|
|
|
def XGETBV : I<0x01, MRM_D0, (outs), (ins), "xgetbv", []>, TB;
|
|
|
|
|
2014-09-05 00:58:25 +08:00
|
|
|
let Uses = [EDX, EAX, ECX] in
|
2016-08-16 14:41:00 +08:00
|
|
|
def XSETBV : I<0x01, MRM_D1, (outs), (ins),
|
|
|
|
"xsetbv",
|
|
|
|
[(int_x86_xsetbv ECX, EDX, EAX)]>, TB;
|
|
|
|
|
|
|
|
} // HasXSAVE
|
2011-04-05 00:58:13 +08:00
|
|
|
|
2015-10-12 19:47:46 +08:00
|
|
|
let Uses = [EDX, EAX] in {
|
|
|
|
let Predicates = [HasXSAVE] in {
|
|
|
|
def XSAVE : I<0xAE, MRM4m, (outs), (ins opaque512mem:$dst),
|
|
|
|
"xsave\t$dst",
|
2017-10-23 23:53:21 +08:00
|
|
|
[(int_x86_xsave addr:$dst, EDX, EAX)]>, PS;
|
2015-10-12 19:47:46 +08:00
|
|
|
def XSAVE64 : RI<0xAE, MRM4m, (outs), (ins opaque512mem:$dst),
|
|
|
|
"xsave64\t$dst",
|
2017-10-23 23:53:21 +08:00
|
|
|
[(int_x86_xsave64 addr:$dst, EDX, EAX)]>, PS, Requires<[In64BitMode]>;
|
2011-10-07 13:53:50 +08:00
|
|
|
def XRSTOR : I<0xAE, MRM5m, (outs), (ins opaque512mem:$dst),
|
2015-10-12 19:47:46 +08:00
|
|
|
"xrstor\t$dst",
|
2017-10-24 00:11:33 +08:00
|
|
|
[(int_x86_xrstor addr:$dst, EDX, EAX)]>, PS;
|
2014-01-17 16:16:57 +08:00
|
|
|
def XRSTOR64 : RI<0xAE, MRM5m, (outs), (ins opaque512mem:$dst),
|
2015-10-12 19:47:46 +08:00
|
|
|
"xrstor64\t$dst",
|
2017-10-24 00:11:33 +08:00
|
|
|
[(int_x86_xrstor64 addr:$dst, EDX, EAX)]>, PS, Requires<[In64BitMode]>;
|
2015-10-12 19:47:46 +08:00
|
|
|
}
|
|
|
|
let Predicates = [HasXSAVEOPT] in {
|
|
|
|
def XSAVEOPT : I<0xAE, MRM6m, (outs), (ins opaque512mem:$dst),
|
|
|
|
"xsaveopt\t$dst",
|
2016-01-06 14:18:41 +08:00
|
|
|
[(int_x86_xsaveopt addr:$dst, EDX, EAX)]>, PS;
|
2015-10-12 19:47:46 +08:00
|
|
|
def XSAVEOPT64 : RI<0xAE, MRM6m, (outs), (ins opaque512mem:$dst),
|
|
|
|
"xsaveopt64\t$dst",
|
2016-01-06 14:18:41 +08:00
|
|
|
[(int_x86_xsaveopt64 addr:$dst, EDX, EAX)]>, PS, Requires<[In64BitMode]>;
|
2015-10-12 19:47:46 +08:00
|
|
|
}
|
|
|
|
let Predicates = [HasXSAVEC] in {
|
|
|
|
def XSAVEC : I<0xC7, MRM4m, (outs), (ins opaque512mem:$dst),
|
|
|
|
"xsavec\t$dst",
|
|
|
|
[(int_x86_xsavec addr:$dst, EDX, EAX)]>, TB;
|
|
|
|
def XSAVEC64 : RI<0xC7, MRM4m, (outs), (ins opaque512mem:$dst),
|
|
|
|
"xsavec64\t$dst",
|
|
|
|
[(int_x86_xsavec64 addr:$dst, EDX, EAX)]>, TB, Requires<[In64BitMode]>;
|
|
|
|
}
|
|
|
|
let Predicates = [HasXSAVES] in {
|
|
|
|
def XSAVES : I<0xC7, MRM5m, (outs), (ins opaque512mem:$dst),
|
|
|
|
"xsaves\t$dst",
|
|
|
|
[(int_x86_xsaves addr:$dst, EDX, EAX)]>, TB;
|
|
|
|
def XSAVES64 : RI<0xC7, MRM5m, (outs), (ins opaque512mem:$dst),
|
|
|
|
"xsaves64\t$dst",
|
|
|
|
[(int_x86_xsaves64 addr:$dst, EDX, EAX)]>, TB, Requires<[In64BitMode]>;
|
2015-02-05 16:51:06 +08:00
|
|
|
def XRSTORS : I<0xC7, MRM3m, (outs), (ins opaque512mem:$dst),
|
2015-10-12 19:47:46 +08:00
|
|
|
"xrstors\t$dst",
|
|
|
|
[(int_x86_xrstors addr:$dst, EDX, EAX)]>, TB;
|
2015-02-05 16:51:06 +08:00
|
|
|
def XRSTORS64 : RI<0xC7, MRM3m, (outs), (ins opaque512mem:$dst),
|
2015-10-12 19:47:46 +08:00
|
|
|
"xrstors64\t$dst",
|
|
|
|
[(int_x86_xrstors64 addr:$dst, EDX, EAX)]>, TB, Requires<[In64BitMode]>;
|
2011-10-07 13:53:50 +08:00
|
|
|
}
|
2015-10-12 19:47:46 +08:00
|
|
|
} // Uses
|
2013-03-21 07:09:50 +08:00
|
|
|
} // SchedRW
|
2011-10-07 13:53:50 +08:00
|
|
|
|
2011-04-05 00:58:13 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// VIA PadLock crypto instructions
|
|
|
|
let Defs = [RAX, RDI], Uses = [RDX, RDI] in
|
2014-02-19 13:34:21 +08:00
|
|
|
def XSTORE : I<0xa7, MRM_C0, (outs), (ins), "xstore", []>, TB;
|
2011-04-05 00:58:13 +08:00
|
|
|
|
2011-06-30 09:38:03 +08:00
|
|
|
def : InstAlias<"xstorerng", (XSTORE)>;
|
|
|
|
|
2011-04-05 00:58:13 +08:00
|
|
|
let Defs = [RSI, RDI], Uses = [RBX, RDX, RSI, RDI] in {
|
2014-02-19 13:34:21 +08:00
|
|
|
def XCRYPTECB : I<0xa7, MRM_C8, (outs), (ins), "xcryptecb", []>, TB;
|
|
|
|
def XCRYPTCBC : I<0xa7, MRM_D0, (outs), (ins), "xcryptcbc", []>, TB;
|
|
|
|
def XCRYPTCTR : I<0xa7, MRM_D8, (outs), (ins), "xcryptctr", []>, TB;
|
|
|
|
def XCRYPTCFB : I<0xa7, MRM_E0, (outs), (ins), "xcryptcfb", []>, TB;
|
|
|
|
def XCRYPTOFB : I<0xa7, MRM_E8, (outs), (ins), "xcryptofb", []>, TB;
|
2011-04-05 00:58:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
let Defs = [RAX, RSI, RDI], Uses = [RAX, RSI, RDI] in {
|
2014-02-19 13:34:21 +08:00
|
|
|
def XSHA1 : I<0xa6, MRM_C8, (outs), (ins), "xsha1", []>, TB;
|
|
|
|
def XSHA256 : I<0xa6, MRM_D0, (outs), (ins), "xsha256", []>, TB;
|
2011-04-05 00:58:13 +08:00
|
|
|
}
|
|
|
|
let Defs = [RAX, RDX, RSI], Uses = [RAX, RSI] in
|
2014-02-19 13:34:21 +08:00
|
|
|
def MONTMUL : I<0xa6, MRM_C0, (outs), (ins), "montmul", []>, TB;
|
2015-12-24 16:25:00 +08:00
|
|
|
//==-----------------------------------------------------------------------===//
|
|
|
|
// PKU - enable protection key
|
2015-12-31 16:31:13 +08:00
|
|
|
let usesCustomInserter = 1 in {
|
|
|
|
def WRPKRU : PseudoI<(outs), (ins GR32:$src),
|
|
|
|
[(int_x86_wrpkru GR32:$src)]>;
|
|
|
|
def RDPKRU : PseudoI<(outs GR32:$dst), (ins),
|
|
|
|
[(set GR32:$dst, (int_x86_rdpkru))]>;
|
|
|
|
}
|
|
|
|
|
2016-06-19 03:13:38 +08:00
|
|
|
let Defs = [EAX, EDX], Uses = [ECX] in
|
2015-12-31 16:31:13 +08:00
|
|
|
def RDPKRUr : I<0x01, MRM_EE, (outs), (ins), "rdpkru", []>, TB;
|
2015-12-24 16:25:00 +08:00
|
|
|
let Uses = [EAX, ECX, EDX] in
|
2015-12-31 16:31:13 +08:00
|
|
|
def WRPKRUr : I<0x01, MRM_EF, (outs), (ins), "wrpkru", []>, TB;
|
2011-10-07 15:02:24 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FS/GS Base Instructions
|
2011-10-31 03:57:21 +08:00
|
|
|
let Predicates = [HasFSGSBase, In64BitMode] in {
|
2011-10-07 15:02:24 +08:00
|
|
|
def RDFSBASE : I<0xAE, MRM0r, (outs GR32:$dst), (ins),
|
2011-10-31 03:57:21 +08:00
|
|
|
"rdfsbase{l}\t$dst",
|
2014-02-01 16:17:56 +08:00
|
|
|
[(set GR32:$dst, (int_x86_rdfsbase_32))]>, XS;
|
2011-10-07 15:02:24 +08:00
|
|
|
def RDFSBASE64 : RI<0xAE, MRM0r, (outs GR64:$dst), (ins),
|
2011-10-31 03:57:21 +08:00
|
|
|
"rdfsbase{q}\t$dst",
|
2014-02-01 16:17:56 +08:00
|
|
|
[(set GR64:$dst, (int_x86_rdfsbase_64))]>, XS;
|
2011-10-07 15:02:24 +08:00
|
|
|
def RDGSBASE : I<0xAE, MRM1r, (outs GR32:$dst), (ins),
|
2011-10-31 03:57:21 +08:00
|
|
|
"rdgsbase{l}\t$dst",
|
2014-02-01 16:17:56 +08:00
|
|
|
[(set GR32:$dst, (int_x86_rdgsbase_32))]>, XS;
|
2011-10-07 15:02:24 +08:00
|
|
|
def RDGSBASE64 : RI<0xAE, MRM1r, (outs GR64:$dst), (ins),
|
2011-10-31 03:57:21 +08:00
|
|
|
"rdgsbase{q}\t$dst",
|
2014-02-01 16:17:56 +08:00
|
|
|
[(set GR64:$dst, (int_x86_rdgsbase_64))]>, XS;
|
2011-10-31 03:57:21 +08:00
|
|
|
def WRFSBASE : I<0xAE, MRM2r, (outs), (ins GR32:$src),
|
|
|
|
"wrfsbase{l}\t$src",
|
2014-02-01 16:17:56 +08:00
|
|
|
[(int_x86_wrfsbase_32 GR32:$src)]>, XS;
|
2011-10-31 03:57:21 +08:00
|
|
|
def WRFSBASE64 : RI<0xAE, MRM2r, (outs), (ins GR64:$src),
|
|
|
|
"wrfsbase{q}\t$src",
|
2014-02-01 16:17:56 +08:00
|
|
|
[(int_x86_wrfsbase_64 GR64:$src)]>, XS;
|
2011-10-31 03:57:21 +08:00
|
|
|
def WRGSBASE : I<0xAE, MRM3r, (outs), (ins GR32:$src),
|
|
|
|
"wrgsbase{l}\t$src",
|
2014-02-01 16:17:56 +08:00
|
|
|
[(int_x86_wrgsbase_32 GR32:$src)]>, XS;
|
2011-10-31 03:57:21 +08:00
|
|
|
def WRGSBASE64 : RI<0xAE, MRM3r, (outs), (ins GR64:$src),
|
|
|
|
"wrgsbase{q}\t$src",
|
2014-02-01 16:17:56 +08:00
|
|
|
[(int_x86_wrgsbase_64 GR64:$src)]>, XS;
|
2011-10-07 15:02:24 +08:00
|
|
|
}
|
2011-10-16 15:05:40 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// INVPCID Instruction
|
|
|
|
def INVPCID32 : I<0x82, MRMSrcMem, (outs), (ins GR32:$src1, i128mem:$src2),
|
2014-01-14 15:41:20 +08:00
|
|
|
"invpcid\t{$src2, $src1|$src1, $src2}", []>, T8PD,
|
2013-12-20 10:04:49 +08:00
|
|
|
Requires<[Not64BitMode]>;
|
2011-10-16 15:05:40 +08:00
|
|
|
def INVPCID64 : I<0x82, MRMSrcMem, (outs), (ins GR64:$src1, i128mem:$src2),
|
2014-01-14 15:41:20 +08:00
|
|
|
"invpcid\t{$src2, $src1|$src1, $src2}", []>, T8PD,
|
2011-10-16 15:05:40 +08:00
|
|
|
Requires<[In64BitMode]>;
|
2013-04-11 12:52:28 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// SMAP Instruction
|
2015-02-05 16:51:02 +08:00
|
|
|
let Defs = [EFLAGS] in {
|
2013-04-11 12:52:28 +08:00
|
|
|
def CLAC : I<0x01, MRM_CA, (outs), (ins), "clac", []>, TB;
|
|
|
|
def STAC : I<0x01, MRM_CB, (outs), (ins), "stac", []>, TB;
|
|
|
|
}
|
2015-02-08 07:36:36 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// SMX Instruction
|
|
|
|
let Uses = [RAX, RBX, RCX, RDX], Defs = [RAX, RBX, RCX] in {
|
|
|
|
def GETSEC : I<0x37, RawFrm, (outs), (ins), "getsec", []>, TB;
|
|
|
|
}
|
2017-10-23 23:53:16 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// RDPID Instruction
|
|
|
|
def RDPID32 : I<0xC7, MRM7r, (outs GR32:$src), (ins),
|
|
|
|
"rdpid\t$src", []>, XS,
|
|
|
|
Requires<[Not64BitMode]>;
|
|
|
|
def RDPID64 : I<0xC7, MRM7r, (outs GR64:$src), (ins),
|
|
|
|
"rdpid\t$src", []>, XS,
|
|
|
|
Requires<[In64BitMode]>;
|
2017-10-23 23:53:21 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// PTWRITE Instruction
|
|
|
|
def PTWRITEm: I<0xAE, MRM4m, (outs), (ins i32mem:$dst),
|
|
|
|
"ptwrite{l}\t$dst", []>, XS;
|
|
|
|
def PTWRITE64m : RI<0xAE, MRM4m, (outs), (ins i64mem:$dst),
|
|
|
|
"ptwrite{q}\t$dst", []>, XS, Requires<[In64BitMode]>;
|
|
|
|
|
|
|
|
def PTWRITEr : I<0xAE, MRM4r, (outs), (ins GR32:$dst),
|
|
|
|
"ptwrite{l}\t$dst", []>, XS;
|
|
|
|
def PTWRITE64r : RI<0xAE, MRM4r, (outs), (ins GR64:$dst),
|
|
|
|
"ptwrite{q}\t$dst", []>, XS, Requires<[In64BitMode]>;
|