implement proper support for sysret{,l,q}, rdar://8403907

llvm-svn: 113350
This commit is contained in:
Chris Lattner 2010-09-08 05:45:34 +00:00
parent 063363fa80
commit a9ca7837e4
5 changed files with 25 additions and 3 deletions

View File

@ -628,6 +628,7 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
.Case("repz", "rep")
.Case("repnz", "repne")
.Case("iret", "iretl")
.Case("sysret", "sysretl")
.Case("push", Is64Bit ? "pushq" : "pushl")
.Case("pushf", Is64Bit ? "pushfq" : "pushfl")
.Case("popf", Is64Bit ? "popfq" : "popfl")

View File

@ -120,6 +120,10 @@ def ADJCALLSTACKUP64 : I<0, Pseudo, (outs), (ins i32imm:$amt1, i32imm:$amt2),
def IRET64 : RI<0xcf, RawFrm, (outs), (ins), "iretq", []>,
Requires<[In64BitMode]>;
def SYSRETQ : RI<0x07, RawFrm,
(outs), (ins), "sysretq", []>, TB, Requires<[In64BitMode]>;
//===----------------------------------------------------------------------===//
// Call Instructions...
//

View File

@ -971,8 +971,8 @@ def TRAP : I<0x0B, RawFrm, (outs), (ins), "ud2", [(trap)]>, TB;
def SYSCALL : I<0x05, RawFrm,
(outs), (ins), "syscall", []>, TB;
def SYSRET : I<0x07, RawFrm,
(outs), (ins), "sysret", []>, TB;
def SYSRETL : I<0x07, RawFrm,
(outs), (ins), "sysretl", []>, TB;
def SYSENTER : I<0x34, RawFrm,
(outs), (ins), "sysenter", []>, TB;
def SYSEXIT : I<0x35, RawFrm,

View File

@ -444,3 +444,11 @@ iretw
iretl
// CHECK: iretl
// CHECK: encoding: [0xcf]
// rdar://8403907
sysret
// CHECK: sysretl
// CHECK: encoding: [0x0f,0x07]
sysretl
// CHECK: sysretl
// CHECK: encoding: [0x0f,0x07]

View File

@ -201,4 +201,13 @@ iretq
// CHECK: iretq
// CHECK: encoding: [0x48,0xcf]
// rdar://8403907
sysret
// CHECK: sysretl
// CHECK: encoding: [0x0f,0x07]
sysretl
// CHECK: sysretl
// CHECK: encoding: [0x0f,0x07]
sysretq
// CHECK: sysretq
// CHECK: encoding: [0x48,0x0f,0x07]