aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-28 01:30:08 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-28 01:30:08 +0000
commitff6057664636d5ce5e996bdebac1a8e6b3058504 (patch)
tree0c8a36df172b36e3005dd06220f66d7b597460d4 /lib/Support/APInt.cpp
parent36230cdda48edf6c634f2dcf69f9d78ac5a17377 (diff)
Fix a bug in RoundDoubleToAPInt where it would force the size to 64 bits
instead of honoring the client's requested bit width. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APInt.cpp')
-rw-r--r--lib/Support/APInt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index f38029ac8f..f965625450 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -808,7 +808,7 @@ APInt llvm::APIntOps::RoundDoubleToAPInt(double Double, uint32_t width) {
// If the exponent is negative, the value is < 0 so just return 0.
if (exp < 0)
- return APInt(64u, 0u);
+ return APInt(width, 0u);
// Extract the mantissa by clearing the top 12 bits (sign + exponent).
uint64_t mantissa = (T.I & (~0ULL >> 12)) | 1ULL << 52;