[llvm-branch-commits] [llvm-branch] r119195 - in /llvm/branches/Apple/whitney/lib/Target/X86: AsmParser/X86AsmParser.cpp X86InstrInfo.td
Daniel Dunbar
daniel at zuster.org
Mon Nov 15 13:43:02 PST 2010
Author: ddunbar
Date: Mon Nov 15 15:43:02 2010
New Revision: 119195
URL: http://llvm.org/viewvc/llvm-project?rev=119195&view=rev
Log:
Merge r117819:
--
Author: Chris Lattner <clattner at apple.com>
Date: Sat Oct 30 18:07:17 2010 +0000
move a bunch more aliases from .cpp -> .td file.
Modified:
llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/branches/Apple/whitney/lib/Target/X86/X86InstrInfo.td
Modified: llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=119195&r1=119194&r2=119195&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp Mon Nov 15 15:43:02 2010
@@ -636,24 +636,10 @@
.Case("pop", Is64Bit ? "popq" : "popl")
.Case("pushf", Is64Bit ? "pushfq" : "pushfl")
.Case("popf", Is64Bit ? "popfq" : "popfl")
- .Case("pushfd", "pushfl")
- .Case("popfd", "popfl")
.Case("retl", Is64Bit ? "retl" : "ret")
.Case("retq", Is64Bit ? "ret" : "retq")
- // Floating point stack cmov aliases.
- .Case("fcmovz", "fcmove")
- .Case("fcmova", "fcmovnbe")
- .Case("fcmovnae", "fcmovb")
- .Case("fcmovna", "fcmovbe")
- .Case("fcmovae", "fcmovnb")
- .Case("fwait", "wait")
.Case("movzx", "movzb") // FIXME: Not correct.
- .Case("fildq", "fildll")
.Case("fcompi", "fcomip")
- .Case("fnstcww", "fnstcw")
- .Case("fstcww", "fstcw")
- .Case("fnstsww", "fnstsw")
- .Case("fstsww", "fstsw")
.Default(Name);
// FIXME: Hack to recognize cmp<comparison code>{ss,sd,ps,pd}.
@@ -964,7 +950,7 @@
}
// The assembler accepts various amounts of brokenness for fnstsw.
- if (Name == "fnstsw") {
+ if (Name == "fnstsw" || Name == "fnstsww") {
if (Operands.size() == 2 &&
static_cast<X86Operand*>(Operands[1])->isReg()) {
// "fnstsw al" and "fnstsw eax" -> "fnstw"
@@ -1105,6 +1091,7 @@
// First, handle aliases that expand to multiple instructions.
// FIXME: This should be replaced with a real .td file alias mechanism.
if (Op->getToken() == "fstsw" || Op->getToken() == "fstcw" ||
+ Op->getToken() == "fstsww" || Op->getToken() == "fstcww" ||
Op->getToken() == "finit" || Op->getToken() == "fsave" ||
Op->getToken() == "fstenv" || Op->getToken() == "fclex") {
MCInst Inst;
@@ -1113,12 +1100,14 @@
const char *Repl =
StringSwitch<const char*>(Op->getToken())
- .Case("finit", "fninit")
- .Case("fsave", "fnsave")
- .Case("fstcw", "fnstcw")
+ .Case("finit", "fninit")
+ .Case("fsave", "fnsave")
+ .Case("fstcw", "fnstcw")
+ .Case("fstcww", "fnstcw")
.Case("fstenv", "fnstenv")
- .Case("fstsw", "fnstsw")
- .Case("fclex", "fnclex")
+ .Case("fstsw", "fnstsw")
+ .Case("fstsww", "fnstsw")
+ .Case("fclex", "fnclex")
.Default(0);
assert(Repl && "Unknown wait-prefixed instruction");
delete Operands[0];
Modified: llvm/branches/Apple/whitney/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/Target/X86/X86InstrInfo.td?rev=119195&r1=119194&r2=119195&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/branches/Apple/whitney/lib/Target/X86/X86InstrInfo.td Mon Nov 15 15:43:02 2010
@@ -1265,17 +1265,33 @@
def : MnemonicAlias<"cdq", "cltd">;
def : MnemonicAlias<"cwde", "cwtl">;
def : MnemonicAlias<"cdqe", "cltq">;
+
+def : MnemonicAlias<"pushfd", "pushfl">;
+def : MnemonicAlias<"popfd", "popfl">;
+
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">;
+// Floating point stack aliases.
+def : MnemonicAlias<"fcmovz", "fcmove">;
+def : MnemonicAlias<"fcmova", "fcmovnbe">;
+def : MnemonicAlias<"fcmovnae", "fcmovb">;
+def : MnemonicAlias<"fcmovna", "fcmovbe">;
+def : MnemonicAlias<"fcmovae", "fcmovnb">;
+def : MnemonicAlias<"fildq", "fildll">;
+def : MnemonicAlias<"fldcww", "fldcw">;
+def : MnemonicAlias<"fnstcww", "fnstcw">;
+def : MnemonicAlias<"fnstsww", "fnstsw">;
+def : MnemonicAlias<"fucompi", "fucomip">;
+def : MnemonicAlias<"fwait", "wait">;
+
+
class CondCodeAlias<string Prefix,string Suffix, string OldCond, string NewCond>
: MnemonicAlias<!strconcat(Prefix, OldCond, Suffix),
!strconcat(Prefix, NewCond, Suffix)>;
More information about the llvm-branch-commits
mailing list