From d58350d789762858e94703e2083054e7f9bf35a4 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Tue, 6 May 2014 12:50:47 +0000 Subject: [PATCH] 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 --- lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp b/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp index a4a48d37c04..9ba1b73986b 100644 --- a/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp +++ b/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp @@ -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(