Change the sysexit mnemonic (and sysexitl) to never have the REX.W prefix and
authorKevin Enderby <enderby@apple.com>
Thu, 27 Oct 2011 17:40:41 +0000 (17:40 +0000)
committerKevin Enderby <enderby@apple.com>
Thu, 27 Oct 2011 17:40:41 +0000 (17:40 +0000)
not depend on In32BitMode.  Use the sysexitq mnemonic for the version with the
REX.W prefix and only allow it only In64BitMode.  rdar://9738584

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143112 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.td
lib/Target/X86/X86InstrSystem.td
test/MC/X86/x86-32-coverage.s
test/MC/X86/x86-64.s
test/MC/X86/x86_errors.s

index aa35cf0f0097410f55f7b2c85ea4f5c5fdb7a138..2a85ba193f3bb898cbb69c9122b321dd9a8dc82c 100644 (file)
@@ -1573,6 +1573,7 @@ def : MnemonicAlias<"verrw", "verr">;
 // System instruction aliases.
 def : MnemonicAlias<"iret", "iretl">;
 def : MnemonicAlias<"sysret", "sysretl">;
+def : MnemonicAlias<"sysexit", "sysexitl">;
 
 def : MnemonicAlias<"lgdtl", "lgdt">, Requires<[In32BitMode]>;
 def : MnemonicAlias<"lgdtq", "lgdt">, Requires<[In64BitMode]>;
index b5651f314c30e1dc12970b5db7ad99d7b00865f4..be3500adeca8b98acb84cccfd7f8a46199b9b75e 100644 (file)
@@ -51,9 +51,8 @@ def SYSRETQ  :RI<0x07, RawFrm, (outs), (ins), "sysretq", []>, TB,
 
 def SYSENTER : I<0x34, RawFrm, (outs), (ins), "sysenter", []>, TB;
                  
-def SYSEXIT   : I<0x35, RawFrm, (outs), (ins), "sysexit", []>, TB,
-                Requires<[In32BitMode]>;
-def SYSEXIT64 :RI<0x35, RawFrm, (outs), (ins), "sysexit", []>, TB,
+def SYSEXIT   : I<0x35, RawFrm, (outs), (ins), "sysexitl", []>, TB;
+def SYSEXIT64 :RI<0x35, RawFrm, (outs), (ins), "sysexitq", []>, TB,
                 Requires<[In64BitMode]>;
 
 def IRET16 : I<0xcf, RawFrm, (outs), (ins), "iretw", []>, OpSize;
index 0954ce2b02cd99d864cf2515183c5293dc843398..577ac40e321a1b02f392fcd8d2f6fb4aedf6347d 100644 (file)
 // CHECK:      sysexit
                sysexit
 
+// CHECK:      sysexitl
+               sysexitl
+
 // CHECK:      ud2
                ud2
 
 // CHECK:  encoding: [0x0f,0x35]
                sysexit
 
+// CHECK: sysexitl
+// CHECK:  encoding: [0x0f,0x35]
+               sysexitl
+
 // CHECK: fxsave       3735928559(%ebx,%ecx,8)
 // CHECK:  encoding: [0x0f,0xae,0x84,0xcb,0xef,0xbe,0xad,0xde]
                fxsave  0xdeadbeef(%ebx,%ecx,8)
index a9cdaa495f050c836c16ef6896fa37aed07713de..6c836fca907fe1b86a203ebb2aad785d0ba07207 100644 (file)
@@ -1191,3 +1191,15 @@ xchgl %ecx, %eax
 // CHECK: xchgl %ecx, %eax
 // CHECK: encoding: [0x91]
 xchgl %eax, %ecx
+
+// CHECK: sysexit
+// CHECK: encoding: [0x0f,0x35]
+sysexit
+
+// CHECK: sysexitl
+// CHECK: encoding: [0x0f,0x35]
+sysexitl
+
+// CHECK: sysexitq
+// CHECK: encoding: [0x48,0x0f,0x35]
+sysexitq
index 054331ad81ba008e3ac1df792989c5952a57ca87..8de7444ea6c01ad595729ecc8e2fde8ee7cfee39 100644 (file)
@@ -18,3 +18,5 @@ addl $0, 0(%rax)
 
 movl 0(%rax), 0(%edx)  // error: invalid operand for instruction
 
+// 32: error: instruction requires a CPU feature not currently enabled
+sysexitq