AArch64/ARM64: add more specific diagnostic for floating imm 0.0.
authorTim Northover <tnorthover@apple.com>
Tue, 6 May 2014 12:50:47 +0000 (12:50 +0000)
committerTim Northover <tnorthover@apple.com>
Tue, 6 May 2014 12:50:47 +0000 (12:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208082 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp

index a4a48d37c04852917229b8118a97629b50684cef..9ba1b73986bcf97a8e9b1fce89d83f73b65865c6 100644 (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(