aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-10-31 18:43:46 +0000
committerChris Lattner <sabre@nondot.org>2010-10-31 18:43:46 +0000
commita33b93f7f162fe85dfe4fc1f16e1afb254393ab9 (patch)
tree7c8518a281526ef22f6866785132b30c68f2b63d /lib
parent4590766580ff94e3a7fa95cda7b602b23f14843e (diff)
downloadexternal_llvm-a33b93f7f162fe85dfe4fc1f16e1afb254393ab9.zip
external_llvm-a33b93f7f162fe85dfe4fc1f16e1afb254393ab9.tar.gz
external_llvm-a33b93f7f162fe85dfe4fc1f16e1afb254393ab9.tar.bz2
sketch out the planned instruction alias mechanism, add some comments about
how the push/pop mnemonic aliases are wrong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117857 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86InstrInfo.td14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td
index 3af3911..ab9869a 100644
--- a/lib/Target/X86/X86InstrInfo.td
+++ b/lib/Target/X86/X86InstrInfo.td
@@ -1258,6 +1258,17 @@ include "X86InstrCompiler.td"
// Assembler Aliases
//===----------------------------------------------------------------------===//
+// movsx aliases
+def : InstAlias<(outs GR32:$dst), (ins GR8 :$src),
+ "movsx $src, $dst",
+ (MOVSX32rr8 GR32:$dst, GR8:$src)>;
+def : InstAlias<(outs GR32:$dst), (ins GR16:$src),
+ "movsx $src, $dst",
+ (MOVSX32rr16 GR32:$dst, GR16:$src)>;
+
+
+// TODO: lidtl/lidtq can be opcode aliases, perhaps others.
+
def : MnemonicAlias<"iret", "iretl">;
def : MnemonicAlias<"sysret", "sysretl">;
def : MnemonicAlias<"cbw", "cbtw">;
@@ -1272,6 +1283,9 @@ def : MnemonicAlias<"popf", "popfl">, Requires<[In32BitMode]>;
def : MnemonicAlias<"popf", "popfq">, Requires<[In64BitMode]>;
def : MnemonicAlias<"popfd", "popfl">;
+// FIXME: This is wrong for "push reg". "push %bx" should turn into pushw in
+// all modes. However: "push (addr)" and "push $42" should default to
+// pushl/pushq depending on the current mode. Similar for "pop %bx"
def : MnemonicAlias<"push", "pushl">, Requires<[In32BitMode]>;
def : MnemonicAlias<"push", "pushq">, Requires<[In64BitMode]>;
def : MnemonicAlias<"pushf", "pushfl">, Requires<[In32BitMode]>;