Skip to content

Commit 49e6a0d

Browse files
committed
Change the sysexit mnemonic (and sysexitl) to never have the REX.W prefix and
not depend on In32BitMode. Use the sysexitq mnemonic for the version with the REX.W prefix and only allow it only In64BitMode. rdar://9738584 llvm-svn: 143112
1 parent 11d6114 commit 49e6a0d

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

llvm/lib/Target/X86/X86InstrInfo.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,7 @@ def : MnemonicAlias<"verrw", "verr">;
15731573
// System instruction aliases.
15741574
def : MnemonicAlias<"iret", "iretl">;
15751575
def : MnemonicAlias<"sysret", "sysretl">;
1576+
def : MnemonicAlias<"sysexit", "sysexitl">;
15761577

15771578
def : MnemonicAlias<"lgdtl", "lgdt">, Requires<[In32BitMode]>;
15781579
def : MnemonicAlias<"lgdtq", "lgdt">, Requires<[In64BitMode]>;

llvm/lib/Target/X86/X86InstrSystem.td

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ def SYSRETQ :RI<0x07, RawFrm, (outs), (ins), "sysretq", []>, TB,
5151

5252
def SYSENTER : I<0x34, RawFrm, (outs), (ins), "sysenter", []>, TB;
5353

54-
def SYSEXIT : I<0x35, RawFrm, (outs), (ins), "sysexit", []>, TB,
55-
Requires<[In32BitMode]>;
56-
def SYSEXIT64 :RI<0x35, RawFrm, (outs), (ins), "sysexit", []>, TB,
54+
def SYSEXIT : I<0x35, RawFrm, (outs), (ins), "sysexitl", []>, TB;
55+
def SYSEXIT64 :RI<0x35, RawFrm, (outs), (ins), "sysexitq", []>, TB,
5756
Requires<[In64BitMode]>;
5857

5958
def IRET16 : I<0xcf, RawFrm, (outs), (ins), "iretw", []>, OpSize;

llvm/test/MC/X86/x86-32-coverage.s

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@
500500
// CHECK: sysexit
501501
sysexit
502502

503+
// CHECK: sysexitl
504+
sysexitl
505+
503506
// CHECK: ud2
504507
ud2
505508

@@ -4417,6 +4420,10 @@
44174420
// CHECK: encoding: [0x0f,0x35]
44184421
sysexit
44194422

4423+
// CHECK: sysexitl
4424+
// CHECK: encoding: [0x0f,0x35]
4425+
sysexitl
4426+
44204427
// CHECK: fxsave 3735928559(%ebx,%ecx,8)
44214428
// CHECK: encoding: [0x0f,0xae,0x84,0xcb,0xef,0xbe,0xad,0xde]
44224429
fxsave 0xdeadbeef(%ebx,%ecx,8)

llvm/test/MC/X86/x86-64.s

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,3 +1191,15 @@ xchgl %ecx, %eax
11911191
// CHECK: xchgl %ecx, %eax
11921192
// CHECK: encoding: [0x91]
11931193
xchgl %eax, %ecx
1194+
1195+
// CHECK: sysexit
1196+
// CHECK: encoding: [0x0f,0x35]
1197+
sysexit
1198+
1199+
// CHECK: sysexitl
1200+
// CHECK: encoding: [0x0f,0x35]
1201+
sysexitl
1202+
1203+
// CHECK: sysexitq
1204+
// CHECK: encoding: [0x48,0x0f,0x35]
1205+
sysexitq

llvm/test/MC/X86/x86_errors.s

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ addl $0, 0(%rax)
1818

1919
movl 0(%rax), 0(%edx) // error: invalid operand for instruction
2020

21+
// 32: error: instruction requires a CPU feature not currently enabled
22+
sysexitq

0 commit comments

Comments
 (0)