aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/AsmParser/LLLexer.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2016-08-05 11:59:49 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2016-08-05 11:59:49 +0000
commitf72c663ac56e361e7b5808f64cd0c16d116db526 (patch)
tree3bed2867893cfc3931f06d7743630a1e8ee2d131 /llvm/lib/AsmParser/LLLexer.cpp
parent2b8c774ce75e3b8e168889a718f8c90776ba589a (diff)
downloadllvm-f72c663ac56e361e7b5808f64cd0c16d116db526.zip
llvm-f72c663ac56e361e7b5808f64cd0c16d116db526.tar.gz
llvm-f72c663ac56e361e7b5808f64cd0c16d116db526.tar.bz2
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
Diffstat (limited to 'llvm/lib/AsmParser/LLLexer.cpp')
-rw-r--r--llvm/lib/AsmParser/LLLexer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp
index 980ae1ec..c118ecf 100644
--- a/llvm/lib/AsmParser/LLLexer.cpp
+++ b/llvm/lib/AsmParser/LLLexer.cpp
@@ -871,7 +871,8 @@ lltok::Kind LLLexer::Lex0x() {
// HexFPConstant - Floating point constant represented in IEEE format as a
// hexadecimal number for when exponential notation is not precise enough.
// 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;
}