implement the iret suite of instructions properly,

fixing rdar://8403974



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113349 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-09-08 05:38:31 +00:00
parent 2544f42692
commit ba8cea450f
5 changed files with 32 additions and 3 deletions

View File

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

View File

@ -117,7 +117,8 @@ def ADJCALLSTACKUP64 : I<0, Pseudo, (outs), (ins i32imm:$amt1, i32imm:$amt2),
}
// Interrupt Instructions
def IRET64 : RI<0xcf, RawFrm, (outs), (ins), "iret{q}", []>;
def IRET64 : RI<0xcf, RawFrm, (outs), (ins), "iretq", []>,
Requires<[In64BitMode]>;
//===----------------------------------------------------------------------===//
// Call Instructions...

View File

@ -601,8 +601,8 @@ def INT3 : I<0xcc, RawFrm, (outs), (ins), "int3",
[(int_x86_int (i8 3))]>;
def INT : Ii8<0xcd, RawFrm, (outs), (ins i8imm:$trap), "int\t$trap",
[(int_x86_int imm:$trap)]>;
def IRET16 : I<0xcf, RawFrm, (outs), (ins), "iret{w}", []>, OpSize;
def IRET32 : I<0xcf, RawFrm, (outs), (ins), "iret{l}", []>;
def IRET16 : I<0xcf, RawFrm, (outs), (ins), "iretw", []>, OpSize;
def IRET32 : I<0xcf, RawFrm, (outs), (ins), "iret{l|d}", []>;
// PIC base construction. This expands to code that looks like this:
// call $next_inst

View File

@ -434,3 +434,13 @@ L1:
// CHECK: jecxz L1
// CHECK: encoding: [0xe3,A]
// rdar://8403974
iret
// CHECK: iretl
// CHECK: encoding: [0xcf]
iretw
// CHECK: iretw
// CHECK: encoding: [0x66,0xcf]
iretl
// CHECK: iretl
// CHECK: encoding: [0xcf]

View File

@ -185,3 +185,20 @@ rep movsl
// CHECK: encoding: [0xf3]
// CHECK: movsl
// CHECK: encoding: [0xa5]
// rdar://8403974
iret
// CHECK: iretl
// CHECK: encoding: [0xcf]
iretw
// CHECK: iretw
// CHECK: encoding: [0x66,0xcf]
iretl
// CHECK: iretl
// CHECK: encoding: [0xcf]
iretq
// CHECK: iretq
// CHECK: encoding: [0x48,0xcf]