mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-07 01:38:26 +00:00
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
This commit is contained in:
parent
36230cdda4
commit
ff60576646
@ -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…
x
Reference in New Issue
Block a user