aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-10-30 17:36:36 +0000
committerChris Lattner <sabre@nondot.org>2010-10-30 17:36:36 +0000
commit674c1dcca21f5edf9f7380902971fc5471c0bd4a (patch)
treeb25b3b65baa600caf962eb7b8b666d378dfdcc40 /lib
parent905b8f76142b43cd33c36c554d359ee8740f51d5 (diff)
implement (and document!) the first kind of MC assembler alias, which
just remaps one mnemonic to another. Convert a few of the X86 aliases from .cpp to .td code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117815 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/AsmParser/X86AsmParser.cpp15
-rw-r--r--lib/Target/X86/X86InstrInfo.td23
2 files changed, 23 insertions, 15 deletions
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 4a8a63e284..0666414b51 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -632,17 +632,6 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
.Case("repe", "rep")
.Case("repz", "rep")
.Case("repnz", "repne")
- .Case("iret", "iretl")
- .Case("sysret", "sysretl")
- .Case("cbw", "cbtw")
- .Case("cwd", "cwtd")
- .Case("cdq", "cltd")
- .Case("cwde", "cwtl")
- .Case("cdqe", "cltq")
- .Case("smovb", "movsb")
- .Case("smovw", "movsw")
- .Case("smovl", "movsl")
- .Case("smovq", "movsq")
.Case("push", Is64Bit ? "pushq" : "pushl")
.Case("pop", Is64Bit ? "popq" : "popl")
.Case("pushf", Is64Bit ? "pushfq" : "pushfl")
@@ -704,14 +693,10 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
.Case("movzx", "movzb") // FIXME: Not correct.
.Case("fildq", "fildll")
.Case("fcompi", "fcomip")
- .Case("fucompi", "fucomip")
- .Case("fldcww", "fldcw")
.Case("fnstcww", "fnstcw")
.Case("fstcww", "fstcw")
.Case("fnstsww", "fnstsw")
.Case("fstsww", "fstsw")
- .Case("verrw", "verr")
- .Case("ud2a", "ud2")
.Default(Name);
// FIXME: Hack to recognize cmp<comparison code>{ss,sd,ps,pd}.
diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td
index 86e0616473..fd0caac487 100644
--- a/lib/Target/X86/X86InstrInfo.td
+++ b/lib/Target/X86/X86InstrInfo.td
@@ -1254,3 +1254,26 @@ include "X86InstrSystem.td"
// Compiler Pseudo Instructions and Pat Patterns
include "X86InstrCompiler.td"
+//===----------------------------------------------------------------------===//
+// Assembler Aliases
+//===----------------------------------------------------------------------===//
+
+def : MnemonicAlias<"iret", "iretl">;
+def : MnemonicAlias<"sysret", "sysretl">;
+def : MnemonicAlias<"cbw", "cbtw">;
+def : MnemonicAlias<"cwd", "cwtd">;
+def : MnemonicAlias<"cdq", "cltd">;
+def : MnemonicAlias<"cwde", "cwtl">;
+def : MnemonicAlias<"cdqe", "cltq">;
+def : MnemonicAlias<"smovb", "movsb">;
+def : MnemonicAlias<"smovw", "movsw">;
+def : MnemonicAlias<"smovl", "movsl">;
+def : MnemonicAlias<"smovq", "movsq">;
+
+def : MnemonicAlias<"fldcww", "fldcw">;
+def : MnemonicAlias<"fucompi", "fucomip">;
+def : MnemonicAlias<"ud2a", "ud2">;
+def : MnemonicAlias<"verrw", "verr">;
+
+
+