diff options
author | Chris Lattner <sabre@nondot.org> | 2010-10-05 21:09:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-10-05 21:09:45 +0000 |
commit | 508fc4708bb859391af8969614e67c84ab56c38c (patch) | |
tree | 9146e4051a3924c4643595f4bce154aefd9bd18d /lib/Target/X86/AsmParser | |
parent | 62fed8bd380b67f47bde3ff2a437db0951c7d186 (diff) |
Replace a gross hack (the MOV64ri_alt instruction) with a slightly less
gross hack (having the asmmatcher handle the alias).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115685 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/AsmParser')
-rw-r--r-- | lib/Target/X86/AsmParser/X86AsmParser.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index d9409201b4..4b0807e513 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -834,6 +834,15 @@ 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") || @@ -1139,7 +1148,6 @@ MatchAndEmitInstruction(SMLoc IDLoc, Operands[0] = X86Operand::CreateToken(Repl, IDLoc); } - bool WasOriginallyInvalidOperand = false; unsigned OrigErrorInfo; MCInst Inst; |