LLLexer.cpp: Avoid using BitsToDouble() to preserve SNaN like "double 0x7FF4000000000000".

We should not use double (or float) in the LLVM, unless it is really needed. x87 FP register doesn't preserve SNaN to move the value.

FIXME: APFloat() may have the constructor by raw bit.
llvm-svn: 277813
This commit is contained in:
NAKAMURA Takumi 2016-08-05 11:59:49 +00:00
parent 2b8c774ce7
commit f72c663ac5
1 changed files with 2 additions and 1 deletions

View File

@ -871,7 +871,8 @@ lltok::Kind LLLexer::Lex0x() {
// HexFPConstant - Floating point constant represented in IEEE format as a // HexFPConstant - Floating point constant represented in IEEE format as a
// hexadecimal number for when exponential notation is not precise enough. // hexadecimal number for when exponential notation is not precise enough.
// Half, Float, and double only. // Half, Float, and double only.
APFloatVal = APFloat(BitsToDouble(HexIntToVal(TokStart + 2, CurPtr))); APFloatVal = APFloat(APFloat::IEEEdouble,
APInt(64, HexIntToVal(TokStart + 2, CurPtr)));
return lltok::APFloat; return lltok::APFloat;
} }