[PATCH] D24346: [x86] Accept 'retn' as an alias to 'ret[lqw]'\'ret' (At&t\Intel)
Marina Yatsina via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 28 09:01:44 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL282601: [x86] Accept 'retn' as an alias to 'ret[lqw]'\'ret' (At&t\Intel) (authored by myatsina).
Changed prior to commit:
https://reviews.llvm.org/D24346?vs=70700&id=72846#toc
Repository:
rL LLVM
https://reviews.llvm.org/D24346
Files:
llvm/trunk/lib/Target/X86/X86InstrInfo.td
llvm/trunk/test/MC/X86/ret.s
Index: llvm/trunk/test/MC/X86/ret.s
===================================================================
--- llvm/trunk/test/MC/X86/ret.s
+++ llvm/trunk/test/MC/X86/ret.s
@@ -57,6 +57,22 @@
// ERR32: error: instruction requires: 64-bit mode
// ERR16: error: instruction requires: 64-bit mode
+ retn
+// 64: retq
+// 64: encoding: [0xc3]
+// 32: retl
+// 32: encoding: [0xc3]
+// 16: retw
+// 16: encoding: [0xc3]
+
+ retn $0
+// 64: retq $0
+// 64: encoding: [0xc2,0x00,0x00]
+// 32: retl $0
+// 32: encoding: [0xc2,0x00,0x00]
+// 16: retw $0
+// 16: encoding: [0xc2,0x00,0x00]
+
lret
// 64: lretl
// 64: encoding: [0xcb]
Index: llvm/trunk/lib/Target/X86/X86InstrInfo.td
===================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td
@@ -2630,6 +2630,12 @@
def : MnemonicAlias<"ret", "retl", "att">, Requires<[In32BitMode]>;
def : MnemonicAlias<"ret", "retq", "att">, Requires<[In64BitMode]>;
+// Apply 'ret' behavior to 'retn'
+def : MnemonicAlias<"retn", "retw", "att">, Requires<[In16BitMode]>;
+def : MnemonicAlias<"retn", "retl", "att">, Requires<[In32BitMode]>;
+def : MnemonicAlias<"retn", "retq", "att">, Requires<[In64BitMode]>;
+def : MnemonicAlias<"retn", "ret", "intel">;
+
def : MnemonicAlias<"sal", "shl", "intel">;
def : MnemonicAlias<"salb", "shlb", "att">;
def : MnemonicAlias<"salw", "shlw", "att">;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24346.72846.patch
Type: text/x-patch
Size: 1430 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160928/20e0820c/attachment.bin>
More information about the llvm-commits
mailing list