Index: llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp =================================================================== --- llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +++ llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp @@ -2283,9 +2283,9 @@ const AsmToken &Tok = Parser.getTok(); if (Tok.is(AsmToken::Real) || Tok.is(AsmToken::Integer)) { int64_t Val; - if (Tok.is(AsmToken::Integer) && !isNegative && Tok.getString().startswith("0x")) { + if (Tok.is(AsmToken::Integer) && Tok.getString().startswith("0x")) { Val = Tok.getIntVal(); - if (Val > 255 || Val < 0) { + if (Val > 255 || isNegative) { TokError("encoded floating point value out of range"); return MatchOperand_ParseFail; } Index: llvm/trunk/test/MC/AArch64/neon-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/neon-diagnostics.s +++ llvm/trunk/test/MC/AArch64/neon-diagnostics.s @@ -279,10 +279,15 @@ //---------------------------------------------------------------------- // invalid vector type (2s, 4s, 2d) fmov v0.4h, #1.0 + // invalid immediate (negative hexadecimal encoding) + fmov v0.4s, #-0x0 // CHECK:ERROR: error: invalid operand for instruction // CHECK:ERROR: fmov v0.4h, #1.0 // CHECK:ERROR: ^ +// CHECK-ERROR: error: encoded floating point value out of range +// CHECK-ERROR: fmov v0.4s, #-0x0 +// CHECK-ERROR: ^ //---------------------------------------------------------------------- // Vector Move - register