AArch64/ARM64: add more specific diagnostic for floating imm 0.0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208082 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tim Northover 2014-05-06 12:50:47 +00:00
parent c5f9aff43e
commit d58350d789

View File

@ -3246,11 +3246,12 @@ bool ARM64AsmParser::parseOperand(OperandVector &Operands, bool isCondCode,
if (Tok.is(AsmToken::Real)) {
APFloat RealVal(APFloat::IEEEdouble, Tok.getString());
uint64_t IntVal = RealVal.bitcastToAPInt().getZExtValue();
if (IntVal != 0 ||
(Mnemonic != "fcmp" && Mnemonic != "fcmpe" && Mnemonic != "fcmeq" &&
Mnemonic != "fcmge" && Mnemonic != "fcmgt" && Mnemonic != "fcmle" &&
Mnemonic != "fcmlt"))
if (Mnemonic != "fcmp" && Mnemonic != "fcmpe" && Mnemonic != "fcmeq" &&
Mnemonic != "fcmge" && Mnemonic != "fcmgt" && Mnemonic != "fcmle" &&
Mnemonic != "fcmlt")
return TokError("unexpected floating point literal");
else if (IntVal != 0)
return TokError("only valid floating-point immediate is #0.0");
Parser.Lex(); // Eat the token.
Operands.push_back(