move sldt, imul, and movabsq aliases from c++ to .td file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118347 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2010-11-06 18:44:26 +00:00
parent fb7000fcbd
commit 9c1dbc69d7
2 changed files with 18 additions and 29 deletions

View File

@@ -752,15 +752,6 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
if (getLexer().is(AsmToken::EndOfStatement))
Parser.Lex(); // Consume the EndOfStatement
// Hack to allow 'movq <largeimm>, <reg>' as an alias for movabsq.
if ((Name == "movq" || Name == "mov") && Operands.size() == 3 &&
static_cast<X86Operand*>(Operands[2])->isReg() &&
static_cast<X86Operand*>(Operands[1])->isImm() &&
!static_cast<X86Operand*>(Operands[1])->isImmSExti64i32()) {
delete Operands[0];
Operands[0] = X86Operand::CreateToken("movabsq", NameLoc);
}
// FIXME: Hack to handle recognize s{hr,ar,hl} $1, <op>. Canonicalize to
// "shift <op>".
if ((Name.startswith("shr") || Name.startswith("sar") ||
@@ -858,26 +849,6 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
Operands.erase(Operands.begin() + 1);
}
// FIXME: Hack to handle "imul <imm>, B" which is an alias for "imul <imm>, B,
// B".
if (Name.startswith("imul") && Operands.size() == 3 &&
static_cast<X86Operand*>(Operands[1])->isImm() &&
static_cast<X86Operand*>(Operands.back())->isReg()) {
X86Operand *Op = static_cast<X86Operand*>(Operands.back());
Operands.push_back(X86Operand::CreateReg(Op->getReg(), Op->getStartLoc(),
Op->getEndLoc()));
}
// 'sldt <mem>' can be encoded with either sldtw or sldtq with the same
// effect (both store to a 16-bit mem). Force to sldtw to avoid ambiguity
// errors, since its encoding is the most compact.
if (Name == "sldt" && Operands.size() == 2 &&
static_cast<X86Operand*>(Operands[1])->isMem()) {
delete Operands[0];
Operands[0] = X86Operand::CreateToken("sldtw", NameLoc);
}
// The assembler accepts these instructions with no operand as a synonym for
// an instruction acting on st(1). e.g. "fxch" -> "fxch %st(1)".
if ((Name == "fxch" || Name == "fucom" || Name == "fucomp" ||