random cleanups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113157 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-09-06 18:32:06 +00:00
parent a9eadca2fd
commit 47ab90bfa8

View File

@ -623,14 +623,14 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
if (Is64Bit) { if (Is64Bit) {
if (Name == "popfl") if (Name == "popfl")
return Error(NameLoc, "popfl cannot be encoded in 64-bit mode"); return Error(NameLoc, "popfl cannot be encoded in 64-bit mode");
else if (Name == "pushfl") if (Name == "pushfl")
return Error(NameLoc, "pushfl cannot be encoded in 64-bit mode"); return Error(NameLoc, "pushfl cannot be encoded in 64-bit mode");
else if (Name == "pusha") if (Name == "pusha")
return Error(NameLoc, "pusha cannot be encoded in 64-bit mode"); return Error(NameLoc, "pusha cannot be encoded in 64-bit mode");
} else { } else {
if (Name == "popfq") if (Name == "popfq")
return Error(NameLoc, "popfq cannot be encoded in 32-bit mode"); return Error(NameLoc, "popfq cannot be encoded in 32-bit mode");
else if (Name == "pushfq") if (Name == "pushfq")
return Error(NameLoc, "pushfq cannot be encoded in 32-bit mode"); return Error(NameLoc, "pushfq cannot be encoded in 32-bit mode");
} }
@ -778,6 +778,8 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
if (ExtraImmOp) if (ExtraImmOp)
Operands.push_back(X86Operand::CreateImm(ExtraImmOp, NameLoc, NameLoc)); Operands.push_back(X86Operand::CreateImm(ExtraImmOp, NameLoc, NameLoc));
// This does the actual operand parsing.
if (getLexer().isNot(AsmToken::EndOfStatement)) { if (getLexer().isNot(AsmToken::EndOfStatement)) {
// Parse '*' modifier. // Parse '*' modifier.
@ -807,12 +809,13 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
// FIXME: Hack to handle recognizing s{hr,ar,hl}? $1. // FIXME: Hack to handle recognizing s{hr,ar,hl}? $1.
if ((Name.startswith("shr") || Name.startswith("sar") || if ((Name.startswith("shr") || Name.startswith("sar") ||
Name.startswith("shl")) && Name.startswith("shl")) &&
Operands.size() == 3 && Operands.size() == 3) {
static_cast<X86Operand*>(Operands[1])->isImm() && X86Operand *Op1 = static_cast<X86Operand*>(Operands[1]);
isa<MCConstantExpr>(static_cast<X86Operand*>(Operands[1])->getImm()) && if (Op1->isImm() && isa<MCConstantExpr>(Op1->getImm()) &&
cast<MCConstantExpr>(static_cast<X86Operand*>(Operands[1])->getImm())->getValue() == 1) { cast<MCConstantExpr>(Op1->getImm())->getValue() == 1) {
delete Operands[1]; delete Operands[1];
Operands.erase(Operands.begin() + 1); Operands.erase(Operands.begin() + 1);
}
} }
// FIXME: Hack to handle "f{mul*,add*,sub*,div*} $op, st(0)" the same as // FIXME: Hack to handle "f{mul*,add*,sub*,div*} $op, st(0)" the same as