mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-05 12:31:33 +00:00
ARM assembly diagnostic caret in better position for FPImm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148459 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9363c58dc2
commit
ae69f703d5
@ -4277,6 +4277,7 @@ parseFPImm(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
|||||||
Parser.Lex();
|
Parser.Lex();
|
||||||
}
|
}
|
||||||
const AsmToken &Tok = Parser.getTok();
|
const AsmToken &Tok = Parser.getTok();
|
||||||
|
SMLoc Loc = Tok.getLoc();
|
||||||
if (Tok.is(AsmToken::Real)) {
|
if (Tok.is(AsmToken::Real)) {
|
||||||
APFloat RealVal(APFloat::IEEEdouble, Tok.getString());
|
APFloat RealVal(APFloat::IEEEdouble, Tok.getString());
|
||||||
uint64_t IntVal = RealVal.bitcastToAPInt().getZExtValue();
|
uint64_t IntVal = RealVal.bitcastToAPInt().getZExtValue();
|
||||||
@ -4285,7 +4286,7 @@ parseFPImm(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
|||||||
int Val = ARM_AM::getFP64Imm(APInt(64, IntVal));
|
int Val = ARM_AM::getFP64Imm(APInt(64, IntVal));
|
||||||
Parser.Lex(); // Eat the token.
|
Parser.Lex(); // Eat the token.
|
||||||
if (Val == -1) {
|
if (Val == -1) {
|
||||||
TokError("floating point value out of range");
|
Error(Loc, "floating point value out of range");
|
||||||
return MatchOperand_ParseFail;
|
return MatchOperand_ParseFail;
|
||||||
}
|
}
|
||||||
Operands.push_back(ARMOperand::CreateFPImm(Val, S, getContext()));
|
Operands.push_back(ARMOperand::CreateFPImm(Val, S, getContext()));
|
||||||
@ -4295,14 +4296,14 @@ parseFPImm(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
|||||||
int64_t Val = Tok.getIntVal();
|
int64_t Val = Tok.getIntVal();
|
||||||
Parser.Lex(); // Eat the token.
|
Parser.Lex(); // Eat the token.
|
||||||
if (Val > 255 || Val < 0) {
|
if (Val > 255 || Val < 0) {
|
||||||
TokError("encoded floating point value out of range");
|
Error(Loc, "encoded floating point value out of range");
|
||||||
return MatchOperand_ParseFail;
|
return MatchOperand_ParseFail;
|
||||||
}
|
}
|
||||||
Operands.push_back(ARMOperand::CreateFPImm(Val, S, getContext()));
|
Operands.push_back(ARMOperand::CreateFPImm(Val, S, getContext()));
|
||||||
return MatchOperand_Success;
|
return MatchOperand_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
TokError("invalid floating point immediate");
|
Error(Loc, "invalid floating point immediate");
|
||||||
return MatchOperand_ParseFail;
|
return MatchOperand_ParseFail;
|
||||||
}
|
}
|
||||||
/// Parse a arm instruction operand. For now this parses the operand regardless
|
/// Parse a arm instruction operand. For now this parses the operand regardless
|
||||||
|
Loading…
Reference in New Issue
Block a user