diff options
author | Aidan Dodds <aidan@codeplay.com> | 2015-12-10 10:11:49 +0000 |
---|---|---|
committer | Aidan Dodds <aidan@codeplay.com> | 2015-12-10 10:11:49 +0000 |
commit | 49ffb02a584c664fd4067d1e1b311dcdf63758ff (patch) | |
tree | 532b7848262dd36b8ecbe24ec6d0adc2d38d2128 /lldb/source/Core/DataExtractor.cpp | |
parent | 733e71b73b35eccd467c50baf12214d85941f0b0 (diff) | |
download | bcm5719-llvm-49ffb02a584c664fd4067d1e1b311dcdf63758ff.tar.gz bcm5719-llvm-49ffb02a584c664fd4067d1e1b311dcdf63758ff.zip |
Differential Revision: http://reviews.llvm.org/D15333
llvm-svn: 255237
Diffstat (limited to 'lldb/source/Core/DataExtractor.cpp')
-rw-r--r-- | lldb/source/Core/DataExtractor.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp index 8db48ef3186..dc7857fe9cb 100644 --- a/lldb/source/Core/DataExtractor.cpp +++ b/lldb/source/Core/DataExtractor.cpp @@ -14,6 +14,7 @@ #include <limits> #include <sstream> #include <string> +#include <math.h> #include "clang/AST/ASTContext.h" @@ -1405,24 +1406,21 @@ DumpAPInt (Stream *s, const DataExtractor &data, lldb::offset_t offset, lldb::of return offset; } -static float half2float (uint16_t half) +static float +half2float (uint16_t half) { -#ifdef _MSC_VER - llvm_unreachable("half2float not implemented for MSVC"); -#else - union{ float f; uint32_t u;}u; + union { float f; uint32_t u; } u; int32_t v = (int16_t) half; - - if( 0 == (v & 0x7c00)) + + if (0 == (v & 0x7c00)) { u.u = v & 0x80007FFFU; return u.f * ldexpf(1, 125); } - + v <<= 13; u.u = v | 0x70000000U; return u.f * ldexpf(1, -112); -#endif } lldb::offset_t |