mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
move a bunch more aliases from .cpp -> .td file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117819 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8cb441c9e0
commit
8b260a7644
@ -636,24 +636,10 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
|
||||
.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 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
|
||||
}
|
||||
|
||||
// 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 @@ MatchAndEmitInstruction(SMLoc IDLoc,
|
||||
// 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 @@ MatchAndEmitInstruction(SMLoc IDLoc,
|
||||
|
||||
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];
|
||||
|
@ -1265,17 +1265,33 @@ def : MnemonicAlias<"cwd", "cwtd">;
|
||||
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)>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user