summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
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
commit66d0d572c295d9f7f33c70e83acf83436310fdef (patch)
treec5d5977037c167da817356fd7cb05d4371127e1e /llvm/lib/Support
parente8af69632f4acce5eb1d21b48be2391811cdff3b (diff)
downloadbcm5719-llvm-66d0d572c295d9f7f33c70e83acf83436310fdef.tar.gz
bcm5719-llvm-66d0d572c295d9f7f33c70e83acf83436310fdef.zip
Fix a bug in RoundDoubleToAPInt where it would force the size to 64 bits
instead of honoring the client's requested bit width. llvm-svn: 34712
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/APInt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index f38029ac8f2..f9656254503 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud