forked from OSchip/llvm-project
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
This commit is contained in:
parent
e8af69632f
commit
66d0d572c2
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue