implement proper support for sysret{,l,q}, rdar://8403907
authorChris Lattner <sabre@nondot.org>
Wed, 8 Sep 2010 05:45:34 +0000 (05:45 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 8 Sep 2010 05:45:34 +0000 (05:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113350 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/AsmParser/X86AsmParser.cpp
lib/Target/X86/X86Instr64bit.td
lib/Target/X86/X86InstrInfo.td
test/MC/AsmParser/X86/x86_32-new-encoder.s
test/MC/AsmParser/X86/x86_64-new-encoder.s

index 484ffce8c6d6f4e9f3ca257f880d8bad1aaa2c2c..90bd4e3d1b5afc44939aff9a01a60554a0eb70c2 100644 (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")
index 5f6c68bf882270b491d8dc5459f54699b4d11a7a..fe12a97c77a201b6620295544b5382a0e4afebd3 100644 (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...
 //
index f50132b21706eb23d8b2f2e893eeaefff4024fff..875dfa26235510036a117cff87706fda779cf659 100644 (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,
index e99af15a1da2ddfe2922e4e4d01d4e7df4634485..ed8ee868196db08c23682caa048bc1f1001697cd 100644 (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]
index 75a424322b4bcfc74a0d6f7eb87a1efc19b97ca5..6f5f8fae1d09d621f376de91c566436b1862707a 100644 (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]